#ifndef GLOBALPARAMETERS_H #define GLOBALPARAMETERS_H #pragma execution_character_set("utf-8") #include #include "singleton.h" class QAbstractTableModel; class QTableView; class MyTableModel; //采集设备参数所处的状态 typedef enum _tagSignalStatus { STATUS_NORMAL = 0, STATUS_WARN = 1, STATUS_ERROR = 2, STATUS_INFO = 3, }SignalStatus; typedef struct _ModelItem { SignalStatus status; std::string ParameterName; std::string value; std::string unit; std::string sampleTime; }ModelItem; typedef QList TableData; class CWaitorCursor { public: CWaitorCursor(); ~CWaitorCursor(); }; //全局变量 class AppData:public Singleton { public: AppData(token); ~AppData(); AppData(const AppData &other) = delete; AppData& operator=(const AppData &other) = delete; public: //数据表格的表头 QStringList lstDataTableHeaderText; //定时刷新间隔 int nTimeOut; //目标机器IP QString qsDestinationIp; //最后的错误信息 QString qsLastErrorString; }; //全局通用类 class AppCommon:public Singleton { public: AppCommon(token); ~AppCommon(); AppCommon(const AppCommon&)=delete; AppCommon& operator =(const AppCommon&)= delete; public: void InitializeTableView(MyTableModel* model,QTableView* tableView); }; #endif // GLOBALPARAMETERS_H