|
NXWidgets
1.19
|
#include <ccalibration.hxx>

Classes | |
| struct | SCalibScreenInfo |
Public Member Functions | |
| CCalibration (CTaskbar *taskbar, CFullScreenWindow *window, CTouchscreen *touchscreen) | |
| ~CCalibration (void) | |
| IApplicationWindow * | getWindow (void) const |
| NXWidgets::IBitmap * | getIcon (void) |
| NXWidgets::CNxString | getName (void) |
| bool | run (void) |
| void | stop (void) |
| void | destroy (void) |
| void | hide (void) |
| void | redraw (void) |
| bool | isFullScreen (void) const |
Public Member Functions inherited from NxWM::IApplication | |
| virtual | ~IApplication (void) |
| void | setMinimized (bool minimized) |
| void | setTopApplication (bool topapp) |
| bool | isMinimized (void) const |
| bool | isTopApplication (void) const |
Private Member Functions | |
| void | touchscreenInput (struct touch_sample_s &sample) |
| bool | createWidgets (void) |
| void | destroyWidgets (void) |
| bool | startCalibration (enum ECalThreadState initialState) |
| bool | isRunning (void) const |
| bool | isStarted (void) const |
| bool | averageSamples (struct nxgl_point_s &average) |
| void | stateMachine (void) |
| void | showCalibration (void) |
| void | finishCalibration (void) |
| bool | createCalibrationData (struct SCalibrationData &data) |
Static Private Member Functions | |
| static FAR void * | calibration (FAR void *arg) |
Private Attributes | |
| CTaskbar * | m_taskbar |
| CFullScreenWindow * | m_window |
| CTouchscreen * | m_touchscreen |
| NXWidgets::CLabel * | m_text |
| NXWidgets::CNxFont * | m_font |
| pthread_t | m_thread |
| struct SCalibScreenInfo | m_screenInfo |
| struct nxgl_point_s | m_touchPos |
| volatile uint8_t | m_calthread |
| uint8_t | m_calphase |
| bool | m_stop |
| bool | m_touched |
| uint8_t | m_touchId |
| uint8_t | m_nsamples |
| struct nxgl_point_s | m_sampleData [CONFIG_NXWM_CALIBRATION_NSAMPLES] |
| struct nxgl_point_s | m_calibData [CALIB_DATA_POINTS] |
Additional Inherited Members | |
Protected Attributes inherited from NxWM::IApplication | |
| bool | m_minimized |
| bool | m_topapp |
The CCalibration class provides the the calibration window and obtains callibration data.
Definition at line 123 of file ccalibration.hxx.
|
private |
Identifies the current display state
Definition at line 145 of file ccalibration.hxx.
|
private |
The state of the calibration thread.
| Enumerator | |
|---|---|
| CALTHREAD_NOTRUNNING | The calibration thread has not yet been started |
| CALTHREAD_STARTED | The calibration thread has been started, but is not yet running |
| CALTHREAD_RUNNING | The calibration thread is running normally |
| CALTHREAD_STOPREQUESTED | The calibration thread has been requested to stop |
| CALTHREAD_HIDE | The hide() called by calibration thread running |
| CALTHREAD_SHOW | The redraw() called by calibration thread running |
| CALTHREAD_TERMINATED | The calibration thread terminated normally |
Definition at line 130 of file ccalibration.hxx.
| CCalibration::CCalibration | ( | CTaskbar * | taskbar, |
| CFullScreenWindow * | window, | ||
| CTouchscreen * | touchscreen | ||
| ) |
CCalibration Constructor
| taskbar. | The taskbar instance used to terminate calibration |
| window. | The window to use for the calibration display |
| touchscreen. | An instance of the class that wraps the touchscreen device. |
Definition at line 116 of file ccalibration.cxx.
| CCalibration::~CCalibration | ( | void | ) |
CCalibration Destructor
Definition at line 142 of file ccalibration.cxx.
|
private |
Accumulate and average touch sample data
| average. | When the averaged data is available, return it here |
Definition at line 694 of file ccalibration.cxx.
|
staticprivate |
The calibration thread. This is the entry point of a thread that provides the calibration displays, waits for input, and collects calibration data.
| arg. | The CCalibration 'this' pointer cast to a void*. |
Definition at line 582 of file ccalibration.cxx.
|
private |
Given the raw touch data collected by the calibration thread, create the massaged calibration data needed by CTouchscreen.
| data. | A reference to the location to save the calibration data |
Definition at line 1144 of file ccalibration.cxx.
|
private |
Create widgets need by the calibration thread.
Definition at line 428 of file ccalibration.cxx.
|
virtual |
Destroy the application and free all of its resources. This method will initiate blocking of messages from the NX server. The server will flush the window message queue and reply with the blocked message. When the block message is received by CWindowMessenger, it will send the destroy message to the start window task which will, finally, safely delete the application.
Implements NxWM::IApplication.
Definition at line 250 of file ccalibration.cxx.
|
private |
Destroy widgets created for the calibration thread.
Definition at line 518 of file ccalibration.cxx.
|
private |
Finish calibration steps and provide the calibration data to the touchscreen driver.
Definition at line 1095 of file ccalibration.cxx.
|
virtual |
Get the icon associated with the application
Implements NxWM::IApplication.
Definition at line 173 of file ccalibration.cxx.
|
virtual |
Get the name string associated with the application
Implements NxWM::IApplication.
Definition at line 187 of file ccalibration.cxx.
|
virtual |
Each implementation of IApplication must provide a method to recover the contained IApplicationWindow instance.
Implements NxWM::IApplication.
Definition at line 160 of file ccalibration.cxx.
|
virtual |
The application window is hidden (either it is minimized or it is maximized, but not at the top of the hierarchy
The application window is hidden (either it is minimized or it is maximized, but it is not at the top of the hierarchy)
Implements NxWM::IApplication.
Definition at line 266 of file ccalibration.cxx.
|
virtual |
Report of this is a "normal" window or a full screen window. The primary purpose of this method is so that window manager will know whether or not it show draw the task bar.
Implements NxWM::IApplication.
Definition at line 331 of file ccalibration.cxx.
|
inlineprivate |
Return true if the calibration thread is running normally. There are lots of potential race conditions. There are also two ambiguous states:
1) The thread may have been started but not yet running (CALTHREAD_STARTED), or the 2) The thread may been requested to terminate, but has not yet terminated (CALTHREAD_STOPREQUESTED)
Both of those states will cause isRunning() to return false.
Definition at line 239 of file ccalibration.hxx.
|
inlineprivate |
Return true if the calibration thread is has been started and has not yet terminated. There is a potential race condition here when the thread has been requested to terminate, but has not yet terminated (CALTHREAD_STOPREQUESTED). isStarted() will return false in that case.
Definition at line 256 of file ccalibration.hxx.
|
virtual |
Redraw the entire window. The application has been maximized or otherwise moved to the top of the hierarchy. This method is called from CTaskbar when the application window must be displayed
Implements NxWM::IApplication.
Definition at line 287 of file ccalibration.cxx.
|
virtual |
Start the application (perhaps in the minimized state).
Implements NxWM::IApplication.
Definition at line 198 of file ccalibration.cxx.
|
private |
Presents the next calibration screen
Presents the next calibration screen
| screenInfo | Describes the next calibration screen |
Definition at line 1044 of file ccalibration.cxx.
|
private |
Start the calibration thread.
| initialState. | The initial state of the calibration thread |
Definition at line 535 of file ccalibration.cxx.
|
private |
This is the calibration state machine. It is called initially and then as new touchscreen data is received.
Definition at line 800 of file ccalibration.cxx.
|
virtual |
Stop the application.
Implements NxWM::IApplication.
Definition at line 209 of file ccalibration.cxx.
|
private |
Accept raw touchscreen input.
| sample | Touchscreen input sample |
Definition at line 342 of file ccalibration.cxx.
|
private |
Definition at line 189 of file ccalibration.hxx.
|
private |
Current calibration display state (See ECalibrationPhase)
Definition at line 181 of file ccalibration.hxx.
|
private |
Current calibration display state (See ECalibThreadState)
Definition at line 180 of file ccalibration.hxx.
|
private |
The font used in the message
Definition at line 175 of file ccalibration.hxx.
|
private |
Number of samples collected so far at this position
Definition at line 186 of file ccalibration.hxx.
|
private |
Definition at line 187 of file ccalibration.hxx.
|
private |
Describes the current calibration display
Definition at line 178 of file ccalibration.hxx.
|
private |
True: We have been asked to stop the calibration
Definition at line 182 of file ccalibration.hxx.
|
private |
CCalibration state dataThe taskbar (used to terminate calibration)
Definition at line 170 of file ccalibration.hxx.
|
private |
Calibration message
Definition at line 174 of file ccalibration.hxx.
|
private |
The calibration thread ID
Definition at line 177 of file ccalibration.hxx.
|
private |
True: The screen is touched
Definition at line 183 of file ccalibration.hxx.
|
private |
The ID of the touch
Definition at line 184 of file ccalibration.hxx.
|
private |
This is the last touch position
Definition at line 179 of file ccalibration.hxx.
|
private |
The touchscreen device
Definition at line 172 of file ccalibration.hxx.
|
private |
The window for the calibration display
Definition at line 171 of file ccalibration.hxx.
1.8.13