add temp code

This commit is contained in:
DESKTOP-7I8SUIC\zhang 2025-07-28 20:55:48 +08:00
parent 27d45de8a1
commit ec2d25398c
19 changed files with 4852 additions and 4544 deletions

View File

@ -15,6 +15,7 @@ SOURCES += \
common.cpp \
config_mgr.cpp \
connect.cpp \
dc_outputs.cpp \
ethconfig.cpp \
keyphase.cpp \
keyphase_data.cpp \
@ -48,6 +49,7 @@ HEADERS += \
config_mgr.h \
connect.h \
data_config.h \
dc_outputs.h \
displacement_ds.h \
ethconfig.h \
keyphase.h \
@ -77,6 +79,7 @@ HEADERS += \
FORMS += \
acceleration.ui \
connect.ui \
dc_outputs.ui \
ethconfig.ui \
keyphase.ui \
macconfig.ui \

View File

@ -32,136 +32,6 @@ Acceleration::~Acceleration() {
delete ui;
}
void Acceleration::on_checkBox_rms_toggled(bool checked) {
// TODO: 自定义的回调
if (checked) {
if (ui->checkBox_integrate->isChecked()) {
QStringList items = {"0-25 mm/s rms", "0-50 mm/s rms", "自定义"};
ui->comboBox_direct_value_range->clear();
ui->comboBox_direct_value_range->addItems(items);
ui->comboBox_direct_value_range->setCurrentIndex(0);
ui->comboBox_1x_value_range->clear();
ui->comboBox_1x_value_range->addItems(items);
ui->comboBox_1x_value_range->setCurrentIndex(0);
ui->comboBox_2x_value_range->clear();
ui->comboBox_2x_value_range->addItems(items);
ui->comboBox_2x_value_range->setCurrentIndex(0);
} else {
QStringList items = {"0-20 m/s^2 rms", "0-50 m/s^2 rms", "0-100 m/s^2 rms", "0-200 m/s^2 rms", "自定义"};
ui->comboBox_direct_value_range->clear();
ui->comboBox_direct_value_range->addItems(items);
ui->comboBox_direct_value_range->setCurrentIndex(0);
ui->comboBox_1x_value_range->clear();
ui->comboBox_1x_value_range->addItems(items);
ui->comboBox_1x_value_range->setCurrentIndex(0);
ui->comboBox_2x_value_range->clear();
ui->comboBox_2x_value_range->addItems(items);
ui->comboBox_2x_value_range->setCurrentIndex(0);
}
return;
}
if (ui->checkBox_integrate->isChecked()) {
QStringList items = {"0-25 mm/s pk", "0-50 mm/s pk", "0-100 mm/s pk", "自定义"};
ui->comboBox_direct_value_range->clear();
ui->comboBox_direct_value_range->addItems(items);
ui->comboBox_direct_value_range->setCurrentIndex(0);
ui->comboBox_1x_value_range->clear();
ui->comboBox_1x_value_range->addItems(items);
ui->comboBox_1x_value_range->setCurrentIndex(0);
ui->comboBox_2x_value_range->clear();
ui->comboBox_2x_value_range->addItems(items);
ui->comboBox_2x_value_range->setCurrentIndex(0);
} else {
QStringList items = {"0-20 m/s^2 pk", "0-50 m/s^2 pk", "0-100 m/s^2 pk", "0-200 m/s^2 pk", "0-250 m/s^2 pk", "0-400 m/s^2 pk", "自定义"};
ui->comboBox_direct_value_range->clear();
ui->comboBox_direct_value_range->addItems(items);
ui->comboBox_direct_value_range->setCurrentIndex(0);
ui->comboBox_1x_value_range->clear();
ui->comboBox_1x_value_range->addItems(items);
ui->comboBox_1x_value_range->setCurrentIndex(0);
ui->comboBox_2x_value_range->clear();
ui->comboBox_2x_value_range->addItems(items);
ui->comboBox_2x_value_range->setCurrentIndex(0);
}
}
void Acceleration::on_checkBox_integrate_toggled(bool checked) {
// TODO: 自定义的回调
if (checked) {
if (ui->checkBox_rms->isChecked()) {
QStringList items = {"0-25 mm/s rms", "0-50 mm/s rms", "自定义"};
ui->comboBox_direct_value_range->clear();
ui->comboBox_direct_value_range->addItems(items);
ui->comboBox_direct_value_range->setCurrentIndex(0);
ui->comboBox_1x_value_range->clear();
ui->comboBox_1x_value_range->addItems(items);
ui->comboBox_1x_value_range->setCurrentIndex(0);
ui->comboBox_2x_value_range->clear();
ui->comboBox_2x_value_range->addItems(items);
ui->comboBox_2x_value_range->setCurrentIndex(0);
} else {
QStringList items = {"0-25 mm/s pk", "0-50 mm/s pk", "0-100 mm/s pk", "自定义"};
ui->comboBox_direct_value_range->clear();
ui->comboBox_direct_value_range->addItems(items);
ui->comboBox_direct_value_range->setCurrentIndex(0);
ui->comboBox_1x_value_range->clear();
ui->comboBox_1x_value_range->addItems(items);
ui->comboBox_1x_value_range->setCurrentIndex(0);
ui->comboBox_2x_value_range->clear();
ui->comboBox_2x_value_range->addItems(items);
ui->comboBox_2x_value_range->setCurrentIndex(0);
}
return;
}
if (ui->checkBox_rms->isChecked()) {
QStringList items = {"0-20 m/s^2 rms", "0-50 m/s^2 rms", "0-100 m/s^2 rms", "0-200 m/s^2 rms", "自定义"};
ui->comboBox_direct_value_range->clear();
ui->comboBox_direct_value_range->addItems(items);
ui->comboBox_direct_value_range->setCurrentIndex(0);
ui->comboBox_1x_value_range->clear();
ui->comboBox_1x_value_range->addItems(items);
ui->comboBox_1x_value_range->setCurrentIndex(0);
ui->comboBox_2x_value_range->clear();
ui->comboBox_2x_value_range->addItems(items);
ui->comboBox_2x_value_range->setCurrentIndex(0);
} else {
QStringList items = {"0-20 m/s^2 pk", "0-50 m/s^2 pk", "0-100 m/s^2 pk", "0-200 m/s^2 pk", "0-250 m/s^2 pk", "0-400 m/s^2 pk", "自定义"};
ui->comboBox_direct_value_range->clear();
ui->comboBox_direct_value_range->addItems(items);
ui->comboBox_direct_value_range->setCurrentIndex(0);
ui->comboBox_1x_value_range->clear();
ui->comboBox_1x_value_range->addItems(items);
ui->comboBox_1x_value_range->setCurrentIndex(0);
ui->comboBox_2x_value_range->clear();
ui->comboBox_2x_value_range->addItems(items);
ui->comboBox_2x_value_range->setCurrentIndex(0);
}
}
void Acceleration::on_checkBox_1x_ampl_toggled(bool checked) {
if (checked) {
ui->comboBox_1x_value_range->setEnabled(true);
ui->doubleSpinBox_1x_ampl_clamp->setEnabled(true);
ui->doubleSpinBox_1x_phase_lag_clamp->setEnabled(true);
return;
}
ui->comboBox_1x_value_range->setEnabled(false);
ui->doubleSpinBox_1x_ampl_clamp->setEnabled(false);
ui->doubleSpinBox_1x_phase_lag_clamp->setEnabled(false);
}
void Acceleration::on_checkBox_2x_ampl_toggled(bool checked) {
if (checked) {
ui->comboBox_2x_value_range->setEnabled(true);
ui->doubleSpinBox_2x_ampl_clamp->setEnabled(true);
ui->doubleSpinBox_2x_phase_lag_clamp->setEnabled(true);
return;
}
ui->comboBox_2x_value_range->setEnabled(false);
ui->doubleSpinBox_2x_ampl_clamp->setEnabled(false);
ui->doubleSpinBox_2x_phase_lag_clamp->setEnabled(false);
}
void Acceleration::Init() {
std::shared_ptr<CardBase> base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no);
if (base_ptr == nullptr) {
@ -188,32 +58,70 @@ void Acceleration::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);
ui->comboBox_direct_value_range->setCurrentIndex(variable_ptr->direct_.full_scale_range);
ui->doubleSpinBox_direct_clamp->setValue(variable_ptr->direct_.clamp_value);
// ui->label_bias_voltage->setText(QString::number(variable_ptr->direct_.bias_voltage));
// ui->doubleSpinBox_bias_volt_clamp->setValue(variables[i].clamp_value);
// ui->comboBox_bias_volt_range->setCurrentIndex();
ui->checkBox_1x_ampl->setChecked(variable_ptr->x1_.checked);
ui->comboBox_1x_value_range->setCurrentIndex(variable_ptr->x1_.full_scale_range);
ui->doubleSpinBox_1x_ampl_clamp->setValue(variable_ptr->x1_.clamp_value);
ui->doubleSpinBox_1x_phase_lag_clamp->setValue(variable_ptr->x1_.phase_lag);
ui->checkBox_2x_ampl->setChecked(variable_ptr->x2_.checked);
ui->comboBox_2x_value_range->setCurrentIndex(variable_ptr->x2_.full_scale_range);
ui->doubleSpinBox_2x_ampl_clamp->setValue(variable_ptr->x2_.clamp_value);
ui->doubleSpinBox_2x_phase_lag_clamp->setValue(variable_ptr->x2_.phase_lag);
ui->spinBox_alert->setValue(variable_ptr->delay_.alert);
ui->doubleSpinBox_danger->setValue(variable_ptr->delay_.danger);
ui->checkBox_100ms->setChecked(variable_ptr->delay_.active_100ms);
ui->checkBox_rms->setChecked(variable_ptr->rms_active_);
ui->checkBox_integrate->setChecked(variable_ptr->integrate_active_);
ui->checkBox_alert_latching->setChecked(variable_ptr->alert_latching_);
ui->checkBox_danger_latching->setChecked(variable_ptr->danger_latching_);
ui->checkBox_timed_ok->setChecked(variable_ptr->timed_ok_);
ui->comboBox_recorder_output->setCurrentIndex(variable_ptr->recorder_out_.recorder_output);
ui->checkBox_two_ma_clamp->setChecked(variable_ptr->recorder_out_.two_ma_clamp);
ui->doubleSpinBox_trip_multiply->setValue(variable_ptr->recorder_out_.trip_multiply);
ui->comboBox_comparision->setCurrentIndex(variable_ptr->recorder_out_.comparision);
ui->spinBox_comparision_percentage->setValue(variable_ptr->recorder_out_.percentage);
// 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);
//
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 Acceleration::on_pushButton_confirm_clicked() {
@ -243,32 +151,8 @@ 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();
variable->direct_.full_scale_range = ui->comboBox_direct_value_range->currentIndex();
variable->direct_.clamp_value = ui->doubleSpinBox_direct_clamp->value();
variable->direct_.custom = 0; // TODO:
variable->x1_.checked = ui->checkBox_1x_ampl->isChecked();
variable->x1_.full_scale_range = ui->comboBox_1x_value_range->currentIndex();
variable->x1_.clamp_value = ui->doubleSpinBox_1x_ampl_clamp->value();
variable->x1_.custom = 0; // TODO:
variable->x1_.phase_lag = ui->doubleSpinBox_1x_phase_lag_clamp->value();
variable->x2_.checked = ui->checkBox_2x_ampl->isChecked();
variable->x2_.full_scale_range = ui->comboBox_2x_value_range->currentIndex();
variable->x2_.clamp_value = ui->doubleSpinBox_2x_ampl_clamp->value();
variable->x2_.custom = 0; // TODO:
variable->x2_.phase_lag = ui->doubleSpinBox_2x_phase_lag_clamp->value();
variable->recorder_out_.recorder_output = ui->comboBox_recorder_output->currentIndex();
variable->recorder_out_.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked();
variable->recorder_out_.trip_multiply = ui->doubleSpinBox_trip_multiply->value();
variable->recorder_out_.comparision = ui->comboBox_comparision->currentIndex();
variable->recorder_out_.percentage = ui->spinBox_comparision_percentage->value();
variable->delay_.alert = ui->spinBox_alert->value();
variable->delay_.danger = ui->doubleSpinBox_danger->value();
variable->delay_.active_100ms = ui->checkBox_100ms->isChecked();
variable->rms_active_ = ui->checkBox_rms->isChecked();
variable->integrate_active_ = ui->checkBox_integrate->isChecked();
variable->alert_latching_ = ui->checkBox_alert_latching->isChecked();
variable->danger_latching_ = ui->checkBox_danger_latching->isChecked();
variable->timed_ok_ = ui->checkBox_timed_ok->isChecked();
ptr->variables_.push_back(variable);
this->close();
return;
@ -283,32 +167,7 @@ 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();
variable->direct_.full_scale_range = ui->comboBox_direct_value_range->currentIndex();
variable->direct_.clamp_value = ui->doubleSpinBox_direct_clamp->value();
variable->direct_.custom = 0; // TODO:
variable->x1_.checked = ui->checkBox_1x_ampl->isChecked();
variable->x1_.full_scale_range = ui->comboBox_1x_value_range->currentIndex();
variable->x1_.clamp_value = ui->doubleSpinBox_1x_ampl_clamp->value();
variable->x1_.custom = 0; // TODO:
variable->x1_.phase_lag = ui->doubleSpinBox_1x_phase_lag_clamp->value();
variable->x2_.checked = ui->checkBox_2x_ampl->isChecked();
variable->x2_.full_scale_range = ui->comboBox_2x_value_range->currentIndex();
variable->x2_.clamp_value = ui->doubleSpinBox_2x_ampl_clamp->value();
variable->x2_.custom = 0; // TODO:
variable->x2_.phase_lag = ui->doubleSpinBox_2x_phase_lag_clamp->value();
variable->recorder_out_.recorder_output = ui->comboBox_recorder_output->currentIndex();
variable->recorder_out_.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked();
variable->recorder_out_.trip_multiply = ui->doubleSpinBox_trip_multiply->value();
variable->recorder_out_.comparision = ui->comboBox_comparision->currentIndex();
variable->recorder_out_.percentage = ui->spinBox_comparision_percentage->value();
variable->delay_.alert = ui->spinBox_alert->value();
variable->delay_.danger = ui->doubleSpinBox_danger->value();
variable->delay_.active_100ms = ui->checkBox_100ms->isChecked();
variable->rms_active_ = ui->checkBox_rms->isChecked();
variable->integrate_active_ = ui->checkBox_integrate->isChecked();
variable->alert_latching_ = ui->checkBox_alert_latching->isChecked();
variable->danger_latching_ = ui->checkBox_danger_latching->isChecked();
variable->timed_ok_ = ui->checkBox_timed_ok->isChecked();
this->close();
}

