diff --git a/cardbase.h b/cardbase.h index 359599f..fa1532b 100644 --- a/cardbase.h +++ b/cardbase.h @@ -24,7 +24,7 @@ class VariableBase { virtual ~VariableBase() {} int id_; - VibChannelType type_; + int type_; Filter filter_[3]; General general; AlarmDangerHigh danger_high; diff --git a/config_mgr.cpp b/config_mgr.cpp index 097175a..b23843d 100644 --- a/config_mgr.cpp +++ b/config_mgr.cpp @@ -779,6 +779,7 @@ void ConfigMgr::Load(QString filename) { variable->filter_[k].checked = filter_ele["checked"].toBool(); } variable->id_ = j + 1; + variable->type_ = vib_data->base_config_[j].channel_type; QJsonObject measurement, gap,m_general,m_alarm,g_general,g_alarm; measurement = tmp_variable["measurement"].toObject(); gap = tmp_variable["gap"].toObject(); @@ -848,6 +849,7 @@ void ConfigMgr::Load(QString filename) { variable->filter_[k].checked = filter_ele["checked"].toBool(); } variable->id_ = j + 1; + variable->type_ = vib_data->base_config_[j].channel_type; QJsonObject gap,g_general,g_alarm; gap = tmp_variable["gap"].toObject(); g_general = gap["general"].toObject(); @@ -890,6 +892,7 @@ void ConfigMgr::Load(QString filename) { variable->filter_[k].checked = filter_ele["checked"].toBool(); } variable->id_ = j + 1; + variable->type_ = vib_data->base_config_[j].channel_type; QJsonObject processed_output, general, alarm; processed_output = tmp_variable["processed_output"].toObject(); general = processed_output["general"].toObject(); @@ -948,6 +951,7 @@ void ConfigMgr::Load(QString filename) { variable->filter_[k].checked = filter_ele["checked"].toBool(); } variable->id_ = j + 1; + variable->type_ = vib_data->base_config_[j].channel_type; QJsonObject processed_output, general, alarm; processed_output = tmp_variable["processed_output"].toObject(); general = processed_output["general"].toObject(); @@ -989,6 +993,7 @@ void ConfigMgr::Load(QString filename) { variable->filter_[k].checked = filter_ele["checked"].toBool(); } variable->id_ = j + 1; + variable->type_ = vib_data->base_config_[j].channel_type; QJsonObject processed_output, general, alarm; processed_output = tmp_variable["processed_output"].toObject(); general = processed_output["general"].toObject(); diff --git a/data_config.h b/data_config.h index 66a8c71..1b5abb3 100644 --- a/data_config.h +++ b/data_config.h @@ -300,7 +300,6 @@ typedef struct SeismicMonitor_{ normal_voltage_high = 20; normal_voltage_low = -20; signal_sensitivity = 8; - channel_type = -1; function = 0; first_channel_angle = 0; second_channel_angle = 0; diff --git a/dc_outputs.cpp b/dc_outputs.cpp index e29a9dc..53923e7 100644 --- a/dc_outputs.cpp +++ b/dc_outputs.cpp @@ -155,31 +155,30 @@ QString DC_Outputs::GetUnit(int com_index){ channel_num = 2; } std::shared_ptr variable_base = vib_dc_output_ptr->GetChannelPtr(channel_num + 1); - if (vib_dc_output_ptr->base_config_[channel_num].channel_type == kVibRadial) { - std::shared_ptr variable_ptr = std::dynamic_pointer_cast(variable_base); - unit_num = variable_ptr->general.engineering_unit; - qDebug() << "unit_num1" << unit_num ; - } - if (vib_dc_output_ptr->base_config_[channel_num].channel_type == kVibAcc) { - std::shared_ptr variable_ptr = std::dynamic_pointer_cast(variable_base); - unit_num = variable_ptr->general.engineering_unit; - qDebug() << "unit_num2" << unit_num ; - } - if (vib_dc_output_ptr->base_config_[channel_num].channel_type == kVibVelocity) { - std::shared_ptr variable_ptr = std::dynamic_pointer_cast(variable_base); - unit_num = variable_ptr->general.engineering_unit; - qDebug() << "unit_num3" << unit_num ; - } - if (vib_dc_output_ptr->base_config_[channel_num].channel_type == kVibThrust) { - std::shared_ptr variable_ptr = std::dynamic_pointer_cast(variable_base); - unit_num = variable_ptr->general.engineering_unit; - qDebug() << "unit_num4" << unit_num ; - } - if (vib_dc_output_ptr->base_config_[channel_num].channel_type == kVibPressurePulsation) { - std::shared_ptr variable_ptr = std::dynamic_pointer_cast(variable_base); - unit_num = variable_ptr->general.engineering_unit; +// if (vib_dc_output_ptr->base_config_[channel_num].channel_type == kVibRadial) { +// std::shared_ptr variable_ptr = std::dynamic_pointer_cast(variable_base); +// unit_num = variable_ptr->general.engineering_unit; +// qDebug() << "unit_num1" << unit_num ; +// } +// if (vib_dc_output_ptr->base_config_[channel_num].channel_type == kVibAcc) { +// std::shared_ptr variable_ptr = std::dynamic_pointer_cast(variable_base); +// unit_num = variable_ptr->general.engineering_unit; +// qDebug() << "unit_num2" << unit_num ; +// } +// if (vib_dc_output_ptr->base_config_[channel_num].channel_type == kVibVelocity) { +// std::shared_ptr variable_ptr = std::dynamic_pointer_cast(variable_base); +// unit_num = variable_ptr->general.engineering_unit; +// qDebug() << "unit_num3" << unit_num ; +// } +// if (vib_dc_output_ptr->base_config_[channel_num].channel_type == kVibThrust) { +// std::shared_ptr variable_ptr = std::dynamic_pointer_cast(variable_base); +// unit_num = vib_dc_output_ptr->base_config_[channel_num].sensitivity_unit; +// qDebug() << "unit_num4" << unit_num ; +// } + //if (vib_dc_output_ptr->base_config_[channel_num].channel_type == kVibPressurePulsation) { + unit_num = vib_dc_output_ptr->base_config_[channel_num].sensitivity_unit; qDebug() << "unit_num5" << unit_num ; - } + //} switch (unit_num) { case kUnit1:{ unit_str = "g"; diff --git a/high_speed_current.ui b/high_speed_current.ui index c30b814..0fe4bb0 100644 --- a/high_speed_current.ui +++ b/high_speed_current.ui @@ -11,7 +11,7 @@ - Form + 高速电流 diff --git a/seismic_monitor.ui b/seismic_monitor.ui index 28c26c1..b605232 100644 --- a/seismic_monitor.ui +++ b/seismic_monitor.ui @@ -364,7 +364,7 @@ - m/s^2 + m/s**2 @@ -805,7 +805,7 @@ - m/s^2 + m/s**2 @@ -1612,7 +1612,7 @@ - m/s^2 + m/s**2 @@ -2053,7 +2053,7 @@ - m/s^2 + m/s**2