System and method for drawing network diagram

文档序号:1004217 发布日期:2020-10-23 浏览:5次 中文

阅读说明:本技术 一种网络图的绘制系统及方法 (System and method for drawing network diagram ) 是由 李岩 程龙 解维奇 刘党辉 王�华 王建华 段永胜 王岩 于 2020-07-08 设计创作,主要内容包括:本申请公开了一种网络图的图形化交互式绘制方法,包括编辑与箭线对应的第一图形元素和与节点对应的第二图形元素;设计所述第一图形元素对应的第一面向对象类和所述第二图形元素对应的第二面向对象类;利用与所述第一面向对象类相关联的所述第一图形元素和与所述第二面向对象类相关的所述第二图形元素,以图形化方式绘制所述网络图。本申请通过编辑设计图形元素和与图形元素相对应面向对象类,使网络图绘制过程中,绘制者能通过对话框等形式及时获得过程信息或结果信息的反馈。并通过构建网络图结构模型,可自动确定箭线和节点图形元素的输入输出关系,自动实现网络图规范性判断、关键路径和时间参数计算的功能。(The application discloses a graphical interactive drawing method of a network graph, which comprises the steps of editing a first graphic element corresponding to an arrow line and a second graphic element corresponding to a node; designing a first object-oriented class corresponding to the first graphic element and a second object-oriented class corresponding to the second graphic element; graphically rendering the network graph with the first graphical element associated with the first object-facing class and the second graphical element associated with the second object-facing class. By editing and designing the graphic elements and the object-oriented classes corresponding to the graphic elements, a drawer can timely obtain feedback of process information or result information in a dialog box and other forms in the network diagram drawing process. And by constructing a network diagram structure model, the input-output relationship between the arrow line and the node graphic element can be automatically determined, and the functions of network diagram normative judgment and key path and time parameter calculation are automatically realized.)

1. A method for drawing a network diagram is characterized by comprising the following steps:

editing a first graphic element corresponding to an arrow line;

editing a second graphic element corresponding to the node;

designing a first object facing class corresponding to the first graphic element, wherein the first graphic element can call the first object facing class through an element attribute dialog box;

designing a second object-oriented class corresponding to the second graphic element, wherein the second graphic element can call the second object-oriented class through an element attribute dialog box;

and drawing the network graph in a graphical mode by using the first graphic element and the second graphic element.

2. The rendering method according to claim 1, further comprising:

and checking the drawn network diagram according to the drawing specification of the network diagram, and prompting the parts which do not meet the specification.

3. The rendering method according to claim 2, further comprising:

generating a structure model of the network graph which is drawn based on the connection relation between the arrow lines and the nodes, and performing normative check on the network graph by using a topological sorting and traversal algorithm according to the structure model, wherein the normative check comprises the following steps:

checking whether isolated nodes and/or isolated arrowlines exist in the network graph;

checking whether a loop exists in the network map;

checking whether an arrow line in the network graph is connected to the same node;

checking whether there is and only one starting point and one end point in the network graph;

checking whether only one arrow line exists between two nodes in the network graph;

and prompting the checking result by changing the color of the corresponding graphic element.

4. The rendering method according to claim 2, further comprising:

and calculating the key path of the network diagram and the time parameters of each process and the total process, and storing and displaying the calculation result.

5. The rendering method according to claim 4, characterized by comprising:

generating a topology number of the node in the network graph, and enabling the end point node number of the arrow line to be larger than the starting point node number;

calculating a key path and time parameters according to the topological sorting, wherein the arrow lines and the nodes on the key path are changed into thickened lines in the graph for displaying;

the calculated time parameters of the arrow line and the node are stored in the parameters of the corresponding object class, and can be viewed through the attribute dialog boxes of the arrow line and the node, and a calculation result report of the time parameters and the key path can also be generated for viewing;

wherein, the contents of the report form of the calculation result comprise: the system comprises a process sequence number, a process start-stop node number, a process name, process working hours, the earliest working time of the process, the latest working time of the process, the earliest completion time of the process, the latest completion time of the process, the total time difference and the single time difference of the process, and whether the process is a key process or a father process.

6. The rendering method according to claim 4, characterized by comprising:

setting the network graph as an 'x.cpm' file, and storing graphic elements in the network graph and structural relation and display state information among the elements;

the ". cpm" file is displayed using a multi-document structure template.

7. The rendering method according to any one of claims 1 to 6,

the first object-oriented class is used for representing and recording arrow line parameters and arrow line operating functions of the arrow line, wherein the arrow line parameters comprise: attribute character strings of start/end node variables of arrow lines, process names, responsible persons, operators, equipment and places, time parameters of process working hours, earliest start and completion time, latest start and completion time, and state display information of start point position, line type, color and thickness; the arrow line function includes: drawing an arrow line, setting and reading attributes, segmenting the arrow line, setting and reading a start point, a stop point and a middle point, moving, setting and judging the position of the arrow line, and serializing the access of the arrow line;

the second object-oriented class is used for representing and recording node parameters and node operation functions of the nodes, wherein the node parameters comprise: the method comprises the following steps that (1) an arrow line set of nodes, a node name attribute character string, a node ID, earliest and latest time parameters of node events, node positions, line types, colors and state display information of arrow line connection points are displayed; the node operation function includes: drawing nodes, setting and reading attributes, moving, setting and judging self positions, judging and recording arrow line connection positions, and accessing serialized operation functions by the nodes;

when the starting/ending node variable of the arrow line is connected with the node, the node class object connected with the starting point and the ending point of the arrow line is saved; when the arrow line of the node is connected with the node, the arrow line set of the node records the arrow line class object of the node to be input and output; when the connection between the arrow line and the node is disconnected, the start/end node variable of the arrow line and the corresponding parameter value stored or recorded by the arrow line set of the node are deleted simultaneously.

8. The method according to any one of claims 1 to 6, wherein the step of graphically rendering the network map using the first graphic element and the second graphic element comprises:

selecting a required pointer state in a pointer state dialog box through a mouse pointer, wherein the display state of the mouse pointer comprises the following steps: a normal state, a node drawing state and an arrow line drawing state;

under the normal state, the mouse pointer finishes normal functions of clicking and selecting the mouse;

in the node drawing state, a mouse pointer is displayed as the node drawing state, the node can be directly drawn in a drawing view area, and the drawn node can be dragged by a mouse to change the position and/or the shape of the node in the drawing view area;

in the arrow line drawing state, a mouse pointer is displayed in the arrow line drawing state, in a drawing view area, a mouse is clicked to draw an arrow line starting point, then the mouse pointer is dragged to the next point, the mouse is clicked to obtain arrow line segmentation points, the arrow line drawing action is repeated, a plurality of arrow line segmentation points can be obtained until double-click of the mouse finishes drawing of the arrow line terminal point, the drawn arrow line can be dragged by the mouse, and the position and/or the shape of the drawn arrow line in the drawing view area are/is changed;

wherein, the arrow line includes real arrow line and virtual arrow line, the arrow line drawing state includes real arrow line drawing state and virtual arrow line drawing state.

9. The rendering method according to claim 8, wherein in the node rendering state, after the node is rendered in the rendering view area, the node number is automatically incremented, and after the node is double-clicked by a mouse, a node attribute setting dialog box is popped up, so that parameter setting of the node can be performed.

10. The drawing method according to claim 8, wherein in the arrow-line drawing state, a process name and time are displayed above and below the arrow line, respectively; when the mouse pointer is positioned at the straight line part of the arrow line, a mouse key can be pressed to drag the arrow line to change the position of the arrow line; when the mouse pointer is positioned at the endpoint part of the segment point of the arrow line, a mouse key can be pressed to drag the endpoint of the segment point to adjust the shape of the arrow line; when the arrow line is selected by clicking the mouse key, the starting point and the end point of the arrow line are first graphic points with the first color, and the middle segmentation point is a second graphic point with the first color; when the arrow line is connected to the node, the start point and the end point of the connection become first and second graphic points of a second color; and when the arrow line is selected by double clicking the mouse key, popping up an arrow line attribute setting dialog box, and setting parameters of the arrow line.

11. The rendering method of any of claims 1-6, wherein the first object-oriented class is a CGraphLine class based on the VC + + programming language; the second object-oriented class is based on a VC + + programming language CGraphNode class.

12. A system for rendering a network diagram, comprising:

the graphic element editing unit is used for editing a first graphic element corresponding to the arrow line and a second graphic element corresponding to the node;

the object-oriented class design unit is used for designing a first object-oriented class corresponding to the first graphic element and a second object-oriented class corresponding to the second graphic element;

a network graph drawing unit to graphically draw the network graph using the first graphical element associated with the first object-facing class and the second graphical element associated with the second object-facing class.

13. The rendering system of claim 12, further comprising:

and the checking and prompting unit is used for checking the network diagram according to the drawing specification of the network diagram and prompting the part which does not meet the specification.

14. The rendering system of claim 13, further comprising:

