From ae942378900fb6a0b57bba6cbb74f231cf6b15e0 Mon Sep 17 00:00:00 2001 From: Pascale Noyret Date: Mon, 6 Jul 2009 15:49:00 +0000 Subject: [PATCH] *** empty log message *** --- Aster/qtGroup.py | 35 ++++++++++++++++++ InterfaceQT4/editor.py | 1 - InterfaceQT4/eficas_go.py | 11 +++--- InterfaceQT4/readercata.py | 1 + InterfaceQT4/ssIhm.py | 29 +++++++++++++++ generator/generator_GroupMA.py | 65 ++++++++++++++++++++++++++++++++++ 6 files changed, 136 insertions(+), 6 deletions(-) create mode 100755 Aster/qtGroup.py create mode 100644 InterfaceQT4/ssIhm.py create mode 100644 generator/generator_GroupMA.py diff --git a/Aster/qtGroup.py b/Aster/qtGroup.py new file mode 100755 index 00000000..2ca6b892 --- /dev/null +++ b/Aster/qtGroup.py @@ -0,0 +1,35 @@ +#!/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 +name='prefs_'+prefs.code +__import__(name) + +from InterfaceQT4 import eficas_go + +eficas_go.lance_eficas_ssIhm(code=prefs.code,fichier="/home/noyret/Eficas_Aster/zz.comm",version='v9.5') diff --git a/InterfaceQT4/editor.py b/InterfaceQT4/editor.py index 0e885a69..74b0ec27 100644 --- a/InterfaceQT4/editor.py +++ b/InterfaceQT4/editor.py @@ -18,7 +18,6 @@ # # ====================================================================== -print "INTERFACEQT4" import types,sys,os import traceback from PyQt4 import * diff --git a/InterfaceQT4/eficas_go.py b/InterfaceQT4/eficas_go.py index 1b2168c6..16c11003 100644 --- a/InterfaceQT4/eficas_go.py +++ b/InterfaceQT4/eficas_go.py @@ -46,7 +46,7 @@ def lance_eficas(code=None,fichier=None): sys.exit(res) -def lance_eficas_ssIhm(code=None,fichier=None): +def lance_eficas_ssIhm(code=None,fichier=None,version='v9.5'): """ Lance l'appli EFICAS pour trouver les noms des groupes """ @@ -58,11 +58,12 @@ def lance_eficas_ssIhm(code=None,fichier=None): Eficas=Appli(code=code) from ssIhm import QWParentSSIhm - parent=QWParentSSIhm(code,Eficas,'v9.4') + parent=QWParentSSIhm(code,Eficas,version) + + import readercata + if not hasattr( readercata, 'reader' ) : + readercata.reader = readercata.READERCATA( parent, Eficas ) - from readercata import READERCATA - readercata = READERCATA( parent, Eficas ) - from editor import JDCEditor monEditeur=JDCEditor(Eficas,fichier) print monEditeur.cherche_Groupes() diff --git a/InterfaceQT4/readercata.py b/InterfaceQT4/readercata.py index 7c11bbfe..9471b022 100644 --- a/InterfaceQT4/readercata.py +++ b/InterfaceQT4/readercata.py @@ -79,6 +79,7 @@ class READERCATA: self.appliEficas.close() sys.exit(1) + if self.version_code is not None: # La version a ete fixee for cata in liste_cata_possibles: diff --git a/InterfaceQT4/ssIhm.py b/InterfaceQT4/ssIhm.py new file mode 100644 index 00000000..a89aafb3 --- /dev/null +++ b/InterfaceQT4/ssIhm.py @@ -0,0 +1,29 @@ +# -*- 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. +# +# +# ====================================================================== +# permet de lancer EFICAS en n affichant rien + +class QWParentSSIhm: + def __init__(self,code,appliEficas,version_code): + self.ihm="QT" + self.code=code + self.version_code=version_code + self.appliEficas=appliEficas + diff --git a/generator/generator_GroupMA.py b/generator/generator_GroupMA.py new file mode 100644 index 00000000..7c1c4b2a --- /dev/null +++ b/generator/generator_GroupMA.py @@ -0,0 +1,65 @@ +# -*- 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 contient le plugin generateur d une liste des GroupNo et GroupMA +""" +import traceback +import types,string,re + +from generator_python import PythonGenerator +def entryPoint(): + """ + Retourne les informations nécessaires pour le chargeur de plugins + + Ces informations sont retournées dans un dictionnaire + """ + return { + # Le nom du plugin + 'name' : 'GroupMA', + # La factory pour créer une instance du plugin + 'factory' : GroupMAGenerator, + } + + +class GroupMAGenerator(PythonGenerator): + """ + Ce generateur parcourt un objet de type JDC et produit + un texte au format eficas et + un texte au format homard + + """ + # Les extensions de fichier préconisées + extensions=('.comm',) + + def __init__(self): + PythonGenerator.__init__(self) + self.liste=[] + + def gener(self,obj,format='brut'): + self.liste=[] + self.text=PythonGenerator.gener(self,obj,'brut') + return self.liste + + def generMCSIMP(self,obj) : + if 'grma' in repr(obj.definition.type) or 'grno' in repr(obj.definition.type) : + self.liste.append(obj.valeur) + s=PythonGenerator.generMCSIMP(self,obj) + return s -- 2.39.2