![]() |
PS_Fgen_FW
4da88f4073c1cc65ea45c3a652a2751e495e50db
Firmware for an Power Supply and Function Generator build from an ATX power supply
|
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. | |
Class that is used to control the screen.
This class can be used for screen handling. It contains all necessary handles and methods.
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.
void ScreenManagerClass::DoDraw | ( | ) |
Evaluate, if the screen should be redrawn.
If yes, the Draw method is called.
void ScreenManagerClass::Init | ( | ) |
Initialize the ScreenManager.
This method initializes the u8g_lib and UI_Manager handles and builds the VisualTree.
void ScreenManagerClass::KeyInput | ( | Keys_t | key | ) |
Method that is used to input keys (and encoder inputs) into the screen subsystem (and the UI_Lib).
key | Key that is forwarded to the UI_Lib. |
void ScreenManagerClass::ShowHideDeviceRWLMessage | ( | bool | showMessage | ) |
Show or hide a message indicating that the device is in RWL state (only controllable via SCPI commands).
showMessage | If true, a message is displayed that the device is in RWL state; If false, the main page is shown. |
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.
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.
bool ScreenManagerClass::TouchInput | ( | uint16_t | x, |
uint16_t | y, | ||
TouchTypes | touchType ) |
Process a touch input at the given point (x, y)
x | X-Coordinate of the touched point |
y | Y-Coordinate of the touched point |
touchType | Type of the touch |
|
private |
Build the VisualTree for all screens used for drawing.
This function is internally called by the Init() function of this class.
void ScreenManagerClass::UpdateCalibrationValidIndicator | ( | bool | calibrationValid | ) |
Update the calibration valid indicator (calibration icon indicating that the calibration factors are valid).
calibrationValid | If true, the calibration icon is shown; If false, the calibration icon is hidden. |
void ScreenManagerClass::UpdateSettingsChangedIndicator | ( | bool | settingsChanged | ) |
Update the settings changed indicator (star indicating that there are unstored settings).
settingsChanged | If true, the star is shown; If false, the star is hidden. |
|
private |
Start time of the touch.
This is used to detect long touches.
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).
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.