You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.4 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __TIME_SHOW_WIDGET_HEADER__
  2. #define __TIME_SHOW_WIDGET_HEADER__
  3. #include <time.h>
  4. #include "../guiClass.h"
  5. #include "../../components/base/basicEventHandler.h"
  6. #include "../../components/base/basicEventHeap.h"
  7. typedef enum{
  8. TSW_NO_STATUS=0,
  9. TSW_NO_CONNECTION,
  10. TSW_LEARNING,
  11. TSW_ARMING,
  12. TSW_ARMED,
  13. TSW_ALARMING,
  14. TSW_ALARMED,
  15. TSW_DEARMING
  16. } TSW_STATUS;
  17. class TimeShowWidget : public QWidget, public basicEventHandler {
  18. private:
  19. QPixmap *m_pGreenPixmap;
  20. QPixmap *m_pRedPixmap;
  21. QPixmap *m_pGrayPixmap;
  22. QPixmap *m_pBluePixmap;
  23. QPixmap *m_pArmedPixmap[10];
  24. QPixmap *m_pPreArmedPixmap[10];
  25. QPixmap *m_pAlarmedPixmap[10];
  26. int m_iLogoSize;
  27. int m_iLogoIndex;
  28. int m_iLogoStage;
  29. TSW_STATUS m_bWorkingStatus;
  30. QLCDNumber *m_pYearNumber;
  31. QLCDNumber *m_pMonthNumber;
  32. QLCDNumber *m_pDayNumber;
  33. QLCDNumber *m_pHourNumber;
  34. QLCDNumber *m_pMinutesNumber;
  35. QLCDNumber *m_pSecondsNumber;
  36. QPixmap *m_pPixmap;
  37. QPixmap *m_pOverlayPixmap;
  38. QTimer *m_pClockTimer;
  39. QTimer *m_pLogoTimer;
  40. QLabel *m_pLogoLabel;
  41. public:
  42. explicit TimeShowWidget(QWidget *parent = NULL);
  43. ~TimeShowWidget();
  44. void setLogoSize(int Z);
  45. void setStatus(TSW_STATUS S){ m_bWorkingStatus = S; };
  46. public slots:
  47. void dispatchEvent(basicEvent *Evt);
  48. void updateClock();
  49. void updateLogo();
  50. };
  51. #endif