CN109739455B - Power grid tidal current diagram visualization method - Google Patents
Power grid tidal current diagram visualization method Download PDFInfo
- Publication number
- CN109739455B CN109739455B CN201811620496.7A CN201811620496A CN109739455B CN 109739455 B CN109739455 B CN 109739455B CN 201811620496 A CN201811620496 A CN 201811620496A CN 109739455 B CN109739455 B CN 109739455B
- Authority
- CN
- China
- Prior art keywords
- power grid
- rendering
- component
- grid equipment
- tidal current
- 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.)
- Active
Links
Images
Landscapes
- Processing Or Creating Images (AREA)
Abstract
The invention provides a power grid tidal current diagram visualization method, which comprises the following steps: the WPF graphical interface framework continuously loads a power grid tidal current graph data file to be rendered in real time; analyzing the data file of the power grid tidal current diagram to obtain a data structure of the power grid tidal current diagram; and adjusting the architecture of the WPF graphical interface framework according to the data structure of the power grid tidal current diagram, so that the WPF graphical interface framework is combined with the Direct2D module. Has the advantages that: the invention provides a power grid tidal current diagram visualization method, which combines a Direct2D high-performance rendering technology under DirectX with a WPF graphical interface framework to replace the original milcore rendering technology of the WPF graphical interface framework, realizes the high-performance power grid tidal current diagram visualization rendering method, can effectively improve the rendering speed, ensures the fluency of the power grid tidal current diagram displayed on large-screen equipment, and avoids the phenomenon of blockage.
Description
Technical Field
The invention belongs to the technical field of data visualization, and particularly relates to a method for visualizing a tidal current diagram of a power grid.
Background
The steady distribution of voltage and power in an electric power system is called tidal current, and a circuit graph formed by distributing the voltage and the power of an electric network through electrical signs such as lines, nodes, reactance elements and the like is an electric network tidal current graph. The power grid tidal current graph occupies an important position in the operation of the power grid.
In a large-screen data visualization scheme in the power industry, a power grid tidal current diagram needs to be visually displayed. Customers in the power industry have higher requirements on the display performance of the tidal current diagram of the power grid, so that the display smoothness on large-resolution large-screen equipment is guaranteed, and the requirement on the timeliness of refreshing the visualized service data is also met.
In the current common large-screen data visualization scheme, a WPF graphical interface framework is adopted as a development technology for visualization presentation at a large-screen end. The WPF graphical interface framework is used as a desktop software graphical interface development framework and has the characteristics of short development period and quick start of software developers. However, in order to facilitate rapid development by developers of various levels, there are higher abstraction structures and interface packages. It is determined that the operation performance of the method is obviously lower than that of the bottom development technologies such as Direct3D, Direct2D and the like.
As shown in fig. 1, which is a schematic diagram of a WPF graphics development framework, a PresentationCore and a presentationopennetwork in an upper layer constitute an abstract structure of the WPF graphics interface framework. The system is constructed on a Windows kernel and a User32 technical system, and simultaneously supports the DirectX (including sub-parts such as Direct3D, Direct2D and the like) hardware accelerated rendering technology. The WPF graphics development framework has a higher level of abstraction than the Windows graphics framework shown in FIG. 2.
The WPF graphic development framework also supports hardware accelerated rendering, and the realization principle is as follows: referring to FIG. 1, the WPF graphic development framework is mediated by the milcore module with DirectX. The milcore module is responsible for rendering and displaying the WPF graphical interface framework, translates the rendering and displaying of the WPF into specific rendering instructions and delivers the rendering instructions to DirectX for rendering. However, when an application program developed by the WPF graphics development framework performs rendering, the rendering efficiency of the milcore module is low due to the abstract structure and the encapsulation of the application program. As shown in fig. 3, a WPF graphical interface framework rendering schematic diagram shows a group of processes for rendering a black border circle by a graphical development framework, where in fig. 3, a total of 4 rendering instructions are required to complete the rendering of the black border circle.
In the existing large-screen visualization scheme, one power grid tidal current graph usually comprises hundreds of various graphic elements such as circles and ellipses, and therefore when the power grid tidal current graph is rendered and displayed by adopting the original rendering technology of the WPF graphical interface framework, due to the slow rendering speed, the phenomenon that the power grid tidal current graph is not smoothly displayed on large-screen equipment and is easily blocked can occur.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a power grid tidal current diagram visualization method, which can effectively solve the problems.
The technical scheme adopted by the invention is as follows:
the invention provides a power grid tidal current diagram visualization method, which comprises the following steps:
step 1, initializing a WPF graphical interface framework, and setting a picture rendering size;
step 2, continuously loading a power grid tidal current graph data file to be rendered in real time by the WPF graphical interface framework; wherein the power grid tidal current graph data file is docked with a data source; when the data source changes, the power grid tidal current diagram data file changes in real time, namely: the power grid tidal current diagram data file is a dynamically variable data file;
step 3, the WPF graphical interface framework judges whether the format of the loaded power grid tidal current graph data file is supported, and if not, the step 9 is skipped; if yes, executing step 4;
step 4, the WPF graphical interface framework analyzes the power grid tidal current diagram data file to obtain a power grid tidal current diagram data structure; wherein the power grid tidal flow graph data structure comprises: description information of the power grid equipment primitive, description information of the power grid equipment attribute and description information of the power grid equipment topological connection relation;
step 5, adjusting the architecture of the WPF graphical interface framework according to the data structure of the power grid tidal current diagram, so that the WPF graphical interface framework is combined with the Direct2D module, and the method comprises the following steps:
step 5.1, creating a visual UI component according to the data structure of the power grid tidal current diagram, namely: element2D components; the visual UI component comprises a power grid equipment primitive UI control, a power grid equipment attribute UI control and a power grid equipment topological connection relation UI control;
packaging the visual UI component in a general view frame, namely a presentationframe module, of the WPF graphical interface frame;
step 5.2, creating a rendering context component corresponding to the visualization UI component, namely: a Scene2D component; wherein the render context component comprises: a power grid equipment primitive rendering context subassembly corresponding to the power grid equipment primitive UI control, a power grid equipment attribute rendering context subassembly corresponding to the power grid equipment attribute UI control, and a power grid equipment topological connection relation rendering context subassembly corresponding to the power grid equipment topological connection relation UI control;
in the common language runtime module of the WPF graphical interface framework, namely: the Common Language Runtime module is used for encapsulating the rendering context component;
step 5.3, creating a rendering instruction generation component corresponding to the rendering context component, namely: a Core2D component; wherein the rendering instruction generation component comprises: a grid equipment primitive rendering instruction generating sub-component corresponding to the grid equipment primitive rendering context sub-component, a grid equipment attribute rendering instruction generating sub-component corresponding to the grid equipment attribute rendering context sub-component, and a grid equipment topological connection relation rendering instruction generating sub-component corresponding to the grid equipment topological connection relation rendering context sub-component;
encapsulating the rendering instruction generation component in a common language runtime module of the WPF graphical interface framework;
step 5.4, creating a D3 Dimap component; combining the Direct2D module with a WPF graphical interface framework, wherein the combined graphical interface framework comprises:
the universal view frame presentationframe, the calling module presentationore, the Common Language Runtime module Common Language Runtime, Direct2D, DirectX, D3 Direct components; wherein, the Common Language Runtime module Common Language Runtime encapsulates the rendering context component and the rendering instruction generation component;
the connection relationship is as follows: the output end of the visual UI component passes over the presentation module and is directly connected to the input end of the rendering context component; the output end of the rendering context component is connected to the input end of the rendering instruction generation component; the output end of the rendering instruction generation component is connected to the input end of the Direct 2D; the output end of the Direct2D is connected to the input end of the DirectX; the output end of the DirectX is connected to the input end of the D3Dimage component; the output end of the D3Dimage component is connected to the input end of the universal view frame presentation frame;
step 6, after the WPF graphical interface framework is combined with the Direct2D module, the visualization of the current rendering of the power grid tidal current graph is realized by adopting the following steps:
step 6.1, the visual UI component is combined with the general view framework to convert the power grid tidal flow graph data structure into a power grid tidal flow graph, and the method specifically comprises the following steps:
the power grid equipment primitive UI control converts the description information of the power grid equipment primitive into a power grid equipment primitive graph;
the power grid equipment attribute UI control converts the description information of the power grid equipment attribute into a power grid equipment attribute graph;
the power grid equipment topological connection relation UI control converts the description information of the power grid equipment topological connection relation into a power grid equipment topological connection relation graph;
step 6.2, the visualization UI component sends the converted power grid tidal current graph to the rendering context component;
step 6.3, the rendering context component generates corresponding rendering parameters according to the power grid tidal current graph graphs, and sends the rendering parameters to the rendering instruction generating component;
wherein the rendering context component generates corresponding rendering parameters according to the power grid tidal flow graph, and the rendering parameters comprise:
the power grid equipment primitive rendering context subassembly generates power grid equipment primitive rendering parameters according to the power grid equipment primitive graph;
the power grid equipment attribute rendering context subassembly generates power grid equipment attribute rendering parameters according to the power grid equipment attribute graph;
the power grid equipment topological connection relation rendering context subassembly generates power grid equipment topological connection relation rendering parameters according to the power grid equipment topological connection relation graph;
step 6.4, the rendering instruction generation component interprets the rendering parameters as a Direct2D rendering instruction; the method comprises the following steps:
the power grid equipment primitive rendering instruction generation sub-component interprets the power grid equipment primitive rendering parameters as a rendering instruction of Direct2D to the power grid equipment primitive;
the power grid equipment attribute rendering instruction generates a sub-component, and the power grid equipment attribute rendering parameters are interpreted as rendering instructions of Direct2D for the power grid equipment attributes;
the power grid equipment topological connection relation rendering instruction generates a sub-component, and the power grid equipment topological connection relation rendering parameters are interpreted as rendering instructions of Direct2D on the power grid equipment topological connection relation;
step 6.5, the rendering instruction generating component stores the rendering instruction obtained by interpretation and sends the rendering instruction obtained by interpretation to Direct 2D;
6.6, receiving all rendering instructions of the power grid tidal current diagram to be rendered in batch for the Direct 2D; then, the Direct2D interprets the rendering instructions and assembles all the rendering instructions into one rendering instruction according to a rendering optimization algorithm;
then, the Direct2D calls a DirectX graphical interface rendering interface to render the picture content according to the assembled rendering instruction, and the rendered content is output to a D3Dimage component after the DirectX completes the picture rendering;
6.7, displaying the rendered content to a universal view frame presentationframe ork by the D3Dimage component, and finishing the display of the rendered picture;
step 7, judging whether the power grid tidal current diagram picture needs to be continuously displayed; if the power grid tidal current graph picture is closed, skipping to the step 9, and finishing rendering; if the power grid tidal current diagram picture is kept in an open state, executing the step 8;
step 8, returning to the step 2, judging whether the newly loaded power grid tidal current graph data file changes or not by the WPF graphical interface framework, if not, jumping to the step 6.5, sending the rendering instruction stored for the previous time to Direct2D by the rendering instruction generating component, and then executing the step 6.6-the step 7 to finish rendering once; the circulation is continuously carried out;
if the change occurs, the WPF graphical interface framework only loads the relevant power grid tidal current graph data files related to the change; then, through the steps 3-6.4, a rendering instruction which changes at this time is obtained; then, in step 6.5, the rendering instruction generating component sends the changed rendering instruction and the unchanged rendering instruction to Direct2D, and then executes steps 6.6 to 7 to complete the image rendering of the change and update of the primary power grid tidal current graph; the circulation is continuously carried out;
and 9, finishing rendering.
Preferably, in step 4, the description information of the attribute of the power grid device includes name description information of the power grid device, relative position description information of the power grid device, and real-time load description information of the power grid device.
The method for visualizing the tidal current diagram of the power grid has the following advantages:
the invention provides a power grid tidal current diagram visualization method, which combines a Direct2D high-performance rendering technology under DirectX with a WPF graphical interface framework to replace the original milcore rendering technology of the WPF graphical interface framework, realizes the high-performance power grid tidal current diagram visualization rendering method, can effectively improve the rendering speed, ensures the fluency of the power grid tidal current diagram displayed on large-screen equipment, and avoids the phenomenon of blockage.
Drawings
FIG. 1 is an architectural diagram of a WPF graphics development framework;
FIG. 2 is a schematic diagram of the architecture of a Windows graphics framework;
FIG. 3 is a WPF graphical interface framework rendering diagram;
FIG. 4 is a schematic diagram of a frame structure of a graphics interface combining Direct2D with WPF provided by the present invention;
fig. 5 is an implementation architecture diagram of a power grid tidal current diagram visualization method provided by the invention.
Detailed Description
In order to make the technical problems, technical solutions and advantageous effects solved by the present invention more clearly apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a power grid tidal current diagram visualization method, which combines a Direct2D high-performance rendering technology under DirectX with a WPF graphical interface framework to replace the original milcore rendering technology of the WPF graphical interface framework, realizes the high-performance power grid tidal current diagram visualization rendering method, can effectively improve the rendering speed, ensures the fluency of the power grid tidal current diagram displayed on large-screen equipment, and avoids the phenomenon of blockage.
Referring to fig. 4 and 5, the invention provides a method for visualizing a tidal flow graph of a power grid, comprising the following steps:
step 1, initializing a WPF graphical interface framework, and setting a picture rendering size;
step 2, continuously loading a power grid tidal current graph data file to be rendered in real time by the WPF graphical interface framework; wherein the power grid tidal current graph data file is docked with a data source; when the data source changes, the power grid tidal current diagram data file changes in real time, namely: the power grid tidal current diagram data file is a dynamically variable data file;
step 3, the WPF graphical interface framework judges whether the format of the loaded power grid tidal current graph data file is supported, and if not, the step 9 is skipped; if yes, executing step 4;
step 4, the WPF graphical interface framework analyzes the power grid tidal current diagram data file to obtain a power grid tidal current diagram data structure; wherein the power grid tidal flow graph data structure comprises: description information of the power grid equipment primitive, description information of the power grid equipment attribute and description information of the power grid equipment topological connection relation; the description information of the attributes of the power grid equipment comprises name description information of the power grid equipment, relative position description information of the power grid equipment and real-time load description information of the power grid equipment.
Step 5, adjusting the architecture of the WPF graphical interface framework according to the data structure of the power grid tidal current diagram, so that the WPF graphical interface framework is combined with the Direct2D module, and the method comprises the following steps:
step 5.1, creating a visual UI component according to the data structure of the power grid tidal current diagram, namely: element2D components; the visual UI component comprises a power grid equipment primitive UI control, a power grid equipment attribute UI control and a power grid equipment topological connection relation UI control;
packaging the visual UI component in a general view frame, namely a presentationframe module, of the WPF graphical interface frame;
step 5.2, creating a rendering context component corresponding to the visualization UI component, namely: a Scene2D component; wherein the render context component comprises: a power grid equipment primitive rendering context subassembly corresponding to the power grid equipment primitive UI control, a power grid equipment attribute rendering context subassembly corresponding to the power grid equipment attribute UI control, and a power grid equipment topological connection relation rendering context subassembly corresponding to the power grid equipment topological connection relation UI control;
in the common language runtime module of the WPF graphical interface framework, namely: the Common Language Runtime module is used for encapsulating the rendering context component;
step 5.3, creating a rendering instruction generation component corresponding to the rendering context component, namely: a Core2D component; wherein the rendering instruction generation component comprises: a grid equipment primitive rendering instruction generating sub-component corresponding to the grid equipment primitive rendering context sub-component, a grid equipment attribute rendering instruction generating sub-component corresponding to the grid equipment attribute rendering context sub-component, and a grid equipment topological connection relation rendering instruction generating sub-component corresponding to the grid equipment topological connection relation rendering context sub-component;
encapsulating the rendering instruction generation component in a common language runtime module of the WPF graphical interface framework;
step 5.4, creating a D3 Dimap component; combining the Direct2D module with a WPF graphical interface framework, wherein the combined graphical interface framework comprises:
the universal view frame presentationframe, the calling module presentationore, the Common Language Runtime module Common Language Runtime, Direct2D, DirectX, D3 Direct components; wherein, the Common Language Runtime module Common Language Runtime encapsulates the rendering context component and the rendering instruction generation component;
the connection relationship is as follows: the output end of the visual UI component passes over the presentation module and is directly connected to the input end of the rendering context component; the output end of the rendering context component is connected to the input end of the rendering instruction generation component; the output end of the rendering instruction generation component is connected to the input end of the Direct 2D; the output end of the Direct2D is connected to the input end of the DirectX; the output end of the DirectX is connected to the input end of the D3Dimage component; the output end of the D3Dimage component is connected to the input end of the universal view frame presentation frame;
step 6, after the WPF graphical interface framework is combined with the Direct2D module, the visualization of the current rendering of the power grid tidal current graph is realized by adopting the following steps:
step 6.1, the visual UI component is combined with the general view framework to convert the power grid tidal flow graph data structure into a power grid tidal flow graph, and the method specifically comprises the following steps:
the power grid equipment primitive UI control converts the description information of the power grid equipment primitive into a power grid equipment primitive graph;
the power grid equipment attribute UI control converts the description information of the power grid equipment attribute into a power grid equipment attribute graph;
the power grid equipment topological connection relation UI control converts the description information of the power grid equipment topological connection relation into a power grid equipment topological connection relation graph;
step 6.2, the visualization UI component sends the converted power grid tidal current graph to the rendering context component;
step 6.3, the rendering context component generates corresponding rendering parameters according to the power grid tidal current graph graphs, and sends the rendering parameters to the rendering instruction generating component;
wherein the rendering context component generates corresponding rendering parameters according to the power grid tidal flow graph, and the rendering parameters comprise:
the power grid equipment primitive rendering context subassembly generates power grid equipment primitive rendering parameters according to the power grid equipment primitive graph;
the power grid equipment attribute rendering context subassembly generates power grid equipment attribute rendering parameters according to the power grid equipment attribute graph;
the power grid equipment topological connection relation rendering context subassembly generates power grid equipment topological connection relation rendering parameters according to the power grid equipment topological connection relation graph;
step 6.4, the rendering instruction generation component interprets the rendering parameters as a Direct2D rendering instruction; the method comprises the following steps:
the power grid equipment primitive rendering instruction generation sub-component interprets the power grid equipment primitive rendering parameters as a rendering instruction of Direct2D to the power grid equipment primitive;
the power grid equipment attribute rendering instruction generates a sub-component, and the power grid equipment attribute rendering parameters are interpreted as rendering instructions of Direct2D for the power grid equipment attributes;
the power grid equipment topological connection relation rendering instruction generates a sub-component, and the power grid equipment topological connection relation rendering parameters are interpreted as rendering instructions of Direct2D on the power grid equipment topological connection relation;
step 6.5, the rendering instruction generating component stores the rendering instruction obtained by interpretation and sends the rendering instruction obtained by interpretation to Direct 2D;
6.6, receiving all rendering instructions of the power grid tidal current diagram to be rendered in batch for the Direct 2D; then, the Direct2D interprets the rendering instructions and assembles all the rendering instructions into one rendering instruction according to a rendering optimization algorithm;
then, the Direct2D calls a DirectX graphical interface rendering interface to render the picture content according to the assembled rendering instruction, and the rendered content is output to a D3Dimage component after the DirectX completes the picture rendering;
6.7, displaying the rendered content to a universal view frame presentationframe ork by the D3Dimage component, and finishing the display of the rendered picture;
step 7, judging whether the power grid tidal current diagram picture needs to be continuously displayed; if the power grid tidal current graph picture is closed, skipping to the step 9, and finishing rendering; if the power grid tidal current diagram picture is kept in an open state, executing the step 8;
step 8, returning to the step 2, judging whether the newly loaded power grid tidal current graph data file changes or not by the WPF graphical interface framework, if not, jumping to the step 6.5, sending the rendering instruction stored for the previous time to Direct2D by the rendering instruction generating component, and then executing the step 6.6-the step 7 to finish rendering once; the circulation is continuously carried out;
if the change occurs, the WPF graphical interface framework only loads the relevant power grid tidal current graph data files related to the change; then, through the steps 3-6.4, a rendering instruction which changes at this time is obtained; then, in step 6.5, the rendering instruction generating component sends the changed rendering instruction and the unchanged rendering instruction to Direct2D, and then executes steps 6.6 to 7 to complete the image rendering of the change and update of the primary power grid tidal current graph; the circulation is continuously carried out;
and 9, finishing rendering.
The invention provides a power grid tidal current diagram visualization method, which mainly comprises the following steps: creating a visual UI component Element2D for realizing the visualization of the tidal current picture Element to obtain a tidal current diagram Element graph according to the tidal current diagram data structure of the power grid; creating a rendering context component Scene2D for generating rendering parameters according to the tidal flow graph element graphics; creating a rendering instruction generation component Core2D for interpreting rendering parameters as Direct2D rendering instructions;
the visualization UI component Element2D, the rendering context component Scene2D and the rendering instruction generation component Core2D are respectively encapsulated in different layers of the WPF graphical interface framework;
and Direct2D is not encapsulated in the WPF graphical interface framework, is independent of the WPF graphical interface framework and only performs message interaction with the WPF graphical interface framework.
Therefore, when the data file of the power grid tidal current diagram is not changed, in order to realize the real-time display of the tidal current diagram picture, the circularly executed rendering process comprises the following steps:
the visualization UI component Element2D, the rendering context component Scene2D and the rendering instruction generating component Core2D do not need to be created again, and the rendering instruction generating component Core2D saves the rendering instruction obtained last time; then, when a rendering cycle is performed each time, the rendering instruction generating component Core2D directly sends the rendering instruction stored for the previous time to Direct2D, the Direct2D executes the rendering process, and the rendering content is output to the D3 Direct component; displaying the rendering content to a universal view frame presentationframe by the D3Dimage component, and finishing the display of the rendering picture;
and if the data file of the power grid tidal current graph changes, the executed rendering process is as follows:
only aiming at the changed power grid tidal flow graph data file, creating a visualization UI component Element2D, a rendering context component Scene2D and a rendering instruction generation component Core2D, so that the rendering instruction which is changed is generated by a rendering instruction generation component Core 2D; meanwhile, the rendering instruction generation component Core2D stores the rendering instruction which is not changed, then the rendering instruction generation component Core2D sends the changed rendering instruction and the unchanged rendering instruction to Direct2D together, the Direct2D executes the rendering process, and the rendering content is output to the D3 Direct component; and the D3Dimage component displays the rendering content to the universal view frame presentationframe, and completes the display of the rendering picture. Therefore, when the data file of the power grid tidal current graph is changed, the method does not need to completely re-execute the rendering process for one time, and only needs to be executed in a targeted manner, so that the rendering efficiency is improved; for the condition that the data file of the power grid tidal current graph is not changed, the rendering instruction generating component Core2D only needs to directly send the rendering instruction to Direct2D, and the rendering efficiency is more efficient.
For Direct2D, due to its good architecture design and excellent rendering algorithm, the rendering algorithm implemented by the native kernel of the WPF graphical interface framework is greatly improved. Specifically, the rendering instruction sent directly to Direct2D by the rendering instruction generation component Core2D is a plurality of rendering instructions, that is: one tidal flow graph element corresponds to one rendering instruction; for Direct2D, multiple rendering instructions can be quickly assembled into one rendering instruction, so that in the subsequent steps, the rendering process can be completed only by executing one rendering instruction, and the rendering efficiency is remarkably improved.
The WPF graphical interface framework provided by the invention is combined with the Direct2D module, and the rendering performance of the original WPF graphical interface framework in the prior art is tested, wherein the table 1 is a rendering result table of the invention; table 2 is a prior art rendering results table:
TABLE 1
Resolution of pictures | Number of figures | Refresh mechanism | Rendering frame rate | Fluency of picture |
7680x2160 | 500 | At intervals of 0.3 second | Over 30 frames | Is very smooth |
7680x2160 | 1000 | At intervals of 0.3 second | About 25 frames | Is very smooth |
7680x3240 | 600 | At intervals of 0.3 second | 22 frames(left and right) | Is smoother |
TABLE 2
Resolution of pictures | Number of figures | Refresh mechanism | Rendering frame rate | Fluency of picture |
7680x2160 | 500 | At intervals of 3 seconds | 11 frames or so | Refresh delay 3 seconds |
7680x2160 | 1000 | At intervals of 3 seconds | About 8 frames | Refresh delay 5 seconds |
7680x3240 | 600 | At intervals of 3 seconds | About 5 frames | Refresh delay 3 seconds |
Comparing table 1 and table 2, it can be seen that, compared with the native WPF graphical interface framework in the prior art, the method of the invention effectively improves the picture rendering performance of the power grid visualization tidal current graph.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and improvements can be made without departing from the principle of the present invention, and such modifications and improvements should also be considered within the scope of the present invention.
Claims (2)
1. A method for visualizing a tidal flow graph of an electrical grid is characterized by comprising the following steps:
step 1, initializing a WPF graphical interface framework, and setting a picture rendering size;
step 2, continuously loading a power grid tidal current graph data file to be rendered in real time by the WPF graphical interface framework; wherein the power grid tidal current graph data file is docked with a data source; when the data source changes, the power grid tidal current diagram data file changes in real time, namely: the power grid tidal current diagram data file is a dynamically variable data file;
step 3, the WPF graphical interface framework judges whether the format of the loaded power grid tidal current graph data file is supported, and if not, the step 9 is skipped; if yes, executing step 4;
step 4, the WPF graphical interface framework analyzes the power grid tidal current diagram data file to obtain a power grid tidal current diagram data structure; wherein the power grid tidal flow graph data structure comprises: description information of the power grid equipment primitive, description information of the power grid equipment attribute and description information of the power grid equipment topological connection relation;
step 5, adjusting the architecture of the WPF graphical interface framework according to the data structure of the power grid tidal current diagram, so that the WPF graphical interface framework is combined with the Direct2D module, and the method comprises the following steps:
step 5.1, creating a visual UI component according to the data structure of the power grid tidal current diagram, namely: element2D components; the visual UI component comprises a power grid equipment primitive UI control, a power grid equipment attribute UI control and a power grid equipment topological connection relation UI control;
packaging the visual UI component in a general view frame, namely a presentationframe module, of the WPF graphical interface frame;
step 5.2, creating a rendering context component corresponding to the visualization UI component, namely: a Scene2D component; wherein the render context component comprises: a power grid equipment primitive rendering context subassembly corresponding to the power grid equipment primitive UI control, a power grid equipment attribute rendering context subassembly corresponding to the power grid equipment attribute UI control, and a power grid equipment topological connection relation rendering context subassembly corresponding to the power grid equipment topological connection relation UI control;
in the common language runtime module of the WPF graphical interface framework, namely: the Common Language Runtime module is used for encapsulating the rendering context component;
step 5.3, creating a rendering instruction generation component corresponding to the rendering context component, namely: a Core2D component; wherein the rendering instruction generation component comprises: a grid equipment primitive rendering instruction generating sub-component corresponding to the grid equipment primitive rendering context sub-component, a grid equipment attribute rendering instruction generating sub-component corresponding to the grid equipment attribute rendering context sub-component, and a grid equipment topological connection relation rendering instruction generating sub-component corresponding to the grid equipment topological connection relation rendering context sub-component;
encapsulating the rendering instruction generation component in a common language runtime module of the WPF graphical interface framework;
step 5.4, creating a D3 Dimap component; combining the Direct2D module with a WPF graphical interface framework, wherein the combined graphical interface framework comprises:
the universal view frame presentationframe, the calling module presentationore, the Common Language Runtime module Common Language Runtime, Direct2D, DirectX, D3 Direct components; wherein, the Common Language Runtime module Common Language Runtime encapsulates the rendering context component and the rendering instruction generation component;
the connection relationship is as follows: the output end of the visual UI component passes over the presentation module and is directly connected to the input end of the rendering context component; the output end of the rendering context component is connected to the input end of the rendering instruction generation component; the output end of the rendering instruction generation component is connected to the input end of the Direct 2D; the output end of the Direct2D is connected to the input end of the DirectX; the output end of the DirectX is connected to the input end of the D3Dimage component; the output end of the D3Dimage component is connected to the input end of the universal view frame presentation frame;
step 6, after the WPF graphical interface framework is combined with the Direct2D module, the visualization of the current rendering of the power grid tidal current graph is realized by adopting the following steps:
step 6.1, the visual UI component is combined with the general view framework to convert the power grid tidal flow graph data structure into a power grid tidal flow graph, and the method specifically comprises the following steps:
the power grid equipment primitive UI control converts the description information of the power grid equipment primitive into a power grid equipment primitive graph;
the power grid equipment attribute UI control converts the description information of the power grid equipment attribute into a power grid equipment attribute graph;
the power grid equipment topological connection relation UI control converts the description information of the power grid equipment topological connection relation into a power grid equipment topological connection relation graph;
step 6.2, the visualization UI component sends the converted power grid tidal current graph to the rendering context component;
step 6.3, the rendering context component generates corresponding rendering parameters according to the power grid tidal current graph graphs, and sends the rendering parameters to the rendering instruction generating component;
wherein the rendering context component generates corresponding rendering parameters according to the power grid tidal flow graph, and the rendering parameters comprise:
the power grid equipment primitive rendering context subassembly generates power grid equipment primitive rendering parameters according to the power grid equipment primitive graph;
the power grid equipment attribute rendering context subassembly generates power grid equipment attribute rendering parameters according to the power grid equipment attribute graph;
the power grid equipment topological connection relation rendering context subassembly generates power grid equipment topological connection relation rendering parameters according to the power grid equipment topological connection relation graph;
step 6.4, the rendering instruction generation component interprets the rendering parameters as a Direct2D rendering instruction; the method comprises the following steps:
the power grid equipment primitive rendering instruction generation sub-component interprets the power grid equipment primitive rendering parameters as a rendering instruction of Direct2D to the power grid equipment primitive;
the power grid equipment attribute rendering instruction generates a sub-component, and the power grid equipment attribute rendering parameters are interpreted as rendering instructions of Direct2D for the power grid equipment attributes;
the power grid equipment topological connection relation rendering instruction generates a sub-component, and the power grid equipment topological connection relation rendering parameters are interpreted as rendering instructions of Direct2D on the power grid equipment topological connection relation;
step 6.5, the rendering instruction generating component stores the rendering instruction obtained by interpretation and sends the rendering instruction obtained by interpretation to Direct 2D;
6.6, receiving all rendering instructions of the power grid tidal current diagram to be rendered in batch for the Direct 2D; then, the Direct2D interprets the rendering instructions and assembles all the rendering instructions into one rendering instruction according to a rendering optimization algorithm;
then, the Direct2D calls a DirectX graphical interface rendering interface to render the picture content according to the assembled rendering instruction, and the rendered content is output to a D3Dimage component after the DirectX completes the picture rendering;
6.7, displaying the rendered content to a universal view frame presentationframe ork by the D3Dimage component, and finishing the display of the rendered picture;
step 7, judging whether the power grid tidal current diagram picture needs to be continuously displayed; if the power grid tidal current graph picture is closed, skipping to the step 9, and finishing rendering; if the power grid tidal current diagram picture is kept in an open state, executing the step 8;
step 8, returning to the step 2, judging whether the newly loaded power grid tidal current graph data file changes or not by the WPF graphical interface framework, if not, jumping to the step 6.5, sending the rendering instruction stored for the previous time to Direct2D by the rendering instruction generating component, and then executing the step 6.6-the step 7 to finish rendering once; the circulation is continuously carried out;
if the change occurs, the WPF graphical interface framework only loads the relevant power grid tidal current graph data files related to the change; then, through the steps 3-6.4, a rendering instruction which changes at this time is obtained; then, in step 6.5, the rendering instruction generating component sends the changed rendering instruction and the unchanged rendering instruction to Direct2D, and then executes steps 6.6 to 7 to complete the image rendering of the change and update of the primary power grid tidal current graph; the circulation is continuously carried out;
and 9, finishing rendering.
2. The method according to claim 1, wherein in step 4, the description information of the attributes of the power grid equipment includes name description information of the power grid equipment, relative position description information of the power grid equipment, and real-time load description information of the power grid equipment.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811620496.7A CN109739455B (en) | 2018-12-28 | 2018-12-28 | Power grid tidal current diagram visualization method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811620496.7A CN109739455B (en) | 2018-12-28 | 2018-12-28 | Power grid tidal current diagram visualization method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109739455A CN109739455A (en) | 2019-05-10 |
CN109739455B true CN109739455B (en) | 2021-09-21 |
Family
ID=66361782
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811620496.7A Active CN109739455B (en) | 2018-12-28 | 2018-12-28 | Power grid tidal current diagram visualization method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109739455B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108198231A (en) * | 2017-12-11 | 2018-06-22 | 厦门亿力吉奥信息科技有限公司 | Electric power GIS vector graphics real-time drawing method, storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
BRPI0818582A2 (en) * | 2007-10-20 | 2015-07-21 | Citrix Systems Inc | Methods and systems for remotely displaying three-dimensional graph data |
-
2018
- 2018-12-28 CN CN201811620496.7A patent/CN109739455B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108198231A (en) * | 2017-12-11 | 2018-06-22 | 厦门亿力吉奥信息科技有限公司 | Electric power GIS vector graphics real-time drawing method, storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109739455A (en) | 2019-05-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110989878B (en) | Animation display method and device in applet, electronic equipment and storage medium | |
US8108799B2 (en) | Remoting of windows presentation framework based applications in a non-composed desktop | |
CN107832108A (en) | Rendering intent, device and the electronic equipment of 3D canvas web page elements | |
JP4901261B2 (en) | Efficient remote display system with high-quality user interface | |
CN111193876B (en) | Method and device for adding special effect in video | |
JP2018512644A (en) | System and method for reducing memory bandwidth using low quality tiles | |
CN109671147B (en) | Texture map generation method and device based on three-dimensional model | |
JP5281660B2 (en) | Shader-based extension for declarative presentation framework | |
CN102122502A (en) | Method and related device for displaying three-dimensional (3D) font | |
CN107908608B (en) | Method, storage medium and device for converting and displaying manuscript in three-dimensional space | |
CN110555900B (en) | Rendering instruction processing method and device, storage medium and electronic equipment | |
CN111324381A (en) | Development system, development method, development apparatus, computer device, and storage medium | |
CN113268303A (en) | Interface element configuration method and device, storage medium and electronic equipment | |
CN111539905A (en) | Method, apparatus, device and storage medium for generating image | |
CN117390322A (en) | Virtual space construction method and device, electronic equipment and nonvolatile storage medium | |
CN103729190A (en) | Method for displaying unified parsing of multiple media on mobile terminal | |
CN109739455B (en) | Power grid tidal current diagram visualization method | |
KR102482874B1 (en) | Apparatus and Method of rendering | |
CN117828207A (en) | Page rendering method, page rendering device and computer readable storage medium | |
EP2992512B1 (en) | Anti-aliasing for geometries | |
CN107908393B (en) | Method for designing SCADA real-time model picture | |
CN115359145A (en) | Method and device for drawing process graphics primitives, storage medium and computer equipment | |
JP2015179350A (en) | Content converter and method and communication system | |
CN118170284B (en) | Window rendering method, device, equipment and medium | |
CN116560947A (en) | Customized monitoring visualization method and device |
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 |