优化界面
This commit is contained in:
parent
58d4a43788
commit
7c6f069c31
@ -73,6 +73,7 @@ void Acceleration::readJsonFile(const QString &filePath)
|
||||
variables[i].clamp_value = temp_obj["clamp_value"].toDouble();
|
||||
}else if(variables[i].type == "bias_volt"){
|
||||
variables[i].clamp_value = temp_obj["clamp_value"].toDouble();
|
||||
variables[i].bias_voltage = temp_obj["bias_voltage"].toInt();
|
||||
}else if(variables[i].type == "1x_ampl"){
|
||||
variables[i].checked = temp_obj["checked"].toBool();
|
||||
variables[i].full_sacle_range = temp_obj["full_sacle_range"].toString();
|
||||
@ -179,13 +180,11 @@ void Acceleration::on_pushButton_confirm_clicked()
|
||||
variables[i].checked = ui->checkBox_1x_ampl->isChecked();
|
||||
variables[i].full_sacle_range = ui->comboBox_1x_value_range->currentText();
|
||||
variables[i].clamp_value = ui->doubleSpinBox_1x_ampl_clamp->value();
|
||||
}else if(variables[i].type == "1x_phase_lag"){
|
||||
variables[i].clamp_value = ui->doubleSpinBox_1x_phase_lag_clamp->value();
|
||||
}else if(variables[i].type == "2x_ampl"){
|
||||
variables[i].checked = ui->checkBox_2x_ampl->isChecked();
|
||||
variables[i].full_sacle_range = ui->comboBox_2x_value_range->currentText();
|
||||
variables[i].clamp_value = ui->doubleSpinBox_2x_ampl_clamp->value();
|
||||
}else if(variables[i].type == "2x_phase_lag"){
|
||||
variables[i].clamp_value = ui->doubleSpinBox_2x_phase_lag_clamp->value();
|
||||
}
|
||||
}
|
||||
|
@ -180,6 +180,7 @@ void KeyPhase::on_pushButton_confirm_clicked()
|
||||
temp_obj.insert("threshold", keyphase_variables[i].threshold);
|
||||
temp_obj.insert("hysteresis", keyphase_variables[i].hysteresis);
|
||||
temp_obj.insert("events_per_revolution", keyphase_variables[i].events_per_revolution);
|
||||
temp_obj.insert("automatic_threshold",keyphase_variables[i].automatic_threshold);
|
||||
chan_array.append(temp_obj);
|
||||
}
|
||||
json_obj.insert("chan", chan_array);
|
||||
|
@ -89,7 +89,7 @@ void Seismic_monitor::Init()
|
||||
ui->doubleSpinBox_low_1->setValue(seismic_monitor[i].normal_voltage_low);
|
||||
ui->doubleSpinBox_high_1->setValue(seismic_monitor[i].normal_voltage_high);
|
||||
if(seismic_monitor[i].sample_rate == "32000"){
|
||||
ui->comboBox_sample_rate_1->setCurrentText("32k");
|
||||
ui->comboBox_sample_rate_1->setCurrentText("32 k");
|
||||
}
|
||||
}
|
||||
if(seismic_monitor[i].id == 2){
|
||||
@ -106,7 +106,7 @@ void Seismic_monitor::Init()
|
||||
ui->doubleSpinBox_low_2->setValue(seismic_monitor[i].normal_voltage_low);
|
||||
ui->doubleSpinBox_high_2->setValue(seismic_monitor[i].normal_voltage_high);
|
||||
if(seismic_monitor[i].sample_rate == "32000"){
|
||||
ui->comboBox_sample_rate_2->setCurrentText("32k");
|
||||
ui->comboBox_sample_rate_2->setCurrentText("32 k");
|
||||
}
|
||||
}
|
||||
if(seismic_monitor[i].id == 3){
|
||||
@ -123,7 +123,7 @@ void Seismic_monitor::Init()
|
||||
ui->doubleSpinBox_low_3->setValue(seismic_monitor[i].normal_voltage_low);
|
||||
ui->doubleSpinBox_high_3->setValue(seismic_monitor[i].normal_voltage_high);
|
||||
if(seismic_monitor[i].sample_rate == "32000"){
|
||||
ui->comboBox_sample_rate_3->setCurrentText("32k");
|
||||
ui->comboBox_sample_rate_3->setCurrentText("32 k");
|
||||
}
|
||||
}
|
||||
if(seismic_monitor[i].id == 4){
|
||||
@ -140,7 +140,7 @@ void Seismic_monitor::Init()
|
||||
ui->doubleSpinBox_low_4->setValue(seismic_monitor[i].normal_voltage_low);
|
||||
ui->doubleSpinBox_high_4->setValue(seismic_monitor[i].normal_voltage_high);
|
||||
if(seismic_monitor[i].sample_rate == "32000"){
|
||||
ui->comboBox_sample_rate_4->setCurrentText("32k");
|
||||
ui->comboBox_sample_rate_4->setCurrentText("32 k");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -152,28 +152,32 @@ void Seismic_monitor::on_pushButton_confirm_clicked()
|
||||
seismic_monitor[var].transducer_name = ui->comboBox_transducer_name_1->currentText();
|
||||
seismic_monitor[var].scale_factor = ui->lineEdit_scale_factor_1->text();
|
||||
seismic_monitor[var].active = ui->checkBox_enable_1->isChecked();
|
||||
seismic_monitor[var].sample_rate = ui->comboBox_sample_rate_1->currentText();
|
||||
if(ui->comboBox_sample_rate_1->currentText() == "32 k")
|
||||
seismic_monitor[var].sample_rate = "32000";
|
||||
seismic_monitor[var].normal_voltage_low = ui->doubleSpinBox_low_1->value();
|
||||
seismic_monitor[var].normal_voltage_high = ui->doubleSpinBox_high_1->value();
|
||||
}else if(seismic_monitor[var].id == 2){
|
||||
seismic_monitor[var].transducer_name = ui->comboBox_transducer_name_2->currentText();
|
||||
seismic_monitor[var].scale_factor = ui->lineEdit_scale_factor_2->text();
|
||||
seismic_monitor[var].active = ui->checkBox_enable_2->isChecked();
|
||||
seismic_monitor[var].sample_rate = ui->comboBox_sample_rate_2->currentText();
|
||||
if(ui->comboBox_sample_rate_2->currentText() == "32 k")
|
||||
seismic_monitor[var].sample_rate = "32000";
|
||||
seismic_monitor[var].normal_voltage_low = ui->doubleSpinBox_low_2->value();
|
||||
seismic_monitor[var].normal_voltage_high = ui->doubleSpinBox_high_2->value();
|
||||
}else if(seismic_monitor[var].id == 3){
|
||||
seismic_monitor[var].transducer_name = ui->comboBox_transducer_name_3->currentText();
|
||||
seismic_monitor[var].scale_factor = ui->lineEdit_scale_factor_3->text();
|
||||
seismic_monitor[var].active = ui->checkBox_enable_3->isChecked();
|
||||
seismic_monitor[var].sample_rate = ui->comboBox_sample_rate_3->currentText();
|
||||
if(ui->comboBox_sample_rate_3->currentText() == "32 k")
|
||||
seismic_monitor[var].sample_rate = "32000";
|
||||
seismic_monitor[var].normal_voltage_low = ui->doubleSpinBox_low_3->value();
|
||||
seismic_monitor[var].normal_voltage_high = ui->doubleSpinBox_high_3->value();
|
||||
}else if(seismic_monitor[var].id == 4){
|
||||
seismic_monitor[var].transducer_name = ui->comboBox_transducer_name_4->currentText();
|
||||
seismic_monitor[var].scale_factor = ui->lineEdit_scale_factor_3->text();
|
||||
seismic_monitor[var].active = ui->checkBox_enable_4->isChecked();
|
||||
seismic_monitor[var].sample_rate = ui->comboBox_sample_rate_4->currentText();
|
||||
if(ui->comboBox_sample_rate_4->currentText() == "32 k")
|
||||
seismic_monitor[var].sample_rate = "32000";
|
||||
seismic_monitor[var].normal_voltage_low = ui->doubleSpinBox_low_4->value();
|
||||
seismic_monitor[var].normal_voltage_high = ui->doubleSpinBox_high_4->value();
|
||||
}
|
||||
@ -203,7 +207,7 @@ void Seismic_monitor::on_pushButton_confirm_clicked()
|
||||
monitor_obj["card_type"] = 1;
|
||||
QJsonDocument jsonDoc;
|
||||
jsonDoc.setObject(monitor_obj);
|
||||
QString file_name = QString("\\config\\seismic_monitor_slot_%1.json").arg(slot_no);
|
||||
QString file_name = QString("\\config\\%1\\seismic_monitor_slot.json").arg(slot_no);
|
||||
QFile file(QCoreApplication::applicationDirPath() + file_name);
|
||||
file.open(QIODevice::WriteOnly);
|
||||
file.write(jsonDoc.toJson());
|
||||
@ -220,50 +224,73 @@ void Seismic_monitor::on_pushButton_set_default_clicked()
|
||||
|
||||
void Seismic_monitor::on_pushButton_config_1_clicked()
|
||||
{
|
||||
for (int i = 0 ;i < CHANNLE_COUNT ; i++) {
|
||||
if(seismic_monitor[i].id == 1){
|
||||
if(ui->comboBox_chan_type_1->currentText() == "加速度"){
|
||||
channel = 1;
|
||||
Acceleration *acceleration = new Acceleration(slot_no,channel,seismic_monitor[i].active);
|
||||
if(ui->comboBox_chan_type_1->currentText() == "加速度"){
|
||||
Acceleration *acceleration = new Acceleration(slot_no,channel,ui->checkBox_enable_1->isChecked());
|
||||
acceleration->setWindowModality(Qt::ApplicationModal);
|
||||
acceleration->show();
|
||||
}else if(ui->comboBox_chan_type_1->currentText() == "位移"){
|
||||
channel = 1;
|
||||
Radial_vibration *radial_vibration = new Radial_vibration(slot_no,channel,seismic_monitor[i].active);
|
||||
Radial_vibration *radial_vibration = new Radial_vibration(slot_no,channel,ui->checkBox_enable_1->isChecked());
|
||||
radial_vibration->setWindowModality(Qt::ApplicationModal);
|
||||
radial_vibration->show();
|
||||
}else if(ui->comboBox_chan_type_1->currentText() == "速度"){
|
||||
channel = 1;
|
||||
Velocity *velocity = new Velocity(slot_no,channel,seismic_monitor[i].active);
|
||||
Velocity *velocity = new Velocity(slot_no,channel,ui->checkBox_enable_1->isChecked());
|
||||
velocity->setWindowModality(Qt::ApplicationModal);
|
||||
velocity->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Seismic_monitor::on_pushButton_config_3_clicked()
|
||||
void Seismic_monitor::on_pushButton_config_2_clicked()
|
||||
{
|
||||
for (int i = 0 ;i < CHANNLE_COUNT ; i++) {
|
||||
if(seismic_monitor[i].id == 3){
|
||||
if(seismic_monitor[i].channel_type == "加速度"){
|
||||
channel = 3;
|
||||
Acceleration *acceleration = new Acceleration(slot_no,channel,seismic_monitor[i].active);
|
||||
channel = 2;
|
||||
if(ui->comboBox_chan_type_2->currentText() == "加速度"){
|
||||
Acceleration *acceleration = new Acceleration(slot_no,channel,ui->checkBox_enable_2->isChecked());
|
||||
acceleration->setWindowModality(Qt::ApplicationModal);
|
||||
acceleration->show();
|
||||
}else if(seismic_monitor[i].channel_type == "位移"){
|
||||
channel = 3;
|
||||
Radial_vibration *radial_vibration = new Radial_vibration(slot_no,channel,seismic_monitor[i].active);
|
||||
}else if(ui->comboBox_chan_type_2->currentText() == "位移"){
|
||||
Radial_vibration *radial_vibration = new Radial_vibration(slot_no,channel,ui->checkBox_enable_2->isChecked());
|
||||
radial_vibration->setWindowModality(Qt::ApplicationModal);
|
||||
radial_vibration->show();
|
||||
}else if(seismic_monitor[i].channel_type == "速度"){
|
||||
channel = 3;
|
||||
Velocity *velocity = new Velocity(slot_no,channel,seismic_monitor[i].active);
|
||||
}else if(ui->comboBox_chan_type_2->currentText() == "速度"){
|
||||
|
||||
Velocity *velocity = new Velocity(slot_no,channel,ui->checkBox_enable_2->isChecked());
|
||||
velocity->setWindowModality(Qt::ApplicationModal);
|
||||
velocity->show();
|
||||
}
|
||||
}
|
||||
}
|
||||
void Seismic_monitor::on_pushButton_config_3_clicked()
|
||||
{
|
||||
channel = 3;
|
||||
if(ui->comboBox_chan_type_3->currentText() == "加速度"){
|
||||
Acceleration *acceleration = new Acceleration(slot_no,channel,ui->checkBox_enable_3->isChecked());
|
||||
acceleration->setWindowModality(Qt::ApplicationModal);
|
||||
acceleration->show();
|
||||
}else if(ui->comboBox_chan_type_3->currentText() == "位移"){
|
||||
Radial_vibration *radial_vibration = new Radial_vibration(slot_no,channel,ui->checkBox_enable_3->isChecked());
|
||||
radial_vibration->setWindowModality(Qt::ApplicationModal);
|
||||
radial_vibration->show();
|
||||
}else if(ui->comboBox_chan_type_3->currentText() == "速度"){
|
||||
Velocity *velocity = new Velocity(slot_no,channel,ui->checkBox_enable_3->isChecked());
|
||||
velocity->setWindowModality(Qt::ApplicationModal);
|
||||
velocity->show();
|
||||
}
|
||||
}
|
||||
|
||||
void Seismic_monitor::on_pushButton_config_4_clicked()
|
||||
{
|
||||
channel = 4;
|
||||
if(ui->comboBox_chan_type_4->currentText() == "加速度"){
|
||||
Acceleration *acceleration = new Acceleration(slot_no,channel,ui->checkBox_enable_4->isChecked());
|
||||
acceleration->setWindowModality(Qt::ApplicationModal);
|
||||
acceleration->show();
|
||||
}else if(ui->comboBox_chan_type_4->currentText() == "位移"){
|
||||
Radial_vibration *radial_vibration = new Radial_vibration(slot_no,channel,ui->checkBox_enable_4->isChecked());
|
||||
radial_vibration->setWindowModality(Qt::ApplicationModal);
|
||||
radial_vibration->show();
|
||||
}else if(ui->comboBox_chan_type_4->currentText() == "速度"){
|
||||
Velocity *velocity = new Velocity(slot_no,channel,ui->checkBox_enable_4->isChecked());
|
||||
velocity->setWindowModality(Qt::ApplicationModal);
|
||||
velocity->show();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,10 @@ private slots:
|
||||
|
||||
void on_pushButton_config_3_clicked();
|
||||
|
||||
void on_pushButton_config_2_clicked();
|
||||
|
||||
void on_pushButton_config_4_clicked();
|
||||
|
||||
private:
|
||||
Ui::Seismic_monitor *ui;
|
||||
|
||||
|
@ -199,7 +199,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_22">
|
||||
<property name="text">
|
||||
<string>=</string>
|
||||
<string>===</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
@ -281,7 +281,7 @@
|
||||
<x>200</x>
|
||||
<y>300</y>
|
||||
<width>120</width>
|
||||
<height>80</height>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
@ -1055,7 +1055,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>=</string>
|
||||
<string>===</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
@ -1905,7 +1905,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>=</string>
|
||||
<string>===</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
|
@ -356,6 +356,9 @@
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="radioButton_manual_threshold_1">
|
||||
<property name="geometry">
|
||||
@ -369,6 +372,9 @@
|
||||
<property name="text">
|
||||
<string> 手动</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_23">
|
||||
@ -495,6 +501,9 @@
|
||||
<property name="text">
|
||||
<string> 锁存</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup_2</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="radioButton_not_alert_latching_1">
|
||||
<property name="geometry">
|
||||
@ -511,6 +520,9 @@
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup_2</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QGroupBox" name="groupBox_4">
|
||||
@ -537,6 +549,9 @@
|
||||
<property name="text">
|
||||
<string> 锁存</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup_3</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="radioButton_not_overspeed_latching_1">
|
||||
<property name="geometry">
|
||||
@ -553,6 +568,9 @@
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup_3</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
@ -1624,7 +1642,7 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>310</x>
|
||||
<y>270</y>
|
||||
<y>280</y>
|
||||
<width>371</width>
|
||||
<height>91</height>
|
||||
</rect>
|
||||
@ -1695,7 +1713,7 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>110</y>
|
||||
<y>100</y>
|
||||
<width>251</width>
|
||||
<height>181</height>
|
||||
</rect>
|
||||
@ -2196,7 +2214,7 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>310</x>
|
||||
<y>270</y>
|
||||
<y>280</y>
|
||||
<width>371</width>
|
||||
<height>91</height>
|
||||
</rect>
|
||||
@ -2267,7 +2285,7 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>110</y>
|
||||
<y>100</y>
|
||||
<width>251</width>
|
||||
<height>181</height>
|
||||
</rect>
|
||||
@ -2479,4 +2497,9 @@
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="buttonGroup_3"/>
|
||||
<buttongroup name="buttonGroup"/>
|
||||
<buttongroup name="buttonGroup_2"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
@ -73,6 +73,7 @@ void Velocity::readJsonFile(const QString &filePath)
|
||||
variables[i].clamp_value = temp_obj["clamp_value"].toDouble();
|
||||
}else if(variables[i].type == "bias_volt"){
|
||||
variables[i].clamp_value = temp_obj["clamp_value"].toDouble();
|
||||
variables[i].bias_voltage = temp_obj["bias_voltage"].toInt();
|
||||
}else if(variables[i].type == "1x_ampl"){
|
||||
variables[i].checked = temp_obj["checked"].toBool();
|
||||
variables[i].full_sacle_range = temp_obj["full_sacle_range"].toString();
|
||||
@ -235,6 +236,7 @@ void Velocity::on_pushButton_confirm_clicked()
|
||||
temp_obj.insert("clamp_value",variables[i].clamp_value);
|
||||
}else if(variables[i].type == "bias_volt"){
|
||||
temp_obj.insert("clamp_value",variables[i].clamp_value);
|
||||
temp_obj.insert("bias_voltage",variables[i].bias_voltage);
|
||||
}else if(variables[i].type == "1x_ampl"){
|
||||
temp_obj.insert("checked",variables[i].checked);
|
||||
temp_obj.insert("full_sacle_range",variables[i].full_sacle_range);
|
||||
|
Loading…
x
Reference in New Issue
Block a user