| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- #ifndef WIDGET_H
- #define WIDGET_H
- #include <QWidget>
- #include "udphelper.h"
- #include "volviewform.h"
- //#include <QList>
- #include <QLabel>
- #include <QGraphicsProxyWidget>
- #include <QGraphicsView>
- #include "msgwidget.h"
- namespace Ui {
- class Widget;
- }
- //ST7735驱动
- #define ST7735_ERROR
- #ifdef ST7735_ERROR
- //ST7735 驱动使用GRB红色与蓝色位置相反
- #define LABEL_RED "QLabel{color: blue;}"
- #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);"
- #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 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 SetCO2(QString strShow);
- void SetVer(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);
- void setMAXChildIndex(int nIndex);
- int nMAXChildIndex;
- //是否显示MSG
- bool isHiddenMSGWidget(){
- if(m_pMSGWidget)
- return m_pMSGWidget->isHidden();
- return false;
- }
- //点击任意按钮确认
- void ClickMSGBtn();
- //
- void adjustMSGWidgetPosition(bool isAuto=true);
- //设置显示方式
- void setMonwayType(int nType);
- protected:
- void resizeEvent(QResizeEvent *event) override;
- signals:
- void signal_ClickMSG();//报警确认
- void signal_SetData(QLabel* pLab,QString strShow);
- public slots:
- //改为异步刷新数据
- void SetData(QLabel* pLab,QString strShow);
- //显示msg窗口
- void ShowMSGWidget(QString strShowData);
- public:
- Ui::Widget *ui;
- private:
- UdpHelper* udpHelper;
- int device_type ;
- int device_chn ;
- //QList<VolViewForm*> volView;
- //当前显示页面ID
- int nChidIndex;
- int nChidPHIndex;
- QGraphicsProxyWidget* m_pAngleCtrl;
- QGraphicsView* m_pView;
- int m_nWidth;
- int m_nHeight;
- MSGWidget* m_pMSGWidget;//提示界面
- int nIndexShow;
- public:
- int m_nAngle;
- int m_nMonwayType;//1:总检测 2:分监分控 3:分监不控
- };
- #endif // WIDGET_H
|