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.

67 lines
1.9 KiB

7 years ago
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __LRF_SENSOR_WIDGET_HEADER__
  2. #define __LRF_SENSOR_WIDGET_HEADER__
  3. #include <time.h>
  4. #include "../guiClass.h"
  5. #include "../../components/base/basicEventHandler.h"
  6. #include "../../components/base/basicEventHeap.h"
  7. #include "../../components/object/objectLGS.h"
  8. #include "../dialogs/SettingsLgsDialog.h"
  9. class DeviceChooser;
  10. class LrfSensorWidget : public QFrame, public basicEventHandler{
  11. private:
  12. E_LGS_STAGE m_eStatus;
  13. E_CLIENT_WORK_MODE m_eMode;
  14. DeviceChooser *m_pParent;
  15. uint32_t m_nRangeMap[TH_SIZE_NODES];
  16. bool m_bIsSelected;
  17. QTimer *m_pStatusTimer; // 1/3 sec
  18. QTimer *m_pLogoTimer; // 1/5 sec
  19. QLabel *m_pLogoLabel;
  20. QLabel *m_pNameLabel;
  21. QLabel *m_pStatusLabel;
  22. QPushButton *m_pBtnSettings;
  23. QPushButton *m_pBtnRefresh;
  24. QProgressBar *m_pProgressBar;
  25. QPushButton *m_pBtnMasking;
  26. QPushButton *m_pBtnAddMask;
  27. QPushButton *m_pBtnDelMask;
  28. QPushButton *m_pBtnUpdateMask;
  29. QComboBox *m_pCBoxLrfID;
  30. objectLGS *m_pDevice;
  31. /* Gui Res*/
  32. QPixmap *m_pGreenPixmap;
  33. QPixmap *m_pRedPixmap;
  34. QPixmap *m_pGrayPixmap;
  35. QPixmap *m_pBluePixmap;
  36. /* GUI controlls */
  37. DialogSettingsLGS *m_pSettingsDialog;
  38. public:
  39. explicit LrfSensorWidget( DeviceChooser *parent = NULL );
  40. virtual ~LrfSensorWidget();
  41. bool attachDevice( objectLGS *dev );
  42. bool attachRangeMap();
  43. virtual void dispatchEvent( basicEvent *Evt );
  44. bool loadFromFile( char *fName );
  45. bool saveIntoFile( char *fName );
  46. public slots:
  47. bool event(QEvent *event);
  48. void setSelected( bool val );
  49. void sensorSettings();
  50. void refreshRangeMap();
  51. void updateStatus();
  52. void updateLogo();
  53. void setStatus( E_LGS_STAGE st );
  54. void activateMasks( void );
  55. void disableMasks( void );
  56. void updateMasks(void);
  57. void addMask( void );
  58. void delMask( void );
  59. };
  60. #endif