Quellcode durchsuchen

优化代码兼容性

YaoH vor 1 Monat
Ursprung
Commit
ccab601ae4
2 geänderte Dateien mit 10 neuen und 6 gelöschten Zeilen
  1. 6 0
      fireWidget/firingwidget.cpp
  2. 4 6
      fireWidget/firingwidget.h

+ 6 - 0
fireWidget/firingwidget.cpp

@@ -21,6 +21,12 @@
 #define ANSI_COLOR_GREEN "\x1B[32m"
 #define ANSI_COLOR_RESET "\x1B[0m"
 
+// Static constant definitions
+const int ErrorBlastStatusList::DEV_ERROR = 0xA0;
+const int ErrorBlastStatusList::BUS_SHORT = 0xA1;
+const int ErrorBlastStatusList::BUS_VOLTAGE_ERR = 0xA2;
+const int ErrorBlastStatusList::DET_OFFLINE_ERR = 0xA3;
+
 firingWidget::firingWidget(const int &row, const bool &select, const QString &uuid, QWidget *parent)
     : QWidget(parent),
       ui(new Ui::firingWidget),

+ 4 - 6
fireWidget/firingwidget.h

@@ -25,10 +25,10 @@ class firingWidget;
 class ErrorBlastStatusList {
    public:
     // Error code constants
-    static const int DEV_ERROR = 0xA0;        // Device exception
-    static const int BUS_SHORT = 0xA1;        // Bus short circuit
-    static const int BUS_VOLTAGE_ERR = 0xA2;  // Bus voltage abnormal
-    static const int DET_OFFLINE_ERR = 0xA3;  // Detonator offline
+    static const int DEV_ERROR;        // Device exception
+    static const int BUS_SHORT;        // Bus short circuit
+    static const int BUS_VOLTAGE_ERR;  // Bus voltage abnormal
+    static const int DET_OFFLINE_ERR;  // Detonator offline
 
     // Check if a status code exists in the error list
     static bool isErrorStatus(int code) { return getErrorMap().find(code) != getErrorMap().end(); }
@@ -51,8 +51,6 @@ class ErrorBlastStatusList {
     }
 };
 
-// The map will be initialized in the cpp file
-
 class firingWidget : public QWidget {
     Q_OBJECT