STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 1)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 3)
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
instanceName, interfaceName, 0 )
SALOME_DriverPy.SALOME_DriverPy_i.__init__( self, interfaceName )
+ self._orb = orb
self._naming_service = SALOME_ComponentPy.SALOME_NamingServicePy_i( self._orb )
- self.study = None
- self.studyData = None
- self.entry2PyName = None
+ obj = self._naming_service.Resolve( '/Study' )
+ self.study = obj._narrow( SALOMEDS.Study )
+ self.studyData = []
+ self.entry2PyName = {}
pass
def getVersion( self ):
"""
Gets study data
"""
- if self.studyData:
- l = []
- for m in self.studyData:
- l.append( m._this() )
- return l
- print "ATOMGEN: getData() failed because study was not found"
- return []
+ l = []
+ for m in self.studyData:
+ l.append( m._this() )
+ return l
def Save( self, component, URL, isMultiFile ):
"""
global __entry2IOR__
__entry2IOR__.clear()
import StringIO, pickle
- study = salome.myStudy
- self.study = study
- iter = study.NewChildIterator(component)
+ iter = self.study.NewChildIterator(component)
data = []
while iter.More():
sobject = iter.Value()
from ATOMGEN_Data import Molecule, Atom
mol = Molecule(attr.Value())
__entry2IOR__[sobject.GetID()] = ObjectToString(mol._this())
- iter1 = study.NewChildIterator(sobject)
+ iter1 = self.study.NewChildIterator(sobject)
while iter1.More():
sobject1 = iter1.Value()
iter1.Next()
if not found: continue
name = attr.Value()
x = y = z = None
- iter2 = study.NewChildIterator(sobject1)
+ iter2 = self.study.NewChildIterator(sobject1)
while iter2.More():
sobject2 = iter2.Value()
iter2.Next()
"""
Called when study is closed
"""
- study = salome.myStudy
- if self.studyData:
- self.studyData = None
- if study == self.study:
- self.study = None
- pass
+ self.studyData = []
def CanPublishInStudy( self, IOR ):
"""
if so is not None:
entries.append(so.GetID())
# store data
- if self.studyData:
- data = self.studyData
- data += new_data
- self.studyData = data
- return entries
- print "ATOMGEN: could not append new data"
+ data = self.studyData
+ data += new_data
+ self.studyData = data
return entries
def _translateMolecule( self, mol, i, dx, dy, dz ):
if self.study is None:
return
- self.entry2PyName = None
+ self.entry2PyName = {}
iter = self.study.NewChildIterator(self.study.FindComponent(self._ComponentDataType))
while iter.More():
sobject = iter.Value()
- iter.Next()
+ iter.Next()
found, attr = sobject.FindAttribute("AttributeName")
if not found: continue
- self.entry2PyName[sobject.GetID()] = self._fixPythonName(attr.Value())
+ self.entry2PyName[sobject.GetID()] = self._fixPythonName(attr.Value())
def _fixPythonName(self, in_str):
"""
__CMD_RUN_ALGO1__ = 4010
# study data
-__study_data__ = None
+__study_data__ = {}
################################################
# Init GUI wrappers
global myStudy
global __study_data__
myStudy = _getStudy()
- _getEngine().study = myStudy
+ _getEngine()
# create actions
__study_data__[ "actions" ] = {}
"""
print "ATOMGENGUI::OnGUIEvent: commandId =", commandId
if dict_command.has_key( commandId ):
- try:
- dict_command[ commandId ]()
- except Exception, e:
- processException( e )
+# try:
+ dict_command[ commandId ]()
+# except Exception, e:
+# processException( e )
else:
print "ATOMGENGUI::OnGUIEvent: Action is not implemented: ", commandId
pass