and the calculating unit is used for calculating the key path of the network diagram and the time parameters of each process and the total process.

15. The rendering system of claim 14, further comprising:

and the storage and display unit is used for storing and displaying the calculation result.

Technical Field

The present application relates to the field of workflow design and management technologies, and in particular, to a system and a method for drawing a network graph for task implementation, planning and resource allocation.

Background

The design of workflow with network diagrams is an effective way for task management and optimization in many fields. The PERT plan Evaluation and Review Technique (Program Evaluation and Review Technique) is a Technique for planning and evaluating a plan by using network map analysis. The method can coordinate all the procedures of the whole plan, reasonably arrange manpower, material resources, time and fund and accelerate the completion of the plan. In terms of planning and analyzing means, PERT is widely used and is an important means and method for modern management. Currently, aoe (activity On Edge network) network graph (also called double-code network graph) is a common form of PERT analysis. It is a net-shaped graph formed by expressing various works to be completed by a plan and the sequence and the mutual relation thereof by using circles and directed arrow lines. As shown in fig. 1, in the AOE network graph, there are arrowed lines indicating the work, arrowed tails indicating the start of the work, and arrowed lines indicating the end of the work. The place where the arrow head and the arrow tail are connected is drawn with a circle and coded with numbers, and the numbers i-j of the arrow head and the arrow tail are used as the codes of the work.

Disclosure of Invention

Objects of the invention

In order to overcome the defects in the prior art, the technical problem to be solved by the application is to provide a method for drawing a network diagram, so as to realize graphical interactive drawing of the network diagram. The application further provides a system for drawing the network diagram.

(II) technical scheme

In one aspect, the present application provides a method for drawing a network diagram, including:

editing a first graphic element corresponding to an arrow line;

editing a second graphic element corresponding to the node;

designing a first object facing class corresponding to the first graphic element, wherein the first graphic element can call the first object facing class through an element attribute dialog box;

designing a second object-oriented class corresponding to the second graphic element, wherein the second graphic element can call the second object-oriented class through an element attribute dialog box;

and drawing the network graph in a graphical mode by using the first graphic element and the second graphic element.

Further, the method also comprises the steps of checking the drawn network diagram according to the drawing specification of the network diagram and prompting the parts which do not meet the specification.

Further, the method comprises the following steps:

generating a structure model of the network graph which is drawn based on the connection relation between the arrow lines and the nodes, and carrying out normative inspection on the network graph by using a topological sorting and traversal algorithm according to the structure model, wherein the method comprises the following steps:

checking whether isolated nodes and/or isolated arrowlines exist in the network graph;

checking whether a loop exists in the network map;

checking whether an arrow line in the network graph is connected to the same node;

checking whether there is and only one starting point and one end point in the network graph;

checking whether only one arrow line exists between two nodes in the network graph;

and prompting the checking result by changing the color of the corresponding graphic element.

Further, calculating the key path of the network diagram and the time parameters of each process and the total process, and storing and displaying the calculation result.

Further, the method comprises the following steps:

generating a topology number of the node in the network graph, and enabling a terminal node number of the arrow line to be larger than a starting node number;

calculating a key path and time parameters according to the topological sorting, wherein the arrow line and the node on the key path are displayed as bold lines in the graph;

the calculated time parameters of the arrow line and the node are stored in the parameters of the corresponding object class, and can be viewed through the attribute dialog boxes of the arrow line and the node, and a calculation result report of the time parameters and the key path can also be generated for viewing;

wherein, the contents of the report form of the calculation result comprise: the system comprises a process sequence number, a process starting and stopping node number, a process name, process working hours, the earliest working time of the process, the latest working time of the process, the earliest completion time of the process, the latest completion time of the process, total time difference and single time difference of the process, and whether the process is a key process or not and whether the process is a father process or not.

Further, the method comprises the following steps:

setting the network graph as an 'x.cpm' file, and storing the structural relationship and display state information between graphic elements and elements in the network graph;

the ". cpm" file is displayed using a multi-document structure template.

Further, the first object-oriented class is used for representing and recording arrow line parameters and arrow line operation functions of the arrow line, wherein the arrow line parameters include: attribute character strings of start/end node variables, process names, responsible persons, operators, equipment and places of the arrowed lines, time parameters of process working hours, earliest start and completion time, latest start and completion time, and state display information of start point positions, line types, colors and thicknesses; the arrow line function includes: drawing an arrow line, setting and reading attributes, segmenting the arrow line, setting and reading a start point, a stop point and a middle point, moving, setting and judging the position of the arrow line, and serializing the access of the arrow line;

