#ifndef WIDGET_H #define WIDGET_H #include #include "udphelper.h" #include "volviewform.h" #include #include #include #include #include namespace Ui { class Widget; } //ST7735驱动 #define ST7735_ERROR #define JY242 //景园2.42寸屏幕 #ifdef ST7735_ERROR //ST7735 驱动使用GRB红色与蓝色位置相反 #define LABEL_RED "QLabel{color: blue;}" #define LABEL_GREEN "QLabel{color: rgb(255, 255, 255);}" #define LABEL_SELECT "background-color:blue;color: white;" #define LABEL_Defalut "background-color:rgb(0, 0, 0);color: white;" #else #define LABEL_RED "QLabel{color: red;}" #define LABEL_GREEN "QLabel{color: rgb(115, 210, 22);}" #define LABEL_SELECT "background-color:rgb(115, 210, 22);color: white;" #define LABEL_Defalut "background-color:rgb(85, 87, 83);color: rgb(115, 210, 22);" #endif class Widget : public QWidget { Q_OBJECT public: explicit Widget(QWidget *parent = 0); ~Widget(); void setInitData(QGraphicsProxyWidget* pAngleCtrl, QGraphicsView* pView, int nWidget,int nHight); //是否显示详细数据 int getShowModeIndex(); int getShowPagIndex(); int getShowSubIndex(); int getShowPHIndex(); void setShowPHIndex(int nIndex); //更新日期IP void UpdateDate(); QString ReadIP(); void SetData(QLabel* pLab,QString strShow); void SetV(QString strShow); void SetA(QString strShow); void SetW(QString strShow); void SetF(QString strShow); void SetSUM(QString strShow); void SetIP(QString strIP); void SetT(QString strShow); void SetH(QString strShow); void setCH(int nIndex); void setPH(int nIndex,int nPhID); void SetStatus(QString strShow); //点击事件 //void BtnDown(int nButtonID,int nDownType); //上翻页 void pageUp(); //下翻页 void pageDown(); //切换页面 void ChangeView(int widgetType,int nIndex); //modbus设置 void setSelectStatus(int nIndex); void CtrlBtnSet(int nIndex,int nData); int nMAXChildIndex; private slots: void slot_TimerRun(); public: Ui::Widget *ui; private: UdpHelper* udpHelper; int device_type ; int device_chn ; QList volView; //当前显示页面ID int nChidIndex; int nChidPHIndex; int m_nAngle; QGraphicsProxyWidget* m_pAngleCtrl; QGraphicsView* m_pView; int m_nWidth; int m_nHeight; QTimer* m_Timer; }; #endif // WIDGET_H