Summary of the invention
The purpose of this invention is to provide a kind of menu hierarchies display packing, it can clearly show the subordinate relation between the various menu, makes the client check the current path of doing operation more easily.
For achieving the above object, the present invention is by the following technical solutions:
A kind of menu hierarchies display packing is characterized in that may further comprise the steps:
1) set up resource table, writing down every grade of contents of menus in this resource table, every grade of contents of menus comprises the menu head of menu head at the corresponding levels, menu item at the corresponding levels and previous menu;
2) set up the corresponding relation of the key assignments of menus at different levels in the resource table and button;
3) obtain the key assignments message of button;
4) resolve the key assignments message of obtaining;
5) draw according to the menu of analysis result taking-up respective stages.
Further:
The concrete steps of described step 5) comprise:
5.1) at first according to the menu content of analysis result from resource table taking-up respective stages;
5.2) then upwards search for the menu head of each Previous Menu step by step from the corresponding levels;
5.3) the last menu head of each Previous Menu, the menu head of menu at the corresponding levels, the menu item at the corresponding levels on screen, drawn.
Described key assignments message comprises button value, touch potential and key-press status.
The present invention can clearly show the subordinate relation between the various menu, makes the user check the current path of doing operation more easily, thereby is not easy maloperation.
Embodiment
The present invention is a kind of menu hierarchies display packing, and it may further comprise the steps:
1) set up resource table, writing down every grade of contents of menus in this resource table, every grade of contents of menus comprises the menu head of menu head at the corresponding levels, menu item at the corresponding levels and previous menu;
2) set up the corresponding relation of the key assignments of menus at different levels in the resource table and button;
3) obtain the key assignments message of button;
4) resolve the key assignments message of obtaining;
5) at first take out the menu content of respective stages from resource table, then upwards search for the menu head of each Previous Menu step by step, the last menu head of each Previous Menu, the menu head of menu at the corresponding levels, the menu item at the corresponding levels on screen, drawn from the corresponding levels according to analysis result.
Be that example is described further with a digital system of Oscillograph below.
The software block diagram of system applies part as shown in Figure 1.Comprise KeyProc (key assignments processing) module, Command (remote command parsing) module, SSM (state machine) module, Function (application function) module and GUI (interface drafting) module.Wherein:
The KeyProc module obtains key assignments and touch potential.The SSM module is to realize the core of systemic-function, and this module realizes systemic-function by the mode of administrative messag.The Funciton module realizes oscillographic every major function.The GUI module is analytical capabilities message on the one hand, realizes the drafting of screen interface on the other hand.
The implementation procedure of systemic-function as shown in Figure 2.Wherein:
1.SSM key assignments message (comprising key assignments, touch potential and key-press status etc.) systematic function message according to input.
If press below the CH1 menu first key (coupling) once, SSM can be encoded into this action the feature message of 64 of code lengths.Feature message is made up of two parts, is respectively feature message ID and zone bit.Each function all has unique feature message ID corresponding with it, and high 56 of feature message are used for distributing unique feature message ID to each feature message.Least-significant byte is a zone bit, is used for writing down that button is pressed and information such as the state of upspringing.This step is mapped button and function.
Zone bit is mainly used to represent the type of this feature message, and the screen interface that each type of message correspondence refreshes is different.Such as feature message if " button is pressed " type, the effect of having only button to press on the interface so, and do not have other variation.
2.SSM call the feature message parsing module of GUI, feature message is resolved becomes forms message.
Forms message has comprised the current set of menu, current page, also have current operated knob, current popup menu and current operated be information such as which button.The current set of menu is as an object, its in store oneself menu head, the information such as level of menu item and it self.Illustrate the associated information of the current set of menu.Menu head as this menu of Fig. 3 is " network settings ", menu item below it is respectively " Configuration Type ", " IP address " etc. and is presented at project on the menu, and it self level is three grades (above " assisting " and " interface setting " two hierarchical levels of menus is arranged).
3.GUI module is issued SSM on the one hand with the forms message that parses and is used for management system running, leaves on the other hand and oneself is used for drawing the interface.
4. if menu is the one-level menu, the level at its only in store menu head and own place.If secondary and following menu, it not only needs to preserve menu head and level, also needs to preserve the menu of its upper level simultaneously.When the menu that analyzes was three grades or level Four, it also can index first order menu according to the Previous Menu that its is preserved like this.
Illustrate performing step:
1. press the Utility key, when key is upspring, send Utility key corresponding key message.State machine receives this press key message, is converted into feature message (just press this key and need carry out which operation), and enters into this state of Utility, sends this feature message to GUI simultaneously.
2.GUI feature message is resolved to forms message (being exactly to need the interface to draw which content).The necessary information in interface is drawn in the process need search of resolving.Such as when drawing menu, which the menu that must know current place is, what the menu head is, this menu has several, and what is respectively.Present the current set of menu is Utility (as Fig. 4), and the menu head shows Utility exactly, and this menu has three, is respectively interface setting, system time and self-correcting.Finished from the keyboard to the function again to a whole set of task that shows to this.
3. the function of the F1 soft key correspondence of menu is the interface setting.Press the F1 key this moment, and SSM receives and state can be switched to after this key assignments below interface is provided with, simultaneously sending function message.The GUI module parses is the interface setting to current menu, can note the relevant information that interface is provided with this menu, can preserve its previous menu simultaneously, i.e. the Utility menu.Parsing can be plotted to the menu item of interface setting on the menu after finishing.(see figure 5)
4. continue to press the network settings key, it is identical that the process of execution is caught up with the process of stating, and the current set of menu of this moment is switched on " network settings ".Its in store its previous menu, i.e. " interface setting ".And in store its Previous Menu-" the assisting " of " interface setting " menu, retrieval so step by step, just will before the menu path of the operation that be done all note, referring to Fig. 3.
Below this digital oscilloscope system operation is simply introduced
The center section of Fig. 6 is system's runnable interface, and both sides are the button at screen two ends, and their function is corresponding with the menu that shows on the screen.Function as first button correspondence of right side is that LAN is provided with, and the function of second button correspondence is a USB device.
The button that much has symbol is arranged on the panel of instrument.These symbol direct representations the function of these buttons.By corresponding button, the menu of screen can be followed it and be switched in other words.It is Utility that the name of a button is for example arranged on the screen, presses this button, and menu can be switching to appearance shown in Figure 4.Each menu all is made up of two parts, is respectively menu head and menu item.The menu head is used for representing the allomeric function and the menu path thereof of this menu.Menu item is then represented concrete function, and it is corresponding with the button on right side.
The concrete operational scheme of system is seen Fig. 7.Herein according to the label introduction that marks among the figure.
1, pushes button.At first will resolve key assignments, which key what detection was pressed exactly is, has pressed several times.What we pressed for example here is the Utility key, has pressed once.
2, the key information that parses is corresponding with concrete function.Such as pressing the Utility button, menu to be switched to below the Utility menu exactly.
3, feature message is carried out concrete function on the one hand, offers the interface on the one hand and draws part, and the drafting at interface partly can be drawn concrete interface according to the function that sends over.
Here mainly introduce the drafting of interface menu.Menu is drawn part has one to be used for preserving the resource table of drawing the required resource of menu.Writing down the menu head of each menu and the content of menu item in this resource table.If not first order menu, it can write down the menu head of its previous menu.As shown in Figure 3, be the menu hierarchies displayed map.The current set of menu of this moment is " network settings ", and it is a Level-3 menu.Its in store oneself key element, menu head-" the interface setting " of in store its previous menu simultaneously.And " interface setting " as a second-level menu, in the time of its in store own key element, is also writing down the menu head of its Previous Menu, just " assists ".When drawing " network settings " menu, can go earlier to find in the resource table its its other resources like this, search menu head at different levels then step by step, and draw.