the second object-oriented class is used for representing and recording node parameters and node operation functions of the nodes, wherein the node parameters comprise: the method comprises the steps of collecting an arrow line of a node, a node name attribute character string, a node ID, earliest and latest time parameters of a node event, and state display information of a node position, a line type, a color and an arrow line connecting point; the node operation function includes: drawing nodes, setting and reading attributes, moving, setting and judging self positions, judging and recording arrow line connection positions, and accessing serialized operation functions by the nodes;

when the starting/ending node variable of the arrow line is connected with the node, the node class object connected with the starting point and the ending point of the arrow line is saved; the set of the arrow lines of the node records the arrow line type objects of the input and output nodes when the arrow lines are connected with the node; when the connection between the arrow line and the node is disconnected, the start/end node variable of the arrow line and the corresponding parameter value stored or recorded by the arrow line set of the node are deleted simultaneously.

Further, the process of graphically drawing the network graph by using the first graphic element and the second graphic element includes:

selecting a required pointer state in a pointer state dialog box through a mouse pointer, wherein the display state of the mouse pointer comprises the following steps: a normal state, a node drawing state and an arrow line drawing state;

under the normal state, the mouse pointer finishes normal functions of clicking and selecting the mouse;

in the node drawing state, a mouse pointer is displayed as the node drawing state, the node can be directly drawn in a drawing view area, and the drawn node can be dragged by a mouse to change the position and/or the shape of the node in the drawing view area;

in the arrow line drawing state, a mouse pointer is displayed in the arrow line drawing state, in a drawing view area, a mouse is clicked to draw an arrow line starting point, then the mouse pointer is dragged to the next point, the mouse is clicked to obtain arrow line segmentation points, the arrow line drawing action is repeated, a plurality of arrow line segmentation points can be obtained until double-click of the mouse finishes drawing of the arrow line terminal point, the drawn arrow line can be dragged by the mouse, and the position and/or the shape of the arrow line in the drawing view area are/is changed;

wherein, the arrow line includes real arrow line and virtual arrow line, the arrow line drawing state includes real arrow line drawing state and virtual arrow line drawing state.

Further, in the node drawing state, after the node is drawn in the drawing view area, the node number is automatically increased in an increasing manner, and after the node is double-clicked by a mouse, a node attribute setting dialog box is popped up, so that the parameter setting of the node can be performed.

Further, in the arrow line drawing state, the process name and the time are respectively displayed above and below the arrow line; when the mouse pointer is positioned at the straight line part of the arrow line, a mouse key can be pressed to drag the arrow line to change the position of the arrow line; when the mouse pointer is positioned at the endpoint part of the segment point of the arrow line, a mouse key can be pressed to drag the endpoint of the segment point to adjust the shape of the arrow line; when the arrow line is selected by clicking a mouse key, the starting point and the end point of the arrow line are first graphic points with a first color, and the middle segmentation point is a second graphic point with the first color; when the arrow line is connected to the node, the start point and the end point of the connection become first and second graphic points of a second color; and when the arrow line is selected by double clicking the mouse key, popping up an arrow line attribute setting dialog box, and setting parameters of the arrow line.

Further, the first object-oriented class is a CGraphLine class based on the VC + + programming language; the second object-oriented class is based on a VC + + programming language CGraphNode class.

In another aspect, the present application provides a system for drawing a network diagram, including:

a graphic element editing unit for editing a first graphic element corresponding to an arrow line and a second graphic element corresponding to a node;

the object-oriented class design unit is used for designing a first object-oriented class corresponding to the first graphic element and a second object-oriented class corresponding to the second graphic element;

a network graph drawing unit to graphically draw the network graph using the first graphical element associated with the first object-facing class and the second graphical element associated with the second object-facing class.

Further, the method also comprises the following steps:

and the inspection prompting unit is used for inspecting the network diagram according to the drawing specification of the network diagram and prompting the part which does not meet the specification.

Further, the method also comprises the following steps:

and the calculating unit is used for calculating the key path of the network diagram and the time parameters of each process and the total process.

Further, the method also comprises the following steps:

and the storage and display unit is used for storing and displaying the calculation result.

According to the drawing method and the drawing system, the corresponding object-oriented class of the graphic elements is designed by editing the graphic elements of the arrow lines and the nodes, and the drawing of the network graph is completed in a graphic mode through an interactive drawing process by utilizing the graphic elements associated with the object class. The interaction means that when the user clicks the graphic element through a mouse in the process of drawing the network diagram, the system can timely feed back process information or result information to the user through a dialog box and the like.

