界面的一些修改
This commit is contained in:
@@ -28,6 +28,9 @@ GlobalSetting::GlobalSetting(QWidget *parent) :
|
||||
emit setGCSID(id.toInt());//设置全局ID
|
||||
|
||||
|
||||
on_pushButton_getServoOffset_clicked();
|
||||
|
||||
|
||||
}
|
||||
|
||||
GlobalSetting::~GlobalSetting()
|
||||
@@ -51,6 +54,9 @@ void GlobalSetting::on_pushButton_setGCSID_clicked()
|
||||
|
||||
cfg->deleteLater();
|
||||
delete cfg;
|
||||
|
||||
emit showMessage(tr("设置本机ID成功,ID:%1").arg(QString::number(id)));
|
||||
|
||||
}
|
||||
|
||||
void GlobalSetting::getGCSID(void)
|
||||
@@ -60,4 +66,71 @@ void GlobalSetting::getGCSID(void)
|
||||
QVariant id;
|
||||
cfg->get_GCS_ID(&id);
|
||||
emit setGCSID(id.toInt());//设置全局ID
|
||||
|
||||
delete cfg;
|
||||
|
||||
emit showMessage(tr("设置本机ID成功,ID:%1").arg(QString::number(id.toInt())));
|
||||
}
|
||||
|
||||
|
||||
void GlobalSetting::getServo(void)
|
||||
{
|
||||
on_pushButton_getServoOffset_clicked();
|
||||
}
|
||||
|
||||
|
||||
void GlobalSetting::on_pushButton_getServoOffset_clicked()
|
||||
{
|
||||
Config *cfg = new Config();
|
||||
|
||||
QVariant la;
|
||||
QVariant ra;
|
||||
QVariant le;
|
||||
QVariant re;
|
||||
QVariant ru;
|
||||
|
||||
cfg->getServoOffset(&la,&ra,&le,&re,&ru);
|
||||
|
||||
ui->doubleSpinBox_la->setValue(la.toDouble());
|
||||
ui->doubleSpinBox_ra->setValue(ra.toDouble());
|
||||
ui->doubleSpinBox_le->setValue(le.toDouble());
|
||||
ui->doubleSpinBox_re->setValue(re.toDouble());
|
||||
ui->doubleSpinBox_ru->setValue(ru.toDouble());
|
||||
|
||||
emit setServo(la,ra,le,re,ru);
|
||||
|
||||
delete cfg;
|
||||
|
||||
emit showMessage(tr("舵面偏差读取成功"));
|
||||
|
||||
}
|
||||
|
||||
void GlobalSetting::on_pushButton_setServoOffset_clicked()
|
||||
{
|
||||
QVariant la;
|
||||
QVariant ra;
|
||||
QVariant le;
|
||||
QVariant re;
|
||||
QVariant ru;
|
||||
|
||||
la = ui->doubleSpinBox_la->value();
|
||||
ra = ui->doubleSpinBox_ra->value();
|
||||
le = ui->doubleSpinBox_le->value();
|
||||
re = ui->doubleSpinBox_re->value();
|
||||
ru = ui->doubleSpinBox_ru->value();
|
||||
|
||||
|
||||
emit setServo(la,ra,le,re,ru);
|
||||
|
||||
|
||||
Config *cfg = new Config();
|
||||
|
||||
cfg->setServoOffset(la,ra,le,re,ru);
|
||||
|
||||
cfg->deleteLater();
|
||||
delete cfg;
|
||||
|
||||
|
||||
emit showMessage(tr("舵面偏差设置成功"));
|
||||
|
||||
}
|
||||
|
||||
@@ -20,13 +20,25 @@ public:
|
||||
|
||||
|
||||
void getGCSID(void);
|
||||
void getServo(void);
|
||||
|
||||
private slots:
|
||||
void on_pushButton_setGCSID_clicked();
|
||||
|
||||
void on_pushButton_getServoOffset_clicked();
|
||||
|
||||
void on_pushButton_setServoOffset_clicked();
|
||||
|
||||
signals:
|
||||
void showMessage(const QString &message,int TimeOut = 0);
|
||||
|
||||
void setGCSID(int id);
|
||||
|
||||
void setServo(QVariant la,QVariant ra,
|
||||
QVariant le,QVariant re,
|
||||
QVariant ru);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
Ui::GlobalSetting *ui;
|
||||
|
||||
@@ -15,17 +15,97 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>舵机偏差</string>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>302</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>右副翼</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_la">
|
||||
<property name="minimum">
|
||||
<double>-99.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QPushButton" name="pushButton_setServoOffset">
|
||||
<property name="text">
|
||||
<string>保存</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>左升降</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_re">
|
||||
<property name="minimum">
|
||||
<double>-99.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QPushButton" name="pushButton_getServoOffset">
|
||||
<property name="text">
|
||||
<string>读取</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" 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_6">
|
||||
<property name="text">
|
||||
<string>左副翼</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_ru">
|
||||
<property name="minimum">
|
||||
<double>-99.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>右升降</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_ra">
|
||||
<property name="minimum">
|
||||
<double>-99.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_le">
|
||||
<property name="minimum">
|
||||
<double>-99.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
@@ -53,6 +133,19 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>302</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
|
||||
Reference in New Issue
Block a user