调整健康字摆布,调整伺服界面的名称

This commit is contained in:
hm
2022-09-02 00:28:57 +08:00
parent 83138a1035
commit 0de5474a8f
9 changed files with 305 additions and 321 deletions
+24 -24
View File
@@ -92,7 +92,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>开伞</string>
<string>空速管加热</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -105,7 +105,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>上行失效</string>
<string>开气囊舱</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -118,7 +118,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>开气囊</string>
<string>伞舱门开</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -137,7 +137,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>内置记录仪</string>
<string>记录打开</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -150,7 +150,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>内置写入</string>
<string>记录写入</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -169,7 +169,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>开加力</string>
<string>停车</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -182,7 +182,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>外置写入</string>
<string>INS解算正常</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -201,7 +201,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>选择SBG</string>
<string>抛伞</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -214,7 +214,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>记录打开</string>
<string>充气</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -227,7 +227,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>外置记录仪</string>
<string>连接INS</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -240,7 +240,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>充气</string>
<string>上行失效</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -253,7 +253,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>抛伞</string>
<string>安控区内</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -272,7 +272,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>停车</string>
<string>关加力</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -285,7 +285,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>伞舱</string>
<string>伞舱</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -298,7 +298,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>安控区内</string>
<string>SBG解算正常</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -338,7 +338,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>空速管加热</string>
<string>油位计</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -357,7 +357,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>内置惯导</string>
<string>INS</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -385,7 +385,7 @@
<number>0</number>
</property>
<property name="text">
<string>数据链</string>
<string>ECU</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -449,7 +449,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>综</string>
<string>综合控制器</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -462,7 +462,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>ECU</string>
<string>机载电池</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -501,7 +501,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>机载电源</string>
<string>数据链</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -527,7 +527,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>油位</string>
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -540,7 +540,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>内部GPS</string>
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -553,7 +553,7 @@
<string notr="true">background-color: rgb(205, 205, 205);</string>
</property>
<property name="text">
<string>外部GPS</string>
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
+3 -3
View File
@@ -807,7 +807,7 @@ color: rgb(0, 128, 0);</string>
</font>
</property>
<property name="text">
<string>电池</string>
<string>机载电池</string>
</property>
</widget>
</widget>
@@ -815,7 +815,7 @@ color: rgb(0, 128, 0);</string>
<item row="31" column="0">
<widget class="QLabel" name="label_50">
<property name="text">
<string>机载电源[V/A]</string>
<string>28V输出[V/A]</string>
</property>
</widget>
</item>
@@ -860,7 +860,7 @@ color: rgb(0, 128, 0);</string>
<item row="32" column="0">
<widget class="QLabel" name="label_52">
<property name="text">
<string>舵机电源[V/A]</string>
<string>56V输出[V/A]</string>
</property>
</widget>
</item>
+4
View File
@@ -126,6 +126,10 @@ Senser::Senser(QWidget *parent) :
ui->listView_Data->hide();
ui->label_2_dynamic->hide();
ui->label_2_static->hide();
}
Senser::~Senser()
+120 -146
View File
@@ -220,7 +220,7 @@
<property name="verticalSpacing">
<number>8</number>
</property>
<item row="1" column="1">
<item row="0" column="1">
<widget class="QLabel" name="label_1_rel_alt">
<property name="minimumSize">
<size>
@@ -250,96 +250,7 @@
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="label_2_static">
<property name="minimumSize">
<size>
<width>150</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_1_cas">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="label_1_static">
<property name="minimumSize">
<size>
<width>150</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_57">
<property name="text">
<string>真空速[m/s]</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_56">
<property name="text">
<string>表速[m/s]</string>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="3" column="1">
<widget class="QLabel" name="label_1_ma">
<property name="minimumSize">
<size>
@@ -364,14 +275,101 @@
</property>
</widget>
</item>
<item row="5" column="0">
<item row="1" column="1">
<widget class="QLabel" name="label_1_cas">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLabel" name="label_2_dynamic">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_55">
<property name="font">
<font>
<family>黑体</family>
</font>
</property>
<property name="text">
<string>气压高度[m]</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_59">
<property name="text">
<string>动压[hPa]</string>
</property>
</widget>
</item>
<item row="5" column="1">
<item row="2" column="1">
<widget class="QLabel" name="label_1_tas">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_1_dynamic">
<property name="minimumSize">
<size>
@@ -397,54 +395,24 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_55">
<property name="font">
<font>
<family>黑体</family>
</font>
</property>
<widget class="QLabel" name="label_56">
<property name="text">
<string>气压高度[m]</string>
<string>表速[m/s]</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_60">
<item row="3" column="0">
<widget class="QLabel" name="label_58">
<property name="text">
<string>静压[hPa]</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_1_tas">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<string>马赫数</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLabel" name="label_2_dynamic">
<widget class="QLabel" name="label_2_static">
<property name="minimumSize">
<size>
<width>0</width>
<width>150</width>
<height>20</height>
</size>
</property>
@@ -465,36 +433,42 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_77">
<item row="5" column="1">
<widget class="QLabel" name="label_1_static">
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
<width>150</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(189, 189, 189);</string>
</property>
<property name="text">
<string>内部大气机</string>
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_78">
<item row="2" column="0">
<widget class="QLabel" name="label_57">
<property name="text">
<string>外部大气机</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<string>真空速[m/s]</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_58">
<item row="5" column="0">
<widget class="QLabel" name="label_60">
<property name="text">
<string>马赫数</string>
<string>静压[hPa]</string>
</property>
</widget>
</item>
@@ -534,7 +508,7 @@
<item row="0" column="1">
<widget class="QLabel" name="label_2">
<property name="text">
<string>内部惯导</string>
<string>INS</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -1172,7 +1146,7 @@
<item row="0" column="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>外部惯导</string>
<string>SBG</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
+2 -2
View File
@@ -112,7 +112,7 @@ ServoSystem::ServoSystem(QWidget *parent) :
//use_ext_ins参数名称
ui->comboBox_IMU->addItem("内置惯导",0);
ui->comboBox_IMU->addItem("INS",0);
ui->comboBox_IMU->addItem("SBG",1);
ui->comboBox_IMU->setCurrentIndex(0);
@@ -138,7 +138,7 @@ ServoSystem::ServoSystem(QWidget *parent) :
//ui->pushButton_AirHeatOn->hide();
//ui->pushButton_HeatOn3->hide();
//ui->pushButton_HeatOn4->hide();
ui->pushButton_IAS_SEL_2->hide();//隐藏选中外置大气
m_ra = 0;
+3 -3
View File
@@ -127,7 +127,7 @@
<item row="2" column="2">
<widget class="QPushButton" name="pushButton_IAS_SEL_1">
<property name="text">
<string>内置大气机</string>
<string>大气机空速</string>
</property>
</widget>
</item>
@@ -137,7 +137,7 @@
<item row="4" column="0">
<widget class="QGroupBox" name="groupBox_16">
<property name="title">
<string>电指令</string>
<string>载荷供电指令</string>
</property>
<layout class="QGridLayout" name="gridLayout_27">
<property name="spacing">
@@ -874,7 +874,7 @@
<item row="0" column="1">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>电源</string>
<string>机载电池</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+61 -23
View File
@@ -84,6 +84,61 @@ void CheckDirs(const QString &path, const QStringList &dirs) {
}
}
void makeDir(void)
{
//构建语言文件夹
QDir *Languagedir = new QDir;
if(!Languagedir->exists("./Language"))
{
qDebug() << "make dir Language";
Languagedir->mkdir("./Language");//如果文件夹不存在就新建
}
//构建日志目录
QDir *logdir = new QDir;
if(!logdir->exists("./log"))
{
qDebug() << "make dir log";
logdir->mkdir("./log");//如果文件夹不存在就新建
}
//构建Tlog目录
QDir *Tlogdir = new QDir;
if(!Tlogdir->exists("./log/tlog"))
{
qDebug() << "make dir tlog";
Tlogdir->mkdir("./log/tlog");//如果文件夹不存在就新建
}
//构建CSV目录
QDir *csvlog = new QDir;
if(!csvlog->exists("./log/csv"))
{
qDebug() << "make dir csv";
csvlog->mkdir("./log/csv");//如果文件夹不存在就新建
}
//构建文本日志目录
QDir *textlog = new QDir;
if(!textlog->exists("./log/textlog"))
{
qDebug() << "make dir textlog";
textlog->mkdir("./log/textlog");//如果文件夹不存在就新建
}
//构建Other目录
QDir *Otherdir = new QDir;
if(!Otherdir->exists("./log/other"))
{
qDebug() << "make dir other";
Otherdir->mkdir("./log/other");//如果文件夹不存在就新建
}
}
QStringList getFiles(const QString &filePath,const QString &fileSuffix)
{
QStringList list;
@@ -95,9 +150,11 @@ QStringList getFiles(const QString &filePath,const QString &fileSuffix)
QStringList filelist = Dir.entryList(QDir::Files); //获取所有文件
foreach (QFileInfo file, filelist) //遍历只加载.txt到文件列表
{
if(file.fileName().split(".").back() == fileSuffix) //判断进行再次确认是.fileSuffix
//qDebug() << file.absolutePath() << file.fileName();
if(file.suffix() == fileSuffix) //判断进行再次确认是.fileSuffix
{
list.push_back(file.absoluteFilePath());
list.push_back(filePath + file.fileName());
}
}
@@ -105,7 +162,6 @@ QStringList getFiles(const QString &filePath,const QString &fileSuffix)
}
void LoadLang(QApplication *a)
{
QTranslator * qtTranslator = new QTranslator{};
@@ -121,7 +177,7 @@ void LoadLang(QApplication *a)
}
//导入全部的翻译文件
QStringList filelist = getFiles("./","qm");
QStringList filelist = getFiles("./Language/","qm");
foreach (QString lang, filelist) {
QTranslator * Translator = new QTranslator{};
@@ -141,14 +197,7 @@ void LoadLang(QApplication *a)
void RegisterType(void)
{
//qmlRegisterModule("Drivers.LinkUI",1,0);
//qmlRegisterType<LinkUI>("Drivers.LinkUI",1,0,"LinkUI");
qDebug() << "register qml type";
}
@@ -156,9 +205,7 @@ int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// QTranslator translator;
// translator.load("./GCS_zh_CN.qm");
// a.installTranslator(&translator);
makeDir();
QString strLibPath(QDir::toNativeSeparators(QApplication::applicationDirPath()) + QDir::separator() + "plugins");
@@ -174,15 +221,6 @@ int main(int argc, char *argv[])
RegisterType();
QStringList l = QStyleFactory::keys();
foreach (QString s, l) {
qDebug() << s;
}
//QApplication::setStyle(QStyleFactory::create("fusion"));
MainWindow w;//这一步已经全部初始化完成
w.setWindowTitle(QString("KB3A GCS Qt%1 %2").arg(QT_VERSION_STR).arg(APP_VERSION));//with version
+69 -117
View File
@@ -46,47 +46,6 @@ float to360deg(float raw)
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
//构建日志目录
QDir *logdir = new QDir;
if(!logdir->exists("./log"))
{
qDebug() << "make dir log";
logdir->mkdir("./log");//如果文件夹不存在就新建
}
//构建Tlog目录
QDir *Tlogdir = new QDir;
if(!Tlogdir->exists("./log/tlog"))
{
qDebug() << "make dir tlog";
Tlogdir->mkdir("./log/tlog");//如果文件夹不存在就新建
}
//构建CSV目录
QDir *csvlog = new QDir;
if(!csvlog->exists("./log/csv"))
{
qDebug() << "make dir csv";
csvlog->mkdir("./log/csv");//如果文件夹不存在就新建
}
//构建文本日志目录
QDir *textlog = new QDir;
if(!textlog->exists("./log/textlog"))
{
qDebug() << "make dir textlog";
textlog->mkdir("./log/textlog");//如果文件夹不存在就新建
}
//构建Other目录
QDir *Otherdir = new QDir;
if(!Otherdir->exists("./log/other"))
{
qDebug() << "make dir other";
Otherdir->mkdir("./log/other");//如果文件夹不存在就新建
}
setFocusPolicy(Qt::StrongFocus);
setAttribute(Qt::WA_AcceptTouchEvents);
@@ -1580,14 +1539,14 @@ void MainWindow::updateUI()//事件驱动式更新数据
{
echo_count = 3;
toolsui->servosystem->setCheckState(4,1);//空速管加热
healthui->setState(7,HealthUI::state::success);//AIR
healthui->setState(22,HealthUI::state::success);//AIR
}
echo_seq_old = vehicle.ccmstate.echo_seq;
}
else
{
toolsui->servosystem->setCheckState(4,0);//空速管不加热
healthui->setState(7,HealthUI::state::inital);//AIR
healthui->setState(22,HealthUI::state::inital);//AIR
echo_count = 0;
}
@@ -1614,21 +1573,19 @@ void MainWindow::updateUI()//事件驱动式更新数据
if(isCommunicationLost == false)
{
healthui->setState(1,getBit(health,6)?(getBit(health,0)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//IMU
healthui->setState(1,getBit(health,6)?(getBit(health,0)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//INS
healthui->setState(2,getBit(health,7)?(getBit(health,1)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//SBG
healthui->setState(4,getBit(health,8)?(getBit(health,2)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//BMU
healthui->setState(3,getBit(health,9)?(getBit(health,3)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//ECU
healthui->setState(3,getBit(health,9)?(getBit(health,3)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//BMU
healthui->setState(4,(dlink->mavlinknode->isCommunicationLost)?(HealthUI::state::failure):(HealthUI::state::success));//DLINK
healthui->setState(5,getBit(health,10)?(getBit(health,4)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//CCM
healthui->setState(6,(dlink->mavlinknode->isCommunicationLost)?(HealthUI::state::failure):(HealthUI::state::success));//DLINK
healthui->setState(6,getBit(health,8)?(getBit(health,2)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//ECU
// 22 23 24 25 26 27 28 29
// 5525D 5803A 5607A 4525D atteck slide 解码 通讯
//healthui->setState(7,getBit(health,29)?(getBit(health,28)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//AIR
healthui->setState(8,getBit(health,5)?(getBit(health,11)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//FL
//healthui->setState(7,getBit(health,29)?(getBit(health,28)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//空速管加热
healthui->setState(7,getBit(health,5)?(getBit(health,11)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//FuelLevel
//8,9,10位为空
toolsui->servosystem->setCheckState(6,getBit(health,22)?(HealthUI::state::failure):(HealthUI::state::success));
toolsui->servosystem->setCheckState(7,getBit(health,23)?(HealthUI::state::failure):(HealthUI::state::success));
@@ -1672,89 +1629,100 @@ void MainWindow::updateUI()//事件驱动式更新数据
healthui->setState(15,getBit(health,15)?(getBit(servoHealt,2)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//RU
//19~24
if(((vehicle.turbinstate.SysState & 0x000F) == 0x04) ||
((vehicle.turbinstate.SysState & 0x000F) == 0x00))
{
healthui->setState(21,HealthUI::state::failure);//停车
}
else
{
healthui->setState(21,HealthUI::state::inital);//停车
}
//healthui->setState(21,((vehicle.turbinstate.SysState & 0x000F) == 0x04)?(HealthUI::state::failure):(HealthUI::state::inital));//停车
healthui->setState(22,getBit(health,18)?(HealthUI::state::failure):(HealthUI::state::inital));//开伞
healthui->setState(23,getBit(health,19)?(HealthUI::state::failure):(HealthUI::state::inital));//开气囊
healthui->setState(24,getBit(health,20)?(HealthUI::state::failure):(HealthUI::state::inital));//充气
healthui->setState(25,getBit(health,21)?(HealthUI::state::failure):(HealthUI::state::inital));//抛伞
//healthui->setState(26,((vehicle.turbinstate.SysState & 0x000F) >= 0x0d)?(HealthUI::state::success):(HealthUI::state::inital));//开加力
//21~25
if((vehicle.turbinstate.SysState & 0x000F) >= 0x0d)
{
uint8_t sta = vehicle.turbinstate.SysState & 0x000F;
switch (sta) {
case 0x0d:
healthui->setValueState(26,tr("开加力"));
healthui->setValueState(21,tr("开加力"));
break;
case 0x0e:
healthui->setValueState(26,tr("半加力"));
healthui->setValueState(21,tr("半加力"));
break;
case 0x0f:
healthui->setValueState(26,tr("全加力"));
healthui->setValueState(21,tr("全加力"));
break;
default:
healthui->setValueState(26,tr("关加力"));
healthui->setValueState(21,tr("关加力"));
break;
}
healthui->setState(26,HealthUI::state::success);//开加力
healthui->setState(21,HealthUI::state::success);//开加力
}
else
{
healthui->setState(26,HealthUI::state::inital);//开加力
healthui->setValueState(26,tr("关加力"));
healthui->setState(21,HealthUI::state::inital);//开加力
healthui->setValueState(21,tr("关加力"));
}
//空速管加热在上面
if(getBit(enable,6))//从0开始,获取第6位
{
healthui->setState(27,HealthUI::state::failure);//伞舱
healthui->setValueState(27,tr("伞舱开"));
healthui->setState(23,HealthUI::state::failure);//伞舱
healthui->setValueState(23,tr("伞舱"));
}
else
{
healthui->setState(27,HealthUI::state::success);//伞舱
healthui->setValueState(27,tr("伞舱"));
healthui->setState(23,HealthUI::state::success);//伞舱
healthui->setValueState(23,tr("伞舱门闭"));
}
//healthui->setState(26,(((vehicle.servo_output_raw.servo6_raw - 1000)/10) > 110)?(HealthUI::state::success):(HealthUI::state::inital));//开加力
healthui->setState(24,getBit(health,31)?(HealthUI::state::inital):(HealthUI::state::failure));//上行失效
healthui->setState(25,getBit(enable,7)?(HealthUI::state::success):(HealthUI::state::failure));//安控区
healthui->setValueState(25,getBit(enable,7)?(tr("安控区内")):(tr("安控区外")));//安控区
if(((vehicle.turbinstate.SysState & 0x000F) == 0x04) ||
((vehicle.turbinstate.SysState & 0x000F) == 0x00))
{
healthui->setState(26,HealthUI::state::failure);//停车
}
else
{
healthui->setState(26,HealthUI::state::inital);//不停车
}
healthui->setState(27,getBit(health,18)?(HealthUI::state::failure):(HealthUI::state::inital));//开伞舱
healthui->setState(28,getBit(health,19)?(HealthUI::state::failure):(HealthUI::state::inital));//开气囊
healthui->setState(29,getBit(health,20)?(HealthUI::state::failure):(HealthUI::state::inital));//充气
healthui->setState(30,getBit(health,21)?(HealthUI::state::failure):(HealthUI::state::inital));//抛伞
healthui->setState(31,getBit(health,30)?(HealthUI::state::success):(HealthUI::state::inital));//记录打开
healthui->setState(32,getBit(enable,5)?(HealthUI::state::success):(HealthUI::state::inital));//内置写入
healthui->setState(33,getBit(health,12)?(HealthUI::state::warning):(HealthUI::state::success));//惯导选中
healthui->setValueState(33,getBit(health,12)?(tr("连接INS")):(tr("连接SBG")));//sel
switch (vehicle.ins1.sys_status & 0x0F) {
default:
case 0:
{
healthui->setState(9,HealthUI::state::success);
healthui->setValueState(9,tr("INS解算正常"));
healthui->setState(34,HealthUI::state::success);
healthui->setValueState(34,tr("INS解算正常"));
}break;
case 1:
{
healthui->setState(9,HealthUI::state::failure);
healthui->setValueState(9,tr("INS星数不足"));
healthui->setState(34,HealthUI::state::failure);
healthui->setValueState(34,tr("INS星数不足"));
}break;
case 2:
{
healthui->setState(9,HealthUI::state::failure);
healthui->setValueState(9,tr("INS内部错误"));
healthui->setState(34,HealthUI::state::failure);
healthui->setValueState(34,tr("INS内部错误"));
}break;
case 3:
{
healthui->setState(9,HealthUI::state::failure);
healthui->setValueState(9,tr("INS速度超限"));
healthui->setState(34,HealthUI::state::failure);
healthui->setValueState(34,tr("INS速度超限"));
}break;
}
@@ -1762,44 +1730,28 @@ void MainWindow::updateUI()//事件驱动式更新数据
default:
case 0:
{
healthui->setState(10,HealthUI::state::success);
healthui->setValueState(10,tr("SBG解算正常"));
healthui->setState(35,HealthUI::state::success);
healthui->setValueState(35,tr("SBG解算正常"));
}break;
case 1:
{
healthui->setState(10,HealthUI::state::failure);
healthui->setValueState(10,tr("SBG星数不足"));
healthui->setState(35,HealthUI::state::failure);
healthui->setValueState(35,tr("SBG星数不足"));
}break;
case 2:
{
healthui->setState(10,HealthUI::state::failure);
healthui->setValueState(10,tr("SBG内部错误"));
healthui->setState(35,HealthUI::state::failure);
healthui->setValueState(35,tr("SBG内部错误"));
}break;
case 3:
{
healthui->setState(10,HealthUI::state::failure);
healthui->setValueState(10,tr("SBG速度超限"));
healthui->setState(35,HealthUI::state::failure);
healthui->setValueState(35,tr("SBG速度超限"));
}break;
}
healthui->setState(28,getBit(health,31)?(HealthUI::state::inital):(HealthUI::state::failure));//上行有效
healthui->setState(29,getBit(health,30)?(HealthUI::state::success):(HealthUI::state::inital));
//healthui->setValueState(29,getBit(health,30)?(tr("记录已打开")):(tr("")));//sel
healthui->setState(30,getBit(health,12)?(HealthUI::state::warning):(HealthUI::state::success));//sel
healthui->setValueState(30,getBit(health,12)?(tr("连接内置惯导")):(tr("连接SBG")));//sel
//31-40
healthui->setState(31,getBit(enable,4)?(getBit(enable,3)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//内置记录
healthui->setState(32,getBit(enable,5)?(HealthUI::state::success):(HealthUI::state::failure));//内置写入
healthui->setState(33,getBit(enable,1)?(getBit(enable,0)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//外置记录
healthui->setState(34,getBit(enable,2)?(HealthUI::state::success):(HealthUI::state::failure));//外置写入
healthui->setState(35,getBit(enable,7)?(HealthUI::state::success):(HealthUI::state::failure));//sel
healthui->setValueState(35,getBit(enable,7)?(tr("安控区内")):(tr("安控区外")));//sel
+19 -3
View File
@@ -2420,7 +2420,11 @@ void OPMapWidget::WPLoad(QString path)//带文件目录参数
else if(currentGroup >= 3)
{
emit showMessage(tr("Load Mission File:Group %1,%2").arg(QString::number(currentGroup)).arg(path));
int GrouNumber = currentGroup - 2;
if(GrouNumber > 0)
{
emit showMessage(tr("Load Mission File:Group %1,%2").arg(QString::number(GrouNumber)).arg(path));
}
//清除所有
//删除一个组
foreach(QGraphicsItem * i, map->childItems()) {
@@ -2591,7 +2595,11 @@ void OPMapWidget::WPSave(QString path)//带文件目录参数
}
else if(currentGroup >= 3)
{
emit showMessage(tr("Save Mission File:Group %1,%2").arg(QString::number(currentGroup)).arg(path));
int GrouNumber = currentGroup - 2;
if(GrouNumber > 0)
{
emit showMessage(tr("Save Mission File:Group %1,%2").arg(QString::number(GrouNumber)).arg(path));
}
QJsonArray items;
@@ -2848,7 +2856,15 @@ void OPMapWidget::WPUpload(void)
}
emit showMessage(tr("start upload mission %1,total %2").arg(currentGroup).arg(list.size()));
int GrouNumber = currentGroup - 2;
if(GrouNumber > 0)
{
emit showMessage(tr("start upload mission %1,total %2").arg(GrouNumber).arg(list.size()));
}
//选择当前ID号