#ifndef COUNTERWINDOWRT_H #define COUNTERWINDOWRT_H #include <QWidget> #include <QLabel> #include <QTimer> #include <QDate> #include <QTime> #include <QFile> #include <QThread> #include <QMessageBox> #include "CounterDevice.h" #include "CounterChannel.h" #include "QLabelDblClick.h" #include "ChannelChartForm.h" #include "CounterSettingForm.h" #include "common/utils/SettingConfig.h" #include "common/utils/TimerCounterUtil.h" #include "common/HttpRequestController.h" #include "common/HttpServer.h" #ifdef unix #include "common/utils/QKafkaConsumer.h" #endif QT_BEGIN_NAMESPACE namespace Ui { class CounterWindowRT; } QT_END_NAMESPACE class CounterWindowRT : public QWidget { Q_OBJECT public: CounterWindowRT(QWidget *parent = nullptr); ~CounterWindowRT(); public slots: void keyPressEvent(QKeyEvent *event); void onChannelSettingSubmit(QJsonArray channelSettings); private: Ui::CounterWindowRT *ui; CounterSettingForm * settingForm; QSystemTrayIcon * trayIcon; QVector<QLabel *> devTitleList; // 计数器设备标题的QLabel集合 QVector<QLabel *> devRefList; // Ref通道 QVector<QLabel *> devCompRefList; // 归算Ref通道 QVector<QLabel *> channelNameList; // 通道名的QLabel集合 QVector<QLabel *> channelValueList; // 通道测量值的QLabel集合 QVector<QLabel *> computeValueList; // 通道归算值的QLabel集合 HttpRequestController * httpReq; #ifdef unix QKafkaConsumer * kafkaConsumer; QKafkaConsumer * alarmMsgConsumer; #endif QVector<QString> alarmDev; QVector<QString> offlineDev; QVector<QString> alarmChannel; QVector<QString> offlineChannel; void getDeviceList(); QList<QString> getClockNumList(); void getChannelList(QString deviceId); void initDevAndChannelForm(int count); void updateChannelDataForm(QJsonArray messageArray); void updateDeviceAlarm(QJsonArray alarmList); void findRefAndMeasureChannel(); // 查找主备路的测量参考通道以及各自的测量通道 double calculateAvgStandbyTimeDiff(QList<QStringList> thisChannel, QList<QStringList> refChannel, QList<QStringList> standbyChannel); private slots: void updateDateAndTime(); void watchStandbyConsistency(); int initHttpToken(); void on_btnMenuMin_clicked(); void on_btnMenuSetting_clicked(); void onTrayIconActived(QSystemTrayIcon::ActivationReason reason); void initChannelForm(); void updateDeviceWidget(); void onChannelNameLabelDblClicked(); void drawCounterDataOnPage(QJsonArray messageArray); void onKafkaMessageReceived(QJsonObject message); void onAlarmMessageReceived(QJsonObject alarmMsg); void onCounterMaserHeartHandle(); }; #endif // COUNTERWINDOWRT_H