A method for connecting a model-based development programming tool
By determining the connection type and scheduling the connection algorithm in graphical modeling software, the problem of complex connections in graphical modeling software development is solved, realizing a simple and easy-to-use intelligent connection method, and improving the usability of the tool and programming efficiency.
Patent Information
- Application Number
- CN202311577789.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-23
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2043-11-23
AI Technical Summary
In the existing technology, the connection methods in the development of graphical modeling software are complex, making it difficult to achieve simplicity, ease of use and powerful functions, resulting in a high threshold for programming design.
The model-based programming tool obtains the target pin position, determines the connection type as L-shaped, reverse L-shaped, S-shaped, or reverse S-shaped, and schedules pre-deployed connection algorithms for intelligent connection, supporting line position editing and human-computer interaction adjustment.
It enables intelligent connection under different icon layouts, improves tool usability and programming efficiency, makes the connection between algorithm icons reasonable and clear, and reduces the difficulty of programming design.
Smart Images

Figure CN117369794B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of nuclear power plant instrument control software, in particular to a connection method based on model development programming tool. BACKGROUND
[0002] The development of nuclear power plant instrument control engineering application software generally uses graphical design method, and a program such as C can be obtained by compiling the model through a code generation tool. Therefore, a tool is needed to enable the user to interact with the graphical representation of the model, and then realize the graphical modeling method. The current popular programming method is based on text, mainly using a certain recognized programming language to model the system. In recent years, people have begun to realize that visualizing the software development method can greatly improve the software development efficiency. In many cases, the graphical representation is clearer, more intuitive, and closer to the actual demand. Through the graphical representation, the correlation, data flow and other information between them can be observed intuitively. However, such intuitive understanding cannot be achieved through text. The visual representation method has become the development trend of software development methodology, such as UML. The advantage of the visual system is that it can map the dry programming language syntax to the relationship between graphical objects, so that general technical personnel can understand the system without understanding the language syntax. To some extent, the threshold of programming design is reduced.
[0003] The present application only cares about the content related to the development of graphical modeling software, and does not include the conversion rules of graphics and text. For the development of graphical modeling software, many available programming frameworks can be used, such as QT, Eclipse, etc. Even if a general programming framework is used, we still need to solve the usability problem of the software. How to realize a simple, easy-to-use and powerful modeling software still requires developers to invest a lot of energy and creativity. The present application proposes an easy-to-use and feasible connection method for the connection requirement in the graphical modeling process. SUMMARY
[0004] The present application aims to provide a connection method based on model development programming tool, which solves the technical problems existing in the prior art.
[0005] The present application is realized by the following technical scheme:
[0006] A connection method based on model development programming tool, comprising:
[0007] Based on the model development programming tool, the first target pin position of the first target connection symbol and the second target pin position of the second target connection symbol are obtained; the first target pin position represents the starting position, and the second target pin position represents the ending position;
[0008] determine a connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol based on the first target pin position and the second target pin position, wherein the connection type comprises an L type, an inverse L type, an S type, and an inverse S type;
[0009] schedule a pre-deployed connection algorithm to connect the first target pin and the second target pin according to the connection type between the first target pin and the second target pin of the second target connection symbol, to complete a connection process.
[0010] In a possible implementation, the determining of the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol based on the first target pin position and the second target pin position comprises:
[0011] extract an X-axis coordinate in the first target pin position as x1, and extract an X-axis coordinate in the second target pin position as x2;
[0012] determine the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol as an S type or an inverse S type if the X-axis coordinate x1 in the first target pin position is greater than or equal to the X-axis coordinate x2 in the second target pin position, or determine the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol as an L type or an inverse L type if the X-axis coordinate x1 in the first target pin position is less than the X-axis coordinate x2 in the second target pin position.
[0013] In a possible implementation, the scheduling of the pre-deployed connection algorithm to connect the first target pin and the second target pin according to the connection type between the first target pin and the second target pin of the second target connection symbol comprises:
[0014] when the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is an L type or an inverse L type, schedule a first connection algorithm to connect the first target pin and the second target pin;
[0015] when the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is an S type or an inverse S type, schedule a second connection algorithm to connect the first target pin and the second target pin.
[0016] In a possible implementation, the first connection algorithm comprises:
[0017] determine six base points as a first base point P1, a second base point P2, a third base point P3, a fourth base point P4, a fifth base point P5, and a sixth base point P6;
[0018] determining the position of the first base point P1 as the first target pin position (x1, y1) of the first target connection symbol and the position of the second base point P2 as the second target pin position (x2, y2) of the second target connection symbol;
[0019] determining the position of the third base point P3 as ((x1+x2) / 2, y1) and the position of the fourth base point P4 as ((x1+x2) / 2, y2);
[0020] connecting the first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5 and the sixth base point P6 in sequence to complete the connection.
[0021] In a possible implementation, the second connection algorithm comprises:
[0022] determining six base points as the first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5 and the sixth base point P6;
[0023] determining the position of the first base point P1 as the first target pin position (x1, y1) of the first target connection symbol and the position of the sixth base point P6 as the second target pin position (x2, y2) of the second target connection symbol;
[0024] determining the position of the second base point P2 as (x1+m, y1), the position of the third base point P3 as (x1+m, (y1+y2) / 2), the position of the fourth base point P4 as (x2-m, (y1+y2) / 2), and the position of the fifth base point P5 as (x2-m, y1); wherein m represents a preset position offset;
[0025] connecting the first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5 and the sixth base point P6 in sequence to complete the connection.
[0026] In a possible implementation, according to the connection type between the first target pin and the second target pin of the second target connection symbol, after the first target pin and the second target pin are connected by the pre-deployed connection algorithm, the method further comprises:
[0027] When the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is L type or inverse L type, a first adjustment instruction of the first target pin position and / or the second target pin position generated by the human-computer interaction is accepted, and the first target pin position and / or the second target pin position is adjusted according to the first adjustment instruction, while the first base point P1 changes following the first target pin position and / or the sixth base point P6 changes following the second target pin position, and the positions of the remaining base points change following the first base point P1;
[0028] When the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is L type or inverse L type, a second adjustment instruction input by the human-computer interaction is accepted, and the horizontal coordinates of the third base point P3 and / or the fourth base point P4 change according to the second adjustment instruction;
[0029] When the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is S type or inverse S type, a third adjustment instruction of the first target pin position generated by the human-computer interaction is accepted, and the first target pin position is adjusted according to the third adjustment instruction, while the first base point P1 changes following the first target pin position, and the positions of the remaining base points change following the first base point P1;
[0030] When the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is S type or inverse S type, a fourth adjustment instruction input by the human-computer interaction is accepted, and the horizontal coordinates of the second base point P2 and / or the fifth base point P5 change according to the fourth adjustment instruction, and the third base point P3 and the fourth base point P4 change following;
[0031] When the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is S type or inverse S type, a fifth adjustment instruction input by the human-computer interaction is accepted, and the third base point P3 and / or the fourth base point P4 change according to the fifth adjustment instruction, and the second base point P2 and the fifth base point P5 change following.
[0032] In a possible implementation, after the first target pin and the second target pin are connected by the pre-deployed connection algorithm according to the connection type between the first target pin and the second target pin of the second target connection symbol, the method further includes:
[0033] The first target pin position and / or the second target pin position is detected in real time whether to change, if yes, the X-axis coordinate in the first target pin position is extracted as x1, and the X-axis coordinate in the second target pin position is extracted as x2, otherwise, the monitoring is continued;
[0034] determining that the connection type between the first target pin of the first target connection diagram symbol and the second target pin of the second target connection diagram symbol is S type or reverse S type if the X-axis coordinate x1 in the first target pin position is greater than or equal to the X-axis coordinate x2 in the second target pin position, or otherwise determining that the connection type between the first target pin of the first target connection diagram symbol and the second target pin of the second target connection diagram symbol is L type or reverse L type.
[0035] In a possible implementation, the first connection algorithm comprises:
[0036] obtaining the total number n of pins of the first target connection diagram symbol and the pin index i of the first target pin, and determining six base points as a first base point P1, a second base point P2, a third base point P3, a fourth base point P4, a fifth base point P5, and a sixth base point P6;
[0037] determining the positions of the first base point P1 and the second base point P2 as a first target pin position (x1, y1) of the first target connection diagram symbol, and determining the positions of the fifth base point P5 and the sixth base point P6 as a second target pin position (x2, y2) of the second target connection diagram symbol;
[0038] determining the position of the third base point P3 as ((x1+x2)*(0.3+(0.4*i) / (n+1)), y1), and determining the position of the fourth base point P4 as ((x1+x2)*(0.3+(0.4*i) / (n+1)), y2);
[0039] connecting the first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5, and the sixth base point P6 in sequence to complete the connection.
[0040] In a possible implementation, the second connection algorithm comprises:
[0041] obtaining the total number n of pins of the first target connection diagram symbol and the pin index i of the first target pin, and determining six base points as a first base point P1, a second base point P2, a third base point P3, a fourth base point P4, a fifth base point P5, and a sixth base point P6;
[0042] determining the position of the first base point P1 as a first target pin position (x1, y1) of the first target connection diagram symbol, and determining the position of the sixth base point P6 as a second target pin position (x2, y2) of the second target connection diagram symbol;
[0043] determining the position of the second base point P2 as (x1+m(1+f*i), y1), determining the position of the third base point P3 as (x1+m(1+f*i), (y1+y2) / 2), determining the position of the fourth base point P4 as (x2-m(1+f*i), (y1+y2) / 2), and determining the position of the fifth base point P5 as (x2-m(1+f*i), y1); wherein m represents a preset position offset, and f represents a tab coefficient;
[0044] The first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5, and the sixth base point P6 are sequentially connected, and the connection is completed.
[0045] In a possible implementation, the method further includes:
[0046] The free fold line mode is provided for the staff, and in the free fold line mode, a plurality of continuous control points input by the user through human-computer interaction are accepted;
[0047] For any two adjacent control points, the A mode, the B mode, the C mode, or the D mode is used for connection.
[0048] The A mode is a horizontal right-angle connection, the B mode is a vertical right-angle connection, the C mode is a horizontal connection, and the D mode is a vertical connection.
[0049] The model development programming tool-based connection method provided by the application determines the connection type based on the start position and the end position, finally schedules the pre-deployed connection algorithm based on the connection type to perform connection, can realize intelligent connection under different graph symbol layouts, supports line position editing and other functions, makes the connection between algorithm graph symbols as reasonable and clear as possible, and effectively improves tool usability. BRIEF DESCRIPTION OF DRAWINGS
[0050] In order to more clearly illustrate the technical solutions of the example embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the application, and therefore should not be considered as limiting the scope. For those skilled in the art, other related drawings can also be obtained without creative labor. In the drawings:
[0051] Figure 1 The flow chart of the model development programming tool-based connection method provided by the embodiment of the application.
[0052] Figure 2 The schematic diagram of the connection type provided by the embodiment of the application.
[0053] Figure 3 (a) The schematic diagram of the first connection algorithm provided by the embodiment of the application,Figure 3 (b) is a schematic diagram of the second connection algorithm provided in an embodiment of the present invention.
[0054] Figure 4 This is a schematic diagram of the position transformation of the L-shaped connecting line provided in an embodiment of the present invention.
[0055] Figure 5 This is a schematic diagram of the position change of the S-shaped connecting line provided in an embodiment of the present invention.
[0056] Figure 6 The diagram shows the improved connection algorithm provided in the embodiment of the present invention.
[0057] Figure 7 This is a diagram illustrating the derived wiring pattern of the S-shaped connecting line provided in an embodiment of the present invention.
[0058] Figure 8 This is a schematic diagram of a free-form broken line connection pattern provided in an embodiment of the present invention.
[0059] Figure 9 This is an example diagram of a free-form broken line connection provided in an embodiment of the present invention. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention. Example
[0061] like Figure 1 As shown, a connection method for developing programming tools based on models includes:
[0062] S1. Based on the model development programming tool, obtain the first target pin position of the first target connection symbol and the second target pin position of the second target connection symbol. The first target pin position represents the starting position, and the second target pin position represents the ending position.
[0063] S2. Based on the first target pin position and the second target pin position, determine the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol.
[0064] like Figure 2 As shown, the connection types include: L-shaped, reverse L-shaped, S-shaped, and reverse S-shaped.
[0065] S3. Based on the connection type between the first target pin and the second target pin of the second target connection diagram, schedule the pre-deployed connection algorithm to connect the first target pin and the second target pin to complete the connection process.
[0066] The application provides a connection method based on a model development programming tool, which determines a connection type based on a starting position and an ending position, finally schedules a pre-deployed connection algorithm for connection based on the connection type, can realize intelligent connection under different figure layouts, supports line position editing and other functions, makes the connection between algorithm figures as reasonable and clear as possible, and effectively improves tool usability.
[0067] In a possible implementation, the connection type between the first target pin of the first target connection figure and the second target pin of the second target connection figure is determined based on the first target pin position and the second target pin position, and includes the following steps.
[0068] The X-axis coordinate in the first target pin position is extracted as x1, and the X-axis coordinate in the second target pin position is extracted as x2.
[0069] It is determined whether the X-axis coordinate x1 in the first target pin position is greater than or equal to the X-axis coordinate x2 in the second target pin position. If yes, the connection type between the first target pin of the first target connection figure and the second target pin of the second target connection figure is determined as S type or reverse S type; otherwise, the connection type between the first target pin of the first target connection figure and the second target pin of the second target connection figure is determined as L type or reverse L type.
[0070] In a possible implementation, the pre-deployed connection algorithm is scheduled to connect the first target pin and the second target pin according to the connection type between the first target pin and the second target pin of the second target connection figure, and includes the following steps.
[0071] When the connection type between the first target pin of the first target connection figure and the second target pin of the second target connection figure is L type or reverse L type, the first connection algorithm is scheduled to connect the first target pin and the second target pin.
[0072] When the connection type between the first target pin of the first target connection figure and the second target pin of the second target connection figure is S type or reverse S type, the second connection algorithm is scheduled to connect the first target pin and the second target pin.
[0073] As shown in FIG. Figure 3 The first connection algorithm includes the following steps.
[0074] Six base points are determined as a first base point P1, a second base point P2, a third base point P3, a fourth base point P4, a fifth base point P5, and a sixth base point P6.
[0075] The positions of the first base point P1 and the second base point P2 are determined as the first target pin position (x1, y1) of the first target connection symbol, and the positions of the fifth base point P5 and the sixth base point P6 are determined as the second target pin position (x2, y2) of the second target connection symbol.
[0076] The position of the third base point P3 is determined as ((x1+x2) / 2, y1), and the position of the fourth base point P4 is determined as ((x1+x2) / 2, y2).
[0077] The first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5, and the sixth base point P6 are sequentially connected to complete the connection.
[0078] As shown in FIG. 2B, the second connection algorithm includes the following steps. Figure 3 Six base points are determined as the first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5, and the sixth base point P6.
[0079] The position of the first base point P1 is determined as the first target pin position (x1, y1) of the first target connection symbol, and the position of the sixth base point P6 is determined as the second target pin position (x2, y2) of the second target connection symbol.
[0080] The position of the second base point P2 is determined as (x1+m, y1), the position of the third base point P3 is determined as (x1+m, (y1+y2) / 2), the position of the fourth base point P4 is determined as (x2-m, (y1+y2) / 2), and the position of the fifth base point P5 is determined as (x2-m, y1). Wherein m represents a preset position offset.
[0081] The first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5, and the sixth base point P6 are sequentially connected to complete the connection.
[0082] In a possible implementation, after the pre-deployed connection algorithm is scheduled to connect the first target pin and the second target pin according to the connection type between the first target pin and the second target pin of the second target connection symbol, the method further includes the following steps.
[0083]
[0084] When the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is L type or inverse L type, a first adjustment instruction of the first target pin position and / or the second target pin position generated by the human-computer interaction is accepted, and the first target pin position and / or the second target pin position is adjusted according to the first adjustment instruction, while the first base point P1 changes following the first target pin position and / or the sixth base point P6 changes following the second target pin position, and the positions of the remaining base points change following the first base point P1.
[0085] When the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is L type or inverse L type, a second adjustment instruction input by the human-computer interaction is accepted, and the horizontal coordinates of the third base point P3 and / or the fourth base point P4 change according to the second adjustment instruction.
[0086] When the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is S type or inverse S type, a third adjustment instruction of the first target pin position generated by the human-computer interaction is accepted, and the first target pin position is adjusted according to the third adjustment instruction, while the first base point P1 changes following the first target pin position, and the positions of the remaining base points change following the first base point P1.
[0087] When the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is S type or inverse S type, a fourth adjustment instruction input by the human-computer interaction is accepted, and the horizontal coordinates of the second base point P2 and / or the fifth base point P5 change according to the fourth adjustment instruction, and the third base point P3 and the fourth base point P4 change following.
[0088] When the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is S type or inverse S type, a fifth adjustment instruction input by the human-computer interaction is accepted, and the third base point P3 and / or the fourth base point P4 change according to the fifth adjustment instruction, and the second base point P2 and the fifth base point P5 change following.
[0089] For example, support pin position changes and control point changes to achieve flexible wiring and manual adjustment, the change rule is as follows: for L type, the movement includes: a, c) the starting pin moves, then P1 follows the starting pin, P3 follows the change of the vertical coordinate, the horizontal coordinate is unchanged, and the remaining points are unchanged. b, d) click the line to select the line, move the mouse to the vicinity of P3, P4, P3, P4 points can move along the X axis with the mouse, P3, P4 horizontal coordinate changes synchronously with the mouse position. The remaining points are unchanged. The movement of the end pin is similar to that of the starting pin, which is not described in detail. For S type connection, the movement includes: a) the starting pin position moves, P1 follows the change, P2 vertical coordinate follows the movement, horizontal coordinate is unchanged. b) the same as L type, P2 and P5 can move horizontally when selected by the mouse, P3 and P4 follow passively. c) P3 and P4 can move to any position with the mouse when selected by the mouse, P2 and P5 horizontal coordinates follow passively. The connection transformation is as shown in Figure 4 and Figure 5 .
[0090] In one possible implementation, after the pre-deployed connection algorithm is scheduled to connect the first target pin and the second target pin, according to the connection type between the first target pin and the second target pin of the second target connection symbol, it further includes:
[0091] Real-time detection of whether the first target pin position and / or the second target pin position changes, if so, extract the X axis coordinate x1 in the first target pin position, and extract the X axis coordinate x2 in the second target pin position, otherwise continue to monitor.
[0092] Determine whether the X axis coordinate x1 in the first target pin position is greater than or equal to the X axis coordinate x2 in the second target pin position, if so, determine that the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is S type or reverse S type, otherwise determine that the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is L type or reverse L type.
[0093] For example: when the relative position of the pin changes, the connection mode is checked, and the line type is automatically switched to re-layout. The conversion logic is as follows: if the connection type is L type before moving, when the pin position changes after moving the pin, x1 >= x2, then trigger linear switching, and generate S type connection again. If the connection type is S type before moving, the line type will not change when the position changes, because S type is more complex than L type, and has higher plasticity, which can be adjusted manually to realize L type connection. Conversely, it cannot.
[0094] Since the same algorithm is used in the connection algorithm, it is difficult to distinguish the line when connecting the parallel pins of the same symbol. Therefore, a new connection calculation method is proposed to solve this problem. Here, the number of symbol input pins and output pins n and the pin index i of the current connection are introduced. According to the pin index, the line is indented to separate the overlapping lines, as shown in Figure 6 .
[0095] In one possible implementation, the first connection algorithm includes:
[0096] The total number of pins n of the first target connection symbol and the pin index i of the first target pin are obtained, and six base points are determined, i.e., the first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5, and the sixth base point P6.
[0097] The positions of the first base point P1 and the second base point P2 are determined as the position (x1, y1) of the first target pin of the first target connection symbol, and the positions of the fifth base point P5 and the sixth base point P6 are determined as the position (x2, y2) of the second target pin of the second target connection symbol.
[0098] The position of the third base point P3 is determined as ((x1+x2)*(0.3+(0.4*i) / (n+1)), y1), and the position of the fourth base point P4 is determined as ((x1+x2)*(0.3+(0.4*i) / (n+1)), y2).
[0099] The first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5, and the sixth base point P6 are sequentially connected to complete the connection.
[0100] For S-type connection, the derived connection style shown in Figure 7 can be achieved by moving the control point to avoid obstacles in the S-type connection path.
[0101] In one possible implementation, the second connection algorithm includes:
[0102] The total number of pins n of the first target connection symbol and the pin index i of the first target pin are obtained, and six base points are determined, i.e., the first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5, and the sixth base point P6.
[0103] The position of the first base point P1 is determined as the position (x1, y1) of the first target pin of the first target connection symbol, and the position of the sixth base point P6 is determined as the position (x2, y2) of the second target pin of the second target connection symbol.
[0104] The position of the second base point P2 is determined as (x1+m(1+f*i), y1), the position of the third base point P3 is determined as (x1+m(1+f*i), (y1+y2) / 2), the position of the fourth base point P4 is determined as (x2-m(1+f*i), (y1+y2) / 2), and the position of the fifth base point P5 is determined as (x2-m(1+f*i), y1). Here, m represents the preset position offset, and f represents the indentation coefficient.
[0105] Connect the first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5, and the sixth base point P6 in sequence to complete the connection.
[0106] In one possible implementation, it also includes:
[0107] Provide staff with a free-form polyline mode, and in the free-form polyline mode, accept multiple continuous control points input by the user through human-machine interface.
[0108] For any two adjacent control points, connect them using mode A, mode B, mode C, or mode D.
[0109] Mode A is a horizontal right-angled line, Mode B is a vertical right-angled line, Mode C is a horizontal line, and Mode D is a vertical line.
[0110] It also supports custom free-form polylines, which consist of a list of control points. Clicking the starting pin enters connection mode; in this mode, each click generates one or two control points, until the ending pin is clicked. Free-form polylines are drawn by connecting all control points. The drawing method is as follows: Free-form polyline drawing modes include... Figure 8 There are four drawing modes: A) Horizontal Right Angle, B) Vertical Right Angle, C) Horizontal Line, and D) Vertical Line. The control point calculation method for mode A is: P2' = (x2, y1), where P1 and P2 are the mouse click positions. The control point calculation method for mode B is: P2' = (x1, y2), where P1 and P2 are the mouse click positions. The control point calculation methods for modes C and D are: P1 and P2 are the mouse click positions. During the drawing process, the drawing mode will switch between ABCD based on the positions of two mouse clicks to achieve a more reasonable polyline.
[0111] The switching logic is: the start pin uses A mode (i.e. initialized as A mode), when the first click position of the mouse is at the same horizontal position as the initial pin, the current uses C mode to draw. If the first click position of the mouse is at the same vertical position as the initial pin, the current uses D mode to draw. Otherwise, A mode is used to draw. In the process of continuing to connect, if the same horizontal is C, the same vertical is D. Otherwise, if the last time uses C, the next time uses B, if the last time uses D, the next time uses A, otherwise, the last mode is continued. The drawing mode conversion example is as follows: Figure 9 .
[0112] Those skilled in the art will appreciate that embodiments of the application can be supplied as methods, systems, or computer program products. Accordingly, the application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer-readable program code.
[0113] The application is described in reference to the flowcharts and / or block diagrams of the methods, apparatus (systems), and computer program products according to embodiments of the application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowcharts and / or block diagrams block or blocks. Figure 1 one or more flows and / or blocks Figure 1 means for carrying out the function specified by the flow or flows and / or block or blocks.
[0114] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions means which implement the function specified in the flowcharts and / or block diagrams flow or flows and / or block or blocks. Figure 1 one or more flows and / or blocks Figure 1 means for carrying out the function specified by the flow or flows and / or block or blocks.
[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowcharts and / or block diagrams flow or flows and / or block or blocks. Figure 1 one or more flows and / or blocksFigure 1 the functions specified in the one or more blocks.
[0116] Those skilled in the art can understand that all or part of the steps in the above-mentioned facts and methods can be completed by instructing the relevant hardware through programs, and the programs involved or the programs mentioned can be stored in a computer-readable storage medium. When the program is executed, the following steps are included: at this time, the corresponding method steps are derived, and the storage medium can be ROM / RAM, magnetic disc, optical disc, etc.
[0117] The above specific embodiments further illustrate the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for developing a programming tool based on a model, the method comprising: The method comprises the following steps: obtaining a first target pin position of a first target connection diagram symbol and a second target pin position of a second target connection diagram symbol based on a model development programming tool; the first target pin position represents a starting position, and the second target pin position represents an ending position; determining a connection type between a first target pin of the first target connection diagram symbol and a second target pin of the second target connection diagram symbol based on the first target pin position and the second target pin position; the connection type comprises an L type, an inverse L type, an S type and an inverse S type; scheduling a pre-deployed connection algorithm to connect the first target pin and the second target pin according to the connection type between the first target pin and the second target pin, and completing a connection process; the L type and the inverse L type connection type correspond to scheduling a first connection algorithm, and the S type and the inverse S type connection type correspond to scheduling a second connection algorithm; the first connection algorithm comprises the following steps: determining six base points as a first base point P1, a second base point P2, a third base point P3, a fourth base point P4, a fifth base point P5 and a sixth base point P6; determining positions of the first base point P1 and the second base point P2 as a first target pin position (x1, y1) of the first target connection diagram symbol, and determining positions of the fifth base point P5 and the sixth base point P6 as a second target pin position (x2, y2) of the second target connection diagram symbol; determining a position of the third base point P3 as ((x1+x2) / 2, y1) and a position of the fourth base point P4 as ((x1+x2) / 2, y2); sequentially connecting the first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5 and the sixth base point P6 to complete the connection; the second connection algorithm comprises the following steps: determining six base points as a first base point P1, a second base point P2, a third base point P3, a fourth base point P4, a fifth base point P5 and a sixth base point P6; determining a position of the first base point P1 as a first target pin position (x1, y1) of the first target connection diagram symbol, and determining a position of the sixth base point P6 as a second target pin position (x2, y2) of the second target connection diagram symbol; determining a position of the second base point P2 as (x1+m, y1), a position of the third base point P3 as (x1+m, (y1+y2) / 2), a position of the fourth base point P4 as (x2-m, (y1+y2) / 2), and a position of the fifth base point P5 as (x2-m, y1); wherein m represents a preset position offset; sequentially connecting the first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5 and the sixth base point P6 to complete the connection; after the first target pin and the second target pin are connected, each base point in the first connection algorithm and the second connection algorithm is adjusted according to a human-computer interaction adjustment instruction. After the first target pin is connected with the second target pin, the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is re-determined according to the real-time change state of the first target pin position and / or the second target pin position.
2. The model-based development programming tool wiring method of claim 1, wherein, The connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is determined based on the first target pin position and the second target pin position, and includes: The X-axis coordinate in the first target pin position is extracted as x1, and the X-axis coordinate in the second target pin position is extracted as x2; It is judged whether the X-axis coordinate x1 in the first target pin position is greater than or equal to the X-axis coordinate x2 in the second target pin position, if yes, the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is determined as S type or reverse S type, otherwise the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is determined as L type or reverse L type.
3. The method of claim 2, wherein, According to the connection type between the first target pin and the second target pin of the second target connection symbol, the first target pin and the second target pin are connected by scheduling the pre-deployed connection algorithm, including: When the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is S type or reverse S type, the first connection algorithm is scheduled to connect the first target pin and the second target pin; When the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is L type or reverse L type, the second connection algorithm is scheduled to connect the first target pin and the second target pin.
4. The method of claim 1, wherein the model-based development programming tool is a graphical programming tool. After the first target pin and the second target pin are connected according to the connection type between the first target pin and the second target pin of the second target connection symbol, the pre-deployed connection algorithm is scheduled to connect the first target pin and the second target pin, further including: When the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is L type or reverse L type, the first adjustment instruction of the first target pin position and / or the second target pin position generated by human-computer interaction is accepted, and the first target pin position and / or the second target pin position is adjusted according to the first adjustment instruction, and the first base point P1 follows the first target pin position change and / or the sixth base point P6 follows the second target pin position change, the positions of the remaining base points follow the first base point P1 change; When the connection type between the first target pin of the first target connection symbol and the second target pin of the second target connection symbol is L type or reverse L type, the second adjustment instruction input by human-computer interaction is accepted, and the horizontal coordinates of the third base point P3 and / or the fourth base point P4 are changed according to the second adjustment instruction; When the connection type between the first target pin of the first target connection diagram symbol and the second target pin of the second target connection diagram symbol is S type or reverse S type, a third adjustment instruction of the first target pin position generated by the human-computer interaction is accepted, and the first target pin position is adjusted according to the third adjustment instruction, and the first base point P1 changes with the first target pin position, and the positions of the remaining base points change with the first base point P1; When the connection type between the first target pin of the first target connection diagram symbol and the second target pin of the second target connection diagram symbol is S type or reverse S type, a fourth adjustment instruction input by the human-computer interaction is accepted, the horizontal coordinates of the second base point P2 and / or the fifth base point P5 change according to the fourth adjustment instruction, and the third base point P3 and the fourth base point P4 change accordingly; When the connection type between the first target pin of the first target connection diagram symbol and the second target pin of the second target connection diagram symbol is S type or reverse S type, a fifth adjustment instruction input by the human-computer interaction is accepted, the third base point P3 and / or the fourth base point P4 change according to the fifth adjustment instruction, and the second base point P2 and the fifth base point P5 change accordingly.
5. The method of claim 2, wherein, According to the connection type between the first target pin and the second target pin of the second target connection diagram symbol, the first target pin and the second target pin are connected by the pre-deployed connection algorithm, and the method further comprises: Real-time detection is performed on whether the first target pin position and / or the second target pin position changes, if yes, the X-axis coordinate in the first target pin position is extracted as x1, and the X-axis coordinate in the second target pin position is extracted as x2, otherwise, the monitoring is continued; It is judged whether the X-axis coordinate x1 in the first target pin position is greater than or equal to the X-axis coordinate x2 in the second target pin position, if yes, it is determined that the connection type between the first target pin of the first target connection diagram symbol and the second target pin of the second target connection diagram symbol is S type or reverse S type, otherwise, it is determined that the connection type between the first target pin of the first target connection diagram symbol and the second target pin of the second target connection diagram symbol is L type or reverse L type.
6. The method of claim 3, wherein, The first connection algorithm comprises: Obtaining the total number n of pins of the first target connection diagram symbol and the pin index i of the first target pin, and determining six base points as the first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5 and the sixth base point P6; The positions of the first base point P1 and the second base point P2 are determined as the first target pin position (x1, y1) of the first target connection diagram symbol, and the positions of the fifth base point P5 and the sixth base point P6 are determined as the second target pin position (x2, y2) of the second target connection diagram symbol; The position of the third base point P3 is determined as ((x1+x2)*(0.3+(0.4*i) / (n+1)), y1), and the position of the fourth base point P4 is determined as ((x1+x2)*(0.3+(0.4*i) / (n+1)), y2); The first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5 and the sixth base point P6 are sequentially connected to complete the connection.
7. The method of claim 3, wherein the model-based development programming tool is a graphical programming tool. The second connection algorithm comprises: Obtaining the pin total number n of the first target connection symbol and the pin index i of the first target pin, six base points are determined as the first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5 and the sixth base point P6; The position of the first base point P1 is determined as the first target pin position (x1, y1) of the first target connection symbol, and the position of the sixth base point P6 is determined as the second target pin position (x2, y2) of the second target connection symbol; The position of the second base point P2 is determined as (x1+m(1+f*i), y1), the position of the third base point P3 is determined as (x1+m(1+f*i), (y1+y2) / 2), the position of the fourth base point P4 is determined as (x2-m(1+f*i), (y1+y2) / 2), and the position of the fifth base point P5 is determined as (x2-m(1+f*i), y1); wherein m represents a preset position offset, and f represents an indentation coefficient; The first base point P1, the second base point P2, the third base point P3, the fourth base point P4, the fifth base point P5 and the sixth base point P6 are sequentially connected, and the connection is completed.
8. The method of claim 1, wherein the model-based development programming tool is a graphical programming tool. Further comprising: Providing a free broken line mode to the staff, and in the free broken line mode, accepting a plurality of continuous control points input by a user through a man-machine interface; For any two adjacent control points, A mode, B mode, C mode or D mode is used for connection; A mode is horizontal right-angle connection, B mode is vertical right-angle connection, C mode is horizontal connection, and D mode is vertical connection.
Citation Information
Patent Citations
Topological graph display method based on inter-station network connection of DCS platform of nuclear power plant
CN110442755A
Connection line adjustment method and device, and related equipment
CN111381818A
Nuclear power station DCS system application software logic diagram connection data processing method
CN113986214A
Vector diagram drawing method and device, equipment and storage medium
CN114693840A