Disclosure of Invention
In order to solve the technical problems, the invention aims to provide a method, a system, a device and a storage medium for processing reserved equipment in batches quickly.
The first technical scheme adopted by the invention is as follows:
a method of fast processing a reservation device, comprising the steps of:
acquiring equipment resources which need to be reserved, and adding the equipment resources into a preset reserved equipment list;
and marking the equipment resources in the reserved equipment list in sequence according to a preset reservation standard until the equipment resources in the reserved equipment list are traversed.
Further, the step of acquiring the device resource to be subjected to reservation processing and adding the device resource to a preset reserved device list specifically includes the following steps:
after the input folder selection information is obtained, selecting a first folder according to the folder selection information;
sequentially acquiring all subfolders in the selected folder, and generating a folder set according to the acquired subfolders;
traversing a second folder in the folder set in sequence, and selecting the second folder as equipment resources needing reservation processing according to a preset selection mode;
and importing the equipment resources into a simulation interface, and adding the equipment resources into a preset reserved equipment list.
Further, the step of acquiring the equipment resource to be subjected to reservation processing and adding the equipment resource to a preset reserved equipment list specifically includes:
after the input device selection information is acquired, acquiring device resources which need to be reserved according to the device selection information, and adding the device resources into a preset reserved device list.
Further, the step of sequentially marking the device resources in the reserved device list according to the preset reservation standard until the device resources in the reserved device list are traversed, specifically includes the following steps:
acquiring equipment resources from the reserved equipment list in sequence, and marking the equipment resources according to a preset reserved standard;
acquiring line body information and station information of equipment resources, and creating a root node according to the line body information;
after creating a child node under the root node according to the station information, adding equipment resources under the child node;
and traversing the next equipment resource in turn until the equipment resource in the reserved equipment list is traversed.
Further, the method also comprises the following steps:
and after the input recovery information is obtained, recovering the equipment resources subjected to the marking processing to the original state according to the recovery information.
The second technical scheme adopted by the invention is as follows:
a system for fast processing of reserved devices, comprising:
the selection module is used for acquiring equipment resources which need to be reserved and adding the equipment resources into a preset reserved equipment list;
the marking module is used for sequentially marking the equipment resources in the reserved equipment list according to a preset reservation standard until the equipment resources in the reserved equipment list are traversed.
Further, the selection module comprises an acquisition unit, a collection unit, a selection unit and an importing unit;
the acquisition unit is used for selecting the folder according to the folder selection information after acquiring the input folder selection information;
the collection unit is used for sequentially acquiring all subfolders in the selected folder and generating a folder collection according to the acquired subfolders;
the selecting unit is used for traversing folders in the folder set in sequence and selecting the folders as equipment resources needing to be reserved according to a preset selecting mode;
the importing unit is used for importing the equipment resources into the simulation interface and adding the equipment resources into a preset reserved equipment list.
Further, the marking module comprises a marking processing unit, a node creating unit, a node adding unit and a traversing unit;
the marking processing unit is used for sequentially acquiring equipment resources from the reserved equipment list and marking the equipment resources according to a preset reserved standard;
the node creation unit is used for acquiring line body information and station information of the equipment resource and creating a root node according to the line body information;
the node adding unit is used for adding equipment resources under the child nodes after creating the child nodes under the root node according to the station information;
the traversing unit is used for sequentially traversing the next equipment resource until the equipment resource in the reserved equipment list is traversed.
The third technical scheme adopted by the invention is as follows:
an automatic generation device of computer code, the memory for storing at least one program, the processor for loading the at least one program to perform the method described above.
The fourth technical scheme adopted by the invention is as follows:
a storage medium having stored therein processor executable instructions which when executed by a processor are for performing the method as described above.
The beneficial effects of the invention are as follows: according to the invention, the equipment resources needing to be subjected to marking processing are selected in batches, and then the equipment resources needing to be subjected to the marking processing are automatically subjected to the marking processing according to the preset reservation standard, so that batch one-key processing of the reserved equipment is realized, users do not need to process the reserved equipment one by one, the time of simulation personnel is greatly saved, and the working efficiency of engineers is improved.
Detailed Description
Example 1
As shown in fig. 1, the present embodiment provides a method for rapidly processing a reserved device, which includes the following steps:
s1, acquiring equipment resources which need to be reserved, and adding the equipment resources into a preset reserved equipment list;
s2, marking the equipment resources in the reserved equipment list in sequence according to a preset reservation standard until the equipment resources in the reserved equipment list are traversed.
According to the method provided by the embodiment, development is performed based on the secondary development interface provided by Process Simulation software, and after a user selects resources required to be set as reserved equipment in batches, the equipment resources are automatically added into a preset reserved equipment list. After the user finishes selecting, inputting operation information, and directly marking equipment resources to be subjected to reservation processing according to a preset reservation standard, for example, setting the color of the equipment to be gray, and changing the transparency, wherein the reservation standard records the color and the transparency value to be changed. Different reservation criteria are used for different phases of the device, such as the device in the second phase is marked gray and the device in the third phase is marked light brown. By the method, users do not need to process the reserved equipment one by one, so that the time of simulation personnel is greatly saved, and the working efficiency of engineers is improved.
The program core of the method of the embodiment is: for obtaining equipment resources to be processed into reserved equipment, the program has two operation logics, if a user selects to browse folders and selects a folder, the program firstly calls a secondary development interface to execute the imported resources into a software simulation environment by equipment which is not imported into Process Simulation software, then adds the resources into a reserved equipment list, and executes the operation of processing into reserved equipment; if the user selects the existing equipment resources in the simulation environment, the selected equipment is automatically added into the reserved equipment list by the selected program, the user can continue to select, and after the selection is finished, clicking operation can execute the operation of processing all the equipment in the set into reserved equipment in batches. Thus, step S1 may choose to acquire device resources in two ways, the first: if the user clicks the browse folder button, a dialog box is popped up, and the user directly selects a folder. The second way is: and the user selects the reserved equipment to be processed one by one on the simulation interface.
In the first mode, the method specifically comprises the steps A1 to A4:
a1, after acquiring input folder selection information, selecting a first folder according to the folder selection information;
a2, sequentially acquiring all subfolders in the selected folder, and generating a folder set according to the acquired subfolders;
a3, traversing the second folders in the folder set in sequence, and selecting the second folders as equipment resources needing to be reserved according to a preset selection mode;
and A4, importing the equipment resources into a simulation interface, and adding the equipment resources into a preset reserved equipment list.
When the user selects a folder in the dialog box, the program will perform the following steps:
(1) And acquiring all subfolders under the selected folder, and adding all subfolders into the folder set.
(2) Automatically calling a secondary development interface, traversing the folder set, and importing folders with file names ending with 'cojt' in the folder set into simulation software as equipment resources one by one.
(3) The device resources are added into the reserved device list, corresponding display is provided on the plug-in page, and the user can select the device resources to be added into the reserved device list on the software resource tree or in the three-dimensional window.
When the second mode is adopted, the method specifically comprises the following steps: after the input device selection information is acquired, acquiring device resources which need to be reserved according to the device selection information, and adding the device resources into a preset reserved device list.
If all the equipment resources in the simulation environment are required to be set by the user, the equipment resources can be selected on a software resource tree or in a three-dimensional window, and the program automatically adds the selected objects of the user into a reserved equipment list.
The operation of marking the equipment resources in the reserved equipment list is how to reserve the equipment, different customers have different standards, the reserved processing standards for the second-stage, third-stage or fourth-stage engineering are different, and the processing standards of different customers are read by the program background and are processed according to the standards. Specifically, step S2 specifically includes the steps of
S21, acquiring equipment resources from a reserved equipment list in sequence, and marking the equipment resources according to a preset reserved standard;
s22, acquiring line body information and station information of the equipment resource, and creating a root node according to the line body information;
s23, after creating a child node under the root node according to the station information, adding equipment resources under the child node;
s24, traversing the next equipment resource in sequence until the equipment resource in the reserved equipment list is traversed.
When the user clicks the "Apply" button, the program starts to traverse from the first element in the reserved device list, and let the current device element be i, specifically performs the following steps:
(1) And acquiring a 'reservation standard' and a 'reservation period number' selected by a user on a plug-in page, wherein the 'reservation standard' and the 'reservation period number' are selected and reserved by the user, reading a standard file in an xml format, and finding a corresponding reservation standard according to the standard and the reservation period number set by the user.
(2) Processing the device i into a reserved device according to the reserved standard, such as setting the color of the device i, and changing the transparency.
(3) And circularly searching the parent level of the equipment i upwards to acquire the line body and the station where the equipment i is located. Calling the secondary development interface, automatically creating a corresponding root node named by a line body in 'Logical Collections Tree', creating a child node named by a station under the root node of the line body, and adding the equipment i under the child node of the station by the program.
(4) After the current equipment element i is processed, traversing the next element is started until the elements in the reserved equipment list are traversed.
In addition, if the user selects "add tag", the program will add a tag to device i during the process of traversing each device element, to indicate which period of reserved device.
Further as a preferred embodiment, the method further comprises the steps of:
and after the input recovery information is obtained, recovering the equipment resources subjected to the marking processing to the original state according to the recovery information.
The transparency change is reversible, and the user can use the "shared" command to change the reserved device from transparent to the entity display mode as required, but if the color is to be changed from gray to the original color, the color of each part of the device in the simulation device is not easy, for example, the robot body is one color, the pipeline is another color, if the original color is to be recovered, each part needs to be clicked and the color is to be changed, and other devices such as a clamp, a workbench and the like usually need to click the "Set Modeling" command, so that the device enters the editing mode, and then the parts are clicked one by one to recover the color, which is tedious and takes a certain time.
Therefore, the embodiment sets a one-key recovery function, and specifically sets a "Unreserve" key, through which the color and transparency of the reserved device are recovered to the original state, and the user does not need to set the color and transparency by one part, so that the user can conveniently and quickly recover the data, and the working efficiency of engineers is greatly improved.
The method only needs the user to select the resource to be set as the reserved equipment, realizes batch one-key processing of the reserved equipment, and when the user introduces the reserved equipment resource and the resource is introduced into the simulation environment, the program processes the resource into the reserved equipment, thereby being convenient and quick, greatly saving the time of simulation personnel, being very convenient for the user to restore the original color and transparency, and only needing one-key restoration without checking the RGB value of the original color of the equipment resource for manual restoration.
Example two
As shown in fig. 2, the present embodiment provides a system for fast processing a reserved device, including:
the selection module is used for acquiring equipment resources which need to be reserved and adding the equipment resources into a preset reserved equipment list;
the marking module is used for sequentially marking the equipment resources in the reserved equipment list according to a preset reservation standard until the equipment resources in the reserved equipment list are traversed.
Further as a preferred embodiment, the selection module includes an acquisition unit, a collection unit, a selection unit, and an import unit;
the acquisition unit is used for selecting the folder according to the folder selection information after acquiring the input folder selection information;
the collection unit is used for sequentially acquiring all subfolders in the selected folder and generating a folder collection according to the acquired subfolders;
the selecting unit is used for traversing folders in the folder set in sequence and selecting the folders as equipment resources needing to be reserved according to a preset selecting mode;
the importing unit is used for importing the equipment resources into the simulation interface and adding the equipment resources into a preset reserved equipment list.
Further as a preferred embodiment, the marking module includes a marking processing unit, a node creating unit, a node adding unit, and a traversing unit;
the marking processing unit is used for sequentially acquiring equipment resources from the reserved equipment list and marking the equipment resources according to a preset reserved standard;
the node creation unit is used for acquiring line body information and station information of the equipment resource and creating a root node according to the line body information;
the node adding unit is used for adding equipment resources under the child nodes after creating the child nodes under the root node according to the station information;
the traversing unit is used for sequentially traversing the next equipment resource until the equipment resource in the reserved equipment list is traversed.
The system for rapidly processing the reserved equipment can execute the method for rapidly processing the reserved equipment provided by the first embodiment of the method, can execute any combination implementation steps of the method embodiment, and has corresponding functions and beneficial effects.
Example III
The present embodiment provides an automatic computer code generating apparatus, wherein the memory is configured to store at least one program, and the processor is configured to load the at least one program to perform the method of the first embodiment.
The automatic generation device of the computer code of the embodiment can execute the method for rapidly processing the reserved equipment provided by the first embodiment of the method of the invention, can execute any combination implementation steps of the method embodiment, and has the corresponding functions and beneficial effects of the method.
Example IV
The present embodiment provides a storage medium having stored therein processor-executable instructions which, when executed by a processor, are adapted to carry out the method of embodiment one.
The storage medium of the embodiment can execute the method for rapidly processing the reserved equipment provided by the first embodiment of the method of the invention, and can execute the steps in any combination of the embodiments of the method, thereby having the corresponding functions and beneficial effects of the method.
While the preferred embodiment of the present invention has been described in detail, the present invention is not limited to the embodiments, and those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention, and these equivalent modifications or substitutions are included in the scope of the present invention as defined in the appended claims.