executed in the same way, and they give the same result as in the standard
Python interface.
+.. _section_advanced_eficas_gui:
+
+Using the EFICAS graphical interface as an ADAO TUI command
+-----------------------------------------------------------
+
+To make it easier to quickly edit an ADAO command file with EFICAS (JDC, or
+pair of files ".comm/.py", that are together in a directory), you can launch
+the graphical user interface from the Python interpreter. To do this, in a
+Python interpreter obtained from the "SALOME shell", the following commands are
+used::
+
+ from adao import adaoBuilder
+ adaoBuilder.Gui()
+
+If necessary, explicit messages can be used to identify the required
+environment variables that are missing. However, this command should not be run
+in the SALOME Python console (because in this case it is enough to activate the
+module...) but it can be done in a "SALOME shell" session obtained from the
+"Tools/Extensions" menu of SALOME. As a reminder, the easiest way to get a
+Python interpreter included in a "SALOME shell" session is to run the following
+command in a terminal::
+
+ $SALOMEDIR/salome shell -- python
+
+with ``SALOMEDIR`` the ``<SALOME main installation directory>``.
+
.. _section_advanced_execution_mode:
Change the default execution mode of nodes in YACS
To implement these "*observer*" efficiently, one can look to the
:ref:`section_ref_observers_requirements`.
+.. _section_advanced_logging:
+
Getting more information when running a calculation
---------------------------------------------------
It is also recalled that one have to choose the type "*multi*" for the default
container in order to launch the scheme, to allow a really parallel execution.
+.. _subsection_new_adao_version:
+
Switching from a version of ADAO to a newer one
-----------------------------------------------
du fichier JDC ADAO>``) automatiquement en utilisant un script de commandes
Shell "type" contenant toutes les étapes requises. Si la commande principale de
lancement de SALOME, nommée ``salome``, n'est pas couramment accessible dans un
-terminal courant, l'utilisateur doit savoir où se trouvent les principaux
+terminal standard, l'utilisateur doit savoir où se trouvent les principaux
fichiers de lancement de SALOME, et en particulier ce fichier ``salome``. Le
répertoire dans lequel ce fichier réside est symboliquement nommé ``<Répertoire
principal d'installation de SALOME>`` et doit être remplacé par le bon dans le
être exécutés de la même manière, et ils donnent le même résultat que dans
l'interface API/TUI en Python standard.
+.. _section_advanced_eficas_gui:
+
+Utiliser l'interface graphique EFICAS comme une commande TUI d'ADAO
+-------------------------------------------------------------------
+
+Pour faciliter l'édition rapide avec EFICAS d'un fichier de commandes ADAO
+(JDC, ou paire de fichiers ".comm/.py", qui se trouvent ensemble dans un
+répertoire), on peut lancer l'interface graphique depuis l'interpréteur Python.
+Pour cela, dans un interpréteur Python obtenu depuis le "SALOME shell", on
+utilise les commandes suivantes::
+
+ from adao import adaoBuilder
+ adaoBuilder.Gui()
+
+si nécessaire, des messages explicites permettent d'identifier les variables
+d'environnement requises qui seraient absentes. Cette commande ne doit
+néanmoins pas être lancée dans la console Python de SALOME (car dans ce cas il
+suffit d'activer le module...), mais elle peut l'être dans une session "SALOME
+shell" obtenue depuis le menu "Outils/Extensions" de SALOME. Pour mémoire, le
+moyen le plus simple d'obtenir un interpréteur Python inclu dans une session
+"SALOME shell" est de lancer la commande suivante dans un terminal::
+
+ $SALOMEDIR/salome shell -- python
+
+avec ``SALOMEDIR`` le ``<Répertoire principal d'installation de SALOME>``.
+
.. _section_advanced_execution_mode:
Changer le mode par défaut d'exécution de noeuds dans YACS
Pour mettre en oeuvre ces "*observer*" de manière efficace, on se reportera aux
:ref:`section_ref_observers_requirements`.
+.. _section_advanced_logging:
+
Obtenir plus d'information lors du déroulement d'un calcul
----------------------------------------------------------
"*multi*" pour le lancement du schéma, pour permettre une exécution
véritablement parallèle.
+.. _subsection_new_adao_version:
+
Passer d'une version d'ADAO à une nouvelle
------------------------------------------
for ename in ("Observer",):
self.__adaoObject[ename] = []
self.__StoredInputs[ename] = []
+ self.__StoredInputs["Name"] = self.__name
+ self.__StoredInputs["Directory"] = self.__directory
#
# Récupère le chemin du répertoire parent et l'ajoute au path
# (Cela complète l'action de la classe PathManagement dans PlatformInfo,
"""
def __init__(self, __addpath = None):
# Chemin pour l'installation (ordre important)
+ self.__msg = ""
+ self.__path_settings_ok = False
+ #----------------
if "EFICAS_ROOT" in os.environ:
__EFICAS_ROOT = os.environ["EFICAS_ROOT"]
__path_ok = True
else:
- print("\nKeyError:\n"+\
+ self.__msg += "\nKeyError:\n"+\
" the required environment variable EFICAS_ROOT is unknown.\n"+\
- " You have either to be in SALOME environment, or to set this\n"+\
- " variable in your environment to the right path \"<...>\" to find\n"+\
- " an installed EFICAS application. For example:\n"+\
- " EFICAS_ROOT=\"<...>\" %s"%__file__
- )
+ " You have either to be in SALOME environment, or to set\n"+\
+ " this variable in your environment to the right path \"<...>\"\n"+\
+ " to find an installed EFICAS application. For example:\n"+\
+ " EFICAS_ROOT=\"<...>\" command\n"
__path_ok = False
try:
import adao
- __path_ok = True
+ __path_ok = True and __path_ok
except ImportError:
- print("\nImportError:\n"+\
+ self.__msg += "\nImportError:\n"+\
" the required ADAO library can not be found to be imported.\n"+\
" You have either to be in ADAO environment, or to be in SALOME\n"+\
" environment, or to set manually in your Python 3 environment the\n"+\
" right path \"<...>\" to find an installed ADAO application. For\n"+\
" example:\n"+\
- " PYTHONPATH=\"<...>:${PYTHONPATH}\" %s"%__file__
- )
+ " PYTHONPATH=\"<...>:${PYTHONPATH}\" command\n"
__path_ok = False
try:
import PyQt5
- __path_ok = True
+ __path_ok = True and __path_ok
except ImportError:
- print("\nImportError:\n"+\
+ self.__msg += "\nImportError:\n"+\
" the required PyQt5 library can not be found to be imported.\n"+\
" You have either to have a raisonable up-to-date Python 3\n"+\
- " installation (less than 5 years), or to be in SALOME environment."
- )
+ " installation (less than 5 years), or to be in SALOME environment.\n"
__path_ok = False
+ #----------------
if not __path_ok:
- print("\nWarning:\n"+\
- " It seems you have some troubles with your installation. It may\n"+\
- " exists other errors that are not explained as above, like some\n"+\
- " incomplete or obsolete Python 3 and module installation.\n"+\
+ self.__msg += "\nWarning:\n"+\
+ " It seems you have some troubles with your installation.\n"+\
+ " Be aware that some other errors may exist, that are not\n"+\
+ " explained as above, like some incomplete or obsolete\n"+\
+ " Python 3, or incomplete module installation.\n"+\
" \n"+\
" Please correct the above error(s) before launching the\n"+\
- " standalone EFICAS/ADAO interface \"%s\"\n"%__file__
- )
- sys.exit(2)
+ " standalone EFICAS/ADAO interface.\n"
+ logging.debug("Some of the ADAO/EFICAS/QT5 paths have not been found")
+ self.__path_settings_ok = False
else:
logging.debug("All the ADAO/EFICAS/QT5 paths have been found")
- sys.path.insert(0,__EFICAS_ROOT)
- sys.path.insert(0,os.path.join(adao.adao_py_dir,"daEficas"))
- if __addpath is not None and os.path.exists(os.path.abspath(__addpath)):
- sys.path.insert(0,os.path.abspath(__addpath))
- logging.debug("All the paths have been correctly set up")
- #
+ self.__path_settings_ok = True
+ #----------------
+ if self.__path_settings_ok:
+ sys.path.insert(0,__EFICAS_ROOT)
+ sys.path.insert(0,os.path.join(adao.adao_py_dir,"daEficas"))
+ if __addpath is not None and os.path.exists(os.path.abspath(__addpath)):
+ sys.path.insert(0,os.path.abspath(__addpath))
+ logging.debug("All the paths have been correctly set up")
+ else:
+ print(self.__msg)
+ logging.debug("Errors in path settings have been found")
+
def gui(self):
- logging.debug("Launching the standalone EFICAS/ADAO interface...")
- from daEficas import prefs
- from InterfaceQT4 import eficas_go
- eficas_go.lanceEficas(code=prefs.code)
+ if self.__path_settings_ok:
+ logging.debug("Launching standalone EFICAS/ADAO interface...")
+ from daEficas import prefs
+ from InterfaceQT4 import eficas_go
+ eficas_go.lanceEficas(code=prefs.code)
+ else:
+ logging.debug("Can not launch standalone EFICAS/ADAO interface for path errors.")
# ==============================================================================
if __name__ == "__main__":
"""
__author__ = "Jean-Philippe ARGAUD"
-import os, numpy, time, copy, types, sys, math, logging
+import os, time, copy, types, sys, logging
+import math, numpy, scipy
from daCore.BasicObjects import Operator
from daCore.PlatformInfo import PlatformInfo
mpr = PlatformInfo().MachinePrecision()