test
Dependencies: ad5422_arduino mbed LT1446 ADS1248-1 LM35-1 Flash FT813 PGA280_ADS1259
display.h@4:d53895f65eb7, 2020-08-11 (annotated)
- Committer:
- nikmaos
- Date:
- Tue Aug 11 19:13:43 2020 +0000
- Revision:
- 4:d53895f65eb7
- Parent:
- 3:d4b106bf3a32
- Child:
- 5:21240fa1ee4c
1108
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 | 4:d53895f65eb7 | 26 | typedef enum {//для клавиатуры цифр |
nikmaos | 4:d53895f65eb7 | 27 | NONE_PRESS, |
nikmaos | 4:d53895f65eb7 | 28 | NUMB_0, |
nikmaos | 4:d53895f65eb7 | 29 | NUMB_1, |
nikmaos | 4:d53895f65eb7 | 30 | NUMB_2, |
nikmaos | 4:d53895f65eb7 | 31 | NUMB_3, |
nikmaos | 4:d53895f65eb7 | 32 | NUMB_4, |
nikmaos | 4:d53895f65eb7 | 33 | NUMB_5, |
nikmaos | 4:d53895f65eb7 | 34 | NUMB_6, |
nikmaos | 4:d53895f65eb7 | 35 | NUMB_7, |
nikmaos | 4:d53895f65eb7 | 36 | NUMB_8, |
nikmaos | 4:d53895f65eb7 | 37 | NUMB_9, |
nikmaos | 4:d53895f65eb7 | 38 | SYM_DOT, |
nikmaos | 4:d53895f65eb7 | 39 | }pressCipher; |
nikmaos | 4:d53895f65eb7 | 40 | |
nikmaos | 4:d53895f65eb7 | 41 | //выбранная ячейка для редактирования |
nikmaos | 4:d53895f65eb7 | 42 | typedef enum{ |
nikmaos | 4:d53895f65eb7 | 43 | EDIT_P1, |
nikmaos | 4:d53895f65eb7 | 44 | EDIT_I1, |
nikmaos | 4:d53895f65eb7 | 45 | EDIT_D1, |
nikmaos | 4:d53895f65eb7 | 46 | |
nikmaos | 4:d53895f65eb7 | 47 | EDIT_P2, |
nikmaos | 4:d53895f65eb7 | 48 | EDIT_I2, |
nikmaos | 4:d53895f65eb7 | 49 | EDIT_D2, |
nikmaos | 4:d53895f65eb7 | 50 | }selectedEditor; |
nikmaos | 4:d53895f65eb7 | 51 | |
nikmaos | 3:d4b106bf3a32 | 52 | // all existing screens |
nikmaos | 3:d4b106bf3a32 | 53 | typedef enum { |
nikmaos | 3:d4b106bf3a32 | 54 | MENU_SCREEN, |
nikmaos | 3:d4b106bf3a32 | 55 | CURR_HUM_SCREEN, |
nikmaos | 3:d4b106bf3a32 | 56 | CURR_TEMP_SCREEN, |
nikmaos | 3:d4b106bf3a32 | 57 | TEST_CHROM_SCREEN, //тестовый экран |
nikmaos | 4:d53895f65eb7 | 58 | PID_SCREEN, |
nikmaos | 3:d4b106bf3a32 | 59 | } screenValues; |
nikmaos | 3:d4b106bf3a32 | 60 | |
nikmaos | 3:d4b106bf3a32 | 61 | |
nikmaos | 3:d4b106bf3a32 | 62 | /************************************************************************************************************************** |
nikmaos | 3:d4b106bf3a32 | 63 | ************************** User class for drawing at FT800 **************************************************************** |
nikmaos | 3:d4b106bf3a32 | 64 | **************************************************************************************************************************/ |
nikmaos | 3:d4b106bf3a32 | 65 | |
nikmaos | 3:d4b106bf3a32 | 66 | class Display |
nikmaos | 3:d4b106bf3a32 | 67 | { |
nikmaos | 3:d4b106bf3a32 | 68 | public: |
nikmaos | 3:d4b106bf3a32 | 69 | // in Display class we use FT800 TFT (definition is available in main.cpp) |
nikmaos | 3:d4b106bf3a32 | 70 | Display(FT813 *TFT) { |
nikmaos | 3:d4b106bf3a32 | 71 | _TFT = TFT; |
nikmaos | 3:d4b106bf3a32 | 72 | } |
nikmaos | 3:d4b106bf3a32 | 73 | |
nikmaos | 3:d4b106bf3a32 | 74 | // functions describing all available screens (screens-functions) |
nikmaos | 3:d4b106bf3a32 | 75 | void ChromTest(float temp,float ras,int temp_u,float ras_u); //тестовый экран |
nikmaos | 3:d4b106bf3a32 | 76 | void MainMenu(float humidity, float temperature); // [display.Draw_MainMenu.cpp] |
nikmaos | 3:d4b106bf3a32 | 77 | void CurrentHumidity(float humidity); // [display.Draw_CurrentValuesGraphs.cpp] |
nikmaos | 3:d4b106bf3a32 | 78 | void CurrentTemperature(float temperature); // [display.Draw_CurrentValuesGraphs.cpp] |
nikmaos | 3:d4b106bf3a32 | 79 | |
nikmaos | 3:d4b106bf3a32 | 80 | // functions using to prepare FT800 re = recalibration |
nikmaos | 3:d4b106bf3a32 | 81 | void Calibration(char * calibration,char re); // [display.Calibration.cpp] |
nikmaos | 3:d4b106bf3a32 | 82 | |
nikmaos | 3:d4b106bf3a32 | 83 | // functions for touch screen tracking |
nikmaos | 3:d4b106bf3a32 | 84 | char GetTouch(void); // [display.GetTouch.cpp] |
nikmaos | 3:d4b106bf3a32 | 85 | |
nikmaos | 3:d4b106bf3a32 | 86 | // variables using for navigation between screens |
nikmaos | 3:d4b106bf3a32 | 87 | char pressedButton; |
nikmaos | 3:d4b106bf3a32 | 88 | char activeScreen; |
nikmaos | 3:d4b106bf3a32 | 89 | |
nikmaos | 3:d4b106bf3a32 | 90 | private: |
nikmaos | 3:d4b106bf3a32 | 91 | FT813 *_TFT; |
nikmaos | 3:d4b106bf3a32 | 92 | |
nikmaos | 3:d4b106bf3a32 | 93 | void StartDL(void); // [display.DisplayListFunctions.cpp] |
nikmaos | 3:d4b106bf3a32 | 94 | void FinishDL(void); // [display.DisplayListFunctions.cpp] |
nikmaos | 3:d4b106bf3a32 | 95 | void MainMenuReference(void); // [display.Draw_MainMenuReference.cpp] |
nikmaos | 3:d4b106bf3a32 | 96 | void HorisontalGrid_CurrentTemp(void); // [display.Draw_Grids.cpp] |
nikmaos | 3:d4b106bf3a32 | 97 | void HorisontalGrid_CurrentHumidity(void); // [display.Draw_Grids.cpp] |
nikmaos | 3:d4b106bf3a32 | 98 | |
nikmaos | 3:d4b106bf3a32 | 99 | |
nikmaos | 3:d4b106bf3a32 | 100 | void CreateStringTempHum(char *str, float number, bool isTemp); // [display.StringsTransforming.cpp] |
nikmaos | 3:d4b106bf3a32 | 101 | |
nikmaos | 3:d4b106bf3a32 | 102 | char humidityStr[8], temperatureStr[8]; |
nikmaos | 3:d4b106bf3a32 | 103 | char currentHumidity_X, currentTemperature_X; |
nikmaos | 3:d4b106bf3a32 | 104 | char currentHumidity_Y[68], currentTemperature_Y[68]; |
nikmaos | 3:d4b106bf3a32 | 105 | }; |
nikmaos | 3:d4b106bf3a32 | 106 | |
nikmaos | 3:d4b106bf3a32 | 107 | #endif /* SCREENS_H_ */ |