NxWM::CCalibration: Add an option to provide some instructions in the center of the calibration screen
This commit is contained in:
parent
c62e1b5cc4
commit
1393518ba7
@ -380,3 +380,8 @@
|
|||||||
Petteri Aimonen (2013-6-4).
|
Petteri Aimonen (2013-6-4).
|
||||||
|
|
||||||
1.9 2013-xx-xx Gregory Nutt <gnutt@nuttx.org>
|
1.9 2013-xx-xx Gregory Nutt <gnutt@nuttx.org>
|
||||||
|
|
||||||
|
* NxWM::CCalibration.cxx/hxx: If CONFIG_NXWM_CALIBRATION_MESSAGES is
|
||||||
|
defined then CCalibration will provide some instructions in the center
|
||||||
|
of the display (2013-10-14).
|
||||||
|
|
||||||
|
40
Kconfig
40
Kconfig
@ -718,6 +718,17 @@ endif
|
|||||||
|
|
||||||
comment "Calibration display settings"
|
comment "Calibration display settings"
|
||||||
|
|
||||||
|
config NXWM_CALIBRATION_MARGIN
|
||||||
|
int "Calibration Margin"
|
||||||
|
default 40
|
||||||
|
---help---
|
||||||
|
The Calbration display consists of a target press offset from the edges
|
||||||
|
of the display by this number of pixels (in the horizontal direction)
|
||||||
|
or rows (in the vertical). The closer that you can comfortabley
|
||||||
|
position the press positions to the edge, the more accurate will be the
|
||||||
|
linear interpolation (provide that the hardware provides equally good
|
||||||
|
measurements near the edges).
|
||||||
|
|
||||||
config NXWM_CALIBRATION_CUSTOM_COLORS
|
config NXWM_CALIBRATION_CUSTOM_COLORS
|
||||||
bool "Custom Calibration Colors"
|
bool "Custom Calibration Colors"
|
||||||
default n
|
default n
|
||||||
@ -754,6 +765,35 @@ config NXWM_CALIBRATION_TOUCHEDCOLOR
|
|||||||
the touch is recorder. Default: RGB(255, 255, 96) (very light yellow)
|
the touch is recorder. Default: RGB(255, 255, 96) (very light yellow)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
config NXWM_CALIBRATION_MESSAGES
|
||||||
|
bool "Add Instructions in Center"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
By default, the calibration screen is clear excecpt for the
|
||||||
|
calibratino touchpoints. If this options are enabled, then
|
||||||
|
instructions when to touch and when to release the touch will
|
||||||
|
be added in the center of the display,
|
||||||
|
|
||||||
|
if NXWM_CALIBRATION_MESSAGES
|
||||||
|
|
||||||
|
config NXWM_CALIBRATION_CUSTOM_FONTID
|
||||||
|
bool "Use a Custom Font in Calibration Display"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Set to override the system default font id (NXFONT_DEFAULT).
|
||||||
|
|
||||||
|
if NXWM_CALIBRATION_CUSTOM_FONTID
|
||||||
|
|
||||||
|
config NXWM_CALIBRATION_FONTID
|
||||||
|
int "Calibration Font ID"
|
||||||
|
default 0
|
||||||
|
---help---
|
||||||
|
Use this default NxWidgets font ID instead of the system font ID
|
||||||
|
(NXFONT_DEFAULT). Default: 0
|
||||||
|
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
config NXWM_CUSTOM_CALIBRATION_ICON
|
config NXWM_CUSTOM_CALIBRATION_ICON
|
||||||
bool "Custom Calibration Icon"
|
bool "Custom Calibration Icon"
|
||||||
default n
|
default n
|
||||||
|
@ -48,6 +48,8 @@
|
|||||||
#include "cnxstring.hxx"
|
#include "cnxstring.hxx"
|
||||||
#include "cwidgeteventhandler.hxx"
|
#include "cwidgeteventhandler.hxx"
|
||||||
#include "cwidgetcontrol.hxx"
|
#include "cwidgetcontrol.hxx"
|
||||||
|
#include "clabel.hxx"
|
||||||
|
#include "cnxfont.hxx"
|
||||||
|
|
||||||
#include "ctaskbar.hxx"
|
#include "ctaskbar.hxx"
|
||||||
#include "iapplication.hxx"
|
#include "iapplication.hxx"
|
||||||
@ -146,6 +148,10 @@ namespace NxWM
|
|||||||
CTaskbar *m_taskbar; /**< The taskbar (used to terminate calibration) */
|
CTaskbar *m_taskbar; /**< The taskbar (used to terminate calibration) */
|
||||||
CFullScreenWindow *m_window; /**< The window for the calibration display */
|
CFullScreenWindow *m_window; /**< The window for the calibration display */
|
||||||
CTouchscreen *m_touchscreen; /**< The touchscreen device */
|
CTouchscreen *m_touchscreen; /**< The touchscreen device */
|
||||||
|
#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES
|
||||||
|
NXWidgets::CLabel *m_text; /**< Calibration message */
|
||||||
|
NXWidgets::CNxFont *m_font; /**< The font used in the message */
|
||||||
|
#endif
|
||||||
pthread_t m_thread; /**< The calibration thread ID */
|
pthread_t m_thread; /**< The calibration thread ID */
|
||||||
struct SCalibScreenInfo m_screenInfo; /**< Describes the current calibration display */
|
struct SCalibScreenInfo m_screenInfo; /**< Describes the current calibration display */
|
||||||
struct nxgl_point_s m_touchPos; /**< This is the last touch position */
|
struct nxgl_point_s m_touchPos; /**< This is the last touch position */
|
||||||
|
@ -467,6 +467,8 @@
|
|||||||
* CONFIG_NXWM_CALIBRATION_TOUCHEDCOLOR - The color of the circle in the
|
* CONFIG_NXWM_CALIBRATION_TOUCHEDCOLOR - The color of the circle in the
|
||||||
* touchscreen calibration display after the touch is recorder. Default:
|
* touchscreen calibration display after the touch is recorder. Default:
|
||||||
* MKRGB(255, 255, 96) (very light yellow)
|
* MKRGB(255, 255, 96) (very light yellow)
|
||||||
|
* CONFIG_NXWM_CALIBRATION_FONTID - Use this default NxWidgets font ID
|
||||||
|
* instead of the system font ID (NXFONT_DEFAULT).
|
||||||
* CONFIG_NXWM_CALIBRATION_ICON - The ICON to use for the touchscreen
|
* CONFIG_NXWM_CALIBRATION_ICON - The ICON to use for the touchscreen
|
||||||
* calibration application. Default: NxWM::g_calibrationBitmap
|
* calibration application. Default: NxWM::g_calibrationBitmap
|
||||||
* CONFIG_NXWM_CALIBRATION_SIGNO - The realtime signal used to wake up the
|
* CONFIG_NXWM_CALIBRATION_SIGNO - The realtime signal used to wake up the
|
||||||
@ -475,6 +477,13 @@
|
|||||||
* thread. Default: SCHED_PRIORITY_DEFAULT
|
* thread. Default: SCHED_PRIORITY_DEFAULT
|
||||||
* CONFIG_NXWM_CALIBRATION_LISTENERSTACK - Calibration listener thread stack
|
* CONFIG_NXWM_CALIBRATION_LISTENERSTACK - Calibration listener thread stack
|
||||||
* size. Default 2048
|
* size. Default 2048
|
||||||
|
* CONFIG_NXWM_CALIBRATION_MARGIN
|
||||||
|
* The Calbration display consists of a target press offset from the edges
|
||||||
|
* of the display by this number of pixels (in the horizontal direction)
|
||||||
|
* or rows (in the vertical). The closer that you can comfortabley
|
||||||
|
* position the press positions to the edge, the more accurate will be the
|
||||||
|
* linear interpolation (provide that the hardware provides equally good
|
||||||
|
* measurements near the edges).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR
|
#ifndef CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR
|
||||||
@ -493,6 +502,10 @@
|
|||||||
# define CONFIG_NXWM_CALIBRATION_TOUCHEDCOLOR MKRGB(255, 255, 96)
|
# define CONFIG_NXWM_CALIBRATION_TOUCHEDCOLOR MKRGB(255, 255, 96)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_NXWM_CALIBRATION_FONTID
|
||||||
|
# define CONFIG_NXWM_CALIBRATION_FONTID NXFONT_DEFAULT
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_NXWM_CALIBRATION_ICON
|
#ifndef CONFIG_NXWM_CALIBRATION_ICON
|
||||||
# define CONFIG_NXWM_CALIBRATION_ICON NxWM::g_calibrationBitmap
|
# define CONFIG_NXWM_CALIBRATION_ICON NxWM::g_calibrationBitmap
|
||||||
#endif
|
#endif
|
||||||
@ -509,6 +522,10 @@
|
|||||||
# define CONFIG_NXWM_CALIBRATION_LISTENERSTACK 2048
|
# define CONFIG_NXWM_CALIBRATION_LISTENERSTACK 2048
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_NXWM_CALIBRATION_MARGIN
|
||||||
|
# define CONFIG_NXWM_CALIBRATION_MARGIN 40
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Hexcalculator applications ***********************************************/
|
/* Hexcalculator applications ***********************************************/
|
||||||
/**
|
/**
|
||||||
* Calibration display settings:
|
* Calibration display settings:
|
||||||
|
@ -64,20 +64,30 @@
|
|||||||
* Positional/size data for the calibration lines and circles
|
* Positional/size data for the calibration lines and circles
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CALIBRATION_LEFTX 40
|
#define CALIBRATION_LEFTX CONFIG_NXWM_CALIBRATION_MARGIN
|
||||||
#define CALIBRATION_RIGHTX (windowSize.w - 41)
|
#define CALIBRATION_RIGHTX (windowSize.w - CONFIG_NXWM_CALIBRATION_MARGIN + 1)
|
||||||
#define CALIBRATION_TOPY 40
|
#define CALIBRATION_TOPY CONFIG_NXWM_CALIBRATION_MARGIN
|
||||||
#define CALIBRATION_BOTTOMY (windowSize.h - 41)
|
#define CALIBRATION_BOTTOMY (windowSize.h - CONFIG_NXWM_CALIBRATION_MARGIN + 1)
|
||||||
|
|
||||||
#define CALIBRATION_CIRCLE_RADIUS 16
|
#define CALIBRATION_CIRCLE_RADIUS 16
|
||||||
#define CALIBRATION_LINE_THICKNESS 2
|
#define CALIBRATION_LINE_THICKNESS 2
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* CCalibration Implementation Classes
|
* Private Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
using namespace NxWM;
|
using namespace NxWM;
|
||||||
|
|
||||||
|
#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES
|
||||||
|
static const char g_touchmsg[] = "Touch";
|
||||||
|
static const char g_againmsg[] = "Again";
|
||||||
|
static const char g_okmsg[] = "OK";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* CCalibration Implementation Classes
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CCalibration Constructor
|
* CCalibration Constructor
|
||||||
*
|
*
|
||||||
@ -99,6 +109,14 @@ CCalibration::CCalibration(CTaskbar *taskbar, CFullScreenWindow *window,
|
|||||||
m_calthread = CALTHREAD_NOTRUNNING;
|
m_calthread = CALTHREAD_NOTRUNNING;
|
||||||
m_calphase = CALPHASE_NOT_STARTED;
|
m_calphase = CALPHASE_NOT_STARTED;
|
||||||
m_touched = false;
|
m_touched = false;
|
||||||
|
|
||||||
|
// Nullify widgets that will be instantiated when the calibration thread
|
||||||
|
// is started
|
||||||
|
|
||||||
|
#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES
|
||||||
|
m_text = (NXWidgets::CLabel *)0;
|
||||||
|
m_font = (NXWidgets::CNxFont *)0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -191,10 +209,15 @@ void CCalibration::stop(void)
|
|||||||
m_calthread = CALTHREAD_STOPREQUESTED;
|
m_calthread = CALTHREAD_STOPREQUESTED;
|
||||||
|
|
||||||
// Try to wake up the calibration thread so that it will see our
|
// Try to wake up the calibration thread so that it will see our
|
||||||
// terminatin request
|
// termination request
|
||||||
|
|
||||||
gvdbg("Stopping calibration: m_calthread=%d\n", (int)m_calthread);
|
gvdbg("Stopping calibration: m_calthread=%d\n", (int)m_calthread);
|
||||||
(void)pthread_kill(m_thread, CONFIG_NXWM_CALIBRATION_SIGNO);
|
(void)pthread_kill(m_thread, CONFIG_NXWM_CALIBRATION_SIGNO);
|
||||||
|
|
||||||
|
// Wait for the calibration thread to exit
|
||||||
|
|
||||||
|
FAR pthread_addr_t value;
|
||||||
|
(void)pthread_join(m_thread, &value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -328,6 +351,9 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample)
|
|||||||
if (!m_touched)
|
if (!m_touched)
|
||||||
{
|
{
|
||||||
m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_TOUCHEDCOLOR;
|
m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_TOUCHEDCOLOR;
|
||||||
|
#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES
|
||||||
|
m_text->setText(g_okmsg);
|
||||||
|
#endif
|
||||||
showCalibration();
|
showCalibration();
|
||||||
m_touched = true;
|
m_touched = true;
|
||||||
}
|
}
|
||||||
@ -363,6 +389,9 @@ void CCalibration::touchscreenInput(struct touch_sample_s &sample)
|
|||||||
// No... restore the un-highlighted circle
|
// No... restore the un-highlighted circle
|
||||||
|
|
||||||
m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR;
|
m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR;
|
||||||
|
#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES
|
||||||
|
m_text->setText("");
|
||||||
|
#endif
|
||||||
showCalibration();
|
showCalibration();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -415,10 +444,6 @@ bool CCalibration::startCalibration(enum ECalThreadState initialState)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Detach from the pthread so that we do not have any memory leaks
|
|
||||||
|
|
||||||
(void)pthread_detach(m_thread);
|
|
||||||
|
|
||||||
gvdbg("Calibration thread m_calthread=%d\n", (int)m_calthread);
|
gvdbg("Calibration thread m_calthread=%d\n", (int)m_calthread);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -436,6 +461,81 @@ FAR void *CCalibration::calibration(FAR void *arg)
|
|||||||
CCalibration *This = (CCalibration *)arg;
|
CCalibration *This = (CCalibration *)arg;
|
||||||
bool stalled = true;
|
bool stalled = true;
|
||||||
|
|
||||||
|
#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES
|
||||||
|
// Create widgets that will be used in the calibration display
|
||||||
|
// Select a font for the calculator
|
||||||
|
|
||||||
|
This->m_font = new NXWidgets::
|
||||||
|
CNxFont((nx_fontid_e)CONFIG_NXWM_CALIBRATION_FONTID,
|
||||||
|
CONFIG_NXWM_DEFAULT_FONTCOLOR, CONFIG_NXWM_TRANSPARENT_COLOR);
|
||||||
|
if (!This->m_font)
|
||||||
|
{
|
||||||
|
gdbg("ERROR failed to create font\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Recover the window instance contained in the application window
|
||||||
|
|
||||||
|
NXWidgets::INxWindow *window = This->m_window->getWindow();
|
||||||
|
|
||||||
|
// Get the size of the window
|
||||||
|
|
||||||
|
struct nxgl_size_s windowSize;
|
||||||
|
if (!window->getSize(&windowSize))
|
||||||
|
{
|
||||||
|
gdbg("ERROR: Failed to get window size\n");
|
||||||
|
delete This->m_font;
|
||||||
|
This->m_font = (NXWidgets::CNxFont *)0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// How big can the label be?
|
||||||
|
|
||||||
|
struct nxgl_size_s labelSize;
|
||||||
|
labelSize.w = (windowSize.w - 2*CONFIG_NXWM_CALIBRATION_MARGIN - 20);
|
||||||
|
labelSize.h = This->m_font->getHeight() + 2*4;
|
||||||
|
|
||||||
|
// Where should the label be?
|
||||||
|
|
||||||
|
struct nxgl_point_s labelPos;
|
||||||
|
labelPos.x = ((windowSize.w - labelSize.w) / 2);
|
||||||
|
labelPos.y = ((windowSize.h - labelSize.h) / 2);
|
||||||
|
|
||||||
|
// Get the widget control associated with the application window
|
||||||
|
|
||||||
|
NXWidgets::CWidgetControl *control = This->m_window->getWidgetControl();
|
||||||
|
|
||||||
|
// Create a label to show the calibration message.
|
||||||
|
|
||||||
|
This->m_text = new NXWidgets::
|
||||||
|
CLabel(control, labelPos.x, labelPos.y, labelSize.w, labelSize.h, "");
|
||||||
|
|
||||||
|
if (!This->m_text)
|
||||||
|
{
|
||||||
|
gdbg("ERROR: Failed to create CLabel\n");
|
||||||
|
delete This->m_font;
|
||||||
|
This->m_font = (NXWidgets::CNxFont *)0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// No border
|
||||||
|
|
||||||
|
This->m_text->setBorderless(true);
|
||||||
|
|
||||||
|
// Center text
|
||||||
|
|
||||||
|
This->m_text->setTextAlignmentHoriz(NXWidgets::CLabel::TEXT_ALIGNMENT_HORIZ_CENTER);
|
||||||
|
|
||||||
|
// Disable drawing and events until we are asked to redraw the window
|
||||||
|
|
||||||
|
This->m_text->disableDrawing();
|
||||||
|
This->m_text->setRaisesEvents(false);
|
||||||
|
|
||||||
|
// Select the font
|
||||||
|
|
||||||
|
This->m_text->setFont(This->m_font);
|
||||||
|
#endif
|
||||||
|
|
||||||
// The calibration thread is now running
|
// The calibration thread is now running
|
||||||
|
|
||||||
This->m_calthread = CALTHREAD_RUNNING;
|
This->m_calthread = CALTHREAD_RUNNING;
|
||||||
@ -468,7 +568,7 @@ FAR void *CCalibration::calibration(FAR void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The calibration thread will stall if has been asked to hide the
|
// The calibration thread will stall if has been asked to hide the
|
||||||
// display. While stalled, we will just sleep for a bit abd test
|
// display. While stalled, we will just sleep for a bit and test
|
||||||
// the state again. If we are re-awakened by a redraw(), then we
|
// the state again. If we are re-awakened by a redraw(), then we
|
||||||
// will be given a signal which will wake us up immediately.
|
// will be given a signal which will wake us up immediately.
|
||||||
//
|
//
|
||||||
@ -498,10 +598,29 @@ FAR void *CCalibration::calibration(FAR void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hide the message
|
||||||
|
|
||||||
|
#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES
|
||||||
|
This->m_text->setText("");
|
||||||
|
This->m_text->enableDrawing();
|
||||||
|
This->m_text->redraw();
|
||||||
|
This->m_text->disableDrawing();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Perform the final steps of calibration
|
// Perform the final steps of calibration
|
||||||
|
|
||||||
This->finishCalibration();
|
This->finishCalibration();
|
||||||
|
|
||||||
|
// Destroy widgets
|
||||||
|
|
||||||
|
#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES
|
||||||
|
delete This->m_text;
|
||||||
|
This->m_text = (NXWidgets::CLabel *)0;
|
||||||
|
|
||||||
|
delete This->m_font;
|
||||||
|
This->m_font = (NXWidgets::CNxFont *)0;
|
||||||
|
#endif
|
||||||
|
|
||||||
gvdbg("Terminated: m_calthread=%d\n", (int)This->m_calthread);
|
gvdbg("Terminated: m_calthread=%d\n", (int)This->m_calthread);
|
||||||
return (FAR void *)0;
|
return (FAR void *)0;
|
||||||
}
|
}
|
||||||
@ -552,6 +671,9 @@ void CCalibration::stateMachine(void)
|
|||||||
m_screenInfo.pos.y = CALIBRATION_TOPY;
|
m_screenInfo.pos.y = CALIBRATION_TOPY;
|
||||||
m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR;
|
m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR;
|
||||||
m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR;
|
m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR;
|
||||||
|
#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES
|
||||||
|
m_text->setText(g_touchmsg);
|
||||||
|
#endif
|
||||||
showCalibration();
|
showCalibration();
|
||||||
|
|
||||||
// Then set up the current state
|
// Then set up the current state
|
||||||
@ -568,7 +690,7 @@ void CCalibration::stateMachine(void)
|
|||||||
m_calibData[CALIB_UPPER_LEFT_INDEX].x = m_touchPos.x;
|
m_calibData[CALIB_UPPER_LEFT_INDEX].x = m_touchPos.x;
|
||||||
m_calibData[CALIB_UPPER_LEFT_INDEX].y = m_touchPos.y;
|
m_calibData[CALIB_UPPER_LEFT_INDEX].y = m_touchPos.y;
|
||||||
|
|
||||||
// Clear the previous screen by re-drawing it using the backgro9und
|
// Clear the previous screen by re-drawing it using the background
|
||||||
// color. That is much faster than clearing the whole display
|
// color. That is much faster than clearing the whole display
|
||||||
|
|
||||||
m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR;
|
m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR;
|
||||||
@ -581,6 +703,9 @@ void CCalibration::stateMachine(void)
|
|||||||
m_screenInfo.pos.y = CALIBRATION_TOPY;
|
m_screenInfo.pos.y = CALIBRATION_TOPY;
|
||||||
m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR;
|
m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR;
|
||||||
m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR;
|
m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR;
|
||||||
|
#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES
|
||||||
|
m_text->setText(g_touchmsg);
|
||||||
|
#endif
|
||||||
showCalibration();
|
showCalibration();
|
||||||
|
|
||||||
// Then set up the current state
|
// Then set up the current state
|
||||||
@ -610,6 +735,9 @@ void CCalibration::stateMachine(void)
|
|||||||
m_screenInfo.pos.y = CALIBRATION_BOTTOMY;
|
m_screenInfo.pos.y = CALIBRATION_BOTTOMY;
|
||||||
m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR;
|
m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR;
|
||||||
m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR;
|
m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR;
|
||||||
|
#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES
|
||||||
|
m_text->setText(g_touchmsg);
|
||||||
|
#endif
|
||||||
showCalibration();
|
showCalibration();
|
||||||
|
|
||||||
// Then set up the current state
|
// Then set up the current state
|
||||||
@ -639,6 +767,9 @@ void CCalibration::stateMachine(void)
|
|||||||
m_screenInfo.pos.y = CALIBRATION_BOTTOMY;
|
m_screenInfo.pos.y = CALIBRATION_BOTTOMY;
|
||||||
m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR;
|
m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_LINECOLOR;
|
||||||
m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR;
|
m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_CIRCLECOLOR;
|
||||||
|
#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES
|
||||||
|
m_text->setText(g_touchmsg);
|
||||||
|
#endif
|
||||||
showCalibration();
|
showCalibration();
|
||||||
|
|
||||||
// Then set up the current state
|
// Then set up the current state
|
||||||
@ -660,6 +791,9 @@ void CCalibration::stateMachine(void)
|
|||||||
|
|
||||||
m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR;
|
m_screenInfo.lineColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR;
|
||||||
m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR;
|
m_screenInfo.circleFillColor = CONFIG_NXWM_CALIBRATION_BACKGROUNDCOLOR;
|
||||||
|
#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES
|
||||||
|
m_text->setText(g_touchmsg);
|
||||||
|
#endif
|
||||||
showCalibration();
|
showCalibration();
|
||||||
|
|
||||||
// Inform any waiter that calibration is complete
|
// Inform any waiter that calibration is complete
|
||||||
@ -719,6 +853,14 @@ void CCalibration::showCalibration(void)
|
|||||||
|
|
||||||
port->drawFilledRect(m_screenInfo.pos.x, 0, CALIBRATION_LINE_THICKNESS, windowSize.h,
|
port->drawFilledRect(m_screenInfo.pos.x, 0, CALIBRATION_LINE_THICKNESS, windowSize.h,
|
||||||
m_screenInfo.lineColor);
|
m_screenInfo.lineColor);
|
||||||
|
|
||||||
|
/* Show the touchscreen message */
|
||||||
|
|
||||||
|
#ifdef CONFIG_NXWM_CALIBRATION_MESSAGES
|
||||||
|
m_text->enableDrawing();
|
||||||
|
m_text->redraw();
|
||||||
|
m_text->disableDrawing();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user