Summary of the invention
The object of the present invention is to provide a kind of simulation software interface integrating method, can not realize embedding the interlock between window and the parent window when it has solved local interface integrated emulation software in the background technology; When the remote emulation software interface is integrated during operating cost, loaded down with trivial details, can not share and specify the simulation software human window, remote desktop or remote emulation interface can't be embedded into the technical matters in the local software.
Technical solution of the present invention is as follows:
A kind of simulation software interface integrating method, this method comprises following performing step:
(1) form the integrated software platform: utilize RCP (the Rich Client Platform) plug-in unit of Eclipse environment to form the integrated software platform, this integrated software platform comprises SWT (Standard Widget Toolkit) plug-in unit and Agent WebService client;
(1.1) utilize the RCP plug-in unit of Eclipse environment to form the integrated software platform, on this integrated software platform, provide software integrated region view with the view mode;
(1.2) carry out integrated to simulation software;
(2) dispose the simulation software server: comprise the installation of Agent Web Services server end, the adapter of simulation software and simulation software;
(3) in the integrated software platform by the Agent Web Services server end on the Agent Web Services client call simulation software server;
(4) embed simulation software interface.
Agent Web Services server end in the above-mentioned steps (3) can adopt WCF to realize; The api interface that described Agent WebServices server end is provided be Start (String AdapterName, Dictionary params, intstep); In the described step (3) in the integrated software platform by the Agent Web Services server end on the Agent Web Services client call simulation software server, concrete steps are as follows:
(3.1) the Agent Web Services client in the integrated software platform dynamically generates the ServicesClient object, and it is AnsysAdapter that AdapterName is set simultaneously, and params is set respectively;
(3.2) Start by ServicesClient object reference Agent Web Services server end;
(3.3) adapter of simulation software calls emulation component according to AdapterName among the Start and step, and the operation simulation software.
AdapterName in the parameter of above-mentioned Start is meant the title of the adapter of simulation software, and is corresponding with the simulation software that will start; Described params comprises InputPath, OutputPath, PicturePath, FlowId and TaskId, wherein InputPath is the realistic model file path of input, OutputPath is the realistic model file path of output, the picture path of PicturePath for exporting, FlowId is ID number of flow process, and TaskId is ID number of task; Described Step is meant the emulation component sign corresponding with the adapter of simulation software, and described emulation component is the encapsulation to the simulation software functional module.
Above-mentioned steps (1) is carried out when integrated local emulation software, be that the org.eclipse.swt.internal.Windows.OS class with the SWT plug-in unit encapsulates the Windows api function on the integrated software platform, the view control of calling api function interface SetParent SWT plug-in unit is set to be integrated the parent window of simulation software.
Above-mentioned steps (4) is that concrete steps are as follows when embedding the local emulation software interface:
(4.1) adapter of simulation software obtains the desktop handle by the GetDesktopWindow method of Windows API, utilizes the GetWindow method that all desktop forms are carried out hierarchical alterative, and obtains class name and title name by the SendMessage method; Then, judgement is also found class name and the complete forms consistent with simulation software of title name, the server end of Agent WebServices passes to the Agent Web Services client of integrated software platform with the forms handle of the simulation software rreturn value as Start;
(4.2) after Agent Web Services client obtains the window handle of simulation software, the sharp SWT plug-in unit of the integrated software platform call operation Windows API of system, utilize the SetParent method that the parent window of simulation software human window is set, the simulation software human window is embedded in the human window of integrated software platform;
(4.3) make by the embedding human window by the SendMessage method and in the view control of SWT plug-in unit, be full of the integrated region view.
Above-mentioned steps (1) is carried out when integrated remote emulation software, and the integrated software platform comprises the VNC reader; To the integrated of remote emulation software is with the SWT plug-in unit VNC client to be embedded in the local integrated region view on the integrated software platform; In the described step (2), the deployment of remote emulation software server also comprises the installation of VNC server.
Above-mentioned steps (4) is that concrete steps are as follows when embedding the remote emulation software interface:
(5.1) adapter of simulation software obtains the human window title name of simulation software from self configuration file;
(5.2) adapter of simulation software calls the VNC server to share the simulation software human window;
(5.3) adapter of simulation software makes up the IP of VNC server place server and VNC server end slogan, as the VNC link information, and returns to Agent Web Services client by Start;
(5.4) the VNC reader of VNC client is with the human window of VNC client as the integrated software platform;
(5.5) the integrated software platform afterwards, is resolved this VNC link information in the VNC link information that obtains to return by Agent Web Services client, according to the IP and the port numbers of the VNC server that gets access to the VNC reader is set;
(5.6) the VNC reader connects the VNC server;
(5.7) integrated software platform simulation software human window that the VNC server is shared is embedded into the view control of SWT plug-in unit.
Above-mentioned configuration file is arranged in the adapter of simulation software installation directory, and described configuration file comprises emulation component pathname, simulation software human window title name.
The specific implementation function of above-mentioned steps (5.2) is: System.Diagnostics.Process.Start (configFileName, " sharewindow " "+mainWindowTitle+ " " "); Wherein configFileName is for starting the path of VNC server, and mainWindowTitle is the human window title of simulation software.
The present invention has following advantage:
1. the present invention has versatility, can integrated all kinds of simulation software interfaces.
2. because simulation process will relate to a plurality of simulation softwares usually, and start a plurality of simulation softwares respectively when using, need carry out complicated data relationship definition, boot sequence definition etc.The present invention can realize the sequence starting of data relationship definition and simulation software.
3. when integrated local and remote simulation software interface, the simulation software human window can be embedded in the current software platform interface.
4. can realize the interlock of parent window in simulation software human window and the integrated software platform.
6. the remote emulation software interface is integrated has cross operating system and strides the characteristics of programming language.
7. carry out the remote emulation software interface when integrated, need not to import username and password, easy and simple to handle.
8. carry out the remote emulation software interface when integrated, the integrated software platform can dispose VNC operation attribute automatically.
9. in remote emulation software interface integrating process, can realize to the human window of specifying simulation software share and integrated.
Embodiment
The present invention can be integrated into the human window of the various simulation softwares of windows desktop program schema in the unified software platform, is implemented in the simulation software human window of operation Local or Remote in the same software platform.
Main performing step of the present invention is as follows:
(1) form the integrated software platform: utilize the RCP plug-in unit of Eclipse environment to form the integrated software platform, this integrated software platform comprises SWT plug-in unit and Agent Web Service client.The present invention possesses the cross-platform characteristic of java application, not only can be integrated in the simulation software of the windows desktop program schema of moving in the Windows operating system, can also be integrated in the Linux that moves in Linux and the Unix operating system and the simulation software of Unix desktop programs pattern.Specific implementation is:
(1.1) utilize the RCP plug-in unit of Eclipse environment to form the integrated software platform, on this integrated software platform, provide software integrated region view with the view mode.
(1.2) integrated to local emulation software: the org.eclipse.swt.internal.Windows.OS class with the SWT plug-in unit on the integrated software platform encapsulates Windows API, and the view control of calling api function interface SetParent SWT plug-in unit is set to be integrated the parent window of simulation software.Integrated to local emulation software can adopt different Windows api functions.If when not realizing the interlock between simulation software window and the integrated software platform parent window, also can use Move Window.
(1.3) integrated to remote emulation software: on the integrated software platform, the VNC client is embedded in the local integrated region view with the SWT plug-in unit.
(2) dispose the simulation software server:
(2.1) deployment of local emulation software server comprises: the installation of Agent Web Services server end, the adapter of simulation software and simulation software, it all is standard installation procedures.Agent Web Services server end and the adapter of simulation software transmit the control messages to simulation software, are the interactive interfaces of integrated software platform and simulation software.
(2.2) deployment of remote emulation software server comprises: the installation of Agent Web Services server end, the adapter of simulation software, simulation software and VNC server, it all is standard installation procedures.Agent Web Services server end and the adapter of simulation software transmit the control messages to simulation software, are the interactive interfaces of integrated software platform and simulation software.
(3) in the integrated software platform by the Agent Web Services server end on the Agent Web Services client call simulation software server, no matter be the simulation software department server arranging method that adopts Local or Remote, its concrete mode is:
(3.1) Agent Web Services server end adopts WCF (Windows Communication Foundation) technology to realize.
(3.2) api interface that provided of Agent Web Services server end is: Start (String AdapterName, Dictionary params, int step), and the Start parameter declaration is as follows:
AdapterName: be meant the title of the adapter of simulation software, corresponding with the simulation software that will start.
Params: comprise InputPath, OutputPath, PicturePath, FlowId and TaskId; Wherein InputPath is the realistic model file path of input, and OutputPath is the realistic model file path of output, the picture path of PicturePath for exporting, and FlowId is ID number of flow process, TaskId is ID number of task.
Step: be emulation component sign corresponding with the adapter of simulation software in the database, emulation component is the encapsulation to the simulation software functional module.
(3.3) the Agent Web Services client in the integrated software platform dynamically generates the ServicesClient object, and the parameter value of AdapterName and params is set.
(3.4) Start by ServicesClient object reference Agent Web Services server end.
(3.5) adapter of simulation software calls emulation component according to AdapterName among the Start and step, and the operation Ansys of simulation software.
(4) embed the local emulation software interface, step is as follows:
(4.1) adapter of simulation software obtains the desktop handle by the GetDesktopWindow method of Windows API, utilizes the GetWindow method that all desktop forms are carried out hierarchical alterative, and obtains class name and title name by the SendMessage method.Then, judgement is also found class name and the complete forms consistent with simulation software of title name, the server end of Agent WebServices passes to the Agent Web Services client of integrated software platform with the forms handle of the simulation software rreturn value as Start.
(4.2) after Agent Web Services client obtains the window handle of simulation software, the sharp SWT plug-in unit of the integrated software platform call operation Windows API of system, utilize the SetParent method that the parent window of simulation software human window is set, thereby the simulation software human window is embedded in the human window of integrated software platform.
(4.3) last, make by the embedding human window by the SendMessage method in the view control of SWT plug-in unit, to be full of the integrated region view.
(5) embed the remote emulation software interface, step is as follows:
(5.1) adapter of simulation software obtains the human window title name of simulation software from self configuration file.This configuration file is arranged in the adapter of simulation software installation directory, and configuration file comprises emulation component pathname, simulation software human window title name.
(5.2) adapter of simulation software calls the VNC server to share the Ansys of simulation software human window, the specific implementation function is: System.Diagnostics.Process.Start (configFileName, " sharewindow " "+mainWindowTitle+ " " "), wherein configFileName is for starting the path of VNC server, and mainWindowTitle is the human window title of simulation software.
(5.3) adapter of simulation software makes up the IP of VNC server place server and VNC server end slogan, as the VNC link information, and returns to Agent Web Services client by Start.
(5.4) the integrated software platform comprises VNC client-side program VNC reader, can be with the human window of VNC client as the integrated software platform.
(5.5) the integrated software platform is resolved this VNC link information after the VNC link information that obtains to return by Agent Web Services client, according to the IP and the port numbers of the VNC server that gets access to the VNC reader is set.
(5.6) the VNC reader connects the VNC server.
(5.7) integrated software platform simulation software human window that the VNC server is shared is embedded into the view control of SWT plug-in unit.
Referring to Fig. 1, being installed in this locality with the Ansys of simulation software comparatively commonly used in the engineering analysis is example, when semi-girder is carried out statics Analysis, starts union and becomes the concrete implementation step of local simulation software as follows:
(1) form the integrated software platform: utilize the RCP plug-in unit of Eclipse environment to form the integrated software platform, this integrated software platform comprises SWT plug-in unit and Agent Web Service client.
Integrated to local emulation software: the org.eclipse.swt.internal.Windows.OS class with the SWT plug-in unit on the integrated software platform encapsulates the Windows api function, and the view control of calling api function interface SetParent SWT plug-in unit is set to be integrated the parent window of simulation software.
(2) deployment of local emulation software server comprises: the installation of Agent Web Services server end, the adapter of simulation software and the Ansys of simulation software, it is the standard installation procedure.Agent Web Services server end and the adapter of simulation software transmit the control messages to simulation software, are the interactive interfaces of integrated software platform and simulation software.
(3) the Agent Web Services client in the integrated software platform dynamically generates the ServicesClient object, and it is AnsysAdapter that AdapterName is set simultaneously, and params is set respectively:
InputPath=Project xuanbiliang StaticAnalysis OriginalModelImport, wherein xuanbiliang represents that the object of analyzing is a semi-girder, StaticAnalysis represents to carry out statics Analysis;
OutputPath=Project\xuanbiliang\StaticAnalysis\SimulationModel\;
PicturePath=Project\xuanbiliang\StaticAnalysis\SimulationModel\Pic\;
FlowId is 1, and TaskId is 1, and it is 1 that step is set.
(4) Start by ServicesClient object reference Agent Web Services server end.
(5) adapter of simulation software calls emulation component 1 according to AdapterName among the Start and step, and the operation Ansys of simulation software.
(6) adapter of simulation software obtains the desktop handle by the GetDesktopWindow method of Windows api function, utilizes the GetWindow method that all desktop forms are carried out hierarchical alterative, and obtains class name and title name by the SendMessage method.Then, judgement is also found class name and the complete forms consistent with the Ansys of simulation software of title name, the server end of Agent Web Services passes to the Agent Web Services client of integrated software platform with the forms handle of the Ansys of the simulation software rreturn value as Start.
(7) after Agent Web Services client obtains the window handle of the Ansys of simulation software, the Windows api function of the sharp SWT plug-in unit of integrated software platform call operation system, utilize the SetParent method that the parent window of the Ansys of simulation software human window is set, thereby simulation software Ansys human window is embedded in the human window of integrated software platform.
(8) last, make by the human window of embedding forms Ansys by the SendMessage method in SWT plug-in unit control, to be full of the integrated region view.
Referring to Fig. 2, being installed on the remote server with the Ansys of simulation software comparatively commonly used in the engineering analysis is example, and when semi-girder was carried out statics Analysis, the concrete implementation step of startup and integrated remote emulation software was as follows:
(1) form the integrated software platform: utilize the RCP plug-in unit of Eclipse environment to form the integrated software platform, this integrated software platform comprises SWT plug-in unit, Agent Web Service client and VNC reader.
Integrated to remote emulation software: on the integrated software platform, the VNC client is embedded in the local integrated region view with the SWT plug-in unit.
(2) deployment of remote emulation software server comprises: the installation of Agent Web Services server end, the adapter of simulation software, the Ansys of simulation software and VNC server, it is the standard installation procedure.Agent WebServices server end and the adapter of simulation software transmit the control messages to simulation software, are the interactive interfaces of integrated software platform and simulation software.
(3) the Agent Web Services client in the integrated software platform dynamically generates the ServicesClient object, and it is AnsysAdapter that AdapterName is set simultaneously, and params is set respectively:
InputPath=Project xuanbiliang StaticAnalysis OriginalModelImport, wherein xuanbiliang represents that the object of analyzing is a semi-girder, StaticAnalysis represents to carry out statics Analysis;
OutputPath=Project\xuanbiliang\StaticAnalysis\SimulationModel\;
PicturePath=Project\xuanbiliang\StaticAnalysis\SimulationModel\Pic\;
FlowId is 1, and TaskId is 1, and it is 1 that step is set.
(4) Start by ServicesClient object reference Agent Web Services server end.
(5) adapter of simulation software calls emulation component 1 according to AdapterName among the Start and step, and the operation Ansys of simulation software.
(6) adapter of simulation software obtains the human window title name Ansys Multiphsics Utility Menu of the Ansys of simulation software from self configuration file.This configuration file is arranged in the adapter of simulation software installation directory, and configuration file comprises emulation component pathname, simulation software human window title name.
(7) adapter of simulation software calls the VNC server to share the Ansys of simulation software human window, the specific implementation function is: System.Diagnostics.Process.Start (configFileName, " sharewindow " "+mainWindowTitle+ " Ansys Multiphsics Utility Menu " ").Wherein configFileName is for starting the path of VNC server, and mainWindowTitle is the human window title of simulation software.
(8) adapter of simulation software makes up the IP of VNC server place server and VNC server end slogan 5700, as the VNC link information, and returns to Agent Web Services client by Start.
(9) the integrated software platform comprises VNC client-side program VNC reader, can be with the human window of VNC client as the integrated software platform.
(10) the integrated software platform is resolved this VNC link information after the VNC link information that obtains to return by Agent Web Services client, according to the IP and the port numbers 5700 of the VNC server that gets access to the VNC reader is set.
(11) the VNC reader connects the VNC server.
(12) integrated software platform simulation software Ansys human window that the VNC server is shared is embedded into the view control of SWT plug-in unit.
The present invention when integrated, if need not to provide the single simulation software interface of appointment, can adopt WTS to replace VNC long-range, and this method can improve the travelling speed of program.