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 parent window when it has solved in the background technology local interface integrated emulation software; 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 to the technical matters in local software.
Technical solution of the present invention is as follows:
A kind of simulation software interface integrating method, the method comprises following performing step:
(1) form the integrated software platform: the RCP(Rich Client Platform that utilizes the Eclipse environment) plug-in unit forms the integrated software platform, and this integrated software platform comprises SWT(Standard Widget Toolkit) plug-in unit and Agent Web Service client;
(1.1) utilize the RCP plug-in unit of Eclipse environment to form the integrated software platform, on this integrated software platform, by the view mode, provide software integrated region view;
(1.2) to simulation software, carry out integrated;
(2) dispose the simulation software server: comprise the installation of Web service acting server end, simulation software adapter (adapter) and simulation software;
(3) call the Web service acting server end on the simulation software server by the Web service agent client in the integrated software platform;
(4) embed simulation software interface.
Web service acting server end in above-mentioned steps (3) can adopt WCF to realize; The api interface that described Web service acting server end provides is Start (String adapter (adapter) Name, Dictionary params, int step); Call the Web service acting server end on the simulation software server by the Web service agent client in described step (3) in the integrated software platform, concrete steps are as follows:
(3.1) the Web service agent client in the integrated software platform dynamically generates the ServicesClient object, and it is Ansys adapter (adapter) that adapter (adapter) Name is set simultaneously, and params is set respectively;
(3.2) by the Start of ServicesClient object reference Web service acting server end;
(3.3) simulation software adapter (adapter), according to (adapter) Name of the adapter in Start and step, calls emulation component, and the operation simulation software.
Adapter in the parameter of above-mentioned Start (adapter) Name refers to the title of simulation software adapter (adapter), 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 No. ID of flow process, and TaskId is task No. ID; Described Step refers to the emulation component sign corresponding with simulation software adapter (adapter), 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 is encapsulated the Windows api function on the integrated software platform, the view control of Using 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 while embedding the local emulation software interface, concrete steps are as follows:
(4.1) simulation software adapter (adapter) obtains the desktop handle by the GetDesktopWindow method of Windows API, utilize the GetWindow method to carry out hierarchical alterative to all desktop forms, and obtain class name and title name by the SendMessage method; Then, judge and find class name and the title name forms consistent with simulation software fully that the rreturn value of server end using the forms handle of simulation software as Start that Web service is acted on behalf of passes to the Web service agent client of integrated software platform;
(4.2) after the Web service agent client obtains the window handle of simulation software, the platform profit SWT of integrated software plug-in unit call operation system Windows API, 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 to be full of in the view control of SWT plug-in unit by the embedding human window integrated region view by the SendMessage method.
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, be with the SWT plug-in unit, the VNC client to be embedded in local integrated region view on the integrated software platform; In described step (2), the deployment of remote emulation software server also comprises the installation of VNC server.
Above-mentioned steps (4) is that while embedding the remote emulation software interface, concrete steps are as follows:
(5.1) simulation software adapter (adapter) obtains the human window title name of simulation software from self configuration file;
(5.2) simulation software adapter (adapter) calls the VNC server to share the simulation software human window;
(5.3) simulation software adapter (adapter) is combined the IP of VNC server place server and VNC server end slogan, as the VNC link information, and returns to the Web service agent client by Start;
(5.4) human window of VNC reader using the VNC client as the integrated software platform of VNC client;
(5.5) the integrated software platform, obtaining the VNC link information of returning by the Web service agent client, afterwards, is resolved this VNC link information, according to IP and the port numbers of the VNC server got, the VNC reader is set;
(5.6) the VNC reader connects the VNC server;
(5.7) the integrated software platform simulation software human window shared the VNC server is embedded into the view control of SWT plug-in unit.
Above-mentioned configuration file is arranged in simulation software adapter (adapter) 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 respectively a plurality of simulation softwares while using, need to 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 current software platform interface.
4. can realize the interlock of parent window in simulation software human window and integrated software platform.
6. the remote emulation software interface is integrated has cross operating system and across the characteristics of programming language.
7. carry out the remote emulation software interface when integrated, without the input username and password, easy and simple to handle.
8. carry out the remote emulation software interface when integrated, the integrated software platform can configure VNC operation attribute automatically.
9. in remote emulation software interface integrating process, can realize human window to 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 unified software platform, realizes the simulation software human window of operation Local or Remote in 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 Windows operating system, can also be integrated in the Linux that moves in Linux and 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, by the view mode, provide software integrated region view.
(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 is encapsulated Windows API, and the view control of Using 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, while not realizing the interlock between simulation software window and integrated software platform parent window, also can use Move Window.
(1.3) integrated to remote emulation software: with the SWT plug-in unit, the VNC client is embedded in local integrated region view on the integrated software platform.
(2) dispose the simulation software server:
(2.1) deployment of local emulation software server comprises: the installation of Web service acting server end, simulation software adapter (adapter) and simulation software, it is all standard installation procedures.Web service acting server end and simulation software adapter (adapter) transmit the control message 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 Web service acting server end, simulation software adapter (adapter), simulation software and VNC server, it is all standard installation procedures.Web service acting server end and simulation software adapter (adapter) transmit the control message to simulation software, are the interactive interfaces of integrated software platform and simulation software.
(3) no matter call the Web service acting server end on the simulation software server by the Web service agent client in the integrated software platform, be the simulation software server disposition method that adopts Local or Remote, and its concrete mode is:
(3.1) Web service acting server end adopts WCF(Windows Communication Foundation) the technology realization.
(3.2) api interface that Web service acting server end provides is: Start (String adapter (adapter) Name, Dictionary params, int step), and the Start parameter declaration is as follows:
Adapter (adapter) Name: refer to the title of simulation software adapter (adapter), 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 picture path that will export for the realistic model file path of output, PicturePath, and FlowId is flow process No. ID, and TaskId is task No. ID.
Step: be emulation component sign corresponding with simulation software adapter (adapter) in database, emulation component is the encapsulation to the simulation software functional module.
(3.3) the Web service agent client in the integrated software platform dynamically generates the ServicesClient object, and the parameter value of adapter (adapter) Name and params is set.
(3.4) by the Start of ServicesClient object reference Web service acting server end.
(3.5) simulation software adapter (adapter), according to (adapter) Name of the adapter in Start and step, calls emulation component, and the operation Ansys of simulation software.
(4) embed the local emulation software interface, step is as follows:
(4.1) simulation software adapter (adapter) obtains the desktop handle by the GetDesktopWindow method of Windows API, utilize the GetWindow method to carry out hierarchical alterative to all desktop forms, and obtain class name and title name by the SendMessage method.Then, judge and find class name and the title name forms consistent with simulation software fully that the rreturn value of server end using the forms handle of simulation software as Start that Web service is acted on behalf of passes to the Web service agent client of integrated software platform.
(4.2) after the Web service agent client obtains the window handle of simulation software, the platform profit SWT of integrated software plug-in unit call operation system Windows API, 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 to be full of in the view control of SWT plug-in unit by the embedding human window integrated region view by the SendMessage method.
(5) embed the remote emulation software interface, step is as follows:
(5.1) simulation software adapter (adapter) obtains the human window title name of simulation software from self configuration file.This configuration file is arranged in simulation software adapter (adapter) installation directory, and configuration file comprises emulation component pathname, simulation software human window title name.
(5.2) simulation software adapter (adapter) 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) simulation software adapter (adapter) is combined the IP of VNC server place server and VNC server end slogan, as the VNC link information, and returns to the Web service agent client by Start.
(5.4) the integrated software platform comprises VNC client-side program VNC reader, human window that can be using the VNC client as the integrated software platform.
(5.5) the integrated software platform, after obtaining the VNC link information of returning by the Web service agent client, is resolved this VNC link information, according to IP and the port numbers of the VNC server got, the VNC reader is set.
(5.6) the VNC reader connects the VNC server.
(5.7) the integrated software platform simulation software human window shared the VNC server is embedded into the view control of SWT plug-in unit.
Referring to Fig. 1, the Ansys of simulation software comparatively commonly used in engineering analysis of take is arranged on this locality as example, when semi-girder is carried out to 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 is encapsulated the Windows api function, and the view control of Using 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 Web service acting server end, simulation software adapter (adapter) and the Ansys of simulation software, it is the standard installation procedure.Web service acting server end and simulation software adapter (adapter) transmit the control message to simulation software, are the interactive interfaces of integrated software platform and simulation software.
(3) the Web service agent client in the integrated software platform dynamically generates the ServicesClient object, and it is Ansys adapter (adapter) that adapter (adapter) Name is set simultaneously, and params is set respectively:
InputPath=Project xuanbiliang StaticAnalysis OriginalModelImport, wherein xuanbiliang means that the object of being analyzed is semi-girder, StaticAnalysis means to carry out statics Analysis;
OutputPath=?Project\xuanbiliang\StaticAnalysis\SimulationModel\;
PicturePath=Project\xuanbiliang\StaticAnalysis\SimulationModel\Pic\;
FlowId is that 1, TaskId is 1, and it is 1 that step is set.
(4) by the Start of ServicesClient object reference Web service acting server end.
(5) simulation software adapter (adapter), according to (adapter) Name of the adapter in Start and step, calls emulation component 1, and the operation Ansys of simulation software.
(6) simulation software adapter (adapter) obtains the desktop handle by the GetDesktopWindow method of Windows api function, utilize the GetWindow method to carry out hierarchical alterative to all desktop forms, and obtain class name and title name by the SendMessage method.Then, judge and find class name and the title name forms consistent with the Ansys of simulation software fully, Web service agency's the rreturn value of server end using the forms handle of the Ansys of simulation software as Start, pass to the Web service agent client of integrated software platform.
(7) after the Web service agent client obtains the window handle of the Ansys of simulation software, the Windows api function of the platform profit SWT of integrated software plug-in unit 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, by the SendMessage method, make to be full of the integrated region view by the human window of embedding forms Ansys in SWT plug-in unit control.
Referring to Fig. 2, it is example that the Ansys of simulation software comparatively commonly used of take in engineering analysis is arranged on remote server, when semi-girder is carried out to statics Analysis, start and the concrete implementation step of integrated remote emulation 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, Agent Web Service client and VNC reader.
Integrated to remote emulation software: with the SWT plug-in unit, the VNC client is embedded in local integrated region view on the integrated software platform.
(2) deployment of remote emulation software server comprises: the installation of Web service acting server end, simulation software adapter (adapter), the Ansys of simulation software and VNC server, it is the standard installation procedure.Web service acting server end and simulation software adapter (adapter) transmit the control message to simulation software, are the interactive interfaces of integrated software platform and simulation software.
(3) the Web service agent client in the integrated software platform dynamically generates the ServicesClient object, and it is Ansys adapter (adapter) that adapter (adapter) Name is set simultaneously, and params is set respectively:
InputPath=Project xuanbiliang StaticAnalysis OriginalModelImport, wherein xuanbiliang means that the object of being analyzed is semi-girder, StaticAnalysis means to carry out statics Analysis;
OutputPath=?Project\xuanbiliang\StaticAnalysis\SimulationModel\;
PicturePath=Project\xuanbiliang\StaticAnalysis\SimulationModel\Pic\;
FlowId is that 1, TaskId is 1, and it is 1 that step is set.
(4) by the Start of ServicesClient object reference Web service acting server end.
(5) simulation software adapter (adapter), according to (adapter) Name of the adapter in Start and step, calls emulation component 1, and the operation Ansys of simulation software.
(6) simulation software adapter (adapter) 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 simulation software adapter (adapter) installation directory, and configuration file comprises emulation component pathname, simulation software human window title name.
(7) simulation software adapter (adapter) 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) simulation software adapter (adapter) is combined the IP of VNC server place server and VNC server end slogan 5700, as the VNC link information, and returns to the Web service agent client by Start.
(9) the integrated software platform comprises VNC client-side program VNC reader, human window that can be using the VNC client as the integrated software platform.
(10) the integrated software platform, after obtaining the VNC link information of returning by the Web service agent client, is resolved this VNC link information, according to IP and the port numbers 5700 of the VNC server got, the VNC reader is set.
(11) the VNC reader connects the VNC server.
(12) the integrated software platform simulation software Ansys human window shared the VNC server is embedded into the view control of SWT plug-in unit.
The present invention when integrated, if without the single simulation software interface that appointment is provided, can adopt WTS to replace VNC long-range, and this method can improve the travelling speed of program.