|
|
|
@ -1592,6 +1592,8 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
|
|
|
|
|
if (netCaptureResult)
|
|
|
|
|
{
|
|
|
|
|
time_t takingTime = ts;
|
|
|
|
|
if(localPhotoInfo.scheduleTime != 0)
|
|
|
|
|
takingTime = localPhotoInfo.scheduleTime;
|
|
|
|
|
if (localPhotoInfo.remedy != 0)
|
|
|
|
|
{
|
|
|
|
|
if ((takingTime - localPhotoInfo.scheduleTime) > 30)
|
|
|
|
@ -1681,11 +1683,17 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
|
|
|
|
|
}
|
|
|
|
|
else if (photoInfo.cameraType == CAM_TYPE_NET)
|
|
|
|
|
{
|
|
|
|
|
powerCtrlPtr = std::shared_ptr<PowerControl>(new NetCameraPowerCtrl(mPhotoInfo.closeDelayTime));
|
|
|
|
|
if(mPhotoInfo.scheduleTime == 0)
|
|
|
|
|
powerCtrlPtr = std::shared_ptr<PowerControl>(new NetCameraPowerCtrl(mPhotoInfo.closeDelayTime));
|
|
|
|
|
else
|
|
|
|
|
powerCtrlPtr = std::shared_ptr<PowerControl>(new NetCameraPowerCtrl(2));
|
|
|
|
|
}
|
|
|
|
|
else if (photoInfo.cameraType == CAM_TYPE_PLZ)
|
|
|
|
|
{
|
|
|
|
|
powerCtrlPtr = std::shared_ptr<PowerControl>(new PlzCameraPowerCtrl(mPhotoInfo.closeDelayTime));
|
|
|
|
|
if(mPhotoInfo.scheduleTime == 0)
|
|
|
|
|
powerCtrlPtr = std::shared_ptr<PowerControl>(new PlzCameraPowerCtrl(mPhotoInfo.closeDelayTime));
|
|
|
|
|
else
|
|
|
|
|
powerCtrlPtr = std::shared_ptr<PowerControl>(new PlzCameraPowerCtrl(2));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
res = true;
|
|
|
|
@ -1799,6 +1807,8 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
|
|
|
|
|
std::thread t([localPhotoInfo, param, pThis, path, osds, wid_serial]() mutable
|
|
|
|
|
{
|
|
|
|
|
time_t ts = time(NULL);
|
|
|
|
|
if(localPhotoInfo.scheduleTime != 0)
|
|
|
|
|
ts = localPhotoInfo.scheduleTime;
|
|
|
|
|
pThis->OpenPTZSensors(localPhotoInfo.selfTestingTime);
|
|
|
|
|
|
|
|
|
|
if (localPhotoInfo.preset != 0 && localPhotoInfo.preset != 0xFF)
|
|
|
|
@ -1813,11 +1823,9 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
|
|
|
|
|
|
|
|
|
|
if(localPhotoInfo.scheduleTime == 0) {
|
|
|
|
|
pThis->ClosePTZSensors(localPhotoInfo.closeDelayTime);
|
|
|
|
|
GpioControl::setCam3V3Enable(false, localPhotoInfo.closeDelayTime);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
pThis->ClosePTZSensors(2);
|
|
|
|
|
GpioControl::setCam3V3Enable(false, 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1867,9 +1875,6 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
|
|
|
|
|
|
|
|
|
|
std::thread t([localPhotoInfo, param, pThis, path, osds, wid_serial, powerCtrlPtr]() mutable
|
|
|
|
|
{
|
|
|
|
|
time_t ts = time(NULL);
|
|
|
|
|
pThis->OpenPTZSensors(localPhotoInfo.selfTestingTime);
|
|
|
|
|
|
|
|
|
|
if (localPhotoInfo.preset != 0 && localPhotoInfo.preset != 0xFF)
|
|
|
|
|
{
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"Recv CameraCtrl Command, action= MOVE_PRESETNO, preset = %u", localPhotoInfo.preset);
|
|
|
|
@ -3904,8 +3909,8 @@ int CPhoneDevice::GetIceData(IDevice::ICE_INFO *iceInfo, IDevice::ICE_TAIL *iceT
|
|
|
|
|
iceTail->instantaneous_winddirection = 0xff;
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO, "地址%d,风速风向传感器未启用",
|
|
|
|
|
sensorParam[num].devaddr);
|
|
|
|
|
break;
|
|
|
|
|
} else if (sensorParam[num].SensorsType == WIND_PROTOCOL &&
|
|
|
|
|
continue;
|
|
|
|
|
} else if ((sensorParam[num].SensorsType == WIND_PROTOCOL || sensorParam[num].SensorsType == MUTIWEATHER_PROTOCOL) &&
|
|
|
|
|
sensorParam[num].IsNoInsta == 1) {
|
|
|
|
|
GetWindSpeedData(&airt);
|
|
|
|
|
if (airt.AiState == 255 || airt.AiState == -1) {
|
|
|
|
@ -3973,8 +3978,8 @@ int CPhoneDevice::GetIceData(IDevice::ICE_INFO *iceInfo, IDevice::ICE_TAIL *iceT
|
|
|
|
|
iceTail->humidity = 0xff;
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO, "地址%d,温湿度传感器未启用",
|
|
|
|
|
sensorParam[num].devaddr);
|
|
|
|
|
break;
|
|
|
|
|
} else if (sensorParam[num].SensorsType == WEATHER_PROTOCOL && sensorParam[num].IsNoInsta == 1) {
|
|
|
|
|
continue;
|
|
|
|
|
} else if ((sensorParam[num].SensorsType == WEATHER_PROTOCOL || sensorParam[num].SensorsType == MUTIWEATHER_PROTOCOL) && sensorParam[num].IsNoInsta == 1) {
|
|
|
|
|
GetAirTempData(&airt);
|
|
|
|
|
if (airt.AiState == 255 || airt.AiState == -1) {
|
|
|
|
|
iceTail->air_temperature = 0xff;
|
|
|
|
@ -4073,10 +4078,10 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo, D_SENSOR_PARAM *s
|
|
|
|
|
weatherInfo->avg_winddirection_10min = 0xff;
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO, "地址%d,风速风向传感器未启用",
|
|
|
|
|
sensorParam[num].devaddr);
|
|
|
|
|
break;
|
|
|
|
|
} else if (sensorParam[num].SensorsType == WIND_PROTOCOL && sensorParam[num].IsNoInsta == 1)
|
|
|
|
|
continue;
|
|
|
|
|
} else if ((sensorParam[num].SensorsType == WIND_PROTOCOL || sensorParam[num].SensorsType == MUTIWEATHER_PROTOCOL) && sensorParam[num].IsNoInsta == 1)
|
|
|
|
|
{
|
|
|
|
|
GetWeatherData(&airt, 2);
|
|
|
|
|
GetWindSpeedData(&airt);
|
|
|
|
|
if (airt.AiState == 255 || airt.AiState == -1)
|
|
|
|
|
{
|
|
|
|
|
weatherInfo->avg_windspeed_10min = 0xff;
|
|
|
|
@ -4119,7 +4124,7 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo, D_SENSOR_PARAM *s
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GetWeatherData(&airt, 3);
|
|
|
|
|
GetWindDirectionData(&airt);
|
|
|
|
|
if (airt.AiState == 255 || airt.AiState == -1)
|
|
|
|
|
{
|
|
|
|
|
weatherInfo->avg_winddirection_10min = 0xff;
|
|
|
|
@ -4144,7 +4149,7 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo, D_SENSOR_PARAM *s
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GetWeatherData(&airt, 4);
|
|
|
|
|
GetRainfallData(&airt);
|
|
|
|
|
weatherInfo->precipitation = airt.EuValue;
|
|
|
|
|
if(airt.AiState == 255 || airt.AiState == -1)
|
|
|
|
|
{
|
|
|
|
@ -4163,7 +4168,7 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo, D_SENSOR_PARAM *s
|
|
|
|
|
weatherInfo->precipitation = weatherInfo->precipitation + sensorParam[num].offset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GetWeatherData(&airt, 5);
|
|
|
|
|
GetAtmosData(&airt);
|
|
|
|
|
weatherInfo->air_pressure = airt.EuValue;
|
|
|
|
|
if(airt.AiState == 255 || airt.AiState == -1)
|
|
|
|
|
{
|
|
|
|
@ -4181,7 +4186,7 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo, D_SENSOR_PARAM *s
|
|
|
|
|
weatherInfo->air_pressure = weatherInfo->air_pressure + sensorParam[num].offset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GetWeatherData(&airt, 6);
|
|
|
|
|
GetOpticalRadiationData(&airt);
|
|
|
|
|
weatherInfo->radiation_intensity = airt.EuValue;
|
|
|
|
|
if(airt.AiState == 255 || airt.AiState == -1)
|
|
|
|
|
{
|
|
|
|
@ -4202,6 +4207,7 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo, D_SENSOR_PARAM *s
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int num = 0; num < MAX_SERIAL_DEV_NUM; num++) {
|
|
|
|
|
if (sensorParam[num].SensorsType == WEATHER_PROTOCOL && sensorParam[num].IsNoInsta == 0)
|
|
|
|
|
{
|
|
|
|
@ -4209,11 +4215,11 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo, D_SENSOR_PARAM *s
|
|
|
|
|
weatherInfo->humidity = 0xff;
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO, "地址%d,温湿度传感器未启用",
|
|
|
|
|
sensorParam[num].devaddr);
|
|
|
|
|
break;
|
|
|
|
|
} else if (sensorParam[num].SensorsType == WEATHER_PROTOCOL &&
|
|
|
|
|
continue;
|
|
|
|
|
} else if ((sensorParam[num].SensorsType == WEATHER_PROTOCOL || sensorParam[num].SensorsType == MUTIWEATHER_PROTOCOL) &&
|
|
|
|
|
sensorParam[num].IsNoInsta == 1)
|
|
|
|
|
{
|
|
|
|
|
GetWeatherData(&airt, 0);
|
|
|
|
|
GetAirTempData(&airt);
|
|
|
|
|
if (airt.AiState == 255 || airt.AiState == -1)
|
|
|
|
|
{
|
|
|
|
|
weatherInfo->air_temperature = 0xff;
|
|
|
|
@ -4243,7 +4249,7 @@ int CPhoneDevice::GetWData(IDevice::WEATHER_INFO *weatherInfo, D_SENSOR_PARAM *s
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GetWeatherData(&airt, 1);
|
|
|
|
|
GetHumidityData(&airt);
|
|
|
|
|
if (airt.AiState == 255 || airt.AiState == -1)
|
|
|
|
|
{
|
|
|
|
|
weatherInfo->humidity = 0xff;
|
|
|
|
|