PS_Fgen_FW  4da88f4073c1cc65ea45c3a652a2751e495e50db
Firmware for an Power Supply and Function Generator build from an ATX power supply
Loading...
Searching...
No Matches
ScreenManagerClass Class Reference

Class that is used to control the screen. More...

#include <ScreenManager.h>

Public Member Functions

 ScreenManagerClass ()
 Constructor of the ScreenManagerClass.
 
void Init ()
 Initialize the ScreenManager.
 
void UpdateVisibilities ()
 Update the visibility of all screens.
 
void DoDraw ()
 Evaluate, if the screen should be redrawn.
 
void ShowUiMainPage ()
 This method can be used to show the main page (no MessageDialog or calibration page).
 
void ShowUiCalibrationMenu ()
 This method can be used to start the calibration and show the calibration page.
 
void ShowHideDeviceRWLMessage (bool showMessage)
 Show or hide a message indicating that the device is in RWL state (only controllable via SCPI commands).
 
void DeviceTimerTickISR ()
 This method is called periodically by the device timer ISR and runs in the ISR context.
 
void UpdateSettingsChangedIndicator (bool settingsChanged)
 Update the settings changed indicator (star indicating that there are unstored settings).
 
void UpdateCalibrationValidIndicator (bool calibrationValid)
 Update the calibration valid indicator (calibration icon indicating that the calibration factors are valid).
 
void KeyInput (Keys_t key)
 Method that is used to input keys (and encoder inputs) into the screen subsystem (and the UI_Lib).
 
bool TouchInput (uint16_t x, uint16_t y, TouchTypes touchType)
 Process a touch input at the given point (x, y)
 
void TouchHandlingISR ()
 Call this method cyclic for touch handling.
 

Public Attributes

bool RedrawScreenRequest
 Flag that indicates that the screen should be redrawn.
 
bool CurrentScreenNeedsPeriodicRedraw
 Flag that indicates if the current displayed screen needs to be periodically redrawn.
 
bool IsSplashScreenShown
 Variable used to keep track if the SplashScreen is shown.
 
uint16_t TimeCounter_SplashScreen_ms
 Timer conter value that is used to measure the time, the SplashScreen is shown.
 
uint16_t TimeCounter_ScreenRedraw_ms
 Variable used for measuring the time to the next screen redraw.
 
uint16_t TimeCounter_TouchHandling_ms
 Variable used for measuring the time to the next touch handling.
 

Private Member Functions

void uiBuildTree ()
 Build the VisualTree for all screens used for drawing.
 

Private Attributes

Adafruit_ILI9341 _tft
 ILI9341 graphics handle that is used with all drawing related methods.
 
XPT2046 _ts
 XPT2046 touchscreen handle.
 
unsigned long _touchStartTime = 0
 Start time of the touch.
 
TouchEventStates _touchEventState = TOUCH_EVENTS_WAIT_FOR_TOUCH
 Current state of the touch detection state machine.
 

Detailed Description

Class that is used to control the screen.

This class can be used for screen handling. It contains all necessary handles and methods.

Member Function Documentation

◆ DeviceTimerTickISR()

void ScreenManagerClass::DeviceTimerTickISR ( )

This method is called periodically by the device timer ISR and runs in the ISR context.

It is used to show or hide the SplashScreen.

◆ DoDraw()

void ScreenManagerClass::DoDraw ( )

Evaluate, if the screen should be redrawn.

If yes, the Draw method is called.

◆ Init()

void ScreenManagerClass::Init ( )

Initialize the ScreenManager.

This method initializes the u8g_lib and UI_Manager handles and builds the VisualTree.

◆ KeyInput()

void ScreenManagerClass::KeyInput ( Keys_t key)

Method that is used to input keys (and encoder inputs) into the screen subsystem (and the UI_Lib).

Parameters
keyKey that is forwarded to the UI_Lib.

◆ ShowHideDeviceRWLMessage()

void ScreenManagerClass::ShowHideDeviceRWLMessage ( bool showMessage)

Show or hide a message indicating that the device is in RWL state (only controllable via SCPI commands).

Parameters
showMessageIf true, a message is displayed that the device is in RWL state; If false, the main page is shown.

◆ ShowUiCalibrationMenu()

void ScreenManagerClass::ShowUiCalibrationMenu ( )

This method can be used to start the calibration and show the calibration page.

This is a short version for using the ChangeVisualTreeRoot() method of the UI_Manager.

◆ ShowUiMainPage()

void ScreenManagerClass::ShowUiMainPage ( )

This method can be used to show the main page (no MessageDialog or calibration page).

This is a short version for using the ChangeVisualTreeRoot() method of the UI_Manager.

◆ TouchInput()

bool ScreenManagerClass::TouchInput ( uint16_t x,
uint16_t y,
TouchTypes touchType )

Process a touch input at the given point (x, y)

Parameters
xX-Coordinate of the touched point
yY-Coordinate of the touched point
touchTypeType of the touch
Returns
true if the touch was processed; false if not.

◆ uiBuildTree()

void ScreenManagerClass::uiBuildTree ( )
private

Build the VisualTree for all screens used for drawing.

This function is internally called by the Init() function of this class.

◆ UpdateCalibrationValidIndicator()

void ScreenManagerClass::UpdateCalibrationValidIndicator ( bool calibrationValid)

Update the calibration valid indicator (calibration icon indicating that the calibration factors are valid).

Parameters
calibrationValidIf true, the calibration icon is shown; If false, the calibration icon is hidden.

◆ UpdateSettingsChangedIndicator()

void ScreenManagerClass::UpdateSettingsChangedIndicator ( bool settingsChanged)

Update the settings changed indicator (star indicating that there are unstored settings).

Parameters
settingsChangedIf true, the star is shown; If false, the star is hidden.

Member Data Documentation

◆ _touchStartTime

unsigned long ScreenManagerClass::_touchStartTime = 0
private

Start time of the touch.

This is used to detect long touches.

◆ CurrentScreenNeedsPeriodicRedraw

bool ScreenManagerClass::CurrentScreenNeedsPeriodicRedraw

Flag that indicates if the current displayed screen needs to be periodically redrawn.

This is neccessary if the screen contains measured values that change periodically. This isn't neccessary if the screen only contains static data. The screen is always redrawn on user inputs (keys or USART).

◆ RedrawScreenRequest

bool ScreenManagerClass::RedrawScreenRequest

Flag that indicates that the screen should be redrawn.

A redraw should occur periodically (if the screen needs to be redrawn periodically) or on user inputs.


The documentation for this class was generated from the following files: