|
|
|
@ -1316,7 +1316,7 @@ void GM_StartSerialComm()
|
|
|
|
|
srdt.ms_dev[i].FirstCmdTimeCnt = get_msec();
|
|
|
|
|
srdt.ms_dev[i].recvdatacnt = 0;
|
|
|
|
|
for(j=0; j<WEATHER_DATA_NUM; j++)
|
|
|
|
|
srdt.ms_dev[i].aiValue[j].AiState = StartSample;
|
|
|
|
|
srdt.ms_dev[i].aiValue[j].AiState = SER_STARTSAMPLE;
|
|
|
|
|
break;
|
|
|
|
|
case RALLY_PROTOCOL: /* 拉力*/
|
|
|
|
|
sprintf(szbuf, "拉力");
|
|
|
|
@ -1324,14 +1324,14 @@ void GM_StartSerialComm()
|
|
|
|
|
srdt.ms_dev[i].FirstCmdTimeCnt = get_msec();
|
|
|
|
|
srdt.ms_dev[i].recvdatacnt = 0;
|
|
|
|
|
for(j=0; j<RALLY_DATA_NUM; j++)
|
|
|
|
|
srdt.ms_dev[i].aiValue[j].AiState = StartSample;
|
|
|
|
|
srdt.ms_dev[i].aiValue[j].AiState = SER_STARTSAMPLE;
|
|
|
|
|
break;
|
|
|
|
|
case WIND_PROTOCOL: /* 风速风向*/
|
|
|
|
|
sprintf(szbuf, "风速风向");
|
|
|
|
|
srdt.ms_dev[i].IsNeedSerial = 1;
|
|
|
|
|
srdt.ms_dev[i].FirstCmdTimeCnt = get_msec();
|
|
|
|
|
for(j=0; j<WEATHER_DATA_NUM; j++)
|
|
|
|
|
srdt.ms_dev[i].aiValue[j].AiState = StartSample;
|
|
|
|
|
srdt.ms_dev[i].aiValue[j].AiState = SER_STARTSAMPLE;
|
|
|
|
|
break;
|
|
|
|
|
case SLANT_PROTOCOL: /* 倾角*/
|
|
|
|
|
sprintf(szbuf, "倾角");
|
|
|
|
@ -1339,7 +1339,7 @@ void GM_StartSerialComm()
|
|
|
|
|
srdt.ms_dev[i].FirstCmdTimeCnt = get_msec();
|
|
|
|
|
srdt.ms_dev[i].recvdatacnt = 0;
|
|
|
|
|
for(j=0; j<SLANTANGLE_DATA_NUM; j++)
|
|
|
|
|
srdt.ms_dev[i].aiValue[j].AiState = StartSample;
|
|
|
|
|
srdt.ms_dev[i].aiValue[j].AiState = SER_STARTSAMPLE;
|
|
|
|
|
break;
|
|
|
|
|
case PELCO_D_PROTOCOL: /* 摄像机协议*/
|
|
|
|
|
case PELCO_P_PROTOCOL: /* 摄像机协议*/
|
|
|
|
@ -1477,7 +1477,7 @@ void GM_StartSerialCameraPhoto(BYTE channel, int cmdidx)
|
|
|
|
|
srdt.iLastGetPhotoNo = srdt.ms_dev[i].SerialCmdidx;
|
|
|
|
|
srdt.ms_dev[i].IsNeedSerial = 1;
|
|
|
|
|
if(0 == cmdidx)
|
|
|
|
|
srdt.ms_dev[i].image.state = StartSample;
|
|
|
|
|
srdt.ms_dev[i].image.state = SER_STARTSAMPLE;
|
|
|
|
|
if((0 == cmdidx) && (srdt.presetno > 0 ))
|
|
|
|
|
{
|
|
|
|
|
srdt.ms_dev[i].SerialCmdidx = 10017;
|
|
|
|
@ -1640,17 +1640,17 @@ void GM_IsCloseSensors()
|
|
|
|
|
DebugLog(devparam[i].commid, buf, 'I');
|
|
|
|
|
for(j=0;j<MAX_DEV_VALUE_NUM; j++)
|
|
|
|
|
{
|
|
|
|
|
if(StartSample == srdt.ms_dev[i].aiValue[j].AiState)
|
|
|
|
|
srdt.ms_dev[i].aiValue[j].AiState = SampleFail;
|
|
|
|
|
else if(Sample == srdt.ms_dev[i].aiValue[j].AiState)
|
|
|
|
|
srdt.ms_dev[i].aiValue[j].AiState = SamplingSuccess;
|
|
|
|
|
if(SER_STARTSAMPLE == srdt.ms_dev[i].aiValue[j].AiState)
|
|
|
|
|
srdt.ms_dev[i].aiValue[j].AiState = SER_SAMPLEFAIL;
|
|
|
|
|
else if(SER_SAMPLE == srdt.ms_dev[i].aiValue[j].AiState)
|
|
|
|
|
srdt.ms_dev[i].aiValue[j].AiState = SAMPLINGSUCCESS;
|
|
|
|
|
}
|
|
|
|
|
for(j=0; j<WEATHER_DATA_NUM; j++)
|
|
|
|
|
{
|
|
|
|
|
if(StartSample == weatherpntmsg[j].AiState)
|
|
|
|
|
weatherpntmsg[j].AiState = SampleFail;
|
|
|
|
|
else if(Sample == weatherpntmsg[j].AiState)
|
|
|
|
|
weatherpntmsg[j].AiState = SamplingSuccess;
|
|
|
|
|
if(SER_STARTSAMPLE == weatherpntmsg[j].AiState)
|
|
|
|
|
weatherpntmsg[j].AiState = SER_SAMPLEFAIL;
|
|
|
|
|
else if(SER_SAMPLE == weatherpntmsg[j].AiState)
|
|
|
|
|
weatherpntmsg[j].AiState = SAMPLINGSUCCESS;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
@ -1659,10 +1659,10 @@ void GM_IsCloseSensors()
|
|
|
|
|
case SERIALCAMERA_PROTOCOL: /* 串口摄像机协议*/
|
|
|
|
|
if(-1 == srdt.ms_dev[i].SerialCmdidx)
|
|
|
|
|
{
|
|
|
|
|
if((StartSample == srdt.ms_dev[i].image.state) || (Sample == srdt.ms_dev[i].image.state))
|
|
|
|
|
srdt.ms_dev[i].image.state = SampleFail;
|
|
|
|
|
if((SER_STARTSAMPLE == srdt.ms_dev[i].image.state) || (SER_SAMPLE == srdt.ms_dev[i].image.state))
|
|
|
|
|
srdt.ms_dev[i].image.state = SER_SAMPLEFAIL;
|
|
|
|
|
else if(PHOTO_SAVE_SUCC == srdt.ms_dev[i].image.state)
|
|
|
|
|
srdt.ms_dev[i].image.state = SamplingSuccess;
|
|
|
|
|
srdt.ms_dev[i].image.state = SAMPLINGSUCCESS;
|
|
|
|
|
srdt.ms_dev[i].IsNeedSerial = 0;
|
|
|
|
|
sprintf(buf, "通道%d摄像机使用完毕!可以关闭摄像机电源!", devparam[i].CameraChannel);
|
|
|
|
|
DebugLog(devparam[i].commid, buf, 'I');
|
|
|
|
@ -2040,7 +2040,7 @@ void CameraPhotoPortDataProcess( int devno)
|
|
|
|
|
DebugLog(devparam[devno].commid, szbuf, 'V');
|
|
|
|
|
presetno = (int)rtumsg.MsgData[i+8];
|
|
|
|
|
pPortParam->image.presetno = presetno;
|
|
|
|
|
pPortParam->image.state = Sample;
|
|
|
|
|
pPortParam->image.state = SER_SAMPLE;
|
|
|
|
|
curserial->RevCmdFlag = 1;
|
|
|
|
|
pPortParam->SerialCmdidx = 1;
|
|
|
|
|
srdt.sendphotocmdcnt = 0;
|
|
|
|
@ -2071,7 +2071,7 @@ void CameraPhotoPortDataProcess( int devno)
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if((1 == SaveImageDataTofile(devno)) && (Sample == pPortParam->image.state))
|
|
|
|
|
if((1 == SaveImageDataTofile(devno)) && (SER_SAMPLE == pPortParam->image.state))
|
|
|
|
|
pPortParam->image.state = PHOTO_SAVE_SUCC;
|
|
|
|
|
recvend = 1;
|
|
|
|
|
}
|
|
|
|
@ -3147,7 +3147,7 @@ void ShxyProtocolDataProcess( int devno)
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
pPortParam->aiValue[0].EuValue = fvalue;
|
|
|
|
|
pPortParam->aiValue[0].AiState = Sample;
|
|
|
|
|
pPortParam->aiValue[0].AiState = SER_SAMPLE;
|
|
|
|
|
//slantpntmsg[aipnt][0].EuValue = fvalue*slantpntmsg[aipnt][0].AiParam.fFactor\
|
|
|
|
|
// +slantpntmsg[aipnt][0].AiParam.EuValueDelta;
|
|
|
|
|
//slantpntmsg[aipnt][0].AiState = 1;
|
|
|
|
@ -3176,7 +3176,7 @@ void ShxyProtocolDataProcess( int devno)
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
pPortParam->aiValue[1].EuValue = fvalue;
|
|
|
|
|
pPortParam->aiValue[1].AiState = Sample;
|
|
|
|
|
pPortParam->aiValue[1].AiState = SER_SAMPLE;
|
|
|
|
|
/*slantpntmsg[aipnt][1].EuValue = fvalue*slantpntmsg[aipnt][1].AiParam.fFactor\
|
|
|
|
|
+slantpntmsg[aipnt][1].AiParam.EuValueDelta;
|
|
|
|
|
slantpntmsg[aipnt][1].AiState = 1;*/
|
|
|
|
@ -3207,15 +3207,15 @@ void ShxyProtocolDataProcess( int devno)
|
|
|
|
|
frnb = (GeneratingRandomNumber()%101-50)/1000.0;
|
|
|
|
|
pPortParam->aiValue[AirTempNo].EuValue *= (1+frnb);
|
|
|
|
|
weatherpntmsg[AirTempNo].EuValue *= (1+frnb);
|
|
|
|
|
//weatherpntmsg[AirTempNo].AiState = Sample;
|
|
|
|
|
//weatherpntmsg[AirTempNo].AiState = SER_SAMPLE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pPortParam->aiValue[AirTempNo].EuValue = fvalue;/*pPortParam->aiValue[0].AiParam.fFactor + pPortParam->aiValue[0].AiParam.EuValueDelta;*/
|
|
|
|
|
weatherpntmsg[AirTempNo].EuValue = fvalue;/*weatherpntmsg[AirTempNo].AiParam.fFactor + weatherpntmsg[AirTempNo].AiParam.EuValueDelta;*/
|
|
|
|
|
}
|
|
|
|
|
pPortParam->aiValue[AirTempNo].AiState = Sample;
|
|
|
|
|
weatherpntmsg[AirTempNo].AiState = Sample;
|
|
|
|
|
pPortParam->aiValue[AirTempNo].AiState = SER_SAMPLE;
|
|
|
|
|
weatherpntmsg[AirTempNo].AiState = SER_SAMPLE;
|
|
|
|
|
//g_SelfTest.SensorsFault |= (0x01);
|
|
|
|
|
//if ((gDisSunRain & 0x80) == 0x80)
|
|
|
|
|
{
|
|
|
|
@ -3235,8 +3235,8 @@ void ShxyProtocolDataProcess( int devno)
|
|
|
|
|
pPortParam->aiValue[AtmosNo].EuValue = fvalue;/*pPortParam->aiValue[5].AiParam.fFactor + pPortParam->aiValue[5].AiParam.EuValueDelta;*/
|
|
|
|
|
weatherpntmsg[AtmosNo].EuValue = fvalue;/*weatherpntmsg[AtmosNo].AiParam.fFactor + weatherpntmsg[AtmosNo].AiParam.EuValueDelta;*/
|
|
|
|
|
}
|
|
|
|
|
pPortParam->aiValue[AtmosNo].AiState = Sample;
|
|
|
|
|
weatherpntmsg[AtmosNo].AiState = Sample;
|
|
|
|
|
pPortParam->aiValue[AtmosNo].AiState = SER_SAMPLE;
|
|
|
|
|
weatherpntmsg[AtmosNo].AiState = SER_SAMPLE;
|
|
|
|
|
//g_SelfTest.SensorsFault |= (0x10);
|
|
|
|
|
//if ((gDisSunRain & 0x80) == 0x80)
|
|
|
|
|
{
|
|
|
|
@ -3256,8 +3256,8 @@ void ShxyProtocolDataProcess( int devno)
|
|
|
|
|
pPortParam->aiValue[HumidityNo].EuValue = fvalue;/*pPortParam->aiValue[1].AiParam.fFactor + pPortParam->aiValue[1].AiParam.EuValueDelta;*/
|
|
|
|
|
weatherpntmsg[HumidityNo].EuValue = fvalue;/*weatherpntmsg[HumidityNo].AiParam.fFactor + weatherpntmsg[HumidityNo].AiParam.EuValueDelta;*/
|
|
|
|
|
}
|
|
|
|
|
pPortParam->aiValue[HumidityNo].AiState = Sample;
|
|
|
|
|
weatherpntmsg[HumidityNo].AiState = Sample;
|
|
|
|
|
pPortParam->aiValue[HumidityNo].AiState = SER_SAMPLE;
|
|
|
|
|
weatherpntmsg[HumidityNo].AiState = SER_SAMPLE;
|
|
|
|
|
//g_SelfTest.SensorsFault |= (0x02);
|
|
|
|
|
//if ((gDisSunRain & 0x80) == 0x80)
|
|
|
|
|
{
|
|
|
|
@ -3281,8 +3281,8 @@ void ShxyProtocolDataProcess( int devno)
|
|
|
|
|
pPortParam->aiValue[WindSpeedNo].EuValue = fvalue;/*pPortParam->aiValue[2].AiParam.fFactor + pPortParam->aiValue[2].AiParam.EuValueDelta;*/
|
|
|
|
|
weatherpntmsg[WindSpeedNo].EuValue = fvalue;/*weatherpntmsg[WindSpeedNo].AiParam.fFactor + weatherpntmsg[WindSpeedNo].AiParam.EuValueDelta;*/
|
|
|
|
|
}
|
|
|
|
|
pPortParam->aiValue[WindSpeedNo].AiState = Sample;
|
|
|
|
|
weatherpntmsg[WindSpeedNo].AiState = Sample;
|
|
|
|
|
pPortParam->aiValue[WindSpeedNo].AiState = SER_SAMPLE;
|
|
|
|
|
weatherpntmsg[WindSpeedNo].AiState = SER_SAMPLE;
|
|
|
|
|
//g_SelfTest.SensorsFault |= (0x04);
|
|
|
|
|
//if ((gDisSunRain & 0x10) == 0x10)
|
|
|
|
|
{
|
|
|
|
@ -3305,8 +3305,8 @@ void ShxyProtocolDataProcess( int devno)
|
|
|
|
|
pPortParam->aiValue[WindDirectionNo].EuValue = fvalue;/*pPortParam->aiValue[3].AiParam.fFactor + pPortParam->aiValue[3].AiParam.EuValueDelta;*/
|
|
|
|
|
weatherpntmsg[WindDirectionNo].EuValue = fvalue;/*weatherpntmsg[WindDirectionNo].AiParam.fFactor + weatherpntmsg[WindDirectionNo].AiParam.EuValueDelta;*/
|
|
|
|
|
}
|
|
|
|
|
pPortParam->aiValue[WindDirectionNo].AiState = Sample;
|
|
|
|
|
weatherpntmsg[WindDirectionNo].AiState = Sample;
|
|
|
|
|
pPortParam->aiValue[WindDirectionNo].AiState = SER_SAMPLE;
|
|
|
|
|
weatherpntmsg[WindDirectionNo].AiState = SER_SAMPLE;
|
|
|
|
|
//g_SelfTest.SensorsFault |= (0x08);
|
|
|
|
|
//if ((gDisSunRain & 0x10) == 0x10)
|
|
|
|
|
{
|
|
|
|
@ -3323,7 +3323,7 @@ void ShxyProtocolDataProcess( int devno)
|
|
|
|
|
+pPortParam->aiValue[0].AiParam.EuValueDelta;*/
|
|
|
|
|
//rallypntmsg[aipnt][0].EuValue = fvalue*rallypntmsg[aipnt][0].AiParam.fFactor\
|
|
|
|
|
// +rallypntmsg[aipnt][0].AiParam.EuValueDelta;
|
|
|
|
|
pPortParam->aiValue[0].AiState = Sample;
|
|
|
|
|
pPortParam->aiValue[0].AiState = SER_SAMPLE;
|
|
|
|
|
//rallypntmsg[aipnt][0].AiState = 1;
|
|
|
|
|
sprintf(szbuf, "地址%d拉力:%0.3fKg ", devparam[devno].devaddr, fvalue);
|
|
|
|
|
DebugLog(devparam[devno].commid, szbuf, 'V');
|
|
|
|
@ -3343,7 +3343,7 @@ void ShxyProtocolDataProcess( int devno)
|
|
|
|
|
//slantpntmsg[aipnt][0].EuValue = fvalue*slantpntmsg[aipnt][0].AiParam.fFactor\
|
|
|
|
|
//+slantpntmsg[aipnt][0].AiParam.EuValueDelta;
|
|
|
|
|
}
|
|
|
|
|
pPortParam->aiValue[0].AiState = Sample;
|
|
|
|
|
pPortParam->aiValue[0].AiState = SER_SAMPLE;
|
|
|
|
|
//slantpntmsg[aipnt][0].AiState = 1;
|
|
|
|
|
sprintf(szbuf, "倾角ID:%d slantangle X=%0.3f ", devparam[devno].devaddr, fvalue);
|
|
|
|
|
break;
|
|
|
|
@ -3361,7 +3361,7 @@ void ShxyProtocolDataProcess( int devno)
|
|
|
|
|
pPortParam->aiValue[1].EuValue = fvalue;/*pPortParam->aiValue[1].AiParam.fFactor\
|
|
|
|
|
+pPortParam->aiValue[1].AiParam.EuValueDelta;*/
|
|
|
|
|
}
|
|
|
|
|
pPortParam->aiValue[1].AiState = Sample;
|
|
|
|
|
pPortParam->aiValue[1].AiState = SER_SAMPLE;
|
|
|
|
|
//slantpntmsg[aipnt][1].AiState = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
@ -3587,9 +3587,9 @@ int GetWeatherData(Data_DEF *data, int datano)
|
|
|
|
|
return -1;
|
|
|
|
|
data->EuValue = weatherpntmsg[datano].EuValue;
|
|
|
|
|
data->AiState = weatherpntmsg[datano].AiState;
|
|
|
|
|
if((SampleFail == data->AiState) || (SamplingSuccess == data->AiState))
|
|
|
|
|
if((SER_SAMPLEFAIL == data->AiState) || (SAMPLINGSUCCESS == data->AiState))
|
|
|
|
|
{
|
|
|
|
|
weatherpntmsg[datano].AiState = Idle;
|
|
|
|
|
weatherpntmsg[datano].AiState = SER_IDLE;
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
@ -3601,9 +3601,9 @@ int GetAirTempData(Data_DEF *airt)
|
|
|
|
|
return -1;
|
|
|
|
|
airt->EuValue = weatherpntmsg[AirTempNo].EuValue;
|
|
|
|
|
airt->AiState = weatherpntmsg[AirTempNo].AiState;
|
|
|
|
|
if((SampleFail == airt->AiState) || (SamplingSuccess == airt->AiState))
|
|
|
|
|
if((SER_SAMPLEFAIL == airt->AiState) || (SAMPLINGSUCCESS == airt->AiState))
|
|
|
|
|
{
|
|
|
|
|
weatherpntmsg[AirTempNo].AiState = Idle;
|
|
|
|
|
weatherpntmsg[AirTempNo].AiState = SER_IDLE;
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
@ -3615,9 +3615,9 @@ int GetHumidityData(Data_DEF *airt)
|
|
|
|
|
return -1;
|
|
|
|
|
airt->EuValue = weatherpntmsg[HumidityNo].EuValue;
|
|
|
|
|
airt->AiState = weatherpntmsg[HumidityNo].AiState;
|
|
|
|
|
if((SampleFail == airt->AiState) || (SamplingSuccess == airt->AiState))
|
|
|
|
|
if((SER_SAMPLEFAIL == airt->AiState) || (SAMPLINGSUCCESS == airt->AiState))
|
|
|
|
|
{
|
|
|
|
|
weatherpntmsg[HumidityNo].AiState = Idle;
|
|
|
|
|
weatherpntmsg[HumidityNo].AiState = SER_IDLE;
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
@ -3629,9 +3629,9 @@ int GetWindSpeedData(Data_DEF *airt)
|
|
|
|
|
return -1;
|
|
|
|
|
airt->EuValue = weatherpntmsg[WindSpeedNo].EuValue;
|
|
|
|
|
airt->AiState = weatherpntmsg[WindSpeedNo].AiState;
|
|
|
|
|
if((SampleFail == airt->AiState) || (SamplingSuccess == airt->AiState))
|
|
|
|
|
if((SER_SAMPLEFAIL == airt->AiState) || (SAMPLINGSUCCESS == airt->AiState))
|
|
|
|
|
{
|
|
|
|
|
weatherpntmsg[WindSpeedNo].AiState = Idle;
|
|
|
|
|
weatherpntmsg[WindSpeedNo].AiState = SER_IDLE;
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
@ -3643,9 +3643,9 @@ int GetWindDirectionData(Data_DEF *airt)
|
|
|
|
|
return -1;
|
|
|
|
|
airt->EuValue = weatherpntmsg[WindDirectionNo].EuValue;
|
|
|
|
|
airt->AiState = weatherpntmsg[WindDirectionNo].AiState;
|
|
|
|
|
if((SampleFail == airt->AiState) || (SamplingSuccess == airt->AiState))
|
|
|
|
|
if((SER_SAMPLEFAIL == airt->AiState) || (SAMPLINGSUCCESS == airt->AiState))
|
|
|
|
|
{
|
|
|
|
|
weatherpntmsg[WindDirectionNo].AiState = Idle;
|
|
|
|
|
weatherpntmsg[WindDirectionNo].AiState = SER_IDLE;
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
@ -3657,9 +3657,9 @@ int GetRainfallData(Data_DEF *airt)
|
|
|
|
|
return -1;
|
|
|
|
|
airt->EuValue = weatherpntmsg[RainfallNo].EuValue;
|
|
|
|
|
airt->AiState = weatherpntmsg[RainfallNo].AiState;
|
|
|
|
|
if((SampleFail == airt->AiState) || (SamplingSuccess == airt->AiState))
|
|
|
|
|
if((SER_SAMPLEFAIL == airt->AiState) || (SAMPLINGSUCCESS == airt->AiState))
|
|
|
|
|
{
|
|
|
|
|
weatherpntmsg[RainfallNo].AiState = Idle;
|
|
|
|
|
weatherpntmsg[RainfallNo].AiState = SER_IDLE;
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
@ -3671,9 +3671,9 @@ int GetAtmosData(Data_DEF *airt)
|
|
|
|
|
return -1;
|
|
|
|
|
airt->EuValue = weatherpntmsg[AtmosNo].EuValue;
|
|
|
|
|
airt->AiState = weatherpntmsg[AtmosNo].AiState;
|
|
|
|
|
if((SampleFail == airt->AiState) || (SamplingSuccess == airt->AiState))
|
|
|
|
|
if((SER_SAMPLEFAIL == airt->AiState) || (SAMPLINGSUCCESS == airt->AiState))
|
|
|
|
|
{
|
|
|
|
|
weatherpntmsg[AtmosNo].AiState = Idle;
|
|
|
|
|
weatherpntmsg[AtmosNo].AiState = SER_IDLE;
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
@ -3685,9 +3685,9 @@ int GetOpticalRadiationData(Data_DEF *airt)
|
|
|
|
|
return -1;
|
|
|
|
|
airt->EuValue = weatherpntmsg[OpticalRadiationNo].EuValue;
|
|
|
|
|
airt->AiState = weatherpntmsg[OpticalRadiationNo].AiState;
|
|
|
|
|
if((SampleFail == airt->AiState) || (SamplingSuccess == airt->AiState))
|
|
|
|
|
if((SER_SAMPLEFAIL == airt->AiState) || (SAMPLINGSUCCESS == airt->AiState))
|
|
|
|
|
{
|
|
|
|
|
weatherpntmsg[OpticalRadiationNo].AiState = Idle;
|
|
|
|
|
weatherpntmsg[OpticalRadiationNo].AiState = SER_IDLE;
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
@ -3703,9 +3703,9 @@ int GetPullValue(int devno, Data_DEF *data)
|
|
|
|
|
return -1;
|
|
|
|
|
data->EuValue = srdt.ms_dev[devno].aiValue[0].EuValue;
|
|
|
|
|
data->AiState = srdt.ms_dev[devno].aiValue[0].AiState;
|
|
|
|
|
if((SampleFail == data->AiState) || (SamplingSuccess == data->AiState))
|
|
|
|
|
if((SER_SAMPLEFAIL == data->AiState) || (SAMPLINGSUCCESS == data->AiState))
|
|
|
|
|
{
|
|
|
|
|
srdt.ms_dev[devno].aiValue[0].AiState = Idle;
|
|
|
|
|
srdt.ms_dev[devno].aiValue[0].AiState = SER_IDLE;
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
@ -3724,9 +3724,9 @@ int GetAngleValue(int devno, Data_DEF *data, int Xy)
|
|
|
|
|
|
|
|
|
|
data->EuValue = srdt.ms_dev[devno].aiValue[Xy].EuValue;
|
|
|
|
|
data->AiState = srdt.ms_dev[devno].aiValue[Xy].AiState;
|
|
|
|
|
if((SampleFail == data->AiState) || (SamplingSuccess == data->AiState))
|
|
|
|
|
if((SER_SAMPLEFAIL == data->AiState) || (SAMPLINGSUCCESS == data->AiState))
|
|
|
|
|
{
|
|
|
|
|
srdt.ms_dev[devno].aiValue[Xy].AiState = Idle;
|
|
|
|
|
srdt.ms_dev[devno].aiValue[Xy].AiState = SER_IDLE;
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
@ -3746,9 +3746,9 @@ int GetImage(int devno, IMAGE_DEF *photo)
|
|
|
|
|
memmove(photo->photoname, srdt.ms_dev[devno].image.photoname, sizeof(photo->photoname));
|
|
|
|
|
photo->imagelen = srdt.ms_dev[devno].image.imagelen;
|
|
|
|
|
photo->state = srdt.ms_dev[devno].image.state;
|
|
|
|
|
if((SampleFail == photo->state) || (SamplingSuccess == photo->state))
|
|
|
|
|
if((SER_SAMPLEFAIL == photo->state) || (SAMPLINGSUCCESS == photo->state))
|
|
|
|
|
{
|
|
|
|
|
srdt.ms_dev[devno].image.state = Idle;
|
|
|
|
|
srdt.ms_dev[devno].image.state = SER_IDLE;
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
|