test
Dependencies: ad5422_arduino mbed LT1446 ADS1248-1 LM35-1 Flash FT813 PGA280_ADS1259
display.h@3:d4b106bf3a32, 2020-08-08 (annotated)
- Committer:
- nikmaos
- Date:
- Sat Aug 08 18:32:53 2020 +0000
- Revision:
- 3:d4b106bf3a32
- Child:
- 4:d53895f65eb7
808
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nikmaos | 3:d4b106bf3a32 | 1 | #include "mbed.h" |
nikmaos | 3:d4b106bf3a32 | 2 | #include "FT_Platform.h" |
nikmaos | 3:d4b106bf3a32 | 3 | #include <string> |
nikmaos | 3:d4b106bf3a32 | 4 | |
nikmaos | 3:d4b106bf3a32 | 5 | #ifndef DISPLAY_H_ |
nikmaos | 3:d4b106bf3a32 | 6 | #define DISPLAY_H_ |
nikmaos | 3:d4b106bf3a32 | 7 | |
nikmaos | 3:d4b106bf3a32 | 8 | /************************************************************************************************************************** |
nikmaos | 3:d4b106bf3a32 | 9 | ************************** Defines using for drawing ********************************************************************** |
nikmaos | 3:d4b106bf3a32 | 10 | **************************************************************************************************************************/ |
nikmaos | 3:d4b106bf3a32 | 11 | |
nikmaos | 3:d4b106bf3a32 | 12 | // all tracking touch screen areas |
nikmaos | 3:d4b106bf3a32 | 13 | typedef enum { |
nikmaos | 3:d4b106bf3a32 | 14 | NONE_PRESS, |
nikmaos | 3:d4b106bf3a32 | 15 | CURR_TEMP_PRESS, |
nikmaos | 3:d4b106bf3a32 | 16 | CURR_HUM_PRESS, |
nikmaos | 3:d4b106bf3a32 | 17 | MENU_PRESS, |
nikmaos | 3:d4b106bf3a32 | 18 | CHROM_TEMP_PRESS, //проверка кнопки |
nikmaos | 3:d4b106bf3a32 | 19 | CHROM_SET_TEMP_PRESS, //устаносить температуру |
nikmaos | 3:d4b106bf3a32 | 20 | CHROM_SET_RASHOD_PRESS, //установить расход |
nikmaos | 3:d4b106bf3a32 | 21 | CHROM_SET_SENSGAIN_PRESS, //установить коэффициент усиления PGA |
nikmaos | 3:d4b106bf3a32 | 22 | CHROM_ANALIZ_PRESS, //анализ |
nikmaos | 3:d4b106bf3a32 | 23 | CHROM_PROBA_PRESS, //пробоотбор |
nikmaos | 3:d4b106bf3a32 | 24 | } pressValues; |
nikmaos | 3:d4b106bf3a32 | 25 | |
nikmaos | 3:d4b106bf3a32 | 26 | // all existing screens |
nikmaos | 3:d4b106bf3a32 | 27 | typedef enum { |
nikmaos | 3:d4b106bf3a32 | 28 | MENU_SCREEN, |
nikmaos | 3:d4b106bf3a32 | 29 | CURR_HUM_SCREEN, |
nikmaos | 3:d4b106bf3a32 | 30 | CURR_TEMP_SCREEN, |
nikmaos | 3:d4b106bf3a32 | 31 | TEST_CHROM_SCREEN, //тестовый экран |
nikmaos | 3:d4b106bf3a32 | 32 | } screenValues; |
nikmaos | 3:d4b106bf3a32 | 33 | |
nikmaos | 3:d4b106bf3a32 | 34 | |
nikmaos | 3:d4b106bf3a32 | 35 | /************************************************************************************************************************** |
nikmaos | 3:d4b106bf3a32 | 36 | ************************** User class for drawing at FT800 **************************************************************** |
nikmaos | 3:d4b106bf3a32 | 37 | **************************************************************************************************************************/ |
nikmaos | 3:d4b106bf3a32 | 38 | |
nikmaos | 3:d4b106bf3a32 | 39 | class Display |
nikmaos | 3:d4b106bf3a32 | 40 | { |
nikmaos | 3:d4b106bf3a32 | 41 | public: |
nikmaos | 3:d4b106bf3a32 | 42 | // in Display class we use FT800 TFT (definition is available in main.cpp) |
nikmaos | 3:d4b106bf3a32 | 43 | Display(FT813 *TFT) { |
nikmaos | 3:d4b106bf3a32 | 44 | _TFT = TFT; |
nikmaos | 3:d4b106bf3a32 | 45 | } |
nikmaos | 3:d4b106bf3a32 | 46 | |
nikmaos | 3:d4b106bf3a32 | 47 | // functions describing all available screens (screens-functions) |
nikmaos | 3:d4b106bf3a32 | 48 | void ChromTest(float temp,float ras,int temp_u,float ras_u); //тестовый экран |
nikmaos | 3:d4b106bf3a32 | 49 | void MainMenu(float humidity, float temperature); // [display.Draw_MainMenu.cpp] |
nikmaos | 3:d4b106bf3a32 | 50 | void CurrentHumidity(float humidity); // [display.Draw_CurrentValuesGraphs.cpp] |
nikmaos | 3:d4b106bf3a32 | 51 | void CurrentTemperature(float temperature); // [display.Draw_CurrentValuesGraphs.cpp] |
nikmaos | 3:d4b106bf3a32 | 52 | |
nikmaos | 3:d4b106bf3a32 | 53 | // functions using to prepare FT800 re = recalibration |
nikmaos | 3:d4b106bf3a32 | 54 | void Calibration(char * calibration,char re); // [display.Calibration.cpp] |
nikmaos | 3:d4b106bf3a32 | 55 | |
nikmaos | 3:d4b106bf3a32 | 56 | // functions for touch screen tracking |
nikmaos | 3:d4b106bf3a32 | 57 | char GetTouch(void); // [display.GetTouch.cpp] |
nikmaos | 3:d4b106bf3a32 | 58 | |
nikmaos | 3:d4b106bf3a32 | 59 | // variables using for navigation between screens |
nikmaos | 3:d4b106bf3a32 | 60 | char pressedButton; |
nikmaos | 3:d4b106bf3a32 | 61 | char activeScreen; |
nikmaos | 3:d4b106bf3a32 | 62 | |
nikmaos | 3:d4b106bf3a32 | 63 | private: |
nikmaos | 3:d4b106bf3a32 | 64 | FT813 *_TFT; |
nikmaos | 3:d4b106bf3a32 | 65 | |
nikmaos | 3:d4b106bf3a32 | 66 | void StartDL(void); // [display.DisplayListFunctions.cpp] |
nikmaos | 3:d4b106bf3a32 | 67 | void FinishDL(void); // [display.DisplayListFunctions.cpp] |
nikmaos | 3:d4b106bf3a32 | 68 | void MainMenuReference(void); // [display.Draw_MainMenuReference.cpp] |
nikmaos | 3:d4b106bf3a32 | 69 | void HorisontalGrid_CurrentTemp(void); // [display.Draw_Grids.cpp] |
nikmaos | 3:d4b106bf3a32 | 70 | void HorisontalGrid_CurrentHumidity(void); // [display.Draw_Grids.cpp] |
nikmaos | 3:d4b106bf3a32 | 71 | |
nikmaos | 3:d4b106bf3a32 | 72 | |
nikmaos | 3:d4b106bf3a32 | 73 | void CreateStringTempHum(char *str, float number, bool isTemp); // [display.StringsTransforming.cpp] |
nikmaos | 3:d4b106bf3a32 | 74 | |
nikmaos | 3:d4b106bf3a32 | 75 | char humidityStr[8], temperatureStr[8]; |
nikmaos | 3:d4b106bf3a32 | 76 | char currentHumidity_X, currentTemperature_X; |
nikmaos | 3:d4b106bf3a32 | 77 | char currentHumidity_Y[68], currentTemperature_Y[68]; |
nikmaos | 3:d4b106bf3a32 | 78 | }; |
nikmaos | 3:d4b106bf3a32 | 79 | |
nikmaos | 3:d4b106bf3a32 | 80 | #endif /* SCREENS_H_ */ |