diff --git a/acceleration.cpp b/acceleration.cpp index cc1c94d..ac9ad99 100644 --- a/acceleration.cpp +++ b/acceleration.cpp @@ -151,8 +151,59 @@ void Acceleration::on_pushButton_confirm_clicked() { variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].high = ui->spinBox_band_pass_high->value(); - - + // processed output + // -general + if(ui->comboBox_output_used->currentIndex() == 0) + variable->general.output_used = true; + else + variable->general.output_used = false; + // -alarm + variable->danger_high.level = ui->lineEdit_danger_high_level->text().toDouble(); + variable->danger_high.hysteresis = ui->lineEdit_danger_high_hysteresis->text().toDouble(); + variable->danger_high.delay = ui->lineEdit_danger_high_delay->text().toDouble(); + variable->danger_high.enable = ui->checkBox_danger_high_enable->isChecked(); + variable->danger_high.latch = ui->checkBox_danger_high_latch->isChecked(); + variable->alert_high.level = ui->lineEdit_alert_high_level->text().toDouble(); + variable->alert_high.hysteresis = ui->lineEdit_alert_high_hysteresis->text().toDouble(); + variable->alert_high.delay = ui->lineEdit_alert_high_delay->text().toDouble(); + variable->alert_high.enable = ui->checkBox_alert_high_enable->isChecked(); + variable->alert_high.latch = ui->checkBox_alert_high_latch->isChecked(); + variable->danger_low.level = ui->lineEdit_danger_low_level->text().toDouble(); + variable->danger_low.hysteresis = ui->lineEdit_danger_low_hysteresis->text().toDouble(); + variable->danger_low.delay = ui->lineEdit_danger_low_delay->text().toDouble(); + variable->danger_low.enable = ui->checkBox_danger_low_enable->isChecked(); + variable->danger_low.latch = ui->checkBox_danger_low_latch->isChecked(); + // -freband output + 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(); + variable->freband_output[1].enable = ui->checkBox_enable_2->isChecked(); + variable->freband_output[1].start = ui->lineEdit_start_2->text().toDouble(); + variable->freband_output[1].end = ui->lineEdit_end_2->text().toDouble(); + variable->freband_output[2].enable = ui->checkBox_enable_3->isChecked(); + variable->freband_output[2].start = ui->lineEdit_start_3->text().toDouble(); + variable->freband_output[2].end = ui->lineEdit_end_3->text().toDouble(); + variable->freband_output[3].enable = ui->checkBox_enable_4->isChecked(); + variable->freband_output[3].start = ui->lineEdit_start_4->text().toDouble(); + variable->freband_output[3].end = ui->lineEdit_end_4->text().toDouble(); + variable->freband_output[4].enable = ui->checkBox_enable_5->isChecked(); + variable->freband_output[4].start = ui->lineEdit_start_5->text().toDouble(); + variable->freband_output[4].end = ui->lineEdit_end_5->text().toDouble(); + variable->freband_output[5].enable = ui->checkBox_enable_6->isChecked(); + variable->freband_output[5].start = ui->lineEdit_start_6->text().toDouble(); + variable->freband_output[5].end = ui->lineEdit_end_6->text().toDouble(); + variable->freband_output[6].enable = ui->checkBox_enable_7->isChecked(); + variable->freband_output[6].start = ui->lineEdit_start_7->text().toDouble(); + variable->freband_output[6].end = ui->lineEdit_end_7->text().toDouble(); + variable->freband_output[7].enable = ui->checkBox_enable_8->isChecked(); + variable->freband_output[7].start = ui->lineEdit_start_8->text().toDouble(); + variable->freband_output[7].end = ui->lineEdit_end_8->text().toDouble(); + variable->freband_output[8].enable = ui->checkBox_enable_9->isChecked(); + variable->freband_output[8].start = ui->lineEdit_start_9->text().toDouble(); + variable->freband_output[8].end = ui->lineEdit_end_9->text().toDouble(); + variable->freband_output[9].enable = ui->checkBox_enable_10->isChecked(); + variable->freband_output[9].start = ui->lineEdit_start_10->text().toDouble(); + variable->freband_output[9].end = ui->lineEdit_end_10->text().toDouble(); ptr->variables_.push_back(variable); this->close(); return; @@ -167,7 +218,59 @@ void Acceleration::on_pushButton_confirm_clicked() { variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].high = ui->spinBox_band_pass_high->value(); - + // processed output + // -general + if(ui->comboBox_output_used->currentIndex() == 0) + variable->general.output_used = true; + else + variable->general.output_used = false; + // -alarm + variable->danger_high.level = ui->lineEdit_danger_high_level->text().toDouble(); + variable->danger_high.hysteresis = ui->lineEdit_danger_high_hysteresis->text().toDouble(); + variable->danger_high.delay = ui->lineEdit_danger_high_delay->text().toDouble(); + variable->danger_high.enable = ui->checkBox_danger_high_enable->isChecked(); + variable->danger_high.latch = ui->checkBox_danger_high_latch->isChecked(); + variable->alert_high.level = ui->lineEdit_alert_high_level->text().toDouble(); + variable->alert_high.hysteresis = ui->lineEdit_alert_high_hysteresis->text().toDouble(); + variable->alert_high.delay = ui->lineEdit_alert_high_delay->text().toDouble(); + variable->alert_high.enable = ui->checkBox_alert_high_enable->isChecked(); + variable->alert_high.latch = ui->checkBox_alert_high_latch->isChecked(); + variable->danger_low.level = ui->lineEdit_danger_low_level->text().toDouble(); + variable->danger_low.hysteresis = ui->lineEdit_danger_low_hysteresis->text().toDouble(); + variable->danger_low.delay = ui->lineEdit_danger_low_delay->text().toDouble(); + variable->danger_low.enable = ui->checkBox_danger_low_enable->isChecked(); + variable->danger_low.latch = ui->checkBox_danger_low_latch->isChecked(); + // -freband output + 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(); + variable->freband_output[1].enable = ui->checkBox_enable_2->isChecked(); + variable->freband_output[1].start = ui->lineEdit_start_2->text().toDouble(); + variable->freband_output[1].end = ui->lineEdit_end_2->text().toDouble(); + variable->freband_output[2].enable = ui->checkBox_enable_3->isChecked(); + variable->freband_output[2].start = ui->lineEdit_start_3->text().toDouble(); + variable->freband_output[2].end = ui->lineEdit_end_3->text().toDouble(); + variable->freband_output[3].enable = ui->checkBox_enable_4->isChecked(); + variable->freband_output[3].start = ui->lineEdit_start_4->text().toDouble(); + variable->freband_output[3].end = ui->lineEdit_end_4->text().toDouble(); + variable->freband_output[4].enable = ui->checkBox_enable_5->isChecked(); + variable->freband_output[4].start = ui->lineEdit_start_5->text().toDouble(); + variable->freband_output[4].end = ui->lineEdit_end_5->text().toDouble(); + variable->freband_output[5].enable = ui->checkBox_enable_6->isChecked(); + variable->freband_output[5].start = ui->lineEdit_start_6->text().toDouble(); + variable->freband_output[5].end = ui->lineEdit_end_6->text().toDouble(); + variable->freband_output[6].enable = ui->checkBox_enable_7->isChecked(); + variable->freband_output[6].start = ui->lineEdit_start_7->text().toDouble(); + variable->freband_output[6].end = ui->lineEdit_end_7->text().toDouble(); + variable->freband_output[7].enable = ui->checkBox_enable_8->isChecked(); + variable->freband_output[7].start = ui->lineEdit_start_8->text().toDouble(); + variable->freband_output[7].end = ui->lineEdit_end_8->text().toDouble(); + variable->freband_output[8].enable = ui->checkBox_enable_9->isChecked(); + variable->freband_output[8].start = ui->lineEdit_start_9->text().toDouble(); + variable->freband_output[8].end = ui->lineEdit_end_9->text().toDouble(); + variable->freband_output[9].enable = ui->checkBox_enable_10->isChecked(); + variable->freband_output[9].start = ui->lineEdit_start_10->text().toDouble(); + variable->freband_output[9].end = ui->lineEdit_end_10->text().toDouble(); this->close(); } diff --git a/cardbase.h b/cardbase.h index 9dee64d..fdf2398 100644 --- a/cardbase.h +++ b/cardbase.h @@ -29,6 +29,13 @@ class VariableBase { AlarmAlertHigh alert_high; AlarmDangerLow danger_low; AlarmAlertLow alert_low; + + General gap_general; + AlarmDangerHigh gap_danger_high; + AlarmAlertHigh gap_alert_high; + AlarmDangerLow gap_danger_low; + AlarmAlertLow gap_alert_low; + FrequencybandOutput freband_output[10]; }; diff --git a/config_mgr.cpp b/config_mgr.cpp index e68e418..f711058 100644 --- a/config_mgr.cpp +++ b/config_mgr.cpp @@ -133,41 +133,56 @@ void ConfigMgr::Save(QString & file_path) { band_pass["checked"] = radial_ptr->filter_[2].checked; filter.append(band_pass); variables["filter"] = filter; - QJsonObject direct; - QJsonObject x1; - QJsonObject x2; - QJsonObject recorder_out; - QJsonObject delay; - QJsonArray latching; - direct["full_scale_range"] = radial_ptr->direct_.full_scale_range; - direct["clamp_value"] = radial_ptr->direct_.clamp_value; - direct["custom"] = radial_ptr->direct_.custom; - variables["direct"] = direct; - x1["checked"] = radial_ptr->x1_.checked; - x1["full_scale_range"] = radial_ptr->x1_.full_scale_range; - x1["clamp_value"] = radial_ptr->x1_.clamp_value; - x1["custom"] = radial_ptr->x1_.custom; - x1["phase_lag"] = radial_ptr->x1_.phase_lag; - variables["x1"] = x1; - x2["checked"] = radial_ptr->x2_.checked; - x2["full_scale_range"] = radial_ptr->x2_.full_scale_range; - x2["clamp_value"] = radial_ptr->x2_.clamp_value; - x2["custom"] = radial_ptr->x2_.custom; - x2["phase_lag"] = radial_ptr->x2_.phase_lag; - variables["x2"] = x2; - recorder_out["recorder_output"] = radial_ptr->recorder_out_.recorder_output; - recorder_out["two_ma_clamp"] = radial_ptr->recorder_out_.two_ma_clamp; - recorder_out["trip_multiply"] = radial_ptr->recorder_out_.trip_multiply; - recorder_out["comparision"] = radial_ptr->recorder_out_.comparision; - recorder_out["percentage"] = radial_ptr->recorder_out_.percentage; - variables["recorder_out"] = recorder_out; - delay["alert"] = radial_ptr->delay_.alert; - delay["danger"] = radial_ptr->delay_.danger; - delay["active_100ms"] = radial_ptr->delay_.active_100ms; - variables["delay"] = delay; - latching.append(radial_ptr->alert_latching_); - latching.append(radial_ptr->danger_latching_); - variables["latching"] = latching; + // measurement + QJsonObject measurement,general,alarm; + general["output_used"] = radial_ptr->general.output_used; + general["engieneering_unit"] = radial_ptr->general.engineering_unit; + general["rectifier_function"] = radial_ptr->general.rectifier_function; + + alarm["danger_high_level"] = radial_ptr->danger_high.level; + alarm["danger_high_hysteresis"] = radial_ptr->danger_high.hysteresis; + alarm["danger_high_delay"] = radial_ptr->danger_high.delay; + alarm["danger_high_enable"] = radial_ptr->danger_high.enable; + alarm["danger_high_latch"] = radial_ptr->danger_high.latch; + alarm["alert_high_level"] = radial_ptr->alert_high.level; + alarm["alert_high_hysteresis"] = radial_ptr->alert_high.hysteresis; + alarm["alert_high_delay"] = radial_ptr->alert_high.delay; + alarm["alert_high_enable"] = radial_ptr->alert_high.enable; + alarm["alert_high_latch"] = radial_ptr->alert_high.latch; + alarm["danger_low_level"] = radial_ptr->danger_low.level; + alarm["danger_low_hysteresis"] = radial_ptr->danger_low.hysteresis; + alarm["danger_low_delay"] = radial_ptr->danger_low.delay; + alarm["danger_low_enable"] = radial_ptr->danger_low.enable; + alarm["danger_low_latch"] = radial_ptr->danger_low.latch; + measurement["general"] = general; + measurement["alarm"] = alarm; + variables["measurement"] = measurement; + // gap + QJsonObject gap,gap_general,gap_alarm; + gap_general["output_used"] = radial_ptr->gap_general.output_used; + gap_general["engieneering_unit"] = radial_ptr->gap_general.engineering_unit; + gap_general["rectifier_function"] = radial_ptr->gap_general.rectifier_function; + + gap_alarm["danger_high_level"] = radial_ptr->gap_danger_high.level; + gap_alarm["danger_high_hysteresis"] = radial_ptr->gap_danger_high.hysteresis; + gap_alarm["danger_high_delay"] = radial_ptr->gap_danger_high.delay; + gap_alarm["danger_high_enable"] = radial_ptr->gap_danger_high.enable; + gap_alarm["danger_high_latch"] = radial_ptr->gap_danger_high.latch; + gap_alarm["alert_high_level"] = radial_ptr->gap_alert_high.level; + gap_alarm["alert_high_hysteresis"] = radial_ptr->gap_alert_high.hysteresis; + gap_alarm["alert_high_delay"] = radial_ptr->gap_alert_high.delay; + gap_alarm["alert_high_enable"] = radial_ptr->gap_alert_high.enable; + gap_alarm["alert_high_latch"] = radial_ptr->gap_alert_high.latch; + gap_alarm["danger_low_level"] = radial_ptr->gap_danger_low.level; + gap_alarm["danger_low_hysteresis"] = radial_ptr->gap_danger_low.hysteresis; + gap_alarm["danger_low_delay"] = radial_ptr->gap_danger_low.delay; + gap_alarm["danger_low_enable"] = radial_ptr->gap_danger_low.enable; + gap_alarm["danger_low_latch"] = radial_ptr->gap_danger_low.latch; + gap["general"] = gap_general; + gap["alarm"] = gap_alarm; + variables["gap"] = gap; + + }else if(ptr->base_config_[cid].channel_type == kVibThrust){ std::shared_ptr thrust_ptr = std::dynamic_pointer_cast(base_channel_ptr); if(thrust_ptr == nullptr){ @@ -191,33 +206,33 @@ void ConfigMgr::Save(QString & file_path) { band_pass["checked"] = thrust_ptr->filter_[2].checked; filter.append(band_pass); variables["filter"] = filter; - QJsonObject direct,gap; - QJsonObject recorder_out; - QJsonObject delay; - QJsonArray latching; - direct["full_scale_range"] = thrust_ptr->direct_.full_scale_range; - direct["clamp_value"] = thrust_ptr->direct_.clamp_value; - direct["custom"] = thrust_ptr->direct_.custom; - variables["direct"] = direct; - gap["full_scale_range"] = thrust_ptr->gap_range.full_scale_range; - gap["custom"] = thrust_ptr->gap_range.custom; + // gap + QJsonObject gap,gap_general,gap_alarm; + gap_general["output_used"] = thrust_ptr->gap_general.output_used; + gap_general["engieneering_unit"] = thrust_ptr->gap_general.engineering_unit; + gap_general["rectifier_function"] = thrust_ptr->gap_general.rectifier_function; + + gap_alarm["danger_high_level"] = thrust_ptr->gap_danger_high.level; + gap_alarm["danger_high_hysteresis"] = thrust_ptr->gap_danger_high.hysteresis; + gap_alarm["danger_high_delay"] = thrust_ptr->gap_danger_high.delay; + gap_alarm["danger_high_enable"] = thrust_ptr->gap_danger_high.enable; + gap_alarm["danger_high_latch"] = thrust_ptr->gap_danger_high.latch; + gap_alarm["alert_high_level"] = thrust_ptr->gap_alert_high.level; + gap_alarm["alert_high_hysteresis"] = thrust_ptr->gap_alert_high.hysteresis; + gap_alarm["alert_high_delay"] = thrust_ptr->gap_alert_high.delay; + gap_alarm["alert_high_enable"] = thrust_ptr->gap_alert_high.enable; + gap_alarm["alert_high_latch"] = thrust_ptr->gap_alert_high.latch; + gap_alarm["danger_low_level"] = thrust_ptr->gap_danger_low.level; + gap_alarm["danger_low_hysteresis"] = thrust_ptr->gap_danger_low.hysteresis; + gap_alarm["danger_low_delay"] = thrust_ptr->gap_danger_low.delay; + gap_alarm["danger_low_enable"] = thrust_ptr->gap_danger_low.enable; + gap_alarm["danger_low_latch"] = thrust_ptr->gap_danger_low.latch; + gap["general"] = gap_general; + gap["alarm"] = gap_alarm; variables["gap"] = gap; - recorder_out["recorder_output"] = thrust_ptr->recorder_out_.recorder_output; - recorder_out["two_ma_clamp"] = thrust_ptr->recorder_out_.two_ma_clamp; - recorder_out["trip_multiply"] = thrust_ptr->recorder_out_.trip_multiply; - recorder_out["comparision"] = thrust_ptr->recorder_out_.comparision; - recorder_out["percentage"] = thrust_ptr->recorder_out_.percentage; - variables["recorder_out"] = recorder_out; - delay["alert"] = thrust_ptr->delay_.alert; - delay["danger"] = thrust_ptr->delay_.danger; - delay["active_100ms"] = thrust_ptr->delay_.active_100ms; - variables["delay"] = delay; - latching.append(thrust_ptr->alert_latching_); - latching.append(thrust_ptr->danger_latching_); - latching.append(thrust_ptr->timed_ok_); - variables["zero_position"] = thrust_ptr->zero_position.value; variables["negation"] = thrust_ptr->zero_position.negation; - variables["latching"] = latching; + variables["zero_position"] = thrust_ptr->zero_position.value; + }else if(ptr->base_config_[cid].channel_type == kVibPressurePulsation){ std::shared_ptr pressure_ptr = std::dynamic_pointer_cast(base_channel_ptr); if(pressure_ptr == nullptr){ @@ -254,7 +269,17 @@ void ConfigMgr::Save(QString & file_path) { variables["sampling"] = sampling; variables["scaling"] = scaling; - } else { + QJsonArray freband_output_array; + QJsonObject freband_output; + for (int var = 0; var < 10; ++var) { + freband_output["enable"] = pressure_ptr->freband_output[var].enable; + freband_output["start"] = pressure_ptr->freband_output[var].start; + freband_output["end"] = pressure_ptr->freband_output[var].end; + freband_output_array.append(freband_output); + } + variables["freband_output"] = freband_output_array; + + } else if(ptr->base_config_[cid].channel_type == kVibAcc){ std::shared_ptr av_ptr = std::dynamic_pointer_cast(base_channel_ptr); if(av_ptr == nullptr){ continue; @@ -277,46 +302,40 @@ void ConfigMgr::Save(QString & file_path) { band_pass["checked"] = av_ptr->filter_[2].checked; filter.append(band_pass); variables["filter"] = filter; - QJsonObject direct; - QJsonObject x1; - QJsonObject x2; - QJsonObject recorder_out; - QJsonObject delay; - QJsonArray latching; - direct["full_scale_range"] = av_ptr->direct_.full_scale_range; - direct["clamp_value"] = av_ptr->direct_.clamp_value; - direct["custom"] = av_ptr->direct_.custom; - variables["direct"] = direct; - x1["checked"] = av_ptr->x1_.checked; - x1["full_scale_range"] = av_ptr->x1_.full_scale_range; - x1["clamp_value"] = av_ptr->x1_.clamp_value; - x1["custom"] = av_ptr->x1_.custom; - x1["phase_lag"] = av_ptr->x1_.phase_lag; - variables["x1"] = x1; - x2["checked"] = av_ptr->x2_.checked; - x2["full_scale_range"] = av_ptr->x2_.full_scale_range; - x2["clamp_value"] = av_ptr->x2_.clamp_value; - x2["custom"] = av_ptr->x2_.custom; - x2["phase_lag"] = av_ptr->x2_.phase_lag; - variables["x2"] = x2; - QJsonObject rms_integrate; - rms_integrate["rms_active"] = av_ptr->rms_active_; - rms_integrate["integrate_active"] = av_ptr->integrate_active_; - variables["rms_integrate"] = rms_integrate; - recorder_out["recorder_output"] = av_ptr->recorder_out_.recorder_output; - recorder_out["two_ma_clamp"] = av_ptr->recorder_out_.two_ma_clamp; - recorder_out["trip_multiply"] = av_ptr->recorder_out_.trip_multiply; - recorder_out["comparision"] = av_ptr->recorder_out_.comparision; - recorder_out["percentage"] = av_ptr->recorder_out_.percentage; - variables["recorder_out"] = recorder_out; - delay["alert"] = av_ptr->delay_.alert; - delay["danger"] = av_ptr->delay_.danger; - delay["active_100ms"] = av_ptr->delay_.active_100ms; - variables["delay"] = delay; - latching.append(av_ptr->alert_latching_); - latching.append(av_ptr->danger_latching_); - latching.append(av_ptr->timed_ok_); - variables["latching"] = latching; + // processed output + QJsonObject processed_output,general,alarm; + general["output_used"] = av_ptr->general.output_used; + general["engieneering_unit"] = av_ptr->general.engineering_unit; + general["rectifier_function"] = av_ptr->general.rectifier_function; + + alarm["danger_high_level"] = av_ptr->danger_high.level; + alarm["danger_high_hysteresis"] = av_ptr->danger_high.hysteresis; + alarm["danger_high_delay"] = av_ptr->danger_high.delay; + alarm["danger_high_enable"] = av_ptr->danger_high.enable; + alarm["danger_high_latch"] = av_ptr->danger_high.latch; + alarm["alert_high_level"] = av_ptr->alert_high.level; + alarm["alert_high_hysteresis"] = av_ptr->alert_high.hysteresis; + alarm["alert_high_delay"] = av_ptr->alert_high.delay; + alarm["alert_high_enable"] = av_ptr->alert_high.enable; + alarm["alert_high_latch"] = av_ptr->alert_high.latch; + alarm["danger_low_level"] = av_ptr->danger_low.level; + alarm["danger_low_hysteresis"] = av_ptr->danger_low.hysteresis; + alarm["danger_low_delay"] = av_ptr->danger_low.delay; + alarm["danger_low_enable"] = av_ptr->danger_low.enable; + alarm["danger_low_latch"] = av_ptr->danger_low.latch; + processed_output["general"] = general; + processed_output["alarm"] = alarm; + variables["processed_output"] = processed_output; + QJsonArray freband_output_array; + QJsonObject freband_output; + for (int var = 0; var < 10; ++var) { + freband_output["enable"] = av_ptr->freband_output[var].enable; + freband_output["start"] = av_ptr->freband_output[var].start; + freband_output["end"] = av_ptr->freband_output[var].end; + freband_output_array.append(freband_output); + } + variables["freband_output"] = freband_output_array; + } channel_item["variable"] = variables; } else if (card_type_[i] == kCardSpeedSingle || card_type_[i] == kCardSpeedTMRPrimary) { diff --git a/pressure_pulsation.cpp b/pressure_pulsation.cpp index 7f685a1..5ede225 100644 --- a/pressure_pulsation.cpp +++ b/pressure_pulsation.cpp @@ -66,6 +66,37 @@ void PressurePulsation::Init() { ui->lineEdit_measuring_value_max->setText(QString::number(variable_ptr->measuring_max)); ui->lineEdit_scale_value_min->setText(QString::number(variable_ptr->scale_min)); ui->lineEdit_scale_value_max->setText(QString::number(variable_ptr->scale_max)); + + 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)); + ui->checkBox_enable_2->setChecked(variable_ptr->freband_output[1].enable); + ui->lineEdit_start_2->setText(QString::number(variable_ptr->freband_output[1].start)); + ui->lineEdit_end_2->setText(QString::number(variable_ptr->freband_output[1].end)); + ui->checkBox_enable_3->setChecked(variable_ptr->freband_output[2].enable); + ui->lineEdit_start_3->setText(QString::number(variable_ptr->freband_output[2].start)); + ui->lineEdit_end_3->setText(QString::number(variable_ptr->freband_output[2].end)); + ui->checkBox_enable_4->setChecked(variable_ptr->freband_output[3].enable); + ui->lineEdit_start_4->setText(QString::number(variable_ptr->freband_output[3].start)); + ui->lineEdit_end_4->setText(QString::number(variable_ptr->freband_output[3].end)); + ui->checkBox_enable_5->setChecked(variable_ptr->freband_output[4].enable); + ui->lineEdit_start_5->setText(QString::number(variable_ptr->freband_output[4].start)); + ui->lineEdit_end_5->setText(QString::number(variable_ptr->freband_output[4].end)); + ui->checkBox_enable_6->setChecked(variable_ptr->freband_output[5].enable); + ui->lineEdit_start_6->setText(QString::number(variable_ptr->freband_output[5].start)); + ui->lineEdit_end_6->setText(QString::number(variable_ptr->freband_output[5].end)); + ui->checkBox_enable_7->setChecked(variable_ptr->freband_output[6].enable); + ui->lineEdit_start_7->setText(QString::number(variable_ptr->freband_output[6].start)); + ui->lineEdit_end_7->setText(QString::number(variable_ptr->freband_output[6].end)); + ui->checkBox_enable_8->setChecked(variable_ptr->freband_output[7].enable); + ui->lineEdit_start_8->setText(QString::number(variable_ptr->freband_output[7].start)); + ui->lineEdit_end_8->setText(QString::number(variable_ptr->freband_output[7].end)); + ui->checkBox_enable_9->setChecked(variable_ptr->freband_output[8].enable); + ui->lineEdit_start_9->setText(QString::number(variable_ptr->freband_output[8].start)); + ui->lineEdit_end_9->setText(QString::number(variable_ptr->freband_output[8].end)); + ui->checkBox_enable_10->setChecked(variable_ptr->freband_output[9].enable); + ui->lineEdit_start_10->setText(QString::number(variable_ptr->freband_output[9].start)); + ui->lineEdit_end_10->setText(QString::number(variable_ptr->freband_output[9].end)); } void PressurePulsation::on_pushButton_confirm_clicked() { @@ -103,6 +134,37 @@ void PressurePulsation::on_pushButton_confirm_clicked() variable->measuring_max = ui->lineEdit_measuring_value_max->text().toInt(); variable->scale_min = ui->lineEdit_scale_value_min->text().toInt(); variable->scale_max = ui->lineEdit_scale_value_max->text().toInt(); + // -freband output + 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(); + variable->freband_output[1].enable = ui->checkBox_enable_2->isChecked(); + variable->freband_output[1].start = ui->lineEdit_start_2->text().toDouble(); + variable->freband_output[1].end = ui->lineEdit_end_2->text().toDouble(); + variable->freband_output[2].enable = ui->checkBox_enable_3->isChecked(); + variable->freband_output[2].start = ui->lineEdit_start_3->text().toDouble(); + variable->freband_output[2].end = ui->lineEdit_end_3->text().toDouble(); + variable->freband_output[3].enable = ui->checkBox_enable_4->isChecked(); + variable->freband_output[3].start = ui->lineEdit_start_4->text().toDouble(); + variable->freband_output[3].end = ui->lineEdit_end_4->text().toDouble(); + variable->freband_output[4].enable = ui->checkBox_enable_5->isChecked(); + variable->freband_output[4].start = ui->lineEdit_start_5->text().toDouble(); + variable->freband_output[4].end = ui->lineEdit_end_5->text().toDouble(); + variable->freband_output[5].enable = ui->checkBox_enable_6->isChecked(); + variable->freband_output[5].start = ui->lineEdit_start_6->text().toDouble(); + variable->freband_output[5].end = ui->lineEdit_end_6->text().toDouble(); + variable->freband_output[6].enable = ui->checkBox_enable_7->isChecked(); + variable->freband_output[6].start = ui->lineEdit_start_7->text().toDouble(); + variable->freband_output[6].end = ui->lineEdit_end_7->text().toDouble(); + variable->freband_output[7].enable = ui->checkBox_enable_8->isChecked(); + variable->freband_output[7].start = ui->lineEdit_start_8->text().toDouble(); + variable->freband_output[7].end = ui->lineEdit_end_8->text().toDouble(); + variable->freband_output[8].enable = ui->checkBox_enable_9->isChecked(); + variable->freband_output[8].start = ui->lineEdit_start_9->text().toDouble(); + variable->freband_output[8].end = ui->lineEdit_end_9->text().toDouble(); + variable->freband_output[9].enable = ui->checkBox_enable_10->isChecked(); + variable->freband_output[9].start = ui->lineEdit_start_10->text().toDouble(); + variable->freband_output[9].end = ui->lineEdit_end_10->text().toDouble(); ptr->variables_.push_back(variable); this->close(); @@ -127,6 +189,38 @@ void PressurePulsation::on_pushButton_confirm_clicked() variable->scale_min = ui->lineEdit_scale_value_min->text().toInt(); variable->scale_max = ui->lineEdit_scale_value_max->text().toInt(); + // -freband output + 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(); + variable->freband_output[1].enable = ui->checkBox_enable_2->isChecked(); + variable->freband_output[1].start = ui->lineEdit_start_2->text().toDouble(); + variable->freband_output[1].end = ui->lineEdit_end_2->text().toDouble(); + variable->freband_output[2].enable = ui->checkBox_enable_3->isChecked(); + variable->freband_output[2].start = ui->lineEdit_start_3->text().toDouble(); + variable->freband_output[2].end = ui->lineEdit_end_3->text().toDouble(); + variable->freband_output[3].enable = ui->checkBox_enable_4->isChecked(); + variable->freband_output[3].start = ui->lineEdit_start_4->text().toDouble(); + variable->freband_output[3].end = ui->lineEdit_end_4->text().toDouble(); + variable->freband_output[4].enable = ui->checkBox_enable_5->isChecked(); + variable->freband_output[4].start = ui->lineEdit_start_5->text().toDouble(); + variable->freband_output[4].end = ui->lineEdit_end_5->text().toDouble(); + variable->freband_output[5].enable = ui->checkBox_enable_6->isChecked(); + variable->freband_output[5].start = ui->lineEdit_start_6->text().toDouble(); + variable->freband_output[5].end = ui->lineEdit_end_6->text().toDouble(); + variable->freband_output[6].enable = ui->checkBox_enable_7->isChecked(); + variable->freband_output[6].start = ui->lineEdit_start_7->text().toDouble(); + variable->freband_output[6].end = ui->lineEdit_end_7->text().toDouble(); + variable->freband_output[7].enable = ui->checkBox_enable_8->isChecked(); + variable->freband_output[7].start = ui->lineEdit_start_8->text().toDouble(); + variable->freband_output[7].end = ui->lineEdit_end_8->text().toDouble(); + variable->freband_output[8].enable = ui->checkBox_enable_9->isChecked(); + variable->freband_output[8].start = ui->lineEdit_start_9->text().toDouble(); + variable->freband_output[8].end = ui->lineEdit_end_9->text().toDouble(); + variable->freband_output[9].enable = ui->checkBox_enable_10->isChecked(); + variable->freband_output[9].start = ui->lineEdit_start_10->text().toDouble(); + variable->freband_output[9].end = ui->lineEdit_end_10->text().toDouble(); + this->close(); } diff --git a/pressure_pulsation.ui b/pressure_pulsation.ui index 5b943e5..bd0e8cb 100644 --- a/pressure_pulsation.ui +++ b/pressure_pulsation.ui @@ -7,7 +7,7 @@ 0 0 701 - 519 + 572 @@ -76,7 +76,7 @@ 30 - 450 + 500 632 37 @@ -164,11 +164,11 @@ 20 60 651 - 381 + 421 - 0 + 2 @@ -514,8 +514,8 @@ 20 70 - 118 - 22 + 121 + 23 @@ -543,7 +543,7 @@ 20 100 122 - 14 + 17 @@ -569,7 +569,7 @@ 20 130 92 - 14 + 17 @@ -594,8 +594,8 @@ 20 160 - 104 - 14 + 106 + 17 @@ -774,6 +774,367 @@ + + + 分频段选择 + + + + + 40 + 230 + 71 + 16 + + + + 使能 + + + + + + 140 + 80 + 113 + 20 + + + + + + + 40 + 170 + 71 + 16 + + + + 使能 + + + + + + 140 + 110 + 113 + 20 + + + + + + + 40 + 140 + 71 + 16 + + + + 使能 + + + + + + 140 + 170 + 113 + 20 + + + + + + + 290 + 140 + 113 + 20 + + + + + + + 290 + 200 + 113 + 20 + + + + + + + 160 + 40 + 91 + 16 + + + + 频率开始(Hz) + + + + + + 290 + 230 + 113 + 20 + + + + + + + 40 + 80 + 71 + 16 + + + + 使能 + + + + + + 140 + 140 + 113 + 20 + + + + + + + 140 + 200 + 113 + 20 + + + + + + + 40 + 200 + 71 + 16 + + + + 使能 + + + + + + 290 + 110 + 113 + 20 + + + + + + + 310 + 40 + 91 + 16 + + + + 频率结束(Hz) + + + + + + 140 + 230 + 113 + 20 + + + + + + + 40 + 110 + 71 + 16 + + + + 使能 + + + + + + 290 + 80 + 113 + 20 + + + + + + + 290 + 170 + 113 + 20 + + + + + + + 40 + 350 + 71 + 16 + + + + 使能 + + + + + + 140 + 320 + 113 + 20 + + + + + + + 40 + 290 + 71 + 16 + + + + 使能 + + + + + + 140 + 350 + 113 + 20 + + + + + + + 290 + 320 + 113 + 20 + + + + + + + 40 + 260 + 71 + 16 + + + + 使能 + + + + + + 290 + 260 + 113 + 20 + + + + + + + 140 + 290 + 113 + 20 + + + + + + + 290 + 290 + 113 + 20 + + + + + + + 140 + 260 + 113 + 20 + + + + + + + 40 + 320 + 71 + 16 + + + + 使能 + + + + + + 290 + 350 + 113 + 20 + + + + diff --git a/radial_vibration.cpp b/radial_vibration.cpp index dd48fcd..c528a0a 100644 --- a/radial_vibration.cpp +++ b/radial_vibration.cpp @@ -70,7 +70,67 @@ void Radial::Init() { ui->checkBox_band_pass->setChecked(variable_ptr->filter_[2].checked); ui->spinBox_band_pass_low->setValue(variable_ptr->filter_[2].low); ui->spinBox_band_pass_high->setValue(variable_ptr->filter_[2].high); + // processed output + // -general + if(variable_ptr->general.output_used) + ui->comboBox_output_used->setCurrentIndex(0); + else + ui->comboBox_output_used->setCurrentIndex(1); + // -alarm + ui->lineEdit_danger_high_level->setText(QString::number(variable_ptr->danger_high.level)); + ui->lineEdit_danger_high_hysteresis->setText(QString::number(variable_ptr->danger_high.level)); + ui->lineEdit_danger_high_delay->setText(QString::number(variable_ptr->danger_high.level)); + ui->checkBox_danger_high_enable->setChecked(variable_ptr->danger_high.enable); + ui->checkBox_danger_high_latch->setChecked(variable_ptr->danger_high.latch); + ui->lineEdit_alert_high_level->setText(QString::number(variable_ptr->alert_high.level)); + ui->lineEdit_alert_high_hysteresis->setText(QString::number(variable_ptr->alert_high.level)); + ui->lineEdit_alert_high_delay->setText(QString::number(variable_ptr->alert_high.level)); + ui->checkBox_alert_high_enable->setChecked(variable_ptr->alert_high.enable); + ui->checkBox_alert_high_latch->setChecked(variable_ptr->alert_high.latch); + + ui->lineEdit_danger_low_level->setText(QString::number(variable_ptr->danger_low.level)); + ui->lineEdit_danger_low_hysteresis->setText(QString::number(variable_ptr->danger_low.level)); + ui->lineEdit_danger_low_delay->setText(QString::number(variable_ptr->danger_low.level)); + ui->checkBox_danger_low_enable->setChecked(variable_ptr->danger_low.enable); + ui->checkBox_danger_low_latch->setChecked(variable_ptr->danger_low.latch); + + ui->lineEdit_danger_low_level->setText(QString::number(variable_ptr->danger_low.level)); + ui->lineEdit_danger_low_hysteresis->setText(QString::number(variable_ptr->danger_low.level)); + ui->lineEdit_danger_low_delay->setText(QString::number(variable_ptr->danger_low.level)); + ui->checkBox_danger_low_enable->setChecked(variable_ptr->danger_low.enable); + ui->checkBox_danger_low_latch->setChecked(variable_ptr->danger_low.latch); + + // Gap + // -general + if(variable_ptr->gap_general.output_used) + ui->comboBox_output_used_2->setCurrentIndex(0); + else + ui->comboBox_output_used_2->setCurrentIndex(1); + // -alarm + ui->lineEdit_danger_high_level_2->setText(QString::number(variable_ptr->gap_danger_high.level)); + ui->lineEdit_danger_high_hysteresis_2->setText(QString::number(variable_ptr->gap_danger_high.level)); + ui->lineEdit_danger_high_delay_2->setText(QString::number(variable_ptr->gap_danger_high.level)); + ui->checkBox_danger_high_enable_2->setChecked(variable_ptr->gap_danger_high.enable); + ui->checkBox_danger_high_latch_2->setChecked(variable_ptr->gap_danger_high.latch); + + ui->lineEdit_alert_high_level_2->setText(QString::number(variable_ptr->gap_alert_high.level)); + ui->lineEdit_alert_high_hysteresis_2->setText(QString::number(variable_ptr->gap_alert_high.level)); + ui->lineEdit_alert_high_delay_2->setText(QString::number(variable_ptr->gap_alert_high.level)); + ui->checkBox_alert_high_enable_2->setChecked(variable_ptr->gap_alert_high.enable); + ui->checkBox_alert_high_latch_2->setChecked(variable_ptr->gap_alert_high.latch); + + ui->lineEdit_danger_low_level_2->setText(QString::number(variable_ptr->gap_danger_low.level)); + ui->lineEdit_danger_low_hysteresis_2->setText(QString::number(variable_ptr->gap_danger_low.level)); + ui->lineEdit_danger_low_delay_2->setText(QString::number(variable_ptr->gap_danger_low.level)); + ui->checkBox_danger_low_enable_2->setChecked(variable_ptr->gap_danger_low.enable); + ui->checkBox_danger_low_latch_2->setChecked(variable_ptr->gap_danger_low.latch); + + ui->lineEdit_danger_low_level_2->setText(QString::number(variable_ptr->gap_danger_low.level)); + ui->lineEdit_danger_low_hysteresis_2->setText(QString::number(variable_ptr->gap_danger_low.level)); + ui->lineEdit_danger_low_delay_2->setText(QString::number(variable_ptr->gap_danger_low.level)); + ui->checkBox_danger_low_enable_2->setChecked(variable_ptr->gap_danger_low.enable); + ui->checkBox_danger_low_latch_2->setChecked(variable_ptr->gap_danger_low.latch); } void Radial::on_pushButton_confirm_clicked() { @@ -100,7 +160,51 @@ void Radial::on_pushButton_confirm_clicked() { variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].high = ui->spinBox_band_pass_high->value(); - + // processed output + // -general + if(ui->comboBox_output_used->currentIndex() == 0) + variable->general.output_used = true; + else + variable->general.output_used = false; + // -alarm + variable->danger_high.level = ui->lineEdit_danger_high_level->text().toDouble(); + variable->danger_high.hysteresis = ui->lineEdit_danger_high_hysteresis->text().toDouble(); + variable->danger_high.delay = ui->lineEdit_danger_high_delay->text().toDouble(); + variable->danger_high.enable = ui->checkBox_danger_high_enable->isChecked(); + variable->danger_high.latch = ui->checkBox_danger_high_latch->isChecked(); + variable->alert_high.level = ui->lineEdit_alert_high_level->text().toDouble(); + variable->alert_high.hysteresis = ui->lineEdit_alert_high_hysteresis->text().toDouble(); + variable->alert_high.delay = ui->lineEdit_alert_high_delay->text().toDouble(); + variable->alert_high.enable = ui->checkBox_alert_high_enable->isChecked(); + variable->alert_high.latch = ui->checkBox_alert_high_latch->isChecked(); + variable->danger_low.level = ui->lineEdit_danger_low_level->text().toDouble(); + variable->danger_low.hysteresis = ui->lineEdit_danger_low_hysteresis->text().toDouble(); + variable->danger_low.delay = ui->lineEdit_danger_low_delay->text().toDouble(); + variable->danger_low.enable = ui->checkBox_danger_low_enable->isChecked(); + variable->danger_low.latch = ui->checkBox_danger_low_latch->isChecked(); + // Gap + // -general + if(ui->comboBox_output_used_2->currentIndex() == 0) + variable->gap_general.output_used = true; + else + variable->gap_general.output_used = false; + // -alarm + variable->gap_danger_high.level = ui->lineEdit_danger_high_level_2->text().toDouble(); + variable->gap_danger_high.hysteresis = ui->lineEdit_danger_high_hysteresis_2->text().toDouble(); + variable->gap_danger_high.delay = ui->lineEdit_danger_high_delay_2->text().toDouble(); + variable->gap_danger_high.enable = ui->checkBox_danger_high_enable_2->isChecked(); + variable->gap_danger_high.latch = ui->checkBox_danger_high_latch_2->isChecked(); + variable->gap_alert_high.level = ui->lineEdit_alert_high_level_2->text().toDouble(); + variable->gap_alert_high.hysteresis = ui->lineEdit_alert_high_hysteresis_2->text().toDouble(); + variable->gap_alert_high.delay = ui->lineEdit_alert_high_delay_2->text().toDouble(); + variable->gap_alert_high.enable = ui->checkBox_alert_high_enable_2->isChecked(); + variable->gap_alert_high.latch = ui->checkBox_alert_high_latch_2->isChecked(); + variable->gap_danger_low.level = ui->lineEdit_danger_low_level_2->text().toDouble(); + variable->gap_danger_low.hysteresis = ui->lineEdit_danger_low_hysteresis_2->text().toDouble(); + variable->gap_danger_low.delay = ui->lineEdit_danger_low_delay_2->text().toDouble(); + variable->gap_danger_low.enable = ui->checkBox_danger_low_enable_2->isChecked(); + variable->gap_danger_low.latch = ui->checkBox_danger_low_latch_2->isChecked(); + // add to ptr ptr->variables_.push_back(variable); this->close(); return; @@ -115,7 +219,50 @@ void Radial::on_pushButton_confirm_clicked() { variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].high = ui->spinBox_band_pass_high->value(); - + // processed output + // -general + if(ui->comboBox_output_used->currentIndex() == 0) + variable->general.output_used = true; + else + variable->general.output_used = false; + // -alarm + variable->danger_high.level = ui->lineEdit_danger_high_level->text().toDouble(); + variable->danger_high.hysteresis = ui->lineEdit_danger_high_hysteresis->text().toDouble(); + variable->danger_high.delay = ui->lineEdit_danger_high_delay->text().toDouble(); + variable->danger_high.enable = ui->checkBox_danger_high_enable->isChecked(); + variable->danger_high.latch = ui->checkBox_danger_high_latch->isChecked(); + variable->alert_high.level = ui->lineEdit_alert_high_level->text().toDouble(); + variable->alert_high.hysteresis = ui->lineEdit_alert_high_hysteresis->text().toDouble(); + variable->alert_high.delay = ui->lineEdit_alert_high_delay->text().toDouble(); + variable->alert_high.enable = ui->checkBox_alert_high_enable->isChecked(); + variable->alert_high.latch = ui->checkBox_alert_high_latch->isChecked(); + variable->danger_low.level = ui->lineEdit_danger_low_level->text().toDouble(); + variable->danger_low.hysteresis = ui->lineEdit_danger_low_hysteresis->text().toDouble(); + variable->danger_low.delay = ui->lineEdit_danger_low_delay->text().toDouble(); + variable->danger_low.enable = ui->checkBox_danger_low_enable->isChecked(); + variable->danger_low.latch = ui->checkBox_danger_low_latch->isChecked(); + // Gap + // -general + if(ui->comboBox_output_used_2->currentIndex() == 0) + variable->gap_general.output_used = true; + else + variable->gap_general.output_used = false; + // -alarm + variable->gap_danger_high.level = ui->lineEdit_danger_high_level_2->text().toDouble(); + variable->gap_danger_high.hysteresis = ui->lineEdit_danger_high_hysteresis_2->text().toDouble(); + variable->gap_danger_high.delay = ui->lineEdit_danger_high_delay_2->text().toDouble(); + variable->gap_danger_high.enable = ui->checkBox_danger_high_enable_2->isChecked(); + variable->gap_danger_high.latch = ui->checkBox_danger_high_latch_2->isChecked(); + variable->gap_alert_high.level = ui->lineEdit_alert_high_level_2->text().toDouble(); + variable->gap_alert_high.hysteresis = ui->lineEdit_alert_high_hysteresis_2->text().toDouble(); + variable->gap_alert_high.delay = ui->lineEdit_alert_high_delay_2->text().toDouble(); + variable->gap_alert_high.enable = ui->checkBox_alert_high_enable_2->isChecked(); + variable->gap_alert_high.latch = ui->checkBox_alert_high_latch_2->isChecked(); + variable->gap_danger_low.level = ui->lineEdit_danger_low_level_2->text().toDouble(); + variable->gap_danger_low.hysteresis = ui->lineEdit_danger_low_hysteresis_2->text().toDouble(); + variable->gap_danger_low.delay = ui->lineEdit_danger_low_delay_2->text().toDouble(); + variable->gap_danger_low.enable = ui->checkBox_danger_low_enable_2->isChecked(); + variable->gap_danger_low.latch = ui->checkBox_danger_low_latch_2->isChecked(); this->close(); } diff --git a/radial_vibration.ui b/radial_vibration.ui index 51513c9..6cb64dc 100644 --- a/radial_vibration.ui +++ b/radial_vibration.ui @@ -23,7 +23,7 @@ - 1 + 2 @@ -293,14 +293,14 @@ - 10 - 40 + 20 + 50 621 321 - 0 + 1 @@ -566,7 +566,7 @@ - + 150 @@ -676,7 +676,7 @@ - + 290 @@ -689,7 +689,7 @@ - + 290 @@ -702,7 +702,7 @@ - + 290 @@ -728,7 +728,7 @@ - + 350 @@ -741,7 +741,7 @@ - + 350 @@ -754,7 +754,7 @@ - + 350 @@ -767,7 +767,7 @@ - + 350 @@ -797,7 +797,7 @@ - 0 + 1 @@ -1063,7 +1063,7 @@ - + 150 @@ -1173,7 +1173,7 @@ - + 290 @@ -1186,7 +1186,7 @@ - + 290 @@ -1199,7 +1199,7 @@ - + 290 @@ -1225,7 +1225,7 @@ - + 350 @@ -1238,7 +1238,7 @@ - + 350 @@ -1251,7 +1251,7 @@ - + 350 @@ -1264,7 +1264,7 @@ - + 350 diff --git a/trust.cpp b/trust.cpp index f4c192e..67dc28f 100644 --- a/trust.cpp +++ b/trust.cpp @@ -62,6 +62,37 @@ void Trust::Init() { ui->doubleSpinBox_zero_position->setValue(variable_ptr->zero_position.value); ui->checkBox_negation->setChecked(variable_ptr->zero_position.negation); + + // processed output + // -general + if(variable_ptr->general.output_used) + ui->comboBox_output_used->setCurrentIndex(0); + else + ui->comboBox_output_used->setCurrentIndex(1); + // -alarm + ui->lineEdit_danger_high_level->setText(QString::number(variable_ptr->danger_high.level)); + ui->lineEdit_danger_high_hysteresis->setText(QString::number(variable_ptr->danger_high.level)); + ui->lineEdit_danger_high_delay->setText(QString::number(variable_ptr->danger_high.level)); + ui->checkBox_danger_high_enable->setChecked(variable_ptr->danger_high.enable); + ui->checkBox_danger_high_latch->setChecked(variable_ptr->danger_high.latch); + + ui->lineEdit_alert_high_level->setText(QString::number(variable_ptr->alert_high.level)); + ui->lineEdit_alert_high_hysteresis->setText(QString::number(variable_ptr->alert_high.level)); + ui->lineEdit_alert_high_delay->setText(QString::number(variable_ptr->alert_high.level)); + ui->checkBox_alert_high_enable->setChecked(variable_ptr->alert_high.enable); + ui->checkBox_alert_high_latch->setChecked(variable_ptr->alert_high.latch); + + ui->lineEdit_danger_low_level->setText(QString::number(variable_ptr->danger_low.level)); + ui->lineEdit_danger_low_hysteresis->setText(QString::number(variable_ptr->danger_low.level)); + ui->lineEdit_danger_low_delay->setText(QString::number(variable_ptr->danger_low.level)); + ui->checkBox_danger_low_enable->setChecked(variable_ptr->danger_low.enable); + ui->checkBox_danger_low_latch->setChecked(variable_ptr->danger_low.latch); + + ui->lineEdit_danger_low_level->setText(QString::number(variable_ptr->danger_low.level)); + ui->lineEdit_danger_low_hysteresis->setText(QString::number(variable_ptr->danger_low.level)); + ui->lineEdit_danger_low_delay->setText(QString::number(variable_ptr->danger_low.level)); + ui->checkBox_danger_low_enable->setChecked(variable_ptr->danger_low.enable); + ui->checkBox_danger_low_latch->setChecked(variable_ptr->danger_low.latch); } void Trust::on_pushButton_confirm_clicked() { @@ -94,6 +125,29 @@ void Trust::on_pushButton_confirm_clicked() variable->zero_position.value = ui->doubleSpinBox_zero_position->value(); variable->zero_position.negation = ui->checkBox_negation->isChecked(); + + // processed output + // -general + if(ui->comboBox_output_used->currentIndex() == 0) + variable->general.output_used = true; + else + variable->general.output_used = false; + // -alarm + variable->danger_high.level = ui->lineEdit_danger_high_level->text().toDouble(); + variable->danger_high.hysteresis = ui->lineEdit_danger_high_hysteresis->text().toDouble(); + variable->danger_high.delay = ui->lineEdit_danger_high_delay->text().toDouble(); + variable->danger_high.enable = ui->checkBox_danger_high_enable->isChecked(); + variable->danger_high.latch = ui->checkBox_danger_high_latch->isChecked(); + variable->alert_high.level = ui->lineEdit_alert_high_level->text().toDouble(); + variable->alert_high.hysteresis = ui->lineEdit_alert_high_hysteresis->text().toDouble(); + variable->alert_high.delay = ui->lineEdit_alert_high_delay->text().toDouble(); + variable->alert_high.enable = ui->checkBox_alert_high_enable->isChecked(); + variable->alert_high.latch = ui->checkBox_alert_high_latch->isChecked(); + variable->danger_low.level = ui->lineEdit_danger_low_level->text().toDouble(); + variable->danger_low.hysteresis = ui->lineEdit_danger_low_hysteresis->text().toDouble(); + variable->danger_low.delay = ui->lineEdit_danger_low_delay->text().toDouble(); + variable->danger_low.enable = ui->checkBox_danger_low_enable->isChecked(); + variable->danger_low.latch = ui->checkBox_danger_low_latch->isChecked(); ptr->variables_.push_back(variable); this->close(); return; @@ -111,6 +165,29 @@ void Trust::on_pushButton_confirm_clicked() variable->zero_position.value = ui->doubleSpinBox_zero_position->value(); variable->zero_position.negation = ui->checkBox_negation->isChecked(); + + // processed output + // -general + if(ui->comboBox_output_used->currentIndex() == 0) + variable->general.output_used = true; + else + variable->general.output_used = false; + // -alarm + variable->danger_high.level = ui->lineEdit_danger_high_level->text().toDouble(); + variable->danger_high.hysteresis = ui->lineEdit_danger_high_hysteresis->text().toDouble(); + variable->danger_high.delay = ui->lineEdit_danger_high_delay->text().toDouble(); + variable->danger_high.enable = ui->checkBox_danger_high_enable->isChecked(); + variable->danger_high.latch = ui->checkBox_danger_high_latch->isChecked(); + variable->alert_high.level = ui->lineEdit_alert_high_level->text().toDouble(); + variable->alert_high.hysteresis = ui->lineEdit_alert_high_hysteresis->text().toDouble(); + variable->alert_high.delay = ui->lineEdit_alert_high_delay->text().toDouble(); + variable->alert_high.enable = ui->checkBox_alert_high_enable->isChecked(); + variable->alert_high.latch = ui->checkBox_alert_high_latch->isChecked(); + variable->danger_low.level = ui->lineEdit_danger_low_level->text().toDouble(); + variable->danger_low.hysteresis = ui->lineEdit_danger_low_hysteresis->text().toDouble(); + variable->danger_low.delay = ui->lineEdit_danger_low_delay->text().toDouble(); + variable->danger_low.enable = ui->checkBox_danger_low_enable->isChecked(); + variable->danger_low.latch = ui->checkBox_danger_low_latch->isChecked(); this->close(); } diff --git a/trust.ui b/trust.ui index 5734bec..b95bd22 100644 --- a/trust.ui +++ b/trust.ui @@ -281,13 +281,13 @@ 10 - 20 + 30 621 321 - 1 + 0 @@ -430,7 +430,7 @@ 初始位置 - + 10 @@ -462,7 +462,7 @@ -50 - 50 V - + 10 @@ -611,7 +611,7 @@ - + 150 @@ -721,7 +721,7 @@ - + 290 @@ -734,7 +734,7 @@ - + 290 @@ -747,7 +747,7 @@ - + 290 @@ -773,7 +773,7 @@ - + 350 @@ -786,7 +786,7 @@ - + 350 @@ -799,7 +799,7 @@ - + 350 @@ -812,7 +812,7 @@ - + 350 @@ -828,367 +828,6 @@ - - - 分频段选择 - - - - - 120 - 210 - 113 - 20 - - - - - - - 20 - 90 - 71 - 16 - - - - 使能 - - - - - - 270 - 270 - 113 - 20 - - - - - - - 20 - 300 - 71 - 16 - - - - 使能 - - - - - - 20 - 60 - 71 - 16 - - - - 使能 - - - - - - 140 - 20 - 91 - 16 - - - - 频率开始(Hz) - - - - - - 270 - 300 - 113 - 20 - - - - - - - 270 - 240 - 113 - 20 - - - - - - - 20 - 330 - 71 - 16 - - - - 使能 - - - - - - 120 - 60 - 113 - 20 - - - - - - - 20 - 270 - 71 - 16 - - - - 使能 - - - - - - 120 - 270 - 113 - 20 - - - - - - - 270 - 60 - 113 - 20 - - - - - - - 120 - 150 - 113 - 20 - - - - - - - 120 - 120 - 113 - 20 - - - - - - - 20 - 150 - 71 - 16 - - - - 使能 - - - - - - 290 - 20 - 91 - 16 - - - - 频率结束(Hz) - - - - - - 270 - 180 - 113 - 20 - - - - - - - 120 - 330 - 113 - 20 - - - - - - - 270 - 120 - 113 - 20 - - - - - - - 270 - 210 - 113 - 20 - - - - - - - 20 - 120 - 71 - 16 - - - - 使能 - - - - - - 120 - 180 - 113 - 20 - - - - - - - 270 - 150 - 113 - 20 - - - - - - - 120 - 240 - 113 - 20 - - - - - - - 120 - 300 - 113 - 20 - - - - - - - 270 - 90 - 113 - 20 - - - - - - - 20 - 240 - 71 - 16 - - - - 使能 - - - - - - 120 - 90 - 113 - 20 - - - - - - - 20 - 180 - 71 - 16 - - - - 使能 - - - - - - 20 - 210 - 71 - 16 - - - - 使能 - - - - - - 270 - 330 - 113 - 20 - - - - diff --git a/velocity.cpp b/velocity.cpp index aa54834..9ee0a41 100644 --- a/velocity.cpp +++ b/velocity.cpp @@ -32,28 +32,10 @@ Velocity::~Velocity() { delete ui; } -void Velocity::on_checkBox_rms_toggled(bool checked) { - // TODO: 自定义的回调 - -} - -void Velocity::on_checkBox_integrate_toggled(bool checked) { - // TODO: 自定义的回调 - -} - void Velocity::on_pushButton_cancel_clicked() { this->close(); } -void Velocity::on_checkBox_1x_ampl_toggled(bool checked) { - -} - -void Velocity::on_checkBox_2x_ampl_toggled(bool checked) { - -} - void Velocity::Init() { std::shared_ptr base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no); if (base_ptr == nullptr) { @@ -81,6 +63,37 @@ void Velocity::Init() { ui->spinBox_band_pass_low->setValue(variable_ptr->filter_[2].low); ui->spinBox_band_pass_high->setValue(variable_ptr->filter_[2].high); + // processed output + // -general + if(variable_ptr->general.output_used) + ui->comboBox_output_used->setCurrentIndex(0); + else + ui->comboBox_output_used->setCurrentIndex(1); + // -alarm + ui->lineEdit_danger_high_level->setText(QString::number(variable_ptr->danger_high.level)); + ui->lineEdit_danger_high_hysteresis->setText(QString::number(variable_ptr->danger_high.level)); + ui->lineEdit_danger_high_delay->setText(QString::number(variable_ptr->danger_high.level)); + ui->checkBox_danger_high_enable->setChecked(variable_ptr->danger_high.enable); + ui->checkBox_danger_high_latch->setChecked(variable_ptr->danger_high.latch); + + ui->lineEdit_alert_high_level->setText(QString::number(variable_ptr->alert_high.level)); + ui->lineEdit_alert_high_hysteresis->setText(QString::number(variable_ptr->alert_high.level)); + ui->lineEdit_alert_high_delay->setText(QString::number(variable_ptr->alert_high.level)); + ui->checkBox_alert_high_enable->setChecked(variable_ptr->alert_high.enable); + ui->checkBox_alert_high_latch->setChecked(variable_ptr->alert_high.latch); + + ui->lineEdit_danger_low_level->setText(QString::number(variable_ptr->danger_low.level)); + ui->lineEdit_danger_low_hysteresis->setText(QString::number(variable_ptr->danger_low.level)); + ui->lineEdit_danger_low_delay->setText(QString::number(variable_ptr->danger_low.level)); + ui->checkBox_danger_low_enable->setChecked(variable_ptr->danger_low.enable); + ui->checkBox_danger_low_latch->setChecked(variable_ptr->danger_low.latch); + + ui->lineEdit_danger_low_level->setText(QString::number(variable_ptr->danger_low.level)); + ui->lineEdit_danger_low_hysteresis->setText(QString::number(variable_ptr->danger_low.level)); + ui->lineEdit_danger_low_delay->setText(QString::number(variable_ptr->danger_low.level)); + ui->checkBox_danger_low_enable->setChecked(variable_ptr->danger_low.enable); + ui->checkBox_danger_low_latch->setChecked(variable_ptr->danger_low.latch); + } void Velocity::on_pushButton_confirm_clicked() { @@ -110,7 +123,28 @@ void Velocity::on_pushButton_confirm_clicked() { variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].high = ui->spinBox_band_pass_high->value(); - + // processed output + // -general + if(ui->comboBox_output_used->currentIndex() == 0) + variable->general.output_used = true; + else + variable->general.output_used = false; + // -alarm + variable->danger_high.level = ui->lineEdit_danger_high_level->text().toDouble(); + variable->danger_high.hysteresis = ui->lineEdit_danger_high_hysteresis->text().toDouble(); + variable->danger_high.delay = ui->lineEdit_danger_high_delay->text().toDouble(); + variable->danger_high.enable = ui->checkBox_danger_high_enable->isChecked(); + variable->danger_high.latch = ui->checkBox_danger_high_latch->isChecked(); + variable->alert_high.level = ui->lineEdit_alert_high_level->text().toDouble(); + variable->alert_high.hysteresis = ui->lineEdit_alert_high_hysteresis->text().toDouble(); + variable->alert_high.delay = ui->lineEdit_alert_high_delay->text().toDouble(); + variable->alert_high.enable = ui->checkBox_alert_high_enable->isChecked(); + variable->alert_high.latch = ui->checkBox_alert_high_latch->isChecked(); + variable->danger_low.level = ui->lineEdit_danger_low_level->text().toDouble(); + variable->danger_low.hysteresis = ui->lineEdit_danger_low_hysteresis->text().toDouble(); + variable->danger_low.delay = ui->lineEdit_danger_low_delay->text().toDouble(); + variable->danger_low.enable = ui->checkBox_danger_low_enable->isChecked(); + variable->danger_low.latch = ui->checkBox_danger_low_latch->isChecked(); ptr->variables_.push_back(variable); this->close(); return; @@ -125,6 +159,27 @@ void Velocity::on_pushButton_confirm_clicked() { variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].high = ui->spinBox_band_pass_high->value(); - + // processed output + // -general + if(ui->comboBox_output_used->currentIndex() == 0) + variable->general.output_used = true; + else + variable->general.output_used = false; + // -alarm + variable->danger_high.level = ui->lineEdit_danger_high_level->text().toDouble(); + variable->danger_high.hysteresis = ui->lineEdit_danger_high_hysteresis->text().toDouble(); + variable->danger_high.delay = ui->lineEdit_danger_high_delay->text().toDouble(); + variable->danger_high.enable = ui->checkBox_danger_high_enable->isChecked(); + variable->danger_high.latch = ui->checkBox_danger_high_latch->isChecked(); + variable->alert_high.level = ui->lineEdit_alert_high_level->text().toDouble(); + variable->alert_high.hysteresis = ui->lineEdit_alert_high_hysteresis->text().toDouble(); + variable->alert_high.delay = ui->lineEdit_alert_high_delay->text().toDouble(); + variable->alert_high.enable = ui->checkBox_alert_high_enable->isChecked(); + variable->alert_high.latch = ui->checkBox_alert_high_latch->isChecked(); + variable->danger_low.level = ui->lineEdit_danger_low_level->text().toDouble(); + variable->danger_low.hysteresis = ui->lineEdit_danger_low_hysteresis->text().toDouble(); + variable->danger_low.delay = ui->lineEdit_danger_low_delay->text().toDouble(); + variable->danger_low.enable = ui->checkBox_danger_low_enable->isChecked(); + variable->danger_low.latch = ui->checkBox_danger_low_latch->isChecked(); this->close(); } diff --git a/velocity.h b/velocity.h index af40b1b..1c0a31e 100644 --- a/velocity.h +++ b/velocity.h @@ -20,10 +20,6 @@ class Velocity : public QWidget { private slots: void on_pushButton_confirm_clicked(); void on_pushButton_cancel_clicked(); - void on_checkBox_1x_ampl_toggled(bool checked); - void on_checkBox_2x_ampl_toggled(bool checked); - void on_checkBox_rms_toggled(bool checked); - void on_checkBox_integrate_toggled(bool checked); private: Ui::Velocity *ui; diff --git a/velocity.ui b/velocity.ui index ba9bd1f..b24891c 100644 --- a/velocity.ui +++ b/velocity.ui @@ -293,14 +293,14 @@ - 10 - 20 + 20 + 30 621 321 - 0 + 1 @@ -566,7 +566,7 @@ - + 150 @@ -676,7 +676,7 @@ - + 290 @@ -689,7 +689,7 @@ - + 290 @@ -702,7 +702,7 @@ - + 290 @@ -728,7 +728,7 @@ - + 350 @@ -741,7 +741,7 @@ - + 350 @@ -754,7 +754,7 @@ - + 350 @@ -767,7 +767,7 @@ - + 350