test

Dependencies:   ad5422_arduino mbed LT1446 ADS1248-1 LM35-1 Flash FT813 PGA280_ADS1259

display.h

Committer:
nikmaos
Date:
2020-08-08
Revision:
3:d4b106bf3a32
Child:
4:d53895f65eb7

File content as of revision 3:d4b106bf3a32:

#include "mbed.h"
#include "FT_Platform.h"
#include <string>

#ifndef DISPLAY_H_
#define DISPLAY_H_

/**************************************************************************************************************************
************************** Defines using for drawing **********************************************************************
**************************************************************************************************************************/

// all tracking touch screen areas
typedef enum {
    NONE_PRESS,
    CURR_TEMP_PRESS,
    CURR_HUM_PRESS,
    MENU_PRESS,
    CHROM_TEMP_PRESS,               //проверка кнопки
    CHROM_SET_TEMP_PRESS,           //устаносить температуру
    CHROM_SET_RASHOD_PRESS,         //установить расход
    CHROM_SET_SENSGAIN_PRESS,       //установить коэффициент усиления PGA
    CHROM_ANALIZ_PRESS,             //анализ
    CHROM_PROBA_PRESS,              //пробоотбор
} pressValues;

// all existing screens 
typedef enum {
    MENU_SCREEN,
    CURR_HUM_SCREEN,
    CURR_TEMP_SCREEN,
    TEST_CHROM_SCREEN,              //тестовый экран
} screenValues;


/**************************************************************************************************************************
************************** User class for drawing at FT800 ****************************************************************
**************************************************************************************************************************/

class Display
{
public:
    // in Display class we use FT800 TFT (definition is available in main.cpp)
    Display(FT813 *TFT) {
        _TFT = TFT;
    }

    // functions describing all available screens (screens-functions)
    void ChromTest(float temp,float ras,int temp_u,float ras_u); //тестовый экран
    void MainMenu(float humidity, float temperature);   // [display.Draw_MainMenu.cpp]
    void CurrentHumidity(float humidity);               // [display.Draw_CurrentValuesGraphs.cpp]
    void CurrentTemperature(float temperature);         // [display.Draw_CurrentValuesGraphs.cpp]

    // functions using to prepare FT800 re = recalibration
    void Calibration(char * calibration,char re);       // [display.Calibration.cpp]

    // functions for touch screen tracking
    char GetTouch(void);                                // [display.GetTouch.cpp]

    // variables using for navigation between screens
    char pressedButton;
    char activeScreen;

private:
    FT813 *_TFT;

    void StartDL(void);                                 // [display.DisplayListFunctions.cpp]
    void FinishDL(void);                                // [display.DisplayListFunctions.cpp]
    void MainMenuReference(void);                       // [display.Draw_MainMenuReference.cpp]
    void HorisontalGrid_CurrentTemp(void);              // [display.Draw_Grids.cpp]
    void HorisontalGrid_CurrentHumidity(void);          // [display.Draw_Grids.cpp]
    

    void CreateStringTempHum(char *str, float number, bool isTemp);       // [display.StringsTransforming.cpp]

    char humidityStr[8], temperatureStr[8];
    char currentHumidity_X, currentTemperature_X;
    char currentHumidity_Y[68], currentTemperature_Y[68];
};

#endif /* SCREENS_H_ */