From: Jean-Philippe ARGAUD Date: Wed, 15 Mar 2017 12:36:37 +0000 (+0100) Subject: Adding an open/close button to control the EFICAS tree view X-Git-Tag: V8_3_0rc1~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5a8640721921519b94fae321436f40c066124257;p=modules%2Fadao.git Adding an open/close button to control the EFICAS tree view --- diff --git a/Makefile.am b/Makefile.am index 7b58c38..a51564c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,7 +29,7 @@ endif SUBDIRS += src if SALOME_MODULE -SUBDIRS += resources bin examples test +SUBDIRS += resources bin examples test i18n endif if SPHINX_IS_OK diff --git a/bin/AdaoCatalogGenerator.py b/bin/AdaoCatalogGenerator.py index cedec35..cfa54e2 100644 --- a/bin/AdaoCatalogGenerator.py +++ b/bin/AdaoCatalogGenerator.py @@ -224,7 +224,7 @@ def F_ObserverTemplate() : return BLOC(condition = " NodeType == 'Template' ", def F_Observers(statut) : return FACT( statut=statut, - SELECTION = SIMP(statut="o", defaut=[], typ="TXM", min=0, max="**", validators=NoRepeat(), into=(${choices})),${decl_choices} + SELECTION = SIMP(statut="o", defaut=[], typ="TXM", min=0, max="**", homo="SansOrdreNiDoublon", validators=NoRepeat(), into=(${choices})),${decl_choices} ) """%(observers_list,observers_cont) diff --git a/doc/en/Makefile.am b/doc/en/Makefile.am index 2cc486f..3156f2d 100644 --- a/doc/en/Makefile.am +++ b/doc/en/Makefile.am @@ -49,6 +49,7 @@ EXTRA_DIST = conf.py advanced.rst examples.rst index.rst intro.rst theory.rs images/eficas_close.png \ images/eficas_open.png \ images/eficas_saveas.png \ + images/eficas_tree.png \ images/eficas_valid.png \ images/yacs_containerlog.png diff --git a/doc/en/images/eficas_tree.png b/doc/en/images/eficas_tree.png new file mode 100644 index 0000000..13222b3 Binary files /dev/null and b/doc/en/images/eficas_tree.png differ diff --git a/doc/fr/Makefile.am b/doc/fr/Makefile.am index 9de1300..93237fb 100644 --- a/doc/fr/Makefile.am +++ b/doc/fr/Makefile.am @@ -49,6 +49,7 @@ EXTRA_DIST = conf.py advanced.rst examples.rst index.rst intro.rst theory.rs images/eficas_close.png \ images/eficas_open.png \ images/eficas_saveas.png \ + images/eficas_tree.png \ images/eficas_valid.png \ images/yacs_containerlog.png diff --git a/doc/fr/images/eficas_tree.png b/doc/fr/images/eficas_tree.png new file mode 100644 index 0000000..13222b3 Binary files /dev/null and b/doc/fr/images/eficas_tree.png differ diff --git a/i18n/adao.pro b/i18n/adao.pro index 1fc6ebe..aef3485 100644 --- a/i18n/adao.pro +++ b/i18n/adao.pro @@ -2,16 +2,16 @@ # # clear ; echo ; echo -e "#\n# Debut des sources" ; echo ; \ # echo -e "TRANSLATIONS += adao_fr.ts\n\nCODECFORTR = utf-8\n" ; \ -# find .. -name '*.ui' | sed 's#^\.#FORMS += .#g' ; \ -# find ../bin -name '*.py' | sed 's#^\.#SOURCES += .#g' ; \ +# find .. -name '*.ui' | sed 's#^\.#FORMS += .#g' | sort ; \ +# find ../bin -name '*.py' | sed 's#^\.#SOURCES += .#g' | sort ; \ # find ../src -name '*.py' | grep -v tests/ | sed 's#^\.#SOURCES += .#g' ; \ # echo # # Create/update the .ts files with: -# pylupdate5 i18n/adao.pro -# geany i18n/adao_*.ts # Pour traiter si necessaire les "obsolete" -# linguist i18n/adao_*.ts -# lrelease i18n/adao.pro +# pylupdate5 adao.pro +# geany adao_*.ts # Pour traiter si necessaire les "obsolete" +# linguist adao_*.ts +# lrelease adao.pro # # Debut des sources diff --git a/i18n/adao_en.ts b/i18n/adao_en.ts index fab0d30..2cf3001 100644 --- a/i18n/adao_en.ts +++ b/i18n/adao_en.ts @@ -3,14 +3,12 @@ @default - ASSIMILATION_STUDY - Data assimilation or optimization + Data assimilation or optimization - CHECKING_STUDY - Verification + Verification diff --git a/i18n/adao_fr.ts b/i18n/adao_fr.ts index 5b38988..ae16186 100644 --- a/i18n/adao_fr.ts +++ b/i18n/adao_fr.ts @@ -3,14 +3,12 @@ @default - ASSIMILATION_STUDY - Assimilation de données ou optimisation + Assimilation de données ou optimisation - CHECKING_STUDY - Vérification + Vérification diff --git a/src/daEficas/prefs_ADAO.py.in b/src/daEficas/prefs_ADAO.py.in index 1df16d5..2335a8a 100644 --- a/src/daEficas/prefs_ADAO.py.in +++ b/src/daEficas/prefs_ADAO.py.in @@ -20,27 +20,36 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# Author: André Ribes, andre.ribes@edf.fr, EDF R&D +# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D import os, sys # print "import des prefs de Adao" - +# # Configuration de Eficas +# ======================= +# # INSTALLDIR, REPINI est obligatoire INSTALLDIR = "@EFICAS_DIR@" sys.path.insert(0,INSTALLDIR) # positionnee a repin au debut mise a jour dans configuration repIni=os.path.dirname(os.path.abspath(__file__)) - -# initialdir sert comme directory initial des QFileDialog +# +# Sert comme directory initial des QFileDialog initialdir=os.environ["PWD"] +# +# Traductions et codages # Codage des strings qui accepte les accents (en remplacement de 'ascii') encoding='iso-8859-1' -# lang indique la langue utilisee pour les chaines d'aide : fr ou ang -lang='fr' +# Indique la langue du catalogue utilisee pour les chaines d'aide : fr ou ang +# lang='fr' +# Traduction des labels de boutons ou autres +translatorFichier = os.environ["ADAO_ROOT_DIR"] + "/share/salome/resources/adao/adao" # Ce nom sera complete par EFICAS avec _.qm +# +# Pilotage des sous-fenetres d'EFICAS closeAutreCommande = True closeFrameRechercheCommande = True closeEntete = True +closeArbre = True taille=800 diff --git a/src/daSalome/daGUI/daGuiImpl/adaoCase.py b/src/daSalome/daGUI/daGuiImpl/adaoCase.py index 532c950..10a9868 100644 --- a/src/daSalome/daGUI/daGuiImpl/adaoCase.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoCase.py @@ -43,6 +43,7 @@ class AdaoCase: self.salome_study_item = None # Study item object self.eficas_editor = None # Editor object from Eficas + self.arbreOuvert = False def setEditor(self, editor): if editor is not self.eficas_editor: @@ -119,3 +120,13 @@ class AdaoCase: rtn = u"Validation report for the selected ADAO case:\n\n" rtn += unicode( self.eficas_editor.jdc.report()) return rtn + + def showTreeAdaoCase(self): + if self.eficas_editor: + if self.arbreOuvert: + self.eficas_editor.fermeArbre() + self.arbreOuvert = False + else: + self.eficas_editor.ouvreArbre() + self.arbreOuvert = True + return self.arbreOuvert diff --git a/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py b/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py index d0c5504..8c0250c 100644 --- a/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py +++ b/src/daSalome/daGUI/daGuiImpl/adaoGuiManager.py @@ -63,6 +63,7 @@ UI_ELT_IDS = Enumerate([ 'SAVE_ADAOCASE_ID', 'SAVE_AS_ADAOCASE_ID', 'VALIDATE_ADAOCASE_ID', + 'SHOWTREE_ADAOCASE_ID', 'CLOSE_ADAOCASE_ID', 'YACS_EXPORT_ID', ],offset=6950) @@ -73,6 +74,7 @@ ACTIONS_MAP={ UI_ELT_IDS.SAVE_ADAOCASE_ID:"saveAdaoCase", UI_ELT_IDS.SAVE_AS_ADAOCASE_ID:"saveasAdaoCase", UI_ELT_IDS.VALIDATE_ADAOCASE_ID:"validateAdaoCase", + UI_ELT_IDS.SHOWTREE_ADAOCASE_ID:"showTreeAdaoCase", UI_ELT_IDS.CLOSE_ADAOCASE_ID:"closeAdaoCase", UI_ELT_IDS.YACS_EXPORT_ID:"exportCaseToYACS", } @@ -325,6 +327,22 @@ class AdaoCaseManager(EficasObserver): adaoGuiHelper.gui_information(SalomePyQt.SalomePyQt().getDesktop(), msg) break +####### +# +# Gestion de l'affichage de l'arbre EFICAS +# 1: la fonction showTreeAdaoCase est appelee par le GUI SALOME +# +####### + + def showTreeAdaoCase(self): + adaoLogger.debug("Validation du cas par un rapport sur le JDC") + self.harmonizeSelectionFromEficas() + salomeStudyItem = adaoGuiHelper.getSelectedItem() + for case_name, adao_case in self.cases.iteritems(): + if adao_case.salome_study_item.GetID() == salomeStudyItem.GetID(): + msg = adao_case.showTreeAdaoCase() + break + ####### # # Gestion de la connexion avec YACS @@ -426,6 +444,9 @@ class AdaoGuiUiComponentBuilder: a = sgPyQt.createAction( UI_ELT_IDS.VALIDATE_ADAOCASE_ID, "Validate case", "Validate case", "Validate an ADAO case", "eficas_valid.png" ) sgPyQt.createMenu(a, mid) sgPyQt.createTool(a, tid) + a = sgPyQt.createAction( UI_ELT_IDS.SHOWTREE_ADAOCASE_ID, "Show tree", "Show tree", "Show the commands tree", "eficas_tree.png" ) + sgPyQt.createMenu(a, mid) + sgPyQt.createTool(a, tid) a = sgPyQt.createAction( UI_ELT_IDS.CLOSE_ADAOCASE_ID, "Close case", "Close case", "Close an ADAO case", "eficas_close.png" ) sgPyQt.createMenu(a, mid) sgPyQt.createTool(a, tid)