![](/media/cache/profiles/9f0876a200701e5fdece2e58aa965574.jpg.50x50_q85.jpg)
Русифицированная версия программы для измерения температуры и отн. влажности и вывода информации на сенсорный TFT
Dependencies: FT800_2 HYT mbed
display.h
00001 #include "mbed.h" 00002 #include "FT_Platform.h" 00003 #include "pictures.h" 00004 #include "statistics.h" 00005 #include <string> 00006 00007 #ifndef DISPLAY_H_ 00008 #define DISPLAY_H_ 00009 00010 /************************************************************************************************************************** 00011 ************************** Defines using for drawing ********************************************************************** 00012 **************************************************************************************************************************/ 00013 00014 // all tracking touch screen areas 00015 typedef enum { 00016 NONE_PRESS, 00017 CURR_TEMP_PRESS, 00018 CURR_HUM_PRESS, 00019 STAT_TEMP_PRESS, 00020 STAT_HUM_PRESS, 00021 ZONE_1_PRESS, 00022 ZONE_2_PRESS, 00023 ZONE_3_PRESS, 00024 ZONE_4_PRESS, 00025 ZONE_5_PRESS, 00026 ZONE_6_PRESS, 00027 ZONE_7_PRESS, 00028 ZONE_8_PRESS, 00029 ABOUT_PRESS, 00030 MENU_PRESS, 00031 } pressValues; 00032 00033 // all screens available in app 00034 typedef enum { 00035 MENU_SCREEN, 00036 CURR_HUM_SCREEN, 00037 CURR_TEMP_SCREEN, 00038 ABOUT_SCREEN, 00039 HUM_24HRS_SCREEN, 00040 HUM_3HRS_SCREEN, 00041 HUM_30MIN_SCREEN, 00042 TEMP_24HRS_SCREEN, 00043 TEMP_3HRS_SCREEN, 00044 TEMP_30MIN_SCREEN 00045 } screenValues; 00046 00047 00048 /************************************************************************************************************************** 00049 ************************** User class for drawing at FT800 **************************************************************** 00050 **************************************************************************************************************************/ 00051 00052 class Display 00053 { 00054 public: 00055 // in Display class we use FT800 TFT (definition is available in main.cpp) 00056 Display(FT800 *TFT) { 00057 _TFT = TFT; 00058 } 00059 00060 // functions describing all available screens (screens-functions) 00061 void MainMenu(float humidity, float temperature); // [display.Draw_MainMenu.cpp] 00062 void CurrentHumidity(float humidity); // [display.Draw_CurrentValues.cpp] 00063 void CurrentTemperature(float temperature); // [display.Draw_CurrentValues.cpp] 00064 void StatHumidity_24hrs(volatile uint64_t seconds, short int statistics24hrs[3][288], 00065 uint64_t gridSecondsOffset); // [display.Draw_24hrsStatistics.cpp] 00066 void StatTemperature_24hrs(volatile uint64_t seconds, short int statistics24hrs[3][288], 00067 uint64_t gridSecondsOffset); // [display.Draw_24hrsStatistics.cpp] 00068 void StatHumidity_3hrs(volatile uint64_t seconds, short int statistics24hrs[3][288], 00069 uint64_t gridSecondsOffset); // [display.Draw_3hrsStatistics.cpp] 00070 void StatTemperature_3hrs(volatile uint64_t seconds, short int statistics24hrs[3][288], 00071 uint64_t gridSecondsOffset); // [display.Draw_3hrsStatistics.cpp] 00072 void StatHumidity_30min(volatile uint64_t seconds, short int statistics24hrs[3][288], 00073 uint64_t gridSecondsOffset); // [display.Draw_30minStatistics.cpp] 00074 void StatTemperature_30min(volatile uint64_t seconds, short int statistics24hrs[3][288], 00075 uint64_t gridSecondsOffset); // [display.Draw_30minStatistics.cpp] 00076 void AboutSensor(void); // [display.Draw_AboutSensor.cpp] 00077 00078 // functions using to prepare FT800 / FT801 00079 void LoadImagesAndFonts(void); // [display.LoadImagesAndFonts.cpp] 00080 void HandleAllBitmaps(void); // [display.LoadImagesAndFonts.cpp] 00081 void Calibration(void); // [display.Calibration.cpp] 00082 00083 // function for touchscreen tracking 00084 char GetTouch(void); // [display.GetTouch.cpp] 00085 00086 // variables using for navigation between screens 00087 char pressedButton; 00088 char activeScreen; 00089 char timePoint3hrs, timePoint30min; 00090 00091 private: 00092 FT800 *_TFT; 00093 00094 // For start and end every display list (every screen) 00095 void StartDL(void); // [display.DisplayListFunctions.cpp] 00096 void FinishDL(void); // [display.DisplayListFunctions.cpp] 00097 00098 // Utility function for drawing 00099 void MainMenuReference(void); // [display.Draw_MainMenuReference.cpp] 00100 void TimeSinceTurnOn(uint64_t seconds); // [display.Draw_TimeSinceTurnOn.cpp] 00101 void HorisontalGrid_Current_Temperature(void); // [display.Draw_Grids.cpp] 00102 void HorisontalGrid_Current_Humidity(void); // [display.Draw_Grids.cpp] 00103 void HorisontalGrid_Statistics_Temperature(void); // [display.Draw_Grids.cpp] 00104 void HorisontalGrid_Statistics_Humidity(void); // [display.Draw_Grids.cpp] 00105 void VerticalGrid3hrs(uint64_t gridSecondsOffset); // [display.Draw_Grids.cpp] 00106 void VerticalGrid24hrs(uint64_t gridSecondsOffset); // [display.Draw_Grids.cpp] 00107 void VerticalGrid30min(uint64_t gridSecondsOffset); // [display.Draw_Grids.cpp] 00108 00109 // String operations 00110 char CreateStringTempHum(char *str, float number, bool isTemp); // [display.StringsTransform.cpp] 00111 void CreateStringMultipliedTemp(char *str, short int number); // [display.StringsTransform.cpp] 00112 void CreateStringTime(char *str, uint32_t numberOfSeconds); // [display.StringsTransform.cpp] 00113 void CreateStringRussian(const string rustext); // [display.StringsTransform.cpp] 00114 00115 // String variables 00116 char humidityStr[8], temperatureStr[8]; 00117 char timeStr[9], gridTimeStr[9]; 00118 char russianStr[150]; 00119 00120 // Variables for managing graphs with current temperature or humidity 00121 char currentHumidity_X, currentTemperature_X; 00122 char currentHumidity_Y[68], currentTemperature_Y[68]; 00123 }; 00124 00125 #endif /* SCREENS_H_ */
Generated on Wed Jul 13 2022 04:41:34 by
![doxygen](doxygen.png)