res=app.exec_()
sys.exit(res)
-def getEficasSsIhm(code=None, multi=False, langue='en', labelCode=None,forceXML=False, genereXSD=False):
-#------------------------------------------------------------------------------------------------------
+def getEficasSsIhm(code=None, multi=False, langue='en', labelCode=None,forceXML=False, genereXSD=False, fichierCata=None):
+#-------------------------------------------------------------------------------------------------------------------------
"""
Lance l'appli EFICAS sans Ihm
"""
if forceXML : options.withXSD=True
from InterfaceQT4.qtEficasSsIhm import AppliSsIhm
- Eficas=AppliSsIhm(code=code, salome=0, multi=multi, langue=langue, labelCode=labelCode, genereXSD=genereXSD)
+ Eficas=AppliSsIhm(code=code, salome=0, multi=multi, langue=langue, labelCode=labelCode, genereXSD=genereXSD, fichierCata=fichierCata)
return Eficas
#maClasseAccas=getattr(self.cata,objEtape.monNomClasseAccas)
return fonctionValidee
-
return laFonction
+def createFromDocumentAccas(fichierCata=None,fichier=None,code=None):
+#------------------------------------------------------------
+ if fichier == None : print ('file is needed'); return None
+ if fichierCata == None : print ('cata file is needed'); return None
+
+ from Noyau.N_OBJECT import activeSurcharge
+ activeSurcharge()
+
+ from .editorSsIhm import JDCEditorSsIhm
+ monEficasSsIhm = getEficasSsIhm(code='Essai', fichierCata=fichierCata)
+ monEditeur=JDCEditorSsIhm(monEficasSsIhm,fichier)
+ return monEditeur.jdc
+ #from Noyau
# --------------------------- toutes les fonctions après sont obseletes
"""
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):
+ def __init__(self,code=None,salome=1,parent=None,multi=False,langue='fr',ssIhm=True,labelCode=None,genereXSD=False,fichierCata=None):
"""
Constructor
"""
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')
- self.fichierCata=session.d_env.fichierCata
+ 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
print((' `- JDC sdAccessible : PAR_LOT =', self.parLot))
return self.parLot == 'NON'
+ def getEtapesByName(self,name):
+ listeDEtapes=[]
+ for e in self.etapes :
+ if e.nom == name : listeDEtapes.append(e)
+ return listeDEtapes
+
+ def getEtapeByConceptName(self,conceptName):
+ for e in self.etapes :
+ if e.sdnom == conceptName : return e
+
+
def _build_reserved_kw_list(self):
"""Construit la liste des mots-cles reserves (interdits pour le
nommage des concepts)."""
self._reserved_kw.difference_update(
['OPER', 'MACRO', 'BLOC', 'SIMP', 'FACT', 'FORM',
'GEOM', 'MCSIMP', 'MCFACT'])
+
self.cr.fatal(_(u"Type non autorisé pour le mot-clé %s : '%s'"),
self.nom, self.valeur)
return self.cr
+
+
+def newGetattr(self,name):
+ try :
+ fils=self.getChild(name)
+ if fils :
+ if fils.nature == 'MCSIMP' : return fils.valeur
+ if fils.nature == 'MCList' :
+ if fils[0].definition.max == 1 : return fils[0]
+ return fils
+ except :
+ raise AttributeError("%r object has no attribute %r" % (self.__class__.__name__, name))
+ raise AttributeError("%r object has no attribute %r" % (self.__class__.__name__, name))
+
+def newGetattrForEtape(self,name):
+ try :
+ lesFils=self.getEtapesByName(name)
+ if lesFils != [] : return lesFils
+ except :
+ raise AttributeError("%r object has no attribute %r" % (self.__class__.__name__, name))
+ raise AttributeError("%r object has no attribute %r" % (self.__class__.__name__, name))
+
+def activeSurcharge():
+ from .N_MCCOMPO import MCCOMPO
+ MCCOMPO.__getattr__ = newGetattr
+ from .N_JDC import JDC
+ JDC.__getattr__ = newGetattrForEtape
+
--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# Copyright (C) 2007-2021 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
+#
+"""
+"""
+import sys,os
+import prefs
+sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..'))
+
+from InterfaceQT4 import eficas_go
+jdd = eficas_go.createFromDocumentAccas('cataPocRN.py','edg32.comm')
+
+
+monRodBank=jdd.RodBank[0]
+print ('MonObjet ', monRodBank, ' a pour nom', monRodBank.sdnom)
+print (monRodBank.rodbank_name)
+
+print ('on fait une erreur volontaire')
+try :
+ monRodBank=jdd.rodrank[0]
+except : pass
+
+monRodBank2=jdd.getEtapeByConceptName('RB')
+assert monRodBank2 == monRodBank
+
+
+techno=jdd.Techno_data[0]
+print (techno.assembly_list)
+print (techno.rodbank_list)
+try :
+ print (techno.toto)
+except : pass
+
+print (techno.radial_description)
+print (techno.radial_description.nb_assembly)
+print (techno.radial_description.assembly_map_6.xaxis)
+print (techno.radial_description.assembly_map_6.yaxis)
+print (techno.radial_description.assembly_map_6.assembly_map)
+print (techno.radial_description.assembly_map_6.assembly_map[0][3])
+