Salome HOME
This commit was generated by cvs2git to create tag 'V1_3_0'.
[modules/kernel.git] / doc / html / INPUT / sources / static / examples_Kernel.html
1 <!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
2 <html>
3 <head>
4     
5   <meta http-equiv="Content-Type"
6  content="text/html; charset=iso-8859-1">
7     
8   <meta name="GENERATOR"
9  content="Mozilla/4.73 [en] (WinNT; I) [Netscape]">
10   <title>Main Page</title>
11      
12   <link href="doxygen.css" rel="stylesheet" type="text/css">
13 </head>
14   <body>
15  &nbsp; 
16 <center>
17 <table width="96%">
18  <tbody>
19     <tr>
20  <td><a href="http://www.opencascade.com"><img
21  src="sources/logocorp.gif" border="0" height="46" width="122">
22       </a></td>
23    <td> 
24       <div align="right"><a href="http://www.opencascade.org/SALOME/"><img
25  src="sources/application.gif" border="0" height="46" width="108">
26       </a></div>
27  </td>
28  </tr>
29  
30   </tbody>
31 </table>
32 </center>
33    
34 <h1><a name="page2">Examples</a> </h1>
35    <small><i><big><b>Package SALOME</b></big></i></small><b><i>_ModuleCatalog</i></b><br>
36 <small><br>
37 &nbsp;&nbsp;&nbsp; &nbsp; <big>interface <a href="#module_catalog">SALOME_ModuleCatalog::ModuleCatalog</a></big><br>
38 <br>
39 <i><big><b>Package SALOME<br>
40 <br>
41 &nbsp;&nbsp;&nbsp; </b></big></i></small>interface<a href="#Session"> SALOME::Session</a><br>
42 <br>
43 <small><i><big><b>Package Engines<br>
44 &nbsp;&nbsp;&nbsp; </b></big></i><i><big><b> </b></big></i></small><br>
45 &nbsp;&nbsp;&nbsp; interface <a href="#container">Engines::Container</a><small><br>
46 </small><small><br>
47 <i><big><b>&nbsp;&nbsp;&nbsp; <br>
48 &nbsp;&nbsp;&nbsp; </b></big></i></small><br>
49 <br>
50 <div align="center">&nbsp;&nbsp;&nbsp; <u><font
51  face="Helvetica, Arial, sans-serif"><big><big><b><small><big><a
52  name="module_catalog"></a>SALOME_ModuleCatalog::ModuleCatalog interface</big></small></b></big></big></font></u>
53 <br>
54 </div>
55 <br>
56 <div align="center"><big><big><u><b><font
57  face="Helvetica, Arial, sans-serif"><br>
58 </font></b></u></big></big>
59 <div align="left"><br>
60 <big><b><a class="el"
61  href="interfaceSALOME__ModuleCatalog_1_1Acomponent.html">Acomponent</a>
62 GetComponent  (in string <i>componentname</i>)</b></big><br>
63 <br>
64 See the <a href="#load_com_ex">example</a> below<br>
65 <br>
66 </div>
67 <big><big><u><b><font face="Helvetica, Arial, sans-serif"><br>
68 </font></b><small><font face="Helvetica, Arial, sans-serif"><big><b><a
69  name="Session"></a>SALOME::Session interface</b></big></font></small></u></big></big><br>
70 <div align="left"><br>
71 <br>
72 <big><b>GetInterface ()</b><b>, StopSession () raises (GUIActive, RunningStudies)</b></big><br>
73 <br>
74 <u><i>Stop session and restart GUI application: </i></u><br>
75 <br>
76 mySession.StopSession()<br>
77 <br>
78 mySession.GetInterface()<br>
79 <br>
80 <br>
81 <div align="center"><u><big><big><font
82  face="Helvetica, Arial, sans-serif"><b><a name="container"></a>Engines::Container
83 interface</b></font></big></big></u><br>
84 <br>
85 <br>
86 <div align="left"><big><b><a class="el"
87  href="interfaceEngines_1_1Component.html">Component</a>
88 load_impl  (in string <i>nameToRegister</i>, in string <i>componentName</i>)</b></big><br>
89 <br>
90 <i><u><a name="load_com_ex"></a>Load component with defined component name:</u></i><br>
91 <br>
92 compinfo = module_catalog.GetComponent(componentName)<br>
93 <br>
94 &nbsp;try:<br>
95 &nbsp;&nbsp;&nbsp; machineName = theComputer # name of machine<br>
96 &nbsp;&nbsp;&nbsp; path = compoinfo.GetPathPrefix(machineName) + "/"<br>
97 &nbsp;except SALOME_ModuleCatalog.NotFound, ex:<br>
98 &nbsp;&nbsp;&nbsp; MESSAGE( "machine " + machineName + " not found in Module
99 Catalog" )<br>
100 &nbsp;&nbsp;&nbsp; MESSAGE( "trying localhost" )<br>
101 &nbsp;&nbsp;&nbsp; try:<br>
102 &nbsp;&nbsp;&nbsp; path = compoinfo.GetPathPrefix("localhost") + "/"<br>
103 &nbsp;&nbsp;&nbsp; except SALOME_ModuleCatalog.NotFound, ex:<br>
104 &nbsp;&nbsp;&nbsp; path = ""<br>
105 <br>
106 implementation = path + "lib" + componentName + "Engine.so"<br>
107 MESSAGE( "Trying to load " + implementation )<br>
108 <br>
109 &nbsp;try:<br>
110 <div align="left">&nbsp;&nbsp;&nbsp; component = container.load_impl(componentName,
111 implementation)<i> # Loads into the container a new component, registers
112 it and starts it's CORBA servant. </i><br>
113 </div>
114 &nbsp;&nbsp;&nbsp; MESSAGE( "component " + component._get_instanceName()
115 + " launched !" )<br>
116 &nbsp;&nbsp;&nbsp; return component<br>
117 except:<br>
118 &nbsp;&nbsp;&nbsp; MESSAGE( "component " + componentName + " NOT launched
119 !" )<br>
120 <br>
121 <br>
122 </div>
123 <br>
124 </div>
125 <br>
126 </div>
127 <br>
128 </div>
129
130 <br>
131 <br>
132 <br>
133 </body>
134 </html>