CN108132780A - A kind of aviation display control method based on custom script - Google Patents

A kind of aviation display control method based on custom script Download PDF

Info

Publication number
CN108132780A
CN108132780A CN201711323130.9A CN201711323130A CN108132780A CN 108132780 A CN108132780 A CN 108132780A CN 201711323130 A CN201711323130 A CN 201711323130A CN 108132780 A CN108132780 A CN 108132780A
Authority
CN
China
Prior art keywords
script
files
file
picture
keyword
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.)
Granted
Application number
CN201711323130.9A
Other languages
Chinese (zh)
Other versions
CN108132780B (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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Present invention is disclosed a kind of aviation display control methods based on custom script, using aviation displays as script executor, first establish the tissue of script file, the tissue of script file includes, pdf.c files, normal.h files, draw.h files, declare.h files, warn.h files, the aviation display control method includes the following steps that morphological analysis, syntactic analysis, symbol table import, create index list, script export, and script is finally run under embedded platform.The present invention concludes aviation display elements and control logic, and user directly can show content and control logic using instruction design picture, and display is by the instruction in analyzing script file one by one, and realization picture is shown and logic control.

Description

A kind of aviation display control method based on custom script
Technical field
The present invention relates to display control method more particularly to a kind of aviation display control method based on custom script, Belong to the technical field that embedded picture is shown.
Background technology
At present, domestic military aviation field, airborne picture display control mainly has following two forms, first, by display Software is directly shown according to external status word progress picture and control, second is that by general standard interfaces such as ARINC661 by outside Equipment directly carries out picture control.First method host can not independently change picture, when needing that picture is carried out to improve modification When, first change requirement is proposed to display contractor, then display picture is carried out more according to specified requirement by display contractor Change, change period length, cost are big, and display contractor needs to know that the display content of all elements in picture and control are former Reason, is unfavorable for manufacturing.Second method needs main engine plants, designs Controlling model according to standard, early investment is of high cost, design is all Phase is long, quantities is big, for middle-size and small-size main engine plants, can not form development ability in a short time.
Invention content
Present invention aim to address above-mentioned the deficiencies in the prior art, conventional on-board picture shows that input cost is high, designs The problem of period is long, quantities is big provides a kind of aviation display control method based on custom script.
In order to achieve the above object, the technical solution adopted in the present invention is:
A kind of aviation display control method based on custom script, using aviation displays as script executor, first establishes foot The tissue of this document, the tissue of script file include,
Pdf.c files, for compiling picture element and picture control logic;
Normal.h files, for defining logical operator, fetch bit operation meet attribute changes word keyword hexadecimal Coding;
Draw.h files, for defining the hexadecimal code of the keyword of display control script;
Declare.h files, for defining the hexadecimal code of the corresponding keyword of data buffer storage regional address;
Warn.h files, for defining the hexadecimal code of bell character string, character string display form and display priority;
The aviation display control method includes the following steps,
Step a, morphological analysis
Comment line in script and null are rejected, obtain effective character string;
Step b, syntactic analysis
Arithmetic is introduced, for calculating offset during data buffer storage regional address defined in script;
Step c, symbol table import
Symbol table is established to the mapping table of corresponding hexadecimal code, by normal.h, draw.h, declare.h, warn.h tetra- Keyword in a file imports symbol table, and when converting pdf.c files, keyword in pdf.c files is replaced with corresponding ten Entire script text is converted into hexadecimal data file by senary numerical value;
Step d creates index list
Defined in pdf.c files display in need picture, the unique identifier for distinguishing all pictures is frame number, is being led Go out before script file, be added to file header in the front end of script file, to the date of script file, version and picture index Location is accordingly described;
Step e, script export
After converting, the hexadecimal data script of .dat forms is generated.
The beneficial effects are mainly as follows:
Aviation display elements and control logic are concluded, user directly can show content and control using instruction design picture Logic processed, display is by the instruction in analyzing script file one by one, and realization picture is shown and logic control.
Description of the drawings
Fig. 1 is the flow chart that script is converted in the present invention.
Fig. 2 is the flow chart that script executor is run in the present invention.
Specific embodiment
The present invention provides a kind of aviation display control method based on custom script.Below in conjunction with attached drawing to skill of the present invention Art scheme is described in detail, so that it is more readily understood and grasps.
A kind of aviation display control method based on custom script, using display as script executor, all pictures Face shows that content and logic are defined by script file, and the change and optimization of subsequent pic are mostly by changing script file reality It is existing, significantly reduce the workload of display software maintenance stage.
In order to promote execution efficiency of the script under embedded platform, need by the script of text formatting be converted to 16 into Document format data processed.
Specifically, the tissue of script file is first established, the tissue of script file includes:Pdf.c files, for compiling picture Element and picture control logic;Normal.h files, for defining logical operator, fetch bit operation meets the pass of attribute changes word The hexadecimal code of key word;Draw.h files, for defining the hexadecimal code of the keyword of display control script; Declare.h files, for defining the hexadecimal code of the corresponding keyword of data buffer storage regional address;Warn.h files are used In the hexadecimal code for defining bell character string, character string display form and display priority.
Script conversion is that the content in more than file is analyzed, and ultimately forms corresponding hexadecimal data text Part, conversion include the following steps:
Step a, morphological analysis
Morphological analysis mainly rejects the comment line in script and null, obtains effective character string.Comment line refers to C++ phases Grammer is answered, supports row annotation(“//”)It is annotated afterwards with block(“/**/”)Two kinds of annotation methods, to simplify design difficulty, it is specified that " # Define " character strings include with beginning of letter and only comprising letter, digital, underscore character string and with English double quotation marks Character string be legal keyword.
Step b, syntactic analysis
To ensure the ease for use of invention, arithmetic is only introduced in the present invention, is mainly used for the data buffer area defined in script During address, convenient for calculating offset.
Step c, symbol table import
The present invention needs to establish symbol table to the mapping table of corresponding hexadecimal code, by normal.h, draw.h, Keyword in tetra- files of declare.h, warn.h imports symbol table, when finally conversion pdf.c files, it is necessary to will Keyword replaces with corresponding hexadecimal values in pdf.c, and entire script text is converted into hexadecimal data file, When symbol table imports, classified according to keyword to hexadecimal code, and add flag bit to instruction, character.
Step d creates index list
Defined in pdf.c display in need picture, the unique identifier for distinguishing all pictures is frame number, in export foot Before this document, file access is carried out for the ease of being based on frame number, file header is added in the front end of file, to script file Date, version and picture index address accordingly described.
Step e, script export
After converting, the hexadecimal data script of .dat forms is generated.
Script operation is carried out again, and script is finally run under embedded platform, one by one to the finger under a certain picture during operation Order is parsed, and completes the display of picture, and the logic control to showing picture is realized according to outer input data and button.
As shown in Figure 1, the specific implementation step explanation of script conversion:
Step 201:Select file, crossover tool use WIN32 platform softwares, by selection window " opening " option, are mapped to GetOpenFileName () function calls file selection window;
Step 202:File path is obtained, is obtained here by the member variable lpstrFile for reading OPENFILENAME structures Current file name, and according to " " position obtains file path;
Step 203:Detect script file it is whether complete, the present invention except pdf.c in addition to must also comprising normal.h, declare.h, Draw.h and warn.h, whether complete, if completely continuing to hold if needing to detect above-mentioned script file herein under path where pdf.c Row step 204, is otherwise exited;
Step 204:Symbol table is initialized, the present invention needs the keyword for defining " #define " and its hexadecimal code pair It should get up, for the ease of retrieval, using the map structures in C++, define map<string,val>SymbolTable symbols Table needs to initialize it herein;
Step 205:Extract oeprator coding from normal.h, logical operator defined in normal.h files, fetch bit The operators such as operator, attribute changes word, the present invention need to read operator keyword coding corresponding with its in this file, It is saved in the symbol table of step 203 establishment;
Step 206:Address mark coding is extracted from declare.h, most of instruction needs reference address, realizes external input The mapping of content is shown to picture, the present invention needs to read address mark keyword coding corresponding with its in this file, protects It is stored in the symbol table of step 203 establishment;
Step 207:Instruction encoding is extracted from draw.h, instruction is to form the basic element of script, and the present invention needs to read this Command keyword coding corresponding with its in file is saved in the symbol table of step 203 establishment;
Step 208:Hexadecimal script file is created .dat files are created under path where script file, and redirect backward 0x2000 byte directory spaces prepare write-in script file, and script file is divided into three parts, and first part is catalogue, second Part is bell character, Part III is picture, and catalogue accounts for 0x2000 fixed bytes, bell character and picture Coutinuous store;
Step 209:Warn.h files are read, when reading effective keyword, symbol table symbolTable are retrieved, if crucial Word is defined, then exports keyword and correspond to hexadecimal code, otherwise exports prompt alarm information, while judge keyword WARN_LIN and PFL_LIB, as the beginning and end label of an alarm, recording mark position treats that mesh is written in step 211 Record;
Step 210:Pdf.c files are read, when reading effective keyword, symbol table symbolTable are retrieved, if keyword It is defined, then export keyword and correspond to hexadecimal code, otherwise export prompt alarm information, while judge keyword HEAD and EOF1, the beginning and end as a width picture mark, and recording mark position treats that catalogue is written in step 211;
Step 211:Hexadecimal script catalogue is write, jumps to top of file, the label recorded according to step 209 and step 210 Position will alert the state pause judgments address of item and the state pause judgments address of picture and catalogue be written;
Step 212:Delete temporary file, the present invention after script file has been read, it can be pre-processed, delete annotation with Null, and * .tmp temporary files are written, need to delete temporary file herein, be called by system call function system " Temporary file is deleted in del*.tmp " orders.
As shown in Fig. 2, being script executor one by one to the data in processing hexadecimal script file, and generate corresponding aobvious Show the explanation of picture:
Step 301:Frame number is obtained, except initial picture system is set, remaining frame number is by several picture order tune It is set when spending, needs to consider the handoff relation between each picture when designing script file, realize screen switching closed-loop control;
Step 302:Judge whether to read script for the first time, it is that can not be modified that script file, which is loaded into during target platform is run, , the expression system described herein that reads for the first time reads script for the first time during startup or reset, if reading foot for the first time This, jumps to step 305 and continues to execute, and otherwise performs step 303;
Step 303:Script catalogue is cached, script catalogue is included marks the index in script file to alarm library and picture first place Address, the unique mark for distinguishing alarm library and picture is respectively to alert library number and frame number, to improve software execution efficiency, is needed pair It is cached, without traversing script file repeatedly after caching, you can find alarm library number alarm library corresponding with frame number and The initial address of picture;
Step 304:Caching alarm library, alarm library are a series of alarm colors, font size, priority, alarm word address and alarm word The set of string is accorded with, to improve software execution efficiency, this information only needs to obtain primary;
Step 305:Judge whether key frame switches, judge whether the foundation of switching shows frame number for former and later two display cycles Variation if variation jumps to step 307 and continues to execute, otherwise performs step 306;
Step 306:Key frame script is cached, after obtaining new key frame number, the key frame is obtained by retrieving script catalogue and exists Beginning and end address in script caches key frame script according to the group address and script handle;
Step 307:Script is parsed, master's (son) picture script of caching is parsed one by one, shows corresponding picture;
Step 308:Judge whether to show sprite, whether sprite shows refers to depending on the sprite in current key frame is shown It enables, which shows hidden state and initial sprite number, if desired show, then perform step 309, otherwise return to Step 301, next round cycle is opened;
Step 309:Judge whether sprite switches, whether sprite switches depending on the sprite switching in current sprite refers to It enables, the sprite number switched after the instruction definition pressing keys, performs step 310 if sprite switches, otherwise jump to step Rapid 307 continue to execute;
Step 310:Sprite script is cached, after obtaining new sprite number, the sprite is obtained by retrieving script catalogue and exists Beginning and end address in script caches sprite script according to the group address and script handle.
By above description it can be found that a kind of aviation display control method based on custom script of the present invention, as long as Applicable using the display terminal of the graphical display in OpenGL/ES/SC libraries, the present invention can be easily in PC environment lower dies Plan operation is main engine plants when early period, hardware did not designed, you can carries out display picture design work by writing script, has designed Into script file without change, can directly embedded platform run, shorten the development cycle.The present invention can also make main engine plants Retain the change means that content and control logic are shown to picture, in picture redesign, redevelopment, intervened without contractor. The intersecting C language software grammer of the present invention is more simple, and system designer's simply study can both be grasped, and make system designer Picture establishment can be carried out in the case of no Software Specialty technical ability.
Technical scheme of the present invention is fully described above, it should be noted that specific embodiment party of the invention Formula is simultaneously not limited by the description set out above, the Spirit Essence of those of ordinary skill in the art according to the present invention structure, method or All technical solutions that function etc. is formed using equivalents or equivalent transformation, all fall within protection scope of the present invention Within.

Claims (1)

1. a kind of aviation display control method based on custom script, using aviation displays as script executor, feature It is:
The tissue of script file is first established, the tissue of script file includes,
Pdf.c files, for compiling picture element and picture control logic;
Normal.h files, for defining logical operator, fetch bit operation meet attribute changes word keyword hexadecimal Coding;
Draw.h files, for defining the hexadecimal code of the keyword of display control script;
Declare.h files, for defining the hexadecimal code of the corresponding keyword of data buffer storage regional address;
Warn.h files, for defining the hexadecimal code of bell character string, character string display form and display priority;
The aviation display control method includes the following steps,
Step a, morphological analysis
Comment line in script and null are rejected, obtain effective character string;
Step b, syntactic analysis
Arithmetic is introduced, for calculating offset during data buffer storage regional address defined in script;
Step c, symbol table import
Symbol table is established to the mapping table of corresponding hexadecimal code, by normal.h, draw.h, declare.h, warn.h tetra- Keyword in a file imports symbol table, and when converting pdf.c files, keyword in pdf.c files is replaced with corresponding ten Entire script text is converted into hexadecimal data file by senary numerical value;
Step d creates index list
Defined in pdf.c files display in need picture, the unique identifier for distinguishing all pictures is frame number, is being led Go out before script file, be added to file header in the front end of script file, to the date of script file, version and picture index Location is accordingly described;
Step e, script export
After converting, the hexadecimal data script of .dat forms 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 true CN108132780A (en) 2018-06-08
CN108132780B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112083897A (en) * 2020-07-30 2020-12-15 济南浪潮高新科技投资发展有限公司 Signal declaration system, method, equipment and medium in digital logic design

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130339841A1 (en) * 2012-06-14 2013-12-19 Open Text S.A. Systems and methods of a script generation engine
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130339841A1 (en) * 2012-06-14 2013-12-19 Open Text S.A. Systems and methods of a script generation engine
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
纪伟: "基于脚本语言的海洋数据处理与可视化研究", 《中国优秀硕士学位论文全文数据库 基础科学辑》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112083897A (en) * 2020-07-30 2020-12-15 济南浪潮高新科技投资发展有限公司 Signal declaration system, method, equipment and medium in digital logic design

Also Published As

Publication number Publication date
CN108132780B (en) 2021-05-07

Similar Documents

Publication Publication Date Title
JP4755427B2 (en) Database access system and database access method
CN101937427B (en) Browser-based system and method for content edition and issue
US7958133B2 (en) Application conversion of source data
CN105446725B (en) Method and system for Mode-driven architecture
KR20080086456A (en) A method and system for editing text with a find and replace function leveraging derivations of the find and replace input
WO2012141183A1 (en) Content providing apparatus compatible with various terminal devices
US20100251227A1 (en) Binary resource format and compiler
CN114036183A (en) Data ETL processing method, device, equipment and medium
EP1231547B1 (en) System and method for mapping structured documents to structured data of program language and program for executing its method
CN110377371B (en) Style sheet system management method based on Web tag
CN106354746A (en) Searching method, and searching device
CN108132780A (en) A kind of aviation display control method based on custom script
JP2010267092A (en) Information processor and information processing method
JP2008176777A (en) Web document style change system and its method
CN116303359A (en) Method for realizing multi-type document export of database structure
CN116028062A (en) Target code generation method, NPU instruction display method and device
CN104021134A (en) Method for modifying and converting font file, and system thereof
CN100562008C (en) Message handling system and processing method thereof
JP5184987B2 (en) Index information creating apparatus, index information creating method and program
CN111061528B (en) Simplified coding method based on 32bit data bit
JP5596517B2 (en) Internationalized screen generation system and program
CN116306500B (en) Source character string splicing and extracting method and device, electronic equipment and storage medium
KR101705254B1 (en) Apparatus and program
CN115051904B (en) Method and device for managing single disk state based on markup language
KR102011843B1 (en) Method, apparatus and program for transforming data combination format

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