From: PASCALE NOYRET Date: Fri, 15 Dec 2023 16:36:33 +0000 (+0100) Subject: sauvegarde du 14 juillet X-Git-Tag: avantLeRenommagePourEric~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5aae19fee609dd4d70d1cd98ed4600a7b4deb360;p=tools%2Feficas.git sauvegarde du 14 juillet --- 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/CMakeLists.txt deleted file mode 100755 index da7ad195..00000000 --- a/Doc/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (C) 2001-2020 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 - -find_package(Sphinx REQUIRED) - -# configured documentation tools and intermediate build results -set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build") - -# Sphinx cache with pickled ReST documents -set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees") - -# HTML output directory -set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html") - -add_custom_target(EFICAS_NOUVEAUdoc ALL - ${SPHINX_EXECUTABLE} - -q -b html - -d "${SPHINX_CACHE_DIR}" - "${CMAKE_CURRENT_SOURCE_DIR}" - "${SPHINX_HTML_DIR}" - COMMENT "Building HTML documentation with Sphinx") - -INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION ${CMAKE_INSTALL_PREFIX}/Doc/) diff --git a/Doc/Makefile b/Doc/Makefile deleted file mode 100644 index d4a29d88..00000000 --- a/Doc/Makefile +++ /dev/null @@ -1,153 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = _build - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/EFICASdoc.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/EFICASdoc.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/EFICASdoc" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/EFICASdoc" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." diff --git a/Doc/Users/CMakeLists.txt b/Doc/Users/CMakeLists.txt new file mode 100755 index 00000000..da7ad195 --- /dev/null +++ b/Doc/Users/CMakeLists.txt @@ -0,0 +1,38 @@ +# Copyright (C) 2001-2020 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 + +find_package(Sphinx REQUIRED) + +# configured documentation tools and intermediate build results +set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build") + +# Sphinx cache with pickled ReST documents +set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees") + +# HTML output directory +set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html") + +add_custom_target(EFICAS_NOUVEAUdoc ALL + ${SPHINX_EXECUTABLE} + -q -b html + -d "${SPHINX_CACHE_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}" + "${SPHINX_HTML_DIR}" + COMMENT "Building HTML documentation with Sphinx") + +INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION ${CMAKE_INSTALL_PREFIX}/Doc/) diff --git a/Doc/Users/Makefile b/Doc/Users/Makefile new file mode 100644 index 00000000..d4a29d88 --- /dev/null +++ b/Doc/Users/Makefile @@ -0,0 +1,153 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/EFICASdoc.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/EFICASdoc.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/EFICASdoc" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/EFICASdoc" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/Doc/Users/ajouter_une_commande.rst b/Doc/Users/ajouter_une_commande.rst new file mode 100644 index 00000000..d33ee01a --- /dev/null +++ b/Doc/Users/ajouter_une_commande.rst @@ -0,0 +1,88 @@ +Add a command +============= + +Eficas allows you to create or edit a dataset. Remember it is always possible to save (or read) invalid datasets. +Building dataset consists of adding new commands, entering parameter values and if necessary naming concepts. +see : :ref:`concept-label`. +| +Eficas provides two different widgets : first one allows you to manage commands, second one to enter values for each command. +You can navigate between widgets using arrows or pushbutton. + +.. image:: images/CommandeBouton.png + :align: right + +Command widget shows up at file creation (if the new file is created empty ) or when clicking on : + + + + + + + + + + + + + + +Enter commands +--------------- + +Eficas main widget provided two distinct areas: The left side always contains the dataset explorer as a tree view. The right widget contains all commands the user is allowed to select. +If a dataset consists of a single command, tree view area is not displayed. + +.. image:: images/ChoixCommande.png + :align: center + +| + +To have command's **documentation** (if available), **simple-click** on the command. + +.. image:: images/Documentation1.png + :align: center + +| + + +To **add** the command **click twice.** The new command is added after the current command (highlighted in the tree view). In case of impossibility, a message is displayed. + +.. image:: images/Ordre.png + :align: center + +| + + + +If the dataset must comply with building :ref:`rules-label`, a specific icon appears in the command widget. + +.. image:: images/Regles.png + :align: center + +| + + +The user also can choose the way the commands are sorted, either by alphabetical order, either by fonctionnalities. +Last type of sorting commands is called 'by modelisation' that is to say logical order to prepare data for the code. + +.. image:: images/Groupes.png + :align: center + +| + + +The content filtering system is very simple : only commands containing the expression are shown. + +.. image:: images/FiltreCommande.png + :align: center + +| + + + +The user can use "Find", which is a filter widget to find a concept or command position in the dataset. The pushbutton "next/suivant" shows the next matching concept/command. + +.. image:: images/FindConcept.png + :align: center + + diff --git a/Doc/Users/color_chart.rst b/Doc/Users/color_chart.rst new file mode 100644 index 00000000..74b5eef4 --- /dev/null +++ b/Doc/Users/color_chart.rst @@ -0,0 +1,24 @@ +Color chart +=========== + +a very simple colors chart helps the user to know if a item is valid or not : + +* In the Dataset tree view + + - green square : valid objects (Dataset, Command, Concept ...) + - red square : unvalid objects + - **yellow square** : valid **Concept** the user must name + - green diamond : valid group keywords + - red diamond : unvalid group keywords + - green circle : valid keywords + - red circle : unvalid keywords + +* In the input data form widget + - green circle : valid keywords or unvalid objects + - red circle : unvalid keywords or unvalid objects + +* In the rules part + + - red is for unobserved rules + - black is for observed rules + diff --git a/Doc/Users/commentaires_parametres.rst b/Doc/Users/commentaires_parametres.rst new file mode 100644 index 00000000..65928bc3 --- /dev/null +++ b/Doc/Users/commentaires_parametres.rst @@ -0,0 +1,46 @@ +Parameters and comments +======================== + +Parameters +----------- +The users can define parameters. As parameters, Eficas accepts : + +- Real +- String +- Integer +- List + +A parameter's definition can use existing parameters such as : +eps=sqrt((((W / NX) ** 2) + ((H / NY) ** 2))) + +right-click menus on tree items allows you to add a parameter. + +.. image:: images/Parametres.png + :align: center + + +Pushing on "Parametres" Pushbutton opens a dialog containing all already existing parameters. You can define as many parameters as needed +at once. + +.. image:: images/Parametres1.png + :align: center + + +to use a parameter, just type its name. + +.. image:: images/Parametres2.png + :align: center + + +Comments +--------- + +Comments may refer to : + +- user annotation. In this case, background label is white. +- generated comment. In this case, background label is light grey. + + +.. image:: images/Commentaire.png + :align: center + diff --git a/Doc/Users/conf.py b/Doc/Users/conf.py new file mode 100644 index 00000000..819c52a2 --- /dev/null +++ b/Doc/Users/conf.py @@ -0,0 +1,139 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2001-2020 EDF R&D +# +# This file is part of SALOME EFICAS module +# +# 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 +# +# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D + +import sys, os, time, sphinx, logging + +# -- Module version information -------------------------------------------------- + +if "module_version" not in locals(): + module_version = lambda : None + module_version.name = "EFICAS_NOUVEAU" + module_version.year = "%s"%(time.localtime()[0],) + module_version.version = "" + logging.warning('Using fallback "module_version" because none was found') + +# -- Project information ------------------------------------------------------- + +project = u'%s'%module_version.name +author = u'Pascale NOYRET' +copyright = u'2001-%s, EDF R&D, %s'%(module_version.year,author) +version = '%s'%module_version.version +release = '%s'%module_version.version +doctitle = u"%s documentation"%module_version.name +docfull = u"Editeur de FIchier de Commandes et Analyseur Sémantique" + +# -- General configuration ----------------------------------------------------- + +from distutils.version import LooseVersion #, StrictVersion +__lv = LooseVersion(sphinx.__version__) +if __lv < LooseVersion("1.4.0"): + extensions = ['sphinx.ext.pngmath'] +else: + extensions = ['sphinx.ext.imgmath'] +try: + import sphinx_rtd_theme + extensions += ['sphinx_rtd_theme'] + use_rtd_theme = True + logging.debug('Using "sphinx_rtd_theme" that was found') +except: + use_rtd_theme = False + logging.debug('Not using "sphinx_rtd_theme" because none was found') +# +source_suffix = '.rst' +source_encoding = 'utf-8' +master_doc = 'index' +language = 'en' +exclude_patterns = [ + '_build', + 'Thumbs.db', + '.DS_Store', + ] +pygments_style = None +templates_path = ['_templates'] + +# -- Options for HTML output --------------------------------------------------- + +if use_rtd_theme: + html_theme = "sphinx_rtd_theme" +else: + html_theme = 'default' if __lv < LooseVersion("1.3.0") else 'classic' +# +html_title = doctitle +html_static_path = ['_static'] +html_show_sourcelink = False +html_search_language = language + +# -- Options for HTMLHelp output ----------------------------------------------- + +htmlhelp_basename = module_version.name+'doc' + +# -- Options for LaTeX output -------------------------------------------------- + +latex_elements = { + 'papersize': 'a4paper', + 'pointsize': '10pt', + 'figure_align': 'htbp', +} +latex_documents = [ + ('index', '%s.tex'%module_version.name, doctitle, + author, 'manual'), +] + +# -- Options for manual page output -------------------------------------------- + +man_pages = [ + (master_doc, '%s'%module_version.name, doctitle, + [author], 1) +] + +# -- Options for Texinfo output ------------------------------------------------ + +texinfo_documents = [ + (master_doc, '%s'%module_version.name, doctitle, + author, '%s'%module_version.name, docfull, + 'Miscellaneous'), +] + +# -- Options for Epub output --------------------------------------------------- + +epub_title = doctitle +epub_author = author +epub_publisher = author +epub_copyright = copyright +epub_exclude_files = ['search.html'] + +# -- Options for PDF output ---------------------------------------------------- + +pdf_documents = [( + 'contents', + u'%s'%module_version.name, + u'%s'%module_version.name, + author, + dict(pdf_compressed = True), +),] +pdf_stylesheets = ['sphinx','kerning','a4'] +pdf_compressed = True +pdf_inline_footnotes = True + +# -- Extension configuration --------------------------------------------------- diff --git a/Doc/Users/eficas_icons.rst b/Doc/Users/eficas_icons.rst new file mode 100644 index 00000000..8766460d --- /dev/null +++ b/Doc/Users/eficas_icons.rst @@ -0,0 +1,28 @@ +.. _icons-label: + +======================= +Using icons in Eficas +======================= + +Icons +----- + +Icons are used because they are presumed to save time, but all actions can be accessed from menus. +Eficas use a small set of icons. Hopefully, users are familiar with. However, all icons are labelled. + + +.. image:: images/Icons.png + :align: center + + + + +Shortcuts +--------- + +Eficas keybord shortcuts require the user to press a sequence of keys. +These sequences contain 'Ctrl' for common shortcuts as "Ctrl+C", Alt for accessing action of menu, and 'Shift' for specific actions. Note that 'Shift D' allows expanding/collapsing items + + + + diff --git a/Doc/Users/eficas_in_salome.rst b/Doc/Users/eficas_in_salome.rst new file mode 100644 index 00000000..6dbe7da1 --- /dev/null +++ b/Doc/Users/eficas_in_salome.rst @@ -0,0 +1,40 @@ +.. _salome-label: + +Eficas in Salome (For Aster) +============================ + +Launching Eficas in Salome +--------------------------- +First activate Eficas module + +.. image:: images/LctDsSalome.png + :align: center + + +Use Eficas. When a file is saved, Eficas will create an associated entry in the object browser. +It is possible to use the file in other modules (see appropriate module's documentation). + +.. image:: images/ArbreSalome.png + :align: center + +Structural Element +------------------- + +Eficas is able to create "structural element" in GEOM or in SMESH in order to +validate data. + +- Create your geometry + +.. image:: images/SalomePylone.png + :align: center + +- Create your Eficas dataseat, and define for example a beam , with AFFE-CARA-ELEM. + +- Click on "View3D". Eficas shows you the result in GEOM and creates "beams" . + Be aware : these "structural elements" are not "geometry elements". You can't use it. + It's also possible to verify normals orientation. + +.. image:: images/SalomePyloneSE.png + :align: center + + diff --git a/Doc/Users/eficas_notions.rst b/Doc/Users/eficas_notions.rst new file mode 100644 index 00000000..ec2e75af --- /dev/null +++ b/Doc/Users/eficas_notions.rst @@ -0,0 +1,67 @@ +.. _concept-label: + +Eficas Concepts +================ + +Commands in the Data Set (or JDC Jeu De Commandes ) +--------------------------------------------------- + +A dataset is made of a collection of commands. Each command have parameters (keywords). They can return concept or not: + +* Command not returning concept : they are described as "PROC" in catalogs. + + - example: + - DEBUT() is a proc. + - for ASTER, it initializes memory and files. + +* Command returning a concept : + The concept has a specific type (defined in the catalog) and a name (given by the user). These commandes are described as "OPER" in catalogs. + + - example : + - MONMAIL=LIRE_MAILLAGE(UNITE=20); + - This line creates a new concept MONMAIL of type "maillage", which can be re-used as entry for another keyword. + + When an object is valid, the user has to named it. In tree view, a yellow square shows valid objects that have to be nammed. + +Commands are composed of keywords, or groups of keywords. These items are associated according to rules or conditions. +They are described in the catalog. + + +Keywords +--------- + +* Group of keywords (mot-clef facteur ) + + This is a list of keywords which jointly have a meaning for the code. + It is composed of group of keywords and simple keywords. + Some are mandatory, repeatable. + This list can depend on conditionnal rules. + + +* Simple keyword (mot-clef simple) . + + This is a parameter. It also can be mandatory or not. + It has attributes. + + +Attributes of a keyword +--------------------------- + +a parameter (simple keyword or "mot-clef simple") has : + +- a type : real, string, complex, integer, matrix, file (existing or allready existing), directory or a concept class which is defined in the catalog. +- a cardinality. + +a parameter (simple keyword or "mot-clef simple") should have : + +- a default value +- a short documentation +- a long documentation +- an interval of values +- a set of discrete values + + +Input data panel depends on both these attributes. Eficas ensures that data are valid. It forces the user to enter a list if needed, it verifies the input type. It displays only possible values. + + + diff --git a/Doc/Users/eficas_presentation.rst b/Doc/Users/eficas_presentation.rst new file mode 100644 index 00000000..45357f53 --- /dev/null +++ b/Doc/Users/eficas_presentation.rst @@ -0,0 +1,26 @@ +What's Eficas +============== + +Name's origin +------------- +Eficas is the acronym of ' **E**\ diteur de **FI**\ chier de **C**\ ommandes et **A**\ nalyseur **S**\ émantique'. +That means that Eficas allows users to write a parameter file for a code. +It handles with syntax and semantic. +It avoids misuse of commands which are not allowed in a given context. +It insures integrity of the file. + +General Behaviour +------------------ +* Catalogs + +Eficas can be used by multiple codes and handles with multiple versions of each code. It is customized with files named "Catalogs (or Catalogues)" : It contains all commands for a code. Each command has a name and parameters which are defined by developpers. + + +* Outputs + +Eficas's output is a commands file (dataset file or Jeux De Données) ".comm". It may be able to produce various file formats such as .xml, .py or specific format. However, you always must have a '.comm" output: this is the only format Eficas is able to reread. + +Both commands Files and Catalogs are python file. So you have to remind some +:ref:`python-label` + + diff --git a/Doc/Users/eficas_rules.rst b/Doc/Users/eficas_rules.rst new file mode 100644 index 00000000..63c71df8 --- /dev/null +++ b/Doc/Users/eficas_rules.rst @@ -0,0 +1,119 @@ +.. _rules-label: + +=============================== +Eficas rules +=============================== + +All the rules can be combinated, creating more complicated rules. + +AU_MOINS_UN +----------- + + AU_MOINS_UN rule obliges the user to create at least one concept of the list. More than one can be created. + +- Example + + Keyword POUTRE in OPER AFFE_CARA_ELEM contains the rule : + + regles=(AU_MOINS_UN( + 'POUTRE','COQUE','DISCRET','CABLE','BARRE','MASSIF','ASSE_GRIL','GRILLE'),) + +- That means if AFFE_CARA_ELEM is used in the JDC, the user must select one at least of the Keyword between POUTRE, COQUE, DISCRET, CABLE, BARRE, MASSIF, ASSE_GRIL, GRILLE : + + * If the user doesn't select any of these keywords, AFFE_CARA_ELEM is unvalid. + * If he selects POUTRE, AFFE_CARA_ELEM is valid. + * If he selects both POUTRE and DISCRET, AFFE_CARA_ELEM is valid. + + +UN_PARMI +-------- + + AU_MOINS_UN rule obliges the user to create one and only one concept of the list. + +- Example + + Oper AFFE_CHAR_MECA contains the rules : + + regles=(UN_PARMI('VECT_Y','ANGL_VRIL'), + +- That means if AFFE_CHAR_MECA is used in the JDC, the user must select VECT_Y or ANGL_VRIL. + + * If the user doesn't select any of these keywords, DEFI_GROUP is unvalid. + * If he selects only VECT_Y, DEFI_GROUP is valid. + * Eficas will not proposed the keyword ANGL_VRIL if VECT_Y already exists. + + +EXCLUS +-------- + + EXCLUS means that, if one of the keyword is created, the other won't be allowed. + + - Example : + DEFI_SQUELETTE contains the rules : + + EXCLUS('SOUS_STRUC','SECTEUR') + +- That means if DEFI_SQUELETTE is used in the JDC + + * If the user doesn't select any of these keywords, DEFI_SQUELETTE is valid. + * If he selects only SOUS_STRUC, DEFI_SQUELETTE is valid. + * If he selects only SECTEUR, DEFI_SQUELETTE is valid. + * Eficas will not proposed the keyword SECTEUR if SOUS_STRUC already exists. + +ENSEMBLE +-------- + + the rule means that if one keyword is selected, the others have to be also. + the keywords order is not meaningful. + +- Example + + GRILLE in AFFE_CARA_ELEM, contains : + + ENSEMBLE('ORIG_AXE','AXE') + +- That means if GRILLE is used in the JDC + + * If the user doesn't select any of these keywords, GRILLE is valid. + * If he selects only ORIG_AXE, GRILLE is invalid. + * If he selects both ORIG_AXE and AXE, GRILLE is valid. + +PRESENT_PRESENT +--------------- + + the rule means that if the FIRST keyword is selected, the others have to be also. + +- Example + + MACRO_MISS_3D contains the rule + + PRESENT_PRESENT('FREQ_MIN','FREQ_MAX','FREQ_PAS') + +- That means if MACRO_MISS_3D is used in the JDC + + * If the user doesn't select any of these keywords, GRILLE is valid. + * If he selects only FREQ_MAX, GRILLE is valid. + * If he selects only FREQ_PAS, GRILLE is valid. + * If he selects only FREQ_MIN, GRILLE is invalid. + * If he selects both FREQ_MIN, FREQ_MAX and FREQ_PAS, GRILLE is valid. + + +PRESENT_ABSENT +--------------- + + the rule means that if the FIRST keyword is selected, the others aren't allowed. + +- Example + FORCE_COQUE in AFFE_CHAR_MECA contains + + regles=( PRESENT_ABSENT('FX','PRES','F1','F2','F3','MF1','MF2'), + +- That means if FORCE_COQUE is used in the JDC + + * If the user doesn't select any of these keywords, FORCE_COQUE is valid. + * If he selects only FX, FORCE_COQUE is valid. + * If he selects both PRES and F1, FORCE_COQUE is valid. + + + + diff --git a/Doc/Users/images/ArbreSalome.png b/Doc/Users/images/ArbreSalome.png new file mode 100644 index 00000000..f9819f07 Binary files /dev/null and b/Doc/Users/images/ArbreSalome.png differ diff --git a/Doc/Users/images/ChoixCata.png b/Doc/Users/images/ChoixCata.png new file mode 100644 index 00000000..adc17bf4 Binary files /dev/null and b/Doc/Users/images/ChoixCata.png differ diff --git a/Doc/Users/images/ChoixCode.png b/Doc/Users/images/ChoixCode.png new file mode 100644 index 00000000..0f265322 Binary files /dev/null and b/Doc/Users/images/ChoixCode.png differ diff --git a/Doc/Users/images/ChoixCommande.png b/Doc/Users/images/ChoixCommande.png new file mode 100644 index 00000000..737ee735 Binary files /dev/null and b/Doc/Users/images/ChoixCommande.png differ diff --git a/Doc/Users/images/CommandeBouton.png b/Doc/Users/images/CommandeBouton.png new file mode 100644 index 00000000..990f8831 Binary files /dev/null and b/Doc/Users/images/CommandeBouton.png differ diff --git a/Doc/Users/images/Commentaire.png b/Doc/Users/images/Commentaire.png new file mode 100644 index 00000000..22dc4e99 Binary files /dev/null and b/Doc/Users/images/Commentaire.png differ diff --git a/Doc/Users/images/DataMenu.png b/Doc/Users/images/DataMenu.png new file mode 100644 index 00000000..5376bd40 Binary files /dev/null and b/Doc/Users/images/DataMenu.png differ diff --git a/Doc/Users/images/DblClickOnOptional.png b/Doc/Users/images/DblClickOnOptional.png new file mode 100644 index 00000000..333d79fc Binary files /dev/null and b/Doc/Users/images/DblClickOnOptional.png differ diff --git a/Doc/Users/images/Documentation1.png b/Doc/Users/images/Documentation1.png new file mode 100644 index 00000000..f332d959 Binary files /dev/null and b/Doc/Users/images/Documentation1.png differ diff --git a/Doc/Users/images/DoubleFleche.png b/Doc/Users/images/DoubleFleche.png new file mode 100644 index 00000000..7834570e Binary files /dev/null and b/Doc/Users/images/DoubleFleche.png differ diff --git a/Doc/Users/images/Duplication.png b/Doc/Users/images/Duplication.png new file mode 100644 index 00000000..ca22d72d Binary files /dev/null and b/Doc/Users/images/Duplication.png differ diff --git a/Doc/Users/images/Erreur.png b/Doc/Users/images/Erreur.png new file mode 100644 index 00000000..8be418e1 Binary files /dev/null and b/Doc/Users/images/Erreur.png differ diff --git a/Doc/Users/images/FichiersEtRepertoires.png b/Doc/Users/images/FichiersEtRepertoires.png new file mode 100644 index 00000000..5f38cf95 Binary files /dev/null and b/Doc/Users/images/FichiersEtRepertoires.png differ diff --git a/Doc/Users/images/FiltreCommande.png b/Doc/Users/images/FiltreCommande.png new file mode 100644 index 00000000..6ebf78c1 Binary files /dev/null and b/Doc/Users/images/FiltreCommande.png differ diff --git a/Doc/Users/images/FindConcept.png b/Doc/Users/images/FindConcept.png new file mode 100644 index 00000000..d2d55ec7 Binary files /dev/null and b/Doc/Users/images/FindConcept.png differ diff --git a/Doc/Users/images/GererFichiers.png b/Doc/Users/images/GererFichiers.png new file mode 100644 index 00000000..3434e230 Binary files /dev/null and b/Doc/Users/images/GererFichiers.png differ diff --git a/Doc/Users/images/GererMCS.png b/Doc/Users/images/GererMCS.png new file mode 100644 index 00000000..67a72591 Binary files /dev/null and b/Doc/Users/images/GererMCS.png differ diff --git a/Doc/Users/images/Groupes.png b/Doc/Users/images/Groupes.png new file mode 100644 index 00000000..9abcf80d Binary files /dev/null and b/Doc/Users/images/Groupes.png differ diff --git a/Doc/Users/images/Icons.png b/Doc/Users/images/Icons.png new file mode 100644 index 00000000..f6582e62 Binary files /dev/null and b/Doc/Users/images/Icons.png differ diff --git a/Doc/Users/images/Import.png b/Doc/Users/images/Import.png new file mode 100644 index 00000000..2b932552 Binary files /dev/null and b/Doc/Users/images/Import.png differ diff --git a/Doc/Users/images/LctDsSalome.png b/Doc/Users/images/LctDsSalome.png new file mode 100644 index 00000000..59057700 Binary files /dev/null and b/Doc/Users/images/LctDsSalome.png differ diff --git a/Doc/Users/images/ListeEtTuple.png b/Doc/Users/images/ListeEtTuple.png new file mode 100644 index 00000000..807771dd Binary files /dev/null and b/Doc/Users/images/ListeEtTuple.png differ diff --git a/Doc/Users/images/Main.png b/Doc/Users/images/Main.png new file mode 100644 index 00000000..003ca74b Binary files /dev/null and b/Doc/Users/images/Main.png differ diff --git a/Doc/Users/images/Matrice.png b/Doc/Users/images/Matrice.png new file mode 100644 index 00000000..0d2ec7a3 Binary files /dev/null and b/Doc/Users/images/Matrice.png differ diff --git a/Doc/Users/images/Menus.png b/Doc/Users/images/Menus.png new file mode 100644 index 00000000..d19eff3c Binary files /dev/null and b/Doc/Users/images/Menus.png differ diff --git a/Doc/Users/images/Multi.png b/Doc/Users/images/Multi.png new file mode 100644 index 00000000..0c500fbd Binary files /dev/null and b/Doc/Users/images/Multi.png differ diff --git a/Doc/Users/images/NomPython.png b/Doc/Users/images/NomPython.png new file mode 100644 index 00000000..d24e6f0a Binary files /dev/null and b/Doc/Users/images/NomPython.png differ diff --git a/Doc/Users/images/NommerObjet.png b/Doc/Users/images/NommerObjet.png new file mode 100644 index 00000000..5bb63fe8 Binary files /dev/null and b/Doc/Users/images/NommerObjet.png differ diff --git a/Doc/Users/images/Nouveau.png b/Doc/Users/images/Nouveau.png new file mode 100644 index 00000000..0ef1e48a Binary files /dev/null and b/Doc/Users/images/Nouveau.png differ diff --git a/Doc/Users/images/OptionnelCommande.png b/Doc/Users/images/OptionnelCommande.png new file mode 100644 index 00000000..e76a567f Binary files /dev/null and b/Doc/Users/images/OptionnelCommande.png differ diff --git a/Doc/Users/images/OptionnelCommande1.png b/Doc/Users/images/OptionnelCommande1.png new file mode 100644 index 00000000..a6395998 Binary files /dev/null and b/Doc/Users/images/OptionnelCommande1.png differ diff --git a/Doc/Users/images/OptionnelParametersAdao.png b/Doc/Users/images/OptionnelParametersAdao.png new file mode 100644 index 00000000..e04ffc03 Binary files /dev/null and b/Doc/Users/images/OptionnelParametersAdao.png differ diff --git a/Doc/Users/images/OptionnelParametersAdao1.png b/Doc/Users/images/OptionnelParametersAdao1.png new file mode 100644 index 00000000..e6dfc05a Binary files /dev/null and b/Doc/Users/images/OptionnelParametersAdao1.png differ diff --git a/Doc/Users/images/Ordre.png b/Doc/Users/images/Ordre.png new file mode 100644 index 00000000..6c1c4252 Binary files /dev/null and b/Doc/Users/images/Ordre.png differ diff --git a/Doc/Users/images/Ouvrir.png b/Doc/Users/images/Ouvrir.png new file mode 100644 index 00000000..1ad549ec Binary files /dev/null and b/Doc/Users/images/Ouvrir.png differ diff --git a/Doc/Users/images/Parametres.png b/Doc/Users/images/Parametres.png new file mode 100644 index 00000000..185fed8a Binary files /dev/null and b/Doc/Users/images/Parametres.png differ diff --git a/Doc/Users/images/Parametres1.png b/Doc/Users/images/Parametres1.png new file mode 100644 index 00000000..6c9029d9 Binary files /dev/null and b/Doc/Users/images/Parametres1.png differ diff --git a/Doc/Users/images/Parametres2.png b/Doc/Users/images/Parametres2.png new file mode 100644 index 00000000..7561fcb4 Binary files /dev/null and b/Doc/Users/images/Parametres2.png differ diff --git a/Doc/Users/images/Poubelle.png b/Doc/Users/images/Poubelle.png new file mode 100644 index 00000000..26cd6cc4 Binary files /dev/null and b/Doc/Users/images/Poubelle.png differ diff --git a/Doc/Users/images/Recents.png b/Doc/Users/images/Recents.png new file mode 100644 index 00000000..09365701 Binary files /dev/null and b/Doc/Users/images/Recents.png differ diff --git a/Doc/Users/images/Regles.png b/Doc/Users/images/Regles.png new file mode 100644 index 00000000..508f0109 Binary files /dev/null and b/Doc/Users/images/Regles.png differ diff --git a/Doc/Users/images/Roue.png b/Doc/Users/images/Roue.png new file mode 100644 index 00000000..bcabda6d Binary files /dev/null and b/Doc/Users/images/Roue.png differ diff --git a/Doc/Users/images/Run.png b/Doc/Users/images/Run.png new file mode 100644 index 00000000..d4ce89ae Binary files /dev/null and b/Doc/Users/images/Run.png differ diff --git a/Doc/Users/images/SalomePylone.png b/Doc/Users/images/SalomePylone.png new file mode 100644 index 00000000..3aff78cd Binary files /dev/null and b/Doc/Users/images/SalomePylone.png differ diff --git a/Doc/Users/images/SalomePyloneSE.png b/Doc/Users/images/SalomePyloneSE.png new file mode 100644 index 00000000..1be99b77 Binary files /dev/null and b/Doc/Users/images/SalomePyloneSE.png differ diff --git a/Doc/Users/images/Scripts.png b/Doc/Users/images/Scripts.png new file mode 100644 index 00000000..e49a2b56 Binary files /dev/null and b/Doc/Users/images/Scripts.png differ diff --git a/Doc/Users/images/SelectAllInList.png b/Doc/Users/images/SelectAllInList.png new file mode 100644 index 00000000..2bd91a57 Binary files /dev/null and b/Doc/Users/images/SelectAllInList.png differ diff --git a/Doc/Users/images/ShowAllValues.png b/Doc/Users/images/ShowAllValues.png new file mode 100644 index 00000000..b9ca58e9 Binary files /dev/null and b/Doc/Users/images/ShowAllValues.png differ diff --git a/Doc/Users/images/TPXO.png b/Doc/Users/images/TPXO.png new file mode 100644 index 00000000..fbc67540 Binary files /dev/null and b/Doc/Users/images/TPXO.png differ diff --git a/Doc/Users/images/ToolTipOnButton.png b/Doc/Users/images/ToolTipOnButton.png new file mode 100644 index 00000000..1861b2d3 Binary files /dev/null and b/Doc/Users/images/ToolTipOnButton.png differ diff --git a/Doc/Users/images/ToolTipOnLabel.png b/Doc/Users/images/ToolTipOnLabel.png new file mode 100644 index 00000000..2e369c6d Binary files /dev/null and b/Doc/Users/images/ToolTipOnLabel.png differ diff --git a/Doc/Users/images/ToolTipOnLineEdit.png b/Doc/Users/images/ToolTipOnLineEdit.png new file mode 100644 index 00000000..c2ab10d8 Binary files /dev/null and b/Doc/Users/images/ToolTipOnLineEdit.png differ diff --git a/Doc/Users/images/ToolTipOnRed.png b/Doc/Users/images/ToolTipOnRed.png new file mode 100644 index 00000000..441d51c3 Binary files /dev/null and b/Doc/Users/images/ToolTipOnRed.png differ diff --git a/Doc/Users/images/Zero.png b/Doc/Users/images/Zero.png new file mode 100644 index 00000000..96381c7b Binary files /dev/null and b/Doc/Users/images/Zero.png differ diff --git a/Doc/Users/index.rst b/Doc/Users/index.rst new file mode 100644 index 00000000..d67712ea --- /dev/null +++ b/Doc/Users/index.rst @@ -0,0 +1,35 @@ +.. EFICAS documentation master file, created by sphinx-quickstart on Wed Sep 14 11:40:32 2011. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to EFICAS's documentation! +================================== + +This documentation covers the usage of Eficas as data setting tool. +This is intended for end users who want to use Eficas and not for developpers who want to write a catalog. + +The usage of Eficas for a particular code is not described in this guide. Refer to +code documentation to know how to use Eficas more specifically. + +Contents: + +.. toctree:: + :maxdepth: 1 + + eficas_presentation + lancer_eficas + nouveau_JDC + ajouter_une_commande + parametrer_une_commande + color_chart + commentaires_parametres + eficas_icons + widgetInDetails + eficas_notions + eficas_rules + python_rules + eficas_in_salome + + + + diff --git a/Doc/Users/lancer_eficas.rst b/Doc/Users/lancer_eficas.rst new file mode 100644 index 00000000..1eab8dd7 --- /dev/null +++ b/Doc/Users/lancer_eficas.rst @@ -0,0 +1,33 @@ +Running Eficas +============== + +In Eficas, many common commands can be invoked via menus, toolbar buttons as well as keyboard shortcuts. +As in many GUI, a menu widget can be either a pull-down menu or a standalone context menu. Pull-down menus are shown by the menu bar when the user clicks on the respective item or presses the specified shortcut key. Context menus are usually invoked by some special keyboard key or by right-clicking. +Eficas allows you to write (and reread) an unvalid file. At any time, you can save your works. + + +- Eficas is mainly available in Salome, and often from code's modules (for example for Aster or Adao). Otherwise, see how to launch : :ref:`salome-label`. +- To run Eficas standalone, use command line : python Code/qtEficas_Code. +- On Windows, use .bat to run Eficas. + +*If Eficas is installed on your machine only for one specific code and one specific version of this code, skeep the two next steps.* + + + +Choose a Code ... +------------------ + +Unless you have started Eficas for a specific code, Eficas will ask you to choose the code you want to work with, +each time you click on "Nouveau/New" or "Ouvrir/Open" in the "Fichier/File" menu. + +.. image:: images/ChoixCode.png + :align: center + +and a version of the Code +---------------------------- + +if many catalogs (ie many versions ) are available, Eficas will ask you to select one. + +.. image:: images/ChoixCata.png + :align: center + diff --git a/Doc/Users/nouveau_JDC.rst b/Doc/Users/nouveau_JDC.rst new file mode 100644 index 00000000..cc2dc9f9 --- /dev/null +++ b/Doc/Users/nouveau_JDC.rst @@ -0,0 +1,79 @@ +First step +=========== + +Build a new dataset. +--------------------- +Launch Eficas and choose "Nouveau/New" in "File" menu. + +.. image:: images/Nouveau.png + :align: center + +For some codes (Telemac or PSEN), simulation dataset are pre-filled with mandatory keywords. Users complete the dataset with values +and add new commands if needed. In this case, the window that allows to :ref:`form-label` appears. + + +Open an existing dataset. +--------------------------- +Launch Eficas and choose "Open/Ouvrir" in "File" menu. It shows up a file Open/Save dialog window. + +.. image:: images/Ouvrir.png + :align: center + +Open a "Recently Used" dataset. +-------------------------------- +To open a document that you recently used, click "File" , point to "Recently Opened", and then click the item that you want to open. + +.. image:: images/Recents.png + :align: center + +To clear the contents of the list, click 'Delete' item. + + +Data/Jdc Menu. +---------------- + +.. image:: images/DataMenu.png + :align: center + +- Why is dataset unvalid? + Click on Validation Report item. + +- "Rules for dataset" displays the rules you have to respect when building a dataset + + +- "Source File" item allows to check the source file. + +- "Result File" item allows to check the .comm result. + It allows you to save the dataset in a file (for Adao Study for example) + +- "Comment" item add a comment at the beginning of the dataset. + +- "Parameters" allows you to manage parameters for the dataset. + +Open Multiple dataset. +---------------------- + +You can open multiple datasets. Each file is associated with a different page and is shown by clicking on its tab. + +.. image:: images/Multi.png + :align: center + + +Open twice the same dataset. +---------------------------- +You can open twice the same dataset (in order to create a copy and rename it). Eficas warns you : + +.. image:: images/Duplication.png + :align: center + +In case of duplication, Eficas does not assure coherency between the two copies. + + +The dataset is valid. +--------------------- +Once the dataset is valid, you can lauch your code (in particulary PSEN, Carmel). Use 'run' icon +or choose "Run" in the menubar. + +.. image:: images/Run.png + :align: center + diff --git a/Doc/Users/parametrer_une_commande.rst b/Doc/Users/parametrer_une_commande.rst new file mode 100644 index 00000000..d4368876 --- /dev/null +++ b/Doc/Users/parametrer_une_commande.rst @@ -0,0 +1,171 @@ +.. _form-label: + +=============== +Edit a command +=============== + +Each command has to be setted up. Eficas generates a data entry form. +This form varies dynamicaly, depending on the context : rules and already existing values. + +This widget appears by selecting (clicking) on a command (first level in the tree view). + +.. image:: images/DoubleFleche.png + :align: right + +You can navigate from command to command using the arrows buttons: + + +The command widget +-------------------- + +this widget is divided vertically into three separate areas : + - the tree view, + - the form widget + - the optional keywords. + +When needed, views provide scrollbar so that the entire information can be viewed. + +A bottom widget provides a horizontal bar for presenting documentation as the status bar is used to display error or warning messages. + +.. image:: images/Main.png + :align: center + +| +| + +Edit values +------------- + +Eficas uses many different widgets in order to help you to choose values : + +- Line editors for simple values +- Entry lists widgets +- Popup lists +- Group boxes of button + +see :ref:`features-label` to know more about each widget. + + +.. image:: images/Erreur.png + :align: center +Eficas does not let you enter invalid values. It checks the type and the cardinality of the value. +It ensures that the value is in the value domain or proposes a set of discrete values. +Data entered is checked against a set of rules. Errors are displayed in red to draw attention. + + +Form construction is dynamic +---------------------------- + +The form is updated according to values. It asks for the field depending on what's selected. + +In the example below: + +- if value of 'Initial_Conditions' is 'Zero Elevation', no additional data is needed + +.. image:: images/Zero.png + :align: center + +- if value of 'Initial_Conditions' is 'TPXO satellite altimetry', you have to fill 'Ascii_Database_For_Tide' + +.. image:: images/TPXO.png + :align: center + +Displaying optional keyword +------------------------------ + +When you create a new command, the widget opens with the optional keywords of this command. + +.. image:: images/OptionnelCommande.png + :align: center + +When entering in a "group keyword", the optional keywords list is updated to show optional keyword for this specific "group keyword". + +.. image:: images/OptionnelCommande1.png + :align: center + + +By clicking on command label ("INITIALIZATION") or on keyword label ("Input_files"), the corresponding optional keywords list is displayed. + +Sometimes, when a user enters a value for a keyword, optional keywords are dependents on this value. Optional keywords list is updated. +This is the case for conditionnal keywords + +.. image:: images/OptionnelParametersAdao.png + :align: center + + +.. image:: images/OptionnelParametersAdao1.png + :align: center + +Adding/Deleting an optional keyword +------------------------------------ + +Optional keywords (if any) are in the right part of the "command window". Just double-click on the checkbox to add the keyword. +The input data form is redisplayed and the list of possible optional keywords will be updated (for example, if two keywords cannot be simultaneously present). + +.. image:: images/DblClickOnOptional.png + :align: center + +.. image:: images/Poubelle.png + :align: right +To delete a keyword (or a command), just click the garbage icon : + +| +Naming Concepts +--------------- + +The icon for a command may be one of three colors: green, yellow or red. These colors represent the status of the command and the color meanings is : + - red for unvalid command, + - green for valid command, + - yellow for commands which have to be named. + +.. image:: images/NommerObjet.png + :align: center + +Tooltips +-------- + +**Use tooltips to have information.** + +- Tooltips on **labels** display **information about the keyword**. Double-click on the label to display this information in the comment area, at the bottom of the window. This is useful for long text. *(You also can double-click on the keyword in the tree dataset.)* + +.. image:: images/ToolTipOnLabel.png + :align: center + +- Tooltips on **lineEdit** (one-line text editor) display **suggestion** for the input value. Suggestion are not very frequent. They are not default values, because you have to enter it explicitely. + +.. image:: images/ToolTipOnLineEdit.png + :align: center + +- Tooltips on **Red point** display **information about the validity** for the keyword or for the group of keywords. +By double-clicking on the "red point" a window displaying the same information appears. It should be usefull if text +is too long to be read at one sitting. + +.. image:: images/ToolTipOnRed.png + :align: center + +- Tooltips on **Commands Button** explain what the icon/button represents, and which action is activated by clicking. + +.. image:: images/ToolTipOnButton.png + :align: center + + +Context Menus +-------------- +In the dataset tree, context menus (invoked by right-clicking) allow user to : + +- create comments in the tree +- create parameter +- comment the command itself +- delete the node + +.. image:: images/Menus.png + :align: center + +Some commands have associated scripts. They are easy to identify because the "run" icon is present : + +.. image:: images/Roue.png + :align: right + + +.. image:: images/Scripts.png + :align: center diff --git a/Doc/Users/python_rules.rst b/Doc/Users/python_rules.rst new file mode 100644 index 00000000..19a8ee34 --- /dev/null +++ b/Doc/Users/python_rules.rst @@ -0,0 +1,39 @@ +.. _python-label: + +=============================== +rules for python syntax +=============================== + +Variable names and identifiers are similar to those in many other languages : +---------------------------------------------------------------------------- + +* They start with a letter (A_Z or a-z) or underscore "_"". +* They are followed by letters, numbers or underscores. +* They are case-sensitive. +* A string is a sequence of caracters enclosed by a matching pair of single or double quotes. + +Eficas does not allow you to use uncorrect names : + +.. image:: images/NomPython.png + +Some identifiers are reserved words : +------------------------------------- + +* You can't use words of the python language as identifiers. +* Eficas itself uses identifiers which become reserved words. For example, you can't use the following words, even if it would make some interesting names: + - BLOC, EXCLUS, OPER, ASSD, + - EVAL, FACT, FORM, JDC, + - REGLE, VALIDATOR, + - ETAPE, ENTITE + +Python's way for assigning values to variables: +------------------------------------------------- + +* Keep in mind that ".comm" are python files. The simplest form of assignement is : variable = value +* The hash character (#) starts a comment +* Tuples are enclosed in parentheses. +* Lists are enclosed in bracked. +* In tuples or lists, a ',' follows each item especially the last one. + +.. image:: images/ListeEtTuple.png + diff --git a/Doc/Users/widgetInDetails.rst b/Doc/Users/widgetInDetails.rst new file mode 100644 index 00000000..ae4dbe1f --- /dev/null +++ b/Doc/Users/widgetInDetails.rst @@ -0,0 +1,70 @@ +.. _features-label: + +======================== +Some Widgets Features +======================== + +File or Directory +----------------- + ++-------------------------------------+--------------------------------------------------+ +| a File parameter has to be : | if catalog's description is : | ++=====================================+==================================================+ +|an existing file | type='Fichier' | ++-------------------------------------+--------------------------------------------------+ +|a directory | type='Repertoire' | ++-------------------------------------+--------------------------------------------------+ +|an existing file with specific suffix| type='Fichier','JDC Files (*.comm);;All Files (*)| ++-------------------------------------+--------------------------------------------------+ +|a non-allready existing file | type=('Fichier',"",'Sauvegarde'), | ++-------------------------------------+--------------------------------------------------+ +|a simple string | type='FichierNoAbs' | ++-------------------------------------+--------------------------------------------------+ + +The following widget allows users to enter a directory (first) or a file. Magnifier icon is not avalaible when a directory is required. + +.. image:: images/FichiersEtRepertoires.png + +- to open a file explorer, click on the corresponding icon. If a file suffix is required, content of the directory is filtered before being shown in the dialog, using a semicolon-separated list of filters specified. + +- to view file content, click on magnifier icon. It uses xdg-open, which is a desktop-independent tool for opening files (according to suffix convention). + + +List +----- +List widgets have a toolbar down, under values area. + +.. image:: images/ShowAllValues.png + +- Use the Up or Down arrows to move the selection in the list +- Use the Plus (or Minus) icon to add (delete) a new line +- Use the magnifier icon to see all the values in a modal widget + +| + +If lists are not ordered, it is possible to select all values by clicking the button on the right. + +.. image:: images/SelectAllInList.png + + + +Import data from file +----------------------- + +Data import icon provide access to data from ASCII text files. +Select the character that separates values in your text file and values you want to import. + +.. image:: images/Import.png + :align: center + + +Matrix +------- +Sometimes, matrix dimensions depend on the number of others parameters (for example, correlation matrix). +If a new variable is entered or if the name changes, matrix becomes invalid. +Users have to redisplay the header by pushing the refresh icon. + +.. image:: images/Matrice.png + + + diff --git a/Doc/ajouter_une_commande.rst b/Doc/ajouter_une_commande.rst deleted file mode 100644 index d33ee01a..00000000 --- a/Doc/ajouter_une_commande.rst +++ /dev/null @@ -1,88 +0,0 @@ -Add a command -============= - -Eficas allows you to create or edit a dataset. Remember it is always possible to save (or read) invalid datasets. -Building dataset consists of adding new commands, entering parameter values and if necessary naming concepts. -see : :ref:`concept-label`. -| -Eficas provides two different widgets : first one allows you to manage commands, second one to enter values for each command. -You can navigate between widgets using arrows or pushbutton. - -.. image:: images/CommandeBouton.png - :align: right - -Command widget shows up at file creation (if the new file is created empty ) or when clicking on : - - - - - - - - - - - - - - -Enter commands ---------------- - -Eficas main widget provided two distinct areas: The left side always contains the dataset explorer as a tree view. The right widget contains all commands the user is allowed to select. -If a dataset consists of a single command, tree view area is not displayed. - -.. image:: images/ChoixCommande.png - :align: center - -| - -To have command's **documentation** (if available), **simple-click** on the command. - -.. image:: images/Documentation1.png - :align: center - -| - - -To **add** the command **click twice.** The new command is added after the current command (highlighted in the tree view). In case of impossibility, a message is displayed. - -.. image:: images/Ordre.png - :align: center - -| - - - -If the dataset must comply with building :ref:`rules-label`, a specific icon appears in the command widget. - -.. image:: images/Regles.png - :align: center - -| - - -The user also can choose the way the commands are sorted, either by alphabetical order, either by fonctionnalities. -Last type of sorting commands is called 'by modelisation' that is to say logical order to prepare data for the code. - -.. image:: images/Groupes.png - :align: center - -| - - -The content filtering system is very simple : only commands containing the expression are shown. - -.. image:: images/FiltreCommande.png - :align: center - -| - - - -The user can use "Find", which is a filter widget to find a concept or command position in the dataset. The pushbutton "next/suivant" shows the next matching concept/command. - -.. image:: images/FindConcept.png - :align: center - - diff --git a/Doc/color_chart.rst b/Doc/color_chart.rst deleted file mode 100644 index 74b5eef4..00000000 --- a/Doc/color_chart.rst +++ /dev/null @@ -1,24 +0,0 @@ -Color chart -=========== - -a very simple colors chart helps the user to know if a item is valid or not : - -* In the Dataset tree view - - - green square : valid objects (Dataset, Command, Concept ...) - - red square : unvalid objects - - **yellow square** : valid **Concept** the user must name - - green diamond : valid group keywords - - red diamond : unvalid group keywords - - green circle : valid keywords - - red circle : unvalid keywords - -* In the input data form widget - - green circle : valid keywords or unvalid objects - - red circle : unvalid keywords or unvalid objects - -* In the rules part - - - red is for unobserved rules - - black is for observed rules - diff --git a/Doc/commentaires_parametres.rst b/Doc/commentaires_parametres.rst deleted file mode 100644 index 65928bc3..00000000 --- a/Doc/commentaires_parametres.rst +++ /dev/null @@ -1,46 +0,0 @@ -Parameters and comments -======================== - -Parameters ------------ -The users can define parameters. As parameters, Eficas accepts : - -- Real -- String -- Integer -- List - -A parameter's definition can use existing parameters such as : -eps=sqrt((((W / NX) ** 2) + ((H / NY) ** 2))) - -right-click menus on tree items allows you to add a parameter. - -.. image:: images/Parametres.png - :align: center - - -Pushing on "Parametres" Pushbutton opens a dialog containing all already existing parameters. You can define as many parameters as needed -at once. - -.. image:: images/Parametres1.png - :align: center - - -to use a parameter, just type its name. - -.. image:: images/Parametres2.png - :align: center - - -Comments ---------- - -Comments may refer to : - -- user annotation. In this case, background label is white. -- generated comment. In this case, background label is light grey. - - -.. image:: images/Commentaire.png - :align: center - diff --git a/Doc/conf.py b/Doc/conf.py deleted file mode 100644 index 819c52a2..00000000 --- a/Doc/conf.py +++ /dev/null @@ -1,139 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2001-2020 EDF R&D -# -# This file is part of SALOME EFICAS module -# -# 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 -# -# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D - -import sys, os, time, sphinx, logging - -# -- Module version information -------------------------------------------------- - -if "module_version" not in locals(): - module_version = lambda : None - module_version.name = "EFICAS_NOUVEAU" - module_version.year = "%s"%(time.localtime()[0],) - module_version.version = "" - logging.warning('Using fallback "module_version" because none was found') - -# -- Project information ------------------------------------------------------- - -project = u'%s'%module_version.name -author = u'Pascale NOYRET' -copyright = u'2001-%s, EDF R&D, %s'%(module_version.year,author) -version = '%s'%module_version.version -release = '%s'%module_version.version -doctitle = u"%s documentation"%module_version.name -docfull = u"Editeur de FIchier de Commandes et Analyseur Sémantique" - -# -- General configuration ----------------------------------------------------- - -from distutils.version import LooseVersion #, StrictVersion -__lv = LooseVersion(sphinx.__version__) -if __lv < LooseVersion("1.4.0"): - extensions = ['sphinx.ext.pngmath'] -else: - extensions = ['sphinx.ext.imgmath'] -try: - import sphinx_rtd_theme - extensions += ['sphinx_rtd_theme'] - use_rtd_theme = True - logging.debug('Using "sphinx_rtd_theme" that was found') -except: - use_rtd_theme = False - logging.debug('Not using "sphinx_rtd_theme" because none was found') -# -source_suffix = '.rst' -source_encoding = 'utf-8' -master_doc = 'index' -language = 'en' -exclude_patterns = [ - '_build', - 'Thumbs.db', - '.DS_Store', - ] -pygments_style = None -templates_path = ['_templates'] - -# -- Options for HTML output --------------------------------------------------- - -if use_rtd_theme: - html_theme = "sphinx_rtd_theme" -else: - html_theme = 'default' if __lv < LooseVersion("1.3.0") else 'classic' -# -html_title = doctitle -html_static_path = ['_static'] -html_show_sourcelink = False -html_search_language = language - -# -- Options for HTMLHelp output ----------------------------------------------- - -htmlhelp_basename = module_version.name+'doc' - -# -- Options for LaTeX output -------------------------------------------------- - -latex_elements = { - 'papersize': 'a4paper', - 'pointsize': '10pt', - 'figure_align': 'htbp', -} -latex_documents = [ - ('index', '%s.tex'%module_version.name, doctitle, - author, 'manual'), -] - -# -- Options for manual page output -------------------------------------------- - -man_pages = [ - (master_doc, '%s'%module_version.name, doctitle, - [author], 1) -] - -# -- Options for Texinfo output ------------------------------------------------ - -texinfo_documents = [ - (master_doc, '%s'%module_version.name, doctitle, - author, '%s'%module_version.name, docfull, - 'Miscellaneous'), -] - -# -- Options for Epub output --------------------------------------------------- - -epub_title = doctitle -epub_author = author -epub_publisher = author -epub_copyright = copyright -epub_exclude_files = ['search.html'] - -# -- Options for PDF output ---------------------------------------------------- - -pdf_documents = [( - 'contents', - u'%s'%module_version.name, - u'%s'%module_version.name, - author, - dict(pdf_compressed = True), -),] -pdf_stylesheets = ['sphinx','kerning','a4'] -pdf_compressed = True -pdf_inline_footnotes = True - -# -- Extension configuration --------------------------------------------------- diff --git a/Doc/eficas_icons.rst b/Doc/eficas_icons.rst deleted file mode 100644 index 8766460d..00000000 --- a/Doc/eficas_icons.rst +++ /dev/null @@ -1,28 +0,0 @@ -.. _icons-label: - -======================= -Using icons in Eficas -======================= - -Icons ------ - -Icons are used because they are presumed to save time, but all actions can be accessed from menus. -Eficas use a small set of icons. Hopefully, users are familiar with. However, all icons are labelled. - - -.. image:: images/Icons.png - :align: center - - - - -Shortcuts ---------- - -Eficas keybord shortcuts require the user to press a sequence of keys. -These sequences contain 'Ctrl' for common shortcuts as "Ctrl+C", Alt for accessing action of menu, and 'Shift' for specific actions. Note that 'Shift D' allows expanding/collapsing items - - - - diff --git a/Doc/eficas_in_salome.rst b/Doc/eficas_in_salome.rst deleted file mode 100644 index 6dbe7da1..00000000 --- a/Doc/eficas_in_salome.rst +++ /dev/null @@ -1,40 +0,0 @@ -.. _salome-label: - -Eficas in Salome (For Aster) -============================ - -Launching Eficas in Salome ---------------------------- -First activate Eficas module - -.. image:: images/LctDsSalome.png - :align: center - - -Use Eficas. When a file is saved, Eficas will create an associated entry in the object browser. -It is possible to use the file in other modules (see appropriate module's documentation). - -.. image:: images/ArbreSalome.png - :align: center - -Structural Element -------------------- - -Eficas is able to create "structural element" in GEOM or in SMESH in order to -validate data. - -- Create your geometry - -.. image:: images/SalomePylone.png - :align: center - -- Create your Eficas dataseat, and define for example a beam , with AFFE-CARA-ELEM. - -- Click on "View3D". Eficas shows you the result in GEOM and creates "beams" . - Be aware : these "structural elements" are not "geometry elements". You can't use it. - It's also possible to verify normals orientation. - -.. image:: images/SalomePyloneSE.png - :align: center - - diff --git a/Doc/eficas_notions.rst b/Doc/eficas_notions.rst deleted file mode 100644 index ec2e75af..00000000 --- a/Doc/eficas_notions.rst +++ /dev/null @@ -1,67 +0,0 @@ -.. _concept-label: - -Eficas Concepts -================ - -Commands in the Data Set (or JDC Jeu De Commandes ) ---------------------------------------------------- - -A dataset is made of a collection of commands. Each command have parameters (keywords). They can return concept or not: - -* Command not returning concept : they are described as "PROC" in catalogs. - - - example: - - DEBUT() is a proc. - - for ASTER, it initializes memory and files. - -* Command returning a concept : - The concept has a specific type (defined in the catalog) and a name (given by the user). These commandes are described as "OPER" in catalogs. - - - example : - - MONMAIL=LIRE_MAILLAGE(UNITE=20); - - This line creates a new concept MONMAIL of type "maillage", which can be re-used as entry for another keyword. - - When an object is valid, the user has to named it. In tree view, a yellow square shows valid objects that have to be nammed. - -Commands are composed of keywords, or groups of keywords. These items are associated according to rules or conditions. -They are described in the catalog. - - -Keywords ---------- - -* Group of keywords (mot-clef facteur ) - - This is a list of keywords which jointly have a meaning for the code. - It is composed of group of keywords and simple keywords. - Some are mandatory, repeatable. - This list can depend on conditionnal rules. - - -* Simple keyword (mot-clef simple) . - - This is a parameter. It also can be mandatory or not. - It has attributes. - - -Attributes of a keyword ---------------------------- - -a parameter (simple keyword or "mot-clef simple") has : - -- a type : real, string, complex, integer, matrix, file (existing or allready existing), directory or a concept class which is defined in the catalog. -- a cardinality. - -a parameter (simple keyword or "mot-clef simple") should have : - -- a default value -- a short documentation -- a long documentation -- an interval of values -- a set of discrete values - - -Input data panel depends on both these attributes. Eficas ensures that data are valid. It forces the user to enter a list if needed, it verifies the input type. It displays only possible values. - - - diff --git a/Doc/eficas_presentation.rst b/Doc/eficas_presentation.rst deleted file mode 100644 index 45357f53..00000000 --- a/Doc/eficas_presentation.rst +++ /dev/null @@ -1,26 +0,0 @@ -What's Eficas -============== - -Name's origin -------------- -Eficas is the acronym of ' **E**\ diteur de **FI**\ chier de **C**\ ommandes et **A**\ nalyseur **S**\ émantique'. -That means that Eficas allows users to write a parameter file for a code. -It handles with syntax and semantic. -It avoids misuse of commands which are not allowed in a given context. -It insures integrity of the file. - -General Behaviour ------------------- -* Catalogs - -Eficas can be used by multiple codes and handles with multiple versions of each code. It is customized with files named "Catalogs (or Catalogues)" : It contains all commands for a code. Each command has a name and parameters which are defined by developpers. - - -* Outputs - -Eficas's output is a commands file (dataset file or Jeux De Données) ".comm". It may be able to produce various file formats such as .xml, .py or specific format. However, you always must have a '.comm" output: this is the only format Eficas is able to reread. - -Both commands Files and Catalogs are python file. So you have to remind some -:ref:`python-label` - - diff --git a/Doc/eficas_rules.rst b/Doc/eficas_rules.rst deleted file mode 100644 index 63c71df8..00000000 --- a/Doc/eficas_rules.rst +++ /dev/null @@ -1,119 +0,0 @@ -.. _rules-label: - -=============================== -Eficas rules -=============================== - -All the rules can be combinated, creating more complicated rules. - -AU_MOINS_UN ------------ - - AU_MOINS_UN rule obliges the user to create at least one concept of the list. More than one can be created. - -- Example - - Keyword POUTRE in OPER AFFE_CARA_ELEM contains the rule : - - regles=(AU_MOINS_UN( - 'POUTRE','COQUE','DISCRET','CABLE','BARRE','MASSIF','ASSE_GRIL','GRILLE'),) - -- That means if AFFE_CARA_ELEM is used in the JDC, the user must select one at least of the Keyword between POUTRE, COQUE, DISCRET, CABLE, BARRE, MASSIF, ASSE_GRIL, GRILLE : - - * If the user doesn't select any of these keywords, AFFE_CARA_ELEM is unvalid. - * If he selects POUTRE, AFFE_CARA_ELEM is valid. - * If he selects both POUTRE and DISCRET, AFFE_CARA_ELEM is valid. - - -UN_PARMI --------- - - AU_MOINS_UN rule obliges the user to create one and only one concept of the list. - -- Example - - Oper AFFE_CHAR_MECA contains the rules : - - regles=(UN_PARMI('VECT_Y','ANGL_VRIL'), - -- That means if AFFE_CHAR_MECA is used in the JDC, the user must select VECT_Y or ANGL_VRIL. - - * If the user doesn't select any of these keywords, DEFI_GROUP is unvalid. - * If he selects only VECT_Y, DEFI_GROUP is valid. - * Eficas will not proposed the keyword ANGL_VRIL if VECT_Y already exists. - - -EXCLUS --------- - - EXCLUS means that, if one of the keyword is created, the other won't be allowed. - - - Example : - DEFI_SQUELETTE contains the rules : - - EXCLUS('SOUS_STRUC','SECTEUR') - -- That means if DEFI_SQUELETTE is used in the JDC - - * If the user doesn't select any of these keywords, DEFI_SQUELETTE is valid. - * If he selects only SOUS_STRUC, DEFI_SQUELETTE is valid. - * If he selects only SECTEUR, DEFI_SQUELETTE is valid. - * Eficas will not proposed the keyword SECTEUR if SOUS_STRUC already exists. - -ENSEMBLE --------- - - the rule means that if one keyword is selected, the others have to be also. - the keywords order is not meaningful. - -- Example - - GRILLE in AFFE_CARA_ELEM, contains : - - ENSEMBLE('ORIG_AXE','AXE') - -- That means if GRILLE is used in the JDC - - * If the user doesn't select any of these keywords, GRILLE is valid. - * If he selects only ORIG_AXE, GRILLE is invalid. - * If he selects both ORIG_AXE and AXE, GRILLE is valid. - -PRESENT_PRESENT ---------------- - - the rule means that if the FIRST keyword is selected, the others have to be also. - -- Example - - MACRO_MISS_3D contains the rule - - PRESENT_PRESENT('FREQ_MIN','FREQ_MAX','FREQ_PAS') - -- That means if MACRO_MISS_3D is used in the JDC - - * If the user doesn't select any of these keywords, GRILLE is valid. - * If he selects only FREQ_MAX, GRILLE is valid. - * If he selects only FREQ_PAS, GRILLE is valid. - * If he selects only FREQ_MIN, GRILLE is invalid. - * If he selects both FREQ_MIN, FREQ_MAX and FREQ_PAS, GRILLE is valid. - - -PRESENT_ABSENT ---------------- - - the rule means that if the FIRST keyword is selected, the others aren't allowed. - -- Example - FORCE_COQUE in AFFE_CHAR_MECA contains - - regles=( PRESENT_ABSENT('FX','PRES','F1','F2','F3','MF1','MF2'), - -- That means if FORCE_COQUE is used in the JDC - - * If the user doesn't select any of these keywords, FORCE_COQUE is valid. - * If he selects only FX, FORCE_COQUE is valid. - * If he selects both PRES and F1, FORCE_COQUE is valid. - - - - diff --git a/Doc/images/ArbreSalome.png b/Doc/images/ArbreSalome.png deleted file mode 100644 index f9819f07..00000000 Binary files a/Doc/images/ArbreSalome.png and /dev/null differ diff --git a/Doc/images/ChoixCata.png b/Doc/images/ChoixCata.png deleted file mode 100644 index adc17bf4..00000000 Binary files a/Doc/images/ChoixCata.png and /dev/null differ diff --git a/Doc/images/ChoixCode.png b/Doc/images/ChoixCode.png deleted file mode 100644 index 0f265322..00000000 Binary files a/Doc/images/ChoixCode.png and /dev/null differ diff --git a/Doc/images/ChoixCommande.png b/Doc/images/ChoixCommande.png deleted file mode 100644 index 737ee735..00000000 Binary files a/Doc/images/ChoixCommande.png and /dev/null differ diff --git a/Doc/images/CommandeBouton.png b/Doc/images/CommandeBouton.png deleted file mode 100644 index 990f8831..00000000 Binary files a/Doc/images/CommandeBouton.png and /dev/null differ diff --git a/Doc/images/Commentaire.png b/Doc/images/Commentaire.png deleted file mode 100644 index 22dc4e99..00000000 Binary files a/Doc/images/Commentaire.png and /dev/null differ diff --git a/Doc/images/DataMenu.png b/Doc/images/DataMenu.png deleted file mode 100644 index 5376bd40..00000000 Binary files a/Doc/images/DataMenu.png and /dev/null differ diff --git a/Doc/images/DblClickOnOptional.png b/Doc/images/DblClickOnOptional.png deleted file mode 100644 index 333d79fc..00000000 Binary files a/Doc/images/DblClickOnOptional.png and /dev/null differ diff --git a/Doc/images/Documentation1.png b/Doc/images/Documentation1.png deleted file mode 100644 index f332d959..00000000 Binary files a/Doc/images/Documentation1.png and /dev/null differ diff --git a/Doc/images/DoubleFleche.png b/Doc/images/DoubleFleche.png deleted file mode 100644 index 7834570e..00000000 Binary files a/Doc/images/DoubleFleche.png and /dev/null differ diff --git a/Doc/images/Duplication.png b/Doc/images/Duplication.png deleted file mode 100644 index ca22d72d..00000000 Binary files a/Doc/images/Duplication.png and /dev/null differ diff --git a/Doc/images/Erreur.png b/Doc/images/Erreur.png deleted file mode 100644 index 8be418e1..00000000 Binary files a/Doc/images/Erreur.png and /dev/null differ diff --git a/Doc/images/FichiersEtRepertoires.png b/Doc/images/FichiersEtRepertoires.png deleted file mode 100644 index 5f38cf95..00000000 Binary files a/Doc/images/FichiersEtRepertoires.png and /dev/null differ diff --git a/Doc/images/FiltreCommande.png b/Doc/images/FiltreCommande.png deleted file mode 100644 index 6ebf78c1..00000000 Binary files a/Doc/images/FiltreCommande.png and /dev/null differ diff --git a/Doc/images/FindConcept.png b/Doc/images/FindConcept.png deleted file mode 100644 index d2d55ec7..00000000 Binary files a/Doc/images/FindConcept.png and /dev/null differ diff --git a/Doc/images/GererFichiers.png b/Doc/images/GererFichiers.png deleted file mode 100644 index 3434e230..00000000 Binary files a/Doc/images/GererFichiers.png and /dev/null differ diff --git a/Doc/images/GererMCS.png b/Doc/images/GererMCS.png deleted file mode 100644 index 67a72591..00000000 Binary files a/Doc/images/GererMCS.png and /dev/null differ diff --git a/Doc/images/Groupes.png b/Doc/images/Groupes.png deleted file mode 100644 index 9abcf80d..00000000 Binary files a/Doc/images/Groupes.png and /dev/null differ diff --git a/Doc/images/Icons.png b/Doc/images/Icons.png deleted file mode 100644 index f6582e62..00000000 Binary files a/Doc/images/Icons.png and /dev/null differ diff --git a/Doc/images/Import.png b/Doc/images/Import.png deleted file mode 100644 index 2b932552..00000000 Binary files a/Doc/images/Import.png and /dev/null differ diff --git a/Doc/images/LctDsSalome.png b/Doc/images/LctDsSalome.png deleted file mode 100644 index 59057700..00000000 Binary files a/Doc/images/LctDsSalome.png and /dev/null differ diff --git a/Doc/images/ListeEtTuple.png b/Doc/images/ListeEtTuple.png deleted file mode 100644 index 807771dd..00000000 Binary files a/Doc/images/ListeEtTuple.png and /dev/null differ diff --git a/Doc/images/Main.png b/Doc/images/Main.png deleted file mode 100644 index 003ca74b..00000000 Binary files a/Doc/images/Main.png and /dev/null differ diff --git a/Doc/images/Matrice.png b/Doc/images/Matrice.png deleted file mode 100644 index 0d2ec7a3..00000000 Binary files a/Doc/images/Matrice.png and /dev/null differ diff --git a/Doc/images/Menus.png b/Doc/images/Menus.png deleted file mode 100644 index d19eff3c..00000000 Binary files a/Doc/images/Menus.png and /dev/null differ diff --git a/Doc/images/Multi.png b/Doc/images/Multi.png deleted file mode 100644 index 0c500fbd..00000000 Binary files a/Doc/images/Multi.png and /dev/null differ diff --git a/Doc/images/NomPython.png b/Doc/images/NomPython.png deleted file mode 100644 index d24e6f0a..00000000 Binary files a/Doc/images/NomPython.png and /dev/null differ diff --git a/Doc/images/NommerObjet.png b/Doc/images/NommerObjet.png deleted file mode 100644 index 5bb63fe8..00000000 Binary files a/Doc/images/NommerObjet.png and /dev/null differ diff --git a/Doc/images/Nouveau.png b/Doc/images/Nouveau.png deleted file mode 100644 index 0ef1e48a..00000000 Binary files a/Doc/images/Nouveau.png and /dev/null differ diff --git a/Doc/images/OptionnelCommande.png b/Doc/images/OptionnelCommande.png deleted file mode 100644 index e76a567f..00000000 Binary files a/Doc/images/OptionnelCommande.png and /dev/null differ diff --git a/Doc/images/OptionnelCommande1.png b/Doc/images/OptionnelCommande1.png deleted file mode 100644 index a6395998..00000000 Binary files a/Doc/images/OptionnelCommande1.png and /dev/null differ diff --git a/Doc/images/OptionnelParametersAdao.png b/Doc/images/OptionnelParametersAdao.png deleted file mode 100644 index e04ffc03..00000000 Binary files a/Doc/images/OptionnelParametersAdao.png and /dev/null differ diff --git a/Doc/images/OptionnelParametersAdao1.png b/Doc/images/OptionnelParametersAdao1.png deleted file mode 100644 index e6dfc05a..00000000 Binary files a/Doc/images/OptionnelParametersAdao1.png and /dev/null differ diff --git a/Doc/images/Ordre.png b/Doc/images/Ordre.png deleted file mode 100644 index 6c1c4252..00000000 Binary files a/Doc/images/Ordre.png and /dev/null differ diff --git a/Doc/images/Ouvrir.png b/Doc/images/Ouvrir.png deleted file mode 100644 index 1ad549ec..00000000 Binary files a/Doc/images/Ouvrir.png and /dev/null differ diff --git a/Doc/images/Parametres.png b/Doc/images/Parametres.png deleted file mode 100644 index 185fed8a..00000000 Binary files a/Doc/images/Parametres.png and /dev/null differ diff --git a/Doc/images/Parametres1.png b/Doc/images/Parametres1.png deleted file mode 100644 index 6c9029d9..00000000 Binary files a/Doc/images/Parametres1.png and /dev/null differ diff --git a/Doc/images/Parametres2.png b/Doc/images/Parametres2.png deleted file mode 100644 index 7561fcb4..00000000 Binary files a/Doc/images/Parametres2.png and /dev/null differ diff --git a/Doc/images/Poubelle.png b/Doc/images/Poubelle.png deleted file mode 100644 index 26cd6cc4..00000000 Binary files a/Doc/images/Poubelle.png and /dev/null differ diff --git a/Doc/images/Recents.png b/Doc/images/Recents.png deleted file mode 100644 index 09365701..00000000 Binary files a/Doc/images/Recents.png and /dev/null differ diff --git a/Doc/images/Regles.png b/Doc/images/Regles.png deleted file mode 100644 index 508f0109..00000000 Binary files a/Doc/images/Regles.png and /dev/null differ diff --git a/Doc/images/Roue.png b/Doc/images/Roue.png deleted file mode 100644 index bcabda6d..00000000 Binary files a/Doc/images/Roue.png and /dev/null differ diff --git a/Doc/images/Run.png b/Doc/images/Run.png deleted file mode 100644 index d4ce89ae..00000000 Binary files a/Doc/images/Run.png and /dev/null differ diff --git a/Doc/images/SalomePylone.png b/Doc/images/SalomePylone.png deleted file mode 100644 index 3aff78cd..00000000 Binary files a/Doc/images/SalomePylone.png and /dev/null differ diff --git a/Doc/images/SalomePyloneSE.png b/Doc/images/SalomePyloneSE.png deleted file mode 100644 index 1be99b77..00000000 Binary files a/Doc/images/SalomePyloneSE.png and /dev/null differ diff --git a/Doc/images/Scripts.png b/Doc/images/Scripts.png deleted file mode 100644 index e49a2b56..00000000 Binary files a/Doc/images/Scripts.png and /dev/null differ diff --git a/Doc/images/SelectAllInList.png b/Doc/images/SelectAllInList.png deleted file mode 100644 index 2bd91a57..00000000 Binary files a/Doc/images/SelectAllInList.png and /dev/null differ diff --git a/Doc/images/ShowAllValues.png b/Doc/images/ShowAllValues.png deleted file mode 100644 index b9ca58e9..00000000 Binary files a/Doc/images/ShowAllValues.png and /dev/null differ diff --git a/Doc/images/TPXO.png b/Doc/images/TPXO.png deleted file mode 100644 index fbc67540..00000000 Binary files a/Doc/images/TPXO.png and /dev/null differ diff --git a/Doc/images/ToolTipOnButton.png b/Doc/images/ToolTipOnButton.png deleted file mode 100644 index 1861b2d3..00000000 Binary files a/Doc/images/ToolTipOnButton.png and /dev/null differ diff --git a/Doc/images/ToolTipOnLabel.png b/Doc/images/ToolTipOnLabel.png deleted file mode 100644 index 2e369c6d..00000000 Binary files a/Doc/images/ToolTipOnLabel.png and /dev/null differ diff --git a/Doc/images/ToolTipOnLineEdit.png b/Doc/images/ToolTipOnLineEdit.png deleted file mode 100644 index c2ab10d8..00000000 Binary files a/Doc/images/ToolTipOnLineEdit.png and /dev/null differ diff --git a/Doc/images/ToolTipOnRed.png b/Doc/images/ToolTipOnRed.png deleted file mode 100644 index 441d51c3..00000000 Binary files a/Doc/images/ToolTipOnRed.png and /dev/null differ diff --git a/Doc/images/Zero.png b/Doc/images/Zero.png deleted file mode 100644 index 96381c7b..00000000 Binary files a/Doc/images/Zero.png and /dev/null differ diff --git a/Doc/index.rst b/Doc/index.rst deleted file mode 100644 index d67712ea..00000000 --- a/Doc/index.rst +++ /dev/null @@ -1,35 +0,0 @@ -.. EFICAS documentation master file, created by sphinx-quickstart on Wed Sep 14 11:40:32 2011. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to EFICAS's documentation! -================================== - -This documentation covers the usage of Eficas as data setting tool. -This is intended for end users who want to use Eficas and not for developpers who want to write a catalog. - -The usage of Eficas for a particular code is not described in this guide. Refer to -code documentation to know how to use Eficas more specifically. - -Contents: - -.. toctree:: - :maxdepth: 1 - - eficas_presentation - lancer_eficas - nouveau_JDC - ajouter_une_commande - parametrer_une_commande - color_chart - commentaires_parametres - eficas_icons - widgetInDetails - eficas_notions - eficas_rules - python_rules - eficas_in_salome - - - - diff --git a/Doc/lancer_eficas.rst b/Doc/lancer_eficas.rst deleted file mode 100644 index 1eab8dd7..00000000 --- a/Doc/lancer_eficas.rst +++ /dev/null @@ -1,33 +0,0 @@ -Running Eficas -============== - -In Eficas, many common commands can be invoked via menus, toolbar buttons as well as keyboard shortcuts. -As in many GUI, a menu widget can be either a pull-down menu or a standalone context menu. Pull-down menus are shown by the menu bar when the user clicks on the respective item or presses the specified shortcut key. Context menus are usually invoked by some special keyboard key or by right-clicking. -Eficas allows you to write (and reread) an unvalid file. At any time, you can save your works. - - -- Eficas is mainly available in Salome, and often from code's modules (for example for Aster or Adao). Otherwise, see how to launch : :ref:`salome-label`. -- To run Eficas standalone, use command line : python Code/qtEficas_Code. -- On Windows, use .bat to run Eficas. - -*If Eficas is installed on your machine only for one specific code and one specific version of this code, skeep the two next steps.* - - - -Choose a Code ... ------------------- - -Unless you have started Eficas for a specific code, Eficas will ask you to choose the code you want to work with, -each time you click on "Nouveau/New" or "Ouvrir/Open" in the "Fichier/File" menu. - -.. image:: images/ChoixCode.png - :align: center - -and a version of the Code ----------------------------- - -if many catalogs (ie many versions ) are available, Eficas will ask you to select one. - -.. image:: images/ChoixCata.png - :align: center - diff --git a/Doc/nouveau_JDC.rst b/Doc/nouveau_JDC.rst deleted file mode 100644 index cc2dc9f9..00000000 --- a/Doc/nouveau_JDC.rst +++ /dev/null @@ -1,79 +0,0 @@ -First step -=========== - -Build a new dataset. ---------------------- -Launch Eficas and choose "Nouveau/New" in "File" menu. - -.. image:: images/Nouveau.png - :align: center - -For some codes (Telemac or PSEN), simulation dataset are pre-filled with mandatory keywords. Users complete the dataset with values -and add new commands if needed. In this case, the window that allows to :ref:`form-label` appears. - - -Open an existing dataset. ---------------------------- -Launch Eficas and choose "Open/Ouvrir" in "File" menu. It shows up a file Open/Save dialog window. - -.. image:: images/Ouvrir.png - :align: center - -Open a "Recently Used" dataset. --------------------------------- -To open a document that you recently used, click "File" , point to "Recently Opened", and then click the item that you want to open. - -.. image:: images/Recents.png - :align: center - -To clear the contents of the list, click 'Delete' item. - - -Data/Jdc Menu. ----------------- - -.. image:: images/DataMenu.png - :align: center - -- Why is dataset unvalid? - Click on Validation Report item. - -- "Rules for dataset" displays the rules you have to respect when building a dataset - - -- "Source File" item allows to check the source file. - -- "Result File" item allows to check the .comm result. - It allows you to save the dataset in a file (for Adao Study for example) - -- "Comment" item add a comment at the beginning of the dataset. - -- "Parameters" allows you to manage parameters for the dataset. - -Open Multiple dataset. ----------------------- - -You can open multiple datasets. Each file is associated with a different page and is shown by clicking on its tab. - -.. image:: images/Multi.png - :align: center - - -Open twice the same dataset. ----------------------------- -You can open twice the same dataset (in order to create a copy and rename it). Eficas warns you : - -.. image:: images/Duplication.png - :align: center - -In case of duplication, Eficas does not assure coherency between the two copies. - - -The dataset is valid. ---------------------- -Once the dataset is valid, you can lauch your code (in particulary PSEN, Carmel). Use 'run' icon -or choose "Run" in the menubar. - -.. image:: images/Run.png - :align: center - diff --git a/Doc/parametrer_une_commande.rst b/Doc/parametrer_une_commande.rst deleted file mode 100644 index d4368876..00000000 --- a/Doc/parametrer_une_commande.rst +++ /dev/null @@ -1,171 +0,0 @@ -.. _form-label: - -=============== -Edit a command -=============== - -Each command has to be setted up. Eficas generates a data entry form. -This form varies dynamicaly, depending on the context : rules and already existing values. - -This widget appears by selecting (clicking) on a command (first level in the tree view). - -.. image:: images/DoubleFleche.png - :align: right - -You can navigate from command to command using the arrows buttons: - - -The command widget --------------------- - -this widget is divided vertically into three separate areas : - - the tree view, - - the form widget - - the optional keywords. - -When needed, views provide scrollbar so that the entire information can be viewed. - -A bottom widget provides a horizontal bar for presenting documentation as the status bar is used to display error or warning messages. - -.. image:: images/Main.png - :align: center - -| -| - -Edit values -------------- - -Eficas uses many different widgets in order to help you to choose values : - -- Line editors for simple values -- Entry lists widgets -- Popup lists -- Group boxes of button - -see :ref:`features-label` to know more about each widget. - - -.. image:: images/Erreur.png - :align: center -Eficas does not let you enter invalid values. It checks the type and the cardinality of the value. -It ensures that the value is in the value domain or proposes a set of discrete values. -Data entered is checked against a set of rules. Errors are displayed in red to draw attention. - - -Form construction is dynamic ----------------------------- - -The form is updated according to values. It asks for the field depending on what's selected. - -In the example below: - -- if value of 'Initial_Conditions' is 'Zero Elevation', no additional data is needed - -.. image:: images/Zero.png - :align: center - -- if value of 'Initial_Conditions' is 'TPXO satellite altimetry', you have to fill 'Ascii_Database_For_Tide' - -.. image:: images/TPXO.png - :align: center - -Displaying optional keyword ------------------------------- - -When you create a new command, the widget opens with the optional keywords of this command. - -.. image:: images/OptionnelCommande.png - :align: center - -When entering in a "group keyword", the optional keywords list is updated to show optional keyword for this specific "group keyword". - -.. image:: images/OptionnelCommande1.png - :align: center - - -By clicking on command label ("INITIALIZATION") or on keyword label ("Input_files"), the corresponding optional keywords list is displayed. - -Sometimes, when a user enters a value for a keyword, optional keywords are dependents on this value. Optional keywords list is updated. -This is the case for conditionnal keywords - -.. image:: images/OptionnelParametersAdao.png - :align: center - - -.. image:: images/OptionnelParametersAdao1.png - :align: center - -Adding/Deleting an optional keyword ------------------------------------- - -Optional keywords (if any) are in the right part of the "command window". Just double-click on the checkbox to add the keyword. -The input data form is redisplayed and the list of possible optional keywords will be updated (for example, if two keywords cannot be simultaneously present). - -.. image:: images/DblClickOnOptional.png - :align: center - -.. image:: images/Poubelle.png - :align: right -To delete a keyword (or a command), just click the garbage icon : - -| -Naming Concepts ---------------- - -The icon for a command may be one of three colors: green, yellow or red. These colors represent the status of the command and the color meanings is : - - red for unvalid command, - - green for valid command, - - yellow for commands which have to be named. - -.. image:: images/NommerObjet.png - :align: center - -Tooltips --------- - -**Use tooltips to have information.** - -- Tooltips on **labels** display **information about the keyword**. Double-click on the label to display this information in the comment area, at the bottom of the window. This is useful for long text. *(You also can double-click on the keyword in the tree dataset.)* - -.. image:: images/ToolTipOnLabel.png - :align: center - -- Tooltips on **lineEdit** (one-line text editor) display **suggestion** for the input value. Suggestion are not very frequent. They are not default values, because you have to enter it explicitely. - -.. image:: images/ToolTipOnLineEdit.png - :align: center - -- Tooltips on **Red point** display **information about the validity** for the keyword or for the group of keywords. -By double-clicking on the "red point" a window displaying the same information appears. It should be usefull if text -is too long to be read at one sitting. - -.. image:: images/ToolTipOnRed.png - :align: center - -- Tooltips on **Commands Button** explain what the icon/button represents, and which action is activated by clicking. - -.. image:: images/ToolTipOnButton.png - :align: center - - -Context Menus --------------- -In the dataset tree, context menus (invoked by right-clicking) allow user to : - -- create comments in the tree -- create parameter -- comment the command itself -- delete the node - -.. image:: images/Menus.png - :align: center - -Some commands have associated scripts. They are easy to identify because the "run" icon is present : - -.. image:: images/Roue.png - :align: right - - -.. image:: images/Scripts.png - :align: center diff --git a/Doc/python_rules.rst b/Doc/python_rules.rst deleted file mode 100644 index 19a8ee34..00000000 --- a/Doc/python_rules.rst +++ /dev/null @@ -1,39 +0,0 @@ -.. _python-label: - -=============================== -rules for python syntax -=============================== - -Variable names and identifiers are similar to those in many other languages : ----------------------------------------------------------------------------- - -* They start with a letter (A_Z or a-z) or underscore "_"". -* They are followed by letters, numbers or underscores. -* They are case-sensitive. -* A string is a sequence of caracters enclosed by a matching pair of single or double quotes. - -Eficas does not allow you to use uncorrect names : - -.. image:: images/NomPython.png - -Some identifiers are reserved words : -------------------------------------- - -* You can't use words of the python language as identifiers. -* Eficas itself uses identifiers which become reserved words. For example, you can't use the following words, even if it would make some interesting names: - - BLOC, EXCLUS, OPER, ASSD, - - EVAL, FACT, FORM, JDC, - - REGLE, VALIDATOR, - - ETAPE, ENTITE - -Python's way for assigning values to variables: -------------------------------------------------- - -* Keep in mind that ".comm" are python files. The simplest form of assignement is : variable = value -* The hash character (#) starts a comment -* Tuples are enclosed in parentheses. -* Lists are enclosed in bracked. -* In tuples or lists, a ',' follows each item especially the last one. - -.. image:: images/ListeEtTuple.png - diff --git a/Doc/widgetInDetails.rst b/Doc/widgetInDetails.rst deleted file mode 100644 index ae4dbe1f..00000000 --- a/Doc/widgetInDetails.rst +++ /dev/null @@ -1,70 +0,0 @@ -.. _features-label: - -======================== -Some Widgets Features -======================== - -File or Directory ------------------ - -+-------------------------------------+--------------------------------------------------+ -| a File parameter has to be : | if catalog's description is : | -+=====================================+==================================================+ -|an existing file | type='Fichier' | -+-------------------------------------+--------------------------------------------------+ -|a directory | type='Repertoire' | -+-------------------------------------+--------------------------------------------------+ -|an existing file with specific suffix| type='Fichier','JDC Files (*.comm);;All Files (*)| -+-------------------------------------+--------------------------------------------------+ -|a non-allready existing file | type=('Fichier',"",'Sauvegarde'), | -+-------------------------------------+--------------------------------------------------+ -|a simple string | type='FichierNoAbs' | -+-------------------------------------+--------------------------------------------------+ - -The following widget allows users to enter a directory (first) or a file. Magnifier icon is not avalaible when a directory is required. - -.. image:: images/FichiersEtRepertoires.png - -- to open a file explorer, click on the corresponding icon. If a file suffix is required, content of the directory is filtered before being shown in the dialog, using a semicolon-separated list of filters specified. - -- to view file content, click on magnifier icon. It uses xdg-open, which is a desktop-independent tool for opening files (according to suffix convention). - - -List ------ -List widgets have a toolbar down, under values area. - -.. image:: images/ShowAllValues.png - -- Use the Up or Down arrows to move the selection in the list -- Use the Plus (or Minus) icon to add (delete) a new line -- Use the magnifier icon to see all the values in a modal widget - -| - -If lists are not ordered, it is possible to select all values by clicking the button on the right. - -.. image:: images/SelectAllInList.png - - - -Import data from file ------------------------ - -Data import icon provide access to data from ASCII text files. -Select the character that separates values in your text file and values you want to import. - -.. image:: images/Import.png - :align: center - - -Matrix -------- -Sometimes, matrix dimensions depend on the number of others parameters (for example, correlation matrix). -If a new variable is entered or if the name changes, matrix becomes invalid. -Users have to redisplay the header by pushing the refresh icon. - -.. image:: images/Matrice.png - - - 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/OldTestsTk/testihm/common.py b/Tests/OldTestsTk/testihm/common.py new file mode 100644 index 00000000..ebad6afc --- /dev/null +++ b/Tests/OldTestsTk/testihm/common.py @@ -0,0 +1,204 @@ +# -*- coding: utf-8 -*- + +from tkMessageBox import showinfo +root=None +jdcdisplay=None + +class UnKnownNode(Exception):pass + +def init_common(r,j): + global root,jdcdisplay + root=r + jdcdisplay=j + +def KP_return(): + root.event_generate("") + root.update() + +def delete_node(panel): + panel.node.delete() + +def uncomment_command(panel): + panel.bouton_unc.invoke() + root.update() + panel=jdcdisplay.panel_courant + return panel + +def comment_command(panel): + panel.nb.selectpage('Commentaire') + panel.comment_commande() + root.update() + panel=jdcdisplay.panel_courant + return panel + +def create_mocle(nom,panel): + panel.nb.selectpage('Mocles') + panel.Liste.afficheMot(nom) + root.update() + label=panel.Liste.dico_labels[nom] + label.event_generate("") + root.event_generate("") + root.update() + return jdcdisplay.panel_courant + +def change_commandcomm(text,panel): + panel.widget_text.setvalue(text) + root.update() + panel.bouton_val.invoke() + return panel + +def create_command(nom,panel): + panel.nb.selectpage('Commande') + root.update() + panel.command_entry.setentry(nom) + panel.command_entry.component('entry').focus_set() + root.event_generate("") + root.update() + label=panel.liste_command.dico_labels[nom] + label.event_generate("") + label.event_generate("") + #root.event_generate("") + root.update() + panel=jdcdisplay.panel_courant + return panel + +def create_comment(text,panel): + panel.nb.selectpage('Commentaire') + panel.ajout_commentaire() + root.update() + panel=jdcdisplay.panel_courant + panel.widget_text.setvalue(text) + root.update() + panel.bouton_val.invoke() + #panel.change_valeur() + return panel + +def create_param(nom,valeur,panel): + panel.nb.selectpage('Commentaire') + panel.ajout_parametre() + root.update() + panel=jdcdisplay.panel_courant + if nom: + panel.entry_nom.delete(0,"end") + panel.entry_nom.insert(0,nom) + panel.entry_nom.event_generate("") + panel.entry_val.delete(0,"end") + panel.entry_val.insert(0,valeur) + panel.entry_val.event_generate("") + panel.bouton_val.invoke() + root.update() + return panel + +def create_formule(nom,args,expr,panel): + panel=create_command("FORMULE",panel) + panel.entry_nom.delete(0,"end") + panel.entry_nom.insert(0,nom) + panel.entry_nom.event_generate("") + panel.entry_arg.delete(0,"end") + panel.entry_arg.insert(0,args) + panel.entry_arg.event_generate("") + panel.entry_exp.delete(0,"end") + panel.entry_exp.insert(0,expr) + panel.entry_exp.event_generate("") + panel.bouton_val.invoke() + root.update() + return panel + +def nomme_concept(nom,panel): + panel.nb.selectpage('Concept') + root.update() + panel._any.delete(0,"end") + panel._any.insert(0,nom) + panel.but_ok.invoke() + root.update() + return jdcdisplay.panel_courant + +def select_mcf(nom,ind,node): + panel=select_child(nom,node) + parent=panel.node + parent.expand() + parent.select_next(ind) + panel=jdcdisplay.panel_courant + panel.node.expand() + return panel + +def select_child(nom,node): + """node est le parent dont on veut le fils nom""" + for n in node.children: + if n.item.nom == nom: + n.select() + root.update() + panel= jdcdisplay.panel_courant + panel.node.expand() + return panel + raise UnKnownNode(nom) + +def select_node(node): + node.select() + node.expand() + root.update() + return jdcdisplay.panel_courant + +def choose_valeur(valeur,panel): + panel.Liste_choix.afficheMot(valeur) + root.update() + label=panel.Liste_choix.dico_labels[valeur] + label.event_generate("") + label.event_generate("") + root.update() + +def choose_sdco(valeur,panel): + i = list(panel.listbox.get(0, 'end')).index(valeur) + panel.listbox.component("listbox").selection_set(i) + panel.listbox.component("listbox").focus_set() + panel.listbox.component("listbox").event_generate("") + root.update() + +def choose_assd(valeur,panel): + i = list(panel.listbox.get(0, 'end')).index(valeur) + panel.listbox.component("listbox").selection_set(i) + panel.but_val.invoke() + root.update() + +def set_valeur(valeur,panel): + panel.entry.delete(0,"end") + panel.entry.insert(0,valeur) + panel.entry.event_generate("") + root.update() + +def set_sdco(valeur,panel): + panel.entry_co.delete(0,"end") + panel.entry_co.insert(0,valeur) + panel.entry_co.event_generate("") + root.update() + +def set_complexe(valeur,panel): + panel.entry3.setentry(valeur) + panel.entry3.component('entry').focus_set() + panel.entry3.event_generate("") + root.update() + +def add_valeur_into(valeur,panel): + label=panel.Liste_choix.dico_labels[valeur] + panel.Liste_choix.afficheMot(valeur) + root.update() + label.event_generate("<1>") + panel.bouton_add.invoke() + root.update() + +def add_valeur(valeur,panel): + panel.entry.delete(0,"end") + panel.entry.insert(0,valeur) + panel.entry.event_generate("") + root.update() + +def valider_valeur(panel): + panel.bouton_accepter.invoke() + root.update() + +def copier_coller(): + root.event_generate("") + root.event_generate("") + root.update() + return jdcdisplay.panel_courant + diff --git a/Tests/OldTestsTk/testihm/testihm1.py b/Tests/OldTestsTk/testihm/testihm1.py new file mode 100644 index 00000000..dcf246d0 --- /dev/null +++ b/Tests/OldTestsTk/testihm/testihm1.py @@ -0,0 +1,337 @@ +# -*- coding: utf-8 -*- +# Modules Python +import os +import unittest +import difflib +import compare +import sys +import Tkinter + +# Modules Eficas +import prefs +from Editeur import session +from InterfaceTK import eficas_go +from InterfaceTK import splash +from InterfaceTK import eficas +from InterfaceTK import images +from common import * + +version='v8' + +class TestCase(unittest.TestCase): + def setUp(self): + self.root = Tkinter.Tk() + images.update_cache() + # Analyse des arguments de la ligne de commande + options=session.parse([]) + options.cata=version + pass + + def tearDown(self): + self.root.destroy() + init_common(None,None) + pass + + def test000(self): + root=self.root + code="ASTER" + splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) + splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") + app=eficas.EFICAS(root,code=code) + j=app.bureau.newJDC() + jdcdisplay=app.bureau.JDCDisplay_courant + init_common(root,jdcdisplay) + + # commande DEBUT + co=j.addentite("DEBUT",0) + # commande FIN + co=j.addentite("FIN",1) + + jdctree=jdcdisplay.tree.tree.children[0] + panel=select_child("DEBUT",jdctree) + + panel=create_param("P1",9.8,panel) + panel=create_param("P2",8.8,panel) + panel=create_param("P3",7,panel) + panel=create_param("P4","[2,3,4]",panel) + panel=create_param("P5","P3*P1",panel) + panel=create_param(None,"P1-3",panel) + panel=create_comment("Pas trouve shellpanel",panel) + + #commnde LIRE_MAILLAGE + panel=create_command("LIRE_MAILLAGE",panel) + command=panel.node + panel=nomme_concept("MAILLA2",panel) + panel=select_node(command) + panel=create_mocle("UNITE",panel) + panel=set_valeur("P4[1]",panel) + command.collapse() + panel=select_node(command) + #FORMULE + panel=create_formule("az","a,z","a+z",panel) + #commande AFFE_MODELE + panel=create_command("AFFE_MODELE",panel) + command=panel.node + select_child("MAILLAGE",command) + panel=select_node(command) + panel=create_mocle("AFFE",panel) + parent=panel.node + panel=select_child("PHENOMENE",parent) + choose_valeur("MECANIQUE",panel) + panel=select_child("b_mecanique",parent) + panel=select_child("MODELISATION",panel.node) + add_valeur_into("3D",panel) + add_valeur_into("3D_FLUIDE",panel) + valider_valeur(panel) + panel=select_node(parent) + panel=create_mocle("TOUT",panel) + choose_valeur("OUI",panel) + panel=select_node(command) + panel=nomme_concept("MO",panel) + command.collapse() + #fin commande AFFE_MODELE + panel=copier_coller() + command=panel.node + panel=create_mocle("AFFE",panel) + panel=select_node(command) + panel=create_mocle("AFFE",panel) + panel=select_mcf("AFFE",1,command) + parent=panel.node + panel=create_mocle("GROUP_NO",panel) + add_valeur("'GNP3','GNP5','GNP6','GNP7','GNP8','GNP9','GNP10','GNP11','GNP12'",panel) + valider_valeur(panel) + panel=select_child("PHENOMENE",parent) + choose_valeur("ACOUSTIQUE",panel) + panel=select_child("b_acoustique",parent) + panel=select_child("MODELISATION",panel.node) + add_valeur_into("PLAN",panel) + valider_valeur(panel) + + panel=select_mcf("AFFE",2,command) + parent=panel.node + panel=create_mocle("GROUP_MA",panel) + add_valeur("MASSES",panel) + valider_valeur(panel) + panel=select_child("PHENOMENE",parent) + choose_valeur("THERMIQUE",panel) + panel=select_child("b_thermique",parent) + panel=select_child("MODELISATION",panel.node) + add_valeur_into("COQUE",panel) + valider_valeur(panel) + + panel=select_node(command) + panel=nomme_concept("AFFE1",panel) + command.collapse() + #fin commande AFFE_MODELE + #commande AFFE_CARA_ELEM + panel=create_command("AFFE_CARA_ELEM",panel) + command=panel.node + panel=select_node(command) + panel=create_mocle("POUTRE",panel) + parent=panel.node + panel=select_child("SECTION",parent) + choose_valeur("CERCLE",panel) + panel=select_child("b_cercle",parent) + panel=select_child("b_constant",panel.node) + p=panel.node + panel=select_child("CARA",p) + add_valeur_into("R",panel) + add_valeur_into("EP",panel) + valider_valeur(panel) + panel=select_child("VALE",p) + add_valeur("1,2",panel) + valider_valeur(panel) + panel=select_node(parent) + panel=create_mocle("GROUP_MA",panel) + add_valeur("GR1,GR2",panel) + valider_valeur(panel) + panel=select_child("MODELE",command) + choose_assd("MO",panel) + panel=select_node(command) + panel=nomme_concept("CARA",panel) + command.collapse() + #fin commande AFFE_CARA_ELEM + panel=create_command("DEFI_FONCTION",panel) + command=panel.node + panel=create_mocle("VALE",panel) + add_valeur("5.0,3.0",panel) + add_valeur("P4[1],P3",panel) + valider_valeur(panel) + panel=select_child("NOM_PARA",command) + choose_valeur("DX",panel) + panel=select_node(command) + panel=nomme_concept("F1",panel) + command.collapse() + #fin DEFI_FONCTION + panel=create_command("DEFI_FONCTION",panel) + command=panel.node + panel=create_mocle("VALE_C",panel) + add_valeur("5.0,7.0,9.0",panel) + add_valeur("9.0,8.0,7.0",panel) + valider_valeur(panel) + panel=select_child("NOM_PARA",command) + choose_valeur("DRX",panel) + panel=select_node(command) + panel=nomme_concept("F3",panel) + command.collapse() + #fin DEFI_FONCTION +#MATER2=DEFI_MATERIAU(ELAS=_F(E=100000000000.0, +# NU=0.0,), +# ECRO_ASYM_LINE=_F(DC_SIGM_EPSI=0.0, +# SY_C=200000000.0, +# DT_SIGM_EPSI=0.0, +# SY_T=50000000.0,),); + + panel=create_command("DEFI_MATERIAU",panel) + command=panel.node + panel=create_mocle("ELAS",panel) + p=panel.node + panel=select_child("E",p) + set_valeur("100000000000.0",panel) + panel=select_child("NU",p) + set_valeur("0.0",panel) + panel=select_node(command) + panel=create_mocle("ECRO_ASYM_LINE",panel) + p=panel.node + panel=select_child("DC_SIGM_EPSI",p) + set_valeur("0.0",panel) + panel=select_child("SY_C",p) + set_valeur("200000000.0",panel) + panel=select_child("DT_SIGM_EPSI",p) + set_valeur("0.0",panel) + panel=select_child("SY_T",p) + set_valeur("50000000.0",panel) + panel=select_node(command) + panel=nomme_concept("MATER2",panel) + command.collapse() + #fin DEFI_MATERIAU + #PS1=DEFI_PARA_SENSI(VALE=1.0,); + #PS2=DEFI_PARA_SENSI(VALE=1.0,); + #PS3=DEFI_PARA_SENSI(VALE=1.0,); + panel=create_command("DEFI_PARA_SENSI",panel) + command=panel.node + panel=select_child("VALE",command) + set_valeur("1.0",panel) + panel=select_node(command) + panel=nomme_concept("PS1",panel) + command.collapse() + panel=create_command("DEFI_PARA_SENSI",panel) + command=panel.node + panel=select_child("VALE",command) + set_valeur("1.0",panel) + panel=select_node(command) + panel=nomme_concept("PS2",panel) + command.collapse() + panel=create_command("DEFI_PARA_SENSI",panel) + command=panel.node + panel=select_child("VALE",command) + set_valeur("1.0",panel) + panel=select_node(command) + panel=nomme_concept("PS3",panel) + command.collapse() +#CHMAT2=AFFE_MATERIAU(MAILLAGE=MAIL, +# AFFE=_F(TOUT='OUI', +# MATER=MATER2,),); + panel=create_command("AFFE_MATERIAU",panel) + command=panel.node + panel=select_child("MAILLAGE",command) + panel=select_child("AFFE",command) + affe=panel.node + panel=create_mocle("TOUT",panel) + choose_valeur("OUI",panel) + panel=select_child("MATER",affe) + add_valeur_into("MATER2",panel) + valider_valeur(panel) + panel=select_node(command) + panel=nomme_concept("CHMAT2",panel) + command.collapse() +#AAAZ=AFFE_CHAR_THER(MODELE=AFFE1, +# TEMP_IMPO=_F(TOUT='OUI', +# TEMP=0.0,),); + panel=create_command("AFFE_CHAR_THER",panel) + command=panel.node + panel=create_mocle("TEMP_IMPO",panel) + temp=panel.node + panel=create_mocle("TOUT",panel) + choose_valeur("OUI",panel) + panel=select_node(temp) + panel=create_mocle("TEMP",panel) + panel=set_valeur("0.0",panel) + panel=select_child("MODELE",command) + choose_assd("AFFE1",panel) + panel=select_node(command) + panel=nomme_concept("AAAZ",panel) + command.collapse() +#TH1=THER_LINEAIRE(MODELE=AFFE1, +# CHAM_MATER=CHMAT2, +# EXCIT=_F(CHARGE=AAAZ,), +# SENSIBILITE=(PS1,PS2,),); + panel=create_command("THER_LINEAIRE",panel) + command=panel.node + panel=select_child("MODELE",command) + choose_assd("AFFE1",panel) + panel=select_child("CHAM_MATER",command) + panel=select_child("EXCIT",command) + panel=select_child("CHARGE",panel.node) + panel=select_node(command) + panel=create_mocle("SENSIBILITE",panel) + add_valeur_into("PS1",panel) + add_valeur_into("PS2",panel) + valider_valeur(panel) + panel=select_node(command) + panel=nomme_concept("TH1",panel) + command.collapse() +#ACA1=AFFE_CHAR_ACOU(MODELE=AFFE1, +# PRES_IMPO=_F(TOUT='OUI', +# PRES=('RI',3.0,3.0,),),); + panel=create_command("AFFE_CHAR_ACOU",panel) + command=panel.node + panel=create_mocle("PRES_IMPO",panel) + pres=panel.node + panel=create_mocle("TOUT",panel) + choose_valeur("OUI",panel) + panel=select_child("MODELE",command) + choose_assd("AFFE1",panel) + panel=select_child("PRES",pres) + set_complexe("'RI',3.0,3.0",panel) + panel=select_node(command) + panel=nomme_concept("ACA1",panel) + command.collapse() +#MACRO_MATR_ASSE(MODELE=AFFE1, +# NUME_DDL=CO('DDL1'), +# MATR_ASSE=_F(MATRICE=CO('MAT1'), +# OPTION='RIGI_THER',),); + panel=create_command("MACRO_MATR_ASSE",panel) + command=panel.node + panel=select_child("NUME_DDL",command) + set_sdco("DDL1",panel) + panel=select_child("MODELE",command) + choose_assd("AFFE1",panel) + panel=select_child("MATR_ASSE",command) + matr=panel.node + panel=select_child("OPTION",matr) + choose_valeur("RIGI_THER",panel) + panel=select_child("MATRICE",matr) + set_sdco("MAT1",panel) + panel=select_node(command) + command.collapse() +#MACRO_MATR_ASSE(MODELE=AFFE1, +# NUME_DDL=DDL1, +# MATR_ASSE=_F(MATRICE=MAT1, +# OPTION='RIGI_THER',),); + panel=create_command("MACRO_MATR_ASSE",panel) + command=panel.node + panel=select_child("NUME_DDL",command) + choose_sdco("DDL1",panel) + panel=select_child("MODELE",command) + choose_assd("AFFE1",panel) + panel=select_child("MATR_ASSE",command) + matr=panel.node + panel=select_child("OPTION",matr) + choose_valeur("RIGI_THER",panel) + panel=select_child("MATRICE",matr) + set_sdco("MAT2",panel) + panel=select_node(command) + command.collapse() + + assert j.isvalid(),j.report() diff --git a/Tests/OldTestsTk/testihm/testihm2.py b/Tests/OldTestsTk/testihm/testihm2.py new file mode 100644 index 00000000..0bb15fbb --- /dev/null +++ b/Tests/OldTestsTk/testihm/testihm2.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +# Modules Python +import os +import unittest +import difflib +import compare +import sys +import Tkinter + +# Modules Eficas +import prefs +from Editeur import session +from InterfaceTK import eficas_go,splash,eficas,images +from common import * + + +class TestCase(unittest.TestCase): + def setUp(self): + self.root = Tkinter.Tk() + images.update_cache() + # Analyse des arguments de la ligne de commande + options=session.parse([]) + options.cata="v8" + pass + + def tearDown(self): + self.root.destroy() + init_common(None,None) + pass + + def test000(self): + root=self.root + code="ASTER" + splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) + splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") + app=eficas.EFICAS(root,code=code) + j=app.bureau.newJDC() + jdcdisplay=app.bureau.JDCDisplay_courant + init_common(root,jdcdisplay) + + # commande DEBUT + co=j.addentite("DEBUT",0) + # commande FIN + co=j.addentite("FIN",1) + + jdctree=jdcdisplay.tree.tree.children[0] + panel=select_child("DEBUT",jdctree) + panel=create_command("LIRE_MAILLAGE",panel) + panel=nomme_concept("MA",panel) + + panel=create_command("AFFE_MODELE",panel) + command=panel.node + select_child("MAILLAGE",command) + panel=select_node(command) + panel=create_mocle("AFFE",panel) + parent=panel.node + panel=select_child("PHENOMENE",parent) + choose_valeur("MECANIQUE",panel) + panel=select_child("b_mecanique",parent) + panel=select_child("MODELISATION",panel.node) + add_valeur_into("3D",panel) + add_valeur_into("3D_FLUIDE",panel) + valider_valeur(panel) + panel=select_node(parent) + panel=create_mocle("TOUT",panel) + choose_valeur("OUI",panel) + panel=select_node(command) + panel=nomme_concept("MO",panel) + + assert j.isvalid(),j.report() diff --git a/Tests/OldTestsTk/testihm/testihm3.py b/Tests/OldTestsTk/testihm/testihm3.py new file mode 100644 index 00000000..f96a73b8 --- /dev/null +++ b/Tests/OldTestsTk/testihm/testihm3.py @@ -0,0 +1,93 @@ +# -*- coding: utf-8 -*- +# Modules Python +import os +import unittest +import difflib +import compare +import sys +import Tkinter + +# Modules Eficas +import prefs +from Editeur import session +from InterfaceTK import eficas_go,splash,eficas,images +from common import * + + +class TestCase(unittest.TestCase): + def setUp(self): + self.root = Tkinter.Tk() + images.update_cache() + # Analyse des arguments de la ligne de commande + options=session.parse([]) + options.cata="petit" + pass + + def tearDown(self): + self.root.destroy() + init_common(None,None) + pass + + def test000(self): + root=self.root + code="ASTER" + splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) + splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") + app=eficas.EFICAS(root,code=code) + j=app.bureau.newJDC() + jdcdisplay=app.bureau.JDCDisplay_courant + init_common(root,jdcdisplay) + + # commande DEBUT + co=j.addentite("DEBUT",0) + # commande FIN + co=j.addentite("FIN",1) + + jdctree=jdcdisplay.tree.tree.children[0] + panel=select_child("DEBUT",jdctree) + panel=create_command("TESTS_VALID",panel) + command=panel.node + panel=select_child("LongStr",command) + set_valeur("aaa",panel) + panel=select_child("ListStr",command) + add_valeur("aaa",panel) + add_valeur("bbbb,ccc",panel) + valider_valeur(panel) + panel=select_child("PairVal",command) + add_valeur(2,panel) + add_valeur("4,6",panel) + valider_valeur(panel) + panel=select_child("RangeVal",command) + set_valeur(4,panel) + panel=select_child("CardVal",command) + add_valeur("4,6,5,7",panel) + valider_valeur(panel) + panel=select_child("EnumVal",command) + choose_valeur(3,panel) + panel=select_child("OrdList",command) + add_valeur("4,6,5,7",panel) + valider_valeur(panel) + panel=select_child("OrdList2",command) + add_valeur_into(2,panel) + valider_valeur(panel) + panel=select_child("TypeVal",command) + set_valeur(5,panel) + panel=select_child("Compul",command) + add_valeur("2",panel) + add_valeur("1",panel) + valider_valeur(panel) + panel=select_child("CompulInto",command) + add_valeur_into(2,panel) + add_valeur_into(1,panel) + valider_valeur(panel) + panel=select_child("Norep",command) + add_valeur("2",panel) + valider_valeur(panel) + panel=select_child("NorepInto",command) + add_valeur_into(2,panel) + valider_valeur(panel) + + panel=select_node(command) + panel=nomme_concept("MA",panel) + + assert j.isvalid(),j.report() diff --git a/Tests/OldTestsTk/testihm/testihm4.py b/Tests/OldTestsTk/testihm/testihm4.py new file mode 100644 index 00000000..3b3032e4 --- /dev/null +++ b/Tests/OldTestsTk/testihm/testihm4.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Modules Python +import os +import unittest +import difflib +import compare +import sys +import Tkinter + +# Modules Eficas +import prefs +from Editeur import session +from InterfaceTK import eficas_go,splash,eficas,images +from common import * + + +class TestCase(unittest.TestCase): + def setUp(self): + self.root = Tkinter.Tk() + images.update_cache() + # Analyse des arguments de la ligne de commande + options=session.parse([]) + options.cata="v8" + pass + + def tearDown(self): + self.root.destroy() + init_common(None,None) + pass + + def test000(self): + root=self.root + code="ASTER" + splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) + splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") + app=eficas.EFICAS(root,code=code) + file=os.path.join(prefs.INSTALLDIR,"Tests/testelem/az.comm") + j=app.bureau.openJDC(file=file) + jdcdisplay=app.bureau.JDCDisplay_courant + init_common(root,jdcdisplay) + jdctree=jdcdisplay.tree.tree.children[0] + #commentariser commande MACRO_MATR_ASSE + panel=select_child("MACRO_MATR_ASSE",jdctree) + panel=comment_command(panel) + #decommentariser commande MACRO_MATR_ASSE + panel=uncomment_command(panel) + #creation commande commentée + panel=create_command("LIRE_MAILLAGE",panel) + panel=comment_command(panel) + panel=change_commandcomm("mm=LIRE_MAILLAGE(INFO=2,UNITE=21)",panel) + panel=uncomment_command(panel) + panel=select_child("DEFI_FONCTION",jdctree) + delete_node(panel) + + assert j.isvalid(),j.report() diff --git a/Tests/OldTestsTk/testihm7/common.py b/Tests/OldTestsTk/testihm7/common.py new file mode 100644 index 00000000..37c180cd --- /dev/null +++ b/Tests/OldTestsTk/testihm7/common.py @@ -0,0 +1,206 @@ +# -*- coding: utf-8 -*- + +from tkMessageBox import showinfo +root=None +jdcdisplay=None + +class UnKnownNode(Exception):pass + +def init_common(r,j): + global root,jdcdisplay + root=r + jdcdisplay=j + +def KP_return(): + root.event_generate("") + root.update() + +def delete_node(panel): + panel.node.delete() + +def uncomment_command(panel): + panel.bouton_unc.invoke() + root.update() + panel=jdcdisplay.panel_courant + return panel + +def comment_command(panel): + panel.nb.selectpage('Commentaire') + panel.comment_commande() + root.update() + panel=jdcdisplay.panel_courant + return panel + +def create_mocle(nom,panel): + panel.nb.selectpage('Mocles') + panel.Liste.afficheMot(nom) + root.update() + label=panel.Liste.dico_labels[nom] + label.event_generate("") + root.event_generate("") + root.update() + return jdcdisplay.panel_courant + +def change_commandcomm(text,panel): + panel.widget_text.setvalue(text) + root.update() + panel.bouton_val.invoke() + return panel + +def create_command(nom,panel): + panel.nb.selectpage('Commande') + root.update() + panel.command_entry.setentry(nom) + panel.command_entry.component('entry').focus_set() + root.event_generate("") + root.update() + label=panel.liste_command.dico_labels[nom] + label.event_generate("") + label.event_generate("") + #root.event_generate("") + root.update() + panel=jdcdisplay.panel_courant + return panel + +def create_comment(text,panel): + panel.nb.selectpage('Commentaire') + panel.ajout_commentaire() + root.update() + panel=jdcdisplay.panel_courant + panel.widget_text.setvalue(text) + root.update() + panel.bouton_val.invoke() + #panel.change_valeur() + return panel + +def create_param(nom,valeur,panel): + panel.nb.selectpage('Commentaire') + panel.ajout_parametre() + root.update() + panel=jdcdisplay.panel_courant + if nom: + panel.entry_nom.delete(0,"end") + panel.entry_nom.insert(0,nom) + panel.entry_nom.event_generate("") + panel.entry_val.delete(0,"end") + panel.entry_val.insert(0,valeur) + panel.entry_val.event_generate("") + panel.bouton_val.invoke() + root.update() + return panel + +def create_formule(nom,args,expr,panel): + panel=create_command("FORMULE",panel) + panel.entry_nom.delete(0,"end") + panel.entry_nom.insert(0,nom) + panel.entry_nom.event_generate("") + panel.entry_arg.delete(0,"end") + panel.entry_arg.insert(0,args) + panel.entry_arg.event_generate("") + panel.entry_exp.delete(0,"end") + panel.entry_exp.insert(0,expr) + panel.entry_exp.event_generate("") + panel.bouton_val.invoke() + root.update() + return panel + +def nomme_concept(nom,panel): + panel.nb.selectpage('Concept') + root.update() + panel._any.delete(0,"end") + panel._any.insert(0,nom) + panel.but_ok.invoke() + root.update() + return jdcdisplay.panel_courant + +def select_mcf(nom,ind,node): + panel=select_child(nom,node) + parent=panel.node + parent.expand() + parent.select_next(ind) + panel=jdcdisplay.panel_courant + panel.node.expand() + return panel + +def select_child(nom,node): + """node est le parent dont on veut le fils nom""" + for n in node.children: + if n.item.nom == nom: + n.select() + root.update() + panel= jdcdisplay.panel_courant + panel.node.expand() + return panel + raise UnKnownNode(nom) + +def select_node(node): + node.select() + node.expand() + root.update() + return jdcdisplay.panel_courant + +def choose_valeur(valeur,panel): + panel.Liste_choix.afficheMot(valeur) + root.update() + label=panel.Liste_choix.dico_labels[valeur] + label.event_generate("") + label.event_generate("") + root.update() + +def choose_sdco(valeur,panel): + i = list(panel.listbox.get(0, 'end')).index(valeur) + panel.listbox.component("listbox").selection_set(i) + panel.listbox.component("listbox").focus_set() + panel.listbox.component("listbox").event_generate("") + root.update() + +def choose_assd(valeur,panel): + i = list(panel.listbox.get(0, 'end')).index(valeur) + panel.listbox.component("listbox").selection_set(i) + panel.but_val.invoke() + root.update() + +def set_valeur(valeur,panel): + panel.entry.delete(0,"end") + panel.entry.insert(0,valeur) + panel.entry.event_generate("") + root.update() + +def set_sdco(valeur,panel): + panel.b_co.invoke('OUI') + root.update() + panel.entry_co.delete(0,"end") + panel.entry_co.insert(0,valeur) + panel.entry_co.event_generate("") + root.update() + +def set_complexe(valeur,panel): + panel.entry3.setentry(valeur) + panel.entry3.component('entry').focus_set() + panel.entry3.event_generate("") + root.update() + +def add_valeur_into(valeur,panel): + label=panel.Liste_choix.dico_labels[valeur] + panel.Liste_choix.afficheMot(valeur) + root.update() + label.event_generate("<1>") + panel.bouton_add.invoke() + root.update() + +def add_valeur(valeur,panel): + panel.entry.delete(0,"end") + panel.entry.insert(0,valeur) + panel.entry.event_generate("") + root.update() + +def valider_valeur(panel): + panel.bouton_accepter.invoke() + root.update() + +def copier_coller(): + root.event_generate("") + root.event_generate("") + root.update() + return jdcdisplay.panel_courant + diff --git a/Tests/OldTestsTk/testihm7/testihm1.py b/Tests/OldTestsTk/testihm7/testihm1.py new file mode 100644 index 00000000..78590803 --- /dev/null +++ b/Tests/OldTestsTk/testihm7/testihm1.py @@ -0,0 +1,334 @@ +# -*- coding: utf-8 -*- +# Modules Python +import os +import unittest +import difflib +import compare +import sys +import Tkinter + +# Modules Eficas +import prefs +from Editeur import session +from InterfaceTK import eficas_go,splash,eficas,images +from common import * + +version='v7' + +class TestCase(unittest.TestCase): + def setUp(self): + self.root = Tkinter.Tk() + images.update_cache() + # Analyse des arguments de la ligne de commande + options=session.parse([]) + options.cata=version + pass + + def tearDown(self): + self.root.destroy() + init_common(None,None) + pass + + def test000(self): + root=self.root + code="ASTER" + splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) + splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") + app=eficas.EFICAS(root,code=code) + j=app.bureau.newJDC() + jdcdisplay=app.bureau.JDCDisplay_courant + init_common(root,jdcdisplay) + + # commande DEBUT + co=j.addentite("DEBUT",0) + # commande FIN + co=j.addentite("FIN",1) + + jdctree=jdcdisplay.tree.tree.children[0] + panel=select_child("DEBUT",jdctree) + + panel=create_param("P1",9.8,panel) + panel=create_param("P2",8.8,panel) + panel=create_param("P3",7,panel) + panel=create_param("P4","[2,3,4]",panel) + panel=create_param("P5","P3*P1",panel) + panel=create_param(None,"P1-3",panel) + panel=create_comment("Pas trouve shellpanel",panel) + + #commnde LIRE_MAILLAGE + panel=create_command("LIRE_MAILLAGE",panel) + command=panel.node + panel=nomme_concept("MAILLA2",panel) + panel=select_node(command) + panel=create_mocle("UNITE",panel) + panel=set_valeur("P4[1]",panel) + command.collapse() + panel=select_node(command) + #FORMULE + panel=create_formule("az","a,z","a+z",panel) + #commande AFFE_MODELE + panel=create_command("AFFE_MODELE",panel) + command=panel.node + select_child("MAILLAGE",command) + panel=select_node(command) + panel=create_mocle("AFFE",panel) + parent=panel.node + panel=select_child("PHENOMENE",parent) + choose_valeur("MECANIQUE",panel) + panel=select_child("b_mecanique",parent) + panel=select_child("MODELISATION",panel.node) + add_valeur_into("3D",panel) + add_valeur_into("3D_FLUIDE",panel) + valider_valeur(panel) + panel=select_node(parent) + panel=create_mocle("TOUT",panel) + choose_valeur("OUI",panel) + panel=select_node(command) + panel=nomme_concept("MO",panel) + command.collapse() + #fin commande AFFE_MODELE + panel=copier_coller() + command=panel.node + panel=create_mocle("AFFE",panel) + panel=select_node(command) + panel=create_mocle("AFFE",panel) + panel=select_mcf("AFFE",1,command) + parent=panel.node + panel=create_mocle("GROUP_NO",panel) + add_valeur("'GNP3','GNP5','GNP6','GNP7','GNP8','GNP9','GNP10','GNP11','GNP12'",panel) + valider_valeur(panel) + panel=select_child("PHENOMENE",parent) + choose_valeur("ACOUSTIQUE",panel) + panel=select_child("b_acoustique",parent) + panel=select_child("MODELISATION",panel.node) + add_valeur_into("PLAN",panel) + valider_valeur(panel) + + panel=select_mcf("AFFE",2,command) + parent=panel.node + panel=create_mocle("GROUP_MA",panel) + add_valeur("MASSES",panel) + valider_valeur(panel) + panel=select_child("PHENOMENE",parent) + choose_valeur("THERMIQUE",panel) + panel=select_child("b_thermique",parent) + panel=select_child("MODELISATION",panel.node) + add_valeur_into("COQUE",panel) + valider_valeur(panel) + + panel=select_node(command) + panel=nomme_concept("AFFE1",panel) + command.collapse() + #fin commande AFFE_MODELE + #commande AFFE_CARA_ELEM + panel=create_command("AFFE_CARA_ELEM",panel) + command=panel.node + panel=select_node(command) + panel=create_mocle("POUTRE",panel) + parent=panel.node + panel=select_child("SECTION",parent) + choose_valeur("CERCLE",panel) + panel=select_child("b_cercle",parent) + panel=select_child("b_constant",panel.node) + p=panel.node + panel=select_child("CARA",p) + add_valeur_into("R",panel) + add_valeur_into("EP",panel) + valider_valeur(panel) + panel=select_child("VALE",p) + add_valeur("1,2",panel) + valider_valeur(panel) + panel=select_node(parent) + panel=create_mocle("GROUP_MA",panel) + add_valeur("GR1,GR2",panel) + valider_valeur(panel) + panel=select_child("MODELE",command) + choose_assd("MO",panel) + panel=select_node(command) + panel=nomme_concept("CARA",panel) + command.collapse() + #fin commande AFFE_CARA_ELEM + panel=create_command("DEFI_FONCTION",panel) + command=panel.node + panel=create_mocle("VALE",panel) + add_valeur("5.0,3.0",panel) + add_valeur("P4[1],P3",panel) + valider_valeur(panel) + panel=select_child("NOM_PARA",command) + add_valeur("DX",panel) + panel=select_node(command) + panel=nomme_concept("F1",panel) + command.collapse() + #fin DEFI_FONCTION + panel=create_command("DEFI_FONCTION",panel) + command=panel.node + panel=create_mocle("VALE_C",panel) + add_valeur("5.0,7.0,9.0",panel) + add_valeur("9.0,8.0,7.0",panel) + valider_valeur(panel) + panel=select_child("NOM_PARA",command) + add_valeur("DRX",panel) + panel=select_node(command) + panel=nomme_concept("F3",panel) + command.collapse() + #fin DEFI_FONCTION +#MATER2=DEFI_MATERIAU(ELAS=_F(E=100000000000.0, +# NU=0.0,), +# ECRO_ASYM_LINE=_F(DC_SIGM_EPSI=0.0, +# SY_C=200000000.0, +# DT_SIGM_EPSI=0.0, +# SY_T=50000000.0,),); + + panel=create_command("DEFI_MATERIAU",panel) + command=panel.node + panel=create_mocle("ELAS",panel) + p=panel.node + panel=select_child("E",p) + set_valeur("100000000000.0",panel) + panel=select_child("NU",p) + set_valeur("0.0",panel) + panel=select_node(command) + panel=create_mocle("ECRO_ASYM_LINE",panel) + p=panel.node + panel=select_child("DC_SIGM_EPSI",p) + set_valeur("0.0",panel) + panel=select_child("SY_C",p) + set_valeur("200000000.0",panel) + panel=select_child("DT_SIGM_EPSI",p) + set_valeur("0.0",panel) + panel=select_child("SY_T",p) + set_valeur("50000000.0",panel) + panel=select_node(command) + panel=nomme_concept("MATER2",panel) + command.collapse() + #fin DEFI_MATERIAU + #PS1=DEFI_PARA_SENSI(VALE=1.0,); + #PS2=DEFI_PARA_SENSI(VALE=1.0,); + #PS3=DEFI_PARA_SENSI(VALE=1.0,); + panel=create_command("DEFI_PARA_SENSI",panel) + command=panel.node + panel=select_child("VALE",command) + set_valeur("1.0",panel) + panel=select_node(command) + panel=nomme_concept("PS1",panel) + command.collapse() + panel=create_command("DEFI_PARA_SENSI",panel) + command=panel.node + panel=select_child("VALE",command) + set_valeur("1.0",panel) + panel=select_node(command) + panel=nomme_concept("PS2",panel) + command.collapse() + panel=create_command("DEFI_PARA_SENSI",panel) + command=panel.node + panel=select_child("VALE",command) + set_valeur("1.0",panel) + panel=select_node(command) + panel=nomme_concept("PS3",panel) + command.collapse() +#CHMAT2=AFFE_MATERIAU(MAILLAGE=MAIL, +# AFFE=_F(TOUT='OUI', +# MATER=MATER2,),); + panel=create_command("AFFE_MATERIAU",panel) + command=panel.node + panel=select_child("MAILLAGE",command) + panel=select_child("AFFE",command) + affe=panel.node + panel=create_mocle("TOUT",panel) + choose_valeur("OUI",panel) + panel=select_child("MATER",affe) + add_valeur_into("MATER2",panel) + valider_valeur(panel) + panel=select_node(command) + panel=nomme_concept("CHMAT2",panel) + command.collapse() +#AAAZ=AFFE_CHAR_THER(MODELE=AFFE1, +# TEMP_IMPO=_F(TOUT='OUI', +# TEMP=0.0,),); + panel=create_command("AFFE_CHAR_THER",panel) + command=panel.node + panel=create_mocle("TEMP_IMPO",panel) + temp=panel.node + panel=create_mocle("TOUT",panel) + choose_valeur("OUI",panel) + panel=select_node(temp) + panel=create_mocle("TEMP",panel) + panel=set_valeur("0.0",panel) + panel=select_child("MODELE",command) + choose_assd("AFFE1",panel) + panel=select_node(command) + panel=nomme_concept("AAAZ",panel) + command.collapse() +#TH1=THER_LINEAIRE(MODELE=AFFE1, +# CHAM_MATER=CHMAT2, +# EXCIT=_F(CHARGE=AAAZ,), +# SENSIBILITE=(PS1,PS2,),); + panel=create_command("THER_LINEAIRE",panel) + command=panel.node + panel=select_child("MODELE",command) + choose_assd("AFFE1",panel) + panel=select_child("CHAM_MATER",command) + panel=select_child("EXCIT",command) + panel=select_child("CHARGE",panel.node) + panel=select_node(command) + panel=create_mocle("SENSIBILITE",panel) + add_valeur_into("PS1",panel) + add_valeur_into("PS2",panel) + valider_valeur(panel) + panel=select_node(command) + panel=nomme_concept("TH1",panel) + command.collapse() +#ACA1=AFFE_CHAR_ACOU(MODELE=AFFE1, +# PRES_IMPO=_F(TOUT='OUI', +# PRES=('RI',3.0,3.0,),),); + panel=create_command("AFFE_CHAR_ACOU",panel) + command=panel.node + panel=create_mocle("PRES_IMPO",panel) + pres=panel.node + panel=create_mocle("TOUT",panel) + choose_valeur("OUI",panel) + panel=select_child("MODELE",command) + choose_assd("AFFE1",panel) + panel=select_child("PRES",pres) + set_complexe("'RI',3.0,3.0",panel) + panel=select_node(command) + panel=nomme_concept("ACA1",panel) + command.collapse() +#MACRO_MATR_ASSE(MODELE=AFFE1, +# NUME_DDL=CO('DDL1'), +# MATR_ASSE=_F(MATRICE=CO('MAT1'), +# OPTION='RIGI_THER',),); + panel=create_command("MACRO_MATR_ASSE",panel) + command=panel.node + panel=select_child("NUME_DDL",command) + set_sdco("DDL1",panel) + panel=select_child("MODELE",command) + choose_assd("AFFE1",panel) + panel=select_child("MATR_ASSE",command) + matr=panel.node + panel=select_child("OPTION",matr) + choose_valeur("RIGI_THER",panel) + panel=select_child("MATRICE",matr) + set_sdco("MAT1",panel) + panel=select_node(command) + command.collapse() +#MACRO_MATR_ASSE(MODELE=AFFE1, +# NUME_DDL=DDL1, +# MATR_ASSE=_F(MATRICE=MAT1, +# OPTION='RIGI_THER',),); + panel=create_command("MACRO_MATR_ASSE",panel) + command=panel.node + panel=select_child("NUME_DDL",command) + choose_sdco("DDL1",panel) + panel=select_child("MODELE",command) + choose_assd("AFFE1",panel) + panel=select_child("MATR_ASSE",command) + matr=panel.node + panel=select_child("OPTION",matr) + choose_valeur("RIGI_THER",panel) + panel=select_child("MATRICE",matr) + set_sdco("MAT2",panel) + panel=select_node(command) + command.collapse() + + assert j.isvalid(),j.report() diff --git a/Tests/OldTestsTk/testihm7/testihm2.py b/Tests/OldTestsTk/testihm7/testihm2.py new file mode 100644 index 00000000..37de0da2 --- /dev/null +++ b/Tests/OldTestsTk/testihm7/testihm2.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +# Modules Python +import os +import unittest +import difflib +import compare +import sys +import Tkinter + +# Modules Eficas +import prefs +from Editeur import session +from InterfaceTK import eficas_go,splash,eficas,images +from common import * + + +class TestCase(unittest.TestCase): + def setUp(self): + self.root = Tkinter.Tk() + images.update_cache() + # Analyse des arguments de la ligne de commande + options=session.parse([]) + options.cata="v7" + pass + + def tearDown(self): + self.root.destroy() + init_common(None,None) + pass + + def test000(self): + root=self.root + code="ASTER" + splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) + splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") + app=eficas.EFICAS(root,code=code) + j=app.bureau.newJDC() + jdcdisplay=app.bureau.JDCDisplay_courant + init_common(root,jdcdisplay) + + # commande DEBUT + co=j.addentite("DEBUT",0) + # commande FIN + co=j.addentite("FIN",1) + + jdctree=jdcdisplay.tree.tree.children[0] + panel=select_child("DEBUT",jdctree) + panel=create_command("LIRE_MAILLAGE",panel) + panel=nomme_concept("MA",panel) + + panel=create_command("AFFE_MODELE",panel) + command=panel.node + select_child("MAILLAGE",command) + panel=select_node(command) + panel=create_mocle("AFFE",panel) + parent=panel.node + panel=select_child("PHENOMENE",parent) + choose_valeur("MECANIQUE",panel) + panel=select_child("b_mecanique",parent) + panel=select_child("MODELISATION",panel.node) + add_valeur_into("3D",panel) + add_valeur_into("3D_FLUIDE",panel) + valider_valeur(panel) + panel=select_node(parent) + panel=create_mocle("TOUT",panel) + choose_valeur("OUI",panel) + panel=select_node(command) + panel=nomme_concept("MO",panel) + + assert j.isvalid(),j.report() diff --git a/Tests/OldTestsTk/testihm7/testihm4.py b/Tests/OldTestsTk/testihm7/testihm4.py new file mode 100644 index 00000000..6dbd0025 --- /dev/null +++ b/Tests/OldTestsTk/testihm7/testihm4.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Modules Python +import os +import unittest +import difflib +import compare +import sys +import Tkinter + +# Modules Eficas +import prefs +from Editeur import session +from InterfaceTK import eficas_go,splash,eficas,images +from common import * + + +class TestCase(unittest.TestCase): + def setUp(self): + self.root = Tkinter.Tk() + images.update_cache() + # Analyse des arguments de la ligne de commande + options=session.parse([]) + options.cata="v7" + pass + + def tearDown(self): + self.root.destroy() + init_common(None,None) + pass + + def test000(self): + root=self.root + code="ASTER" + splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) + splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") + app=eficas.EFICAS(root,code=code) + file=os.path.join(prefs.INSTALLDIR,"Tests/testelem/az.comm") + j=app.bureau.openJDC(file=file) + jdcdisplay=app.bureau.JDCDisplay_courant + init_common(root,jdcdisplay) + jdctree=jdcdisplay.tree.tree.children[0] + #commentariser commande MACRO_MATR_ASSE + panel=select_child("MACRO_MATR_ASSE",jdctree) + panel=comment_command(panel) + #decommentariser commande MACRO_MATR_ASSE + panel=uncomment_command(panel) + #creation commande commentée + panel=create_command("LIRE_MAILLAGE",panel) + panel=comment_command(panel) + panel=change_commandcomm("mm=LIRE_MAILLAGE(INFO=2,UNITE=21)",panel) + panel=uncomment_command(panel) + panel=select_child("DEFI_FONCTION",jdctree) + delete_node(panel) + + assert j.isvalid(),j.report() diff --git a/Tests/OldTestsTk/testihm9/common.py b/Tests/OldTestsTk/testihm9/common.py new file mode 100644 index 00000000..911387bf --- /dev/null +++ b/Tests/OldTestsTk/testihm9/common.py @@ -0,0 +1,209 @@ +# -*- coding: utf-8 -*- + +from tkMessageBox import showinfo +root=None +jdcdisplay=None + +class UnKnownNode(Exception):pass + +def pause(): + if 1: + showinfo("Pause","Pause") + +def init_common(r,j): + global root,jdcdisplay + root=r + jdcdisplay=j + +def KP_return(): + root.event_generate("") + root.update() + +def delete_node(panel): + panel.node.delete() + +def uncomment_command(panel): + panel.bouton_unc.invoke() + root.update() + panel=jdcdisplay.panel_courant + return panel + +def comment_command(panel): + panel.nb.selectpage('Commentaire') + panel.comment_commande() + root.update() + panel=jdcdisplay.panel_courant + return panel + +def create_mocle(nom,panel): + panel.nb.selectpage('Mocles') + panel.Liste.afficheMot(nom) + root.update() + label=panel.Liste.dico_labels[nom] + label.event_generate("") + root.event_generate("") + root.update() + return jdcdisplay.panel_courant + +def change_commandcomm(text,panel): + panel.widget_text.setvalue(text) + root.update() + panel.bouton_val.invoke() + return panel + +def create_command(nom,panel): + panel.nb.selectpage('Commande') + root.update() + panel.command_entry.setentry(nom) + panel.command_entry.component('entry').focus_set() + root.event_generate("") + root.update() + label=panel.liste_command.dico_labels[nom] + label.event_generate("") + label.event_generate("") + root.update() + panel=jdcdisplay.panel_courant + return panel + +def create_comment(text,panel): + panel.nb.selectpage('Commentaire') + panel.ajout_commentaire() + root.update() + panel=jdcdisplay.panel_courant + panel.widget_text.setvalue(text) + root.update() + panel.bouton_val.invoke() + #panel.change_valeur() + return panel + +def create_param(nom,valeur,panel): + panel.nb.selectpage('Commentaire') + panel.ajout_parametre() + root.update() + panel=jdcdisplay.panel_courant + if nom: + panel.entry_nom.delete(0,"end") + panel.entry_nom.insert(0,nom) + panel.entry_nom.event_generate("") + panel.entry_val.delete(0,"end") + panel.entry_val.insert(0,valeur) + panel.entry_val.event_generate("") + panel.bouton_val.invoke() + root.update() + return panel + +def create_formule(nom,args,expr,panel): + panel=create_command("FORMULE",panel) + panel.entry_nom.delete(0,"end") + panel.entry_nom.insert(0,nom) + panel.entry_nom.event_generate("") + panel.entry_arg.delete(0,"end") + panel.entry_arg.insert(0,args) + panel.entry_arg.event_generate("") + panel.entry_exp.delete(0,"end") + panel.entry_exp.insert(0,expr) + panel.entry_exp.event_generate("") + panel.bouton_val.invoke() + root.update() + return panel + +def nomme_concept(nom,panel): + panel.nb.selectpage('Concept') + root.update() + panel._any.delete(0,"end") + panel._any.insert(0,nom) + panel.but_ok.invoke() + root.update() + return jdcdisplay.panel_courant + +def select_mcf(nom,ind,node): + panel=select_child(nom,node) + parent=panel.node + parent.expand() + parent.select_next(ind) + panel=jdcdisplay.panel_courant + panel.node.expand() + return panel + +def select_child(nom,node): + """node est le parent dont on veut le fils nom""" + for n in node.children: + if n.item.nom == nom: + n.select() + root.update() + panel= jdcdisplay.panel_courant + panel.node.expand() + return panel + raise UnKnownNode(nom) + +def select_node(node): + node.select() + node.expand() + root.update() + return jdcdisplay.panel_courant + +def choose_valeur(valeur,panel): + panel.Liste_choix.afficheMot(valeur) + root.update() + label=panel.Liste_choix.dico_labels[valeur] + label.event_generate("") + label.event_generate("") + root.update() + +def choose_sdco(valeur,panel): + i = list(panel.listbox.get(0, 'end')).index(valeur) + panel.listbox.component("listbox").selection_set(i) + panel.listbox.component("listbox").focus_set() + panel.listbox.component("listbox").event_generate("") + root.update() + +def choose_assd(valeur,panel): + i = list(panel.listbox.get(0, 'end')).index(valeur) + panel.listbox.component("listbox").selection_set(i) + panel.but_val.invoke() + root.update() + +def set_valeur(valeur,panel): + panel.entry.delete(0,"end") + panel.entry.insert(0,valeur) + panel.entry.event_generate("") + root.update() + +def set_sdco(valeur,panel): + panel.b_co.invoke('OUI') + root.update() + panel.entry_co.delete(0,"end") + panel.entry_co.insert(0,valeur) + panel.entry_co.event_generate("") + root.update() + +def set_complexe(valeur,panel): + panel.entry3.setentry(valeur) + panel.entry3.component('entry').focus_set() + panel.entry3.event_generate("") + root.update() + +def add_valeur_into(valeur,panel): + label=panel.Liste_choix.dico_labels[valeur] + panel.Liste_choix.afficheMot(valeur) + root.update() + label.event_generate("<1>") + panel.bouton_add.invoke() + root.update() + +def add_valeur(valeur,panel): + panel.entry.delete(0,"end") + panel.entry.insert(0,valeur) + panel.entry.event_generate("") + root.update() + +def valider_valeur(panel): + panel.bouton_accepter.invoke() + root.update() + +def copier_coller(): + root.event_generate("") + root.event_generate("") + root.update() + return jdcdisplay.panel_courant + diff --git a/Tests/OldTestsTk/testihm9/testihm1.py b/Tests/OldTestsTk/testihm9/testihm1.py new file mode 100644 index 00000000..0c1b6699 --- /dev/null +++ b/Tests/OldTestsTk/testihm9/testihm1.py @@ -0,0 +1,334 @@ +# -*- coding: utf-8 -*- +# Modules Python +import os +import unittest +import difflib +import compare +import sys +import Tkinter + +# Modules Eficas +import prefs +from Editeur import session +from InterfaceTK import eficas_go,splash,eficas,images +from common import * + +version='v9' + +class TestCase(unittest.TestCase): + def setUp(self): + self.root = Tkinter.Tk() + images.update_cache() + # Analyse des arguments de la ligne de commande + options=session.parse([]) + options.cata=version + pass + + def tearDown(self): + self.root.destroy() + init_common(None,None) + pass + + def test000(self): + root=self.root + code="ASTER" + splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) + splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") + app=eficas.EFICAS(root,code=code) + j=app.bureau.newJDC() + jdcdisplay=app.bureau.JDCDisplay_courant + init_common(root,jdcdisplay) + + # commande DEBUT + co=j.addentite("DEBUT",0) + # commande FIN + co=j.addentite("FIN",1) + + jdctree=jdcdisplay.tree.tree.children[0] + panel=select_child("DEBUT",jdctree) + + panel=create_param("P1",9.8,panel) + panel=create_param("P2",8.8,panel) + panel=create_param("P3",7,panel) + panel=create_param("P4","[2,3,4]",panel) + panel=create_param("P5","P3*P1",panel) + panel=create_param(None,"P1-3",panel) + panel=create_comment("Pas trouve shellpanel",panel) + + #commnde LIRE_MAILLAGE + panel=create_command("LIRE_MAILLAGE",panel) + command=panel.node + panel=nomme_concept("MAILLA2",panel) + panel=select_node(command) + panel=create_mocle("UNITE",panel) + panel=set_valeur("P4[1]",panel) + command.collapse() + panel=select_node(command) + #FORMULE + panel=create_formule("az","a,z","a+z",panel) + #commande AFFE_MODELE + panel=create_command("AFFE_MODELE",panel) + command=panel.node + select_child("MAILLAGE",command) + panel=select_node(command) + panel=create_mocle("AFFE",panel) + parent=panel.node + panel=select_child("PHENOMENE",parent) + choose_valeur("MECANIQUE",panel) + panel=select_child("b_mecanique",parent) + panel=select_child("MODELISATION",panel.node) + add_valeur_into("3D",panel) + add_valeur_into("3D_FLUIDE",panel) + valider_valeur(panel) + panel=select_node(parent) + panel=create_mocle("TOUT",panel) + choose_valeur("OUI",panel) + panel=select_node(command) + panel=nomme_concept("MO",panel) + command.collapse() + #fin commande AFFE_MODELE + panel=copier_coller() + command=panel.node + panel=create_mocle("AFFE",panel) + panel=select_node(command) + panel=create_mocle("AFFE",panel) + panel=select_mcf("AFFE",1,command) + parent=panel.node + panel=create_mocle("GROUP_NO",panel) + add_valeur("'GNP3','GNP5','GNP6','GNP7','GNP8','GNP9','GNP10','GNP11','GNP12'",panel) + valider_valeur(panel) + panel=select_child("PHENOMENE",parent) + choose_valeur("ACOUSTIQUE",panel) + panel=select_child("b_acoustique",parent) + panel=select_child("MODELISATION",panel.node) + add_valeur_into("PLAN",panel) + valider_valeur(panel) + + panel=select_mcf("AFFE",2,command) + parent=panel.node + panel=create_mocle("GROUP_MA",panel) + add_valeur("MASSES",panel) + valider_valeur(panel) + panel=select_child("PHENOMENE",parent) + choose_valeur("THERMIQUE",panel) + panel=select_child("b_thermique",parent) + panel=select_child("MODELISATION",panel.node) + add_valeur_into("COQUE",panel) + valider_valeur(panel) + + panel=select_node(command) + panel=nomme_concept("AFFE1",panel) + command.collapse() + #fin commande AFFE_MODELE + #commande AFFE_CARA_ELEM + panel=create_command("AFFE_CARA_ELEM",panel) + command=panel.node + panel=select_node(command) + panel=create_mocle("POUTRE",panel) + parent=panel.node + panel=select_child("SECTION",parent) + choose_valeur("CERCLE",panel) + panel=select_child("b_cercle",parent) + panel=select_child("b_constant",panel.node) + p=panel.node + panel=select_child("CARA",p) + add_valeur_into("R",panel) + add_valeur_into("EP",panel) + valider_valeur(panel) + panel=select_child("VALE",p) + add_valeur("1,2",panel) + valider_valeur(panel) + panel=select_node(parent) + panel=create_mocle("GROUP_MA",panel) + add_valeur("GR1,GR2",panel) + valider_valeur(panel) + panel=select_child("MODELE",command) + choose_assd("MO",panel) + panel=select_node(command) + panel=nomme_concept("CARA",panel) + command.collapse() + #fin commande AFFE_CARA_ELEM + panel=create_command("DEFI_FONCTION",panel) + command=panel.node + panel=create_mocle("VALE",panel) + add_valeur("5.0,3.0",panel) + add_valeur("P4[1],P3",panel) + valider_valeur(panel) + panel=select_child("NOM_PARA",command) + choose_valeur("DX",panel) + panel=select_node(command) + panel=nomme_concept("F1",panel) + command.collapse() + #fin DEFI_FONCTION + panel=create_command("DEFI_FONCTION",panel) + command=panel.node + panel=create_mocle("VALE_C",panel) + add_valeur("5.0,7.0,9.0",panel) + add_valeur("9.0,8.0,7.0",panel) + valider_valeur(panel) + panel=select_child("NOM_PARA",command) + choose_valeur("DRX",panel) + panel=select_node(command) + panel=nomme_concept("F3",panel) + command.collapse() + #fin DEFI_FONCTION +#MATER2=DEFI_MATERIAU(ELAS=_F(E=100000000000.0, +# NU=0.0,), +# ECRO_ASYM_LINE=_F(DC_SIGM_EPSI=0.0, +# SY_C=200000000.0, +# DT_SIGM_EPSI=0.0, +# SY_T=50000000.0,),); + + panel=create_command("DEFI_MATERIAU",panel) + command=panel.node + panel=create_mocle("ELAS",panel) + p=panel.node + panel=select_child("E",p) + set_valeur("100000000000.0",panel) + panel=select_child("NU",p) + set_valeur("0.0",panel) + panel=select_node(command) + panel=create_mocle("ECRO_ASYM_LINE",panel) + p=panel.node + panel=select_child("DC_SIGM_EPSI",p) + set_valeur("0.0",panel) + panel=select_child("SY_C",p) + set_valeur("200000000.0",panel) + panel=select_child("DT_SIGM_EPSI",p) + set_valeur("0.0",panel) + panel=select_child("SY_T",p) + set_valeur("50000000.0",panel) + panel=select_node(command) + panel=nomme_concept("MATER2",panel) + command.collapse() + #fin DEFI_MATERIAU + #PS1=DEFI_PARA_SENSI(VALE=1.0,); + #PS2=DEFI_PARA_SENSI(VALE=1.0,); + #PS3=DEFI_PARA_SENSI(VALE=1.0,); + panel=create_command("DEFI_PARA_SENSI",panel) + command=panel.node + panel=select_child("VALE",command) + set_valeur("1.0",panel) + panel=select_node(command) + panel=nomme_concept("PS1",panel) + command.collapse() + panel=create_command("DEFI_PARA_SENSI",panel) + command=panel.node + panel=select_child("VALE",command) + set_valeur("1.0",panel) + panel=select_node(command) + panel=nomme_concept("PS2",panel) + command.collapse() + panel=create_command("DEFI_PARA_SENSI",panel) + command=panel.node + panel=select_child("VALE",command) + set_valeur("1.0",panel) + panel=select_node(command) + panel=nomme_concept("PS3",panel) + command.collapse() +#CHMAT2=AFFE_MATERIAU(MAILLAGE=MAIL, +# AFFE=_F(TOUT='OUI', +# MATER=MATER2,),); + panel=create_command("AFFE_MATERIAU",panel) + command=panel.node + panel=select_child("MAILLAGE",command) + panel=select_child("AFFE",command) + affe=panel.node + panel=create_mocle("TOUT",panel) + choose_valeur("OUI",panel) + panel=select_child("MATER",affe) + add_valeur_into("MATER2",panel) + valider_valeur(panel) + panel=select_node(command) + panel=nomme_concept("CHMAT2",panel) + command.collapse() +#AAAZ=AFFE_CHAR_THER(MODELE=AFFE1, +# TEMP_IMPO=_F(TOUT='OUI', +# TEMP=0.0,),); + panel=create_command("AFFE_CHAR_THER",panel) + command=panel.node + panel=create_mocle("TEMP_IMPO",panel) + temp=panel.node + panel=create_mocle("TOUT",panel) + choose_valeur("OUI",panel) + panel=select_node(temp) + panel=create_mocle("TEMP",panel) + panel=set_valeur("0.0",panel) + panel=select_child("MODELE",command) + choose_assd("AFFE1",panel) + panel=select_node(command) + panel=nomme_concept("AAAZ",panel) + command.collapse() +#TH1=THER_LINEAIRE(MODELE=AFFE1, +# CHAM_MATER=CHMAT2, +# EXCIT=_F(CHARGE=AAAZ,), +# SENSIBILITE=(PS1,PS2,),); + panel=create_command("THER_LINEAIRE",panel) + command=panel.node + panel=select_child("MODELE",command) + choose_assd("AFFE1",panel) + panel=select_child("CHAM_MATER",command) + panel=select_child("EXCIT",command) + panel=select_child("CHARGE",panel.node) + panel=select_node(command) + panel=create_mocle("SENSIBILITE",panel) + add_valeur_into("PS1",panel) + add_valeur_into("PS2",panel) + valider_valeur(panel) + panel=select_node(command) + panel=nomme_concept("TH1",panel) + command.collapse() +#ACA1=AFFE_CHAR_ACOU(MODELE=AFFE1, +# PRES_IMPO=_F(TOUT='OUI', +# PRES=('RI',3.0,3.0,),),); + panel=create_command("AFFE_CHAR_ACOU",panel) + command=panel.node + panel=create_mocle("PRES_IMPO",panel) + pres=panel.node + panel=create_mocle("TOUT",panel) + choose_valeur("OUI",panel) + panel=select_child("MODELE",command) + choose_assd("AFFE1",panel) + panel=select_child("PRES",pres) + set_complexe("'RI',3.0,3.0",panel) + panel=select_node(command) + panel=nomme_concept("ACA1",panel) + command.collapse() +#MACRO_MATR_ASSE(MODELE=AFFE1, +# NUME_DDL=CO('DDL1'), +# MATR_ASSE=_F(MATRICE=CO('MAT1'), +# OPTION='RIGI_THER',),); + panel=create_command("MACRO_MATR_ASSE",panel) + command=panel.node + panel=select_child("NUME_DDL",command) + set_sdco("DDL1",panel) + panel=select_child("MODELE",command) + choose_assd("AFFE1",panel) + panel=select_child("MATR_ASSE",command) + matr=panel.node + panel=select_child("OPTION",matr) + choose_valeur("RIGI_THER",panel) + panel=select_child("MATRICE",matr) + set_sdco("MAT1",panel) + panel=select_node(command) + command.collapse() +#MACRO_MATR_ASSE(MODELE=AFFE1, +# NUME_DDL=DDL1, +# MATR_ASSE=_F(MATRICE=MAT1, +# OPTION='RIGI_THER',),); + panel=create_command("MACRO_MATR_ASSE",panel) + command=panel.node + panel=select_child("NUME_DDL",command) + choose_sdco("DDL1",panel) + panel=select_child("MODELE",command) + choose_assd("AFFE1",panel) + panel=select_child("MATR_ASSE",command) + matr=panel.node + panel=select_child("OPTION",matr) + choose_valeur("RIGI_THER",panel) + panel=select_child("MATRICE",matr) + set_sdco("MAT2",panel) + panel=select_node(command) + command.collapse() + + assert j.isvalid(),j.report() diff --git a/Tests/OldTestsTk/testihm9/testihm2.py b/Tests/OldTestsTk/testihm9/testihm2.py new file mode 100644 index 00000000..ee3762d9 --- /dev/null +++ b/Tests/OldTestsTk/testihm9/testihm2.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +# Modules Python +import os +import unittest +import difflib +import compare +import sys +import Tkinter + +# Modules Eficas +import prefs +from Editeur import session +from InterfaceTK import eficas_go,splash,eficas,images +from common import * + + +class TestCase(unittest.TestCase): + def setUp(self): + self.root = Tkinter.Tk() + images.update_cache() + # Analyse des arguments de la ligne de commande + options=session.parse([]) + options.cata="v9" + pass + + def tearDown(self): + self.root.destroy() + init_common(None,None) + pass + + def test000(self): + root=self.root + code="ASTER" + splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) + splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") + app=eficas.EFICAS(root,code=code) + j=app.bureau.newJDC() + jdcdisplay=app.bureau.JDCDisplay_courant + init_common(root,jdcdisplay) + + # commande DEBUT + co=j.addentite("DEBUT",0) + # commande FIN + co=j.addentite("FIN",1) + + jdctree=jdcdisplay.tree.tree.children[0] + panel=select_child("DEBUT",jdctree) + panel=create_command("LIRE_MAILLAGE",panel) + panel=nomme_concept("MA",panel) + + panel=create_command("AFFE_MODELE",panel) + command=panel.node + select_child("MAILLAGE",command) + panel=select_node(command) + panel=create_mocle("AFFE",panel) + parent=panel.node + panel=select_child("PHENOMENE",parent) + choose_valeur("MECANIQUE",panel) + panel=select_child("b_mecanique",parent) + panel=select_child("MODELISATION",panel.node) + add_valeur_into("3D",panel) + add_valeur_into("3D_FLUIDE",panel) + valider_valeur(panel) + panel=select_node(parent) + panel=create_mocle("TOUT",panel) + choose_valeur("OUI",panel) + panel=select_node(command) + panel=nomme_concept("MO",panel) + + assert j.isvalid(),j.report() diff --git a/Tests/OldTestsTk/testihm9/testihm3.py b/Tests/OldTestsTk/testihm9/testihm3.py new file mode 100644 index 00000000..f96a73b8 --- /dev/null +++ b/Tests/OldTestsTk/testihm9/testihm3.py @@ -0,0 +1,93 @@ +# -*- coding: utf-8 -*- +# Modules Python +import os +import unittest +import difflib +import compare +import sys +import Tkinter + +# Modules Eficas +import prefs +from Editeur import session +from InterfaceTK import eficas_go,splash,eficas,images +from common import * + + +class TestCase(unittest.TestCase): + def setUp(self): + self.root = Tkinter.Tk() + images.update_cache() + # Analyse des arguments de la ligne de commande + options=session.parse([]) + options.cata="petit" + pass + + def tearDown(self): + self.root.destroy() + init_common(None,None) + pass + + def test000(self): + root=self.root + code="ASTER" + splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) + splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") + app=eficas.EFICAS(root,code=code) + j=app.bureau.newJDC() + jdcdisplay=app.bureau.JDCDisplay_courant + init_common(root,jdcdisplay) + + # commande DEBUT + co=j.addentite("DEBUT",0) + # commande FIN + co=j.addentite("FIN",1) + + jdctree=jdcdisplay.tree.tree.children[0] + panel=select_child("DEBUT",jdctree) + panel=create_command("TESTS_VALID",panel) + command=panel.node + panel=select_child("LongStr",command) + set_valeur("aaa",panel) + panel=select_child("ListStr",command) + add_valeur("aaa",panel) + add_valeur("bbbb,ccc",panel) + valider_valeur(panel) + panel=select_child("PairVal",command) + add_valeur(2,panel) + add_valeur("4,6",panel) + valider_valeur(panel) + panel=select_child("RangeVal",command) + set_valeur(4,panel) + panel=select_child("CardVal",command) + add_valeur("4,6,5,7",panel) + valider_valeur(panel) + panel=select_child("EnumVal",command) + choose_valeur(3,panel) + panel=select_child("OrdList",command) + add_valeur("4,6,5,7",panel) + valider_valeur(panel) + panel=select_child("OrdList2",command) + add_valeur_into(2,panel) + valider_valeur(panel) + panel=select_child("TypeVal",command) + set_valeur(5,panel) + panel=select_child("Compul",command) + add_valeur("2",panel) + add_valeur("1",panel) + valider_valeur(panel) + panel=select_child("CompulInto",command) + add_valeur_into(2,panel) + add_valeur_into(1,panel) + valider_valeur(panel) + panel=select_child("Norep",command) + add_valeur("2",panel) + valider_valeur(panel) + panel=select_child("NorepInto",command) + add_valeur_into(2,panel) + valider_valeur(panel) + + panel=select_node(command) + panel=nomme_concept("MA",panel) + + assert j.isvalid(),j.report() diff --git a/Tests/OldTestsTk/testihm9/testihm4.py b/Tests/OldTestsTk/testihm9/testihm4.py new file mode 100644 index 00000000..20e44bb1 --- /dev/null +++ b/Tests/OldTestsTk/testihm9/testihm4.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Modules Python +import os +import unittest +import difflib +import compare +import sys +import Tkinter + +# Modules Eficas +import prefs +from Editeur import session +from InterfaceTK import eficas_go,splash,eficas,images +from common import * + + +class TestCase(unittest.TestCase): + def setUp(self): + self.root = Tkinter.Tk() + images.update_cache() + # Analyse des arguments de la ligne de commande + options=session.parse([]) + options.cata="v9" + pass + + def tearDown(self): + self.root.destroy() + init_common(None,None) + pass + + def test000(self): + root=self.root + code="ASTER" + splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) + splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") + app=eficas.EFICAS(root,code=code) + file=os.path.join(prefs.INSTALLDIR,"Tests/testelem/az.comm") + j=app.bureau.openJDC(file=file) + jdcdisplay=app.bureau.JDCDisplay_courant + init_common(root,jdcdisplay) + jdctree=jdcdisplay.tree.tree.children[0] + #commentariser commande MACRO_MATR_ASSE + panel=select_child("MACRO_MATR_ASSE",jdctree) + panel=comment_command(panel) + #decommentariser commande MACRO_MATR_ASSE + panel=uncomment_command(panel) + #creation commande commentée + panel=create_command("LIRE_MAILLAGE",panel) + panel=comment_command(panel) + panel=change_commandcomm("mm=LIRE_MAILLAGE(INFO=2,UNITE=21)",panel) + panel=uncomment_command(panel) + panel=select_child("DEFI_FONCTION",jdctree) + delete_node(panel) + + assert j.isvalid(),j.report() diff --git a/Tests/compare.py b/Tests/compare.py deleted file mode 100644 index f81a49e1..00000000 --- a/Tests/compare.py +++ /dev/null @@ -1,68 +0,0 @@ -# -*- coding: iso-8859-1 -*- -import re - -BLANKLINE_MARKER = '' -ELLIPSIS_MARKER = '...' -True=1 -False=0 - -def check(want,got): - if got == want: return True - - # Replace in want with a blank line. - want = re.sub('(?m)^%s\s*?$' % re.escape(BLANKLINE_MARKER), - '', want) - # If a line in got contains only spaces, then remove the - # spaces. - got = re.sub('(?m)^\s*?$', '', got) - if got == want: - return True - - if _ellipsis_match(want, got): - return True - - return False - -def _ellipsis_match(want, got): - if ELLIPSIS_MARKER not in want: - return want == got - - # Find "the real" strings. - ws = want.split(ELLIPSIS_MARKER) - assert len(ws) >= 2 - - # Deal with exact matches possibly needed at one or both ends. - startpos, endpos = 0, len(got) - w = ws[0] - if w: # starts with exact match - if got.startswith(w): - startpos = len(w) - del ws[0] - else: - return False - w = ws[-1] - if w: # ends with exact match - if got.endswith(w): - endpos -= len(w) - del ws[-1] - else: - return False - - if startpos > endpos: - # Exact end matches required more characters than we have, as in - # _ellipsis_match('aa...aa', 'aaa') - return False - - # For the rest, we only need to find the leftmost non-overlapping - # match for each piece. If there's no overall match that way alone, - # there's no overall match period. - for w in ws: - # w may be '' at times, if there are consecutive ellipses, or - # due to an ellipsis at the start or end of `want`. That's OK. - # Search for an empty string succeeds, and doesn't change startpos. - startp = got.find(w, startpos, endpos) - if startp < 0: - return False - startpos = startp + len(w) - - return True 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/old/compare.py b/Tests/old/compare.py new file mode 100644 index 00000000..f81a49e1 --- /dev/null +++ b/Tests/old/compare.py @@ -0,0 +1,68 @@ +# -*- coding: iso-8859-1 -*- +import re + +BLANKLINE_MARKER = '' +ELLIPSIS_MARKER = '...' +True=1 +False=0 + +def check(want,got): + if got == want: return True + + # Replace in want with a blank line. + want = re.sub('(?m)^%s\s*?$' % re.escape(BLANKLINE_MARKER), + '', want) + # If a line in got contains only spaces, then remove the + # spaces. + got = re.sub('(?m)^\s*?$', '', got) + if got == want: + return True + + if _ellipsis_match(want, got): + return True + + return False + +def _ellipsis_match(want, got): + if ELLIPSIS_MARKER not in want: + return want == got + + # Find "the real" strings. + ws = want.split(ELLIPSIS_MARKER) + assert len(ws) >= 2 + + # Deal with exact matches possibly needed at one or both ends. + startpos, endpos = 0, len(got) + w = ws[0] + if w: # starts with exact match + if got.startswith(w): + startpos = len(w) + del ws[0] + else: + return False + w = ws[-1] + if w: # ends with exact match + if got.endswith(w): + endpos -= len(w) + del ws[-1] + else: + return False + + if startpos > endpos: + # Exact end matches required more characters than we have, as in + # _ellipsis_match('aa...aa', 'aaa') + return False + + # For the rest, we only need to find the leftmost non-overlapping + # match for each piece. If there's no overall match that way alone, + # there's no overall match period. + for w in ws: + # w may be '' at times, if there are consecutive ellipses, or + # due to an ellipsis at the start or end of `want`. That's OK. + # Search for an empty string succeeds, and doesn't change startpos. + startp = got.find(w, startpos, endpos) + if startp < 0: + return False + startpos = startp + len(w) + + return True 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/Tests/testihm/common.py b/Tests/testihm/common.py deleted file mode 100644 index ebad6afc..00000000 --- a/Tests/testihm/common.py +++ /dev/null @@ -1,204 +0,0 @@ -# -*- coding: utf-8 -*- - -from tkMessageBox import showinfo -root=None -jdcdisplay=None - -class UnKnownNode(Exception):pass - -def init_common(r,j): - global root,jdcdisplay - root=r - jdcdisplay=j - -def KP_return(): - root.event_generate("") - root.update() - -def delete_node(panel): - panel.node.delete() - -def uncomment_command(panel): - panel.bouton_unc.invoke() - root.update() - panel=jdcdisplay.panel_courant - return panel - -def comment_command(panel): - panel.nb.selectpage('Commentaire') - panel.comment_commande() - root.update() - panel=jdcdisplay.panel_courant - return panel - -def create_mocle(nom,panel): - panel.nb.selectpage('Mocles') - panel.Liste.afficheMot(nom) - root.update() - label=panel.Liste.dico_labels[nom] - label.event_generate("") - root.event_generate("") - root.update() - return jdcdisplay.panel_courant - -def change_commandcomm(text,panel): - panel.widget_text.setvalue(text) - root.update() - panel.bouton_val.invoke() - return panel - -def create_command(nom,panel): - panel.nb.selectpage('Commande') - root.update() - panel.command_entry.setentry(nom) - panel.command_entry.component('entry').focus_set() - root.event_generate("") - root.update() - label=panel.liste_command.dico_labels[nom] - label.event_generate("") - label.event_generate("") - #root.event_generate("") - root.update() - panel=jdcdisplay.panel_courant - return panel - -def create_comment(text,panel): - panel.nb.selectpage('Commentaire') - panel.ajout_commentaire() - root.update() - panel=jdcdisplay.panel_courant - panel.widget_text.setvalue(text) - root.update() - panel.bouton_val.invoke() - #panel.change_valeur() - return panel - -def create_param(nom,valeur,panel): - panel.nb.selectpage('Commentaire') - panel.ajout_parametre() - root.update() - panel=jdcdisplay.panel_courant - if nom: - panel.entry_nom.delete(0,"end") - panel.entry_nom.insert(0,nom) - panel.entry_nom.event_generate("") - panel.entry_val.delete(0,"end") - panel.entry_val.insert(0,valeur) - panel.entry_val.event_generate("") - panel.bouton_val.invoke() - root.update() - return panel - -def create_formule(nom,args,expr,panel): - panel=create_command("FORMULE",panel) - panel.entry_nom.delete(0,"end") - panel.entry_nom.insert(0,nom) - panel.entry_nom.event_generate("") - panel.entry_arg.delete(0,"end") - panel.entry_arg.insert(0,args) - panel.entry_arg.event_generate("") - panel.entry_exp.delete(0,"end") - panel.entry_exp.insert(0,expr) - panel.entry_exp.event_generate("") - panel.bouton_val.invoke() - root.update() - return panel - -def nomme_concept(nom,panel): - panel.nb.selectpage('Concept') - root.update() - panel._any.delete(0,"end") - panel._any.insert(0,nom) - panel.but_ok.invoke() - root.update() - return jdcdisplay.panel_courant - -def select_mcf(nom,ind,node): - panel=select_child(nom,node) - parent=panel.node - parent.expand() - parent.select_next(ind) - panel=jdcdisplay.panel_courant - panel.node.expand() - return panel - -def select_child(nom,node): - """node est le parent dont on veut le fils nom""" - for n in node.children: - if n.item.nom == nom: - n.select() - root.update() - panel= jdcdisplay.panel_courant - panel.node.expand() - return panel - raise UnKnownNode(nom) - -def select_node(node): - node.select() - node.expand() - root.update() - return jdcdisplay.panel_courant - -def choose_valeur(valeur,panel): - panel.Liste_choix.afficheMot(valeur) - root.update() - label=panel.Liste_choix.dico_labels[valeur] - label.event_generate("") - label.event_generate("") - root.update() - -def choose_sdco(valeur,panel): - i = list(panel.listbox.get(0, 'end')).index(valeur) - panel.listbox.component("listbox").selection_set(i) - panel.listbox.component("listbox").focus_set() - panel.listbox.component("listbox").event_generate("") - root.update() - -def choose_assd(valeur,panel): - i = list(panel.listbox.get(0, 'end')).index(valeur) - panel.listbox.component("listbox").selection_set(i) - panel.but_val.invoke() - root.update() - -def set_valeur(valeur,panel): - panel.entry.delete(0,"end") - panel.entry.insert(0,valeur) - panel.entry.event_generate("") - root.update() - -def set_sdco(valeur,panel): - panel.entry_co.delete(0,"end") - panel.entry_co.insert(0,valeur) - panel.entry_co.event_generate("") - root.update() - -def set_complexe(valeur,panel): - panel.entry3.setentry(valeur) - panel.entry3.component('entry').focus_set() - panel.entry3.event_generate("") - root.update() - -def add_valeur_into(valeur,panel): - label=panel.Liste_choix.dico_labels[valeur] - panel.Liste_choix.afficheMot(valeur) - root.update() - label.event_generate("<1>") - panel.bouton_add.invoke() - root.update() - -def add_valeur(valeur,panel): - panel.entry.delete(0,"end") - panel.entry.insert(0,valeur) - panel.entry.event_generate("") - root.update() - -def valider_valeur(panel): - panel.bouton_accepter.invoke() - root.update() - -def copier_coller(): - root.event_generate("") - root.event_generate("") - root.update() - return jdcdisplay.panel_courant - diff --git a/Tests/testihm/testihm1.py b/Tests/testihm/testihm1.py deleted file mode 100644 index dcf246d0..00000000 --- a/Tests/testihm/testihm1.py +++ /dev/null @@ -1,337 +0,0 @@ -# -*- coding: utf-8 -*- -# Modules Python -import os -import unittest -import difflib -import compare -import sys -import Tkinter - -# Modules Eficas -import prefs -from Editeur import session -from InterfaceTK import eficas_go -from InterfaceTK import splash -from InterfaceTK import eficas -from InterfaceTK import images -from common import * - -version='v8' - -class TestCase(unittest.TestCase): - def setUp(self): - self.root = Tkinter.Tk() - images.update_cache() - # Analyse des arguments de la ligne de commande - options=session.parse([]) - options.cata=version - pass - - def tearDown(self): - self.root.destroy() - init_common(None,None) - pass - - def test000(self): - root=self.root - code="ASTER" - splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) - splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") - app=eficas.EFICAS(root,code=code) - j=app.bureau.newJDC() - jdcdisplay=app.bureau.JDCDisplay_courant - init_common(root,jdcdisplay) - - # commande DEBUT - co=j.addentite("DEBUT",0) - # commande FIN - co=j.addentite("FIN",1) - - jdctree=jdcdisplay.tree.tree.children[0] - panel=select_child("DEBUT",jdctree) - - panel=create_param("P1",9.8,panel) - panel=create_param("P2",8.8,panel) - panel=create_param("P3",7,panel) - panel=create_param("P4","[2,3,4]",panel) - panel=create_param("P5","P3*P1",panel) - panel=create_param(None,"P1-3",panel) - panel=create_comment("Pas trouve shellpanel",panel) - - #commnde LIRE_MAILLAGE - panel=create_command("LIRE_MAILLAGE",panel) - command=panel.node - panel=nomme_concept("MAILLA2",panel) - panel=select_node(command) - panel=create_mocle("UNITE",panel) - panel=set_valeur("P4[1]",panel) - command.collapse() - panel=select_node(command) - #FORMULE - panel=create_formule("az","a,z","a+z",panel) - #commande AFFE_MODELE - panel=create_command("AFFE_MODELE",panel) - command=panel.node - select_child("MAILLAGE",command) - panel=select_node(command) - panel=create_mocle("AFFE",panel) - parent=panel.node - panel=select_child("PHENOMENE",parent) - choose_valeur("MECANIQUE",panel) - panel=select_child("b_mecanique",parent) - panel=select_child("MODELISATION",panel.node) - add_valeur_into("3D",panel) - add_valeur_into("3D_FLUIDE",panel) - valider_valeur(panel) - panel=select_node(parent) - panel=create_mocle("TOUT",panel) - choose_valeur("OUI",panel) - panel=select_node(command) - panel=nomme_concept("MO",panel) - command.collapse() - #fin commande AFFE_MODELE - panel=copier_coller() - command=panel.node - panel=create_mocle("AFFE",panel) - panel=select_node(command) - panel=create_mocle("AFFE",panel) - panel=select_mcf("AFFE",1,command) - parent=panel.node - panel=create_mocle("GROUP_NO",panel) - add_valeur("'GNP3','GNP5','GNP6','GNP7','GNP8','GNP9','GNP10','GNP11','GNP12'",panel) - valider_valeur(panel) - panel=select_child("PHENOMENE",parent) - choose_valeur("ACOUSTIQUE",panel) - panel=select_child("b_acoustique",parent) - panel=select_child("MODELISATION",panel.node) - add_valeur_into("PLAN",panel) - valider_valeur(panel) - - panel=select_mcf("AFFE",2,command) - parent=panel.node - panel=create_mocle("GROUP_MA",panel) - add_valeur("MASSES",panel) - valider_valeur(panel) - panel=select_child("PHENOMENE",parent) - choose_valeur("THERMIQUE",panel) - panel=select_child("b_thermique",parent) - panel=select_child("MODELISATION",panel.node) - add_valeur_into("COQUE",panel) - valider_valeur(panel) - - panel=select_node(command) - panel=nomme_concept("AFFE1",panel) - command.collapse() - #fin commande AFFE_MODELE - #commande AFFE_CARA_ELEM - panel=create_command("AFFE_CARA_ELEM",panel) - command=panel.node - panel=select_node(command) - panel=create_mocle("POUTRE",panel) - parent=panel.node - panel=select_child("SECTION",parent) - choose_valeur("CERCLE",panel) - panel=select_child("b_cercle",parent) - panel=select_child("b_constant",panel.node) - p=panel.node - panel=select_child("CARA",p) - add_valeur_into("R",panel) - add_valeur_into("EP",panel) - valider_valeur(panel) - panel=select_child("VALE",p) - add_valeur("1,2",panel) - valider_valeur(panel) - panel=select_node(parent) - panel=create_mocle("GROUP_MA",panel) - add_valeur("GR1,GR2",panel) - valider_valeur(panel) - panel=select_child("MODELE",command) - choose_assd("MO",panel) - panel=select_node(command) - panel=nomme_concept("CARA",panel) - command.collapse() - #fin commande AFFE_CARA_ELEM - panel=create_command("DEFI_FONCTION",panel) - command=panel.node - panel=create_mocle("VALE",panel) - add_valeur("5.0,3.0",panel) - add_valeur("P4[1],P3",panel) - valider_valeur(panel) - panel=select_child("NOM_PARA",command) - choose_valeur("DX",panel) - panel=select_node(command) - panel=nomme_concept("F1",panel) - command.collapse() - #fin DEFI_FONCTION - panel=create_command("DEFI_FONCTION",panel) - command=panel.node - panel=create_mocle("VALE_C",panel) - add_valeur("5.0,7.0,9.0",panel) - add_valeur("9.0,8.0,7.0",panel) - valider_valeur(panel) - panel=select_child("NOM_PARA",command) - choose_valeur("DRX",panel) - panel=select_node(command) - panel=nomme_concept("F3",panel) - command.collapse() - #fin DEFI_FONCTION -#MATER2=DEFI_MATERIAU(ELAS=_F(E=100000000000.0, -# NU=0.0,), -# ECRO_ASYM_LINE=_F(DC_SIGM_EPSI=0.0, -# SY_C=200000000.0, -# DT_SIGM_EPSI=0.0, -# SY_T=50000000.0,),); - - panel=create_command("DEFI_MATERIAU",panel) - command=panel.node - panel=create_mocle("ELAS",panel) - p=panel.node - panel=select_child("E",p) - set_valeur("100000000000.0",panel) - panel=select_child("NU",p) - set_valeur("0.0",panel) - panel=select_node(command) - panel=create_mocle("ECRO_ASYM_LINE",panel) - p=panel.node - panel=select_child("DC_SIGM_EPSI",p) - set_valeur("0.0",panel) - panel=select_child("SY_C",p) - set_valeur("200000000.0",panel) - panel=select_child("DT_SIGM_EPSI",p) - set_valeur("0.0",panel) - panel=select_child("SY_T",p) - set_valeur("50000000.0",panel) - panel=select_node(command) - panel=nomme_concept("MATER2",panel) - command.collapse() - #fin DEFI_MATERIAU - #PS1=DEFI_PARA_SENSI(VALE=1.0,); - #PS2=DEFI_PARA_SENSI(VALE=1.0,); - #PS3=DEFI_PARA_SENSI(VALE=1.0,); - panel=create_command("DEFI_PARA_SENSI",panel) - command=panel.node - panel=select_child("VALE",command) - set_valeur("1.0",panel) - panel=select_node(command) - panel=nomme_concept("PS1",panel) - command.collapse() - panel=create_command("DEFI_PARA_SENSI",panel) - command=panel.node - panel=select_child("VALE",command) - set_valeur("1.0",panel) - panel=select_node(command) - panel=nomme_concept("PS2",panel) - command.collapse() - panel=create_command("DEFI_PARA_SENSI",panel) - command=panel.node - panel=select_child("VALE",command) - set_valeur("1.0",panel) - panel=select_node(command) - panel=nomme_concept("PS3",panel) - command.collapse() -#CHMAT2=AFFE_MATERIAU(MAILLAGE=MAIL, -# AFFE=_F(TOUT='OUI', -# MATER=MATER2,),); - panel=create_command("AFFE_MATERIAU",panel) - command=panel.node - panel=select_child("MAILLAGE",command) - panel=select_child("AFFE",command) - affe=panel.node - panel=create_mocle("TOUT",panel) - choose_valeur("OUI",panel) - panel=select_child("MATER",affe) - add_valeur_into("MATER2",panel) - valider_valeur(panel) - panel=select_node(command) - panel=nomme_concept("CHMAT2",panel) - command.collapse() -#AAAZ=AFFE_CHAR_THER(MODELE=AFFE1, -# TEMP_IMPO=_F(TOUT='OUI', -# TEMP=0.0,),); - panel=create_command("AFFE_CHAR_THER",panel) - command=panel.node - panel=create_mocle("TEMP_IMPO",panel) - temp=panel.node - panel=create_mocle("TOUT",panel) - choose_valeur("OUI",panel) - panel=select_node(temp) - panel=create_mocle("TEMP",panel) - panel=set_valeur("0.0",panel) - panel=select_child("MODELE",command) - choose_assd("AFFE1",panel) - panel=select_node(command) - panel=nomme_concept("AAAZ",panel) - command.collapse() -#TH1=THER_LINEAIRE(MODELE=AFFE1, -# CHAM_MATER=CHMAT2, -# EXCIT=_F(CHARGE=AAAZ,), -# SENSIBILITE=(PS1,PS2,),); - panel=create_command("THER_LINEAIRE",panel) - command=panel.node - panel=select_child("MODELE",command) - choose_assd("AFFE1",panel) - panel=select_child("CHAM_MATER",command) - panel=select_child("EXCIT",command) - panel=select_child("CHARGE",panel.node) - panel=select_node(command) - panel=create_mocle("SENSIBILITE",panel) - add_valeur_into("PS1",panel) - add_valeur_into("PS2",panel) - valider_valeur(panel) - panel=select_node(command) - panel=nomme_concept("TH1",panel) - command.collapse() -#ACA1=AFFE_CHAR_ACOU(MODELE=AFFE1, -# PRES_IMPO=_F(TOUT='OUI', -# PRES=('RI',3.0,3.0,),),); - panel=create_command("AFFE_CHAR_ACOU",panel) - command=panel.node - panel=create_mocle("PRES_IMPO",panel) - pres=panel.node - panel=create_mocle("TOUT",panel) - choose_valeur("OUI",panel) - panel=select_child("MODELE",command) - choose_assd("AFFE1",panel) - panel=select_child("PRES",pres) - set_complexe("'RI',3.0,3.0",panel) - panel=select_node(command) - panel=nomme_concept("ACA1",panel) - command.collapse() -#MACRO_MATR_ASSE(MODELE=AFFE1, -# NUME_DDL=CO('DDL1'), -# MATR_ASSE=_F(MATRICE=CO('MAT1'), -# OPTION='RIGI_THER',),); - panel=create_command("MACRO_MATR_ASSE",panel) - command=panel.node - panel=select_child("NUME_DDL",command) - set_sdco("DDL1",panel) - panel=select_child("MODELE",command) - choose_assd("AFFE1",panel) - panel=select_child("MATR_ASSE",command) - matr=panel.node - panel=select_child("OPTION",matr) - choose_valeur("RIGI_THER",panel) - panel=select_child("MATRICE",matr) - set_sdco("MAT1",panel) - panel=select_node(command) - command.collapse() -#MACRO_MATR_ASSE(MODELE=AFFE1, -# NUME_DDL=DDL1, -# MATR_ASSE=_F(MATRICE=MAT1, -# OPTION='RIGI_THER',),); - panel=create_command("MACRO_MATR_ASSE",panel) - command=panel.node - panel=select_child("NUME_DDL",command) - choose_sdco("DDL1",panel) - panel=select_child("MODELE",command) - choose_assd("AFFE1",panel) - panel=select_child("MATR_ASSE",command) - matr=panel.node - panel=select_child("OPTION",matr) - choose_valeur("RIGI_THER",panel) - panel=select_child("MATRICE",matr) - set_sdco("MAT2",panel) - panel=select_node(command) - command.collapse() - - assert j.isvalid(),j.report() diff --git a/Tests/testihm/testihm2.py b/Tests/testihm/testihm2.py deleted file mode 100644 index 0bb15fbb..00000000 --- a/Tests/testihm/testihm2.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- -# Modules Python -import os -import unittest -import difflib -import compare -import sys -import Tkinter - -# Modules Eficas -import prefs -from Editeur import session -from InterfaceTK import eficas_go,splash,eficas,images -from common import * - - -class TestCase(unittest.TestCase): - def setUp(self): - self.root = Tkinter.Tk() - images.update_cache() - # Analyse des arguments de la ligne de commande - options=session.parse([]) - options.cata="v8" - pass - - def tearDown(self): - self.root.destroy() - init_common(None,None) - pass - - def test000(self): - root=self.root - code="ASTER" - splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) - splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") - app=eficas.EFICAS(root,code=code) - j=app.bureau.newJDC() - jdcdisplay=app.bureau.JDCDisplay_courant - init_common(root,jdcdisplay) - - # commande DEBUT - co=j.addentite("DEBUT",0) - # commande FIN - co=j.addentite("FIN",1) - - jdctree=jdcdisplay.tree.tree.children[0] - panel=select_child("DEBUT",jdctree) - panel=create_command("LIRE_MAILLAGE",panel) - panel=nomme_concept("MA",panel) - - panel=create_command("AFFE_MODELE",panel) - command=panel.node - select_child("MAILLAGE",command) - panel=select_node(command) - panel=create_mocle("AFFE",panel) - parent=panel.node - panel=select_child("PHENOMENE",parent) - choose_valeur("MECANIQUE",panel) - panel=select_child("b_mecanique",parent) - panel=select_child("MODELISATION",panel.node) - add_valeur_into("3D",panel) - add_valeur_into("3D_FLUIDE",panel) - valider_valeur(panel) - panel=select_node(parent) - panel=create_mocle("TOUT",panel) - choose_valeur("OUI",panel) - panel=select_node(command) - panel=nomme_concept("MO",panel) - - assert j.isvalid(),j.report() diff --git a/Tests/testihm/testihm3.py b/Tests/testihm/testihm3.py deleted file mode 100644 index f96a73b8..00000000 --- a/Tests/testihm/testihm3.py +++ /dev/null @@ -1,93 +0,0 @@ -# -*- coding: utf-8 -*- -# Modules Python -import os -import unittest -import difflib -import compare -import sys -import Tkinter - -# Modules Eficas -import prefs -from Editeur import session -from InterfaceTK import eficas_go,splash,eficas,images -from common import * - - -class TestCase(unittest.TestCase): - def setUp(self): - self.root = Tkinter.Tk() - images.update_cache() - # Analyse des arguments de la ligne de commande - options=session.parse([]) - options.cata="petit" - pass - - def tearDown(self): - self.root.destroy() - init_common(None,None) - pass - - def test000(self): - root=self.root - code="ASTER" - splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) - splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") - app=eficas.EFICAS(root,code=code) - j=app.bureau.newJDC() - jdcdisplay=app.bureau.JDCDisplay_courant - init_common(root,jdcdisplay) - - # commande DEBUT - co=j.addentite("DEBUT",0) - # commande FIN - co=j.addentite("FIN",1) - - jdctree=jdcdisplay.tree.tree.children[0] - panel=select_child("DEBUT",jdctree) - panel=create_command("TESTS_VALID",panel) - command=panel.node - panel=select_child("LongStr",command) - set_valeur("aaa",panel) - panel=select_child("ListStr",command) - add_valeur("aaa",panel) - add_valeur("bbbb,ccc",panel) - valider_valeur(panel) - panel=select_child("PairVal",command) - add_valeur(2,panel) - add_valeur("4,6",panel) - valider_valeur(panel) - panel=select_child("RangeVal",command) - set_valeur(4,panel) - panel=select_child("CardVal",command) - add_valeur("4,6,5,7",panel) - valider_valeur(panel) - panel=select_child("EnumVal",command) - choose_valeur(3,panel) - panel=select_child("OrdList",command) - add_valeur("4,6,5,7",panel) - valider_valeur(panel) - panel=select_child("OrdList2",command) - add_valeur_into(2,panel) - valider_valeur(panel) - panel=select_child("TypeVal",command) - set_valeur(5,panel) - panel=select_child("Compul",command) - add_valeur("2",panel) - add_valeur("1",panel) - valider_valeur(panel) - panel=select_child("CompulInto",command) - add_valeur_into(2,panel) - add_valeur_into(1,panel) - valider_valeur(panel) - panel=select_child("Norep",command) - add_valeur("2",panel) - valider_valeur(panel) - panel=select_child("NorepInto",command) - add_valeur_into(2,panel) - valider_valeur(panel) - - panel=select_node(command) - panel=nomme_concept("MA",panel) - - assert j.isvalid(),j.report() diff --git a/Tests/testihm/testihm4.py b/Tests/testihm/testihm4.py deleted file mode 100644 index 3b3032e4..00000000 --- a/Tests/testihm/testihm4.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# Modules Python -import os -import unittest -import difflib -import compare -import sys -import Tkinter - -# Modules Eficas -import prefs -from Editeur import session -from InterfaceTK import eficas_go,splash,eficas,images -from common import * - - -class TestCase(unittest.TestCase): - def setUp(self): - self.root = Tkinter.Tk() - images.update_cache() - # Analyse des arguments de la ligne de commande - options=session.parse([]) - options.cata="v8" - pass - - def tearDown(self): - self.root.destroy() - init_common(None,None) - pass - - def test000(self): - root=self.root - code="ASTER" - splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) - splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") - app=eficas.EFICAS(root,code=code) - file=os.path.join(prefs.INSTALLDIR,"Tests/testelem/az.comm") - j=app.bureau.openJDC(file=file) - jdcdisplay=app.bureau.JDCDisplay_courant - init_common(root,jdcdisplay) - jdctree=jdcdisplay.tree.tree.children[0] - #commentariser commande MACRO_MATR_ASSE - panel=select_child("MACRO_MATR_ASSE",jdctree) - panel=comment_command(panel) - #decommentariser commande MACRO_MATR_ASSE - panel=uncomment_command(panel) - #creation commande commentée - panel=create_command("LIRE_MAILLAGE",panel) - panel=comment_command(panel) - panel=change_commandcomm("mm=LIRE_MAILLAGE(INFO=2,UNITE=21)",panel) - panel=uncomment_command(panel) - panel=select_child("DEFI_FONCTION",jdctree) - delete_node(panel) - - assert j.isvalid(),j.report() diff --git a/Tests/testihm7/common.py b/Tests/testihm7/common.py deleted file mode 100644 index 37c180cd..00000000 --- a/Tests/testihm7/common.py +++ /dev/null @@ -1,206 +0,0 @@ -# -*- coding: utf-8 -*- - -from tkMessageBox import showinfo -root=None -jdcdisplay=None - -class UnKnownNode(Exception):pass - -def init_common(r,j): - global root,jdcdisplay - root=r - jdcdisplay=j - -def KP_return(): - root.event_generate("") - root.update() - -def delete_node(panel): - panel.node.delete() - -def uncomment_command(panel): - panel.bouton_unc.invoke() - root.update() - panel=jdcdisplay.panel_courant - return panel - -def comment_command(panel): - panel.nb.selectpage('Commentaire') - panel.comment_commande() - root.update() - panel=jdcdisplay.panel_courant - return panel - -def create_mocle(nom,panel): - panel.nb.selectpage('Mocles') - panel.Liste.afficheMot(nom) - root.update() - label=panel.Liste.dico_labels[nom] - label.event_generate("") - root.event_generate("") - root.update() - return jdcdisplay.panel_courant - -def change_commandcomm(text,panel): - panel.widget_text.setvalue(text) - root.update() - panel.bouton_val.invoke() - return panel - -def create_command(nom,panel): - panel.nb.selectpage('Commande') - root.update() - panel.command_entry.setentry(nom) - panel.command_entry.component('entry').focus_set() - root.event_generate("") - root.update() - label=panel.liste_command.dico_labels[nom] - label.event_generate("") - label.event_generate("") - #root.event_generate("") - root.update() - panel=jdcdisplay.panel_courant - return panel - -def create_comment(text,panel): - panel.nb.selectpage('Commentaire') - panel.ajout_commentaire() - root.update() - panel=jdcdisplay.panel_courant - panel.widget_text.setvalue(text) - root.update() - panel.bouton_val.invoke() - #panel.change_valeur() - return panel - -def create_param(nom,valeur,panel): - panel.nb.selectpage('Commentaire') - panel.ajout_parametre() - root.update() - panel=jdcdisplay.panel_courant - if nom: - panel.entry_nom.delete(0,"end") - panel.entry_nom.insert(0,nom) - panel.entry_nom.event_generate("") - panel.entry_val.delete(0,"end") - panel.entry_val.insert(0,valeur) - panel.entry_val.event_generate("") - panel.bouton_val.invoke() - root.update() - return panel - -def create_formule(nom,args,expr,panel): - panel=create_command("FORMULE",panel) - panel.entry_nom.delete(0,"end") - panel.entry_nom.insert(0,nom) - panel.entry_nom.event_generate("") - panel.entry_arg.delete(0,"end") - panel.entry_arg.insert(0,args) - panel.entry_arg.event_generate("") - panel.entry_exp.delete(0,"end") - panel.entry_exp.insert(0,expr) - panel.entry_exp.event_generate("") - panel.bouton_val.invoke() - root.update() - return panel - -def nomme_concept(nom,panel): - panel.nb.selectpage('Concept') - root.update() - panel._any.delete(0,"end") - panel._any.insert(0,nom) - panel.but_ok.invoke() - root.update() - return jdcdisplay.panel_courant - -def select_mcf(nom,ind,node): - panel=select_child(nom,node) - parent=panel.node - parent.expand() - parent.select_next(ind) - panel=jdcdisplay.panel_courant - panel.node.expand() - return panel - -def select_child(nom,node): - """node est le parent dont on veut le fils nom""" - for n in node.children: - if n.item.nom == nom: - n.select() - root.update() - panel= jdcdisplay.panel_courant - panel.node.expand() - return panel - raise UnKnownNode(nom) - -def select_node(node): - node.select() - node.expand() - root.update() - return jdcdisplay.panel_courant - -def choose_valeur(valeur,panel): - panel.Liste_choix.afficheMot(valeur) - root.update() - label=panel.Liste_choix.dico_labels[valeur] - label.event_generate("") - label.event_generate("") - root.update() - -def choose_sdco(valeur,panel): - i = list(panel.listbox.get(0, 'end')).index(valeur) - panel.listbox.component("listbox").selection_set(i) - panel.listbox.component("listbox").focus_set() - panel.listbox.component("listbox").event_generate("") - root.update() - -def choose_assd(valeur,panel): - i = list(panel.listbox.get(0, 'end')).index(valeur) - panel.listbox.component("listbox").selection_set(i) - panel.but_val.invoke() - root.update() - -def set_valeur(valeur,panel): - panel.entry.delete(0,"end") - panel.entry.insert(0,valeur) - panel.entry.event_generate("") - root.update() - -def set_sdco(valeur,panel): - panel.b_co.invoke('OUI') - root.update() - panel.entry_co.delete(0,"end") - panel.entry_co.insert(0,valeur) - panel.entry_co.event_generate("") - root.update() - -def set_complexe(valeur,panel): - panel.entry3.setentry(valeur) - panel.entry3.component('entry').focus_set() - panel.entry3.event_generate("") - root.update() - -def add_valeur_into(valeur,panel): - label=panel.Liste_choix.dico_labels[valeur] - panel.Liste_choix.afficheMot(valeur) - root.update() - label.event_generate("<1>") - panel.bouton_add.invoke() - root.update() - -def add_valeur(valeur,panel): - panel.entry.delete(0,"end") - panel.entry.insert(0,valeur) - panel.entry.event_generate("") - root.update() - -def valider_valeur(panel): - panel.bouton_accepter.invoke() - root.update() - -def copier_coller(): - root.event_generate("") - root.event_generate("") - root.update() - return jdcdisplay.panel_courant - diff --git a/Tests/testihm7/testihm1.py b/Tests/testihm7/testihm1.py deleted file mode 100644 index 78590803..00000000 --- a/Tests/testihm7/testihm1.py +++ /dev/null @@ -1,334 +0,0 @@ -# -*- coding: utf-8 -*- -# Modules Python -import os -import unittest -import difflib -import compare -import sys -import Tkinter - -# Modules Eficas -import prefs -from Editeur import session -from InterfaceTK import eficas_go,splash,eficas,images -from common import * - -version='v7' - -class TestCase(unittest.TestCase): - def setUp(self): - self.root = Tkinter.Tk() - images.update_cache() - # Analyse des arguments de la ligne de commande - options=session.parse([]) - options.cata=version - pass - - def tearDown(self): - self.root.destroy() - init_common(None,None) - pass - - def test000(self): - root=self.root - code="ASTER" - splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) - splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") - app=eficas.EFICAS(root,code=code) - j=app.bureau.newJDC() - jdcdisplay=app.bureau.JDCDisplay_courant - init_common(root,jdcdisplay) - - # commande DEBUT - co=j.addentite("DEBUT",0) - # commande FIN - co=j.addentite("FIN",1) - - jdctree=jdcdisplay.tree.tree.children[0] - panel=select_child("DEBUT",jdctree) - - panel=create_param("P1",9.8,panel) - panel=create_param("P2",8.8,panel) - panel=create_param("P3",7,panel) - panel=create_param("P4","[2,3,4]",panel) - panel=create_param("P5","P3*P1",panel) - panel=create_param(None,"P1-3",panel) - panel=create_comment("Pas trouve shellpanel",panel) - - #commnde LIRE_MAILLAGE - panel=create_command("LIRE_MAILLAGE",panel) - command=panel.node - panel=nomme_concept("MAILLA2",panel) - panel=select_node(command) - panel=create_mocle("UNITE",panel) - panel=set_valeur("P4[1]",panel) - command.collapse() - panel=select_node(command) - #FORMULE - panel=create_formule("az","a,z","a+z",panel) - #commande AFFE_MODELE - panel=create_command("AFFE_MODELE",panel) - command=panel.node - select_child("MAILLAGE",command) - panel=select_node(command) - panel=create_mocle("AFFE",panel) - parent=panel.node - panel=select_child("PHENOMENE",parent) - choose_valeur("MECANIQUE",panel) - panel=select_child("b_mecanique",parent) - panel=select_child("MODELISATION",panel.node) - add_valeur_into("3D",panel) - add_valeur_into("3D_FLUIDE",panel) - valider_valeur(panel) - panel=select_node(parent) - panel=create_mocle("TOUT",panel) - choose_valeur("OUI",panel) - panel=select_node(command) - panel=nomme_concept("MO",panel) - command.collapse() - #fin commande AFFE_MODELE - panel=copier_coller() - command=panel.node - panel=create_mocle("AFFE",panel) - panel=select_node(command) - panel=create_mocle("AFFE",panel) - panel=select_mcf("AFFE",1,command) - parent=panel.node - panel=create_mocle("GROUP_NO",panel) - add_valeur("'GNP3','GNP5','GNP6','GNP7','GNP8','GNP9','GNP10','GNP11','GNP12'",panel) - valider_valeur(panel) - panel=select_child("PHENOMENE",parent) - choose_valeur("ACOUSTIQUE",panel) - panel=select_child("b_acoustique",parent) - panel=select_child("MODELISATION",panel.node) - add_valeur_into("PLAN",panel) - valider_valeur(panel) - - panel=select_mcf("AFFE",2,command) - parent=panel.node - panel=create_mocle("GROUP_MA",panel) - add_valeur("MASSES",panel) - valider_valeur(panel) - panel=select_child("PHENOMENE",parent) - choose_valeur("THERMIQUE",panel) - panel=select_child("b_thermique",parent) - panel=select_child("MODELISATION",panel.node) - add_valeur_into("COQUE",panel) - valider_valeur(panel) - - panel=select_node(command) - panel=nomme_concept("AFFE1",panel) - command.collapse() - #fin commande AFFE_MODELE - #commande AFFE_CARA_ELEM - panel=create_command("AFFE_CARA_ELEM",panel) - command=panel.node - panel=select_node(command) - panel=create_mocle("POUTRE",panel) - parent=panel.node - panel=select_child("SECTION",parent) - choose_valeur("CERCLE",panel) - panel=select_child("b_cercle",parent) - panel=select_child("b_constant",panel.node) - p=panel.node - panel=select_child("CARA",p) - add_valeur_into("R",panel) - add_valeur_into("EP",panel) - valider_valeur(panel) - panel=select_child("VALE",p) - add_valeur("1,2",panel) - valider_valeur(panel) - panel=select_node(parent) - panel=create_mocle("GROUP_MA",panel) - add_valeur("GR1,GR2",panel) - valider_valeur(panel) - panel=select_child("MODELE",command) - choose_assd("MO",panel) - panel=select_node(command) - panel=nomme_concept("CARA",panel) - command.collapse() - #fin commande AFFE_CARA_ELEM - panel=create_command("DEFI_FONCTION",panel) - command=panel.node - panel=create_mocle("VALE",panel) - add_valeur("5.0,3.0",panel) - add_valeur("P4[1],P3",panel) - valider_valeur(panel) - panel=select_child("NOM_PARA",command) - add_valeur("DX",panel) - panel=select_node(command) - panel=nomme_concept("F1",panel) - command.collapse() - #fin DEFI_FONCTION - panel=create_command("DEFI_FONCTION",panel) - command=panel.node - panel=create_mocle("VALE_C",panel) - add_valeur("5.0,7.0,9.0",panel) - add_valeur("9.0,8.0,7.0",panel) - valider_valeur(panel) - panel=select_child("NOM_PARA",command) - add_valeur("DRX",panel) - panel=select_node(command) - panel=nomme_concept("F3",panel) - command.collapse() - #fin DEFI_FONCTION -#MATER2=DEFI_MATERIAU(ELAS=_F(E=100000000000.0, -# NU=0.0,), -# ECRO_ASYM_LINE=_F(DC_SIGM_EPSI=0.0, -# SY_C=200000000.0, -# DT_SIGM_EPSI=0.0, -# SY_T=50000000.0,),); - - panel=create_command("DEFI_MATERIAU",panel) - command=panel.node - panel=create_mocle("ELAS",panel) - p=panel.node - panel=select_child("E",p) - set_valeur("100000000000.0",panel) - panel=select_child("NU",p) - set_valeur("0.0",panel) - panel=select_node(command) - panel=create_mocle("ECRO_ASYM_LINE",panel) - p=panel.node - panel=select_child("DC_SIGM_EPSI",p) - set_valeur("0.0",panel) - panel=select_child("SY_C",p) - set_valeur("200000000.0",panel) - panel=select_child("DT_SIGM_EPSI",p) - set_valeur("0.0",panel) - panel=select_child("SY_T",p) - set_valeur("50000000.0",panel) - panel=select_node(command) - panel=nomme_concept("MATER2",panel) - command.collapse() - #fin DEFI_MATERIAU - #PS1=DEFI_PARA_SENSI(VALE=1.0,); - #PS2=DEFI_PARA_SENSI(VALE=1.0,); - #PS3=DEFI_PARA_SENSI(VALE=1.0,); - panel=create_command("DEFI_PARA_SENSI",panel) - command=panel.node - panel=select_child("VALE",command) - set_valeur("1.0",panel) - panel=select_node(command) - panel=nomme_concept("PS1",panel) - command.collapse() - panel=create_command("DEFI_PARA_SENSI",panel) - command=panel.node - panel=select_child("VALE",command) - set_valeur("1.0",panel) - panel=select_node(command) - panel=nomme_concept("PS2",panel) - command.collapse() - panel=create_command("DEFI_PARA_SENSI",panel) - command=panel.node - panel=select_child("VALE",command) - set_valeur("1.0",panel) - panel=select_node(command) - panel=nomme_concept("PS3",panel) - command.collapse() -#CHMAT2=AFFE_MATERIAU(MAILLAGE=MAIL, -# AFFE=_F(TOUT='OUI', -# MATER=MATER2,),); - panel=create_command("AFFE_MATERIAU",panel) - command=panel.node - panel=select_child("MAILLAGE",command) - panel=select_child("AFFE",command) - affe=panel.node - panel=create_mocle("TOUT",panel) - choose_valeur("OUI",panel) - panel=select_child("MATER",affe) - add_valeur_into("MATER2",panel) - valider_valeur(panel) - panel=select_node(command) - panel=nomme_concept("CHMAT2",panel) - command.collapse() -#AAAZ=AFFE_CHAR_THER(MODELE=AFFE1, -# TEMP_IMPO=_F(TOUT='OUI', -# TEMP=0.0,),); - panel=create_command("AFFE_CHAR_THER",panel) - command=panel.node - panel=create_mocle("TEMP_IMPO",panel) - temp=panel.node - panel=create_mocle("TOUT",panel) - choose_valeur("OUI",panel) - panel=select_node(temp) - panel=create_mocle("TEMP",panel) - panel=set_valeur("0.0",panel) - panel=select_child("MODELE",command) - choose_assd("AFFE1",panel) - panel=select_node(command) - panel=nomme_concept("AAAZ",panel) - command.collapse() -#TH1=THER_LINEAIRE(MODELE=AFFE1, -# CHAM_MATER=CHMAT2, -# EXCIT=_F(CHARGE=AAAZ,), -# SENSIBILITE=(PS1,PS2,),); - panel=create_command("THER_LINEAIRE",panel) - command=panel.node - panel=select_child("MODELE",command) - choose_assd("AFFE1",panel) - panel=select_child("CHAM_MATER",command) - panel=select_child("EXCIT",command) - panel=select_child("CHARGE",panel.node) - panel=select_node(command) - panel=create_mocle("SENSIBILITE",panel) - add_valeur_into("PS1",panel) - add_valeur_into("PS2",panel) - valider_valeur(panel) - panel=select_node(command) - panel=nomme_concept("TH1",panel) - command.collapse() -#ACA1=AFFE_CHAR_ACOU(MODELE=AFFE1, -# PRES_IMPO=_F(TOUT='OUI', -# PRES=('RI',3.0,3.0,),),); - panel=create_command("AFFE_CHAR_ACOU",panel) - command=panel.node - panel=create_mocle("PRES_IMPO",panel) - pres=panel.node - panel=create_mocle("TOUT",panel) - choose_valeur("OUI",panel) - panel=select_child("MODELE",command) - choose_assd("AFFE1",panel) - panel=select_child("PRES",pres) - set_complexe("'RI',3.0,3.0",panel) - panel=select_node(command) - panel=nomme_concept("ACA1",panel) - command.collapse() -#MACRO_MATR_ASSE(MODELE=AFFE1, -# NUME_DDL=CO('DDL1'), -# MATR_ASSE=_F(MATRICE=CO('MAT1'), -# OPTION='RIGI_THER',),); - panel=create_command("MACRO_MATR_ASSE",panel) - command=panel.node - panel=select_child("NUME_DDL",command) - set_sdco("DDL1",panel) - panel=select_child("MODELE",command) - choose_assd("AFFE1",panel) - panel=select_child("MATR_ASSE",command) - matr=panel.node - panel=select_child("OPTION",matr) - choose_valeur("RIGI_THER",panel) - panel=select_child("MATRICE",matr) - set_sdco("MAT1",panel) - panel=select_node(command) - command.collapse() -#MACRO_MATR_ASSE(MODELE=AFFE1, -# NUME_DDL=DDL1, -# MATR_ASSE=_F(MATRICE=MAT1, -# OPTION='RIGI_THER',),); - panel=create_command("MACRO_MATR_ASSE",panel) - command=panel.node - panel=select_child("NUME_DDL",command) - choose_sdco("DDL1",panel) - panel=select_child("MODELE",command) - choose_assd("AFFE1",panel) - panel=select_child("MATR_ASSE",command) - matr=panel.node - panel=select_child("OPTION",matr) - choose_valeur("RIGI_THER",panel) - panel=select_child("MATRICE",matr) - set_sdco("MAT2",panel) - panel=select_node(command) - command.collapse() - - assert j.isvalid(),j.report() diff --git a/Tests/testihm7/testihm2.py b/Tests/testihm7/testihm2.py deleted file mode 100644 index 37de0da2..00000000 --- a/Tests/testihm7/testihm2.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- -# Modules Python -import os -import unittest -import difflib -import compare -import sys -import Tkinter - -# Modules Eficas -import prefs -from Editeur import session -from InterfaceTK import eficas_go,splash,eficas,images -from common import * - - -class TestCase(unittest.TestCase): - def setUp(self): - self.root = Tkinter.Tk() - images.update_cache() - # Analyse des arguments de la ligne de commande - options=session.parse([]) - options.cata="v7" - pass - - def tearDown(self): - self.root.destroy() - init_common(None,None) - pass - - def test000(self): - root=self.root - code="ASTER" - splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) - splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") - app=eficas.EFICAS(root,code=code) - j=app.bureau.newJDC() - jdcdisplay=app.bureau.JDCDisplay_courant - init_common(root,jdcdisplay) - - # commande DEBUT - co=j.addentite("DEBUT",0) - # commande FIN - co=j.addentite("FIN",1) - - jdctree=jdcdisplay.tree.tree.children[0] - panel=select_child("DEBUT",jdctree) - panel=create_command("LIRE_MAILLAGE",panel) - panel=nomme_concept("MA",panel) - - panel=create_command("AFFE_MODELE",panel) - command=panel.node - select_child("MAILLAGE",command) - panel=select_node(command) - panel=create_mocle("AFFE",panel) - parent=panel.node - panel=select_child("PHENOMENE",parent) - choose_valeur("MECANIQUE",panel) - panel=select_child("b_mecanique",parent) - panel=select_child("MODELISATION",panel.node) - add_valeur_into("3D",panel) - add_valeur_into("3D_FLUIDE",panel) - valider_valeur(panel) - panel=select_node(parent) - panel=create_mocle("TOUT",panel) - choose_valeur("OUI",panel) - panel=select_node(command) - panel=nomme_concept("MO",panel) - - assert j.isvalid(),j.report() diff --git a/Tests/testihm7/testihm4.py b/Tests/testihm7/testihm4.py deleted file mode 100644 index 6dbd0025..00000000 --- a/Tests/testihm7/testihm4.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# Modules Python -import os -import unittest -import difflib -import compare -import sys -import Tkinter - -# Modules Eficas -import prefs -from Editeur import session -from InterfaceTK import eficas_go,splash,eficas,images -from common import * - - -class TestCase(unittest.TestCase): - def setUp(self): - self.root = Tkinter.Tk() - images.update_cache() - # Analyse des arguments de la ligne de commande - options=session.parse([]) - options.cata="v7" - pass - - def tearDown(self): - self.root.destroy() - init_common(None,None) - pass - - def test000(self): - root=self.root - code="ASTER" - splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) - splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") - app=eficas.EFICAS(root,code=code) - file=os.path.join(prefs.INSTALLDIR,"Tests/testelem/az.comm") - j=app.bureau.openJDC(file=file) - jdcdisplay=app.bureau.JDCDisplay_courant - init_common(root,jdcdisplay) - jdctree=jdcdisplay.tree.tree.children[0] - #commentariser commande MACRO_MATR_ASSE - panel=select_child("MACRO_MATR_ASSE",jdctree) - panel=comment_command(panel) - #decommentariser commande MACRO_MATR_ASSE - panel=uncomment_command(panel) - #creation commande commentée - panel=create_command("LIRE_MAILLAGE",panel) - panel=comment_command(panel) - panel=change_commandcomm("mm=LIRE_MAILLAGE(INFO=2,UNITE=21)",panel) - panel=uncomment_command(panel) - panel=select_child("DEFI_FONCTION",jdctree) - delete_node(panel) - - assert j.isvalid(),j.report() diff --git a/Tests/testihm9/common.py b/Tests/testihm9/common.py deleted file mode 100644 index 911387bf..00000000 --- a/Tests/testihm9/common.py +++ /dev/null @@ -1,209 +0,0 @@ -# -*- coding: utf-8 -*- - -from tkMessageBox import showinfo -root=None -jdcdisplay=None - -class UnKnownNode(Exception):pass - -def pause(): - if 1: - showinfo("Pause","Pause") - -def init_common(r,j): - global root,jdcdisplay - root=r - jdcdisplay=j - -def KP_return(): - root.event_generate("") - root.update() - -def delete_node(panel): - panel.node.delete() - -def uncomment_command(panel): - panel.bouton_unc.invoke() - root.update() - panel=jdcdisplay.panel_courant - return panel - -def comment_command(panel): - panel.nb.selectpage('Commentaire') - panel.comment_commande() - root.update() - panel=jdcdisplay.panel_courant - return panel - -def create_mocle(nom,panel): - panel.nb.selectpage('Mocles') - panel.Liste.afficheMot(nom) - root.update() - label=panel.Liste.dico_labels[nom] - label.event_generate("") - root.event_generate("") - root.update() - return jdcdisplay.panel_courant - -def change_commandcomm(text,panel): - panel.widget_text.setvalue(text) - root.update() - panel.bouton_val.invoke() - return panel - -def create_command(nom,panel): - panel.nb.selectpage('Commande') - root.update() - panel.command_entry.setentry(nom) - panel.command_entry.component('entry').focus_set() - root.event_generate("") - root.update() - label=panel.liste_command.dico_labels[nom] - label.event_generate("") - label.event_generate("") - root.update() - panel=jdcdisplay.panel_courant - return panel - -def create_comment(text,panel): - panel.nb.selectpage('Commentaire') - panel.ajout_commentaire() - root.update() - panel=jdcdisplay.panel_courant - panel.widget_text.setvalue(text) - root.update() - panel.bouton_val.invoke() - #panel.change_valeur() - return panel - -def create_param(nom,valeur,panel): - panel.nb.selectpage('Commentaire') - panel.ajout_parametre() - root.update() - panel=jdcdisplay.panel_courant - if nom: - panel.entry_nom.delete(0,"end") - panel.entry_nom.insert(0,nom) - panel.entry_nom.event_generate("") - panel.entry_val.delete(0,"end") - panel.entry_val.insert(0,valeur) - panel.entry_val.event_generate("") - panel.bouton_val.invoke() - root.update() - return panel - -def create_formule(nom,args,expr,panel): - panel=create_command("FORMULE",panel) - panel.entry_nom.delete(0,"end") - panel.entry_nom.insert(0,nom) - panel.entry_nom.event_generate("") - panel.entry_arg.delete(0,"end") - panel.entry_arg.insert(0,args) - panel.entry_arg.event_generate("") - panel.entry_exp.delete(0,"end") - panel.entry_exp.insert(0,expr) - panel.entry_exp.event_generate("") - panel.bouton_val.invoke() - root.update() - return panel - -def nomme_concept(nom,panel): - panel.nb.selectpage('Concept') - root.update() - panel._any.delete(0,"end") - panel._any.insert(0,nom) - panel.but_ok.invoke() - root.update() - return jdcdisplay.panel_courant - -def select_mcf(nom,ind,node): - panel=select_child(nom,node) - parent=panel.node - parent.expand() - parent.select_next(ind) - panel=jdcdisplay.panel_courant - panel.node.expand() - return panel - -def select_child(nom,node): - """node est le parent dont on veut le fils nom""" - for n in node.children: - if n.item.nom == nom: - n.select() - root.update() - panel= jdcdisplay.panel_courant - panel.node.expand() - return panel - raise UnKnownNode(nom) - -def select_node(node): - node.select() - node.expand() - root.update() - return jdcdisplay.panel_courant - -def choose_valeur(valeur,panel): - panel.Liste_choix.afficheMot(valeur) - root.update() - label=panel.Liste_choix.dico_labels[valeur] - label.event_generate("") - label.event_generate("") - root.update() - -def choose_sdco(valeur,panel): - i = list(panel.listbox.get(0, 'end')).index(valeur) - panel.listbox.component("listbox").selection_set(i) - panel.listbox.component("listbox").focus_set() - panel.listbox.component("listbox").event_generate("") - root.update() - -def choose_assd(valeur,panel): - i = list(panel.listbox.get(0, 'end')).index(valeur) - panel.listbox.component("listbox").selection_set(i) - panel.but_val.invoke() - root.update() - -def set_valeur(valeur,panel): - panel.entry.delete(0,"end") - panel.entry.insert(0,valeur) - panel.entry.event_generate("") - root.update() - -def set_sdco(valeur,panel): - panel.b_co.invoke('OUI') - root.update() - panel.entry_co.delete(0,"end") - panel.entry_co.insert(0,valeur) - panel.entry_co.event_generate("") - root.update() - -def set_complexe(valeur,panel): - panel.entry3.setentry(valeur) - panel.entry3.component('entry').focus_set() - panel.entry3.event_generate("") - root.update() - -def add_valeur_into(valeur,panel): - label=panel.Liste_choix.dico_labels[valeur] - panel.Liste_choix.afficheMot(valeur) - root.update() - label.event_generate("<1>") - panel.bouton_add.invoke() - root.update() - -def add_valeur(valeur,panel): - panel.entry.delete(0,"end") - panel.entry.insert(0,valeur) - panel.entry.event_generate("") - root.update() - -def valider_valeur(panel): - panel.bouton_accepter.invoke() - root.update() - -def copier_coller(): - root.event_generate("") - root.event_generate("") - root.update() - return jdcdisplay.panel_courant - diff --git a/Tests/testihm9/testihm1.py b/Tests/testihm9/testihm1.py deleted file mode 100644 index 0c1b6699..00000000 --- a/Tests/testihm9/testihm1.py +++ /dev/null @@ -1,334 +0,0 @@ -# -*- coding: utf-8 -*- -# Modules Python -import os -import unittest -import difflib -import compare -import sys -import Tkinter - -# Modules Eficas -import prefs -from Editeur import session -from InterfaceTK import eficas_go,splash,eficas,images -from common import * - -version='v9' - -class TestCase(unittest.TestCase): - def setUp(self): - self.root = Tkinter.Tk() - images.update_cache() - # Analyse des arguments de la ligne de commande - options=session.parse([]) - options.cata=version - pass - - def tearDown(self): - self.root.destroy() - init_common(None,None) - pass - - def test000(self): - root=self.root - code="ASTER" - splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) - splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") - app=eficas.EFICAS(root,code=code) - j=app.bureau.newJDC() - jdcdisplay=app.bureau.JDCDisplay_courant - init_common(root,jdcdisplay) - - # commande DEBUT - co=j.addentite("DEBUT",0) - # commande FIN - co=j.addentite("FIN",1) - - jdctree=jdcdisplay.tree.tree.children[0] - panel=select_child("DEBUT",jdctree) - - panel=create_param("P1",9.8,panel) - panel=create_param("P2",8.8,panel) - panel=create_param("P3",7,panel) - panel=create_param("P4","[2,3,4]",panel) - panel=create_param("P5","P3*P1",panel) - panel=create_param(None,"P1-3",panel) - panel=create_comment("Pas trouve shellpanel",panel) - - #commnde LIRE_MAILLAGE - panel=create_command("LIRE_MAILLAGE",panel) - command=panel.node - panel=nomme_concept("MAILLA2",panel) - panel=select_node(command) - panel=create_mocle("UNITE",panel) - panel=set_valeur("P4[1]",panel) - command.collapse() - panel=select_node(command) - #FORMULE - panel=create_formule("az","a,z","a+z",panel) - #commande AFFE_MODELE - panel=create_command("AFFE_MODELE",panel) - command=panel.node - select_child("MAILLAGE",command) - panel=select_node(command) - panel=create_mocle("AFFE",panel) - parent=panel.node - panel=select_child("PHENOMENE",parent) - choose_valeur("MECANIQUE",panel) - panel=select_child("b_mecanique",parent) - panel=select_child("MODELISATION",panel.node) - add_valeur_into("3D",panel) - add_valeur_into("3D_FLUIDE",panel) - valider_valeur(panel) - panel=select_node(parent) - panel=create_mocle("TOUT",panel) - choose_valeur("OUI",panel) - panel=select_node(command) - panel=nomme_concept("MO",panel) - command.collapse() - #fin commande AFFE_MODELE - panel=copier_coller() - command=panel.node - panel=create_mocle("AFFE",panel) - panel=select_node(command) - panel=create_mocle("AFFE",panel) - panel=select_mcf("AFFE",1,command) - parent=panel.node - panel=create_mocle("GROUP_NO",panel) - add_valeur("'GNP3','GNP5','GNP6','GNP7','GNP8','GNP9','GNP10','GNP11','GNP12'",panel) - valider_valeur(panel) - panel=select_child("PHENOMENE",parent) - choose_valeur("ACOUSTIQUE",panel) - panel=select_child("b_acoustique",parent) - panel=select_child("MODELISATION",panel.node) - add_valeur_into("PLAN",panel) - valider_valeur(panel) - - panel=select_mcf("AFFE",2,command) - parent=panel.node - panel=create_mocle("GROUP_MA",panel) - add_valeur("MASSES",panel) - valider_valeur(panel) - panel=select_child("PHENOMENE",parent) - choose_valeur("THERMIQUE",panel) - panel=select_child("b_thermique",parent) - panel=select_child("MODELISATION",panel.node) - add_valeur_into("COQUE",panel) - valider_valeur(panel) - - panel=select_node(command) - panel=nomme_concept("AFFE1",panel) - command.collapse() - #fin commande AFFE_MODELE - #commande AFFE_CARA_ELEM - panel=create_command("AFFE_CARA_ELEM",panel) - command=panel.node - panel=select_node(command) - panel=create_mocle("POUTRE",panel) - parent=panel.node - panel=select_child("SECTION",parent) - choose_valeur("CERCLE",panel) - panel=select_child("b_cercle",parent) - panel=select_child("b_constant",panel.node) - p=panel.node - panel=select_child("CARA",p) - add_valeur_into("R",panel) - add_valeur_into("EP",panel) - valider_valeur(panel) - panel=select_child("VALE",p) - add_valeur("1,2",panel) - valider_valeur(panel) - panel=select_node(parent) - panel=create_mocle("GROUP_MA",panel) - add_valeur("GR1,GR2",panel) - valider_valeur(panel) - panel=select_child("MODELE",command) - choose_assd("MO",panel) - panel=select_node(command) - panel=nomme_concept("CARA",panel) - command.collapse() - #fin commande AFFE_CARA_ELEM - panel=create_command("DEFI_FONCTION",panel) - command=panel.node - panel=create_mocle("VALE",panel) - add_valeur("5.0,3.0",panel) - add_valeur("P4[1],P3",panel) - valider_valeur(panel) - panel=select_child("NOM_PARA",command) - choose_valeur("DX",panel) - panel=select_node(command) - panel=nomme_concept("F1",panel) - command.collapse() - #fin DEFI_FONCTION - panel=create_command("DEFI_FONCTION",panel) - command=panel.node - panel=create_mocle("VALE_C",panel) - add_valeur("5.0,7.0,9.0",panel) - add_valeur("9.0,8.0,7.0",panel) - valider_valeur(panel) - panel=select_child("NOM_PARA",command) - choose_valeur("DRX",panel) - panel=select_node(command) - panel=nomme_concept("F3",panel) - command.collapse() - #fin DEFI_FONCTION -#MATER2=DEFI_MATERIAU(ELAS=_F(E=100000000000.0, -# NU=0.0,), -# ECRO_ASYM_LINE=_F(DC_SIGM_EPSI=0.0, -# SY_C=200000000.0, -# DT_SIGM_EPSI=0.0, -# SY_T=50000000.0,),); - - panel=create_command("DEFI_MATERIAU",panel) - command=panel.node - panel=create_mocle("ELAS",panel) - p=panel.node - panel=select_child("E",p) - set_valeur("100000000000.0",panel) - panel=select_child("NU",p) - set_valeur("0.0",panel) - panel=select_node(command) - panel=create_mocle("ECRO_ASYM_LINE",panel) - p=panel.node - panel=select_child("DC_SIGM_EPSI",p) - set_valeur("0.0",panel) - panel=select_child("SY_C",p) - set_valeur("200000000.0",panel) - panel=select_child("DT_SIGM_EPSI",p) - set_valeur("0.0",panel) - panel=select_child("SY_T",p) - set_valeur("50000000.0",panel) - panel=select_node(command) - panel=nomme_concept("MATER2",panel) - command.collapse() - #fin DEFI_MATERIAU - #PS1=DEFI_PARA_SENSI(VALE=1.0,); - #PS2=DEFI_PARA_SENSI(VALE=1.0,); - #PS3=DEFI_PARA_SENSI(VALE=1.0,); - panel=create_command("DEFI_PARA_SENSI",panel) - command=panel.node - panel=select_child("VALE",command) - set_valeur("1.0",panel) - panel=select_node(command) - panel=nomme_concept("PS1",panel) - command.collapse() - panel=create_command("DEFI_PARA_SENSI",panel) - command=panel.node - panel=select_child("VALE",command) - set_valeur("1.0",panel) - panel=select_node(command) - panel=nomme_concept("PS2",panel) - command.collapse() - panel=create_command("DEFI_PARA_SENSI",panel) - command=panel.node - panel=select_child("VALE",command) - set_valeur("1.0",panel) - panel=select_node(command) - panel=nomme_concept("PS3",panel) - command.collapse() -#CHMAT2=AFFE_MATERIAU(MAILLAGE=MAIL, -# AFFE=_F(TOUT='OUI', -# MATER=MATER2,),); - panel=create_command("AFFE_MATERIAU",panel) - command=panel.node - panel=select_child("MAILLAGE",command) - panel=select_child("AFFE",command) - affe=panel.node - panel=create_mocle("TOUT",panel) - choose_valeur("OUI",panel) - panel=select_child("MATER",affe) - add_valeur_into("MATER2",panel) - valider_valeur(panel) - panel=select_node(command) - panel=nomme_concept("CHMAT2",panel) - command.collapse() -#AAAZ=AFFE_CHAR_THER(MODELE=AFFE1, -# TEMP_IMPO=_F(TOUT='OUI', -# TEMP=0.0,),); - panel=create_command("AFFE_CHAR_THER",panel) - command=panel.node - panel=create_mocle("TEMP_IMPO",panel) - temp=panel.node - panel=create_mocle("TOUT",panel) - choose_valeur("OUI",panel) - panel=select_node(temp) - panel=create_mocle("TEMP",panel) - panel=set_valeur("0.0",panel) - panel=select_child("MODELE",command) - choose_assd("AFFE1",panel) - panel=select_node(command) - panel=nomme_concept("AAAZ",panel) - command.collapse() -#TH1=THER_LINEAIRE(MODELE=AFFE1, -# CHAM_MATER=CHMAT2, -# EXCIT=_F(CHARGE=AAAZ,), -# SENSIBILITE=(PS1,PS2,),); - panel=create_command("THER_LINEAIRE",panel) - command=panel.node - panel=select_child("MODELE",command) - choose_assd("AFFE1",panel) - panel=select_child("CHAM_MATER",command) - panel=select_child("EXCIT",command) - panel=select_child("CHARGE",panel.node) - panel=select_node(command) - panel=create_mocle("SENSIBILITE",panel) - add_valeur_into("PS1",panel) - add_valeur_into("PS2",panel) - valider_valeur(panel) - panel=select_node(command) - panel=nomme_concept("TH1",panel) - command.collapse() -#ACA1=AFFE_CHAR_ACOU(MODELE=AFFE1, -# PRES_IMPO=_F(TOUT='OUI', -# PRES=('RI',3.0,3.0,),),); - panel=create_command("AFFE_CHAR_ACOU",panel) - command=panel.node - panel=create_mocle("PRES_IMPO",panel) - pres=panel.node - panel=create_mocle("TOUT",panel) - choose_valeur("OUI",panel) - panel=select_child("MODELE",command) - choose_assd("AFFE1",panel) - panel=select_child("PRES",pres) - set_complexe("'RI',3.0,3.0",panel) - panel=select_node(command) - panel=nomme_concept("ACA1",panel) - command.collapse() -#MACRO_MATR_ASSE(MODELE=AFFE1, -# NUME_DDL=CO('DDL1'), -# MATR_ASSE=_F(MATRICE=CO('MAT1'), -# OPTION='RIGI_THER',),); - panel=create_command("MACRO_MATR_ASSE",panel) - command=panel.node - panel=select_child("NUME_DDL",command) - set_sdco("DDL1",panel) - panel=select_child("MODELE",command) - choose_assd("AFFE1",panel) - panel=select_child("MATR_ASSE",command) - matr=panel.node - panel=select_child("OPTION",matr) - choose_valeur("RIGI_THER",panel) - panel=select_child("MATRICE",matr) - set_sdco("MAT1",panel) - panel=select_node(command) - command.collapse() -#MACRO_MATR_ASSE(MODELE=AFFE1, -# NUME_DDL=DDL1, -# MATR_ASSE=_F(MATRICE=MAT1, -# OPTION='RIGI_THER',),); - panel=create_command("MACRO_MATR_ASSE",panel) - command=panel.node - panel=select_child("NUME_DDL",command) - choose_sdco("DDL1",panel) - panel=select_child("MODELE",command) - choose_assd("AFFE1",panel) - panel=select_child("MATR_ASSE",command) - matr=panel.node - panel=select_child("OPTION",matr) - choose_valeur("RIGI_THER",panel) - panel=select_child("MATRICE",matr) - set_sdco("MAT2",panel) - panel=select_node(command) - command.collapse() - - assert j.isvalid(),j.report() diff --git a/Tests/testihm9/testihm2.py b/Tests/testihm9/testihm2.py deleted file mode 100644 index ee3762d9..00000000 --- a/Tests/testihm9/testihm2.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- -# Modules Python -import os -import unittest -import difflib -import compare -import sys -import Tkinter - -# Modules Eficas -import prefs -from Editeur import session -from InterfaceTK import eficas_go,splash,eficas,images -from common import * - - -class TestCase(unittest.TestCase): - def setUp(self): - self.root = Tkinter.Tk() - images.update_cache() - # Analyse des arguments de la ligne de commande - options=session.parse([]) - options.cata="v9" - pass - - def tearDown(self): - self.root.destroy() - init_common(None,None) - pass - - def test000(self): - root=self.root - code="ASTER" - splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) - splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") - app=eficas.EFICAS(root,code=code) - j=app.bureau.newJDC() - jdcdisplay=app.bureau.JDCDisplay_courant - init_common(root,jdcdisplay) - - # commande DEBUT - co=j.addentite("DEBUT",0) - # commande FIN - co=j.addentite("FIN",1) - - jdctree=jdcdisplay.tree.tree.children[0] - panel=select_child("DEBUT",jdctree) - panel=create_command("LIRE_MAILLAGE",panel) - panel=nomme_concept("MA",panel) - - panel=create_command("AFFE_MODELE",panel) - command=panel.node - select_child("MAILLAGE",command) - panel=select_node(command) - panel=create_mocle("AFFE",panel) - parent=panel.node - panel=select_child("PHENOMENE",parent) - choose_valeur("MECANIQUE",panel) - panel=select_child("b_mecanique",parent) - panel=select_child("MODELISATION",panel.node) - add_valeur_into("3D",panel) - add_valeur_into("3D_FLUIDE",panel) - valider_valeur(panel) - panel=select_node(parent) - panel=create_mocle("TOUT",panel) - choose_valeur("OUI",panel) - panel=select_node(command) - panel=nomme_concept("MO",panel) - - assert j.isvalid(),j.report() diff --git a/Tests/testihm9/testihm3.py b/Tests/testihm9/testihm3.py deleted file mode 100644 index f96a73b8..00000000 --- a/Tests/testihm9/testihm3.py +++ /dev/null @@ -1,93 +0,0 @@ -# -*- coding: utf-8 -*- -# Modules Python -import os -import unittest -import difflib -import compare -import sys -import Tkinter - -# Modules Eficas -import prefs -from Editeur import session -from InterfaceTK import eficas_go,splash,eficas,images -from common import * - - -class TestCase(unittest.TestCase): - def setUp(self): - self.root = Tkinter.Tk() - images.update_cache() - # Analyse des arguments de la ligne de commande - options=session.parse([]) - options.cata="petit" - pass - - def tearDown(self): - self.root.destroy() - init_common(None,None) - pass - - def test000(self): - root=self.root - code="ASTER" - splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) - splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") - app=eficas.EFICAS(root,code=code) - j=app.bureau.newJDC() - jdcdisplay=app.bureau.JDCDisplay_courant - init_common(root,jdcdisplay) - - # commande DEBUT - co=j.addentite("DEBUT",0) - # commande FIN - co=j.addentite("FIN",1) - - jdctree=jdcdisplay.tree.tree.children[0] - panel=select_child("DEBUT",jdctree) - panel=create_command("TESTS_VALID",panel) - command=panel.node - panel=select_child("LongStr",command) - set_valeur("aaa",panel) - panel=select_child("ListStr",command) - add_valeur("aaa",panel) - add_valeur("bbbb,ccc",panel) - valider_valeur(panel) - panel=select_child("PairVal",command) - add_valeur(2,panel) - add_valeur("4,6",panel) - valider_valeur(panel) - panel=select_child("RangeVal",command) - set_valeur(4,panel) - panel=select_child("CardVal",command) - add_valeur("4,6,5,7",panel) - valider_valeur(panel) - panel=select_child("EnumVal",command) - choose_valeur(3,panel) - panel=select_child("OrdList",command) - add_valeur("4,6,5,7",panel) - valider_valeur(panel) - panel=select_child("OrdList2",command) - add_valeur_into(2,panel) - valider_valeur(panel) - panel=select_child("TypeVal",command) - set_valeur(5,panel) - panel=select_child("Compul",command) - add_valeur("2",panel) - add_valeur("1",panel) - valider_valeur(panel) - panel=select_child("CompulInto",command) - add_valeur_into(2,panel) - add_valeur_into(1,panel) - valider_valeur(panel) - panel=select_child("Norep",command) - add_valeur("2",panel) - valider_valeur(panel) - panel=select_child("NorepInto",command) - add_valeur_into(2,panel) - valider_valeur(panel) - - panel=select_node(command) - panel=nomme_concept("MA",panel) - - assert j.isvalid(),j.report() diff --git a/Tests/testihm9/testihm4.py b/Tests/testihm9/testihm4.py deleted file mode 100644 index 20e44bb1..00000000 --- a/Tests/testihm9/testihm4.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# Modules Python -import os -import unittest -import difflib -import compare -import sys -import Tkinter - -# Modules Eficas -import prefs -from Editeur import session -from InterfaceTK import eficas_go,splash,eficas,images -from common import * - - -class TestCase(unittest.TestCase): - def setUp(self): - self.root = Tkinter.Tk() - images.update_cache() - # Analyse des arguments de la ligne de commande - options=session.parse([]) - options.cata="v9" - pass - - def tearDown(self): - self.root.destroy() - init_common(None,None) - pass - - def test000(self): - root=self.root - code="ASTER" - splash.init_splash(root,code=code,titre="Lancement d'EFICAS pour %s" %code) - splash._splash.configure(text="Chargement d'EFICAS en cours.\n Veuillez patienter ...") - app=eficas.EFICAS(root,code=code) - file=os.path.join(prefs.INSTALLDIR,"Tests/testelem/az.comm") - j=app.bureau.openJDC(file=file) - jdcdisplay=app.bureau.JDCDisplay_courant - init_common(root,jdcdisplay) - jdctree=jdcdisplay.tree.tree.children[0] - #commentariser commande MACRO_MATR_ASSE - panel=select_child("MACRO_MATR_ASSE",jdctree) - panel=comment_command(panel) - #decommentariser commande MACRO_MATR_ASSE - panel=uncomment_command(panel) - #creation commande commentée - panel=create_command("LIRE_MAILLAGE",panel) - panel=comment_command(panel) - panel=change_commandcomm("mm=LIRE_MAILLAGE(INFO=2,UNITE=21)",panel) - panel=uncomment_command(panel) - panel=select_child("DEFI_FONCTION",jdctree) - delete_node(panel) - - assert j.isvalid(),j.report() 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')