修正100e惯导相关数据信号于槽没有连接上问题

This commit is contained in:
2024-07-27 12:43:06 +08:00
parent eb6ceea368
commit c6ea300d2d
3 changed files with 19 additions and 11 deletions
+10 -7
View File
@@ -21,6 +21,9 @@ Parse::Parse(QObject *parent) : QObject(parent)
qRegisterMetaType<Parse::_vel>("Parse::_vel");
qRegisterMetaType<Parse::_pos>("Parse::_pos");
qRegisterMetaType<Parse::_100eIMU>("Parse::_100eIMU");
qRegisterMetaType<Parse::_100eIns>("Parse::_100eIns");
qRegisterMetaType<Parse::thruster>("Parse::thruster");
@@ -1068,15 +1071,15 @@ void Parse::run()
memcpy(&t, data.data() + index, 4);
index += 4;
ins.alt_baro = t * 0.1;
ins.alt_baro = t * 0.01;
memcpy(&t, data.data() + index, 4);
index += 4;
ins.alt_gps = t * 0.1;
ins.alt_gps = t * 0.01;
memcpy(&t, data.data() + index, 4);
index += 4;
ins.alt = t * 0.1;
ins.alt = t * 0.01;
memcpy(&ins.velocity_n, data.data() + index, 4);
index += 4;
@@ -1497,10 +1500,10 @@ void Parse::run()
QByteArray data = raw.mid(214);
thruster thr;
thr.ignitionCommand1 = data[3];
thr.ignitionStatus1 = data[4];
thr.ignitionCommand2 = data[5];
thr.ignitionStatus2 = data[6];
thr.ignitionCommand1 = data[4];
thr.ignitionStatus1 = data[5];
thr.ignitionCommand2 = data[6];
thr.ignitionStatus2 = data[7];
emit thrusterInfo(thr);
}
+7 -4
View File
@@ -226,6 +226,13 @@ void ToolsUI::recieveDataSlot(const int &id, const QByteArray &data)
connect(this,&ToolsUI::parseData,
parse,&Parse::parseData);
connect(parse,&Parse::SSPC_Info,
ecu,&ECU::SSPC_Info);
connect(parse,&Parse::SSPC_Info_state,
ecu,&ECU::SSPC_Info_state);
if(id == 0)
{
connect(parse, SIGNAL(variantInfo(Variant) ) , this, SIGNAL(variantInfo(Variant) ) );
@@ -302,11 +309,7 @@ void ToolsUI::recieveDataSlot(const int &id, const QByteArray &data)
connect(parse,&Parse::ECU_Info,
ecu,&ECU::ECU_Info);
connect(parse,&Parse::SSPC_Info,
ecu,&ECU::SSPC_Info);
connect(parse,&Parse::SSPC_Info_state,
ecu,&ECU::SSPC_Info_state);
// connect(parse,&Parse::vel_info,
// ins,&INS::vel);
+2
View File
@@ -223,6 +223,8 @@ int main(int argc, char *argv[])
*/
makeDir();
QApplication a(argc, argv);