Summary of the invention
The technical problem to be solved in the present invention is just: the technical problem existed for prior art, the invention provides that a kind of easy and simple to handle, principle is simple, the parameter setting method based on track traffic embedded software of versatility and favorable expandability.
For solving the problems of the technologies described above, the present invention by the following technical solutions:
Based on a parameter setting method for track traffic embedded software, the steps include:
1. file to be entered composition is set:
Data type files, is used for describing the data type of embedded software desired parameters;
Controlled condition file, is used for describing the required parameter information arranged of embedded software;
Interface configuration file, being used for characterising parameter arranges the interface layout condition of software;
2. carried out the optimum configurations of field of track traffic embedded software by parameter setting module, the output of described parameter setting module is output parameter value file, and output parameter value file constitutes the input of embedded software; The execution flow process of described parameter setting module is:
(S1) resolution data type configuration file: main according to data type configuration protocol, extracts effective data type and key message thereof;
(S2) by data type stored in chained list: by resolve data type information stored in internal memory chained list;
(S3) resolve controlled condition file: according to controlled condition configuration protocol, automatically extract the required content of parameter information arranged of embedded software;
(S4) parameter memory distributes: for embedded software parametric distribution memory headroom is used for stored parameter value; Data type belonging to the title of parameter and parameter is obtained from step (S3), this step is then according to the data type chained list that step (S2) generates, find 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 with chain sheet form stored in internal memory;
(S6) generate human-computer interaction interface: the interface configurations of resolving according to step (S5), automatically generate respective type control, setup of attribute is carried out to this control, the parameter that record control is corresponding, the membership of each page is shown with tree structure;
(S7) customer parameter setting command is responded, stored parameter value: while generation human-computer interaction interface, have recorded the parameter that this control is corresponding, the optimum configurations order of response user, and by newly-installed for user parameter value stored in the corresponding core position of this parameter;
(S8) output parameter value file: after user completes optimum configurations, parameter value is exported in the form of a file.
As a further improvement on the present invention:
Data type in described data type files comprises length, whether has symbolic information.
Parameter information in described controlled condition file comprises data type, the parameter name of parameter.
Interface layout condition in described interface configuration file is used for describing interface file and forms by several pages, by several grouping in every page, has the control of which type and the parameter of correspondence thereof under each grouping.
Compared with prior art, the invention has the advantages that: the parameter setting method based on track traffic embedded software of the present invention, easy and simple to handle, principle is simple, the definition of data type, the definition of embedded software desired parameters, interface formats definition are opened out, become the configuration file of executable program code, when program is run, the above-mentioned file of dynamic load; Meanwhile, the control of the developing instruments such as BCB is encapsulated, expanded, the control demand of multiple embedded software parameter can be met.Therefore, the secondary development that the present invention is embedded software provides a good human-computer interaction interface, reduces the difficulty of secondary development, and avoid agreement open directly to user, resist technology is secret, strengthens the Universal and scalability of embedded software optimum configurations.
Detailed description of the invention
Below with reference to Figure of description and specific embodiment, the present invention is described in further details.
The present invention is based on the parameter setting method of track traffic embedded software, the steps include:
1. file to be entered composition is set: see Fig. 1, data type files 1, controlled condition file 2, interface configuration file 3 constitute input file of the present invention jointly, and namely input parameter arranges the input file of module 4.
Data type files 1, essentially describes the data type of embedded software desired parameters, comprises length, whether has the information such as symbol.Shown in Figure 2, in the present embodiment, " data type A " represents the type of parameter, as UNWORD, INT8 etc.; " byte number " represents the byte number shared by data type A; " symbol " represents that the type is signed or unsigned type.
Controlled condition file 2, essentially describes the required parameter information arranged of embedded software, comprises the data type of parameter, parameter name etc.Shown in Figure 3, in the present embodiment, represent that this embedded software needs parameters 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 data type files in fig. 2 and define).
Interface configuration file 3, main characterising parameter arranges the interface layout condition of software, by interface with form performances such as the page, subpage frame, grouping, combo box, choice box, edit box, forms.Also need in file to describe and form by several pages, by several grouping in every page, under each grouping, have the control of which type and the parameter of correspondence thereof.Shown in Figure 4, in the present embodiment, top level page has two: the page 1 and the page 2, top level page has two subpage frames for 1 time: subpage frame 11, subpage frame 12, top level page also has two subpage frames for 2 times: subpage frame 21, subpage frame 22, therefore the membership of the page is presented at the right side at main interface by the present invention automatically with tree list, and when user's mouse clicks certain page, then the content of parameter of this page shows.
2. the optimum configurations of field of track traffic embedded software is carried out by parameter setting module 4, the output of parameter setting module 4 is output parameter value file 5, output parameter value file 5 constitutes the input of embedded software, and as shown in Figure 5, the execution flow process of parameter setting module 4 is:
(S1) resolution data type configuration file: main according to data type configuration protocol, extracts effective data type and key message thereof.
(S2) by data type stored in chained list: by resolve data type information stored in internal memory chained list.Definition data structure, this data structure comprises data type name, data type lengths, symbol etc., stores the data type information parsed from data type files, and this data structure forms the node of chained list.
(S3) resolve controlled condition file: main according to controlled condition configuration protocol, automatically extract the required content of parameter information arranged of embedded software.Definition data structure, describe the essential information of relevant parameter, this data structure comprises the title of parameter, the data type etc. of parameter.
(S4) parameter memory distributes: be embedded software parametric distribution memory headroom, main stored parameter value.Data type belonging to the title of parameter and parameter is obtained from step (S3), this step is then according to the data type chained list that step (S2) generates, find corresponding data type, obtain the information such as the length of corresponding data type, thus distribute corresponding memory headroom according to this data type.
(S5) resolution interface configuration file: interface configuration file is resolved, and with chain sheet form stored in internal memory.
(S6) human-computer interaction interface is generated: main to BCB(borland c++ builder development environment, a kind of SDK) control under development environment encapsulates, it is several that the control encapsulated comprises TreeView, Edit, Combobox, Checkbox, Grid, Label etc., as required control is expanded in addition, Checkbox such as with Label, the controls such as form embedded Checkbox, Combobox, realize self-definedization of control.According to the interface configurations that step (S5) is resolved, automatic generation respective type control, and automatically setup of attribute is carried out to this control, the parameter that record control is corresponding, the membership of each page is presented at the left side at main interface with tree structure, make user very clear to whole optimum configurations interface, when user selects certain page, then parametric contol all for this page is shown on the right side of main interface, user is facilitated to carry out optimum configurations targetedly, the mode of this kind of paging, can solve parameter amount brings greatly parameter typesetting mixed and disorderly, the problem that inconvenient user is arranged.See Fig. 6, it is an example of the man-machine interface automatically generated in an embody rule example.
(S7) customer parameter setting command is responded, stored parameter value: while generation human-computer interaction interface, have recorded the parameter that this control is corresponding, therefore respond the optimum configurations order of user, and by newly-installed for user parameter value stored in the corresponding core position of this parameter.
(S8) output parameter value file: after user completes optimum configurations, exported in the form of a file by parameter value, facilitates embedded software to use.
As from the foregoing, main different of the present invention and prior art are just: the definition of data type, embedded software desired parameters are defined, interface formats define open out, become the configuration file of executable program code, operationally, only need the above-mentioned file of dynamic load.Parameter setting module 4 can be by compile program code after can executive software, it adopts dynamic mode to load and resolution data type file, controlled condition file, each configuration file such as interface configuration file, therefore content of parameter is worked as, the compiler of software, when interface typesetting demand changes, technical staff only need use text editor to revise above-mentioned three configuration files accordingly, and without the need to revising executable program code, without the need to recompilating, the demand after change can be met, achieve a set of executable program code and be applicable to different embedded software optimum configurations demands, enhance its versatility and flexibility, substantially increase the convenience of operation.
Below be only the preferred embodiment of the present invention, protection scope of the present invention be not only confined to above-described embodiment, all technical schemes belonged under thinking of the present invention all belong to protection scope of the present invention.It should be pointed out that for those skilled in the art, some improvements and modifications without departing from the principles of the present invention, should be considered as protection scope of the present invention.