#include <DrawableTouchCalibrator.h>
Public Member Functions | |
IoaTouchScreenCalibrator (tcgfx::MenuTouchScreenManager *touchScreen, tcgfx::GraphicsDeviceRenderer *renderer, uint16_t romPos) | |
void | initCalibration (IoaCalibrationScreenPrep screenPrepFn, bool presentUiUninitialised) |
bool | loadCalibration () override |
void | saveCalibration () override |
void | reCalibrateNow () override |
void | reset () override |
void | started (BaseMenuRenderer *currentRenderer) override |
void | renderLoop (unsigned int currentValue, RenderPressMode userClick) override |
void | giveItBack () |
This class implements custom drawing so that it can take over the display and render a basic touch screen calibration UI. It depends upon the IoaCalibrationScreenPrep
function that is called during screen take over to adjust the display and touch rotation back to the default non-rotated settings for the panel. It is assumed that with this the range of adjustments needed can be determined. It is assumed that during this call there is no difference between touch and display rotation.
|
inline |
During setup you'd normally call this function to initialise the touch calibrator with the previous settings, and also to provide the calibrator with a function that can remove all rotations while calibrating, and put them back after calibration is finished. This is because it is easier to calibrate with no rotation applied.
screenPrepFn | a function to remove and restore rotations, bool param of true - starting calibration |
presentUiUninitialised | true if the the UI should show when EEPROM load fails. |
|
overridevirtual |
Loads the calibration data back from EEPROM
Implements tcextras::TouchCalibrationManager.
|
overridevirtual |
Saves the calibration data to EEPROM
Implements tcextras::TouchCalibrationManager.
|
overridevirtual |
Forces recalibration immediately.
Implements tcextras::TouchCalibrationManager.
|
inlineoverridevirtual |
Called when the menu has become inactive, IE after the idle time out has triggered.
Implements CustomDrawing.
|
overridevirtual |
Called when the display is taken over before any calls to renderLoop. You can set up anything you need here.
currentRenderer | the renderer object that sent this event. |
Implements CustomDrawing.
|
overridevirtual |
After takeOverDisplay is called, you'll first get the started event, then this loop will be called repeatedly, you should check if anything needs painting, and redraw display sections if need be.
currentValue | the current value of the encoder, or simulated encoder. |
userClick | the selection state, eg of the select button. |
Implements CustomDrawing.