完善状态

This commit is contained in:
hm
2020-10-11 19:10:57 +08:00
parent e2622fad9f
commit 39012847c4
44 changed files with 2446 additions and 768 deletions
+133
View File
@@ -9,6 +9,67 @@ CommandBox::CommandBox(QWidget *parent) :
m_parent = parent;
ui->comboBox_Full->addItem("基准档",0);
ui->comboBox_Full->addItem("1档",1);
ui->comboBox_Full->addItem("2档",2);
ui->comboBox_Full->addItem("3档",3);
ui->comboBox_Full->addItem("4档",4);
ui->comboBox_Full->addItem("5档",5);
ui->comboBox_Full->addItem("6档",6);
ui->comboBox_Full->addItem("7档",7);
ui->comboBox_Full->addItem("8档",8);
ui->comboBox_Full->addItem("9档",9);
ui->comboBox_Full->setCurrentIndex(0);
ui->comboBox_Half->addItem("基准档",0);
ui->comboBox_Half->addItem("1档",1);
ui->comboBox_Half->addItem("2档",2);
ui->comboBox_Half->addItem("3档",3);
ui->comboBox_Half->addItem("4档",4);
ui->comboBox_Half->addItem("5档",5);
ui->comboBox_Half->addItem("6档",6);
ui->comboBox_Half->addItem("7档",7);
ui->comboBox_Half->addItem("8档",8);
ui->comboBox_Half->addItem("9档",9);
ui->comboBox_Half->setCurrentIndex(0);
ui->comboBox_rate->addItem("10000",10000);
ui->comboBox_rate->addItem("15000",15000);
ui->comboBox_rate->addItem("20000",20000);
ui->comboBox_rate->addItem("25000",25000);
ui->comboBox_rate->addItem("30000",30000);
ui->comboBox_rate->addItem("35000",35000);
ui->comboBox_rate->addItem("40000",40000);
ui->comboBox_rate->addItem("45000",45000);
ui->comboBox_rate->setEditable(true);
ui->comboBox_rate->setCurrentIndex(-1);
ui->comboBox_TestPoint->addItem("核心机主燃油泵",0);
ui->comboBox_TestPoint->addItem("加力主燃油泵",1);
ui->comboBox_TestPoint->addItem("加力点火燃油泵",2);
ui->comboBox_TestPoint->addItem("尾喷口舵机",3);
ui->comboBox_TestPoint->addItem("点火器",4);
ui->comboBox_TestPoint->addItem("启动控制器1",5);
ui->comboBox_TestPoint->addItem("启动控制器2",6);
ui->comboBox_TestPoint->addItem("核心机点火油阀",7);
ui->comboBox_TestPoint->addItem("核心机优先油阀",8);
ui->comboBox_TestPoint->addItem("核心机轻吹油阀",9);
ui->comboBox_TestPoint->addItem("核心机启动气阀",10);
ui->comboBox_TestPoint->addItem("核心机主油阀",11);
ui->comboBox_TestPoint->addItem("加力主油阀",12);
ui->comboBox_TestPoint->addItem("加力轻吹阀",13);
ui->comboBox_TestPoint->addItem("加力点火快速阀",14);
ui->comboBox_TestPoint->addItem("手动转速控制",15);
ui->comboBox_TestPoint->setCurrentIndex(-1);
ui->comboBox_TestValue->show();
ui->comboBox_TestValue->setCurrentIndex(-1);
}
CommandBox::~CommandBox()
@@ -65,6 +126,78 @@ void CommandBox::setFloatFlag(bool flag)
}
void CommandBox::on_comboBox_TestPoint_currentIndexChanged(int index)
{
switch (index) {
case 0:
case 1:
case 2:
case 15:
ui->label_TestValue->show();
ui->label_TestValue->setText("转速");
ui->comboBox_TestValue->show();
ui->comboBox_TestValue->clear();
ui->comboBox_TestValue->addItem("10000",10000);
ui->comboBox_TestValue->addItem("15000",15000);
ui->comboBox_TestValue->addItem("20000",20000);
ui->comboBox_TestValue->addItem("25000",25000);
ui->comboBox_TestValue->addItem("30000",30000);
ui->comboBox_TestValue->addItem("35000",35000);
ui->comboBox_TestValue->addItem("40000",40000);
ui->comboBox_TestValue->addItem("45000",45000);
ui->comboBox_TestValue->setEditable(true);
ui->comboBox_TestValue->setCurrentIndex(0);
break;
case 3:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
ui->label_TestValue->show();
ui->label_TestValue->setText("电平");
ui->comboBox_TestValue->show();
ui->comboBox_TestValue->clear();
ui->comboBox_TestValue->addItem("低电平",0);
ui->comboBox_TestValue->addItem("高电平",1);
ui->comboBox_TestValue->setEditable(true);
ui->comboBox_TestValue->setCurrentIndex(1);
break;
case 4:
ui->label_TestValue->hide();
ui->comboBox_TestValue->hide();
break;
}
}
void CommandBox::on_pushButton_SendTest_clicked()
{
float testPoint = 0;
float testValue = 0;
if(!ui->comboBox_TestValue->isHidden())//如果显示
{
testPoint = ui->comboBox_TestPoint->currentData(Qt::UserRole).toFloat();
testValue = ui->comboBox_TestValue->currentData(Qt::UserRole).toFloat();
}
else
{
testPoint = ui->comboBox_TestPoint->currentData(Qt::UserRole).toFloat();
}
qDebug() << "send test:" << testPoint << testValue;
}
+3 -1
View File
@@ -2,7 +2,7 @@
#define COMMANDBOX_H
#include <QWidget>
#include "QDebug"
#include "QAction"
#include "QContextMenuEvent"
#include "QMenu"
@@ -29,6 +29,8 @@ public slots:
void setFloatFlag(bool flag);
void on_comboBox_TestPoint_currentIndexChanged(int index);
void on_pushButton_SendTest_clicked();
private:
+214 -54
View File
@@ -6,65 +6,225 @@
<rect>
<x>0</x>
<y>0</y>
<width>698</width>
<height>435</height>
<width>548</width>
<height>404</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>50</x>
<y>80</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_2">
<property name="geometry">
<rect>
<x>190</x>
<y>80</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_3">
<property name="geometry">
<rect>
<x>50</x>
<y>140</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_4">
<property name="geometry">
<rect>
<x>190</x>
<y>140</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>发动机指令</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>控制指令</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="2">
<widget class="QPushButton" name="pushButton_coldrun">
<property name="text">
<string>冷运转</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="pushButton_groundstartup">
<property name="text">
<string>地面启动</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_55">
<property name="text">
<string>全加力档</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_Full"/>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="pushButton_Afterburner_on">
<property name="text">
<string>全加力</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="pushButton_Afterburner_off">
<property name="text">
<string>关全加力</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_56">
<property name="text">
<string>半加力档</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBox_Half"/>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="pushButton_Afterburner_half">
<property name="text">
<string>半加力</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QPushButton" name="pushButton_stop">
<property name="text">
<string>停车</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_57">
<property name="text">
<string>给定转速</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBox_rate"/>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="pushButton_setRPM">
<property name="text">
<string>给定转速</string>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QPushButton" name="pushButton_EmergencyStop">
<property name="text">
<string>紧急停车</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QPushButton" name="pushButton_Hardware_on">
<property name="text">
<string>硬件停车开</string>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QPushButton" name="pushButton_Hardware_off">
<property name="text">
<string>硬件停车关</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_4">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="title">
<string>测试指令</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="1">
<widget class="QComboBox" name="comboBox_TestPoint"/>
</item>
<item row="1" column="3">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="pushButton_SendTest">
<property name="text">
<string>测试</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_TestValue"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_58">
<property name="text">
<string>测试项</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_TestValue">
<property name="text">
<string>测试值</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>伺服指令</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QPushButton" name="pushButton_56V_On">
<property name="text">
<string>56V供电打开</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pushButton_56V_Off">
<property name="text">
<string>56V供电关闭</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="pushButton_AirHeatOn">
<property name="text">
<string>空速加热打开</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButton_AirHeatOff">
<property name="text">
<string>空速加热关闭</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>