refine codes.
This commit is contained in:
parent
6c6acfea62
commit
653d994f9c
@ -26,10 +26,6 @@ Acceleration::Acceleration(int slot_no_, int channel_, bool active, QWidget *par
|
||||
QString filePath_variables = QCoreApplication::applicationDirPath() + QString("\\config\\%1\\acceleration_variables_%2.json").arg(slot_no).arg(channel);
|
||||
readJsonFile(filePath_variables);
|
||||
Init();
|
||||
// connect(ui->checkBox_1x_ampl, &QCheckBox::toggled, this, &Acceleration::on_1x_ampl_toggled);
|
||||
// connect(ui->checkBox_2x_ampl, &QCheckBox::toggled, this, &Acceleration::on_2x_ampl_toggled);
|
||||
// connect(ui->checkBox_rms, &QCheckBox::toggled, this, &Acceleration::on_rms_toggled);
|
||||
// connect(ui->checkBox_integrate, &QCheckBox::toggled, this, &Acceleration::on_integrate_toggled);
|
||||
}
|
||||
|
||||
Acceleration::~Acceleration() {
|
||||
|
@ -30,18 +30,38 @@ enum CMTCommand {
|
||||
kUpgradeProgress = 7
|
||||
};
|
||||
|
||||
// 振动板通道类型
|
||||
typedef enum {
|
||||
kVibRadial = 0, // 径向位移
|
||||
kVibAcc = 1, // 加速度
|
||||
kVibVelocity = 2 // 速度
|
||||
} VibChannelType;
|
||||
|
||||
// 振动板采样率
|
||||
typedef enum {
|
||||
kVibSR16K = 0, // 16k
|
||||
kVibSR32K = 1, // 32k
|
||||
kVibSR64k = 2, // 64k
|
||||
kVibSR128K = 3, // 128k
|
||||
} VibSamplingRate;
|
||||
|
||||
// 振动板机架类型
|
||||
typedef enum {
|
||||
kVibRackSingle = 0, // 单一
|
||||
kVibRackTMR = 1 // 三冗余
|
||||
} VibRackType;
|
||||
|
||||
typedef struct {
|
||||
int id;
|
||||
QString channel_name;
|
||||
bool standby;
|
||||
bool active;
|
||||
QString rack_type;
|
||||
int rack_type; // VibRackType
|
||||
QString tmr_group;
|
||||
QString channel_type;
|
||||
int channel_type; // VibChannelType
|
||||
QString transducer_name;
|
||||
QString scale_factor;
|
||||
QString sample_rate;
|
||||
int sampling_rate; // VibSamplingRate
|
||||
float normal_voltage_low;
|
||||
float normal_voltage_high;
|
||||
} SeismicMonitor;
|
||||
|
@ -26,10 +26,6 @@ Radial_vibration::Radial_vibration(int slot_no_, int channel_, bool active, QWid
|
||||
QString filePath_variables = QCoreApplication::applicationDirPath() + QString("\\config\\%1\\radial_vibration_variables_%2.json").arg(slot_no).arg(channel);
|
||||
readJsonFile(filePath_variables);
|
||||
Init();
|
||||
// connect(ui->checkBox_1x_ampl, &QCheckBox::toggled, this, &Radial_vibration::on_1x_ampl_toggled);
|
||||
// connect(ui->checkBox_2x_ampl, &QCheckBox::toggled, this, &Radial_vibration::on_2x_ampl_toggled);
|
||||
// connect(ui->checkBox_not_1x_ampl, &QCheckBox::toggled, this, &Radial_vibration::on_not1x_ampl_toggled);
|
||||
// connect(ui->checkBox_smax_ampl, &QCheckBox::toggled, this, &Radial_vibration::on_smax_ampl_toggled);
|
||||
}
|
||||
|
||||
Radial_vibration::~Radial_vibration() {
|
||||
|
@ -10,10 +10,9 @@
|
||||
#include "velocity.h"
|
||||
#include "radial_vibration.h"
|
||||
|
||||
Seismic_monitor::Seismic_monitor(int slot,QWidget *parent) :
|
||||
Seismic_monitor::Seismic_monitor(int slot, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::Seismic_monitor)
|
||||
{
|
||||
ui(new Ui::Seismic_monitor) {
|
||||
ui->setupUi(this);
|
||||
ui->widget_body->setProperty("flag", "body");
|
||||
ui->comboBox_chan_type_1->setView(new QListView());
|
||||
@ -31,18 +30,15 @@ Seismic_monitor::Seismic_monitor(int slot,QWidget *parent) :
|
||||
slot_no = slot;
|
||||
QString slot_no_ = QString("%1").arg(slot_no);
|
||||
ui->label_slot_no->setText(slot_no_);
|
||||
|
||||
QString filePath = QCoreApplication::applicationDirPath() + QString("\\config\\%1\\seismic_monitor_slot.json").arg(slot_no);
|
||||
readJsonFile(filePath);
|
||||
Init();
|
||||
}
|
||||
|
||||
Seismic_monitor::~Seismic_monitor()
|
||||
{
|
||||
Seismic_monitor::~Seismic_monitor() {
|
||||
delete ui;
|
||||
}
|
||||
void Seismic_monitor::readJsonFile(const QString &filePath)
|
||||
{
|
||||
void Seismic_monitor::readJsonFile(const QString &filePath) {
|
||||
// 创建文件对象
|
||||
QFile file(filePath);
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
@ -64,24 +60,22 @@ void Seismic_monitor::readJsonFile(const QString &filePath)
|
||||
QJsonObject json_obj = jsonDoc.object();
|
||||
card_type = json_obj["card_type"].toInt();
|
||||
QJsonArray chan_array = json_obj["chan"].toArray();
|
||||
|
||||
for(int i = 0; i < chan_array.size(); i++){
|
||||
for (int i = 0; i < chan_array.size(); i++) {
|
||||
QJsonObject temp_obj = chan_array[i].toObject();
|
||||
seismic_monitor[i].id = temp_obj["id"].toInt();
|
||||
seismic_monitor[i].channel_name = temp_obj["channle_name"].toString();
|
||||
seismic_monitor[i].standby = temp_obj["standby"].toBool();
|
||||
seismic_monitor[i].active = temp_obj["active"].toBool();
|
||||
seismic_monitor[i].rack_type = temp_obj["rack_type"].toString();
|
||||
seismic_monitor[i].rack_type = temp_obj["rack_type"].toInt();
|
||||
seismic_monitor[i].tmr_group = temp_obj["tmr_group"].toString();
|
||||
seismic_monitor[i].channel_type = temp_obj["channel_type"].toString();
|
||||
seismic_monitor[i].channel_type = temp_obj["channel_type"].toInt();
|
||||
seismic_monitor[i].transducer_name = temp_obj["transducer_name"].toString();
|
||||
seismic_monitor[i].scale_factor = temp_obj["scale_factor"].toString();
|
||||
seismic_monitor[i].sample_rate = temp_obj["sample_rate"].toString();
|
||||
seismic_monitor[i].sampling_rate = temp_obj["sample_rate"].toInt();
|
||||
QJsonArray voltage_range_array = temp_obj["normal_voltage_range"].toArray();
|
||||
seismic_monitor[i].normal_voltage_low = voltage_range_array[0].toDouble();
|
||||
seismic_monitor[i].normal_voltage_high = voltage_range_array[1].toDouble();
|
||||
}
|
||||
|
||||
QFile file_transducer(QCoreApplication::applicationDirPath() + QString("\\config\\transducer.json"));
|
||||
if (!file_transducer.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
qDebug() << "Cannot open file for reading:" << filePath;
|
||||
@ -108,8 +102,7 @@ void Seismic_monitor::readJsonFile(const QString &filePath)
|
||||
vec_transducer.push_back(transducer);
|
||||
}
|
||||
}
|
||||
void Seismic_monitor::Init()
|
||||
{
|
||||
void Seismic_monitor::Init() {
|
||||
for (int var = 0; var < vec_transducer.size(); ++var) {
|
||||
ui->comboBox_transducer_name_1->addItem(vec_transducer[var].transducer_name);
|
||||
ui->comboBox_transducer_name_2->addItem(vec_transducer[var].transducer_name);
|
||||
@ -117,117 +110,132 @@ void Seismic_monitor::Init()
|
||||
ui->comboBox_transducer_name_4->addItem(vec_transducer[var].transducer_name);
|
||||
}
|
||||
for (int i = 0; i < CHANNLE_COUNT; i++) {
|
||||
if(seismic_monitor[i].id == 1){
|
||||
if (seismic_monitor[i].id == 1) {
|
||||
qDebug() << seismic_monitor[i].channel_type ;
|
||||
if(seismic_monitor[i].channel_type == "acceleration"){
|
||||
ui->comboBox_chan_type_1->setCurrentText("加速度");
|
||||
}else if(seismic_monitor[i].channel_type == "velocity"){
|
||||
ui->comboBox_chan_type_1->setCurrentText("速度");
|
||||
}else if(seismic_monitor[i].channel_type == "proximeter"){
|
||||
ui->comboBox_chan_type_1->setCurrentText("位移");
|
||||
}
|
||||
// if (seismic_monitor[i].channel_type == "acceleration") {
|
||||
// ui->comboBox_chan_type_1->setCurrentText("加速度");
|
||||
// } else if (seismic_monitor[i].channel_type == "velocity") {
|
||||
// ui->comboBox_chan_type_1->setCurrentText("速度");
|
||||
// } else if (seismic_monitor[i].channel_type == "proximeter") {
|
||||
// ui->comboBox_chan_type_1->setCurrentText("位移");
|
||||
// }
|
||||
ui->comboBox_chan_type_1->setCurrentIndex(seismic_monitor[i].channel_type);
|
||||
//ui->comboBox_transducer_name_1->setText(seismic_monitor[i].transducer_name);
|
||||
ui->lineEdit_scale_factor_1->setText(seismic_monitor[i].scale_factor);
|
||||
ui->checkBox_enable_1->setCheckable(seismic_monitor[i].active);
|
||||
ui->doubleSpinBox_low_1->setValue(seismic_monitor[i].normal_voltage_low);
|
||||
ui->doubleSpinBox_high_1->setValue(seismic_monitor[i].normal_voltage_high);
|
||||
if(seismic_monitor[i].sample_rate == "32000"){
|
||||
ui->comboBox_sample_rate_1->setCurrentText("32 k");
|
||||
}
|
||||
// if (seismic_monitor[i].sample_rate == "32000") {
|
||||
// ui->comboBox_sample_rate_1->setCurrentText("32 k");
|
||||
// }
|
||||
ui->comboBox_sample_rate_1->setCurrentIndex(seismic_monitor[i].sampling_rate);
|
||||
}
|
||||
if(seismic_monitor[i].id == 2){
|
||||
if(seismic_monitor[i].channel_type == "acceleration"){
|
||||
ui->comboBox_chan_type_2->setCurrentText("加速度");
|
||||
}else if(seismic_monitor[i].channel_type == "velocity"){
|
||||
ui->comboBox_chan_type_2->setCurrentText("速度");
|
||||
}else if(seismic_monitor[i].channel_type == "proximeter"){
|
||||
ui->comboBox_chan_type_2->setCurrentText("位移");
|
||||
}
|
||||
if (seismic_monitor[i].id == 2) {
|
||||
// if (seismic_monitor[i].channel_type == "acceleration") {
|
||||
// ui->comboBox_chan_type_2->setCurrentText("加速度");
|
||||
// } else if (seismic_monitor[i].channel_type == "velocity") {
|
||||
// ui->comboBox_chan_type_2->setCurrentText("速度");
|
||||
// } else if (seismic_monitor[i].channel_type == "proximeter") {
|
||||
// ui->comboBox_chan_type_2->setCurrentText("位移");
|
||||
// }
|
||||
ui->comboBox_chan_type_2->setCurrentIndex(seismic_monitor[i].channel_type);
|
||||
//ui->comboBox_transducer_name_2->setText(seismic_monitor[i].transducer_name);
|
||||
ui->lineEdit_scale_factor_2->setText(seismic_monitor[i].scale_factor);
|
||||
ui->checkBox_enable_2->setCheckable(seismic_monitor[i].active);
|
||||
ui->doubleSpinBox_low_2->setValue(seismic_monitor[i].normal_voltage_low);
|
||||
ui->doubleSpinBox_high_2->setValue(seismic_monitor[i].normal_voltage_high);
|
||||
if(seismic_monitor[i].sample_rate == "32000"){
|
||||
ui->comboBox_sample_rate_2->setCurrentText("32 k");
|
||||
}
|
||||
// if (seismic_monitor[i].sample_rate == "32000") {
|
||||
// ui->comboBox_sample_rate_2->setCurrentText("32 k");
|
||||
// }
|
||||
ui->comboBox_sample_rate_2->setCurrentIndex(seismic_monitor[i].sampling_rate);
|
||||
}
|
||||
if(seismic_monitor[i].id == 3){
|
||||
if(seismic_monitor[i].channel_type == "acceleration"){
|
||||
ui->comboBox_chan_type_3->setCurrentText("加速度");
|
||||
}else if(seismic_monitor[i].channel_type == "velocity"){
|
||||
ui->comboBox_chan_type_3->setCurrentText("速度");
|
||||
}else if(seismic_monitor[i].channel_type == "proximeter"){
|
||||
ui->comboBox_chan_type_3->setCurrentText("位移");
|
||||
}
|
||||
if (seismic_monitor[i].id == 3) {
|
||||
// if (seismic_monitor[i].channel_type == "acceleration") {
|
||||
// ui->comboBox_chan_type_3->setCurrentText("加速度");
|
||||
// } else if (seismic_monitor[i].channel_type == "velocity") {
|
||||
// ui->comboBox_chan_type_3->setCurrentText("速度");
|
||||
// } else if (seismic_monitor[i].channel_type == "proximeter") {
|
||||
// ui->comboBox_chan_type_3->setCurrentText("位移");
|
||||
// }
|
||||
ui->comboBox_chan_type_3->setCurrentIndex(seismic_monitor[i].channel_type);
|
||||
//ui->lineEdit_transducer_name_3->setText(seismic_monitor[i].transducer_name);
|
||||
ui->lineEdit_scale_factor_3->setText(seismic_monitor[i].scale_factor);
|
||||
ui->checkBox_enable_3->setCheckable(seismic_monitor[i].active);
|
||||
ui->doubleSpinBox_low_3->setValue(seismic_monitor[i].normal_voltage_low);
|
||||
ui->doubleSpinBox_high_3->setValue(seismic_monitor[i].normal_voltage_high);
|
||||
if(seismic_monitor[i].sample_rate == "32000"){
|
||||
ui->comboBox_sample_rate_3->setCurrentText("32 k");
|
||||
}
|
||||
// if (seismic_monitor[i].sample_rate == "32000") {
|
||||
// ui->comboBox_sample_rate_3->setCurrentText("32 k");
|
||||
// }
|
||||
ui->comboBox_sample_rate_3->setCurrentIndex(seismic_monitor[i].sampling_rate);
|
||||
}
|
||||
if(seismic_monitor[i].id == 4){
|
||||
if(seismic_monitor[i].channel_type == "acceleration"){
|
||||
ui->comboBox_chan_type_4->setCurrentText("加速度");
|
||||
}else if(seismic_monitor[i].channel_type == "velocity"){
|
||||
ui->comboBox_chan_type_4->setCurrentText("速度");
|
||||
}else if(seismic_monitor[i].channel_type == "proximeter"){
|
||||
ui->comboBox_chan_type_4->setCurrentText("位移");
|
||||
}
|
||||
if (seismic_monitor[i].id == 4) {
|
||||
// if (seismic_monitor[i].channel_type == "acceleration") {
|
||||
// ui->comboBox_chan_type_4->setCurrentText("加速度");
|
||||
// } else if (seismic_monitor[i].channel_type == "velocity") {
|
||||
// ui->comboBox_chan_type_4->setCurrentText("速度");
|
||||
// } else if (seismic_monitor[i].channel_type == "proximeter") {
|
||||
// ui->comboBox_chan_type_4->setCurrentText("位移");
|
||||
// }
|
||||
ui->comboBox_chan_type_4->setCurrentIndex(seismic_monitor[i].channel_type);
|
||||
//ui->lineEdit_transducer_name_4->setText(seismic_monitor[i].transducer_name);
|
||||
ui->lineEdit_scale_factor_4->setText(seismic_monitor[i].scale_factor);
|
||||
ui->checkBox_enable_4->setCheckable(seismic_monitor[i].active);
|
||||
ui->doubleSpinBox_low_4->setValue(seismic_monitor[i].normal_voltage_low);
|
||||
ui->doubleSpinBox_high_4->setValue(seismic_monitor[i].normal_voltage_high);
|
||||
if(seismic_monitor[i].sample_rate == "32000"){
|
||||
ui->comboBox_sample_rate_4->setCurrentText("32 k");
|
||||
}
|
||||
// if (seismic_monitor[i].sample_rate == "32000") {
|
||||
// ui->comboBox_sample_rate_4->setCurrentText("32 k");
|
||||
// }
|
||||
ui->comboBox_sample_rate_4->setCurrentIndex(seismic_monitor[i].sampling_rate);
|
||||
}
|
||||
}
|
||||
}
|
||||
void Seismic_monitor::on_pushButton_confirm_clicked()
|
||||
{
|
||||
for (int var = 0; var < CHANNLE_COUNT; ++var){
|
||||
if(seismic_monitor[var].id == 1){
|
||||
void Seismic_monitor::on_pushButton_confirm_clicked() {
|
||||
for (int var = 0; var < CHANNLE_COUNT; ++var) {
|
||||
if (seismic_monitor[var].id == 1) {
|
||||
seismic_monitor[var].transducer_name = ui->comboBox_transducer_name_1->currentText();
|
||||
seismic_monitor[var].scale_factor = ui->lineEdit_scale_factor_1->text();
|
||||
seismic_monitor[var].active = ui->checkBox_enable_1->isChecked();
|
||||
if(ui->comboBox_sample_rate_1->currentText() == "32 k")
|
||||
seismic_monitor[var].sample_rate = "32000";
|
||||
// if (ui->comboBox_sample_rate_1->currentText() == "32 k") {
|
||||
// seismic_monitor[var].sample_rate = "32000";
|
||||
// }
|
||||
seismic_monitor[var].sampling_rate = ui->comboBox_sample_rate_1->currentIndex();
|
||||
seismic_monitor[var].normal_voltage_low = ui->doubleSpinBox_low_1->value();
|
||||
seismic_monitor[var].normal_voltage_high = ui->doubleSpinBox_high_1->value();
|
||||
}else if(seismic_monitor[var].id == 2){
|
||||
} else if (seismic_monitor[var].id == 2) {
|
||||
seismic_monitor[var].transducer_name = ui->comboBox_transducer_name_2->currentText();
|
||||
seismic_monitor[var].scale_factor = ui->lineEdit_scale_factor_2->text();
|
||||
seismic_monitor[var].active = ui->checkBox_enable_2->isChecked();
|
||||
if(ui->comboBox_sample_rate_2->currentText() == "32 k")
|
||||
seismic_monitor[var].sample_rate = "32000";
|
||||
// if (ui->comboBox_sample_rate_2->currentText() == "32 k") {
|
||||
// seismic_monitor[var].sample_rate = "32000";
|
||||
// }
|
||||
seismic_monitor[var].sampling_rate = ui->comboBox_sample_rate_2->currentIndex();
|
||||
seismic_monitor[var].normal_voltage_low = ui->doubleSpinBox_low_2->value();
|
||||
seismic_monitor[var].normal_voltage_high = ui->doubleSpinBox_high_2->value();
|
||||
}else if(seismic_monitor[var].id == 3){
|
||||
} else if (seismic_monitor[var].id == 3) {
|
||||
seismic_monitor[var].transducer_name = ui->comboBox_transducer_name_3->currentText();
|
||||
seismic_monitor[var].scale_factor = ui->lineEdit_scale_factor_3->text();
|
||||
seismic_monitor[var].active = ui->checkBox_enable_3->isChecked();
|
||||
if(ui->comboBox_sample_rate_3->currentText() == "32 k")
|
||||
seismic_monitor[var].sample_rate = "32000";
|
||||
// if (ui->comboBox_sample_rate_3->currentText() == "32 k") {
|
||||
// seismic_monitor[var].sample_rate = "32000";
|
||||
// }
|
||||
seismic_monitor[var].sampling_rate = ui->comboBox_sample_rate_3->currentIndex();
|
||||
seismic_monitor[var].normal_voltage_low = ui->doubleSpinBox_low_3->value();
|
||||
seismic_monitor[var].normal_voltage_high = ui->doubleSpinBox_high_3->value();
|
||||
}else if(seismic_monitor[var].id == 4){
|
||||
} else if (seismic_monitor[var].id == 4) {
|
||||
seismic_monitor[var].transducer_name = ui->comboBox_transducer_name_4->currentText();
|
||||
seismic_monitor[var].scale_factor = ui->lineEdit_scale_factor_3->text();
|
||||
seismic_monitor[var].active = ui->checkBox_enable_4->isChecked();
|
||||
if(ui->comboBox_sample_rate_4->currentText() == "32 k")
|
||||
seismic_monitor[var].sample_rate = "32000";
|
||||
// if (ui->comboBox_sample_rate_4->currentText() == "32 k") {
|
||||
// seismic_monitor[var].sample_rate = "32000";
|
||||
// }
|
||||
seismic_monitor[var].sampling_rate = ui->comboBox_sample_rate_4->currentIndex();
|
||||
seismic_monitor[var].normal_voltage_low = ui->doubleSpinBox_low_4->value();
|
||||
seismic_monitor[var].normal_voltage_high = ui->doubleSpinBox_high_4->value();
|
||||
}
|
||||
}
|
||||
QJsonObject monitor_obj,item_obj;
|
||||
QJsonObject monitor_obj, item_obj;
|
||||
QJsonArray chan_array;
|
||||
for(int i = 0; i < CHANNLE_COUNT;i++){
|
||||
for (int i = 0; i < CHANNLE_COUNT; i++) {
|
||||
item_obj["id"] = seismic_monitor[i].id;
|
||||
item_obj["channel_name"] = seismic_monitor[i].channel_name;
|
||||
item_obj["standby"] = seismic_monitor[i].standby;
|
||||
@ -237,7 +245,7 @@ void Seismic_monitor::on_pushButton_confirm_clicked()
|
||||
item_obj["channel_type"] = seismic_monitor[i].channel_type;
|
||||
item_obj["transducer_name"] = seismic_monitor[i].transducer_name;
|
||||
item_obj["scale_factor"] = seismic_monitor[i].scale_factor;
|
||||
item_obj["sample_rate"] = seismic_monitor[i].sample_rate;
|
||||
item_obj["sample_rate"] = seismic_monitor[i].sampling_rate;
|
||||
QJsonArray normal_voltage_array;
|
||||
normal_voltage_array.append(seismic_monitor[i].normal_voltage_low);
|
||||
normal_voltage_array.append(seismic_monitor[i].normal_voltage_high);
|
||||
@ -258,168 +266,164 @@ void Seismic_monitor::on_pushButton_confirm_clicked()
|
||||
this->close();
|
||||
}
|
||||
|
||||
|
||||
void Seismic_monitor::on_pushButton_set_default_clicked()
|
||||
{
|
||||
|
||||
void Seismic_monitor::on_pushButton_set_default_clicked() {
|
||||
}
|
||||
|
||||
|
||||
void Seismic_monitor::on_pushButton_config_1_clicked()
|
||||
{
|
||||
void Seismic_monitor::on_pushButton_config_1_clicked() {
|
||||
channel = 1;
|
||||
if(ui->comboBox_chan_type_1->currentText() == "加速度"){
|
||||
Acceleration *acceleration = new Acceleration(slot_no,channel,ui->checkBox_enable_1->isChecked());
|
||||
if (ui->comboBox_chan_type_1->currentIndex() == kVibAcc) {
|
||||
Acceleration *acceleration = new Acceleration(slot_no, channel, ui->checkBox_enable_1->isChecked());
|
||||
acceleration->setWindowModality(Qt::ApplicationModal);
|
||||
acceleration->show();
|
||||
}else if(ui->comboBox_chan_type_1->currentText() == "位移"){
|
||||
Radial_vibration *radial_vibration = new Radial_vibration(slot_no,channel,ui->checkBox_enable_1->isChecked());
|
||||
} else if (ui->comboBox_chan_type_1->currentIndex() == kVibRadial) {
|
||||
Radial_vibration *radial_vibration = new Radial_vibration(slot_no, channel, ui->checkBox_enable_1->isChecked());
|
||||
radial_vibration->setWindowModality(Qt::ApplicationModal);
|
||||
radial_vibration->show();
|
||||
}else if(ui->comboBox_chan_type_1->currentText() == "速度"){
|
||||
Velocity *velocity = new Velocity(slot_no,channel,ui->checkBox_enable_1->isChecked());
|
||||
} else if (ui->comboBox_chan_type_1->currentIndex() == kVibVelocity) {
|
||||
Velocity *velocity = new Velocity(slot_no, channel, ui->checkBox_enable_1->isChecked());
|
||||
velocity->setWindowModality(Qt::ApplicationModal);
|
||||
velocity->show();
|
||||
}
|
||||
}
|
||||
|
||||
void Seismic_monitor::on_pushButton_config_2_clicked()
|
||||
{
|
||||
void Seismic_monitor::on_pushButton_config_2_clicked() {
|
||||
channel = 2;
|
||||
if(ui->comboBox_chan_type_2->currentText() == "加速度"){
|
||||
Acceleration *acceleration = new Acceleration(slot_no,channel,ui->checkBox_enable_2->isChecked());
|
||||
if (ui->comboBox_chan_type_2->currentIndex() == kVibAcc) {
|
||||
Acceleration *acceleration = new Acceleration(slot_no, channel, ui->checkBox_enable_2->isChecked());
|
||||
acceleration->setWindowModality(Qt::ApplicationModal);
|
||||
acceleration->show();
|
||||
}else if(ui->comboBox_chan_type_2->currentText() == "位移"){
|
||||
Radial_vibration *radial_vibration = new Radial_vibration(slot_no,channel,ui->checkBox_enable_2->isChecked());
|
||||
} else if (ui->comboBox_chan_type_2->currentIndex() == kVibRadial) {
|
||||
Radial_vibration *radial_vibration = new Radial_vibration(slot_no, channel, ui->checkBox_enable_2->isChecked());
|
||||
radial_vibration->setWindowModality(Qt::ApplicationModal);
|
||||
radial_vibration->show();
|
||||
}else if(ui->comboBox_chan_type_2->currentText() == "速度"){
|
||||
|
||||
Velocity *velocity = new Velocity(slot_no,channel,ui->checkBox_enable_2->isChecked());
|
||||
} else if (ui->comboBox_chan_type_2->currentIndex() == kVibVelocity) {
|
||||
Velocity *velocity = new Velocity(slot_no, channel, ui->checkBox_enable_2->isChecked());
|
||||
velocity->setWindowModality(Qt::ApplicationModal);
|
||||
velocity->show();
|
||||
}
|
||||
}
|
||||
void Seismic_monitor::on_pushButton_config_3_clicked()
|
||||
{
|
||||
|
||||
void Seismic_monitor::on_pushButton_config_3_clicked() {
|
||||
channel = 3;
|
||||
if(ui->comboBox_chan_type_3->currentText() == "加速度"){
|
||||
Acceleration *acceleration = new Acceleration(slot_no,channel,ui->checkBox_enable_3->isChecked());
|
||||
if (ui->comboBox_chan_type_3->currentIndex() == kVibAcc) {
|
||||
Acceleration *acceleration = new Acceleration(slot_no, channel, ui->checkBox_enable_3->isChecked());
|
||||
acceleration->setWindowModality(Qt::ApplicationModal);
|
||||
acceleration->show();
|
||||
}else if(ui->comboBox_chan_type_3->currentText() == "位移"){
|
||||
Radial_vibration *radial_vibration = new Radial_vibration(slot_no,channel,ui->checkBox_enable_3->isChecked());
|
||||
} else if (ui->comboBox_chan_type_3->currentIndex() == kVibRadial) {
|
||||
Radial_vibration *radial_vibration = new Radial_vibration(slot_no, channel, ui->checkBox_enable_3->isChecked());
|
||||
radial_vibration->setWindowModality(Qt::ApplicationModal);
|
||||
radial_vibration->show();
|
||||
}else if(ui->comboBox_chan_type_3->currentText() == "速度"){
|
||||
Velocity *velocity = new Velocity(slot_no,channel,ui->checkBox_enable_3->isChecked());
|
||||
} else if (ui->comboBox_chan_type_3->currentIndex() == kVibVelocity) {
|
||||
Velocity *velocity = new Velocity(slot_no, channel, ui->checkBox_enable_3->isChecked());
|
||||
velocity->setWindowModality(Qt::ApplicationModal);
|
||||
velocity->show();
|
||||
}
|
||||
}
|
||||
|
||||
void Seismic_monitor::on_pushButton_config_4_clicked()
|
||||
{
|
||||
void Seismic_monitor::on_pushButton_config_4_clicked() {
|
||||
channel = 4;
|
||||
if(ui->comboBox_chan_type_4->currentText() == "加速度"){
|
||||
Acceleration *acceleration = new Acceleration(slot_no,channel,ui->checkBox_enable_4->isChecked());
|
||||
if (ui->comboBox_chan_type_4->currentIndex() == kVibAcc) {
|
||||
Acceleration *acceleration = new Acceleration(slot_no, channel, ui->checkBox_enable_4->isChecked());
|
||||
acceleration->setWindowModality(Qt::ApplicationModal);
|
||||
acceleration->show();
|
||||
}else if(ui->comboBox_chan_type_4->currentText() == "位移"){
|
||||
Radial_vibration *radial_vibration = new Radial_vibration(slot_no,channel,ui->checkBox_enable_4->isChecked());
|
||||
} else if (ui->comboBox_chan_type_4->currentIndex() == kVibRadial) {
|
||||
Radial_vibration *radial_vibration = new Radial_vibration(slot_no, channel, ui->checkBox_enable_4->isChecked());
|
||||
radial_vibration->setWindowModality(Qt::ApplicationModal);
|
||||
radial_vibration->show();
|
||||
}else if(ui->comboBox_chan_type_4->currentText() == "速度"){
|
||||
Velocity *velocity = new Velocity(slot_no,channel,ui->checkBox_enable_4->isChecked());
|
||||
} else if (ui->comboBox_chan_type_4->currentIndex() == kVibVelocity) {
|
||||
Velocity *velocity = new Velocity(slot_no, channel, ui->checkBox_enable_4->isChecked());
|
||||
velocity->setWindowModality(Qt::ApplicationModal);
|
||||
velocity->show();
|
||||
}
|
||||
}
|
||||
|
||||
void Seismic_monitor::on_comboBox_chan_type_1_currentTextChanged(const QString &arg1)
|
||||
{
|
||||
if(ui->comboBox_chan_type_1->currentText() == "加速度"){
|
||||
ui->label_unit_1->setText("mV / m/s^2");
|
||||
}else if(ui->comboBox_chan_type_1->currentText() == "速度"){
|
||||
ui->label_unit_1->setText("mV / mm/s");
|
||||
}else if(ui->comboBox_chan_type_1->currentText() == "位移"){
|
||||
ui->label_unit_1->setText("mV / mm");
|
||||
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");
|
||||
break;
|
||||
case kVibAcc:
|
||||
ui->label_unit_1->setText("mV / m/s^2");
|
||||
break;
|
||||
case kVibVelocity:
|
||||
ui->label_unit_1->setText("mV / mm/s");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Seismic_monitor::on_comboBox_chan_type_2_currentTextChanged(const QString &arg1)
|
||||
{
|
||||
if(ui->comboBox_chan_type_2->currentText() == "加速度"){
|
||||
ui->label_unit_2->setText("mV / m/s^2");
|
||||
}else if(ui->comboBox_chan_type_2->currentText() == "速度"){
|
||||
ui->label_unit_2->setText("mV / mm/s");
|
||||
}else if(ui->comboBox_chan_type_2->currentText() == "位移"){
|
||||
ui->label_unit_2->setText("mV / mm");
|
||||
void Seismic_monitor::on_comboBox_chan_type_2_currentTextChanged(const QString &arg1) {
|
||||
switch (ui->comboBox_chan_type_1->currentIndex()) {
|
||||
case kVibRadial:
|
||||
ui->label_unit_2->setText("mV / mm");
|
||||
break;
|
||||
case kVibAcc:
|
||||
ui->label_unit_2->setText("mV / m/s^2");
|
||||
break;
|
||||
case kVibVelocity:
|
||||
ui->label_unit_2->setText("mV / mm/s");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Seismic_monitor::on_comboBox_chan_type_3_currentTextChanged(const QString &arg1)
|
||||
{
|
||||
if(ui->comboBox_chan_type_3->currentText() == "加速度"){
|
||||
ui->label_unit_3->setText("mV / m/s^2");
|
||||
}else if(ui->comboBox_chan_type_3->currentText() == "速度"){
|
||||
ui->label_unit_3->setText("mV / mm/s");
|
||||
}else if(ui->comboBox_chan_type_3->currentText() == "位移"){
|
||||
ui->label_unit_3->setText("mV / mm");
|
||||
void Seismic_monitor::on_comboBox_chan_type_3_currentTextChanged(const QString &arg1) {
|
||||
switch (ui->comboBox_chan_type_1->currentIndex()) {
|
||||
case kVibRadial:
|
||||
ui->label_unit_3->setText("mV / mm");
|
||||
break;
|
||||
case kVibAcc:
|
||||
ui->label_unit_3->setText("mV / m/s^2");
|
||||
break;
|
||||
case kVibVelocity:
|
||||
ui->label_unit_3->setText("mV / mm/s");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Seismic_monitor::on_comboBox_chan_type_4_currentTextChanged(const QString &arg1)
|
||||
{
|
||||
if(ui->comboBox_chan_type_4->currentText() == "加速度"){
|
||||
ui->label_unit_4->setText("mV / m/s^2");
|
||||
}else if(ui->comboBox_chan_type_4->currentText() == "速度"){
|
||||
ui->label_unit_4->setText("mV / mm/s");
|
||||
}else if(ui->comboBox_chan_type_4->currentText() == "位移"){
|
||||
ui->label_unit_4->setText("mV / mm");
|
||||
void Seismic_monitor::on_comboBox_chan_type_4_currentTextChanged(const QString &arg1) {
|
||||
switch (ui->comboBox_chan_type_1->currentIndex()) {
|
||||
case kVibRadial:
|
||||
ui->label_unit_4->setText("mV / mm");
|
||||
break;
|
||||
case kVibAcc:
|
||||
ui->label_unit_4->setText("mV / m/s^2");
|
||||
break;
|
||||
case kVibVelocity:
|
||||
ui->label_unit_4->setText("mV / mm/s");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Seismic_monitor::on_pushButton_cancel_clicked()
|
||||
{
|
||||
void Seismic_monitor::on_pushButton_cancel_clicked() {
|
||||
this->close();
|
||||
}
|
||||
|
||||
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){
|
||||
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->lineEdit_scale_factor_1->setText(QString::number(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){
|
||||
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->lineEdit_scale_factor_2->setText(QString::number(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){
|
||||
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->lineEdit_scale_factor_3->setText(QString::number(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){
|
||||
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->lineEdit_scale_factor_4->setText(QString::number(vec_transducer[var].scale_factor));
|
||||
}
|
||||
}
|
||||
|
@ -350,7 +350,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>通道 1 类型:</string>
|
||||
<string>类 型:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
@ -371,6 +371,11 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>位移</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>加速度</string>
|
||||
@ -381,11 +386,6 @@
|
||||
<string>速度</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>位移</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -543,11 +543,29 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>16 k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>32 k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>64 k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>128 k</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -574,7 +592,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>正常电压</string>
|
||||
<string>电压范围</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
@ -715,7 +733,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>通道 2 类型:</string>
|
||||
<string>类 型:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
@ -736,6 +754,11 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>位移</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>加速度</string>
|
||||
@ -746,11 +769,6 @@
|
||||
<string>速度</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>位移</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -905,11 +923,29 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>16 k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>32 k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>64 k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>128 k</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -936,7 +972,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>正常电压</string>
|
||||
<string>电压范围</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
<item>
|
||||
@ -1277,7 +1313,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>通道 3 类型:</string>
|
||||
<string>类 型:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
@ -1298,6 +1334,11 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>位移</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>加速度</string>
|
||||
@ -1308,11 +1349,6 @@
|
||||
<string>速度</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>位移</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -1467,11 +1503,29 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>16 k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>32 k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>64 k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>128 k</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -1498,7 +1552,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>正常电压</string>
|
||||
<string>电压范围</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<item>
|
||||
@ -1639,7 +1693,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>通道 4 类型:</string>
|
||||
<string>类 型:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
@ -1660,6 +1714,11 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>位移</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>加速度</string>
|
||||
@ -1670,11 +1729,6 @@
|
||||
<string>速度</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>位移</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -1829,11 +1883,29 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>16 k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>32 k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>64 k</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>128 k</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@ -1860,7 +1932,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>正常电压</string>
|
||||
<string>电压范围</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||
<item>
|
||||
|
@ -27,10 +27,6 @@ Velocity::Velocity(int slot_no_, int channel_, bool active, QWidget *parent)
|
||||
QString filePath_variables = QCoreApplication::applicationDirPath() + QString("\\config\\%1\\velocity_variables_%2.json").arg(slot_no).arg(channel);
|
||||
readJsonFile(filePath_variables);
|
||||
Init();
|
||||
// connect(ui->checkBox_1x_ampl, &QCheckBox::toggled, this, &Velocity::on_1x_ampl_toggled);
|
||||
// connect(ui->checkBox_2x_ampl, &QCheckBox::toggled, this, &Velocity::on_2x_ampl_toggled);
|
||||
// connect(ui->checkBox_rms, &QCheckBox::toggled, this, &Velocity::on_rms_toggled);
|
||||
// connect(ui->checkBox_integrate, &QCheckBox::toggled, this, &Velocity::on_integrate_toggled);
|
||||
}
|
||||
|
||||
Velocity::~Velocity() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user