Method and device for modifying primitive reference relationship
By configuring the element information table and attribute information table in the graphics configuration software and modifying the source element encoding of the referenced element, the problem that attribute modifications in the existing technology cannot be passed to the cascaded referenced element is solved, and the efficiency and flexibility of graphic design are improved.
Patent Information
- Application Number
- CN202510302893.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-07-25
AI Technical Summary
The effects of modifying the attributes of referenced elements in existing graphics configuration software cannot be passed to other elements in the cascading reference, resulting in cumbersome and inefficient graphics design.
By configuring the element information table and attribute information table in the graphics configuration software, modify the source element encoding of the reference element, and determine whether it is empty. If it is empty, set it to the code of the reference element, and update its attribute value to achieve the same function as modifying the attribute value of the source element.
The effect of modifying any element attribute can be passed to other elements in the cascading reference, reducing the workload of attribute configuration, and improving the flexibility and efficiency of graphical design.
Smart Images

Figure CN120371278A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of graphic configuration, and particularly to a method and device for modifying the reference relationship of graphic elements. Background Art
[0002] Graphic configuration software, sometimes also called SCADA (Supervisory Control and Data Acquisition) software, etc., is an important part of the automation field. The basic function of graphic configuration software is to collect and process data of automation devices (such as PLCs, DCSs), and then display this data in a graphical way. In this way, operators with limited technical backgrounds can also understand the status of the devices (such as production lines) controlled by automation devices and can intervene in a timely manner when abnormalities occur.
[0003] When using graphic configuration software for graphical and dynamic screen design, engineers can create or open a screen (upper left side of the interface), select a graphic element (i.e., a graphic) from the toolbox (leftmost side at the bottom of the interface) or the library (right side of the interface), place it on the screen, and modify its properties such as position, size, fill color, etc., to facilitate operators to understand the device it represents.
[0004] Some properties (such as the height of the brown rectangle in the reactor) can be connected to the height of the material liquid level in the reactor collected by the automation device. For example, when the liquid level changes from 0% to 100%, the height of this rectangle also changes from 0% to 100%. In this way, operators can quickly understand the approximate value of the current reactor liquid level without having to keep staring at the liquid level data displayed on the interface.
[0005] In order to draw various production lines, complex graphics in graphic configuration software are all realized by generating basic graphic element instances based on some system-predefined basic graphic element templates and then splicing them together. Common basic graphic element templates include rectangles, ellipses, sectors, lines, polylines, polygons, bitmaps, pipes, text boxes, buttons, input boxes, etc.
[0006] Although the basic graphic elements seem simple, by splicing several basic graphic elements together and carefully selecting the properties such as fill color, transparency, and gradient color of each graphic element, complex graphics can be drawn.
[0007] These basic graphic element templates have some common properties, such as fill color, border width, etc.; and also some proprietary properties, such as rectangles having length and width dimensions, ellipses having radius dimensions, and pipes having flow effects, etc. It can be considered that all basic graphic elements share a set of the same graphic element property sets, but each type of basic graphic element only uses some of the properties inside, and other properties do not work.
[0008] To further improve the screen drawing efficiency, graphic configuration software generally provides two functions:
[0009] First, combine and decompose graphic elements. After a complex graphic is drawn, they can be combined (referred to as combined graphic elements, or parent graphic elements, and the original graphic elements are called their sub-graphic elements), so that they can be moved, resized, copied, etc. as a whole. A combined graphic element can continue to be combined with other graphic elements to form a combination tree. A combined graphic element can also be gradually decomposed until it is decomposed into individual basic graphic elements. Basic graphic elements cannot be further decomposed.
[0010] Second, create and reference templates. The drawn combined graphic elements can be used as templates and referenced in other projects without having to be redrawn. Graphic elements drawn by relying on referencing a template are called referenced graphic elements (or target graphic elements, and the referenced graphic elements are called source graphic elements). Its important feature is that if the attributes of the template are modified again, it is equivalent to simultaneously modifying the corresponding attributes of these referenced graphic elements. A template can also be copied into ordinary graphic elements (called copied graphic elements), in which case the ability to automatically modify is lost, but at the same time, the ability to freely adjust its own attributes is obtained. The basic graphic elements in the screen are all copied graphic elements.
[0011] Referenced graphic elements can still be combined with other graphic elements, and the referenced graphic elements in the combined graphic elements still maintain the ability to reference the template attributes. However, the referenced graphic elements themselves cannot be decomposed. Currently, in existing graphic configuration software, modifying the attributes of referenced graphic elements cannot transfer the effect to other graphic elements in the cascading reference, which makes the graphical design work more cumbersome and less efficient. Summary of the Invention
[0012] In view of the deficiencies in the prior art, the present invention provides a method and device for modifying the reference relationship of graphic elements, so that the effect of modifying the attributes of the referenced graphic elements can achieve the effect of modifying the attributes of the template graphic elements.
[0013] The above technical objectives of the present invention are achieved through the following technical solutions:
[0014] A method for modifying the reference relationship of graphic elements, including:
[0015] Configure a graphic element information table and an attribute information table in the graphic configuration software. The graphic element information table includes at least fields such as graphic element code, source graphic element code, basic graphic element type, and parent graphic element code; the attribute information table includes at least fields such as graphic element code, attribute code, whether to reference the source graphic element, whether to reference the parent graphic element, and attribute value;
[0016] When combining graphic elements, default the combined value-taking method of the attributes of each sub-graphic element to reference the parent graphic element, or default the reference value-taking method of each attribute of the target graphic element to reference the source graphic element, or set the combined value-taking method or reference value-taking method of a certain graphic element attribute to overwrite;
[0017] Under the default configuration, when modifying the property value of the source primitive, the corresponding property value of its referenced primitive is automatically changed;
[0018] When modifying the property value of the referenced primitive, obtain the source primitive code of the referenced primitive, find the corresponding primitive according to the source primitive code, and determine whether the source primitive code of the primitive is empty. If it is empty, set the source primitive code of the primitive to the primitive code of the referenced primitive, and update the source primitive code of the referenced primitive to be empty. Then modify the property value of the referenced primitive to achieve the same function as modifying the property value of the source primitive.
[0019] Further, when combining primitives, when a certain primitive property references both the parent primitive and the source primitive, choose one.
[0020] Further, when combining primitives, when a certain primitive property references both the parent primitive and the source primitive, perform an exclusive OR calculation on the two referenced property values to obtain the primitive property value.
[0021] The present invention also provides a device for modifying the primitive reference relationship, including:
[0022] A relationship data module for configuring a primitive information table and an attribute information table in a graphic configuration software, where the primitive information table includes at least fields such as primitive code, source primitive code, basic primitive type, and parent primitive code; the attribute information table includes at least fields such as primitive code, attribute code, whether to reference the source primitive, whether to reference the parent primitive, and attribute value;
[0023] An attribute reference module for, when combining primitives, default-configuring the combined value-taking method of the attributes of each sub-primitive to reference the parent primitive, or default-configuring the reference value-taking method of each attribute of the target primitive to reference the source primitive, or setting the combined value-taking method or reference value-taking method of a certain primitive attribute to overwrite;
[0024] A reference relationship modification module for, under the default configuration, modifying the property value of the source primitive, and the corresponding property value of its referenced primitive is automatically changed; when modifying the property value of the referenced primitive, obtain the source primitive code of the referenced primitive, find the corresponding primitive according to the source primitive code, and determine whether the source primitive code of the primitive is empty. If it is empty, set the source primitive code of the primitive to the primitive code of the referenced primitive, and update the source primitive code of the referenced primitive to be empty. Then modify the property value of the referenced primitive to achieve the same function as modifying the property value of the source primitive.
[0025] Further, the attribute reference module is configured to, when combining primitives, choose one when a certain primitive property references both the parent primitive and the source primitive.
[0026] Further, the attribute reference module is configured to perform an exclusive OR calculation on the two referenced attribute values when combining graphic elements, when a certain graphic element attribute references both the parent graphic element and the source graphic element, to obtain the graphic element attribute value.
[0027] The present invention has the following beneficial effects:
[0028] The present invention provides a method and device for modifying the reference relationship of graphic elements. Aiming at the problem that the effect of modifying the attributes of a referenced graphic element in existing graphic configuration software cannot be transmitted to other graphic elements in the cascade reference, when modifying the attribute value of a referenced graphic element, the source graphic element code of the referenced graphic element is obtained, and according to the source graphic element code, the corresponding graphic element is found, and it is judged whether the source graphic element code of the graphic element is empty. If it is empty, the source graphic element code of the graphic element is set to the graphic element code of the referenced graphic element, and the source graphic element code of the referenced graphic element is updated to be empty, and then the attribute value of the referenced graphic element is modified, realizing the same function as modifying the attribute value of the source graphic element, which is convenient for graphical design. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a schematic diagram of graphical design in an embodiment of the present invention;
[0030] Figure 2 It is a schematic diagram of the reference relationship of graphic elements in an embodiment of the present invention;
[0031] Figure 3 It is a schematic diagram of modifying the reference relationship of graphic elements in an embodiment of the present invention;
[0032] Figure 4 It is a flowchart of the method for modifying the reference relationship of graphic elements in an embodiment of the present invention;
[0033] Figure 5 It is a schematic diagram of the device for modifying the reference relationship of graphic elements in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0034] The technical solutions in the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0035] As Figure 1 shown, there are four fan graphic elements in the figure. One of the four graphic elements is a template graphic element, designated as graphic element 1, and the other three are referenced graphic elements that reference the template graphic element, designated as graphic elements 2, 3, and 4. Then their reference relationship is as Figure 2 shown. If graphic element 1 is edited in place, since graphic element 1 is a template, after the editing is completed, graphic elements 2 to 4 will automatically show the new effect. However, if graphic elements 2, 3, or 4 are edited in place, since they are all referenced graphic elements, the new effect cannot be transmitted to the other three graphic elements.
[0036] To address the above problems, this solution provides a method for modifying the graphic element reference relationship. When modifying Graphic Element 2, Graphic Element 2 can be used as a template, and Graphic Element 1 is called the reference graphic element. Specifically, it includes:
[0037] As Figure 3 shown, when there is a cascading reference and Graphic Element 1 itself is also a reference template, it is necessary to trace back further until a template is found, such as Graphic Element 5. Then, let Graphic Element 2 be the template and let Graphic Element 5 reference Graphic Element 2. In this way, when the attributes of Graphic Element 2 are modified, other graphic elements, namely Graphic Element 1, Graphic Element 3, Graphic Element 4, and Graphic Element 5, will all obtain the corresponding attribute effects.
[0038] Applying the above concept to the graphic configuration software, when a user selects a graphic element and discovers that the graphic element is a reference graphic element, the reference relationship can be automatically modified. The current graphic element is used as a template, and the rootmost graphic element references it.
[0039] As Figure 4 shown, the method for modifying the graphic element reference relationship provided in this embodiment includes: configuring a graphic element information table and an attribute information table in the graphic configuration software. Among them, the graphic element information table at least includes fields such as graphic element code, source graphic element code, basic graphic element type, and parent graphic element code; the attribute information table at least includes fields such as graphic element code, attribute code, whether to reference the source graphic element, whether to reference the parent graphic element, and attribute value. When combining graphic elements, the combined value-taking method of the attributes of each sub-graphic element is default-configured to reference the parent graphic element, or the reference value-taking method of each attribute of the target graphic element is default-configured to reference the source graphic element, or the combined value-taking method or reference value-taking method of a certain graphic element attribute is set to overwrite. Under the default configuration, when the attribute value of the source graphic element is modified, the corresponding attribute value of its reference graphic element is automatically changed.
[0040] When modifying the attribute value of a reference graphic element, obtain the source graphic element code of the reference graphic element. According to the source graphic element code, find the corresponding graphic element, and determine whether the source graphic element code of the graphic element is empty. If it is empty, set the source graphic element code of the graphic element to the graphic element code of the reference graphic element, and update the source graphic element code of the reference graphic element to be empty. Then, modify the attribute value of the reference graphic element to achieve the same function as modifying the attribute value of the source graphic element.
[0041] Through the above method for modifying the graphic element reference relationship, the workload of attribute configuration is reduced. The attributes of each graphic element can be referenced either from the source graphic element or from the parent graphic element. The ability to configure flexibly is guaranteed, and whether each graphic element attribute is referenced can be controlled at a fine-grained level. The graphic element combination ability is improved. Whether it is a reference graphic element or a copied graphic element, they can be combined arbitrarily, and the attribute reference ability is still maintained. Moreover, in cascading references, when modifying the attributes of any graphic element, the effect will be transmitted to other graphic elements, and the operation is very convenient.
[0042] The graphic element information table in this embodiment has the following fields:
[0043] Graphic element code: Each graphic element has a globally unique code.
[0044] Source graphic element code: If this graphic element references another graphic element, then this field is the code of the latter; otherwise, this field is empty.
[0045] Basic graphic element type: If this graphic element is a system-predefined basic graphic element, then this field is the type of the basic graphic element; if this graphic element is a combination of other graphic elements, then this field is the combination type. If the source graphic element code exists, then the basic graphic element type must be empty.
[0046] Parent graphic element code: If this graphic element is a sub-graphic element of a parent graphic element, then this field is the code of the latter; otherwise, this field is empty.
[0047] The attribute information table in this embodiment has the following fields:
[0048] Graphic element code: Represents an instance of a graphic element.
[0049] Attribute code: Represents an attribute of the graphic element. Each attribute has a globally unique code.
[0050] Whether to reference the source graphic element: A boolean value. TRUE indicates referencing the source graphic element, and FALSE indicates overwriting.
[0051] Whether to reference the parent graphic element: A boolean value. TRUE indicates referencing the parent graphic element, and FALSE indicates overwriting.
[0052] Attribute value: The value of the attribute.
[0053] When the user selects a basic graphic element type A and creates a graphic element B:
[0054] 1. Add a new record to the graphic element information table, where:
[0055] a) Set the graphic element code to B.
[0056] b) Set the source graphic element code to empty.
[0057] c) Set the basic graphic element type to A.
[0058] d) Set the parent graphic element code to empty.
[0059] 2. For each attribute of the graphic element, add a new record to the attribute information table, and set the two reference flags of each record to TRUE, and the attribute value to the default value or the value entered by the user.
[0060] When the user selects a graphic element A and creates a graphic element B, and B references A:
[0061] 1. Add a new record to the graphic element information table, where:
[0062] a) The graphic element code is set to B.
[0063] b) The source graphic element code is set to A.
[0064] c) The basic graphic element type is set to empty.
[0065] d) The parent graphic element code is set to empty.
[0066] 2. For each attribute of graphic element B, add a new record to the attribute information table, and set the reference source graphic element flag of each record to TRUE.
[0067] When the user combines two sub - graphic elements A and B into C:
[0068] 1. Add a new record to the graphic element information table, where:
[0069] a) The graphic element code is automatically generated by the system or entered by the user.
[0070] b) The source graphic element code is set to empty.
[0071] c) The basic graphic element type is set to empty.
[0072] d) The parent graphic element code is set to empty.
[0073] 2. For each attribute of graphic element C, add a new record to the attribute information table, where
[0074] a) The two reference flags of each record are set to TRUE.
[0075] If the attribute values of A and B are the same, then the reference parent graphic element flags of A and B are set to TRUE, and the attribute value of C is set to the attribute value of A; otherwise, the reference parent graphic element flags of A and B are set to FALSE.
[0076] When combining graphic elements, if the attribute references of multiple sub - graphic elements are combined in a cascading manner, then under the default configuration, modify the attribute value of the root sub - graphic element, and the corresponding attribute values of the remaining sub - graphic elements are automatically changed. For example, if a certain attribute of graphic element A references the corresponding attribute of its parent graphic element B, and graphic element B in turn references the corresponding attribute of its parent graphic element C, then after modifying the attribute of graphic element C, the corresponding attributes of graphic elements A and B are also modified accordingly.
[0077] When a user modifies a reference graphic element (assumed to be graphic element A) in a cascading reference, only need to check each reference source forward until finding a graphic element (assumed to be graphic element C) whose source graphic element coding attribute is empty. Then set the source graphic element coding attribute of C to A, and set the source graphic element coding attribute of A to be empty, thus realizing the modification of the reference relationship. At this time, when modifying the attributes of graphic element A, the corresponding attributes of graphic elements B and C are also modified accordingly.
[0078] When combining graphic elements, when a certain graphic element attribute references both the parent graphic element and the source graphic element, choose one. For example, when this situation occurs, a dialog box will pop up on the software interface for the user to choose whether to reference the parent graphic element or the source graphic element.
[0079] Or, when combining graphic elements, when a certain graphic element attribute references both the parent graphic element and the source graphic element, perform an exclusive OR calculation on the two referenced attribute values to obtain the value of this graphic element attribute.
[0080] Based on this, this solution also proposes a device for modifying the reference relationship of graphic elements, as Figure 5 shown, including: a relationship data module, used to configure a graphic element information table and an attribute information table in a graphic configuration software, where the graphic element information table at least includes fields such as graphic element coding, source graphic element coding, basic graphic element type, and parent graphic element coding; the attribute information table at least includes fields such as graphic element coding, attribute coding, whether to reference the source graphic element, whether to reference the parent graphic element, and attribute value; an attribute reference module, used to, when combining graphic elements, default the combined value-taking method of the attributes of each sub-graphic element to reference the parent graphic element, or default the reference value-taking method of each attribute of the target graphic element to reference the source graphic element, or set the combined value-taking method or reference value-taking method of a certain graphic element attribute to overwrite; a reference relationship modification module, used to, under the default configuration, modify the attribute value of the source graphic element, and the corresponding attribute values of its reference graphic elements are automatically changed; when modifying the attribute value of a reference graphic element, obtain the source graphic element coding of this reference graphic element, find the corresponding graphic element according to the source graphic element coding, judge whether the source graphic element coding of this graphic element is empty, if it is empty, then set the source graphic element coding of this graphic element to the graphic element coding of the reference graphic element, and update the source graphic element coding of the reference graphic element to be empty, and then modify the attribute value of the reference graphic element to achieve the same function as modifying the attribute value of the source graphic element.
[0081] Among them, the attribute reference module is configured to, when combining graphic elements, when a certain graphic element attribute references both the parent graphic element and the source graphic element, choose one. Or, the attribute reference module is configured to, when combining graphic elements, when a certain graphic element attribute references both the parent graphic element and the source graphic element, perform an exclusive OR calculation on the two referenced attribute values to obtain the value of this graphic element attribute.
[0082] The modification method of the graphic element reference relationship provided by this solution aims at the problem that when modifying the attributes of a referenced graphic element in an existing graphic configuration software, the effect cannot be transmitted to other graphic elements in the cascading reference. When modifying the attribute value of a referenced graphic element, the source graphic element code of this referenced graphic element is obtained. According to the source graphic element code, the corresponding graphic element is found, and it is judged whether the source graphic element code of this graphic element is empty. If it is empty, the source graphic element code of this graphic element is set to the graphic element code of the referenced graphic element, and the source graphic element code of the referenced graphic element is updated to be empty. Then, the attribute value of the referenced graphic element is modified to achieve the same function as modifying the attribute value of the source graphic element, which is convenient for graphical design.
[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the purpose and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.
Claims
1. A method for modifying the reference relationship of graphic elements, characterized in that: Including: Configure the primitive information table and the attribute information table in the graphic configuration software. The primitive information table includes at least fields such as primitive code, source primitive code, basic primitive type, and parent primitive code; The attribute information table includes at least fields such as primitive code, attribute code, whether to reference the source primitive, whether to reference the parent primitive, and attribute value; When combining primitives, the combined value-taking method of the attributes of each sub-primitive is default-configured to reference the parent primitive, or the reference value-taking method of each attribute of the target primitive is default-configured to reference the source primitive, or the combined value-taking method or reference value-taking method of a certain primitive attribute is set to overwrite; Under the default configuration, when modifying the attribute value of the source primitive, the corresponding attribute value of its reference primitive is automatically changed; When modifying the attribute value of the reference primitive, obtain the source primitive code of the reference primitive, find the corresponding primitive according to the source primitive code, determine whether the source primitive code of the primitive is empty. If it is empty, set the source primitive code of the primitive to the primitive code of the reference primitive, and update the source primitive code of the reference primitive to be empty. Then modify the attribute value of the reference primitive to achieve the same function as modifying the attribute value of the source primitive.
2. The method for modifying the graphic primitive reference relationship according to claim 1, wherein: When combining primitives, when a certain primitive attribute references both the parent primitive and the source primitive, choose one.
3. The method for modifying the graphic primitive reference relationship according to claim 1, wherein: When combining primitives, when a certain primitive attribute references both the parent primitive and the source primitive, perform an exclusive OR calculation on the two referenced attribute values to obtain the primitive attribute value.
4. A device for modifying the reference relationship of graphic elements, characterized in that: Including: A relationship data module for configuring the primitive information table and the attribute information table in the graphic configuration software. Among them, the primitive information table includes at least fields such as primitive code, source primitive code, basic primitive type, and parent primitive code; The attribute information table includes at least fields such as primitive code, attribute code, whether to reference the source primitive, whether to reference the parent primitive, and attribute value; An attribute reference module for, when combining primitives, default-configuring the combined value-taking method of the attributes of each sub-primitive to reference the parent primitive, or default-configuring the reference value-taking method of each attribute of the target primitive to reference the source primitive, or setting the combined value-taking method or reference value-taking method of a certain primitive attribute to overwrite; A reference relationship modification module for, under the default configuration, when modifying the attribute value of the source primitive, the corresponding attribute value of its reference primitive is automatically changed; when modifying the attribute value of the reference primitive, obtain the source primitive code of the reference primitive, find the corresponding primitive according to the source primitive code, determine whether the source primitive code of the primitive is empty. If it is empty, set the source primitive code of the primitive to the primitive code of the reference primitive, and update the source primitive code of the reference primitive to be empty. Then modify the attribute value of the reference primitive to achieve the same function as modifying the attribute value of the source primitive.
5. The modification device for a graphic primitive reference relationship according to claim 4, characterized in that: The attribute reference module is configured to, when combining primitives, choose one when a certain primitive attribute references both the parent primitive and the source primitive.
6. The modification device for the graphic element reference relationship according to claim 4, wherein: The attribute reference module is configured to, when combining primitives, perform an exclusive OR calculation on the two referenced attribute values when a certain primitive attribute references both the parent primitive and the source primitive to obtain the primitive attribute value.