diff --git a/BatteryMonitor.pro b/BatteryMonitor.pro index 79cc276..3c4fd26 100644 --- a/BatteryMonitor.pro +++ b/BatteryMonitor.pro @@ -25,7 +25,8 @@ SOURCES += \ modbusrtu.cpp \ proto/battery.pb.cc \ appserial.cpp \ - proto/battery_english.pb.cc + proto/battery_english.pb.cc \ + upgradeicon.cpp HEADERS += \ appproto.h \ @@ -46,7 +47,8 @@ HEADERS += \ modbusrtu.h \ proto/battery.pb.h \ appserial.h \ - proto/battery_english.pb.h + proto/battery_english.pb.h \ + upgradeicon.h FORMS += \ dialoglogin.ui \ diff --git a/Language/BatteryMonitor_ENG.qm b/Language/BatteryMonitor_ENG.qm index d37f582..58d6f64 100644 Binary files a/Language/BatteryMonitor_ENG.qm and b/Language/BatteryMonitor_ENG.qm differ diff --git a/custom/delegate.cpp b/custom/delegate.cpp index 5c65f0a..c0a5568 100644 --- a/custom/delegate.cpp +++ b/custom/delegate.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include Delegate::Delegate(QObject *parent): QStyledItemDelegate(parent) { @@ -81,9 +82,16 @@ QWidget *Delegate::createEditor(QWidget *parent, const QStyleOptionViewItem &/*o else if (delegateType == "QLineEdit") { QLineEdit *lineEidt = new QLineEdit(parent); + // lineEidt->setReadOnly(true); editor = lineEidt; connect(lineEidt, SIGNAL(textChanged(QString)), this, SLOT(on_valueChanged(QString))); } + else if (delegateType == "QLabel") + { + QLabel *label = new QLabel(parent); + editor = label; + connect(label, SIGNAL(textChanged(QString)), this, SLOT(on_valueChanged(QString))); + } return editor; } @@ -126,6 +134,11 @@ void Delegate::setEditorData(QWidget *editor, const QModelIndex &index) const QLineEdit *lineEidt = static_cast(editor); lineEidt->setText(value.toString()); } + else if (delegateType == "QLabel") + { + QLabel *label = static_cast(editor); + label->setText(value.toString()); + } else { QStyledItemDelegate::setEditorData(editor, index); @@ -171,6 +184,11 @@ void Delegate::setModelData(QWidget *editor, QAbstractItemModel *model, QLineEdit *lineEidt = static_cast(editor); value = lineEidt->text(); } + else if (delegateType == "QLabel") + { + QLabel *label = static_cast(editor); + value = label->text(); + } model->setData(index, value, Qt::EditRole); } @@ -208,6 +226,7 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, cons drawLineEdit(painter, option, index); } + }//if else { diff --git a/dialoglogin.cpp b/dialoglogin.cpp index 391621d..20eec55 100644 --- a/dialoglogin.cpp +++ b/dialoglogin.cpp @@ -105,6 +105,16 @@ void DialogLogin::init() //主窗口接受语言选择number的信号与槽的连接 connect(this, &DialogLogin::sendLanNumberSignals, m_MainWindow, &MainWindow::getLanNumberSlot); + //故障解析的信号与槽 + connect(m_ModbusRTU, &ModbusRTU::sig_showFault, m_MainWindow, &MainWindow::slot_pageHomeFault); + + //电池界面中,点击bmu发送对应的数据 + // connect(m_MainWindow, &MainWindow::read_regs_input_signals_vol, m_ModbusRTU, &ModbusRTU::read_regs_input_slot_vol); + // connect(m_MainWindow, &MainWindow::read_regs_input_signals_temp, m_ModbusRTU, &ModbusRTU::read_regs_input_slot_temp); + + //上面的方法太low了,直接将row的索引传到modbus的线程中去 + connect(m_MainWindow, &MainWindow::row_of_bmus_index, m_ModbusRTU, &ModbusRTU::change_BMUIndex_slot); + // QMetaObject::invokeMethod(m_ModbusRTU,"read_regs_slot",Qt::QueuedConnection); // connect(m_ModbusRTU, &ModbusRTU::sig_readMoveToThread, m_ModbusRTU, &ModbusRTU::read_regs_slot, Qt::QueuedConnection); diff --git a/mainwindow.cpp b/mainwindow.cpp index 5864684..883533a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -37,6 +37,7 @@ MainWindow::MainWindow(QWidget *parent) ui->setupUi(this); this->init(); this->setMenuStyle(); + trubleListInit(); m_AppProto = new AppProto; m_AppProto_English = new Appproto_English; connect(ui->tabWidget_paraset, SIGNAL(currentChanged(int)), this, SLOT(on_tabChanged(int))); @@ -108,6 +109,12 @@ void MainWindow::init() // ui->retranslateUi(this); // }); + //历史报警标志位初始化为0 + for (int i = 0; i < 56; i++) + { + trouble_list_flag.append(0); + } + /* 状态栏设置 */ statusBarConnectedIcon = new QLabel(); statusBarConnectedType = new QLabel(); @@ -214,11 +221,12 @@ void MainWindow::init() // ui->widget_BCUSelect->setStyleSheet("background-color: #FFFFFF;"); ui->pageHome->setStyleSheet("background-color: #FFFFFF;"); ui->comboBoxBCUSelect->setStyleSheet("background-color: #F8F8FF;"); + ui->pageBatteryStackWidget->setStyleSheet("background-color: #FFFFFF;"); // ui->comboBoxBCUSelect->setStyleSheet("QComboBox QAbstractItemView { background-color: #f0f0f0;}"); - ui->BCU_DIDO->setStyleSheet("background-color: #FFFFFF;"); - ui->BCU_alarm->setStyleSheet("background-color: #FFFFFF;"); + // ui->BCU_DIDO->setStyleSheet("background-color: #FFFFFF;"); + // ui->BCU_alarm->setStyleSheet("background-color: #FFFFFF;"); ui->BCU_statisInfo->setStyleSheet("background-color: #FFFFFF;"); ui->BCU_sysInfo->setStyleSheet("background-color: #FFFFFF;"); @@ -274,227 +282,227 @@ void MainWindow::init() // ui->color_short_circuit->setStyleSheet("background-color: rgb(255, 165, 0);"); // ui->groupBox_color_sgl->setStyleSheet("QGroupBox { border: none; }"); - ui->label_all_overVol->setStyleSheet("QLabel{" + ui->label_trouble_1->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_all_underVol->setStyleSheet("QLabel{" + ui->label_trouble_2->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_sgl_overVol->setStyleSheet("QLabel{" + ui->label_trouble_3->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_sgl_underVol->setStyleSheet("QLabel{" + ui->label_trouble_4->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_sgl_overTempt->setStyleSheet("QLabel{" + ui->label_trouble_5->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_sgl_underTempt->setStyleSheet("QLabel{" + ui->label_trouble_6->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_over_diff_press->setStyleSheet("QLabel{" + ui->label_trouble_7->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_over_diff_tempt->setStyleSheet("QLabel{" + ui->label_trouble_8->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_over_curr->setStyleSheet("QLabel{" + ui->label_trouble_9->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_high_vol_trouble->setStyleSheet("QLabel{" + ui->label_trouble_10->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_mas_slave_com->setStyleSheet("QLabel{" + ui->label_trouble_11->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_sgl_vol_bar->setStyleSheet("QLabel{" + ui->label_trouble_12->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_sgl_tem_bar->setStyleSheet("QLabel{" + ui->label_trouble_13->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_over_soc->setStyleSheet("QLabel{" + ui->label_trouble_14->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_under_soc->setStyleSheet("QLabel{" + ui->label_trouble_15->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_insu_leak->setStyleSheet("QLabel{" + ui->label_trouble_16->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_adhesion->setStyleSheet("QLabel{" + ui->label_trouble_17->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_prechg_status->setStyleSheet("QLabel{" + ui->label_trouble_18->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_over_supply->setStyleSheet("QLabel{" + ui->label_trouble_19->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_under_supply->setStyleSheet("QLabel{" + ui->label_trouble_20->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_T1_highTempt->setStyleSheet("QLabel{" + ui->label_trouble_21->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_T1_underTempt->setStyleSheet("QLabel{" + ui->label_trouble_22->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_T2_highTempt->setStyleSheet("QLabel{" + ui->label_trouble_23->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_T2_underTempt->setStyleSheet("QLabel{" + ui->label_trouble_24->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_balance_overTempt->setStyleSheet("QLabel{" + ui->label_trouble_25->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_reserve1->setStyleSheet("QLabel{" + ui->label_trouble_26->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_highVol_lock->setStyleSheet("QLabel{" + ui->label_trouble_27->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_curr_trouble->setStyleSheet("QLabel{" + ui->label_trouble_28->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_pole_highTempt->setStyleSheet("QLabel{" + ui->label_trouble_29->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_reserve2->setStyleSheet("QLabel{" + ui->label_trouble_30->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_reserve3->setStyleSheet("QLabel{" + ui->label_trouble_31->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_PCS_status->setStyleSheet("QLabel{" + ui->label_trouble_32->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_EMS_status->setStyleSheet("QLabel{" + ui->label_trouble_33->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_fuse_status->setStyleSheet("QLabel{" + ui->label_trouble_34->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_ang_fe_status->setStyleSheet("QLabel{" + ui->label_trouble_35->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_EEPROM_status->setStyleSheet("QLabel{" + ui->label_trouble_36->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_RTC_status->setStyleSheet("QLabel{" + ui->label_trouble_37->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_ADC_status->setStyleSheet("QLabel{" + ui->label_trouble_38->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_SD_status->setStyleSheet("QLabel{" + ui->label_trouble_39->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_feedback_wrong->setStyleSheet("QLabel{" + ui->label_trouble_40->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_heating_overFast->setStyleSheet("QLabel{" + ui->label_trouble_41->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_limit_wrong->setStyleSheet("QLabel{" + ui->label_trouble_42->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_open_cir_wrong->setStyleSheet("QLabel{" + ui->label_trouble_43->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_epo_wrong->setStyleSheet("QLabel{" + ui->label_trouble_44->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_fire_wrong->setStyleSheet("QLabel{" + ui->label_trouble_45->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_con_ins_overtime->setStyleSheet("QLabel{" + ui->label_trouble_46->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_reserve4->setStyleSheet("QLabel{" + ui->label_trouble_47->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_hot_out_of_con->setStyleSheet("QLabel{" + ui->label_trouble_48->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_bat_box_overVol->setStyleSheet("QLabel{" + ui->label_trouble_49->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_bat_box_underVol->setStyleSheet("QLabel{" + ui->label_trouble_50->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_ligntning_wrong->setStyleSheet("QLabel{" + ui->label_trouble_51->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_AC_wrong->setStyleSheet("QLabel{" + ui->label_trouble_52->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_UPS_wrong->setStyleSheet("QLabel{" + ui->label_trouble_53->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_water_flooding_wrong->setStyleSheet("QLabel{" + ui->label_trouble_54->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_guard_worng->setStyleSheet("QLabel{" + ui->label_trouble_55->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); - ui->label_gas_det_wrong->setStyleSheet("QLabel{" + ui->label_trouble_56->setStyleSheet("QLabel{" "background-image: url(:/Image/trouble-background-default.png);" "border: 1px solid gray;" "}"); @@ -1054,110 +1062,8 @@ void MainWindow::setMenuStyle() "background-position: center;" "background-color: rgba(255, 255, 255, 0);" "}"); - - // ui->btnRecord->setStyleSheet("#btnRecord{" - // "background-image: url(:/Image/record-out-black.png);" - // "background-repeat: no-repeat;" - // "background-position: center;" - // "background-color: rgba(255, 255, 255, 0);" - // "}" - // "#btnRecord::hover{" - // "background-image: url(:/Image/record-out-gray.png);" - // "background-repeat: no-repeat;" - // "background-position: center;" - // "background-color: rgba(255, 255, 255, 0);" - // "}"); }); - // connect(ui->btnRecord, &QPushButton::pressed, this, [=]{ - // ui->stackedWidget->setCurrentWidget(ui->pageRecord); - // ui->btnRecord->setStyleSheet("#btnRecord{" - // "background-image: url(:/Image/record-out-green.png);" - // "background-repeat: no-repeat;" - // "background-position: center;" - // "background-color: rgba(255, 255, 255, 0);" - // "}"); - - // ui->btnHome->setStyleSheet("#btnHome{" - // "background-image: url(:/Image/home.png);" - // "background-repeat: no-repeat;" - // "background-position: center;" - // "background-color: rgba(255, 255, 255, 0);" - // "}" - // "#btnHome::hover{" - // "background-image: url(:/Image/home1.png);" - // "background-repeat: no-repeat;" - // "background-position: center;" - // "background-color: rgba(255, 255, 255, 0);" - // "}"); - - // ui->btnBattery->setStyleSheet("#btnBattery{" - // "background-image: url(:/Image/battery.png);" - // "background-repeat: no-repeat;" - // "background-position: center;" - // "background-color: rgba(255, 255, 255, 0);" - // "}" - // "#btnBattery::hover{" - // "background-image: url(:/Image/battery1.png);" - // "background-repeat: no-repeat;" - // "background-position: center;" - // "background-color: rgba(255, 255, 255, 0);" - // "}" - // ); - - // ui->btnParaSet->setStyleSheet("#btnParaSet{" - // "background-image: url(:/Image/paraSet.png);" - // "background-repeat: no-repeat;" - // "background-position: center;" - // "background-color: rgba(255, 255, 255, 0);" - // "}" - // "#btnParaSet::hover{" - // "background-image: url(:/Image/paraSet1.png);" - // "background-repeat: no-repeat;" - // "background-position: center;" - // "background-color: rgba(255, 255, 255, 0);" - // "}"); - - // ui->btnDebug->setStyleSheet("#btnDebug{" - // "background-image: url(:/Image/debug.png);" - // "background-repeat: no-repeat;" - // "background-position: center;" - // "background-color: rgba(255, 255, 255, 0);" - // "}" - // "#btnDebug::hover{" - // "background-image: url(:/Image/debug1.png);" - // "background-repeat: no-repeat;" - // "background-position: center;" - // "background-color: rgba(255, 255, 255, 0);" - // "}"); - - // ui->btnFlash->setStyleSheet("#btnFlash{" - // "background-image: url(:/Image/hardware-line.png);" - // "background-repeat: no-repeat;" - // "background-position: center;" - // "background-color: rgba(255, 255, 255, 0);" - // "}" - // "#btnFlash::hover{" - // "background-image: url(:/Image/hardware-line1.png);" - // "background-repeat: no-repeat;" - // "background-position: center;" - // "background-color: rgba(255, 255, 255, 0);" - // "}"); - - // ui->btnSetup->setStyleSheet("#btnSetup{" - // "background-image: url(:/Image/advance-set-line.png);" - // "background-repeat: no-repeat;" - // "background-position: center;" - // "background-color: rgba(255, 255, 255, 0);" - // "}" - // "#btnSetup::hover{" - // "background-image: url(:/Image/advance-set-line1.png);" - // "background-repeat: no-repeat;" - // "background-position: center;" - // "background-color: rgba(255, 255, 255, 0);" - // "}"); - // }); - connect(ui->btnSetup, &QPushButton::pressed, this, [=]{ emit showLogin(); ui->btnSetup->setStyleSheet("#btnSetup{" @@ -1182,9 +1088,9 @@ void MainWindow::setMenuStyle() "QPushButton:hover { background-color: #77B5D6; color: white; }"); } -void MainWindow::slot_pageDebugDisplayMessage(QByteArray byteArray, int dataType) +void MainWindow::slot_pageDebugDisplayMessage(QByteArray byteArray, int dataType, uint16_t *data) { - qDebug("#1"); + // qDebug("#1"); if(ui->pageDebugCheckBoxDisplay->isChecked() == true) { QString timeStr = QString(QDateTime::currentDateTime().toString("[yyyy-MM-dd hh:mm:ss.zzz] ")); QString tmpStr; @@ -1225,121 +1131,114 @@ void MainWindow::slot_pageDebugDisplayMessage(QByteArray byteArray, int dataType ui->pageDebugTextBrowser->append(showStr); } - qDebug("#2"); + // qDebug("#2"); } -void MainWindow::slot_pageHomeSglDataMessage(QByteArray byteArray, int dataType) +void MainWindow::slot_pageHomeSglDataMessage(QByteArray byteArray, int dataType, uint16_t *data) { if(dataType == TypeRecvData) { - QList result_int; - - bool ok; - for (int i = 3; i < byteArray.size(); i += 2) { - quint8 firstByte = (i < byteArray.size())? byteArray.at(i) : 0; - quint8 secondByte = (i + 1 < byteArray.size())? byteArray.at(i + 1) : 0; - QString hexValue = QString("%1%2") - .arg(QString::number(firstByte, 16).rightJustified(2, '0')) - .arg(QString::number(secondByte, 16).rightJustified(2, '0')); - - result_int += hexValue.toInt(&ok, 16); - } - sgl_vol_info = result_int; - sgl_vol_info.removeLast(); - sgl_info_process(sgl_vol_info, labelListVol); + ui->labelVol1->setText(QString::number(data[0])); + ui->labelVol2->setText(QString::number(data[1])); + ui->labelVol3->setText(QString::number(data[2])); + ui->labelVol4->setText(QString::number(data[3])); + ui->labelVol5->setText(QString::number(data[4])); + ui->labelVol6->setText(QString::number(data[5])); + ui->labelVol7->setText(QString::number(data[6])); + ui->labelVol8->setText(QString::number(data[7])); + ui->labelVol9->setText(QString::number(data[8])); + ui->labelVol10->setText(QString::number(data[9])); + ui->labelVol11->setText(QString::number(data[10])); + ui->labelVol12->setText(QString::number(data[11])); + ui->labelVol13->setText(QString::number(data[12])); + ui->labelVol14->setText(QString::number(data[13])); + ui->labelVol15->setText(QString::number(data[14])); + ui->labelVol16->setText(QString::number(data[15])); } } -void MainWindow::slot_pageHomeSglTempt(QByteArray byteArray, int dataType) +void MainWindow::slot_pageHomeSglTempt(QByteArray byteArray, int dataType, uint16_t *data) { if(dataType == TypeRecvData) { - QList result_int; - - bool ok; - for (int i = 3; i < byteArray.size(); i += 2) { - quint8 firstByte = (i < byteArray.size())? byteArray.at(i) : 0; - quint8 secondByte = (i + 1 < byteArray.size())? byteArray.at(i + 1) : 0; - QString hexValue = QString("%1%2") - .arg(QString::number(firstByte, 16).rightJustified(2, '0')) - .arg(QString::number(secondByte, 16).rightJustified(2, '0')); - - result_int += hexValue.toInt(&ok, 16); - } - sgl_tempt_info = result_int; - sgl_tempt_info.removeLast(); - sgl_info_process(sgl_tempt_info, labelListTempt); + ui->labelTemp1->setText(QString::number(data[0])); + ui->labelTemp2->setText(QString::number(data[1])); + ui->labelTemp3->setText(QString::number(data[2])); + ui->labelTemp4->setText(QString::number(data[3])); + ui->labelTemp5->setText(QString::number(data[4])); + ui->labelTemp6->setText(QString::number(data[5])); + ui->labelTemp7->setText(QString::number(data[6])); + ui->labelTemp8->setText(QString::number(data[7])); + ui->labelTemp9->setText(QString::number(data[8])); + ui->labelTemp10->setText(QString::number(data[9])); + ui->labelTemp11->setText(QString::number(data[10])); + ui->labelTemp12->setText(QString::number(data[11])); + ui->labelTemp13->setText(QString::number(data[12])); + ui->labelTemp14->setText(QString::number(data[13])); + ui->labelTemp15->setText(QString::number(data[14])); + ui->labelTemp16->setText(QString::number(data[15])); } } -void MainWindow::slot_pageHomeBaseInfo1_45(QByteArray byteArray, int dataType) +void MainWindow::slot_pageHomeBaseInfo1_45(QByteArray byteArray, int dataType, uint16_t *data) { if(dataType == TypeRecvData) { - // qDebug() << "33333333333333333333333333333333"; - QList result_int; - - bool ok; - for (int i = 3; i < byteArray.size(); i += 2) { - quint8 firstByte = (i < byteArray.size())? byteArray.at(i) : 0; - quint8 secondByte = (i + 1 < byteArray.size())? byteArray.at(i + 1) : 0; - QString hexValue = QString("%1%2") - .arg(QString::number(firstByte, 16).rightJustified(2, '0')) - .arg(QString::number(secondByte, 16).rightJustified(2, '0')); - - result_int += hexValue.toInt(&ok, 16); - } - base_info1_45 = result_int; - // qDebug() << base_info1_45; - ui->volValue->setText(QString::number(base_info1_45[0])); - ui->batVal_vol_all->setText(QString::number(base_info1_45[0])); + ui->volValue->setText(QString::number(data[0])); + ui->batVal_vol_all->setText(QString::number(data[0])); - ui->currValue->setText(QString::number(base_info1_45[1])); - ui->batVal_cur_all->setText(QString::number(base_info1_45[1])); + ui->currValue->setText(QString::number(data[1])); + ui->batVal_cur_all->setText(QString::number(data[1])); - ui->batVal_soc->setText(QString::number(base_info1_45[2])); - ui->widgetBatt->setValue(base_info1_45[2]); + ui->batVal_soc->setText(QString::number(data[2])); + ui->widgetBatt->setValue(data[2]); - ui->batVal_soh->setText(QString::number(base_info1_45[3])); - ui->batVal_soe->setText(QString::number(base_info1_45[4])); - ui->batVal_rated_vol->setText(QString::number(base_info1_45[5])); - ui->batVal_rated_cap->setText(QString::number(base_info1_45[6])); - ui->batVal_remain_cap->setText(QString::number(base_info1_45[7])); - ui->batVal_bat_count->setText(QString::number(base_info1_45[12])); + ui->batVal_soh->setText(QString::number(data[3])); + ui->batVal_soe->setText(QString::number(data[4])); + ui->batVal_rated_vol->setText(QString::number(data[5])); + ui->batVal_rated_cap->setText(QString::number(data[6])); + ui->batVal_remain_cap->setText(QString::number(data[7])); + ui->batVal_bat_count->setText(QString::number(data[12])); - battery_count = base_info1_45[12]; + battery_count = data[12]; - ui->batVal_tempt_count->setText(QString::number(base_info1_45[14])); - ui->batVal_max_dischg_cur->setText(QString::number(base_info1_45[16])); - ui->batVal_max_dischg_pwer->setText(QString::number(base_info1_45[17])); - ui->batVal_max_chg_cur->setText(QString::number(base_info1_45[18])); - ui->batVal_max_chg_pwer->setText(QString::number(base_info1_45[19])); + ui->batVal_tempt_count->setText(QString::number(data[14])); + ui->batVal_max_dischg_cur->setText(QString::number(data[16])); + ui->batVal_max_dischg_pwer->setText(QString::number(data[17])); + ui->batVal_max_chg_cur->setText(QString::number(data[18])); + ui->batVal_max_chg_pwer->setText(QString::number(data[19])); - ui->batVal_pos_insu_res->setText(QString::number(base_info1_45[20])); - ui->batVal_neg_insu_res->setText(QString::number(base_info1_45[21])); - ui->batVal_sgl_vol_avg->setText(QString::number(base_info1_45[22])); - ui->batVal_sgl_max_press_diff->setText(QString::number(base_info1_45[23])); - ui->batVal_max_sgl_vol->setText(QString::number(base_info1_45[24])); - ui->batVal_max_sgl_vol_bmu_num->setText(QString::number(base_info1_45[25])); - ui->batVal_max_sgl_vol_serial_num->setText(QString::number(base_info1_45[26])); - ui->batVal_min_sgl_vol->setText(QString::number(base_info1_45[27])); - ui->batVal_min_sgl_vol_bmu_num->setText(QString::number(base_info1_45[28])); - ui->batVal_min_sgl_vol_serial_num->setText(QString::number(base_info1_45[29])); - ui->batVal_sgl_temp_avg->setText(QString::number(base_info1_45[30])); - ui->batVal_sgl_max_temp_diff->setText(QString::number(base_info1_45[31])); - ui->batVal_max_sgl_temp->setText(QString::number(base_info1_45[32])); - ui->batVal_max_sgl_temp_bmu_num->setText(QString::number(base_info1_45[33])); - ui->batVal_max_sgl_temp_serial_num->setText(QString::number(base_info1_45[34])); - ui->batVal_min_sgl_temp->setText(QString::number(base_info1_45[35])); - ui->batVal_min_sgl_temp_bmu_num->setText(QString::number(base_info1_45[36])); - ui->batVal_min_sgl_temp_serial_num->setText(QString::number(base_info1_45[37])); - ui->batVal_day_chg_cap->setText(QString::number(base_info1_45[38])); - ui->batVal_day_chg_ele->setText(QString::number(base_info1_45[39])); - ui->batVal_day_dischg_cap->setText(QString::number(base_info1_45[40])); - ui->batVal_day_dischg_ele->setText(QString::number(base_info1_45[41])); - ui->batVal_day_chg_time->setText(QString::number(base_info1_45[42])); - ui->batVal_day_dischg_time->setText(QString::number(base_info1_45[43])); - ui->batVal_leiji_chg_cap->setText(QString::number(base_info1_45[44])); + ui->batVal_pos_insu_res->setText(QString::number(data[20])); + ui->batVal_neg_insu_res->setText(QString::number(data[21])); + ui->batVal_sgl_vol_avg->setText(QString::number(data[22])); + ui->batVal_sgl_max_press_diff->setText(QString::number(data[23])); + ui->batVal_max_sgl_vol->setText(QString::number(data[24])); + ui->batVal_max_sgl_vol_bmu_num->setText(QString::number(data[25])); + ui->batVal_max_sgl_vol_serial_num->setText(QString::number(data[26])); + ui->batVal_min_sgl_vol->setText(QString::number(data[27])); + ui->batVal_min_sgl_vol_bmu_num->setText(QString::number(data[28])); + ui->batVal_min_sgl_vol_serial_num->setText(QString::number(data[29])); + ui->batVal_sgl_temp_avg->setText(QString::number(data[30])); + ui->batVal_sgl_max_temp_diff->setText(QString::number(data[31])); + ui->batVal_max_sgl_temp->setText(QString::number(data[32])); + ui->batVal_max_sgl_temp_bmu_num->setText(QString::number(data[33])); + ui->batVal_max_sgl_temp_serial_num->setText(QString::number(data[34])); + ui->batVal_min_sgl_temp->setText(QString::number(data[35])); + ui->batVal_min_sgl_temp_bmu_num->setText(QString::number(data[36])); + ui->batVal_min_sgl_temp_serial_num->setText(QString::number(data[37])); + ui->batVal_day_chg_cap->setText(QString::number(data[38])); + ui->batVal_day_chg_ele->setText(QString::number(data[39])); + ui->batVal_day_dischg_cap->setText(QString::number(data[40])); + ui->batVal_day_dischg_ele->setText(QString::number(data[41])); + ui->batVal_day_chg_time->setText(QString::number(data[42])); + ui->batVal_day_dischg_time->setText(QString::number(data[43])); + ui->batVal_leiji_chg_cap->setText(QString::number(data[44])); + + //主页单体值 + ui->label_home_max_sgl_vol->setText(QString::number(data[24])); + ui->label_home_min_sgl_vol->setText(QString::number(data[27])); + ui->label_home_max_sgl_temp->setText(QString::number(data[32])); + ui->label_home_min_sgl_temp->setText(QString::number(data[35])); // int array_day_chart[] = {base_info1_45[39], base_info1_45[41], base_info1_45[42], base_info1_45[43]}; @@ -1350,7 +1249,7 @@ void MainWindow::slot_pageHomeBaseInfo1_45(QByteArray byteArray, int dataType) } } -void MainWindow::slot_pageHomeBaseInfo57_78(QByteArray byteArray, int dataType) +void MainWindow::slot_pageHomeBaseInfo57_78(QByteArray byteArray, int dataType, uint16_t *data) { if(dataType == TypeRecvData) { @@ -1399,24 +1298,11 @@ void MainWindow::slot_pageHomeBaseInfo57_78(QByteArray byteArray, int dataType) } } -void MainWindow::slot_pageHomeBaseInfo83_106(QByteArray byteArray, int dataType) +void MainWindow::slot_pageHomeBaseInfo83_106(QByteArray byteArray, int dataType, uint16_t *data) { if(dataType == TypeRecvData) { - QList result_int; - - bool ok; - for (int i = 3; i < byteArray.size(); i += 2) { - quint8 firstByte = (i < byteArray.size())? byteArray.at(i) : 0; - quint8 secondByte = (i + 1 < byteArray.size())? byteArray.at(i + 1) : 0; - QString hexValue = QString("%1%2") - .arg(QString::number(firstByte, 16).rightJustified(2, '0')) - .arg(QString::number(secondByte, 16).rightJustified(2, '0')); - - result_int += hexValue.toInt(&ok, 16); - } - base_info83_106 = result_int; - ui->batVal_samp_press_all->setText(QString::number(base_info83_106[0])); + ui->batVal_samp_press_all->setText(QString::number(data[0])); /*84~95 一级故障(故障位1~16) @@ -1433,13 +1319,13 @@ void MainWindow::slot_pageHomeBaseInfo83_106(QByteArray byteArray, int dataType) 三级故障(故障位49~64) */ - ui->batVal_state_machine->setText(QString::number(base_info83_106[13])); - ui->batVal_chg_satus->setText(QString::number(base_info83_106[14])); - ui->batVal_dischg_satus->setText(QString::number(base_info83_106[15])); - ui->batVal_high_press_close_status->setText(QString::number(base_info83_106[16])); - ui->batVal_fan_status->setText(QString::number(base_info83_106[17])); - ui->batVal_all_alert->setText(QString::number(base_info83_106[18])); - ui->batVal__trouble_all->setText(QString::number(base_info83_106[19])); + ui->batVal_state_machine->setText(QString::number(data[13])); + ui->batVal_chg_satus->setText(QString::number(data[14])); + ui->batVal_dischg_satus->setText(QString::number(data[15])); + ui->batVal_high_press_close_status->setText(QString::number(data[16])); + ui->batVal_fan_status->setText(QString::number(data[17])); + ui->batVal_all_alert->setText(QString::number(data[18])); + ui->batVal__trouble_all->setText(QString::number(data[19])); /*103~106 BCU地址 @@ -1571,6 +1457,8 @@ void MainWindow::getLanNumberSlot(int number) pageParaSetInit_balance_setting(); pageParaSetInit_SOX_setting(); pageParaSetInit_other_setting(); + pageHomeHistoryAlarm(); + pageFlashGetVersion(); } void MainWindow::pageBatteryInit() @@ -1578,6 +1466,221 @@ void MainWindow::pageBatteryInit() } +void MainWindow::pageHomeHistoryAlarm() +{ + ui->groupBox_history_alarm->setStyleSheet("background-color: #FFFFFF;"); + /*设置默认行高*/ + ui->tableView_history_alarm->verticalHeader()->setDefaultSectionSize(26); + /*设置交替行颜色--允许交替行颜色*/ + ui->tableView_history_alarm->setAlternatingRowColors(true); + /*设置水平/垂直滚动模式--一次滚动一个项目*/ + ui->tableView_history_alarm->setHorizontalScrollMode(QAbstractItemView::ScrollPerItem); + ui->tableView_history_alarm->setVerticalScrollMode(QAbstractItemView::ScrollPerItem); + /*设置选择行为--每次选择只有一整行*/ + ui->tableView_history_alarm->setSelectionBehavior(QAbstractItemView::SelectRows); + /*设置拖放行为--不允许拖放*/ + ui->tableView_history_alarm->setDragDropMode(QAbstractItemView::NoDragDrop); + /*设置选择模式--只能选择一个项目*/ + ui->tableView_history_alarm->setSelectionMode(QAbstractItemView::SingleSelection); + /*设置Tab导航键--允许使用Tab键导航,shift+tab反向导航*/ + ui->tableView_history_alarm->setTabKeyNavigation(true); + /*设置是否自动换行--取消自动换行*/ + ui->tableView_history_alarm->setWordWrap(false); + /*设置文本省略模式--省略号不会出现在文本中*/ + ui->tableView_history_alarm->setTextElideMode(Qt::ElideNone); + /*设置左上角全选按钮--禁用*/ + ui->tableView_history_alarm->setCornerButtonEnabled(false); + /*设置是否支持表头排序--应该和表头是否可以单击保持一致*/ + ui->tableView_history_alarm->setSortingEnabled(false); + /*设置是否显示网格线*/ + ui->tableView_history_alarm->setShowGrid(true); + /*设置垂直表头是否可见*/ + ui->tableView_history_alarm->verticalHeader()->setVisible(false); + /*设置选中一行表头是否加粗--不加粗*/ + ui->tableView_history_alarm->horizontalHeader()->setHighlightSections(true); + /*设置最后一行是否拉伸填充*/ + ui->tableView_history_alarm->horizontalHeader()->setStretchLastSection(true); + /*设置行标题最小宽度尺寸*/ + ui->tableView_history_alarm->horizontalHeader()->setMinimumSectionSize(0); + /*设置行标题最小高度*/ + ui->tableView_history_alarm->horizontalHeader()->setFixedHeight(35); + /*设置表头是否可以单击--不可单击*/ + ui->tableView_history_alarm->horizontalHeader()->setSectionsClickable(false); + ui->tableView_history_alarm->verticalHeader()->setHidden(false); + + ui->tableView_history_alarm->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + /*是否可编辑*/ + if(true) + { + ui->tableView_history_alarm->setEditTriggers(QAbstractItemView::CurrentChanged|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed); + } + else + { + ui->tableView_history_alarm->setEditTriggers(QAbstractItemView::NoEditTriggers); + } + + QStringList columnNames; + QList columnWidths; + columnNames << "时间" << "告警名称" << "BCUId" << "状态"; + columnWidths << 240 << 240 << 240 << 240; + + QStringList columnNames_english; + QList columnWidths_english; + columnNames_english << "Time" << "Alarm Name" << "BCUId" << "Status"; + columnWidths_english << 240 << 240 << 240 << 240; + + if(lan == 0) + { + model_history_alarm = new QStandardItemModel; + model_history_alarm->setHorizontalHeaderLabels(columnNames_english); + ui->tableView_history_alarm->setModel(model_history_alarm); + int count = columnNames_english.count(); + for(int i = 0; i< count;i++) + { + ui->tableView_history_alarm->setColumnWidth(i, columnWidths_english.at(i)); + } + } + else if(lan == 1) + { + model_history_alarm = new QStandardItemModel; + model_history_alarm->setHorizontalHeaderLabels(columnNames); + ui->tableView_history_alarm->setModel(model_history_alarm); + int count = columnNames.count(); + for(int i = 0; i< count;i++) + { + ui->tableView_history_alarm->setColumnWidth(i, columnWidths.at(i)); + } + } + + + + + Delegate *labelDelegate = new Delegate; + labelDelegate->setDelegateType("QLabel"); + ui->tableView_history_alarm->setItemDelegateForColumn(0, labelDelegate); + + Delegate *labelDelegate1 = new Delegate; + labelDelegate1->setDelegateType("QLabel"); + ui->tableView_history_alarm->setItemDelegateForColumn(1,labelDelegate1); + + Delegate * labelDelegate2 = new Delegate; + labelDelegate2->setDelegateType("QLabel"); + ui->tableView_history_alarm->setItemDelegateForColumn(2, labelDelegate2); + + Delegate *labelDelegate3 = new Delegate; + labelDelegate3->setDelegateType("QLabel"); + ui->tableView_history_alarm->setItemDelegateForColumn(3,labelDelegate3); + + // if(lan == 0) + // { + + // } + // else if(lan == 1) + // { + + // } + +} + +void MainWindow::pageFlashGetVersion() +{ + ui->tableView_Version->setStyleSheet("background-color: #FFFFFF;"); + /*设置默认行高*/ + ui->tableView_Version->verticalHeader()->setDefaultSectionSize(26); + /*设置交替行颜色--允许交替行颜色*/ + ui->tableView_Version->setAlternatingRowColors(true); + /*设置水平/垂直滚动模式--一次滚动一个项目*/ + ui->tableView_Version->setHorizontalScrollMode(QAbstractItemView::ScrollPerItem); + ui->tableView_Version->setVerticalScrollMode(QAbstractItemView::ScrollPerItem); + /*设置选择行为--每次选择只有一整行*/ + ui->tableView_Version->setSelectionBehavior(QAbstractItemView::SelectRows); + /*设置拖放行为--不允许拖放*/ + ui->tableView_Version->setDragDropMode(QAbstractItemView::NoDragDrop); + /*设置选择模式--只能选择一个项目*/ + ui->tableView_Version->setSelectionMode(QAbstractItemView::SingleSelection); + /*设置Tab导航键--允许使用Tab键导航,shift+tab反向导航*/ + ui->tableView_Version->setTabKeyNavigation(true); + /*设置是否自动换行--取消自动换行*/ + ui->tableView_Version->setWordWrap(false); + /*设置文本省略模式--省略号不会出现在文本中*/ + ui->tableView_Version->setTextElideMode(Qt::ElideNone); + /*设置左上角全选按钮--禁用*/ + ui->tableView_Version->setCornerButtonEnabled(false); + /*设置是否支持表头排序--应该和表头是否可以单击保持一致*/ + ui->tableView_Version->setSortingEnabled(false); + /*设置是否显示网格线*/ + ui->tableView_Version->setShowGrid(true); + /*设置垂直表头是否可见*/ + ui->tableView_Version->verticalHeader()->setVisible(false); + /*设置选中一行表头是否加粗--不加粗*/ + ui->tableView_Version->horizontalHeader()->setHighlightSections(true); + /*设置最后一行是否拉伸填充*/ + ui->tableView_Version->horizontalHeader()->setStretchLastSection(true); + /*设置行标题最小宽度尺寸*/ + ui->tableView_Version->horizontalHeader()->setMinimumSectionSize(0); + /*设置行标题最小高度*/ + ui->tableView_Version->horizontalHeader()->setFixedHeight(35); + /*设置表头是否可以单击--不可单击*/ + ui->tableView_Version->horizontalHeader()->setSectionsClickable(false); + ui->tableView_Version->verticalHeader()->setHidden(false); + + ui->tableView_Version->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + /*是否可编辑*/ + if(true) + { + ui->tableView_Version->setEditTriggers(QAbstractItemView::CurrentChanged|QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed); + } + else + { + ui->tableView_Version->setEditTriggers(QAbstractItemView::NoEditTriggers); + } + + QStringList columnNames; + QList columnWidths; + columnNames << "ID" << "升级前版本号" << "升级后版本号" ; + columnWidths << 120 << 240 << 240 ; + + QStringList columnNames_english; + QList columnWidths_english; + columnNames_english << "ID" << "Version before upgrade" << "Version after upgrade" ; + columnWidths_english << 120 << 240 << 240 ; + + if(lan == 0) + { + model_get_version = new QStandardItemModel; + model_get_version->setHorizontalHeaderLabels(columnNames_english); + ui->tableView_Version->setModel(model_get_version); + int count = columnNames_english.count(); + for(int i = 0; i< count;i++) + { + ui->tableView_Version->setColumnWidth(i, columnWidths_english.at(i)); + } + } + else if(lan == 1) + { + model_get_version = new QStandardItemModel; + model_get_version->setHorizontalHeaderLabels(columnNames); + ui->tableView_Version->setModel(model_get_version); + int count = columnNames.count(); + for(int i = 0; i< count;i++) + { + ui->tableView_Version->setColumnWidth(i, columnWidths.at(i)); + } + } + + Delegate *labelDelegate = new Delegate; + labelDelegate->setDelegateType("QLabel"); + ui->tableView_Version->setItemDelegateForColumn(0, labelDelegate); + + Delegate *labelDelegate1 = new Delegate; + labelDelegate1->setDelegateType("QLabel"); + ui->tableView_Version->setItemDelegateForColumn(1,labelDelegate1); + + Delegate * labelDelegate2 = new Delegate; + labelDelegate2->setDelegateType("QLabel"); + ui->tableView_Version->setItemDelegateForColumn(2, labelDelegate2); +} + void MainWindow::pageParaSetInit() { ui->tabWidget_paraset->setCurrentIndex(0); @@ -1617,7 +1720,7 @@ void MainWindow::pageParaSetInit() /*设置行标题最小宽度尺寸*/ ui->tableView_paraset_sys->horizontalHeader()->setMinimumSectionSize(0); /*设置行标题最小高度*/ - ui->tableView_paraset_sys->horizontalHeader()->setFixedHeight(20); + ui->tableView_paraset_sys->horizontalHeader()->setFixedHeight(35); /*设置表头是否可以单击--不可单击*/ ui->tableView_paraset_sys->horizontalHeader()->setSectionsClickable(false); ui->tableView_paraset_sys->verticalHeader()->setHidden(false); @@ -1651,16 +1754,16 @@ void MainWindow::pageParaSetInit() checkDelegate->setDelegateColumn(0); ui->tableView_paraset_sys->setItemDelegateForColumn(0, checkDelegate); - Delegate *lineEidtDelegate = new Delegate; - lineEidtDelegate->setDelegateType("QLineEdit"); - ui->tableView_paraset_sys->setItemDelegateForColumn(1,lineEidtDelegate); + Delegate *labelDelegate = new Delegate; + labelDelegate->setDelegateType("QLabel"); + ui->tableView_paraset_sys->setItemDelegateForColumn(1,labelDelegate); Delegate * lineEidtDelegate1 = new Delegate; lineEidtDelegate1->setDelegateType("QLineEdit"); ui->tableView_paraset_sys->setItemDelegateForColumn(2, lineEidtDelegate1); - Delegate *lineEidtDelegate2 = new Delegate; - lineEidtDelegate2->setDelegateType("QLineEdit"); - ui->tableView_paraset_sys->setItemDelegateForColumn(3,lineEidtDelegate2); + Delegate *labelDelegate1 = new Delegate; + labelDelegate1->setDelegateType("QLabel"); + ui->tableView_paraset_sys->setItemDelegateForColumn(3,labelDelegate1); if(lan == 0) { @@ -1763,7 +1866,7 @@ void MainWindow::pageParaSetInit_alert_value() /*设置行标题最小宽度尺寸*/ ui->tableView_paraset_alert_value->horizontalHeader()->setMinimumSectionSize(0); /*设置行标题最小高度*/ - ui->tableView_paraset_alert_value->horizontalHeader()->setFixedHeight(20); + ui->tableView_paraset_alert_value->horizontalHeader()->setFixedHeight(35); /*设置表头是否可以单击--不可单击*/ ui->tableView_paraset_alert_value->horizontalHeader()->setSectionsClickable(false); ui->tableView_paraset_alert_value->verticalHeader()->setHidden(false); @@ -1797,16 +1900,16 @@ void MainWindow::pageParaSetInit_alert_value() checkDelegate->setDelegateColumn(0); ui->tableView_paraset_alert_value->setItemDelegateForColumn(0, checkDelegate); - Delegate *lineEidtDelegate = new Delegate; - lineEidtDelegate->setDelegateType("QLineEdit"); - ui->tableView_paraset_alert_value->setItemDelegateForColumn(1,lineEidtDelegate); + Delegate *labelDelegate = new Delegate; + labelDelegate->setDelegateType("QLabel"); + ui->tableView_paraset_alert_value->setItemDelegateForColumn(1,labelDelegate); Delegate * lineEidtDelegate1 = new Delegate; lineEidtDelegate1->setDelegateType("QLineEdit"); ui->tableView_paraset_alert_value->setItemDelegateForColumn(2, lineEidtDelegate1); - Delegate *lineEidtDelegate2 = new Delegate; - lineEidtDelegate2->setDelegateType("QLineEdit"); - ui->tableView_paraset_alert_value->setItemDelegateForColumn(3,lineEidtDelegate2); + Delegate *labelDelegate1 = new Delegate; + labelDelegate1->setDelegateType("QLabel"); + ui->tableView_paraset_alert_value->setItemDelegateForColumn(3,labelDelegate1); if(lan == 0) { @@ -1904,7 +2007,7 @@ void MainWindow::pageParaSetInit_alert_delay() /*设置行标题最小宽度尺寸*/ ui->tableView_paraset_alert_delay->horizontalHeader()->setMinimumSectionSize(0); /*设置行标题最小高度*/ - ui->tableView_paraset_alert_delay->horizontalHeader()->setFixedHeight(20); + ui->tableView_paraset_alert_delay->horizontalHeader()->setFixedHeight(35); /*设置表头是否可以单击--不可单击*/ ui->tableView_paraset_alert_delay->horizontalHeader()->setSectionsClickable(false); ui->tableView_paraset_alert_delay->verticalHeader()->setHidden(false); @@ -1938,16 +2041,16 @@ void MainWindow::pageParaSetInit_alert_delay() checkDelegate->setDelegateColumn(0); ui->tableView_paraset_alert_delay->setItemDelegateForColumn(0, checkDelegate); - Delegate *lineEidtDelegate = new Delegate; - lineEidtDelegate->setDelegateType("QLineEdit"); - ui->tableView_paraset_alert_delay->setItemDelegateForColumn(1,lineEidtDelegate); + Delegate *labelDelegate = new Delegate; + labelDelegate->setDelegateType("QLabel"); + ui->tableView_paraset_alert_delay->setItemDelegateForColumn(1,labelDelegate); Delegate * lineEidtDelegate1 = new Delegate; lineEidtDelegate1->setDelegateType("QLineEdit"); ui->tableView_paraset_alert_delay->setItemDelegateForColumn(2, lineEidtDelegate1); - Delegate *lineEidtDelegate2 = new Delegate; - lineEidtDelegate2->setDelegateType("QLineEdit"); - ui->tableView_paraset_alert_delay->setItemDelegateForColumn(3,lineEidtDelegate2); + Delegate *labelDelegate1 = new Delegate; + labelDelegate1->setDelegateType("QLabel"); + ui->tableView_paraset_alert_delay->setItemDelegateForColumn(3,labelDelegate1); if(lan == 0) { @@ -2046,7 +2149,7 @@ void MainWindow::pageParaSetInit_alert_release_value() /*设置行标题最小宽度尺寸*/ ui->tableView_paraset_alert_release_value->horizontalHeader()->setMinimumSectionSize(0); /*设置行标题最小高度*/ - ui->tableView_paraset_alert_release_value->horizontalHeader()->setFixedHeight(20); + ui->tableView_paraset_alert_release_value->horizontalHeader()->setFixedHeight(35); /*设置表头是否可以单击--不可单击*/ ui->tableView_paraset_alert_release_value->horizontalHeader()->setSectionsClickable(false); ui->tableView_paraset_alert_release_value->verticalHeader()->setHidden(false); @@ -2080,16 +2183,16 @@ void MainWindow::pageParaSetInit_alert_release_value() checkDelegate->setDelegateColumn(0); ui->tableView_paraset_alert_release_value->setItemDelegateForColumn(0, checkDelegate); - Delegate *lineEidtDelegate = new Delegate; - lineEidtDelegate->setDelegateType("QLineEdit"); - ui->tableView_paraset_alert_release_value->setItemDelegateForColumn(1,lineEidtDelegate); + Delegate *labelDelegate = new Delegate; + labelDelegate->setDelegateType("QLabel"); + ui->tableView_paraset_alert_release_value->setItemDelegateForColumn(1,labelDelegate); Delegate * lineEidtDelegate1 = new Delegate; lineEidtDelegate1->setDelegateType("QLineEdit"); ui->tableView_paraset_alert_release_value->setItemDelegateForColumn(2, lineEidtDelegate1); - Delegate *lineEidtDelegate2 = new Delegate; - lineEidtDelegate2->setDelegateType("QLineEdit"); - ui->tableView_paraset_alert_release_value->setItemDelegateForColumn(3,lineEidtDelegate2); + Delegate *labelDelegate1 = new Delegate; + labelDelegate1->setDelegateType("QLabel"); + ui->tableView_paraset_alert_release_value->setItemDelegateForColumn(3,labelDelegate1); if(lan == 0) { BatteryConfig_English::Item item; @@ -2186,7 +2289,7 @@ void MainWindow::pageParaSetInit_alert_release_delay() /*设置行标题最小宽度尺寸*/ ui->tableView_paraset_alert_release_delay->horizontalHeader()->setMinimumSectionSize(0); /*设置行标题最小高度*/ - ui->tableView_paraset_alert_release_delay->horizontalHeader()->setFixedHeight(20); + ui->tableView_paraset_alert_release_delay->horizontalHeader()->setFixedHeight(35); /*设置表头是否可以单击--不可单击*/ ui->tableView_paraset_alert_release_delay->horizontalHeader()->setSectionsClickable(false); ui->tableView_paraset_alert_release_delay->verticalHeader()->setHidden(false); @@ -2220,16 +2323,16 @@ void MainWindow::pageParaSetInit_alert_release_delay() checkDelegate->setDelegateColumn(0); ui->tableView_paraset_alert_release_delay->setItemDelegateForColumn(0, checkDelegate); - Delegate *lineEidtDelegate = new Delegate; - lineEidtDelegate->setDelegateType("QLineEdit"); - ui->tableView_paraset_alert_release_delay->setItemDelegateForColumn(1,lineEidtDelegate); + Delegate *labelDelegate = new Delegate; + labelDelegate->setDelegateType("QLabel"); + ui->tableView_paraset_alert_release_delay->setItemDelegateForColumn(1,labelDelegate); Delegate * lineEidtDelegate1 = new Delegate; lineEidtDelegate1->setDelegateType("QLineEdit"); ui->tableView_paraset_alert_release_delay->setItemDelegateForColumn(2, lineEidtDelegate1); - Delegate *lineEidtDelegate2 = new Delegate; - lineEidtDelegate2->setDelegateType("QLineEdit"); - ui->tableView_paraset_alert_release_delay->setItemDelegateForColumn(3,lineEidtDelegate2); + Delegate *labelDelegate1 = new Delegate; + labelDelegate1->setDelegateType("QLabel"); + ui->tableView_paraset_alert_release_delay->setItemDelegateForColumn(3,labelDelegate1); if(lan == 0) { @@ -2325,7 +2428,7 @@ void MainWindow::pageParaSetInit_alert_dropcurr_rate() /*设置行标题最小宽度尺寸*/ ui->tableView_paraset_alert_dropcurr_rate->horizontalHeader()->setMinimumSectionSize(0); /*设置行标题最小高度*/ - ui->tableView_paraset_alert_dropcurr_rate->horizontalHeader()->setFixedHeight(20); + ui->tableView_paraset_alert_dropcurr_rate->horizontalHeader()->setFixedHeight(35); /*设置表头是否可以单击--不可单击*/ ui->tableView_paraset_alert_dropcurr_rate->horizontalHeader()->setSectionsClickable(false); ui->tableView_paraset_alert_dropcurr_rate->verticalHeader()->setHidden(false); @@ -2359,16 +2462,16 @@ void MainWindow::pageParaSetInit_alert_dropcurr_rate() checkDelegate->setDelegateColumn(0); ui->tableView_paraset_alert_dropcurr_rate->setItemDelegateForColumn(0, checkDelegate); - Delegate *lineEidtDelegate = new Delegate; - lineEidtDelegate->setDelegateType("QLineEdit"); - ui->tableView_paraset_alert_dropcurr_rate->setItemDelegateForColumn(1,lineEidtDelegate); + Delegate *labelDelegate = new Delegate; + labelDelegate->setDelegateType("QLabel"); + ui->tableView_paraset_alert_dropcurr_rate->setItemDelegateForColumn(1,labelDelegate); Delegate * lineEidtDelegate1 = new Delegate; lineEidtDelegate1->setDelegateType("QLineEdit"); ui->tableView_paraset_alert_dropcurr_rate->setItemDelegateForColumn(2, lineEidtDelegate1); - Delegate *lineEidtDelegate2 = new Delegate; - lineEidtDelegate2->setDelegateType("QLineEdit"); - ui->tableView_paraset_alert_dropcurr_rate->setItemDelegateForColumn(3,lineEidtDelegate2); + Delegate *labelDelegate1 = new Delegate; + labelDelegate1->setDelegateType("QLabel"); + ui->tableView_paraset_alert_dropcurr_rate->setItemDelegateForColumn(3,labelDelegate1); if(lan == 0) { BatteryConfig_English::Item item; @@ -2465,7 +2568,7 @@ void MainWindow::pageParaSetInit_alert_solve_measure() /*设置行标题最小宽度尺寸*/ ui->tableView_paraset_alert_solve_mease->horizontalHeader()->setMinimumSectionSize(0); /*设置行标题最小高度*/ - ui->tableView_paraset_alert_solve_mease->horizontalHeader()->setFixedHeight(20); + ui->tableView_paraset_alert_solve_mease->horizontalHeader()->setFixedHeight(35); /*设置表头是否可以单击--不可单击*/ ui->tableView_paraset_alert_solve_mease->horizontalHeader()->setSectionsClickable(false); ui->tableView_paraset_alert_solve_mease->verticalHeader()->setHidden(false); @@ -2499,16 +2602,16 @@ void MainWindow::pageParaSetInit_alert_solve_measure() checkDelegate->setDelegateColumn(0); ui->tableView_paraset_alert_solve_mease->setItemDelegateForColumn(0, checkDelegate); - Delegate *lineEidtDelegate = new Delegate; - lineEidtDelegate->setDelegateType("QLineEdit"); - ui->tableView_paraset_alert_solve_mease->setItemDelegateForColumn(1,lineEidtDelegate); + Delegate *labelDelegate = new Delegate; + labelDelegate->setDelegateType("QLabel"); + ui->tableView_paraset_alert_solve_mease->setItemDelegateForColumn(1,labelDelegate); Delegate * lineEidtDelegate1 = new Delegate; lineEidtDelegate1->setDelegateType("QLineEdit"); ui->tableView_paraset_alert_solve_mease->setItemDelegateForColumn(2, lineEidtDelegate1); - Delegate *lineEidtDelegate2 = new Delegate; - lineEidtDelegate2->setDelegateType("QLineEdit"); - ui->tableView_paraset_alert_solve_mease->setItemDelegateForColumn(3,lineEidtDelegate2); + Delegate *labelDelegate1 = new Delegate; + labelDelegate1->setDelegateType("QLabel"); + ui->tableView_paraset_alert_solve_mease->setItemDelegateForColumn(3,labelDelegate1); if(lan == 0) { BatteryConfig_English::Item item; @@ -2605,7 +2708,7 @@ void MainWindow::pageParaSetInit_DIDO_setting() /*设置行标题最小宽度尺寸*/ ui->tableView_DIDO_setting->horizontalHeader()->setMinimumSectionSize(0); /*设置行标题最小高度*/ - ui->tableView_DIDO_setting->horizontalHeader()->setFixedHeight(20); + ui->tableView_DIDO_setting->horizontalHeader()->setFixedHeight(35); /*设置表头是否可以单击--不可单击*/ ui->tableView_DIDO_setting->horizontalHeader()->setSectionsClickable(false); ui->tableView_DIDO_setting->verticalHeader()->setHidden(false); @@ -2639,16 +2742,16 @@ void MainWindow::pageParaSetInit_DIDO_setting() checkDelegate->setDelegateColumn(0); ui->tableView_DIDO_setting->setItemDelegateForColumn(0, checkDelegate); - Delegate *lineEidtDelegate = new Delegate; - lineEidtDelegate->setDelegateType("QLineEdit"); - ui->tableView_DIDO_setting->setItemDelegateForColumn(1,lineEidtDelegate); + Delegate *labelDelegate = new Delegate; + labelDelegate->setDelegateType("QLabel"); + ui->tableView_DIDO_setting->setItemDelegateForColumn(1,labelDelegate); Delegate * lineEidtDelegate1 = new Delegate; lineEidtDelegate1->setDelegateType("QLineEdit"); ui->tableView_DIDO_setting->setItemDelegateForColumn(2, lineEidtDelegate1); - Delegate *lineEidtDelegate2 = new Delegate; - lineEidtDelegate2->setDelegateType("QLineEdit"); - ui->tableView_DIDO_setting->setItemDelegateForColumn(3,lineEidtDelegate2); + Delegate *labelDelegate1 = new Delegate; + labelDelegate1->setDelegateType("QLabel"); + ui->tableView_DIDO_setting->setItemDelegateForColumn(3,labelDelegate1); if(lan == 0) { @@ -2746,7 +2849,7 @@ void MainWindow::pageParaSetInit_balance_setting() /*设置行标题最小宽度尺寸*/ ui->tableView_balance_setting->horizontalHeader()->setMinimumSectionSize(0); /*设置行标题最小高度*/ - ui->tableView_balance_setting->horizontalHeader()->setFixedHeight(20); + ui->tableView_balance_setting->horizontalHeader()->setFixedHeight(35); /*设置表头是否可以单击--不可单击*/ ui->tableView_balance_setting->horizontalHeader()->setSectionsClickable(false); ui->tableView_balance_setting->verticalHeader()->setHidden(false); @@ -2780,16 +2883,16 @@ void MainWindow::pageParaSetInit_balance_setting() checkDelegate->setDelegateColumn(0); ui->tableView_balance_setting->setItemDelegateForColumn(0, checkDelegate); - Delegate *lineEidtDelegate = new Delegate; - lineEidtDelegate->setDelegateType("QLineEdit"); - ui->tableView_balance_setting->setItemDelegateForColumn(1,lineEidtDelegate); + Delegate *labelDelegate = new Delegate; + labelDelegate->setDelegateType("QLabel"); + ui->tableView_balance_setting->setItemDelegateForColumn(1,labelDelegate); Delegate * lineEidtDelegate1 = new Delegate; lineEidtDelegate1->setDelegateType("QLineEdit"); ui->tableView_balance_setting->setItemDelegateForColumn(2, lineEidtDelegate1); - Delegate *lineEidtDelegate2 = new Delegate; - lineEidtDelegate2->setDelegateType("QLineEdit"); - ui->tableView_balance_setting->setItemDelegateForColumn(3,lineEidtDelegate2); + Delegate *labelDelegate1 = new Delegate; + labelDelegate1->setDelegateType("QLabel"); + ui->tableView_balance_setting->setItemDelegateForColumn(3,labelDelegate1); if(lan == 0) { @@ -2887,7 +2990,7 @@ void MainWindow::pageParaSetInit_SOX_setting() /*设置行标题最小宽度尺寸*/ ui->tableView_SOX_setting->horizontalHeader()->setMinimumSectionSize(0); /*设置行标题最小高度*/ - ui->tableView_SOX_setting->horizontalHeader()->setFixedHeight(20); + ui->tableView_SOX_setting->horizontalHeader()->setFixedHeight(35); /*设置表头是否可以单击--不可单击*/ ui->tableView_SOX_setting->horizontalHeader()->setSectionsClickable(false); ui->tableView_SOX_setting->verticalHeader()->setHidden(false); @@ -2921,16 +3024,16 @@ void MainWindow::pageParaSetInit_SOX_setting() checkDelegate->setDelegateColumn(0); ui->tableView_SOX_setting->setItemDelegateForColumn(0, checkDelegate); - Delegate *lineEidtDelegate = new Delegate; - lineEidtDelegate->setDelegateType("QLineEdit"); - ui->tableView_SOX_setting->setItemDelegateForColumn(1,lineEidtDelegate); + Delegate *labelDelegate = new Delegate; + labelDelegate->setDelegateType("QLabel"); + ui->tableView_SOX_setting->setItemDelegateForColumn(1,labelDelegate); Delegate * lineEidtDelegate1 = new Delegate; lineEidtDelegate1->setDelegateType("QLineEdit"); ui->tableView_SOX_setting->setItemDelegateForColumn(2, lineEidtDelegate1); - Delegate *lineEidtDelegate2 = new Delegate; - lineEidtDelegate2->setDelegateType("QLineEdit"); - ui->tableView_SOX_setting->setItemDelegateForColumn(3,lineEidtDelegate2); + Delegate *labelDelegate1 = new Delegate; + labelDelegate1->setDelegateType("QLabel"); + ui->tableView_SOX_setting->setItemDelegateForColumn(3,labelDelegate1); if(lan == 0) { @@ -3028,7 +3131,7 @@ void MainWindow::pageParaSetInit_other_setting() /*设置行标题最小宽度尺寸*/ ui->tableView_other_setting->horizontalHeader()->setMinimumSectionSize(0); /*设置行标题最小高度*/ - ui->tableView_other_setting->horizontalHeader()->setFixedHeight(20); + ui->tableView_other_setting->horizontalHeader()->setFixedHeight(35); /*设置表头是否可以单击--不可单击*/ ui->tableView_other_setting->horizontalHeader()->setSectionsClickable(false); ui->tableView_other_setting->verticalHeader()->setHidden(false); @@ -3062,16 +3165,16 @@ void MainWindow::pageParaSetInit_other_setting() checkDelegate->setDelegateColumn(0); ui->tableView_other_setting->setItemDelegateForColumn(0, checkDelegate); - Delegate *lineEidtDelegate = new Delegate; - lineEidtDelegate->setDelegateType("QLineEdit"); - ui->tableView_other_setting->setItemDelegateForColumn(1,lineEidtDelegate); + Delegate *labelDelegate = new Delegate; + labelDelegate->setDelegateType("QLabel"); + ui->tableView_other_setting->setItemDelegateForColumn(1,labelDelegate); Delegate * lineEidtDelegate1 = new Delegate; lineEidtDelegate1->setDelegateType("QLineEdit"); ui->tableView_other_setting->setItemDelegateForColumn(2, lineEidtDelegate1); - Delegate *lineEidtDelegate2 = new Delegate; - lineEidtDelegate2->setDelegateType("QLineEdit"); - ui->tableView_other_setting->setItemDelegateForColumn(3,lineEidtDelegate2); + Delegate *labelDelegate1 = new Delegate; + labelDelegate1->setDelegateType("QLabel"); + ui->tableView_other_setting->setItemDelegateForColumn(3, labelDelegate1); if(lan == 0) { @@ -3180,11 +3283,12 @@ void MainWindow::slot_getBcuNumberFromDialoglogin(int number) ui->tabWidgetBMU->setCurrentIndex(0); connect(ui->treeViewBCUbmu, &QTreeView::clicked, [=](const QModelIndex index){ - //BCU被点击的索引已被实现,bmu待定 if(index.parent().isValid()) { - qDebug() << "index" << index; - qDebug() << "BMU" << index.column() << index.row(); + // qDebug() << "index" << index; + qDebug() << "BMU: the row of the List" << index.row(); + int rowIndex = index.row(); + emit row_of_bmus_index(rowIndex); ui->pageBatteryStackWidget->setCurrentIndex(1); } else @@ -3604,7 +3708,111 @@ void MainWindow::slot_pageParaSetShow(QByteArray byteArray, int dataType, int ro } } } +} +void MainWindow::trubleListInit() +{ + for (int i = 1; i <= 56; ++i) + { + QString labelName = QString("label_trouble_%1").arg(i); + QList allWidgets = findChildren(); + for (QWidget* widget : allWidgets) + { + QLabel* label = qobject_cast(widget); + if (label!= nullptr && label->objectName() == labelName) + { + trouble_list.append(label); + break; // 找到后就可以跳出内层循环 + } + } + } +} + +void MainWindow::slot_pageHomeFault(QByteArray byteArray, int dataType, uint16_t *data) +{ + /* ui->color_trouble_1->setStyleSheet("background-image: url(:/Image/trouble-background-1.png);"); + ui->color_trouble_2->setStyleSheet("background-image: url(:/Image/trouble-background-2.png);"); + ui->color_trouble_3->setStyleSheet("background-image: url(:/Image/trouble-background-3.png);"); + ui->color_trouble_normal->setStyleSheet("background-image: url(:/Image/trouble-background-normal.png);"); + */ + if(dataType == TypeRecvData) + { + QList list; + QList list_result; + for (int i=0; i <= 6;i++) + { + QString temp = QString::number(data[i], 2); + while (temp.size() < 16) + { + temp = "0" + temp; + } + list.append(temp); + } + + for(const QString &binary : list) + { + for (int i = 0; i < 16; i+=2) + { + list_result << binary.mid(i, 2); + } + } + + // qDebug() << "data:" << data[0] << data[1] << data[2] << data[3] << data[4] << data[5] << data[6] << data[7]; + // qDebug() << "test_list: " << list; + // qDebug() << "list_reslut:" <setStyleSheet("background-image: url(:/Image/trouble-background-normal.png);"); + } + else if (list_result[i] == "01") + { + trouble_list[i]->setStyleSheet("background-image: url(:/Image/trouble-background-1.png);"); + QString timeStr = QString(QDateTime::currentDateTime().toString("[yyyy-MM-dd hh:mm:ss.zzz] ")); + model_history_alarm->setItem(count_history_alarm, 0, new QStandardItem(timeStr)); + model_history_alarm->setItem(count_history_alarm, 1, new QStandardItem(trouble_list[i]->text())); + model_history_alarm->setItem(count_history_alarm, 2, new QStandardItem(currentBCU)); + model_history_alarm->setItem(count_history_alarm, 3, new QStandardItem("一级报警")); + count_history_alarm++; + } + else if (list_result[i] == "10") + { + trouble_list[i]->setStyleSheet("background-image: url(:/Image/trouble-background-2.png);"); + QString timeStr = QString(QDateTime::currentDateTime().toString("[yyyy-MM-dd hh:mm:ss.zzz] ")); + model_history_alarm->setItem(count_history_alarm, 0, new QStandardItem(timeStr)); + model_history_alarm->setItem(count_history_alarm, 1, new QStandardItem(trouble_list[i]->text())); + model_history_alarm->setItem(count_history_alarm, 2, new QStandardItem(currentBCU)); + model_history_alarm->setItem(count_history_alarm, 3, new QStandardItem("二级报警")); + count_history_alarm++; + } + else if (list_result[i] == "11") + { + trouble_list[i]->setStyleSheet("background-image: url(:/Image/trouble-background-3.png);"); + QString timeStr = QString(QDateTime::currentDateTime().toString("[yyyy-MM-dd hh:mm:ss.zzz] ")); + model_history_alarm->setItem(count_history_alarm, 0, new QStandardItem(timeStr)); + model_history_alarm->setItem(count_history_alarm, 1, new QStandardItem(trouble_list[i]->text())); + model_history_alarm->setItem(count_history_alarm, 2, new QStandardItem(currentBCU)); + model_history_alarm->setItem(count_history_alarm, 3, new QStandardItem("三级报警")); + count_history_alarm++; + } + else + { + trouble_list[i]->setStyleSheet("background-image: url(:/Image/trouble-background-default.png);"); + qDebug() << "Can not analysis the right address!!!"; + } + } + + //设置每次界面刷新数据时,表格始终停留在最新的数据上 + int curIndex = model_history_alarm->rowCount(); + if (curIndex > 0) + { + ui->tableView_history_alarm->scrollToBottom(); + } + } } void MainWindow::closeEvent(QCloseEvent *e) @@ -4024,6 +4232,53 @@ void MainWindow::on_comBoxBCUSelect() rootItem->setText(BCUText); //当改变BCU选择时,改变当前BCU读取的地址 + currentBCU = BCUText; +} +void MainWindow::on_btn_close_pos_clicked() +{ + //强闭总正 } + + +void MainWindow::on_btn_open_pos_clicked() +{ + //强断总正 + +} + +void MainWindow::on_btn_close_neg_clicked() +{ + //强闭总负 + +} + +void MainWindow::on_btn_open_neg_clicked() +{ + //强断总负 + +} + +void MainWindow::on_btn_close_prechg_clicked() +{ + //强闭预充 + +} + +void MainWindow::on_btn_open_prechg_clicked() +{ + //强断预充 + +} + +void MainWindow::on_btnImport_clicked() +{ + QString filePath = QFileDialog::getOpenFileName(this, "请选择需要升级的固件", "", "所有文件 (*)"); + if (!filePath.isEmpty()) { + // 可以在这里对选择的文件路径进行处理 + qDebug() << "选择的文件路径:" << filePath; + ui->label_pageFlash_filepath->setText(filePath); + } +} + diff --git a/mainwindow.h b/mainwindow.h index a9d2e77..82981c9 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -35,6 +35,13 @@ public: public: QStandardItemModel *model; + + QStandardItemModel *modelBCU; //设置BCU目录 + QStandardItem *rootItem; + + QStandardItemModel *model_history_alarm; + QStandardItemModel *model_get_version; + ComLogin *m_ComLogin; AppProto *m_AppProto; Appproto_English *m_AppProto_English; @@ -45,10 +52,9 @@ public: QLabel *statusBarCompany; QLabel *statusBarBcu; QLabel *statusBarVersion; - ChartPaint *chartPat; + // ChartPaint *chartPat; + QString currentBCU = "BCU01"; - QStandardItemModel *modelBCU; //设置BCU目录 - QStandardItem *rootItem; int BCUNumbers; // QGridLayout *gridLayout; @@ -70,6 +76,14 @@ public: int tabWidget_paraset_index = 0; + QList trouble_list; + QList trouble_list_flag; + + bool trouble_history = 1; + + int count_history_alarm = 0; //如果不放到全局变量中去,每次刷新的都是同一个报警的内容,无法达到历史告警的作用 + + private: enum DataType{ @@ -103,6 +117,8 @@ private: void init(); void setMenuStyle(); void pageBatteryInit(); + void pageHomeHistoryAlarm(); + void pageFlashGetVersion(); void pageParaSetInit(); void pageParaSetInit_alert_value(); void pageParaSetInit_alert_delay(); @@ -120,6 +136,8 @@ private: int findMaxIndex(const QList sgl_info); int findMinIndex(const QList sgl_info); + void trubleListInit(); + public slots: // void setNum(QString value); void getLanNumberSlot(int number); @@ -129,18 +147,23 @@ signals: void closeLogin(); void write_regs_signals(int addr, const uint16_t data); void read_regs_signals(int addr, int nb, uint16_t *data, int row); + // void read_regs_input_signals_vol(int addr, int nb, uint16_t *data); + // void read_regs_input_signals_temp(int addr, int nb, uint16_t *data); + void row_of_bmus_index(int index); + void closeThread(); public: void slot_getBcuNumberFromDialoglogin(int number); - void slot_pageDebugDisplayMessage(QByteArray byteArray, int dataType); - void slot_pageHomeSglDataMessage(QByteArray byteArray, int dataType); - void slot_pageHomeSglTempt(QByteArray byteArray, int dataType); - void slot_pageHomeBaseInfo1_45(QByteArray byteArray, int dataType); - void slot_pageHomeBaseInfo57_78(QByteArray byteArray, int dataType); - void slot_pageHomeBaseInfo83_106(QByteArray byteArray, int dataType); + void slot_pageDebugDisplayMessage(QByteArray byteArray, int dataType, uint16_t *data); + void slot_pageHomeSglDataMessage(QByteArray byteArray, int dataType, uint16_t *data); + void slot_pageHomeSglTempt(QByteArray byteArray, int dataType, uint16_t *data); + void slot_pageHomeBaseInfo1_45(QByteArray byteArray, int dataType, uint16_t *data); + void slot_pageHomeBaseInfo57_78(QByteArray byteArray, int dataType, uint16_t *data); + void slot_pageHomeBaseInfo83_106(QByteArray byteArray, int dataType, uint16_t *data); void slot_pageHomeBaseInfo47_49_51_53_55(QList byteArray, int dataType); void slot_pageParaSetShow(QByteArray byteArray, int dataType, int row, int nb); + void slot_pageHomeFault(QByteArray byteArray, int dataType, uint16_t *data); protected: void closeEvent(QCloseEvent *e) override; @@ -153,6 +176,20 @@ private slots: void on_comBoxBCUSelect(); // void on_horizontalSlider_valueChanged(int value); + void on_btn_close_pos_clicked(); + + void on_btn_open_pos_clicked(); + + void on_btn_close_neg_clicked(); + + void on_btn_open_neg_clicked(); + + void on_btn_close_prechg_clicked(); + + void on_btn_open_prechg_clicked(); + + void on_btnImport_clicked(); + public: struct Battery_data { uint16_t pack_total_voltage; // 电池组总压 diff --git a/mainwindow.ui b/mainwindow.ui index a284227..8578f84 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -281,7 +281,7 @@ background-color: rgba(255, 255, 255, 0); - 0 + 4 @@ -472,248 +472,252 @@ background-color: rgba(255, 255, 255, 0); - 继电器状态 + - + - + - - - + + + + + + 0 + 0 + + 微软雅黑 - 9 + 11 - - - - 总正继电器 + 最高单体电压 Qt::AlignCenter - - + + + + + 0 + 0 + + - 微软雅黑 - 9 + 黑体 + 11 - 预充继电器 + Qt::AlignCenter - - + + - 微软雅黑 - 9 + 黑体 + 10 - 总负继电器 - - - Qt::AlignCenter - - - - - - - - 微软雅黑 - 9 - - - - 隔离开关 - - - Qt::AlignCenter + mV - + - - - - - - 0 - 0 - - - - - 华文中宋 - 12 - - - - 强闭总正 - - - - - - - Qt::Horizontal - - - - 28 - 20 - - - - - - - - - 0 - 0 - - - - - 华文中宋 - 12 - - - - 强断总正 - - - - + + + + 0 + 0 + + + + + 微软雅黑 + 11 + + + + 最低单体电压 + + + Qt::AlignCenter + + - - - - - - 0 - 0 - - - - - 华文中宋 - 12 - - - - 强闭总负 - - - - - - - Qt::Horizontal - - - - 28 - 20 - - - - - - - - - 0 - 0 - - - - - 华文中宋 - 12 - - - - 强断总负 - - - - + + + + 0 + 0 + + + + + 黑体 + 11 + + + + + + + Qt::AlignCenter + + - - - - - - 0 - 0 - - - - - 华文中宋 - 12 - - - - 强闭预充 - - - - - - - Qt::Horizontal - - - - 28 - 20 - - - - - - - - - 0 - 0 - - - - - 华文中宋 - 12 - - - - 强断预充 - - - - + + + + 黑体 + 10 + + + + mV + + + + + + + + + + + + 0 + 0 + + + + + 微软雅黑 + 11 + + + + 最高单体温度 + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 黑体 + 11 + + + + + + + Qt::AlignCenter + + + + + + + + 黑体 + 10 + + + + + + + + + + + + + + + + 0 + 0 + + + + + 微软雅黑 + 11 + + + + 最低单体温度 + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 黑体 + 11 + + + + + + + Qt::AlignCenter + + + + + + + + 黑体 + 10 + + + + + + @@ -771,11 +775,11 @@ background-color: rgba(255, 255, 255, 0); - + - + 黑体 @@ -791,7 +795,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -807,7 +811,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -823,7 +827,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -839,7 +843,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -855,7 +859,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -871,7 +875,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -887,7 +891,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -907,7 +911,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -923,7 +927,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -939,7 +943,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -955,7 +959,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -971,7 +975,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -987,7 +991,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1003,7 +1007,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1019,7 +1023,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1039,7 +1043,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1055,7 +1059,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1071,7 +1075,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1087,7 +1091,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1103,7 +1107,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1119,7 +1123,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1135,7 +1139,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1151,7 +1155,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1171,7 +1175,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1187,7 +1191,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1203,7 +1207,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1219,7 +1223,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1235,7 +1239,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1251,7 +1255,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1267,7 +1271,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1283,7 +1287,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1303,7 +1307,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1319,7 +1323,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1335,7 +1339,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1351,7 +1355,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1367,7 +1371,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1383,7 +1387,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1399,7 +1403,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1415,7 +1419,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1435,7 +1439,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1451,7 +1455,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1467,7 +1471,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1483,7 +1487,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1499,7 +1503,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1515,7 +1519,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1531,7 +1535,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1547,7 +1551,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1567,7 +1571,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1583,7 +1587,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1599,7 +1603,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1615,7 +1619,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1631,7 +1635,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1647,7 +1651,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1663,7 +1667,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1679,7 +1683,7 @@ background-color: rgba(255, 255, 255, 0); - + 黑体 @@ -1992,16 +1996,284 @@ background-color: rgba(255, 255, 255, 0); - - - + + + + + + 黑体 + 12 + + + + 历史告警 + + + + + + + + + + + + 继电器状态 + + + + + + + + + + + 微软雅黑 + 9 + + + + + + + 总正继电器 + + + Qt::AlignCenter + + + + + + + + 微软雅黑 + 9 + + + + 预充继电器 + + + Qt::AlignCenter + + + + + + + + 微软雅黑 + 9 + + + + 总负继电器 + + + Qt::AlignCenter + + + + + + + + 微软雅黑 + 9 + + + + 隔离开关 + + + Qt::AlignCenter + + + + + + + + + + + + + + 0 + 0 + + + + + 华文中宋 + 12 + + + + 强闭总正 + + + + + + + Qt::Horizontal + + + + 28 + 20 + + + + + + + + + 0 + 0 + + + + + 华文中宋 + 12 + + + + 强断总正 + + + + + + + + + + + + 0 + 0 + + + + + 华文中宋 + 12 + + + + 强闭总负 + + + + + + + Qt::Horizontal + + + + 28 + 20 + + + + + + + + + 0 + 0 + + + + + 华文中宋 + 12 + + + + 强断总负 + + + + + + + + + + + + 0 + 0 + + + + + 华文中宋 + 12 + + + + 强闭预充 + + + + + + + Qt::Horizontal + + + + 28 + 20 + + + + + + + + + 0 + 0 + + + + + 华文中宋 + 12 + + + + 强断预充 + + + + + + + + + + + - + @@ -2172,7 +2444,7 @@ background-color: rgba(255, 255, 255, 0); - 2 + 0 @@ -4964,2591 +5236,6 @@ background-color: rgba(255, 255, 255, 0); - - - DI/DO信息 - - - - - 0 - 0 - 1266 - 210 - - - - - 微软雅黑 - 12 - - - - DO控制状态 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - DO1状态(总正) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - DO2状态(总负) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - DO3状态(预充) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - DO4状态(脱扣3) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - DO5状态(闲置) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - DO6状态(闲置) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - DO7状态(运行1) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - DO8状态(告警1) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - 0 - 210 - 1266 - 270 - - - - - 微软雅黑 - 12 - - - - DI信号状态 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - DI1状态(DO1反馈信号) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - DI2状态(DO2反馈信号) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - DI3状态(闲置) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - DI4状态(闲置) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - DI5状态(闲置) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - DI6状态(闲置) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - DI7状态(闲置) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - DI8状态(闲置) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - DI9状态(闲置) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - DI10状态(闲置) - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - 0 - 480 - 1266 - 325 - - - - - 微软雅黑 - 12 - - - - 其他信号状态 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 禁充信号 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 禁放信号 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 强充1信号 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 强充2信号 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 高压回路状态 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 高压回路上电指令 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - SOC满放信号 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - SOC满充信号 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 绝缘控制信号 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 加热信号 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 制冷信号 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 待机休眠信号 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - 统计信息 @@ -10103,1714 +7790,6 @@ background-color: rgba(255, 255, 255, 0); - - - 告警信息 - - - - - 0 - 270 - 1266 - 481 - - - - - 微软雅黑 - 12 - - - - 系统告警 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - T1高温 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - T1低温 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - T2高温 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - T2低温 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电流过大 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 预充状态 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 供电过高 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 供电过低 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 主从通讯 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 绝缘漏电 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 高压异常 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 极柱过温 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 簇间电流差 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 簇间温差 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 簇间压差 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡过温 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 自定义1故障 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 自定义2故障 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 模拟前端状态 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 自定义3故障 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - - - - 0 - 0 - 1266 - 271 - - - - - 微软雅黑 - 12 - - - - 电池告警 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 总压过压 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 单体过压 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 单体过温 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 压差过大 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - SOC过高 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 温升过快 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电池箱过压 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 总压欠压 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 单体欠压 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 单体低温 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 温差过大 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - SOC过低 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 极限故障 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电池箱欠压 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - - - - - - @@ -11820,7128 +7799,2669 @@ background-color: rgba(255, 255, 255, 0); - 1 + 0 - - - 系统信息 - - - - - 0 - 0 - 1266 - 400 - - - - - 微软雅黑 - 12 - - - - 基本信息 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电池数 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 温感数 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 模组电压 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - V - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 软件版本 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 压差 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 温差 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 平均电压 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 平均温度 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 最高单体电压 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 最高单体温度 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 最低单体电压、 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 最低单体温度 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 最高单体电压编号 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - # - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 最高单体温度编号 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - # - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 最低单体电压编号 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - # - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 最低单体温度编号 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - # - - - Qt::AlignCenter - - - - - - - - - - - - - - - 0 - 400 - 1266 - 325 - - - - - 微软雅黑 - 12 - - - - 状态信息 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 地址线输出 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 地址线输入 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 继电器状态 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 开关量状态 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压排线 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 温感排线 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - AFE状态 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - EEPROM状态 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡高温 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡压差 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡通讯 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡开启电压 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - 电压信息 - - - - 0 - 0 - 1266 - 571 - - - - - 黑体 - 12 - - - - 电压信息 - - - - - 10 - 70 - 1241 - 41 - - - + + + - - - - - - - - 微软雅黑 - 11 - - - - 电压3 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡3 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - + + + + 黑体 + 12 + + + + 单体电压信息 + + + + + + + + + + + + + 微软雅黑 + 11 + + + + 电压1 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + mV + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 微软雅黑 + 11 + + + + 电压2 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + mV + + + Qt::AlignCenter + + + + + + + + + + + + + + + + 微软雅黑 + 11 + + + + 电压3 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + mV + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 微软雅黑 + 11 + + + + 电压4 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + mV + + + Qt::AlignCenter + + + + + + + + + + + + + + + + 微软雅黑 + 11 + + + + 电压5 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + mV + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 微软雅黑 + 11 + + + + 电压6 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + mV + + + Qt::AlignCenter + + + + + + + + + + + + + + + + 微软雅黑 + 11 + + + + 电压7 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + mV + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 微软雅黑 + 11 + + + + 电压8 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + mV + + + Qt::AlignCenter + + + + + + + + + + + + + + + + 微软雅黑 + 11 + + + + 电压9 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + mV + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 微软雅黑 + 11 + + + + 电压10 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + mV + + + Qt::AlignCenter + + + + + + + + + + + + + + + + 微软雅黑 + 11 + + + + 电压11 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + mV + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 微软雅黑 + 11 + + + + 电压12 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + mV + + + Qt::AlignCenter + + + + + + + + + + + + + + + + 微软雅黑 + 11 + + + + 电压13 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + mV + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 微软雅黑 + 11 + + + + 电压14 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + mV + + + Qt::AlignCenter + + + + + + + + + + + + + + + + 微软雅黑 + 11 + + + + 电压15 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + mV + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 微软雅黑 + 11 + + + + 电压16 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + mV + + + Qt::AlignCenter + + + + + + + + + + + - + - Qt::Horizontal + Qt::Vertical - 40 - 20 + 20 + 40 - - - - - - - - - 微软雅黑 - 11 - - - - 电压4 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡4 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - 10 - 170 - 1241 - 41 - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压7 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡7 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压8 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡8 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - 10 - 120 - 1241 - 41 - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压5 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡5 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压6 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡6 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - 10 - 220 - 1241 - 41 - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压9 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡9 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压10 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡10 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - 10 - 470 - 1241 - 41 - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压19 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡19 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压20 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡20 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - 10 - 270 - 1241 - 41 - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压11 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡11 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压12 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡12 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - 10 - 320 - 1241 - 41 - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压13 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡13 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压14 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡14 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - 10 - 370 - 1241 - 41 - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压15 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡15 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压16 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡16 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - 10 - 420 - 1241 - 41 - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压17 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡17 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压18 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡18 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - 10 - 20 - 1241 - 41 - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压1 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡1 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 电压2 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - mV - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 均衡2 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - Qt::AlignCenter - - - - - - - - - - + + 温度信息 - - - - 0 - 0 - 1266 - 400 - - - - - 微软雅黑 - 12 - - - - 单体温度信息 - - - - - - + + + + + + + + 黑体 + 12 + + + + 单体温度信息 + + - + - - - - 微软雅黑 - 11 - - - - 温度1 - - + + + + + + + + 微软雅黑 + 11 + + + + 温度1 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 微软雅黑 + 11 + + + + 温度2 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + Qt::AlignCenter + + + + + + - - - Qt::Horizontal - - - - 18 - 20 - - - + + + + + + + + 微软雅黑 + 11 + + + + 温度3 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 微软雅黑 + 11 + + + + 温度4 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + Qt::AlignCenter + + + + + + - - - - 微软雅黑 - 11 - - - - - - + + + + + + + + 微软雅黑 + 11 + + + + 温度5 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 微软雅黑 + 11 + + + + 温度6 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + Qt::AlignCenter + + + + + + - - - Qt::Horizontal - - - - 18 - 20 - - - + + + + + + + + 微软雅黑 + 11 + + + + 温度7 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 微软雅黑 + 11 + + + + 温度8 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + Qt::AlignCenter + + + + + + - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 温度2 - - + + + + + + + + 微软雅黑 + 11 + + + + 温度9 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 微软雅黑 + 11 + + + + 温度10 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + Qt::AlignCenter + + + + + + - - - Qt::Horizontal - - - - 18 - 20 - - - + + + + + + + + 微软雅黑 + 11 + + + + 温度11 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 微软雅黑 + 11 + + + + 温度12 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + Qt::AlignCenter + + + + + + - - - - 微软雅黑 - 11 - - - - - - + + + + + + + + 微软雅黑 + 11 + + + + 温度13 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 微软雅黑 + 11 + + + + 温度14 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + Qt::AlignCenter + + + + + + - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - + + + + + + + + 微软雅黑 + 11 + + + + 温度15 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + Qt::AlignCenter + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 微软雅黑 + 11 + + + + 温度16 + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + + + + + Qt::Horizontal + + + + 18 + 20 + + + + + + + + + 微软雅黑 + 11 + + + + + + + Qt::AlignCenter + + + + + + - - - - - - - - - - 微软雅黑 - 11 - - - - 温度3 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 温度4 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 温度5 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 温度6 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 温度7 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 温度8 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 温度9 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 温度10 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 温度11 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 温度12 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 温度13 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 温度14 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - - - - - - - - 微软雅黑 - 11 - - - - 温度15 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 微软雅黑 - 11 - - - - 温度16 - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - - - - - Qt::Horizontal - - - - 18 - 20 - - - - - - - - - 微软雅黑 - 11 - - - - - - - Qt::AlignCenter - - - - - - - - - - - + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + @@ -19213,17 +10733,235 @@ li.checked::marker { content: "\2612"; } - - - - - pageFlash + + + + + Qt::Vertical + + + 20 + 40 + + + + + + + + + + + + 0 + 0 + + + + + 黑体 + 12 + + + + 升级调试 + + + + + + + + + 0 + 0 + + + + background-color: rgb(234, 244, 255); + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 黑体 + 12 + + + + + + + 导入 + + + + + + + + + + 0 + 0 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + 升级状态 + + + Qt::AlignCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 黑体 + 12 + + + + + + + 开始升级 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 黑体 + 12 + + + + + + + 获取版本号 + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + - @@ -19378,6 +11116,12 @@ li.checked::marker { content: "\2612"; }
batt.h
1 + + upgradeIcon + QWidget +
upgradeicon.h
+ 1 +
diff --git a/modbusrtu.cpp b/modbusrtu.cpp index 3971c16..690aca1 100644 --- a/modbusrtu.cpp +++ b/modbusrtu.cpp @@ -30,7 +30,7 @@ void ModbusRTU::run() while(true) { // qDebug() << "11111111111111111111111111111111"; - QThread::msleep(200); + QThread::msleep(500); uint16_t base1_45[45]; uint16_t base57_78[22]; uint16_t base83_106[24]; @@ -40,24 +40,25 @@ void ModbusRTU::run() uint16_t base53[1]; uint16_t base55[1]; QList base_list_47_49_51_53_55; - uint16_t sgl_vol[112]; // Buffer to store the registers - uint16_t sgl_tempt[112]; + uint16_t sgl_vol[16]; // Buffer to store the registers + uint16_t sgl_tempt[16]; + uint16_t fault[8]; // uint16_t alarm[]; label: int ret_base1_45 = modbus_read_input_registers(m_ModbusRTUDevice, 1, 45, base1_45); if(MODBUS_ERR == ret_base1_45) { - qDebug() << "modbus no message"; + // qDebug() << "modbus no message"; goto label; } else { // qDebug() << "2222222222222222222222222222222"; QByteArray sendArray = QByteArray::fromRawData(reinterpret_cast(m_ModbusRTUDevice->sendMsg), m_ModbusRTUDevice->sendMsgLen); - emit sig_showModbusData_base_info1_45(sendArray, TypeSendData); + emit sig_showModbusData_base_info1_45(sendArray, TypeSendData, base1_45); free(m_ModbusRTUDevice->sendMsg); QByteArray recvArray = QByteArray::fromRawData(reinterpret_cast(m_ModbusRTUDevice->recvMsg), m_ModbusRTUDevice->recvMsgLen); - emit sig_showModbusData_base_info1_45(recvArray, TypeRecvData); + emit sig_showModbusData_base_info1_45(recvArray, TypeRecvData, base1_45); free(m_ModbusRTUDevice->recvMsg); // qDebug() << "in modbus:" << base1_45; } @@ -107,14 +108,34 @@ void ModbusRTU::run() { // qDebug() << "4444444444444444444444444444"; QByteArray sendArray = QByteArray::fromRawData(reinterpret_cast(m_ModbusRTUDevice->sendMsg), m_ModbusRTUDevice->sendMsgLen); - emit sig_showModbusData_base_info57_78(sendArray, TypeSendData); + emit sig_showModbusData_base_info57_78(sendArray, TypeSendData, base57_78); free(m_ModbusRTUDevice->sendMsg); QByteArray recvArray = QByteArray::fromRawData(reinterpret_cast(m_ModbusRTUDevice->recvMsg), m_ModbusRTUDevice->recvMsgLen); - emit sig_showModbusData_base_info57_78(recvArray, TypeRecvData); + emit sig_showModbusData_base_info57_78(recvArray, TypeRecvData, base57_78); + free(m_ModbusRTUDevice->recvMsg); + } + + int ret_fault = modbus_read_input_registers(m_ModbusRTUDevice, 66, 8, fault); + if(MODBUS_ERR == ret_fault) + { + // qDebug() << "modbus no message"; + goto label; + } + else + { + // qDebug() << "4444444444444444444444444444"; + QByteArray sendArray = QByteArray::fromRawData(reinterpret_cast(m_ModbusRTUDevice->sendMsg), m_ModbusRTUDevice->sendMsgLen); + emit sig_showFault(sendArray, TypeSendData, fault); + free(m_ModbusRTUDevice->sendMsg); + QByteArray recvArray = QByteArray::fromRawData(reinterpret_cast(m_ModbusRTUDevice->recvMsg), m_ModbusRTUDevice->recvMsgLen); + emit sig_showFault(recvArray, TypeRecvData,fault); free(m_ModbusRTUDevice->recvMsg); } int ret_base83_106 = modbus_read_input_registers(m_ModbusRTUDevice, 83, 24, base83_106); + // qDebug() << "#######" << base83_106[0] << base83_106[1] << base83_106[2] << base83_106[3]; + // qDebug() << "#######" << sgl_vol[0] << sgl_vol[1] << sgl_vol[2] << sgl_vol[3] << sgl_vol[4] << sgl_vol[5] << sgl_vol[6] << sgl_vol[7] + // << sgl_vol[8] << sgl_vol[9] << sgl_vol[10] << sgl_vol[11] << sgl_vol[12] << sgl_vol[13] << sgl_vol[14] << sgl_vol[15]; if(MODBUS_ERR == ret_base83_106) { // qDebug() << "modbus no message"; @@ -124,45 +145,57 @@ void ModbusRTU::run() { // qDebug() << "5555555555555555555555555555"; QByteArray sendArray = QByteArray::fromRawData(reinterpret_cast(m_ModbusRTUDevice->sendMsg), m_ModbusRTUDevice->sendMsgLen); - emit sig_showModbusData_base_info83_106(sendArray, TypeSendData); + emit sig_showModbusData_base_info83_106(sendArray, TypeSendData, base83_106); free(m_ModbusRTUDevice->sendMsg); QByteArray recvArray = QByteArray::fromRawData(reinterpret_cast(m_ModbusRTUDevice->recvMsg), m_ModbusRTUDevice->recvMsgLen); - emit sig_showModbusData_base_info83_106(recvArray, TypeRecvData); + emit sig_showModbusData_base_info83_106(recvArray, TypeRecvData, base83_106); free(m_ModbusRTUDevice->recvMsg); } - // int ret_vol = modbus_read_input_registers(m_ModbusRTUDevice, 1001, 112, sgl_vol); - // if(MODBUS_ERR == ret_vol) - // { - // // qDebug() << "modbus no message"; - // goto label; + // qDebug() << "the current of the BMU is :" << BMUIndex; + int volAddress = (1001 + BMUIndex * 16); + int tempAddress = (1601 + BMUIndex * 16); + // qDebug() << "volAddress: " << volAddress; + // qDebug() << "tempAddress: " << tempAddress; + // QElapsedTimer time; + // time.start(); + // qDebug() << "#######" << sgl_vol[0] << sgl_vol[1] << sgl_vol[2] << sgl_vol[3] << sgl_vol[4] << sgl_vol[5] << sgl_vol[6] << sgl_vol[7] + // << sgl_vol[8] << sgl_vol[9] << sgl_vol[10] << sgl_vol[11] << sgl_vol[12] << sgl_vol[13] << sgl_vol[14] << sgl_vol[15]; + // int milsec = time.elapsed(); + // qDebug() <<"0.12311231" << milsec; - // } - // else - // { - // QByteArray sendArray = QByteArray::fromRawData(reinterpret_cast(m_ModbusRTUDevice->sendMsg), m_ModbusRTUDevice->sendMsgLen); - // emit sig_showModbusData(sendArray, TypeSendData); - // free(m_ModbusRTUDevice->sendMsg); - // QByteArray recvArray = QByteArray::fromRawData(reinterpret_cast(m_ModbusRTUDevice->recvMsg), m_ModbusRTUDevice->recvMsgLen); - // emit sig_showModbusData(recvArray, TypeRecvData); - // free(m_ModbusRTUDevice->recvMsg); - // } + int ret_vol = modbus_read_input_registers(m_ModbusRTUDevice, volAddress, 16, sgl_vol); + if(MODBUS_ERR == ret_vol) + { + // qDebug() << "modbus no message"; + goto label; - // int ret_tempt = modbus_read_input_registers(m_ModbusRTUDevice, 1601, 112, sgl_tempt); - // if(MODBUS_ERR == ret_tempt) - // { - // // qDebug() << "modbus no message"; - // goto label; - // } - // else - // { - // QByteArray sendArray = QByteArray::fromRawData(reinterpret_cast(m_ModbusRTUDevice->sendMsg), m_ModbusRTUDevice->sendMsgLen); - // emit sig_showModbusData_sgl_tempt(sendArray, TypeSendData); - // free(m_ModbusRTUDevice->sendMsg); - // QByteArray recvArray = QByteArray::fromRawData(reinterpret_cast(m_ModbusRTUDevice->recvMsg), m_ModbusRTUDevice->recvMsgLen); - // emit sig_showModbusData_sgl_tempt(recvArray, TypeRecvData); - // free(m_ModbusRTUDevice->recvMsg); - // } + } + else + { + QByteArray sendArray = QByteArray::fromRawData(reinterpret_cast(m_ModbusRTUDevice->sendMsg), m_ModbusRTUDevice->sendMsgLen); + emit sig_showModbusData(sendArray, TypeSendData, sgl_vol); + free(m_ModbusRTUDevice->sendMsg); + QByteArray recvArray = QByteArray::fromRawData(reinterpret_cast(m_ModbusRTUDevice->recvMsg), m_ModbusRTUDevice->recvMsgLen); + emit sig_showModbusData(recvArray, TypeRecvData, sgl_vol); + free(m_ModbusRTUDevice->recvMsg); + } + // QThread::msleep(500); + int ret_tempt = modbus_read_input_registers(m_ModbusRTUDevice, tempAddress, 16, sgl_tempt); + if(MODBUS_ERR == ret_tempt) + { + // qDebug() << "modbus no message"; + goto label; + } + else + { + QByteArray sendArray = QByteArray::fromRawData(reinterpret_cast(m_ModbusRTUDevice->sendMsg), m_ModbusRTUDevice->sendMsgLen); + emit sig_showModbusData_sgl_tempt(sendArray, TypeSendData, sgl_tempt); + free(m_ModbusRTUDevice->sendMsg); + QByteArray recvArray = QByteArray::fromRawData(reinterpret_cast(m_ModbusRTUDevice->recvMsg), m_ModbusRTUDevice->recvMsgLen); + emit sig_showModbusData_sgl_tempt(recvArray, TypeRecvData, sgl_tempt); + free(m_ModbusRTUDevice->recvMsg); + } } @@ -171,7 +204,7 @@ void ModbusRTU::run() void ModbusRTU::write_regs_slot(int addr,const uint16_t data) { - qDebug() << "write:进入线程:" << QThread::currentThread(); + // qDebug() << "write:进入线程:" << QThread::currentThread(); int rc = write_single_register(addr, data); if(MODBUS_ERR == rc) { qDebug() << "######modbus no message"; @@ -181,7 +214,7 @@ void ModbusRTU::write_regs_slot(int addr,const uint16_t data) void ModbusRTU::read_regs_slot(int addr, int nb, uint16_t *data, int row) { - qDebug() << "read:进入线程:" << QThread::currentThread(); + // qDebug() << "read:进入线程:" << QThread::currentThread(); int rc = read_holding_register(addr, nb, data); if(MODBUS_ERR == rc) { // qDebug() << "modbus no message"; @@ -194,6 +227,12 @@ void ModbusRTU::read_regs_slot(int addr, int nb, uint16_t *data, int row) } } +void ModbusRTU::change_BMUIndex_slot(int index) +{ + BMUIndex = index; +} + + bool ModbusRTU::modbusRTUConnect(const char *comPort, int baudRate, char parity, int dataBit, int stopBit) { qDebug() << "comPort:" << comPort << "baudRate:" << baudRate << "parity:" << parity << "dataBit" << dataBit << "stopBit:" << stopBit; diff --git a/modbusrtu.h b/modbusrtu.h index f23d86e..f03912c 100644 --- a/modbusrtu.h +++ b/modbusrtu.h @@ -17,6 +17,9 @@ public: public slots: void write_regs_slot(int addr, const uint16_t data); void read_regs_slot(int addr, int nb, uint16_t *data, int row); + // void read_regs_input_slot_vol(int addr, int nb, uint16_t *data); + // void read_regs_input_slot_temp(int addr, int nb, uint16_t *data); + void change_BMUIndex_slot(int index); public: modbus_t *m_ModbusRTUDevice; @@ -26,6 +29,7 @@ public: char parity; int dataBit; int stopBit; + int BMUIndex = 0; public: void run() override; @@ -63,14 +67,15 @@ public: signals: void sig_ModbusRTUConnected(); - void sig_showModbusData(QByteArray byteArray, int dataType); - void sig_showModbusData_sgl_tempt(QByteArray byteArray, int dataType); - void sig_showModbusData_base_info1_45(QByteArray byteArray,int dataType); - void sig_showModbusData_base_info57_78(QByteArray byteArray,int dataType); - void sig_showModbusData_base_info83_106(QByteArray byteArray,int dataType); + void sig_showModbusData(QByteArray byteArray, int dataType, uint16_t *data); + void sig_showModbusData_sgl_tempt(QByteArray byteArray, int dataType, uint16_t *data); + void sig_showModbusData_base_info1_45(QByteArray byteArray,int dataType, uint16_t *data); + void sig_showModbusData_base_info57_78(QByteArray byteArray,int dataType, uint16_t *data); + void sig_showModbusData_base_info83_106(QByteArray byteArray,int dataType, uint16_t *data); void sig_showModbusData_base_info47_49_51_53_55(QByteArray byteArray,int dataType); void sig_showModbusData_base_info_list_47_49_51_53_55(QList byteArray,int dataType); void sig_showReadHoldingRegs(QByteArray byteArray,int dataType, int row, int nb); + void sig_showFault(QByteArray byteArray, int dataType, uint16_t *data); public slots: diff --git a/upgradeicon.cpp b/upgradeicon.cpp new file mode 100644 index 0000000..08fc449 --- /dev/null +++ b/upgradeicon.cpp @@ -0,0 +1,160 @@ +#include "upgradeicon.h" + +upgradeIcon::upgradeIcon(QWidget *parent) : QWidget(parent) +{ + setContentsMargins(0,0,0,0); + borderWidth = 4; + headWidth = 20; + value = 50; + minValue = 0; + maxValue = 100; + alarmValue = 20; + borderRadio = 10; + drawInRadio = 8; + borderColor = QColor(96, 96, 96); +} + +void upgradeIcon::paintEvent(QPaintEvent *) +{ + QPainter painter(this); + painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing); + drawBorder(&painter); + // drawRightHead(&painter); + drawBackground(&painter); + drawText(&painter); +} + +void upgradeIcon::resizeEvent(QResizeEvent *) +{ + +} + +// 画边框 +void upgradeIcon::drawBorder(QPainter *painter) +{ + painter->save(); + painter->setPen(QPen(borderColor,borderWidth)); + borderRect = QRect(borderWidth,borderWidth,width()-2*borderWidth-headWidth,height()-2*borderWidth); + painter->drawRoundedRect(borderRect,borderRadio,borderRadio); + painter->restore(); +} + +// 画右边电池头部 +void upgradeIcon::drawRightHead(QPainter *painter) +{ + painter->save(); + double headHeight = height()/2; + painter->setPen(Qt::NoPen); + painter->setBrush(QColor(96, 96, 96)); + QRectF headRect = QRectF(width()-headWidth-borderWidth/2,height()/2-headHeight/2,headWidth / 1.75,headHeight); + painter->drawRect(headRect); + painter->restore(); +} + +// 画数值对应颜色 +void upgradeIcon::drawBackground(QPainter *painter) +{ + painter->save(); + double batteryWidth = width()-headWidth-3*borderWidth; // 电池宽度 + double bgWidth= value * batteryWidth / (maxValue-minValue); // 背景绘制宽度 + QLinearGradient batteryGradient(QPointF(0, 0), QPointF(borderWidth+bgWidth,height())); + + batteryGradient.setColorAt(0.0, QColor(135, 206, 250)); + // batteryGradient.setColorAt(1.0, QColor(102, 255, 0)); + + painter->setBrush(QBrush(batteryGradient)); + painter->setPen(Qt::NoPen); + QRectF rectBg = QRectF(borderWidth+borderWidth/2,borderWidth+borderWidth/2,bgWidth,height()-3*borderWidth); + painter->drawRoundedRect(rectBg,drawInRadio,drawInRadio); + painter->restore(); +} + +// 画百分比数值 +void upgradeIcon::drawText(QPainter *painter) +{ + painter->save(); + QString value_str = QString("%1%").arg(value); + painter->setPen(QPen(QColor(Qt::black))); + double w = qMin(borderRect.width(),borderRect.height()); + // 文字大小自适应 90为控件初始高度,30位字体默认大小 + int fontSize = 30 * w / 90; + painter->setFont(QFont("Microsoft YaHei UI",fontSize)); + painter->drawText(borderRect,value_str,QTextOption(Qt::AlignHCenter | Qt::AlignVCenter)); + painter->restore(); +} + +// 设置当前值 +void upgradeIcon::setValue(int value) +{ + this->value = value; + update(); +} + +void upgradeIcon::setMinValue(int min) +{ + minValue = min; + update(); +} + +void upgradeIcon::setMaxValue(int max) +{ + maxValue = max; + update(); +} + +void upgradeIcon::setRange(int min, int max) +{ + minValue = min; + maxValue = max; + update(); +} + +void upgradeIcon::setBorderWidth(int width) +{ + borderWidth = width; + update(); +} + +void upgradeIcon::setBorderRadio(int radio) +{ + borderRadio = radio; + update(); +} + +void upgradeIcon::setInRadio(int radio) +{ + drawInRadio = radio; + update(); +} + +void upgradeIcon::setAlarmValue(int alarm) +{ + alarmValue = alarm; + update(); +} + +void upgradeIcon::setBorderColor(QColor color) +{ + borderColor = color; + update(); +} + +int upgradeIcon::getValue() +{ + return value; +} + +int upgradeIcon::getMinValue() +{ + return minValue; +} + +int upgradeIcon::getMaxValue() +{ + return maxValue; +} + +int upgradeIcon::getAlarmValue() +{ + return alarmValue; +} diff --git a/upgradeicon.h b/upgradeicon.h new file mode 100644 index 0000000..d1b2e66 --- /dev/null +++ b/upgradeicon.h @@ -0,0 +1,60 @@ +#ifndef UPGRADEICON_H +#define UPGRADEICON_H + +#include +#include +#include +#include + +class upgradeIcon : public QWidget +{ + Q_OBJECT + Q_PROPERTY(int value READ getValue WRITE setValue) + Q_PROPERTY(int minValue READ getMinValue WRITE setMinValue) + Q_PROPERTY(int maxValue READ getMaxValue WRITE setMaxValue) + Q_PROPERTY(int alarmValue READ getAlarmValue WRITE setAlarmValue) + +public: + explicit upgradeIcon(QWidget *parent = nullptr); + +protected: + void paintEvent(QPaintEvent *) override; + void resizeEvent(QResizeEvent *) override; + +protected: + void drawBorder(QPainter *painter); + void drawRightHead(QPainter *painter); + void drawBackground(QPainter *painter); + void drawText(QPainter *painter); + +public slots: + void setValue(int value); // 设置当前值 + void setMinValue(int min); // 设置最小值 + void setMaxValue(int max); // 设置最大值 + void setRange(int min,int max); // 设置数值范围 + void setBorderWidth(int width); // 设置边框宽度 + void setBorderRadio(int radio); // 设置外边框圆角 + void setInRadio(int radio); // 设置内部绘制区域圆角 + void setAlarmValue(int alarm); // 设置警告值 + void setBorderColor(QColor color); // 设置边框颜色 + int getValue(); // 获取当前值 + int getMinValue(); // 获取当前最小值 + int getMaxValue(); // 获取当前最大值 + int getAlarmValue(); // 获取告警值 + +signals: + +private: + int borderWidth; // 边缘线框宽度 + int headWidth; // 右侧头部宽度 + int value; // 当前值 + int minValue; // 最小值 + int maxValue; // 最大值 + int alarmValue; // 警告值 + int borderRadio; // 外部边框圆角 + int drawInRadio; // 内部绘制区域圆角 + QRectF borderRect; // 电池区域 + QColor borderColor; +}; + +#endif // UPGRADEICON_H