(III) advantageous effects

The technical scheme of the application has the following beneficial technical effects:

1. by editing and designing the graphic elements and the object-oriented classes corresponding to the graphic elements, a drawer can timely obtain feedback of process information or result information in a dialog box or other forms in the network diagram drawing process.

2. By constructing a network diagram structure model, the input-output relationship between the arrow line and the node graphic element can be automatically determined, and the functions of network diagram normative judgment and key path and time parameter calculation are automatically realized.

3. By adopting an object-oriented and graphical man-machine interaction mode, a visual and flexible network diagram drawing method is provided, so that the arrow lines can be segmented and the direction can be changed as required, the process content and time display position and mode can be flexibly set, the nodes can automatically complete topology numbering, and a user can conveniently optimize the design of the network diagram at any time.

4. By providing the basic functions of the object-oriented class of the graphic elements such as the arrow lines and the nodes of the network diagram, the drawing system has the characteristic of universality and can be widely applied to the design, drawing and research of the network diagram in multiple fields.

Drawings

FIG. 1 is a diagram of a prior art network diagram;

FIG. 2 is a schematic flow chart of a rendering method described herein;

FIG. 3 is a schematic flow chart of a rendering method based on FIG. 2;

FIG. 4 is a schematic flow chart of a rendering method based on FIG. 3;

FIG. 5 is a diagram illustrating an example of mouse status selectable styles of a menu bar and a toolbar in the rendering method according to the present application;

FIG. 6 is an exemplary graph of nodes and cursors in a node rendering state according to the present application;

FIG. 7 is an exemplary diagram of a property setting dialog of a node according to the present application;

FIG. 8 is an exemplary diagram of solid arrow lines and a cursor in a solid arrow line drawing state according to the present application;

fig. 9 is an exemplary diagram of a dashed arrow and a cursor in a dashed arrow drawing state according to the present application;

FIG. 10 is an exemplary illustration of an arrow line and node connection described herein;

FIG. 11 is an exemplary diagram of an arrowed property setting dialog described herein;

FIG. 12 is a diagram illustrating a network diagram according to the present application;

FIG. 13 is an exemplary illustration of a review prompt as described herein;

FIG. 14 is a diagram illustrating an example of a calculation result of a time parameter of a network diagram according to the present application;

FIG. 15 is a diagram illustrating an example of storing a network map file according to the present application;

FIG. 16 is a diagram illustrating an example of a network map file comparison analysis according to the present application;

FIG. 17 is a diagram illustrating creation of a node in another embodiment of the rendering method of the present application;

FIG. 18 is a diagram illustrating an example of the connection of node arrows in a further embodiment of the rendering method of the present application;

FIG. 19 is a diagram illustrating a network map parameter report in another embodiment of the drawing method of the present application;

fig. 20 is a block diagram of a rendering system according to the present application.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is further described in detail below with reference to the accompanying drawings in combination with the detailed description. It should be understood that the description is intended to be exemplary only, and is not intended to limit the scope of the present application. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present application.

It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

In the description of the present application, it is noted that the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.

In addition, the technical features mentioned in the different embodiments of the present application described below may be combined with each other as long as they do not conflict with each other.

The present application will be described in more detail below with reference to the accompanying drawings.

Fig. 2 is a schematic flow chart of the drawing method described in the present application.

As shown in fig. 2, a method for drawing a network diagram includes:

s110: editing a first graphic element corresponding to an arrow line;

s120: editing a second graphic element corresponding to the node;

s130: designing a first object facing class corresponding to the first graphic element, wherein the first graphic element can call the first object facing class through an element attribute dialog box;

s140: designing a second object-oriented class corresponding to the second graphic element, wherein the second graphic element can call the second object-oriented class through an element attribute dialog box;

s150: and drawing the network graph in a graphical mode by using the first graphic element and the second graphic element.

In step 110-. A first graphic element and a second graphic element which respectively correspond to an arrow line and a node are edited and manufactured through word or other graphic editing software. Referring to fig. 8 and 9, since the arrow lines generally include a solid arrow line and a dotted arrow line, the first graphic element may further include: a first graphic element corresponding to a solid arrow line, as in fig. 8; and a first graphic element corresponding to the dotted arrow line, as shown in fig. 9.

Step 130, 140 designs a first object-oriented class corresponding to the first graphic element and a second object-oriented class corresponding to the second graphic element. The first graphic element may invoke the first object-oriented class through an element attribute dialog, and the second graphic element may invoke the second object-oriented class through an element attribute dialog.