View File

@ -23,10 +23,6 @@ class Acceleration : public QWidget {
void on_pushButton_set_default_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::Acceleration *ui;

File diff suppressed because it is too large Load Diff

View File

@ -24,12 +24,12 @@ class VariableBase {
int id_;
VibChannelType type_;
Filter filter_[3];
DirectImpl direct_;
GapRange gap_range;
XImpl x1_;
XImpl x2_;
RecorderOut recorder_out_;
Delay delay_;
General general;
AlarmDangerHigh danger_high;
AlarmAlertHigh alert_high;
AlarmDangerLow danger_low;
AlarmAlertLow alert_low;
FrequencybandOutput freband_output[10];
};
// 位移

View File

@ -149,6 +149,25 @@ typedef struct {
bool checked;
} Filter;
typedef struct{
bool output_used;
QString engineering_unit;
QString rectifier_function;
}General;
typedef struct{
float level;
float hysteresis;
float delay;
bool enable;
bool latch;
}AlarmDangerHigh,AlarmAlertHigh,AlarmDangerLow,AlarmAlertLow ;
typedef struct{
bool enable;
int start;
int end;
}FrequencybandOutput ;
//typedef struct {
// Filter filter[3]; // 0: kFilterTypeLowPass, 1: kFilterTypeHighPass, 2: kFilterTypeBandPass
//} AllFilter;

14
dc_outputs.cpp Normal file
View File

@ -0,0 +1,14 @@
#include "dc_outputs.h"
#include "ui_dc_outputs.h"
DC_Outputs::DC_Outputs(QWidget *parent) :
QWidget(parent),
ui(new Ui::DC_Outputs)
{
ui->setupUi(this);
}
DC_Outputs::~DC_Outputs()
{
delete ui;
}

22
dc_outputs.h Normal file
View File

@ -0,0 +1,22 @@
#ifndef DC_OUTPUTS_H
#define DC_OUTPUTS_H
#include <QWidget>
namespace Ui {
class DC_Outputs;
}
class DC_Outputs : public QWidget
{
Q_OBJECT
public:
explicit DC_Outputs(QWidget *parent = nullptr);
~DC_Outputs();
private:
Ui::DC_Outputs *ui;
};
#endif // DC_OUTPUTS_H

293
dc_outputs.ui Normal file
View File

@ -0,0 +1,293 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DC_Outputs</class>
<widget class="QWidget" name="DC_Outputs">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>727</width>
<height>450</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QComboBox" name="comboBox">
<property name="geometry">
<rect>
<x>60</x>
<y>40</y>
<width>150</width>
<height>25</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>25</height>
</size>
</property>
<item>
<property name="text">
<string>通道1 输出1</string>
</property>
</item>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>50</x>
<y>150</y>
<width>54</width>
<height>12</height>
</rect>
</property>
<property name="text">
<string>1</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>50</x>
<y>200</y>
<width>54</width>
<height>12</height>
</rect>
</property>
<property name="text">
<string>2</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>50</x>
<y>240</y>
<width>54</width>
<height>12</height>
</rect>
</property>
<property name="text">
<string>3</string>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>50</x>
<y>280</y>
<width>54</width>
<height>12</height>
</rect>
</property>
<property name="text">
<string>4</string>
</property>
</widget>
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
<x>160</x>
<y>100</y>
<width>101</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>IOC 直流 输出</string>
</property>
</widget>
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>310</x>
<y>100</y>
<width>101</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>最小值</string>
</property>
</widget>
<widget class="QLabel" name="label_7">
<property name="geometry">
<rect>
<x>440</x>
<y>100</y>
<width>101</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>最大值</string>
</property>
</widget>
<widget class="QLabel" name="label_9">
<property name="geometry">
<rect>
<x>160</x>
<y>150</y>
<width>81</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>通道1 输出1</string>
</property>
</widget>
<widget class="QLabel" name="label_10">
<property name="geometry">
<rect>
<x>160</x>
<y>200</y>
<width>81</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>通道1 输出2</string>
</property>
</widget>
<widget class="QLabel" name="label_11">
<property name="geometry">
<rect>
<x>160</x>
<y>240</y>
<width>81</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>未使用</string>
</property>
</widget>
<widget class="QLabel" name="label_12">
<property name="geometry">
<rect>
<x>160</x>
<y>280</y>
<width>81</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>未使用</string>
</property>
</widget>
<widget class="QLabel" name="label_13">
<property name="geometry">
<rect>
<x>300</x>
<y>140</y>
<width>101</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>0.0 m/s**2_RMSpk</string>
</property>
</widget>
<widget class="QLabel" name="label_14">
<property name="geometry">
<rect>
<x>300</x>
<y>200</y>
<width>101</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>0.000 g_RMS</string>
</property>
</widget>
<widget class="QLabel" name="label_15">
<property name="geometry">
<rect>
<x>420</x>
<y>140</y>
<width>121</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>200.0 m/s**2_RMSpk</string>
</property>
</widget>
<widget class="QLabel" name="label_16">
<property name="geometry">
<rect>
<x>420</x>
<y>200</y>
<width>101</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>666.667 g_RMS</string>
</property>
</widget>
<widget class="QLabel" name="label_8">
<property name="geometry">
<rect>
<x>300</x>
<y>240</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>----- -----</string>
</property>
</widget>
<widget class="QLabel" name="label_17">
<property name="geometry">
<rect>
<x>300</x>
<y>280</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>----- -----</string>
</property>
</widget>
<widget class="QLabel" name="label_18">
<property name="geometry">
<rect>
<x>430</x>
<y>240</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>----- -----</string>
</property>
</widget>
<widget class="QLabel" name="label_19">
<property name="geometry">
<rect>
<x>430</x>
<y>280</y>
<width>71</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>----- -----</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -254,7 +254,7 @@
</size>
</property>
<property name="text">
<string>触发配置</string>
<string>直流输出</string>
</property>
<property name="checkable">
<bool>true</bool>

View File

@ -168,7 +168,7 @@
</rect>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab_5">
<attribute name="title">

View File

@ -37,27 +37,11 @@ void Radial::on_pushButton_cancel_clicked() {
}
void Radial::on_checkBox_1x_ampl_toggled(bool checked) {
if (checked) {
ui->comboBox_1x_value_range->setEnabled(true);
ui->doubleSpinBox_1x_ampl_clamp->setEnabled(true);
ui->doubleSpinBox_1x_phase_lag_clamp->setEnabled(true);
return;
}
ui->comboBox_1x_value_range->setEnabled(false);
ui->doubleSpinBox_1x_ampl_clamp->setEnabled(false);
ui->doubleSpinBox_1x_phase_lag_clamp->setEnabled(false);
}
void Radial::on_checkBox_2x_ampl_toggled(bool checked) {
if (checked) {
ui->comboBox_2x_value_range->setEnabled(true);
ui->doubleSpinBox_2x_ampl_clamp->setEnabled(true);
ui->doubleSpinBox_2x_phase_lag_clamp->setEnabled(true);
return;
}
ui->comboBox_2x_value_range->setEnabled(false);
ui->doubleSpinBox_2x_ampl_clamp->setEnabled(false);
ui->doubleSpinBox_2x_phase_lag_clamp->setEnabled(false);
}
void Radial::Init() {
@ -86,29 +70,7 @@ 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);
ui->comboBox_direct_value_range->setCurrentIndex(variable_ptr->direct_.full_scale_range);
ui->doubleSpinBox_direct_clamp->setValue(variable_ptr->direct_.clamp_value);
// ui->label_bias_voltage->setText(QString::number(variable_ptr->direct_.bias_voltage));
// ui->doubleSpinBox_bias_volt_clamp->setValue(variables[i].clamp_value);
// ui->comboBox_bias_volt_range->setCurrentIndex();
ui->checkBox_1x_ampl->setChecked(variable_ptr->x1_.checked);
ui->comboBox_1x_value_range->setCurrentIndex(variable_ptr->x1_.full_scale_range);
ui->doubleSpinBox_1x_ampl_clamp->setValue(variable_ptr->x1_.clamp_value);
ui->doubleSpinBox_1x_phase_lag_clamp->setValue(variable_ptr->x1_.phase_lag);
ui->checkBox_2x_ampl->setChecked(variable_ptr->x2_.checked);
ui->comboBox_2x_value_range->setCurrentIndex(variable_ptr->x2_.full_scale_range);
ui->doubleSpinBox_2x_ampl_clamp->setValue(variable_ptr->x2_.clamp_value);
ui->doubleSpinBox_2x_phase_lag_clamp->setValue(variable_ptr->x2_.phase_lag);
ui->spinBox_alert->setValue(variable_ptr->delay_.alert);
ui->doubleSpinBox_danger->setValue(variable_ptr->delay_.danger);
ui->checkBox_100ms->setChecked(variable_ptr->delay_.active_100ms);
ui->checkBox_alert_latching->setChecked(variable_ptr->alert_latching_);
ui->checkBox_danger_latching->setChecked(variable_ptr->danger_latching_);
ui->comboBox_recorder_output->setCurrentIndex(variable_ptr->recorder_out_.recorder_output);
ui->checkBox_two_ma_clamp->setChecked(variable_ptr->recorder_out_.two_ma_clamp);
ui->doubleSpinBox_trip_multiply->setValue(variable_ptr->recorder_out_.trip_multiply);
ui->comboBox_comparision->setCurrentIndex(variable_ptr->recorder_out_.comparision);
ui->spinBox_comparision_percentage->setValue(variable_ptr->recorder_out_.percentage);
}
void Radial::on_pushButton_confirm_clicked() {
@ -138,29 +100,7 @@ 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();
variable->direct_.full_scale_range = ui->comboBox_direct_value_range->currentIndex();
variable->direct_.clamp_value = ui->doubleSpinBox_direct_clamp->value();
variable->direct_.custom = 0; // TODO:
variable->x1_.checked = ui->checkBox_1x_ampl->isChecked();
variable->x1_.full_scale_range = ui->comboBox_1x_value_range->currentIndex();
variable->x1_.clamp_value = ui->doubleSpinBox_1x_ampl_clamp->value();
variable->x1_.custom = 0; // TODO:
variable->x1_.phase_lag = ui->doubleSpinBox_1x_phase_lag_clamp->value();
variable->x2_.checked = ui->checkBox_2x_ampl->isChecked();
variable->x2_.full_scale_range = ui->comboBox_2x_value_range->currentIndex();
variable->x2_.clamp_value = ui->doubleSpinBox_2x_ampl_clamp->value();
variable->x2_.custom = 0; // TODO:
variable->x2_.phase_lag = ui->doubleSpinBox_2x_phase_lag_clamp->value();
variable->recorder_out_.recorder_output = ui->comboBox_recorder_output->currentIndex();
variable->recorder_out_.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked();
variable->recorder_out_.trip_multiply = ui->doubleSpinBox_trip_multiply->value();
variable->recorder_out_.comparision = ui->comboBox_comparision->currentIndex();
variable->recorder_out_.percentage = ui->spinBox_comparision_percentage->value();
variable->delay_.alert = ui->spinBox_alert->value();
variable->delay_.danger = ui->doubleSpinBox_danger->value();
variable->delay_.active_100ms = ui->checkBox_100ms->isChecked();
variable->alert_latching_ = ui->checkBox_alert_latching->isChecked();
variable->danger_latching_ = ui->checkBox_danger_latching->isChecked();
ptr->variables_.push_back(variable);
this->close();
return;
@ -175,29 +115,7 @@ 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();
variable->direct_.full_scale_range = ui->comboBox_direct_value_range->currentIndex();
variable->direct_.clamp_value = ui->doubleSpinBox_direct_clamp->value();
variable->direct_.custom = 0; // TODO:
variable->x1_.checked = ui->checkBox_1x_ampl->isChecked();
variable->x1_.full_scale_range = ui->comboBox_1x_value_range->currentIndex();
variable->x1_.clamp_value = ui->doubleSpinBox_1x_ampl_clamp->value();
variable->x1_.custom = 0; // TODO:
variable->x1_.phase_lag = ui->doubleSpinBox_1x_phase_lag_clamp->value();
variable->x2_.checked = ui->checkBox_2x_ampl->isChecked();
variable->x2_.full_scale_range = ui->comboBox_2x_value_range->currentIndex();
variable->x2_.clamp_value = ui->doubleSpinBox_2x_ampl_clamp->value();
variable->x2_.custom = 0; // TODO:
variable->x2_.phase_lag = ui->doubleSpinBox_2x_phase_lag_clamp->value();
variable->recorder_out_.recorder_output = ui->comboBox_recorder_output->currentIndex();
variable->recorder_out_.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked();
variable->recorder_out_.trip_multiply = ui->doubleSpinBox_trip_multiply->value();
variable->recorder_out_.comparision = ui->comboBox_comparision->currentIndex();
variable->recorder_out_.percentage = ui->spinBox_comparision_percentage->value();
variable->delay_.alert = ui->spinBox_alert->value();
variable->delay_.danger = ui->doubleSpinBox_danger->value();
variable->delay_.active_100ms = ui->checkBox_100ms->isChecked();
variable->alert_latching_ = ui->checkBox_alert_latching->isChecked();
variable->danger_latching_ = ui->checkBox_danger_latching->isChecked();
this->close();
}

