Parameter setting method based on the track traffic embedded software
Technical field
The present invention is mainly concerned with the application of track traffic embedded software, refers in particular to a kind of parameter setting method that is applicable to the track traffic embedded software.
Background technology
In the prior art; The technician needs to concrete embedded software demand exploitation relevant parameters software to be set usually; It is in fixing software development environment; Through code human editor machine interactive interface, configuration desired parameters and type thereof, the parameter that this technological development goes out is provided with software and does not often possess versatility and extendability.The more important thing is, owing to differences such as the required content of parameter of embedded software, employed compiler, interface composing demands, so each parameter is provided with software and can't unifies general; Even same set of parameter is provided with software; In case parameter requirement changes, parameter type changes, and all needs the software design personnel to remodify parameter software code is set; Recompilate operation, waste time and energy.
In the above-mentioned existing mode; The static mode that loads is adopted in the descriptions of the generation at interface, desired parameters and type thereof etc. in program; Therefore, when configuration surroundings, parameter requirement etc. changes, all need the technician to remodify parameter software program code is set; Very inconvenience does not possess versatility and extendability.
Summary of the invention
The technical matters that the present invention will solve just is: to the technical matters that prior art exists, the present invention provide a kind of easy and simple to handle, principle simple, the parameter setting method based on the track traffic embedded software of versatility and favorable expandability.
For solving the problems of the technologies described above, the present invention adopts following technical scheme:
A kind of parameter setting method based on the track traffic embedded software the steps include:
1. be provided with and treat the input file composition:
The data type file is used for describing the data type of embedded software desired parameters;
The controlled condition file is used for describing the parameter information of the required setting of embedded software;
Interface configuration file is used for characterising parameter the interface layout situation of software is set;
2. through parameter the parameter setting that module is carried out the field of track traffic embedded software is set, said parameter is provided with module and is output as the output parameter value file, and the output parameter value file has constituted the input of embedded software; The execution flow process that said parameter is provided with module is:
(S1) resolution data type configuration file:, extract active data type and key message thereof mainly according to the data type configuration protocol;
(S2) deposit data type in chained list: deposit the data type information of resolving in the internal memory chained list;
(S3) resolve the controlled condition file:, extract the content of parameter information of the required setting of embedded software automatically according to the controlled condition configuration protocol;
(S4) parameter Memory Allocation: for embedded software parameter storage allocation space is used for the stored parameter value; The title and the affiliated data type of parameter of parameter from step (S3), have been obtained; The data type chained list that this step then generates according to step (S2); Find the corresponding data type, obtain the length information of corresponding data type, distribute corresponding memory headroom according to this data type;
(S5) resolution interface configuration file: interface configuration file is resolved, and deposit internal memory in the chain sheet form;
(S6) generate human-computer interaction interface: the interface configurations according to step (S5) is resolved, generate the respective type control automatically, this control is carried out the attribute setting, record control corresponding parameters shows the membership of each page with tree structure;
(S7) the response customer parameter is provided with order; Stored parameter value: when generating human-computer interaction interface; Write down this control corresponding parameters, response user's parameter is provided with order, and deposits the newly-installed parameter value of user in this parameter corresponding core position;
(S8) output parameter value file: after the user accomplishes parameter and is provided with, with the form output of parameter value with file.
As further improvement of the present invention:
Data type in the said data type file comprises length, whether symbolic information is arranged.
Parameter information in the said controlled condition file comprises data type, the parameter title of parameter.
Interface layout situation in the said interface configuration file is used for describing interface file and constitutes by several pages, in every page by several groupings, control and corresponding parameters thereof of each which type of dividing into groups to have down.
Compared with prior art; The invention has the advantages that: the parameter setting method based on the track traffic embedded software of the present invention; Easy and simple to handle, principle is simple, comes out the definition of data type, the definition of embedded software desired parameters, interface formats definition are open, becomes the configuration file of executable program code; During program run, the above-mentioned file of dynamic load; Simultaneously, the control of developing instruments such as BCB is encapsulated, expands, can satisfy the control demand of multiple embedded software parameter.Therefore, the present invention provides a good man-machine interaction interface for the secondary development of embedded software, reduces the difficulty of secondary development, avoids agreement directly to open to the user, and resist technology is secret, strengthens versatility and extensibility that the embedded software parameter is provided with.
Description of drawings
Fig. 1 is a main flow synoptic diagram of the present invention.
Fig. 2 is the composition synoptic diagram of data type file among the present invention.
Fig. 3 is the composition synoptic diagram of controlled condition file among the present invention.
Fig. 4 is the composition synoptic diagram of median surface of the present invention configuration file.
Fig. 5 is the execution schematic flow sheet that parameter is provided with module among the present invention.
Fig. 6 is the synoptic diagram of the automatic man-machine interface that generates in the concrete application example.
Embodiment
Below will combine Figure of description and specific embodiment that the present invention is explained further details.
The present invention is based on the parameter setting method of track traffic embedded software, the steps include:
1. be provided with and treat the input file composition: referring to Fig. 1, data type file 1, controlled condition file 2, interface configuration file 3 have been formed input file of the present invention jointly, and promptly input parameter is provided with the input file of module 4.
Data type file 1 has mainly been described the data type of embedded software desired parameters, comprises length, whether information such as symbol are arranged.Referring to shown in Figure 2, in the present embodiment, the type of " data type A " expression parameter, like UNWORD, INT8 etc.; The shared byte number of " byte number " expression data type A; " symbol " expression the type has sign pattern or unsigned type.
Controlled condition file 2 has mainly been described the parameter information of the required setting of embedded software, comprises data type, parameter title of parameter etc.Referring to shown in Figure 3; In the present embodiment; Represent that this embedded software need be provided with parameter 1, parameter 2; Wherein the data type of parameter 1 is " data type A ", and the data type of parameter 2 is " parameter type B " (" parameter type A ", " parameter type B " are in the data type file in Fig. 2 and define).
Interface configuration file 3, main characterising parameter is provided with the interface layout situation of software, and the interface is showed with forms such as the page, subpage frame, grouping, combo box, choice box, edit box, forms.Also need describe in the file by several pages and constitute, in every page by several groupings, control and corresponding parameters thereof of each which type of dividing into groups to have down.Referring to shown in Figure 4; In the present embodiment, top level page has two: the page 1 and the page 2, and top level page has two sub-pages 1 time: subpage frame 11, subpage frame 12; Top level page also has two sub-pages 2 times: subpage frame 21, subpage frame 22; Therefore the present invention is presented at the right side at main interface with the membership of the page with tree list automatically, and when user's click page, then the content of parameter of this page shows.
2. through parameter the parameter setting that module 4 is carried out the field of track traffic embedded software is set; Parameter is provided with module 4 and is output as output parameter value file 5; Output parameter value file 5 has constituted the input of embedded software, and is as shown in Figure 5, and the execution flow process that parameter is provided with module 4 is:
(S1) resolution data type configuration file:, extract active data type and key message thereof mainly according to the data type configuration protocol.
(S2) deposit data type in chained list: deposit the data type information of resolving in the internal memory chained list.Definition data structure, this data structure comprises data type title, data type lengths, symbol etc., the data type information that storage is come out from the data type document analysis, this data structure constitutes the node of chained list.
(S3) resolve the controlled condition file:, extract the content of parameter information of the required setting of embedded software automatically mainly according to the controlled condition configuration protocol.Definition data structure, the essential information of description relevant parameter, this data structure comprises the title of parameter, the data type of parameter etc.
(S4) parameter Memory Allocation: be embedded software parameter storage allocation space, main stored parameter value.The title and the affiliated data type of parameter of parameter from step (S3), have been obtained; The data type chained list that this step then generates according to step (S2); Find the corresponding data type, obtain the information such as length of corresponding data type, thereby distribute corresponding memory headroom according to this data type.
(S5) resolution interface configuration file: interface configuration file is resolved, and deposit internal memory in the chain sheet form.
(S6) generate human-computer interaction interface: mainly to BCB (borland c++ builder development environment; A kind of SDK) control under the development environment encapsulates; The control of encapsulation comprises several kinds of TreeView, Edit, Combobox, Checkbox, Grid, Label etc., as required control is expanded in addition, for example with the Checkbox of Label; Controls such as the embedded Checkbox of form, Combobox, self-definedization of realization control.Interface configurations according to step (S5) is resolved generates the respective type control automatically, and automatically this control is carried out the attribute setting; Record control corresponding parameters is presented at the left side at main interface with the membership of each page with tree structure, lets the user that entire parameter is provided with the interface and comes into plain view; When the user selects certain page; Then that this page is all parameter controls in right side, main interface show, and make things convenient for the user to carry out parameter setting, the mode of this kind paging targetedly; Can solve the parameter amount brings parameter to set type in a jumble the problem that inconvenient user is provided with greatly.Referring to Fig. 6, be an example of the automatic man-machine interface that generates in a concrete application example.
(S7) the response customer parameter is provided with order; Stored parameter value: when generating human-computer interaction interface; Write down this control corresponding parameters, the parameter that therefore responds the user is provided with order, and deposits the newly-installed parameter value of user in this parameter corresponding core position.
(S8) output parameter value file: after the user accomplishes parameter and is provided with,, make things convenient for embedded software to use with the form output of parameter value with file.
By on can know; Main different of the present invention and prior art just are: come out definition, the definition of embedded software desired parameters, the interface formats definition of data type are open; Become the configuration file of executable program code, when operation, only need the above-mentioned file of dynamic load to get final product.But it can be through the executive software after the program code compiling that parameter is provided with module 4; It adopts dynamic mode to load also each configuration file such as resolution data type file, controlled condition file, interface configuration file; Therefore when the compiler of content of parameter, software, when interface composing demand changes; The technician only need use text editor to revise above-mentioned three configuration files accordingly, and need not to revise executable program code, need not to recompilate; Can satisfy demand after changing; Realized that a cover executable program code is applicable to that different embedded software parameters is provided with demand, strengthened its versatility and dirigibility, improved the convenience of operation greatly.
Below only be preferred implementation of the present invention, protection scope of the present invention also not only is confined to the foregoing description, and all technical schemes that belongs under the thinking of the present invention all belong to protection scope of the present invention.Should be pointed out that for those skilled in the art some improvement and retouching not breaking away under the principle of the invention prerequisite should be regarded as protection scope of the present invention.