The first object-oriented class is used for representing and recording arrow line parameters and arrow line operating functions of the arrow line, wherein the arrow line parameters comprise: attribute character strings of start/end node variables, process names, responsible persons, operators, equipment and places of the arrowed lines, time parameters of process working hours, earliest start time and completion time, latest start time and completion time, and state display information of start point positions, line types, colors and thicknesses; the arrow line function includes: drawing an arrow line, setting and reading attributes, segmenting the arrow line, setting and reading start points and intermediate points, moving, setting and judging the position of the arrow line, and serializing the access of the arrow line;

the second object-oriented class is used for representing and recording node parameters and node operation functions of the nodes, wherein the node parameters comprise: the method comprises the steps of collecting an arrow line of a node, a node name attribute character string, a node ID, earliest and latest time parameters of a node event, and state display information of a node position, a line type, a color and an arrow line connecting point; the node operation function includes: drawing nodes, setting and reading attributes, moving, setting and judging self positions, judging and recording arrow line connection positions, and accessing serialized operation functions by the nodes;

when the starting/ending node variable of the arrow line is connected with the node, the node class object connected with the starting point and the ending point of the arrow line is saved; the set of the arrow lines of the node records the arrow line type objects of the input and output nodes when the arrow lines are connected with the node; when the connection between the arrow line and the node is disconnected, the start/end node variable of the arrow line and the corresponding parameter value stored or recorded by the arrow line set of the node are deleted simultaneously.

Further, in this embodiment, the first object-oriented class is a CGraphLine class based on the VC + + programming language; the second object-oriented class is based on a VC + + programming language CGraphNode class.

It is understood that the object-oriented class design can also be implemented by other computer languages, such as arrow line PLine class and node JNode class designed by Java language, and arrow line PLine class and node PNode class designed by Python language.

In step S150, the process of using the first graphic element and the second graphic element to graphically draw the network diagram includes:

selecting a required pointer state in a pointer state dialog box through a mouse pointer, as shown in fig. 5, the display state of the mouse pointer includes: a normal state, a node drawing state and an arrow line drawing state;

under the normal state, the mouse pointer finishes normal functions of clicking and selecting the mouse;

in the node drawing state, referring to fig. 6, the mouse pointer is displayed as the node drawing state, as shown in fig. 6 b; the node can be directly drawn in the drawing view area, as shown in fig. 6a, the node after being drawn can be dragged by a mouse, and the position and/or the shape of the node in the drawing view area can be changed;

in the arrow line drawing state, referring to fig. 8 and 9, a mouse pointer is displayed in the arrow line drawing state, in a drawing view area, a mouse is clicked to draw an arrow line starting point, then the mouse pointer is dragged to the next point, the mouse is clicked to obtain arrow line segmentation points, the arrow line drawing action is repeated to obtain a plurality of arrow line segmentation points until the double-click mouse finishes drawing the arrow line terminal point, and the drawn arrow line can be dragged by the mouse to change the position and/or the shape of the drawn arrow line in the drawing view area;

as shown in fig. 8 and 9, the arrow drawing state includes a solid arrow drawing state, as shown in fig. 8 b; and a dashed arrow line drawing state, as in fig. 9 b; solid and dashed arrows are drawn as shown in fig. 8a and 9a, respectively.

In this step, in the node drawing state, as shown in fig. 6a, after the node is drawn in the drawing view area, the node number is automatically incremented, as shown by 20 in the circle in fig. 6a, which is the number of the node after being automatically incremented. After double-clicking the node by the mouse, a node attribute setting dialog box pops up, and as shown in fig. 7, parameter setting of the node can be performed.

In this step, further, in the arrow line drawing state, the process name and the time are respectively displayed above and below the arrow line, as shown in fig. 8 a; when the mouse pointer is positioned at the straight line part of the arrow line, a mouse key can be pressed to drag the arrow line to change the position of the arrow line; when the mouse pointer is positioned at the end point of the segment point of the arrow line, a mouse key can be pressed to drag the end point of the segment point to adjust the shape of the arrow line; when the mouse is clicked to select the arrow line, the starting point and the end point of the mouse are first graphic points with the first color, and the middle segmentation point is a second graphic point with the first color, as shown in fig. 8; when the arrow line is connected to the node, the start point and the end point of the connection become the first and second graphic points of the second color, as shown in fig. 10; as shown in fig. 8 and 10, the first color is optionally green, the second color is optionally red, the first graphic point is optionally a circular point, and the second circular point is optionally a square point. As shown in fig. 11, when the arrow line is selected by double-clicking the mouse key, an arrow line attribute setting dialog box pops up, and parameter setting of the arrow line can be performed.

