Vitaliy Loginov
/
disp70
Riverdi 70
TFT/display.Draw_Grids.cpp@0:e46c1282b39f, 2020-06-18 (annotated)
- Committer:
- vitlog
- Date:
- Thu Jun 18 13:18:02 2020 +0000
- Revision:
- 0:e46c1282b39f
Riverdi EVE 70
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vitlog | 0:e46c1282b39f | 1 | #include "display.h" |
vitlog | 0:e46c1282b39f | 2 | |
vitlog | 0:e46c1282b39f | 3 | /************************************************************************************************************************** |
vitlog | 0:e46c1282b39f | 4 | ************************** Draw horisontal grid for temperature (-50 .. +125) ********************************************* |
vitlog | 0:e46c1282b39f | 5 | **************************************************************************************************************************/ |
vitlog | 0:e46c1282b39f | 6 | void Display::HorisontalGrid_CurrentTemp() |
vitlog | 0:e46c1282b39f | 7 | { |
vitlog | 0:e46c1282b39f | 8 | (*_TFT).DL(COLOR_RGB(20, 20, 20)); |
vitlog | 0:e46c1282b39f | 9 | char gridNumb = 125 + 50; |
vitlog | 0:e46c1282b39f | 10 | for (int i = 70 * 16; i <= 225 * 16; i += 352) { |
vitlog | 0:e46c1282b39f | 11 | (*_TFT).DL(BEGIN(LINES)); |
vitlog | 0:e46c1282b39f | 12 | (*_TFT).DL(LINE_WIDTH(8)); |
vitlog | 0:e46c1282b39f | 13 | (*_TFT).DL(VERTEX2F(15 * 16, i)); |
vitlog | 0:e46c1282b39f | 14 | (*_TFT).DL(VERTEX2F(423 * 16, i)); |
vitlog | 0:e46c1282b39f | 15 | if (gridNumb >= 50) { |
vitlog | 0:e46c1282b39f | 16 | (*_TFT).Number(435, i/16 - 9, 26, 0, gridNumb - 50); |
vitlog | 0:e46c1282b39f | 17 | } else if (gridNumb == 25) { |
vitlog | 0:e46c1282b39f | 18 | (*_TFT).Text(435, i/16 - 9, 26, 0, "-25"); |
vitlog | 0:e46c1282b39f | 19 | } else if (gridNumb == 0) { |
vitlog | 0:e46c1282b39f | 20 | (*_TFT).Text(435, i/16 - 9, 26, 0, "-50"); |
vitlog | 0:e46c1282b39f | 21 | } |
vitlog | 0:e46c1282b39f | 22 | gridNumb = gridNumb - 25; |
vitlog | 0:e46c1282b39f | 23 | } |
vitlog | 0:e46c1282b39f | 24 | } |
vitlog | 0:e46c1282b39f | 25 | |
vitlog | 0:e46c1282b39f | 26 | /************************************************************************************************************************** |
vitlog | 0:e46c1282b39f | 27 | ************************** Draw horisontal grid for humidity (0 .. 100) *************************************************** |
vitlog | 0:e46c1282b39f | 28 | **************************************************************************************************************************/ |
vitlog | 0:e46c1282b39f | 29 | void Display::HorisontalGrid_CurrentHumidity() |
vitlog | 0:e46c1282b39f | 30 | { |
vitlog | 0:e46c1282b39f | 31 | (*_TFT).DL(COLOR_RGB(20, 20, 20)); |
vitlog | 0:e46c1282b39f | 32 | char gridNumb = 100; |
vitlog | 0:e46c1282b39f | 33 | for (int i = 70 * 16; i <= 220 * 16; i += 600) { |
vitlog | 0:e46c1282b39f | 34 | (*_TFT).DL(BEGIN(LINES)); |
vitlog | 0:e46c1282b39f | 35 | (*_TFT).DL(LINE_WIDTH(8)); |
vitlog | 0:e46c1282b39f | 36 | (*_TFT).DL(VERTEX2F(15 * 16, i)); |
vitlog | 0:e46c1282b39f | 37 | (*_TFT).DL(VERTEX2F(423 * 16, i)); |
vitlog | 0:e46c1282b39f | 38 | (*_TFT).Number(435, i/16 - 9, 26, 0, gridNumb); |
vitlog | 0:e46c1282b39f | 39 | gridNumb = gridNumb - 25; |
vitlog | 0:e46c1282b39f | 40 | } |
vitlog | 0:e46c1282b39f | 41 | } |
vitlog | 0:e46c1282b39f | 42 |