Display control method and display control terminal
Through the primitive creation tool, the display logic and display of the ATS control terminal are separated, and the primitive components and the drawing attribute list are generated, which solves the code complexity and adaptability problems in the existing technology, and realizes flexible and efficient display control. Improves the controllability and maintainability of the terminal.
Patent Information
- Application Number
- CN202010600498.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-28
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2040-06-28
AI Technical Summary
When displaying line information, the code logic of existing ATS control display terminals is complex and verbose, the adaptability modification is complex and poor controllability, and it is difficult to flexibly cope with the display needs of different lines.
Through the element creation tool, the display logic and display are completely separated, the basic component elements are extracted to generate element components, the display scheme and the drawing attribute list are recorded, the corresponding element file and the drawing attribute list are loaded according to the target code bit for display, and the addition is supported. New elements and group complex primitives for increased efficiency.
It realizes efficient and flexible display work without changing the code, reduces modification complexity, improves controllability and maintainability, and is suitable for different customization needs.
Smart Images

Figure CN111897503B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a display control method and a display control terminal. Background Art
[0002] The display control terminal (such as the control and display terminal) is one of the main terminals of the automatic train monitoring system (ATS, Automatic Train Supervision). Its display interface mainly describes the real-time display of line information (such as switches, sections, signals and platforms, etc.) and train information (such as operation information, movement authorization, etc.).
[0003] Taking the real-time display of line information as an example, the important input file for the control and display terminal to display this information is the "station map" file. The "station map" file is generally created and drawn by data production personnel based on relevant design documents, using the "station map production tool" software, with the existing equipment in the line information (such as switches, sections, signals and platforms, etc.) as the smallest unit to create and draw the line information, and finally generate the "station map" file. The "station map" file describes the type, location, connection relationship and other information of the equipment in the line information composed of the smallest unit. The traditional ATS control and display terminal obtains the relevant information of the station equipment by loading the "station map" file, and draws the status of the station equipment in real time according to the code position, and then displays the real-time information of the line.
[0004] However, due to the different display requirements of each line, the code logic and display of the "real-time drawing of the status of station equipment according to the code position" part of the existing solution are intertwined, and the code logic is complex and lengthy, so its adaptability modification complexity is high and the controllability is poor. Summary of the invention
[0005] The purpose of the present invention is to provide a display control method and a display control terminal. Due to the existence of a graphic element production tool, logic and display are completely separated. When there is a display change requirement, the corresponding display work can be completed by only using the found drawing attribute list without changing the code, which is efficient and flexible.
[0006] In a first aspect, an embodiment of the present invention provides a display control method, including:
[0007] Based on the preset graphic element production tool, each basic component element in the display interface is extracted respectively to obtain a graphic element component;
[0008] Generate a metafile based on the primitive component, wherein the metafile records the association between the display scheme of each primitive and the corresponding code position, and the association between the display scheme of each primitive and the corresponding drawing attribute list;
[0009] If the target code position is received, the metafile is loaded based on the meta component to find the display scheme of the target meta element corresponding to the target code position, and to find the target drawing attribute list corresponding to the display scheme of the target meta element;
[0010] The display state of the target graphic element is drawn according to the target drawing attribute list.
[0011] Optionally, the method further comprises:
[0012] If a request to add a new element to the display interface is received, calling the graphic element creation tool based on the request;
[0013] The new element is drawn based on the basic primitive items in the primitive making tool, and a new primitive is generated.
[0014] Optionally, the method further comprises:
[0015] Obtaining basic primitive item information required to draw the new element;
[0016] Adding the basic graphic element item information to a preset graphic element attribute list;
[0017] The preset primitive attribute list is used to manage basic primitive item information required when drawing each element.
[0018] Optionally, the method further comprises:
[0019] Acquire complex graphics elements from the graphics element components according to preset screening rules;
[0020] The complex primitives are grouped.
[0021] Optionally, obtaining a complex graphic element from the graphic element component according to a preset screening rule includes:
[0022] According to the preset screening rule, the primitives whose code bits are greater than the preset threshold are obtained from the primitive components; wherein the primitives whose code bits are greater than the preset threshold are defined as complex primitives.
[0023] Optionally, the display scheme includes a control type, a drawing element identification ID, a drawing scheme and dynamic drawing parameters; wherein the drawing scheme records a list of drawing attributes related to basic primitive items that need to be changed during drawing when the display state of the primitive changes.
[0024] In a second aspect, an embodiment of the present invention provides a display control terminal, including:
[0025] An extraction module is used to extract each basic component element in the display interface based on a preset graphic element production tool to obtain a graphic element component;
[0026] A generating module, configured to generate a metafile based on the primitive component, wherein the metafile records the association between the display scheme of each primitive and the corresponding code position, and the association between the display scheme of each primitive and the corresponding drawing attribute list;
[0027] A search module, configured to load the metafile based on the metacomponent if a target code position is received, to search for a display scheme of a target metafile corresponding to the target code position, and to search for a target drawing attribute list corresponding to the display scheme of the target metafile;
[0028] A drawing module is used to draw the display state of the target graphic element according to the target drawing attribute list.
[0029] Optionally, the display control terminal further includes:
[0030] A calling module, configured to call the graphic element creation tool based on a request to add a new element to the display interface if a request is received;
[0031] The processing module is used to draw the new element based on the basic primitive items in the primitive production tool and generate a new primitive.
[0032] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the program.
[0033] In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, which implements the above method when executed by a processor.
[0034] The display control method and display control terminal provided by the embodiment of the present invention completely separate logic and display due to the existence of the primitive production tool. When there is a demand for display change, the corresponding display work can be completed by only looking up the drawing attribute list without changing the code, which is efficient and flexible. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 A flow chart of a display control method provided by an embodiment of the present invention;
[0037] Figure 2 A schematic diagram of the structure of a display control terminal provided by an embodiment of the present invention;
[0038] Figure 3 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] See also Figure 1 , an embodiment of the present invention discloses a display control method, comprising:
[0041] 101. Extract each basic component element in the display interface based on a preset graphic element production tool to obtain a graphic element component;
[0042] The primitive production tool and display interface can share the primitive configuration module, which is responsible for the creation, editing, drawing, saving and loading of basic primitive items, primitives (primitive items), scenes and views.
[0043] The graphic primitive creation tool can use packaged basic graphic primitive items (such as simple text, line, path, picture, ellipse, polygon, rectangle, GIF animation, etc.), as well as piece together basic graphic primitive items into graphic primitive items (combined graphics).
[0044] The graphic creation tool supports the dragging function similar to the Windows system drawing software, which can easily and conveniently draw the required graphics. For example, the display of a signal can be composed of two ellipses and several lines of vector graphics, or it can be composed of several portable network graphics (PNG, Portable Network Graphics) pictures and ellipses. Any graphic can be pieced together by the above basic graphics. The graphic creation tool not only supports the combination of the above PNG and vector graphics, but also supports the import of GIF animations. For example, "shield door switch" and "elevator operation status" can be dynamically displayed.
[0045] The primitives in the primitive component are abstractions of the basic components that appear in the display interface (such as switches, signals, etc.). The primitive attribute list can be used to manage the information of the basic elements (basic primitive items) required to draw each element, such as the width, color, pen shape, brush, and position of the brush. A primitive can be composed of one or more basic primitive items (such as lines, circles, pictures, texts, and polygons). As a container for primitives, the scene manages the interfaces of one or more primitives and can propagate events to each primitive; a scene can be divided into three layers: primitive layer, foreground layer, and background layer. The visualization of the content in the scene is managed by views, and multiple views can be connected to the same scene.
[0046] 102. Generate a metafile based on the primitive component, wherein the metafile records the association between the display scheme of each primitive and the corresponding code position, and the association between the display scheme of each primitive and the corresponding drawing attribute list;
[0047] After obtaining the primitive component, a primitive file is generated based on the primitive component. For example, after drawing the required graphics in the above step 101, the scheme style configuration interface of the primitive is entered. In the scheme style configuration interface, the drawing attribute list of each basic primitive corresponding to its display scheme can be set. For example, "line" supports information configuration such as "hide", "color", "dynamic parameters", and establishes an association relationship (correspondence relationship) between the display scheme and the drawing attribute list. Finally, the display scheme is bound to the code position. After completing the above operations, you can click to save the combined graphics (element item) to form a complete combined graphics. All combined graphics and corresponding drawing attribute lists are automatically maintained to the primitive related files through the primitive production tool, and the combined graphics can be dragged into the scene component to form the entire station map. After saving the scene file, the station map format file will be formed. It should be noted that the organization form, data structure and drawing method of the combined graphics can be implemented by using the "graphic grouping" combined with the ATS-specific code position mechanism, which not only takes into account the compatibility of existing code position operations, but also improves the drawing efficiency.
[0048] 103. If the target code position is received, the graphic element file is loaded based on the graphic element component to search for a display scheme of the target graphic element corresponding to the target code position, and search for a target drawing attribute list corresponding to the display scheme of the target graphic element;
[0049] After the display control terminal is started, the primitive component can load the primitive file that records the primitive position, primitive information, drawing scheme, etc. When the display control terminal receives a target code position, the primitive component finds the display scheme of the target primitive corresponding to the target code position according to the target code position, and obtains the target drawing attribute list corresponding to the display scheme.
[0050] 104. Draw the display status of the target graphic element according to the target drawing attribute list.
[0051] After obtaining the target drawing attribute list, the display control terminal can draw according to the basic graphic element information recorded in the target drawing attribute list, and complete the real-time display of the entire line information status.
[0052] The display control method provided by the embodiment of the present invention completely separates logic and display due to the existence of the primitive production tool. When there is a display change requirement, the corresponding display work can be completed by simply looking up the drawing attribute list without changing the code, which is efficient and flexible.
[0053] On the basis of the foregoing method embodiment, it also includes:
[0054] If a request to add a new element to the display interface is received, calling the graphic element creation tool based on the request;
[0055] The new element is drawn based on the basic primitive items in the primitive making tool, and a new primitive is generated.
[0056] Specifically, when a new device (new element) needs to be added, the device is spliced (drawn) with basic primitive items through the primitive creation tool, and a new primitive is generated. The drawing and display of the newly added device can be completed without modifying the code.
[0057] Furthermore, it also includes:
[0058] Obtaining basic primitive item information required to draw the new element;
[0059] Adding the basic graphic element item information to a preset graphic element attribute list;
[0060] The preset primitive attribute list is used to manage basic primitive item information required when drawing each element.
[0061] Specifically, the primitive attribute list manages the information of basic elements (basic primitive items) required to draw each element. When a new device (new element) needs to be added, the primitive creation tool is used to splice (draw) the device with basic primitive items, and the basic primitive item information is added to the primitive attribute list.
[0062] On the basis of the foregoing method embodiment, it also includes:
[0063] Acquire complex graphics elements from the graphics element components according to preset screening rules;
[0064] The complex primitives are grouped.
[0065] Furthermore, the above-mentioned obtaining a complex graphic element from the graphic element component according to a preset screening rule includes:
[0066] According to the preset screening rule, the primitives whose code bits are greater than the preset threshold are obtained from the primitive components; wherein the primitives whose code bits are greater than the preset threshold are defined as complex primitives.
[0067] Specifically, in order to reduce the number of times the basic primitive items are drawn when the primitive component draws the display state, improve the drawing efficiency of the primitive component, and reduce the workload of the primitive configuration personnel, the complex primitives can be grouped, wherein a group consists of one or more basic primitive items. It should be understood that if the complex primitives are not grouped, each basic primitive item must be redrawn when the display state changes, and if the complex primitives are grouped, only the basic primitive items of the group involved in the state change need to be drawn. Take the traffic light as an example of a complex primitive: the traffic light includes a circle and a cross, wherein a cross on the circle indicates that the light is off, and no cross on the circle indicates that the light is on. If there is no grouping, it is necessary to configure states such as bright blue, off blue, bright green, off green, bright red, and off red; if there is grouping, it is only necessary to set the light position group to one group (the color of the circle is filled), and set the light off and on to another group (crossed and not crossed). It can be understood that under the premise of grouping, during the drawing process, if the traffic light changes from bright blue to off blue, it is only necessary to draw a cross without drawing the filling color. It should be noted that the above preset threshold can be adjusted according to actual conditions, and the value of the preset threshold includes but is not limited to 3 or 4.
[0068] Based on the aforementioned method embodiment, the display scheme includes a control type, a drawing element identification ID, a drawing scheme, and dynamic drawing parameters; wherein the drawing scheme records a list of drawing attributes related to basic graphic element items that need to be changed during drawing when the display state of the graphic element changes.
[0069] In summary, the display control method provided in the embodiment of the present invention is not only applicable to ATS control and display terminals, but also applicable to other terminals with display requirements, thereby having better scalability.
[0070] Secondly, in response to different customized display requirements, the existence of graphic element production tools completely separates display from logic. When there is a need to change the display style scheme, you only need to modify the "scheme" drawing properties in the graphic element storage file through the tool to complete the work of "changing the code and modifying the display", which is efficient and flexible.
[0071] Thirdly, it breaks the limitation of traditional station diagrams that use equipment as the smallest drawing unit, and adopts a more abstract graphic element display solution with a clear structure and easy troubleshooting, thus having better maintainability.
[0072] Finally, since the graphic creation tool supports multiple file formats such as PNG, GIF, and display and logic analysis, it fundamentally ensures that the aesthetics will no longer be controlled by the R&D department. All the appearance of the graphics can be left to the artist, and the program only performs logic processing functions.
[0073] Based on the contents of the above embodiments, an embodiment of the present invention provides a display control terminal, which is used to execute the display control method provided in the above method embodiment. Figure 2 , the display control terminal comprises:
[0074] The extraction module 201 is used to extract each basic component element in the display interface based on a preset graphic element production tool to obtain a graphic element component;
[0075] A generating module 202, configured to generate a metafile based on the primitive component, wherein the metafile records the association between the display scheme of each primitive and the corresponding code position, and the association between the display scheme of each primitive and the corresponding drawing attribute list;
[0076] A search module 203 is configured to load the primitive file based on the primitive component to search for a display scheme of a target primitive corresponding to the target code position if a target code position is received, and search for a target drawing attribute list corresponding to the display scheme of the target primitive;
[0077] The drawing module 204 is used to draw the display status of the target primitive according to the target drawing attribute list.
[0078] The display control terminal provided by the embodiment of the present invention completely separates logic and display due to the existence of the graphic element production tool. When there is a display change requirement, the corresponding display work can be completed by simply looking up the drawing attribute list without changing the code, which is efficient and flexible.
[0079] In some optional embodiments, the display control terminal further includes:
[0080] A calling module, configured to call the graphic element creation tool based on a request to add a new element to the display interface if a request is received;
[0081] The processing module is used to draw the new element based on the basic primitive items in the primitive production tool and generate a new primitive.
[0082] The display control terminal of the embodiment of the present invention can be used to execute the technical solution of the aforementioned method embodiment, and its implementation principle and technical effect are similar and will not be repeated here.
[0083] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302 and the memory 303 communicate with each other through the communication bus 304. The processor 301 may call the logic instructions in the memory 303 to execute the following method: extracting each basic component element in the display interface based on a preset primitive production tool to obtain a primitive component; generating a primitive file based on the primitive component, wherein the primitive file records the association between the display scheme of each primitive and the corresponding code position, and the association between the display scheme of each primitive and the corresponding drawing attribute list; if the target code position is received, the primitive file is loaded based on the primitive component to find the display scheme of the target primitive corresponding to the target code position, and find the target drawing attribute list corresponding to the display scheme of the target primitive; and drawing the display state of the target primitive according to the target drawing attribute list.
[0084] In addition, the logic instructions in the above-mentioned memory 303 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0085] On the other hand, an embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the methods provided in the above-mentioned embodiments, for example, including: extracting each basic component element in the display interface based on a preset primitive production tool to obtain a primitive component; generating a primitive file based on the primitive component, wherein the primitive file records the association between the display scheme of each primitive and the corresponding code position, and the association between the display scheme of each primitive and the corresponding drawing attribute list; if a target code position is received, loading the primitive file based on the primitive component to find the display scheme of the target primitive corresponding to the target code position, and find the target drawing attribute list corresponding to the display scheme of the target primitive; drawing the display state of the target primitive according to the target drawing attribute list.
[0086] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0087] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A display control method, characterized in that: include: Based on the preset graphic element production tool, each basic component element in the display interface is extracted respectively to obtain a graphic element component; Generate a metafile based on the primitive component, wherein the metafile records the association between the display scheme of each primitive and the corresponding code position, and the association between the display scheme of each primitive and the corresponding drawing attribute list; the display scheme includes a control type, a drawing element identification ID, a drawing scheme, and a dynamic drawing parameter; wherein the drawing scheme records the drawing attribute list related to the basic primitive items that need to be changed when drawing when the display state of the primitive changes; wherein after drawing the required graphics, enter the primitive scheme style configuration interface, and set the drawing attribute list of each basic primitive corresponding to the display scheme in the scheme style configuration interface; If the target code position is received, the graphic element file is loaded based on the graphic element component to find the display scheme of the target graphic element corresponding to the target code position, and find the target drawing attribute list corresponding to the display scheme of the target graphic element; The display state of the target graphic element is drawn according to the target drawing attribute list.
2. The display control method according to claim 1, characterized in that: The method further comprises: If a request to add a new element to the display interface is received, calling the graphic element creation tool based on the request; The new element is drawn based on the basic primitive items in the primitive making tool, and a new primitive is generated.
3. The display control method according to claim 2, characterized in that: The method further comprises: Obtaining basic primitive item information required to draw the new element; Adding the basic graphic element item information to a preset graphic element attribute list; The preset primitive attribute list is used to manage basic primitive item information required when drawing each element.
4. The display control method according to claim 1, characterized in that: The method further comprises: Acquire complex graphics elements from the graphics element components according to preset screening rules; The complex primitives are grouped.
5. The display control method according to claim 4, characterized in that: The obtaining of complex graphics elements from the graphics element components according to preset screening rules includes: According to the preset screening rule, the primitives whose code bits are greater than the preset threshold are obtained from the primitive components; wherein the primitives whose code bits are greater than the preset threshold are defined as complex primitives.
6. A display control terminal, characterized in that: include: An extraction module is used to extract each basic component element in the display interface based on a preset graphic element production tool to obtain a graphic element component; A generation module, used for generating a metafile based on the primitive component, wherein the metafile records the association between the display scheme of each primitive and the corresponding code position, and the association between the display scheme of each primitive and the corresponding drawing attribute list; the display scheme includes a control type, a drawing element identification ID, a drawing scheme, and a dynamic drawing parameter; wherein the drawing scheme records the drawing attribute list related to the basic primitive items that need to be changed when drawing when the display state of the primitive changes; wherein after drawing the required graphics, the scheme style configuration interface of the primitive is entered, and in the scheme style configuration interface, the drawing attribute list of each basic primitive corresponding to the display scheme is set; A search module, configured to load the metafile based on the metacomponent if a target code position is received, to search for a display scheme of a target metafile corresponding to the target code position, and to search for a target drawing attribute list corresponding to the display scheme of the target metafile; A drawing module is used to draw the display state of the target graphic element according to the target drawing attribute list.
7. The display control terminal according to claim 6, characterized in that: The display control terminal also includes: A calling module, configured to call the graphic element creation tool based on a request to add a new element to the display interface if a request is received; The processing module is used to draw the new element based on the basic primitive items in the primitive production tool and generate a new primitive.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the display control method according to any one of claims 1 to 5 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the display control method according to any one of claims 1 to 5 are implemented.
