Frästisch mit elektronischer Höhenverstellung mittels Schrittmotoren.
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.

Display.h 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Display.h
  3. *
  4. * Wrapper class for Adafruit OLED display.
  5. *
  6. * Created on: 28.01.2022
  7. * Author: FSmilari
  8. */
  9. #ifndef DISPLAY_H_
  10. #define DISPLAY_H_
  11. #include <Adafruit_SSD1306.h>
  12. #include <U8g2_for_Adafruit_GFX.h>
  13. #include <stdint.h>
  14. #include "images/SFToolsLogo.h"
  15. #include "images/ToolsBitmap.h"
  16. #include "images/NullingBitmap.h"
  17. #include "images/RotateBitmap.h"
  18. #include "images/DiveBitmap.h"
  19. #include "Status.h"
  20. #define SCREEN_WIDTH 128
  21. #define SCREEN_HEIGHT 64
  22. #define SCREEN_ADDRESS 0x3C
  23. #define STATUS_TXT_IDLE "OPR"
  24. #define STATUS_TXT_TOOLCHG "WZW"
  25. #define STATUS_TXT_CFG "SETUP"
  26. #define STATUS_TXT_NULLING "NULL"
  27. class Display {
  28. private:
  29. Adafruit_SSD1306 ssd1306;
  30. U8G2_FOR_ADAFRUIT_GFX u8g2_gfx;
  31. String configText;
  32. String configOption;
  33. bool wlsConnected;
  34. bool refreshScreen;
  35. int angle;
  36. unsigned long starttime;
  37. void drawStatusText(String txt);
  38. void drawBitmap(int x, int y, int w, int h, const uint8_t bitmap[]);
  39. void redrawFrame();
  40. void drawWLSStatus();
  41. void rotateAndDrawRotationBitmap();
  42. public:
  43. Display();
  44. void init(void);
  45. void display(void);
  46. void clearDisplay(void);
  47. void showBrand(void);
  48. void showInitialization(void);
  49. void showFrame(Status status);
  50. void drawConfigText(String txt);
  51. void drawConfigOption(String txt);
  52. const String& getConfigOption() const;
  53. void setConfigOption(const String &configOption);
  54. const String& getConfigText() const;
  55. void setConfigText(const String &configText);
  56. void setWlsConnected(bool wlsConnected);
  57. void setRefreshScreen();
  58. };
  59. #endif /* DISPLAY_H_ */