|
|
|
@ -3479,6 +3479,11 @@ void CPhoneDevice::SetStaticIp(const std::string& iface, const std::string& ip,
|
|
|
|
|
|
|
|
|
|
int CPhoneDevice::GetIceData(IDevice::ICE_INFO *iceInfo, IDevice::ICE_TAIL *iceTail, SENSOR_PARAM *sensorParam)
|
|
|
|
|
{
|
|
|
|
|
m_tempData.instantaneous_windspeed = 0;
|
|
|
|
|
m_tempData.air_temperature = 0;
|
|
|
|
|
m_tempData.instantaneous_winddirection = 0;
|
|
|
|
|
m_tempData.humidity = 0;
|
|
|
|
|
|
|
|
|
|
Collect_sensor_data(); //15s
|
|
|
|
|
Data_DEF airt;
|
|
|
|
|
//++等值覆冰厚度, 综合悬挂载荷, 不均衡张力差 置0
|
|
|
|
@ -3493,45 +3498,124 @@ int CPhoneDevice::GetIceData(IDevice::ICE_INFO *iceInfo, IDevice::ICE_TAIL *iceT
|
|
|
|
|
if(sensorParam[num].SensorsType == RALLY_PROTOCOL)
|
|
|
|
|
{
|
|
|
|
|
GetPullValue(num, &airt);
|
|
|
|
|
if(airt.AiState == 2)
|
|
|
|
|
iceInfo->t_sensor_data[pullno].original_tension = airt.EuValue;
|
|
|
|
|
pullno++;
|
|
|
|
|
} else if(sensorParam[num].SensorsType == SLANT_PROTOCOL)
|
|
|
|
|
{
|
|
|
|
|
GetAngleValue(num, &airt, 0);
|
|
|
|
|
if(airt.AiState == 2)
|
|
|
|
|
iceInfo->t_sensor_data[angleno].deflection_angle = airt.EuValue;
|
|
|
|
|
GetAngleValue(num, &airt, 1);
|
|
|
|
|
if(airt.AiState == 2)
|
|
|
|
|
iceInfo->t_sensor_data[angleno].windage_yaw_angle = airt.EuValue;
|
|
|
|
|
angleno++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
std::lock_guard<std::mutex> lock(m_dataLocker);
|
|
|
|
|
GetWindSpeedData(&airt);
|
|
|
|
|
if(airt.AiState == 2)
|
|
|
|
|
{
|
|
|
|
|
iceTail->instantaneous_windspeed = airt.EuValue;
|
|
|
|
|
m_tempData.instantaneous_windspeed = iceTail->instantaneous_windspeed;
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
iceTail->instantaneous_windspeed = m_tempData.instantaneous_windspeed;
|
|
|
|
|
m_tempData.instantaneous_windspeed = 0;
|
|
|
|
|
}
|
|
|
|
|
GetWindDirectionData(&airt);
|
|
|
|
|
iceTail->instantaneous_winddirection = airt.EuValue;//需求无符号整数给出浮点数
|
|
|
|
|
if(airt.AiState == 2)
|
|
|
|
|
{
|
|
|
|
|
iceTail->instantaneous_winddirection = airt.EuValue;
|
|
|
|
|
m_tempData.instantaneous_winddirection = iceTail->instantaneous_winddirection;
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
iceTail->instantaneous_winddirection = m_tempData.instantaneous_winddirection;
|
|
|
|
|
m_tempData.instantaneous_winddirection = 0;
|
|
|
|
|
}
|
|
|
|
|
GetAirTempData(&airt);
|
|
|
|
|
if(airt.AiState == 2) {
|
|
|
|
|
iceTail->air_temperature = airt.EuValue;
|
|
|
|
|
m_tempData.air_temperature = iceTail->air_temperature;
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
iceTail->air_temperature = m_tempData.air_temperature;
|
|
|
|
|
m_tempData.air_temperature = 0;
|
|
|
|
|
}
|
|
|
|
|
GetHumidityData(&airt);
|
|
|
|
|
iceTail->humidity = airt.EuValue;//需求无符号整数给出浮点数
|
|
|
|
|
if(airt.AiState == 2)
|
|
|
|
|
{
|
|
|
|
|
iceTail->humidity = airt.EuValue;
|
|
|
|
|
m_tempData.humidity = iceTail->humidity;
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
iceTail->humidity = m_tempData.humidity;
|
|
|
|
|
m_tempData.humidity = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo)
|
|
|
|
|
{
|
|
|
|
|
m_tempData.instantaneous_windspeed = 0;
|
|
|
|
|
m_tempData.air_temperature = 0;
|
|
|
|
|
m_tempData.instantaneous_winddirection = 0;
|
|
|
|
|
m_tempData.humidity = 0;
|
|
|
|
|
|
|
|
|
|
Collect_sensor_data(); //15s
|
|
|
|
|
|
|
|
|
|
Data_DEF airt;
|
|
|
|
|
GetWeatherData(&airt, 0);
|
|
|
|
|
weatherInfo->air_temperature = airt.EuValue;
|
|
|
|
|
GetWeatherData(&airt, 1);
|
|
|
|
|
weatherInfo->humidity = airt.EuValue;
|
|
|
|
|
{
|
|
|
|
|
std::lock_guard<std::mutex> lock(m_dataLocker);
|
|
|
|
|
GetWeatherData(&airt, 2);
|
|
|
|
|
if(airt.AiState == 2)
|
|
|
|
|
{
|
|
|
|
|
weatherInfo->avg_windspeed_10min = airt.EuValue;
|
|
|
|
|
weatherInfo->extreme_windspeed = airt.EuValue;
|
|
|
|
|
weatherInfo->standard_windspeed = airt.EuValue;
|
|
|
|
|
m_tempData.instantaneous_windspeed = weatherInfo->avg_windspeed_10min;
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
weatherInfo->avg_windspeed_10min = m_tempData.instantaneous_windspeed;
|
|
|
|
|
weatherInfo->extreme_windspeed = m_tempData.instantaneous_windspeed;
|
|
|
|
|
weatherInfo->standard_windspeed = m_tempData.instantaneous_windspeed;
|
|
|
|
|
m_tempData.instantaneous_windspeed = 0;
|
|
|
|
|
}
|
|
|
|
|
GetWeatherData(&airt, 3);
|
|
|
|
|
if(airt.AiState == 2)
|
|
|
|
|
{
|
|
|
|
|
weatherInfo->avg_winddirection_10min = airt.EuValue;
|
|
|
|
|
m_tempData.instantaneous_winddirection = weatherInfo->avg_winddirection_10min;
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
weatherInfo->avg_winddirection_10min = m_tempData.instantaneous_winddirection;
|
|
|
|
|
m_tempData.instantaneous_winddirection = 0;
|
|
|
|
|
}
|
|
|
|
|
GetWeatherData(&airt, 0);
|
|
|
|
|
if(airt.AiState == 2)
|
|
|
|
|
{
|
|
|
|
|
weatherInfo->air_temperature = airt.EuValue;
|
|
|
|
|
m_tempData.air_temperature = weatherInfo->air_temperature;
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
weatherInfo->air_temperature = m_tempData.air_temperature;
|
|
|
|
|
m_tempData.air_temperature = 0;
|
|
|
|
|
}
|
|
|
|
|
GetWeatherData(&airt, 1);
|
|
|
|
|
if(airt.AiState == 2)
|
|
|
|
|
{
|
|
|
|
|
weatherInfo->humidity = airt.EuValue;
|
|
|
|
|
m_tempData.humidity = weatherInfo->humidity;
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
weatherInfo->humidity = m_tempData.humidity;
|
|
|
|
|
m_tempData.humidity = 0;
|
|
|
|
|
}
|
|
|
|
|
GetWeatherData(&airt, 4);
|
|
|
|
|
if(airt.AiState == 2)
|
|
|
|
|
weatherInfo->precipitation = airt.EuValue;
|
|
|
|
@ -3541,6 +3625,8 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo)
|
|
|
|
|
GetWeatherData(&airt, 6);
|
|
|
|
|
if(airt.AiState == 2)
|
|
|
|
|
weatherInfo->radiation_intensity = airt.EuValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|