CN111870938B - Windml-based control rod serial port drive design method under vxworks system - Google Patents
Windml-based control rod serial port drive design method under vxworks system Download PDFInfo
- Publication number
- CN111870938B CN111870938B CN202010656725.1A CN202010656725A CN111870938B CN 111870938 B CN111870938 B CN 111870938B CN 202010656725 A CN202010656725 A CN 202010656725A CN 111870938 B CN111870938 B CN 111870938B
- Authority
- CN
- China
- Prior art keywords
- serial port
- data
- force
- mouse
- sensitive
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 57
- 238000013461 design Methods 0.000 title claims abstract description 11
- 230000008569 process Effects 0.000 claims abstract description 34
- 238000006073 displacement reaction Methods 0.000 claims abstract description 20
- 238000001914 filtration Methods 0.000 claims abstract description 13
- 241000699666 Mus <mouse, genus> Species 0.000 claims description 50
- 238000012545 processing Methods 0.000 claims description 10
- 241000699670 Mus sp. Species 0.000 claims description 7
- 238000006243 chemical reaction Methods 0.000 claims description 4
- 230000004044 response Effects 0.000 abstract description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/40—Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/10—Program control for peripheral devices
- G06F13/102—Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/03—Arrangements for converting the position or the displacement of a member into a coded form
- G06F3/033—Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
- G06F3/038—Control and interface arrangements therefor, e.g. drivers or device-embedded control circuitry
- G06F3/0383—Signal control means within the pointing device
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
- G06F9/4411—Configuring for operating with peripheral devices; Loading of device drivers
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Multimedia (AREA)
- Computer Security & Cryptography (AREA)
- Human Computer Interaction (AREA)
- Position Input By Displaying (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention belongs to the technical field of vxworks systems, and particularly relates to a control rod serial port drive design method based on windml under the vxworks system. Firstly, configuring windml virtual mouse equipment; secondly, realizing the serial port driving of the control lever based on windml virtual mouse equipment; comprising the following steps: initializing a serial device use environment; analyzing serial data to obtain force-sensitive adjustment coordinates sent by the operating lever; filtering the rebound force sensitive adjustment coordinate value according to the rebound process rate of the operating lever; converting the filtered force-sensitive coordinate values into system mouse events; through the steps, the serial port driving function of the control lever under the vxwork system is realized. Compared with the prior art, the invention simplifies the serial port driving and loading process of the control lever, filters rebound process data according to the force-sensitive movement displacement characteristics of the control lever, shortens the response time of converting the movement event of the control lever into the event of the mouse, can be compatible with other types of mouse configuration and use, and ensures the interface performance and the safety of the system.
Description
Technical Field
The invention belongs to the technical field of vxworks systems, and particularly relates to a control rod serial port drive design method based on windml under the vxworks system.
Background
The vxwork operating system is an embedded operating system, and the use of WindML graphic library programming becomes a main means for developing graphics and man-machine interaction interfaces under vxworks. The control lever is used as a common input device in a weapon system, and the control of the up-down, left-right directions is realized by pulling a handle of the control lever by a certain angle.
In order to enable the joystick device to be used as a serial device in a vxworks system normally, the serial driving problem of the joystick needs to be solved. The existing mature joystick driving technology is realized based on windml multiple pointers, the joystick equipment is used as a low-layer input driver to use the standard serial port driver of the system, the high-layer input driver is used as the driving content, and the same driving design is carried out on the joystick of the serial port by simulating windml to the message mechanism of the ps/2 mouse; however, the method is not compatible with a usb type mouse, the type of the access device is limited by the system, and the inaccuracy of the movement position of the joystick is caused by filtering data without the rebound process of the joystick.
In order to solve the problem of serial port driving of the joystick under vxwork, be compatible with other input mouse devices, simplify the driving event process, a design method for serial port driving of the joystick based on a windml virtual mouse needs to be provided.
Disclosure of Invention
First, the technical problem to be solved
The invention aims to solve the technical problems that: how to put forward a joystick serial port drive design method based on windml virtual mice.
(II) technical scheme
In order to solve the technical problems, the invention provides a control rod serial port drive design method based on windml under a vxworks system, which comprises the following steps:
Step 1: configuring windml a virtual mouse device;
In order for the vxworks system to simulate the joystick movement event into a system mouse event, and simultaneously for the compatibility of the system to normally use other types of mice, the virtual mouse device is required to be added in windml configuration files without occupying the system events of the other types of mice; the aim of converting the joystick movement event into a mouse movement event is fulfilled by calling the mouse event of the virtual mouse device;
step2: realizing the serial driving of the control lever based on windml virtual mouse equipment; the step2 comprises the following steps:
Step 21: initializing a serial device use environment;
step 22: analyzing serial data to obtain force-sensitive adjustment coordinates sent by the operating lever;
Step 23: filtering the rebound force sensitive adjustment coordinate value according to the rebound process rate of the operating lever;
Step 24: converting the filtered force-sensitive coordinate values into system mouse events;
Through the steps, the serial port driving function of the control lever under the vxwork system is realized.
Wherein, the step 1 specifically includes:
step 11: creating windml engineering;
Step 12: opening config.windml file adding display equipment in engineering, and adding PS2 or USB mouse according to requirements;
Step 13: the virtual mouse device configuration statement is manually added in config.windml with a text editor open.
Wherein, the step 21 includes:
firstly, in the equipment connected with the vxworks system, a serial device descriptor communicated with a joystick is designated;
Secondly, opening serial equipment communicated with the operating lever through a vxworks system function;
then, configuring the baud rate and check bit parameters of the serial port;
And finally, creating a serial port receiving task to receive the serial port data of the operating lever.
Wherein, the step 22 includes:
firstly, receiving a task through a serial port, and acquiring the content of a mobile event data message sent by operating lever equipment;
Then, verifying the validity of the message, and carrying out sliding window processing on the illegal message to reduce the packet loss rate of the serial port data; and if the message is legal, acquiring force-sensitive adjustment coordinates (x, y) of the joystick relative to the center point in the data message content of the mobile event.
Wherein, the step 23 includes:
Firstly, estimating the maximum distance MLS of single-point movement according to the data rate sent by a serial port of an operating lever;
then, calculating single-point movement displacement of the coordinate point relative to the last coordinate point;
And secondly, comparing the single-point movement displacement with a coordinate point in the MLS filtering rebound process, and filtering rebound force-sensitive adjustment coordinate values in the coordinate point.
Wherein, the step 24 includes:
Firstly, multiplying the relative displacement of the force-sensitive coordinate point and the central point on X and Y axes by a ratio value rate to obtain a relative movement point of the mouse of the joystick;
then, taking the mouse moving point as an input parameter of a mouse event function of the virtual mouse device;
finally, the system mouse event is simulated by calling a mouse event function of the virtual mouse device.
In the step 21, in the process of creating a serial port receiving task to receive the serial port data of the operating lever, the ioctl function of the vxworks system is used circularly to judge whether the serial port has new data receiving; when the receiving length is greater than zero, the read function is used to read the serial data.
In step 22, the correct force-sensitive coordinate value of the control lever can be obtained after the message validity of the serial port data obtained by the serial port receiving task is judged, specifically:
Storing all serial port data received at this time into a temporary array Temp;
Each data in the temporary array Temp is processed in sequence, the total count of the total number of the synthesized data is counted, when the total count is the number of frame heads, whether the frame heads meet the requirement is judged, the frame heads are stored into the buffer array, and if the frame heads do not meet the requirement, the total count is set as 1, and the subsequent data are processed continuously; when the total count is the frame length, judging whether the frame tail and the checksum meet the requirements, if so, calculating the force-sensitive adjustment coordinates (x, y) of the joystick and setting the total count to 0, otherwise, continuously searching for a second frame head from the first frame head position z1 to the position pointed by the total count in the buffer array: if so, shifting all data to an array head after the second frame head position z2 and assigning a value of subtracting z2 from the frame length to the count; if not found, setting count to 1;
And judging whether the number of the processing is smaller than the number of the serial data received at the time, if so, continuing to process, and if not, exiting the circulation.
In the step 23, if the effective force-sensitive coordinate point data is obtained in the step 22, it is determined whether the data belongs to the point data sent in the automatic rebound process of the joystick; the method comprises the following specific steps:
Setting the total displacement of the left and right movement of the operating lever as S0 and the total displacement of the up and down movement as S1; the number of the points sent by the control rod in each rebound process is N, the average distance of the horizontal coordinates between the points is d0=S0/N, and the average distance of the vertical coordinates is d1=S1/N;
if the coordinates of the central point are (x 0, y 0), the received force-sensitive coordinate point is (x 2, y 2), the last received force-sensitive coordinate point is (x 1, y 1), d0= |x1-x2|, d1= |y1-y2|, and the sizes of D0 and D0 and the sizes of D1 and D1 are judged; when D0< D0 and D1< D1, the force-sensitive coordinate point is judged to be satisfactory.
In the step 23, if the force-sensitive coordinate point data of the non-rebound process is obtained in the step 23, simulating a joystick movement event into a system mouse event; the method comprises the following specific steps:
Calculating coordinate points of a screen cursor according to the force-sensitive coordinate points;
Setting a conversion ratio value rate, wherein the moving direction of the operating lever is positive and negative from left to right, and positive from top to bottom;
x3 = (x 0-x 2) rate, y3 = (y 2-y 0) rate of coordinate points of the screen cursor;
and taking the coordinate point of the screen cursor as the input of a virtual mouse event, and simulating a system mouse event.
(III) beneficial effects
Compared with the prior art, the invention realizes the control lever serial port drive based on windml under vxoworks system according to the force-sensitive displacement characteristics of control lever equipment and by combining windml libraries aiming at the characteristics of a system platform in the application scene of vxworks. The invention simplifies the serial port driving and loading process of the control lever, filters rebound process data according to the force-sensitive movement displacement characteristics of the control lever, shortens the response time of converting the control lever movement event into the mouse event, can be compatible with other types of mouse configuration and use, and ensures the interface performance and the safety of the system.
Drawings
Fig. 1 is a flow chart of a joystick serial port drive implementation.
Detailed Description
For the purposes of clarity, content, and advantages of the present invention, a detailed description of the embodiments of the present invention will be described in detail below with reference to the drawings and examples.
In order to solve the problems in the prior art, the invention provides a control rod serial port driving design method based on windml under a vxworks system, which is used for solving the control rod serial port driving problem under a vxworks system platform; as shown in fig. 1, the method comprises the steps of:
Step 1: configuring windml a virtual mouse device;
In order for the vxworks system to simulate the joystick movement event into a system mouse event, and simultaneously for the compatibility of the system to normally use other types of mice, the virtual mouse device is required to be added in windml configuration files without occupying the system events of the other types of mice; the aim of converting the joystick movement event into a mouse movement event is fulfilled by calling the mouse event of the virtual mouse device;
step2: realizing the serial driving of the control lever based on windml virtual mouse equipment; the step2 comprises the following steps:
Step 21: initializing a serial device use environment;
step 22: analyzing serial data to obtain force-sensitive adjustment coordinates sent by the operating lever;
Step 23: filtering the rebound force sensitive adjustment coordinate value according to the rebound process rate of the operating lever;
Step 24: converting the filtered force-sensitive coordinate values into system mouse events;
Through the steps, the serial port driving function of the control lever under the vxwork system is realized.
Wherein, the step 1 specifically includes:
step 11: creating windml engineering;
Step 12: opening config.windml file adding display equipment in engineering, and adding PS2 or USB mouse according to requirements;
Step 13: the virtual mouse device configuration statement is manually added in config.windml with a text editor open.
Wherein, the step 21 includes:
firstly, in the equipment connected with the vxworks system, a serial device descriptor communicated with a joystick is designated;
Secondly, opening serial equipment communicated with the operating lever through a vxworks system function;
then, configuring the baud rate and check bit parameters of the serial port;
And finally, creating a serial port receiving task to receive the serial port data of the operating lever.
Wherein, the step 22 includes:
firstly, receiving a task through a serial port, and acquiring the content of a mobile event data message sent by operating lever equipment;
Then, verifying the validity of the message, and carrying out sliding window processing on the illegal message to reduce the packet loss rate of the serial port data; and if the message is legal, acquiring force-sensitive adjustment coordinates (x, y) of the joystick relative to the center point in the data message content of the mobile event.
Wherein, the step 23 includes:
Firstly, estimating the maximum distance MLS of single-point movement according to the data rate sent by a serial port of an operating lever;
then, calculating single-point movement displacement of the coordinate point relative to the last coordinate point;
And secondly, comparing the single-point movement displacement with a coordinate point in the MLS filtering rebound process, and filtering rebound force-sensitive adjustment coordinate values in the coordinate point.
Wherein, the step 24 includes:
Firstly, multiplying the relative displacement of the force-sensitive coordinate point and the central point on X and Y axes by a ratio value rate to obtain a relative movement point of the mouse of the joystick;
then, taking the mouse moving point as an input parameter of a mouse event function of the virtual mouse device;
finally, the system mouse event is simulated by calling a mouse event function of the virtual mouse device.
In the step 21, in the process of creating a serial port receiving task to receive the serial port data of the operating lever, the ioctl function of the vxworks system is used circularly to judge whether the serial port has new data receiving; when the receiving length is greater than zero, the read function is used to read the serial data.
In step 22, the correct force-sensitive coordinate value of the control lever can be obtained after the message validity of the serial port data obtained by the serial port receiving task is judged, specifically:
Storing all serial port data received at this time into a temporary array Temp;
Each data in the temporary array Temp is processed in sequence, the total count of the total number of the synthesized data is counted, when the total count is the number of frame heads, whether the frame heads meet the requirement is judged, the frame heads are stored into the buffer array, and if the frame heads do not meet the requirement, the total count is set as 1, and the subsequent data are processed continuously; when the total count is the frame length, judging whether the frame tail and the checksum meet the requirements, if so, calculating the force-sensitive adjustment coordinates (x, y) of the joystick and setting the total count to 0, otherwise, continuously searching for a second frame head from the first frame head position z1 to the position pointed by the total count in the buffer array: if so, shifting all data to an array head after the second frame head position z2 and assigning a value of subtracting z2 from the frame length to the count; if not found, setting count to 1 (when the frame head has two bytes, the last data is needed and assigned to the first digit of the array);
And judging whether the number of the processing is smaller than the number of the serial data received at the time, if so, continuing to process, and if not, exiting the circulation.
In the step 23, if the effective force-sensitive coordinate point data is obtained in the step 22, it is determined whether the data belongs to the point data sent in the automatic rebound process of the joystick; the method comprises the following specific steps:
Setting the total displacement of the left and right movement of the operating lever as S0 and the total displacement of the up and down movement as S1; the number of the points sent by the control rod in each rebound process is N, the average distance of the horizontal coordinates between the points is d0=S0/N, and the average distance of the vertical coordinates is d1=S1/N;
if the coordinates of the central point are (x 0, y 0), the received force-sensitive coordinate point is (x 2, y 2), the last received force-sensitive coordinate point is (x 1, y 1), d0= |x1-x2|, d1= |y1-y2|, and the sizes of D0 and D0 and the sizes of D1 and D1 are judged; when D0< D0 and D1< D1, the force-sensitive coordinate point is judged to be satisfactory.
In the step 23, if the force-sensitive coordinate point data of the non-rebound process is obtained in the step 23, simulating a joystick movement event into a system mouse event; the method comprises the following specific steps:
Calculating coordinate points of a screen cursor according to the force-sensitive coordinate points;
Setting a conversion ratio value rate, wherein the moving direction of the operating lever is positive and negative from left to right, and positive from top to bottom;
x3 = (x 0-x 2) rate, y3 = (y 2-y 0) rate of coordinate points of the screen cursor;
and taking the coordinate point of the screen cursor as the input of a virtual mouse event, and simulating a system mouse event.
Example 1
The embodiment provides a control lever serial port driving design method based on windml under a vxworks system, which comprises the following steps:
(1) Configuring windml a virtual mouse device, modifying windml a configuration file to simulate a virtual mouse for the operation rod device and simultaneously being compatible with other types of mouse devices;
(2) And realizing serial driving of the control lever based on windml virtual mouse equipment, initializing a serial use environment, establishing a serial receiving task, analyzing serial data to obtain force-sensitive adjustment coordinates sent by the control lever, filtering the rebound force-sensitive adjustment coordinates according to the rebound process rate of the control lever, and converting the filtered force-sensitive coordinate values into a system mouse event.
In the step (2), the data received by the serial port is subjected to validity check to obtain the coordinate value of the joystick movement event, then the effective coordinate point is filtered according to the speed characteristic of the joystick rebound process, meanwhile, the movement proportion value is set, the relative point of the mouse movement is calculated, and the virtual mouse event is called, so that the purpose of driving the joystick is realized.
Example 2
In this embodiment, as shown in fig. 1, in order to solve the serial port driving problem of the joystick under vworks, an implementation method based on windml virtual mouse is adopted. The contents of this embodiment are further described below.
1. Configuring windml virtual mouse devices
Under the condition that normal use of the system is not affected, in order to solve the problem that the system is compatible with other types of mouse equipment, a virtual mouse equipment is independently configured for the system. In the workbench integrated development environment, windml graphical interface configuration interfaces do not support mouse type multi-selection, and in order to solve the problem, a windml configuration file needs to be modified to manually add virtual mouse equipment. The specific steps of configuring windml the virtual mouse device are as follows:
① Creating windml engineering;
② Opening config.windml file adding display equipment in engineering, and adding PS2 or USB mouse according to requirements;
③ The virtual mouse device configuration statement is manually added in config.windml with a text editor open.
2. Implementing joystick serial port driven events based on windml virtual mice
(1) Initializing serial device use environment
The method for initializing the serial device environment comprises the following steps:
step1, reading configuration information such as serial port numbers, baud rates and the like in a configuration file;
step2, acquiring a serial device descriptor;
step3, using vxworks system function open to open the serial port equipment represented by the descriptor and storing the operation handle pointed by the serial port;
Step4, using the ioctl function to configure the baud rate and the verification attribute of the serial device;
step5, creating a serial port receiving task;
step6, the receiving task circularly uses the ioctl function to judge whether the serial port has new data to receive. When the receiving length is greater than zero, using a read function to read the serial port data;
(2) Force-sensitive adjustment coordinate sent by analytic serial data acquisition control lever
The accurate force-sensitive coordinate value of the control lever can be obtained after the message legitimacy judgment of the serial port data obtained by the serial port receiving task, and the specific steps are as follows:
step1, storing all serial port data received at the time into a temporary array Temp;
Step2, sequentially processing each data in the temporary array Temp, counting the total number count of synthesized data, judging whether the frame header meets the requirement when the total number count is the number of the frame header, storing the frame header into a buffer array, and setting the total number count as 1 if the frame header does not meet the requirement, and continuously processing the subsequent data; when the total count is the frame length, judging whether the frame tail and the checksum meet the requirements, if so, calculating the force-sensitive adjustment coordinates (x, y) of the joystick and setting the total count to 0, otherwise, continuously searching for a second frame head from the first frame head position z1 to the position pointed by the total count in the buffer array: if so, shifting all data to an array head after the second frame head position z2 and assigning a value of subtracting z2 from the frame length to the count; if not found, count is set to 1 (when there are two bytes in the frame header, the last data is needed and assigned to the array header).
Step3, judging whether the number of the processing is smaller than the number of the serial port data received at the time, if so, continuing the processing, and if not, exiting the circulation;
(3) Filtering the rebound force sensitive adjustment coordinate values according to the rate of the rebound process of the joystick
If the effective force-sensitive coordinate point data is obtained in the step (2), judging whether the data belongs to the point data sent in the automatic rebound process of the operating lever. The method comprises the following specific steps:
Step1, setting the total displacement of the left and right movement of the joystick as S0 and the total displacement of the up and down movement as S1. The number of points transmitted by the joystick in each rebound process is N, the average distance of the abscissa between the points is d0=s0/N, and the average distance of the ordinate is d1=s1/N.
Step2, if the coordinates of the central point are (x 0, y 0), the received force-sensitive coordinate point is (x 2, y 2), the last received force-sensitive coordinate point is (x 1, y 1), d0= |x1-x2|, d1= |y1-y2|, and the sizes of D0 and D0 and D1 and D1 are judged; when D0 is less than D0 and D1 is less than D1, judging that the force-sensitive coordinate point meets the requirement;
(4) Converting the coordinate value of the screen point into a system mouse event
And (3) if the force-sensitive coordinate point data of the non-rebound process is obtained in the step (3), simulating a joystick movement event into a system mouse event. The method comprises the following specific steps:
Step1, calculating coordinate points of a screen cursor according to the force-sensitive coordinate points;
the conversion ratio value rate is set, and the movement direction of the joystick is positive and negative, positive and negative.
X3 = (x 0-x 2) rate, y3 = (y 2-y 0) rate of coordinate points of the screen cursor;
step2, taking the coordinate point of the screen cursor as the input of a virtual mouse event, and simulating a system mouse event.
By using the technical scheme, the operation steps are adopted, the invention can realize serial port driving of the control lever under vxwork systems, and the method is verified by an algorithm and is subjected to experimental verification. The result shows that the scheme can shorten the response event time of the joystick, ensure that the joystick device is normally used under the vxwork system and can be compatible with other types of mice.
The foregoing is merely a preferred embodiment of the present invention, and it should be noted that modifications and variations could be made by those skilled in the art without departing from the technical principles of the present invention, and such modifications and variations should also be regarded as being within the scope of the invention.
Claims (1)
1. The control rod serial port driving design method based on windml under the vxworks system is characterized by comprising the following steps:
Step 1: configuring windml a virtual mouse device;
In order for the vxworks system to simulate the joystick movement event into a system mouse event, and simultaneously for the compatibility of the system to normally use other types of mice, the virtual mouse device is required to be added in windml configuration files without occupying the system events of the other types of mice; the aim of converting the joystick movement event into a mouse movement event is fulfilled by calling the mouse event of the virtual mouse device;
step2: realizing the serial driving of the control lever based on windml virtual mouse equipment; the step2 comprises the following steps:
Step 21: initializing a serial device use environment;
step 22: analyzing serial data to obtain force-sensitive adjustment coordinates sent by the operating lever;
Step 23: filtering the rebound force sensitive adjustment coordinate value according to the rebound process rate of the operating lever;
Step 24: converting the filtered force-sensitive coordinate values into system mouse events;
through the steps, the serial port driving function of the control lever under the vxwork system is realized;
wherein, the step 1 specifically includes:
step 11: creating windml engineering;
Step 12: opening config.windml file adding display equipment in engineering, and adding PS2 or USB mouse according to requirements;
step 13: opening a virtual mouse device configuration sentence manually added in config.windml by using a text editor;
wherein, the step 21 includes:
firstly, in the equipment connected with the vxworks system, a serial device descriptor communicated with a joystick is designated;
Secondly, opening serial equipment communicated with the operating lever through a vxworks system function;
then, configuring the baud rate and check bit parameters of the serial port;
Finally, creating a serial port receiving task to receive serial port data of the operating lever;
Wherein, the step 22 includes:
firstly, receiving a task through a serial port, and acquiring the content of a mobile event data message sent by operating lever equipment;
then, verifying the validity of the message, and carrying out sliding window processing on the illegal message to reduce the packet loss rate of the serial port data; if the message is legal, acquiring force-sensitive adjustment coordinates (x, y) of the joystick relative to the center point in the data message content of the mobile event;
Wherein, the step 23 includes:
Firstly, estimating the maximum distance MLS of single-point movement according to the data rate sent by a serial port of an operating lever;
then, calculating single-point movement displacement of the coordinate point relative to the last coordinate point;
Secondly, comparing the single-point movement displacement with a coordinate point in the MLS filtering rebound process, and filtering rebound force-sensitive adjustment coordinate values in the coordinate point;
wherein, the step 24 includes:
Firstly, multiplying the relative displacement of the force-sensitive coordinate point and the central point on X and Y axes by a ratio value rate to obtain a relative movement point of the mouse of the joystick;
then, taking the mouse moving point as an input parameter of a mouse event function of the virtual mouse device;
finally, simulating a system mouse event by calling a mouse event function of the virtual mouse device;
In the step 21, in the process of creating a serial port receiving task to receive the serial port data of the operating lever, the ioctl function of the vxworks system is used circularly to judge whether the serial port has new data receiving; when the receiving length is greater than zero, using a read function to read the serial port data;
In step 22, the correct force-sensitive coordinate value of the control lever can be obtained after the message validity of the serial port data obtained by the serial port receiving task is judged, specifically:
Storing all serial port data received at this time into a temporary array Temp;
Each data in the temporary array Temp is processed in sequence, the total count of the total number of the synthesized data is counted, when the total count is the number of frame heads, whether the frame heads meet the requirement is judged, the frame heads are stored into the buffer array, and if the frame heads do not meet the requirement, the total count is set as 1, and the subsequent data are processed continuously; when the total count is the frame length, judging whether the frame tail and the checksum meet the requirements, if so, calculating the force-sensitive adjustment coordinates (x, y) of the joystick and setting the total count to 0, otherwise, continuously searching for a second frame head from the first frame head position z1 to the position pointed by the total count in the buffer array: if so, shifting all data to an array head after the second frame head position z2 and assigning a value of subtracting z2 from the frame length to the count; if not found, setting count to 1;
Judging whether the number of the processing is smaller than the number of the serial port data received at the time, if so, continuing to process, and if not, exiting the circulation;
in the step 23, if the effective force-sensitive coordinate point data is obtained in the step 22, it is determined whether the data belongs to the point data sent in the automatic rebound process of the joystick; the method comprises the following specific steps:
Setting the total displacement of the left and right movement of the operating lever as S0 and the total displacement of the up and down movement as S1; the number of the points sent by the control rod in each rebound process is N, the average distance of the horizontal coordinates between the points is d0=S0/N, and the average distance of the vertical coordinates is d1=S1/N;
if the coordinates of the central point are (x 0, y 0), the received force-sensitive coordinate point is (x 2, y 2), the last received force-sensitive coordinate point is (x 1, y 1), d0= |x1-x2|, d1= |y1-y2|, and the sizes of D0 and D0 and the sizes of D1 and D1 are judged; when D0 is less than D0 and D1 is less than D1, judging that the force-sensitive coordinate point meets the requirement;
in the step 23, if the force-sensitive coordinate point data of the non-rebound process is obtained in the step 23, simulating a joystick movement event into a system mouse event; the method comprises the following specific steps:
Calculating coordinate points of a screen cursor according to the force-sensitive coordinate points;
Setting a conversion ratio value rate, wherein the moving direction of the operating lever is positive and negative from left to right, and positive from top to bottom;
x3 = (x 0-x 2) rate, y3 = (y 2-y 0) rate of coordinate points of the screen cursor;
and taking the coordinate point of the screen cursor as the input of a virtual mouse event, and simulating a system mouse event.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010656725.1A CN111870938B (en) | 2020-07-09 | 2020-07-09 | Windml-based control rod serial port drive design method under vxworks system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010656725.1A CN111870938B (en) | 2020-07-09 | 2020-07-09 | Windml-based control rod serial port drive design method under vxworks system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111870938A CN111870938A (en) | 2020-11-03 |
CN111870938B true CN111870938B (en) | 2024-07-30 |
Family
ID=73150419
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010656725.1A Active CN111870938B (en) | 2020-07-09 | 2020-07-09 | Windml-based control rod serial port drive design method under vxworks system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111870938B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108072342A (en) * | 2017-11-23 | 2018-05-25 | 无锡合壮智慧交通有限公司 | A kind of automatic testing method and device of manual gear gear level of vehicle |
Family Cites Families (25)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20060024589A (en) * | 2004-09-14 | 2006-03-17 | 에스케이 텔레콤주식회사 | Mobile terminal having an usb on the go module |
US8442607B2 (en) * | 2006-09-07 | 2013-05-14 | Sotera Wireless, Inc. | Hand-held vital signs monitor |
JP2008197600A (en) * | 2007-02-16 | 2008-08-28 | Renesas Technology Corp | Semiconductor integrated circuit and data processing system |
KR101395780B1 (en) * | 2007-07-27 | 2014-05-16 | 삼성전자주식회사 | Pressure sensor arrary apparatus and method for tactility |
CN101504585B (en) * | 2009-03-09 | 2011-04-06 | 广东威创视讯科技股份有限公司 | Sliding type input method of touch screen |
US9128548B2 (en) * | 2012-10-17 | 2015-09-08 | Perceptive Pixel, Inc. | Selective reporting of touch data |
KR101458433B1 (en) * | 2013-10-22 | 2014-11-07 | (주)바론시스템 | Realtime remote control system and for automation equipment |
CN103634083A (en) * | 2013-12-20 | 2014-03-12 | 哈尔滨工业大学 | Dynamic network coded packet loss retransmission method suitable for sensor network |
US9875150B2 (en) * | 2015-06-02 | 2018-01-23 | Apple Inc. | Method and system for processing notifications amongst applications of a data processing system |
EP3304265A1 (en) * | 2015-06-07 | 2018-04-11 | Apple Inc. | Device, method, and graphical user interface for manipulating application windows |
CN105187529B (en) * | 2015-09-08 | 2018-05-11 | 常熟理工学院 | A kind of car networking implementation method based on location information |
WO2017096509A1 (en) * | 2015-12-07 | 2017-06-15 | 华为技术有限公司 | Displaying and processing method, and related apparatuses |
CN107346296B (en) * | 2016-05-05 | 2022-01-18 | 研祥智能科技股份有限公司 | Driving method and device |
CN106155766A (en) * | 2016-06-29 | 2016-11-23 | 广州大彩光电科技有限公司 | A kind of virtual serial port screen simulation system and analogy method thereof |
WO2018081112A1 (en) * | 2016-10-25 | 2018-05-03 | Apple Inc. | Systems and methods for enabling low-vision users to interact with a touch-sensitive secondary display |
CN106775426A (en) * | 2017-01-16 | 2017-05-31 | 北京电子工程总体研究所 | A kind of touch two axles control stick simulation system, device and method |
US20180329622A1 (en) * | 2017-05-12 | 2018-11-15 | Apple Inc. | Portable Computing Input Devices and Methods |
CN110138678B (en) * | 2018-02-08 | 2023-02-24 | 华为技术有限公司 | Data transmission control method and device, network transmission equipment and storage medium |
JP7076902B2 (en) * | 2018-03-22 | 2022-05-30 | 株式会社大一商会 | Pachinko machine |
CN110455179A (en) * | 2018-05-07 | 2019-11-15 | 苹果公司 | The device and method measured using augmented reality |
CN109491568B (en) * | 2018-12-28 | 2021-09-28 | 深圳开立生物医疗科技股份有限公司 | Mouse event processing method, device and equipment and computer readable storage medium |
CN110471584A (en) * | 2019-07-05 | 2019-11-19 | 深圳市格上格创新科技有限公司 | A kind of the cursor of mouse control method and device of handheld input device |
CN210155628U (en) * | 2019-07-29 | 2020-03-17 | 福建形维数字科技有限公司 | Industrial vision application platform device |
CN110688313B (en) * | 2019-09-26 | 2022-11-18 | 天津津航计算技术研究所 | Fault injection method for software testing under VxWorks operating system |
CN110989551A (en) * | 2019-11-22 | 2020-04-10 | 天津津航计算技术研究所 | Test system based on VxWorks system general interface board |
-
2020
- 2020-07-09 CN CN202010656725.1A patent/CN111870938B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108072342A (en) * | 2017-11-23 | 2018-05-25 | 无锡合壮智慧交通有限公司 | A kind of automatic testing method and device of manual gear gear level of vehicle |
Non-Patent Citations (2)
Title |
---|
VxWorks实时操作系统的USB总线驱动分析与开发;皇甫祯;陈怀民;段晓军;吴成富;;测控技术(10);第55-57,60页 * |
基于WindML的操纵杆驱动设计及多指针实现;唐建;邓涵;;机电产品开发与创新(02);第64-67页 * |
Also Published As
Publication number | Publication date |
---|---|
CN111870938A (en) | 2020-11-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102759724B (en) | Testing method and system for communication reliability of intelligent electric energy meters | |
CN111880683B (en) | Touch screen serial port drive design method based on windml virtual equipment under vxworks system | |
CN102591756B (en) | Verification method and system for interface protocol compatibility of multi-interface protocol chip | |
CN112506759B (en) | Automatic test method and device for servo system control software and storage medium | |
CN111444609A (en) | Data processing method and simulation system | |
CN111870938B (en) | Windml-based control rod serial port drive design method under vxworks system | |
CN113485881A (en) | Testing method and device of temporary speed limiting server, electronic equipment and medium | |
US7451070B2 (en) | Optimal bus operation performance in a logic simulation environment | |
CN113408070B (en) | Engine parameter determining method, device, equipment and storage medium | |
CN112966335B (en) | Interface simulation device and automatic driving simulation test platform | |
CN107239418B (en) | Data storage module read-write device and I2C communication method | |
CN117922221A (en) | Vehicle body posture prediction method, device, equipment and medium | |
CN111870939B (en) | Control lever serial port drive design method based on semaphore event under vxworks system | |
CN110825617B (en) | Method and device for simulating communication interaction between devices | |
CN107943625A (en) | A kind of MCU test methods for simulating various communication interfaces | |
CN116303456A (en) | Industrial data processing method, system, device and computer readable storage medium | |
CN102902207A (en) | Method, device and system for integrated turntable control based on Matlab/VC | |
CN114754985A (en) | Vehicle lamp information testing system, method, electronic device and storage medium | |
CN106951278B (en) | Data processing method and device | |
CN109783417B (en) | Serial port communication device and method | |
CN110465093B (en) | Method and device for analyzing inclusion redundant resources based on Unity | |
CN111880682B (en) | Touch screen serial port drive design method based on calibration process under vxworks system | |
CN115017150A (en) | High-code-rate telemetering data processing method | |
CN111953511B (en) | Simulation network networking method and system of semi-physical simulation system for target imaging processing | |
CN111475452B (en) | DisplayPort interface speed bridge system for FPGA prototype verification |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |