备份
This commit is contained in:
@@ -48,6 +48,17 @@ CommandBox::CommandBox(QWidget *parent) :
|
||||
m_re = 0;
|
||||
m_le = 0;
|
||||
|
||||
|
||||
/*
|
||||
QRegExp *reg = new QRegExp("^(-?\d+)(\.\d+)?$");
|
||||
|
||||
ui->lineEdit_msl_in->setValidator(QRegExpValidator(reg));
|
||||
ui->lineEdit_Ma_in->setValidator(QRegExpValidator(reg));
|
||||
ui->lineEdit_Ps_in->setValidator(QRegExpValidator(reg));
|
||||
ui->lineEdit_qbar_in->setValidator(QRegExpValidator(reg));
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
CommandBox::~CommandBox()
|
||||
@@ -509,14 +520,32 @@ void CommandBox::on_pushButton_HeatOff_clicked()
|
||||
}
|
||||
|
||||
|
||||
void CommandBox::on_pushButton_setStructSweepParameter_clicked()
|
||||
{
|
||||
|
||||
float msl_in = ui->lineEdit_msl_in->text().toDouble();
|
||||
float ma_in = ui->lineEdit_Ma_in->text().toDouble();
|
||||
float ps_in = ui->lineEdit_Ps_in->text().toDouble();
|
||||
float qbar_in = ui->lineEdit_qbar_in->text().toDouble();
|
||||
|
||||
|
||||
|
||||
on_commandClicked(tr("设定 %1").arg(ui->pushButton_setStructSweepParameter->text()),
|
||||
msl_in,ma_in,ps_in,qbar_in,0,0,0,20014,0);
|
||||
|
||||
qDebug() << "StructSweep:" <<msl_in << ma_in << ps_in << qbar_in;
|
||||
}
|
||||
|
||||
|
||||
void CommandBox::on_pushButton_test_cmd_clicked()
|
||||
{
|
||||
uint8_t ch = 0;
|
||||
float A;
|
||||
float Amp;
|
||||
float start;
|
||||
float stop;
|
||||
float K;
|
||||
float type;
|
||||
float hlre;
|
||||
|
||||
|
||||
type = ui->comboBox_ActuatorType->currentData().toFloat();
|
||||
@@ -526,26 +555,36 @@ void CommandBox::on_pushButton_test_cmd_clicked()
|
||||
/* 1 ail
|
||||
* 2 ele
|
||||
* 4 rud
|
||||
* 8 dsp
|
||||
*
|
||||
* */
|
||||
|
||||
ch |= ui->checkBox_ail->isChecked()?(1):(0);
|
||||
ch |= ui->checkBox_ele->isChecked()?(2):(0);
|
||||
ch |= ui->checkBox_rud->isChecked()?(4):(0);
|
||||
ch |= ui->checkBox_dsp->isChecked()?(8):(0);
|
||||
|
||||
qDebug() << "ch" << ch;
|
||||
|
||||
A = ui->doubleSpinBox_A_deg->value();
|
||||
Amp = ui->doubleSpinBox_A_deg->value();
|
||||
start = ui->doubleSpinBox__Start_frq_Hz->value();
|
||||
stop = ui->doubleSpinBox_Stop_frq_Hz->value();
|
||||
K = ui->doubleSpinBox_K_frq_Hz->value();
|
||||
|
||||
quint16 hldn = ui->spinBox_hldn->value();
|
||||
quint16 recn = ui->spinBox_recn->value();
|
||||
|
||||
hlre = ((quint16)recn << 8)|hldn;
|
||||
|
||||
on_commandClicked(tr("设定 %1").arg(ui->pushButton_test_cmd->text()),
|
||||
ch,A,start,stop,K,type,0,20009,0);
|
||||
ch,Amp,start,stop,K,type,hlre,20013,0);
|
||||
|
||||
|
||||
qDebug() << "Servo Test:" <<ch << A << start << stop << K << type;
|
||||
qDebug() << "Servo Test:" <<ch << Amp << start << stop << K << type << hlre;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CommandBox::on_pushButton_test_stop_clicked()
|
||||
{
|
||||
|
||||
|
||||
@@ -89,6 +89,8 @@ private slots:
|
||||
|
||||
void on_pushButton_ZeroComplete_clicked();
|
||||
|
||||
void on_pushButton_setStructSweepParameter_clicked();
|
||||
|
||||
private:
|
||||
bool floatflag = true;
|
||||
|
||||
|
||||
+331
-250
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>410</width>
|
||||
<height>584</height>
|
||||
<width>391</width>
|
||||
<height>896</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -38,151 +38,8 @@
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_14">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>待发指令</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_CommandName">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_SendCommand">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>150</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(85, 255, 127);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>发送</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_Cancel">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>150</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(255, 140, 142);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>取消</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="2" column="0">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>参数设置</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_8">
|
||||
<property name="spacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="comboBox_IMU"/>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QPushButton" name="pushButton_IAS_SEL_2">
|
||||
<property name="text">
|
||||
<string>外置大气机</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>选择惯导</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>无人机#</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="comboBox_sys"/>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="pushButton_IAS_SEL_1">
|
||||
<property name="text">
|
||||
<string>内置大气机</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>IAS_SEL</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="pushButton_IMU">
|
||||
<property name="text">
|
||||
<string>选择</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="pushButton_IAS_SEL_0">
|
||||
<property name="text">
|
||||
<string>地速算空速</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_13">
|
||||
<item row="3" column="0">
|
||||
@@ -261,106 +118,14 @@
|
||||
<property name="spacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item row="7" column="1">
|
||||
<widget class="QPushButton" name="pushButton_test_stop">
|
||||
<property name="text">
|
||||
<string>停止测试</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout_12">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_ail">
|
||||
<property name="text">
|
||||
<string>副翼</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="checkBox_ele">
|
||||
<property name="text">
|
||||
<string>升降</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QCheckBox" name="checkBox_rud">
|
||||
<property name="text">
|
||||
<string>方向舵</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox__Start_frq_Hz">
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-9999.000000000000000</double>
|
||||
</property>
|
||||
<item row="9" column="1">
|
||||
<widget class="QSpinBox" name="spinBox_recn">
|
||||
<property name="maximum">
|
||||
<double>9999.000000000000000</double>
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QPushButton" name="pushButton_test_cmd">
|
||||
<property name="text">
|
||||
<string>开始测试</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_A_deg">
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-9999.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>9999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_Stop_frq_Hz">
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-9999.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>9999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>结束频率(Hz)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>扫频频率变化率(Hz/s)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>幅值</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="6" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_K_frq_Hz">
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
@@ -373,23 +138,222 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>开始频率(Hz)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>类型</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>数据处理周期</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>开始频率(Hz)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QPushButton" name="pushButton_test_stop">
|
||||
<property name="text">
|
||||
<string>停止测试</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox__Start_frq_Hz">
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-9999.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>9999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout_12">
|
||||
<item row="0" column="2">
|
||||
<widget class="QCheckBox" name="checkBox_rud">
|
||||
<property name="text">
|
||||
<string>方向舵</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="checkBox_ele">
|
||||
<property name="text">
|
||||
<string>升降</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_ail">
|
||||
<property name="text">
|
||||
<string>副翼</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QCheckBox" name="checkBox_dsp">
|
||||
<property name="text">
|
||||
<string>扰流板</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QPushButton" name="pushButton_test_cmd">
|
||||
<property name="text">
|
||||
<string>开始测试</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>幅值</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_A_deg">
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-9999.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>9999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_Stop_frq_Hz">
|
||||
<property name="decimals">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-9999.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>9999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QSpinBox" name="spinBox_hldn">
|
||||
<property name="maximum">
|
||||
<number>255</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>结束频率(Hz)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QComboBox" name="comboBox_ActuatorType"/>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>扫频频率变化率(Hz/s)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>数据过渡周期</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>结构模态扫频飞行状态设定</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_17">
|
||||
<property name="text">
|
||||
<string>动压(Pa)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
<string>马赫数(Ma)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>海拔高度(m)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="text">
|
||||
<string>静压(Pa)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_msl_in">
|
||||
<property name="text">
|
||||
<string>11000</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_Ma_in">
|
||||
<property name="text">
|
||||
<string>0.8</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_Ps_in">
|
||||
<property name="text">
|
||||
<string>22639</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_qbar_in">
|
||||
<property name="text">
|
||||
<string>11871</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QPushButton" name="pushButton_setStructSweepParameter">
|
||||
<property name="text">
|
||||
<string>setStructSweepParameter</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -441,6 +405,123 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>参数设置</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_8">
|
||||
<property name="spacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="comboBox_IMU"/>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QPushButton" name="pushButton_IAS_SEL_2">
|
||||
<property name="text">
|
||||
<string>外置大气机</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>选择惯导</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>无人机#</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="comboBox_sys"/>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="pushButton_IAS_SEL_1">
|
||||
<property name="text">
|
||||
<string>内置大气机</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>IAS_SEL</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="pushButton_IMU">
|
||||
<property name="text">
|
||||
<string>选择</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="pushButton_IAS_SEL_0">
|
||||
<property name="text">
|
||||
<string>地速算空速</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>待发指令</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_CommandName">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_SendCommand">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>150</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(85, 255, 127);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>发送</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_Cancel">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>150</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(255, 140, 142);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>取消</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
|
||||
@@ -41,13 +41,6 @@
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_decription">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="minimumSize">
|
||||
@@ -69,6 +62,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_decription">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="3">
|
||||
|
||||
@@ -62,29 +62,6 @@ HealthUI::HealthUI(QWidget *parent) :
|
||||
Install("刹车开启",index++,state::inital);
|
||||
|
||||
|
||||
/*
|
||||
Install("右前舱门",index++,state::inital);//35
|
||||
|
||||
//======================================
|
||||
Install("前起承载",index++,state::inital);
|
||||
Install("前起放下",index++,state::inital);
|
||||
Install("前起收起",index++,state::inital);
|
||||
Install("前起锁定",index++,state::inital);
|
||||
Install("左前舱门",index++,state::inital);//40
|
||||
|
||||
Install("左主起承载",index++,state::inital);
|
||||
Install("左主起放下",index++,state::inital);
|
||||
Install("左主起收起",index++,state::inital);
|
||||
Install("左主起锁定",index++,state::inital);
|
||||
Install("左主起舱门",index++,state::inital);//45
|
||||
|
||||
Install("右主起承载",index++,state::inital);
|
||||
Install("右主起放下",index++,state::inital);
|
||||
Install("右主起收起",index++,state::inital);
|
||||
Install("右主起锁定",index++,state::inital);
|
||||
Install("右主起舱门",index++,state::inital);//50
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//通过json安装
|
||||
|
||||
@@ -17,13 +17,9 @@ StatusUI::StatusUI(QWidget *parent) :
|
||||
|
||||
int id_count = 0;
|
||||
|
||||
//StateGroup *mode = new StateGroup(id_count++,this);
|
||||
StateGroup *base = new StateGroup(id_count++,this);
|
||||
StateGroup *actuator = new StateGroup(id_count++,this);
|
||||
//StateGroup *e_fly = new StateGroup(id_count++,this);
|
||||
StateGroup *state = new StateGroup(id_count++,this);
|
||||
//StateGroup *battery = new StateGroup(id_count++,this);
|
||||
//StateGroup *communication = new StateGroup(id_count++,this);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -671,19 +671,19 @@ void ECU::SSPC_Info_state(Parse::_sspc info)
|
||||
|
||||
switch (info.source&0x03) {
|
||||
case 0x00:
|
||||
setValue(ui->checkBox_source,tr("电源:无"));
|
||||
setValue(ui->checkBox_source,tr("无"));
|
||||
setColor(ui->checkBox_source,failure);
|
||||
break;
|
||||
case 0x01:
|
||||
setValue(ui->checkBox_source,tr("电源:地面电源供电"));
|
||||
setValue(ui->checkBox_source,tr("地面电源供电"));
|
||||
setColor(ui->checkBox_source,warning);
|
||||
break;
|
||||
case 0x02:
|
||||
setValue(ui->checkBox_source,tr("电源:主电源供电"));
|
||||
setValue(ui->checkBox_source,tr("主电源供电"));
|
||||
setColor(ui->checkBox_source,success);
|
||||
break;
|
||||
case 0x03:
|
||||
setValue(ui->checkBox_source,tr("电源:蓄电池供电"));
|
||||
setValue(ui->checkBox_source,tr("蓄电池供电"));
|
||||
setColor(ui->checkBox_source,warning);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -266,6 +266,8 @@ void landinggear::actuator_info(Parse::_actuator info)
|
||||
ui->label_0_status->setText(QString::number(info.status));
|
||||
ui->label_0_current->setText(QString::number(info.current,'f',1));
|
||||
ui->label_0_temp->setText(QString::number(info.temp));
|
||||
ui->label_0_left_brake->setText((info.left_brake == 0x11)?("关闭制动器"):("打开制动器"));
|
||||
ui->label_0_right_brake->setText((info.right_brake == 0x11)?("关闭制动器"):("打开制动器"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -819,27 +819,6 @@
|
||||
<string>转向变体舵机</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_20">
|
||||
<property name="text">
|
||||
<string>左变体</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_24">
|
||||
<property name="text">
|
||||
<string>工作状态</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_22">
|
||||
<property name="text">
|
||||
<string>右变体</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label_0_id">
|
||||
<property name="minimumSize">
|
||||
@@ -859,8 +838,8 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLabel" name="label_0_current">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_0_type">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(205, 205, 205);</string>
|
||||
</property>
|
||||
@@ -872,20 +851,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_26">
|
||||
<property name="text">
|
||||
<string>电流信息</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_28">
|
||||
<property name="text">
|
||||
<string>温度信息</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="label_0_wheel">
|
||||
<property name="styleSheet">
|
||||
@@ -899,19 +864,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLabel" name="label_0_temp">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(205, 205, 205);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_46">
|
||||
<property name="minimumSize">
|
||||
@@ -925,6 +877,26 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLabel" name="label_0_current">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(205, 205, 205);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_28">
|
||||
<property name="text">
|
||||
<string>温度信息</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="text">
|
||||
@@ -932,8 +904,8 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="label_0_trans_left">
|
||||
<item row="7" column="1">
|
||||
<widget class="QLabel" name="label_0_temp">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(205, 205, 205);</string>
|
||||
</property>
|
||||
@@ -958,6 +930,33 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_24">
|
||||
<property name="text">
|
||||
<string>工作状态</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="label_0_trans_left">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(205, 205, 205);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>左变体制动</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="label_0_trans_right">
|
||||
<property name="styleSheet">
|
||||
@@ -971,6 +970,27 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_22">
|
||||
<property name="text">
|
||||
<string>右变体</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_26">
|
||||
<property name="text">
|
||||
<string>电流信息</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_20">
|
||||
<property name="text">
|
||||
<string>左变体</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_19">
|
||||
<property name="text">
|
||||
@@ -978,8 +998,28 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_0_type">
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>右变体制动</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QLabel" name="label_0_left_brake">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(205, 205, 205);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QLabel" name="label_0_right_brake">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(205, 205, 205);</string>
|
||||
</property>
|
||||
|
||||
+14
-9
@@ -475,7 +475,7 @@ void Parse::run()
|
||||
{
|
||||
union{uint8_t B[4];uint16_t I[2]; int16_t i[2]; uint32_t H; int32_t h;float F;}src;
|
||||
|
||||
QByteArray data = raw.mid(110);
|
||||
QByteArray data = raw.mid(115);
|
||||
_actuator group;
|
||||
int data_count = 0;
|
||||
|
||||
@@ -487,15 +487,15 @@ void Parse::run()
|
||||
|
||||
src.B[0] = data[data_count++];
|
||||
src.B[1] = data[data_count++];
|
||||
group.wheel = src.i[0] * 60.0 / 0x7FF;
|
||||
group.wheel = src.i[0];
|
||||
|
||||
src.B[0] = data[data_count++];
|
||||
src.B[1] = data[data_count++];
|
||||
group.left_trans = src.i[0] * 55.0 / 0x7FF;
|
||||
group.left_trans = src.i[0];
|
||||
|
||||
src.B[0] = data[data_count++];
|
||||
src.B[1] = data[data_count++];
|
||||
group.right_trans = src.i[0] * 55.0 / 0x7FF;
|
||||
group.right_trans = src.i[0];
|
||||
|
||||
group.status = data[data_count++];
|
||||
|
||||
@@ -505,6 +505,9 @@ void Parse::run()
|
||||
|
||||
group.temp = data[data_count++];
|
||||
|
||||
group.left_brake = data[data_count++];
|
||||
group.right_brake = data[data_count++];
|
||||
|
||||
emit actuator_info(group);
|
||||
|
||||
}
|
||||
@@ -513,7 +516,7 @@ void Parse::run()
|
||||
{
|
||||
union{uint8_t B[4];uint16_t I[2]; int16_t i[2]; uint32_t H; int32_t h;float F;}src;
|
||||
|
||||
QByteArray data = raw.mid(122);
|
||||
QByteArray data = raw.mid(127);
|
||||
_actuator1 group;
|
||||
int data_count = 0;
|
||||
|
||||
@@ -553,7 +556,7 @@ void Parse::run()
|
||||
{
|
||||
union{uint8_t B[4];uint16_t I[2]; int16_t i[2]; uint32_t H; int32_t h;float F;}src;
|
||||
|
||||
QByteArray data = raw.mid(136);
|
||||
QByteArray data = raw.mid(141);
|
||||
_actuator2 group;
|
||||
int data_count = 0;
|
||||
|
||||
@@ -612,7 +615,7 @@ void Parse::run()
|
||||
};
|
||||
}status;
|
||||
|
||||
QByteArray data = raw.mid(150);
|
||||
QByteArray data = raw.mid(155);
|
||||
_imu group;
|
||||
int data_count = 0;
|
||||
|
||||
@@ -757,7 +760,7 @@ void Parse::run()
|
||||
};
|
||||
}status;
|
||||
|
||||
QByteArray data = raw.mid(208);
|
||||
QByteArray data = raw.mid(213);
|
||||
_euler group;
|
||||
int data_count = 0;
|
||||
|
||||
@@ -857,7 +860,7 @@ void Parse::run()
|
||||
{
|
||||
union{uint8_t B[4];uint16_t I[2]; int16_t i[2]; uint32_t H; int32_t h;float F;}src;
|
||||
|
||||
QByteArray data = raw.mid(240);
|
||||
QByteArray data = raw.mid(245);
|
||||
_euler group;
|
||||
int data_count = 0;
|
||||
|
||||
@@ -1232,6 +1235,8 @@ void Parse::run()
|
||||
group.current = src.i[0];
|
||||
|
||||
group.temp = data[data_count++];
|
||||
group.left_brake = data[data_count++];
|
||||
group.right_brake = data[data_count++];
|
||||
|
||||
emit actuator_info(group);
|
||||
|
||||
|
||||
@@ -114,6 +114,8 @@ public:
|
||||
quint8 status;
|
||||
quint16 current;
|
||||
qint8 temp;
|
||||
qint8 left_brake;
|
||||
qint8 right_brake;
|
||||
|
||||
}_actuator;
|
||||
|
||||
|
||||
+43
-43
@@ -87,6 +87,35 @@ void CheckDirs(const QString &path, const QStringList &dirs) {
|
||||
}
|
||||
}
|
||||
|
||||
QStringList getFiles(const QString &filePath,const QString &fileSuffix)
|
||||
{
|
||||
QStringList list;
|
||||
list.clear();
|
||||
|
||||
QDir Dir(filePath); //查看工作路径是否存在
|
||||
if(!Dir.exists()){ return list;} //如果文件夹不存在则返回
|
||||
Dir.setFilter(QDir::Files); //设置过滤器只查看文件
|
||||
QStringList filelist = Dir.entryList(QDir::Files); //获取所有文件
|
||||
foreach (QFileInfo file, filelist) //遍历只加载.txt到文件列表
|
||||
{
|
||||
if(file.fileName().split(".").back() == fileSuffix) //判断进行再次确认是.fileSuffix
|
||||
{
|
||||
list.push_back(file.absoluteFilePath());
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
void setLibPath(void)
|
||||
{
|
||||
QString strLibPath(QDir::toNativeSeparators(QApplication::applicationDirPath()) + QDir::separator() + "plugins");
|
||||
|
||||
QApplication::addLibraryPath(strLibPath);
|
||||
|
||||
qDebug() << strLibPath;
|
||||
}
|
||||
|
||||
|
||||
void LoadLang(QApplication *a)
|
||||
{
|
||||
@@ -102,30 +131,25 @@ void LoadLang(QApplication *a)
|
||||
qWarning() << "Fail to load translator " <<lang << " from " << QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||
}
|
||||
|
||||
QTranslator * myappTranslator = new QTranslator{};
|
||||
lang = "GCS_" + QLocale::system().name();
|
||||
if (myappTranslator->load(lang, QCoreApplication::applicationDirPath())
|
||||
&& a->installTranslator(myappTranslator))
|
||||
{
|
||||
qDebug() << "Success to load translator " <<lang << " from " << QCoreApplication::applicationDirPath();
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning() << "Fail to load translator " <<lang << " from " << QCoreApplication::applicationDirPath();
|
||||
//导入全部的翻译文件
|
||||
QStringList filelist = getFiles("./","qm");
|
||||
|
||||
foreach (QString lang, filelist) {
|
||||
QTranslator * Translator = new QTranslator{};
|
||||
if (Translator->load(lang, QCoreApplication::applicationDirPath())
|
||||
&& a->installTranslator(Translator))
|
||||
{
|
||||
qDebug() << "load translator " <<lang << " from " << QCoreApplication::applicationDirPath();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void RegisterType(void)
|
||||
{
|
||||
|
||||
//qmlRegisterModule("Drivers.LinkUI",1,0);
|
||||
|
||||
//qmlRegisterType<LinkUI>("Drivers.LinkUI",1,0,"LinkUI");
|
||||
|
||||
|
||||
qDebug() << "register qml type";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -133,47 +157,23 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
QTranslator translator;
|
||||
translator.load(":/qm/GCS_zh_CN.qm");
|
||||
a.installTranslator(&translator);
|
||||
|
||||
QString strLibPath(QDir::toNativeSeparators(QApplication::applicationDirPath()) + QDir::separator() + "plugins");
|
||||
|
||||
QApplication::addLibraryPath(strLibPath);
|
||||
|
||||
qDebug() << strLibPath;
|
||||
|
||||
a.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
|
||||
|
||||
QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf8"));
|
||||
|
||||
setLibPath();
|
||||
LoadLang(&a);
|
||||
|
||||
RegisterType();
|
||||
|
||||
|
||||
QStringList l = QStyleFactory::keys();
|
||||
|
||||
foreach (QString s, l) {
|
||||
qDebug() << s;
|
||||
}
|
||||
//QApplication::setStyle(QStyleFactory::create("fusion"));
|
||||
|
||||
|
||||
MainWindow w;//这一步已经全部初始化完成
|
||||
|
||||
w.setWindowTitle(QString("GCS Qt%1 %2").arg(QT_VERSION_STR).arg(APP_VERSION));//with version
|
||||
//w.setWindowTitle(QString("KB3A-V1.00 %1").arg(APP_VERSION));//with version
|
||||
// 主要是控制HDMI输出,如果是LCD显示,此行无关紧要
|
||||
|
||||
w.resize(GetDesktopSize());
|
||||
|
||||
QScreen *screen=QGuiApplication::primaryScreen ();;
|
||||
w.move((screen->availableGeometry().width()-w.width())/2,(screen->availableGeometry().height()-w.height())/2);
|
||||
|
||||
//qDebug() << screen;
|
||||
|
||||
//w.setWindowState(Qt::WindowMaximized);
|
||||
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
|
||||
+100
-99
@@ -1229,38 +1229,50 @@ void MainWindow::update_servo_output_raw(mavlink_servo_output_raw_t servo)
|
||||
if(servo.port == 0)
|
||||
{
|
||||
//12-16
|
||||
statusui->setValue(2,0,QString::number((((((int16_t)servo.servo1_raw) * (ch1.le/32767.0)/ch1.kd) + ch1.d0) * 57.3),'f',2) + '|'
|
||||
+ QString::number((((((int16_t)servo.servo13_raw) * (ch1.le/32767.0)/ch1.kd) + ch1.d0) * 57.3),'f',2));//8000H~7FFFH -38°~38° 1LSB=38/32767
|
||||
/*
|
||||
statusui->setValue(2,1,QString::number(((int16_t)servo.servo2_raw) * 88.0 / 32767.0,'f',2) + '|'
|
||||
+ QString::number(((int16_t)servo.servo14_raw) * 88.0 / 32767.0,'f',2));//88/32767
|
||||
*/
|
||||
statusui->setValue(1,0,QString::number(pwm2angle_2((int16_t)servo.servo1_raw,1,1,1),'f',2) + '|'
|
||||
+ QString::number(pwm2angle_2((int16_t)servo.servo9_raw,1,1,1),'f',2));
|
||||
|
||||
statusui->setValue(2,2,QString::number((((((int16_t)servo.servo3_raw) * (ch3.le/32767.0)/ch3.kd) + ch3.d0) * 57.3),'f',2) + '|'
|
||||
+ QString::number((((((int16_t)servo.servo15_raw) * (ch3.le/32767.0)/ch3.kd) + ch3.d0) * 57.3),'f',2));//直线舵机
|
||||
statusui->setValue(1,1,QString::number(pwm2angle_2((int16_t)servo.servo2_raw,1,1,1),'f',2) + '|'
|
||||
+ QString::number(pwm2angle_2((int16_t)servo.servo10_raw,1,1,1),'f',2));
|
||||
|
||||
statusui->setValue(2,4,QString::number((((((int16_t)servo.servo4_raw) * (ch4.le/32767.0)/ch4.kd) + ch4.d0) * 57.3),'f',2) + '|'
|
||||
+ QString::number((((((int16_t)servo.servo16_raw) * (ch4.le/32767.0)/ch4.kd) + ch4.d0) * 57.3),'f',2));
|
||||
statusui->setValue(1,2,QString::number(pwm2angle_2((int16_t)servo.servo3_raw,1,1,1),'f',2) + '|'
|
||||
+ QString::number(pwm2angle_2((int16_t)servo.servo11_raw,1,1,1),'f',2));
|
||||
|
||||
statusui->setValue(1,3,QString::number(pwm2angle_2((int16_t)servo.servo4_raw,1,1,1),'f',2) + '|'
|
||||
+ QString::number(pwm2angle_2((int16_t)servo.servo12_raw,1,1,1),'f',2));
|
||||
|
||||
|
||||
statusui->setValue(1,4,QString::number(pwm2angle_2((int16_t)servo.servo5_raw,1,1,1),'f',2) + '|'
|
||||
+ QString::number(pwm2angle_2((int16_t)servo.servo13_raw,1,1,1),'f',2));
|
||||
|
||||
statusui->setValue(1,5,QString::number(pwm2angle_2((int16_t)servo.servo6_raw,1,1,1),'f',2) + '|'
|
||||
+ QString::number(pwm2angle_2((int16_t)servo.servo14_raw,1,1,1),'f',2));
|
||||
|
||||
statusui->setValue(1,6,QString::number(pwm2angle_2((int16_t)servo.servo7_raw,1,1,1),'f',2) + '|'
|
||||
+ QString::number(pwm2angle_2((int16_t)servo.servo15_raw,1,1,1),'f',2));
|
||||
|
||||
statusui->setValue(1,7,QString::number(pwm2angle_2((int16_t)servo.servo8_raw,1,1,1),'f',2) + '|'
|
||||
+ QString::number(pwm2angle_2((int16_t)servo.servo16_raw,1,1,1),'f',2));
|
||||
|
||||
raw_ch1 = QString::number((((((int16_t)servo.servo5_raw) * (ch5.le/32767.0)/ch5.kd) + ch5.d0) * 57.3),'f',2);
|
||||
//raw_ch2 = QString::number(((int16_t)servo.servo6_raw) * 88.0 / 32767.0,'f',2);
|
||||
raw_ch3 = QString::number((((((int16_t)servo.servo7_raw) * (ch7.le/32767.0)/ch7.kd) + ch7.d0) * 57.3),'f',2);
|
||||
raw_ch4 = QString::number((((((int16_t)servo.servo8_raw) * (ch8.le/32767.0)/ch8.kd) + ch8.d0) * 57.3),'f',2);
|
||||
|
||||
|
||||
}
|
||||
else if(servo.port == 1)
|
||||
{
|
||||
//17-19
|
||||
statusui->setValue(2,1,raw_ch1 + '|' + QString::number((((((int16_t)servo.servo1_raw) * (ch5.le/32767.0)/ch5.kd) + ch5.d0) * 57.3),'f',2));
|
||||
//statusui->setValue(2,5,raw_ch2 + '|' + QString::number(((int16_t)servo.servo2_raw) * 88.0 / 32767.0,'f',2));
|
||||
statusui->setValue(2,3,raw_ch3 + '|' + QString::number((((((int16_t)servo.servo3_raw) * (ch7.le/32767.0)/ch7.kd) + ch7.d0) * 57.3),'f',2));
|
||||
statusui->setValue(2,5,raw_ch4 + '|' + QString::number((((((int16_t)servo.servo4_raw) * (ch8.le/32767.0)/ch8.kd) + ch8.d0) * 57.3),'f',2));
|
||||
statusui->setValue(1,8,QString::number(pwm2angle_2((int16_t)servo.servo1_raw,1,1,1),'f',2) + '|'
|
||||
+ QString::number(pwm2angle_2((int16_t)servo.servo4_raw,1,1,1),'f',2));
|
||||
|
||||
statusui->setValue(1,9,QString::number(pwm2angle_2((int16_t)servo.servo2_raw,1,1,1),'f',2) + '|'
|
||||
+ QString::number(pwm2angle_2((int16_t)servo.servo5_raw,1,1,1),'f',2));
|
||||
|
||||
statusui->setValue(1,10,QString::number(pwm2angle_2((int16_t)servo.servo3_raw,1,1,1),'f',2) + '|'
|
||||
+ QString::number(pwm2angle_2((int16_t)servo.servo6_raw,1,1,1),'f',2));
|
||||
|
||||
|
||||
emit setECUTemp(servo.servo13_raw,servo.servo14_raw);
|
||||
|
||||
|
||||
|
||||
emit setECUTemp(servo.servo13_raw,servo.servo14_raw);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1602,76 +1614,53 @@ void MainWindow::updateVehicle(MavLinkNode::_vehicle vehicle)//事件驱动式
|
||||
|
||||
if(isCommunicationLost == false)
|
||||
{
|
||||
|
||||
quint16 indexCount = 1;
|
||||
|
||||
healthui->setColor(indexCount++,getBit(present,0)?(getBit(present,6)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//EADC
|
||||
healthui->setColor(indexCount++,getBit(present,1)?(getBit(present,7)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//SBG
|
||||
healthui->setColor(indexCount++,getBit(present,2)?(getBit(present,8)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//ECU
|
||||
healthui->setColor(indexCount++,getBit(present,3)?(getBit(present,9)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//INE
|
||||
healthui->setColor(indexCount++,getBit(present,1)?(getBit(present,7)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//SBG
|
||||
healthui->setColor(indexCount++,getBit(present,0)?(getBit(present,6)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//EADC
|
||||
healthui->setColor(indexCount++,getBit(present,14)?(getBit(present,15)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//gear
|
||||
healthui->setColor(indexCount++,getBit(present,4)?(getBit(present,10)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//SSPC
|
||||
|
||||
healthui->setColor(indexCount++,getBit(present,5)?(getBit(present,11)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//REC
|
||||
healthui->setColor(indexCount++,getBit(present,12)?(HealthUI::state::success):(HealthUI::state::inital));//ECU射检
|
||||
healthui->setColor(indexCount++,getBit(present,13)?(HealthUI::state::success):(HealthUI::state::inital));//REC记录
|
||||
healthui->setColor(indexCount++,getBit(present,14)?(getBit(present,15)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//gear
|
||||
healthui->setColor(indexCount++,getBit(present,2)?(getBit(present,8)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//ECU
|
||||
healthui->setColor(indexCount++,getBit(present,16)?(getBit(present,17)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//act
|
||||
|
||||
healthui->setColor(indexCount++,getBit(present,18)?(getBit(present,19)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//act1
|
||||
healthui->setColor(indexCount++,getBit(present,20)?(getBit(present,21)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//act2
|
||||
|
||||
healthui->setColor(indexCount++,getBit(present,13)?(HealthUI::state::success):(HealthUI::state::inital));//REC记录
|
||||
healthui->setColor(indexCount++,getBit(present,12)?(HealthUI::state::success):(HealthUI::state::inital));//ECU射检
|
||||
healthui->setColor(indexCount++,getBit(present,22)?(HealthUI::state::success):(HealthUI::state::inital));//act自检
|
||||
healthui->setColor(indexCount++,getBit(present,23)?(HealthUI::state::success):(HealthUI::state::inital));//act1自检
|
||||
healthui->setColor(indexCount++,getBit(present,24)?(HealthUI::state::success):(HealthUI::state::inital));//act2自检
|
||||
|
||||
healthui->setColor(indexCount++,getBit(present,25)?(HealthUI::state::success):(HealthUI::state::inital));//eadc加温
|
||||
healthui->setValue(indexCount, getBit(present,30)?("使用320"):("使用SBG"));//使用320/使用SBG
|
||||
healthui->setColor(indexCount++,getBit(present,25)?(HealthUI::state::success):(HealthUI::state::warning));//使用320/使用SBG
|
||||
healthui->setColor(indexCount++,getBit(present,25)?(HealthUI::state::success):(HealthUI::state::inital));//空速管加温
|
||||
healthui->setColor(indexCount++,getBit(present,25)?(HealthUI::state::success):(HealthUI::state::inital));//插销上锁
|
||||
healthui->setColor(indexCount++,getBit(present,28)?(HealthUI::state::success):(HealthUI::state::inital));//变体上锁
|
||||
healthui->setColor(indexCount++,getBit(present,29)?(getBit(present,30)?(HealthUI::state::success):(HealthUI::state::failure)):(HealthUI::state::success));//56V并网
|
||||
|
||||
healthui->setColor(indexCount,getBit(present,27)?(getBit(present,26)?(HealthUI::state::warning):(HealthUI::state::success)):(HealthUI::state::failure));//EADC
|
||||
healthui->setValue(indexCount++,getBit(present,27)?(getBit(present,26)?("EADC故障"):("EADC正常")):("EADC失效"));//eadc
|
||||
healthui->setColor(indexCount++,getBit(present,31)?(HealthUI::state::success):(HealthUI::state::inital));//燃油泵
|
||||
healthui->setColor(indexCount++,getBit(present,31)?(HealthUI::state::success):(HealthUI::state::inital));//燃油切断阀
|
||||
healthui->setColor(indexCount++,getBit(present,31)?(HealthUI::state::success):(HealthUI::state::inital));//温度变送器
|
||||
healthui->setColor(indexCount++,getBit(present,31)?(HealthUI::state::success):(HealthUI::state::inital));//开伞
|
||||
healthui->setColor(indexCount++,getBit(present,31)?(HealthUI::state::success):(HealthUI::state::inital));//切伞
|
||||
|
||||
healthui->setColor(indexCount++,getBit(present,28)?(HealthUI::state::success):(HealthUI::state::inital));//INE进入导航
|
||||
healthui->setColor(indexCount++,getBit(present,31)?(HealthUI::state::success):(HealthUI::state::inital));//蓄电池加温
|
||||
healthui->setColor(indexCount++,getBit(present,31)?(HealthUI::state::success):(HealthUI::state::inital));//刹车/收放
|
||||
healthui->setColor(indexCount++,getBit(present,31)?(HealthUI::state::success):(HealthUI::state::inital));//滑油变送器
|
||||
healthui->setColor(indexCount++,getBit(present,31)?(HealthUI::state::success):(HealthUI::state::inital));//起落架放
|
||||
healthui->setColor(indexCount++,getBit(present,31)?(HealthUI::state::success):(HealthUI::state::inital));//舱门打开
|
||||
|
||||
healthui->setColor(indexCount,getBit(present,29)?(getBit(present,30)?(HealthUI::state::success):(HealthUI::state::failure)):(HealthUI::state::success));//INE导航状态
|
||||
healthui->setValue(indexCount++,getBit(present,29)?(getBit(present,30)?("INE差分导航"):("未进入导航")):("INE卫星导航"));//INE导航状态
|
||||
|
||||
healthui->setColor(indexCount,getBit(present,31)?(HealthUI::state::success):(HealthUI::state::inital));//INE定向状态
|
||||
healthui->setValue(indexCount++,getBit(present,31)?("INE定向"):("INE未定向"));//INE导航状态
|
||||
|
||||
healthui->setColor(indexCount++,getBit(enabled,0)?(HealthUI::state::success):(HealthUI::state::inital));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,1)?(HealthUI::state::success):(HealthUI::state::inital));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,2)?(HealthUI::state::success):(HealthUI::state::inital));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,3)?(HealthUI::state::success):(HealthUI::state::inital));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,4)?(HealthUI::state::success):(HealthUI::state::inital));//
|
||||
|
||||
healthui->setColor(indexCount++,getBit(enabled,5)?(HealthUI::state::success):(HealthUI::state::inital));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,6)?(HealthUI::state::success):(HealthUI::state::inital));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,7)?(HealthUI::state::success):(HealthUI::state::inital));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,8)?(HealthUI::state::success):(HealthUI::state::inital));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,9)?(HealthUI::state::success):(HealthUI::state::inital));//
|
||||
|
||||
healthui->setColor(indexCount++,getBit(enabled,10)?(HealthUI::state::success):(HealthUI::state::inital));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,11)?(HealthUI::state::success):(HealthUI::state::inital));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,12)?(HealthUI::state::success):(HealthUI::state::inital));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,13)?(HealthUI::state::success):(HealthUI::state::inital));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,24)?(HealthUI::state::inital):(HealthUI::state::success));//右前舱门
|
||||
|
||||
healthui->setColor(indexCount++,getBit(enabled,23)?(HealthUI::state::success):(HealthUI::state::inital));//承载
|
||||
healthui->setColor(indexCount++,getBit(enabled,22)?(HealthUI::state::inital):(HealthUI::state::success));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,21)?(HealthUI::state::inital):(HealthUI::state::success));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,20)?(HealthUI::state::inital):(HealthUI::state::success));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,19)?(HealthUI::state::inital):(HealthUI::state::success));//40
|
||||
|
||||
healthui->setColor(indexCount++,getBit(enabled,18)?(HealthUI::state::success):(HealthUI::state::inital));//承载
|
||||
healthui->setColor(indexCount++,getBit(enabled,17)?(HealthUI::state::inital):(HealthUI::state::success));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,16)?(HealthUI::state::inital):(HealthUI::state::success));//
|
||||
|
||||
healthui->setColor(indexCount++,getBit(enabled,31)?(HealthUI::state::inital):(HealthUI::state::success));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,30)?(HealthUI::state::inital):(HealthUI::state::success));//45
|
||||
healthui->setColor(indexCount++,getBit(present,31)?(HealthUI::state::success):(HealthUI::state::inital));//副翼/方向
|
||||
healthui->setColor(indexCount++,getBit(present,31)?(HealthUI::state::success):(HealthUI::state::inital));//扰流/升降
|
||||
healthui->setColor(indexCount++,getBit(present,31)?(HealthUI::state::success):(HealthUI::state::inital));//转向/变体
|
||||
healthui->setColor(indexCount++,getBit(present,31)?(HealthUI::state::success):(HealthUI::state::inital));//起落架承载
|
||||
healthui->setColor(indexCount++,getBit(present,31)?(HealthUI::state::success):(HealthUI::state::inital));//刹车开启
|
||||
|
||||
|
||||
healthui->setColor(indexCount++,getBit(enabled,29)?(HealthUI::state::success):(HealthUI::state::inital));//承载
|
||||
healthui->setColor(indexCount++,getBit(enabled,28)?(HealthUI::state::inital):(HealthUI::state::success));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,27)?(HealthUI::state::inital):(HealthUI::state::success));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,26)?(HealthUI::state::inital):(HealthUI::state::success));//
|
||||
healthui->setColor(indexCount++,getBit(enabled,25)?(HealthUI::state::inital):(HealthUI::state::success));//50
|
||||
|
||||
/*
|
||||
qDebug() << "main" << QString::number(enabled,16).toUpper() << indexCount;
|
||||
@@ -1687,37 +1676,49 @@ void MainWindow::updateVehicle(MavLinkNode::_vehicle vehicle)//事件驱动式
|
||||
//===================status ui =============================================
|
||||
|
||||
//========================0
|
||||
statusui->setValue(0,0,mode_str);
|
||||
//========================1
|
||||
statusui->setValue(1,0,QString::number(vehicle.emb_atom_com.alpha,'f',1));
|
||||
statusui->setValue(1,1,QString::number(vehicle.emb_atom_com.beta,'f',1));
|
||||
statusui->setValue(1,2,QString::number(vehicle.attitude.roll * 57.3,'f',1));
|
||||
statusui->setValue(1,3,QString::number(vehicle.attitude.pitch * 57.3,'f',1));
|
||||
statusui->setValue(1,4,QString::number(vehicle.gps_raw_int.cog * 0.01,'f',1));
|
||||
statusui->setValue(1,5,QString::number(vehicle.gps_raw_int.alt * 10e-4,'f',1));
|
||||
statusui->setValue(1,6,QString::number(vehicle.vfr_hud.airspeed,'f',1));
|
||||
statusui->setValue(1,7,QString::number(vehicle.emb_atom_com.Airspeed,'f',1));
|
||||
statusui->setValue(1,8,QString::number(vehicle.gps_raw_int.vel * 10e-3,'f',1));
|
||||
statusui->setValue(1,9,QString::number(vehicle.emb_atom_com.mach,'f',2));
|
||||
statusui->setValue(1,10,QString::number(-vehicle.global_position_int.vz * 10e-3,'f',1));
|
||||
statusui->setValue(0,0,QString::number(vehicle.emb_atom_com.alpha,'f',1));
|
||||
statusui->setValue(0,1,QString::number(vehicle.emb_atom_com.beta,'f',1));
|
||||
statusui->setValue(0,2,QString::number(vehicle.attitude.roll * 57.3,'f',1));
|
||||
statusui->setValue(0,3,QString::number(vehicle.attitude.pitch * 57.3,'f',1));
|
||||
statusui->setValue(0,4,QString::number(vehicle.gps_raw_int.cog * 0.01,'f',1));
|
||||
statusui->setValue(0,5,QString::number(vehicle.gps_raw_int.alt * 10e-4,'f',1));
|
||||
statusui->setValue(0,6,QString::number(vehicle.vfr_hud.airspeed,'f',1));
|
||||
statusui->setValue(0,7,QString::number(vehicle.emb_atom_com.Airspeed,'f',1));
|
||||
statusui->setValue(0,8,QString::number(vehicle.gps_raw_int.vel * 10e-3,'f',1));
|
||||
statusui->setValue(0,9,QString::number(vehicle.emb_atom_com.mach,'f',2));
|
||||
|
||||
|
||||
quint8 com = (0x44 & 0x0E) >> 1;
|
||||
QString com_str;
|
||||
switch (com) {
|
||||
case 0:
|
||||
com_str = tr("未初始化");
|
||||
break;
|
||||
case 1:
|
||||
com_str = tr("INS/大气");
|
||||
break;
|
||||
case 2:
|
||||
com_str = tr("INS/DGPS");
|
||||
break;
|
||||
case 3:
|
||||
com_str = tr("INS/GNSS");
|
||||
break;
|
||||
case 5:
|
||||
com_str = tr("GNSS");
|
||||
break;
|
||||
default:
|
||||
com_str = tr("未知参数");
|
||||
break;
|
||||
}
|
||||
|
||||
statusui->setValue(0,10,com_str);
|
||||
|
||||
statusui->setValue(0,11,com_str);
|
||||
|
||||
//========================4
|
||||
QString throwkey;
|
||||
throwkey.append((vehicle.rpm.rpm1 == 1)?(tr("投放|")):(tr("锁定|")));
|
||||
throwkey.append((vehicle.rpm.rpm2 == 1)?(tr("投放")):(tr("锁定")));
|
||||
statusui->setValue(4,0,throwkey);
|
||||
|
||||
throwkey.clear();
|
||||
throwkey.append((vehicle.rpm.rpm4 == 0)?(tr("保险|")):(tr("解除|")));
|
||||
throwkey.append((vehicle.rpm.rpm5 == 0)?(tr("工作")):(tr("上锁")));
|
||||
statusui->setValue(4,1,throwkey);
|
||||
|
||||
statusui->setValue(4,2,getBit(health,19)?(tr("已采集")):(tr("未采集")));//加速度采集
|
||||
statusui->setValue(4,3,getBit(health,14)?(tr("点火成功")):(tr("未点火")));
|
||||
|
||||
//========================5 battery
|
||||
statusui->setValue(5,0,QString::number(vehicle.sys_status.voltage_battery * 0.001,'f',1));
|
||||
statusui->setValue(5,1,QString::number(vehicle.battery_status.voltages[2] * 0.001,'f',1));
|
||||
|
||||
//========================6 dlink
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user