From 5aae19fee609dd4d70d1cd98ed4600a7b4deb360 Mon Sep 17 00:00:00 2001 From: PASCALE NOYRET Date: Fri, 15 Dec 2023 17:36:33 +0100 Subject: [PATCH] sauvegarde du 14 juillet --- Codes/ReacteurNumerique/__init__.py | 0 Codes/ReacteurNumerique/a.txt | 1 + Codes/ReacteurNumerique/cata_RN_UQ.py | 1 - Codes/ReacteurNumerique/lanceEficas.py | 7 +- .../prefs_ExempleIntegrateur.py | 8 + .../prefs_ReacteurNumerique.py | 8 +- .../qtEficasReacteurNumerique.py | 8 +- Codes/Telemac/configuration_TELEMAC.py | 2 +- Doc/{ => Users}/CMakeLists.txt | 0 Doc/{ => Users}/Makefile | 0 Doc/{ => Users}/ajouter_une_commande.rst | 0 Doc/{ => Users}/color_chart.rst | 0 Doc/{ => Users}/commentaires_parametres.rst | 0 Doc/{ => Users}/conf.py | 0 Doc/{ => Users}/eficas_icons.rst | 0 Doc/{ => Users}/eficas_in_salome.rst | 0 Doc/{ => Users}/eficas_notions.rst | 0 Doc/{ => Users}/eficas_presentation.rst | 0 Doc/{ => Users}/eficas_rules.rst | 0 Doc/{ => Users}/images/ArbreSalome.png | Bin Doc/{ => Users}/images/ChoixCata.png | Bin Doc/{ => Users}/images/ChoixCode.png | Bin Doc/{ => Users}/images/ChoixCommande.png | Bin Doc/{ => Users}/images/CommandeBouton.png | Bin Doc/{ => Users}/images/Commentaire.png | Bin Doc/{ => Users}/images/DataMenu.png | Bin Doc/{ => Users}/images/DblClickOnOptional.png | Bin Doc/{ => Users}/images/Documentation1.png | Bin Doc/{ => Users}/images/DoubleFleche.png | Bin Doc/{ => Users}/images/Duplication.png | Bin Doc/{ => Users}/images/Erreur.png | Bin .../images/FichiersEtRepertoires.png | Bin Doc/{ => Users}/images/FiltreCommande.png | Bin Doc/{ => Users}/images/FindConcept.png | Bin Doc/{ => Users}/images/GererFichiers.png | Bin Doc/{ => Users}/images/GererMCS.png | Bin Doc/{ => Users}/images/Groupes.png | Bin Doc/{ => Users}/images/Icons.png | Bin Doc/{ => Users}/images/Import.png | Bin Doc/{ => Users}/images/LctDsSalome.png | Bin Doc/{ => Users}/images/ListeEtTuple.png | Bin Doc/{ => Users}/images/Main.png | Bin Doc/{ => Users}/images/Matrice.png | Bin Doc/{ => Users}/images/Menus.png | Bin Doc/{ => Users}/images/Multi.png | Bin Doc/{ => Users}/images/NomPython.png | Bin Doc/{ => Users}/images/NommerObjet.png | Bin Doc/{ => Users}/images/Nouveau.png | Bin Doc/{ => Users}/images/OptionnelCommande.png | Bin Doc/{ => Users}/images/OptionnelCommande1.png | Bin .../images/OptionnelParametersAdao.png | Bin .../images/OptionnelParametersAdao1.png | Bin Doc/{ => Users}/images/Ordre.png | Bin Doc/{ => Users}/images/Ouvrir.png | Bin Doc/{ => Users}/images/Parametres.png | Bin Doc/{ => Users}/images/Parametres1.png | Bin Doc/{ => Users}/images/Parametres2.png | Bin Doc/{ => Users}/images/Poubelle.png | Bin Doc/{ => Users}/images/Recents.png | Bin Doc/{ => Users}/images/Regles.png | Bin Doc/{ => Users}/images/Roue.png | Bin Doc/{ => Users}/images/Run.png | Bin Doc/{ => Users}/images/SalomePylone.png | Bin Doc/{ => Users}/images/SalomePyloneSE.png | Bin Doc/{ => Users}/images/Scripts.png | Bin Doc/{ => Users}/images/SelectAllInList.png | Bin Doc/{ => Users}/images/ShowAllValues.png | Bin Doc/{ => Users}/images/TPXO.png | Bin Doc/{ => Users}/images/ToolTipOnButton.png | Bin Doc/{ => Users}/images/ToolTipOnLabel.png | Bin Doc/{ => Users}/images/ToolTipOnLineEdit.png | Bin Doc/{ => Users}/images/ToolTipOnRed.png | Bin Doc/{ => Users}/images/Zero.png | Bin Doc/{ => Users}/index.rst | 0 Doc/{ => Users}/lancer_eficas.rst | 0 Doc/{ => Users}/nouveau_JDC.rst | 0 Doc/{ => Users}/parametrer_une_commande.rst | 0 Doc/{ => Users}/python_rules.rst | 0 Doc/{ => Users}/widgetInDetails.rst | 0 InterfaceGUI/QT5/configuration.py | 272 ------------- InterfaceGUI/QT5/editor.py | 151 +------- InterfaceGUI/QT5/gereIcones.py | 10 +- InterfaceGUI/QT5/gereListe.py | 4 +- InterfaceGUI/QT5/gereListeAvril11.py | 363 ------------------ InterfaceGUI/QT5/gereTraduction.py | 9 +- InterfaceGUI/QT5/monChoixCata.py | 2 +- InterfaceGUI/QT5/monChoixCode.py | 2 +- InterfaceGUI/QT5/monChoixLangue.py | 2 +- InterfaceGUI/QT5/monGroupeOptionnel.py | 4 +- InterfaceGUI/QT5/monRecherche.py | 2 +- InterfaceGUI/QT5/monRechercheCatalogue.py | 2 +- InterfaceGUI/QT5/monSelectVal.py | 2 +- InterfaceGUI/QT5/monViewTexte.py | 4 +- InterfaceGUI/QT5/monVisu.py | 2 +- InterfaceGUI/QT5/monWidgetBloc.py | 2 +- InterfaceGUI/QT5/monWidgetMatrice.py | 2 +- InterfaceGUI/QT5/monWidgetOptionnel.py | 2 +- .../QT5/monWidgetPlusieursASSDIntoOrdonne.py | 2 +- InterfaceGUI/QT5/monWidgetPlusieursTuple.py | 1 + InterfaceGUI/QT5/monWidgetSimpBase.py | 2 +- InterfaceGUI/QT5/monWidgetSimpBool.py | 2 +- InterfaceGUI/QT5/qtEficas.py | 291 +------------- InterfaceGUI/QT5/ssIhm.py | 56 --- InterfaceGUI/QT5/typeNode.py | 4 +- InterfaceGUI/QT5/viewManager.py | 20 +- InterfaceGUI/configuration.py | 239 ++++++++++++ InterfaceGUI/editorSsIhm.py | 17 +- InterfaceGUI/qtEficasSsIhm.py | 117 ++---- InterfaceGUI/readercata.py | 182 ++++----- InterfaceGUI/readercataXML.py | 6 +- Tests/{ => OldTestsTk}/testihm/common.py | 0 Tests/{ => OldTestsTk}/testihm/testihm1.py | 0 Tests/{ => OldTestsTk}/testihm/testihm2.py | 0 Tests/{ => OldTestsTk}/testihm/testihm3.py | 0 Tests/{ => OldTestsTk}/testihm/testihm4.py | 0 Tests/{ => OldTestsTk}/testihm7/common.py | 0 Tests/{ => OldTestsTk}/testihm7/testihm1.py | 0 Tests/{ => OldTestsTk}/testihm7/testihm2.py | 0 Tests/{ => OldTestsTk}/testihm7/testihm4.py | 0 Tests/{ => OldTestsTk}/testihm9/common.py | 0 Tests/{ => OldTestsTk}/testihm9/testihm1.py | 0 Tests/{ => OldTestsTk}/testihm9/testihm2.py | 0 Tests/{ => OldTestsTk}/testihm9/testihm3.py | 0 Tests/{ => OldTestsTk}/testihm9/testihm4.py | 0 Tests/config.py | 8 - Tests/editeur.ini | 57 --- Tests/eficas_aster.py | 32 -- Tests/{ => old}/compare.py | 0 Tests/style.py | 63 --- Tools/cataEmpty.py | 8 + Tools/cataExample.py | 161 ++++++++ Tools/generateStructure.py | 33 ++ Tools/generateXML.py | 36 ++ Tools/generateXSD.py | 33 ++ Tools/qtEficasGui.py | 46 +++ Tools/validateDataSet.py | 36 ++ 136 files changed, 793 insertions(+), 1531 deletions(-) create mode 100644 Codes/ReacteurNumerique/__init__.py create mode 100644 Codes/ReacteurNumerique/a.txt mode change 100644 => 100755 Codes/ReacteurNumerique/lanceEficas.py create mode 100755 Codes/ReacteurNumerique/prefs_ExempleIntegrateur.py rename Doc/{ => Users}/CMakeLists.txt (100%) rename Doc/{ => Users}/Makefile (100%) rename Doc/{ => Users}/ajouter_une_commande.rst (100%) rename Doc/{ => Users}/color_chart.rst (100%) rename Doc/{ => Users}/commentaires_parametres.rst (100%) rename Doc/{ => Users}/conf.py (100%) rename Doc/{ => Users}/eficas_icons.rst (100%) rename Doc/{ => Users}/eficas_in_salome.rst (100%) rename Doc/{ => Users}/eficas_notions.rst (100%) rename Doc/{ => Users}/eficas_presentation.rst (100%) rename Doc/{ => Users}/eficas_rules.rst (100%) rename Doc/{ => Users}/images/ArbreSalome.png (100%) rename Doc/{ => Users}/images/ChoixCata.png (100%) rename Doc/{ => Users}/images/ChoixCode.png (100%) rename Doc/{ => Users}/images/ChoixCommande.png (100%) rename Doc/{ => Users}/images/CommandeBouton.png (100%) rename Doc/{ => Users}/images/Commentaire.png (100%) rename Doc/{ => Users}/images/DataMenu.png (100%) rename Doc/{ => Users}/images/DblClickOnOptional.png (100%) rename Doc/{ => Users}/images/Documentation1.png (100%) rename Doc/{ => Users}/images/DoubleFleche.png (100%) rename Doc/{ => Users}/images/Duplication.png (100%) rename Doc/{ => Users}/images/Erreur.png (100%) rename Doc/{ => Users}/images/FichiersEtRepertoires.png (100%) rename Doc/{ => Users}/images/FiltreCommande.png (100%) rename Doc/{ => Users}/images/FindConcept.png (100%) rename Doc/{ => Users}/images/GererFichiers.png (100%) rename Doc/{ => Users}/images/GererMCS.png (100%) rename Doc/{ => Users}/images/Groupes.png (100%) rename Doc/{ => Users}/images/Icons.png (100%) rename Doc/{ => Users}/images/Import.png (100%) rename Doc/{ => Users}/images/LctDsSalome.png (100%) rename Doc/{ => Users}/images/ListeEtTuple.png (100%) rename Doc/{ => Users}/images/Main.png (100%) rename Doc/{ => Users}/images/Matrice.png (100%) rename Doc/{ => Users}/images/Menus.png (100%) rename Doc/{ => Users}/images/Multi.png (100%) rename Doc/{ => Users}/images/NomPython.png (100%) rename Doc/{ => Users}/images/NommerObjet.png (100%) rename Doc/{ => Users}/images/Nouveau.png (100%) rename Doc/{ => Users}/images/OptionnelCommande.png (100%) rename Doc/{ => Users}/images/OptionnelCommande1.png (100%) rename Doc/{ => Users}/images/OptionnelParametersAdao.png (100%) rename Doc/{ => Users}/images/OptionnelParametersAdao1.png (100%) rename Doc/{ => Users}/images/Ordre.png (100%) rename Doc/{ => Users}/images/Ouvrir.png (100%) rename Doc/{ => Users}/images/Parametres.png (100%) rename Doc/{ => Users}/images/Parametres1.png (100%) rename Doc/{ => Users}/images/Parametres2.png (100%) rename Doc/{ => Users}/images/Poubelle.png (100%) rename Doc/{ => Users}/images/Recents.png (100%) rename Doc/{ => Users}/images/Regles.png (100%) rename Doc/{ => Users}/images/Roue.png (100%) rename Doc/{ => Users}/images/Run.png (100%) rename Doc/{ => Users}/images/SalomePylone.png (100%) rename Doc/{ => Users}/images/SalomePyloneSE.png (100%) rename Doc/{ => Users}/images/Scripts.png (100%) rename Doc/{ => Users}/images/SelectAllInList.png (100%) rename Doc/{ => Users}/images/ShowAllValues.png (100%) rename Doc/{ => Users}/images/TPXO.png (100%) rename Doc/{ => Users}/images/ToolTipOnButton.png (100%) rename Doc/{ => Users}/images/ToolTipOnLabel.png (100%) rename Doc/{ => Users}/images/ToolTipOnLineEdit.png (100%) rename Doc/{ => Users}/images/ToolTipOnRed.png (100%) rename Doc/{ => Users}/images/Zero.png (100%) rename Doc/{ => Users}/index.rst (100%) rename Doc/{ => Users}/lancer_eficas.rst (100%) rename Doc/{ => Users}/nouveau_JDC.rst (100%) rename Doc/{ => Users}/parametrer_une_commande.rst (100%) rename Doc/{ => Users}/python_rules.rst (100%) rename Doc/{ => Users}/widgetInDetails.rst (100%) delete mode 100644 InterfaceGUI/QT5/configuration.py delete mode 100644 InterfaceGUI/QT5/gereListeAvril11.py delete mode 100644 InterfaceGUI/QT5/ssIhm.py create mode 100644 InterfaceGUI/configuration.py rename Tests/{ => OldTestsTk}/testihm/common.py (100%) rename Tests/{ => OldTestsTk}/testihm/testihm1.py (100%) rename Tests/{ => OldTestsTk}/testihm/testihm2.py (100%) rename Tests/{ => OldTestsTk}/testihm/testihm3.py (100%) rename Tests/{ => OldTestsTk}/testihm/testihm4.py (100%) rename Tests/{ => OldTestsTk}/testihm7/common.py (100%) rename Tests/{ => OldTestsTk}/testihm7/testihm1.py (100%) rename Tests/{ => OldTestsTk}/testihm7/testihm2.py (100%) rename Tests/{ => OldTestsTk}/testihm7/testihm4.py (100%) rename Tests/{ => OldTestsTk}/testihm9/common.py (100%) rename Tests/{ => OldTestsTk}/testihm9/testihm1.py (100%) rename Tests/{ => OldTestsTk}/testihm9/testihm2.py (100%) rename Tests/{ => OldTestsTk}/testihm9/testihm3.py (100%) rename Tests/{ => OldTestsTk}/testihm9/testihm4.py (100%) delete mode 100644 Tests/config.py delete mode 100644 Tests/editeur.ini delete mode 100755 Tests/eficas_aster.py rename Tests/{ => old}/compare.py (100%) delete mode 100644 Tests/style.py create mode 100755 Tools/cataEmpty.py create mode 100755 Tools/cataExample.py create mode 100755 Tools/generateStructure.py create mode 100755 Tools/generateXML.py create mode 100755 Tools/generateXSD.py create mode 100755 Tools/qtEficasGui.py create mode 100755 Tools/validateDataSet.py diff --git a/Codes/ReacteurNumerique/__init__.py b/Codes/ReacteurNumerique/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/Codes/ReacteurNumerique/a.txt b/Codes/ReacteurNumerique/a.txt new file mode 100644 index 00000000..ad61359d --- /dev/null +++ b/Codes/ReacteurNumerique/a.txt @@ -0,0 +1 @@ +./qtEficasReacteurNumerique.py -c cata_RN.py essaiPN.comm diff --git a/Codes/ReacteurNumerique/cata_RN_UQ.py b/Codes/ReacteurNumerique/cata_RN_UQ.py index 39ddb625..faee17f6 100755 --- a/Codes/ReacteurNumerique/cata_RN_UQ.py +++ b/Codes/ReacteurNumerique/cata_RN_UQ.py @@ -5,7 +5,6 @@ if os.path.dirname(repInitial) not in sys.path : sys.path.insert(0,repInitial) if os.path.dirname(repEficas) not in sys.path : sys.path.insert(0,repEficas) import types -from Noyau.N_VALIDATOR import Valid from cata_RN import * # sert a activer les options d incertitude dans eficas diff --git a/Codes/ReacteurNumerique/lanceEficas.py b/Codes/ReacteurNumerique/lanceEficas.py old mode 100644 new mode 100755 index 04831f8d..8dc5baaa --- a/Codes/ReacteurNumerique/lanceEficas.py +++ b/Codes/ReacteurNumerique/lanceEficas.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # Copyright (C) 2007-2012 EDF R&D # # This library is free software; you can redistribute it and/or @@ -30,11 +31,11 @@ sys.path.append(os.path.join(os.path.abspath(eficasPath))) name='prefs_' + code prefFile = Path(name + ".py") -if (prefFile .is_file(): +if prefFile.is_file(): try : __import__(name) except : print ('Unable to import {}').format(prefFile) exit(1) -from InterfaceQT4 import eficas_go -eficas_go.lanceEficas(code=prefs.code,GUI='QT5') +from Editeur import eficas_go +eficas_go.lanceEficas(code=code,GUIPath='QT5') diff --git a/Codes/ReacteurNumerique/prefs_ExempleIntegrateur.py b/Codes/ReacteurNumerique/prefs_ExempleIntegrateur.py new file mode 100755 index 00000000..b159d44c --- /dev/null +++ b/Codes/ReacteurNumerique/prefs_ExempleIntegrateur.py @@ -0,0 +1,8 @@ +import os +repIni='/home/A96028/QT5Dev/eficasMerge/Codes/ReacteurNumerique' +lang='fr' +catalogues=( + ('ReacteurNumerique','Version Beta',os.path.join(repIni,'cata_RN_UQ.py'),'python','python'), + #('ReacteurNumerique','Version UQ',os.path.join(repIni,'cata_RN_EDG_Fake.py'),'python','python'), +) +closeFrameRechercheCommande=False diff --git a/Codes/ReacteurNumerique/prefs_ReacteurNumerique.py b/Codes/ReacteurNumerique/prefs_ReacteurNumerique.py index ae35e063..5b3211da 100755 --- a/Codes/ReacteurNumerique/prefs_ReacteurNumerique.py +++ b/Codes/ReacteurNumerique/prefs_ReacteurNumerique.py @@ -19,23 +19,17 @@ # # ====================================================================== -import traceback -traceback.print_stack() import os,sys # repIni sert a localiser le fichier editeur.ini # Obligatoire repIni=os.path.dirname(os.path.abspath(__file__)) -INSTALLDIR=os.path.join(repIni,'..') +INSTALLDIR=os.path.join(repIni,'..','..') sys.path[:0]=[INSTALLDIR] # lang indique la langue utilisee pour les chaines d'aide : fr ou ang lang='fr' -# Codage des strings qui accepte les accents (en remplacement de 'ascii') -encoding='iso-8859-1' - -# #typeDeCata='XML' catalogues=( ('ReacteurNumerique','Version Beta',os.path.join(repIni,'cata_RN_UQ.py'),'python','python'), diff --git a/Codes/ReacteurNumerique/qtEficasReacteurNumerique.py b/Codes/ReacteurNumerique/qtEficasReacteurNumerique.py index 19d451aa..a4704710 100755 --- a/Codes/ReacteurNumerique/qtEficasReacteurNumerique.py +++ b/Codes/ReacteurNumerique/qtEficasReacteurNumerique.py @@ -25,13 +25,11 @@ # Modules Eficas import prefs name='prefs_'+prefs.code -__import__(name) +#__import__(name) import os, sys - sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..','..')) -import prefs -from InterfaceQT4 import eficas_go +from Editeur import eficas_go print (prefs.code) -eficas_go.lanceEficas(code=prefs.code) +eficas_go.lanceEficas(code=prefs.code, GUIPath='QT5') diff --git a/Codes/Telemac/configuration_TELEMAC.py b/Codes/Telemac/configuration_TELEMAC.py index 4d130a7a..6533cc51 100644 --- a/Codes/Telemac/configuration_TELEMAC.py +++ b/Codes/Telemac/configuration_TELEMAC.py @@ -22,7 +22,7 @@ Ce module sert pour charger les paramètres de configuration d'EFICAS """ # Modules Python -from InterfaceQT4 import configuration +from InterfaceGUI import configuration import os diff --git a/Doc/CMakeLists.txt b/Doc/Users/CMakeLists.txt similarity index 100% rename from Doc/CMakeLists.txt rename to Doc/Users/CMakeLists.txt diff --git a/Doc/Makefile b/Doc/Users/Makefile similarity index 100% rename from Doc/Makefile rename to Doc/Users/Makefile diff --git a/Doc/ajouter_une_commande.rst b/Doc/Users/ajouter_une_commande.rst similarity index 100% rename from Doc/ajouter_une_commande.rst rename to Doc/Users/ajouter_une_commande.rst diff --git a/Doc/color_chart.rst b/Doc/Users/color_chart.rst similarity index 100% rename from Doc/color_chart.rst rename to Doc/Users/color_chart.rst diff --git a/Doc/commentaires_parametres.rst b/Doc/Users/commentaires_parametres.rst similarity index 100% rename from Doc/commentaires_parametres.rst rename to Doc/Users/commentaires_parametres.rst diff --git a/Doc/conf.py b/Doc/Users/conf.py similarity index 100% rename from Doc/conf.py rename to Doc/Users/conf.py diff --git a/Doc/eficas_icons.rst b/Doc/Users/eficas_icons.rst similarity index 100% rename from Doc/eficas_icons.rst rename to Doc/Users/eficas_icons.rst diff --git a/Doc/eficas_in_salome.rst b/Doc/Users/eficas_in_salome.rst similarity index 100% rename from Doc/eficas_in_salome.rst rename to Doc/Users/eficas_in_salome.rst diff --git a/Doc/eficas_notions.rst b/Doc/Users/eficas_notions.rst similarity index 100% rename from Doc/eficas_notions.rst rename to Doc/Users/eficas_notions.rst diff --git a/Doc/eficas_presentation.rst b/Doc/Users/eficas_presentation.rst similarity index 100% rename from Doc/eficas_presentation.rst rename to Doc/Users/eficas_presentation.rst diff --git a/Doc/eficas_rules.rst b/Doc/Users/eficas_rules.rst similarity index 100% rename from Doc/eficas_rules.rst rename to Doc/Users/eficas_rules.rst diff --git a/Doc/images/ArbreSalome.png b/Doc/Users/images/ArbreSalome.png similarity index 100% rename from Doc/images/ArbreSalome.png rename to Doc/Users/images/ArbreSalome.png diff --git a/Doc/images/ChoixCata.png b/Doc/Users/images/ChoixCata.png similarity index 100% rename from Doc/images/ChoixCata.png rename to Doc/Users/images/ChoixCata.png diff --git a/Doc/images/ChoixCode.png b/Doc/Users/images/ChoixCode.png similarity index 100% rename from Doc/images/ChoixCode.png rename to Doc/Users/images/ChoixCode.png diff --git a/Doc/images/ChoixCommande.png b/Doc/Users/images/ChoixCommande.png similarity index 100% rename from Doc/images/ChoixCommande.png rename to Doc/Users/images/ChoixCommande.png diff --git a/Doc/images/CommandeBouton.png b/Doc/Users/images/CommandeBouton.png similarity index 100% rename from Doc/images/CommandeBouton.png rename to Doc/Users/images/CommandeBouton.png diff --git a/Doc/images/Commentaire.png b/Doc/Users/images/Commentaire.png similarity index 100% rename from Doc/images/Commentaire.png rename to Doc/Users/images/Commentaire.png diff --git a/Doc/images/DataMenu.png b/Doc/Users/images/DataMenu.png similarity index 100% rename from Doc/images/DataMenu.png rename to Doc/Users/images/DataMenu.png diff --git a/Doc/images/DblClickOnOptional.png b/Doc/Users/images/DblClickOnOptional.png similarity index 100% rename from Doc/images/DblClickOnOptional.png rename to Doc/Users/images/DblClickOnOptional.png diff --git a/Doc/images/Documentation1.png b/Doc/Users/images/Documentation1.png similarity index 100% rename from Doc/images/Documentation1.png rename to Doc/Users/images/Documentation1.png diff --git a/Doc/images/DoubleFleche.png b/Doc/Users/images/DoubleFleche.png similarity index 100% rename from Doc/images/DoubleFleche.png rename to Doc/Users/images/DoubleFleche.png diff --git a/Doc/images/Duplication.png b/Doc/Users/images/Duplication.png similarity index 100% rename from Doc/images/Duplication.png rename to Doc/Users/images/Duplication.png diff --git a/Doc/images/Erreur.png b/Doc/Users/images/Erreur.png similarity index 100% rename from Doc/images/Erreur.png rename to Doc/Users/images/Erreur.png diff --git a/Doc/images/FichiersEtRepertoires.png b/Doc/Users/images/FichiersEtRepertoires.png similarity index 100% rename from Doc/images/FichiersEtRepertoires.png rename to Doc/Users/images/FichiersEtRepertoires.png diff --git a/Doc/images/FiltreCommande.png b/Doc/Users/images/FiltreCommande.png similarity index 100% rename from Doc/images/FiltreCommande.png rename to Doc/Users/images/FiltreCommande.png diff --git a/Doc/images/FindConcept.png b/Doc/Users/images/FindConcept.png similarity index 100% rename from Doc/images/FindConcept.png rename to Doc/Users/images/FindConcept.png diff --git a/Doc/images/GererFichiers.png b/Doc/Users/images/GererFichiers.png similarity index 100% rename from Doc/images/GererFichiers.png rename to Doc/Users/images/GererFichiers.png diff --git a/Doc/images/GererMCS.png b/Doc/Users/images/GererMCS.png similarity index 100% rename from Doc/images/GererMCS.png rename to Doc/Users/images/GererMCS.png diff --git a/Doc/images/Groupes.png b/Doc/Users/images/Groupes.png similarity index 100% rename from Doc/images/Groupes.png rename to Doc/Users/images/Groupes.png diff --git a/Doc/images/Icons.png b/Doc/Users/images/Icons.png similarity index 100% rename from Doc/images/Icons.png rename to Doc/Users/images/Icons.png diff --git a/Doc/images/Import.png b/Doc/Users/images/Import.png similarity index 100% rename from Doc/images/Import.png rename to Doc/Users/images/Import.png diff --git a/Doc/images/LctDsSalome.png b/Doc/Users/images/LctDsSalome.png similarity index 100% rename from Doc/images/LctDsSalome.png rename to Doc/Users/images/LctDsSalome.png diff --git a/Doc/images/ListeEtTuple.png b/Doc/Users/images/ListeEtTuple.png similarity index 100% rename from Doc/images/ListeEtTuple.png rename to Doc/Users/images/ListeEtTuple.png diff --git a/Doc/images/Main.png b/Doc/Users/images/Main.png similarity index 100% rename from Doc/images/Main.png rename to Doc/Users/images/Main.png diff --git a/Doc/images/Matrice.png b/Doc/Users/images/Matrice.png similarity index 100% rename from Doc/images/Matrice.png rename to Doc/Users/images/Matrice.png diff --git a/Doc/images/Menus.png b/Doc/Users/images/Menus.png similarity index 100% rename from Doc/images/Menus.png rename to Doc/Users/images/Menus.png diff --git a/Doc/images/Multi.png b/Doc/Users/images/Multi.png similarity index 100% rename from Doc/images/Multi.png rename to Doc/Users/images/Multi.png diff --git a/Doc/images/NomPython.png b/Doc/Users/images/NomPython.png similarity index 100% rename from Doc/images/NomPython.png rename to Doc/Users/images/NomPython.png diff --git a/Doc/images/NommerObjet.png b/Doc/Users/images/NommerObjet.png similarity index 100% rename from Doc/images/NommerObjet.png rename to Doc/Users/images/NommerObjet.png diff --git a/Doc/images/Nouveau.png b/Doc/Users/images/Nouveau.png similarity index 100% rename from Doc/images/Nouveau.png rename to Doc/Users/images/Nouveau.png diff --git a/Doc/images/OptionnelCommande.png b/Doc/Users/images/OptionnelCommande.png similarity index 100% rename from Doc/images/OptionnelCommande.png rename to Doc/Users/images/OptionnelCommande.png diff --git a/Doc/images/OptionnelCommande1.png b/Doc/Users/images/OptionnelCommande1.png similarity index 100% rename from Doc/images/OptionnelCommande1.png rename to Doc/Users/images/OptionnelCommande1.png diff --git a/Doc/images/OptionnelParametersAdao.png b/Doc/Users/images/OptionnelParametersAdao.png similarity index 100% rename from Doc/images/OptionnelParametersAdao.png rename to Doc/Users/images/OptionnelParametersAdao.png diff --git a/Doc/images/OptionnelParametersAdao1.png b/Doc/Users/images/OptionnelParametersAdao1.png similarity index 100% rename from Doc/images/OptionnelParametersAdao1.png rename to Doc/Users/images/OptionnelParametersAdao1.png diff --git a/Doc/images/Ordre.png b/Doc/Users/images/Ordre.png similarity index 100% rename from Doc/images/Ordre.png rename to Doc/Users/images/Ordre.png diff --git a/Doc/images/Ouvrir.png b/Doc/Users/images/Ouvrir.png similarity index 100% rename from Doc/images/Ouvrir.png rename to Doc/Users/images/Ouvrir.png diff --git a/Doc/images/Parametres.png b/Doc/Users/images/Parametres.png similarity index 100% rename from Doc/images/Parametres.png rename to Doc/Users/images/Parametres.png diff --git a/Doc/images/Parametres1.png b/Doc/Users/images/Parametres1.png similarity index 100% rename from Doc/images/Parametres1.png rename to Doc/Users/images/Parametres1.png diff --git a/Doc/images/Parametres2.png b/Doc/Users/images/Parametres2.png similarity index 100% rename from Doc/images/Parametres2.png rename to Doc/Users/images/Parametres2.png diff --git a/Doc/images/Poubelle.png b/Doc/Users/images/Poubelle.png similarity index 100% rename from Doc/images/Poubelle.png rename to Doc/Users/images/Poubelle.png diff --git a/Doc/images/Recents.png b/Doc/Users/images/Recents.png similarity index 100% rename from Doc/images/Recents.png rename to Doc/Users/images/Recents.png diff --git a/Doc/images/Regles.png b/Doc/Users/images/Regles.png similarity index 100% rename from Doc/images/Regles.png rename to Doc/Users/images/Regles.png diff --git a/Doc/images/Roue.png b/Doc/Users/images/Roue.png similarity index 100% rename from Doc/images/Roue.png rename to Doc/Users/images/Roue.png diff --git a/Doc/images/Run.png b/Doc/Users/images/Run.png similarity index 100% rename from Doc/images/Run.png rename to Doc/Users/images/Run.png diff --git a/Doc/images/SalomePylone.png b/Doc/Users/images/SalomePylone.png similarity index 100% rename from Doc/images/SalomePylone.png rename to Doc/Users/images/SalomePylone.png diff --git a/Doc/images/SalomePyloneSE.png b/Doc/Users/images/SalomePyloneSE.png similarity index 100% rename from Doc/images/SalomePyloneSE.png rename to Doc/Users/images/SalomePyloneSE.png diff --git a/Doc/images/Scripts.png b/Doc/Users/images/Scripts.png similarity index 100% rename from Doc/images/Scripts.png rename to Doc/Users/images/Scripts.png diff --git a/Doc/images/SelectAllInList.png b/Doc/Users/images/SelectAllInList.png similarity index 100% rename from Doc/images/SelectAllInList.png rename to Doc/Users/images/SelectAllInList.png diff --git a/Doc/images/ShowAllValues.png b/Doc/Users/images/ShowAllValues.png similarity index 100% rename from Doc/images/ShowAllValues.png rename to Doc/Users/images/ShowAllValues.png diff --git a/Doc/images/TPXO.png b/Doc/Users/images/TPXO.png similarity index 100% rename from Doc/images/TPXO.png rename to Doc/Users/images/TPXO.png diff --git a/Doc/images/ToolTipOnButton.png b/Doc/Users/images/ToolTipOnButton.png similarity index 100% rename from Doc/images/ToolTipOnButton.png rename to Doc/Users/images/ToolTipOnButton.png diff --git a/Doc/images/ToolTipOnLabel.png b/Doc/Users/images/ToolTipOnLabel.png similarity index 100% rename from Doc/images/ToolTipOnLabel.png rename to Doc/Users/images/ToolTipOnLabel.png diff --git a/Doc/images/ToolTipOnLineEdit.png b/Doc/Users/images/ToolTipOnLineEdit.png similarity index 100% rename from Doc/images/ToolTipOnLineEdit.png rename to Doc/Users/images/ToolTipOnLineEdit.png diff --git a/Doc/images/ToolTipOnRed.png b/Doc/Users/images/ToolTipOnRed.png similarity index 100% rename from Doc/images/ToolTipOnRed.png rename to Doc/Users/images/ToolTipOnRed.png diff --git a/Doc/images/Zero.png b/Doc/Users/images/Zero.png similarity index 100% rename from Doc/images/Zero.png rename to Doc/Users/images/Zero.png diff --git a/Doc/index.rst b/Doc/Users/index.rst similarity index 100% rename from Doc/index.rst rename to Doc/Users/index.rst diff --git a/Doc/lancer_eficas.rst b/Doc/Users/lancer_eficas.rst similarity index 100% rename from Doc/lancer_eficas.rst rename to Doc/Users/lancer_eficas.rst diff --git a/Doc/nouveau_JDC.rst b/Doc/Users/nouveau_JDC.rst similarity index 100% rename from Doc/nouveau_JDC.rst rename to Doc/Users/nouveau_JDC.rst diff --git a/Doc/parametrer_une_commande.rst b/Doc/Users/parametrer_une_commande.rst similarity index 100% rename from Doc/parametrer_une_commande.rst rename to Doc/Users/parametrer_une_commande.rst diff --git a/Doc/python_rules.rst b/Doc/Users/python_rules.rst similarity index 100% rename from Doc/python_rules.rst rename to Doc/Users/python_rules.rst diff --git a/Doc/widgetInDetails.rst b/Doc/Users/widgetInDetails.rst similarity index 100% rename from Doc/widgetInDetails.rst rename to Doc/Users/widgetInDetails.rst diff --git a/InterfaceGUI/QT5/configuration.py b/InterfaceGUI/QT5/configuration.py deleted file mode 100644 index ea74f310..00000000 --- a/InterfaceGUI/QT5/configuration.py +++ /dev/null @@ -1,272 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2024 EDF R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# -""" - Ce module sert pour charger les parametres de configuration d'EFICAS -""" -import os, sys, types, re -import traceback -from Extensions.i18n import tr - - -class configBase(object): - # ------------------------------- - def __init__(self, appliEficas, repIni): - # ------------------------------- - - # Classe de base permettant de lire, afficher - # et sauvegarder les fichiers utilisateurs - # On a deux directories : la directory generale (Repertoire d install + Nom du code - # Par exemple : ~/Install_Eficas/EficasV1_14/Openturns_Wrapper - # et la directorie de l utilisateur - # HOME/.Eficas_Openturns - # Le fichier prefs.py va etre lu dans la directory generale - # puis surcharge eventuellement par celui contenu dans ${PREFS_CATA_$CODE} - # par celui de l utilisateur - # le fichier de catalogue va etre lu dans la directory de l utilisateur s il exite - # dans le fichier general sinon - - self.appliEficas = appliEficas - self.code = appliEficas.code - self.salome = appliEficas.salome - if self.salome: - self.name = "editeur_salome.ini" - else: - self.name = "editeur.ini" - self.rep_mat = None - self.repIni = repIni - - if self.code == None: - self.code = "" - self.rep_user = os.path.join( - os.path.expanduser("~"), ".config/Eficas", self.code - ) - # else : - # self.rep_user = os.path.join('C:/','.config/Eficas',self.code) - - self.setValeursParDefaut() - - if self.code != "": - self.lectureFichierIniStandard() - self.lectureFichierIniIntegrateur() - self.lectureFichierIniUtilisateur() - - if self.boutonDsMenuBar: - self.closeAutreCommande = True - self.closeFrameRechercheCommande = True - - # Particularite des schemas MAP - if hasattr(self, "make_ssCode"): - self.make_ssCode(self.ssCode) - - if not os.path.isdir(self.savedir): - self.savedir = os.path.join( - os.path.expanduser("~"), ".config/Eficas", self.code - ) - - def setValeursParDefaut(self): - # ----------------------------- - - # Valeurs par defaut - if not os.path.isdir(self.rep_user): - os.makedirs(self.rep_user) - self.path_doc = os.path.abspath(os.path.join(self.repIni, "..", "Doc")) - self.exec_acrobat = "acroread" - nomDir = "Eficas_" + self.code - self.savedir = os.path.abspath(os.path.join(os.path.expanduser("~"), nomDir)) - # if sys.platform[0:5]=="linux" : - # self.savedir = os.path.abspath(os.path.join(os.environ['HOME'],nomDir)) - # else: - # self.savedir = os.path.abspath('C:/') - self.modeNouvCommande = "initial" - self.affiche = "alpha" - self.closeAutreCommande = False - self.closeFrameRechercheCommande = False - self.closeFrameRechercheCommandeSurPageDesCommandes = False - self.closeEntete = False - self.closeArbre = False - self.demandeLangue = False - self.suiteTelemac = False - self.nombreDeBoutonParLigne = 0 - self.translatorFichier = None - self.dicoImages = {} - self.dicoIcones = {} - self.afficheCommandesPliees = True - self.afficheFirstPlies = False - self.simpleClic = False - self.afficheOptionnelVide = False - self.afficheListesPliees = True - self.boutonDsMenuBar = False - self.ficIcones = None - self.repIcones = None - self.differencieSiDefaut = False - self.typeDeCata = "Python" - self.closeParenthese = False - self.closeOptionnel = False - self.afficheFactOptionnel = False - self.enleverActionStructures = False - self.enleverPoubellePourCommande = False - self.enleverParametres = False - self.enleverSupprimer = False - self.ajoutExecution = False - self.utilParExtensions = [] - self.rendVisiblesLesCaches = False - self.pasDeMCOptionnels = False - - self.dumpXSD = False - self.withXSD = False - self.afficheIhm = True - - # self.afficheUQ=False - self.afficheUQ = True - - # -------------------------------------- - def lectureFichierIniStandard(self): - # -------------------------------------- - - name = "prefs_" + self.appliEficas.code - try: - prefsCode = __import__(name) - except: - self.catalogues = [] - print("pas de fichier de prefs") - return - for k in dir(prefsCode): - if k[0:1] != "__" and k[-1:-2] != "__": - valeur = getattr(prefsCode, k) - setattr(self, k, valeur) - - # -------------------------------------- - def lectureFichierIniIntegrateur(self): - # -------------------------------------- - # Verifie l'existence du fichier "standard" - # appelle la lecture de ce fichier - clef = "PREFS_CATA_" + self.code - try: - repIntegrateur = os.path.abspath(os.environ[clef]) - except: - return - - fic_ini_integrateur = os.path.join(repIntegrateur, self.name) - if not os.path.isfile(fic_ini_integrateur): - return - with open(fic_ini_integrateur) as fd: - txt = fd.read() - d = locals() - try: - exec(txt, d) - except: - try: - from PyQt5.QtWidgets import QMessageBox - - QMessageBox.critical( - None, - tr("Import du fichier de Configuration"), - tr( - "Erreur a la lecture du fichier de configuration %s ", - str(fic_ini_integrateur), - ), - ) - except: - print( - "Erreur a la lecture du fichier de configuration %s ", - str(fic_ini_integrateur), - ) - return - self.labels_eficas.append("rep_aide") - for k in self.labels_eficas: - try: - setattr(self, k, d[k]) - except: - pass - # Glut pour les repertoires materiaux - # et pour la doc - for k in d: - if (k[0:8] == "rep_mat_") or (k[0:8] == "rep_doc_"): - setattr(self, k, d[k]) - - # -------------------------------------- - def lectureFichierIniUtilisateur(self): - # -------------------------------------- - # Surcharge les parametres standards par les parametres utilisateur s'ils existent - self.fic_ini_utilisateur = os.path.join(self.rep_user, self.name) - if not os.path.isfile(self.fic_ini_utilisateur): - return - with open(fic_ini_utilisateur) as fd: - txt = fd.read() - d = locals() - try: - exec(txt, d) - except: - l = traceback.format_exception( - sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2] - ) - try: - from PyQt5.QtWidgets import QMessageBox - - QMessageBox.critical( - None, - tr("Import du fichier de Configuration"), - tr( - "Erreur a la lecture du fichier de configuration %s ", - str(fic_ini_integrateur), - ), - ) - except: - print( - "Erreur a la lecture du fichier de configuration %s ", - str(fic_ini_integrateur), - ) - for k in self.labels_user: - try: - setattr(self, k, d[k]) - except: - pass - for k in d: - if (k[0:8] == "rep_mat_") or (k[0:8] == "rep_doc_"): - setattr(self, k, d[k]) - - # -------------------------------------- - def saveParams(self): - # -------------------------------------- - # sauvegarde - # les nouveaux parametres dans le fichier de configuration utilisateur - # - texte = "" - for clef in self.labels_user: - if hasattr(self, clef): - valeur = getattr(self, clef) - texte = texte + clef + " = " + repr(valeur) + "\n" - # Glut pour les repertoires materiaux - # et pour la doc - for k in dir(self): - if (k[0:8] == "rep_mat_") or (k[0:8] == "rep_doc_"): - valeur = getattr(self, k) - texte = texte + k + " = " + repr(valeur) + "\n" - - f = open(self.fic_ini_utilisateur, "w+") - f.write(texte) - f.close() - - -# - - -def makeConfig(appliEficas, rep): - return configBase(appliEficas, rep) diff --git a/InterfaceGUI/QT5/editor.py b/InterfaceGUI/QT5/editor.py index 8efd3ea8..9216d6ae 100755 --- a/InterfaceGUI/QT5/editor.py +++ b/InterfaceGUI/QT5/editor.py @@ -181,7 +181,7 @@ class JDCEditor(JDCEditorSsIhm, Ui_baseWidget, QWidget): # --------------------------------------------- # -----------------------------------------------------------------------# - def _viewText(self, txt, caption="FILE_VIEWER", largeur=1200, hauteur=600): + def _viewText(self, txt, caption="File_viewer", largeur=1200, hauteur=600): # --------------------------------------------------------------------# w = ViewText(self.QWParent, self, caption, txt, largeur, hauteur) w.show() @@ -611,7 +611,7 @@ class JDCEditor(JDCEditorSsIhm, Ui_baseWidget, QWidget): fichier = QFileDialog.getOpenFileName( self.appliEficas, tr("Ouvrir Fichier"), - self.appliEficas.maConfiguration.savedir, + self.appliEficas.maConfiguration.saveDir, tr("Wrapper Files (*.xml);;" "All Files (*)"), ) return fichier @@ -777,11 +777,8 @@ class JDCEditor(JDCEditorSsIhm, Ui_baseWidget, QWidget): extensions = extensions + ";; Run (*.input);;" fn = QFileDialog.getSaveFileName( - self, - tr("sauvegarde"), - path, - extensions, - None, + self, tr("sauvegarde"), + path, extensions, None, QFileDialog.DontConfirmOverwrite, ) if fn == None: @@ -825,10 +822,7 @@ class JDCEditor(JDCEditorSsIhm, Ui_baseWidget, QWidget): tr("Choix du composant obligatoire"), ) return - if hasattr(self.maConfiguration, "savedir"): - path = self.maConfiguration.savedir - else: - path = "C:/" + path = self.maConfiguration.saveDir monNomFichier = "" if self.fichier is not None and self.fichier != "": @@ -916,7 +910,7 @@ class JDCEditor(JDCEditorSsIhm, Ui_baseWidget, QWidget): ]() if self.fichierComplet is None or saveas: if path is None: - path = self.maConfiguration.savedir + path = self.maConfiguration.saveDir bOK, fn = self.determineNomFichier(path, extension) if bOK == 0: return (0, None) @@ -926,7 +920,7 @@ class JDCEditor(JDCEditorSsIhm, Ui_baseWidget, QWidget): return (0, None) ulfile = os.path.abspath(fn) - self.appliEficas.maConfiguration.savedir = os.path.split(ulfile)[0] + self.appliEficas.maConfiguration.saveDir = os.path.split(ulfile)[0] fn = QDir.toNativeSeparators(fn) self.fichierComplet = os.path.splitext(fn)[0] + extension @@ -973,7 +967,7 @@ class JDCEditor(JDCEditorSsIhm, Ui_baseWidget, QWidget): fn = self.fichier if self.fichier is None or saveas: if path is None: - path = self.maConfiguration.savedir + path = self.maConfiguration.saveDir bOK, fn = self.determineNomFichier(path, extension) if bOK == 0: return (0, None) @@ -983,7 +977,7 @@ class JDCEditor(JDCEditorSsIhm, Ui_baseWidget, QWidget): return (0, None) ulfile = os.path.abspath(fn) - self.appliEficas.maConfiguration.savedir = os.path.split(ulfile)[0] + self.appliEficas.maConfiguration.saveDir = os.path.split(ulfile)[0] fn = QDir.toNativeSeparators(fn) newName = fn @@ -1050,7 +1044,7 @@ class JDCEditor(JDCEditorSsIhm, Ui_baseWidget, QWidget): return if self.fichier is None: if path is None: - path = self.maConfiguration.savedir + path = self.maConfiguration.saveDir bOK, fn = self.determineNomFichier(path, "comm") if bOK == 0: return (0, None) @@ -1059,7 +1053,7 @@ class JDCEditor(JDCEditorSsIhm, Ui_baseWidget, QWidget): if fn == "": return (0, None) ulfile = os.path.abspath(fn) - self.appliEficas.maConfiguration.savedir = os.path.split(ulfile)[0] + self.appliEficas.maConfiguration.saveDir = os.path.split(ulfile)[0] fn = QDir.toNativeSeparators(fn) self.fichier = fn else: @@ -1076,7 +1070,7 @@ class JDCEditor(JDCEditorSsIhm, Ui_baseWidget, QWidget): # ------------------------------------------------# if self.fichier is None: if path is None: - path = self.maConfiguration.savedir + path = self.maConfiguration.saveDir bOK, fn = self.determineNomFichier(path, "comm") if bOK == 0: return (0, None) @@ -1085,7 +1079,7 @@ class JDCEditor(JDCEditorSsIhm, Ui_baseWidget, QWidget): if fn == "": return (0, None) ulfile = os.path.abspath(fn) - self.appliEficas.maConfiguration.savedir = os.path.split(ulfile)[0] + self.appliEficas.maConfiguration.saveDir = os.path.split(ulfile)[0] print(fn) fn = QDir.toNativeSeparators(fn) self.fichier = fn @@ -1207,7 +1201,7 @@ class JDCEditor(JDCEditorSsIhm, Ui_baseWidget, QWidget): QMessageBox.information(self, titre, texte) fn = QFileDialog.getOpenFileName( - self.appliEficas, titre, self.appliEficas.maConfiguration.savedir + self.appliEficas, titre, self.appliEficas.maConfiguration.saveDir ) # ce retour est impose par le getFile d'I_JDC @@ -1218,7 +1212,7 @@ class JDCEditor(JDCEditorSsIhm, Ui_baseWidget, QWidget): fn = fn[0] ulfile = os.path.abspath(fn) - self.appliEficas.maConfiguration.savedir = os.path.split(ulfile)[0] + self.appliEficas.maConfiguration.saveDir = os.path.split(ulfile)[0] # On utilise le convertisseur defini par formatFichierIn source = self.getSource(ulfile) @@ -1402,121 +1396,6 @@ class JDCEditor(JDCEditorSsIhm, Ui_baseWidget, QWidget): pass return indexNoeud - # -------------------# Pour execution avec output et error dans le bash - def runPSEN(self): - # -------------------# - - # if self.modified or self.fichier==None : self.saveFile() - self.saveFile() - - # lancement avec le .bat - path1 = os.path.abspath( - os.path.join(os.path.abspath(__file__), "../", "../", "PSEN_Eficas", "PSEN") - ) - WrapperFilePath = os.path.join(path1, "PSSEWrapper.py") - import subprocess - - p = subprocess.Popen(["python", WrapperFilePath]) - (out, err) = p.communicate() - print(out) - print(err) - - # -------------------# Pour execution avec output et error dans le bash - def runPSEN_N1(self): - # -------------------# - - self.saveFile() - path1 = os.path.abspath( - os.path.join( - os.path.abspath(__file__), - "../", - "../", - "ProcessOutputs_Eficas", - "TreatOutputs", - ) - ) - sys.path.append(path1) - - if not (self.jdc.isValid()): - QMessageBox.information( - self, tr("Unvalid JDC"), tr("incorrect keywords will be ignored") - ) - if "dicoImbrique" in generator.plugins: - self.generator = generator.plugins["dicoImbrique"]() - jdc_formate = self.generator.gener(self.jdc) - dico = self.generator.Dico - - ###to delete - # fileDico = r'C:\Logiciels DER\PSEN_V16\Code\ProcessOutputs_Eficas\TreatOutputs\dicoN1.py' - fileDico = os.path.join( - path1, "dicoN1.py" - ) # r'C:\Logiciels DER\PSEN_V16\Code\ProcessOutputs_Eficas\TreatOutputs\dicoN1.py' - f = open(str(fileDico), "w") - f.write("Dico =" + str(dico)) - f.close() - ### - - print("in runPSEN_N1", dico) - print(dico) - from InterfaceGUI.QT5.un import run - - run(dico) - # res,txt_exception=run(dico) - # if res : QMessageBox.information( self, tr("fin de script run"), txt_exception) - # else : QMessageBox.critical( self, tr("Erreur fatale script run"), txt_exception) - - # -------------------# Pour execution avec output et error dans le bash - def process_N1(self): - # -------------------# - - path1 = os.path.abspath( - os.path.join( - os.path.abspath(__file__), - "../", - "../", - "ProcessOutputs_Eficas", - "TreatOutputs", - ) - ) - sys.path.append(path1) - - if "dicoImbrique" in generator.plugins: - self.generator = generator.plugins["dicoImbrique"]() - jdc_formate = self.generator.gener(self.jdc) - dico = self.getDico() # generator.Dico - - for k in dico["CONTINGENCY_PROCESSING"]: - # print (k) - if ( - k[0:19] == "Component_List_For_" - or k[0:21] == "Contingency_List_For_" - ): - newK = k.replace("__", " ") - l = "'" + str(newK) + "'" - dico["CONTINGENCY_PROCESSING"][l] = dico["CONTINGENCY_PROCESSING"][ - k - ] - del dico["CONTINGENCY_PROCESSING"][k] - - ###to delete - fileDico = os.path.join(path1, "dicoN1_process.py") - f = open(str(fileDico), "w") - f.write("Dico =" + str(dico)) - f.close() - ### - return dico - - # return self.getDico() - - # -------------------# Pour execution avec output et error dans le bash - def process_VP(self): - # -------------------# - if "dicoImbrique" in generator.plugins: - self.generator = generator.plugins["dicoImbrique"]() - jdc_formate = self.generator.gener(self.jdc) - dico = self.getDico() # generator.Dico - return dico - if __name__ == "__main__": print("in main") diff --git a/InterfaceGUI/QT5/gereIcones.py b/InterfaceGUI/QT5/gereIcones.py index 42375369..66cea326 100644 --- a/InterfaceGUI/QT5/gereIcones.py +++ b/InterfaceGUI/QT5/gereIcones.py @@ -313,7 +313,7 @@ class ContientIcones(object): fichier = QFileDialog.getSaveFileName( self.appliEficas, tr("Use File"), - self.appliEficas.maConfiguration.savedir, + self.appliEficas.maConfiguration.saveDir, filters, ) else: @@ -321,14 +321,14 @@ class ContientIcones(object): fichier = QFileDialog.getOpenFileName( self.appliEficas, tr("Ouvrir Fichier"), - self.appliEficas.maConfiguration.savedir, + self.appliEficas.maConfiguration.saveDir, filters, ) fichier = fichier[0] if not (fichier == ""): ulfile = os.path.abspath(fichier) - self.appliEficas.maConfiguration.savedir = os.path.split(ulfile)[0] + self.appliEficas.maConfiguration.saveDir = os.path.split(ulfile)[0] self.lineEditVal.setText(fichier) self.editor.afficheCommentaire(tr("Fichier selectionne")) self.LEvaleurPressed() @@ -394,13 +394,13 @@ class ContientIcones(object): def BRepertoirePressed(self): directory = QFileDialog.getExistingDirectory( self.appliEficas, - directory=self.appliEficas.maConfiguration.savedir, + directory=self.appliEficas.maConfiguration.saveDir, options=QFileDialog.ShowDirsOnly, ) if not (directory == ""): absdir = os.path.abspath(directory) - self.appliEficas.maConfiguration.savedir = os.path.dirname(absdir) + self.appliEficas.maConfiguration.saveDir = os.path.dirname(absdir) self.lineEditVal.setText(directory) self.LEvaleurPressed() diff --git a/InterfaceGUI/QT5/gereListe.py b/InterfaceGUI/QT5/gereListe.py index 079e50cb..3a8e836f 100644 --- a/InterfaceGUI/QT5/gereListe.py +++ b/InterfaceGUI/QT5/gereListe.py @@ -309,7 +309,7 @@ class GereListe(object): f.show() def selectInFile(self): - init = str(self.editor.maConfiguration.savedir) + init = str(self.editor.maConfiguration.saveDir) fn = QFileDialog.getOpenFileName( self.node.appliEficas, tr("Fichier de donnees"), @@ -324,7 +324,7 @@ class GereListe(object): if fn == "": return ulfile = os.path.abspath(fn) - self.editor.maConfiguration.savedir = os.path.split(ulfile)[0] + self.editor.maConfiguration.saveDir = os.path.split(ulfile)[0] from InterfaceGUI.QT5.monSelectVal import MonSelectVal diff --git a/InterfaceGUI/QT5/gereListeAvril11.py b/InterfaceGUI/QT5/gereListeAvril11.py deleted file mode 100644 index 6a3321d4..00000000 --- a/InterfaceGUI/QT5/gereListeAvril11.py +++ /dev/null @@ -1,363 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2024 EDF R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# -# Modules Python - -import types, os -import traceback - -from PyQt5.QtWidgets import QLineEdit, QLabel, QFileDialog, QWidget -from PyQt5.QtCore import QEvent, Qt, QTimer -from PyQt5.QtGui import QIcon, QPalette - -from Extensions.i18n import tr -from InterfaceGUI.QT5.monViewTexte import ViewText - - -# ---------------------- # -class LECustom(QLineEdit): - # ---------------------- # - def __init__(self, parent, parentQt, i): - """ - Constructor - """ - QLineEdit.__init__(self, parent) - - self.valeur = None - self.aEuLeFocus = False - self.parentQt = parentQt - self.parent = parent - self.num = i - self.dansUnTuple = False - self.numDsLaListe = -1 - self.returnPressed.connect(self.litValeur) - - def focusInEvent(self, event): - # print ("dans focusInEvent de LECustom",self.parentQt) - print("dans focusInEvent de LECustom", self.num, self.numDsLaListe) - self.parentQt.aEuLeFocus = True - self.aEuLeFocus = True - self.parentQt.LineEditEnCours = self - self.parentQt.numLineEditEnCours = self.num - self.parentQt.textSelected = self.text() - self.setStyleSheet("border: 2px solid gray") - QLineEdit.focusInEvent(self, event) - - def focusOutEvent(self, event): - # print ("dans focusOutEvent de LECustom",self.num,self.numDsLaListe, self.aEuLeFocus) - self.setStyleSheet("border: 0px") - if self.dansUnTuple: - self.setStyleSheet("background:rgb(235,235,235); border: 0px;") - elif self.num % 2 == 1: - self.setStyleSheet("background:rgb(210,210,210)") - else: - self.setStyleSheet("background:rgb(235,235,235)") - - if self.aEuLeFocus: - self.aEuLeFocus = False - self.litValeur() - QLineEdit.focusOutEvent(self, event) - - def litValeur(self): - self.aEuLeFocus = False - val = str(self.text()) - if str(val) == "" or val == None: - self.valeur = None - return - try: - valeur = eval(val, {}) - except: - try: - d = self.parentQt.parentQt.objSimp.jdc.getContexteAvant( - self.parentQt.objSimp.etape - ) - valeur = eval(val, d) - except: - valeur = val - - self.valeur = valeur - - def clean(self): - self.setText("") - - def getValeur(self): - return self.text() - - def setValeur(self, valeur): - self.setText(valeur) - self.valeur = valeur - - # def leaveEvent(self,event): - # ne sert a rien. quand on modifie la valeur on prend le focus - - -# --------------------------- # -class LECustomTuple(LECustom): - # --------------------------- # - def __init__(self, parent): - # index sera mis a jour par TupleCustom - parentQt = parent.parent().parent().parent() - LECustom.__init__(self, parent, parentQt, 0) - # print (dir(self)) - - -# ---------------------------- # -class MonLabelListeClic(QLabel): - # ---------------------------- # - def __init__(self, parent): - QLabel.__init__(self, parent) - self.parent = parent - - def event(self, event): - if event.type() == QEvent.MouseButtonRelease: - self.texte = self.text() - self.parent.traiteClicSurLabelListe(self.texte) - return QLabel.event(self, event) - - -# ------------- # -class GereListe(object): - # ------------- # - - def __init__(self): - self.aEuLeFocus = False - self.connecterSignaux() - - def leaveEvent(self, event): - if self.aEuLeFocus: - print("appel de changeValeur") - self.changeValeur() - self.aEuLeFocus = False - QWidget.leaveEvent(self, event) - - def connecterSignaux(self): - if hasattr(self, "RBHaut"): - self.RBHaut.clicked.connect(self.hautPushed) - self.RBBas.clicked.connect(self.basPushed) - self.RBMoins.clicked.connect(self.moinsPushed) - self.RBPlus.clicked.connect(self.plusPushed) - self.RBVoisListe.clicked.connect(self.voisListePushed) - if hasattr(self, "PBAlpha"): - self.PBCata.clicked.connect(self.cataPushed) - self.PBAlpha.clicked.connect(self.alphaPushed) - self.PBFind.clicked.connect(self.findPushed) - self.LEFiltre.returnPressed.connect(self.LEFiltreReturnPressed) - - def filtreListe(self): - l = [] - if self.filtre != "": - for i in self.listeAAfficher: - if i.find(self.filtre) == 0: - l.append(i) - self.listeAAfficher = l - if self.alpha: - self.listeAAfficher.sort() - - def LEFiltreReturnPressed(self): - self.filtre = self.LEFiltre.text() - self.prepareListeResultatFiltre() - - def findPushed(self): - self.filtre = self.LEFiltre.text() - self.prepareListeResultatFiltre() - - def alphaPushed(self): - # print "alphaPushed" ,self.alpha - if self.alpha == 1: - return - self.alpha = 1 - self.prepareListeResultat() - - def cataPushed(self): - if self.alpha == 0: - return - self.alpha = 0 - self.prepareListeResultat() - - def hautPushed(self): - if self.numLineEditEnCours == 1: - return - else: - numEchange = self.numLineEditEnCours - 1 - self.echange(self.numLineEditEnCours, numEchange) - self.LineEditEnCours.setFocus(True) - self.scrollArea.ensureWidgetVisible(self.LineEditEnCours) - - def basPushed(self): - if self.numLineEditEnCours == self.indexDernierLabel: - return - else: - numEchange = self.numLineEditEnCours + 1 - self.echange(self.numLineEditEnCours, numEchange) - self.LineEditEnCours.setFocus(True) - self.scrollArea.ensureWidgetVisible(self.LineEditEnCours) - - def echange(self, num1, num2): - # on donne le focus au a celui ou on a bouge - # par convention le 2 - nomLineEdit = self.nomLine + str(num1) - # print nomLineEdit - courant = getattr(self, nomLineEdit) - valeurAGarder = courant.text() - nomLineEdit2 = self.nomLine + str(num2) - # print nomLineEdit2 - courant2 = getattr(self, nomLineEdit2) - courant.setText(courant2.text()) - courant2.setText(valeurAGarder) - self.changeValeur(changeDePlace=False) - self.numLineEditEnCours = num2 - self.LineEditEnCours = courant2 - self.LineEditEnCours.setFocus(True) - - def moinsPushed(self): - # on supprime le dernier - if self.numLineEditEnCours == 0: - return - if self.indexDernierLabel == 0: - return - if self.numLineEditEnCours == self.indexDernierLabel: - nomLineEdit = self.nomLine + str(self.indexDernierLabel) - courant = getattr(self, nomLineEdit) - courant.clean() - else: - for i in range(self.numLineEditEnCours, self.indexDernierLabel): - aRemonter = i + 1 - nomLineEdit = self.nomLine + str(aRemonter) - courant = getattr(self, nomLineEdit) - valeurARemonter = courant.getValeur() - nomLineEdit = self.nomLine + str(i) - courant = getattr(self, nomLineEdit) - if valeurARemonter != None: - courant.setValeur(valeurARemonter) - else: - courant.clean() - nomLineEdit = self.nomLine + str(self.indexDernierLabel) - courant = getattr(self, nomLineEdit) - courant.clean() - self.changeValeur(changeDePlace=False, oblige=True) - self.setValide() - - def plusPushed(self): - if self.indexDernierLabel == self.monSimpDef.max: - if len(self.listeValeursCourantes) < self.monSimpDef.max: - self.chercheLigneVide() - else: - self.editor.afficheInfos( - "nb max de valeurs : " + str(self.monSimpDef.max) + " atteint", - Qt.red, - ) - return - self.ajoutLineEdit() - self.descendLesLignes() - self.chercheLigneVide() - QTimer.singleShot(1, self.rendVisibleLigne) - - def chercheLigneVide(self): - for i in range(self.indexDernierLabel): - nomLineEdit = self.nomLine + str(i + 1) - courant = getattr(self, nomLineEdit) - valeur = courant.getValeur() - if valeur == "": - courant.setFocus(True) - self.estVisible = courant - return - - def descendLesLignes(self): - if self.numLineEditEnCours == self.indexDernierLabel: - return - nomLineEdit = self.nomLine + str(self.numLineEditEnCours + 1) - courant = getattr(self, nomLineEdit) - valeurADescendre = courant.getValeur() - courant.clean() - for i in range(self.numLineEditEnCours + 1, self.indexDernierLabel): - aDescendre = i + 1 - nomLineEdit = self.nomLine + str(aDescendre) - courant = getattr(self, nomLineEdit) - valeurAGarder = courant.getValeur() - courant.setValeur(valeurADescendre) - valeurADescendre = valeurAGarder - self.changeValeur(changeDePlace=False) - if hasattr(self, "LineEditEnCours"): - self.scrollArea.ensureWidgetVisible(self.LineEditEnCours) - - def voisListePushed(self): - texteValeurs = "" - for v in self.node.item.getListeValeurs(): - texteValeurs += str(v) + ", " - entete = "Valeurs pour " + self.nom - f = ViewText(self, self.editor, entete, texteValeurs[0:-2]) - f.show() - - def selectInFile(self): - init = str(self.editor.maConfiguration.savedir) - fn = QFileDialog.getOpenFileName( - self.node.appliEficas, - tr("Fichier de donnees"), - init, - tr( - "Tous les Fichiers (*)", - ), - ) - fn = fn[0] - if fn == None: - return - if fn == "": - return - import six - ulfile = os.path.abspath(six.text_type(fn)) - self.editor.maConfiguration.savedir = os.path.split(ulfile)[0] - - from InterfaceGUI.QT5.monSelectVal import MonSelectVal - - MonSelectVal(file=fn, parent=self).show() - - def noircirResultatFiltre(self): - filtre = str(self.LEFiltre.text()) - for cb in self.listeCbRouge: - palette = QPalette(Qt.red) - palette.setColor(QPalette.WindowText, Qt.black) - cb.setPalette(palette) - t = cb.text() - cb.setText(t) - self.LEFiltre.setText("") - self.listeCbRouge = [] - - -# ----------- # -class GerePlie(object): - # ----------- # - - def gereIconePlier(self): - if not (hasattr(self, "BFermeListe")): - return - self.editor.listeDesListesOuvertes.add(self.node.item) - repIcon = self.node.editor.appliEficas.repIcon - if not (self.editor.afficheListesPliees): - fichier = os.path.join(repIcon, "empty.png") - icon = QIcon(fichier) - self.BFermeListe.setIcon(icon) - return - fichier = os.path.join(repIcon, "minusnode.png") - icon = QIcon(fichier) - self.BFermeListe.setIcon(icon) - self.BFermeListe.clicked.connect(self.selectWidgetPlie) - - def selectWidgetPlie(self): - self.editor.listeDesListesOuvertes.remove(self.node.item) - self.reaffichePourDeplier() diff --git a/InterfaceGUI/QT5/gereTraduction.py b/InterfaceGUI/QT5/gereTraduction.py index 274ee609..51281466 100644 --- a/InterfaceGUI/QT5/gereTraduction.py +++ b/InterfaceGUI/QT5/gereTraduction.py @@ -22,24 +22,23 @@ from PyQt5.QtWidgets import QFileDialog, QApplication from Extensions.i18n import tr -def traduction(directPath, editor, version): +def traduction( editor, version): if version == "V9V10": from Traducteur import traduitV9V10 - suffixe = "v10.comm" + if version == "V10V11": from Traducteur import traduitV10V11 - suffixe = "v11.comm" + if version == "V11V12": from Traducteur import traduitV11V12 - suffixe = "v12.comm" fn = QFileDialog.getOpenFileName( editor.appliEficas, tr("Traduire Fichier"), - directPath, + editor.maConfiguration.repUser, tr("Fichiers JDC (*.comm);;" "Tous les Fichiers (*)"), ) diff --git a/InterfaceGUI/QT5/monChoixCata.py b/InterfaceGUI/QT5/monChoixCata.py index 99800dbb..360290b5 100644 --- a/InterfaceGUI/QT5/monChoixCata.py +++ b/InterfaceGUI/QT5/monChoixCata.py @@ -20,7 +20,7 @@ # Modules Python # Modules Eficas -from InterfaceGUI.QT5.desChoixCata import Ui_DChoixCata +from UiQT5.desChoixCata import Ui_DChoixCata from PyQt5.QtWidgets import QDialog from Extensions.i18n import tr diff --git a/InterfaceGUI/QT5/monChoixCode.py b/InterfaceGUI/QT5/monChoixCode.py index 7a8f3db8..21253779 100644 --- a/InterfaceGUI/QT5/monChoixCode.py +++ b/InterfaceGUI/QT5/monChoixCode.py @@ -22,7 +22,7 @@ import os, sys, re -from InterfaceGUI.QT5.desChoixCode import Ui_ChoixCode +from UiQT5.desChoixCode import Ui_ChoixCode from PyQt5.QtWidgets import QDialog, QRadioButton, QGroupBox, QButtonGroup from PyQt5.QtGui import QPalette from PyQt5.QtCore import QProcess, QFileInfo, Qt, QSize diff --git a/InterfaceGUI/QT5/monChoixLangue.py b/InterfaceGUI/QT5/monChoixLangue.py index 29981ba9..9857e35c 100644 --- a/InterfaceGUI/QT5/monChoixLangue.py +++ b/InterfaceGUI/QT5/monChoixLangue.py @@ -22,7 +22,7 @@ import os, sys, re -from InterfaceGUI.QT5.desChoixLangue import Ui_ChoixLangue +from UiQT5.desChoixLangue import Ui_ChoixLangue from PyQt5.QtWidgets import QDialog, QRadioButton, QGroupBox, QButtonGroup from PyQt5.QtGui import QPalette diff --git a/InterfaceGUI/QT5/monGroupeOptionnel.py b/InterfaceGUI/QT5/monGroupeOptionnel.py index 4f60f3e0..4b69fc7e 100644 --- a/InterfaceGUI/QT5/monGroupeOptionnel.py +++ b/InterfaceGUI/QT5/monGroupeOptionnel.py @@ -25,8 +25,8 @@ from PyQt5.QtCore import Qt, QRect from PyQt5.QtGui import QPalette from Extensions.i18n import tr -from InterfaceGUI.QT5.desGroupeOptionnel import Ui_groupeOptionnel -from InterfaceGUI.QT5.desPBOptionnelMT import Ui_customPB +from UiQT5.desGroupeOptionnel import Ui_groupeOptionnel +from UiQT5.desPBOptionnelMT import Ui_customPB # Import des panels diff --git a/InterfaceGUI/QT5/monRecherche.py b/InterfaceGUI/QT5/monRecherche.py index 0fc0b0e8..ee47f194 100644 --- a/InterfaceGUI/QT5/monRecherche.py +++ b/InterfaceGUI/QT5/monRecherche.py @@ -20,7 +20,7 @@ # Modules Python # Modules Eficas -from InterfaceGUI.QT5.desRecherche import Ui_desRecherche +from UiQT5.desRecherche import Ui_desRecherche from PyQt5.QtWidgets import QDialog from PyQt5.QtCore import Qt diff --git a/InterfaceGUI/QT5/monRechercheCatalogue.py b/InterfaceGUI/QT5/monRechercheCatalogue.py index 3182b44e..ee9ad340 100644 --- a/InterfaceGUI/QT5/monRechercheCatalogue.py +++ b/InterfaceGUI/QT5/monRechercheCatalogue.py @@ -20,7 +20,7 @@ # Modules Python # Modules Eficas -from InterfaceGUI.QT5.desRechercheCatalogue import Ui_desRechercheCatalogue +from UiQT5.desRechercheCatalogue import Ui_desRechercheCatalogue from PyQt5.QtWidgets import QDialog, QCompleter from PyQt5.QtCore import Qt diff --git a/InterfaceGUI/QT5/monSelectVal.py b/InterfaceGUI/QT5/monSelectVal.py index d3f2ce2a..4c2e41b9 100644 --- a/InterfaceGUI/QT5/monSelectVal.py +++ b/InterfaceGUI/QT5/monSelectVal.py @@ -20,7 +20,7 @@ # Modules Python # Modules Eficas -from InterfaceGUI.QT5.desSelectVal import Ui_DSelVal +from UiQT5.desSelectVal import Ui_DSelVal from Extensions.i18n import tr from PyQt5.QtWidgets import QDialog, QFileDialog, QMessageBox diff --git a/InterfaceGUI/QT5/monViewTexte.py b/InterfaceGUI/QT5/monViewTexte.py index cbb29787..c47b28e2 100644 --- a/InterfaceGUI/QT5/monViewTexte.py +++ b/InterfaceGUI/QT5/monViewTexte.py @@ -58,7 +58,7 @@ class ViewText(Ui_dView, QDialog): def saveFile(self): # recuperation du nom du fichier if self.editor != None: - dir = self.editor.appliEficas.maConfiguration.savedir + dir = self.editor.appliEficas.maConfiguration.saveDir else: dir = "/tmp" fn = QFileDialog.getSaveFileName(None, tr("Sauvegarder le fichier"), dir) @@ -70,7 +70,7 @@ class ViewText(Ui_dView, QDialog): ulfile = os.path.abspath(fn) if self.editor != None: - self.editor.appliEficas.maConfiguration.savedir = os.path.split(ulfile)[0] + self.editor.appliEficas.maConfiguration.saveDir = os.path.split(ulfile)[0] try: f = open(fn, "w") f.write(str(self.view.toPlainText())) diff --git a/InterfaceGUI/QT5/monVisu.py b/InterfaceGUI/QT5/monVisu.py index c5ba0013..bb01df66 100644 --- a/InterfaceGUI/QT5/monVisu.py +++ b/InterfaceGUI/QT5/monVisu.py @@ -21,7 +21,7 @@ # Modules Eficas -from InterfaceGUI.QT5.desVisu import Ui_DVisu +from UiQT5.desVisu import Ui_DVisu from PyQt5.QtWidgets import QDialog diff --git a/InterfaceGUI/QT5/monWidgetBloc.py b/InterfaceGUI/QT5/monWidgetBloc.py index 7f3c786e..8123ffe5 100644 --- a/InterfaceGUI/QT5/monWidgetBloc.py +++ b/InterfaceGUI/QT5/monWidgetBloc.py @@ -20,7 +20,7 @@ # Modules Eficas -from InterfaceGUI.QT5.desWidgetBloc import Ui_WidgetBloc +from UiQT5.desWidgetBloc import Ui_WidgetBloc from InterfaceGUI.QT5.groupe import Groupe from Extensions.i18n import tr diff --git a/InterfaceGUI/QT5/monWidgetMatrice.py b/InterfaceGUI/QT5/monWidgetMatrice.py index 93dd4a70..67a215cb 100644 --- a/InterfaceGUI/QT5/monWidgetMatrice.py +++ b/InterfaceGUI/QT5/monWidgetMatrice.py @@ -22,7 +22,7 @@ import types, os, sys # Modules Eficas from Extensions.i18n import tr -from InterfaceGUI.QT5..feuille import Feuille +from InterfaceGUI.QT5.feuille import Feuille from Extensions.eficas_exception import EficasException diff --git a/InterfaceGUI/QT5/monWidgetOptionnel.py b/InterfaceGUI/QT5/monWidgetOptionnel.py index ae3c5e84..182e26d9 100644 --- a/InterfaceGUI/QT5/monWidgetOptionnel.py +++ b/InterfaceGUI/QT5/monWidgetOptionnel.py @@ -23,7 +23,7 @@ from PyQt5.QtCore import Qt from Extensions.i18n import tr from UiQT5.desWidgetOptionnel import Ui_WidgetOptionnel -from InterfaceQT5.QT5.monGroupeOptionnel import MonGroupeOptionnel +from InterfaceGUI.QT5.monGroupeOptionnel import MonGroupeOptionnel # Import des panels diff --git a/InterfaceGUI/QT5/monWidgetPlusieursASSDIntoOrdonne.py b/InterfaceGUI/QT5/monWidgetPlusieursASSDIntoOrdonne.py index acbbb5ef..21a2d625 100644 --- a/InterfaceGUI/QT5/monWidgetPlusieursASSDIntoOrdonne.py +++ b/InterfaceGUI/QT5/monWidgetPlusieursASSDIntoOrdonne.py @@ -20,7 +20,7 @@ # Modules Eficas from Extensions.i18n import tr -from InterfaceGUI.QT5..monWidgetPlusieursIntoOrdonne import MonWidgetPlusieursIntoOrdonne +from InterfaceGUI.QT5.monWidgetPlusieursIntoOrdonne import MonWidgetPlusieursIntoOrdonne from InterfaceGUI.QT5.politiquesValidation import PolitiquePlusieurs from PyQt5.QtWidgets import QScrollBar diff --git a/InterfaceGUI/QT5/monWidgetPlusieursTuple.py b/InterfaceGUI/QT5/monWidgetPlusieursTuple.py index e9d36e40..f51f4780 100644 --- a/InterfaceGUI/QT5/monWidgetPlusieursTuple.py +++ b/InterfaceGUI/QT5/monWidgetPlusieursTuple.py @@ -18,6 +18,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +import os from PyQt5.QtWidgets import QFrame, QApplication, QFrame, QWidget from PyQt5.QtGui import QIcon from PyQt5.QtCore import QSize, Qt, QTimer diff --git a/InterfaceGUI/QT5/monWidgetSimpBase.py b/InterfaceGUI/QT5/monWidgetSimpBase.py index 24c85557..c3196a35 100644 --- a/InterfaceGUI/QT5/monWidgetSimpBase.py +++ b/InterfaceGUI/QT5/monWidgetSimpBase.py @@ -69,7 +69,7 @@ class MonWidgetSimpBase(Ui_WidgetSimpBase, Feuille): chaine = "" if valeurTexte != None: - from InterfaceGUI.QT5.ecimal import Decimal + from decimal import Decimal if isinstance(valeurTexte, Decimal): chaine = str(valeurTexte) diff --git a/InterfaceGUI/QT5/monWidgetSimpBool.py b/InterfaceGUI/QT5/monWidgetSimpBool.py index db827bfc..c642e186 100644 --- a/InterfaceGUI/QT5/monWidgetSimpBool.py +++ b/InterfaceGUI/QT5/monWidgetSimpBool.py @@ -23,7 +23,7 @@ from PyQt5.QtWidgets import QRadioButton from Extensions.i18n import tr from InterfaceGUI.QT5.feuille import Feuille -fromUiQT5.desWidgetSimpBool import Ui_WidgetSimpBool +from UiQT5.desWidgetSimpBool import Ui_WidgetSimpBool from InterfaceGUI.QT5.politiquesValidation import PolitiqueUnique from InterfaceGUI.QT5.qtSaisie import SaisieValeur diff --git a/InterfaceGUI/QT5/qtEficas.py b/InterfaceGUI/QT5/qtEficas.py index 365c9277..4fbb568a 100755 --- a/InterfaceGUI/QT5/qtEficas.py +++ b/InterfaceGUI/QT5/qtEficas.py @@ -52,29 +52,17 @@ class Appli(AppliSsIhm, Ui_Eficas, QMainWindow): print("mauvaise utilisation de la classe Appli. Utiliser AppliSsIm SVP") exit() - AppliSsIhm.__init__( - self, - code, - salome, - parent, - multi=multi, - langue=langue, - ssIhm=True, - labelCode=labelCode, - ) QMainWindow.__init__(self, parent) Ui_Eficas.__init__(self) + AppliSsIhm.__init__( self, code, salome, parent, multi=multi, langue=langue, ssIhm=True, labelCode=labelCode,) self.ssIhm = False self.multi = multi self.demande = multi # voir PSEN self.GUIPath = GUIPath - if self.multi == False: - self.definitCode(code, None) - if self.code == None: - return - else: + + if self.multi : self.definitCode(code, None) if self.code == None: return @@ -175,7 +163,7 @@ class Appli(AppliSsIhm, Ui_Eficas, QMainWindow): if self.code != None: self.construitMenu() - self.setWindowTitle(self.VERSION_EFICAS) + self.setWindowTitle(self.versionEficas) try: # if 1 : # print ('attention try devient if 1') @@ -199,7 +187,6 @@ class Appli(AppliSsIhm, Ui_Eficas, QMainWindow): if self.code == None: self.cleanPath() from InterfaceGUI.QT5.monChoixCode import MonChoixCode - widgetChoix = MonChoixCode(self) ret = widgetChoix.exec_() # widgetChoix.show() @@ -207,13 +194,6 @@ class Appli(AppliSsIhm, Ui_Eficas, QMainWindow): return # pour le cancel de la fenetre choix code AppliSsIhm.definitCode(self, self.code, ssCode) - # PN --> pb d exception qui font planter salome - # plus supporte en python 3 - # app=QApplication - # if hasattr(prefsCode,'encoding'): - # import sys - # reload(sys) - # sys.setdefaultencoding(prefsCode.encoding) def construitMenu(self): self.initPatrons() @@ -269,34 +249,6 @@ class Appli(AppliSsIhm, Ui_Eficas, QMainWindow): self.actionCode.setEnabled(True) self.menuAide.addAction(self.actionCode) - def newN1(self): - ssCode = None - code = "PSEN_N1" - self.cleanPath() - dirCode = os.path.abspath( - os.path.join(os.path.abspath(__file__), "../..", "ProcessOutputs_Eficas") - ) - sys.path.insert(0, dirCode) - self.code = code - self.definitCode(code, ssCode) - self.initRecents() - self.multi = True - self.demande = False - self.fileNew() - - def newPSEN(self): - ssCode = None - code = "PSEN" - self.cleanPath() - dirCode = os.path.abspath( - os.path.join(os.path.abspath(__file__), "../..", code) - ) - sys.path.insert(0, dirCode) - self.code = code - self.definitCode(code, ssCode) - self.multi = True - self.demande = False - self.fileNew() def ajoutUQ(self): AppliSsIhm.ajoutUQ(self) @@ -318,21 +270,6 @@ class Appli(AppliSsIhm, Ui_Eficas, QMainWindow): # self.actionEnregistrer.setDisabled(True) # self.actionEnregistrer_sous.setDisabled(True) - def ajoutN1(self): - return - self.menuN1 = self.menubar.addMenu(tr("Process Output")) - self.actionN1 = QAction(self) - self.actionN1.setText(tr("Process Output")) - self.menuN1.addAction(self.actionN1) - self.actionN1.triggered.connect(self.newN1) - - if hasattr(self, "actionOpenProcess"): - return - - self.actionOpenProcess = QAction(self) - self.actionOpenProcess.setText(tr("Open Process_Output File")) - self.menuN1.addAction(self.actionOpenProcess) - self.actionOpenProcess.triggered.connect(self.openProcess) def ajoutExecution(self): self.menuExecution = self.menubar.addMenu(tr("&Run")) @@ -405,96 +342,11 @@ class Appli(AppliSsIhm, Ui_Eficas, QMainWindow): ) self.actionSortieComplete.triggered.connect(self.handleSortieComplete) - def MT(self): - self.enlevernewInclude() - self.toolBar.addSeparator() - - def ZCRACKS(self): - self.enlevernewInclude() - self.toolBar.addSeparator() - self.ajoutExecution() - - self.menuOptions = self.menubar.addMenu("menuOptions") - self.menuOptions.addAction(self.actionParametres_Eficas) - self.menuOptions.setTitle(tr("Options")) def ADAO(self): self.enleverActionsStructures() self.enlevernewInclude() - def ASTER(self): - self.menuTraduction = self.menubar.addMenu("menuTraduction") - self.menuTraduction.addAction(self.actionTraduitV11V12) - self.menuTraduction.addAction(self.actionTraduitV10V11) - self.menuTraduction.addAction(self.actionTraduitV9V10) - self.menuTraduction.setTitle(tr("Traduction")) - - self.menuFichier.addAction(self.actionSauveLigne) - - self.menuOptions = self.menubar.addMenu("menuOptions") - self.menuOptions.addAction(self.actionParametres_Eficas) - self.menuOptions.addAction(self.actionLecteur_Pdf) - self.menuOptions.setTitle(tr("Options")) - - def CARMEL3D(self): - # if self.salome == 0 : return - self.enlevernewInclude() - self.menuMesh = self.menubar.addMenu(tr("Gestion Maillage")) - self.menuMesh.setObjectName("Mesh") - self.menuMesh.addAction(self.actionChercheGrpMaille) - # self.griserActionsStructures() - - def CARMELCND(self): - self.enlevernewInclude() - self.enleverRechercherDsCatalogue() - self.ajoutExecution() - self.ajoutSauveExecution() - self.griserActionsStructures() - - def MAP(self): - self.enlevernewInclude() - self.toolBar.addSeparator() - self.ajoutExecution() - self.ajoutSauveExecution() - self.menuOptions = self.menubar.addMenu("menuOptions") - self.menuOptions.addAction(self.actionParametres_Eficas) - self.menuOptions.setTitle(tr("Options")) - - def MAPIDENTIFICATION(self): - self.enlevernewInclude() - self.enleverSupprimer() - # self.ajoutExecution() - self.enleverRechercherDsCatalogue() - self.enleverActionsStructures() - self.enleverParametres() - - def PSEN(self): - try: - self.action_Nouveau.triggered.disconnect(self.fileNew) - except: - pass - try: - self.action_Nouveau.triggered.disconnect(self.newPSEN) - except: - pass - - self.action_Nouveau.triggered.connect(self.newPSEN) - self.enleverActionsStructures() - self.enleverParametres() - self.enleverRechercherDsCatalogue() - self.enlevernewInclude() - self.ajoutExecution() - self.ajoutN1() - self.ajoutHelpPSEN() - self.ajoutIcones() - - def PSEN_N1(self): - self.enleverActionsStructures() - self.enleverParametres() - self.enleverRechercherDsCatalogue() - self.enlevernewInclude() - self.ajoutExecution() - self.ajoutIcones() def TELEMAC(self): self.enleverActionsStructures() @@ -509,10 +361,6 @@ class Appli(AppliSsIhm, Ui_Eficas, QMainWindow): self.enleverSupprimer() self.enleverRechercherDsCatalogue() - def ajoutHelpPSEN(self): - self.actionParametres_Eficas.setText("Help PSEN") - self.actionParametres_Eficas.triggered.connect(self.aidePSEN) - def ChercheGrpMesh(self): Msg, listeGroup = self.ChercheGrpMeshInSalome() if Msg == None: @@ -532,13 +380,6 @@ class Appli(AppliSsIhm, Ui_Eficas, QMainWindow): else: print("il faut gerer les erreurs") - def ChercheGrp(self): - # Msg,listeGroup=self.ChercheGrpMailleInSalome() - # if Msg == None : - # self.viewmanager.handleAjoutGroup(listeGroup) - # else : - # print "il faut gerer " - pass def ajoutIcones(self): # Pour pallier les soucis de repertoire d icone @@ -554,86 +395,6 @@ class Appli(AppliSsIhm, Ui_Eficas, QMainWindow): icon7 = QIcon(self.repIcon + "/roue.png") self.actionExecution.setIcon(icon7) - def connecterSignauxQT4(self): - self.connect( - self.recentMenu, SIGNAL("aboutToShow()"), self.handleShowRecentMenu - ) - - self.connect(self.action_Nouveau, SIGNAL("triggered()"), self.fileNew) - self.connect(self.actionNouvel_Include, SIGNAL("triggered()"), self.newInclude) - self.connect(self.actionOuvrir, SIGNAL("triggered()"), self.fileOpen) - self.connect(self.actionEnregistrer, SIGNAL("triggered()"), self.fileSave) - self.connect( - self.actionEnregistrer_sous, SIGNAL("triggered()"), self.fileSaveAs - ) - self.connect(self.actionFermer, SIGNAL("triggered()"), self.fileClose) - self.connect(self.actionFermer_tout, SIGNAL("triggered()"), self.fileCloseAll) - self.connect(self.actionQuitter, SIGNAL("triggered()"), self.fileExit) - - self.connect(self.actionEficas, SIGNAL("triggered()"), self.aidePPal) - self.connect(self.actionVersion, SIGNAL("triggered()"), self.version) - self.connect(self.actionParametres, SIGNAL("triggered()"), self.gestionParam) - - self.connect(self.actionCouper, SIGNAL("triggered()"), self.editCut) - self.connect(self.actionCopier, SIGNAL("triggered()"), self.editCopy) - self.connect(self.actionColler, SIGNAL("triggered()"), self.editPaste) - self.connect(self.actionSupprimer, SIGNAL("triggered()"), self.supprimer) - self.connect(self.actionRechercher, SIGNAL("triggered()"), self.rechercher) - self.connect( - self.actionDeplier_replier, SIGNAL("triggered()"), self.handleDeplier - ) - - self.connect( - self.actionRapport_de_Validation, SIGNAL("triggered()"), self.jdcRapport - ) - self.connect(self.actionRegles_du_JdC, SIGNAL("triggered()"), self.jdcRegles) - self.connect( - self.actionFichier_Source, SIGNAL("triggered()"), self.jdcFichierSource - ) - self.connect(self.actionFichier_Resultat, SIGNAL("triggered()"), self.visuJdcPy) - - # Pour Aster - self.actionTraduitV9V10 = QAction(self) - self.actionTraduitV9V10.setObjectName("actionTraduitV9V10") - self.actionTraduitV9V10.setText(tr("TraduitV9V10")) - self.actionTraduitV10V11 = QAction(self) - self.actionTraduitV10V11.setObjectName("actionTraduitV10V11") - self.actionTraduitV10V11.setText(tr("TraduitV10V11")) - self.actionTraduitV11V12 = QAction(self) - self.actionTraduitV11V12.setObjectName("actionTraduitV11V12") - self.actionTraduitV11V12.setText(tr("TraduitV11V12")) - self.actionSauveLigne = QAction(self) - self.actionSauveLigne.setText(tr("Sauve Format Ligne")) - - # self.connect(self.actionParametres_Eficas,SIGNAL("triggered()"),self.optionEditeur) - self.connect(self.actionLecteur_Pdf, SIGNAL("triggered()"), self.optionPdf) - self.connect( - self.actionTraduitV9V10, SIGNAL("triggered()"), self.traductionV9V10 - ) - self.connect( - self.actionTraduitV10V11, SIGNAL("triggered()"), self.traductionV10V11 - ) - self.connect( - self.actionTraduitV11V12, SIGNAL("triggered()"), self.traductionV11V12 - ) - self.connect(self.actionSauveLigne, SIGNAL("triggered()"), self.sauveLigne) - - # Pour Carmel - self.actionChercheGrpMaille = QAction(self) - self.actionChercheGrpMaille.setText(tr("Acquiert groupe mailles")) - self.connect( - self.actionChercheGrpMaille, SIGNAL("triggered()"), self.ChercheGrpMaille - ) - - # Pour CarmelCND - self.actionChercheGrp = QAction(self) - self.actionChercheGrp.setText(tr("Acquisition Groupe Maille")) - self.connect(self.actionChercheGrp, SIGNAL("triggered()"), self.ChercheGrp) - - # Pour Aide - self.actionCode = QAction(self) - self.actionCode.setText(tr("Specificites Maille")) - self.connect(self.actionCode, SIGNAL("triggered()"), self.aideCode) def connecterSignaux(self): self.recentMenu.aboutToShow.connect(self.handleShowRecentMenu) @@ -688,10 +449,6 @@ class Appli(AppliSsIhm, Ui_Eficas, QMainWindow): self.actionChercheGrpMaille = QAction(self) self.actionChercheGrpMaille.setText(tr("Acquiert Groupe Maille")) - # Pour CarmelCND - self.actionChercheGrp = QAction(self) - self.actionChercheGrp.setText(tr("Accquisition Groupe Maille")) - self.actionChercheGrp.triggered.connect(self.ChercheGrp) # Pour Aide self.actionCode = QAction(self) @@ -802,7 +559,7 @@ class Appli(AppliSsIhm, Ui_Eficas, QMainWindow): def sauveRecents(self): try: - rep = self.maConfiguration.rep_user + rep = self.maConfiguration.repUser monFichier = rep + "/listefichiers_" + self.code except: return @@ -824,19 +581,23 @@ class Appli(AppliSsIhm, Ui_Eficas, QMainWindow): def traductionV11V12(self): from InterfaceGUI.QT5.gereTraduction import traduction - traduction(self.maConfiguration.repIni, self.viewmanager, "V11V12") def traductionV10V11(self): from InterfaceGUI.QT5.gereTraduction import traduction - traduction(self.maConfiguration.repIni, self.viewmanager, "V10V11") def traductionV9V10(self): from InterfaceGUI.QT5.gereTraduction import traduction - traduction(self.maConfiguration.repIni, self.viewmanager, "V9V10") + def afficheMessage(self, titre, texte,critical=True): + if critical : + QMessageBox.critical( None, tr(titre), tr(texte)) + else : + QMessageBox.warning( None, tr(titre), tr(texte)) + + def version(self): from InterfaceGUI.QT5.monVisu import DVisu @@ -844,9 +605,9 @@ class Appli(AppliSsIhm, Ui_Eficas, QMainWindow): monVisuDialg = DVisu(parent=self, fl=0) monVisuDialg.setWindowTitle(titre) if self.code != None: - monVisuDialg.TB.setText(self.VERSION_EFICAS + tr(" pour ") + self.code) + monVisuDialg.TB.setText(self.versionEficas + tr(" pour ") + self.code) else: - monVisuDialg.TB.setText(self.VERSION_EFICAS) + monVisuDialg.TB.setText(self.versionEficas) monVisuDialg.adjustSize() monVisuDialg.show() @@ -975,20 +736,6 @@ class Appli(AppliSsIhm, Ui_Eficas, QMainWindow): if msg != "": QMessageBox.warning(self, tr("Erreur"), msg) - def openProcess(self): - ssCode = None - code = "PSEN_N1" - self.cleanPath() - dirCode = os.path.abspath( - os.path.join(os.path.abspath(__file__), "../..", "ProcessOutputs_Eficas") - ) - sys.path.insert(0, dirCode) - self.code = code - self.definitCode(code, ssCode) - self.multi = True - self.demande = False - self.initRecents() - self.fileOpen() def fileOpen(self): try: @@ -1066,15 +813,7 @@ class Appli(AppliSsIhm, Ui_Eficas, QMainWindow): self.viewmanager.newIncludeEditor() def cleanPath(self): - for pathCode in self.ListePathCode: - try: - aEnlever = os.path.abspath( - os.path.join(os.path.dirname(__file__), "..", pathCode) - ) - sys.path.remove(aEnlever) - except: - pass - for pathCode in self.listeAEnlever: + for pathCode in self.listeAPathEnlever: try: sys.path.remove(aEnlever) except: diff --git a/InterfaceGUI/QT5/ssIhm.py b/InterfaceGUI/QT5/ssIhm.py deleted file mode 100644 index 5f4b0b6a..00000000 --- a/InterfaceGUI/QT5/ssIhm.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2024 EDF R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# -# permet de lancer EFICAS en n affichant rien - - - -class appliEficasSSIhm(object): - def __init__(self, code): - self.VERSION_EFICAS = "Sans Ihm" - self.code = code - self.ssCode = None - self.salome = None - self.top = None - self.indice = 0 - self.dict_reels = {} - self.listeAEnlever = [] - - name = "prefs_" + self.code - try: - prefsCode = __import__(name) - except: - name = "prefs_" + self.code.upper() - self.code = self.code.upper() - prefsCode = __import__(name) - - self.repIni = prefsCode.repIni - self.format_fichier = "python" # par defaut - - nameConf = "configuration_" + self.code - configuration = __import__(nameConf) - self.CONFIGURATION = configuration.make_config(self, prefsCode.repIni) - - -class QWParentSSIhm(object): - def __init__(self, code, version_code): - self.ihm = "QT" - self.code = code - self.version_code = version_code - self.format_fichier = "python" # par defaut diff --git a/InterfaceGUI/QT5/typeNode.py b/InterfaceGUI/QT5/typeNode.py index a5ef21d5..b83d2d6c 100644 --- a/InterfaceGUI/QT5/typeNode.py +++ b/InterfaceGUI/QT5/typeNode.py @@ -209,7 +209,7 @@ class PopUpMenuNodeMinimal(object): tr("Aucune documentation n'est associee a ce noeud"), ) return - commande = self.editor.appliEficas.maConfiguration.exec_acrobat + commande = self.editor.appliEficas.maConfiguration.PedfReader try: f = open(commande, "rb") except: @@ -222,7 +222,7 @@ class PopUpMenuNodeMinimal(object): fichier = cle_doc else: fichier = os.path.abspath( - os.path.join(self.editor.maConfiguration.path_doc, cle_doc) + os.path.join(self.editor.maConfiguration.pathDoc, cle_doc) ) try: f = open(fichier, "rb") diff --git a/InterfaceGUI/QT5/viewManager.py b/InterfaceGUI/QT5/viewManager.py index 00b819a1..acf1969b 100644 --- a/InterfaceGUI/QT5/viewManager.py +++ b/InterfaceGUI/QT5/viewManager.py @@ -75,7 +75,7 @@ class MyViewManager(object): fichier = QFileDialog.getOpenFileName( self.appliEficas, tr("Ouvrir Fichier"), - self.appliEficas.maConfiguration.savedir, + self.appliEficas.maConfiguration.saveDir, extensions, ) fichier = fichier[0] @@ -83,7 +83,7 @@ class MyViewManager(object): return None fichier = os.path.abspath(fichier) ulfile = os.path.abspath(fichier) - self.appliEficas.maConfiguration.savedir = os.path.split(ulfile)[0] + self.appliEficas.maConfiguration.saveDir = os.path.split(ulfile)[0] self.appliEficas.addToRecentList(fichier) maPage = self.getEditor(fichier, units=units) if maPage: @@ -394,14 +394,14 @@ class MyViewManager(object): ) else: from InterfaceGUI.QT5.editor import JDCEditor - editor = JDCEditor( - self.appliEficas, - fichier, - jdc, - self.myQtab, - units=units, - include=include, - ) + editor = JDCEditor( + self.appliEficas, + fichier, + jdc, + self.myQtab, + units=units, + include=include, + ) if double != None: self.doubles[editor] = double if editor.jdc: # le fichier est bien un jdc diff --git a/InterfaceGUI/configuration.py b/InterfaceGUI/configuration.py new file mode 100644 index 00000000..81a24e90 --- /dev/null +++ b/InterfaceGUI/configuration.py @@ -0,0 +1,239 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2024 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +""" + Ce module sert pour charger les parametres de configuration d'EFICAS +""" +import os, sys, types, re +import traceback +from Extensions.i18n import tr + + +class configBase(object): + # ----------------------------- + def __init__(self, appliEficas): + # ----------------------------- + """ + Classe de base permettant de lire les fichiers de preference + 1) de l installation eficas : prefs.py (ou prefs_salome.py) dans + la directory du catalogue + 2) contenu dans la variable d environnement : ${PREFS_CATA_$CODE} + Cela permet d avoir une installation partagée d Eficas avec une possibilité de + moduler les préférences selon les machines + 3)le(s) fichier(s) de preference utilisateurs : + prefs_code.ini ou pref_salome_code.ini + contenu dans la directory $HOME/.config/Eficas/code + + Cette classe peut etre surchargee dans le fichier configuration_code.py + dans la directory qui contient le catalogue + """ + + self.appliEficas = appliEficas + self.code = appliEficas.code + if self.code == None: return + self.salome = appliEficas.salome + + if self.salome: name = "prefs_eficas_salome.ini" + else: name = "prefs_eficas.ini" + if sys.platform == 'linux' : repUser = os.path.join( os.path.expanduser("~")) + else : repUser = os.path.join('C:/','.config/Eficas',self.code) + self.fichierPrefsUtilisateur = os.path.join(repUser, name) + + self.labelsEficas = ('PdfReader', 'saveDir', 'modeNouvCommande', 'afficheUQ', 'closeAutreCommande', 'closeFrameRechercheCommande', + 'closeFrameRechercheCommandeSurPageDesCommandes', 'closeEntete', 'closeArbre', 'demandeLangue', 'suiteTelemac', + 'nombreDeBoutonParLigne', 'translatorFichier', 'dicoImages', 'dicoIcones', 'afficheCommandesPliees', 'afficheFirstPlies', + 'simpleClic', 'afficheOptionnelVide', 'afficheListesPliees', 'boutonDsMenuBar', 'ficIcones', + 'repIcones', 'differencieSiDefaut', 'typeDeCata', 'closeParenthese', 'closeOptionnel', + 'afficheFactOptionnel', 'enleverActionStructures', 'enleverPoubellePourCommande', 'enleverParametres', + 'enleverSupprimer', 'ajoutExecution', 'utilParExtensions', 'rendVisiblesLesCaches', + 'pasDeMCOptionnels', 'dumpXSD', 'withXSD', 'afficheIhm', 'catalogues' ) + + self.labelsUser = ('PdfReader', 'saveDir', ' closeArbre', 'demandeLangue', + 'nombreDeBoutonParLigne', 'translatorFichier', 'afficheCommandesPliees', 'afficheFirstPlies', + 'simpleClic', 'afficheOptionnelVide', 'afficheListesPliees', 'differencieSiDefaut') + + + self.setValeursParDefaut() + + if self.code != "": + self.lectureFichierIniStandard() + self.lectureFichierIniIntegrateur() + self.lectureFichierIniUtilisateur() + + # coherence des parametres -) + if self.boutonDsMenuBar: + self.closeAutreCommande = True + self.closeFrameRechercheCommande = True + + if not os.path.isdir(self.saveDir): + if sys.platform == 'linux' : + self.saveDir = os.path.join( os.path.expanduser("~"), 'Eficas', self.code) + else : + self.saveDir = os.path.join('C:/','Eficas',self.code) + + def setValeursParDefaut(self): + # ---------------------------- + + # Valeurs par defaut + self.pathDoc = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..","Doc")) + self.PedfReader = "acroread" + nomDir = "Eficas_" + self.code + self.saveDir = os.path.abspath(os.path.join(os.path.expanduser("~"), nomDir)) + self.modeNouvCommande = "ini" + self.affiche = "alpha" + self.closeAutreCommande = False + self.closeFrameRechercheCommande = False + self.closeFrameRechercheCommandeSurPageDesCommandes = False + self.closeEntete = False + self.closeArbre = False + self.demandeLangue = False + self.suiteTelemac = False + self.nombreDeBoutonParLigne = 0 + self.translatorFichier = None + self.dicoImages = {} + self.dicoIcones = {} + self.afficheCommandesPliees = True + self.afficheFirstPlies = False + self.simpleClic = False + self.afficheOptionnelVide = False + self.afficheListesPliees = True + self.boutonDsMenuBar = False + self.ficIcones = None + self.repIcones = None + self.differencieSiDefaut = False + self.typeDeCata = "Python" + self.closeParenthese = False + self.closeOptionnel = False + self.afficheFactOptionnel = False + self.enleverActionStructures = False + self.enleverPoubellePourCommande = False + self.enleverParametres = False + self.enleverSupprimer = False + self.ajoutExecution = False + self.utilParExtensions = [] + self.rendVisiblesLesCaches = False + self.pasDeMCOptionnels = False + + self.dumpXSD = False + self.withXSD = False + self.afficheIhm = True + self.afficheUQ = True + + # pour garder ce qui existait pour Aster + self.repMat = None + + # -------------------------------------- + def lectureFichierIniStandard(self): + # -------------------------------------- + + if self.salome : name = "prefs_salome_" + self.appliEficas.code + else : name = "prefs_" + self.appliEficas.code + if self.appliEficas.fichierCata != None : + dirCata=os.path.dirname(self.appliEficas.fichierCata) + sys.path.append(os.path.abspath(dirCata)) + self.appliEficas.listePathAEnlever.append(dirCata) + try: + prefsCode = __import__(name) + except: + self.catalogues = [] + print("pas de fichier de prefs") + return + for k in dir(prefsCode): + if k in self.labelsEficas: + valeur=getattr(prefsCode,k) + setattr(self,k,valeur) + + # -------------------------------------- + def lectureFichierIniIntegrateur(self): + # -------------------------------------- + # Verifie l'existence du fichier "standard" + # appelle la lecture de ce fichier + clef = "PREFS_CATA_" + self.code + if clef in os.environ.keys(): fic = os.environ[clef] + else : return + fichierPrefsIntegrateur = os.path.abspath(fic) + if not os.path.isfile(fichierPrefsIntegrateur): return + try : + with open(fichierPrefsIntegrateur) as fd: txt = fd.read() + except: + titre = tr("Import du fichier de Configuration") + texte = "Erreur a la lecture du fichier de configuration {} ".format(str(fichierPrefsIntegrateur)) + self.appliEficas.afficheMessage(titre, texte) + return + d = {} + try: + exec(txt, d) + except: + titre = tr("Import du fichier de Configuration") + texte = "Erreur a la l execution du fichier de configuration {} ".format(str(fichierPrefsIntegrateur)) + self.appliEficas.afficheMessage(titre, texte) + return + + for k in d: + if k in self.labelsEficas: + try: + setattr(self, k, d[k]) + except: + pass + + # -------------------------------------- + def lectureFichierIniUtilisateur(self): + # -------------------------------------- + # Surcharge les parametres standards par les parametres utilisateur s'ils existent + if not os.path.isfile(self.fichierPrefsUtilisateur): return + try : + with open(self.fichierPrefsUtilisateur) as fd: txt = fd.read() + except: + titre = tr("Import du fichier de Configuration"), + texte = "Erreur a la lecture du fichier de configuration {} ".format(str(fichierPrefsUtilisateur)) + self.appliEficas.afficheMessage(titre, texte) + return + d = {} + try: + exec(txt, d) + except: + titre = tr("Import du fichier de Configuration"), + texte = "Erreur a la l execution du fichier de configuration {} ".format(str(fichierPrefsUtilisateur)) + self.appliEficas.afficheMessage(titre, texte) + return + for k in d: + if k in self.labelsUser: + try: + setattr(self, k, d[k]) + except: + pass + + # -------------------------------------- + def saveParams(self): + # -------------------------------------- + # sauvegarde + # les nouveaux parametres dans le fichier de configuration utilisateur + # + texte = "" + for clef in self.labelsUser: + if hasattr(self, clef): + valeur = getattr(self, clef) + texte = texte + clef + " = " + repr(valeur) + "\n" + f = open(self.fichierPrefsUtilisateur, "w+") + f.write(texte) + f.close() + + +def makeConfig(appliEficas): + return configBase(appliEficas) diff --git a/InterfaceGUI/editorSsIhm.py b/InterfaceGUI/editorSsIhm.py index 2f175035..ce672ee5 100755 --- a/InterfaceGUI/editorSsIhm.py +++ b/InterfaceGUI/editorSsIhm.py @@ -73,16 +73,15 @@ class JDCEditorSsIhm: self.code = self.appliEficas.maConfiguration.code self.maConfiguration = self.appliEficas.maConfiguration - if ( - not hasattr(self.appliEficas, "readercata") + if ( not hasattr(self.appliEficas, "readercata") or self.appliEficas.readercata.demandeCatalogue == True - or self.appliEficas.multi == True - ): + or self.appliEficas.multi == True): + if self.maConfiguration.typeDeCata == "XML": from InterfaceGUI import readercataXML as readercata else: from InterfaceGUI import readercata - self.readercata = readercata.ReaderCata(self, self.appliEficas) + self.readercata = readercata.ReaderCata(self.appliEficas, self) self.appliEficas.readercata = self.readercata self.appliEficas.code = self.code else: @@ -261,7 +260,7 @@ class JDCEditorSsIhm: cata=self.readercata.cata, cata_ord_dico=self.readercata.cata_ordonne_dico, nom=jdcName, - rep_mat=self.maConfiguration.rep_mat, + repMat=self.maConfiguration.repMat, ) self.modified = False self.monConvert = monConvert @@ -294,7 +293,7 @@ class JDCEditorSsIhm: appliEficas=self.appliEficas, cata=self.readercata.cata, cata_ord_dico=self.readercata.cata_ordonne_dico, - rep_mat=self.maConfiguration.rep_mat, + repMat=self.maConfiguration.repMat, ) jdc.lang = self.appliEficas.langue @@ -324,7 +323,7 @@ class JDCEditorSsIhm: appliEficas=self.appliEficas, cata=self.readercata.cata, cata_ord_dico=self.readercata.cata_ordonne_dico, - rep_mat=self.maConfiguration.rep_mat, + repMat=self.maConfiguration.repMat, ) jaux.editor = self jaux.analyse() @@ -335,7 +334,7 @@ class JDCEditorSsIhm: cata=self.readercata.cata, cata_ord_dico=self.readercata.cata_ordonne_dico, jdc_pere=jaux, - rep_mat=self.maConfiguration.rep_mat, + repMat=self.maConfiguration.repMat, ) J.editor = self J.analyse() diff --git a/InterfaceGUI/qtEficasSsIhm.py b/InterfaceGUI/qtEficasSsIhm.py index 5eeb33a3..7a257dc2 100755 --- a/InterfaceGUI/qtEficasSsIhm.py +++ b/InterfaceGUI/qtEficasSsIhm.py @@ -20,9 +20,8 @@ import os, sys from Extensions.eficas_exception import EficasException -from Extensions import param2 from InterfaceGUI.getVersion import getEficasVersion -from viewManagerSsIhm import MyViewManagerSsIhm +from InterfaceGUI.viewManagerSsIhm import MyViewManagerSsIhm from Editeur import session @@ -31,31 +30,17 @@ class AppliSsIhm: Class implementing the main user interface. """ - def __init__( - self, - code=None, - salome=1, - parent=None, - multi=False, - langue="fr", - ssIhm=True, - labelCode=None, - genereXSD=False, - versionCode=None, - ssCode=None, - fichierCata=None, - GUIDir=None, + def __init__( self, code=None, salome=1, parent=None, multi=False, langue="fr", + ssIhm=True, labelCode=None, genereXSD=False, versionCode=None, ssCode=None, fichierCata=None, + GUIPath=None, ): """ Constructor """ version = getEficasVersion() - self.VERSION_EFICAS = "Eficas QT5 Salome " + version + self.versionEficas = "Eficas QT5 Salome " + version self.labelCode = labelCode - if not GUIDir: - self.GUIDir = "InterfaceQT4" - else: - self.GUIDir = GUIDir + self.GUIPath = None self.salome = salome self.ssIhm = True @@ -71,43 +56,13 @@ class AppliSsIhm: self.recent = [] self.ficRecents = {} self.mesScripts = {} - self.listeAEnlever = [] - self.ListePathCode = [ - "Adao", - "ADAO", - "Carmel3D", - "Telemac", - "CF", - "MAP", - "ZCracks", - "SEP", - "SPECA", - "PSEN_Eficas", - "PSEN_N1", - ] - self.listeCode = [ - "Adao", - "ADAO", - "Carmel3D", - "Telemac", - "CF", - "MAP", - "ZCracks", - "SEP", - "SPECA", - "PSEN_Eficas", - "PSEN_N1", - ] - self.repIcon = os.path.join( - os.path.dirname(os.path.abspath(__file__)), "..", "Editeur", "icons" - ) - - if fichierCata == None: - self.fichierCata = session.d_env.fichierCata - else: - self.fichierCata = fichierCata - if session.d_env.labelCode: - self.labelCode = session.d_env.labelCode + self.listePathAEnlever = [] + self.repIcon = os.path.join( os.path.dirname(os.path.abspath(__file__)), "..", "Editeur", "icons") + + if fichierCata == None: self.fichierCata = session.d_env.fichierCata + else: self.fichierCata = fichierCata + + if session.d_env.labelCode: self.labelCode = session.d_env.labelCode self.withXSD = session.d_env.withXSD if self.salome: @@ -118,18 +73,14 @@ class AppliSsIhm: print("eficas hors salome") self.multi = multi - if self.multi: - print("pas de multi sans ihm") + if self.multi: print("pas de multi sans ihm") - if langue == "fr": - self.langue = langue - else: - self.langue = "ang" + if langue == "fr": self.langue = langue + else: self.langue = "ang" if self.multi == False: self.definitCode(code, ssCode) - if code == None: - return + if code == None: return self.suiteTelemac = False self.viewmanager = MyViewManagerSsIhm(self) @@ -140,18 +91,12 @@ class AppliSsIhm: self.formatFichierIn = "pythonUQ" # par defaut def definitCode(self, code, ssCode): + # ssCode sert pour Map self.code = code self.ssCode = ssCode if self.code == None: return # pour le cancel de la fenetre choix code - try: - name = "prefs_" + self.code - prefsCode = __import__(name) - self.repIni = prefsCode.repIni - except: - self.repIni = os.path.dirname(os.path.abspath(__file__)) - if ssCode != None: self.formatFichierOut = ssCode # par defaut prefsCode.NAME_SCHEME = ssCode @@ -159,22 +104,13 @@ class AppliSsIhm: self.formatFichierIn = "python" # par defaut self.formatFichierOut = "python" # par defaut - nameConf = "configuration_" + self.code - try: - configuration = __import__(nameConf) - self.maConfiguration = configuration.make_config(self, self.repIni) - except: - from InterfaceQT4.configuration import makeConfig - - # self.maConfiguration = configuration.makeConfig(self,prefsCode.repIni) - self.maConfiguration = makeConfig(self, self.repIni) +#ooooo + from InterfaceGUI.configuration import configBase + self.maConfiguration = configBase(self) if hasattr(self, "maConfiguration") and self.maConfiguration.translatorFichier: from Extensions import localisation - - localisation.localise( - None, - self.langue, + localisation.localise( None, self.langue, translatorFichier=self.maConfiguration.translatorFichier, ) if self.withXSD: @@ -236,8 +172,13 @@ class AppliSsIhm: currentCata = CONTEXT.getCurrentCata() texteXSD = currentCata.dumpXsd(avecEltAbstrait) return texteXSD - # if self.maConfiguration.afficheIhm==False : exit() - # else : return texteXSD + + def afficheMessage(self, titre, texte,critical=True): + print ('__________________________') + print (tr(titre)) + print ('') + print (tr(texte)) + print ('__________________________') # ,self.fileSaveAs diff --git a/InterfaceGUI/readercata.py b/InterfaceGUI/readercata.py index 61b59504..d3b87947 100644 --- a/InterfaceGUI/readercata.py +++ b/InterfaceGUI/readercata.py @@ -29,62 +29,56 @@ import os, sys from Noyau.N_CR import CR from Editeur.catadesc import CatalogDescription -import analyse_catalogue -import analyse_catalogue_initial -import autre_analyse_cata -import uiinfo +from Editeur import analyse_catalogue +from Editeur import analyse_catalogue_initial +from Editeur import autre_analyse_cata +from Editeur import uiinfo from Extensions.i18n import tr from Extensions.eficas_exception import EficasException # ------------------------------- class ReaderCataCommun(object): - # ------------------------------- +# ------------------------------- def askChoixCatalogue(self, cataListeChoix): - # ____________________________________________ + #____________________________________________ """ Ouvre une fenetre de selection du catalogue dans le cas où plusieurs ont ete definis dans Accas/editeur.ini """ - try: - from PyQt5.QtWidgets import QDialog - except: + if self.appliEficas == None : print("Pas de choix interactif sans qt") return code = getattr(self.appliEficas.maConfiguration, "code", None) - if code != None: - title = tr("Choix d une version du code ") + str(code) - else: - title = tr("Choix d une version ") - - from InterfaceGUI.QT5.monChoixCata import MonChoixCata - - widgetChoix = MonChoixCata( + if code != None: title = tr("Choix d une version du code ") + str(code) + else: title = tr("Choix d une version ") + + # a Reflechir + # Pourquoi 2 fois MonChoixCata -- je ne comprends pas mais cela fonctionne + pathGui='InterfaceGUI.'+ self.appliEficas.GUIPath + '.monChoixCata' + MonChoixCata =__import__(pathGui, globals(), locals(), ['MonChoixCata,']) + widgetChoix = MonChoixCata.MonChoixCata( self.appliEficas, [cata.labelCode for cata in cataListeChoix], title ) ret = widgetChoix.exec_() - - lab = str(self.VERSION_EFICAS) + " " - lab += tr(" pour ") - lab += str(self.code) - lab += tr(" avec le catalogue ") - if ret == QDialog.Accepted: + #if ret == QDialog.Accepted: + if ret == 1: cata = cataListeChoix[widgetChoix.CBChoixCata.currentIndex()] self.fichierCata = cata.fichierCata self.labelCode = cata.labelCode self.appliEficas.formatFichierOut = cata.formatFichierOut self.appliEficas.formatFichierIn = cata.formatFichierIn - lab += self.labelCode - self.appliEficas.setWindowTitle(lab) + titre='{} pour {} avec le catalogue {}'.format(self.appliEficas.versionEficas,self.code,self.labelCode) + self.appliEficas.setWindowTitle(titre) widgetChoix.close() else: widgetChoix.close() raise EficasException() def choisitCata(self): - # ____________________ + # ____________________ listeCataPossibles = [] #self.commandesOrdreCatalogue = [] @@ -106,17 +100,11 @@ class ReaderCataCommun(object): listeCataPossibles.append(catalogue) if len(listeCataPossibles) == 0: - try: - QMessageBox.critical( - self.QWParent, + self.appliEficas.afficheMessage( tr("Import du catalogue"), - tr("Pas de catalogue defini pour le code ") + self.code, - ) - except: - print("Pas de catalogue defini pour le code " + self.code) - if self.appliEficas.salome == 0: - sys.exit(1) + tr("Pas de catalogue defini pour le code {}".format(self.code))) self.appliEficas.close() + if self.appliEficas.salome == 0: sys.exit(1) return if self.labelCode is not None: @@ -159,19 +147,12 @@ class ReaderCataCommun(object): listeCataPossibles = (catalogue,) if len(listeCataPossibles) == 0: - try: - from PyQt5.QtWidgets import QMessageBox, QDialog - - QMessageBox.critical( - self.QWParent, - tr("Import du catalogue"), - tr("Pas de catalogue defini pour le code ") + self.code, - ) - except: - print("Pas de catalogue defini pour le code " + self.code) + self.appliEficas.afficheMessage( + tr("Import du catalogue"), + tr("Pas de catalogue defini pour le code ") + self.code, + ) self.appliEficas.close() - if self.appliEficas.salome == 0: - sys.exit(1) + if self.appliEficas.salome == 0: sys.exit(1) return # le label est fixe dans la ligne de commande @@ -191,19 +172,11 @@ class ReaderCataCommun(object): cataListeChoix.append(cata) if len(cataListeChoix) == 0: - try: - from PyQt5.QtWidgets import QMessageBox - - QMessageBox.critical( - self.QWParent, - tr("Import du catalogue"), - tr("Aucun catalogue trouve"), - ) - except: - print("Pas de catalogue defini pour le code " + self.code) + self.appliEficas.afficheMessage( + tr("Import du catalogue"), + tr("Aucun catalogue trouve"),) self.appliEficas.close() - if self.appliEficas.salome == 0: - sys.exit(1) + if self.appliEficas.salome == 0: sys.exit(1) elif len(cataListeChoix) == 1: self.fichierCata = cataListeChoix[0].fichierCata @@ -236,14 +209,14 @@ class ReaderCataCommun(object): # ------------------------------------ class ReaderCata(ReaderCataCommun): - # ------------------------------------ +# ------------------------------------ - def __init__(self, QWParent, appliEficas): - # _______________________________________ + def __init__(self, appliEficas, editor): + # _________________________________ - self.QWParent = QWParent - self.appliEficas = self.QWParent.appliEficas - self.VERSION_EFICAS = self.appliEficas.VERSION_EFICAS + self.appliEficas = appliEficas + self.editor = editor + self.versionEficas = self.appliEficas.versionEficas self.demandeCatalogue = False self.code = self.appliEficas.code self.titre = self.appliEficas.code @@ -261,6 +234,7 @@ class ReaderCata(ReaderCataCommun): self.creeDicoCasToCata() def openCata(self): + # _________________________________ """ Ouvre le catalogue standard du code courant, cad le catalogue present dans le repertoire Cata @@ -270,8 +244,7 @@ class ReaderCata(ReaderCataCommun): self.choisitCata() self.cata = self.importCata(self.fichierCata) - if self.code == "NonConnu": - self.code = self.cata.JdC.code + if self.code == "NonConnu": self.code = self.cata.JdC.code modeleMetier = None dicoEltDif = {} if not (self.appliEficas.genereXSD): @@ -279,7 +252,7 @@ class ReaderCata(ReaderCataCommun): try: import pyxb except: - self.QWParent.informe( + self.appliEficas.afficheMessage( "environnement", "please source pyxb environment" ) exit() @@ -311,8 +284,6 @@ class ReaderCata(ReaderCataCommun): modeleMetier = imp.load_source(nomCataXsd, pathCata) # print ('nomCataXsd , pathCata ',nomCataXsd,pathCata) try: - # if 1 : - # monObjetAnnotation = getattr(modeleMetier,'PNEFdico_'+self.code) monObjetAnnotation = getattr(modeleMetier, "PNEFdico") texte = monObjetAnnotation.__doc__ except: @@ -324,12 +295,12 @@ class ReaderCata(ReaderCataCommun): dicoEltDif = l["dicoEltDif"] # print ('dans readerCata _________', dicoEltDif) - except: + except Exception as e : if self.appliEficas.ssIhm == False: - print("______________ poum import cata_genere ") - self.QWParent.informe( - "XSD driver", "unable to load xsd driver", critique=False - ) + self.appliEficas.afficheMessage( + "XSD driver", "unable to load xsd driver", critique=False + ) + print (e) modeleMetier = None self.cata.DicoNomTypeDifferentNomElt = dicoEltDif @@ -351,20 +322,13 @@ class ReaderCata(ReaderCataCommun): self.cata.modeleMetier = modeleMetier if not self.cata: - # try: - # from PyQt5.QtWidgets import QMessageBox, QDialog - # QMessageBox.critical( self.QWParent, tr("Import du catalogue"),tr("Impossible d'importer le catalogue ")+ self.fichierCata) - # except : - # print ("Impossible d'importer le catalogue "+ self.fichierCata) - self.QWParent.informe( + self.appliEficas.afficheMessage( "Catalogue", "Impossible d'importer le catalogue " + self.fichierCata ) self.appliEficas.close() if self.appliEficas.salome == 0: sys.exit(1) # - # analyse du catalogue (ordre des mots-cles) - # # retrouveOrdreCataStandard fait une analyse textuelle du catalogue # remplace par retrouveOrdreCataStandardAutre qui utilise une numerotation # des mots cles a la creation @@ -407,15 +371,14 @@ class ReaderCata(ReaderCataCommun): # self.titre = ( - self.VERSION_EFICAS + self.versionEficas + " " + tr(" avec le catalogue ") + os.path.basename(self.fichierCata) ) if self.appliEficas.ssIhm == False: self.appliEficas.setWindowTitle(self.titre) - self.appliEficas.titre = self.titre - self.QWParent.titre = self.titre + self.editor.titre = self.titre # incertitude --> change le convert if hasattr(self.cata, "avecIncertitude"): @@ -423,42 +386,41 @@ class ReaderCata(ReaderCataCommun): if hasattr(self.cata, "modifieCatalogueDeterministe"): self.cata.modifieCatalogueDeterministe(self.cata) - def importCata(self, cata): + def importCata(self, fichierCata): """ Realise l'import du catalogue dont le chemin d'acces est donne par cata """ - nom_cata = os.path.splitext(os.path.basename(cata))[0] - rep_cata = os.path.dirname(cata) - sys.path[:0] = [rep_cata] - self.appliEficas.listeAEnlever.append(rep_cata) + + nomCata = os.path.splitext(os.path.basename(fichierCata))[0] + repCata = os.path.abspath(os.path.dirname(fichierCata)) + sys.path[:0] = [repCata] + self.appliEficas.listePathAEnlever.append(repCata) - # PNPNPN pas propre __ A reflechir - if "cata_Vimmp" in list(sys.modules.keys()): - del sys.modules["cata_Vimmp"] - - if nom_cata in list(sys.modules.keys()): - del sys.modules[nom_cata] + if nomCata in list(sys.modules.keys()): + del sys.modules[nomCata] for k in sys.modules: - if k[0 : len(nom_cata) + 1] == nom_cata + ".": + if k[0 : len(nomCata) + 1] == nomCata + ".": del sys.modules[k] + # permet d ajouter des scripts appelables par des fonctions supplementaires + # dans l ihm mesScriptsNomFichier = "mesScripts_" + self.code.upper() - try: - self.appliEficas.mesScripts[self.code] = __import__(mesScriptsNomFichier) - except: - pass + try: self.appliEficas.mesScripts[self.code] = __import__(mesScriptsNomFichier) + except: pass - # if 1 : try: - o = __import__(nom_cata) - return o + #import importlib.util + from importlib import util + cataSpec = util.spec_from_file_location(nomCata, fichierCata) + leCata = util.module_from_spec(cataSpec) + cataSpec.loader.exec_module(leCata) + return leCata except Exception as e: - self.QWParent.informe("catalog python", "unable to load catalog file") + self.appliEficas.afficheMessage("catalog python", "unable to load catalog file") import traceback - traceback.print_exc() - return 0 + exit(1) def retrouveOrdreCataStandardAutre(self): """ @@ -481,8 +443,8 @@ class ReaderCata(ReaderCataCommun): Retrouve l'ordre des mots-cles dans le catalogue, cad : Attention s appuie sur les commentaires """ - nom_cata = os.path.splitext(os.path.basename(self.fichierCata))[0] - rep_cata = os.path.dirname(self.fichierCata) + nomCata = os.path.splitext(os.path.basename(self.fichierCata))[0] + repCata = os.path.dirname(self.fichierCata) self.commandesOrdreCatalogue = analyse_catalogue_initial.analyseCatalogue( self.fichierCata) # print self.commandesOrdreCatalogue diff --git a/InterfaceGUI/readercataXML.py b/InterfaceGUI/readercataXML.py index f3d10162..c820ff37 100644 --- a/InterfaceGUI/readercataXML.py +++ b/InterfaceGUI/readercataXML.py @@ -40,10 +40,10 @@ from readercata import ReaderCataCommun class ReaderCata(ReaderCataCommun): - def __init__(self, QWParent, appliEficas): - self.QWParent = QWParent + def __init__(self, appliEficas, editor): self.appliEficas = appliEficas - self.VERSION_EFICAS = self.appliEficas.VERSION_EFICAS + self.editor = editor + self.versionEficas = self.appliEficas.versionEficas self.code = self.appliEficas.code self.ssCode = self.appliEficas.ssCode # PN ?? bizarre le 22/04/20 diff --git a/Tests/testihm/common.py b/Tests/OldTestsTk/testihm/common.py similarity index 100% rename from Tests/testihm/common.py rename to Tests/OldTestsTk/testihm/common.py diff --git a/Tests/testihm/testihm1.py b/Tests/OldTestsTk/testihm/testihm1.py similarity index 100% rename from Tests/testihm/testihm1.py rename to Tests/OldTestsTk/testihm/testihm1.py diff --git a/Tests/testihm/testihm2.py b/Tests/OldTestsTk/testihm/testihm2.py similarity index 100% rename from Tests/testihm/testihm2.py rename to Tests/OldTestsTk/testihm/testihm2.py diff --git a/Tests/testihm/testihm3.py b/Tests/OldTestsTk/testihm/testihm3.py similarity index 100% rename from Tests/testihm/testihm3.py rename to Tests/OldTestsTk/testihm/testihm3.py diff --git a/Tests/testihm/testihm4.py b/Tests/OldTestsTk/testihm/testihm4.py similarity index 100% rename from Tests/testihm/testihm4.py rename to Tests/OldTestsTk/testihm/testihm4.py diff --git a/Tests/testihm7/common.py b/Tests/OldTestsTk/testihm7/common.py similarity index 100% rename from Tests/testihm7/common.py rename to Tests/OldTestsTk/testihm7/common.py diff --git a/Tests/testihm7/testihm1.py b/Tests/OldTestsTk/testihm7/testihm1.py similarity index 100% rename from Tests/testihm7/testihm1.py rename to Tests/OldTestsTk/testihm7/testihm1.py diff --git a/Tests/testihm7/testihm2.py b/Tests/OldTestsTk/testihm7/testihm2.py similarity index 100% rename from Tests/testihm7/testihm2.py rename to Tests/OldTestsTk/testihm7/testihm2.py diff --git a/Tests/testihm7/testihm4.py b/Tests/OldTestsTk/testihm7/testihm4.py similarity index 100% rename from Tests/testihm7/testihm4.py rename to Tests/OldTestsTk/testihm7/testihm4.py diff --git a/Tests/testihm9/common.py b/Tests/OldTestsTk/testihm9/common.py similarity index 100% rename from Tests/testihm9/common.py rename to Tests/OldTestsTk/testihm9/common.py diff --git a/Tests/testihm9/testihm1.py b/Tests/OldTestsTk/testihm9/testihm1.py similarity index 100% rename from Tests/testihm9/testihm1.py rename to Tests/OldTestsTk/testihm9/testihm1.py diff --git a/Tests/testihm9/testihm2.py b/Tests/OldTestsTk/testihm9/testihm2.py similarity index 100% rename from Tests/testihm9/testihm2.py rename to Tests/OldTestsTk/testihm9/testihm2.py diff --git a/Tests/testihm9/testihm3.py b/Tests/OldTestsTk/testihm9/testihm3.py similarity index 100% rename from Tests/testihm9/testihm3.py rename to Tests/OldTestsTk/testihm9/testihm3.py diff --git a/Tests/testihm9/testihm4.py b/Tests/OldTestsTk/testihm9/testihm4.py similarity index 100% rename from Tests/testihm9/testihm4.py rename to Tests/OldTestsTk/testihm9/testihm4.py diff --git a/Tests/config.py b/Tests/config.py deleted file mode 100644 index f6f6fb00..00000000 --- a/Tests/config.py +++ /dev/null @@ -1,8 +0,0 @@ -import sys -import prefs -ASTERDIR={ - "v7":"/local/chris/ASTER/instals/STA7/astest", - "v8":"/local/chris/ASTER/instals/STA8/astest", - "v9":"/local/chris/ASTER/instals/NEW9/astest", - } - diff --git a/Tests/editeur.ini b/Tests/editeur.ini deleted file mode 100644 index 55246c0f..00000000 --- a/Tests/editeur.ini +++ /dev/null @@ -1,57 +0,0 @@ -# CONFIGURATION MANAGEMENT OF EDF VERSION -# ====================================================================== -# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. -# -# -# ====================================================================== - -import os - -import prefs - -rep_cata = os.path.abspath(os.path.join(prefs.repIni,'../Aster/Cata')) -rep_Pmw = os.path.join(prefs.repIni,'../Pmw') - -# Accès à la documentation Aster -path_doc = os.path.join(rep_cata,'..','Doc') -exec_acrobat = "acroread" -# Utilisateur/Développeur -isdeveloppeur = "NON" -path_cata_dev = "/tmp/cata" -# Répertoire temporaire -rep_travail = "/tmp" -# Répertoire initial -initialdir=os.curdir - -# Choix des catalogues -#rep_mat=os.path.join(rep_cata,'..','materiau') -rep_mat_v7="/local/cchris/ASTER/instals/materiaux/STA7" -rep_mat_v8="/local/cchris/ASTER/instals/materiaux/STA8" -rep_mat_v9="/local/cchris/ASTER/instals/materiaux/NEW9" - -catalogues = ( - ('ASTER','petit',os.path.join(rep_cata,'petitcata'),'python'), - ('ASTER','v5.9',os.path.join(rep_cata,'cataSTA5'),'asterv5'), - ('ASTER','v6.8',os.path.join(rep_cata,'cataSTA6'),'python6'), - ('ASTER','v6',os.path.join(rep_cata,'cataSTA6'),'python6'), - ('ASTER','v7.7',os.path.join(rep_cata,'cataSTA7'),'python'), - ('ASTER','v7',os.path.join(rep_cata,'cataSTA7'),'python'), - ('ASTER','v8.4',os.path.join(rep_cata,'cataSTA8'),'python'), - ('ASTER','v8',os.path.join(rep_cata,'cataSTA8'),'python'), - ('ASTER','v9.1',os.path.join(rep_cata,'cataSTA9'),'python'), - ('ASTER','v9',os.path.join(rep_cata,'cataSTA9'),'python','defaut'), - ) - diff --git a/Tests/eficas_aster.py b/Tests/eficas_aster.py deleted file mode 100755 index deaa5455..00000000 --- a/Tests/eficas_aster.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# CONFIGURATION MANAGEMENT OF EDF VERSION -# ====================================================================== -# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. -# -# -# ====================================================================== - -""" - Ce module sert à lancer EFICAS configuré pour Code_Aster -""" -# Modules Python - -# Modules Eficas -import prefs -from InterfaceTK import eficas_go - -eficas_go.lance_eficas() diff --git a/Tests/compare.py b/Tests/old/compare.py similarity index 100% rename from Tests/compare.py rename to Tests/old/compare.py diff --git a/Tests/style.py b/Tests/style.py deleted file mode 100644 index 0d387727..00000000 --- a/Tests/style.py +++ /dev/null @@ -1,63 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Pour modifier le style d'EFICAS il faut ajouter un fichier style.py qui contiendra les -informations sur le style voulu dans son repertoire Eficas_install. - -La methode la plus simple consiste à modifier directement les attributs de l'objet style dans le -fichier style.py d'Eficas_install. Exemple:: - - style.background='yellow' - -pour modifier la couleur du background. - -Il existe une autre méthode qui peut être utilisée quand on veut modifier plusieurs propriétés à la fois. - -Le fichier style.py doit définir une nouvelle classe qui dérive de la classe de base STYLE avec des attributs -de classe qui définiront le nouveau style (par exemple, si on veut modifier le background):: - - class STYLE(STYLE): - background='yellow' - -Il faut ensuite instancier cette classe, dans ce meme fichier, en donnant le nom style à l'objet cree:: - - style=STYLE() - -Tous les attributs de classe possibles sont visibles dans le module Editeur/basestyle.py:: - - background='gray90' - foreground='black' - entry_background='white' - list_background='white' - list_select_background='#00008b' - list_select_foreground='grey' - tooltip_background="yellow" - - standard = ("Helvetica",12) - standard_italique = ("Helvetica",12,'italic') - standard_gras = ("Helvetica",12,'bold') - standard_gras_souligne = ("Helvetica",12,'bold','underline') - - canvas = ('Helvetica',10) - canvas_italique = ('Helvetica',10,'italic') - canvas_gras = ("Helvetica",10,'bold') - canvas_gras_italique = ("Helvetica",12,'bold','italic') - - standard12 = ("Helvetica",14) - standard12_gras = ("Helvetica",14,'bold') - standard12_gras_italique = ( "Helvetica",14,'bold','italic') - - -Le fichier style.py contenu dans le répertoire Aster permet de spécifier des propriétés globales pour une installation. -Les modifications de style contenues dans ce fichier et dans le fichier style.py d'Eficas_install -sont prises en compte dans cet ordre. -""" - - -style.background='gray90' -style.foreground='black' -style.standard = ("Helvetica",10) -style.standard_italique = ("Helvetica",10,'italic') -style.standard_gras = ("Helvetica",10,'bold') -style.canvas_italique = ('Helvetica',10,'italic') -style.canvas_gras = ("Helvetica",10,'bold') -style.statusfont = ("Helvetica",14) diff --git a/Tools/cataEmpty.py b/Tools/cataEmpty.py new file mode 100755 index 00000000..5d715254 --- /dev/null +++ b/Tools/cataEmpty.py @@ -0,0 +1,8 @@ +# coding: utf-8 +# +from Accas import JDC_CATA + +JdC = JDC_CATA(code='EMPTY', + execmodul=None, + ) + diff --git a/Tools/cataExample.py b/Tools/cataExample.py new file mode 100755 index 00000000..7f78e190 --- /dev/null +++ b/Tools/cataExample.py @@ -0,0 +1,161 @@ +# coding: utf-8 +# +from Accas import JDC_CATA, PROC, EXAMPLE + +JdC = JDC_CATA(code='PATTERNS', + execmodul=None, + ) + + +EXAMPLE = PROC (nom = 'EXAMPLE', + op=None, + + TITRE = SIMP(statut ='o', typ = 'TXM', defaut = 'Mon Etude',), + TITRE2 = SIMP(statut ='f', typ = 'TXM', ), +) +CREEOBJET = OPER (nom="CREEOBJET", + op=None, + sd_prod=ObjetUtilisateur, + UIinfo={"groupes":("Group1",)}, + + TITLE = SIMP(statut ='o', typ = 'TXM', defaut = '',), + RB1 = SIMP(statut ='o', typ = 'I', into = [1,2,3],), + RB2 = SIMP(statut ='o', typ = 'I', into = [1,2,3,4,5,6,],), + CB = SIMP(statut ='o', typ = 'I', into = [1,2,3,4,5,6,7,8,9],), + MBool = SIMP(statut ='o', typ = bool,), + MFile = SIMP(statut ='o', typ = ('Fichier','All Files (*)')), + MDir = SIMP(statut ='o', typ = 'Repertoire'), + Reel1 = SIMP(statut ='o', typ = 'R'), + Compl = SIMP(statut ='o', typ = 'C'), + Tuple2 = SIMP(statut ='o', typ = Tuple(2), validators=VerifTypeTuple(('R','R'))), + Tuple3 = SIMP(statut ='o', typ = Tuple(3), validators=VerifTypeTuple(('R','R','R'))), + + LTITLE = SIMP(statut ='o', typ = 'TXM', max='**', defaut = '',), + LRB2 = SIMP(statut ='o', typ = 'I', max = '**', into = [1,2,3,4,5,6,],), + LCB = SIMP(statut ='o', typ = 'I', max = '**', homo="SansOrdreNiDoublon", into = [1,2,3,4,5,6,7,8,9],), + LReel1 = SIMP(statut ='o', typ = 'R', max = "**"), + LCompl = SIMP(statut ='o', typ = 'C', max = "**"), + LTuple2 = SIMP(statut ='o', typ = Tuple(2), validators=VerifTypeTuple(('R','R')), max = "**"), + LTuple3 = SIMP(statut ='o', typ = Tuple(3), validators=VerifTypeTuple(('R','R','R')), max = "**"), + + LREEL = SIMP(statut ='f', typ = 'R', max='**', defaut = '',), +) + +UTILISEOBJET = PROC (nom="UTILISEOBJET", + op=None, + UIinfo={"groupes":("Group1",)}, + Obj = SIMP (statut ='o', typ = ObjetUtilisateur,) +) + +ESSAI_FACT=OPER(nom="ESSAI_FACT", + sd_prod=ObjetUtilisateur, + op=None, + fr="Affectation de caractéristiques à des éléments de structure", + regles = (AU_MOINS_UN('Poutre','Barre'), + EXCLUS('Discret','Discret_2D'),), + Info = SIMP(statut='f',typ='I', defaut= 1 ,into=(1,2) ), + Verif = SIMP(statut='f',typ='TXM',validators=NoRepeat(),max='**',into=("Maille","Noeud") ), +# +# ============================================================================== + Poutre = FACT(statut= 'f',max= '**', + Section = SIMP(statut= 'o',typ= 'TXM' ,into= ("GENERALE","RECTANGLE","CERCLE") ), + + b_generale = BLOC(condition = " Section == 'GENERALE'", + regles = (UN_PARMI('Maille','GroupeMailles'),), + Maille = SIMP(statut= 'f',typ= 'TXM' ,validators= NoRepeat(),max= '**'), + GroupeMailles = SIMP(statut= 'f',typ= grma,validators= NoRepeat(),max= '**'), + + Vari = SIMP(statut= 'f',typ= 'TXM',into= ("CONSTANT","HOMOTHETIQUE"),defaut= "CONSTANT"), + + b_constant = BLOC(condition = "Vari == 'CONSTANT'", + regles = (PRESENT_ABSENT('Table','Cara'), + PRESENT_PRESENT('Table','Nom'), + PRESENT_PRESENT('Cara','Valeur'),), + Table = SIMP(statut= 'f',typ='TXM'), + Nom = SIMP(statut= 'f',typ= 'TXM'), + Cara = SIMP(statut= 'o',typ= 'TXM',min= 4 ,max= 5, + fr= "A,IY,IZ,JX sont des paramètres obligatoires", + validators= [NoRepeat(), Compulsory(['A','IY','IZ','JX'])], + into= ("A","IY","IZ","AY","AZ","EY","EZ","JX","RY","RZ","RT","JG","IYR2","IZR2","AI") ), + Valeur = SIMP(statut= 'f',typ= 'R',min= 4 ,max= 15), + ), + ), + b_rectangle = BLOC(condition = "Section == 'RECTANGLE'", + regles = (UN_PARMI('Maille','GroupeMailles'),), + Maille = SIMP(statut= 'f',typ= 'TXM' ,validators= NoRepeat(),max= '**'), + GroupeMailles = SIMP(statut= 'f',typ= grma,validators= NoRepeat(),max= '**'), + Vari = SIMP(statut= 'f',typ= 'TXM',into= ("CONSTANT","HOMOTHETIQUE","AFFINE"),defaut= "CONSTANT"), + b_constant = BLOC(condition = "Vari == 'CONSTANT'", + Cara = SIMP(statut= 'o',typ= 'TXM',min= 1 ,max= 4, + validators = [NoRepeat(), + OrVal( [AndVal( [Compulsory(['H']),Absent(['HY','HZ','EPY','EPZ'])] ), + AndVal( [Compulsory(['HY','HZ']),Together(['EPY','EPZ']),Absent(['H','EP'])] )] )], + into= ("H","EP", "HY","HZ","EPY","EPZ"),), + Valeur = SIMP(statut= 'o',typ= 'R',min= 1 ,max= 4), + ), + + Metrique = SIMP(statut= 'f',typ= 'TXM',defaut= "NON",into= ("OUI","NON") ), + Fcx = SIMP(statut= 'f',typ= 'R'), + Tuyau = SIMP(statut= 'f',typ= 'I',val_max= 10,defaut= 3), + ), + ), +# +# ============================================================================== + Barre = FACT(statut='f',max='**', + regles = (UN_PARMI('Maille','GroupeMailles'),), + Maille = SIMP(statut='f',typ='TXM' ,validators=NoRepeat(),max='**'), + GroupeMailles = SIMP(statut='f',typ=grma,validators=NoRepeat(),max='**'), + Section = SIMP(statut='o',typ='TXM',into=("GENERALE","RECTANGLE","CERCLE") ), + b_generale = BLOC(condition = "Section=='GENERALE'", + regles = (PRESENT_ABSENT('Table','Cara'), + PRESENT_PRESENT('Table','Nom'), + PRESENT_PRESENT('Cara','Valeur')), + Table = SIMP(statut='f',typ='TXM'), + Nom = SIMP(statut='f',typ='TXM',validators=LongStr(1,24) ), + Cara = SIMP(statut='f',typ='TXM',into=("A",) ), + Valeur = SIMP(statut='f',typ='R',min=1,max=1 ), + ), + b_rectangle = BLOC(condition = "Section=='RECTANGLE'", + Cara = SIMP(statut='o',typ='TXM', min=1, max=4, + validators = [NoRepeat(), + OrVal( [AndVal( [Compulsory(['H']),Absent(['HY','HZ','EPY','EPZ'])] ), + AndVal( [Compulsory(['HY','HZ']),Together(['EPY','EPZ']),Absent(['H','EP'])] )] )], + into=("H","EP","HZ","HY","EPY","EPZ"), ), + Valeur = SIMP(statut='o',typ='R',min=1,max=4 ), ), + b_cercle = BLOC(condition = "Section=='CERCLE'", + Cara = SIMP(statut='o',typ='TXM',validators=[NoRepeat(),Compulsory(['R'])],min=1,max=2,into=("R","EP") ), + Valeur = SIMP(statut='o',typ='R',min=1,max=2 ), ), + ), +# +# ============================================================================== + Discret = FACT(statut='f',max='**', + REPERE = SIMP(statut='f',typ='TXM',into=("LOCAL","GLOBAL") ), + AMOR_HYST = SIMP(statut='f',typ='R' ), + SYME = SIMP(statut='f',typ='TXM',defaut="OUI",into=("OUI","NON"),), + b_SYME_OUI = BLOC(condition="SYME=='OUI'", + fr="SYMETRIQUE: Affectation de matrices de rigidité, de masse ou d'amortissement à des mailles ou noeuds", + Cara = SIMP(statut='o',typ='TXM',validators=NoRepeat(),max=1,defaut="None", + into = ("K_T_D_N", "K_T_D_L", "K_TR_D_N", "K_TR_D_L", "K_T_N", "K_T_L", "K_TR_N", "K_TR_L", + "M_T_D_N", "M_T_D_L", "M_TR_D_N", "M_TR_D_L", "M_T_N", "M_T_L", "M_TR_N", "M_TR_L", + "A_T_D_N", "A_T_D_L", "A_TR_D_N", "A_TR_D_L", "A_T_N", "A_T_L", "A_TR_N", "A_TR_L",),), + # Affection des caractéristiques de RIGIDITE/AMORTISSEMENT/MASSE + b_AK_T_D_N = BLOC(condition = "((Cara=='K_T_D_N')or(Cara=='A_T_D_N'))", + fr = "Noeud: 3 valeurs (triangulaire supérieure par colonne)", + regles = (UN_PARMI('Maille','GroupeMailles','Noeud','GROUP_NO'),), + Noeud = SIMP(statut='f',typ='TXM' ,validators=NoRepeat(),max='**'), + GROUP_NO = SIMP(statut='f',typ=grno,validators=NoRepeat(),max='**'), + Maille = SIMP(statut='f',typ='TXM' ,validators=NoRepeat(),max='**'), + GroupeMailles = SIMP(statut='f',typ=grma,validators=NoRepeat(),homo='SansOrdreNiDoublon',max='**'), + Valeur = SIMP(statut='o',typ='R',min=3 ,max=3 ),), + ), + ), +# +# ============================================================================== + Discret_2D = FACT(statut='f',max='**', + REPERE = SIMP(statut='f',typ='TXM',into=("LOCAL","GLOBAL") ), + AMOR_HYST = SIMP(statut='f',typ='R' ), + SYME = SIMP(statut='f',typ='TXM',defaut="OUI",into=("OUI","NON"),), + ), +) + + diff --git a/Tools/generateStructure.py b/Tools/generateStructure.py new file mode 100755 index 00000000..3bcfdc3f --- /dev/null +++ b/Tools/generateStructure.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2013 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +""" + cree le .xsd associe au .py + generateXSD.py -c leCatalogueAVECSONNOMCOMPLET POUR TROUVER LE DRIVER + 23 avril +""" +# Modules Python +# Modules Eficas +import sys +import os +sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..')) + +from InterfaceQT4 import eficas_go +eficas_go.genereStructure(code='NonConnu') diff --git a/Tools/generateXML.py b/Tools/generateXML.py new file mode 100755 index 00000000..c67da453 --- /dev/null +++ b/Tools/generateXML.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2013 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +""" +"" + cree le .xml associe au .comm + generateXML.py -c leCatalogue le.comm + 23 avril + +""" +# Modules Python +# Modules Eficas + +import sys +import os +sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../')) + +from InterfaceQT4 import eficas_go +eficas_go.genereXML(code='NonConnu') diff --git a/Tools/generateXSD.py b/Tools/generateXSD.py new file mode 100755 index 00000000..3f8ad835 --- /dev/null +++ b/Tools/generateXSD.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2013 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +""" + cree le .xsd associe au .py + generateXSD.py -c leCatalogueAVECSONNOMCOMPLET POUR TROUVER LE DRIVER + 23 avril +""" +# Modules Python +# Modules Eficas +import sys +import os +sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..')) + +from InterfaceQT4 import eficas_go +eficas_go.genereXSD(code='NonConnu') diff --git a/Tools/qtEficasGui.py b/Tools/qtEficasGui.py new file mode 100755 index 00000000..497570de --- /dev/null +++ b/Tools/qtEficasGui.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2024 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +""" + Ce module sert a lancer EFICAS contre l avis de Pascale sans directory associee + Dans ce cas on peut taper + a) de n importe ou sans avoir rien positionne : + /leCheminVersTools/qtEficasGui.py -c leFichierCatalogueAvecSonPathComplet + b) En ayant positionne le PYTHONPATH avec la directory qui contient ce qu il faut + c est a dire le prefs.py et prefs_leCode.py + exemple pour Adao + /leCheminVersTools/qtEficasGui.py -k Adao + /leCheminVersTools/qtEficasGui.py -k Adao -v V95 + version du 23 avril + +""" +# Modules Python +# Modules Eficas + +import sys +import os + +repIni=os.path.dirname(os.path.abspath(__file__)) +INSTALLDIR=os.path.join(repIni,'..') +sys.path[:0]=[INSTALLDIR] +#sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../..')) + +from Editeur import eficas_go +eficas_go.lanceEficas(code='NonConnu') diff --git a/Tools/validateDataSet.py b/Tools/validateDataSet.py new file mode 100755 index 00000000..0ba40437 --- /dev/null +++ b/Tools/validateDataSet.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2013 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +""" +"" + cree le .xml associe au .comm + generateXML.py -c leCatalogue le.comm + 23 avril + +""" +# Modules Python +# Modules Eficas + +import sys +import os +sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../')) + +from InterfaceQT4 import eficas_go +eficas_go.validateDataSet(code='NonConnu') -- 2.39.2