This commit is contained in:
hm
2021-05-13 09:17:59 +08:00
parent 35098e2a5c
commit b38e0abc8b
12 changed files with 166 additions and 289 deletions
+26 -1
View File
@@ -17,6 +17,9 @@ GlobalSetting::GlobalSetting(QWidget *parent) :
ui->comboBox_Beep->addItem(tr(""),true);
ui->comboBox_Beep->addItem(tr(""),false);
ui->comboBox_TTS->addItem(tr(""),true);
ui->comboBox_TTS->addItem(tr(""),false);
Config *cfg = new Config();
@@ -29,6 +32,9 @@ GlobalSetting::GlobalSetting(QWidget *parent) :
ui->comboBox_Beep->setCurrentIndex(ui->comboBox_Beep->findData(beep.toBool()));
QVariant tts;
cfg->getTTS(&tts);
ui->comboBox_TTS->setCurrentIndex(ui->comboBox_TTS->findData(beep.toBool()));
emit setGCSID(id.toInt());//设置全局ID
@@ -222,5 +228,24 @@ void GlobalSetting::on_pushButton_Beep_clicked()
delete cfg;
emit showMessage((state.toBool())?(tr("声音开启")):(tr("声音关闭")));
emit showMessage((state.toBool())?(tr("心跳声音开启")):(tr("心跳声音关闭")));
}
void GlobalSetting::on_pushButton_TTS_clicked()
{
QVariant state;
state = ui->comboBox_TTS->currentData();
emit setTTS(state.toBool());
Config *cfg = new Config();
cfg->setTTS(state);
cfg->deleteLater();
delete cfg;
emit showMessage((state.toBool())?(tr("语音提示开启")):(tr("语音提示关闭")));
}
@@ -36,6 +36,8 @@ private slots:
void on_pushButton_Beep_clicked();
void on_pushButton_TTS_clicked();
signals:
void showMessage(const QString &message,int TimeOut = 0);
@@ -50,6 +52,8 @@ signals:
void setBeep(QVariant beep);
void setTTS(QVariant flag);
private:
Ui::GlobalSetting *ui;
};
+47 -11
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>533</width>
<height>454</height>
<width>738</width>
<height>472</height>
</rect>
</property>
<property name="windowTitle">
@@ -139,10 +139,10 @@
<string>ID设置</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<item row="1" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>设置地面站ID号</string>
<string>心跳声</string>
</property>
</widget>
</item>
@@ -156,6 +156,16 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_Beep"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>地面站ID号</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="pushButton_Beep">
<property name="text">
@@ -163,13 +173,20 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_Beep"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_9">
<item row="2" column="2">
<widget class="QPushButton" name="pushButton_TTS">
<property name="text">
<string>心跳声开关</string>
<string>Set</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBox_TTS"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>提示声</string>
</property>
</widget>
</item>
@@ -219,8 +236,27 @@
</layout>
</widget>
</item>
<item row="1" column="1">
<widget class="QQuickWidget" name="quickWidget">
<property name="resizeMode">
<enum>QQuickWidget::SizeRootObjectToView</enum>
</property>
<property name="source">
<url>
<string>qrc:/App/qml/base.qml</string>
</url>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QQuickWidget</class>
<extends>QWidget</extends>
<header location="global">QtQuickWidgets/QQuickWidget</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
@@ -274,6 +274,7 @@ void ParameterInspector::clearview(void)
for (vehicle_ite=vehicles.begin(); vehicle_ite!=vehicles.end();++vehicle_ite)
{
vehicle_ite.value().clear();
//delete vehicle_ite.value();
//vehicle_ite.value() = NULL;
@@ -1,264 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ParameterInspector</class>
<widget class="QWidget" name="ParameterInspector">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>768</width>
<height>580</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="1" rowspan="2">
<layout class="QGridLayout" name="gridLayout">
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="label_3">
<property name="maximumSize">
<size>
<width>180</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="CancelpushButton">
<property name="minimumSize">
<size>
<width>120</width>
<height>60</height>
</size>
</property>
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QPushButton" name="pushButton_id">
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QPushButton" name="pushButton_value">
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QPushButton" name="pushButton_Save">
<property name="minimumSize">
<size>
<width>120</width>
<height>60</height>
</size>
</property>
<property name="text">
<string>Save</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="WriteButton">
<property name="minimumSize">
<size>
<width>120</width>
<height>60</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>75</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>write</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QPushButton" name="pushButton_Load">
<property name="minimumSize">
<size>
<width>120</width>
<height>60</height>
</size>
</property>
<property name="text">
<string>Load</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLineEdit" name="lineEdit">
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QSplitter" name="splitter_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QWidget" name="layoutWidget">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButton_system">
<property name="minimumSize">
<size>
<width>0</width>
<height>60</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clearButton">
<property name="minimumSize">
<size>
<width>120</width>
<height>60</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ReadButton">
<property name="minimumSize">
<size>
<width>120</width>
<height>60</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>read</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>PushButton</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="1" column="0">
<widget class="QTreeWidget" name="treeWidget">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="columnCount">
<number>1</number>
</property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<attribute name="headerMinimumSectionSize">
<number>50</number>
</attribute>
<attribute name="headerDefaultSectionSize">
<number>200</number>
</attribute>
<attribute name="headerHighlightSections">
<bool>false</bool>
</attribute>
<attribute name="headerShowSortIndicator" stdset="0">
<bool>false</bool>
</attribute>
<attribute name="headerStretchLastSection">
<bool>true</bool>
</attribute>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QProgressBar" name="progressBar">
<property name="value">
<number>0</number>
</property>
<property name="textDirection">
<enum>QProgressBar::BottomToTop</enum>
</property>
<property name="format">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>