523 lines
24 KiB
C++
523 lines
24 KiB
C++
#include "seismic_monitor.h"
|
|
#include "ui_seismic_monitor.h"
|
|
#include <QDebug>
|
|
#include <QJsonDocument>
|
|
#include <QJsonArray>
|
|
#include <QJsonObject>
|
|
#include <QFile>
|
|
#include <QListView>
|
|
#include "acceleration.h"
|
|
#include "velocity.h"
|
|
#include "radial_vibration.h"
|
|
#include "data_config.h"
|
|
#include "config_mgr.h"
|
|
#include "vibrationdata.h"
|
|
#include "trust.h"
|
|
#include <QMessageBox>
|
|
#include "pressure_pulsation.h"
|
|
#include "channel_1_2.h"
|
|
#include "channel_3_4.h"
|
|
|
|
Seismic_monitor::Seismic_monitor(int slot,int cardtype, QWidget *parent) :
|
|
QWidget(parent),
|
|
ui(new Ui::Seismic_monitor) {
|
|
ui->setupUi(this);
|
|
ui->widget_body->setProperty("flag", "body");
|
|
ui->comboBox_chan_type_1->setView(new QListView());
|
|
ui->comboBox_chan_type_2->setView(new QListView());
|
|
ui->comboBox_chan_type_3->setView(new QListView());
|
|
ui->comboBox_chan_type_4->setView(new QListView());
|
|
|
|
slot_no = slot;
|
|
car_type = static_cast<CardType>(cardtype);
|
|
QString slot_no_ = QString("%1").arg(slot_no);
|
|
ui->label_slot_no->setText(slot_no_);
|
|
ui->checkBox_standby_1->hide();
|
|
ui->checkBox_standby_2->hide();
|
|
Init();
|
|
}
|
|
|
|
Seismic_monitor::~Seismic_monitor() {
|
|
delete ui;
|
|
}
|
|
|
|
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);
|
|
// ui->comboBox_transducer_name_3->addItem(vec_transducer[var].transducer_name);
|
|
// ui->comboBox_transducer_name_4->addItem(vec_transducer[var].transducer_name);
|
|
// }
|
|
std::shared_ptr<CardBase> base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no);
|
|
if (base_ptr == nullptr) {
|
|
qDebug() << "base_ptr";
|
|
// do nothing or use template to init it.
|
|
std::shared_ptr<VibrationData> vib_data = std::make_shared<VibrationData>();
|
|
vib_data->slot_ = slot_no;
|
|
vib_data->card_type_ = car_type;
|
|
ConfigMgr::Instance()->AddCard(vib_data);
|
|
UpdateData(vib_data);
|
|
return;
|
|
}
|
|
|
|
std::shared_ptr<VibrationData> vib_data = std::dynamic_pointer_cast<VibrationData>(base_ptr);
|
|
for (int i = 0; i < CHANNEL_COUNT; i++) {
|
|
if (i + 1 == 1) {
|
|
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_sensitivity_unit_1->setCurrentIndex(vib_data->base_config_[i].sensitivity_unit);
|
|
ui->lineEdit_signal_sensitivity_1->setText(QString::number(vib_data->base_config_[i].signal_sensitivity));
|
|
|
|
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->checkBox_keyphase->setChecked(vib_data->base_config_[i].keyphase);
|
|
ui->comboBox_keyphase_ch->setCurrentText(QString::number(vib_data->base_config_[i].keyphase_ch));
|
|
ui->comboBox_keyphase_slot->setCurrentText(QString::number(vib_data->base_config_[i].keyphase_slot));
|
|
|
|
} else if (i + 1 == 2) {
|
|
ui->comboBox_chan_type_2->setCurrentIndex(vib_data->base_config_[i].channel_type);
|
|
ui->comboBox_sensitivity_unit_2->setCurrentIndex(vib_data->base_config_[i].sensitivity_unit);
|
|
ui->lineEdit_signal_sensitivity_2->setText(QString::number(vib_data->base_config_[i].signal_sensitivity));
|
|
|
|
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->checkBox_keyphase_2->setChecked(vib_data->base_config_[i].keyphase);
|
|
ui->comboBox_keyphase_ch_2->setCurrentText(QString::number(vib_data->base_config_[i].keyphase_ch));
|
|
ui->comboBox_keyphase_slot_2->setCurrentText(QString::number(vib_data->base_config_[i].keyphase_slot));
|
|
|
|
} 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_sensitivity_unit_3->setCurrentIndex(vib_data->base_config_[i].sensitivity_unit);
|
|
ui->lineEdit_signal_sensitivity_3->setText(QString::number(vib_data->base_config_[i].signal_sensitivity));
|
|
|
|
ui->checkBox_keyphase_3->setChecked(vib_data->base_config_[i].keyphase);
|
|
ui->comboBox_keyphase_ch_3->setCurrentText(QString::number(vib_data->base_config_[i].keyphase_ch));
|
|
ui->comboBox_keyphase_slot_3->setCurrentText(QString::number(vib_data->base_config_[i].keyphase_slot));
|
|
|
|
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);
|
|
|
|
} else if (i + 1 == 4) {
|
|
ui->comboBox_chan_type_4->setCurrentIndex(vib_data->base_config_[i].channel_type);
|
|
ui->comboBox_sensitivity_unit_4->setCurrentIndex(vib_data->base_config_[i].sensitivity_unit);
|
|
ui->lineEdit_signal_sensitivity_4->setText(QString::number(vib_data->base_config_[i].signal_sensitivity));
|
|
|
|
ui->checkBox_keyphase_4->setChecked(vib_data->base_config_[i].keyphase);
|
|
ui->comboBox_keyphase_ch_4->setCurrentText(QString::number(vib_data->base_config_[i].keyphase_ch));
|
|
ui->comboBox_keyphase_slot_4->setCurrentText(QString::number(vib_data->base_config_[i].keyphase_slot));
|
|
|
|
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);
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
void Seismic_monitor::UpdateData(std::shared_ptr<VibrationData> vib_data) {
|
|
for (int var = 0; var < CHANNEL_COUNT; ++var) {
|
|
if (var + 1 == 1) {
|
|
vib_data->base_config_[var].standby = ui->checkBox_standby_1->isChecked();
|
|
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].sensitivity_unit = ui->comboBox_sensitivity_unit_1->currentIndex();
|
|
vib_data->base_config_[var].signal_sensitivity = ui->lineEdit_signal_sensitivity_1->text().toFloat();
|
|
|
|
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].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();
|
|
vib_data->base_config_[var].keyphase_ch = ui->comboBox_keyphase_ch->currentText().toInt();
|
|
} else if (var + 1 == 2) {
|
|
vib_data->base_config_[var].standby = ui->checkBox_standby_1->isChecked();
|
|
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].sensitivity_unit = ui->comboBox_sensitivity_unit_2->currentIndex();
|
|
vib_data->base_config_[var].signal_sensitivity = ui->lineEdit_signal_sensitivity_2->text().toFloat();
|
|
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].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();
|
|
vib_data->base_config_[var].keyphase_ch = ui->comboBox_keyphase_ch_2->currentText().toInt();
|
|
} else if (var + 1 == 3) {
|
|
vib_data->base_config_[var].standby = ui->checkBox_standby_2->isChecked();
|
|
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].sensitivity_unit = ui->comboBox_sensitivity_unit_3->currentIndex();
|
|
vib_data->base_config_[var].signal_sensitivity = ui->lineEdit_signal_sensitivity_3->text().toFloat();
|
|
|
|
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].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();
|
|
vib_data->base_config_[var].keyphase_ch = ui->comboBox_keyphase_ch_3->currentText().toInt();
|
|
} else if (var + 1 == 4) {
|
|
vib_data->base_config_[var].standby = ui->checkBox_standby_2->isChecked();
|
|
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].sensitivity_unit = ui->comboBox_sensitivity_unit_4->currentIndex();
|
|
vib_data->base_config_[var].signal_sensitivity = ui->lineEdit_signal_sensitivity_4->text().toFloat();
|
|
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].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();
|
|
vib_data->base_config_[var].keyphase_ch = ui->comboBox_keyphase_ch_4->currentText().toInt();
|
|
}
|
|
}
|
|
}
|
|
|
|
void Seismic_monitor::on_pushButton_confirm_clicked() {
|
|
std::shared_ptr<CardBase> base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no);
|
|
if (base_ptr == nullptr) {
|
|
qCritical() << " should not be here";
|
|
// std::shared_ptr<VibrationData> vib_data = std::make_shared<VibrationData>();
|
|
// ConfigMgr::Instance()->AddCard(vib_data);
|
|
// UpdateData(vib_data);
|
|
return;
|
|
}
|
|
if (ConfigMgr::Instance()->card_type_[ui->comboBox_keyphase_slot->currentIndex()] != kCardKeyphaseSingle && ui->checkBox_keyphase->isChecked()) {
|
|
QMessageBox::information(this, QStringLiteral("提示"), "第一通道键相槽位选择错误!");
|
|
return;
|
|
}
|
|
if (ConfigMgr::Instance()->card_type_[ui->comboBox_keyphase_slot_2->currentIndex()] != kCardKeyphaseSingle && ui->checkBox_keyphase_2->isChecked()) {
|
|
QMessageBox::information(this, QStringLiteral("提示"), "第二通道键相槽位选择错误!");
|
|
return;
|
|
}
|
|
if (ConfigMgr::Instance()->card_type_[ui->comboBox_keyphase_slot_3->currentIndex()] != kCardKeyphaseSingle && ui->checkBox_keyphase_3->isChecked()) {
|
|
QMessageBox::information(this, QStringLiteral("提示"), "第三通道键相槽位选择错误!");
|
|
return;
|
|
}
|
|
if (ConfigMgr::Instance()->card_type_[ui->comboBox_keyphase_slot_4->currentIndex()] != kCardKeyphaseSingle && ui->checkBox_keyphase_4->isChecked()) {
|
|
QMessageBox::information(this, QStringLiteral("提示"), "第四通道键相槽位选择错误!");
|
|
return;
|
|
}
|
|
if(ui->lineEdit_signal_sensitivity_1->text() == "0" ||
|
|
ui->lineEdit_signal_sensitivity_2->text() == "0" ||
|
|
ui->lineEdit_signal_sensitivity_3->text() == "0" ||
|
|
ui->lineEdit_signal_sensitivity_4->text() == "0"){
|
|
QMessageBox::information(this, QStringLiteral("提示"), "传感器灵敏度填写错误!");
|
|
return;
|
|
}
|
|
|
|
std::shared_ptr<VibrationData> vib_data = std::dynamic_pointer_cast<VibrationData>(base_ptr);
|
|
UpdateData(vib_data);
|
|
this->close();
|
|
}
|
|
|
|
void Seismic_monitor::on_pushButton_set_default_clicked() {
|
|
}
|
|
|
|
void Seismic_monitor::on_pushButton_config_1_clicked() {
|
|
channel = 1;
|
|
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->currentIndex() == kVibRadial) {
|
|
Radial *radial_vibration = new Radial(slot_no, channel, ui->checkBox_enable_1->isChecked());
|
|
radial_vibration->setWindowModality(Qt::ApplicationModal);
|
|
radial_vibration->show();
|
|
} 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();
|
|
}else if (ui->comboBox_chan_type_1->currentIndex() == kVibThrust) {
|
|
Trust *trust = new Trust(slot_no, channel, ui->checkBox_enable_1->isChecked());
|
|
trust->setWindowModality(Qt::ApplicationModal);
|
|
trust->show();
|
|
}else if (ui->comboBox_chan_type_1->currentIndex() == kVibPressurePulsation) {
|
|
PressurePulsation *pressure_pulsation = new PressurePulsation(slot_no, channel, ui->checkBox_enable_1->isChecked());
|
|
pressure_pulsation->setWindowModality(Qt::ApplicationModal);
|
|
pressure_pulsation->show();
|
|
}
|
|
}
|
|
|
|
void Seismic_monitor::on_pushButton_config_2_clicked() {
|
|
channel = 2;
|
|
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->currentIndex() == kVibRadial) {
|
|
Radial *radial_vibration = new Radial(slot_no, channel, ui->checkBox_enable_2->isChecked());
|
|
radial_vibration->setWindowModality(Qt::ApplicationModal);
|
|
radial_vibration->show();
|
|
} 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();
|
|
}else if (ui->comboBox_chan_type_2->currentIndex() == kVibThrust) {
|
|
Trust *trust = new Trust(slot_no, channel, ui->checkBox_enable_2->isChecked());
|
|
trust->setWindowModality(Qt::ApplicationModal);
|
|
trust->show();
|
|
}else if (ui->comboBox_chan_type_2->currentIndex() == kVibPressurePulsation) {
|
|
PressurePulsation *pressure_pulsation = new PressurePulsation(slot_no, channel, ui->checkBox_enable_2->isChecked());
|
|
pressure_pulsation->setWindowModality(Qt::ApplicationModal);
|
|
pressure_pulsation->show();
|
|
}
|
|
}
|
|
|
|
void Seismic_monitor::on_pushButton_config_3_clicked() {
|
|
channel = 3;
|
|
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->currentIndex() == kVibRadial) {
|
|
Radial *radial_vibration = new Radial(slot_no, channel, ui->checkBox_enable_3->isChecked());
|
|
radial_vibration->setWindowModality(Qt::ApplicationModal);
|
|
radial_vibration->show();
|
|
} 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();
|
|
}else if (ui->comboBox_chan_type_3->currentIndex() == kVibThrust) {
|
|
Trust *trust = new Trust(slot_no, channel, ui->checkBox_enable_3->isChecked());
|
|
trust->setWindowModality(Qt::ApplicationModal);
|
|
trust->show();
|
|
}else if (ui->comboBox_chan_type_3->currentIndex() == kVibPressurePulsation) {
|
|
PressurePulsation *pressure_pulsation = new PressurePulsation(slot_no, channel, ui->checkBox_enable_3->isChecked());
|
|
pressure_pulsation->setWindowModality(Qt::ApplicationModal);
|
|
pressure_pulsation->show();
|
|
}
|
|
}
|
|
|
|
void Seismic_monitor::on_pushButton_config_4_clicked() {
|
|
channel = 4;
|
|
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->currentIndex() == kVibRadial) {
|
|
Radial *radial_vibration = new Radial(slot_no, channel, ui->checkBox_enable_4->isChecked());
|
|
radial_vibration->setWindowModality(Qt::ApplicationModal);
|
|
radial_vibration->show();
|
|
} 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();
|
|
}else if (ui->comboBox_chan_type_4->currentIndex() == kVibThrust) {
|
|
Trust *trust = new Trust(slot_no, channel, ui->checkBox_enable_4->isChecked());
|
|
trust->setWindowModality(Qt::ApplicationModal);
|
|
trust->show();
|
|
}else if (ui->comboBox_chan_type_4->currentIndex() == kVibPressurePulsation) {
|
|
PressurePulsation *pressure_pulsation = new PressurePulsation(slot_no, channel, ui->checkBox_enable_4->isChecked());
|
|
pressure_pulsation->setWindowModality(Qt::ApplicationModal);
|
|
pressure_pulsation->show();
|
|
}
|
|
}
|
|
|
|
void Seismic_monitor::on_comboBox_chan_type_1_currentTextChanged(const QString &arg1) {
|
|
switch (ui->comboBox_chan_type_1->currentIndex()) {
|
|
case kVibRadial:
|
|
|
|
EnableKeyphase();
|
|
break;
|
|
case kVibAcc:
|
|
|
|
EnableKeyphase();
|
|
break;
|
|
case kVibVelocity:
|
|
|
|
EnableKeyphase();
|
|
break;
|
|
case kVibThrust:
|
|
|
|
DisableKeyphase();
|
|
break;
|
|
case kVibPressurePulsation:
|
|
DisableKeyphase();
|
|
break;
|
|
}
|
|
}
|
|
|
|
void Seismic_monitor::on_comboBox_chan_type_2_currentTextChanged(const QString &arg1) {
|
|
switch (ui->comboBox_chan_type_2->currentIndex()) {
|
|
case kVibRadial:
|
|
EnableKeyphase();
|
|
break;
|
|
case kVibAcc:
|
|
EnableKeyphase2();
|
|
break;
|
|
case kVibVelocity:
|
|
EnableKeyphase2();
|
|
break;
|
|
case kVibThrust:
|
|
DisableKeyphase2();
|
|
break;
|
|
case kVibPressurePulsation:
|
|
DisableKeyphase2();
|
|
break;
|
|
}
|
|
}
|
|
|
|
void Seismic_monitor::on_comboBox_chan_type_3_currentTextChanged(const QString &arg1) {
|
|
switch (ui->comboBox_chan_type_3->currentIndex()) {
|
|
case kVibRadial:
|
|
EnableKeyphase();
|
|
break;
|
|
case kVibAcc:
|
|
EnableKeyphase3();
|
|
break;
|
|
case kVibVelocity:
|
|
EnableKeyphase3();
|
|
break;
|
|
case kVibThrust:
|
|
DisableKeyphase3();
|
|
break;
|
|
case kVibPressurePulsation:
|
|
DisableKeyphase3();
|
|
break;
|
|
}
|
|
}
|
|
|
|
void Seismic_monitor::on_comboBox_chan_type_4_currentTextChanged(const QString &arg1) {
|
|
switch (ui->comboBox_chan_type_4->currentIndex()) {
|
|
case kVibRadial:
|
|
EnableKeyphase4();
|
|
break;
|
|
case kVibAcc:
|
|
EnableKeyphase4();
|
|
break;
|
|
case kVibVelocity:
|
|
EnableKeyphase4();
|
|
break;
|
|
case kVibThrust:
|
|
DisableKeyphase4();
|
|
break;
|
|
case kVibPressurePulsation:
|
|
DisableKeyphase4();
|
|
break;
|
|
}
|
|
}
|
|
|
|
void Seismic_monitor::on_pushButton_cancel_clicked() {
|
|
this->close();
|
|
}
|
|
|
|
void Seismic_monitor::on_comboBox_transducer_name_1_currentTextChanged(const QString &arg1) {
|
|
|
|
}
|
|
|
|
void Seismic_monitor::on_comboBox_transducer_name_2_currentTextChanged(const QString &arg1) {
|
|
|
|
}
|
|
|
|
void Seismic_monitor::on_comboBox_transducer_name_3_currentTextChanged(const QString &arg1) {
|
|
|
|
}
|
|
|
|
void Seismic_monitor::on_comboBox_transducer_name_4_currentTextChanged(const QString &arg1) {
|
|
|
|
}
|
|
void Seismic_monitor::EnableKeyphase(){
|
|
ui->checkBox_keyphase->setCheckable(true);
|
|
ui->checkBox_keyphase->setEnabled(true);
|
|
ui->comboBox_keyphase_ch->setEnabled(true);
|
|
ui->comboBox_keyphase_slot->setEnabled(true);
|
|
}
|
|
void Seismic_monitor::EnableKeyphase2(){
|
|
ui->checkBox_keyphase_2->setCheckable(true);
|
|
ui->checkBox_keyphase_2->setEnabled(true);
|
|
ui->comboBox_keyphase_ch_2->setEnabled(true);
|
|
ui->comboBox_keyphase_slot_2->setEnabled(true);
|
|
}
|
|
void Seismic_monitor::EnableKeyphase3(){
|
|
ui->checkBox_keyphase_3->setCheckable(true);
|
|
ui->checkBox_keyphase_3->setEnabled(true);
|
|
ui->comboBox_keyphase_ch_3->setEnabled(true);
|
|
ui->comboBox_keyphase_slot_3->setEnabled(true);
|
|
}
|
|
void Seismic_monitor::EnableKeyphase4(){
|
|
ui->checkBox_keyphase_4->setCheckable(true);
|
|
ui->checkBox_keyphase_4->setEnabled(true);
|
|
ui->comboBox_keyphase_ch_4->setEnabled(true);
|
|
ui->comboBox_keyphase_slot_4->setEnabled(true);
|
|
}
|
|
void Seismic_monitor::DisableKeyphase(){
|
|
ui->checkBox_keyphase->setCheckable(false);
|
|
ui->checkBox_keyphase->setEnabled(false);
|
|
ui->comboBox_keyphase_ch->setEnabled(false);
|
|
ui->comboBox_keyphase_slot->setEnabled(false);
|
|
}
|
|
void Seismic_monitor::DisableKeyphase2(){
|
|
ui->checkBox_keyphase_2->setCheckable(false);
|
|
ui->checkBox_keyphase_2->setEnabled(false);
|
|
ui->comboBox_keyphase_ch_2->setEnabled(false);
|
|
ui->comboBox_keyphase_slot_2->setEnabled(false);
|
|
}
|
|
void Seismic_monitor::DisableKeyphase3(){
|
|
ui->checkBox_keyphase_3->setCheckable(false);
|
|
ui->checkBox_keyphase_3->setEnabled(false);
|
|
ui->comboBox_keyphase_ch_3->setEnabled(false);
|
|
ui->comboBox_keyphase_slot_3->setEnabled(false);
|
|
|
|
}
|
|
void Seismic_monitor::DisableKeyphase4(){
|
|
ui->checkBox_keyphase_4->setCheckable(false);
|
|
ui->checkBox_keyphase_4->setEnabled(false);
|
|
ui->comboBox_keyphase_ch_4->setEnabled(false);
|
|
ui->comboBox_keyphase_slot_4->setEnabled(false);
|
|
}
|
|
|
|
void Seismic_monitor::on_comboBox_sensitivity_unit_1_currentTextChanged(const QString &arg1)
|
|
{
|
|
QString str = QString("信号灵敏度(mV/%1)").arg(arg1);
|
|
ui->label_signal_sensitivity_1->setText(str);
|
|
}
|
|
|
|
|
|
void Seismic_monitor::on_comboBox_sensitivity_unit_2_currentTextChanged(const QString &arg1)
|
|
{
|
|
QString str = QString("信号灵敏度(mV/%1)").arg(arg1);
|
|
ui->label_signal_sensitivity_2->setText(str);
|
|
}
|
|
|
|
|
|
void Seismic_monitor::on_comboBox_sensitivity_unit_3_currentTextChanged(const QString &arg1)
|
|
{
|
|
QString str = QString("信号灵敏度(mV/%1)").arg(arg1);
|
|
ui->label_signal_sensitivity_3->setText(str);
|
|
}
|
|
|
|
|
|
void Seismic_monitor::on_comboBox_sensitivity_unit_4_currentTextChanged(const QString &arg1)
|
|
{
|
|
QString str = QString("信号灵敏度(mV/%1)").arg(arg1);
|
|
ui->label_signal_sensitivity_4->setText(str);
|
|
}
|
|
|
|
|
|
void Seismic_monitor::on_pushButton_config_1_2_clicked()
|
|
{
|
|
Channel_1_2 *ch1_2 = new Channel_1_2(slot_no, 5);
|
|
ch1_2->setWindowModality(Qt::ApplicationModal);
|
|
ch1_2->show();
|
|
}
|
|
|
|
|
|
void Seismic_monitor::on_pushButton_config_3_4_clicked()
|
|
{
|
|
Channel_3_4 *ch3_4 = new Channel_3_4(slot_no, 6);
|
|
ch3_4->setWindowModality(Qt::ApplicationModal);
|
|
ch3_4->show();
|
|
}
|
|
|