Flight simulator hardware detection system based on WPF
Technical Field
The invention relates to the technical field of flight simulation training, in particular to a WPF-based flight simulator hardware detection system.
Background
The flight simulator is a real-time simulation system which generates corresponding visual pictures, sound special effects and action feedback according to the operation of a pilot. When a pilot operates various devices (a steering column, pedals, an accelerator, buttons and the like) in a simulation cabin or a teacher operates related control keys on a teacher's desk, the operation control devices generate corresponding voltage signals, the voltage signals are converted into digital quantities through an input interface and then are sent to a computer, the computer calculates the received digital quantities through a preset management program and a related mathematical model, then the calculated results are compiled and controlled through an API (application program interface) of flight simulation software, corresponding airplane driving states are driven by related instruments to indicate the corresponding airplane states, related indicator lights on a driving control panel are driven to present the corresponding states, a sound box emits sounds consistent with the operation, and a motion platform is in the corresponding motion states.
The flight simulator is a device for training pilots, and generally comprises a cockpit, interface equipment, various instruments, a vision system and a training computer. The computer is the control center of the flight training simulator. When trainees train, the trainees can perform various operations while sitting in the cockpit: the electric door is opened, the accelerator is pushed and pulled, the flight lever and the rudder are operated, and various data such as flight speed, travel, position, height, wind direction, wind speed and the like can be obtained. The sight system can simulate the scenery where the student is located, the student feels the motions of diving, pitching and circling just like sitting in the airplane during operation, can see various scenery (cloud, fog, river and building) on and off the airplane, and can set various flight environments so as to comprehensively exercise the technology and learn and master various operations with high difficulty and danger. Therefore, as long as the simulation conditions are vivid, the trainees who pass the flight simulation training can immediately drive the airplane to lift off for exercise after the graduation. The prior flight simulator pays attention to the realization of the fidelity and multiple functions of the flight simulator, and is not careless in the aspects of maintenance and repair of the flight simulator, so that the design is attractive, the use is convenient, the function is complete, and the simulator hardware detection system convenient to operate can generate a great pushing effect on the maintenance of the flight simulator.
At present, a maintenance simulator generally needs to send professional maintenance personnel to an actual field of equipment for debugging and maintaining, and the cost is higher; the existing simulator has the problems of difficult maintenance, difficult fault confirmation, long solving time, unreasonable flow and the like.
WPF (Windows Presentation Foundation) is a Microsoft-derived Windows-based user interface Framework that is part of NET Framework 3.0. The method provides a uniform programming model, language and framework, and really does the work of separating interface designers and developers; at the same time, it provides a new multimedia interactive user graphical interface.
The UDP protocol is known as the user datagram protocol, and it is used for processing packets in a network like the TCP protocol, and is a connectionless protocol. In the OSI model, at the fourth layer, the transport layer, is at a layer above the IP protocol.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a WPF-based flight simulator hardware detection system, support remote use and solve the problems that the existing simulator is not suitable for maintenance, is not suitable for confirmation of faults, is long in solving time and is unreasonable in flow.
The WPF-based flight simulator hardware detection system comprises five parts, namely a switch panel, a circuit breaker panel, an accelerator panel, an instrument panel and an operation panel; and setting an eight-byte data protocol according to the UDP service protocol, wherein the first byte is the area number of the panel, the second byte is the key number, the third byte is data, and the rest bytes are left empty for standby.
Preferably, the first byte is the area number of the panel where the first byte is located, and the specific details are as follows: the switch panel area number is 1, the breaker panel area number is 2, the accelerator panel area number is 3, the meter panel area number is 4, and the operation panel area number is 5.
Preferably, the second byte is a key number, which is as follows: the key number of the general electric switch is 3, the key number of the beacon light is 6, and the key number of the airspeed meter is 5.
Preferably, the third byte is a data number, which is specifically as follows: the lamp is in a state of 1 on and 0 off; switch state 1 on, 0 off; the throttle lever data is 0-100.
Preferably, the first part of switch panel comprises an electronic switch of the simulator, a main switch, an aviation lamp switch and an auxiliary fuel switch, and the states of the switch and the lamp can be correspondingly fed back according to hardware operation of the switch panel; the second part of the breaker panel comprises an engine switch and a trip switch; the engine switch has 5 gears: OFF, LEFT, RIGHT, BOTH, START, the jump switch has two states of pressing and jumping out; the third part throttle panel contains throttle lever, mixing ratio pole, wing flap switch, and flight simulator throttle gear can be adjusted to the throttle lever, and mixing ratio pole cooperation throttle lever uses, and throttle lever and mixing ratio pole range all are 0-100, and the wing flap switch possess 4 gears: 0. 10, 20, 30; the instrument panel of the fourth part comprises an airspeed meter, an altimeter and an attitude instrument, and the functions of the airspeed meter, the altimeter and the attitude instrument are sequentially used for indicating the flying speed, the flying altitude and the flying attitude of the flight simulator; the fifth part of the operation panel comprises an operation rod and a pedal, and clear feedback can be made on the states of the operation rod and the pedal.
Due to the adoption of the technical scheme, the invention has the beneficial effects that: the flight simulator hardware detection system can clearly feed back the state of each part of the simulator hardware, can quickly detect the damaged part, and provides great convenience for the maintenance and repair of the flight simulator.
Drawings
FIG. 1 is a diagram of the data protocol format of the present invention;
FIG. 2 is a schematic diagram of the general structure of the present invention;
FIG. 3 is a state screenshot of the present invention instruction 16100000;
FIG. 4 is a state screenshot of the present invention instruction 42000000.
Detailed Description
The embodiments of the invention will be described in detail below with reference to the drawings, but the invention can be implemented in many different ways as defined and covered by the claims.
The invention is described in detail below with reference to the accompanying drawings.
Example 1:
fig. 1 is a data protocol format diagram, the data protocol is composed of 8 bytes, the types of the data protocol are all in a shaping mode, the first byte is the area number of the panel where the data protocol is located (for example, the area number of a switch panel is 1, the area number of a circuit breaker panel is 2, the area number of an accelerator panel is 3, the area number of an instrument panel is 4, and the area number of an operation panel is 5), the second byte is the key number (for example, the key number of a main switch is 3, the key number of a beacon light is 6, the key number of an airspeed meter is 5, and the like), the third byte is data (for example, the state of the light is 1 on, 0 off, the switch state is 1 on, 0 off, the throttle lever data is 0-100), and the rest bytes are. Therefore, each data protocol instruction can be used for accurately feeding back a device on one simulator, and the simulator detection system can be used for accurately feeding back each data instruction.
If the beacon light switch is turned on as indicated by command 16100000 (the first byte 1 indicates the zone panel number is 1, the second byte 6 indicates the key numbered 6 on the zone panel, the third byte 1 indicates the status of this key is 1, and the next 5 0 s are complementary based on the 8-byte protocol), the beacon light switch is visible on the zone 1 panel as in fig. 3; also for example, command 42000000 (the first byte 4 indicates zone panel number 4, the second byte 2 indicates zone panel number 4 button, the third 0 indicates this button status 0, and the next 5 0's are based on 8 byte protocol supplements) indicates that the flap is in 0 gear, and that the flap is in 0 gear as can be observed on the zone 3 panel, as shown in FIG. 4.
Fig. 2 is a general block diagram of the flight simulator hardware detection system of the present invention, which can be clearly seen to mainly comprise five major parts. The first part of switch panel (number 1 in the figure) contains simulator electronic switch, main switch, various aviation lights, auxiliary fuel switch, etc., and the states of the switch and the lights can be correspondingly fed back according to the hardware operation of the switch panel. The second part of the breaker panel (number 2 in the figure) contains an engine switch, various trip switches; the engine switch has 5 gears, and the jump switch has two kinds of states of pressing and jumping out, and its effect is equivalent to the safety switch, for example its jump switch can jump out when reserve battery voltage is too big, and reserve battery can be invalid. The third part throttle panel (number 3 in the figure) comprises a throttle lever, a mixing ratio lever and a flap switch; the throttle lever can adjust the throttle gear of the flight simulator, the mixing ratio lever is matched with the throttle lever for use, the measuring ranges of the mixing ratio lever and the throttle lever are 0-100, and when the hardware of the simulator is operated, the corresponding progress bar can be changed along with the mixing ratio lever; the flap switch has 4 gears (0, 10, 20, 30). The instrument panel (number 4 in the figure) of the fourth part comprises an airspeed meter, an altimeter and an attitude indicator, and the functions of the airspeed meter, the altimeter and the attitude indicator are sequentially used for indicating the flying speed, the flying altitude and the flying attitude of the flight simulator. The fifth part of the operation panel (5 in the figure) comprises an operation rod and a pedal, and can clearly feedback the states of the operation rod and the pedal. The flight simulator hardware detection system can make clear feedback on the state of each component of the simulator hardware through analysis of a data protocol, can quickly detect out a damaged component, and provides great convenience for maintenance and repair of the flight simulator.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.