FIG. 3 is a schematic flow chart of a rendering method based on FIG. 2;

FIG. 12 is a diagram illustrating a network diagram according to the present application;

FIG. 13 is an exemplary illustration of a review prompt as described herein;

as shown in fig. 3, 12 and 13, the rendering method further includes:

s160: and checking the drawn network diagram according to the drawing specification of the network diagram, and prompting the parts which do not meet the specification.

Fig. 13 is a diagram illustrating an example of the inspection prompt according to the present application.

The step S160 of checking the drawn network diagram according to the drawing specification of the network diagram, and prompting a part of the network diagram which does not meet the specification includes:

generating a structure model of the network graph which is drawn based on the connection relation between the arrow lines and the nodes, and carrying out normative inspection on the network graph by using a topological sorting and traversal algorithm according to the structure model, wherein the method comprises the following steps:

checking whether isolated nodes and/or isolated arrowlines exist in the network graph;

checking whether a loop exists in the network map;

checking whether an arrow line in the network graph is connected to the same node;

checking whether there is and only one starting point and one end point in the network graph;

checking whether only one arrow line exists between two nodes in the network graph;

and prompting the checking result by changing the color of the corresponding graphic element.

When the connection relationship between any one of the arrow lines and the nodes or between the arrow lines and the nodes in the network graph does not meet the above specification, as a prompt, as shown in fig. 13, the color of the corresponding graphic element is automatically changed.

Fig. 4 is a schematic flow chart of the drawing method based on fig. 3.

Fig. 14 is an exemplary diagram of a calculation result of a network diagram time parameter according to the present application.

As shown in fig. 4 and 14, the drawing method further includes:

s170: and calculating the key path of the network diagram and the time parameters of each process and the total process, and storing and displaying the calculation result.

The process of calculating the key path of the network diagram, and the time parameters of each process and the total process therein, and storing and displaying the calculation result in step S170 includes:

s171: generating a topology number of the node in the network graph, and enabling the end node number of the arrow line to be larger than the starting node number;

s172: calculating a key path and time parameters according to the topological sorting, wherein the arrow lines and the nodes on the key path are changed into thickened lines in the graph for displaying;

s173: the calculated time parameters of the arrow lines and the nodes are stored in the parameters of the corresponding object classes and can be checked through the attribute dialog boxes of the arrow lines and the nodes, and a report form of the calculation results of the time parameters and the key paths can also be generated for checking;

wherein, the contents of the report form of the calculation result comprise: the system comprises a process sequence number, a process starting and stopping node number, a process name, process working hours, the earliest working time of the process, the latest working time of the process, the earliest completion time of the process, the latest completion time of the process, total time difference and single time difference of the process, and whether the process is a key process or not and whether the process is a father process or not.

During calculation, the node topology number in the network graph can be automatically generated, the end point node number of the arrow line is larger than the start point node number, and the calculation of the key path and the time parameter is carried out according to the topology sequence, wherein the calculation step comprises the following steps:

setting parameters:

earliest time e (i) when the arrow line process starts;

the latest time l (i) when the arrow line process starts;

the process of e (i) ═ l (i) is a key process;

the earliest time at which a node event starts ve (i);

the latest time at which the node event starts vl (i);

assuming that the arrowed line process ai is represented by < j, k > (i.e., from vertex j to k) and the duration thereof is given by dut (< j, k >;), then:

e(i)=ve(j)

l(i)=vl(k)-dut(<j,k>)

solving ve (i) and vl (j) in two steps:

1) forward recursion starting at ve (j) ═ 0

ve(j)=Max{ve(i)+dut(<i,j>)}

<i,j>∈T,2<=j<=n

Where T is the set of all arrowed lines starting at j.

2) Backward recursion starting from vl (n) ═ ve (n)

vl(i)=Min{vl(j)-dut(<i,j>)}

<i,j>∈S,1<=i<=n-1

Where S is the set of all arrowed lines ending with i.

Solving a critical path:

according to the values of ve and vl of each vertex, the earliest starting time e(s) and the latest starting time l(s) of each arrow line (activity) are obtained, wherein the critical process is that e(s) ═ l(s). The arrow lines and nodes on the critical path are shown as bold lines in the graph. And the calculated time parameters of each node and each arrow line are stored into the parameters of the corresponding object class, and the time parameters can be checked through the node and arrow line attribute dialog boxes and can also be checked by generating a report.

