Background technology
The electronic installation with Touch Screen needs the position of touch first carrying out Touch Screen to calibrate before use and obtains relevant calibration parameter, correctly to understand the actual coordinate of user at Touch Screen institute touch-control by this calibration parameter in each use afterwards.
The embedded OS that WindowsCE (hereinafter referred to as WinCE) researches and develops for Microsoft, there is in WinCE built-in calibration procedure, only need when calibrating Touch Screen to call out the built-in calibration function of WinCE, such as TouchClaibrate, calibration can be completed to obtain calibration parameter, and this calibration parameter be deposited in the registration table (Registry) of WinCE.
As shown in Figure 1, first step S101 tells pattern window events subsystem (Graphics, Windowing, andEventsSubsystem, or claim graphics process window, hereinafter referred to as the GWES) process of WinCE to the built-in program process 1 of WinCE.Because GWES process is connected applications program design interface (applicationprogramminginterface, API), user interface (userinterface, and Graphics Device Interface database (graphicsdeviceinterfacelibraries UI), GDIlibraries) form, therefore GWES process is bridge between the operating system of user, application apparatus and application apparatus and interface.During each execution GWES process, step S102 can check whether as first start, if first start then proceeds to step S103, step 103 reads calibration parameter and is deposited the touch-control dynamic base (touch.dll) 22 to GWES process from the registration table 21 of WinCE.If not first start then proceeds to step S104, step S104 obtains calibration parameter from the touch-control dynamic base (touch.dll) 22 of GWES process.Then in each use afterwards, the actual coordinate of user at Touch Screen institute touch-control is correctly understood by this calibration parameter.
Although the characteristic of this height of WinCE encapsulation brings developer very large convenience, relatively, can be just few a lot of for the space of developer's amendment.Therefore, under the operating environment of WinCE, the user interface not only calibrating flow process can for customized limited space, and customized meeting brings developer the huge and workload of complexity.
Embodiment
Some vocabulary is employed to censure particular element in the middle of instructions and claim.Person of ordinary skill in the field should understand, and same element may be called with different noun by manufacturer.This specification and claims not using the difference of title as the mode of distinguish one element from another, but using element difference functionally as differentiation criterion." comprising " mentioned in instructions and claim is in the whole text open language, therefore should be construed to " comprise but be not limited to ".In addition, " couple " word comprise directly any at this and be indirectly electrically connected means.Describing and coordinating Fig. 1 to Fig. 3 in full that the present invention is described by following embodiment, but following describe in device, element and method, step be explain the present invention, and should not be used for restriction the present invention.
One embodiment of the invention provides a kind of method of the customized calibration Touch Screen based on WinCE operating system, is applicable to the electronic installation at least with a Touch Screen, such as personal digital assistant (Personaldigitalassistant, PDA).The relevant informations such as the framework of WinCE operating system and function are open in MSDN (MicrosoftDeveloperNetwork), this instructions is based on the relevant information disclosed by MSDN, and the published relevant public routine of MSDN or common code are not then repeated in this manual.
Figure 2 shows that the process flow diagram of customized according to an embodiment of the invention calibration Touch Screen.Wherein process 2 (S201 ~ 212) is customized according to an embodiment of the invention calibration procedure, registration table 21 and touch-control dynamic base (touch.dll) 22 identical with the registration table 21 in Fig. 1 and touch-control dynamic base (touch.dll) 22.
Step S201 performs a customized calibration procedure for starting, and such as, by this customized calibration procedure called after AppCali.exe, then step S202 shows the customized Calibration interface of AppCali.exe.Step S203 judges whether user presses reference point (provided by calibration interface and be shown on Touch Screen).If so, then step S204 reads the position of touch original value pressed of user; If not, then step S211 judges whether time-out.If time-out, as shown in step S212, terminate customized calibration, if non-time-out, again enter step S203 and judge whether user presses reference point.
If user presses reference point, step S204 reads the position of touch original value that user presses.In one embodiment, the position of touch original value that reading user presses performs by the built-in routine of WinCE, such as, use the TouchPanelEnable function that WinCE is built-in.In another embodiment, can at pattern window events subsystem (Graphics, Windowing, andEventsSubsystem, or claim graphics process window, hereinafter referred to as GWES) set up the function of a reading position of touch original value in the touch-control dynamic base (touch.dll) of process, utilize this function interface can directly read position of touch original value, and the built-in routine as WinCE need not read position of touch original value through several steps.
Then step S205 judges whether position of touch original value is effective value, if effective value then step S206 this effective position of touch original value is recorded as the position of touch sampled value of corresponding reference point.
Step S207 judges whether the position of touch sampled value having gathered all reference point, if the position of touch sampled value of all reference point has gathered all, then step S208 calculates new calibration parameter according to these position of touch sampled values and its calibration reference value.In one embodiment, position of touch sampled value and the new calibration parameter corresponding to its calibration reference value can be calculated according to algorithm disclosed in MSDN.
Because the new calibration parameter obtained through above-listed step is not that the calibration procedure built-in according to WinCE obtains, therefore completing steps S208 instantly and in use each afterwards, cannot forever utilize these new calibration parameters.Have no idea forever to utilize these new calibration parameters when performing the GWES process in Fig. 1 namely at every turn.Therefore these new calibration parameters are updated to make these new calibration parameters forever come into force in the registration table 21 of WinCE by step S209, namely replace the calibration parameter originally in WinCE registration table 21 with new calibration parameter.
In addition, as shown in Fig. 1 step S103, because GWES process only can read calibration parameter when starting shooting for the first time from registration table 21, after these new calibration parameters are updated in the registration table 21 of WinCE by step S209, if user will use these new calibration parameters, then must restart and GWES process just can be made from registration table 21 to read new calibration parameter and new calibration parameter is deposited in the touch-control dynamic base (touch.dll) 22 of GWES process.
Therefore, new calibration parameter is updated in touch-control dynamic base (touch.dll) 22 to make these new calibration parameters can come into force at once by step S210.In one embodiment, the calibration parameter in touch-control dynamic base (touch.dll) 22 is set to the variable of shared section key by step S210, and new calibration parameter is updated to the calibration parameter in touch-control dynamic base (touch.dll) 22.In another embodiment, the calibration parameter in touch-control dynamic base (touch.dll) 22 is set to registration table region by step S210, and new calibration parameter is updated to the calibration parameter in touch-control dynamic base (touch.dll) 22.In an other embodiment, calibration parameter in touch-control dynamic base (touch.dll) 22 is set to event (event) global variable by step S210, and new calibration parameter is updated to the calibration parameter in touch-control dynamic base (touch.dll) 22.Then the new calibration parameter that customized calibration procedure obtains can be updated in touch-control dynamic base (touch.dll) 22 to make new calibration parameter come into force through above-described embodiment.
In one embodiment, calibration can pass through five reference point to carry out, such as center, upper left, lower-left, upper right, five, bottom right reference point, customized calibration interface is display one mark on the position of a reference point (such as hitting exactly) of Touch Screen, a such as cross mark.When user is according to when hitting exactly mark shown in reference point and clicking Touch Screen, step S204 reads the position of touch original value that user clicks, then step S205 judges that whether this position of touch original value is effective, if effectively, this position of touch original value is recorded as the position of touch sampled value of center corresponding to reference point by step S206, then repeats above-listed step with acquisition, upper left, lower-left, upper right, each self-corresponding position of touch sampled value of bottom right reference point.Then step S208 is according to these position of touch sampled values and corresponding calibration reference value (the such as true coordinate of corresponding reference point, that is frame of reference coordinate identification) calculate new calibration parameter, such as can obtain ten new calibration parameters for the x-axis coordinate of five reference point and y-axis coordinate.
In one embodiment, the customized calibration interface of customized calibration procedure AppCali.exe comprises the function button of user's self-defining, such as " determine " button and " exiting " button, customized calibration interface more can be increased in customized calibration procedure the information that will be shown to user and know, allows user can more independently control customized calibration procedure.
Figure 3 shows that electronic installation 30, such as PDA according to an embodiment of the invention, and the operating system of this electronic installation is WinCE.
Electronic installation 30 comprises storage element 301, and it stores WinCE operating system 311 and customized calibration procedure 312.Primary memory 303 couples with storage element 301 and Touch Screen 302.Processing unit 304 and storage element 301, Touch Screen 302 and primary memory 303 couple, and processing unit 304 loads WinCE operating system 311 to primary memory 303 from storage element 301 and performs.When carrying out the calibration of Touch Screen 302, processing unit 304 loads customized calibration procedure 312 to primary memory 303 from storage element 301 and performs, and makes Touch Screen 302 show the customized Calibration interface of customized calibration procedure 312 according to customized calibration procedure 312.The new calibration parameter that the customized calibration procedure 312 of execution obtains is updated in the registration table 321 of WinCE operating system 311 and in the GWES process 322 of WinCE operating system 311 by processing unit 304.
In one embodiment, the GWES process 322 of WinCE operating system 311 comprises touch-control dynamic base (touch.dll).Touch-control dynamic base (touch.dll) comprises the function of a reading position of touch original value, when customized calibration procedure 312 will read the position of touch original value of reference point, the function that processing unit 304 loads this reading position of touch original value performs such as read position of touch original value shown in step S204 to primary memory 303, and then customized calibration procedure 312 judges that whether position of touch original value is effective.If effectively, this position of touch original value is recorded as the position of touch sampled value of corresponding reference point.The position of touch sampled value that processing unit 304 is corresponding according to all reference point calculates new calibration parameter with its calibration reference value.
Be updated in the GWES process 322 of WinCE operating system 311 about by new calibration parameter, in one embodiment, calibration parameter in touch-control dynamic base (touch.dll) is set to the variable of shared section key, and the calibration parameter in touch-control dynamic base (touch.dll) replaces with new calibration parameter by customized calibration procedure 312.In another embodiment, the calibration parameter in touch-control dynamic base (touch.dll) is set to registration table region, and the calibration parameter in touch-control dynamic base (touch.dll) replaces with new calibration parameter by customized calibration procedure 312.In an other embodiment, calibration parameter in touch-control dynamic base (touch.dll) is set to event global variable, and the calibration parameter in touch-control dynamic base (touch.dll) replaces with new calibration parameter by customized calibration procedure 312.
According to above-listed embodiment, the demand that developer is able to realize customized calibration on the basis of the intrinsic flow process of WinCE is to change user interface or to increase the function button etc. of self-defining, and the calibration result (new calibration parameter) that this customized calibration is obtained can be permanent and come into force under WinCE operating environment at once.Such as, if desired user interface during change calibration Touch Screen or need to increase the function button of self-defining, namely the amendment carrying out user interface according to the instruction of above-listed embodiment does not need to recompilate BSP (BoardSupportPackage), and the kind of the base map of user interface, font and/or language can be revised, and other customized functions can be increased, such as increase the function key of " determination " and " exiting ".
The above embodiments are only used for enumerating embodiments of the present invention, and explain technical characteristic of the present invention, are not used for limiting category of the present invention.According to spirit of the present invention, unlabored change or isotropism arrangement all belong to the scope that the present invention advocates to any person of ordinary skill in the field, and interest field of the present invention should be as the criterion with claim.