2 # Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
4 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 # File : SyrControlComponent.py
25 # Author : Jean Rahuel
26 # Module : SuperVisionTest
32 from omniORB import CORBA, PortableServer
34 import Engines, Engines__POA
35 import SuperVisionTest, SuperVisionTest__POA
36 from SALOME_ComponentPy import *
38 from LifeCycleCORBA import *
39 from SALOME_NamingServicePy import *
41 from SyrComponent_idl import *
43 from SyrControlComponent_idl import *
45 orb = CORBA.ORB_init([''], CORBA.ORB_ID)
47 lcc = LifeCycleCORBA(orb)
49 naming_service = SALOME_NamingServicePy_i(orb)
51 modulecatalog = naming_service.Resolve("/Kernel/ModulCatalog")
53 class SyrControlComponent( SuperVisionTest__POA.SyrControlComponent, SALOME_ComponentPy_i):
55 def L_OneEven( self , ValOne , ValEven ):
56 self.beginService( 'SyrControlComponent L_OneEven' )
57 self.sendMessage( NOTIF_STEP , "time.sleep( 1 )" )
64 self.sendMessage( NOTIF_TRACE , "OddNumber" )
67 self.sendMessage( NOTIF_TRACE , "EvenNumber" )
70 self.sendMessage( NOTIF_TRACE , "Syracuse is TRUE : NumberOne" )
75 self.endService( 'SyrControlComponent L_OneEven' )
76 return Finished,Incr,Even,Odd
78 def C_NotOneIsEven( self ):
79 self.beginService( 'SyrControlComponent C_NotOneIsEven' )
80 self.sendMessage( NOTIF_TRACE , "EvenNumber" )
82 self.endService( 'SyrControlComponent C_NotOneIsEven' )
85 def LOOPN( self , InLoop , iN , iK , min , max ):
86 self.beginService( 'SyrControlComponent LOOPN' )
87 self.sendMessage( NOTIF_TRACE , "LOOPN" )
92 if min > 0 & min <= max :
99 print 'SyrControlComponent LOOPN InLoop iN OutLoop N',InLoop,iN,OutLoop,N
100 self.endService( 'SyrControlComponent LOOPN' )
103 def WHILENOTONE( self , N ):
104 OutLoop = self.Syr.C_ISONE( N )
109 print 'SyrControlComponent WHILENOTONE OutLoop N',OutLoop,N
112 def IFNOTEVEN( self , N ) :
113 Even = self.Syr.C_ISEVEN( N )
117 print 'SyrControlComponent IFNOTEVEN Odd Even N',Odd,Even,N
120 def LOOPi( self , InLoop , ii ):
130 print 'SyrControlComponent LOOPi InLoop ii OutLoop i',InLoop,ii,OutLoop,i
133 def WHILEEVEN( self , N ) :
134 OutLoop = self.Syr.C_ISEVEN( N )
135 print 'SyrControlComponent WHILEEVEN OutLoop N',OutLoop,N
138 def __init__(self, orb, poa, this, containerName, instanceName, interfaceName):
139 SALOME_ComponentPy_i.__init__(self, orb, poa, this, containerName,
140 instanceName, interfaceName, 1)
141 self.Syr = lcc.FindOrLoadComponent( 'FactoryServer' , 'SyrComponent' )
142 print "SyrControlComponent::__init__",dir(self.Syr)