File diff suppressed because it is too large Load Diff

View File

@ -25,14 +25,7 @@ Seismic_monitor::Seismic_monitor(int slot,int cardtype, QWidget *parent) :
ui->comboBox_chan_type_2->setView(new QListView());
ui->comboBox_chan_type_3->setView(new QListView());
ui->comboBox_chan_type_4->setView(new QListView());
ui->comboBox_transducer_name_1->setView(new QListView());
ui->comboBox_transducer_name_2->setView(new QListView());
ui->comboBox_transducer_name_3->setView(new QListView());
ui->comboBox_transducer_name_4->setView(new QListView());
ui->comboBox_sample_rate_1->setView(new QListView());
ui->comboBox_sample_rate_2->setView(new QListView());
ui->comboBox_sample_rate_3->setView(new QListView());
ui->comboBox_sample_rate_4->setView(new QListView());
slot_no = slot;
car_type = static_cast<CardType>(cardtype);
QString slot_no_ = QString("%1").arg(slot_no);
@ -69,41 +62,33 @@ void Seismic_monitor::Init() {
qDebug() << vib_data->base_config_[i].channel_type ;
ui->comboBox_chan_type_1->setCurrentIndex(vib_data->base_config_[i].channel_type);
ui->checkBox_standby_1->setChecked(vib_data->base_config_[i].standby);
ui->comboBox_transducer_name_1->setCurrentIndex(vib_data->base_config_[i].transducer_id);
ui->doubleSpinBox_scale_factor_1->setValue(vib_data->base_config_[i].scale_factor);
ui->checkBox_enable_1->setChecked(vib_data->base_config_[i].active);
ui->doubleSpinBox_low_1->setValue(vib_data->base_config_[i].normal_voltage_low);
ui->doubleSpinBox_high_1->setValue(vib_data->base_config_[i].normal_voltage_high);
ui->comboBox_sample_rate_1->setCurrentIndex(vib_data->base_config_[i].sampling_rate);
ui->checkBox_power_1->setChecked(vib_data->base_config_[i].power);
} else if (i + 1 == 2) {
ui->comboBox_chan_type_2->setCurrentIndex(vib_data->base_config_[i].channel_type);
ui->comboBox_transducer_name_2->setCurrentIndex(vib_data->base_config_[i].transducer_id);
ui->doubleSpinBox_scale_factor_2->setValue(vib_data->base_config_[i].scale_factor);
ui->checkBox_enable_2->setChecked(vib_data->base_config_[i].active);
ui->doubleSpinBox_low_2->setValue(vib_data->base_config_[i].normal_voltage_low);
ui->doubleSpinBox_high_2->setValue(vib_data->base_config_[i].normal_voltage_high);
ui->comboBox_sample_rate_2->setCurrentIndex(vib_data->base_config_[i].sampling_rate);
ui->checkBox_power_2->setChecked(vib_data->base_config_[i].power);
} else if (i + 1 == 3) {
ui->checkBox_standby_2->setChecked(vib_data->base_config_[i].standby);
ui->comboBox_chan_type_3->setCurrentIndex(vib_data->base_config_[i].channel_type);
ui->comboBox_transducer_name_3->setCurrentIndex(vib_data->base_config_[i].transducer_id);
ui->doubleSpinBox_scale_factor_3->setValue(vib_data->base_config_[i].scale_factor);
ui->checkBox_enable_3->setChecked(vib_data->base_config_[i].active);
ui->doubleSpinBox_low_3->setValue(vib_data->base_config_[i].normal_voltage_low);
ui->doubleSpinBox_high_3->setValue(vib_data->base_config_[i].normal_voltage_high);
ui->comboBox_sample_rate_3->setCurrentIndex(vib_data->base_config_[i].sampling_rate);
ui->checkBox_power_3->setChecked(vib_data->base_config_[i].power);
} else if (i + 1 == 4) {
ui->comboBox_chan_type_4->setCurrentIndex(vib_data->base_config_[i].channel_type);
ui->comboBox_transducer_name_4->setCurrentIndex(vib_data->base_config_[i].transducer_id);
ui->doubleSpinBox_scale_factor_4->setValue(vib_data->base_config_[i].scale_factor);
ui->checkBox_enable_4->setChecked(vib_data->base_config_[i].active);
ui->doubleSpinBox_low_4->setValue(vib_data->base_config_[i].normal_voltage_low);
ui->doubleSpinBox_high_4->setValue(vib_data->base_config_[i].normal_voltage_high);
ui->comboBox_sample_rate_4->setCurrentIndex(vib_data->base_config_[i].sampling_rate);
ui->checkBox_power_4->setChecked(vib_data->base_config_[i].power);
}
}
}
@ -115,12 +100,9 @@ void Seismic_monitor::UpdateData(std::shared_ptr<VibrationData> vib_data) {
vib_data->base_config_[var].active = ui->checkBox_enable_1->isChecked();
vib_data->base_config_[var].rack_type = 0;
vib_data->base_config_[var].channel_type = ui->comboBox_chan_type_1->currentIndex();
vib_data->base_config_[var].transducer_id = ui->comboBox_transducer_name_1->currentIndex();
vib_data->base_config_[var].scale_factor = ui->doubleSpinBox_scale_factor_1->value();
vib_data->base_config_[var].sampling_rate = ui->comboBox_sample_rate_1->currentIndex();
vib_data->base_config_[var].normal_voltage_low = ui->doubleSpinBox_low_1->value();
vib_data->base_config_[var].normal_voltage_high = ui->doubleSpinBox_high_1->value();
vib_data->base_config_[var].power = ui->checkBox_power_1->isChecked();
vib_data->base_config_[var].chan_id = QString("S%1C%2").arg(QString::number(slot_no, 10).rightJustified(2, '0')).arg(QString::number(var+1, 10).rightJustified(2, '0'));
vib_data->base_config_[var].keyphase = ui->checkBox_keyphase->isChecked();
vib_data->base_config_[var].keyphase_slot = ui->comboBox_keyphase_slot->currentText().toInt();
@ -130,12 +112,10 @@ void Seismic_monitor::UpdateData(std::shared_ptr<VibrationData> vib_data) {
vib_data->base_config_[var].active = ui->checkBox_enable_2->isChecked();
vib_data->base_config_[var].rack_type = 0;
vib_data->base_config_[var].channel_type = ui->comboBox_chan_type_2->currentIndex();
vib_data->base_config_[var].transducer_id = ui->comboBox_transducer_name_2->currentIndex();
vib_data->base_config_[var].scale_factor = ui->doubleSpinBox_scale_factor_2->value();
vib_data->base_config_[var].sampling_rate = ui->comboBox_sample_rate_2->currentIndex();
vib_data->base_config_[var].normal_voltage_low = ui->doubleSpinBox_low_2->value();
vib_data->base_config_[var].normal_voltage_high = ui->doubleSpinBox_high_2->value();
vib_data->base_config_[var].power = ui->checkBox_power_2->isChecked();
vib_data->base_config_[var].chan_id = QString("S%1C%2").arg(QString::number(slot_no, 10).rightJustified(2, '0')).arg(QString::number(var+1, 10).rightJustified(2, '0'));
vib_data->base_config_[var].keyphase = ui->checkBox_keyphase_2->isChecked();
vib_data->base_config_[var].keyphase_slot = ui->comboBox_keyphase_slot_2->currentText().toInt();
@ -145,12 +125,10 @@ void Seismic_monitor::UpdateData(std::shared_ptr<VibrationData> vib_data) {
vib_data->base_config_[var].active = ui->checkBox_enable_3->isChecked();
vib_data->base_config_[var].rack_type = 0;
vib_data->base_config_[var].channel_type = ui->comboBox_chan_type_3->currentIndex();
vib_data->base_config_[var].transducer_id = ui->comboBox_transducer_name_3->currentIndex();
vib_data->base_config_[var].scale_factor = ui->doubleSpinBox_scale_factor_3->value();
vib_data->base_config_[var].sampling_rate = ui->comboBox_sample_rate_3->currentIndex();
vib_data->base_config_[var].normal_voltage_low = ui->doubleSpinBox_low_3->value();
vib_data->base_config_[var].normal_voltage_high = ui->doubleSpinBox_high_3->value();
vib_data->base_config_[var].power = ui->checkBox_power_3->isChecked();
vib_data->base_config_[var].chan_id = QString("S%1C%2").arg(QString::number(slot_no, 10).rightJustified(2, '0')).arg(QString::number(var+1, 10).rightJustified(2, '0'));
vib_data->base_config_[var].keyphase = ui->checkBox_keyphase_3->isChecked();
vib_data->base_config_[var].keyphase_slot = ui->comboBox_keyphase_slot_3->currentText().toInt();
@ -160,12 +138,8 @@ void Seismic_monitor::UpdateData(std::shared_ptr<VibrationData> vib_data) {
vib_data->base_config_[var].active = ui->checkBox_enable_4->isChecked();
vib_data->base_config_[var].rack_type = 0;
vib_data->base_config_[var].channel_type = ui->comboBox_chan_type_4->currentIndex();
vib_data->base_config_[var].transducer_id = ui->comboBox_transducer_name_4->currentIndex();
vib_data->base_config_[var].scale_factor = ui->doubleSpinBox_scale_factor_4->value();
vib_data->base_config_[var].sampling_rate = ui->comboBox_sample_rate_4->currentIndex();
vib_data->base_config_[var].normal_voltage_low = ui->doubleSpinBox_low_4->value();
vib_data->base_config_[var].normal_voltage_high = ui->doubleSpinBox_high_4->value();
vib_data->base_config_[var].power = ui->checkBox_power_4->isChecked();
vib_data->base_config_[var].chan_id = QString("S%1C%2").arg(QString::number(slot_no, 10).rightJustified(2, '0')).arg(QString::number(var+1, 10).rightJustified(2, '0'));
vib_data->base_config_[var].keyphase = ui->checkBox_keyphase_4->isChecked();
vib_data->base_config_[var].keyphase_slot = ui->comboBox_keyphase_slot_4->currentText().toInt();
@ -313,19 +287,19 @@ void Seismic_monitor::on_pushButton_config_4_clicked() {
void Seismic_monitor::on_comboBox_chan_type_1_currentTextChanged(const QString &arg1) {
switch (ui->comboBox_chan_type_1->currentIndex()) {
case kVibRadial:
ui->label_unit_1->setText("mV / mm");
EnableKeyphase();
break;
case kVibAcc:
ui->label_unit_1->setText("mV / m/s^2");
EnableKeyphase();
break;
case kVibVelocity:
ui->label_unit_1->setText("mV / mm/s");
EnableKeyphase();
break;
case kVibThrust:
ui->label_unit_1->setText("mV / mil");
DisableKeyphase();
break;
case kVibPressurePulsation:
@ -337,19 +311,15 @@ void Seismic_monitor::on_comboBox_chan_type_1_currentTextChanged(const QString &
void Seismic_monitor::on_comboBox_chan_type_2_currentTextChanged(const QString &arg1) {
switch (ui->comboBox_chan_type_2->currentIndex()) {
case kVibRadial:
ui->label_unit_2->setText("mV / mm");
EnableKeyphase();
break;
case kVibAcc:
ui->label_unit_2->setText("mV / m/s^2");
EnableKeyphase2();
break;
case kVibVelocity:
ui->label_unit_2->setText("mV / mm/s");
EnableKeyphase2();
break;
case kVibThrust:
ui->label_unit_2->setText("mV / mil");
DisableKeyphase2();
break;
case kVibPressurePulsation:
@ -361,19 +331,15 @@ void Seismic_monitor::on_comboBox_chan_type_2_currentTextChanged(const QString &
void Seismic_monitor::on_comboBox_chan_type_3_currentTextChanged(const QString &arg1) {
switch (ui->comboBox_chan_type_3->currentIndex()) {
case kVibRadial:
ui->label_unit_3->setText("mV / mm");
EnableKeyphase();
break;
case kVibAcc:
ui->label_unit_3->setText("mV / m/s^2");
EnableKeyphase3();
break;
case kVibVelocity:
ui->label_unit_3->setText("mV / mm/s");
EnableKeyphase3();
break;
case kVibThrust:
ui->label_unit_3->setText("mV / mil");
DisableKeyphase3();
break;
case kVibPressurePulsation:
@ -385,19 +351,15 @@ void Seismic_monitor::on_comboBox_chan_type_3_currentTextChanged(const QString &
void Seismic_monitor::on_comboBox_chan_type_4_currentTextChanged(const QString &arg1) {
switch (ui->comboBox_chan_type_4->currentIndex()) {
case kVibRadial:
ui->label_unit_4->setText("mV / mm");
EnableKeyphase4();
break;
case kVibAcc:
ui->label_unit_4->setText("mV / m/s^2");
EnableKeyphase4();
break;
case kVibVelocity:
ui->label_unit_4->setText("mV / mm/s");
EnableKeyphase4();
break;
case kVibThrust:
ui->label_unit_4->setText("mV / mil");
DisableKeyphase4();
break;
case kVibPressurePulsation:
@ -411,35 +373,19 @@ void Seismic_monitor::on_pushButton_cancel_clicked() {
}
void Seismic_monitor::on_comboBox_transducer_name_1_currentTextChanged(const QString &arg1) {
for (int var = 0; var < vec_transducer.size(); ++var) {
if (ui->comboBox_transducer_name_1->currentText() == vec_transducer[var].transducer_name) {
ui->doubleSpinBox_scale_factor_1->setValue(vec_transducer[var].scale_factor);
}
}
}
void Seismic_monitor::on_comboBox_transducer_name_2_currentTextChanged(const QString &arg1) {
for (int var = 0; var < vec_transducer.size(); ++var) {
if (ui->comboBox_transducer_name_2->currentText() == vec_transducer[var].transducer_name) {
ui->doubleSpinBox_scale_factor_2->setValue(vec_transducer[var].scale_factor);
}
}
}
void Seismic_monitor::on_comboBox_transducer_name_3_currentTextChanged(const QString &arg1) {
for (int var = 0; var < vec_transducer.size(); ++var) {
if (ui->comboBox_transducer_name_3->currentText() == vec_transducer[var].transducer_name) {
ui->doubleSpinBox_scale_factor_3->setValue(vec_transducer[var].scale_factor);
}
}
}
void Seismic_monitor::on_comboBox_transducer_name_4_currentTextChanged(const QString &arg1) {
for (int var = 0; var < vec_transducer.size(); ++var) {
if (ui->comboBox_transducer_name_4->currentText() == vec_transducer[var].transducer_name) {
ui->doubleSpinBox_scale_factor_4->setValue(vec_transducer[var].scale_factor);
}
}
}
void Seismic_monitor::EnableKeyphase(){
ui->checkBox_keyphase->setCheckable(true);

File diff suppressed because it is too large Load Diff

View File

@ -59,19 +59,7 @@ void Trust::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);
ui->comboBox_direct_value_range->setCurrentIndex(variable_ptr->direct_.full_scale_range);
ui->comboBox_gap_range->setCurrentIndex(variable_ptr->gap_range.full_scale_range);
ui->doubleSpinBox_direct_clamp->setValue(variable_ptr->direct_.clamp_value);
// ui->label_bias_voltage->setText(QString::number(variable_ptr->direct_.bias_voltage));
// ui->doubleSpinBox_bias_volt_clamp->setValue(variables[i].clamp_value);
// ui->comboBox_bias_volt_range->setCurrentIndex();
ui->spinBox_alert->setValue(variable_ptr->delay_.alert);
ui->doubleSpinBox_danger->setValue(variable_ptr->delay_.danger);
ui->checkBox_100ms->setChecked(variable_ptr->delay_.active_100ms);
ui->checkBox_alert_latching->setChecked(variable_ptr->alert_latching_);
ui->checkBox_danger_latching->setChecked(variable_ptr->danger_latching_);
ui->comboBox_recorder_output->setCurrentIndex(variable_ptr->recorder_out_.recorder_output);
ui->checkBox_two_ma_clamp->setChecked(variable_ptr->recorder_out_.two_ma_clamp);
ui->doubleSpinBox_zero_position->setValue(variable_ptr->zero_position.value);
ui->checkBox_negation->setChecked(variable_ptr->zero_position.negation);
}
@ -103,17 +91,7 @@ void Trust::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();
variable->direct_.full_scale_range = ui->comboBox_direct_value_range->currentIndex();
variable->direct_.clamp_value = ui->doubleSpinBox_direct_clamp->value();
variable->direct_.custom = 0; // TODO:
variable->gap_range.full_scale_range = ui->comboBox_gap_range->currentIndex();
variable->recorder_out_.recorder_output = ui->comboBox_recorder_output->currentIndex();
variable->recorder_out_.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked();
variable->delay_.alert = ui->spinBox_alert->value();
variable->delay_.danger = ui->doubleSpinBox_danger->value();
variable->delay_.active_100ms = ui->checkBox_100ms->isChecked();
variable->alert_latching_ = ui->checkBox_alert_latching->isChecked();
variable->danger_latching_ = ui->checkBox_danger_latching->isChecked();
variable->zero_position.value = ui->doubleSpinBox_zero_position->value();
variable->zero_position.negation = ui->checkBox_negation->isChecked();
ptr->variables_.push_back(variable);
@ -130,18 +108,7 @@ void Trust::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();
variable->direct_.full_scale_range = ui->comboBox_direct_value_range->currentIndex();
variable->direct_.clamp_value = ui->doubleSpinBox_direct_clamp->value();
variable->direct_.custom = 0; // TODO:
variable->gap_range.full_scale_range = ui->comboBox_gap_range->currentIndex();
variable->gap_range.custom = 0;
variable->recorder_out_.recorder_output = ui->comboBox_recorder_output->currentIndex();
variable->recorder_out_.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked();
variable->delay_.alert = ui->spinBox_alert->value();
variable->delay_.danger = ui->doubleSpinBox_danger->value();
variable->delay_.active_100ms = ui->checkBox_100ms->isChecked();
variable->alert_latching_ = ui->checkBox_alert_latching->isChecked();
variable->danger_latching_ = ui->checkBox_danger_latching->isChecked();
variable->zero_position.value = ui->doubleSpinBox_zero_position->value();
variable->zero_position.negation = ui->checkBox_negation->isChecked();
this->close();

1228
trust.ui

File diff suppressed because it is too large Load Diff

View File

@ -34,60 +34,12 @@ Velocity::~Velocity() {
void Velocity::on_checkBox_rms_toggled(bool checked) {
// TODO: 自定义的回调
if (checked) {
ui->checkBox_integrate->setEnabled(false);
QStringList items = {"0-10 mm/s rms", "0-20 mm/s rms", "0-50 mm/s rms", "自定义"};
ui->comboBox_direct_value_range->clear();
ui->comboBox_direct_value_range->addItems(items);
ui->comboBox_direct_value_range->setCurrentIndex(1);
ui->comboBox_1x_value_range->clear();
ui->comboBox_1x_value_range->addItems(items);
ui->comboBox_1x_value_range->setCurrentIndex(1);
ui->comboBox_2x_value_range->clear();
ui->comboBox_2x_value_range->addItems(items);
ui->comboBox_2x_value_range->setCurrentIndex(1);
return;
}
ui->checkBox_integrate->setEnabled(true);
ui->comboBox_direct_value_range->clear();
QStringList items = {"0-10 mm/s pk", "0-20 mm/s pk", "0-50 mm/s pk", "自定义"};
ui->comboBox_direct_value_range->addItems(items);
ui->comboBox_direct_value_range->setCurrentIndex(1);
ui->comboBox_1x_value_range->clear();
ui->comboBox_1x_value_range->addItems(items);
ui->comboBox_1x_value_range->setCurrentIndex(1);
ui->comboBox_2x_value_range->clear();
ui->comboBox_2x_value_range->addItems(items);
ui->comboBox_2x_value_range->setCurrentIndex(1);
}
void Velocity::on_checkBox_integrate_toggled(bool checked) {
// TODO: 自定义的回调
if (checked) {
ui->checkBox_rms->setEnabled(false);
ui->comboBox_direct_value_range->clear();
QStringList items = {"0-100 um pp", "0-200 um pp", "0-500 um pp", "自定义"};
ui->comboBox_direct_value_range->addItems(items);
ui->comboBox_direct_value_range->setCurrentIndex(1);
ui->comboBox_1x_value_range->clear();
ui->comboBox_1x_value_range->addItems(items);
ui->comboBox_1x_value_range->setCurrentIndex(1);
ui->comboBox_2x_value_range->clear();
ui->comboBox_2x_value_range->addItems(items);
ui->comboBox_2x_value_range->setCurrentIndex(1);
return;
}
ui->checkBox_rms->setEnabled(true);
ui->comboBox_direct_value_range->clear();
QStringList items = {"0-10 mm/s pk", "0-20 mm/s pk", "0-50 mm/s pk", "自定义"};
ui->comboBox_direct_value_range->addItems(items);
ui->comboBox_direct_value_range->setCurrentIndex(1);
ui->comboBox_1x_value_range->clear();
ui->comboBox_1x_value_range->addItems(items);
ui->comboBox_1x_value_range->setCurrentIndex(1);
ui->comboBox_2x_value_range->clear();
ui->comboBox_2x_value_range->addItems(items);
ui->comboBox_2x_value_range->setCurrentIndex(1);
}
void Velocity::on_pushButton_cancel_clicked() {
@ -95,27 +47,11 @@ void Velocity::on_pushButton_cancel_clicked() {
}
void Velocity::on_checkBox_1x_ampl_toggled(bool checked) {
if (checked) {
ui->comboBox_1x_value_range->setEnabled(true);
ui->doubleSpinBox_1x_ampl_clamp->setEnabled(true);
ui->doubleSpinBox_1x_phase_lag_clamp->setEnabled(true);
return;
}
ui->comboBox_1x_value_range->setEnabled(false);
ui->doubleSpinBox_1x_ampl_clamp->setEnabled(false);
ui->doubleSpinBox_1x_phase_lag_clamp->setEnabled(false);
}
void Velocity::on_checkBox_2x_ampl_toggled(bool checked) {
if (checked) {
ui->comboBox_2x_value_range->setEnabled(true);
ui->doubleSpinBox_2x_ampl_clamp->setEnabled(true);
ui->doubleSpinBox_2x_phase_lag_clamp->setEnabled(true);
return;
}
ui->comboBox_2x_value_range->setEnabled(false);
ui->doubleSpinBox_2x_ampl_clamp->setEnabled(false);
ui->doubleSpinBox_2x_phase_lag_clamp->setEnabled(false);
}
void Velocity::Init() {
@ -144,32 +80,7 @@ void Velocity::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);
ui->comboBox_direct_value_range->setCurrentIndex(variable_ptr->direct_.full_scale_range);
ui->doubleSpinBox_direct_clamp->setValue(variable_ptr->direct_.clamp_value);
// ui->label_bias_voltage->setText(QString::number(variable_ptr->direct_.bias_voltage));
// ui->doubleSpinBox_bias_volt_clamp->setValue(variables[i].clamp_value);
// ui->comboBox_bias_volt_range->setCurrentIndex();
ui->checkBox_1x_ampl->setChecked(variable_ptr->x1_.checked);
ui->comboBox_1x_value_range->setCurrentIndex(variable_ptr->x1_.full_scale_range);
ui->doubleSpinBox_1x_ampl_clamp->setValue(variable_ptr->x1_.clamp_value);
ui->doubleSpinBox_1x_phase_lag_clamp->setValue(variable_ptr->x1_.phase_lag);
ui->checkBox_2x_ampl->setChecked(variable_ptr->x2_.checked);
ui->comboBox_2x_value_range->setCurrentIndex(variable_ptr->x2_.full_scale_range);
ui->doubleSpinBox_2x_ampl_clamp->setValue(variable_ptr->x2_.clamp_value);
ui->doubleSpinBox_2x_phase_lag_clamp->setValue(variable_ptr->x2_.phase_lag);
ui->spinBox_alert->setValue(variable_ptr->delay_.alert);
ui->doubleSpinBox_danger->setValue(variable_ptr->delay_.danger);
ui->checkBox_100ms->setChecked(variable_ptr->delay_.active_100ms);
ui->checkBox_rms->setChecked(variable_ptr->rms_active_);
ui->checkBox_integrate->setChecked(variable_ptr->integrate_active_);
ui->checkBox_alert_latching->setChecked(variable_ptr->alert_latching_);
ui->checkBox_danger_latching->setChecked(variable_ptr->danger_latching_);
ui->checkBox_timed_ok->setChecked(variable_ptr->timed_ok_);
ui->comboBox_recorder_output->setCurrentIndex(variable_ptr->recorder_out_.recorder_output);
ui->checkBox_two_ma_clamp->setChecked(variable_ptr->recorder_out_.two_ma_clamp);
ui->doubleSpinBox_trip_multiply->setValue(variable_ptr->recorder_out_.trip_multiply);
ui->comboBox_comparision->setCurrentIndex(variable_ptr->recorder_out_.comparision);
ui->spinBox_comparision_percentage->setValue(variable_ptr->recorder_out_.percentage);
}
void Velocity::on_pushButton_confirm_clicked() {
@ -199,32 +110,7 @@ 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();
variable->direct_.full_scale_range = ui->comboBox_direct_value_range->currentIndex();
variable->direct_.clamp_value = ui->doubleSpinBox_direct_clamp->value();
variable->direct_.custom = 0; // TODO:
variable->x1_.checked = ui->checkBox_1x_ampl->isChecked();
variable->x1_.full_scale_range = ui->comboBox_1x_value_range->currentIndex();
variable->x1_.clamp_value = ui->doubleSpinBox_1x_ampl_clamp->value();
variable->x1_.custom = 0; // TODO:
variable->x1_.phase_lag = ui->doubleSpinBox_1x_phase_lag_clamp->value();
variable->x2_.checked = ui->checkBox_2x_ampl->isChecked();
variable->x2_.full_scale_range = ui->comboBox_2x_value_range->currentIndex();
variable->x2_.clamp_value = ui->doubleSpinBox_2x_ampl_clamp->value();
variable->x2_.custom = 0; // TODO:
variable->x2_.phase_lag = ui->doubleSpinBox_2x_phase_lag_clamp->value();
variable->recorder_out_.recorder_output = ui->comboBox_recorder_output->currentIndex();
variable->recorder_out_.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked();
variable->recorder_out_.trip_multiply = ui->doubleSpinBox_trip_multiply->value();
variable->recorder_out_.comparision = ui->comboBox_comparision->currentIndex();
variable->recorder_out_.percentage = ui->spinBox_comparision_percentage->value();
variable->delay_.alert = ui->spinBox_alert->value();
variable->delay_.danger = ui->doubleSpinBox_danger->value();
variable->delay_.active_100ms = ui->checkBox_100ms->isChecked();
variable->rms_active_ = ui->checkBox_rms->isChecked();
variable->integrate_active_ = ui->checkBox_integrate->isChecked();
variable->alert_latching_ = ui->checkBox_alert_latching->isChecked();
variable->danger_latching_ = ui->checkBox_danger_latching->isChecked();
variable->timed_ok_ = ui->checkBox_timed_ok->isChecked();
ptr->variables_.push_back(variable);
this->close();
return;
@ -239,31 +125,6 @@ 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();
variable->direct_.full_scale_range = ui->comboBox_direct_value_range->currentIndex();
variable->direct_.clamp_value = ui->doubleSpinBox_direct_clamp->value();
variable->direct_.custom = 0; // TODO:
variable->x1_.checked = ui->checkBox_1x_ampl->isChecked();
variable->x1_.full_scale_range = ui->comboBox_1x_value_range->currentIndex();
variable->x1_.clamp_value = ui->doubleSpinBox_1x_ampl_clamp->value();
variable->x1_.custom = 0; // TODO:
variable->x1_.phase_lag = ui->doubleSpinBox_1x_phase_lag_clamp->value();
variable->x2_.checked = ui->checkBox_2x_ampl->isChecked();
variable->x2_.full_scale_range = ui->comboBox_2x_value_range->currentIndex();
variable->x2_.clamp_value = ui->doubleSpinBox_2x_ampl_clamp->value();
variable->x2_.custom = 0; // TODO:
variable->x2_.phase_lag = ui->doubleSpinBox_2x_phase_lag_clamp->value();
variable->recorder_out_.recorder_output = ui->comboBox_recorder_output->currentIndex();
variable->recorder_out_.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked();
variable->recorder_out_.trip_multiply = ui->doubleSpinBox_trip_multiply->value();
variable->recorder_out_.comparision = ui->comboBox_comparision->currentIndex();
variable->recorder_out_.percentage = ui->spinBox_comparision_percentage->value();
variable->delay_.alert = ui->spinBox_alert->value();
variable->delay_.danger = ui->doubleSpinBox_danger->value();
variable->delay_.active_100ms = ui->checkBox_100ms->isChecked();
variable->rms_active_ = ui->checkBox_rms->isChecked();
variable->integrate_active_ = ui->checkBox_integrate->isChecked();
variable->alert_latching_ = ui->checkBox_alert_latching->isChecked();
variable->danger_latching_ = ui->checkBox_danger_latching->isChecked();
variable->timed_ok_ = ui->checkBox_timed_ok->isChecked();
this->close();
}

File diff suppressed because it is too large Load Diff