add temp code

This commit is contained in:
zhangsheng 2025-07-28 22:05:26 +08:00
parent ec2d25398c
commit b1a776bfda
12 changed files with 1043 additions and 545 deletions

View File

@ -151,8 +151,59 @@ void Acceleration::on_pushButton_confirm_clicked() {
variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].checked = ui->checkBox_band_pass->isChecked();
variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].low = ui->spinBox_band_pass_low->value();
variable->filter_[2].high = ui->spinBox_band_pass_high->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); ptr->variables_.push_back(variable);
this->close(); this->close();
return; return;
@ -167,7 +218,59 @@ void Acceleration::on_pushButton_confirm_clicked() {
variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].checked = ui->checkBox_band_pass->isChecked();
variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].low = ui->spinBox_band_pass_low->value();
variable->filter_[2].high = ui->spinBox_band_pass_high->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(); this->close();
} }

View File

@ -29,6 +29,13 @@ class VariableBase {
AlarmAlertHigh alert_high; AlarmAlertHigh alert_high;
AlarmDangerLow danger_low; AlarmDangerLow danger_low;
AlarmAlertLow alert_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]; FrequencybandOutput freband_output[10];
}; };

View File

@ -133,41 +133,56 @@ void ConfigMgr::Save(QString & file_path) {
band_pass["checked"] = radial_ptr->filter_[2].checked; band_pass["checked"] = radial_ptr->filter_[2].checked;
filter.append(band_pass); filter.append(band_pass);
variables["filter"] = filter; variables["filter"] = filter;
QJsonObject direct; // measurement
QJsonObject x1; QJsonObject measurement,general,alarm;
QJsonObject x2; general["output_used"] = radial_ptr->general.output_used;
QJsonObject recorder_out; general["engieneering_unit"] = radial_ptr->general.engineering_unit;
QJsonObject delay; general["rectifier_function"] = radial_ptr->general.rectifier_function;
QJsonArray latching;
direct["full_scale_range"] = radial_ptr->direct_.full_scale_range; alarm["danger_high_level"] = radial_ptr->danger_high.level;
direct["clamp_value"] = radial_ptr->direct_.clamp_value; alarm["danger_high_hysteresis"] = radial_ptr->danger_high.hysteresis;
direct["custom"] = radial_ptr->direct_.custom; alarm["danger_high_delay"] = radial_ptr->danger_high.delay;
variables["direct"] = direct; alarm["danger_high_enable"] = radial_ptr->danger_high.enable;
x1["checked"] = radial_ptr->x1_.checked; alarm["danger_high_latch"] = radial_ptr->danger_high.latch;
x1["full_scale_range"] = radial_ptr->x1_.full_scale_range; alarm["alert_high_level"] = radial_ptr->alert_high.level;
x1["clamp_value"] = radial_ptr->x1_.clamp_value; alarm["alert_high_hysteresis"] = radial_ptr->alert_high.hysteresis;
x1["custom"] = radial_ptr->x1_.custom; alarm["alert_high_delay"] = radial_ptr->alert_high.delay;
x1["phase_lag"] = radial_ptr->x1_.phase_lag; alarm["alert_high_enable"] = radial_ptr->alert_high.enable;
variables["x1"] = x1; alarm["alert_high_latch"] = radial_ptr->alert_high.latch;
x2["checked"] = radial_ptr->x2_.checked; alarm["danger_low_level"] = radial_ptr->danger_low.level;
x2["full_scale_range"] = radial_ptr->x2_.full_scale_range; alarm["danger_low_hysteresis"] = radial_ptr->danger_low.hysteresis;
x2["clamp_value"] = radial_ptr->x2_.clamp_value; alarm["danger_low_delay"] = radial_ptr->danger_low.delay;
x2["custom"] = radial_ptr->x2_.custom; alarm["danger_low_enable"] = radial_ptr->danger_low.enable;
x2["phase_lag"] = radial_ptr->x2_.phase_lag; alarm["danger_low_latch"] = radial_ptr->danger_low.latch;
variables["x2"] = x2; measurement["general"] = general;
recorder_out["recorder_output"] = radial_ptr->recorder_out_.recorder_output; measurement["alarm"] = alarm;
recorder_out["two_ma_clamp"] = radial_ptr->recorder_out_.two_ma_clamp; variables["measurement"] = measurement;
recorder_out["trip_multiply"] = radial_ptr->recorder_out_.trip_multiply; // gap
recorder_out["comparision"] = radial_ptr->recorder_out_.comparision; QJsonObject gap,gap_general,gap_alarm;
recorder_out["percentage"] = radial_ptr->recorder_out_.percentage; gap_general["output_used"] = radial_ptr->gap_general.output_used;
variables["recorder_out"] = recorder_out; gap_general["engieneering_unit"] = radial_ptr->gap_general.engineering_unit;
delay["alert"] = radial_ptr->delay_.alert; gap_general["rectifier_function"] = radial_ptr->gap_general.rectifier_function;
delay["danger"] = radial_ptr->delay_.danger;
delay["active_100ms"] = radial_ptr->delay_.active_100ms; gap_alarm["danger_high_level"] = radial_ptr->gap_danger_high.level;
variables["delay"] = delay; gap_alarm["danger_high_hysteresis"] = radial_ptr->gap_danger_high.hysteresis;
latching.append(radial_ptr->alert_latching_); gap_alarm["danger_high_delay"] = radial_ptr->gap_danger_high.delay;
latching.append(radial_ptr->danger_latching_); gap_alarm["danger_high_enable"] = radial_ptr->gap_danger_high.enable;
variables["latching"] = latching; 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){ }else if(ptr->base_config_[cid].channel_type == kVibThrust){
std::shared_ptr<ThrustVariable> thrust_ptr = std::dynamic_pointer_cast<ThrustVariable>(base_channel_ptr); std::shared_ptr<ThrustVariable> thrust_ptr = std::dynamic_pointer_cast<ThrustVariable>(base_channel_ptr);
if(thrust_ptr == nullptr){ if(thrust_ptr == nullptr){
@ -191,33 +206,33 @@ void ConfigMgr::Save(QString & file_path) {
band_pass["checked"] = thrust_ptr->filter_[2].checked; band_pass["checked"] = thrust_ptr->filter_[2].checked;
filter.append(band_pass); filter.append(band_pass);
variables["filter"] = filter; variables["filter"] = filter;
QJsonObject direct,gap; // gap
QJsonObject recorder_out; QJsonObject gap,gap_general,gap_alarm;
QJsonObject delay; gap_general["output_used"] = thrust_ptr->gap_general.output_used;
QJsonArray latching; gap_general["engieneering_unit"] = thrust_ptr->gap_general.engineering_unit;
direct["full_scale_range"] = thrust_ptr->direct_.full_scale_range; gap_general["rectifier_function"] = thrust_ptr->gap_general.rectifier_function;
direct["clamp_value"] = thrust_ptr->direct_.clamp_value;
direct["custom"] = thrust_ptr->direct_.custom; gap_alarm["danger_high_level"] = thrust_ptr->gap_danger_high.level;
variables["direct"] = direct; gap_alarm["danger_high_hysteresis"] = thrust_ptr->gap_danger_high.hysteresis;
gap["full_scale_range"] = thrust_ptr->gap_range.full_scale_range; gap_alarm["danger_high_delay"] = thrust_ptr->gap_danger_high.delay;
gap["custom"] = thrust_ptr->gap_range.custom; 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; 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["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){ }else if(ptr->base_config_[cid].channel_type == kVibPressurePulsation){
std::shared_ptr<PressurePulsationVariable> pressure_ptr = std::dynamic_pointer_cast<PressurePulsationVariable>(base_channel_ptr); std::shared_ptr<PressurePulsationVariable> pressure_ptr = std::dynamic_pointer_cast<PressurePulsationVariable>(base_channel_ptr);
if(pressure_ptr == nullptr){ if(pressure_ptr == nullptr){
@ -254,7 +269,17 @@ void ConfigMgr::Save(QString & file_path) {
variables["sampling"] = sampling; variables["sampling"] = sampling;
variables["scaling"] = scaling; 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<AccVelVariable> av_ptr = std::dynamic_pointer_cast<AccVelVariable>(base_channel_ptr); std::shared_ptr<AccVelVariable> av_ptr = std::dynamic_pointer_cast<AccVelVariable>(base_channel_ptr);
if(av_ptr == nullptr){ if(av_ptr == nullptr){
continue; continue;
@ -277,46 +302,40 @@ void ConfigMgr::Save(QString & file_path) {
band_pass["checked"] = av_ptr->filter_[2].checked; band_pass["checked"] = av_ptr->filter_[2].checked;
filter.append(band_pass); filter.append(band_pass);
variables["filter"] = filter; variables["filter"] = filter;
QJsonObject direct; // processed output
QJsonObject x1; QJsonObject processed_output,general,alarm;
QJsonObject x2; general["output_used"] = av_ptr->general.output_used;
QJsonObject recorder_out; general["engieneering_unit"] = av_ptr->general.engineering_unit;
QJsonObject delay; general["rectifier_function"] = av_ptr->general.rectifier_function;
QJsonArray latching;
direct["full_scale_range"] = av_ptr->direct_.full_scale_range; alarm["danger_high_level"] = av_ptr->danger_high.level;
direct["clamp_value"] = av_ptr->direct_.clamp_value; alarm["danger_high_hysteresis"] = av_ptr->danger_high.hysteresis;
direct["custom"] = av_ptr->direct_.custom; alarm["danger_high_delay"] = av_ptr->danger_high.delay;
variables["direct"] = direct; alarm["danger_high_enable"] = av_ptr->danger_high.enable;
x1["checked"] = av_ptr->x1_.checked; alarm["danger_high_latch"] = av_ptr->danger_high.latch;
x1["full_scale_range"] = av_ptr->x1_.full_scale_range; alarm["alert_high_level"] = av_ptr->alert_high.level;
x1["clamp_value"] = av_ptr->x1_.clamp_value; alarm["alert_high_hysteresis"] = av_ptr->alert_high.hysteresis;
x1["custom"] = av_ptr->x1_.custom; alarm["alert_high_delay"] = av_ptr->alert_high.delay;
x1["phase_lag"] = av_ptr->x1_.phase_lag; alarm["alert_high_enable"] = av_ptr->alert_high.enable;
variables["x1"] = x1; alarm["alert_high_latch"] = av_ptr->alert_high.latch;
x2["checked"] = av_ptr->x2_.checked; alarm["danger_low_level"] = av_ptr->danger_low.level;
x2["full_scale_range"] = av_ptr->x2_.full_scale_range; alarm["danger_low_hysteresis"] = av_ptr->danger_low.hysteresis;
x2["clamp_value"] = av_ptr->x2_.clamp_value; alarm["danger_low_delay"] = av_ptr->danger_low.delay;
x2["custom"] = av_ptr->x2_.custom; alarm["danger_low_enable"] = av_ptr->danger_low.enable;
x2["phase_lag"] = av_ptr->x2_.phase_lag; alarm["danger_low_latch"] = av_ptr->danger_low.latch;
variables["x2"] = x2; processed_output["general"] = general;
QJsonObject rms_integrate; processed_output["alarm"] = alarm;
rms_integrate["rms_active"] = av_ptr->rms_active_; variables["processed_output"] = processed_output;
rms_integrate["integrate_active"] = av_ptr->integrate_active_; QJsonArray freband_output_array;
variables["rms_integrate"] = rms_integrate; QJsonObject freband_output;
recorder_out["recorder_output"] = av_ptr->recorder_out_.recorder_output; for (int var = 0; var < 10; ++var) {
recorder_out["two_ma_clamp"] = av_ptr->recorder_out_.two_ma_clamp; freband_output["enable"] = av_ptr->freband_output[var].enable;
recorder_out["trip_multiply"] = av_ptr->recorder_out_.trip_multiply; freband_output["start"] = av_ptr->freband_output[var].start;
recorder_out["comparision"] = av_ptr->recorder_out_.comparision; freband_output["end"] = av_ptr->freband_output[var].end;
recorder_out["percentage"] = av_ptr->recorder_out_.percentage; freband_output_array.append(freband_output);
variables["recorder_out"] = recorder_out; }
delay["alert"] = av_ptr->delay_.alert; variables["freband_output"] = freband_output_array;
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;
} }
channel_item["variable"] = variables; channel_item["variable"] = variables;
} else if (card_type_[i] == kCardSpeedSingle || card_type_[i] == kCardSpeedTMRPrimary) { } else if (card_type_[i] == kCardSpeedSingle || card_type_[i] == kCardSpeedTMRPrimary) {

View File

@ -66,6 +66,37 @@ void PressurePulsation::Init() {
ui->lineEdit_measuring_value_max->setText(QString::number(variable_ptr->measuring_max)); 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_min->setText(QString::number(variable_ptr->scale_min));
ui->lineEdit_scale_value_max->setText(QString::number(variable_ptr->scale_max)); 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() 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->measuring_max = ui->lineEdit_measuring_value_max->text().toInt();
variable->scale_min = ui->lineEdit_scale_value_min->text().toInt(); variable->scale_min = ui->lineEdit_scale_value_min->text().toInt();
variable->scale_max = ui->lineEdit_scale_value_max->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); ptr->variables_.push_back(variable);
this->close(); this->close();
@ -127,6 +189,38 @@ void PressurePulsation::on_pushButton_confirm_clicked()
variable->scale_min = ui->lineEdit_scale_value_min->text().toInt(); variable->scale_min = ui->lineEdit_scale_value_min->text().toInt();
variable->scale_max = ui->lineEdit_scale_value_max->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(); this->close();
} }

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>701</width> <width>701</width>
<height>519</height> <height>572</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -76,7 +76,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>30</x> <x>30</x>
<y>450</y> <y>500</y>
<width>632</width> <width>632</width>
<height>37</height> <height>37</height>
</rect> </rect>
@ -164,11 +164,11 @@
<x>20</x> <x>20</x>
<y>60</y> <y>60</y>
<width>651</width> <width>651</width>
<height>381</height> <height>421</height>
</rect> </rect>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>2</number>
</property> </property>
<widget class="QWidget" name="tab_5"> <widget class="QWidget" name="tab_5">
<attribute name="title"> <attribute name="title">
@ -514,8 +514,8 @@
<rect> <rect>
<x>20</x> <x>20</x>
<y>70</y> <y>70</y>
<width>118</width> <width>121</width>
<height>22</height> <height>23</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_10"> <layout class="QHBoxLayout" name="horizontalLayout_10">
@ -543,7 +543,7 @@
<x>20</x> <x>20</x>
<y>100</y> <y>100</y>
<width>122</width> <width>122</width>
<height>14</height> <height>17</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_11"> <layout class="QHBoxLayout" name="horizontalLayout_11">
@ -569,7 +569,7 @@
<x>20</x> <x>20</x>
<y>130</y> <y>130</y>
<width>92</width> <width>92</width>
<height>14</height> <height>17</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_12"> <layout class="QHBoxLayout" name="horizontalLayout_12">
@ -594,8 +594,8 @@
<rect> <rect>
<x>20</x> <x>20</x>
<y>160</y> <y>160</y>
<width>104</width> <width>106</width>
<height>14</height> <height>17</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_13"> <layout class="QHBoxLayout" name="horizontalLayout_13">
@ -774,6 +774,367 @@
</widget> </widget>
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>分频段选择</string>
</attribute>
<widget class="QCheckBox" name="checkBox_enable_6">
<property name="geometry">
<rect>
<x>40</x>
<y>230</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start">
<property name="geometry">
<rect>
<x>140</x>
<y>80</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_4">
<property name="geometry">
<rect>
<x>40</x>
<y>170</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_2">
<property name="geometry">
<rect>
<x>140</x>
<y>110</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_3">
<property name="geometry">
<rect>
<x>40</x>
<y>140</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_4">
<property name="geometry">
<rect>
<x>140</x>
<y>170</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_3">
<property name="geometry">
<rect>
<x>290</x>
<y>140</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_5">
<property name="geometry">
<rect>
<x>290</x>
<y>200</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_17">
<property name="geometry">
<rect>
<x>160</x>
<y>40</y>
<width>91</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>频率开始(Hz)</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_6">
<property name="geometry">
<rect>
<x>290</x>
<y>230</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable">
<property name="geometry">
<rect>
<x>40</x>
<y>80</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_3">
<property name="geometry">
<rect>
<x>140</x>
<y>140</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_5">
<property name="geometry">
<rect>
<x>140</x>
<y>200</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_5">
<property name="geometry">
<rect>
<x>40</x>
<y>200</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_2">
<property name="geometry">
<rect>
<x>290</x>
<y>110</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_18">
<property name="geometry">
<rect>
<x>310</x>
<y>40</y>
<width>91</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>频率结束(Hz)</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_6">
<property name="geometry">
<rect>
<x>140</x>
<y>230</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_2">
<property name="geometry">
<rect>
<x>40</x>
<y>110</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end">
<property name="geometry">
<rect>
<x>290</x>
<y>80</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_4">
<property name="geometry">
<rect>
<x>290</x>
<y>170</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_10">
<property name="geometry">
<rect>
<x>40</x>
<y>350</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_9">
<property name="geometry">
<rect>
<x>140</x>
<y>320</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_8">
<property name="geometry">
<rect>
<x>40</x>
<y>290</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_10">
<property name="geometry">
<rect>
<x>140</x>
<y>350</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_9">
<property name="geometry">
<rect>
<x>290</x>
<y>320</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_7">
<property name="geometry">
<rect>
<x>40</x>
<y>260</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_7">
<property name="geometry">
<rect>
<x>290</x>
<y>260</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_8">
<property name="geometry">
<rect>
<x>140</x>
<y>290</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_8">
<property name="geometry">
<rect>
<x>290</x>
<y>290</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_7">
<property name="geometry">
<rect>
<x>140</x>
<y>260</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_9">
<property name="geometry">
<rect>
<x>40</x>
<y>320</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_10">
<property name="geometry">
<rect>
<x>290</x>
<y>350</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
</widget>
</widget> </widget>
</widget> </widget>
<resources/> <resources/>

View File

@ -70,7 +70,67 @@ void Radial::Init() {
ui->checkBox_band_pass->setChecked(variable_ptr->filter_[2].checked); 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_low->setValue(variable_ptr->filter_[2].low);
ui->spinBox_band_pass_high->setValue(variable_ptr->filter_[2].high); 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() { 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].checked = ui->checkBox_band_pass->isChecked();
variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].low = ui->spinBox_band_pass_low->value();
variable->filter_[2].high = ui->spinBox_band_pass_high->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); ptr->variables_.push_back(variable);
this->close(); this->close();
return; return;
@ -115,7 +219,50 @@ void Radial::on_pushButton_confirm_clicked() {
variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].checked = ui->checkBox_band_pass->isChecked();
variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].low = ui->spinBox_band_pass_low->value();
variable->filter_[2].high = ui->spinBox_band_pass_high->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(); this->close();
} }

View File

@ -23,7 +23,7 @@
</rect> </rect>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>2</number>
</property> </property>
<widget class="QWidget" name="tab_5"> <widget class="QWidget" name="tab_5">
<attribute name="title"> <attribute name="title">
@ -293,14 +293,14 @@
<widget class="QTabWidget" name="tabWidget_4"> <widget class="QTabWidget" name="tabWidget_4">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>20</x>
<y>40</y> <y>50</y>
<width>621</width> <width>621</width>
<height>321</height> <height>321</height>
</rect> </rect>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="tab_8"> <widget class="QWidget" name="tab_8">
<attribute name="title"> <attribute name="title">
@ -566,7 +566,7 @@
</rect> </rect>
</property> </property>
</widget> </widget>
<widget class="QLineEdit" name="lineEdit_danger_high_hystersis"> <widget class="QLineEdit" name="lineEdit_danger_high_hysteresis">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>150</x> <x>150</x>
@ -676,7 +676,7 @@
</rect> </rect>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_danger_enable"> <widget class="QCheckBox" name="checkBox_danger_high_enable">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>290</x> <x>290</x>
@ -689,7 +689,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_alert_enable"> <widget class="QCheckBox" name="checkBox_alert_high_enable">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>290</x> <x>290</x>
@ -702,7 +702,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_alert_enable_2"> <widget class="QCheckBox" name="checkBox_alert_low_enable">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>290</x> <x>290</x>
@ -728,7 +728,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_alert_latch"> <widget class="QCheckBox" name="checkBox_alert_high_latch">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>350</x>
@ -741,7 +741,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_danger_low_ltach"> <widget class="QCheckBox" name="checkBox_danger_low_latch">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>350</x>
@ -754,7 +754,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_danger_latch"> <widget class="QCheckBox" name="checkBox_danger_high_latch">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>350</x>
@ -767,7 +767,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_alert_latch_2"> <widget class="QCheckBox" name="checkBox_alert_low_latch">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>350</x>
@ -797,7 +797,7 @@
</rect> </rect>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="tab_10"> <widget class="QWidget" name="tab_10">
<attribute name="title"> <attribute name="title">
@ -1063,7 +1063,7 @@
</rect> </rect>
</property> </property>
</widget> </widget>
<widget class="QLineEdit" name="lineEdit_danger_high_hystersis_2"> <widget class="QLineEdit" name="lineEdit_danger_high_hysteresis_2">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>150</x> <x>150</x>
@ -1173,7 +1173,7 @@
</rect> </rect>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_danger_enable_2"> <widget class="QCheckBox" name="checkBox_danger_high_enable_2">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>290</x> <x>290</x>
@ -1186,7 +1186,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_alert_enable_3"> <widget class="QCheckBox" name="checkBox_alert_high_enable_2">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>290</x> <x>290</x>
@ -1199,7 +1199,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_alert_enable_4"> <widget class="QCheckBox" name="checkBox_alert_low_enable_2">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>290</x> <x>290</x>
@ -1225,7 +1225,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_alert_latch_3"> <widget class="QCheckBox" name="checkBox_alert_high_latch_2">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>350</x>
@ -1238,7 +1238,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_danger_low_ltach_2"> <widget class="QCheckBox" name="checkBox_danger_low_latch_2">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>350</x>
@ -1251,7 +1251,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_danger_latch_2"> <widget class="QCheckBox" name="checkBox_danger_high_latch_2">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>350</x>
@ -1264,7 +1264,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_alert_latch_4"> <widget class="QCheckBox" name="checkBox_alert_low_latch_2">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>350</x>

View File

@ -62,6 +62,37 @@ void Trust::Init() {
ui->doubleSpinBox_zero_position->setValue(variable_ptr->zero_position.value); ui->doubleSpinBox_zero_position->setValue(variable_ptr->zero_position.value);
ui->checkBox_negation->setChecked(variable_ptr->zero_position.negation); 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() 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.value = ui->doubleSpinBox_zero_position->value();
variable->zero_position.negation = ui->checkBox_negation->isChecked(); 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); ptr->variables_.push_back(variable);
this->close(); this->close();
return; return;
@ -111,6 +165,29 @@ void Trust::on_pushButton_confirm_clicked()
variable->zero_position.value = ui->doubleSpinBox_zero_position->value(); variable->zero_position.value = ui->doubleSpinBox_zero_position->value();
variable->zero_position.negation = ui->checkBox_negation->isChecked(); 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(); this->close();
} }

385
trust.ui
View File

@ -281,13 +281,13 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
<y>20</y> <y>30</y>
<width>621</width> <width>621</width>
<height>321</height> <height>321</height>
</rect> </rect>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tab_8"> <widget class="QWidget" name="tab_8">
<attribute name="title"> <attribute name="title">
@ -430,7 +430,7 @@
<property name="title"> <property name="title">
<string>初始位置</string> <string>初始位置</string>
</property> </property>
<widget class="QDoubleSpinBox" name="doubleSpinBox_zero_position_2"> <widget class="QDoubleSpinBox" name="doubleSpinBox_zero_position">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
@ -462,7 +462,7 @@
<string>-50 - 50 V</string> <string>-50 - 50 V</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_negation_2"> <widget class="QCheckBox" name="checkBox_negation">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
@ -611,7 +611,7 @@
</rect> </rect>
</property> </property>
</widget> </widget>
<widget class="QLineEdit" name="lineEdit_danger_high_hystersis"> <widget class="QLineEdit" name="lineEdit_danger_high_hysteresis">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>150</x> <x>150</x>
@ -721,7 +721,7 @@
</rect> </rect>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_danger_enable"> <widget class="QCheckBox" name="checkBox_danger_high_enable">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>290</x> <x>290</x>
@ -734,7 +734,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_alert_enable"> <widget class="QCheckBox" name="checkBox_alert_high_enable">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>290</x> <x>290</x>
@ -747,7 +747,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_alert_enable_2"> <widget class="QCheckBox" name="checkBox_alert_low_enable">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>290</x> <x>290</x>
@ -773,7 +773,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_alert_latch"> <widget class="QCheckBox" name="checkBox_alert_high_latch">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>350</x>
@ -786,7 +786,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_danger_low_ltach"> <widget class="QCheckBox" name="checkBox_danger_low_latch">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>350</x>
@ -799,7 +799,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_danger_latch"> <widget class="QCheckBox" name="checkBox_danger_high_latch">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>350</x>
@ -812,7 +812,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_alert_latch_2"> <widget class="QCheckBox" name="checkBox_alert_low_latch">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>350</x>
@ -828,367 +828,6 @@
</widget> </widget>
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="tab_6">
<attribute name="title">
<string>分频段选择</string>
</attribute>
<widget class="QLineEdit" name="lineEdit_start_6">
<property name="geometry">
<rect>
<x>120</x>
<y>210</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_2">
<property name="geometry">
<rect>
<x>20</x>
<y>90</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_8">
<property name="geometry">
<rect>
<x>270</x>
<y>270</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_9">
<property name="geometry">
<rect>
<x>20</x>
<y>300</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable">
<property name="geometry">
<rect>
<x>20</x>
<y>60</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>140</x>
<y>20</y>
<width>91</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>频率开始(Hz)</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_9">
<property name="geometry">
<rect>
<x>270</x>
<y>300</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_7">
<property name="geometry">
<rect>
<x>270</x>
<y>240</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_10">
<property name="geometry">
<rect>
<x>20</x>
<y>330</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start">
<property name="geometry">
<rect>
<x>120</x>
<y>60</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_8">
<property name="geometry">
<rect>
<x>20</x>
<y>270</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_8">
<property name="geometry">
<rect>
<x>120</x>
<y>270</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end">
<property name="geometry">
<rect>
<x>270</x>
<y>60</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_4">
<property name="geometry">
<rect>
<x>120</x>
<y>150</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_3">
<property name="geometry">
<rect>
<x>120</x>
<y>120</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_4">
<property name="geometry">
<rect>
<x>20</x>
<y>150</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>290</x>
<y>20</y>
<width>91</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>频率结束(Hz)</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_5">
<property name="geometry">
<rect>
<x>270</x>
<y>180</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_10">
<property name="geometry">
<rect>
<x>120</x>
<y>330</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_3">
<property name="geometry">
<rect>
<x>270</x>
<y>120</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_6">
<property name="geometry">
<rect>
<x>270</x>
<y>210</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_3">
<property name="geometry">
<rect>
<x>20</x>
<y>120</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_5">
<property name="geometry">
<rect>
<x>120</x>
<y>180</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_4">
<property name="geometry">
<rect>
<x>270</x>
<y>150</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_7">
<property name="geometry">
<rect>
<x>120</x>
<y>240</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_9">
<property name="geometry">
<rect>
<x>120</x>
<y>300</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_2">
<property name="geometry">
<rect>
<x>270</x>
<y>90</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_7">
<property name="geometry">
<rect>
<x>20</x>
<y>240</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_start_2">
<property name="geometry">
<rect>
<x>120</x>
<y>90</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_5">
<property name="geometry">
<rect>
<x>20</x>
<y>180</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QCheckBox" name="checkBox_enable_6">
<property name="geometry">
<rect>
<x>20</x>
<y>210</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>使能</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_end_10">
<property name="geometry">
<rect>
<x>270</x>
<y>330</y>
<width>113</width>
<height>20</height>
</rect>
</property>
</widget>
</widget>
</widget> </widget>
<widget class="QWidget" name="layoutWidget"> <widget class="QWidget" name="layoutWidget">
<property name="geometry"> <property name="geometry">

View File

@ -32,28 +32,10 @@ Velocity::~Velocity() {
delete ui; 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() { void Velocity::on_pushButton_cancel_clicked() {
this->close(); this->close();
} }
void Velocity::on_checkBox_1x_ampl_toggled(bool checked) {
}
void Velocity::on_checkBox_2x_ampl_toggled(bool checked) {
}
void Velocity::Init() { void Velocity::Init() {
std::shared_ptr<CardBase> base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no); std::shared_ptr<CardBase> base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no);
if (base_ptr == nullptr) { 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_low->setValue(variable_ptr->filter_[2].low);
ui->spinBox_band_pass_high->setValue(variable_ptr->filter_[2].high); 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() { 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].checked = ui->checkBox_band_pass->isChecked();
variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].low = ui->spinBox_band_pass_low->value();
variable->filter_[2].high = ui->spinBox_band_pass_high->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); ptr->variables_.push_back(variable);
this->close(); this->close();
return; return;
@ -125,6 +159,27 @@ void Velocity::on_pushButton_confirm_clicked() {
variable->filter_[2].checked = ui->checkBox_band_pass->isChecked(); variable->filter_[2].checked = ui->checkBox_band_pass->isChecked();
variable->filter_[2].low = ui->spinBox_band_pass_low->value(); variable->filter_[2].low = ui->spinBox_band_pass_low->value();
variable->filter_[2].high = ui->spinBox_band_pass_high->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(); this->close();
} }

