Version1

Dependencies:   BSP_DISCO_F746NG DHT22

Committer:
antoinnneee
Date:
Mon Jun 22 15:16:28 2020 +0000
Revision:
0:d60753bdf6d7
FirstCommit;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
antoinnneee 0:d60753bdf6d7 1 #ifndef VIEW_H
antoinnneee 0:d60753bdf6d7 2 #define VIEW_H
antoinnneee 0:d60753bdf6d7 3 #include "mbed.h"
antoinnneee 0:d60753bdf6d7 4 #include "button.h"
antoinnneee 0:d60753bdf6d7 5 #include "gauge.h"
antoinnneee 0:d60753bdf6d7 6 #include "stm32746g_discovery_lcd.h"
antoinnneee 0:d60753bdf6d7 7 #include <list>
antoinnneee 0:d60753bdf6d7 8
antoinnneee 0:d60753bdf6d7 9 #include <DHT22/DHT22.h>
antoinnneee 0:d60753bdf6d7 10 #define SCREENWIDTH 480
antoinnneee 0:d60753bdf6d7 11 #define SCREENHEIGHT 272
antoinnneee 0:d60753bdf6d7 12
antoinnneee 0:d60753bdf6d7 13 /*
antoinnneee 0:d60753bdf6d7 14 class View regrouppant les diferent element graphique et permettant le
antoinnneee 0:d60753bdf6d7 15 transfert des positions
antoinnneee 0:d60753bdf6d7 16 */
antoinnneee 0:d60753bdf6d7 17
antoinnneee 0:d60753bdf6d7 18
antoinnneee 0:d60753bdf6d7 19 class View
antoinnneee 0:d60753bdf6d7 20 {
antoinnneee 0:d60753bdf6d7 21 public:
antoinnneee 0:d60753bdf6d7 22 View(int width = SCREENWIDTH, int height = SCREENHEIGHT, uint32_t bgColor = LCD_COLOR_WHITE);
antoinnneee 0:d60753bdf6d7 23 void contain(int x, int y);
antoinnneee 0:d60753bdf6d7 24 void draw();
antoinnneee 0:d60753bdf6d7 25 DHT22 *dht;
antoinnneee 0:d60753bdf6d7 26 void updateGauge();
antoinnneee 0:d60753bdf6d7 27 private :
antoinnneee 0:d60753bdf6d7 28 int16_t m_width = SCREENWIDTH;
antoinnneee 0:d60753bdf6d7 29 int16_t m_height = SCREENHEIGHT;
antoinnneee 0:d60753bdf6d7 30 uint32_t m_bgColor = LCD_COLOR_WHITE;
antoinnneee 0:d60753bdf6d7 31 list <Button*> m_buttonList;
antoinnneee 0:d60753bdf6d7 32 Gauge* temperatureGauge;
antoinnneee 0:d60753bdf6d7 33 Gauge* humidityGauge;
antoinnneee 0:d60753bdf6d7 34 void setGaugeValue(float(DHT22::*funcGauge)(), Gauge* targetGauge);
antoinnneee 0:d60753bdf6d7 35 void drawImage(int offsetX, int offsetY, int type);
antoinnneee 0:d60753bdf6d7 36 int m_lastType = 0;
antoinnneee 0:d60753bdf6d7 37 };
antoinnneee 0:d60753bdf6d7 38
antoinnneee 0:d60753bdf6d7 39 #endif