CN108132780B - Aviation display control method based on custom script - Google Patents

Aviation display control method based on custom script Download PDF

Info

Publication number
CN108132780B
CN108132780B CN201711323130.9A CN201711323130A CN108132780B CN 108132780 B CN108132780 B CN 108132780B CN 201711323130 A CN201711323130 A CN 201711323130A CN 108132780 B CN108132780 B CN 108132780B
Authority
CN
China
Prior art keywords
file
script
picture
hexadecimal
display
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
Application number
CN201711323130.9A
Other languages
Chinese (zh)
Other versions
CN108132780A (en
Inventor
周剑
曹峰
毛志洋
黄星
冯宁波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Changfeng Aviation Electronics Co Ltd
Original Assignee
Suzhou Changfeng Aviation Electronics Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Suzhou Changfeng Aviation Electronics Co Ltd filed Critical Suzhou Changfeng Aviation Electronics Co Ltd
Priority to CN201711323130.9A priority Critical patent/CN108132780B/en
Publication of CN108132780A publication Critical patent/CN108132780A/en
Application granted granted Critical
Publication of CN108132780B publication Critical patent/CN108132780B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/425Lexical analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Abstract

The invention discloses an aviation display control method based on a self-defined script, which takes an aviation display as a script actuator, firstly establishes the organization of script files, wherein the organization of the script files comprises a pdf.c file, a normal.h file, a draw.h file, a declar.h file and a war.h file. According to the invention, aviation display elements and control logic are summarized, a user can directly adopt instructions to design picture display contents and control logic, and the display realizes picture display and logic control by analyzing the instructions in the script file one by one.

Description

Aviation display control method based on custom script
Technical Field
The invention relates to a display control method, in particular to an aviation display control method based on a custom script, and belongs to the technical field of embedded picture display.
Background
At present, in the field of domestic military aviation, airborne picture display control mainly has the following two forms, namely picture display and control are directly carried out by display software according to external state characters, and picture control is directly carried out by external equipment through universal standard interfaces such as ARINC 661. The first method is that the host can not modify the picture automatically, when the picture needs to be modified perfectly, the change requirement is firstly put forward to the display controller, and then the display controller changes the display picture according to the specified requirement, the change period is long, the cost is high, and the display controller needs to know the display content and the control principle of all elements in the picture, which is not beneficial to manufacturing. The second method needs a host factory, controls the model according to the standard design, has high early investment cost, long design period and large engineering quantity, and can not form development capacity in a short period for medium and small host factories.
Disclosure of Invention
The invention aims to solve the defects of the prior art, and the problems of high input cost, long design period and large engineering quantity of the traditional airborne picture display, and provides an aviation display control method based on a custom script.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
an aviation display control method based on self-defined script, using aviation display as script executor, firstly establishing the organization of script file, the organization of script file includes,
c file for compiling picture elements and picture control logic;
a normal.h file for defining a logical operator, a bit-taking operation conforming to the hexadecimal code of the keyword of the attribute modifying word;
a draw.h file for defining hexadecimal codes of the keywords of the display control script;
a delete.h file for defining hexadecimal codes of the keywords corresponding to the addresses of the data cache region;
a war.h file for defining hexadecimal codes of alarm character strings, character string display formats and display priorities;
the aviation display control method comprises the following steps of,
step a, lexical analysis
Removing the annotation lines and the blank lines in the script to obtain effective character strings;
step b, syntax analysis
Introducing four arithmetic operations for calculating the offset when defining the address of the data cache region in the script;
step c, importing symbol table
Establishing a mapping table from a symbol table to corresponding hexadecimal codes, importing keywords in four files, namely normal.h, draw.h, default.h and war.h, into the symbol table, replacing the keywords in the pdf.c file with corresponding hexadecimal numerical values when converting the pdf.c file, and converting the whole script text into a hexadecimal data file;
step d, creating index directory
Defining all pictures to be displayed in the pdf.c file, wherein the unique identifier for distinguishing all the pictures is a picture number, adding a file header at the front end of the script file before exporting the script file, and correspondingly describing the date, the version and the picture index address of the script file;
step e, script export
After the conversion is completed, a hexadecimal data script in dat format is generated.
The invention has the following beneficial effects:
and summarizing the aviation display elements and the control logic, so that a user can directly adopt instructions to design picture display contents and the control logic, and the display realizes picture display and logic control by analyzing the instructions in the script file one by one.
Drawings
FIG. 1 is a flow chart of script transformation in the present invention.
FIG. 2 is a flow chart of the operation of the script executor of the present invention.
Detailed Description
The invention provides an aviation display control method based on a custom script. The technical solution of the present invention is described in detail below with reference to the accompanying drawings so that it can be more easily understood and appreciated.
A self-defined script-based aviation display control method is characterized in that a display is used as a script executor, all picture display contents and logics are defined through script files, and the change and optimization of subsequent pictures are mostly realized by modifying the script files, so that the workload of the display software in the maintenance stage is greatly reduced.
In order to improve the execution efficiency of the script under the embedded platform, the script in the text format needs to be converted into a hexadecimal data file format.
Specifically, an organization of the script file is established first, and the organization of the script file includes: c file for compiling picture elements and picture control logic; a normal.h file for defining a logical operator, a bit-taking operation conforming to the hexadecimal code of the keyword of the attribute modifying word; a draw.h file for defining hexadecimal codes of the keywords of the display control script; a delete.h file for defining hexadecimal codes of the keywords corresponding to the addresses of the data cache region; a war.h file, hexadecimal coding for defining alarm strings, string display formats and display priorities.
The script conversion is to analyze the content in the above files and finally form a corresponding hexadecimal data file, and the conversion includes the following steps:
step a, lexical analysis
The lexical analysis is mainly to remove the annotation lines and the blank lines in the script to obtain effective character strings. The comment line refers to C + + corresponding syntax, supports two comment methods of line comment ("//") and block comment ("/+ + -"), and specifies a "# define" character string, a character string starting with letters and containing only letters, numbers, underlines, and a character string included with double quotation marks in english as legal keywords for simplifying the design difficulty.
Step b, syntax analysis
In order to ensure the usability of the invention, only four arithmetic operations are introduced in the invention, which is mainly used for conveniently calculating the offset when defining the address of the data cache region in the script.
Step c, importing symbol table
The invention needs to establish a mapping table from a symbol table to corresponding hexadecimal codes, imports keywords in four files of normal.h, draw.h, clear.h and war.h into the symbol table, when a pdf.c file is finally converted, the keywords in the pdf.c file need to be replaced by corresponding hexadecimal numerical values, the whole script text is converted into a hexadecimal data file, and when the symbol table is imported, the hexadecimal codes are classified according to the keywords, and flag bits are added to carry out instruction and character addition.
Step d, creating index directory
And defining all pictures to be displayed in pdf.c, wherein a unique identifier for distinguishing all the pictures is a picture number, and before exporting the script file, in order to facilitate file access based on the picture number, a file header is added at the front end of the file to correspondingly describe the date, the version and the picture index address of the script file.
Step e, script export
After the conversion is completed, a hexadecimal data script in dat format is generated.
And executing script operation, wherein the script finally operates under the embedded platform, analyzing the instructions under a certain picture one by one during operation to complete the display of the picture, and realizing the logic control of the displayed picture according to external input data and keys.
As shown in FIG. 1, the specific implementation steps of the script transformation are described as follows:
step 201: selecting a file, mapping the file to a GetOpenFileName () function by adopting WIN32 platform software through selecting a window opening option by a conversion tool, and calling a file selection window;
step 202: acquiring a file path, wherein the current file name is acquired by reading a member variable lpstrFile of an OPENFILLENME structure, and the file path is acquired according to the position of \ ";
step 203: detecting whether the script file is complete, wherein the method also comprises normal.h, default.h, draw.h and war.h except pdf.c, wherein the method needs to detect whether the script file is complete under the path of pdf.c, if so, the step 204 is executed, otherwise, the method exits;
step 204: initializing a symbol table, wherein a key word defined by "# define" needs to be corresponded with a hexadecimal code of the key word, a map structure in C + + is adopted for facilitating retrieval, a map < string, val > symbol table is defined, and the symbol table needs to be initialized;
step 205: extracting operation symbol codes from the normal.h, defining operators such as a logic operator, a bit-taking operator, an attribute changing word and the like in the normal.h file, reading operator keywords and corresponding codes in the file, and storing the operator keywords and the corresponding codes in the symbol table created in the step 203;
step 206: extracting address symbol codes from the detail.h, wherein most of the instructions need to refer to addresses to realize the mapping from external input to the display content of the picture, and the invention needs to read the address symbol keywords and the codes corresponding to the address symbol keywords in the file and store the address symbol keywords and the codes into the symbol table created in the step 203;
step 207: extracting instruction codes from the draw.h, wherein the instructions are basic elements forming the script, and the invention needs to read instruction keywords and corresponding codes in the file and store the instruction keywords and the corresponding codes in the symbol table created in the step 203;
step 208: creating a hexadecimal script file, creating a dat file under the path of the script file, jumping backwards to a directory space of 0x2000 bytes, and preparing to write the script file, wherein the script file is divided into three parts, the first part is a directory, the second part is an alarm character, the third part is a picture, the directory occupies 0x2000 fixed bytes, and the alarm character and the picture are continuously stored;
step 209: reading a war.h file, retrieving a symbol table symbolTable when an effective keyword is read, outputting a hexadecimal code corresponding to the keyword if the keyword is defined, otherwise, outputting prompt alarm information, judging the keywords WARN _ LIN and PFL _ LIB as a starting mark and an ending mark of an alarm, recording the mark position, and writing in a directory in step 211;
step 210: reading pdf.c files, retrieving symbol table symbolTable when effective keywords are read, if the keywords are defined, outputting corresponding hexadecimal codes of the keywords, otherwise, outputting prompt alarm information, meanwhile, judging keywords HEAD and EOF1 to serve as start and end marks of a picture, recording mark positions, and writing in a directory in step 211;
step 211: writing a hexadecimal script directory, jumping to the head of the file, and writing the starting and ending addresses of the alarm item and the starting and ending addresses of the picture into the directory according to the mark positions recorded in the steps 209 and 210;
step 212: after the script file is read, the invention preprocesses the script file, deletes the annotation and the blank line, and writes into the temporary file.
As shown in fig. 2, the data in the hexadecimal script file is processed for each pair of script executors and a description of the corresponding display screen is generated:
step 301: acquiring a picture number, wherein the rest picture numbers are set by a plurality of picture control instructions during scheduling except the initial picture number system setting, and the switching relation among pictures is required to be considered when designing a script file so as to realize closed-loop control of picture switching;
step 302: judging whether the script is read for the first time, wherein the script file cannot be changed when being loaded to the target platform during operation, the first reading described herein indicates that the system reads the script for the first time during starting or resetting, if so, jumping to step 305 to continue execution, otherwise, executing step 303;
step 303: caching a script directory, wherein the script directory comprises index addresses for marking the first bits of the alarm library and the picture in a script file, unique identifiers for distinguishing the alarm library and the picture are an alarm library number and a picture number respectively, and the unique identifiers are required to be cached for improving the software execution efficiency;
step 304: the method comprises the following steps of caching an alarm library, wherein the alarm library is a set of a series of alarm colors, word numbers, priorities, alarm word addresses and alarm character strings, and the information only needs to be acquired once in order to improve the software execution efficiency;
step 305: judging whether the main picture is switched, judging whether the display picture numbers of the two display periods before and after are changed according to the switching, if so, skipping to the step 307 to continue execution, otherwise, executing the step 306;
step 306: caching a main picture script, acquiring a head and tail address of the main picture in the script by retrieving a script directory after acquiring a new main picture number, and caching the main picture script according to the group of addresses and the script handle;
step 307: analyzing the script, analyzing the cached main (sub) picture script one by one, and displaying the corresponding picture;
step 308: judging whether a sub-picture is displayed or not, wherein whether the sub-picture is displayed or not depends on a sub-picture display instruction in the current main picture, the instruction defines a sub-picture display and hidden state and an initial sub-picture number, if the sub-picture needs to be displayed, executing a step 309, otherwise, returning to the step 301, and starting the next round of circulation;
step 309: judging whether the sub-picture is switched or not, wherein whether the sub-picture is switched or not depends on a sub-picture switching instruction in the current sub-picture, the instruction defines the number of the switched sub-picture after the key is pressed, if the sub-picture is switched, executing the step 310, and if not, skipping to the step 307 to continue executing;
step 310: and caching the sprite script, acquiring the head and tail addresses of the sprite in the script by searching the script directory after acquiring the new sprite number, and caching the sprite script according to the group address and the script handle.
Through the description, the aviation display control method based on the custom script can be suitable as long as a display terminal of the graphical display of the OpenGL/ES/SC library is adopted, can be conveniently simulated and operated in a PC environment, can be used for developing display screen design work by writing the script when the hardware of a host factory is not designed in the previous period, can be directly operated on an embedded platform without changing the designed script file, and shortens the development period. The invention also can lead the host factory to keep the changing means of the picture display content and the control logic, and does not need the intervention of a bearing party when the picture is redesigned and redeveloped. The syntax of the intersected C language software is simpler, and a system designer can learn and master the syntax simply, so that the system designer can perform picture compilation without software professional skills.
The technical solutions of the present invention are fully described above, it should be noted that the specific embodiments of the present invention are not limited by the above description, and all technical solutions formed by equivalent or equivalent changes in structure, method, or function according to the spirit of the present invention by those skilled in the art are within the scope of the present invention.

Claims (1)

1. An aviation display control method based on a custom script takes an aviation display as a script executor, and is characterized in that:
firstly, establishing the organization of the script file, wherein the organization of the script file comprises,
c file for compiling picture elements and picture control logic;
a normal.h file for defining hexadecimal encodings of the keywords of the logical operator, the bit-taking operator and the attribute modifier;
a draw.h file for defining hexadecimal codes of the keywords of the display control script;
a delete.h file for defining hexadecimal codes of the keywords corresponding to the addresses of the data cache region;
a war.h file for defining hexadecimal codes of alarm character strings, character string display formats and display priorities;
the aviation display control method comprises the following steps of,
step a, lexical analysis
Removing the annotation lines and the blank lines in the script to obtain effective character strings;
step b, syntax analysis
Introducing four arithmetic operations for calculating the offset when defining the address of the data cache region in the script;
step c, importing symbol table
Establishing a mapping table from a symbol table to corresponding hexadecimal codes, importing keywords in four files, namely normal.h, draw.h, default.h and war.h, into the symbol table, replacing the keywords in the pdf.c file with corresponding hexadecimal numerical values when converting the pdf.c file, and converting the whole script text into a hexadecimal data file;
step d, creating index directory
Defining all pictures to be displayed in the pdf.c file, wherein the unique identifier for distinguishing all the pictures is a picture number, adding a file header at the front end of the script file before exporting the script file, and correspondingly describing the date, the version and the picture index address of the script file;
step e, script export
After the conversion is completed, a hexadecimal data script in dat format is generated.
CN201711323130.9A 2017-12-13 2017-12-13 Aviation display control method based on custom script Active CN108132780B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711323130.9A CN108132780B (en) 2017-12-13 2017-12-13 Aviation display control method based on custom script

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711323130.9A CN108132780B (en) 2017-12-13 2017-12-13 Aviation display control method based on custom script

Publications (2)

Publication Number Publication Date
CN108132780A CN108132780A (en) 2018-06-08
CN108132780B true CN108132780B (en) 2021-05-07

Family

ID=62389416

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711323130.9A Active CN108132780B (en) 2017-12-13 2017-12-13 Aviation display control method based on custom script

Country Status (1)

Country Link
CN (1) CN108132780B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103530112A (en) * 2013-08-31 2014-01-22 国家电网公司 Method for realizing simulation of display frames of relay protection device
CN103761095A (en) * 2014-01-23 2014-04-30 上海斐讯数据通信技术有限公司 Method for generating universal header data information of upgraded file
CN103823676A (en) * 2014-02-14 2014-05-28 珠海市君天电子科技有限公司 Display control method, display control device and client side

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10417314B2 (en) * 2012-06-14 2019-09-17 Open Text Sa Ulc Systems and methods of a script generation engine

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103530112A (en) * 2013-08-31 2014-01-22 国家电网公司 Method for realizing simulation of display frames of relay protection device
CN103761095A (en) * 2014-01-23 2014-04-30 上海斐讯数据通信技术有限公司 Method for generating universal header data information of upgraded file
CN103823676A (en) * 2014-02-14 2014-05-28 珠海市君天电子科技有限公司 Display control method, display control device and client side

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于脚本语言的海洋数据处理与可视化研究;纪伟;《中国优秀硕士学位论文全文数据库 基础科学辑》;20160715;第A010-19页 *

Also Published As

Publication number Publication date
CN108132780A (en) 2018-06-08

Similar Documents

Publication Publication Date Title
US20130144920A1 (en) Creating a configuration file template
CN110059455A (en) Code encryption method, apparatus, electronic equipment and computer readable storage medium
CN112149399A (en) Table information extraction method, device, equipment and medium based on RPA and AI
EP1677207A1 (en) Translation support device
CN101675415A (en) Program pattern analyzer, pattern appearance status information production method, pattern information generating device, and program
CN114036183A (en) Data ETL processing method, device, equipment and medium
CN108132780B (en) Aviation display control method based on custom script
CN113760894A (en) Data calling method and device, electronic equipment and storage medium
CN116028062A (en) Target code generation method, NPU instruction display method and device
CN113296759B (en) User interface processing method, user interface processing system, device and storage medium
CN107612919B (en) Protocol configuration method and device
CN111061528B (en) Simplified coding method based on 32bit data bit
KR100846203B1 (en) Method for generating mobile application and record media recorded program for realizing the same
CN115248803B (en) Collection method and device suitable for network disk file, network disk and storage medium
CN112130841B (en) SQL development method and device and terminal equipment
CN115051904B (en) Method and device for managing single disk state based on markup language
US11960380B2 (en) Debugging SQL statements
KR20070001765A (en) Memory saving character display system and display method thereof
TW594574B (en) Editing method for supporting multiple languages
CN114356289A (en) Shader using method based on multiple platforms and related equipment
KR100588729B1 (en) Apparatus and method for providing user screen in character type online service
CN117453713A (en) SQL sentence generation method, device and storage medium for multi-type database
Giloi et al. Interactive graphics on intelligent terminals in a time-sharing environment
CN116755704A (en) Rule behavior model real-time code generation method based on rule description file
CN113935282A (en) Document editing method, device, storage medium and equipment

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