From 76c820603736784c1487b69d011043c3f8354974 Mon Sep 17 00:00:00 2001 From: zhangsheng Date: Fri, 13 Mar 2026 10:33:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=AB=98=E9=80=9F=E7=94=B5?= =?UTF-8?q?=E6=B5=81=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TSI_Config.pro | 5 + channel_crc.cpp | 3 - config_mgr.cpp | 85 +- data_config.h | 20 +- dc_outputs.cpp | 169 +- dc_outputs.h | 3 + high_speed_current.cpp | 288 +++ high_speed_current.h | 43 + high_speed_current.ui | 3451 +++++++++++++++++++++++++++++++++++ high_speed_current_data.cpp | 3 + high_speed_current_data.h | 16 + mainwindow.cpp | 49 +- mainwindow.ui | 61 +- tachometer.h | 3 - 14 files changed, 4103 insertions(+), 96 deletions(-) create mode 100644 high_speed_current.cpp create mode 100644 high_speed_current.h create mode 100644 high_speed_current.ui create mode 100644 high_speed_current_data.cpp create mode 100644 high_speed_current_data.h diff --git a/TSI_Config.pro b/TSI_Config.pro index aeea952..cc35475 100644 --- a/TSI_Config.pro +++ b/TSI_Config.pro @@ -24,6 +24,8 @@ SOURCES += \ dc_outputs.cpp \ ethconfig.cpp \ headerView.cpp \ + high_speed_current.cpp \ + high_speed_current_data.cpp \ keyphase.cpp \ keyphase_data.cpp \ macconfig.cpp \ @@ -68,6 +70,8 @@ HEADERS += \ displacement_ds.h \ ethconfig.h \ headerView.h \ + high_speed_current.h \ + high_speed_current_data.h \ keyphase.h \ keyphase_data.h \ macconfig.h \ @@ -104,6 +108,7 @@ FORMS += \ dc_output_channel.ui \ dc_outputs.ui \ ethconfig.ui \ + high_speed_current.ui \ keyphase.ui \ macconfig.ui \ mainwindow.ui \ diff --git a/channel_crc.cpp b/channel_crc.cpp index 6cc72a7..533308f 100644 --- a/channel_crc.cpp +++ b/channel_crc.cpp @@ -57,17 +57,14 @@ void ChannelCRC::on_pushButton_get_clicked() rows ++ ; } } - } void ChannelCRC::readData(const QByteArray &data) { qDebug() << "Received from server111:" << data; - uint8_t cmd = data[3]; if (cmd == kGetChannelCRCValue) { GetChannelCRCCountRsp get_ch_crc_rsp; memcpy(&get_ch_crc_rsp, data.data(), sizeof(GetChannelCRCCountRsp)); qDebug() << "get_ch_crc_rsp code" << get_ch_crc_rsp.code << get_ch_crc_rsp.card_id << get_ch_crc_rsp.channel_id << get_ch_crc_rsp.count << rows_slot[(int)get_ch_crc_rsp.card_id] ; model->setData(model->index(rows_slot[(int)get_ch_crc_rsp.card_id],((int)get_ch_crc_rsp.channel_id),QModelIndex()),get_ch_crc_rsp.count); - } } diff --git a/config_mgr.cpp b/config_mgr.cpp index 8fd83cd..097175a 100644 --- a/config_mgr.cpp +++ b/config_mgr.cpp @@ -10,6 +10,7 @@ #include "keyphase_data.h" #include "singlerelay_data.h" #include "tmrrelayassociation_data.h" +#include "high_speed_current_data.h" #include @@ -38,7 +39,8 @@ int ConfigMgr::Save(QString & file_path) { card_type_[i] != kCardKeyphaseSingle && card_type_[i] != kCardRelaySingle && card_type_[i] != kCardRelayTMRPrimary && - card_type_[i] != kCardRelaySingleNOK) { + card_type_[i] != kCardRelaySingleNOK && + card_type_[i] != kCardHighSpeedCurrent) { continue; } // process slot @@ -500,6 +502,41 @@ int ConfigMgr::Save(QString & file_path) { alarm["alert_high_latch"] = ptr->alert_high[cid].latch; channel_item.insert("alarm" , alarm); + }else if(card_type_[i] == kCardHighSpeedCurrent){ + std::shared_ptr base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot); + if (base_ptr == nullptr || cid > 3) { + continue; + } + std::shared_ptr ptr = std::dynamic_pointer_cast(base_ptr); + // output channel + QJsonObject dc_output_item; + if(ptr->dc_output[cid].output_channel != -1){ + dc_output_item["output_channel"] = ptr->dc_output[cid].output_channel; + dc_output_item["minmum"] = ptr->dc_output[cid].minmum; + dc_output_item["maxmum"] = ptr->dc_output[cid].maxmum; + dc_output[QString::number(cid + 1)] = dc_output_item; + } + channel_item.insert("active", ptr->variables_[cid].active); + channel_item.insert("point_name", ptr->variables_[cid].point_name); + channel_item.insert("engineering_unit", ptr->variables_[cid].engineering_unit); + channel_item.insert("fullScalePosition", ptr->variables_[cid].fullScalePosition); + channel_item.insert("xfullScalePosition", ptr->variables_[cid].xfullScalePosition); + channel_item.insert("zeroScalePosition", ptr->variables_[cid].zeroScalePosition); + channel_item.insert("xzeroScalePosition", ptr->variables_[cid].xzeroScalePosition); + channel_item.insert("rectifier_funtion", ptr->variables_[cid].rectifier_funtion); + + QJsonObject alarm; + alarm["danger_high_level"] = ptr->danger_high[cid].level; + alarm["danger_high_hysteresis"] = ptr->danger_high[cid].hysteresis; + alarm["danger_high_delay"] = ptr->danger_high[cid].delay; + alarm["danger_high_enable"] = ptr->danger_high[cid].enable; + alarm["danger_high_latch"] = ptr->danger_high[cid].latch; + alarm["alert_high_level"] = ptr->alert_high[cid].level; + alarm["alert_high_hysteresis"] = ptr->alert_high[cid].hysteresis; + alarm["alert_high_delay"] = ptr->alert_high[cid].delay; + alarm["alert_high_enable"] = ptr->alert_high[cid].enable; + alarm["alert_high_latch"] = ptr->alert_high[cid].latch; + channel_item.insert("alarm" , alarm); } else if (card_type_[i] == kCardKeyphaseSingle) { std::shared_ptr base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot); if (base_ptr == nullptr || cid > 3) { @@ -1082,6 +1119,52 @@ void ConfigMgr::Load(QString filename) { } cards_.push_back(keyphase_data); + }else if(card_type_[i] == kCardHighSpeedCurrent){ + std::shared_ptr current_data = std::make_shared(); + current_data->slot_ = slot; + current_data->card_type_ = static_cast(card_type_[i]); + current_data->version_ = temp_obj["version"].toInt(); + current_data->relative_number = temp_obj["relative_number"].toInt(); + current_data->group = temp_obj["group"].toInt(); + for (int j = 0; j < CHANNEL_COUNT_SPEED; ++j) { + channel = temp_obj[QString::number(j + 1)].toObject(); + current_data->variables_[j].active = channel["active"].toBool(); + current_data->variables_[j].point_name = channel["point_name"].toString(); + current_data->variables_[j].engineering_unit = channel["engineering_unit"].toString(); + current_data->variables_[j].fullScalePosition = channel["fullScalePosition"].toDouble(); + current_data->variables_[j].xfullScalePosition = channel["xfullScalePosition"].toDouble(); + current_data->variables_[j].zeroScalePosition = channel["zeroScalePosition"].toDouble(); + current_data->variables_[j].xzeroScalePosition = channel["xzeroScalePosition"].toDouble(); + current_data->variables_[j].rectifier_funtion = channel["rectifier_funtion"].toInt(); + if(channel.contains("alarm")){ + QJsonObject alarm = channel["alarm"].toObject(); + current_data->danger_high[j].level = alarm["danger_high_level"].toDouble(); + current_data->danger_high[j].hysteresis = alarm["danger_high_hysteresis"].toDouble(); + current_data->danger_high[j].delay = alarm["danger_high_delay"].toInt(); + current_data->danger_high[j].enable = alarm["danger_high_enable"].toBool(); + current_data->danger_high[j].latch = alarm["danger_high_latch"].toBool(); + current_data->alert_high[j].level = alarm["alert_high_level"].toDouble(); + current_data->alert_high[j].hysteresis = alarm["alert_high_hysteresis"].toDouble(); + current_data->alert_high[j].delay = alarm["alert_high_delay"].toInt(); + current_data->alert_high[j].enable = alarm["alert_high_enable"].toBool(); + current_data->alert_high[j].latch = alarm["alert_high_latch"].toBool(); + } + } + // dc_output + QJsonObject dc_output_obj = temp_obj["dc_output"].toObject(); + if(!dc_output_obj.isEmpty()){ + QJsonObject output_obj; + for (int var = 0; var < CHANNEL_COUNT; ++var) { + output_obj = dc_output_obj[QString::number(var + 1)].toObject(); + if(output_obj.isEmpty()) + continue; + current_data->dc_output[var].output_channel = output_obj["output_channel"].toInt(); + current_data->dc_output[var].minmum = output_obj["minmum"].toDouble(); + current_data->dc_output[var].maxmum = output_obj["maxmum"].toDouble(); + } + + } + cards_.push_back(current_data); }else if (card_type_[i] == kCardRelaySingle ){ std::shared_ptr singlerelay_data = std::make_shared(); singlerelay_data->slot_ = slot; diff --git a/data_config.h b/data_config.h index 1ad2043..66a8c71 100644 --- a/data_config.h +++ b/data_config.h @@ -52,6 +52,8 @@ typedef enum { kCardRelayTMRBackup = 34, kCardRelaySingleNOK = 35, + kCardHighSpeedCurrent = 36, + } CardType; // 振动板通道类型 @@ -63,6 +65,7 @@ typedef enum { kVibPressurePulsation = 4, //动态压力脉动 kVib12 = 5, // 通道1&2 kVib34 = 6, // 通道3&4 + kHighSpeedCurrent = 7 // 高速电流 } VibChannelType; enum TotalCalcValueType { // 转速 @@ -133,7 +136,8 @@ typedef enum{ kRMSScalePeakToPeak = 3, kAVG = 4, kRMSScaleAVG = 5, - kRMS = 6 + kRMS = 6, + kMin = 7 } RectifierFuntion; typedef enum{ @@ -484,6 +488,20 @@ typedef struct { bool fail; } KeyphaseVariables; +typedef struct HighSpeedCurrentVariables_ +{ + int id; + QString point_name; + bool active; + QString engineering_unit; + float fullScalePosition; + float xfullScalePosition; + float zeroScalePosition; + float xzeroScalePosition; + int rectifier_funtion; + HighSpeedCurrentVariables_() {} +}HighSpeedCurrentVariables; + typedef struct { QString transducer_name; double scale_factor; diff --git a/dc_outputs.cpp b/dc_outputs.cpp index f36fad5..e29a9dc 100644 --- a/dc_outputs.cpp +++ b/dc_outputs.cpp @@ -6,6 +6,7 @@ #include "config_mgr.h" #include "data_config.h" #include "vibrationdata.h" +#include ChannelUsed ch_used[SLOT_NUM][22]; @@ -57,50 +58,82 @@ void DC_Outputs::Init(){ qCritical() << "[DC_Outputs::Init] should not be here"; return; } - vib_dc_output_ptr = std::dynamic_pointer_cast(base_ptr); + if (car_type == kCardHighSpeedCurrent) { + hsc_dc_output_ptr = std::dynamic_pointer_cast(base_ptr); + if (hsc_dc_output_ptr == nullptr) { + qCritical() << "[DC_Outputs::Init] high speed current data is null"; + return; + } + QStandardItemModel *model = qobject_cast(ui->comboBox_ch_output->model()); + if (model != nullptr) { + for (int i = 6; i < ui->comboBox_ch_output->count(); ++i) { + model->item(i)->setEnabled(false); + } + } + } else { + vib_dc_output_ptr = std::dynamic_pointer_cast(base_ptr); + } QString unit_str = ""; - if(vib_dc_output_ptr->dc_output[0].output_channel != -1){ - unit_str = GetUnit(vib_dc_output_ptr->dc_output[0].output_channel); - ui->label_ch_1->setText(ui->comboBox_ch_output->itemText(vib_dc_output_ptr->dc_output[0].output_channel)); - ui->label_ch_1_min->setText(QString::number(vib_dc_output_ptr->dc_output[0].minmum)); - ui->label_ch_1_max->setText(QString::number(vib_dc_output_ptr->dc_output[0].maxmum)); - ui->label_ch_1_min_unit->setText(unit_str); - ui->label_ch_1_max_unit->setText(unit_str); - ch_used[slot_no][vib_dc_output_ptr->dc_output[0].output_channel].used[0] = true; - } - if(vib_dc_output_ptr->dc_output[1].output_channel != -1){ - unit_str = GetUnit(vib_dc_output_ptr->dc_output[1].output_channel); - ui->label_ch_2->setText(ui->comboBox_ch_output->itemText(vib_dc_output_ptr->dc_output[1].output_channel)); - ui->label_ch_2_min->setText(QString::number(vib_dc_output_ptr->dc_output[1].minmum)); - ui->label_ch_2_max->setText(QString::number(vib_dc_output_ptr->dc_output[1].maxmum)); - ui->label_ch_2_min_unit->setText(unit_str); - ui->label_ch_2_max_unit->setText(unit_str); - ch_used[slot_no][vib_dc_output_ptr->dc_output[1].output_channel].used[1] = true; - } - if(vib_dc_output_ptr->dc_output[2].output_channel != -1){ - unit_str = GetUnit(vib_dc_output_ptr->dc_output[2].output_channel); - ui->label_ch_3->setText(ui->comboBox_ch_output->itemText(vib_dc_output_ptr->dc_output[2].output_channel)); - ui->label_ch_3_min->setText(QString::number(vib_dc_output_ptr->dc_output[2].minmum)); - ui->label_ch_3_max->setText(QString::number(vib_dc_output_ptr->dc_output[2].maxmum)); - ui->label_ch_3_min_unit->setText(unit_str); - ui->label_ch_3_max_unit->setText(unit_str); - ch_used[slot_no][vib_dc_output_ptr->dc_output[2].output_channel].used[2] = true; - } - if(vib_dc_output_ptr->dc_output[3].output_channel != -1){ - unit_str = GetUnit(vib_dc_output_ptr->dc_output[3].output_channel); - ui->label_ch_4->setText(ui->comboBox_ch_output->itemText(vib_dc_output_ptr->dc_output[3].output_channel)); - ui->label_ch_4_min->setText(QString::number(vib_dc_output_ptr->dc_output[3].minmum)); - ui->label_ch_4_max->setText(QString::number(vib_dc_output_ptr->dc_output[3].maxmum)); - ui->label_ch_4_min_unit->setText(unit_str); - ui->label_ch_4_max_unit->setText(unit_str); - ch_used[slot_no][vib_dc_output_ptr->dc_output[3].output_channel].used[3] = true; - } - - + DCOutput *dc_output = GetDcOutputArray(); + if (dc_output == nullptr) { + qCritical() << "[DC_Outputs::Init] dc_output is null"; + return; + } + if(dc_output[0].output_channel != -1){ + unit_str = GetUnit(dc_output[0].output_channel); + ui->label_ch_1->setText(ui->comboBox_ch_output->itemText(dc_output[0].output_channel)); + ui->label_ch_1_min->setText(QString::number(dc_output[0].minmum)); + ui->label_ch_1_max->setText(QString::number(dc_output[0].maxmum)); + ui->label_ch_1_min_unit->setText(unit_str); + ui->label_ch_1_max_unit->setText(unit_str); + ch_used[slot_no][dc_output[0].output_channel].used[0] = true; + } + if(dc_output[1].output_channel != -1){ + unit_str = GetUnit(dc_output[1].output_channel); + ui->label_ch_2->setText(ui->comboBox_ch_output->itemText(dc_output[1].output_channel)); + ui->label_ch_2_min->setText(QString::number(dc_output[1].minmum)); + ui->label_ch_2_max->setText(QString::number(dc_output[1].maxmum)); + ui->label_ch_2_min_unit->setText(unit_str); + ui->label_ch_2_max_unit->setText(unit_str); + ch_used[slot_no][dc_output[1].output_channel].used[1] = true; + } + if(dc_output[2].output_channel != -1){ + unit_str = GetUnit(dc_output[2].output_channel); + ui->label_ch_3->setText(ui->comboBox_ch_output->itemText(dc_output[2].output_channel)); + ui->label_ch_3_min->setText(QString::number(dc_output[2].minmum)); + ui->label_ch_3_max->setText(QString::number(dc_output[2].maxmum)); + ui->label_ch_3_min_unit->setText(unit_str); + ui->label_ch_3_max_unit->setText(unit_str); + ch_used[slot_no][dc_output[2].output_channel].used[2] = true; + } + if(dc_output[3].output_channel != -1){ + unit_str = GetUnit(dc_output[3].output_channel); + ui->label_ch_4->setText(ui->comboBox_ch_output->itemText(dc_output[3].output_channel)); + ui->label_ch_4_min->setText(QString::number(dc_output[3].minmum)); + ui->label_ch_4_max->setText(QString::number(dc_output[3].maxmum)); + ui->label_ch_4_min_unit->setText(unit_str); + ui->label_ch_4_max_unit->setText(unit_str); + ch_used[slot_no][dc_output[3].output_channel].used[3] = true; + } } QString DC_Outputs::GetUnit(int com_index){ + if (car_type == kCardHighSpeedCurrent) { + if (hsc_dc_output_ptr == nullptr) { + return ""; + } + int channel_num = com_index; + if (com_index == 4) { + channel_num = 0; + } else if (com_index == 5) { + channel_num = 2; + } + if (channel_num < 0 || channel_num >= CHANNEL_COUNT_SPEED) { + return ""; + } + return hsc_dc_output_ptr->variables_[channel_num].engineering_unit; + } int unit_num = -1,channel_num = 0; QString unit_str = ""; channel_num = com_index; @@ -191,6 +224,19 @@ QString DC_Outputs::GetUnit(int com_index){ } return unit_str; } + +DCOutput *DC_Outputs::GetDcOutputArray(){ + if (car_type == kCardHighSpeedCurrent) { + if (hsc_dc_output_ptr == nullptr) { + return nullptr; + } + return hsc_dc_output_ptr->dc_output; + } + if (vib_dc_output_ptr == nullptr) { + return nullptr; + } + return vib_dc_output_ptr->dc_output; +} void DC_Outputs::on_comboBox_ch_output_activated(int index) { current_index = index; @@ -204,6 +250,11 @@ void DC_Outputs::on_comboBox_ch_output_activated(int index) void DC_Outputs::output_channel_data(int channel,float minmun,float maxmum,int not_used){ qDebug() << channel << minmun << maxmum ; QString unit_str = GetUnit(current_index); + DCOutput *dc_output = GetDcOutputArray(); + if (dc_output == nullptr) { + qCritical() << "[DC_Outputs::output_channel_data] dc_output is null"; + return; + } for (int i = 0; i < CHANNEL_COUNT; i++) { if(ch_used[slot_no][current_index].used[i] && i != (channel - 1)){ if(i == 0){ @@ -213,7 +264,7 @@ void DC_Outputs::output_channel_data(int channel,float minmun,float maxmum,int n label_ch1[3]->setText("-----"); label_ch1[4]->setText("-----"); ch_used[slot_no][ui->comboBox_ch_output->currentIndex()].used[0] = false; - vib_dc_output_ptr->dc_output[0].output_channel = -1; + dc_output[0].output_channel = -1; }else if(i == 1){ label_ch2[0]->setText("未使用"); label_ch2[1]->setText("-----"); @@ -221,7 +272,7 @@ void DC_Outputs::output_channel_data(int channel,float minmun,float maxmum,int n label_ch2[3]->setText("-----"); label_ch2[4]->setText("-----"); ch_used[slot_no][current_index].used[1] = false; - vib_dc_output_ptr->dc_output[1].output_channel = -1; + dc_output[1].output_channel = -1; }else if(i == 2){ label_ch3[0]->setText("未使用"); label_ch3[1]->setText("-----"); @@ -229,7 +280,7 @@ void DC_Outputs::output_channel_data(int channel,float minmun,float maxmum,int n label_ch3[3]->setText("-----"); label_ch3[4]->setText("-----"); ch_used[slot_no][current_index].used[2] = false; - vib_dc_output_ptr->dc_output[2].output_channel = -1; + dc_output[2].output_channel = -1; }else if(i == 3){ label_ch4[0]->setText("未使用"); label_ch4[1]->setText("-----"); @@ -237,7 +288,7 @@ void DC_Outputs::output_channel_data(int channel,float minmun,float maxmum,int n label_ch4[3]->setText("-----"); label_ch4[4]->setText("-----"); ch_used[slot_no][current_index].used[3] = false; - vib_dc_output_ptr->dc_output[3].output_channel = -1; + dc_output[3].output_channel = -1; } } } @@ -248,9 +299,9 @@ void DC_Outputs::output_channel_data(int channel,float minmun,float maxmum,int n ui->label_ch_1_min_unit->setText(unit_str); ui->label_ch_1_max_unit->setText(unit_str); ch_used[slot_no][ui->comboBox_ch_output->currentIndex()].used[0] = true; - vib_dc_output_ptr->dc_output[0].output_channel = current_index; - vib_dc_output_ptr->dc_output[0].minmum = ui->label_ch_1_min->text().toFloat(); - vib_dc_output_ptr->dc_output[0].maxmum = ui->label_ch_1_max->text().toFloat(); + dc_output[0].output_channel = current_index; + dc_output[0].minmum = ui->label_ch_1_min->text().toFloat(); + dc_output[0].maxmum = ui->label_ch_1_max->text().toFloat(); }else if(channel == 2){ ui->label_ch_2->setText(ui->comboBox_ch_output->currentText()); ui->label_ch_2_min->setText(QString::number(minmun)); @@ -258,9 +309,9 @@ void DC_Outputs::output_channel_data(int channel,float minmun,float maxmum,int n ui->label_ch_2_min_unit->setText(unit_str); ui->label_ch_2_max_unit->setText(unit_str); ch_used[slot_no][ui->comboBox_ch_output->currentIndex()].used[1] = true; - vib_dc_output_ptr->dc_output[1].output_channel = current_index; - vib_dc_output_ptr->dc_output[1].minmum = ui->label_ch_2_min->text().toFloat(); - vib_dc_output_ptr->dc_output[1].maxmum = ui->label_ch_2_max->text().toFloat(); + dc_output[1].output_channel = current_index; + dc_output[1].minmum = ui->label_ch_2_min->text().toFloat(); + dc_output[1].maxmum = ui->label_ch_2_max->text().toFloat(); }else if(channel == 3){ ui->label_ch_3->setText(ui->comboBox_ch_output->currentText()); ui->label_ch_3_min->setText(QString::number(minmun)); @@ -268,9 +319,9 @@ void DC_Outputs::output_channel_data(int channel,float minmun,float maxmum,int n ui->label_ch_3_min_unit->setText(unit_str); ui->label_ch_3_max_unit->setText(unit_str); ch_used[slot_no][ui->comboBox_ch_output->currentIndex()].used[2] = true; - vib_dc_output_ptr->dc_output[2].output_channel = current_index; - vib_dc_output_ptr->dc_output[2].minmum = ui->label_ch_3_min->text().toFloat(); - vib_dc_output_ptr->dc_output[2].maxmum = ui->label_ch_3_max->text().toFloat(); + dc_output[2].output_channel = current_index; + dc_output[2].minmum = ui->label_ch_3_min->text().toFloat(); + dc_output[2].maxmum = ui->label_ch_3_max->text().toFloat(); }else if(channel == 4){ ui->label_ch_4->setText(ui->comboBox_ch_output->currentText()); ui->label_ch_4_min->setText(QString::number(minmun)); @@ -278,9 +329,9 @@ void DC_Outputs::output_channel_data(int channel,float minmun,float maxmum,int n ui->label_ch_4_min_unit->setText(unit_str); ui->label_ch_4_max_unit->setText(unit_str); ch_used[slot_no][ui->comboBox_ch_output->currentIndex()].used[3] = true; - vib_dc_output_ptr->dc_output[3].output_channel = current_index; - vib_dc_output_ptr->dc_output[3].minmum = ui->label_ch_4_min->text().toFloat(); - vib_dc_output_ptr->dc_output[3].maxmum = ui->label_ch_4_max->text().toFloat(); + dc_output[3].output_channel = current_index; + dc_output[3].minmum = ui->label_ch_4_min->text().toFloat(); + dc_output[3].maxmum = ui->label_ch_4_max->text().toFloat(); }else if(channel == 5){ if(not_used == 0){ label_ch1[0]->setText("未使用"); @@ -289,7 +340,7 @@ void DC_Outputs::output_channel_data(int channel,float minmun,float maxmum,int n label_ch1[3]->setText("-----"); label_ch1[4]->setText("-----"); ch_used[slot_no][ui->comboBox_ch_output->currentIndex()].used[0] = false; - vib_dc_output_ptr->dc_output[0].output_channel = -1; + dc_output[0].output_channel = -1; }else if(not_used == 1){ label_ch2[0]->setText("未使用"); label_ch2[1]->setText("-----"); @@ -297,7 +348,7 @@ void DC_Outputs::output_channel_data(int channel,float minmun,float maxmum,int n label_ch2[3]->setText("-----"); label_ch2[4]->setText("-----"); ch_used[slot_no][ui->comboBox_ch_output->currentIndex()].used[1] = false; - vib_dc_output_ptr->dc_output[1].output_channel = -1; + dc_output[1].output_channel = -1; }else if(not_used == 2){ label_ch3[0]->setText("未使用"); label_ch3[1]->setText("-----"); @@ -305,7 +356,7 @@ void DC_Outputs::output_channel_data(int channel,float minmun,float maxmum,int n label_ch3[3]->setText("-----"); label_ch3[4]->setText("-----"); ch_used[slot_no][ui->comboBox_ch_output->currentIndex()].used[2] = false; - vib_dc_output_ptr->dc_output[2].output_channel = -1; + dc_output[2].output_channel = -1; }else if(not_used == 3){ label_ch4[0]->setText("未使用"); label_ch4[1]->setText("-----"); @@ -313,7 +364,7 @@ void DC_Outputs::output_channel_data(int channel,float minmun,float maxmum,int n label_ch4[3]->setText("-----"); label_ch4[4]->setText("-----"); ch_used[slot_no][ui->comboBox_ch_output->currentIndex()].used[3] = false; - vib_dc_output_ptr->dc_output[3].output_channel = -1; + dc_output[3].output_channel = -1; } } } diff --git a/dc_outputs.h b/dc_outputs.h index e502964..f21e2b6 100644 --- a/dc_outputs.h +++ b/dc_outputs.h @@ -4,6 +4,7 @@ #include #include "data_config.h" #include "vibrationdata.h" +#include "high_speed_current_data.h" namespace Ui { class DC_Outputs; @@ -32,8 +33,10 @@ private slots: private: Ui::DC_Outputs *ui; std::shared_ptr vib_dc_output_ptr = nullptr; + std::shared_ptr hsc_dc_output_ptr = nullptr; void Init(); QString GetUnit(int com_index); + DCOutput *GetDcOutputArray(); QLabel *label_ch1[5]; QLabel *label_ch2[5]; QLabel *label_ch3[5]; diff --git a/high_speed_current.cpp b/high_speed_current.cpp new file mode 100644 index 0000000..967a392 --- /dev/null +++ b/high_speed_current.cpp @@ -0,0 +1,288 @@ +#include "high_speed_current.h" +#include "ui_high_speed_current.h" +#include "config_mgr.h" +#include + +HighSpeedCurrent::HighSpeedCurrent(int slot_no_,CardType cardtype,QWidget *parent) + : QWidget(parent) + , ui(new Ui::HighSpeedCurrent) +{ + ui->setupUi(this); + slot_no = slot_no_; + card_type = cardtype; + QString slot = QString("%1").arg(slot_no); + ui->label_slot->setText(slot); + Init(); +} + +HighSpeedCurrent::~HighSpeedCurrent() +{ + delete ui; +} + +void HighSpeedCurrent::UpdateData(std::shared_ptr ¤t_data){ + + current_data->card_type_ = kCardHighSpeedCurrent; + current_data->slot_ = slot_no; + current_data->version_ = 1; + for (int i = 0; i < CHANNEL_COUNT_SPEED; i++){ + if (i + 1 == 1) { + current_data->variables_[i].active = ui->checkBox_chan_1->isChecked(); + current_data->variables_[i].engineering_unit = ui->lineEdit_engineeringUnit->text(); + current_data->variables_[i].fullScalePosition = ui->lineEdit_fullScalePosition->text().toFloat(); + current_data->variables_[i].xfullScalePosition = ui->lineEdit_xfullScalePosition->text().toFloat(); + current_data->variables_[i].zeroScalePosition = ui->lineEdit_zeroScalePosition->text().toFloat(); + current_data->variables_[i].xzeroScalePosition = ui->lineEdit_xzeroScalePosition->text().toFloat(); + current_data->variables_[i].rectifier_funtion = ui->comboBox_rectifier_funtion->currentIndex(); + // -alarm + current_data->danger_high[i].level = ui->lineEdit_danger_high_level->text().toDouble(); + current_data->danger_high[i].hysteresis = ui->lineEdit_danger_high_hysteresis->text().toDouble(); + current_data->danger_high[i].delay = ui->lineEdit_danger_high_delay->text().toDouble(); + current_data->danger_high[i].enable = ui->checkBox_danger_high_enable->isChecked(); + current_data->danger_high[i].latch = ui->checkBox_danger_high_latch->isChecked(); + current_data->alert_high[i].level = ui->lineEdit_alert_high_level->text().toDouble(); + current_data->alert_high[i].hysteresis = ui->lineEdit_alert_high_hysteresis->text().toDouble(); + current_data->alert_high[i].delay = ui->lineEdit_alert_high_delay->text().toDouble(); + current_data->alert_high[i].enable = ui->checkBox_alert_high_enable->isChecked(); + current_data->alert_high[i].latch = ui->checkBox_alert_high_latch->isChecked(); + + }else if(i + 1 == 2){ + current_data->variables_[i].active = ui->checkBox_chan_2->isChecked(); + current_data->variables_[i].engineering_unit = ui->lineEdit_engineeringUnit_2->text(); + current_data->variables_[i].fullScalePosition = ui->lineEdit_fullScalePosition_2->text().toFloat(); + current_data->variables_[i].xfullScalePosition = ui->lineEdit_xfullScalePosition_2->text().toFloat(); + current_data->variables_[i].zeroScalePosition = ui->lineEdit_zeroScalePosition_2->text().toFloat(); + current_data->variables_[i].xzeroScalePosition = ui->lineEdit_xzeroScalePosition_2->text().toFloat(); + current_data->variables_[i].rectifier_funtion = ui->comboBox_rectifier_funtion_2->currentIndex(); + // -alarm + current_data->danger_high[i].level = ui->lineEdit_danger_high_level_2->text().toDouble(); + current_data->danger_high[i].hysteresis = ui->lineEdit_danger_high_hysteresis_2->text().toDouble(); + current_data->danger_high[i].delay = ui->lineEdit_danger_high_delay_2->text().toDouble(); + current_data->danger_high[i].enable = ui->checkBox_danger_high_enable_2->isChecked(); + current_data->danger_high[i].latch = ui->checkBox_danger_high_latch_2->isChecked(); + current_data->alert_high[i].level = ui->lineEdit_alert_high_level_2->text().toDouble(); + current_data->alert_high[i].hysteresis = ui->lineEdit_alert_high_hysteresis_2->text().toDouble(); + current_data->alert_high[i].delay = ui->lineEdit_alert_high_delay_2->text().toDouble(); + current_data->alert_high[i].enable = ui->checkBox_alert_high_enable_2->isChecked(); + current_data->alert_high[i].latch = ui->checkBox_alert_high_latch_2->isChecked(); + }else if(i + 1 == 3){ + current_data->variables_[i].active = ui->checkBox_chan_3->isChecked(); + current_data->variables_[i].engineering_unit = ui->lineEdit_engineeringUnit_3->text(); + current_data->variables_[i].fullScalePosition = ui->lineEdit_fullScalePosition_3->text().toFloat(); + current_data->variables_[i].xfullScalePosition = ui->lineEdit_xfullScalePosition_3->text().toFloat(); + current_data->variables_[i].zeroScalePosition = ui->lineEdit_zeroScalePosition_3->text().toFloat(); + current_data->variables_[i].xzeroScalePosition = ui->lineEdit_xzeroScalePosition_3->text().toFloat(); + current_data->variables_[i].rectifier_funtion = ui->comboBox_rectifier_funtion_3->currentIndex(); + // -alarm + current_data->danger_high[i].level = ui->lineEdit_danger_high_level_3->text().toDouble(); + current_data->danger_high[i].hysteresis = ui->lineEdit_danger_high_hysteresis_3->text().toDouble(); + current_data->danger_high[i].delay = ui->lineEdit_danger_high_delay_3->text().toDouble(); + current_data->danger_high[i].enable = ui->checkBox_danger_high_enable_3->isChecked(); + current_data->danger_high[i].latch = ui->checkBox_danger_high_latch_3->isChecked(); + current_data->alert_high[i].level = ui->lineEdit_alert_high_level_3->text().toDouble(); + current_data->alert_high[i].hysteresis = ui->lineEdit_alert_high_hysteresis_3->text().toDouble(); + current_data->alert_high[i].delay = ui->lineEdit_alert_high_delay_3->text().toDouble(); + current_data->alert_high[i].enable = ui->checkBox_alert_high_enable_3->isChecked(); + current_data->alert_high[i].latch = ui->checkBox_alert_high_latch_3->isChecked(); + }else if(i + 1 == 4){ + current_data->variables_[i].active = ui->checkBox_chan_4->isChecked(); + current_data->variables_[i].engineering_unit = ui->lineEdit_engineeringUnit_4->text(); + current_data->variables_[i].fullScalePosition = ui->lineEdit_fullScalePosition_4->text().toFloat(); + current_data->variables_[i].xfullScalePosition = ui->lineEdit_xfullScalePosition_4->text().toFloat(); + current_data->variables_[i].zeroScalePosition = ui->lineEdit_zeroScalePosition_4->text().toFloat(); + current_data->variables_[i].xzeroScalePosition = ui->lineEdit_xzeroScalePosition_4->text().toFloat(); + current_data->variables_[i].rectifier_funtion = ui->comboBox_rectifier_funtion_4->currentIndex(); + // -alarm + current_data->danger_high[i].level = ui->lineEdit_danger_high_level_4->text().toDouble(); + current_data->danger_high[i].hysteresis = ui->lineEdit_danger_high_hysteresis_4->text().toDouble(); + current_data->danger_high[i].delay = ui->lineEdit_danger_high_delay_4->text().toDouble(); + current_data->danger_high[i].enable = ui->checkBox_danger_high_enable_4->isChecked(); + current_data->danger_high[i].latch = ui->checkBox_danger_high_latch_4->isChecked(); + current_data->alert_high[i].level = ui->lineEdit_alert_high_level_4->text().toDouble(); + current_data->alert_high[i].hysteresis = ui->lineEdit_alert_high_hysteresis_4->text().toDouble(); + current_data->alert_high[i].delay = ui->lineEdit_alert_high_delay_4->text().toDouble(); + current_data->alert_high[i].enable = ui->checkBox_alert_high_enable_4->isChecked(); + current_data->alert_high[i].latch = ui->checkBox_alert_high_latch_4->isChecked(); + } + } +} + +void HighSpeedCurrent::Init() { + std::shared_ptr base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no); + if (base_ptr == nullptr) { + // do nothing or use template to init it. + std::shared_ptr current_data = std::make_shared(); + current_data->card_type_ = card_type; + current_data->slot_ = slot_no; + ConfigMgr::Instance()->AddCard(current_data); + UpdateData(current_data); + return; + } + std::shared_ptr current_data = std::dynamic_pointer_cast(base_ptr); + for (int i = 0; i < CHANNEL_COUNT_SPEED; i++) { + if (i + 1 == 1) { + ui->checkBox_chan_1->setChecked(current_data->variables_[i].active); + ui->lineEdit_engineeringUnit->setText(current_data->variables_[i].engineering_unit); + ui->lineEdit_fullScalePosition->setText(QString::number(current_data->variables_[i].fullScalePosition)); + ui->lineEdit_xfullScalePosition->setText(QString::number(current_data->variables_[i].xfullScalePosition)); + ui->lineEdit_zeroScalePosition->setText(QString::number(current_data->variables_[i].zeroScalePosition)); + ui->lineEdit_xzeroScalePosition->setText(QString::number(current_data->variables_[i].xzeroScalePosition)); + ui->comboBox_rectifier_funtion->setCurrentIndex(current_data->variables_[i].rectifier_funtion); + // -alarm + ui->lineEdit_danger_high_level->setText(QString::number(current_data->danger_high[i].level)); + ui->lineEdit_danger_high_hysteresis->setText(QString::number(current_data->danger_high[i].hysteresis)); + ui->lineEdit_danger_high_delay->setText(QString::number(current_data->danger_high[i].delay)); + ui->checkBox_danger_high_enable->setChecked(current_data->danger_high[i].enable); + ui->checkBox_danger_high_latch->setChecked(current_data->danger_high[i].latch); + + ui->lineEdit_alert_high_level->setText(QString::number(current_data->alert_high[i].level)); + ui->lineEdit_alert_high_hysteresis->setText(QString::number(current_data->alert_high[i].hysteresis)); + ui->lineEdit_alert_high_delay->setText(QString::number(current_data->alert_high[i].delay)); + ui->checkBox_alert_high_enable->setChecked(current_data->alert_high[i].enable); + ui->checkBox_alert_high_latch->setChecked(current_data->alert_high[i].latch); + }else if(i + 1 == 2){ + ui->checkBox_chan_2->setChecked(current_data->variables_[i].active); + ui->lineEdit_engineeringUnit_2->setText(current_data->variables_[i].engineering_unit); + ui->lineEdit_fullScalePosition_2->setText(QString::number(current_data->variables_[i].fullScalePosition)); + ui->lineEdit_xfullScalePosition_2->setText(QString::number(current_data->variables_[i].xfullScalePosition)); + ui->lineEdit_zeroScalePosition_2->setText(QString::number(current_data->variables_[i].zeroScalePosition)); + ui->lineEdit_xzeroScalePosition_2->setText(QString::number(current_data->variables_[i].xzeroScalePosition)); + ui->comboBox_rectifier_funtion_2->setCurrentIndex(current_data->variables_[i].rectifier_funtion); + // -alarm + ui->lineEdit_danger_high_level_2->setText(QString::number(current_data->danger_high[i].level)); + ui->lineEdit_danger_high_hysteresis_2->setText(QString::number(current_data->danger_high[i].hysteresis)); + ui->lineEdit_danger_high_delay_2->setText(QString::number(current_data->danger_high[i].delay)); + ui->checkBox_danger_high_enable_2->setChecked(current_data->danger_high[i].enable); + ui->checkBox_danger_high_latch_2->setChecked(current_data->danger_high[i].latch); + + ui->lineEdit_alert_high_level_2->setText(QString::number(current_data->alert_high[i].level)); + ui->lineEdit_alert_high_hysteresis_2->setText(QString::number(current_data->alert_high[i].hysteresis)); + ui->lineEdit_alert_high_delay_2->setText(QString::number(current_data->alert_high[i].delay)); + ui->checkBox_alert_high_enable_2->setChecked(current_data->alert_high[i].enable); + ui->checkBox_alert_high_latch_2->setChecked(current_data->alert_high[i].latch); + }else if(i + 1 == 3){ + ui->checkBox_chan_3->setChecked(current_data->variables_[i].active); + ui->lineEdit_engineeringUnit_3->setText(current_data->variables_[i].engineering_unit); + ui->lineEdit_fullScalePosition_3->setText(QString::number(current_data->variables_[i].fullScalePosition)); + ui->lineEdit_xfullScalePosition_3->setText(QString::number(current_data->variables_[i].xfullScalePosition)); + ui->lineEdit_zeroScalePosition_3->setText(QString::number(current_data->variables_[i].zeroScalePosition)); + ui->lineEdit_xzeroScalePosition_3->setText(QString::number(current_data->variables_[i].xzeroScalePosition)); + ui->comboBox_rectifier_funtion_3->setCurrentIndex(current_data->variables_[i].rectifier_funtion); + // -alarm + ui->lineEdit_danger_high_level_3->setText(QString::number(current_data->danger_high[i].level)); + ui->lineEdit_danger_high_hysteresis_3->setText(QString::number(current_data->danger_high[i].hysteresis)); + ui->lineEdit_danger_high_delay_3->setText(QString::number(current_data->danger_high[i].delay)); + ui->checkBox_danger_high_enable_3->setChecked(current_data->danger_high[i].enable); + ui->checkBox_danger_high_latch_3->setChecked(current_data->danger_high[i].latch); + + ui->lineEdit_alert_high_level_3->setText(QString::number(current_data->alert_high[i].level)); + ui->lineEdit_alert_high_hysteresis_3->setText(QString::number(current_data->alert_high[i].hysteresis)); + ui->lineEdit_alert_high_delay_3->setText(QString::number(current_data->alert_high[i].delay)); + ui->checkBox_alert_high_enable_3->setChecked(current_data->alert_high[i].enable); + ui->checkBox_alert_high_latch_3->setChecked(current_data->alert_high[i].latch); + }else if(i + 1 == 4){ + ui->checkBox_chan_4->setChecked(current_data->variables_[i].active); + ui->lineEdit_engineeringUnit_4->setText(current_data->variables_[i].engineering_unit); + ui->lineEdit_fullScalePosition_4->setText(QString::number(current_data->variables_[i].fullScalePosition)); + ui->lineEdit_xfullScalePosition_4->setText(QString::number(current_data->variables_[i].xfullScalePosition)); + ui->lineEdit_zeroScalePosition_4->setText(QString::number(current_data->variables_[i].zeroScalePosition)); + ui->lineEdit_xzeroScalePosition_4->setText(QString::number(current_data->variables_[i].xzeroScalePosition)); + ui->comboBox_rectifier_funtion_4->setCurrentIndex(current_data->variables_[i].rectifier_funtion); + // -alarm + ui->lineEdit_danger_high_level_4->setText(QString::number(current_data->danger_high[i].level)); + ui->lineEdit_danger_high_hysteresis_4->setText(QString::number(current_data->danger_high[i].hysteresis)); + ui->lineEdit_danger_high_delay_4->setText(QString::number(current_data->danger_high[i].delay)); + ui->checkBox_danger_high_enable_4->setChecked(current_data->danger_high[i].enable); + ui->checkBox_danger_high_latch_4->setChecked(current_data->danger_high[i].latch); + + ui->lineEdit_alert_high_level_4->setText(QString::number(current_data->alert_high[i].level)); + ui->lineEdit_alert_high_hysteresis_4->setText(QString::number(current_data->alert_high[i].hysteresis)); + ui->lineEdit_alert_high_delay_4->setText(QString::number(current_data->alert_high[i].delay)); + ui->checkBox_alert_high_enable_4->setChecked(current_data->alert_high[i].enable); + ui->checkBox_alert_high_latch_4->setChecked(current_data->alert_high[i].latch); + } + } + ui->comboBox_relative_number->setCurrentIndex(base_ptr->relative_number); + ui->comboBox_group->setCurrentIndex(base_ptr->group - 1); +} +void HighSpeedCurrent::on_lineEdit_engineeringUnit_editingFinished() +{ + QString str = ui->lineEdit_engineeringUnit->text(); + ui->label_unit1->setText(str); + ui->label_unit2->setText(str); +} + + +void HighSpeedCurrent::on_lineEdit_engineeringUnit_2_editingFinished() +{ + QString str = ui->lineEdit_engineeringUnit_2->text(); + ui->label_unit1_2->setText(str); + ui->label_unit2_2->setText(str); +} + + +void HighSpeedCurrent::on_lineEdit_engineeringUnit_3_editingFinished() +{ + QString str = ui->lineEdit_engineeringUnit_3->text(); + ui->label_unit1_3->setText(str); + ui->label_unit2_3->setText(str); +} + + +void HighSpeedCurrent::on_lineEdit_engineeringUnit_4_editingFinished() +{ + QString str = ui->lineEdit_engineeringUnit_4->text(); + ui->label_unit1_4->setText(str); + ui->label_unit2_4->setText(str); +} + + +void HighSpeedCurrent::on_pushButton_confirm_clicked() +{ + if(ui->lineEdit_fullScalePosition->text() == "" || + ui->lineEdit_xfullScalePosition->text() == "" || + ui->lineEdit_zeroScalePosition->text() == "" || + ui->lineEdit_xzeroScalePosition->text() == ""){ + QMessageBox::information(this, QStringLiteral("提示"), "请填写测量上下限数据!"); + return; + } + std::shared_ptr base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no); + if (base_ptr == nullptr) { + qCritical() << " should not be here"; + return; + } + for (int var = 1; var < SLOT_NUM; var ++) { + if(ui->comboBox_relative_number->currentIndex() != 0){ + std::shared_ptr slot_base_ptr = ConfigMgr::Instance()->GetSlotPtr(var); + if(slot_base_ptr == nullptr || slot_base_ptr->card_type_ != kCardHighSpeedCurrent) + continue; + if(var == slot_no) + continue; + qDebug() << "relative_number" << var << slot_base_ptr->relative_number; + if(slot_base_ptr->relative_number == ui->comboBox_relative_number->currentIndex() && + slot_base_ptr->card_type_ != kCardHighSpeedCurrent){ + QMessageBox::information(this, QStringLiteral("提示"), "板卡相对编号重复!"); + return; + } + } + } + base_ptr->relative_number = ui->comboBox_relative_number->currentIndex(); + base_ptr->group = ui->comboBox_group->currentIndex() + 1; + + std::shared_ptr current_data = std::dynamic_pointer_cast(base_ptr); + UpdateData(current_data); + this->close(); +} + + +void HighSpeedCurrent::on_pushButton_cancel_clicked() +{ + this->close(); +} + + +void HighSpeedCurrent::on_pushButton_copy_channel_clicked() +{ + +} + diff --git a/high_speed_current.h b/high_speed_current.h new file mode 100644 index 0000000..e419fe5 --- /dev/null +++ b/high_speed_current.h @@ -0,0 +1,43 @@ +#ifndef HIGH_SPEED_CURRENT_H +#define HIGH_SPEED_CURRENT_H + +#include +#include "data_config.h" +#include "high_speed_current_data.h" +#include + +namespace Ui { +class HighSpeedCurrent; +} + +class HighSpeedCurrent : public QWidget +{ + Q_OBJECT + +public: + explicit HighSpeedCurrent(int slot_no_,CardType cardtype,QWidget *parent = nullptr); + ~HighSpeedCurrent(); + int slot_no; + CardType card_type; +private slots: + void on_lineEdit_engineeringUnit_editingFinished(); + + void on_lineEdit_engineeringUnit_2_editingFinished(); + + void on_lineEdit_engineeringUnit_3_editingFinished(); + + void on_lineEdit_engineeringUnit_4_editingFinished(); + + void on_pushButton_confirm_clicked(); + + void on_pushButton_cancel_clicked(); + + void on_pushButton_copy_channel_clicked(); + +private: + Ui::HighSpeedCurrent *ui; + void UpdateData(std::shared_ptr ¤t_data); + void Init(); +}; + +#endif // HIGH_SPEED_CURRENT_H diff --git a/high_speed_current.ui b/high_speed_current.ui new file mode 100644 index 0000000..ef45b10 --- /dev/null +++ b/high_speed_current.ui @@ -0,0 +1,3451 @@ + + + HighSpeedCurrent + + + + 0 + 0 + 803 + 561 + + + + Form + + + + + + + + + + + 槽位号: + + + + + + + 7 + + + + + + + + + + + 分组: + + + + + + + + 50 + 0 + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + + + + + + + + 相对编号: + + + + + + + + 50 + 0 + + + + + 0 + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + 7 + + + + + 8 + + + + + 9 + + + + + 10 + + + + + 11 + + + + + 12 + + + + + 13 + + + + + 14 + + + + + 15 + + + + + + + + + + Qt::Horizontal + + + + 604 + 20 + + + + + + + + + + + + + + + + 通道1激活 + + + true + + + + + + + 通道2激活 + + + true + + + + + + + 通道3激活 + + + true + + + + + + + 通道4激活 + + + true + + + + + + + + + 0 + + + + 通道1 + + + + + + + + + + 10 + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 工程单位: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 278 + 0 + + + + + 278 + 16777215 + + + + mA + + + + + + + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 测量上限: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 40 + 0 + + + + + 40 + 16777215 + + + + mA + + + + + + + + 30 + 0 + + + + + 30 + 16777215 + + + + - + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 70 + 0 + + + + + 70 + 16777215 + + + + mA + + + + + + + + + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 测量下限: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 40 + 0 + + + + + 40 + 16777215 + + + + mA + + + + + + + + 30 + 0 + + + + + 30 + 16777215 + + + + - + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 70 + 0 + + + + + 70 + 16777215 + + + + mA + + + + + + + + + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 整流器: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 150 + 25 + + + + + 16777215 + 25 + + + + + True Peak + + + + + True Peak-To-Peak + + + + + RMS Scaled Peak + + + + + RMS Scaled Peak-To-Peak + + + + + AVG + + + + + RMS Scaled AVG + + + + + RMS + + + + + MIN + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 警报 + + + + + + 50 + + + 10 + + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + 危险 + 高 + + + + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + 警报 + 高 + + + + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + 等级 + + + Qt::AlignCenter + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + 回差 + + + Qt::AlignCenter + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + 延时 +(S) + + + Qt::AlignCenter + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + + + + + 16777215 + 20 + + + + Qt::LeftToRight + + + 使能 + + + Qt::AlignCenter + + + + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + Qt::LeftToRight + + + + + + true + + + + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + + + + + + + + + + + + + 16777215 + 20 + + + + 锁存 + + + Qt::AlignCenter + + + + + + + + 0 + 25 + + + + + + + + + + + + 0 + 25 + + + + + + + + + + + + + Qt::Horizontal + + + + 150 + 20 + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 通道2 + + + + + + + + + + 10 + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 工程单位: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 278 + 0 + + + + + 278 + 16777215 + + + + mA + + + + + + + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 测量上限: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 40 + 0 + + + + + 40 + 16777215 + + + + mA + + + + + + + + 30 + 0 + + + + + 30 + 16777215 + + + + - + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 70 + 0 + + + + + 70 + 16777215 + + + + mA + + + + + + + + + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 测量下限: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 40 + 0 + + + + + 40 + 16777215 + + + + mA + + + + + + + + 30 + 0 + + + + + 30 + 16777215 + + + + - + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 70 + 0 + + + + + 70 + 16777215 + + + + mA + + + + + + + + + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 整流器: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 150 + 25 + + + + + 16777215 + 25 + + + + + True Peak + + + + + True Peak-To-Peak + + + + + RMS Scaled Peak + + + + + RMS Scaled Peak-To-Peak + + + + + AVG + + + + + RMS Scaled AVG + + + + + RMS + + + + + MIN + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 警报 + + + + + + 50 + + + 10 + + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + 危险 + 高 + + + + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + 警报 + 高 + + + + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + 等级 + + + Qt::AlignCenter + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + 回差 + + + Qt::AlignCenter + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + 延时 +(S) + + + Qt::AlignCenter + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + + + + + 16777215 + 20 + + + + Qt::LeftToRight + + + 使能 + + + Qt::AlignCenter + + + + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + Qt::LeftToRight + + + + + + true + + + + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + + + + + + + + + + + + + 16777215 + 20 + + + + 锁存 + + + Qt::AlignCenter + + + + + + + + 0 + 25 + + + + + + + + + + + + 0 + 25 + + + + + + + + + + + + + Qt::Horizontal + + + + 150 + 20 + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 通道3 + + + + + + + + + + 10 + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 工程单位: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 278 + 0 + + + + + 278 + 16777215 + + + + mA + + + + + + + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 测量上限: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 40 + 0 + + + + + 40 + 16777215 + + + + mA + + + + + + + + 30 + 0 + + + + + 30 + 16777215 + + + + - + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 70 + 0 + + + + + 70 + 16777215 + + + + mA + + + + + + + + + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 测量下限: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 40 + 0 + + + + + 40 + 16777215 + + + + mA + + + + + + + + 30 + 0 + + + + + 30 + 16777215 + + + + - + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 70 + 0 + + + + + 70 + 16777215 + + + + mA + + + + + + + + + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 整流器: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 150 + 25 + + + + + 16777215 + 25 + + + + + True Peak + + + + + True Peak-To-Peak + + + + + RMS Scaled Peak + + + + + RMS Scaled Peak-To-Peak + + + + + AVG + + + + + RMS Scaled AVG + + + + + RMS + + + + + MIN + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 警报 + + + + + + 50 + + + 10 + + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + 危险 + 高 + + + + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + 警报 + 高 + + + + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + 等级 + + + Qt::AlignCenter + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + 回差 + + + Qt::AlignCenter + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + 延时 +(S) + + + Qt::AlignCenter + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + + + + + 16777215 + 20 + + + + Qt::LeftToRight + + + 使能 + + + Qt::AlignCenter + + + + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + Qt::LeftToRight + + + + + + true + + + + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + + + + + + + + + + + + + 16777215 + 20 + + + + 锁存 + + + Qt::AlignCenter + + + + + + + + 0 + 25 + + + + + + + + + + + + 0 + 25 + + + + + + + + + + + + + Qt::Horizontal + + + + 150 + 20 + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 通道4 + + + + + + + + + + 10 + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 工程单位: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 278 + 0 + + + + + 278 + 16777215 + + + + mA + + + + + + + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 测量上限: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 40 + 0 + + + + + 40 + 16777215 + + + + mA + + + + + + + + 30 + 0 + + + + + 30 + 16777215 + + + + - + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 70 + 0 + + + + + 70 + 16777215 + + + + mA + + + + + + + + + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 测量下限: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 40 + 0 + + + + + 40 + 16777215 + + + + mA + + + + + + + + 30 + 0 + + + + + 30 + 16777215 + + + + - + + + + + + + + 60 + 0 + + + + + 60 + 16777215 + + + + + + + + + 70 + 0 + + + + + 70 + 16777215 + + + + mA + + + + + + + + + + + + + + 80 + 0 + + + + + 80 + 16777215 + + + + 整流器: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 150 + 25 + + + + + 16777215 + 25 + + + + + True Peak + + + + + True Peak-To-Peak + + + + + RMS Scaled Peak + + + + + RMS Scaled Peak-To-Peak + + + + + AVG + + + + + RMS Scaled AVG + + + + + RMS + + + + + MIN + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 警报 + + + + + + 50 + + + 10 + + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + 危险 + 高 + + + + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + 警报 + 高 + + + + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + 等级 + + + Qt::AlignCenter + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + 回差 + + + Qt::AlignCenter + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + + + + + 0 + 30 + + + + + 16777215 + 30 + + + + 延时 +(S) + + + Qt::AlignCenter + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + 50 + 25 + + + + + 16777215 + 25 + + + + 0 + + + + + + + + + + + + 16777215 + 20 + + + + Qt::LeftToRight + + + 使能 + + + Qt::AlignCenter + + + + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + Qt::LeftToRight + + + + + + true + + + + + + + + 0 + 25 + + + + + 16777215 + 25 + + + + + + + + + + + + + + + + 16777215 + 20 + + + + 锁存 + + + Qt::AlignCenter + + + + + + + + 0 + 25 + + + + + + + + + + + + 0 + 25 + + + + + + + + + + + + + Qt::Horizontal + + + + 150 + 20 + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + + + + + + 100 + 35 + + + + 确 定 + + + + + + + + 100 + 35 + + + + 取 消 + + + + + + + + 100 + 35 + + + + 复制通道 + + + + + + + + + + + + + diff --git a/high_speed_current_data.cpp b/high_speed_current_data.cpp new file mode 100644 index 0000000..39704c4 --- /dev/null +++ b/high_speed_current_data.cpp @@ -0,0 +1,3 @@ +#include "high_speed_current_data.h" + +HighSpeedCurrentData::HighSpeedCurrentData() {} diff --git a/high_speed_current_data.h b/high_speed_current_data.h new file mode 100644 index 0000000..f37f2e7 --- /dev/null +++ b/high_speed_current_data.h @@ -0,0 +1,16 @@ +#ifndef HIGH_SPEED_CURRENT_DATA_H +#define HIGH_SPEED_CURRENT_DATA_H + +#include "cardbase.h" + +class HighSpeedCurrentData : public CardBase +{ +public: + HighSpeedCurrentData(); + HighSpeedCurrentVariables variables_[4]; + AlarmDangerHigh danger_high[CHANNEL_COUNT_SPEED]; + AlarmAlertHigh alert_high[CHANNEL_COUNT_SPEED]; + DCOutput dc_output[CHANNEL_COUNT]; +}; + +#endif // HIGH_SPEED_CURRENT_DATA_H diff --git a/mainwindow.cpp b/mainwindow.cpp index cbb97dd..7c045af 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -21,7 +21,6 @@ #include "vibrationdata.h" #include "connect.h" #include "tmrrelayassociation.h" -#include "setpoint_tachometer.h" #include "pointname.h" #include "ethconfig.h" #include "macconfig.h" @@ -33,6 +32,7 @@ #include #include #include "channel_crc.h" +#include "high_speed_current.h" QString g_strServerIp; QString g_version; @@ -124,7 +124,7 @@ MainWindow::MainWindow(QWidget *parent) //qInstallMessageHandler(messageHandler); #endif QDate buildDate = QLocale( QLocale::English ).toDate( QString(__DATE__).replace(" ", " 0"), "MMM dd yyyy"); - QString Version = "V1.0_" + buildDate.toString("yyyyMMdd") + "_129d"; + QString Version = "V1.0_" + buildDate.toString("yyyyMMdd") + "_1704"; ui->label_version->setText(Version); } @@ -196,6 +196,7 @@ void MainWindow::createMenu(const QString &rootTitle, QPushButton *parent) { QMenu *monitors = new QMenu("监视器", mainMenu); QMenu *relays = new QMenu("/DOM810 继电器模块", mainMenu); QMenu *keyphasor = new QMenu("/KPM834 键相模块", mainMenu); + // 创建第二层子菜单:/HAM824 振动板卡 QMenu *proximitor_menu = new QMenu("/HAM824 振动板卡", monitors); QMenu *rpm_menu = new QMenu("/OPM844 转速板卡", monitors); @@ -224,6 +225,8 @@ void MainWindow::createMenu(const QString &rootTitle, QPushButton *parent) { mainMenu->addMenu(monitors); // 将第一层加入主菜单 mainMenu->addMenu(relays); mainMenu->addMenu(keyphasor); + QAction *high_speed_current = monitors->addAction("/HAM851 高速电流卡"); + high_speed_current->setData(kCardHighSpeedCurrent); QAction *reset = mainMenu->addAction("重置模块"); mainMenu->addSeparator(); QAction *upgrade = mainMenu->addAction("升级固件"); @@ -267,7 +270,7 @@ void MainWindow::createMenu(const QString &rootTitle, QPushButton *parent) { QObject::connect(get_card_processID, &QAction::triggered, this, &MainWindow::onMenuActionTriggered); QObject::connect(copy_sub_card, &QAction::triggered, this, &MainWindow::onMenuActionTriggered); QObject::connect(move_sub_card, &QAction::triggered, this, &MainWindow::onMenuActionTriggered); - + QObject::connect(high_speed_current, &QAction::triggered, this, &MainWindow::onMenuActionTriggered); } void MainWindow::createMenuSet(const QString &rootTitle, QPushButton *parent) { @@ -329,6 +332,8 @@ void MainWindow::onMenuActionTriggered() { chan_display = "振动"; } else if (slot_type == "OPM844") { chan_display = "转速"; + } else if (slot_type == "HAM851") { + chan_display = "高速\n电流"; } if (card_type == kCardRelayTMRPrimary && (ConfigMgr::Instance()->card_type_[button_id - 1] != kCardNone || @@ -376,11 +381,16 @@ void MainWindow::onMenuActionTriggered() { ConfigMgr::Instance()->LaodTemplate(":/config/template_vib.json",button_id); } - }else if ((card_type == kCardVibSingle || card_type == kCardSpeedSingle || + }else if ((card_type == kCardVibSingle || card_type == kCardSpeedSingle || card_type == kCardHighSpeedCurrent || card_type == kCardKeyphaseSingle || card_type == kCardRelaySingle || card_type == kCardRelaySingleNOK) && ConfigMgr::Instance()->card_type_[button_id - 1] != kCardNone) { QMessageBox::information(this, QStringLiteral("提示"), "不要重叠单板卡配置,请在创建新配置之前移除现有的配置!"); return; + }else if(card_type == kCardHighSpeedCurrent){ + map_slot_config[button_id].slot_type = slot_type; + map_slot_config[button_id].card_type = card_type; + button->setText(chan_display); + ConfigMgr::Instance()->card_type_[button_id - 1] = card_type; } if (action->text() == "重置模块") { QMessageBox *box = new QMessageBox(QMessageBox::Question, "提示", "是否重置板卡?", QMessageBox::Yes | QMessageBox::No, this); @@ -423,7 +433,8 @@ void MainWindow::onMenuActionTriggered() { }else if (ConfigMgr::Instance()->card_type_[button_id - 1] == kCardVibSingle || ConfigMgr::Instance()->card_type_[button_id - 1] == kCardSpeedSingle || - ConfigMgr::Instance()->card_type_[button_id - 1] == kCardKeyphaseSingle) { + ConfigMgr::Instance()->card_type_[button_id - 1] == kCardKeyphaseSingle || + ConfigMgr::Instance()->card_type_[button_id - 1] == kCardHighSpeedCurrent ) { ConfigMgr::Instance()->card_type_[button_id - 1] = kCardNone; map_slot_config[button_id].slot_btn->setText(""); std::shared_ptr base_ptr = ConfigMgr::Instance()->GetSlotPtr(button_id); @@ -511,6 +522,10 @@ void MainWindow::OnButtonGroup(QAbstractButton *slot_btn) { Tachometer *tachometer = new Tachometer(button_id,map_slot_config[button_id].card_type); tachometer->setWindowModality(Qt::ApplicationModal); tachometer->show(); + } else if (slot_config.slot_type == "HAM851") { // 高速电流模块 + HighSpeedCurrent *high_speed_current = new HighSpeedCurrent(button_id,map_slot_config[button_id].card_type); + high_speed_current->setWindowModality(Qt::ApplicationModal); + high_speed_current->show(); } return; } @@ -540,6 +555,11 @@ void MainWindow::OnButtonGroup(QAbstractButton *slot_btn) { single_relay->show(); break; } + case kCardHighSpeedCurrent:{ + HighSpeedCurrent *high_speed_current = new HighSpeedCurrent(button_id,map_slot_config[button_id].card_type); + high_speed_current->setWindowModality(Qt::ApplicationModal); + high_speed_current->show(); + }break; case kCardRelayTMRPrimary:{ TMRRelayAssociation *single_tmr_relay = new TMRRelayAssociation(button_id,map_slot_config[button_id].card_type); single_tmr_relay->setWindowModality(Qt::ApplicationModal); @@ -559,23 +579,14 @@ void MainWindow::OnButtonGroup(QAbstractButton *slot_btn) { if(base_ptr == nullptr) return; switch(base_ptr->card_type_){ - case kCardVibSingle:{ + case kCardVibSingle: + case kCardHighSpeedCurrent: + { QString object_name = slot_btn->objectName(); int button_id = object_name.right(object_name.length() - 15).toInt(); DC_Outputs *dc_output = new DC_Outputs(button_id,ConfigMgr::Instance()->card_type_[button_id - 1]); dc_output->setWindowModality(Qt::ApplicationModal); dc_output->show(); - // Setpoint *setpoint = new Setpoint(button_id,ConfigMgr::Instance()->card_type_[button_id - 1]); - // setpoint->setWindowModality(Qt::ApplicationModal); - // setpoint->show(); - break; - } - case kCardSpeedSingle:{ - QString object_name = slot_btn->objectName(); - int button_id = object_name.right(object_name.length() - 15).toInt(); - Setpoint_Tachometer *setpoint_tachometer = new Setpoint_Tachometer(button_id,ConfigMgr::Instance()->card_type_[button_id - 1]); - setpoint_tachometer->setWindowModality(Qt::ApplicationModal); - setpoint_tachometer->show(); break; } } @@ -744,6 +755,10 @@ void MainWindow::on_pushButton_open_clicked() { buttonList[i + 1]->setText("转速"); break; } + case kCardHighSpeedCurrent:{ + buttonList[i + 1]->setText("高速\n电流"); + break; + } case kCardRelaySingle: case kCardRelaySingleNOK: case kCardRelayTMRBackup: diff --git a/mainwindow.ui b/mainwindow.ui index c91f441..6528b5b 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -7,7 +7,7 @@ 0 0 1129 - 561 + 564 @@ -367,7 +367,7 @@ - + 0 Qt::AlignCenter @@ -723,25 +723,62 @@ - + 50 - 0 + 280 16777215 - 16777215 + 280 - - - - - Qt::AlignCenter - + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 50 + 140 + + + + 电源1 + + + + + + + + 50 + 140 + + + + 电源2 + + + + @@ -1090,7 +1127,7 @@ 0 0 1129 - 23 + 21 diff --git a/tachometer.h b/tachometer.h index 9d45ced..2d138c1 100644 --- a/tachometer.h +++ b/tachometer.h @@ -32,9 +32,6 @@ class Tachometer : public QDialog { private: Ui::Tachometer *ui; void UpdateData(std::shared_ptr &speed_data); -// Tachometer_Variables tachometer_variables[4]; - -// void readJsonFile(const QString &filePath); void Init(); };