The time parameter and the calculation result of the critical path generate the following report:

technological process case parameter table (total man-hour as 12.00)

Figure BDA0002575789990000131

Fig. 15 is a diagram illustrating an example of saving a network map file according to the present application.

FIG. 16 is a diagram illustrating an example of a network map file comparison analysis according to the present application;

as shown in fig. 15, further, the network map is set as an ". cnpm" file, and the graphic elements in the network map and the structural relationship between the elements and the display state information are stored;

the ". cpm" file is displayed using a multi-document structure template.

The ". cpm" file is displayed by using a multi-document structure template, as shown in fig. 16, which is mainly used for conveniently comparing and modifying a plurality of network map files at the same time.

Further examples:

in order to further describe the above embodiment, the network diagram of the preparation workflow before the automatic ship sails is taken as an example, and the drawing method of the embodiment will be further described.

(1) Designing the object-oriented CGraphLine class and the CGraphNode class of the arrow line and the node by using VC + + through a design unit for the object class;

(2) and drawing nodes and arrow lines by using a network graph drawing unit in a graphical interaction mode.

1) A node is created.

Exe opens the program file HTCPM, creates a new task, clicks a right mouse button to pop up a shortcut menu to select a node, creates two nodes 1 and 2 in a blank space as shown in FIG. 5, and clicks the right mouse button to select a normal node, and then ends the node creation.

2) An arrow line procedure is created.

Clicking a right button, clicking a 'solid arrow line' creating process in a shortcut menu, double clicking a left mouse button in the process to pop up a process attribute setting window, and as shown in fig. 11, setting items such as working hours, process names, display positions and the like. And the process creation can be finished by clicking the right mouse button to select 'normal'.

3) Connecting the nodes and the arrow lines.

And selecting two endpoints of the arrow line, dragging the two endpoints to the connecting points of the nodes respectively for connection, wherein the red change of the endpoints of the arrow line indicates the success of the connection. As shown in fig. 18. The positions of the nodes and the working procedures can be adjusted to make the flow chart more beautiful.

(3) The network diagram is drawn, and the normative judgment is shown in fig. 12 and 13.

And finishing flow chart drawing according to the steps of the embodiment, performing network chart normative check, and giving a prompt and marking an error position by the system when an unconnected process or other non-normative phenomena occur.

(4) Network graph critical path and time parameter calculation, as shown in fig. 14.

After the network graph is drawn, clicking 'AOE time parameter calculation' subordinate to a 'calculation' menu bar, and if the network graph is not standard, automatically prompting by a system, as shown in FIG. 13; if the network map is in compliance, the time parameter calculation is automatically performed, and a key route, i.e., a path represented by a thick line, is displayed in the original network map, as shown in fig. 14. And the calculated time parameters of each node and each arrow line are stored in the parameters of the corresponding object class, and the time parameters can be checked through the node and arrow line attribute dialog boxes and can also be checked by generating a report.

(5) And storing the network map file to generate a word report, as shown in fig. 15.

And selecting a saving path in the dialog box shown in the figure, and storing the network graph file by taking cpm as an extension name, so as to facilitate calling, comparison and optimization. Selecting the function of generating word report forms, the report forms can be generated in the specified path, and the network diagram overall view and the process parameter calculation result are shown as shown in fig. 19.

Another embodiment

As shown in fig. 20, a graphical interactive drawing system of a network diagram includes:

a network diagram graphic element editing unit 201 for editing a first graphic element corresponding to an arrow line and a second graphic element corresponding to a node;

a network diagram graphic element object-oriented class design unit 202, configured to design a first object-oriented class corresponding to the first graphic element and a second object-oriented class corresponding to the second graphic element;

a network graph drawing unit 203, which draws the network graph in a graphical manner by using the first graphic element associated with the first object-facing class and the second graphic element associated with the second object-facing class.

Further, a checking and prompting unit 204 is included, configured to check the network diagram according to the drawing specification of the network diagram, and prompt a part of the network diagram which does not meet the specification.

Further, a calculating unit 205 is included for calculating the critical path of the network diagram, and the time parameter of each process and the total process therein.

Further, a saving and displaying unit 206 is included for saving and displaying the calculation result.

It should be understood that the above examples are only for clarity of illustration and are not intended to limit the embodiments. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. All embodiments need not be, and cannot be, given poor exemplification here. And obvious variations or modifications therefrom are within the scope of the invention.

28页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:流程图自动化描述方法和装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!