添加继电器状态

This commit is contained in:
2024-07-28 11:01:52 +08:00
parent f35c0a6ed3
commit 0c7f9f8121
4 changed files with 21 additions and 1 deletions
+2
View File
@@ -267,6 +267,8 @@ StatusUI::StatusUI(QWidget *parent) :
install(statu4,0, "轨控1点火状态", 0); install(statu4,0, "轨控1点火状态", 0);
install(statu4,0, "轨控2点火指令", 0); install(statu4,0, "轨控2点火指令", 0);
install(statu4,0, "轨控2点火状态", 0); install(statu4,0, "轨控2点火状态", 0);
install(statu4,0, "继电器指令反馈", 0);
+16 -1
View File
@@ -677,7 +677,7 @@ void Parse::run()
if(raw.size() >= 209)//163~208 100e_IMU if(raw.size() >= 209)//163~208 100e_IMU
{ {
QByteArray data = data.mid(163); QByteArray data = raw.mid(163);
int index = 0; int index = 0;
_100eIMU imu; _100eIMU imu;
@@ -1511,6 +1511,21 @@ void Parse::run()
thr.ignitionCommand2 = data[6]; thr.ignitionCommand2 = data[6];
thr.ignitionStatus2 = data[7]; thr.ignitionStatus2 = data[7];
quint8 t = data[8];
switch(t)
{
case 0x55:
thr.relayStatus = "继电器关";
break;
case 0xAA:
thr.relayStatus = "继电器开";
break;
default:
thr.relayStatus = "未知";
break;
}
emit thrusterInfo(thr); emit thrusterInfo(thr);
} }
+1
View File
@@ -172,6 +172,7 @@ public:
quint8 ignitionCommand1; quint8 ignitionCommand1;
quint8 ignitionStatus2; quint8 ignitionStatus2;
quint8 ignitionCommand2; quint8 ignitionCommand2;
QString relayStatus;
}thruster; }thruster;
typedef struct typedef struct
+2
View File
@@ -2853,6 +2853,8 @@ void MainWindow::thrusterInfo(Parse::thruster info)
statusui->setValue("轨控2点火状态", str); statusui->setValue("轨控2点火状态", str);
statusui->setValue("继电器指令反馈", info.relayStatus);
} }
void MainWindow::SSPC_Info_state(Parse::_sspc info) void MainWindow::SSPC_Info_state(Parse::_sspc info)