modify press unit
This commit is contained in:
parent
0994b00441
commit
8a16b60a09
@ -274,23 +274,34 @@ void ConfigMgr::Save(QString & file_path) {
|
|||||||
band_pass["checked"] = pressure_ptr->filter_[2].checked;
|
band_pass["checked"] = pressure_ptr->filter_[2].checked;
|
||||||
filter.append(band_pass);
|
filter.append(band_pass);
|
||||||
variables["filter"] = filter;
|
variables["filter"] = filter;
|
||||||
QJsonObject sampling;
|
// QJsonObject sampling;
|
||||||
QJsonObject scaling;
|
// QJsonObject scaling;
|
||||||
sampling["fixed"] = pressure_ptr->fixed;
|
// sampling["fixed"] = pressure_ptr->fixed;
|
||||||
sampling["sample_rate"] = pressure_ptr->sample_rate;
|
// sampling["sample_rate"] = pressure_ptr->sample_rate;
|
||||||
sampling["band_width"] = pressure_ptr->bandwidth;
|
// sampling["band_width"] = pressure_ptr->bandwidth;
|
||||||
sampling["fft_points"] = pressure_ptr->fft_points;
|
// sampling["fft_points"] = pressure_ptr->fft_points;
|
||||||
scaling["measuring_min"] = pressure_ptr->measuring_min;
|
// scaling["measuring_min"] = pressure_ptr->measuring_min;
|
||||||
scaling["measuring_max"] = pressure_ptr->measuring_max;
|
// scaling["measuring_max"] = pressure_ptr->measuring_max;
|
||||||
scaling["scale_min"] = pressure_ptr->scale_min;
|
// scaling["scale_min"] = pressure_ptr->scale_min;
|
||||||
scaling["scale_max"] = pressure_ptr->scale_max;
|
// scaling["scale_max"] = pressure_ptr->scale_max;
|
||||||
variables["sampling"] = sampling;
|
// variables["sampling"] = sampling;
|
||||||
variables["scaling"] = scaling;
|
// variables["scaling"] = scaling;
|
||||||
QJsonObject general;
|
QJsonObject general,alarm;
|
||||||
general["output_used"] = pressure_ptr->general.output_used;
|
general["output_used"] = pressure_ptr->general.output_used;
|
||||||
general["engieneering_unit"] = pressure_ptr->general.engineering_unit;
|
general["engieneering_unit"] = pressure_ptr->general.engineering_unit;
|
||||||
general["rectifier_function"] = pressure_ptr->general.rectifier_function;
|
general["rectifier_function"] = pressure_ptr->general.rectifier_function;
|
||||||
|
|
||||||
|
alarm["danger_high_level"] = pressure_ptr->danger_high.level;
|
||||||
|
alarm["danger_high_hysteresis"] = pressure_ptr->danger_high.hysteresis;
|
||||||
|
alarm["danger_high_delay"] = pressure_ptr->danger_high.delay;
|
||||||
|
alarm["danger_high_enable"] = pressure_ptr->danger_high.enable;
|
||||||
|
alarm["danger_high_latch"] = pressure_ptr->danger_high.latch;
|
||||||
|
alarm["alert_high_level"] = pressure_ptr->alert_high.level;
|
||||||
|
alarm["alert_high_hysteresis"] = pressure_ptr->alert_high.hysteresis;
|
||||||
|
alarm["alert_high_delay"] = pressure_ptr->alert_high.delay;
|
||||||
|
alarm["alert_high_enable"] = pressure_ptr->alert_high.enable;
|
||||||
|
alarm["alert_high_latch"] = pressure_ptr->alert_high.latch;
|
||||||
|
|
||||||
variables["general"] = general;
|
variables["general"] = general;
|
||||||
QJsonObject freband_output,number;
|
QJsonObject freband_output,number;
|
||||||
for (int var = 0; var < 10; ++var) {
|
for (int var = 0; var < 10; ++var) {
|
||||||
@ -302,6 +313,7 @@ void ConfigMgr::Save(QString & file_path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
variables["freband_output"] = number;
|
variables["freband_output"] = number;
|
||||||
|
variables["alarm"] = alarm;
|
||||||
|
|
||||||
} else if(ptr->base_config_[cid].channel_type == kVibAcc){
|
} else if(ptr->base_config_[cid].channel_type == kVibAcc){
|
||||||
std::shared_ptr<AccVelVariable> av_ptr = std::dynamic_pointer_cast<AccVelVariable>(base_channel_ptr);
|
std::shared_ptr<AccVelVariable> av_ptr = std::dynamic_pointer_cast<AccVelVariable>(base_channel_ptr);
|
||||||
@ -885,10 +897,9 @@ void ConfigMgr::Load(QString filename) {
|
|||||||
variable->filter_[k].checked = filter_ele["checked"].toBool();
|
variable->filter_[k].checked = filter_ele["checked"].toBool();
|
||||||
}
|
}
|
||||||
variable->id_ = j + 1;
|
variable->id_ = j + 1;
|
||||||
QJsonObject processed_output, general, alarm;
|
QJsonObject general, alarm;
|
||||||
processed_output = tmp_variable["processed_output"].toObject();
|
general = tmp_variable["general"].toObject();
|
||||||
general = processed_output["general"].toObject();
|
alarm = tmp_variable["alarm"].toObject();
|
||||||
alarm = processed_output["alarm"].toObject();
|
|
||||||
variable->general.output_used = general["output_used"].toBool();
|
variable->general.output_used = general["output_used"].toBool();
|
||||||
variable->general.engineering_unit = general["engieneering_unit"].toInt();
|
variable->general.engineering_unit = general["engieneering_unit"].toInt();
|
||||||
variable->general.rectifier_function = general["rectifier_function"].toInt();
|
variable->general.rectifier_function = general["rectifier_function"].toInt();
|
||||||
|
|||||||
@ -155,10 +155,7 @@ typedef enum{
|
|||||||
kUnit7 = 6, // mils
|
kUnit7 = 6, // mils
|
||||||
kUnit8 = 7, // inch/s**2
|
kUnit8 = 7, // inch/s**2
|
||||||
kUnit9 = 9, // mbar
|
kUnit9 = 9, // mbar
|
||||||
kUnit10 = 10, // bar
|
kUnit10 = 10 // bar
|
||||||
kUnit11 = 11, // psi
|
|
||||||
kUnit12 = 12, // pa
|
|
||||||
kUnit13 = 13 // user defined
|
|
||||||
} EngineeringUnit;
|
} EngineeringUnit;
|
||||||
|
|
||||||
typedef enum{
|
typedef enum{
|
||||||
|
|||||||
@ -188,14 +188,6 @@ QString DC_Outputs::GetUnit(int com_index){
|
|||||||
unit_str = "bar";
|
unit_str = "bar";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case kUnit11:{
|
|
||||||
unit_str = "psi";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case kUnit12:{
|
|
||||||
unit_str = "pa";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return unit_str;
|
return unit_str;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,7 +64,7 @@ void PressurePulsation::Init() {
|
|||||||
ui->comboBox_output_used->setCurrentIndex(0);
|
ui->comboBox_output_used->setCurrentIndex(0);
|
||||||
else
|
else
|
||||||
ui->comboBox_output_used->setCurrentIndex(1);
|
ui->comboBox_output_used->setCurrentIndex(1);
|
||||||
ui->comboBox_engineering_unit->setCurrentIndex(variable_ptr->general.engineering_unit);
|
ui->comboBox_engineering_unit->setCurrentText(GetUnit(variable_ptr->general.engineering_unit));
|
||||||
ui->comboBox_rectifier_funtion->setCurrentIndex(variable_ptr->general.rectifier_function);
|
ui->comboBox_rectifier_funtion->setCurrentIndex(variable_ptr->general.rectifier_function);
|
||||||
// -alarm
|
// -alarm
|
||||||
ui->lineEdit_danger_high_level->setText(QString::number(variable_ptr->danger_high.level));
|
ui->lineEdit_danger_high_level->setText(QString::number(variable_ptr->danger_high.level));
|
||||||
@ -166,7 +166,7 @@ void PressurePulsation::on_pushButton_confirm_clicked()
|
|||||||
variable->general.output_used = true;
|
variable->general.output_used = true;
|
||||||
else
|
else
|
||||||
variable->general.output_used = false;
|
variable->general.output_used = false;
|
||||||
variable->general.engineering_unit = ui->comboBox_engineering_unit->currentIndex();
|
variable->general.engineering_unit = SetUnit(ui->comboBox_engineering_unit->currentText());
|
||||||
variable->general.rectifier_function = ui->comboBox_rectifier_funtion->currentIndex();
|
variable->general.rectifier_function = ui->comboBox_rectifier_funtion->currentIndex();
|
||||||
// -alarm
|
// -alarm
|
||||||
variable->danger_high.level = ui->lineEdit_danger_high_level->text().toDouble();
|
variable->danger_high.level = ui->lineEdit_danger_high_level->text().toDouble();
|
||||||
@ -311,4 +311,75 @@ void PressurePulsation::on_lineEdit_alert_high_level_editingFinished()
|
|||||||
ui->lineEdit_danger_high_level->setText(ui->lineEdit_alert_high_level->text());
|
ui->lineEdit_danger_high_level->setText(ui->lineEdit_alert_high_level->text());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
QString PressurePulsation::GetUnit(int unit_num){
|
||||||
|
QString unit_str = "";
|
||||||
|
switch (unit_num) {
|
||||||
|
case kUnit1:{
|
||||||
|
unit_str = "g";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit2:{
|
||||||
|
unit_str = "m/s**2";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit3:{
|
||||||
|
unit_str = "mm/s";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit4:{
|
||||||
|
unit_str = "inch/s";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit5:{
|
||||||
|
unit_str = "um";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit6:{
|
||||||
|
unit_str = "mm";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit7:{
|
||||||
|
unit_str = "mils";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit8:{
|
||||||
|
unit_str = "inch/s**2";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit9:{
|
||||||
|
unit_str = "mbar";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit10:{
|
||||||
|
unit_str = "bar";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return unit_str;
|
||||||
|
}
|
||||||
|
int PressurePulsation::SetUnit(QString unit_str){
|
||||||
|
int unit_num = -1;
|
||||||
|
if (unit_str == "g") {
|
||||||
|
unit_num = 0;
|
||||||
|
}
|
||||||
|
else if(unit_str == "m/s**2"){
|
||||||
|
unit_num = 1;
|
||||||
|
}else if(unit_str == "mm/s"){
|
||||||
|
unit_num = 2;
|
||||||
|
}else if(unit_str == "inch/s"){
|
||||||
|
unit_num = 3;
|
||||||
|
}else if(unit_str == "um"){
|
||||||
|
unit_num = 4;
|
||||||
|
}else if(unit_str == "mm"){
|
||||||
|
unit_num = 5;
|
||||||
|
}else if(unit_str == "mils"){
|
||||||
|
unit_num = 6;
|
||||||
|
}else if(unit_str == "inch/s**2"){
|
||||||
|
unit_num = 7;
|
||||||
|
}else if(unit_str == "mbar"){
|
||||||
|
unit_num = 9;
|
||||||
|
}else if(unit_str == "bar"){
|
||||||
|
unit_num = 10;
|
||||||
|
}
|
||||||
|
return unit_num;
|
||||||
|
}
|
||||||
|
|||||||
@ -27,6 +27,8 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
Ui::PressurePulsation *ui;
|
Ui::PressurePulsation *ui;
|
||||||
void Init();
|
void Init();
|
||||||
|
QString GetUnit(int unit_num);
|
||||||
|
int SetUnit(QString unit_str);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PRESSURE_PULSATION_H
|
#endif // PRESSURE_PULSATION_H
|
||||||
|
|||||||
@ -98,7 +98,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -469,11 +469,6 @@
|
|||||||
<string>mm/s</string>
|
<string>mm/s</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>inch/s</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>um</string>
|
<string>um</string>
|
||||||
@ -484,16 +479,6 @@
|
|||||||
<string>mm</string>
|
<string>mm</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>mils</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>inch/s**2</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>mbar</string>
|
<string>mbar</string>
|
||||||
@ -504,16 +489,6 @@
|
|||||||
<string>bar</string>
|
<string>bar</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>psi</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>pa</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
@ -71,7 +71,7 @@ void Seismic_monitor::Init() {
|
|||||||
qDebug() << vib_data->base_config_[i].channel_type ;
|
qDebug() << vib_data->base_config_[i].channel_type ;
|
||||||
ui->comboBox_chan_type_1->setCurrentIndex(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->checkBox_standby_1->setChecked(vib_data->base_config_[i].standby);
|
||||||
ui->comboBox_sensitivity_unit_1->setCurrentIndex(vib_data->base_config_[i].sensitivity_unit);
|
ui->comboBox_sensitivity_unit_1->setCurrentText(GetUnit(vib_data->base_config_[i].sensitivity_unit));
|
||||||
ui->lineEdit_signal_sensitivity_1->setText(QString::number(vib_data->base_config_[i].signal_sensitivity));
|
ui->lineEdit_signal_sensitivity_1->setText(QString::number(vib_data->base_config_[i].signal_sensitivity));
|
||||||
if(vib_data->base_config_[i].power)
|
if(vib_data->base_config_[i].power)
|
||||||
ui->comboBox_power_supply_1->setCurrentIndex(0);
|
ui->comboBox_power_supply_1->setCurrentIndex(0);
|
||||||
@ -87,7 +87,7 @@ void Seismic_monitor::Init() {
|
|||||||
|
|
||||||
} else if (i + 1 == 2) {
|
} else if (i + 1 == 2) {
|
||||||
ui->comboBox_chan_type_2->setCurrentIndex(vib_data->base_config_[i].channel_type);
|
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->comboBox_sensitivity_unit_2->setCurrentText(GetUnit(vib_data->base_config_[i].sensitivity_unit));
|
||||||
ui->lineEdit_signal_sensitivity_2->setText(QString::number(vib_data->base_config_[i].signal_sensitivity));
|
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->checkBox_enable_2->setChecked(vib_data->base_config_[i].active);
|
||||||
@ -104,7 +104,7 @@ void Seismic_monitor::Init() {
|
|||||||
} else if (i + 1 == 3) {
|
} else if (i + 1 == 3) {
|
||||||
ui->checkBox_standby_2->setChecked(vib_data->base_config_[i].standby);
|
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_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->comboBox_sensitivity_unit_3->setCurrentText(GetUnit(vib_data->base_config_[i].sensitivity_unit));
|
||||||
ui->lineEdit_signal_sensitivity_3->setText(QString::number(vib_data->base_config_[i].signal_sensitivity));
|
ui->lineEdit_signal_sensitivity_3->setText(QString::number(vib_data->base_config_[i].signal_sensitivity));
|
||||||
if(vib_data->base_config_[i].power)
|
if(vib_data->base_config_[i].power)
|
||||||
ui->comboBox_power_supply_3->setCurrentIndex(0);
|
ui->comboBox_power_supply_3->setCurrentIndex(0);
|
||||||
@ -120,7 +120,7 @@ void Seismic_monitor::Init() {
|
|||||||
|
|
||||||
} else if (i + 1 == 4) {
|
} else if (i + 1 == 4) {
|
||||||
ui->comboBox_chan_type_4->setCurrentIndex(vib_data->base_config_[i].channel_type);
|
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->comboBox_sensitivity_unit_4->setCurrentText(GetUnit(vib_data->base_config_[i].sensitivity_unit));
|
||||||
ui->lineEdit_signal_sensitivity_4->setText(QString::number(vib_data->base_config_[i].signal_sensitivity));
|
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->checkBox_keyphase_4->setChecked(vib_data->base_config_[i].keyphase);
|
||||||
@ -160,7 +160,7 @@ 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].active = ui->checkBox_enable_1->isChecked();
|
||||||
vib_data->base_config_[var].rack_type = 0;
|
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].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].sensitivity_unit = SetUnit(ui->comboBox_sensitivity_unit_1->currentText());
|
||||||
vib_data->base_config_[var].signal_sensitivity = ui->lineEdit_signal_sensitivity_1->text().toFloat();
|
vib_data->base_config_[var].signal_sensitivity = ui->lineEdit_signal_sensitivity_1->text().toFloat();
|
||||||
if(ui->comboBox_power_supply_1->currentIndex() == 0)
|
if(ui->comboBox_power_supply_1->currentIndex() == 0)
|
||||||
vib_data->base_config_[var].power = true;
|
vib_data->base_config_[var].power = true;
|
||||||
@ -177,7 +177,7 @@ 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].active = ui->checkBox_enable_2->isChecked();
|
||||||
vib_data->base_config_[var].rack_type = 0;
|
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].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].sensitivity_unit = SetUnit(ui->comboBox_sensitivity_unit_2->currentText());
|
||||||
vib_data->base_config_[var].signal_sensitivity = ui->lineEdit_signal_sensitivity_2->text().toFloat();
|
vib_data->base_config_[var].signal_sensitivity = ui->lineEdit_signal_sensitivity_2->text().toFloat();
|
||||||
if(ui->comboBox_power_supply_1->currentIndex() == 0)
|
if(ui->comboBox_power_supply_1->currentIndex() == 0)
|
||||||
vib_data->base_config_[var].power = true;
|
vib_data->base_config_[var].power = true;
|
||||||
@ -194,7 +194,7 @@ 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].active = ui->checkBox_enable_3->isChecked();
|
||||||
vib_data->base_config_[var].rack_type = 0;
|
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].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].sensitivity_unit = SetUnit(ui->comboBox_sensitivity_unit_3->currentText());
|
||||||
vib_data->base_config_[var].signal_sensitivity = ui->lineEdit_signal_sensitivity_3->text().toFloat();
|
vib_data->base_config_[var].signal_sensitivity = ui->lineEdit_signal_sensitivity_3->text().toFloat();
|
||||||
if(ui->comboBox_power_supply_1->currentIndex() == 0)
|
if(ui->comboBox_power_supply_1->currentIndex() == 0)
|
||||||
vib_data->base_config_[var].power = true;
|
vib_data->base_config_[var].power = true;
|
||||||
@ -212,7 +212,7 @@ 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].active = ui->checkBox_enable_4->isChecked();
|
||||||
vib_data->base_config_[var].rack_type = 0;
|
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].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].sensitivity_unit = SetUnit(ui->comboBox_sensitivity_unit_4->currentText());
|
||||||
vib_data->base_config_[var].signal_sensitivity = ui->lineEdit_signal_sensitivity_4->text().toFloat();
|
vib_data->base_config_[var].signal_sensitivity = ui->lineEdit_signal_sensitivity_4->text().toFloat();
|
||||||
if(ui->comboBox_power_supply_1->currentIndex() == 0)
|
if(ui->comboBox_power_supply_1->currentIndex() == 0)
|
||||||
vib_data->base_config_[var].power = true;
|
vib_data->base_config_[var].power = true;
|
||||||
@ -657,4 +657,75 @@ void Seismic_monitor::on_comboBox_function_1_currentIndexChanged(int index)
|
|||||||
}
|
}
|
||||||
current_config_1_2 = index;
|
current_config_1_2 = index;
|
||||||
}
|
}
|
||||||
|
QString Seismic_monitor::GetUnit(int unit_num){
|
||||||
|
QString unit_str = "";
|
||||||
|
switch (unit_num) {
|
||||||
|
case kUnit1:{
|
||||||
|
unit_str = "g";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit2:{
|
||||||
|
unit_str = "m/s**2";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit3:{
|
||||||
|
unit_str = "mm/s";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit4:{
|
||||||
|
unit_str = "inch/s";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit5:{
|
||||||
|
unit_str = "um";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit6:{
|
||||||
|
unit_str = "mm";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit7:{
|
||||||
|
unit_str = "mils";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit8:{
|
||||||
|
unit_str = "inch/s**2";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit9:{
|
||||||
|
unit_str = "mbar";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case kUnit10:{
|
||||||
|
unit_str = "bar";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return unit_str;
|
||||||
|
}
|
||||||
|
int Seismic_monitor::SetUnit(QString unit_str){
|
||||||
|
int unit_num = -1;
|
||||||
|
if (unit_str == "g") {
|
||||||
|
unit_num = 0;
|
||||||
|
}
|
||||||
|
else if(unit_str == "m/s**2"){
|
||||||
|
unit_num = 1;
|
||||||
|
}else if(unit_str == "mm/s"){
|
||||||
|
unit_num = 2;
|
||||||
|
}else if(unit_str == "inch/s"){
|
||||||
|
unit_num = 3;
|
||||||
|
}else if(unit_str == "um"){
|
||||||
|
unit_num = 4;
|
||||||
|
}else if(unit_str == "mm"){
|
||||||
|
unit_num = 5;
|
||||||
|
}else if(unit_str == "mils"){
|
||||||
|
unit_num = 6;
|
||||||
|
}else if(unit_str == "inch/s**2"){
|
||||||
|
unit_num = 7;
|
||||||
|
}else if(unit_str == "mbar"){
|
||||||
|
unit_num = 9;
|
||||||
|
}else if(unit_str == "bar"){
|
||||||
|
unit_num = 10;
|
||||||
|
}
|
||||||
|
return unit_num;
|
||||||
|
}
|
||||||
|
|||||||
@ -79,6 +79,8 @@ private:
|
|||||||
void DisableKeyphase2();
|
void DisableKeyphase2();
|
||||||
void DisableKeyphase3();
|
void DisableKeyphase3();
|
||||||
void DisableKeyphase4();
|
void DisableKeyphase4();
|
||||||
|
QString GetUnit(int unit_num);
|
||||||
|
int SetUnit(QString unit_str);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SEISMIC_MONITOR_H
|
#endif // SEISMIC_MONITOR_H
|
||||||
|
|||||||
@ -265,7 +265,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -1166,7 +1166,7 @@
|
|||||||
<string>配置</string>
|
<string>配置</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="">
|
<widget class="QWidget" name="layoutWidget">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>21</x>
|
<x>21</x>
|
||||||
@ -1231,7 +1231,7 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="">
|
<widget class="QWidget" name="layoutWidget">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>20</x>
|
<x>20</x>
|
||||||
@ -1266,7 +1266,7 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="">
|
<widget class="QWidget" name="layoutWidget">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>20</x>
|
<x>20</x>
|
||||||
@ -1535,7 +1535,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab_3">
|
<widget class="QWidget" name="tab_3">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user