A secondary screen cabinet automatic drawing method and system based on modular configuration
By building a module library and module mapping files, and establishing a mapping relationship between interface objects and template objects, the problem of cumbersome and inconsistent design of substation secondary cabinet drawings was solved, and automatic splicing and standardized generation were achieved, improving design efficiency and drawing consistency.
Patent Information
- Application Number
- CN202611227503.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-13
- Publication Date
- 2026-11-06
AI Technical Summary
In existing technologies, the design of secondary switchboards in substations is cumbersome, the design efficiency is low, the circuit connection relies on manual operation which is prone to errors, the consistency of drawings is poor, and the changes, maintenance and reuse are difficult and inconvenient.
Build a module library and module mapping files, establish a mapping relationship between interface objects and template objects, drive the collaborative generation of multiple drawings through variable numbering, automatically stitch modules together, and achieve unified configuration and standardized drawing output.
It achieves automatic calculation of connection points without the need for repeated configuration, ensuring drawing consistency, simplifying the change process, and improving design efficiency and reusability.
Smart Images

Figure CN123049677A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electrical automation design technology, and in particular relates to a method and system for automatic drawing generation of secondary cabinets based on modular configuration. Background Technology
[0002] Currently, the design of secondary switchboard drawings for substations is mainly done manually, requiring designers to complete the drawings page by page in power design software. The total number of pages for secondary switchboard drawings in a single substation typically reaches dozens or even hundreds of pages, involving various types such as schematic diagrams, overview diagrams, layout diagrams, terminal block diagrams, equipment connection diagrams, and material lists. The design workload is extremely heavy, and it has become one of the main bottlenecks restricting the efficiency of engineering design.
[0003] To reduce repetitive drawing work, existing power design software, such as EPLAN and AutoCAD Electrical, provides a macro file mechanism. Designers can create macro files for frequently used equipment and circuits in advance, and then insert the required macro files into the corresponding pages during the design process by searching or dragging and dropping, based on the drawing content. For the same equipment, its representation in schematic diagrams, overview diagrams, and layout diagrams often differs, usually requiring the selection of the appropriate macro file or macro file variant for each. After inserting the macro files, designers still need to manually draw the connection lines between modules and, after all drawings are completed, organize the drawing sequence and generate relevant reports.
[0004] Existing technologies have the following drawbacks: Firstly, macro files need to be inserted one by one, and the graphical representations in different drawings need to be repeatedly selected, limiting design efficiency. Secondly, the connection point positions in macro files are usually not saved in a data format that can be read and calculated by the program, and loop connections still need to be completed manually, which is prone to problems such as omissions and incorrect connections, and is difficult to troubleshoot after errors occur. In addition, different designers may have differences in naming equipment identifiers, drawing graphics, and loop representations, affecting the consistency of drawings. When the equipment function category or brand changes, it is also necessary to search for and replace the relevant content and reprocess the connection relationships in the entire set of drawings, which is a large workload and prone to omissions. Although existing project drawings can be used as references or copied, it is necessary to adjust the equipment macros and loop connections one by one, resulting in low reuse efficiency. Summary of the Invention
[0005] Purpose of the invention: The purpose of this invention is to provide a method and system for automatic drawing generation of secondary cabinets based on modular configuration. By constructing a module mapping file and establishing a mapping relationship between interface objects and template objects, automatic drawing generation based on unified module configuration, variable number driving and multi-drawing collaborative generation is achieved, thereby alleviating the problems of cumbersome manual operation, reliance on manual loop connection, low standardization, difficulty in change maintenance and inconvenience of reuse in the prior art.
[0006] Technical solution: The automatic drawing generation method for secondary cabinets based on modular configuration described in this invention includes the following steps:
[0007] A module library is constructed, which stores macro files corresponding to the equipment or circuits of the secondary cabinet. The macro files have macro file addresses and contain variable numbers. Different variable numbers correspond to different graphic representations of the same equipment or the same circuit in different drawing types.
[0008] A module mapping file is established, which includes a template object corresponding to a device or loop. The template object is used to record the configuration attribute information of the device or loop. The configuration attribute information includes at least the macro file address, variable number, insertion point coordinates, and relative coordinates, wherein the relative coordinates are the coordinate offset of the output connection point relative to the insertion point.
[0009] Create a UI object data model, which includes a cabinet UI object and sub-UI objects; define the template object in the module mapping file as a member attribute of the corresponding UI object, establish a mapping relationship between the corresponding UI object and the template object, and complete the modular configuration;
[0010] Obtain and parse the cabinet configuration information, create instances of the cabinet interface object and the sub-interface object based on the parsing results, and match the corresponding template object from the module mapping file according to the cabinet configuration information;
[0011] In response to the drawing export command, the macro file address is obtained through the template object associated with the instance of the cabinet interface object and the sub-interface object. The corresponding variable number is determined according to the type of the drawing to be generated. The corresponding macro file is called according to the macro file address and the variable number. The module corresponding to the called macro file is inserted into the drawing page according to the insertion point coordinates.
[0012] For modules with output connection points, the actual coordinates of each output connection point are determined based on the insertion point coordinates and relative coordinates. Using the actual coordinates of each output connection point as the insertion position, other related modules are inserted into the corresponding actual coordinate positions to establish the connection relationship between the related modules and the output connection points. This allows for the automatic splicing of each module to generate secondary cabinet drawings that include schematic diagrams, overview diagrams, and layout diagrams.
[0013] Preferably, the module library includes cabinet macro files, power circuit macro files, and functional module macro files; the cabinet macro files correspond to the secondary switch cabinet, the power circuit macro files correspond to the power supply circuits of the equipment within the secondary switch cabinet, and the functional module macro files include equipment macros, input circuit macros, and output circuit macros; the power circuit macro files include DC power circuit macros and AC power circuit macros, the DC power circuit macros include power distribution macros and DC power module macros, and the AC power circuit macros include power input macros, AC power module macros, and lighting fan circuit macros.
[0014] Preferably, in the module mapping file, each device node records its component number, brand, function category, default identifier, variable number, insertion point coordinates, macro file address, and output connection point list; each loop node records its macro file address, variable number, insertion point coordinates, and relative coordinates; and each output connection point in the output connection point list records its relative coordinates to the insertion point.
[0015] Preferably, the module mapping file further includes a component brand mapping table, which records the component numbers corresponding to devices of the same functional category under different brands; when the device brand changes, the component number corresponding to the changed brand is obtained according to the component brand mapping table, and the corresponding template object is re-matched based on the changed component number.
[0016] Preferably, the cabinet interface object includes a front interface object and a rear interface object, and both the front interface object and the rear interface object include one or more guide rail interface objects, each of the guide rail interface objects including one or more device interface objects; the sub-interface object includes the guide rail interface object and the device interface object.
[0017] Preferably, the cabinet configuration information includes the number of cabinet rails and the category information of the functional modules on each rail; the step of matching the corresponding template object from the module mapping file based on the cabinet configuration information includes: creating a corresponding cabinet interface object instance based on the number of cabinet rails and matching the corresponding cabinet template object; creating a device interface object instance based on the category information of the functional modules on each rail, and filtering a set of template objects from the module mapping file based on the functional category and brand of the device interface object, and selecting the template object with a default true value in the set of template objects as a member attribute of the device interface object.
[0018] Preferably, the generation of secondary cabinet drawings, including schematic diagrams, overview diagrams, and layout diagrams, includes:
[0019] When generating the schematic, the corresponding macro file is called according to the macro file address of each template object and the variable number corresponding to the schematic. The macro file is inserted into the schematic page according to the coordinates of the insertion point, and the power circuit, functional module circuit and communication circuit are automatically spliced according to the actual coordinates of the output connection point.
[0020] When generating the overview map, the corresponding macro file is called according to the variable number corresponding to the overview map of each template object, and the devices are inserted into the overview map page in the order of device installation. The insertion point coordinates of the next module are calculated based on the width of the already inserted modules. When the insertion position exceeds the page boundary, a new overview map page is created to continue inserting.
[0021] When generating the layout diagram, the cabinet macro file is called and inserted into the layout diagram page. Based on the equipment type information configured in each guide rail in the cabinet template, the equipment is matched to the corresponding guide rail according to its function category. The corresponding macro file is called and placed on the guide rail according to the variable number corresponding to the layout diagram of the equipment template object. If there is insufficient space remaining on the current guide rail, the process switches to the next guide rail of the same type to continue placing the equipment.
[0022] Secondly, the modular configuration-based automatic drawing generation system for secondary cabinets according to the present invention includes:
[0023] The module library module is used to build a module library. The module library stores macro files corresponding to the equipment or circuits of the secondary cabinet. The macro files have macro file addresses and contain variable numbers. Different variable numbers correspond to different graphic representations of the same equipment or the same circuit in different drawing types.
[0024] The mapping configuration module is used to create a module mapping file. The module mapping file includes a template object corresponding to a device or loop. The template object is used to record the configuration attribute information of the device or loop. The configuration attribute information includes at least the macro file address, variable number, insertion point coordinates, and relative coordinates.
[0025] The modular configuration module is used to create a data model of interface objects, including cabinet interface objects and sub-interface objects, define template objects as member attributes of the corresponding interface objects, and establish a mapping relationship between the corresponding interface objects and template objects.
[0026] The matching module is used to obtain and parse the cabinet configuration information, create instances of cabinet interface objects and sub-interface objects based on the parsing results, and match the corresponding template objects.
[0027] The drawing module is used to respond to the drawing export command. It obtains the macro file address through the template object associated with the interface object instance, determines the corresponding variable number according to the type of the drawing to be generated, calls the corresponding macro file, and determines the actual coordinates of the output connection point based on the insertion point coordinates and relative coordinates, so as to automatically stitch together the various modules and generate the secondary cabinet drawing.
[0028] Thirdly, the present invention also provides an electronic device, including a processor, a memory, and a communication bus. The communication bus is used to realize the communication connection between the processor and the memory. The memory stores a computer program. When the computer program is executed by the processor, the electronic device executes the automatic drawing method for secondary cabinets based on modular configuration.
[0029] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the electronic device performs the aforementioned method for automatic drawing generation of secondary cabinets based on modular configuration.
[0030] Beneficial Effects: Compared with the prior art, the present invention has the following significant advantages: 1. By constructing a module mapping file and establishing a mapping relationship between interface objects and template objects, and using the template object as a unified configuration carrier, the same interface object can automatically match and call the corresponding macro file according to the variable number under different drawing types, realizing the collaborative generation of multiple drawings such as schematic diagrams, overview diagrams, and layout diagrams. This eliminates the need for separate configuration or manual adjustment for each drawing type, alleviating the problems of tedious manual operation and repeated configuration of multiple drawings; 2. Based on the insertion point coordinates and output connection point relative coordinates recorded in the template object, the actual coordinates of the output connection points of each module are automatically calculated, and these coordinates are used as the insertion position of the associated module to complete the automatic splicing between modules. This eliminates the need for manual judgment of connection point positions and manual wiring, alleviating the problem of loop connection relying on manual operation and being prone to errors; 3. When the equipment brand or functional category changes, the module mapping file can be used to automatically connect the modules. The component brand mapping table automatically retrieves the corresponding component number after the change and re-matches the template object. The entire change process only requires modifying the configuration information, without manually replacing macro files page by page or reconnecting circuits, alleviating the difficulty of change maintenance; 4. The modularly configured cabinet interface objects and their template mapping relationships can be saved as standardized configuration templates. Subsequent new projects only need to import the cabinet configuration information and create interface object instances to automatically generate a complete set of drawings, without having to repeatedly establish mappings or reconfigure module parameters, alleviating the problem of inconvenience in reuse; 5. The module library is used to uniformly manage the macro files of all equipment and circuits. The same functional modules correspond to the same macro file address and variable number configuration in different projects. Multiple drawings are generated from the same template object, ensuring that the graphic representation of the same equipment in schematic diagrams, overview diagrams and layout diagrams is consistent across pages, alleviating the problem of differences in drawing styles between projects caused by low standardization. Attached Figure Description
[0031] Figure 1 This is a schematic diagram of the method flow of the present invention;
[0032] Figure 2 This is a schematic diagram of the hierarchical structure of the data model of the present invention;
[0033] Figure 3 This is a schematic diagram of the system structure of the present invention;
[0034] Figure 4 This is a schematic diagram of the computer storage medium structure of the present invention. Detailed Implementation
[0035] The technical solution of the present invention will be further described below with reference to the accompanying drawings. In this document, "module" refers to a graphic unit called by a macro file and inserted into a drawing page, which can correspond to a cabinet, equipment, input circuit, output circuit, or power circuit; "template object" is a structured configuration object in the module mapping file corresponding to an equipment or circuit; "associated module" is another module that has a preset circuit connection relationship with a certain output connection point and needs to be located or connected according to the actual coordinates of that output connection point. The above terms are only used to describe the implementation logic and do not limit the specific data format of the module mapping file.
[0036] I. Overall Process and Module Library Construction
[0037] Figure 1 This is a flowchart illustrating an optional automatic drawing generation method for secondary cabinets according to an embodiment of the present invention, including steps S101 to S105. S101 involves building a module library, creating macro files, and configuring variable identifiers; S102 involves establishing a module mapping file, recording macro file addresses, variable numbers, insertion point coordinates, relative coordinates of output connection points, and device or loop configuration attributes; S103 involves creating an interface object data model and associating template objects as member attributes of the interface object; S104 involves acquiring and parsing cabinet configuration information, creating interface object instances, and matching template objects; S105 involves responding to drawing export commands by calling macro files, calculating the actual coordinates of output connection points, inserting associated modules, and establishing connection relationships.
[0038] In S101, to ensure consistent drawing representation across different designers and projects, standard macro files are pre-created in the power design software according to functional type, forming a module library. Cabinet macro files, power circuit macro files, and functional module macro files are all saved as macro files. Equipment macros, input circuit macros, output circuit macros, and macro files for DC power supplies, AC power supplies, lighting fans, etc., respectively cover the cabinet entity and its typical electrical relationships. Each macro file is located by a unique macro file address, enabling subsequent programs to accurately read the corresponding resources.
[0039] For the same equipment or circuit, schematic diagrams emphasize electrical connections, overview diagrams emphasize equipment combinations, and layout diagrams emphasize installation locations. Therefore, these three types of drawings require different graphical representations. To address this, variable numbers corresponding to each drawing type are set within the same macro file; for example, the first variable number can be used for schematic diagrams, the second for overview diagrams, and the third for layout diagrams. When performing an export operation, the program first determines the current drawing type, then maps that type to the corresponding variable number, and retrieves the applicable graphical representation from the macro file accordingly. The specific names, number, and encoding format of the variable numbers can be adapted to the power design software used.
[0040] II. Module mapping files, coordinates, and brand mapping
[0041] In S102, the module mapping file serves as a structured association between device parameters, loop parameters, and macro files. This file can be saved in XML format. In the XML implementation, the root node is the device configuration node, under which device nodes and loop nodes are set. Output connection points and sub-device nodes can be set under device or loop nodes. The component number serves as a unique identifier for the device, and the macro file address corresponds to a macro file in the module library. Variable numbers are used to select the required graphical representation from the macro file, such as a power loop, schematic diagram, or overview diagram. The insertion point coordinates record the absolute reference position of the macro file on the drawing page, and the relative coordinates record the offset of the loop's internal connection point relative to this reference position.
[0042] Below is an example of a module mapping file format. The field names in the example explain the data meaning: brandtype indicates the brand type, isdefault indicates the default identifier, partnr indicates the part number, marco indicates the macro file path, pwrvariant and variant can be associated with the power circuit and schematic variable numbers respectively, locationX and locationY indicate the insertion point coordinates, and the X and Y attributes of the Point element indicate the coordinate offset of the output connection point relative to the insertion point.
[0043] <?xml version="1.0" encoding="utf-8" ?>
[0044] <deviceconfig>
[0045] <device brandtype="HN" isdefault="true" partnr="OBL201" marco="...\OBL201_GroupHN.ema" pwrvariant="0;1">
[0046] <subcircuit variant="2;3" locationx="112" locationy="220">
[0047] <point X="0" Y="40" / >
[0048] < / subcircuit>
[0049] <subdevice type="HEAV-OEC-24" partnr="HEAV.HEAV-OEC-24" installdirection="2" isdefault="true" / >
[0050] <subdevice type="HEAV-OEC-08(ST / MM)" partnr="HEAV.HEAV-OEC-08(ST / MM)" installdirection="2" / >
[0051] < / device>
[0052] < / deviceconfig>
[0053] In this example, the Device node describes the device, the SubCircuit node describes the output connection point or loop segment corresponding to the device, and the SubDevice node describes the sub-device. Assuming the insertion point of the SubCircuit is (112, 220) and its Point element is (0, 40), the actual coordinates of the corresponding output connection point are (112, 260). When this connection point needs to connect to downstream electrical equipment, other loops, or related devices, the electronic device uses these actual coordinates as a positioning reference, calls the associated module, and establishes the corresponding connection relationship. Additional attributes such as brand, default identifier, and installation direction can also participate in equipment selection and layout.
[0054] In addition to device and loop configurations, the module mapping file also includes a component brand mapping table. This mapping table can be stored as a Device list under the Mapping node, listing the component numbers corresponding to different brands using the same functional category as an index. For example:
[0055] <device group="..." type="AI" category="...">
[0056] <material brand="RW" partnr="ZD_FAI108A-RW" / >
[0057] <material brand="HN" partnr="ZD_FAI108A" / >
[0058] < / device>
[0059] The Device element describes devices within the same functional category, while the Material element lists part numbers by brand. If project requirements or procurement batches lead to changes in device brands, electronic devices can first determine their functional category using the original part number, then obtain the part number corresponding to the new brand through the part brand mapping table, and re-select template objects that match the part number from the corresponding template object set, ensuring that the interface display parameters and subsequent output results are updated synchronously.
[0060] III. Matching Interface Object Data Model and Configuration
[0061] In S103, the software configuration interface organizes data hierarchically by project, plant, and cabinet, and can be displayed in a tree structure. Project interface objects contain plant interface objects, and plant interface objects contain cabinet interface objects. Each cabinet interface object distinguishes between a front and a back, with one or more guide rail interface objects configured on both sides. Each guide rail contains one or more device interface objects, such as... Figure 2 As shown.
[0062] The control panel interface objects reference template objects in the module mapping file to provide the overall equipment and circuit configuration range for the control panel. Each guide rail interface object and equipment interface object, as a sub-interface object, maintains its own template object set attribute and template object attribute. The template object set is filtered from the module mapping file based on function category and brand; the template object attribute represents the individual template object that actually matches it, which can be assigned a default identifier during initialization or selected by the designer in the configuration interface. Thus, each interface object can stably reference its corresponding template object, forming a mapping relationship from interface parameters to drawing modules.
[0063] In S104, import the cabinet configuration information file. This file records at least the cabinet identifier, cabinet layout information, number of guide rails, and equipment or functional module category information on each guide rail. After parsing, the electronic equipment first creates corresponding cabinet interface object instances based on the number of guide rails and matches them with cabinet template objects; then, it creates equipment interface object instances based on the functional module category information on each guide rail, filters the candidate template object set according to functional category and brand, and selects the template object with the default identifier True as the initial member attribute.
[0064] The automatic matching results can be used as the initial configuration rather than the final, immutable configuration. The brand of a device interface object can inherit the manufacturer type of its respective plant; when not explicitly specified, a default manufacturer type is used. Designers can adjust the device selection or device identifier before exporting. When a brand switch occurs, the program reselects the target template object based on the component brand mapping table, and then updates the corresponding interface parameters, without needing to manually search for macro files for each device.
[0065] IV. Drawing Export and Automatic Circuit Assembly
[0066] In S105, the module library, module mapping files, interface object instances, and template object matching are all prepared. For the selected cabinet, the electronic device generates a cover page, schematic diagram, overview diagram, layout diagram, and various reports in a preset order. The schematic diagram, overview diagram, and layout diagram are generated by calling macro files; the cover page and report pages are generated using preset templates. After all pages and report pages are generated, the electronic device sorts them according to the arrangement habits of secondary cabinet drawings to form a complete secondary cabinet drawing.
[0067] (a) Cover page generation
[0068] The electronic equipment creates a title page type drawing page and writes basic information such as cabinet model, cabinet dimensions, and designer information based on the cabinet configuration information. The fields used on the cover page can be defined by a preset template to ensure page consistency between the same project or different projects.
[0069] (II) Schematic diagram generation and assembly
[0070] The electronic device creates multi-line schematic drawing pages. The schematic includes power circuits, functional module circuits, and communication circuits. For each template object to be inserted, the electronic device reads the macro file address and the variable number corresponding to the schematic, calls the corresponding macro file, and inserts the module corresponding to the macro file into the page using the insertion point coordinates of the template object. For modules with multiple output connection points, the electronic device iterates through the relative coordinate list, calculates the actual coordinates of each output connection point, and positions and connects the devices or circuit modules associated with those output connection points according to the actual coordinates.
[0071] In the DC power supply circuit, a DC power supply circuit page is generated based on the configuration of the power consumption circuit. Within each page, a power distribution macro is inserted according to the insertion point coordinates of the power distribution module. Subsequently, the actual coordinates of each power output are determined based on the relative coordinates of each output connection point, and the power outputs are sequentially connected to the corresponding downstream electrical equipment. In the AC power supply circuit and lighting circuit, a power input macro is inserted within the same page according to the insertion point coordinates of the power input template, and a power module macro is inserted according to the insertion point coordinates of the power module template; both together form the AC power input and power supply circuit. For the fan lighting circuit, a fan power macro is inserted according to the insertion point coordinates of its template.
[0072] In a functional module loop, the electronic device can determine the macro file address based on the component number of the device template object, call the macro file using the schematic variable number, and insert it into the schematic page according to the insertion point coordinates, while automatically setting the device identifier. When a module has an associated loop with other device modules, the program locates the coordinates of the corresponding terminal in the loop of the inserted module, uses these terminal coordinates as the insertion position or connection positioning reference for the associated loop macro file, calls the associated loop macro file, and completes the splicing of different device module loops according to the connection relationship between the terminals.
[0073] In the communication loop, the communication master device macro is first inserted according to the insertion point coordinates of the communication template; then, the actual coordinates of each communication node are calculated based on the relative coordinates of the output connection point of the communication master device macro and its insertion point coordinates; finally, each communication loop macro is inserted or connected to the corresponding node position to realize the automatic splicing of the communication master device loop and each communication loop.
[0074] (III) Generation of Overview Map
[0075] Electronic devices create overview view type drawing pages, processing template objects sequentially according to the installation order of each device. For each template object, a macro file is invoked using the variable number corresponding to the overview view, and the module is inserted into the overview view page according to the current insertion point coordinates. After insertion is complete, the insertion point coordinates of the next module are calculated based on the width of the current module, thus achieving sequential splicing of device modules. When the next insertion position exceeds the current page boundary, a new overview view page is automatically created and insertion continues.
[0076] (iv) Generation of layout diagram
[0077] The electronic equipment installation board layout drawing page is created by first calling the cabinet macro file based on the cabinet template object and inserting it into the page. Then, the device type information configured for each rail in the cabinet template is read, and each device in the cabinet is matched to the corresponding rail according to its function category. Next, the macro file is called based on the layout variable number of the device template object to place the device module onto the corresponding rail. When the remaining space on the current rail is insufficient, the program automatically switches to the next rail of the same type to continue placement. After all devices are placed, a secondary cabinet layout drawing is obtained.
[0078] (v) Report generation and drawing sorting
[0079] Once the drawings are generated, the electronic equipment automatically produces a bill of materials, catalog, equipment connection diagrams, and terminal diagrams based on preset report templates. Subsequently, the electronic equipment sorts the cover page, schematic diagram, overview diagram, layout diagram, and various report pages to form complete secondary cabinet drawings that can be directly used for design, manufacturing, installation, commissioning, and operation and maintenance. After importing the cabinet configuration information, designers only need to confirm or adjust the equipment selection and equipment identifiers as necessary to batch complete the secondary cabinet drawing output.
[0080] V. System, Electronic Equipment, and Storage Media Implementation Methods
[0081] Based on the same technical concept, the automatic drawing generation system for secondary cabinets may include a module library module, a mapping configuration module, a modular configuration module, a matching module, and a drawing generation module. The module library module is used to establish a macro file library and manage variable numbers; the mapping configuration module is used to establish module mapping files including template objects; the modular configuration module is used to establish cabinet interface objects and sub-interface objects and associate them with template objects; the matching module is used to parse cabinet configuration information, create interface object instances, and match template objects; the drawing generation module is used to call macro files according to the drawing type, determine the actual coordinates of output connection points, stitch together associated modules, and output secondary cabinet drawings.
[0082] like Figure 3 As shown, the system can be deployed on an electronic device 800 including a processor 81, a memory 82, and a communication bus 83. The communication bus 83 enables communication between the processor 81 and the memory 82; the memory 82 stores data such as the automatic drawing program for the secondary cabinet, module mapping files, cabinet configuration information, macro file addresses, and preset drawing templates; the processor 81 executes the program to perform operations such as module library establishment, mapping file processing, interface object creation, template object matching, macro file calling, coordinate calculation, module splicing, drawing generation, and sorting.
[0083] like Figure 4As shown, the computer storage medium 900 can store computer-executable instructions, namely, the automatic drawing generation program for the secondary cabinet. The computer storage medium can be a hard disk, solid-state drive, read-only memory, random access memory, flash memory, optical memory, or other non-transient computer-readable storage media. When the instructions are executed by the processor, the electronic device performs the aforementioned modular configuration, drawing type selection, macro file invocation, and automatic splicing operations.
[0084] This solution can be implemented as a method, system, electronic device, software, hardware, or a combination of software and hardware as a computer program product. The corresponding program instructions can be executed by a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to achieve the functions shown in the flowchart and system block diagram. The program instructions can also be stored in a computer-readable storage device or loaded onto a programmable data processing device to perform a series of operations, forming a computer implementation process corresponding to the aforementioned automatic drawing output process.
[0085] VI. Optional Implementation Methods
[0086] In the above embodiments, the module mapping file adopts XML format; however, JSON or other structured data formats may also be used without changing the meaning of data such as device or circuit configuration attributes, macro file addresses, variable numbers, insertion point coordinates, relative coordinates, and brand mapping relationships. The circuit macro file may adopt the window macro format supported by the power design software; alternatively, it may adopt the block file format supported by other computer-aided design software, such as DWG blocks or DXF blocks.
[0087] In the above implementation, the template object obtains an initial match by importing and parsing the cabinet configuration information file. Alternatively, designers can manually create interface object instances and select template objects in the configuration interface, and then perform the same macro file call, coordinate calculation, and module splicing process. The drawing type, variable number format, interface object hierarchy, and automatic splicing order can be adjusted according to the engineering design software and project rules. As long as the technical concept of this invention remains based on the mapping between template objects and interface objects, macro file calls based on drawing types, and automatic positioning based on the relative coordinates of the insertion point and output connection point, the invention can be realized.
Claims
1. A method for automatic drawing generation of secondary cabinets based on modular configuration, characterized in that, Includes the following steps: A module library is constructed, which stores macro files corresponding to the equipment or circuits of the secondary cabinet. The macro files have macro file addresses and contain variable numbers. Different variable numbers correspond to different graphic representations of the same equipment or the same circuit in different drawing types. A module mapping file is established, which includes a template object corresponding to a device or loop. The template object is used to record the configuration attribute information of the device or loop. The configuration attribute information includes at least the macro file address, variable number, insertion point coordinates, and relative coordinates, wherein the relative coordinates are the coordinate offset of the output connection point relative to the insertion point. Create a UI object data model, which includes a cabinet UI object and sub-UI objects; define the template object in the module mapping file as a member attribute of the corresponding UI object, establish a mapping relationship between the corresponding UI object and the template object, and complete the modular configuration; Obtain and parse the cabinet configuration information, create instances of the cabinet interface object and the sub-interface object based on the parsing results, and match the corresponding template object from the module mapping file according to the cabinet configuration information; In response to the drawing export command, the macro file address is obtained through the template object associated with the instance of the cabinet interface object and the sub-interface object. The corresponding variable number is determined according to the type of the drawing to be generated. The corresponding macro file is called according to the macro file address and the variable number. The module corresponding to the called macro file is inserted into the drawing page according to the insertion point coordinates. For modules with output connection points, the actual coordinates of each output connection point are determined based on the insertion point coordinates and relative coordinates. Using the actual coordinates of each output connection point as the insertion position, other related modules are inserted into the corresponding actual coordinate positions to establish the connection relationship between the related modules and the output connection points. This allows for the automatic splicing of each module to generate secondary cabinet drawings that include schematic diagrams, overview diagrams, and layout diagrams.
2. The method according to claim 1, characterized in that, The module library includes cabinet macro files, power circuit macro files, and functional module macro files. The cabinet macro files correspond to the secondary switch cabinet, the power circuit macro files correspond to the power supply circuits of the equipment within the secondary switch cabinet, and the functional module macro files include equipment macros, input circuit macros, and output circuit macros. The power circuit macro files include DC power circuit macros and AC power circuit macros. The DC power circuit macros include power distribution macros and DC power module macros, and the AC power circuit macros include power input macros, AC power module macros, and lighting fan circuit macros.
3. The method according to claim 1, characterized in that, In the module mapping file, each device node records its component number, brand, function category, default identifier, variable number, insertion point coordinates, macro file address, and output connection point list; each loop node records its macro file address, variable number, insertion point coordinates, and relative coordinates; and each output connection point in the output connection point list records its relative coordinates to the insertion point.
4. The method according to claim 3, characterized in that, The module mapping file also includes a component brand mapping table, which records the component numbers corresponding to devices of the same functional category under different brands. When the device brand changes, the component number corresponding to the changed brand is obtained according to the component brand mapping table, and the corresponding template object is re-matched based on the changed component number.
5. The method according to claim 1, characterized in that, The cabinet interface object includes a front interface object and a rear interface object. Both the front interface object and the rear interface object include one or more guide rail interface objects. Each guide rail interface object includes one or more device interface objects. The sub-interface object includes the guide rail interface object and the device interface object.
6. The method according to claim 5, characterized in that, The cabinet configuration information includes the number of cabinet rails and the category information of functional modules on each rail. Matching the corresponding template object from the module mapping file based on the cabinet configuration information includes: creating a corresponding cabinet interface object instance based on the number of cabinet rails and matching the corresponding cabinet template object; creating a device interface object instance based on the category information of functional modules on each rail; and filtering a set of template objects from the module mapping file based on the functional category and brand of the device interface object, selecting template objects with a default true value from the set of template objects as member attributes of the device interface object.
7. The method according to claim 1, characterized in that, The generation of secondary cabinet drawings, including schematic diagrams, overview diagrams, and layout diagrams, includes: When generating the schematic, the corresponding macro file is called according to the macro file address of each template object and the variable number corresponding to the schematic. The macro file is inserted into the schematic page according to the coordinates of the insertion point, and the power circuit, functional module circuit and communication circuit are automatically spliced according to the actual coordinates of the output connection point. When generating the overview map, the corresponding macro file is called according to the variable number corresponding to the overview map of each template object, and the devices are inserted into the overview map page in the order of device installation. The insertion point coordinates of the next module are calculated based on the width of the already inserted modules. When the insertion position exceeds the page boundary, a new overview map page is created to continue inserting. When generating the layout diagram, the cabinet macro file is called and inserted into the layout diagram page. Based on the equipment type information configured in each guide rail in the cabinet template, the equipment is matched to the corresponding guide rail according to its function category. The corresponding macro file is called and placed on the guide rail according to the variable number corresponding to the layout diagram of the equipment template object. If there is insufficient space remaining on the current guide rail, the process switches to the next guide rail of the same type to continue placing the equipment.
8. An automatic drawing generation system for secondary cabinets based on modular configuration, characterized in that, include: The module library module is used to build a module library. The module library stores macro files corresponding to the equipment or circuits of the secondary cabinet. The macro files have macro file addresses and contain variable numbers. Different variable numbers correspond to different graphic representations of the same equipment or the same circuit in different drawing types. The mapping configuration module is used to create a module mapping file. The module mapping file includes a template object corresponding to a device or loop. The template object is used to record the configuration attribute information of the device or loop. The configuration attribute information includes at least the macro file address, variable number, insertion point coordinates, and relative coordinates. The modular configuration module is used to create a data model of interface objects, including cabinet interface objects and sub-interface objects, define template objects as member attributes of the corresponding interface objects, and establish a mapping relationship between the corresponding interface objects and template objects. The matching module is used to obtain and parse the cabinet configuration information, create instances of cabinet interface objects and sub-interface objects based on the parsing results, and match the corresponding template objects. The drawing module is used to respond to the drawing export command. It obtains the macro file address through the template object associated with the interface object instance, determines the corresponding variable number according to the type of the drawing to be generated, calls the corresponding macro file, and determines the actual coordinates of the output connection point based on the insertion point coordinates and relative coordinates, so as to automatically stitch together the various modules and generate the secondary cabinet drawing.
9. An electronic device, characterized in that, The device includes a processor, a memory, and a communication bus, wherein the communication bus is used to establish a communication connection between the processor and the memory, the memory stores a computer program, and when the computer program is executed by the processor, the electronic device performs the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the electronic device to perform the method described in any one of claims 1 to 7.
