From 21ea1b3f8ba08bd3923628456696d700ac0d7f75 Mon Sep 17 00:00:00 2001 From: zhangsheng Date: Wed, 26 Mar 2025 16:20:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8C=AF=E5=8A=A8=E6=9D=BF?= =?UTF-8?q?=E5=8D=A1=E7=95=8C=E9=9D=A2=EF=BC=8C=E5=8A=A0=E9=80=9F=E5=BA=A6?= =?UTF-8?q?=EF=BC=8C=E9=80=9F=E5=BA=A6=EF=BC=8C=E4=BD=8D=E7=A7=BB=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- acceleration.cpp | 7 + acceleration.h | 2 + acceleration.ui | 21 +-- data_config.h | 6 + doc/config/acceleration_variables_8_1.json | 46 ----- doc/config/filter_8_1.json | 24 --- doc/config/main.json | 24 +-- doc/config/seismic_monitor_slot_3.json | 71 ------- doc/config/seismic_monitor_slot_4.json | 71 ------- doc/config/transducer.json | 4 + radial_vibration.cpp | 1 + radial_vibration.ui | 83 +------- seismic_monitor.cpp | 133 ++++++++++++- seismic_monitor.h | 20 +- seismic_monitor.ui | 55 ++++-- tachometer.cpp | 18 +- tachometer.ui | 132 +------------ velocity.cpp | 7 + velocity.h | 2 + velocity.ui | 210 ++++++++------------- 20 files changed, 328 insertions(+), 609 deletions(-) delete mode 100644 doc/config/acceleration_variables_8_1.json delete mode 100644 doc/config/filter_8_1.json delete mode 100644 doc/config/seismic_monitor_slot_3.json delete mode 100644 doc/config/seismic_monitor_slot_4.json create mode 100644 doc/config/transducer.json diff --git a/acceleration.cpp b/acceleration.cpp index 1c20d89..128362f 100644 --- a/acceleration.cpp +++ b/acceleration.cpp @@ -271,6 +271,7 @@ void Acceleration::on_pushButton_confirm_clicked() } file.write(jsonDoc_variables.toJson()); file.close(); + this->close(); } @@ -279,3 +280,9 @@ void Acceleration::on_pushButton_set_default_clicked() } + +void Acceleration::on_pushButton_cancel_clicked() +{ + this->close(); +} + diff --git a/acceleration.h b/acceleration.h index 581c748..021ec74 100644 --- a/acceleration.h +++ b/acceleration.h @@ -23,6 +23,8 @@ private slots: void on_pushButton_set_default_clicked(); + void on_pushButton_cancel_clicked(); + private: Ui::Acceleration *ui; diff --git a/acceleration.ui b/acceleration.ui index 36d6148..0467c6b 100644 --- a/acceleration.ui +++ b/acceleration.ui @@ -107,7 +107,7 @@ - 1 + 0 @@ -1043,19 +1043,6 @@ - - - - - 100 - 35 - - - - 测点名称 - - - @@ -1071,6 +1058,9 @@ + + false + 100 @@ -1084,6 +1074,9 @@ + + false + 100 diff --git a/data_config.h b/data_config.h index e3a4cfb..85d8ffb 100644 --- a/data_config.h +++ b/data_config.h @@ -98,6 +98,12 @@ typedef struct{ int danger_response_time; }Tachometer_Variables; +typedef struct +{ + QString transducer_name; + double scale_factor; +}Transducer; + #pragma pack(1) typedef struct { uint8_t head[3]; // 固定值:0xAA55AA diff --git a/doc/config/acceleration_variables_8_1.json b/doc/config/acceleration_variables_8_1.json deleted file mode 100644 index 4abc311..0000000 --- a/doc/config/acceleration_variables_8_1.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "version": 1, - "slot":1, - "id":1, - "rms_active":true, - "integrate_active":true, - "variables":[ - { - "type":"direct", - "full_sacle_range":"0-20 m/s^2 pk", - "clamp_value":1.25 - }, - { - "type":"bias_volt", - "bias_voltage": -24, - "clamp_value":1.25 - }, - { - "type":"1x_ampl", - "full_sacle_range":"0-2 m/s^2 pk", - "clamp_value":1.25, - "phase_lag":180, - "checked":true - }, - { - "type":"2x_ampl", - "full_sacle_range":"0-2 m/s^2 pk", - "clamp_value":1.25, - "phase_lag":180, - "checked":true - } - ], - "delay":{ - "alert":30, - "danger":30.0, - "100ms":true - }, - "alert_latching":true, - "danger_latching":true, - "timed_ok":true, - "recorder_output":"direct", - "two_ma_clamp":true, - "trip_mutiply":1.00, - "comparision":"direct", - "comparision_percentage":5 -} \ No newline at end of file diff --git a/doc/config/filter_8_1.json b/doc/config/filter_8_1.json deleted file mode 100644 index 86ee443..0000000 --- a/doc/config/filter_8_1.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "slot":1, - "id":1, - "filter":[ - { - "type":"high_pass", - "low":5, - "high":1000, - "checked":true - }, - { - "type":"low_pass", - "low":5, - "high":1000, - "checked":true - }, - { - "type":"band_pass", - "low":5, - "high":1000, - "checked":true - } - ] -} \ No newline at end of file diff --git a/doc/config/main.json b/doc/config/main.json index d4e4397..acd19f8 100644 --- a/doc/config/main.json +++ b/doc/config/main.json @@ -7,49 +7,49 @@ }, { "chan_display": "振动", - "rack_type": "", + "rack_type": "Single", "slot": 1, "slot_type": "HAM824" }, { "chan_display": "振动", - "rack_type": "", + "rack_type": "Single", "slot": 2, "slot_type": "HAM824" }, { "chan_display": "振动", - "rack_type": "", + "rack_type": "Single", "slot": 3, "slot_type": "HAM824" }, { "chan_display": "振动", - "rack_type": "", + "rack_type": "Single", "slot": 4, "slot_type": "HAM824" }, { "chan_display": "键相", - "rack_type": "", + "rack_type": "Single", "slot": 5, "slot_type": "KPM834" }, { "chan_display": "键相", - "rack_type": "", + "rack_type": "Single", "slot": 6, "slot_type": "KPM834" }, { "chan_display": "键相", - "rack_type": "", + "rack_type": "Single", "slot": 7, "slot_type": "KPM834" }, { "chan_display": "转速", - "rack_type": "", + "rack_type": "Single", "slot": 8, "slot_type": "OPM844" }, @@ -73,25 +73,25 @@ }, { "chan_display": "继电器", - "rack_type": "", + "rack_type": "Single", "slot": 12, "slot_type": "DOM810" }, { "chan_display": "三冗余继电器", - "rack_type": "", + "rack_type": "TMR1", "slot": 13, "slot_type": "DOM810" }, { "chan_display": "三冗余继电器", - "rack_type": "", + "rack_type": "TMR2", "slot": 14, "slot_type": "DOM810" }, { "chan_display": "三冗余继电器", - "rack_type": "", + "rack_type": "TMR3", "slot": 15, "slot_type": "DOM810" } diff --git a/doc/config/seismic_monitor_slot_3.json b/doc/config/seismic_monitor_slot_3.json deleted file mode 100644 index 0938ca7..0000000 --- a/doc/config/seismic_monitor_slot_3.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "card_type": 1, - "chan": [ - { - "active": true, - "channel_name": "", - "channel_type": "acceleration", - "id": 1, - "normal_voltage_range": [ - 0, - 21 - ], - "rack_type": "TMR", - "sample_rate": "32 k", - "scale_factor": "10", - "standby": true, - "tmr_group": "1-3", - "transducer_name": "" - }, - { - "active": true, - "channel_name": "", - "channel_type": "acceleration", - "id": 2, - "normal_voltage_range": [ - 0, - 21 - ], - "rack_type": "TMR", - "sample_rate": "32 k", - "scale_factor": "10", - "standby": true, - "tmr_group": "1-3", - "transducer_name": "" - }, - { - "active": true, - "channel_name": "", - "channel_type": "velocity", - "id": 3, - "normal_voltage_range": [ - 0, - 21 - ], - "rack_type": "TMR", - "sample_rate": "32 k", - "scale_factor": "10", - "standby": true, - "tmr_group": "3-5", - "transducer_name": "" - }, - { - "active": true, - "channel_name": "", - "channel_type": "velocity", - "id": 4, - "normal_voltage_range": [ - 0, - 21 - ], - "rack_type": "TMR", - "sample_rate": "32 k", - "scale_factor": "10", - "standby": true, - "tmr_group": "3-5", - "transducer_name": "" - } - ], - "slot": 3, - "version": 1 -} diff --git a/doc/config/seismic_monitor_slot_4.json b/doc/config/seismic_monitor_slot_4.json deleted file mode 100644 index e314182..0000000 --- a/doc/config/seismic_monitor_slot_4.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "card_type": 1, - "chan": [ - { - "active": true, - "channel_name": "", - "channel_type": "", - "id": -1973791, - "normal_voltage_range": [ - null, - null - ], - "rack_type": "", - "sample_rate": "", - "scale_factor": "", - "standby": true, - "tmr_group": "", - "transducer_name": "" - }, - { - "active": true, - "channel_name": "", - "channel_type": "", - "id": -1973791, - "normal_voltage_range": [ - null, - null - ], - "rack_type": "", - "sample_rate": "", - "scale_factor": "", - "standby": true, - "tmr_group": "", - "transducer_name": "" - }, - { - "active": true, - "channel_name": "", - "channel_type": "", - "id": -1973791, - "normal_voltage_range": [ - null, - null - ], - "rack_type": "", - "sample_rate": "", - "scale_factor": "", - "standby": true, - "tmr_group": "", - "transducer_name": "" - }, - { - "active": true, - "channel_name": "", - "channel_type": "", - "id": -1973791, - "normal_voltage_range": [ - null, - null - ], - "rack_type": "", - "sample_rate": "", - "scale_factor": "", - "standby": true, - "tmr_group": "", - "transducer_name": "" - } - ], - "slot": 4, - "version": 1 -} diff --git a/doc/config/transducer.json b/doc/config/transducer.json new file mode 100644 index 0000000..48081b3 --- /dev/null +++ b/doc/config/transducer.json @@ -0,0 +1,4 @@ +[{"transducer_name":"测试1","scale_factor":1.25}, +{"transducer_name":"测试2","scale_factor":1.26}, +{"transducer_name":"测试3","scale_factor":1.27}, +{"transducer_name":"测试4","scale_factor":1.28}] \ No newline at end of file diff --git a/radial_vibration.cpp b/radial_vibration.cpp index a094f70..5189fe7 100644 --- a/radial_vibration.cpp +++ b/radial_vibration.cpp @@ -285,6 +285,7 @@ void Radial_vibration::on_pushButton_confirm_clicked() file_variables.write(jsonDoc_variables.toJson()); file_filter.close(); file_variables.close(); + this->close(); } diff --git a/radial_vibration.ui b/radial_vibration.ui index 914b81d..cfb7c2e 100644 --- a/radial_vibration.ui +++ b/radial_vibration.ui @@ -23,74 +23,12 @@ - 1 + 0 传感器和滤波配置 - - - - 10 - 180 - 241 - 131 - - - - 传感器方向 - - - - - 40 - 50 - 61 - 22 - - - - - - - 130 - 50 - 89 - 16 - - - - - - - - - - 130 - 70 - 89 - 16 - - - - - - - - - - 40 - 30 - 54 - 12 - - - - 角度 - - - @@ -1111,19 +1049,6 @@ - - - - - 100 - 35 - - - - 测点名称 - - - @@ -1139,6 +1064,9 @@ + + false + 100 @@ -1152,6 +1080,9 @@ + + false + 100 diff --git a/seismic_monitor.cpp b/seismic_monitor.cpp index 0963fc6..c9a09c0 100644 --- a/seismic_monitor.cpp +++ b/seismic_monitor.cpp @@ -17,6 +17,17 @@ Seismic_monitor::Seismic_monitor(int slot,QWidget *parent) : ui->setupUi(this); ui->widget_body->setProperty("flag", "body"); ui->comboBox_chan_type_1->setView(new QListView()); + ui->comboBox_chan_type_2->setView(new QListView()); + ui->comboBox_chan_type_3->setView(new QListView()); + ui->comboBox_chan_type_4->setView(new QListView()); + ui->comboBox_transducer_name_1->setView(new QListView()); + ui->comboBox_transducer_name_2->setView(new QListView()); + ui->comboBox_transducer_name_3->setView(new QListView()); + ui->comboBox_transducer_name_4->setView(new QListView()); + ui->comboBox_sample_rate_1->setView(new QListView()); + ui->comboBox_sample_rate_2->setView(new QListView()); + ui->comboBox_sample_rate_3->setView(new QListView()); + ui->comboBox_sample_rate_4->setView(new QListView()); slot_no = slot; QString slot_no_ = QString("%1").arg(slot_no); ui->label_slot_no->setText(slot_no_); @@ -70,9 +81,41 @@ void Seismic_monitor::readJsonFile(const QString &filePath) seismic_monitor[i].normal_voltage_low = voltage_range_array[0].toDouble(); seismic_monitor[i].normal_voltage_high = voltage_range_array[1].toDouble(); } + + QFile file_transducer(QCoreApplication::applicationDirPath() + QString("\\config\\transducer.json")); + if (!file_transducer.open(QIODevice::ReadOnly | QIODevice::Text)) { + qDebug() << "Cannot open file for reading:" << filePath; + return; + } + QString content_transducer = file_transducer.readAll(); + file_transducer.close(); + QByteArray jsonData2 = content_transducer.toUtf8(); + QJsonDocument jsonDoc2 = QJsonDocument::fromJson(jsonData2); + if (jsonDoc2.isNull()) { + qDebug() << "Cannot parse JSON document"; + return; + } + if (!jsonDoc2.isObject() && !jsonDoc2.isArray()) { + qDebug() << "JSON document is not an object or an array"; + return; + } + QJsonArray json_array = jsonDoc2.array(); + for (int var = 0; var < json_array.size(); ++var) { + Transducer transducer; + QJsonObject temp_obj = json_array[var].toObject(); + transducer.transducer_name = temp_obj["transducer_name"].toString(); + transducer.scale_factor = temp_obj["scale_factor"].toDouble(); + vec_transducer.push_back(transducer); + } } void Seismic_monitor::Init() { + for (int var = 0; var < vec_transducer.size(); ++var) { + ui->comboBox_transducer_name_1->addItem(vec_transducer[var].transducer_name); + ui->comboBox_transducer_name_2->addItem(vec_transducer[var].transducer_name); + ui->comboBox_transducer_name_3->addItem(vec_transducer[var].transducer_name); + ui->comboBox_transducer_name_4->addItem(vec_transducer[var].transducer_name); + } for (int i = 0; i < CHANNLE_COUNT; i++) { if(seismic_monitor[i].id == 1){ qDebug() << seismic_monitor[i].channel_type ; @@ -212,7 +255,7 @@ void Seismic_monitor::on_pushButton_confirm_clicked() file.open(QIODevice::WriteOnly); file.write(jsonDoc.toJson()); file.close(); - + this->close(); } @@ -294,3 +337,91 @@ void Seismic_monitor::on_pushButton_config_4_clicked() } } +void Seismic_monitor::on_comboBox_chan_type_1_currentTextChanged(const QString &arg1) +{ + if(ui->comboBox_chan_type_1->currentText() == "加速度"){ + ui->label_unit_1->setText("mV / m/s^2"); + }else if(ui->comboBox_chan_type_1->currentText() == "速度"){ + ui->label_unit_1->setText("mV / mm/s"); + }else if(ui->comboBox_chan_type_1->currentText() == "位移"){ + ui->label_unit_1->setText("mV / mm"); + } +} + + +void Seismic_monitor::on_comboBox_chan_type_2_currentTextChanged(const QString &arg1) +{ + if(ui->comboBox_chan_type_2->currentText() == "加速度"){ + ui->label_unit_2->setText("mV / m/s^2"); + }else if(ui->comboBox_chan_type_2->currentText() == "速度"){ + ui->label_unit_2->setText("mV / mm/s"); + }else if(ui->comboBox_chan_type_2->currentText() == "位移"){ + ui->label_unit_2->setText("mV / mm"); + } +} + + +void Seismic_monitor::on_comboBox_chan_type_3_currentTextChanged(const QString &arg1) +{ + if(ui->comboBox_chan_type_3->currentText() == "加速度"){ + ui->label_unit_3->setText("mV / m/s^2"); + }else if(ui->comboBox_chan_type_3->currentText() == "速度"){ + ui->label_unit_3->setText("mV / mm/s"); + }else if(ui->comboBox_chan_type_3->currentText() == "位移"){ + ui->label_unit_3->setText("mV / mm"); + } +} + + +void Seismic_monitor::on_comboBox_chan_type_4_currentTextChanged(const QString &arg1) +{ + if(ui->comboBox_chan_type_4->currentText() == "加速度"){ + ui->label_unit_4->setText("mV / m/s^2"); + }else if(ui->comboBox_chan_type_4->currentText() == "速度"){ + ui->label_unit_4->setText("mV / mm/s"); + }else if(ui->comboBox_chan_type_4->currentText() == "位移"){ + ui->label_unit_4->setText("mV / mm"); + } +} + +void Seismic_monitor::on_pushButton_cancel_clicked() +{ + this->close(); +} + +void Seismic_monitor::on_comboBox_transducer_name_1_currentTextChanged(const QString &arg1) +{ + for(int var = 0;var < vec_transducer.size();++var){ + if(ui->comboBox_transducer_name_1->currentText() == vec_transducer[var].transducer_name){ + ui->lineEdit_scale_factor_1->setText(QString::number(vec_transducer[var].scale_factor)); + } + } +} + +void Seismic_monitor::on_comboBox_transducer_name_2_currentTextChanged(const QString &arg1) +{ + for(int var = 0;var < vec_transducer.size();++var){ + if(ui->comboBox_transducer_name_2->currentText() == vec_transducer[var].transducer_name){ + ui->lineEdit_scale_factor_2->setText(QString::number(vec_transducer[var].scale_factor)); + } + } +} + +void Seismic_monitor::on_comboBox_transducer_name_3_currentTextChanged(const QString &arg1) +{ + for(int var = 0;var < vec_transducer.size();++var){ + if(ui->comboBox_transducer_name_3->currentText() == vec_transducer[var].transducer_name){ + ui->lineEdit_scale_factor_3->setText(QString::number(vec_transducer[var].scale_factor)); + } + } +} + +void Seismic_monitor::on_comboBox_transducer_name_4_currentTextChanged(const QString &arg1) +{ + for(int var = 0;var < vec_transducer.size();++var){ + if(ui->comboBox_transducer_name_4->currentText() == vec_transducer[var].transducer_name){ + ui->lineEdit_scale_factor_4->setText(QString::number(vec_transducer[var].scale_factor)); + } + } +} + diff --git a/seismic_monitor.h b/seismic_monitor.h index 11d2a8e..18d8926 100644 --- a/seismic_monitor.h +++ b/seismic_monitor.h @@ -30,13 +30,31 @@ private slots: void on_pushButton_config_4_clicked(); + void on_comboBox_chan_type_1_currentTextChanged(const QString &arg1); + + void on_comboBox_chan_type_2_currentTextChanged(const QString &arg1); + + void on_comboBox_chan_type_3_currentTextChanged(const QString &arg1); + + void on_comboBox_chan_type_4_currentTextChanged(const QString &arg1); + + void on_pushButton_cancel_clicked(); + + void on_comboBox_transducer_name_1_currentTextChanged(const QString &arg1); + + void on_comboBox_transducer_name_2_currentTextChanged(const QString &arg1); + + void on_comboBox_transducer_name_3_currentTextChanged(const QString &arg1); + + void on_comboBox_transducer_name_4_currentTextChanged(const QString &arg1); + private: Ui::Seismic_monitor *ui; int card_type; void readJsonFile(const QString &filePath); SeismicMonitor seismic_monitor[CHANNLE_COUNT]; - + QVector vec_transducer; void Init(); }; diff --git a/seismic_monitor.ui b/seismic_monitor.ui index 9a54ae4..400bf02 100644 --- a/seismic_monitor.ui +++ b/seismic_monitor.ui @@ -119,19 +119,6 @@ - - - - - 100 - 35 - - - - 测点名称 - - - @@ -147,6 +134,9 @@ + + false + 100 @@ -160,6 +150,9 @@ + + false + 100 @@ -339,7 +332,7 @@ - 0 + 1 @@ -494,7 +487,7 @@ - + mv/ m/s^2 @@ -600,6 +593,9 @@ 16777215 + + -100.000000000000000 + @@ -643,6 +639,9 @@ 16777215 + + -100.000000000000000 + @@ -825,7 +824,7 @@ - + mv/ m/s^2 @@ -937,6 +936,9 @@ 16777215 + + -100.000000000000000 + @@ -986,6 +988,9 @@ 16777215 + + -100.000000000000000 + @@ -1201,7 +1206,7 @@ - 0 + 1 @@ -1356,7 +1361,7 @@ - + mv/ m/s @@ -1462,6 +1467,9 @@ 16777215 + + -100.000000000000000 + @@ -1505,6 +1513,9 @@ 16777215 + + -100.000000000000000 + @@ -1687,7 +1698,7 @@ - + mv/ m/s^2 @@ -1793,6 +1804,9 @@ 16777215 + + -100.000000000000000 + @@ -1836,6 +1850,9 @@ 16777215 + + -100.000000000000000 + diff --git a/tachometer.cpp b/tachometer.cpp index 999595e..09b4ff8 100644 --- a/tachometer.cpp +++ b/tachometer.cpp @@ -113,10 +113,7 @@ void Tachometer::Init() ui->radioButton_overspeed_latching_2->setCheckable(true); else ui->radioButton_overspeed_latching_2->setCheckable(false); - if(tachometer_variables[i].normal_latching) - ui->radioButton_normal_latching_2->setCheckable(true); - else - ui->radioButton_not_normal_latching_2->setCheckable(false); + } if(tachometer_variables[i].id == 3){ ui->checkBox_chan_3->setChecked(tachometer_variables[i].active); @@ -139,10 +136,7 @@ void Tachometer::Init() ui->radioButton_overspeed_latching_3->setCheckable(true); else ui->radioButton_overspeed_latching_3->setCheckable(false); - if(tachometer_variables[i].normal_latching) - ui->radioButton_normal_latching_3->setCheckable(true); - else - ui->radioButton_not_normal_latching_3->setCheckable(false); + } if(tachometer_variables[i].id == 4){ ui->checkBox_chan_4->setChecked(tachometer_variables[i].active); @@ -165,10 +159,7 @@ void Tachometer::Init() ui->radioButton_overspeed_latching_4->setCheckable(true); else ui->radioButton_overspeed_latching_4->setCheckable(false); - if(tachometer_variables[i].normal_latching) - ui->radioButton_normal_latching_4->setCheckable(true); - else - ui->radioButton_not_normal_latching_4->setCheckable(false); + } } } @@ -201,7 +192,6 @@ void Tachometer::on_pushButton_confirm_clicked() tachometer_variables[i].two_ma_clamp = ui->checkBox_two_ma_clamp_2->isChecked(); tachometer_variables[i].alert_latching = ui->radioButton_alert_latching_2->isChecked(); tachometer_variables[i].overspeed_latching = ui->radioButton_overspeed_latching_2->isChecked(); - tachometer_variables[i].normal_latching = ui->radioButton_normal_latching_2->isChecked(); } if(tachometer_variables[i].id == 3){ tachometer_variables[i].active = ui->checkBox_chan_3->isChecked(); @@ -215,7 +205,6 @@ void Tachometer::on_pushButton_confirm_clicked() tachometer_variables[i].two_ma_clamp = ui->checkBox_two_ma_clamp_3->isChecked(); tachometer_variables[i].alert_latching = ui->radioButton_alert_latching_3->isChecked(); tachometer_variables[i].overspeed_latching = ui->radioButton_overspeed_latching_3->isChecked(); - tachometer_variables[i].normal_latching = ui->radioButton_normal_latching_3->isChecked(); } if(tachometer_variables[i].id == 4){ tachometer_variables[i].active = ui->checkBox_chan_4->isChecked(); @@ -229,7 +218,6 @@ void Tachometer::on_pushButton_confirm_clicked() tachometer_variables[i].two_ma_clamp = ui->checkBox_two_ma_clamp_4->isChecked(); tachometer_variables[i].alert_latching = ui->radioButton_alert_latching_4->isChecked(); tachometer_variables[i].overspeed_latching = ui->radioButton_overspeed_latching_4->isChecked(); - tachometer_variables[i].normal_latching = ui->radioButton_normal_latching_4->isChecked(); } } QString slot = QString("%1").arg(slot_no); diff --git a/tachometer.ui b/tachometer.ui index deaad93..3daa3bb 100644 --- a/tachometer.ui +++ b/tachometer.ui @@ -712,48 +712,6 @@ 通道 2 - - - - 310 - 20 - 151 - 91 - - - - 正常模式 - - - - - 30 - 30 - 71 - 20 - - - - 锁存 - - - - - - 30 - 60 - 71 - 20 - - - - 非锁存 - - - true - - - @@ -1023,7 +981,7 @@ - 480 + 310 20 191 91 @@ -1553,7 +1511,7 @@ - 480 + 310 20 191 91 @@ -1596,48 +1554,6 @@ - - - - 310 - 20 - 151 - 91 - - - - 正常模式 - - - - - 30 - 30 - 71 - 20 - - - - 锁存 - - - - - - 30 - 60 - 71 - 20 - - - - 非锁存 - - - true - - - @@ -2125,7 +2041,7 @@ - 470 + 310 20 191 91 @@ -2168,48 +2084,6 @@ - - - - 310 - 20 - 151 - 91 - - - - 正常模式 - - - - - 30 - 30 - 71 - 20 - - - - 锁存 - - - - - - 30 - 60 - 71 - 20 - - - - 非锁存 - - - true - - - diff --git a/velocity.cpp b/velocity.cpp index b222785..f222b18 100644 --- a/velocity.cpp +++ b/velocity.cpp @@ -279,5 +279,12 @@ void Velocity::on_pushButton_confirm_clicked() } variables_file.write(variables_data); variables_file.close(); + this->close(); +} + + +void Velocity::on_pushButton_cancel_clicked() +{ + this->close(); } diff --git a/velocity.h b/velocity.h index b2a176a..f93d6b7 100644 --- a/velocity.h +++ b/velocity.h @@ -21,6 +21,8 @@ public: private slots: void on_pushButton_confirm_clicked(); + void on_pushButton_cancel_clicked(); + private: Ui::Velocity *ui; diff --git a/velocity.ui b/velocity.ui index 501a7f3..cd7d1a7 100644 --- a/velocity.ui +++ b/velocity.ui @@ -6,7 +6,7 @@ 0 0 - 754 + 717 582 @@ -23,7 +23,7 @@ - 1 + 0 @@ -980,138 +980,88 @@ - + - 11 - 531 - 100 - 35 + 20 + 530 + 661 + 37 - - - 100 - 35 - - - - 确定 - - - - - - 117 - 531 - 100 - 35 - - - - - 100 - 35 - - - - 设置为默认值 - - - - - - 223 - 531 - 100 - 35 - - - - - 100 - 35 - - - - 加载预定义模板 - - - - - - 329 - 531 - 100 - 35 - - - - - 100 - 35 - - - - 测点名称 - - - - - - 435 - 531 - 100 - 35 - - - - - 100 - 35 - - - - 取消 - - - - - - 541 - 531 - 100 - 35 - - - - - 100 - 35 - - - - 打印 - - - - - - 647 - 531 - 100 - 35 - - - - - 100 - 35 - - - - 帮助 - + + + + + + 100 + 35 + + + + 确定 + + + + + + + + 100 + 35 + + + + 设置为默认值 + + + + + + + + 100 + 35 + + + + 取消 + + + + + + + false + + + + 100 + 35 + + + + 打印 + + + + + + + false + + + + 100 + 35 + + + + 帮助 + + + +