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.

78 lines
3.0 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __SDL_FLY_HUNTER_WIDGET_HEADER__
  2. #define __SDL_FLY_HUNTER_WIDGET_HEADER__
  3. #include "../core/coreWidget.h"
  4. #include "../core/coreLabel.h"
  5. #include "buttonWidget.h"
  6. #include "simpleButtonWidget.h"
  7. #include "simplePanelWidget.h"
  8. #include "scrollListWidget.h"
  9. //typedef enum E_FH_MODE_FLAGS {
  10. // MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1, /* 0b00000001 Reserved for future use. | */
  11. // MAV_MODE_FLAG_TEST_ENABLED = 2, /* 0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations. | */
  12. // MAV_MODE_FLAG_AUTO_ENABLED = 4, /* 0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation. | */
  13. // MAV_MODE_FLAG_GUIDED_ENABLED = 8, /* 0b00001000 guided mode enabled, system flies waypoints / mission items. | */
  14. // MAV_MODE_FLAG_STABILIZE_ENABLED = 16, /* 0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around. | */
  15. // MAV_MODE_FLAG_HIL_ENABLED = 32, /* 0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational. | */
  16. // MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64, /* 0b01000000 remote control input is enabled. | */
  17. // MAV_MODE_FLAG_SAFETY_ARMED = 128
  18. //}FH_MODE_FLAGS;
  19. class objectFlyHunter;
  20. class sdlOsdVideoWidget;
  21. extern objectFlyHunter* mHNT;
  22. class sdlFlyHunterWidget: public sdlCoreWidget{
  23. private:
  24. sdlLabel * m_pNameLabel;
  25. sdlLabel * m_pTypeLabel;
  26. sdlLabel * m_pModeLabel;
  27. sdlLabel * m_pCustomModeLabel;
  28. sdlScrollListWidget * m_pComPorts;
  29. sdlButtonWidget * m_pArmMode;
  30. sdlButtonWidget * m_pLandNow;
  31. sdlButtonWidget * m_pTakeOff;
  32. sdlButtonWidget * m_pFlyHome;
  33. sdlButtonWidget * m_pSetHome;
  34. sdlButtonWidget * m_pHoldPosition;
  35. sdlButtonWidget * m_pLockXY;
  36. sdlButtonWidget * m_pLockYZ;
  37. sdlSimpleButtonWidget * m_pReconnect;
  38. sdlSimplePanel * m_pFHNfoPanel;
  39. sdlSimplePanel * m_pFHBasicModePanel;
  40. sdlSimpleButtonWidget * m_pActualModeFlag[8];
  41. sdlSimpleButtonWidget * m_pNewModeFlag[8];
  42. sdlSimpleButtonWidget * m_pSetModeButton;
  43. sdlSimplePanel * m_pFHSetModePanel;
  44. uint8_t m_bStatusCheckerCnt;
  45. uint8_t m_bStatusFH;
  46. uint8_t m_bStatusRadio;
  47. uint8_t m_bStatusDrone;
  48. uint8_t m_bStatusGPS;
  49. uint64_t m_bBlinkingTO;
  50. bool m_bBlinkingLVL;
  51. objectFlyHunter * m_pFH;
  52. sdlOsdVideoWidget * m_pOSD;
  53. CSTR m_pName;
  54. CSTR m_pType;
  55. CSTR m_pMode;
  56. CSTR m_pCustomMode;
  57. TEXTURE_HEAP_ITEM * m_pCtrlTex;
  58. bool m_bBasicModeActual;
  59. bool m_bCustomModeActual;
  60. virtual void drawBefore(SDL_Renderer* pRenderer);
  61. virtual void drawAfter(SDL_Renderer* pRenderer);
  62. virtual bool create(void);
  63. public:
  64. explicit sdlFlyHunterWidget(int x, int y, int width, int height, sdlCoreWidget* pParent = NULL);
  65. ~sdlFlyHunterWidget();
  66. void attachFlyHunter(objectFlyHunter* ptr);
  67. void attachOSD(sdlOsdVideoWidget* ptr);
  68. };
  69. #endif