diff --git a/acceleration.cpp b/acceleration.cpp index 77b6e77..a26746e 100644 --- a/acceleration.cpp +++ b/acceleration.cpp @@ -25,6 +25,8 @@ Acceleration::Acceleration(int slot_no_, int channel_, bool active, QWidget *par } else { ui->label_active->setText("(停用)"); } + ui->comboBox_fre_domain_resolution->setCurrentIndex(2); + ui->comboBox_lines_number->setCurrentIndex(2); Init(); } @@ -92,7 +94,9 @@ void Acceleration::Init() { ui->checkBox_alert_low_enable->setChecked(variable_ptr->alert_low.enable); ui->checkBox_alert_low_latch->setChecked(variable_ptr->alert_low.latch); - // + // freband output + ui->comboBox_fre_domain_resolution->setCurrentText(QString::number( variable_ptr->freband_output_item.fre_domain_resolution)); + ui->comboBox_lines_number->setCurrentText(QString::number( variable_ptr->freband_output_item.lines_number)); ui->checkBox_enable->setChecked(variable_ptr->freband_output[0].enable); ui->lineEdit_start->setText(QString::number(variable_ptr->freband_output[0].start)); ui->lineEdit_end->setText(QString::number(variable_ptr->freband_output[0].end)); @@ -189,6 +193,8 @@ void Acceleration::on_pushButton_confirm_clicked() { variable->alert_low.enable = ui->checkBox_alert_low_enable->isChecked(); variable->alert_low.latch = ui->checkBox_alert_low_latch->isChecked(); // -freband output + variable->freband_output_item.fre_domain_resolution = ui->comboBox_fre_domain_resolution->currentText().toFloat(); + variable->freband_output_item.lines_number = ui->comboBox_lines_number->currentText().toInt(); variable->freband_output[0].enable = ui->checkBox_enable->isChecked(); variable->freband_output[0].start = ui->lineEdit_start->text().toDouble(); variable->freband_output[0].end = ui->lineEdit_end->text().toDouble(); @@ -263,6 +269,8 @@ void Acceleration::on_pushButton_confirm_clicked() { variable->alert_low.enable = ui->checkBox_alert_low_enable->isChecked(); variable->alert_low.latch = ui->checkBox_alert_low_latch->isChecked(); // -freband output + variable->freband_output_item.fre_domain_resolution = ui->comboBox_fre_domain_resolution->currentText().toFloat(); + variable->freband_output_item.lines_number = ui->comboBox_lines_number->currentText().toInt(); variable->freband_output[0].enable = ui->checkBox_enable->isChecked(); variable->freband_output[0].start = ui->lineEdit_start->text().toDouble(); variable->freband_output[0].end = ui->lineEdit_end->text().toDouble(); diff --git a/acceleration.ui b/acceleration.ui index ee7fb70..5c95826 100644 --- a/acceleration.ui +++ b/acceleration.ui @@ -107,7 +107,7 @@ - 0 + 2 @@ -1170,7 +1170,7 @@ 分频段选择 - + @@ -1347,7 +1347,7 @@ - false + true 使能 @@ -1357,7 +1357,7 @@ - false + true @@ -1370,7 +1370,7 @@ - false + true @@ -1387,7 +1387,7 @@ - false + true 使能 @@ -1397,7 +1397,7 @@ - false + true @@ -1410,7 +1410,7 @@ - false + true @@ -1427,7 +1427,7 @@ - false + true 使能 @@ -1437,7 +1437,7 @@ - false + true @@ -1450,7 +1450,7 @@ - false + true @@ -1467,7 +1467,7 @@ - false + true 使能 @@ -1477,7 +1477,7 @@ - false + true @@ -1490,7 +1490,7 @@ - false + true @@ -1507,7 +1507,7 @@ - false + true 使能 @@ -1517,7 +1517,7 @@ - false + true @@ -1530,7 +1530,7 @@ - false + true @@ -1547,7 +1547,7 @@ - false + true 使能 @@ -1557,7 +1557,7 @@ - false + true @@ -1570,7 +1570,7 @@ - false + true @@ -1598,17 +1598,121 @@ - - - Qt::Horizontal - - - - 231 - 20 - - - + + + + + + + + 125 + 0 + + + + 频域分辨率(Hz): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 125 + 0 + + + + + 1 + + + + + 2 + + + + + 2.5 + + + + + 5 + + + + + + + + + + + + + 125 + 0 + + + + 线数: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 125 + 0 + + + + + 400 + + + + + 800 + + + + + 1600 + + + + + 3200 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + diff --git a/cardbase.h b/cardbase.h index 3d89ae8..359599f 100644 --- a/cardbase.h +++ b/cardbase.h @@ -39,6 +39,7 @@ class VariableBase { AlarmAlertLow gap_alert_low; FrequencybandOutput freband_output[10]; + FrequencybandOutputItem freband_output_item; }; // 位移 diff --git a/config_mgr.cpp b/config_mgr.cpp index 186f055..40ffaba 100644 --- a/config_mgr.cpp +++ b/config_mgr.cpp @@ -303,7 +303,7 @@ void ConfigMgr::Save(QString & file_path) { alarm["alert_high_latch"] = pressure_ptr->alert_high.latch; processed_output["general"] = general; processed_output["alarm"] = alarm; - QJsonObject freband_output,number; + QJsonObject freband_output,number,item; for (int var = 0; var < 10; ++var) { if(pressure_ptr->freband_output[var].start != 0 || pressure_ptr->freband_output[var].end != 0){ freband_output["enable"] = pressure_ptr->freband_output[var].enable; @@ -312,6 +312,9 @@ void ConfigMgr::Save(QString & file_path) { number[QString::number(var + 1)] = freband_output; } } + item["fre_domain_resolution"] = pressure_ptr->freband_output_item.fre_domain_resolution; + item["lines_number"] = pressure_ptr->freband_output_item.lines_number; + number["config_params"] = item; variables["freband_output"] = number; variables["processed_output"] = processed_output; @@ -367,7 +370,7 @@ void ConfigMgr::Save(QString & file_path) { processed_output["general"] = general; processed_output["alarm"] = alarm; variables["processed_output"] = processed_output; - QJsonObject freband_output,number; + QJsonObject freband_output,number,item; for (int var = 0; var < 10; ++var) { if(av_ptr->freband_output[var].start != 0 || av_ptr->freband_output[var].end != 0){ freband_output["enable"] = av_ptr->freband_output[var].enable; @@ -376,6 +379,9 @@ void ConfigMgr::Save(QString & file_path) { number[QString::number(var + 1)] = freband_output; } } + item["fre_domain_resolution"] = av_ptr->freband_output_item.fre_domain_resolution; + item["lines_number"] = av_ptr->freband_output_item.lines_number; + number["config_params"] = item; variables["freband_output"] = number; }else if(ptr->base_config_[cid].channel_type == kVibVelocity){ @@ -925,7 +931,7 @@ void ConfigMgr::Load(QString filename) { // variable->alert_low.enable = alarm["alert_low_enable"].toBool(); // variable->alert_low.latch = alarm["alert_low_latch"].toBool(); QJsonObject freband_output_obj = tmp_variable["freband_output"].toObject(); - QJsonObject number_obj; + QJsonObject number_obj,config_params; for (int k = 0; k < 10; ++k) { number_obj = freband_output_obj[QString::number(k + 1)].toObject(); if(number_obj.isEmpty()) @@ -936,6 +942,11 @@ void ConfigMgr::Load(QString filename) { output.end = number_obj["end"].toInt(); variable->freband_output[k] = output; } + config_params = freband_output_obj["config_params"].toObject(); + if(!config_params.isEmpty()){ + variable->freband_output_item.fre_domain_resolution = config_params["fre_domain_resolution"].toDouble(); + variable->freband_output_item.lines_number = config_params["lines_number"].toInt(); + } vib_data->variables_.push_back(variable); break; } @@ -1019,7 +1030,7 @@ void ConfigMgr::Load(QString filename) { // variable->alert_low.enable = alarm["alert_low_enable"].toBool(); // variable->alert_low.latch = alarm["alert_low_latch"].toBool(); QJsonObject freband_output_obj = tmp_variable["freband_output"].toObject(); - QJsonObject number_obj; + QJsonObject number_obj,config_params; for (int k = 0; k < 10; ++k) { number_obj = freband_output_obj[QString::number(k + 1)].toObject(); if(number_obj.isEmpty()) @@ -1030,6 +1041,11 @@ void ConfigMgr::Load(QString filename) { output.end = number_obj["end"].toInt(); variable->freband_output[k] = output; } + config_params = freband_output_obj["config_params"].toObject(); + if(!config_params.isEmpty()){ + variable->freband_output_item.fre_domain_resolution = config_params["fre_domain_resolution"].toDouble(); + variable->freband_output_item.lines_number = config_params["lines_number"].toInt(); + } vib_data->variables_.push_back(variable); break; } diff --git a/data_config.h b/data_config.h index 83dfbf7..da979f4 100644 --- a/data_config.h +++ b/data_config.h @@ -334,6 +334,15 @@ typedef struct FrequencybandOutput_{ } }FrequencybandOutput ; +typedef struct FrequencybandOutputItem_ { + float fre_domain_resolution; + int lines_number; + FrequencybandOutputItem_(){ + fre_domain_resolution = 2.5; + lines_number = 1600; + } +}FrequencybandOutputItem; + typedef struct DCOutput_{ int output_channel; float minmum; diff --git a/pressure_pulsation.cpp b/pressure_pulsation.cpp index f6d14dd..8b33008 100644 --- a/pressure_pulsation.cpp +++ b/pressure_pulsation.cpp @@ -25,6 +25,8 @@ PressurePulsation::PressurePulsation(int slot_no_, int channel_, bool active,QWi } else { ui->label_active->setText("(停用)"); } + ui->comboBox_fre_domain_resolution->setCurrentIndex(2); + ui->comboBox_lines_number->setCurrentIndex(2); Init(); } @@ -91,7 +93,9 @@ void PressurePulsation::Init() { ui->checkBox_alert_low_enable->setChecked(variable_ptr->alert_low.enable); ui->checkBox_alert_low_latch->setChecked(variable_ptr->alert_low.latch); - // + // freband output + ui->comboBox_fre_domain_resolution->setCurrentText(QString::number( variable_ptr->freband_output_item.fre_domain_resolution)); + ui->comboBox_lines_number->setCurrentText(QString::number( variable_ptr->freband_output_item.lines_number)); ui->checkBox_enable->setChecked(variable_ptr->freband_output[0].enable); ui->lineEdit_start->setText(QString::number(variable_ptr->freband_output[0].start)); ui->lineEdit_end->setText(QString::number(variable_ptr->freband_output[0].end)); @@ -190,6 +194,8 @@ void PressurePulsation::on_pushButton_confirm_clicked() variable->alert_low.enable = ui->checkBox_alert_low_enable->isChecked(); variable->alert_low.latch = ui->checkBox_alert_low_latch->isChecked(); // -freband output + variable->freband_output_item.fre_domain_resolution = ui->comboBox_fre_domain_resolution->currentText().toFloat(); + variable->freband_output_item.lines_number = ui->comboBox_lines_number->currentText().toInt(); variable->freband_output[0].enable = ui->checkBox_enable->isChecked(); variable->freband_output[0].start = ui->lineEdit_start->text().toDouble(); variable->freband_output[0].end = ui->lineEdit_end->text().toDouble(); @@ -264,6 +270,8 @@ void PressurePulsation::on_pushButton_confirm_clicked() variable->alert_low.enable = ui->checkBox_alert_low_enable->isChecked(); variable->alert_low.latch = ui->checkBox_alert_low_latch->isChecked(); // -freband output + variable->freband_output_item.fre_domain_resolution = ui->comboBox_fre_domain_resolution->currentText().toFloat(); + variable->freband_output_item.lines_number = ui->comboBox_lines_number->currentText().toInt(); variable->freband_output[0].enable = ui->checkBox_enable->isChecked(); variable->freband_output[0].start = ui->lineEdit_start->text().toDouble(); variable->freband_output[0].end = ui->lineEdit_end->text().toDouble(); diff --git a/pressure_pulsation.ui b/pressure_pulsation.ui index ab9280a..d99c8bb 100644 --- a/pressure_pulsation.ui +++ b/pressure_pulsation.ui @@ -98,7 +98,7 @@ - 1 + 2 @@ -1177,7 +1177,7 @@ 分频段选择 - + @@ -1354,7 +1354,7 @@ - false + true 使能 @@ -1364,7 +1364,7 @@ - false + true @@ -1377,7 +1377,7 @@ - false + true @@ -1394,7 +1394,7 @@ - false + true 使能 @@ -1404,7 +1404,7 @@ - false + true @@ -1417,7 +1417,7 @@ - false + true @@ -1434,7 +1434,7 @@ - false + true 使能 @@ -1444,7 +1444,7 @@ - false + true @@ -1457,7 +1457,7 @@ - false + true @@ -1474,7 +1474,7 @@ - false + true 使能 @@ -1484,7 +1484,7 @@ - false + true @@ -1497,7 +1497,7 @@ - false + true @@ -1514,7 +1514,7 @@ - false + true 使能 @@ -1524,7 +1524,7 @@ - false + true @@ -1537,7 +1537,7 @@ - false + true @@ -1554,7 +1554,7 @@ - false + true 使能 @@ -1564,7 +1564,7 @@ - false + true @@ -1577,7 +1577,7 @@ - false + true @@ -1605,17 +1605,121 @@ - - - Qt::Horizontal - - - - 247 - 20 - - - + + + + + + + + 125 + 0 + + + + 频域分辨率(Hz): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 125 + 0 + + + + + 1 + + + + + 2 + + + + + 2.5 + + + + + 5 + + + + + + + + + + + + + 125 + 0 + + + + 线数: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 125 + 0 + + + + + 400 + + + + + 800 + + + + + 1600 + + + + + 3200 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + +