优化气体传感器数据解析和消息传递
- 使用union解析CO2/H2O数据,解决大小端问题 - 添加LINECOMMEND/LINEDATASHOW消息类型区分 - 添加WorkingState/SavingDate原子变量 - 修正气体传感器部分逻辑
This commit is contained in:
@ -86,50 +86,114 @@ int IrisSensor_Gas_P0::RecvData_Chk(/*std::string sRecv*/)
|
||||
return 0;
|
||||
}
|
||||
|
||||
union Union16 {
|
||||
short s16; // 有符号短整型 (处理正负)
|
||||
unsigned short u16; // 无符号短整型
|
||||
unsigned char b[2]; // 字节数组
|
||||
};
|
||||
// 用于处理4字节(32位)数据
|
||||
union Union32 {
|
||||
int s32; // 有符号长整型
|
||||
unsigned int u32; // 无符号长整型
|
||||
unsigned char b[4]; // 字节数组
|
||||
};
|
||||
|
||||
int IrisSensor_Gas_P0::ParseMeasuredData_Chk()
|
||||
{
|
||||
if (m_sRecv.size()!=0x1f+4)
|
||||
// 如果长度不匹配(0x1f + 4 = 35)
|
||||
if (m_sRecv.size() != 35)
|
||||
{
|
||||
qDebug() << "Err:Sensor_Gas ParseData Failed,Incorrect Data Length.Exit Code:1";
|
||||
qDebug() << "Err:Sensor_Gas ParseData Failed, Incorrect Data Length. Exit Code:1";
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char uc12, uc13, uc14, uc15, uc16,uc17,uc18,uc19,uc28,uc29,uc30,uc31,uc32, uc33;
|
||||
char aaaa[34];
|
||||
memcpy(aaaa,m_sRecv.c_str(),m_sRecv.size());
|
||||
|
||||
uc32 = m_sRecv[32];
|
||||
uc33 = m_sRecv[33];
|
||||
m_fTPTemperature = (uc32 * 256 + uc33) / 100;
|
||||
Union16 u16;
|
||||
Union32 u32;
|
||||
|
||||
uc30 = m_sRecv[30];
|
||||
uc31 = m_sRecv[31];
|
||||
m_fPB = (uc30 * 256 + uc31) / 10;
|
||||
// 1. 解析温度 (Index 32, 33) - 假设是 short (16-bit)
|
||||
// 大端转小端:高位 index[32] 放在 b[1],低位 index[33] 放在 b[0]
|
||||
u16.b[1] = static_cast<unsigned char>(m_sRecv[32]);
|
||||
u16.b[0] = static_cast<unsigned char>(m_sRecv[33]);
|
||||
m_fTPTemperature = u16.s16 / 100.0f; // 直接使用 s16 即可自动处理正负
|
||||
|
||||
uc28 = m_sRecv[28];
|
||||
uc29 = m_sRecv[29];
|
||||
m_fPB = (uc28 * 256 + uc29) / 10;
|
||||
// 2. 解析 PB (Index 30, 31)
|
||||
u16.b[1] = static_cast<unsigned char>(m_sRecv[30]);
|
||||
u16.b[0] = static_cast<unsigned char>(m_sRecv[31]);
|
||||
// 注意:你原代码里这里和下面都赋值给了 m_fPB,是否其中一个是别的变量?
|
||||
float fPB_1 = u16.s16 / 10.0f;
|
||||
|
||||
uc16 = m_sRecv[16];
|
||||
uc17 = m_sRecv[17];
|
||||
uc18 = m_sRecv[18];
|
||||
uc19 = m_sRecv[19];
|
||||
m_ulCO2 = uc16*256*256*256 + uc17*256*256 + uc18*256 + uc19;
|
||||
// 3. 解析 PB (Index 28, 29)
|
||||
u16.b[1] = static_cast<unsigned char>(m_sRecv[28]);
|
||||
u16.b[0] = static_cast<unsigned char>(m_sRecv[29]);
|
||||
m_fPB = u16.s16 / 10.0f;
|
||||
|
||||
uc12 = m_sRecv[12];
|
||||
uc13 = m_sRecv[13];
|
||||
uc14 = m_sRecv[14];
|
||||
uc15 = m_sRecv[15];
|
||||
m_ulH2O = uc12 * 256 * 256 * 256 + uc13 * 256 * 256 + uc14 * 256 + uc15;
|
||||
// 4. 解析 CO2 (Index 16-19) - 32位
|
||||
u32.b[3] = static_cast<unsigned char>(m_sRecv[16]);
|
||||
u32.b[2] = static_cast<unsigned char>(m_sRecv[17]);
|
||||
u32.b[1] = static_cast<unsigned char>(m_sRecv[18]);
|
||||
u32.b[0] = static_cast<unsigned char>(m_sRecv[19]);
|
||||
m_ulCO2 = u32.s32; // 如果 CO2 是正数,s32 和 u32 一样;如果有负数,s32 会正确解释补码
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
// 5. 解析 H2O (Index 12-15) - 32位
|
||||
u32.b[3] = static_cast<unsigned char>(m_sRecv[12]);
|
||||
u32.b[2] = static_cast<unsigned char>(m_sRecv[13]);
|
||||
u32.b[1] = static_cast<unsigned char>(m_sRecv[14]);
|
||||
u32.b[0] = static_cast<unsigned char>(m_sRecv[15]);
|
||||
m_ulH2O = u32.s32;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// int IrisSensor_Gas_P0::ParseMeasuredData_Chk()
|
||||
// {
|
||||
// if (m_sRecv.size()!=0x1f+4)
|
||||
// {
|
||||
// qDebug() << "Err:Sensor_Gas ParseData Failed,Incorrect Data Length.Exit Code:1";
|
||||
// return 1;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// unsigned char uc12, uc13, uc14, uc15, uc16,uc17,uc18,uc19,uc28,uc29,uc30,uc31,uc32, uc33;
|
||||
// char aaaa[34];
|
||||
// memcpy(aaaa,m_sRecv.c_str(),m_sRecv.size());
|
||||
//
|
||||
// uc32 = m_sRecv[32];
|
||||
// uc33 = m_sRecv[33];
|
||||
// m_fTPTemperature = (uc32 * 256 + uc33) / 100;
|
||||
//
|
||||
// uc30 = m_sRecv[30];
|
||||
// uc31 = m_sRecv[31];
|
||||
// m_fPB = (uc30 * 256 + uc31) / 10;
|
||||
//
|
||||
// uc28 = m_sRecv[28];
|
||||
// uc29 = m_sRecv[29];
|
||||
// m_fPB = (uc28 * 256 + uc29) / 10;
|
||||
//
|
||||
// uc16 = m_sRecv[16];
|
||||
// uc17 = m_sRecv[17];
|
||||
// uc18 = m_sRecv[18];
|
||||
// uc19 = m_sRecv[19];
|
||||
// m_ulCO2 = uc16*256*256*256 + uc17*256*256 + uc18*256 + uc19;
|
||||
//
|
||||
// uc12 = m_sRecv[12];
|
||||
// uc13 = m_sRecv[13];
|
||||
// uc14 = m_sRecv[14];
|
||||
// uc15 = m_sRecv[15];
|
||||
// m_ulH2O = uc12 * 256 * 256 * 256 + uc13 * 256 * 256 + uc14 * 256 + uc15;
|
||||
//
|
||||
//
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
int IrisSensor_Gas_P0::Initialize(std::string ucPortNumber)
|
||||
{
|
||||
QString qstrPortName = QString::fromStdString(ucPortNumber);
|
||||
@ -167,7 +231,7 @@ int IrisSensor_Gas_P0::GetVersion()
|
||||
return 0;
|
||||
}// 02 01 09 F4
|
||||
|
||||
int IrisSensor_Gas_P0::GetMeasuredData(unsigned long &ulCO2, unsigned long &ulH2O, float &fTPTemperature, float &fPP, float &fPB)
|
||||
int IrisSensor_Gas_P0::GetMeasuredData( double &ulCO2, double &ulH2O, float &fTPTemperature, float &fPP, float &fPB)
|
||||
{
|
||||
QByteArray qbSend;
|
||||
qbSend.append(0x02);
|
||||
@ -184,11 +248,13 @@ int IrisSensor_Gas_P0::GetMeasuredData(unsigned long &ulCO2, unsigned long &ulH2
|
||||
|
||||
ParseMeasuredData_Chk();
|
||||
|
||||
ulCO2 = m_ulCO2*1.0;
|
||||
ulH2O = m_ulH2O*1.0;
|
||||
ulCO2 = m_ulCO2*1.0/10;
|
||||
ulH2O = m_ulH2O*1.0/10;
|
||||
fTPTemperature = m_fTPTemperature;
|
||||
fPP = m_fPP;
|
||||
fPB = m_fPB;
|
||||
ulCO2=ulCO2<0?0:ulCO2;
|
||||
ulH2O=ulH2O<0?0:ulH2O;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -275,7 +341,7 @@ int IrisSensor_Gas_P0::ResetCalibration(char cChannel)
|
||||
|
||||
qbSend.append(ucChksum);
|
||||
|
||||
|
||||
SendData_Chk(qbSend.toStdString());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ private:
|
||||
|
||||
float m_fTPTemperature;
|
||||
float m_fPP, m_fPB;
|
||||
unsigned long m_ulCO2, m_ulH2O;
|
||||
long m_ulCO2, m_ulH2O;
|
||||
|
||||
unsigned int uiSoftwareVersion, uiHardwareVersion;
|
||||
public:
|
||||
@ -25,7 +25,7 @@ private:
|
||||
public:
|
||||
int Initialize(std::string ucPortNumber);
|
||||
int GetVersion();
|
||||
int GetMeasuredData(unsigned long &ulCO2, unsigned long &ulH2O,float &fTPTemperature,float &fPP, float &fPB);
|
||||
int GetMeasuredData(double &ulCO2, double &ulH2O,float &fTPTemperature,float &fPP, float &fPB);
|
||||
int ZeroCalibration_N2();
|
||||
int ZeroCalibration_Air();
|
||||
int SpanCalibration(char cChannel, unsigned int uiPPM);
|
||||
|
||||
@ -2,13 +2,18 @@
|
||||
#include "unistd.h"
|
||||
#include <cmath>
|
||||
#include "hal_uart.h"
|
||||
|
||||
#define LINECOMMEND 0
|
||||
#define LINEDATASHOW 1
|
||||
std::atomic<int> WorkingState;
|
||||
std::atomic<int> SavingDate;
|
||||
CMainAcqThread::CMainAcqThread(QObject* parent /*= nullptr*/)
|
||||
{
|
||||
m_iFlagCaptureStatus = 0;
|
||||
iFlagIsPathGenerated = false;
|
||||
|
||||
m_clsCapTimer.setTimerType(Qt::PreciseTimer);
|
||||
WorkingState = 0;
|
||||
SavingDate = 0;
|
||||
|
||||
#ifdef ZZ_FLAG_TEST
|
||||
//connect(&m_clsCapTimer, &QTimer::timeout, this, &CMainAcqThread::OnTestTimer);
|
||||
@ -52,15 +57,16 @@ int CMainAcqThread::StartUp()
|
||||
|
||||
m_ctrlVehicle.StartupPSDK_M300RTK();
|
||||
QString qstrMessage = "Initializing sensors,Please wait...";
|
||||
emit Signal_UpdateVehicleMessage(qstrMessage);
|
||||
emit Signal_UpdateVehicleMessage(qstrMessage,LINECOMMEND);
|
||||
|
||||
|
||||
int iRes = m_ctrlGasSensor.Initialize(m_struSensorPort.qstrGasSensorPort.toStdString());
|
||||
if (iRes!=0)
|
||||
{
|
||||
qstrMessage.clear();
|
||||
qstrMessage.append("Fatal Error!!! Gas sensor not connected.Please check.");
|
||||
//qstrMessage = "Fatal Error!!! Gas sensor not connected.Please check.";
|
||||
emit Signal_UpdateVehicleMessage(qstrMessage);
|
||||
qstrMessage = "Fatal Error!!! Gas sensor not connected.Please check.";
|
||||
emit Signal_UpdateVehicleMessage(qstrMessage,LINECOMMEND);
|
||||
qDebug() << qstrMessage;
|
||||
//return 1;
|
||||
}
|
||||
@ -69,28 +75,30 @@ int CMainAcqThread::StartUp()
|
||||
if (iRes != 0)
|
||||
{
|
||||
qstrMessage.append("Fatal Error!!! Wind sensor not connected.Please check.");
|
||||
//qstrMessage = "Fatal Error!!! Wind sensor not connected.Please check.";
|
||||
emit Signal_UpdateVehicleMessage(qstrMessage);
|
||||
qstrMessage = "Fatal Error!!! Wind sensor not connected.Please check.";
|
||||
emit Signal_UpdateVehicleMessage(qstrMessage,LINECOMMEND);
|
||||
qDebug() << qstrMessage;
|
||||
//return 2;
|
||||
}
|
||||
|
||||
qstrMessage.append("System ready.Waiting for signals");
|
||||
//qstrMessage = "System ready.Waiting for signals";
|
||||
emit Signal_UpdateVehicleMessage(qstrMessage);
|
||||
// qstrMessage = "System ready.Waiting for signals";
|
||||
// qstrMessage="123456789123456789123456789123456789123456789123456789123456789";
|
||||
emit Signal_UpdateVehicleMessage(qstrMessage,LINECOMMEND);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CMainAcqThread::SetupMessagePipe()
|
||||
{
|
||||
connect(&m_ctrlVehicle, &VehicleController::Signal_StartCapture, this, &CMainAcqThread::Slot_StartCapture);
|
||||
connect(&m_ctrlVehicle.m_clsWidget,&ZZ_Widget_M300RTK::SendCommand,this,&CMainAcqThread::GetCommand);
|
||||
connect(&m_ctrlVehicle.m_clsWidget,&ZZ_Widget_M300RTK::SendCommand,this,&CMainAcqThread::GetCommand,Qt::QueuedConnection);
|
||||
connect(this, &CMainAcqThread::SendCommand, &m_ctrlVehicle.m_clsWidget, &ZZ_Widget_M300RTK::BackCommand);
|
||||
connect(&m_ctrlVehicle, &VehicleController::Signal_StopCapture, this, &CMainAcqThread::Slot_StopCapture);
|
||||
|
||||
connect(this, &CMainAcqThread::Signal_UpdateVehicleMessage, &m_ctrlVehicle, &VehicleController::Signal_UpdateVehicleMessage);
|
||||
|
||||
connect(&m_clsCapTimer, &QTimer::timeout, this, &CMainAcqThread::OnTimerCapture);
|
||||
m_clsCapTimer.start(1000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -146,10 +154,21 @@ int CMainAcqThread::FormFixedWindData()
|
||||
m_fTempFixedWindVecY = m_fTempFixedWindVecY - m_struM300RTKDataFrame.stVelocity.y;
|
||||
m_fTempFixedWindVecZ = m_fTempFixedWindVecZ - m_struM300RTKDataFrame.stVelocity.z;
|
||||
|
||||
double dDotProduct = m_fTempFixedWindVecX; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
double dVectorLength = sqrt(m_fTempFixedWindVecX * m_fTempFixedWindVecX + m_fTempFixedWindVecY * m_fTempFixedWindVecY + m_fTempFixedWindVecZ * m_fTempFixedWindVecZ); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>
|
||||
double dAngleInRadians = acos(dDotProduct / dVectorLength); // <20><><EFBFBD><EFBFBD>нǵĻ<C7B5><C4BB><EFBFBD>ֵ
|
||||
double angleInDegrees = dAngleInRadians * (180.0 / M_PI); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>
|
||||
double dVectorLength = sqrt(m_fTempFixedWindVecX * m_fTempFixedWindVecX + m_fTempFixedWindVecY * m_fTempFixedWindVecY + m_fTempFixedWindVecZ * m_fTempFixedWindVecZ);
|
||||
|
||||
if (dVectorLength < 0.0001)
|
||||
{
|
||||
m_struUASDataFrame.fFixedWindDirection = 0;
|
||||
m_struUASDataFrame.fFixedWindSpeed = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
double dDotProduct = m_fTempFixedWindVecX;
|
||||
double dCosAngle = dDotProduct / dVectorLength;
|
||||
if (dCosAngle > 1.0) dCosAngle = 1.0;
|
||||
if (dCosAngle < -1.0) dCosAngle = -1.0;
|
||||
double dAngleInRadians = acos(dCosAngle);
|
||||
double angleInDegrees = dAngleInRadians * (180.0 / M_PI);
|
||||
|
||||
m_struUASDataFrame.fFixedWindDirection = angleInDegrees;
|
||||
m_struUASDataFrame.fFixedWindSpeed = dVectorLength;
|
||||
@ -188,7 +207,7 @@ void CMainAcqThread::OnTestTimer()
|
||||
|
||||
int CMainAcqThread::GetData()
|
||||
{
|
||||
unsigned long ulCO2=0, ulH2O=0;
|
||||
double ulCO2=0, ulH2O=0;
|
||||
float fGasTemp=-1,fPP=-1,fPB=-1;
|
||||
m_ctrlGasSensor.GetMeasuredData(ulCO2, ulH2O, fGasTemp, fPP, fPB);
|
||||
m_struGSDataFrame.ulCO2 = ulCO2;
|
||||
@ -207,10 +226,14 @@ int CMainAcqThread::GetData()
|
||||
m_ctrlVehicle.GetOneDataFrame(m_struM300RTKDataFrame);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
}
|
||||
|
||||
|
||||
// #define ZZ_FLAG_TEST
|
||||
|
||||
int CMainAcqThread::OnTimerCapture()
|
||||
{
|
||||
if (m_iFlagCaptureStatus >1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#ifdef ZZ_FLAG_TEST
|
||||
qDebug() << "OnTimerCapture entering time:" << QTime::currentTime();
|
||||
#endif
|
||||
@ -227,14 +250,23 @@ int CMainAcqThread::OnTimerCapture()
|
||||
QString qstrMessage;
|
||||
qstrMessage = QString("CO2: %1ppm, H20: %2ppm\r\nFixed Wind Speed: %3m/s\r\nFixed Wind Direction: %4deg").arg(m_struGSDataFrame.ulCO2).arg(m_struGSDataFrame.ulH2O)
|
||||
.arg(m_struUASDataFrame.fFixedWindSpeed).arg(m_struUASDataFrame.fFixedWindDirection);
|
||||
emit Signal_UpdateVehicleMessage(qstrMessage);
|
||||
emit Signal_UpdateVehicleMessage("CO2:"+QString::number(m_struGSDataFrame.ulCO2,'f',1)+"\t H2O:"+QString::number(m_struGSDataFrame.ulH2O,'f',1),LINEDATASHOW);
|
||||
emit Signal_UpdateVehicleMessage("WS:"+QString::number(m_struUASDataFrame.fFixedWindSpeed,'f',2)+"\t D:"+QString::number(m_struUASDataFrame.fFixedWindDirection,'f',2)+"",LINEDATASHOW+1);
|
||||
// emit Signal_UpdateVehicleMessage("PP:"+QString::number(m_struGSDataFrame.fPP,'f',2)+"\t PB:"+QString::number(m_struGSDataFrame.fPB,'f',2)+"",LINEDATASHOW+2);
|
||||
emit Signal_UpdateVehicleMessage("T:"+QString::number(m_struGSDataFrame.fTemp,'f',2)+"\t PB:"+QString::number(m_struGSDataFrame.fPB,'f',2),LINEDATASHOW+2);
|
||||
|
||||
// emit Signal_UpdateVehicleMessage(qstrMessage);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
#ifdef ZZ_FLAG_TEST
|
||||
qDebug() << m_struM300RTKDataFrame.stGPSPosition.x << m_struM300RTKDataFrame.stGPSPosition.y << m_struM300RTKDataFrame.stGPSPosition.z
|
||||
<< m_struM300RTKDataFrame.stVelocity.x << m_struM300RTKDataFrame.stVelocity.y << m_struM300RTKDataFrame.stVelocity.z;
|
||||
#endif
|
||||
if (SavingDate==1)
|
||||
{
|
||||
m_ctrlData.WriteData(m_struM300RTKDataFrame, m_struGSDataFrame, m_struUASDataFrame);
|
||||
}
|
||||
|
||||
|
||||
m_ctrlData.WriteData(m_struM300RTKDataFrame, m_struGSDataFrame, m_struUASDataFrame);
|
||||
|
||||
|
||||
#ifdef ZZ_FLAG_TEST
|
||||
@ -258,12 +290,13 @@ int CMainAcqThread::Slot_StartCapture()
|
||||
|
||||
m_ctrlData.GenerateFile();
|
||||
|
||||
m_clsCapTimer.start(1000);
|
||||
// m_clsCapTimer.start(1000);
|
||||
#ifdef ZZ_FLAG_TEST
|
||||
qDebug() << "CMainAcqThread Test Cap Started";
|
||||
#endif // ZZ_FLAG_TEST
|
||||
|
||||
|
||||
m_iFlagCaptureStatus = 1;
|
||||
SavingDate = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -275,7 +308,8 @@ int CMainAcqThread::Slot_StopCapture()
|
||||
|
||||
iFlagIsPathGenerated = false;
|
||||
|
||||
m_clsCapTimer.stop();
|
||||
SavingDate=0;
|
||||
//m_clsCapTimer.stop();
|
||||
|
||||
m_ctrlData.CloseData();
|
||||
#ifdef ZZ_FLAG_TEST
|
||||
@ -283,7 +317,7 @@ int CMainAcqThread::Slot_StopCapture()
|
||||
#endif // ZZ_FLAG_TEST
|
||||
|
||||
QString qstrMessage = QString("Capture Stopped.");
|
||||
emit Signal_UpdateVehicleMessage(qstrMessage);
|
||||
emit Signal_UpdateVehicleMessage(qstrMessage,LINECOMMEND);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -296,20 +330,26 @@ void CMainAcqThread::GetCommand(QString Worker, QString Command) {
|
||||
int waitetime=10;
|
||||
qDebug()<<"GetCommand Worker:"<<Worker<<" Command:"<<Command;
|
||||
if (Worker=="WDA") {
|
||||
m_iFlagCaptureStatus=WADCALI;
|
||||
QThread::msleep(1100);
|
||||
|
||||
//#分割字符comman
|
||||
QStringList arc=Command.split("#");
|
||||
if (arc[0]=="StartCalibrate") {
|
||||
if (arc.length()<2) {
|
||||
emit SendCommand("WDA","Finish");
|
||||
m_iFlagCaptureStatus=NORMAL;
|
||||
return;
|
||||
}
|
||||
m_ctrlWindSensor.CalibrateWDA(arc[1].toDouble());
|
||||
emit SendCommand("WDA","Finish");
|
||||
m_iFlagCaptureStatus=NORMAL;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if (Worker == "GAS") {
|
||||
m_iFlagCaptureStatus = GASGALI;
|
||||
QStringList arc = Command.split("#");
|
||||
qDebug()<<"arc is"<<arc;
|
||||
if (arc[0] == "ZeroCalibrate") {
|
||||
@ -349,7 +389,7 @@ void CMainAcqThread::GetCommand(QString Worker, QString Command) {
|
||||
|
||||
if (arc.size()<3) {
|
||||
emit SendCommand("GAS", "Finish");
|
||||
|
||||
m_iFlagCaptureStatus=NORMAL;
|
||||
return;
|
||||
}
|
||||
char cChannel=0;
|
||||
@ -360,7 +400,7 @@ void CMainAcqThread::GetCommand(QString Worker, QString Command) {
|
||||
}
|
||||
else {
|
||||
emit SendCommand("GAS", "Finish");
|
||||
|
||||
m_iFlagCaptureStatus=NORMAL;
|
||||
return;
|
||||
}
|
||||
unsigned int uiPPM=arc[2].toUInt();
|
||||
@ -376,6 +416,6 @@ void CMainAcqThread::GetCommand(QString Worker, QString Command) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
m_iFlagCaptureStatus=NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,6 +17,9 @@ using namespace ZZ_DATA_DEF::DJI;
|
||||
using namespace ZZ_DATA_DEF::CO2_GAS_SENSOR;
|
||||
using namespace ZZ_DATA_DEF::UA_SENSOR;
|
||||
using namespace ZZ_DATA_DEF::MainConfig;
|
||||
#define WADCALI 2;
|
||||
#define GASGALI 3;
|
||||
#define NORMAL 1;
|
||||
|
||||
class CMainAcqThread :public QObject
|
||||
{
|
||||
@ -28,7 +31,7 @@ public:
|
||||
private:
|
||||
QTime lastTime;
|
||||
QTimer m_clsCapTimer;
|
||||
std::atomic<int> m_WorkingState;
|
||||
|
||||
int iFlagIsPathGenerated;
|
||||
|
||||
MiscControls m_struMiscCtrls;
|
||||
@ -65,7 +68,7 @@ private:
|
||||
int RotateWindVec();
|
||||
int FormFixedWindData();
|
||||
signals:
|
||||
void Signal_UpdateVehicleMessage(QString qstrMessage);
|
||||
void Signal_UpdateVehicleMessage(QString qstrMessage,int linid);
|
||||
void SendCommand(QString Worker, QString Command);
|
||||
public slots:
|
||||
void OnTestTimer();
|
||||
|
||||
@ -117,8 +117,8 @@ namespace ZZ_DATA_DEF
|
||||
{
|
||||
// unsigned long ulCO2;
|
||||
// unsigned long ulH2O;
|
||||
float ulCO2;
|
||||
float ulH2O;
|
||||
double ulCO2;
|
||||
double ulH2O;
|
||||
float fTemp;
|
||||
float fPB;
|
||||
float fPP;
|
||||
|
||||
Reference in New Issue
Block a user