串口拍照调用函数修改

hdrplus
XI.CHEN 6 months ago
parent e59497e159
commit 58b01573ad

@ -1696,11 +1696,14 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
{ {
CPhoneDevice* pThis = this; CPhoneDevice* pThis = this;
IDevice::PHOTO_INFO localPhotoInfo = mPhotoInfo; IDevice::PHOTO_INFO localPhotoInfo = mPhotoInfo;
std::thread t([localPhotoInfo, path, pThis]() mutable IDevice::SerialsPhotoParam param = { "", 0, 0 };
GetPhotoSerialsParamCb(param);
std::thread t([localPhotoInfo, param, pThis]() mutable
{ {
if (localPhotoInfo.preset != 0 && localPhotoInfo.preset != 0xFF) if (localPhotoInfo.preset != 0 && localPhotoInfo.preset != 0xFF)
{ {
//CameraPhotoCmd(time(NULL), localPhotoInfo.channel, MOVE_PRESETNO, 0, localPhotoInfo.preset); CameraPhotoCmd(time(NULL), localPhotoInfo.channel, MOVE_PRESETNO, 0, localPhotoInfo.preset, param.serfile, param.baud, param.addr);
std::this_thread::sleep_for(std::chrono::seconds(3)); std::this_thread::sleep_for(std::chrono::seconds(3));
} }
time_t ts = time(NULL); time_t ts = time(NULL);
@ -1709,7 +1712,7 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
XYLOG(XYLOG_SEVERITY_INFO, "Camera is SeltTesting, selfTestingtime = %d", localPhotoInfo.selfTestingTime); XYLOG(XYLOG_SEVERITY_INFO, "Camera is SeltTesting, selfTestingtime = %d", localPhotoInfo.selfTestingTime);
pThis->OpenPTZSensors(localPhotoInfo.selfTestingTime); pThis->OpenPTZSensors(localPhotoInfo.selfTestingTime);
} }
//CameraPhotoCmd(ts, localPhotoInfo.channel, 0, localPhotoInfo.resolution, 0); CameraPhotoCmd(ts, localPhotoInfo.channel, 0, localPhotoInfo.resolution, 0, param.serfile, param.baud, param.addr);
XYLOG(XYLOG_SEVERITY_INFO, "Taking photo over"); XYLOG(XYLOG_SEVERITY_INFO, "Taking photo over");
pThis->TakePTZPhotoCb(3, localPhotoInfo); pThis->TakePTZPhotoCb(3, localPhotoInfo);
}); });
@ -3489,32 +3492,32 @@ int CPhoneDevice::GetIceData(IDevice::ICE_INFO *iceInfo, IDevice::ICE_TAIL *iceT
if(sensorParam[num].SensorsType == RALLY_PROTOCOL) if(sensorParam[num].SensorsType == RALLY_PROTOCOL)
{ {
GetPullValue(num, &airt); GetPullValue(num, &airt);
if(airt.AiState == 2) // if(airt.AiState == 2)
{ // {
iceInfo->t_sensor_data[pullno].original_tension = airt.EuValue; iceInfo->t_sensor_data[pullno].original_tension = airt.EuValue;
XYLOG(XYLOG_SEVERITY_INFO,"地址%d, 拉力 = %f", sensorParam[num].devaddr, iceInfo->t_sensor_data[pullno].original_tension); XYLOG(XYLOG_SEVERITY_INFO,"地址%d, 采样状态 = %d, 拉力 = %f", sensorParam[num].devaddr, airt.AiState, iceInfo->t_sensor_data[pullno].original_tension);
} // }
else // else
iceInfo->t_sensor_data[pullno].original_tension = 0xff; // iceInfo->t_sensor_data[pullno].original_tension = 0xff;
pullno++; pullno++;
} else if(sensorParam[num].SensorsType == SLANT_PROTOCOL) } else if(sensorParam[num].SensorsType == SLANT_PROTOCOL)
{ {
GetAngleValue(num, &airt, 0); GetAngleValue(num, &airt, 0);
if(airt.AiState == 2) // if(airt.AiState == 2)
{ // {
iceInfo->t_sensor_data[angleno].deflection_angle = airt.EuValue; iceInfo->t_sensor_data[angleno].deflection_angle = airt.EuValue;
XYLOG(XYLOG_SEVERITY_INFO,"地址%d, x = %f", sensorParam[num].devaddr, iceInfo->t_sensor_data[angleno].deflection_angle); XYLOG(XYLOG_SEVERITY_INFO,"地址%d, 采样状态 = %d, x = %f", sensorParam[num].devaddr, airt.AiState, iceInfo->t_sensor_data[angleno].deflection_angle);
} // }
else // else
iceInfo->t_sensor_data[angleno].deflection_angle = 0xff; // iceInfo->t_sensor_data[angleno].deflection_angle = 0xff;
GetAngleValue(num, &airt, 1); GetAngleValue(num, &airt, 1);
if(airt.AiState == 2) // if(airt.AiState == 2)
{ // {
iceInfo->t_sensor_data[angleno].windage_yaw_angle = airt.EuValue; iceInfo->t_sensor_data[angleno].windage_yaw_angle = airt.EuValue;
XYLOG(XYLOG_SEVERITY_INFO,"地址%d, y = %f", sensorParam[num].devaddr, iceInfo->t_sensor_data[angleno].windage_yaw_angle); XYLOG(XYLOG_SEVERITY_INFO,"地址%d, 采样状态 = %d, y = %f", sensorParam[num].devaddr, airt.AiState, iceInfo->t_sensor_data[angleno].windage_yaw_angle);
} // }
else // else
iceInfo->t_sensor_data[angleno].windage_yaw_angle =0xff; // iceInfo->t_sensor_data[angleno].windage_yaw_angle =0xff;
angleno++; angleno++;
} }
} }

@ -297,6 +297,16 @@ protected:
return false; return false;
} }
inline bool GetPhotoSerialsParamCb(SerialsPhotoParam &param) const
{
if (m_listener != NULL)
{
return m_listener->OnPhotoSerialsParamGet(param);
}
return false;
}
void QueryPowerInfo(std::map<std::string, std::string>& powerInfo); void QueryPowerInfo(std::map<std::string, std::string>& powerInfo);
std::string QueryCpuTemperature(); std::string QueryCpuTemperature();

@ -2096,7 +2096,7 @@ void SendCmdFormPollCmdBuf(int port)
len = GM_SerialComSend(&pPortParam->PollCmd[2], pPortParam->cmdlen - 2, port); len = GM_SerialComSend(&pPortParam->PollCmd[2], pPortParam->cmdlen - 2, port);
if (len < 1) if (len < 1)
{ {
sprintf(buf, "串口%d, 发送命令失败!", port + 1); sprintf(buf, "串口%d, 发送命令失败! fd = %d", port + 1, serialport[port].fd);
DebugLog(port, buf, 'E'); DebugLog(port, buf, 'E');
} }
else else

Loading…
Cancel
Save