更新轨控发动机协议

This commit is contained in:
2024-07-16 17:30:15 +08:00
parent 1eb38728b2
commit 464d2765e9
4 changed files with 75 additions and 6 deletions
+9 -2
View File
@@ -27,6 +27,8 @@ StatusUI::StatusUI(QWidget *parent) :
StateGroup *statu2 = new StateGroup(id_count++,this);
StateGroup *statu3 = new StateGroup(id_count++,this);
StateGroup *statu4 = new StateGroup(id_count++,this);
//install(mode,0,"飞行模式",0,QMap<QVariant, StateWidget::state>{{"待机",StateWidget::state::gray},{"手动",StateWidget::state::orange},{"自主",StateWidget::state::green}});
@@ -118,8 +120,7 @@ StatusUI::StatusUI(QWidget *parent) :
install(state,0,"油量使用值",0,QMap<QVariant, StateWidget::state>{{"使用采集油量",StateWidget::state::orange},{"使用模型油量",StateWidget::state::green}});
install(state,0, "轨控1点火指令", 0);
install(state,0, "轨控2点火指令", 0);
@@ -282,6 +283,11 @@ StatusUI::StatusUI(QWidget *parent) :
// QMap<QVariant, StateWidget::state>{{"不复飞",StateWidget::state::green},
// {"复飞",StateWidget::state::red}});
install(statu4,0, "轨控1点火指令", 0);
install(statu4,0, "轨控1点火状态", 0);
install(statu4,0, "轨控2点火指令", 0);
install(statu4,0, "轨控2点火状态", 0);
QMap<int,StateGroup *> column;
@@ -301,6 +307,7 @@ StatusUI::StatusUI(QWidget *parent) :
column.insert(column.size(),communication);
column.insert(column.size(),statu2);
column.insert(column.size(),statu3);
column.insert(column.size(),statu4);
GroupList.insert(1,column);
+4 -2
View File
@@ -1735,8 +1735,10 @@ void Parse::run()
QByteArray data = raw.mid(214);
thruster thr;
thr.ignitionStatus1 = data[3];
thr.ignitionStatus2 = data[4];
thr.ignitionCommand1 = data[4];
thr.ignitionStatus1 = data[5];
thr.ignitionCommand2 = data[6];
thr.ignitionStatus2 = data[7];
emit thrusterInfo(thr);
}
+2
View File
@@ -169,7 +169,9 @@ public:
typedef struct
{
quint8 ignitionStatus1;
quint8 ignitionCommand1;
quint8 ignitionStatus2;
quint8 ignitionCommand2;
}thruster;
typedef struct
+60 -2
View File
@@ -2777,7 +2777,7 @@ void MainWindow::thrusterInfo(Parse::thruster info)
{
QString str;
switch(info.ignitionStatus1)
switch(info.ignitionCommand1)
{
case 0x00:
{
@@ -2800,7 +2800,7 @@ void MainWindow::thrusterInfo(Parse::thruster info)
statusui->setValue("轨控1点火指令", str);
switch(info.ignitionStatus2)
switch(info.ignitionCommand2)
{
case 0x00:
{
@@ -2823,6 +2823,64 @@ void MainWindow::thrusterInfo(Parse::thruster info)
statusui->setValue("轨控2点火指令", str);
switch(info.ignitionStatus1)
{
case 0x00:
{
str = "无操作";
break;
}
case 0x55:
{
str = "点火中";
break;
}
case 0xAA:
{
str = "点火完成";
break;
}
default:
{
str = "未知";
break;
}
}
statusui->setValue("轨控1点火状态", str);
switch(info.ignitionStatus2)
{
case 0x00:
{
str = "无操作";
break;
}
case 0x55:
{
str = "点火中";
break;
}
case 0xAA:
{
str = "点火完成";
break;
}
default:
{
str = "未知";
break;
}
}
statusui->setValue("轨控2点火状态", str);
}
void MainWindow::SSPC_Info_state(Parse::_sspc info)