Method and device for generating page file, computer storage medium and terminal
By integrating the VBA development environment into the configuration software, creating and editing VBA projects for each page file, the problem of the DCS system being unable to meet the page requirements of different nuclear power plants was solved, improving page design efficiency and system stability.
Patent Information
- Application Number
- CN202511087546.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-04
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-08-04
AI Technical Summary
In existing technologies, DCS systems cannot meet the personalized needs of different nuclear power plants for page styles and content, resulting in inefficient graphic page design and a significant waste of time and resources.
The VBA development environment is integrated into the configuration software to create a corresponding VBA project for each page file. The page component files are imported and edited, including document class submodules and type library files. The secondary development of page files is realized through VBA technology to meet the display requirements of different nuclear power plants.
It reduced the difficulty of page development and the consumption of human resources, improved the design efficiency and system stability of DCS pages, and enabled the adaptation of page display requirements for different nuclear power plants.
Smart Images

Figure CN120909586A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the distributed control technology, in particular to a method, device, computer storage medium and terminal for generating a page file. BACKGROUND
[0002] With the development of science and technology, the distributed control system (DCS) is widely applied to power, chemical industry, nuclear power, new energy and environmental protection and other fields. The field process of each field is different, and different pages need to be configured for displaying DCS alarms, logs, trends and field states; in addition, in the same field, such as the nuclear power field, different nuclear power stations have different requirements for the style and content of the page. In the related technology, the DCS provides a fixed set of graphic pages including basic display functions such as alarms, logs, trends and lists. This implementation cannot meet the needs of different nuclear power stations for different pages; designing corresponding graphic pages for different nuclear power stations requires a large amount of time and resources, and the efficiency is extremely low. How to improve the design quality of the graphic pages of the nuclear power station has become a problem to be solved. SUMMARY
[0003] The embodiment of the present application provides a method for generating a page file, comprising: integrating a VBA development environment in the configuration software, and creating a corresponding VBA project for each page file created in advance; in each VBA project, importing a corresponding page composition file, wherein the page composition file is the composition of the page file, the page composition file includes an editable document class submodule and one or more type library files, and further includes a page composition definition submodule and a page composition calling submodule created in advance according to the composition of the distributed control system (DCS), the page composition calling submodule is called through the document class submodule, the document class submodule includes one or more event response functions for flow control of the execution of the page file, and the type library file contains an interface function set for implementing the functional components included in the DCS; editing the editable page composition file imported into the VBA project according to the page composition information of the DCS determined in advance, so as to generate a page file deployed on an operator station.
[0004] On the other hand, the embodiment of the present application also provides a computer storage medium, the computer storage medium stores a computer program, and the computer program is executed by a processor to realize the above-mentioned method for generating a page file.
[0005] In another aspect, the embodiment of the present application also provides a terminal, comprising a memory and a processor, the memory stores a computer program; wherein, the processor is configured to execute the computer program in the memory; The computer program, when executed by the processor, implements the method of generating a page file as described above.
[0006] In still another aspect, the embodiments of the present application further provide an apparatus for generating a page file, comprising: The embodiments of the present disclosure integrate the VBA development environment in the configuration software, and create a corresponding VBA project for each page file, so as to realize the isolation of the functions of the page file from the configuration software, reduce the difficulty of page development through the isolation of the page file and the configuration software, import the page composition file into the VBA project, provide a basis for the editing of the page composition file based on the VBA technology, and provide an architectural basis for the secondary development of the DCS page; the page developer edits the editable page composition file imported into the VBA project in the VBA environment according to the pre-determined page composition information of the DCS, so as to provide a basis for generating the DCS page of the operator station in different industrial sites, and different DCS pages only need to be edited through the editable page composition file, thereby reducing the time and human resource consumption of the DCS page development and improving the efficiency of the DCS page.
[0007] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent to those skilled in the art from the description, or can be learned by practice of the present application. Other advantages of the present application can be realized and attained by means of the instrumentalities and combinations particularly pointed out in the description and appended claims. BRIEF DESCRIPTION OF DRAWINGS
[0008] The accompanying drawings are included to provide a further understanding of the technical scheme of the present application, and constitute a part of the specification, and are used to explain the technical scheme of the present application together with the embodiments of the present application, and do not constitute a limitation on the technical scheme of the present application.
[0009] Figure 1 A flow chart of the method for generating a page file of the embodiments of the present disclosure is shown in FIG. 1; Figure 2 A structural block diagram of the apparatus for generating a page file of the embodiments of the present disclosure is shown in FIG. 2. DETAILED DESCRIPTION
[0010] The present application describes a plurality of embodiments, but the description is exemplary rather than limiting, and it is obvious to those skilled in the art that there can be more embodiments and implementation schemes within the scope of the embodiments described in the present application. Although many possible combinations of features are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment can be used with any other feature or element of any other embodiment, or can replace any other feature or element of any other embodiment.
[0011] This application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed herein can also be combined with any conventional feature or element to form unique inventive solutions. Any feature or element of any embodiment can also be combined with features or elements from other inventive solutions to form another unique inventive solution. Therefore, it is to be understood that any feature shown and / or discussed in the present application can be implemented alone or in any suitable combination. Accordingly, except as it may be otherwise limited, the embodiments are not limited to the other limitations as set forth in the following claims and equivalents thereof.
[0012] Furthermore, in describing representative embodiments, the specification can have presented the method and / or process as a particular sequence of steps. However, to the extent that the method or process depends on more than one step, the method or process should not be limited to the particular sequence of steps described. Other sequences of steps can be possible, and are within the scope of the embodiments. Thus, man skilled in the art will appreciate that the specific order of the steps in the methods and processes described herein is not to be taken as a limitation of the claimed embodiments. Furthermore, the claims should not be limited to the steps of the methods and / or processes in the order written, and one skilled in the art can readily understand that many modification and permutations of the methods and processes are possible that are still within the spirit and scope of the embodiments.
[0013] Figure 1 A flowchart of a method for generating a page file for an embodiment of the present disclosure is shown in FIG. 1, which includes: Figure 1 Step 101, integrating a VBA development environment in configuration software, and creating a corresponding VBA project for each page file created in advance; Step 102, importing a corresponding page composition file in each VBA project, wherein the page composition file is a composition of the page file, the page composition file includes an editable document class submodule and one or more type library files, and further includes a page composition definition submodule and a page composition calling submodule created in advance according to the composition of a distributed control system (DCS), the page composition calling submodule is called through the document class submodule, the document class submodule includes one or more event response functions defined in advance for flow control of execution of the page file, and the type library file contains an interface function set for implementing functional components contained in the DCS; Step 103, editing the editable page composition file imported in the VBA project according to the page composition information of the DCS determined in advance, to generate a page file deployed on an operator station.
[0014] The embodiment of the present disclosure integrates a VBA development environment in configuration software, and creates a corresponding VBA project for each page file, so that the functions of the page file are isolated from the configuration software, the difficulty of page development is reduced through the isolation of the page file and the configuration software; the page composition file is imported into the VBA project, and the editing of the page composition file is based on the VBA technology, thereby providing a framework for the secondary development of the DCS page; the page developer edits the editable page composition file imported into the VBA project in the VBA environment according to the pre-determined page composition information of the DCS, thereby providing a basis for generating the DCS page of the operator station in different industrial sites, and different DCS pages only need to be edited by editing the editable page composition file, so that the time and human resource consumption of the DCS page development are reduced, and the efficiency of the DCS page is improved.
[0015] The embodiment of the present disclosure provides a page file generation method based on VBA, and the page file is edited by configuration graphics and a VBA project; without modifying the configuration software, the page composition file of the configuration can meet different requirements of different nuclear power sites for the display page of the operator station; for example, in a second-phase reconstruction project of a certain nuclear power station, the alarm list is required to be displayed in black background, 30 rows of information are displayed on each page, and 10 rows of information are automatically scrolled up when the screen is full; in another nuclear project 1 / 2 unit, the alarm list is required to be displayed in gray alarm, 20 rows of information are displayed on each page, and 5 rows of information are automatically scrolled up when the screen is full; by using the method of the embodiment of the present disclosure, the adaptability of the page display of different nuclear power stations can be adjusted only by editing the configuration page file through the VBA project and adjusting the background color and the number of display items and scroll items of the page file in the VBA project, so that the system stability is improved, and the maintainability of the display page is ensured.
[0016] The configuration software of the embodiment of the present disclosure is a special software for data acquisition and process control, and is a software platform and development environment of the monitoring layer in an industrial automation system; a user can flexibly construct and configure the human-machine interface (HMI) and the monitoring and control logic function of the industrial automatic control system without writing a computer program; the embodiment of the present disclosure can take a single function page file as a configuration unit, and each function page file is defined as an independent file, such as a process system alarm page, a red alarm page, a yellow alarm page, a full log page, an operation log page, a basic system list, an analog quantity list, and a switching quantity list; the page file can be created by offline configuration software and can be edited in the offline configuration software; the edited page file can be saved as a single file, and the saved file can be downloaded to the operator station and loaded and called by the online software of the operator station.
[0017] In an exemplary instance, after the page file is created, the configuration software integrates the VBA development environment through the APC technology, and generates a corresponding VBA project for each page file; the VBA project of the page file can be opened and edited in the VBA development environment integrated by the configuration software.
[0018] The page file in step 101 contains pre-drawn graphic objects, and the graphic objects in the page file include the following one or any combination of basic objects generated by the configuration software according to the related art: chart element objects, text objects, line objects (straight lines, arcs and curves) and basic graphic objects (rectangles, circles and polygons, etc.); the page file can also include combination objects composed of one or more basic objects, for example, the combination objects can include an object containing both graphics and text formed by combining various basic objects together, such as a button, and icons corresponding to various devices (such as icons corresponding to a hand controller). The number of graphic objects in the page of the embodiment of the present disclosure can be determined by the developer; the graphic objects are divided into basic objects and combination objects, and the information of the basic objects includes: object ID number, object name, brush width, brush color, fill color, rotation angle, object length and width size, object configured property information, graphic flashing information, etc.; the information of the combination objects includes: the basic objects contained in the combination objects, and the information of the basic objects contained in the contained basic objects.
[0019] Take the octagon page of the key parameters of the nuclear reactor as an example: create a page file of a safety parameter display system (SPDS), add a chart element object (for drawing an octagon and a coordinate system) to the page file, add 8 text objects for displaying the current values of the eight key parameters (nuclear power, primary loop pressure, primary loop humidity, primary loop radioactivity, containment pressure, cold helium temperature, hot helium temperature, and primary loop flow ratio), draw a button graphic object (a combination object) for realizing left-click pop-up of a page file (another page) of detailed descriptions of 8 points, add a data reading (DataRead) submodule (responsible for calling an interface provided by a server for point values to read point values from a real-time server) in the VBA project corresponding to the page file; a point definition (PointDefine) submodule (defining variables of the eight points and calculating coordinate values of the display positions of the eight points in a chart control drawn by the chart element object); a drawing (LineDraw) submodule (responsible for calling an interface function provided by the chart control and responsible for drawing positions of the eight points in the chart control), a plurality of variables, arrays, and function sets are defined in each submodule, and a type library file for mathematical calculation in the VBA project is introduced to cooperatively complete the functions of the submodules. After the submodules are added in the VBA project, a document class submodule is edited, in an event response function of the document class submodule for displaying safety parameters, an initialization chart control function of the LineDraw submodule is called; a variable value initialization function of the PointDefine submodule is called; a function of reading current values of the eight key variables and two upper and lower limits is called; a background function of drawing an octagon of the LineDraw submodule is called; in the event response function, a function of drawing a real-time octagon in the LineDraw submodule is called. The embodiments of the present disclosure add a button response function of a button object for popping up detailed information of the eight points on the SPDS, for example, the button object is called Detail, a Detail_OnClick() event response function is edited, and opening operation of a small page of key parameter detailed information is added in the Detail_OnClick() event response function.
[0020] The page file in the embodiments of the present disclosure can include basic page composition information (page type, name, version, creation time, size, background color, and the like) of the page file, graphic objects in the page file, a document class submodule and one or more type library files imported into the VBA project, and a page composition definition submodule and a page composition calling submodule created in advance according to composition of a distributed control system (DCS).
[0021] In an exemplary instance, the document class submodule in the embodiments of the present disclosure is generated based on a page base code, the page base code including one or more event response functions for flow control of execution of a page file; the event response functions can be generated by using an editor commonly used by those skilled in the art with reference to related technologies.
[0022] The event response function of the mouse movement in the page base code in the embodiments of the present disclosure implements the following processing: ExeHSTriggerFeature nID, 4, 0, x, y / / running the interactive feature calling submodule, the parameter 4 represents mouse movement If nID = -1 Then / / if the mouse does not move to any graphic object MACSGraphView.HideTip / / hiding the tip information on the page (the tip information is a small label for prompting the functions of the graphic objects on the page when the mouse moves to the graphic objects on the page) EndIf.
[0023] In an exemplary instance, the interface function set in the embodiments of the present disclosure is used to expand the collection of various functions by adding a type library file to the VBA project. The embodiments of the present disclosure can provide various types of interface function sets through configuration software; the interface function set in the embodiments of the present disclosure can include a page display function set (such as displaying text content, displaying line color, setting graphic element flashing frequency, and redrawing a page) and a page interaction function set (such as opening another page, popping up another panel, and popping up a prompt information); the interface function set in the embodiments of the present disclosure is used to be called in the above steps to complete various dynamic displays.
[0024] In an exemplary instance, the embodiments of the present disclosure can import the page composition file in the order of first importing the document class submodule, then importing the type library, and finally importing the page composition definition submodule and the page composition calling submodule.
[0025] The embodiment of the present disclosure can import the type library file into the VBA project, which can include adding the type library file related to the functional components contained in the DCS to the page file; the type library file can include the operating system type library file and the custom type library file, and the custom type library file can come from the components developed according to the DCS requirements; for example, the requirements require to realize the network printer diagnosis function, and the network printer diagnosis component is developed by itself, the type library file of the component can be imported on the printer diagnosis page, and the current state of the printer can be obtained by calling the interface provided by the printer diagnosis component. The type library file imported by the embodiment of the present disclosure can include: the type library file for communication with the server, the type library file for communication function between the operator station, the type library file for printer diagnosis, and the type library file for trend display, etc. The embodiment of the present disclosure realizes the secondary editing of the page file through the VBA project, and can add other type library files related to functions to the page file.
[0026] In an exemplary instance, the page composition definition submodule of the embodiment of the present disclosure can include a dynamic property definition submodule and an interactive property definition submodule; accordingly, the page composition calling submodule can include a dynamic property calling submodule and an interactive property calling submodule.
[0027] The embodiment of the present disclosure can add corresponding dynamic properties and interactive properties to the graphic object through the configuration software and the page composition definition submodule imported in the VBA project; accordingly, the dynamic properties and the interactive properties added to the graphic object are called through the page composition calling submodule.
[0028] The embodiment of the present disclosure can define the frequently used display functions as a dynamic property set based on the configuration software, and the dynamic property set can also be defined through the special window provided by the configuration software. The dynamic properties defined by the dynamic property definition submodule of the embodiment of the present disclosure can include one or any combination of the following set: color changing property (for example, when the point value of the DCS system meets a certain condition, the color of the graphic object or the combined object is set), text property (the text value of the graphic object in the page is set), flashing property (the flashing state of the graphic object is set according to the situation of the point value of the DCS system), hidden property, filling property, rotating property, horizontal moving property, operation enabling property, analog value property, and switching value property; The embodiment of the present disclosure can customize the dynamic properties according to the actual use, so as to be used in the graphic object contained in the configured page file. The embodiment of the present disclosure can save the defined file as a page composition definition submodule through the configuration software, and import the page composition definition submodule into the VBA project after creating the page file and the VBA project.
[0029] The dynamic characteristic defined by the dynamic characteristic defining submodule in the embodiment of the present disclosure is called by a calling function contained in the dynamic characteristic calling submodule. The calling function can be generated by referring to related technologies based on the existing functions of the configuration software, and the calling of the dynamic characteristics of the configured graphic objects in the page file can be realized through the calling function. For example, in the page file, the filling characteristics or analog value display characteristics of the graphic objects are configured.
[0030] The embodiment of the present disclosure can define frequently used interactive functions as an interactive characteristic set based on the configuration software. The interactive characteristic set can also be defined through a special window provided by the configuration software. The interactive characteristics defined by the interactive characteristic defining submodule in the embodiment of the present disclosure can include one or any combination of the following set: button pressing characteristics (dynamically displaying the button effect when the button is pressed), button lifting (dynamically displaying the button effect when the button is lifted), push-out window characteristics (pushing out a new window when the mouse moves), switching background map characteristics (switching a background map when the mouse moves), opening IO device map characteristics (opening a module list map of a control station), push-out menu characteristics (realizing the drop-down display function of the menu), and display prompt characteristics (displaying the explanation information of a graphic object on the page when the mouse moves to the graphic object). The embodiment of the present disclosure can save the defined file as an interactive characteristic defining submodule through the configuration software, and when the page file is created, the interactive characteristic defining submodule is imported into the VBA project corresponding to the page file.
[0031] The interactive characteristics in the embodiment of the present disclosure can be called through a calling function contained in the interactive characteristic calling submodule. The calling function can be generated by referring to related technologies based on the existing functions of the configuration software, and the calling of the interactive characteristics of the configured graphic objects in the page file can be realized through the calling function. For example, the interactive characteristics of the mouse when the mouse moves to the graphic object are configured on the graphic object in the page file, and the interactive characteristics of the mouse when the left mouse button is clicked are configured to push out a small panel.
[0032] The embodiment of the present disclosure can include a plurality of page composition defining submodules and page composition calling submodules in the VBA project corresponding to the page file according to the basic framework of the DCS. Some submodules can be directly generated when the page file is created, and one or more page composition defining submodules and page composition calling submodules can be further added through the VBA project in the page development process.
[0033] The embodiment of the present disclosure configures the event-driven functions of the graphic objects added to the page file by the page editor as needed. The corresponding event response functions can be registered in the VBA project for each graphic object through the configuration software, that is, various event response functions can be realized in the VBA environment.
[0034] In an exemplary instance, the event response function in the embodiment of the present disclosure can include one or any combination of the following: an event response function of a mouse click on a graphic object (which can be represented as OnClick ()); an event response function of a double click of a left mouse button on a graphic object (which can be represented as OnLButtonDBClick ()); an event response function of a left mouse button press on a graphic object (which can be represented as OnLButtonDown ()); an event response function of a left mouse button click-up after a click on a graphic object (which can be represented as OnLButtonUp ()); an event response function of a right mouse button press on a graphic object (which can be represented as OnRButtonDown ()); an event response function of a right mouse button click-up after a click on a graphic object (which can be represented as OnRButtonUp ()); and an event response function of a mouse movement on a graphic object (which can be represented as OnMouseMove ()).
[0035] In an exemplary instance, the embodiment of the present disclosure can edit the editable page composition file by receiving an external input parameter of the editable page composition file, to generate a page file deployed on an operator station. The editing of the page file in the embodiment of the present disclosure is implemented by a page editor based on a pre-determined parameter of a graphic object, and the configuration software provides an editing function to support the editing to generate various page files meeting the field requirements. The embodiment of the present disclosure saves the edited page file by saving the page file in a configuration into a file in a self-defined format.
[0036] In an exemplary instance, the method of the embodiment of the present disclosure further includes: loading a corresponding event interface set of each page file created in advance in the running software of the operator station; after the operator station runs the generated page file, when a page message is listened to, the event response function corresponding to the page message in the VBA project is run through the loaded event interface set.
[0037] In an exemplary instance, the embodiment of the present disclosure runs the event response function corresponding to the page message in the VBA project through the loaded event interface set, including: when the page message is listened to, entering the message response function corresponding to the page message pre-loaded in the running software; calling the event trigger function corresponding to the page message through the message response function; according to the called event trigger function, running the event response function corresponding to the page message in the document class submodule imported in the VBA project.
[0038] Optionally, a page composition calling submodule is called through the event response function in the document class submodule.
[0039] The event response function set in the document class submodule of the embodiment of the present disclosure corresponds to the event interface set provided by the page file in the operator station (the configuration software also provides the same interface set), and the event interface set of the embodiment of the present disclosure is defined for implementing the event response function, and is used to implement the calling function of the page composition calling submodule in the page file. The event interface set can include one or any combination of the following function sets: an event function for opening a page file (which can be represented as Open ()); an event function for starting a page (which can be represented as OnStartOnLine ()); an event function for running a page cycle (which can be represented as OnLineTimer ()); an event function for stopping a page cycle (which can be represented as OnStopOnLine ()); an event function for pressing a left mouse button in a page (which can be represented as OnLButtonDown ()); an event function for lifting a left mouse button in a page (which can be represented as OnLButtonUp ()); an event function for pressing a right mouse button in a page (which can be represented as OnRButtonDown ()); an event function for lifting a right mouse button in a page (which can be represented as OnRButtonUp ()); an event function for double-clicking a mouse in a page (which can be represented as OnLButtonDBClick ()); and an event function for moving a mouse in a page (which can be represented as OnMouseMove ()).
[0040] The embodiment of the present disclosure defines the event interface set through the configuration software (the functions in the event interface set are defined based on the COM technology), and the event interface set includes an event triggering function corresponding to each interface (for example, the OnMouseMove interface corresponds to the Fire_OnMouseMove function). Correspondingly, the operator station main program also stores and loads the same event interface set and event triggering function. When the page file is loaded and run, the operator station main program will monitor the page message. When a certain page message (such as the mouse move message) is monitored, the message response function corresponding to the page message is entered, the event triggering function (the OnMouseMove message corresponds to the Fire_OnMouseMove function) is called through the message response function, the event corresponding to the page message is triggered to the VBA project in the page file through the event triggering function, the document class submodule imported in the VBA project is run, and the event response function in the document class submodule is used for response processing (the event response function of the mouse movement).
[0041] In an exemplary example, the message response function of the embodiment of the present disclosure can be edited and generated by a technician through the configuration software of the engineer station according to the event triggering function to be called.
[0042] In an exemplary instance, the operator station of the embodiment of the present disclosure sets the flow of running the generated page file in the online main program, including: The event function set of the page document is used for execution in the running process of the page file, triggers into the VBA project, and runs the page composition file in the VBA project. The event function set of the graphic object is used for the page in the execution process. If the corresponding event of the graphic object is generated, it triggers into the VBA project, and runs the event response function of the graphic object defined in the VBA project.
[0043] After the page file loading is started, the effect of the dynamic characteristics of the graphic object of the page is displayed according to the edited page composition file, and the interactive characteristics of the graphic object are displayed according to the user operation. The running process of the page file includes: Step S1, the running software on the operator station loads the page file into the memory to run the page file; Step S2, the running software triggers the event function (Open()) of opening the page file in the event interface set of the page file; when the embodiment of the present disclosure triggers the event function of opening the page file of the page file, the page file running will jump to the VBA project, and the event function of opening the page file in the document class submodule is executed; the process of the event function of opening the page file executed by the embodiment of the present disclosure can include obtaining the basic page composition information (page name) of the page file in the VBA environment; Step S3, the configuration software triggers the event function (OnStartOnLine()) of starting the page of the page file; after the embodiment of the present disclosure triggers the event function of starting the page, the program running process will jump to the VBA project, and the event function of starting the page in the event interface set is executed. The process of the event function of starting the page is the initialization process of the corresponding VBA project, which can include the initialization operation of each variable used by the page file.
[0044] Step S4, after initializing the VBA project of the page file, the periodic processing operation of the page file is performed; the periodic processing of the embodiment of the present disclosure of the page file can include: 1, periodically calling the periodic event response function in the VBA project; 2, triggering the event response function in the VBA project according to the event message acting on the page file; 3, periodically drawing the graphic object on the graphic page; 4, processing the call of the interface function in the interface function set by the VBA project; the above-mentioned periodic processing process of the embodiment of the present disclosure can be executed in parallel; wherein, 1, periodically calling the periodic event response function in the VBA project can include: The time of the event function (OnLineTimer()) judging the page cycle running is up; the graphic software of the embodiment of the present disclosure triggers and executes the OnLineTimer() of the imported VBA project by cycle; the processing executed when the OnLineTimer() is executed includes various operations of reading and displaying data by cycle, and the cycle can be set when the page file is created.
[0045] If the timing time of the OnLineTimer() is up, the processing in the event response function of the OnLineTimer() defined in the VBA is executed; In the event response function of the OnLineTimer(), the function in the definition submodule of the dynamic characteristic can be called, the dynamic characteristic configured on all graphic objects is called, and the dynamic display of various effects of the graphic objects is realized. The graphic software can be called through the ReDraw interface function of the graphic software, the graphic software redraws the graphic object configured with the dynamic characteristic, and the dynamic display effect is ensured; here, the ReDraw interface function is one of the interface functions in the interface function set provided by the document class submodule of the graphic software, and the function is to redraw the display of various graphic objects on the page.
[0046] 2. When the event response function in the VBA project is triggered by listening to the event message acting on the page file, the event message on the page file can include: mouse movement message, mouse left button single click message, mouse right button single click message and mouse left button double click message, which will be described below by classification: When the configuration software listens to the mouse movement message, the event response function (OnMouseMove()) of the mouse moving on the graphic object in the VBA project is triggered; different graphic objects in the embodiment of the present disclosure will correspond to different OnMouseMove(), and if the event response function has a processing process in the VBA project, the processing defined in the VBA will be executed; When the configuration software listens to the mouse left button single click message, the following event response functions in the VBA project are triggered to execute corresponding processing: the event response function (OnClick()) of the mouse clicking on the graphic object; the event response function (OnLButtonDown()) of the mouse left button pressing on the graphic object; the event response function (OnLButtonUp()) of the mouse left button lifting after clicking on the graphic object; When the configuration software listens to the mouse right button single click message, the following event response functions in the VBA project are triggered to execute corresponding processing: the event response function (OnRButtonDown()) of the mouse right button pressing on the graphic object; the event response function (OnRButtonUp()) of the mouse right button lifting after clicking on the graphic object; When the configuration software listens to the left mouse double-click message, the following event response function in the VBA project is triggered to perform corresponding processing: the event response function OnLButtonDBClick() of the left mouse double-clicking the graphic object.
[0047] 3. Periodically refreshing the page and drawing all graphic objects in the page; the disclosed embodiment of the configuration software periodically refreshes the page to draw the dynamic display effect of all graphic objects in real time during the running of the configuration software; including the display of the values of various graphic objects, color change, and flashing display effect.
[0048] 4. Continuously processing the calling of the interface functions provided by the configuration software by the VBA project; the disclosed embodiment of the configuration software provides a set of interface functions for calling in the VBA project, and the set of interface functions includes the modification of the attribute values of various graphic objects, the opening or closing of the page, and all functions that need to be processed by the graphic software.
[0049] If the configuration software receives the calling of the page closing interface function by the VBA project, the OnStopOnLine() event processing process defined in the VBA project is executed to clean up the page resources, and the configuration software closes the page.
[0050] If the configuration software receives the calling of other interfaces by the VBA project, the configuration software judges whether the operation of closing the page is included in the interface processing, if the operation of closing the page is included, after the execution of other operations except closing, the OnStopOnLine() event processing process defined in the VBA project is executed to clean up the page resources and close the page; if the calling of the interface function does not involve the closing processing of the page, the corresponding interface processing is executed.
[0051] The disclosed embodiment further provides a computer storage medium, the computer storage medium stores a computer program, and the computer program is executed by a processor to implement the method for generating a page file.
[0052] The disclosed embodiment further provides a terminal, including a memory and a processor, the memory stores a computer program; wherein, The processor is configured to execute the computer program in the memory; The computer program is executed by the processor to implement the method for generating a page file.
[0053] Figure 2 The structure block diagram of the apparatus for generating a page file of the disclosed embodiment is shown in Figure 2 The structure block diagram of the apparatus for generating a page file of the disclosed embodiment is shown in The creating unit is configured to integrate a VBA development environment in the configuration software, and create a corresponding VBA project for each page file created in advance; The importing unit is configured to import a corresponding page composition file in each VBA project, wherein the page composition file is a composition of the page file, the page composition file includes an editable document class submodule and one or more type library files, and further includes a page composition definition submodule and a page composition calling submodule created in advance according to the composition of the distributed control system (DCS), the page composition calling submodule is called through the document class submodule, the document class submodule includes one or more event response functions defined in advance for flow control of execution of the page file, and the type library file contains an interface function set for implementing a functional component included in the DCS. The generating unit is configured to edit the editable page composition file in the imported VBA project according to the page composition information of the DCS determined in advance, so as to generate a page file deployed on an operator station.
[0054] In an exemplary instance, the page composition definition submodule in the embodiment of the present disclosure includes a dynamic property definition submodule and / or an interactive property definition submodule. When the page composition definition submodule includes the dynamic property definition submodule, the page composition calling submodule includes a dynamic property calling submodule; and when the page composition definition submodule includes the interactive property definition submodule, the page composition calling submodule includes an interactive property calling submodule.
[0055] In an exemplary instance, when the page composition definition submodule in the embodiment of the present disclosure includes the dynamic property definition submodule, the dynamic property defined by the dynamic property definition submodule includes one or any combination of the following set: color changing property, text property, flashing property, hiding property, filling property, rotating property, horizontal moving property, operation enabling property, analog value property, and switching value property. In an exemplary instance, when the page composition definition submodule in the embodiment of the present disclosure includes the interactive property definition submodule, the interactive property defined by the interactive property definition submodule includes one or any combination of the following set: button pressing property, button lifting, window pushing property, bottom map switching property, IO device map opening property, menu pushing property, and prompt displaying property.
[0056] In an exemplary instance, the event response function in the embodiment of the present disclosure includes one or any combination of the following: Mouse click event response function on the graphic object; Mouse left double click event response function on the graphic object; Mouse left button down event response function on the graphic object; Mouse left button up event response function on the graphic object; Mouse right button down event response function on the graphic object; Mouse right button up event response function on the graphic object; Mouse move event response function on the graphic object.
[0057] In an exemplary instance, the operation processing unit of the embodiment of the present disclosure is arranged to: Load the event interface set corresponding to each of the pre-created page files in the operation software of the operator station, so that when the generated page file of the operator station is running and a page message is listened to, the event response function corresponding to the page message in the VBA project is run through the loaded event interface set.
[0058] The embodiment of the present disclosure runs the event response function corresponding to the page message in the VBA project of the operator station through the loaded event interface set, comprising: When the page message is listened to, run the message response function corresponding to the page message, wherein the message response function is pre-edited and generated by the configuration software of the engineer station; Call the event trigger function corresponding to the page message through the run message response function; According to the called event trigger function, run the event response function corresponding to the page message in the document class submodule imported into the VBA project.
[0059] In an exemplary instance, the event interface set in the embodiment of the present disclosure comprises one or any combination of the following function set: Event function of opening the page file; Event function of starting the page; Event function of running the page cycle; Event function of stopping the page cycle; Event function of pressing the mouse left button on the page; Event function of lifting the mouse left button on the page; Event function of pressing the mouse right button on the page; Event function of lifting the mouse right button on the page; Event function of double-clicking the mouse on the page; Event function of moving the mouse on the page.
[0060] Those of ordinary skill in the art will realize and understand that all or some of the steps in the methods disclosed above and the functional modules / units in the systems and devices can be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component can have multiple functions, or one function or step can be performed by several physical components in cooperation. Some or all of the components can be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on computer-readable media, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, the term "computer storage media" includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and that can be accessed by a computer. Furthermore, it is common and well understood by those of ordinary skill in the art that communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and can include any information delivery media.
Claims
1. A method of generating a page file, characterized by, The method comprises the following steps: integrating a VBA development environment in configuration software, and creating a corresponding VBA project for each pre-created page file; in each VBA project, importing a corresponding page composition file, wherein the page composition file is a composition of the page file, the page composition file comprises an editable document class submodule and one or more type library files, and further comprises a page composition definition submodule and a page composition calling submodule, which are pre-created according to the composition of a distributed control system (DCS), the page composition calling submodule is called through the document class submodule, the document class submodule comprises one or more event response functions pre-defined for flow control of execution of the page file, and the type library file comprises an interface function set for implementing a functional component included in the DCS; editing the editable page composition file imported into the VBA project according to pre-determined page composition information of the DCS, so as to generate a page file deployed on an operator station.
2. The method according to claim 1, wherein: the page composition definition submodule comprises a dynamic property definition submodule and / or an interactive property definition submodule; when the page composition definition submodule comprises the dynamic property definition submodule, the page composition calling submodule comprises a dynamic property calling submodule; and when the page composition definition submodule comprises the interactive property definition submodule, the page composition calling submodule comprises an interactive property calling submodule.
3. The method according to claim 2, wherein: when the page composition definition submodule comprises the dynamic property definition submodule, the dynamic property defined by the dynamic property definition submodule comprises one or any combination of a color-changing property, a text property, a flashing property, a hiding property, a filling property, a rotating property, a horizontal moving property, an operation enabling property, an analog value property, and a switching value property; when the page composition definition submodule comprises the interactive property definition submodule, the interactive property defined by the interactive property definition submodule comprises one or any combination of a button pressing property, a button lifting property, a window pushing property, a bottom map switching property, an IO device map opening property, a menu pushing property, and a prompt displaying property.
4. The method according to any one of claims 1 to 3, characterized in that, the event response function comprises one or any combination of: an event response function of a mouse single click on a graphic object; an event response function of a mouse left double click on a graphic object; an event response function of a mouse left button pressing on a graphic object; an event response function of a mouse left button lifting after a single click on a graphic object; an event response function of a mouse right button pressing on a graphic object; an event response function of a mouse right button lifting after a single click on a graphic object; and an event response function of a mouse moving on a graphic object. after the page file deployed on the operator station is generated, the method further comprises: loading an event interface set corresponding to each pre-created page file in running software of the operator station; 5. The method according to any one of claims 1 to 3, characterized in that, after the operator station runs the generated page file, when a page message is listened to, running an event response function corresponding to the page message in the VBA project through the loaded event interface set. 6. The method of claim 5, wherein, The event interface set loaded runs the event response function corresponding to the page message in the VBA project, comprising: When the page message is monitored, the message response function corresponding to the page message is run, wherein the message response function is generated by pre-editing the configuration software; Through the running of the message response function, the event trigger function corresponding to the page message is called; According to the called event trigger function, the event response function corresponding to the page message in the document class submodule imported into the VBA project is run.
7. The method of claim 6, wherein, The event interface set includes one or any combination of the following function sets: Event function of opening page file; event function of starting page; event function of running page cycle; event function of stopping page cycle; event function of pressing left mouse button in page; event function of lifting left mouse button in page; event function of pressing right mouse button in page; event function of lifting right mouse button in page; event function of double-clicking mouse in page; event function of mouse moving in page.
8. A computer storage medium, the computer storage medium storing a computer program, the computer program being executed by a processor to implement the method for generating a page file according to any one of claims 1 to 7.
9. A terminal comprising: A memory and a processor, the memory storing a computer program; wherein, The processor is configured to execute the computer program in the memory; The computer program is executed by the processor to implement the method for generating a page file according to any one of claims 1 to 7.
10. An apparatus for generating a page file, characterized by Comprising: A creating unit, an importing unit and a generating unit; wherein, The creating unit is configured to integrate the VBA development environment in the configuration software, and create a corresponding VBA project for each page file created in advance; The importing unit is configured to import the corresponding page composition file into each VBA project, wherein the page composition file is the composition of the page file, the page composition file includes one editable document class submodule and one or more type library files, and also includes a page composition definition submodule and a page composition calling submodule created in advance according to the composition of the distributed control system (DCS), the page composition calling submodule is called through the document class submodule, the document class submodule includes one or more event response functions defined in advance for flow control of execution of the page file, and the type library file contains an interface function set for implementing the functional components contained in the DCS; The generating unit is configured to edit the editable page composition file in the imported VBA project according to the page composition information of the DCS determined in advance, so as to generate the page file deployed on the operator station.
Citation Information
Patent Citations
Automatic conversion method for behavior control scripting language
CN103529773A
VBA-based DCS monomer test case automatic generation method
CN110502441A
System upgrading method, device and equipment and computer readable storage medium
CN111290771A
Nuclear power DCS human-computer interface combination icon conversion method and device
CN114090004A
Configuration image processing method and device, computer equipment and storage medium
CN114675925A