ESP3D  3.0
Firmware for ESP boards connected to 3D Printer
basicdisplay.h
Go to the documentation of this file.
1 /*
2  basicdisplay.h - display functions class
3 
4  Copyright (c) 2014 Luc Lebosse. All rights reserved.
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
21 #define SPLASH_SCREEN 0
22 #define MAIN_SCREEN 1
23 #define CALIBRATION_SCREEN 2
24 
25 #ifndef _BASICDISPLAY_H
26 #define _BASICDISPLAY_H
27 
28 
29 class Display
30 {
31 public:
32  Display();
33  ~Display();
34  bool begin();
35  void end();
36  void handle();
37  void show_screenID(uint8_t screenID);
38  void update_screen(bool force=false);
39  void clear_screen();
40  void progress(uint8_t v);
41  void SetStatus(const char * status);
42  bool startCalibration();
43 private:
44  bool main_screen(bool force = false);
45  bool display_signal(bool force = false);
46  bool display_IP(bool force = false);
47  bool splash();
48  bool showStatus(bool force = false);
49  bool _started;
50  uint8_t _screenID;
51  bool _splash_displayed;
52  uint _screenwidth;
53  uint _screenheight;
54  uint16_t sizetoFitSpace(const char * string, uint16_t maxwidth);
55  void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t color);
56  void drawRect(int16_t x, int16_t y, int16_t width, int16_t height, int16_t color);
57  void fillRect(int16_t x, int16_t y, int16_t width, int16_t height, int16_t color);
58  void setTextFont(uint8_t font);
59  void drawString(const char *string, int32_t poX, int32_t poY, int16_t color);
60  void drawXbm(int16_t x, int16_t y, int16_t width, int16_t height, int16_t color, const uint8_t *xbm);
61  void drawXbm(int16_t x, int16_t y, int16_t width, int16_t height, uint16_t fgcolor, uint16_t bgcolor, const uint8_t *xbm);
62  uint16_t getStringWidth(const char* text);
63  String _status;
64 };
65 
66 extern Display esp3d_display;
67 extern void display_progress(uint8_t v);
68 
69 #endif //_BASICDISPLAY_H
70 
Display::show_screenID
void show_screenID(uint8_t screenID)
Display::end
void end()
Display::begin
bool begin()
display_progress
void display_progress(uint8_t v)
Display::~Display
~Display()
Display::SetStatus
void SetStatus(const char *status)
esp3d_display
Display esp3d_display
Display
Definition: advanceddisplay.h:29
Display::Display
Display()
Display::update_screen
void update_screen(bool force=false)
Display::progress
void progress(uint8_t v)
Display::display_IP
bool display_IP(bool force=false)
Display::handle
void handle()
Display::startCalibration
bool startCalibration()
Display::clear_screen
void clear_screen()