View File

@ -20,10 +20,6 @@ class Velocity : public QWidget {
private slots: private slots:
void on_pushButton_confirm_clicked(); void on_pushButton_confirm_clicked();
void on_pushButton_cancel_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: private:
Ui::Velocity *ui; Ui::Velocity *ui;

View File

@ -293,14 +293,14 @@
<widget class="QTabWidget" name="tabWidget_3"> <widget class="QTabWidget" name="tabWidget_3">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>20</x>
<y>20</y> <y>30</y>
<width>621</width> <width>621</width>
<height>321</height> <height>321</height>
</rect> </rect>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="tab_8"> <widget class="QWidget" name="tab_8">
<attribute name="title"> <attribute name="title">
@ -566,7 +566,7 @@
</rect> </rect>
</property> </property>
</widget> </widget>
<widget class="QLineEdit" name="lineEdit_danger_high_hystersis"> <widget class="QLineEdit" name="lineEdit_danger_high_hysteresis">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>150</x> <x>150</x>
@ -676,7 +676,7 @@
</rect> </rect>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_danger_enable"> <widget class="QCheckBox" name="checkBox_danger_high_enable">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>290</x> <x>290</x>
@ -689,7 +689,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_alert_enable"> <widget class="QCheckBox" name="checkBox_alert_high_enable">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>290</x> <x>290</x>
@ -702,7 +702,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_alert_enable_2"> <widget class="QCheckBox" name="checkBox_alert_low_enable">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>290</x> <x>290</x>
@ -728,7 +728,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_alert_latch"> <widget class="QCheckBox" name="checkBox_alert_high_latch">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>350</x>
@ -741,7 +741,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_danger_low_ltach"> <widget class="QCheckBox" name="checkBox_danger_low_latch">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>350</x>
@ -754,7 +754,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_danger_latch"> <widget class="QCheckBox" name="checkBox_danger_high_latch">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>350</x>
@ -767,7 +767,7 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="checkBox_alert_latch_2"> <widget class="QCheckBox" name="checkBox_alert_low_latch">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>350</x> <x>350</x>