From abb0813651226a11d2139e8d301d61ddecadb2fd Mon Sep 17 00:00:00 2001 From: Pascale Noyret Date: Mon, 30 Nov 2009 14:06:54 +0000 Subject: [PATCH] Pour les menus custom --- src/EFICASGUI/EFICASGUI.py | 83 +++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 46 deletions(-) diff --git a/src/EFICASGUI/EFICASGUI.py b/src/EFICASGUI/EFICASGUI.py index 23b5c126..7b3975b2 100644 --- a/src/EFICASGUI/EFICASGUI.py +++ b/src/EFICASGUI/EFICASGUI.py @@ -36,7 +36,6 @@ print "EFicasGUI :: :::::::::::::::::::::::::::::::::::::::::::::::::::::" # ----------------------------------------------------------------------------- def OnGUIEvent(commandID) : - print "EficasGUI :: OnGUIEvent :::::::::::::::::::::::::::::::::commandID = ",commandID if dict_command.has_key(commandID): print "OnGUIEvent :::::::::: commande associƩe : ",commandID dict_command[commandID]() @@ -62,7 +61,6 @@ def activate(): Portage V3. """ - print "--------EFICASGUI:: activate" setSettings() @@ -76,31 +74,36 @@ def activeStudyChanged(ID): -def definePopup(theContext, theObject, theParent): - theContext= "" - theObject = "100" - theParent = "ObjectBrowser" - a=salome.sg.getAllSelected() +#def definePopup(theContext, theObject, theParent): +# print "EFICASGUI --- definePopup" +# print "EFICASGUI --- definePopup" +# theContext= "" +# theObject = "100" +# theParent = "ObjectBrowser" +# a=salome.sg.getAllSelected() - selectedEntry = a[0] - mySO = monEditor.study.FindObjectID(selectedEntry); - aType = monEditor.getFileType(mySO) - if aType == "FICHIER_EFICAS_ASTER" : - theObject="73" - - return (theContext, theObject, theParent) - - -def customPopup(popup, theContext, theObject, theParent): - print "EFICASGUI --- customPopup TODO" - print "EFICASGUI --- customPopup" - print "EFICASGUI --- customPopup" - print "EFICASGUI --- customPopup" - print "EFICASGUI --- customPopup" - print "EFICASGUI --- customPopup" - print "EFICASGUI --- customPopup" - print "EFICASGUI --- customPopup" - print "EFICASGUI --- customPopup" +# selectedEntry = a[0] +# mySO = monEditor.study.FindObjectID(selectedEntry); +# aType = monEditor.getFileType(mySO) +# print aType +# return (theContext, theObject, theParent) + + +#def customPopup(popup, theContext, theObject, theParent): +# a=salome.sg.getAllSelected() + +# selectedEntry = a[0] +# mySO = monEditor.study.FindObjectID(selectedEntry); +# aType = monEditor.getFileType(mySO) + +# print "EFICASGUI --- customPopup" +# print "EFICASGUI --- customPopup" +# print "EFICASGUI --- customPopup" +# print "EFICASGUI --- customPopup" +# print "EFICASGUI --- customPopup" +# print "EFICASGUI --- customPopup" +# print "EFICASGUI --- customPopup" +# print "EFICASGUI --- customPopup" # popup.removeItem(99003) @@ -114,7 +117,6 @@ def runEficas(): print currentStudyId eficasSalome.runEficas( "ASTER" ) - def runEficaspourOpenturnsStudy(): print "runEficas Pour Openturns Study" @@ -147,24 +149,16 @@ def runEficasFichier(version=None): mySO = monEditor.study.FindObjectID(selectedEntry); aType = monEditor.getFileType(mySO) aValue = monEditor.getFileName(mySO) - if aType == "FICHIER_EFICAS_ASTER": - fileName = aValue - code = "ASTER" - elif aType == "FICHIER_EFICAS_SEP": - fileName = aValue - code = "SEP" - elif aType == "FICHIER_EFICAS_OPENTURNS": + if aType != None : fileName = aValue - code = "OPENTURNS" - else: - fileName=None - code = "ASTER" + code = aType[15:] else: - code = "ASTER" + QMessageBox.critical(None, "Selection Invalide", + "Selectionner un seul fichier SVP") + return; + if code: - #eficasSalome.runEficas(code,attr,studyId=currentStudyId) - #desktop=sgPyQt.getDesktop() if version : eficasSalome.runEficas( code, fileName, version=version) else : @@ -174,19 +168,16 @@ def runEficasFichier(version=None): # Partie applicative dict_command={ - 941:runEficasFichier,# runEficas, + 941:runEficas,# runEficas, 942:runEficaspourOM,# runEficas, 947:runEficaspourOpenturnsStudy, 948:runEficaspourOpenturnsWrapper, - 4041:runEficasFichier, #runEficas, + 4041:runEficas, #runEficas, 4042:runEficaspourOM,# runEficas, 4047:runEficaspourOpenturnsStudy, 4048:runEficaspourOpenturnsWrapper, 9041:runEficasFichier, - 9042:runEficaspourOM,# runEficas, - 9047:runEficaspourOpenturnsStudy, - 9048:runEficaspourOpenturnsWrapper, } -- 2.39.2