From b8ca1ab25c2d380716a2b0fcd820985e5e4717fc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Ribes?= Date: Wed, 16 Jun 2010 16:21:31 +0200 Subject: [PATCH] DATASSIM to ADAO --- .../{DATASSIMGUI_impl.py => ADAOGUI_impl.py} | 15 ++- src/daSalome/daGUI/daGuiImpl/Makefile.am | 12 +- .../{datassimCase.py => adaoCase.py} | 15 ++- ...{datassimGuiHelper.py => adaoGuiHelper.py} | 10 +- ...atassimGuiManager.py => adaoGuiManager.py} | 110 +++++++++--------- ...simModuleHelper.py => adaoModuleHelper.py} | 6 +- ...assimStudyEditor.py => adaoStudyEditor.py} | 44 +++---- 7 files changed, 105 insertions(+), 107 deletions(-) rename src/daSalome/daGUI/daGuiImpl/{DATASSIMGUI_impl.py => ADAOGUI_impl.py} (91%) rename src/daSalome/daGUI/daGuiImpl/{datassimCase.py => adaoCase.py} (84%) rename src/daSalome/daGUI/daGuiImpl/{datassimGuiHelper.py => adaoGuiHelper.py} (90%) rename src/daSalome/daGUI/daGuiImpl/{datassimGuiManager.py => adaoGuiManager.py} (78%) rename src/daSalome/daGUI/daGuiImpl/{datassimModuleHelper.py => adaoModuleHelper.py} (98%) rename src/daSalome/daGUI/daGuiImpl/{datassimStudyEditor.py => adaoStudyEditor.py} (70%) diff --git a/src/daSalome/daGUI/daGuiImpl/DATASSIMGUI_impl.py b/src/daSalome/daGUI/daGuiImpl/ADAOGUI_impl.py similarity index 91% rename from src/daSalome/daGUI/daGuiImpl/DATASSIMGUI_impl.py rename to src/daSalome/daGUI/daGuiImpl/ADAOGUI_impl.py index 272bd3c..7e708e7 100644 --- a/src/daSalome/daGUI/daGuiImpl/DATASSIMGUI_impl.py +++ b/src/daSalome/daGUI/daGuiImpl/ADAOGUI_impl.py @@ -35,15 +35,15 @@ sgPyQt = SalomePyQt.SalomePyQt() # to be created for each study. It contains at least the ui component builder that # creates the menu and toolbar items (must be created for every study) -from daGuiImpl import datassimGuiHelper -from daGuiImpl.datassimGuiManager import DatassimGuiUiComponentBuilder -from daGuiImpl.datassimGuiManager import DatassimGuiActionImpl +from daGuiImpl import adaoGuiHelper +from daGuiImpl.adaoGuiManager import AdaoGuiUiComponentBuilder +from daGuiImpl.adaoGuiManager import AdaoGuiActionImpl class GUIcontext: uiComponentBuilder = None actionImpl = None def __init__(self): - self.uiComponentBuilder = DatassimGuiUiComponentBuilder() - self.actionImpl = DatassimGuiActionImpl() + self.uiComponentBuilder = AdaoGuiUiComponentBuilder() + self.actionImpl = AdaoGuiActionImpl() __study2context__ = {} @@ -112,9 +112,9 @@ def activeStudyChanged( studyID ): def createPopupMenu( popup, context ): activeStudyId = sgPyQt.getStudyId() ctx = _setContext(sgPyQt.getStudyId()) - selcount, selected = datassimGuiHelper.getAllSelected(activeStudyId) + selcount, selected = adaoGuiHelper.getAllSelected(activeStudyId) if selcount == 1: - selectedItem = datassimGuiHelper.getSelectedItem(activeStudyId) + selectedItem = adaoGuiHelper.getSelectedItem(activeStudyId) popup = ctx.uiComponentBuilder.createPopupMenuOnItem(popup, activeStudyId, selectedItem) def OnGUIEvent(actionId) : @@ -126,7 +126,6 @@ def OnGUIEvent(actionId) : ctx = _setContext( sgPyQt.getStudyId() ) ctx.actionImpl.processAction(actionId) - # called when module's preferences are changed # preference's resources section and setting name are passed as parameters def preferenceChanged( section, setting ): diff --git a/src/daSalome/daGUI/daGuiImpl/Makefile.am b/src/daSalome/daGUI/daGuiImpl/Makefile.am index dfc4733..a6d8a9b 100644 --- a/src/daSalome/daGUI/daGuiImpl/Makefile.am +++ b/src/daSalome/daGUI/daGuiImpl/Makefile.am @@ -23,13 +23,13 @@ mypkgpythondir =$(salomepythondir)/daGuiImpl mypkgpython_PYTHON = \ __init__.py \ - DATASSIMGUI_impl.py \ - datassimGuiManager.py \ - datassimGuiHelper.py \ - datassimModuleHelper.py \ - datassimStudyEditor.py \ + ADAOGUI_impl.py \ + adaoGuiManager.py \ + adaoGuiHelper.py \ + adaoModuleHelper.py \ + adaoStudyEditor.py \ studyedit.py \ - datassimCase.py \ + adaoCase.py \ enumerate.py diff --git a/src/daSalome/daGUI/daGuiImpl/datassimCase.py b/src/daSalome/daGUI/daGuiImpl/adaoCase.py similarity index 84% rename from src/daSalome/daGUI/daGuiImpl/datassimCase.py rename to src/daSalome/daGUI/daGuiImpl/adaoCase.py index e6ea931..ddb1b8d 100644 --- a/src/daSalome/daGUI/daGuiImpl/datassimCase.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoCase.py @@ -23,8 +23,7 @@ import subprocess import traceback import SalomePyQt -class DatassimCase: - +class AdaoCase: def __init__(self): self.__name = "new_case" @@ -55,17 +54,17 @@ class DatassimCase: msg += "(Try to load: " + filename + ")" return msg - if not os.environ.has_key("DATASSIM_ROOT_DIR"): - return "Please add DATASSIM_ROOT_DIR to your environnement" + if not os.environ.has_key("ADAO_ROOT_DIR"): + return "Please add ADAO_ROOT_DIR to your environnement" - datassim_path = os.environ["DATASSIM_ROOT_DIR"] - datassim_exe = datassim_path + "/bin/salome/DatassimYacsSchemaCreator.py" + adao_path = os.environ["ADAO_ROOT_DIR"] + adao_exe = adao_path + "/bin/salome/AdaoYacsSchemaCreator.py" self.__yacs_filename = self.__filename[:self.__filename.rfind(".")] + '.xml' - args = [datassim_exe, filename, self.__yacs_filename] + args = [adao_exe, filename, self.__yacs_filename] p = subprocess.Popen(args) (stdoutdata, stderrdata) = p.communicate() if not os.path.exists(self.__yacs_filename): - msg = "An error occured during the execution of DatassimYacsSchemaCreator.py \n" + msg = "An error occured during the execution of AdaoYacsSchemaCreator.py \n" msg += "See erros details in your terminal \n" return msg return rtn diff --git a/src/daSalome/daGUI/daGuiImpl/datassimGuiHelper.py b/src/daSalome/daGUI/daGuiImpl/adaoGuiHelper.py similarity index 90% rename from src/daSalome/daGUI/daGuiImpl/datassimGuiHelper.py rename to src/daSalome/daGUI/daGuiImpl/adaoGuiHelper.py index be7bee9..d973e84 100644 --- a/src/daSalome/daGUI/daGuiImpl/datassimGuiHelper.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoGuiHelper.py @@ -25,7 +25,7 @@ import salome import SalomePyQt __sgPyQt = SalomePyQt.SalomePyQt() -import datassimModuleHelper +import adaoModuleHelper from PyQt4 import QtGui,QtCore def waitCursor(): @@ -54,7 +54,7 @@ def getActiveStudy(): makes sens only in the GUI context. """ studyId = getActiveStudyId()() - study = datassimModuleHelper.getStudyManager().GetStudyByID( studyId ) + study = adaoModuleHelper.getStudyManager().GetStudyByID( studyId ) return study def refreshObjectBrowser(): @@ -74,7 +74,7 @@ def getSelectedItem(salomeStudyId=getActiveStudyId()): if salome.sg is None: raise Exception("GuiHelper.getSelectedItem can't be used without the GUI context") - salomeStudy = datassimModuleHelper.getStudyManager().GetStudyByID( salomeStudyId ) + salomeStudy = adaoModuleHelper.getStudyManager().GetStudyByID( salomeStudyId ) item = None listEntries=salome.sg.getAllSelected() @@ -91,11 +91,11 @@ def getAllSelected(salomeStudyId): if salome.sg is None: raise OmaException("getSelectedItem can't be used without the GUI context", OmaException.TYPES.DEVEL) - study = datassimModuleHelper.getStudyManager().GetStudyByID( salomeStudyId ) + study = adaoModuleHelper.getStudyManager().GetStudyByID( salomeStudyId ) selcount = salome.sg.SelectedCount() seltypes = {} for i in range( selcount ): - __incObjToMap( seltypes, datassimModuleHelper.getObjectID( study, salome.sg.getSelected( i ) ) ) + __incObjToMap( seltypes, adaoModuleHelper.getObjectID( study, salome.sg.getSelected( i ) ) ) pass return selcount, seltypes diff --git a/src/daSalome/daGUI/daGuiImpl/datassimGuiManager.py b/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py similarity index 78% rename from src/daSalome/daGUI/daGuiImpl/datassimGuiManager.py rename to src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py index c79a582..fdff429 100644 --- a/src/daSalome/daGUI/daGuiImpl/datassimGuiManager.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py @@ -32,12 +32,12 @@ import SalomePyQt sgPyQt = SalomePyQt.SalomePyQt() from daGuiImpl.enumerate import Enumerate -from daGuiImpl.datassimCase import DatassimCase -from daEficasWrapper.datassimEficasWrapper import DatassimEficasWrapper +from daGuiImpl.adaoCase import AdaoCase +from daEficasWrapper.adaoEficasWrapper import AdaoEficasWrapper from daEficasWrapper.eficasWrapper import EficasObserver from daEficasWrapper.eficasWrapper import EficasEvent -import datassimGuiHelper -import datassimStudyEditor +import adaoGuiHelper +import adaoStudyEditor __cases__ = {} @@ -47,23 +47,23 @@ __cases__ = {} # ============================================================================== # UI_ELT_IDS = Enumerate([ - 'DATASSIM_MENU_ID', - 'NEW_DATASSIMCASE_ID', - 'OPEN_DATASSIMCASE_ID', - 'EDIT_DATASSIMCASE_POP_ID', - 'REMOVE_DATASSIMCASE_POP_ID', + 'ADAO_MENU_ID', + 'NEW_ADAOCASE_ID', + 'OPEN_ADAOCASE_ID', + 'EDIT_ADAOCASE_POP_ID', + 'REMOVE_ADAOCASE_POP_ID', 'YACS_EXPORT_POP_ID', ],offset=950) ACTIONS_MAP={ - UI_ELT_IDS.NEW_DATASSIMCASE_ID:"newDatassimCase", - UI_ELT_IDS.OPEN_DATASSIMCASE_ID:"openDatassimCase", - UI_ELT_IDS.EDIT_DATASSIMCASE_POP_ID:"editDatassimCase", - UI_ELT_IDS.REMOVE_DATASSIMCASE_POP_ID:"removeDatassimCase", + UI_ELT_IDS.NEW_ADAOCASE_ID:"newAdaoCase", + UI_ELT_IDS.OPEN_ADAOCASE_ID:"openAdaoCase", + UI_ELT_IDS.EDIT_ADAOCASE_POP_ID:"editAdaoCase", + UI_ELT_IDS.REMOVE_ADAOCASE_POP_ID:"removeAdaoCase", UI_ELT_IDS.YACS_EXPORT_POP_ID:"exportCaseToYACS", } -class DatassimGuiUiComponentBuilder: +class AdaoGuiUiComponentBuilder: """ The initialisation of this class creates the graphic components involved in the GUI (menu, menu item, toolbar). A ui component builder should be @@ -77,31 +77,31 @@ class DatassimGuiUiComponentBuilder: objectTR = QObject() # create top-level menu - mid = sgPyQt.createMenu( "DATASSIM", -1, UI_ELT_IDS.DATASSIM_MENU_ID, sgPyQt.defaultMenuGroup() ) + mid = sgPyQt.createMenu( "ADAO", -1, UI_ELT_IDS.ADAO_MENU_ID, sgPyQt.defaultMenuGroup() ) # create toolbar - tid = sgPyQt.createTool( "DATASSIM" ) + tid = sgPyQt.createTool( "ADAO" ) - a = sgPyQt.createAction( UI_ELT_IDS.NEW_DATASSIMCASE_ID, "New case", "New case", "Create a new datassim case", "" ) + a = sgPyQt.createAction( UI_ELT_IDS.NEW_ADAOCASE_ID, "New case", "New case", "Create a new adao case", "" ) sgPyQt.createMenu(a, mid) sgPyQt.createTool(a, tid) - a = sgPyQt.createAction( UI_ELT_IDS.OPEN_DATASSIMCASE_ID, "Open case", "Open case", "Open a datassim case", "" ) + a = sgPyQt.createAction( UI_ELT_IDS.OPEN_ADAOCASE_ID, "Open case", "Open case", "Open a adao case", "" ) sgPyQt.createMenu(a, mid) sgPyQt.createTool(a, tid) # the following action are used in context popup - a = sgPyQt.createAction( UI_ELT_IDS.EDIT_DATASSIMCASE_POP_ID, "Edit case", "Edit case", "Edit the selected study case", "" ) - a = sgPyQt.createAction( UI_ELT_IDS.REMOVE_DATASSIMCASE_POP_ID, "Remove case", "Remove case", "Remove the selected study case", "" ) + a = sgPyQt.createAction( UI_ELT_IDS.EDIT_ADAOCASE_POP_ID, "Edit case", "Edit case", "Edit the selected study case", "" ) + a = sgPyQt.createAction( UI_ELT_IDS.REMOVE_ADAOCASE_POP_ID, "Remove case", "Remove case", "Remove the selected study case", "" ) a = sgPyQt.createAction( UI_ELT_IDS.YACS_EXPORT_POP_ID, "Export to YACS", "Export to YACS", "Generate a YACS graph executing this case", "" ) def createPopupMenuOnItem(self,popup,salomeSudyId, item): - if datassimStudyEditor.isValidDatassimCaseItem(salomeSudyId, item): - popup.addAction( sgPyQt.action( UI_ELT_IDS.EDIT_DATASSIMCASE_POP_ID ) ) - popup.addAction( sgPyQt.action( UI_ELT_IDS.REMOVE_DATASSIMCASE_POP_ID ) ) + if adaoStudyEditor.isValidAdaoCaseItem(salomeSudyId, item): + popup.addAction( sgPyQt.action( UI_ELT_IDS.EDIT_ADAOCASE_POP_ID ) ) + popup.addAction( sgPyQt.action( UI_ELT_IDS.REMOVE_ADAOCASE_POP_ID ) ) popup.addAction( sgPyQt.action( UI_ELT_IDS.YACS_EXPORT_POP_ID ) ) return popup -class DatassimGuiActionImpl(EficasObserver): +class AdaoGuiActionImpl(EficasObserver): """ This class implements the ui actions concerning the management of oma study cases. @@ -113,7 +113,7 @@ class DatassimGuiActionImpl(EficasObserver): # to newOmaCase(). #self.__dlgNewStudyCase = DlgNewStudyCase() self.__parent = SalomePyQt.SalomePyQt().getDesktop() - self.__dlgEficasWrapper = DatassimEficasWrapper(parent=SalomePyQt.SalomePyQt().getDesktop()) + self.__dlgEficasWrapper = AdaoEficasWrapper(parent=SalomePyQt.SalomePyQt().getDesktop()) self.__dlgEficasWrapper.addObserver(self) self.__Eficas_viewId = -1 @@ -162,11 +162,11 @@ class DatassimGuiActionImpl(EficasObserver): def activate(self): self.showEficas() - def newDatassimCase(self): + def newAdaoCase(self): self.showEficas() self.__dlgEficasWrapper.fileNew() - def openDatassimCase(self): + def openAdaoCase(self): self.showEficas() global __cases__ fichier = QtGui.QFileDialog.getOpenFileName(SalomePyQt.SalomePyQt().getDesktop(), @@ -174,11 +174,11 @@ class DatassimGuiActionImpl(EficasObserver): self.__dlgEficasWrapper.CONFIGURATION.savedir, self.__dlgEficasWrapper.trUtf8('JDC Files (*.comm);;''All Files (*)')) if fichier.isNull(): return - new_case = DatassimCase() + new_case = AdaoCase() new_case.set_filename(str(fichier)) new_case.set_name(str(fichier.split('/')[-1])) - salomeStudyId = datassimGuiHelper.getActiveStudyId() - salomeStudyItem = datassimStudyEditor.addInStudy(salomeStudyId, new_case) + salomeStudyId = adaoGuiHelper.getActiveStudyId() + salomeStudyItem = adaoStudyEditor.addInStudy(salomeStudyId, new_case) case_key = (salomeStudyId, salomeStudyItem.GetID()) __cases__[case_key] = new_case @@ -187,15 +187,15 @@ class DatassimGuiActionImpl(EficasObserver): callbackId = [salomeStudyId, salomeStudyItem] self.__dlgEficasWrapper.setCallbackId(callbackId) self.showEficas() - datassimGuiHelper.refreshObjectBrowser() + adaoGuiHelper.refreshObjectBrowser() - def editDatassimCase(self): + def editAdaoCase(self): # First we show eficas - all cases are reloaded global __cases__ # Take study item - salomeStudyId = datassimGuiHelper.getActiveStudyId() - salomeStudyItem = datassimGuiHelper.getSelectedItem(salomeStudyId) + salomeStudyId = adaoGuiHelper.getActiveStudyId() + salomeStudyItem = adaoGuiHelper.getSelectedItem(salomeStudyId) case_key = (salomeStudyId, salomeStudyItem.GetID()) # ShowEficas, If case is an empty case - case is destroyed by reopen @@ -216,12 +216,12 @@ class DatassimGuiActionImpl(EficasObserver): print "Oups - cannot edit case !" traceback.print_exc() - def removeDatassimCase(self): + def removeAdaoCase(self): global __cases__ # First step: selectCase - salomeStudyId = datassimGuiHelper.getActiveStudyId() - salomeStudyItem = datassimGuiHelper.getSelectedItem(salomeStudyId) + salomeStudyId = adaoGuiHelper.getActiveStudyId() + salomeStudyItem = adaoGuiHelper.getSelectedItem(salomeStudyId) callbackId = [salomeStudyId, salomeStudyItem] case_open_in_eficas = self.__dlgEficasWrapper.selectCase(callbackId) # If case is in eficas close it ! @@ -232,20 +232,20 @@ class DatassimGuiActionImpl(EficasObserver): case_key = (salomeStudyId, salomeStudyItem.GetID()) if __cases__.has_key(case_key): __cases__.pop(case_key) - datassimStudyEditor.removeItem(salomeStudyId, salomeStudyItem) - datassimGuiHelper.refreshObjectBrowser() + adaoStudyEditor.removeItem(salomeStudyId, salomeStudyItem) + adaoGuiHelper.refreshObjectBrowser() def exportCaseToYACS(self): global __cases__ - salomeStudyId = datassimGuiHelper.getActiveStudyId() - salomeStudyItem = datassimGuiHelper.getSelectedItem(salomeStudyId) + salomeStudyId = adaoGuiHelper.getActiveStudyId() + salomeStudyItem = adaoGuiHelper.getSelectedItem(salomeStudyId) case_key = (salomeStudyId, salomeStudyItem.GetID()) case = __cases__[case_key] msg = case.exportCaseToYACS() if msg != "": - datassimGuiHelper.gui_warning(self.__parent, msg) + adaoGuiHelper.gui_warning(self.__parent, msg) # ========================================================================== # Processing notifications from eficas @@ -272,14 +272,14 @@ class DatassimGuiActionImpl(EficasObserver): def _processEficasNewEvent(self, eficasWrapper, eficasEvent): global __cases__ - new_case = DatassimCase() + new_case = AdaoCase() case_name = eficasWrapper.getCaseName() new_case.set_name(case_name) - salomeStudyId = datassimGuiHelper.getActiveStudyId() - salomeStudyItem = datassimStudyEditor.addInStudy(salomeStudyId, new_case) + salomeStudyId = adaoGuiHelper.getActiveStudyId() + salomeStudyItem = adaoStudyEditor.addInStudy(salomeStudyId, new_case) case_key = (salomeStudyId, salomeStudyItem.GetID()) __cases__[case_key] = new_case - datassimGuiHelper.refreshObjectBrowser() + adaoGuiHelper.refreshObjectBrowser() callbackId = [salomeStudyId, salomeStudyItem] self.__dlgEficasWrapper.setCallbackId(callbackId) @@ -303,8 +303,8 @@ class DatassimGuiActionImpl(EficasObserver): self.__dlgEficasWrapper.setCallbackId(callbackId) else: # Since I am an empty case I destroy myself before reloading - datassimStudyEditor.removeItem(salomeStudyId, salomeStudyItem) - datassimGuiHelper.refreshObjectBrowser() + adaoStudyEditor.removeItem(salomeStudyId, salomeStudyItem) + adaoGuiHelper.refreshObjectBrowser() __cases__.pop(case_key) self.__dlgEficasWrapper.fileNew() except: @@ -318,9 +318,9 @@ class DatassimGuiActionImpl(EficasObserver): self.__dlgEficasWrapper.Openfile(self.__dlgEficasWrapper.getOpenFileName()) # Creation d'un nouveau cas - new_case = DatassimCase() - salomeStudyId = datassimGuiHelper.getActiveStudyId() - salomeStudyItem = datassimStudyEditor.addInStudy(salomeStudyId, new_case) + new_case = AdaoCase() + salomeStudyId = adaoGuiHelper.getActiveStudyId() + salomeStudyItem = adaoStudyEditor.addInStudy(salomeStudyId, new_case) case_key = (salomeStudyId, salomeStudyItem.GetID()) __cases__[case_key] = new_case @@ -357,7 +357,7 @@ class DatassimGuiActionImpl(EficasObserver): pass else: case.set_filename(file_case_name) - datassimStudyEditor.updateItem(targetSalomeStudyId, targetSalomeStudyItem, case) + adaoStudyEditor.updateItem(targetSalomeStudyId, targetSalomeStudyItem, case) # Case key changed ! #new_case_key = (targetSalomeStudyId, targetSalomeStudyItem.GetID()) @@ -365,7 +365,7 @@ class DatassimGuiActionImpl(EficasObserver): #__cases__.pop(old_case_key) #__cases__[new_case_key] = case - datassimGuiHelper.refreshObjectBrowser() + adaoGuiHelper.refreshObjectBrowser() def _processEficasDestroyEvent(self, eficasWrapper, eficasEvent): global __cases__ @@ -378,8 +378,8 @@ class DatassimGuiActionImpl(EficasObserver): case_key = (targetSalomeStudyId, targetSalomeStudyItem.GetID()) __cases__.pop(case_key) - datassimStudyEditor.removeItem(targetSalomeStudyId, targetSalomeStudyItem) - datassimGuiHelper.refreshObjectBrowser() + adaoStudyEditor.removeItem(targetSalomeStudyId, targetSalomeStudyItem) + adaoGuiHelper.refreshObjectBrowser() def _processEficasUnknownEvent(self, eficasWrapper, eficasEvent): print "Unknown Eficas Event" diff --git a/src/daSalome/daGUI/daGuiImpl/datassimModuleHelper.py b/src/daSalome/daGUI/daGuiImpl/adaoModuleHelper.py similarity index 98% rename from src/daSalome/daGUI/daGuiImpl/datassimModuleHelper.py rename to src/daSalome/daGUI/daGuiImpl/adaoModuleHelper.py index c30957f..1336a47 100644 --- a/src/daSalome/daGUI/daGuiImpl/datassimModuleHelper.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoModuleHelper.py @@ -78,7 +78,7 @@ def componentName(): # Note that this name should be (i) the name used for the class implementing # the component CORBA interface and (ii) the name used to declare the component # in the catalog of the module. - return "DATASSIM" + return "ADAO" # _MEM_ we use here the tr() translation methode to manage constant parameters # in the application. We could have specified instead constant values directly @@ -87,13 +87,13 @@ from PyQt4.QtCore import QObject QObjectTR=QObject() def componentUserName(): - return "DATASSIM" + return "ADAO" def modulePixmap(): """ Get the reference pixmap for this module. """ - return "DATASSIM_small.png" + return "ADAO_small.png" __verbose__ = None def verbose(): diff --git a/src/daSalome/daGUI/daGuiImpl/datassimStudyEditor.py b/src/daSalome/daGUI/daGuiImpl/adaoStudyEditor.py similarity index 70% rename from src/daSalome/daGUI/daGuiImpl/datassimStudyEditor.py rename to src/daSalome/daGUI/daGuiImpl/adaoStudyEditor.py index e73da18..9d29837 100644 --- a/src/daSalome/daGUI/daGuiImpl/datassimStudyEditor.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoStudyEditor.py @@ -22,16 +22,16 @@ __author__="aribes/gboulant" from enumerate import Enumerate import studyedit -import datassimModuleHelper -from daGuiImpl.datassimCase import DatassimCase +import adaoModuleHelper +from daGuiImpl.adaoCase import AdaoCase # # ============================================================================== # Constant parameters and identifiers # ============================================================================== # -DATASSIM_ITEM_TYPES = Enumerate([ - "DATASSIM_CASE", +ADAO_ITEM_TYPES = Enumerate([ + "ADAO_CASE", ]) # @@ -46,25 +46,25 @@ DATASSIM_ITEM_TYPES = Enumerate([ # a SComponent is a reference in a study toward a SALOME component # -def addInStudy(salomeStudyId, datassimCase): +def addInStudy(salomeStudyId, adaoCase): """ This function adds in the specified SALOME study a study entry that corresponds - to the specified datassim case. This study case is put in a folder under - the DATASSIM component and is identified by the case name. + to the specified adao case. This study case is put in a folder under + the ADAO component and is identified by the case name. """ studyEditor = studyedit.getStudyEditor(salomeStudyId) - datassimRootEntry = studyEditor.findOrCreateComponent( - engineName = datassimModuleHelper.componentName(), - componentName = datassimModuleHelper.componentUserName()) + adaoRootEntry = studyEditor.findOrCreateComponent( + engineName = adaoModuleHelper.componentName(), + componentName = adaoModuleHelper.componentUserName()) - itemName = datassimCase.get_name() - itemValue = str(datassimCase.get_filename()) - itemType = DATASSIM_ITEM_TYPES.DATASSIM_CASE + itemName = adaoCase.get_name() + itemValue = str(adaoCase.get_filename()) + itemType = ADAO_ITEM_TYPES.ADAO_CASE salomeStudyItem = studyEditor.createItem( - datassimRootEntry, itemName, + adaoRootEntry, itemName, comment = itemValue, typeId = itemType) # _MEM_ Note that we use the comment attribute to store the serialize @@ -72,16 +72,16 @@ def addInStudy(salomeStudyId, datassimCase): return salomeStudyItem -def updateItem(salomeStudyId, salomeStudyItem, datassimCase): +def updateItem(salomeStudyId, salomeStudyItem, adaoCase): studyEditor = studyedit.getStudyEditor(salomeStudyId) - if salomeStudyItem.GetName()[:-2] != datassimCase.get_name(): - itemName = datassimCase.get_name() - itemValue = datassimCase.get_filename() + if salomeStudyItem.GetName()[:-2] != adaoCase.get_name(): + itemName = adaoCase.get_name() + itemValue = adaoCase.get_filename() else: itemName = salomeStudyItem.GetName() - itemValue = datassimCase.get_filename() + itemValue = adaoCase.get_filename() studyEditor.setItem(salomeStudyItem, name = itemName, @@ -95,16 +95,16 @@ def removeItem(salomeStudyId, item): return studyEditor.removeItem(item,True) -def isValidDatassimCaseItem(salomeStudyId,item): +def isValidAdaoCaseItem(salomeStudyId,item): """ - Return true if the specified item corresponds to a valid datassimCase + Return true if the specified item corresponds to a valid adaoCase """ if item is None: return False studyEditor = studyedit.getStudyEditor(salomeStudyId) itemType = studyEditor.getTypeId(item) - if itemType != DATASSIM_ITEM_TYPES.DATASSIM_CASE: + if itemType != ADAO_ITEM_TYPES.ADAO_CASE: return False return True -- 2.39.2