|
|
@ -3082,15 +3082,15 @@ void ShxyProtocolDataProcess( int devno)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
frnb = (GeneratingRandomNumber()%101-50)/1000.0;
|
|
|
|
frnb = (GeneratingRandomNumber()%101-50)/1000.0;
|
|
|
|
pPortParam->aiValue[0].EuValue *= (1+frnb);
|
|
|
|
pPortParam->aiValue[0].EuValue *= (1+frnb);
|
|
|
|
weatherpntmsg[0].EuValue *= (1+frnb);
|
|
|
|
weatherpntmsg[AirTempNo].EuValue *= (1+frnb);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
pPortParam->aiValue[0].EuValue = fvalue*pPortParam->aiValue[0].AiParam.fFactor + pPortParam->aiValue[0].AiParam.EuValueDelta;
|
|
|
|
pPortParam->aiValue[0].EuValue = fvalue*pPortParam->aiValue[0].AiParam.fFactor + pPortParam->aiValue[0].AiParam.EuValueDelta;
|
|
|
|
weatherpntmsg[0].EuValue = fvalue*weatherpntmsg[0].AiParam.fFactor + weatherpntmsg[0].AiParam.EuValueDelta;
|
|
|
|
weatherpntmsg[AirTempNo].EuValue = fvalue*weatherpntmsg[AirTempNo].AiParam.fFactor + weatherpntmsg[AirTempNo].AiParam.EuValueDelta;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pPortParam->aiValue[0].AiState = 1;
|
|
|
|
pPortParam->aiValue[0].AiState = 1;
|
|
|
|
weatherpntmsg[0].AiState = 1;
|
|
|
|
weatherpntmsg[AirTempNo].AiState = 1;
|
|
|
|
//g_SelfTest.SensorsFault |= (0x01);
|
|
|
|
//g_SelfTest.SensorsFault |= (0x01);
|
|
|
|
//if ((gDisSunRain & 0x80) == 0x80)
|
|
|
|
//if ((gDisSunRain & 0x80) == 0x80)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -3103,15 +3103,15 @@ void ShxyProtocolDataProcess( int devno)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
frnb = (GeneratingRandomNumber()%41-20)/10000.0;
|
|
|
|
frnb = (GeneratingRandomNumber()%41-20)/10000.0;
|
|
|
|
pPortParam->aiValue[5].EuValue *= (1+frnb);
|
|
|
|
pPortParam->aiValue[5].EuValue *= (1+frnb);
|
|
|
|
weatherpntmsg[5].EuValue *= (1+frnb);
|
|
|
|
weatherpntmsg[AtmosNo].EuValue *= (1+frnb);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
pPortParam->aiValue[5].EuValue = fvalue*pPortParam->aiValue[5].AiParam.fFactor + pPortParam->aiValue[5].AiParam.EuValueDelta;
|
|
|
|
pPortParam->aiValue[5].EuValue = fvalue*pPortParam->aiValue[5].AiParam.fFactor + pPortParam->aiValue[5].AiParam.EuValueDelta;
|
|
|
|
weatherpntmsg[5].EuValue = fvalue*weatherpntmsg[5].AiParam.fFactor + weatherpntmsg[5].AiParam.EuValueDelta;
|
|
|
|
weatherpntmsg[AtmosNo].EuValue = fvalue*weatherpntmsg[AtmosNo].AiParam.fFactor + weatherpntmsg[AtmosNo].AiParam.EuValueDelta;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pPortParam->aiValue[5].AiState = 1;
|
|
|
|
pPortParam->aiValue[5].AiState = 1;
|
|
|
|
weatherpntmsg[5].AiState = 1;
|
|
|
|
weatherpntmsg[AtmosNo].AiState = 1;
|
|
|
|
//g_SelfTest.SensorsFault |= (0x10);
|
|
|
|
//g_SelfTest.SensorsFault |= (0x10);
|
|
|
|
//if ((gDisSunRain & 0x80) == 0x80)
|
|
|
|
//if ((gDisSunRain & 0x80) == 0x80)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -3124,15 +3124,15 @@ void ShxyProtocolDataProcess( int devno)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
frnb = (GeneratingRandomNumber()%41-20)/1000.0;
|
|
|
|
frnb = (GeneratingRandomNumber()%41-20)/1000.0;
|
|
|
|
pPortParam->aiValue[1].EuValue *= (1+frnb);
|
|
|
|
pPortParam->aiValue[1].EuValue *= (1+frnb);
|
|
|
|
weatherpntmsg[1].EuValue *= (1+frnb);
|
|
|
|
weatherpntmsg[HumidityNo].EuValue *= (1+frnb);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
pPortParam->aiValue[1].EuValue = fvalue*pPortParam->aiValue[1].AiParam.fFactor + pPortParam->aiValue[1].AiParam.EuValueDelta;
|
|
|
|
pPortParam->aiValue[1].EuValue = fvalue*pPortParam->aiValue[1].AiParam.fFactor + pPortParam->aiValue[1].AiParam.EuValueDelta;
|
|
|
|
weatherpntmsg[1].EuValue = fvalue*weatherpntmsg[1].AiParam.fFactor + weatherpntmsg[1].AiParam.EuValueDelta;
|
|
|
|
weatherpntmsg[HumidityNo].EuValue = fvalue*weatherpntmsg[HumidityNo].AiParam.fFactor + weatherpntmsg[HumidityNo].AiParam.EuValueDelta;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pPortParam->aiValue[1].AiState = 1;
|
|
|
|
pPortParam->aiValue[1].AiState = 1;
|
|
|
|
weatherpntmsg[1].AiState = 1;
|
|
|
|
weatherpntmsg[HumidityNo].AiState = 1;
|
|
|
|
//g_SelfTest.SensorsFault |= (0x02);
|
|
|
|
//g_SelfTest.SensorsFault |= (0x02);
|
|
|
|
//if ((gDisSunRain & 0x80) == 0x80)
|
|
|
|
//if ((gDisSunRain & 0x80) == 0x80)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -3149,15 +3149,15 @@ void ShxyProtocolDataProcess( int devno)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
frnb = (GeneratingRandomNumber()%41-20)/1000.0;
|
|
|
|
frnb = (GeneratingRandomNumber()%41-20)/1000.0;
|
|
|
|
pPortParam->aiValue[2].EuValue *= (1+frnb);
|
|
|
|
pPortParam->aiValue[2].EuValue *= (1+frnb);
|
|
|
|
weatherpntmsg[2].EuValue *= (1+frnb);
|
|
|
|
weatherpntmsg[WindSpeedNo].EuValue *= (1+frnb);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
pPortParam->aiValue[2].EuValue = fvalue*pPortParam->aiValue[2].AiParam.fFactor + pPortParam->aiValue[2].AiParam.EuValueDelta;
|
|
|
|
pPortParam->aiValue[2].EuValue = fvalue*pPortParam->aiValue[2].AiParam.fFactor + pPortParam->aiValue[2].AiParam.EuValueDelta;
|
|
|
|
weatherpntmsg[2].EuValue = fvalue*weatherpntmsg[2].AiParam.fFactor + weatherpntmsg[2].AiParam.EuValueDelta;
|
|
|
|
weatherpntmsg[WindSpeedNo].EuValue = fvalue*weatherpntmsg[WindSpeedNo].AiParam.fFactor + weatherpntmsg[WindSpeedNo].AiParam.EuValueDelta;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pPortParam->aiValue[2].AiState = 1;
|
|
|
|
pPortParam->aiValue[2].AiState = 1;
|
|
|
|
weatherpntmsg[2].AiState = 1;
|
|
|
|
weatherpntmsg[WindSpeedNo].AiState = 1;
|
|
|
|
//g_SelfTest.SensorsFault |= (0x04);
|
|
|
|
//g_SelfTest.SensorsFault |= (0x04);
|
|
|
|
//if ((gDisSunRain & 0x10) == 0x10)
|
|
|
|
//if ((gDisSunRain & 0x10) == 0x10)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -3174,15 +3174,15 @@ void ShxyProtocolDataProcess( int devno)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
frnb = (GeneratingRandomNumber()%41-20)/1000.0;
|
|
|
|
frnb = (GeneratingRandomNumber()%41-20)/1000.0;
|
|
|
|
pPortParam->aiValue[3].EuValue *= (1+frnb);
|
|
|
|
pPortParam->aiValue[3].EuValue *= (1+frnb);
|
|
|
|
weatherpntmsg[3].EuValue *= (1+frnb);
|
|
|
|
weatherpntmsg[WindDirectionNo].EuValue *= (1+frnb);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
pPortParam->aiValue[3].EuValue = fvalue*pPortParam->aiValue[3].AiParam.fFactor + pPortParam->aiValue[3].AiParam.EuValueDelta;
|
|
|
|
pPortParam->aiValue[3].EuValue = fvalue*pPortParam->aiValue[3].AiParam.fFactor + pPortParam->aiValue[3].AiParam.EuValueDelta;
|
|
|
|
weatherpntmsg[3].EuValue = fvalue*weatherpntmsg[3].AiParam.fFactor + weatherpntmsg[3].AiParam.EuValueDelta;
|
|
|
|
weatherpntmsg[WindDirectionNo].EuValue = fvalue*weatherpntmsg[WindDirectionNo].AiParam.fFactor + weatherpntmsg[WindDirectionNo].AiParam.EuValueDelta;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pPortParam->aiValue[3].AiState = 1;
|
|
|
|
pPortParam->aiValue[3].AiState = 1;
|
|
|
|
weatherpntmsg[3].AiState = 1;
|
|
|
|
weatherpntmsg[WindDirectionNo].AiState = 1;
|
|
|
|
//g_SelfTest.SensorsFault |= (0x08);
|
|
|
|
//g_SelfTest.SensorsFault |= (0x08);
|
|
|
|
//if ((gDisSunRain & 0x10) == 0x10)
|
|
|
|
//if ((gDisSunRain & 0x10) == 0x10)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -3522,4 +3522,13 @@ void CameraPhotoCmd(SENSOR_PARAM *sensorParam, u_char channel, int cmdidx, u_cha
|
|
|
|
GM_StartSerialCameraPhoto(1, cmdidx);
|
|
|
|
GM_StartSerialCameraPhoto(1, cmdidx);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int GetAirTempData(Data_DEF *airt)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(NULL == airt)
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
airt->EuValue = weatherpntmsg[AirTempNo].EuValue;
|
|
|
|
|
|
|
|
airt->AiState = weatherpntmsg[AirTempNo].AiState;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|