Salome HOME
1ere version avec cata_vimmp et cata_gromacs
authorpascale.noyret <pascale.noyret@edf.fr>
Tue, 16 Apr 2019 15:02:45 +0000 (17:02 +0200)
committerpascale.noyret <pascale.noyret@edf.fr>
Tue, 16 Apr 2019 15:02:45 +0000 (17:02 +0200)
24 files changed:
Accas/A_NUPLET.py
Accas/A_TUPLE.py [new file with mode: 0644]
Accas/__init__.py
Efi2Xsd/AccasXsd.py
Efi2Xsd/MCAccasXsd.py
Efi2Xsd/balises.py
Efi2Xsd/mapDesTypes.py
Ihm/I_JDC.py
InterfaceQT4/configuration.py
InterfaceQT4/monChoixCommande.py
InterfaceQT4/monWidgetCommande.py
InterfaceQT4/monWidgetOptionnel.py
JP/cata_Vimmp.py
JP/cata_gromacs.py [new file with mode: 0644]
JP/prefs_JP.py [deleted file]
JP/prefs_Vimmp.py [new file with mode: 0644]
JP/qtEficasJP.py [deleted file]
JP/qtEficasVimmp.py [new file with mode: 0755]
Noyau/N_ENTITE.py
Noyau/N_ETAPE.py
Noyau/N_JDC.py
Noyau/N_OPER.py
Noyau/N_SIMP.py
Noyau/N_VALIDATOR.py

index d9fbe3537c9b1e240288c5309f94a6478ac2d823..093b36d62bf3a4650d15c503bd7ef374006ac52c 100644 (file)
@@ -25,3 +25,4 @@ from . import A_MCNUPLET
 class NUPL(nuplet.NUPL):
    class_instance=A_MCNUPLET.MCNUPLET
    list_instance=A_MCLIST.MCList
+
diff --git a/Accas/A_TUPLE.py b/Accas/A_TUPLE.py
new file mode 100644 (file)
index 0000000..0e9549c
--- /dev/null
@@ -0,0 +1,13 @@
+import types
+class Tuple:
+  def __init__(self,ntuple):
+    self.ntuple=ntuple
+
+  def __convert__(self,valeur):
+    if type(valeur) == types.StringType: return None
+    if len(valeur) != self.ntuple: return None
+    return valeur
+
+  def info(self):
+    return "Tuple de %s elements" % self.ntuple
+
index d84c9ed3279e8a1664d7bf9f6fd4e176e9b5c905..471d79857211801f8e6cf2cfb1485c047068fbf7 100644 (file)
@@ -47,6 +47,8 @@ from .A_FACT import FACT
 from .A_SIMP import SIMP
 from .A_EVAL import EVAL
 from .A_NUPLET import NUPL
+from .A_TUPLE import Tuple
+
 
 from .A_JDC import JDC
 from .A_ETAPE import ETAPE
index a075b0d596439bd83edf5e5e01196744364ed09d..78010db9b44a55fee794d9852ec7c2906317167d 100755 (executable)
@@ -116,9 +116,9 @@ class X_definitionComposee (X_definition):
           texteComplexeVenantDesFils=self.CreeTexteComplexeVenantDesFils()
           self.texteComplexe  = texteComplexeVenantDesFils + self.texteComplexe
           if not isinstance(self,X_OPER ) : 
-             self.texteComplexe += finTypeCompo
-             if inExtension : self.texteComplexe += finExtension
              self.texteComplexe += finTypeCompoSeq
+             if inExtension : self.texteComplexe += finExtension
+             self.texteComplexe += finTypeCompo
        else :
           self.texteComplexe = ""
 
@@ -159,6 +159,7 @@ class X_OPER (X_definitionComposee):
 # ---------------------------------
    def dumpXsd(self):
        X_definitionComposee.dumpXsd(self)
+       self.texteComplexe += finTypeCompoSeq
        self.texteComplexe += operAttributeName
        self.texteComplexe += attributeTypeForASSD
        self.texteComplexe += attributeTypeUtilisateurName.format(self.sd_prod.__name__)
@@ -245,7 +246,7 @@ class X_SIMP (X_definition):
  
        self.texteSimple  += debutSimpleType.format(self.nomDuTypePyxb)
        # On est dans une liste
-       if self.max > 1 or self.max == '**' or self.max ==  float('inf') : 
+       if self.max > 1 or self.max == '**' or self.max ==  float('inf') or  hasattr(self.type[0], 'ntuple') 
           self.texteSimple  += debutTypeSimpleListe
           self.texteSimple  += "\t\t\t\t"+debutRestrictionBase.format(self.nomDuTypeDeBase)
           if self.val_min != float('-inf')  : self.texteSimple += "\t\t\t\t"+minInclusiveBorne.format(self.val_min)
@@ -272,12 +273,20 @@ class X_SIMP (X_definition):
        # il faut traduire le min et le max
        # il faut ajouter les regles
        # il faut gerer les types tuple et fichier
-
-       if hasattr(self.type[0], 'ntuple') : return ('XXXXXXXX')
-       if not (self.type[0] in list(dictNomsDesTypes.keys())) : 
-          if (isinstance(self.type[0], Accas.ASSD) or issubclass(self.type[0], Accas.ASSD)) : return 'xs:string'
+       if hasattr(self.type[0], 'ntuple') : 
+          try :
+             leType=self.validators.typeDesTuples[0]
+             for i in range(self.type[0].ntuple):
+                 if self.validators.typeDesTuples[i] != leType : return ('XXXXXXXX')
+             typeATraduire=leType
+          except : 
+             return ('XXXXXXXX')
+       else : 
+             typeATraduire=self.type[0]
+       if not (typeATraduire in list(dictNomsDesTypes.keys())) : 
+          if (isinstance(typeATraduire, Accas.ASSD) or issubclass(typeATraduire, Accas.ASSD)) : return 'xs:string'
           else : return ('YYYYY')
-       return dictNomsDesTypes[self.type[0]]
+       return dictNomsDesTypes[typeATraduire]
   
    def traduitValMinValMax(self):
        self.maxInclusive=self.val_max
@@ -373,6 +382,7 @@ class X_JDC_CATA :
             c.dumpXsd(inExtension=True)
             self.texteSimple += c.texteSimple
             self.texteSimple += c.texteComplexe
+            c.texteElt=eltCompoDsSequenceInExtension.format(c.nom,self.code,c.nomDuTypePyxb)
             self.texteElt   += c.texteElt
         #print (self.texteCata)
         #print (self.texteSimple)
index 840cc26abddde5cee2cdde9feaddff6728b9c8d5..68196c2590bcaddff3ca7657ae67ce5d2742ac20 100755 (executable)
@@ -408,7 +408,7 @@ class X_JDC (X_MCCOMPO):
    def  __init__(self):
       self.perePyxb=None
       if not self.cata.modeleMetier : return
-      if hasattr(self.cata,'DicoNomTypeDifferentNomElt') : print ('jkllllllllllllllll')
+      #if hasattr(self.cata,'DicoNomTypeDifferentNomElt') : print ('jkllllllllllllllll')
       if not(hasattr(self.cata,'DicoNomTypeDifferentNomElt')) : self.cata.DicoNomTypeDifferentNomElt={}
       self.monNomClasseModeleMetier=self.code
       self.maClasseModeleMetier=getattr(self.cata.modeleMetier,self.monNomClasseModeleMetier)
@@ -418,18 +418,17 @@ class X_JDC (X_MCCOMPO):
       pyxb.GlobalValidationConfig._setInvalidElementInContent(pyxb.GlobalValidationConfig.RAISE_EXCEPTION)
       pyxb.GlobalValidationConfig._setOrphanElementInContent(pyxb.GlobalValidationConfig.RAISE_EXCEPTION)
       
+      
 
    def enregistreEtapePyxb(self,etape,indice=0):
-     # OK seulement si sequence (choice ? ...)
-     # 01 11 2018
      # ne fonctionne pas : a reecrire avec les fonctions addObjPyxb et ReconstruitPerePyxb
-      #print ( 'hhhhhhhhhhhhhhh enregistreEtapePyxb hhhhhhhhhhhhhhhhhhhhhhhhh')
-      #print ('enregistre ds ',self, etape.nom, 'indice = ', indice)
+     # ne contient pas indice pour l insant
+      print ( 'hhhhhhhhhhhhhhh enregistreEtapePyxb hhhhhhhhhhhhhhhhhhhhhhhhh')
+      print ('enregistre ds ',self, etape.nom, 'indice = ', indice)
       if not self.cata.modeleMetier : return
-      #import traceback
-      #traceback.print_stack()
       self.objPyxb.append(etape.objPyxb)
-      etape.perePyxb=self
+      etape.perePyxb = self
+
       #print (self.objPyxb.orderedContent())
       #if indice   != (len(self.objPyxb.orderedContent()) ) : 
       #  tampon=self.objPyxb.orderedContent()[-1]
@@ -439,7 +438,6 @@ class X_JDC (X_MCCOMPO):
       #  self.objPyxb.orderedContent()[indice]=tampon
 
       #print (self.objPyxb.orderedContent())
-      etape.perePyxb = self
       #try:
       #   self.objPyxb.validateBinding()
       #except pyxb.ValidationError as e:
index ac8cc1efa390279763065dafb359c79a6aedab83..6209540f89b0e12cdbd7fcd3c29ccbe4b79d24ea 100644 (file)
@@ -26,9 +26,10 @@ eltWithDefautDsSequence = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{
 # COMPO
 debutTypeCompo    = '\t<xs:complexType name="{}" >\n'
 debutTypeCompoSeq = '\t\t<xs:sequence>\n'
-finTypeCompo      = '\t\t</xs:sequence>\n'
-finTypeCompoSeq   = '\t</xs:complexType>\n'
+finTypeCompoSeq      = '\t\t</xs:sequence>\n'
+finTypeCompo   = '\t</xs:complexType>\n'
 eltCompoDsSequence = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
+eltCompoDsSequenceInExtension = '\t\t\t<xs:element name="{}" type="{}:{}"/>\n'
 
 # BLOC
 debutTypeSubst = '\t<xs:group name="{}">   \n\t\t<xs:sequence>\n'
index d90cbc128a658588a9551e494f315c07662ea126..4667b08bf1b4445014e8905cc96941d7d1b5f773 100755 (executable)
@@ -77,11 +77,6 @@ dictPROCEficasXML =  { 'nom'        : 'nom',
                        'fr'         : ('doc','fr',),
                        'docu'       : ('doc','docu'),
                       }
-     #                  'UIinfo' : 'UIinfo'
-     #                  'reentrant'
-     #                  'repetable'
-     #                  'op_init'
-     #                  'fenetreIhm' : 'fenetreIhm'
 
 dictPROCXMLEficas = inverseDico(dictPROCEficasXML)
 
@@ -89,7 +84,7 @@ dictOPEREficasXML = dictPROCEficasXML
 dictOPERXMLEficas = dictPROCXMLEficas
 
 dictPourCast                = { 'I' : int, 'R' : float, 'bool' : bool ,   }
-dictNomsDesTypes = { 'I' : 'int', 'R' : 'float', bool : 'boolean' , 'TXM' : 'string', 'Fichier' : 'string', 'Repertoire':'string', 'FichierNoAbs' : 'string', 'FichierOuRepertoire':'string'   }
+dictNomsDesTypes = { 'I' : 'xs:int', 'R' : 'xs:float', bool : 'xs:boolean' , 'TXM' : 'xs:string', 'Fichier' : 'xs:string', 'Repertoire':'xs:string', 'FichierNoAbs' : 'xs:string', 'FichierOuRepertoire':'xs:string'   }
 
 listeParamDeTypeTypeAttendu = ( 'defaut', 'sug', 'val_min', 'val_max', 'into', 'intoSug')
 listeParamDeTypeStr         = ('fr', 'docu', 'ang', 'nom' )
index 47491375d46b0e0cb3e7e314427befa849978917..c2153bfa8b74f174c9902fd9a7d69f37b581e9ef 100644 (file)
@@ -321,6 +321,7 @@ class JDC(I_OBJECT.OBJECT):
           self.editmode=0
           self.activeEtapes()
           self.enregistreEtapePyxb(e,pos)
+          # PN fait ds self.activeEtapes
           CONNECTOR.Emit(self,"add",e)
           self.finModif()
           return e
@@ -436,26 +437,9 @@ class JDC(I_OBJECT.OBJECT):
 
    def activeEtapes(self):
       """
-          Cette methode a pour fonction de desactiver les etapes qui doivent
-          l'etre cad, dans le cas d'ASTER, les etapes qui ne sont pas 
-          comprises entre le premier DEBUT/POURSUITE et le premier FIN 
-          et rendre actives les autres
-      """
-      #if self.definition.code == 'ASTER' :
-         # Seulement pour ASTER :
-         # Avant DEBUT actif vaut 0
-         # Apres DEBUT et avant le 1er FIN actif vaut 1
-         # Apres le 1er FIN actif vaut -1
-      #   actif=0
-      #actif=1
+      """
       for etape in self.etapes:
-        #if actif == 0 and etape.nom in ['DEBUT','POURSUITE']:actif=1
-        #if actif == 1:
            etape.active()
-           self.enregistreEtapePyxb(etape)
-        #else:
-        #   etape.inactive()
-        #if etape.nom == 'FIN':actif=-1
 
    def deplaceEntite(self,indexNoeudACopier,indexNoeudOuColler,pos):
       """
index 6057ce389723b993e4561afaf0bac93e1c5a1b86..10edd6bce4fc7fb55ab6f3cd149e442d1f007afe 100644 (file)
@@ -108,6 +108,7 @@ class configBase(object):
       self.affiche="alpha"
       self.closeAutreCommande = False
       self.closeFrameRechercheCommande = False
+      self.closeFrameRechercheCommandeSurPageDesCommandes = False
       self.closeEntete = False
       self.closeArbre = False
       self.demandeLangue=False
index 7d41beec1757c2bececdfb99b7843b87acfc7567..990fc1c0407c21e5d44977cb3861d9780a504030 100644 (file)
@@ -101,7 +101,7 @@ class MonChoixCommande(Ui_ChoixCommandes,QWidget):
          self.boolOrdre==1;  
          self.RBOrdre.setChecked(True);  
          self.afficheOrdre()
-      if self.editor.maConfiguration.closeFrameRechercheCommande == True : self.frameAffichage.close()
+      if self.editor.maConfiguration.closeFrameRechercheCommandeSurPageDesCommandes == True : self.frameAffichage.close()
 
       if self.editor.widgetTree != None : self.editor.restoreSplitterSizes(2) 
       else: self.editor.restoreSplitterSizes(3)
index da899b4e416c4a66ca7e9a3274bcc77094a96e1e..460c14534a48f03b853a06e8b2f0b2555fba163a 100644 (file)
@@ -92,9 +92,8 @@ class MonWidgetCommande(Ui_WidgetCommande,Groupe):
        
       if hasattr(self,'LENom'): self.LENom.returnPressed.connect(self.nomChange)
    
-      if self.editor.code in ['Adao','ADAO'] and self.editor.maConfiguration.closeFrameRechercheCommande==True  : 
-                      self.frameAffichage.close()
       if self.editor.maConfiguration.closeFrameRechercheCommande==True  : 
+         self.frameAffichage.close()
          self.closeAutreCommande()
 
       if self.editor.code in ['CARMELCND',] : self.closeAutreCommande()
index 904e5841a9f19c780a0f37d74406aeca9ad9923f..be75c09b9be9a1fdbb6d4d2a85c3a760065cb19c 100644 (file)
@@ -77,7 +77,7 @@ class  MonWidgetOptionnel (QWidget,Ui_WidgetOptionnel):
             del self.dicoMCWidgetOptionnel[k]
 
   def titre(self,MC):
-     if self.parentCommande.node.editor.code in ['Adao','ADAO'] and self.parentCommande.node.editor.maConfiguration.closeFrameRechercheCommande==True :
+     if self.parentCommande.node.editor.maConfiguration.closeFrameRechercheCommande==True :
         self.frameLabelCommande.close()
         return
      labeltext,fonte,couleur = self.parentCommande.node.item.getLabelText()
index 404a0284534c8879d978b6594d9a088b7fee6eb3..8ecc12a0a0c7fb85a493a248dea935baee664a4c 100755 (executable)
@@ -1,40 +1,20 @@
 #  coding: utf-8 -*-
 #
-#  Copyright (C) 2012-2013 EDF
-#
-#  This file is part of SALOME HYDRO module.
-#
-#  SALOME HYDRO module 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 3 of the License, or
-#  (at your option) any later version.
-#
-#  SALOME HYDRO module 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 SALOME HYDRO module.  If not, see <http://www.gnu.org/licenses/>.
-# PNPN changer la place du trait dans les FACT ouverts
-# PNPN ne pas afficher les facts optionnels
 
+import os
 import types
-from Accas import *
-import types
-class Tuple:
-  def __init__(self,ntuple):
-    self.ntuple=ntuple
+monFichier=os.path.abspath(__file__)
 
-  def __convert__(self,valeur):
-    if type(valeur) == types.StringType: return None
-    if len(valeur) != self.ntuple: return None
-    return valeur
+#  ------------------------------------------------- Definition fonction utilisateur
+from Accas import *
+class Surface_Elementaire (UserASSD): pass
+class StudySD (ASSD) : pass
 
-  def info(self):
-    return "Tuple de %s elements" % self.ntuple
+def creeSurfaceElementaire(MC) :
+   MC.creeObjetClasse(Surface_Elementaire)
+   return
 
-class Surface_Elementaire (UserASSD): pass
+#  ------------------------------------------------- Definition fonction du catalogue ou macro
 
 def champ (nomDelaContante, labels ,nbReels ) :
 # ajouter les extensions pour le fichier et les blocs associes
@@ -53,7 +33,7 @@ def champ (nomDelaContante, labels ,nbReels ) :
              #                   validators=VerifTypeTuple(("'R',"*nbReels),),) # end Particule
      ), #b_vsaisie
      b_vdsfich = BLOC (condition = "Mode_saisie == 'valeurs ds fichier'", 
-        Format = SIMP (statut='o', typ = 'TXM', into = ['txt','Med',] ),
+        Format = SIMP (statut='o', typ = 'TXM', into = ['txt','Med',], position='global' ),
         td_txt = BLOC_FICHIER (condition = 'Format == "txt"',
           Fichier  = SIMP(statut='o', typ = ('Fichier','Text Files(*.txt);All Files (*)'),),
         ),
@@ -72,85 +52,65 @@ def champ (nomDelaContante, labels ,nbReels ) :
      ),
     )
  
-       
-   
-def bloc_description_particule_manuelle (fonction_type_de_description) :
-    return BLOC ( condition = 'type_description_particule == "manuelle"',
-        Nombre_D_Especes = SIMP(statut = 'o', typ = 'I', defaut =1,),
-        Consigne = SIMP(statut ="o", homo="information", typ="TXM", defaut = " definir autant d espece que le  nombre d especes"),
-        Espece = FACT ( statut='o', max = "**",
-            Particule = apply(fonction_type_de_description),
-             ), # fin  fact Espece
-      )  # end b_manuelle
 
-def bloc_description_particule_tableau (nbReels, labels):
-      return BLOC ( condition = 'type_description_particule == "tableau"',
-        Nombre_D_Especes = SIMP(statut = 'o', typ = 'I', defaut =1,),
-        Consigne = SIMP(statut ="o", homo="information", typ="TXM", defaut = " definir autant d espece que le  nombre d especes"),
-        Espece = FACT ( statut='o', max = "**",
-             Particules = SIMP( fenetreIhm='Tableau', homo = labels,
-                                statut='o', min=2, max='**',
-                                typ = Tuple(nbReels),
-                                validators=VerifTypeTuple(("'R',"*nbReels),),) # end Particule
-             ), # fin  fact Espece
-      )  # end b_tableau
-
-def creeSurfaceElementaire(MC) :
-   # PNPN pour qu eric puisse tester
-   MC.creeObjetClasse(Surface_Elementaire)
-   return
-    
-# 
+def BlocPourLesFichiers (laCondition, NomDuFichier, ListeFormats):
+    SIMPFormatFichier = SIMP(statut='o', typ = 'TXM', into = tuple(ListeFormats) + ('others',), )
+    dicoDesBlocs = {}
+    for formatFich in ListeFormats :
+        nomBloc     = 'b_format_fichier' + str(formatFich)
+        typeDesFichiers = ('Fichier', formatFich + " Files (*." + formatFich + ");;All Files (*)",) 
+        blocCondition ="Format_Fichier == '" + formatFich + "'"
+        dicoDesBlocs[nomBloc] = BLOC_FICHIER ( condition = blocCondition, NomDuFichier = SIMP(statut='o', typ = typeDesFichiers ),)
+    dicoDesBlocs['b_format_fichier_others'] = BLOC_FICHIER (condition="Format_Fichier == 'others'", NomDuFichier = SIMP(statut='o', typ = ('Fichier','All Files (*)'),),)
+    return BLOC(condition=laCondition, Format_Fichier = SIMPFormatFichier, **dicoDesBlocs)
+       
 
-dict_Composant = { "Usecase Silvia" : ['Particule'],
-                   "Ecoulement_diphasique_disperse" : ['Particule', 'Fluide','Solide','Plasma',]
-                 }
-JdC = JDC_CATA('Vimmp')
+# ____________________________________________________________________________________________ #
 
+JdC = JDC_CATA(code='Vimmp',fichierSource=monFichier)
 
-Etude = PROC (nom = 'Etude',
-   Titre =  SIMP(statut='o', typ = 'TXM'),
 
+Etude = OPER (nom = 'Etude', sd_prod = StudySD, 
+   Titre        = SIMP(statut='o', typ = 'TXM'),
+   Temps_Simule = FACT(statut='o',
+     Temps_Initial =  SIMP(statut='o', typ = 'R'),
+     Duree =  SIMP(statut='o', typ = 'R'),
+                     ),
+#
    Domaine_Geometrique= FACT( statut='o',
-   Forme =  SIMP(statut='o', typ = 'TXM',into = ['Forme Simplifiee', 'CAO ou Maillage']),
-   b_Forme = BLOC( condition = 'Forme == "Forme Simplifiee"',
-          Boite = SIMP(statut='o', typ = 'TXM',into = ['Cube', 'Boule',] ),  
+       Forme   =  SIMP(statut='o', typ = 'TXM',into = ['Forme Simplifiee', 'CAO ou Maillage']),
+       b_Forme = BLOC( condition = 'Forme == "Forme Simplifiee"',
+          Boite = SIMP(statut='o', typ = 'TXM',into = ['Cube', 'Sphere','Cylindre'] ),  
           b_Cube = BLOC( condition = 'Boite == "Cube"',
-            Taille_Boite_Englobante = SIMP(statut='o', typ = 'R', max=3, min =3) 
-            # derait etre un Tuple(3) mais a faire apres la projection
+             #Taille_Boite_Englobante = SIMP(statut='o', typ = 'R', max=3, min =3) 
+             # derait etre un Tuple(3) mais a faire apres la projection
+             Taille_Boite_Englobante = SIMP(statut='o', typ= Tuple(3), validators=VerifTypeTuple(('R','R','R'),),)
           ), # fin b_Cube
           b_Boule = BLOC( condition = 'Boite == "Sphere"',
             Centre = SIMP(statut='o', typ = 'R', max=3, min =3),
-            Rayon  = SIMP(statut='o', typ = 'R') ,
-            # derait etre un Tuple(3) mais a faire apres la projection
-          ), # fin b_Sphere
-   ), # fin b_Forme
-   b_CAO =  BLOC ( condition="Forme == 'CAO ou Maillage'" ,
-           format_fichier = SIMP (statut='o', typ = 'TXM', into = ['txt','Med','I-deas', 'Gmsh', 'Harpoon', 'Simail', 'Star-CCM'], ),
- # PNPN -> generer tous les blocs
- # faire un mot clef pour avoir une projection qui permet le concatenation des into ?
-            b_format_fichier_med = BLOC ( condition="format_fichier == 'Med'",
-              Fichier_Domaine= SIMP(statut='o', typ = ('Fichier','Med Files(*.med);All Files (*)'),),
-            ),
-    ),# fin b_CAO 
+            # devrait etre un Tuple(3) mais a faire apres la projection
+          ),# fin b_Boule
+          b_Cylindre = BLOC( condition = 'Boite == "Cylindre"',
+            Hauteur = SIMP(statut = "o", typ = 'R',  val_min=0.0, ang='Nanotube length [m]'),
+          ),# fin b_Tube
+          b_Boule_ou_Cylindre = BLOC( condition = 'Boite == "Sphere" or Boite == "Cylindre"',
+            Rayon  = SIMP(statut='o', typ = 'R', val_min=0.0, ang='radius length [m]') ,
+          ),# fin b_Boule_ouCylindre
+       ), # fin b_Forme
+#
+       b_CAO = BlocPourLesFichiers ("Forme == 'CAO ou Maillage'",'Fichier_Domaine', ['txt','med','I-deas', 'Gmsh', 'top',]),
     surface_Elementaire=SIMP(statut= 'o',typ= 'TXM',max='**', siValide=creeSurfaceElementaire),
-    essai=SIMP(statut= 'o',typ= Surface_Elementaire),
-
-   ), # fin Domaine_Geometrique
+  ), # fin Domaine_Geometrique
 
 
+# ------------------- Composant_Du_Systeme -----------------------------#
    Composant_Du_Systeme= FACT(  statut='o', max = "**",
-#     #EF : Je ne ferais pas apparaître ici l'hybridation via le max=2
-#     #     J'attendrais de définir la méthode numérique...
      Composant = SIMP(statut='o', typ = 'TXM',into =  ['Particule', 'Fluide','Solide','Plasma'], position = 'global'),
      Niveau_De_Description = FACT ( min=1, max= 2, statut='o', 
        Niveau_De_Description_Generale = SIMP( statut ='o', typ = 'TXM',into = ['Microscopique','Mesoscopique', 'Macroscopique']),
-
-       # PNPN voir le global qui ne fonctionne pas
-       #b_Mesoscopique_Particule   = BLOC( condition = "Niveau_De_Description_Generale == 'Mesoscopique' ",
        b_Mesoscopique_Particule   = BLOC( condition = "Niveau_De_Description_Generale == 'Mesoscopique' and Composant == 'Particule'",
           Description_Physique = FACT( statut = 'o',
-             Electrostatics  = SIMP( statut='o', typ=bool, defaut=False, position ='global'),
+             Electrostatics    = SIMP( statut='o',   typ=bool, defaut=False, position ='global'),
              Nombre_D_Especes  = SIMP( statut = 'o', typ = 'I', defaut =1, position ='global_jdc'),
              Espece = FACT( statut='o', max = "**",
                 Nom_De_L_Espece     = SIMP( statut='o', typ = 'TXM'),
@@ -227,7 +187,7 @@ Etude = PROC (nom = 'Etude',
                 Modele_De_Particule = FACT ( statut='o', max ='**',
                    Type_D_Approche = SIMP(statut='o', typ = 'TXM',into =['Cinetique', 'Cinetique_Etendue', 'Position']),
                 ), # Modele_De_Particule
-                Modele_Numerique = FACT ( statut='o', 
+                Definition_Modele_Numerique = FACT ( statut='o', 
                    Modele_Numerique = SIMP (statut = 'o', typ = 'TXM', into = ['MD', 'DPD'], defaut ='DPD'), 
                    b_DPD = BLOC(condition = 'Modele_Numerique == "DPD"' ,
                       Structure_Loi_evolution = SIMP (statut = 'o', typ = 'TXM', into = ['Equations de Langevin']),
@@ -263,13 +223,13 @@ Etude = PROC (nom = 'Etude',
         b_periodique = BLOC( condition = "Type_Conditions_Limites == 'Periodique'",
           Direction = SIMP(statut='o', typ = 'TXM', into = ['X','Y','Z', 'all']),
         ), # b_periodique
-        b_Variable = BLOC( condition = "Porte_Sur_Tout_le_Vecteur == False ",
+        b_Variable_CL = BLOC( condition = "Porte_Sur_Tout_le_Vecteur == False ",
           Variable_Du_Vecteur_Etat = SIMP(statut='o', typ = 'TXM'),
         ), # b_Variable
     ),  # Conditions_Aux_Limites
     Conditions_Initiales = FACT ( statut ='o',  # 1 par valeur du vecteur d etat
         Porte_Sur_Tout_le_Vecteur = SIMP(statut='o', typ = bool),
-        b_Variable = BLOC( condition = "Porte_Sur_Tout_le_Vecteur == False ",
+        b_Variable_CI = BLOC( condition = "Porte_Sur_Tout_le_Vecteur == False ",
           Condition_Initiale_Par_Variable = FACT ( max = "**", statut ='o', 
              Variable_Du_Vecteur_Etat  = SIMP(statut='o', typ = 'TXM'),
              Type_Conditions_Initiales = SIMP( statut='o', typ= 'TXM', into =['Distribution Initiale Vecteur Etat', 'Valeurs Vecteur Etat Initiales'], position ='global'),
@@ -297,101 +257,34 @@ Etude = PROC (nom = 'Etude',
              ),# Condition_Initiale_Par_Variable
            ), # b_Globale
     ),  # Conditions_Initiales
-
 ) #  Etude
 
-#   # Systeme physique : met en oeuvre 1 ou plusieurs des 4 entites  ELectron
-#   #  Atome Coarse CVE (en check) but de l etude
-#   # plasma, solid, fluid , particule
-#   # met en oeuvre des composants principaux puis a quel niveau 
-#   # sous systeme physique elementaire pour composant principal
-#   # 
-#   Niveau_De_Description =  SIMP(statut='o', max= '**',typ ='TXM', into = ['Microscopic','Mesoscopic', 'Macroscopic',], homo= 'SansOrdreNiDoublon',position='global')  ,
-#   Type_De_Description =  SIMP( statut='o',  max= '**',homo ='SansOrdreNiDoublon',typ ='TXM', into = ['Modele Particulaire','Particulaire Stochastique','Automate sur reseau','Lagrangien Stochastique'],position='global') ,
-#   Modele_numeric =  SIMP( statut='o',  max= '**',homo ='SansOrdreNiDoublon',typ ='TXM', into = ['MD','DPD', 'DEM', 'CFD','LBM'],position='global') ,
-#   # selon les types de description on aura un modele de description de particules =
-#   # vecteur d etat ( approche cinetique et approche cinetique etendue ( electromagnetisme ou charge ...)) (independant du nb d espece)
-#   # on peut avoir des vecteurs d etat differents pour chacune des especes mais un vecteur d etat seulement par espece (differentes especes )
-#   # 
-#   #
-#   # en ddp la loi de comportement est donnée
-#   # DPD - > approche cinetique
-#   #       on choisit la structure de loi d evolution = langevin
-#   #       expression de la force conservative = loi de comportement (p33) _ MR (0 ou n)
-#   #       pour la m loi d evolution avec parametres fixes standalone
-#   #       pour la m loi d evolution avec parametres sont donnes par  1 ou +sieurs calculs (surtout en CFD pour +sieurs calcul pour chaque niveau) (hybride)
-#   #       on pourrait ne pas avoir de loi de comportement mais des parametres de la loi d evolution
-#   #       fermeture des contraintes : q faire sur une quantite numerique
-#   #   il y a des familles de structure de loi d evolution en fonction du couple ( modele de description et du modele numerique )   
-#   # DPD :  1 structure de loi d evolution : 3 termes
-#   # 1 et 1 seule structure de loi d evolution par modele numerique (inverse pas vrai : si langevin par forcement DPD)
-#   #Entite =  SIMP(statut='o',  max= '**',homo ='SansOrdreNiDoublon',typ ='TXM', into = ['element','atomic', 'grain', 'CVE (cont volume)'],position='global'), 
-#   #method_numeric = SIMP(statut='o', typ ='TXM', into = ['DPD ', 'SDPD']),
-#   type_de_methode=  SIMP(statut='o', typ ='TXM', into = ['stand_alone', 'hybride']) 
-#   # MD  = molecular dynamics (= microscopic)
-#   # CFD = computational fluid dynamics (= macroscopic) 
-#   # DPD = Dissipative Particule dynamics (= meso)  
-#   # DEM = Discrete Element Method 
-#   # ----------------------------------------------
-#   #b_DEM = BLOC (condition = 'Type_Etude == "DEM"',
-#   # ----------------------------------------------
-#   #   type_description_particule =  SIMP(statut = 'o', typ ='TXM', into =['fichier', 'tableau', 'manuelle'],position = 'global'),
-#   #   b_fichier = bloc_description_particule_fichier(),
-#   #   b_tableau = bloc_description_particule_tableau (9, ('Ux','Uy', 'Uz,', 'Vx','Vy', 'Vz','Rx','Ry','Rz')),
-#   #   b_manuelle = bloc_description_particule_manuelle(description_manuelle_particule_DEM),
-#   # ), # fin b_DEM
-#
-#   # ------------------------------------------------
-##    b_CFD = BLOC (condition = 'Type_Etude == "CFD"',
-##   # -----------------------------------------------
-##     Ecoulement = SIMP(statut='o', typ ='TXM', into = ['Laminaire','Turbulent']),
-##     FLuid = FACT( statut = 'o', 
-##          Masse_Volumique          =  SIMP(statut='o', typ='R', ),
-##          Viscosite_cinetique      =  SIMP(statut='o', typ='R', ),
-##          Diffusivite_thermique    =  SIMP(statut='f', typ='R', ),
-##          Diffusivite_des_especes  =  SIMP(statut='f', typ='R', max = '**'),
-##           ),
-##     
-##     #Particule = FACT( statut = 'o', max="**",
-##     #  Description_Cinetique =   Description_manuelle_Particule_Cinetique_etendue(),
-##     #  ),
-##     # type_description_particule =  SIMP(statut = 'o', typ ='TXM', into =['fichier', 'tableau', 'manuelle'],position = 'global'),
-##     # b_fichier = bloc_description_particule_fichier(),
-##      #b_tableau = bloc_description_particule_tableau (9, ('Ux','Uy', 'Uz,', 'Vx','Vy', 'Vz','Rx','Ry','Rz')),
-##    ),  # fin b_CFD
-##
-##    b_MD = BLOC (condition = 'Type_Etude == "MD"',
-##     type_description_particule =  SIMP(statut = 'o', typ ='TXM', into =['fichier', 'tableau', 'manuelle'],position = 'global'),
-##     b_fichier = bloc_description_particule_fichier(),
-##     b_tableau = bloc_description_particule_tableau (6, ('Ux','Uy', 'Uz,', 'Vx','Vy', 'Vz')),
-##     b_manuelle = bloc_description_particule_manuelle(description_manuelle_particule_cinetique),
-##
-##     Materiel_Relation = FACT( statut ='f',
-##         Entree_Possible= SIMP(statut='o', typ ='TXM', into = ['calcul', 'fichier']),
-##          b_fichier =   BLOC (condition = "Entree_Possible == 'fichier'",
-##             fichier_MR= SIMP(statut='o', typ= ('Fichier','All Files (*)')),
-##                            ),
-##          ),
-##    ), # fin b_MD
-##  # ---------------------------------------------
-##  b_DPD = BLOC (condition = 'Type_Etude == "DPD"',
-##  # ---------------------------------------------
-##   type_description_particule =  SIMP(statut = 'o', typ ='TXM', into =['fichier', 'tableau', 'manuelle'],position = 'global'),
-##   b_fichier = bloc_description_particule_fichier(),
-##   b_tableau = bloc_description_particule_tableau (6, ('Ux','Uy', 'Uz,', 'Vx','Vy', 'Vz')),
-##   b_manuelle = bloc_description_particule_manuelle(description_manuelle_particule_cinetique),
-##   Thermostat =  SIMP(statut='o', typ='R', ),
-##     ),
-##)
-###       ),
-###       ),
-#)
-###  #Fluid = SIMP(statut='o', typ ='TXM', into ='Laminaire', 'Trubulent'])
-###  #     Temperature =  SIMP(statut='f', typ='R', ),
-###  #     Concentration =  SIMP(statut='f', typ='R'),
-###  #     Diffusivite =  SIMP(statut='f', typ='R'),
-###  #     Frottement =  SIMP(statut='f', typ='R'),
-###  #     Concentration =  SIMP(statut='f', typ='R'),
-###    #),
-###
-###
+Run_Option = PROC (  nom='Run_Option',
+        MyStudy = SIMP (statut ='o', typ = StudySD ),
+        Working_Dir = SIMP( statut='f', typ= 'TXM'),   # 
+        Input_Files = FACT( statut ='o',
+            Type_Topology_File = SIMP( statut='o', typ= 'TXM', into=['geo']),
+            Topology_File   = SIMP( statut='o', typ= 'TXM'),
+        ),
+        Output_Files =  FACT ( statut ='o',
+            Output_File = SIMP( statut='f', typ= 'TXM'),
+        ),
+ )# Run_Option
+   
+
+DicoNomTypeDifferentNomElt={'T_Type_Interaction': {'_Type_Interaction_Interaction_Par_Paire_b_Interactionparpaire_Description_Physique_b_Mesoscopique_Particule_Niveau_De_Description_Composant_Du_Systeme_Etude': 'T_Type_Interaction',
+                        '_Type_Interaction_Interaction_champ_moyen_b_champ_moyen_Description_Physique_b_Mesoscopique_Particule_Niveau_De_Description_Composant_Du_Systeme_Etude': 'T_Type_Interaction_1',
+                        '_Type_Interaction_Interaction_champ_moyen_dynamique_b_champ_moyen_dynamique_Description_Physique_b_Mesoscopique_Particule_Niveau_De_Description_Composant_Du_Systeme_Etude': 'T_Type_Interaction_2'}}
+
+
+#def bloc_description_particule_tableau (nbReels, labels):
+#     return BLOC ( condition = 'type_description_particule == "tableau"',
+#       Nombre_D_Especes = SIMP(statut = 'o', typ = 'I', defaut =1,),
+#        Consigne = SIMP(statut ="o", homo="information", typ="TXM", defaut = " definir autant d espece que le  nombre d especes"),
+#        Espece = FACT ( statut='o', max = "**",
+#             Particules = SIMP( fenetreIhm='Tableau', homo = labels,
+#                                statut='o', min=2, max='**',
+#                                typ = Tuple(nbReels),
+#                                validators=VerifTypeTuple(("'R',"*nbReels),),) # end Particule
+#             ), # fin  fact Espece
+#      )  # end b_tableau
diff --git a/JP/cata_gromacs.py b/JP/cata_gromacs.py
new file mode 100644 (file)
index 0000000..9332bc7
--- /dev/null
@@ -0,0 +1,15 @@
+from cata_Vimmp import *
+
+
+CodeSpecific=PROC(nom='CodeSpecific',
+     Energy_Minimization = FACT(statut='o',
+         MD_Input_File     = SIMP(statut='o',  typ = ('Fichier','mdp Files (*.mdp);;All Files (*)')),
+         Structure_File    = SIMP(statut='o',  typ = ('Fichier','gro Files (*.gro);;All Files (*)')),
+                           # en entree de grompp et de mdrun option -c
+         Gromacs_Topology_File     = SIMP(statut='o',  typ = ('Fichier','Top Files (*.top);;All Files (*)')),
+         MD_File           = SIMP(statut='o',  typ = ('FichierNoAbs')),     # doit finir par mdp
+                           # le MD_Output_File (-o pour grommp devient le -s de de mdrun)
+         XDR_Output_File   = SIMP(statut='o',  typ = ('FichierNoAbs')),     # doit finir par tpr 
+         log_File          = SIMP(statut='f', defaut ='/tmp/EM.log', typ=('FichierNoAbs')),
+     ),
+)
diff --git a/JP/prefs_JP.py b/JP/prefs_JP.py
deleted file mode 100644 (file)
index 030a42a..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-# -*- coding: utf-8 -*-
-#            maConfiguration 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,sys
-# repIni sert a localiser le fichier editeur.ini
-# Obligatoire
-repIni=os.path.dirname(os.path.abspath(__file__))
-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=(
-   ('JP','V2017',os.path.join(repIni,'cata_JP.py'),'python','python'),
-)
-#nombreDeBoutonParLigne=4
-#simpleClic=True
-#closeFrameRechercheCommande=True
-#boutonDsMenuBar=False
-#closeArbre=True
-#afficheListesPliees=False
-#afficheCommandesPliees = False
-#enleverActionStructures = True
-#enleverParametres = True
-#enleverSupprimer = True
-#ajoutExecution = True
-#translatorFichier = os.path.join(repIni,'Meteo')
-#withXSD=True
-dumpXSD=True
-#afficheIhm=False
diff --git a/JP/prefs_Vimmp.py b/JP/prefs_Vimmp.py
new file mode 100644 (file)
index 0000000..69d0118
--- /dev/null
@@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+#            maConfiguration 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,sys
+# repIni sert a localiser le fichier editeur.ini
+# Obligatoire
+repIni=os.path.dirname(os.path.abspath(__file__))
+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=(
+   ('Vimmp','Vimmp',os.path.join(repIni,'cata_Vimmp.py'),'python','python'),
+   ('VimmpG','VimmpG',os.path.join(repIni,'cata_gromacs.py'),'python','python'),
+#   ('VimmpEN','VimmpEN',os.path.join(repIni,'cata_en.py'),'python','python'),
+)
+nombreDeBoutonParLigne=4
+#simpleClic=True
+closeFrameRechercheCommande=False
+closeFrameRechercheCommandeSurPageDesCommandes=True
+#boutonDsMenuBar=False
+#closeArbre=True
+#afficheListesPliees=False
+#afficheCommandesPliees = False
+afficheCommandesPliees=True
+enleverActionStructures = True
+enleverParametres = True
+enleverSupprimer = True
+#ajoutExecution = True
+#translatorFichier = os.path.join(repIni,'Meteo')
+withXSD=True
+#dumpXSD=True
+#afficheIhm=False
diff --git a/JP/qtEficasJP.py b/JP/qtEficasJP.py
deleted file mode 100755 (executable)
index 38a990b..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/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
-#
-"""
-   Ce module sert a lancer EFICAS configure pour Meteo 
-"""
-# Modules Python
-# Modules Eficas
-import prefs
-name='prefs_'+prefs.code
-__import__(name)
-
-import sys
-import os
-sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../..'))
-
-import prefs
-from InterfaceQT4 import eficas_go
-eficas_go.lanceEficas(code=prefs.code)
diff --git a/JP/qtEficasVimmp.py b/JP/qtEficasVimmp.py
new file mode 100755 (executable)
index 0000000..38a990b
--- /dev/null
@@ -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
+#
+"""
+   Ce module sert a lancer EFICAS configure pour Meteo 
+"""
+# Modules Python
+# Modules Eficas
+import prefs
+name='prefs_'+prefs.code
+__import__(name)
+
+import sys
+import os
+sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'../..'))
+
+import prefs
+from InterfaceQT4 import eficas_go
+eficas_go.lanceEficas(code=prefs.code)
index 8d9d11a58956168b1a5105fda5249d6354024418..9a7eed9814ce6c7807152e91ec98b479594b0239 100644 (file)
@@ -68,6 +68,8 @@ class ENTITE(object):
         else:
             self.validators = validators
         self.doitSenregistrerComme = None
+        self.txtNomComplet=''
+        self.redefinit=False
 
     def affecter_parente(self):
         """
@@ -77,6 +79,7 @@ class ENTITE(object):
             Il s'agit principalement des mots cles
         """
         for k, v in list(self.entites.items()):
+            #print( k,v)
             v.pere = self
             v.nom = k
 
@@ -263,17 +266,48 @@ class ENTITE(object):
             self.cr.fatal(_(u"L'attribut 'position' doit valoir 'local', 'global' "
                             u"ou 'global_jdc' : %r"), self.position)
 
-#    def dumpXSD(self):
-#        args = self.entites.copy()
-#        mcs = set()
-#        for nom, val in list(args.items()):
-#            if val.label == 'SIMP':
-#                mcs.add(nom)
-#                # XXX
-#                # if val.max != 1 and val.type == 'TXM':
-#                    # print "#CMD", parent, nom
-#            elif val.label == 'FACT':
-#                liste=val.dumpXSD()
-#                mcs.update(liste)
-#        print (self.nom, mcs) 
-#        return mcs
+    def nomComplet(self):
+        if self.txtNomComplet  != '' : return self.txtNomComplet
+        qui=self
+        while hasattr(qui, 'pere' ):
+              self.txtNomComplet+='_'+qui.nom
+              qui=qui.pere
+        self.txtNomComplet+='_'+qui.nom
+        return self.txtNomComplet
+
+    def addDefinitionMC(self,listeMCAvant,**args):
+        ouChercher=self
+        for mot in listeMCAvant:
+            try :
+              ouChercher=ouChercher.entites[mot]
+            except :
+              print ('impossible de trouver : ',mot,' ',listeMCAvant)
+        (nomMC,defMC)=args.items()[0]
+        defMC.pere = ouChercher
+        defMC.pere.propageRedefinit()
+        defMC.nom = nomMC
+        cata = CONTEXT.getCurrentCata()
+        print (cata)
+        ouChercher.entites[nomMC]=defMC
+
+    def changeDefinitionMC(self,listeMCAvant,**args):
+        ouChercher=self
+        for mot in listeMCAvant:
+            try :
+              ouChercher=ouChercher.entites[mot]
+            except :
+              print ('impossible de trouver : ',mot,' ',listeMCAvant)
+        monSIMP=ouChercher
+        for (nomAttributDef,valeurAttributDef) in args.items():
+             if hasattr(monSIMP, nomAttributDef) :
+               setattr(monSIMP, nomAttributDef, valeurAttributDef) 
+             else :
+               print ('pb avec ', nomAttributdef,valeurAttributMC)
+        monSIMP.propageRedefinit()
+
+    def propageRedefinit(self):
+   # a reflechir
+       self.redefinit=True
+       # PNPN il faut remonter a l etape
+   
+   
index 9a777aa6c597120bbc8262ce4a525a7f6bfa0778..5a185e203f336cc0a3e6fed3a857012f2453474f 100644 (file)
@@ -97,7 +97,7 @@ class ETAPE(N_MCCOMPO.MCCOMPO):
         enregistrements necessaires
         surcharge dans Ihm
         """
-        print ('makeRegister de  ETAPE')
+        #print ('makeRegister de  ETAPE')
         if self.parent:
             self.jdc = self.parent.getJdcRoot()
             self.id = self.parent.register(self)
index 7e0a7455b71775418ef46464ff93c9dcd91180db..178a797e9b09d85ecec6d8c90dcb017a606c4616 100644 (file)
@@ -292,6 +292,10 @@ Causes possibles :
                 "erreur non prevue et non traitee prevenir la maintenance " + '\n' + ''.join(l))
             del exc_typ, exc_val, exc_fr
             CONTEXT.unsetCurrentStep()
+        idx=0
+        for e in self.etapes:
+            self.enregistreEtapePyxb(e,idx)
+            idx=idx+1
 
     def afficheFinExec(self):
         """
@@ -323,6 +327,8 @@ Causes possibles :
            Cette methode ajoute etape dans la liste des etapes : self.etapes
            et retourne un numero d'enregistrement
         """
+        import traceback
+        traceback.print_stack()
         self.etapes.append(etape)
         self.index_etapes[etape] = len(self.etapes) - 1
         return self.gRegister(etape)
index 955b0897a2ae9b39d42e3185b0d563619ca879c9..dace06be9f79e1defc270ea7ce78e299f3c6c8c9 100644 (file)
@@ -119,6 +119,7 @@ class OPER(N_ENTITE.ENTITE):
         self.UIinfo = UIinfo
         self.affecter_parente()
         self.checkDefinition(self.nom)
+        self.txtNomComplet=""
 
     def __call__(self, reuse=None, **args):
         """
index 2f5db69b6ad2486972bad3150e7a4dd9c493c807..9fdc39d6a4bd19517a41aa10823222b1022e74a1 100644 (file)
@@ -83,7 +83,8 @@ class SIMP(N_ENTITE.ENTITE):
         else:
             self.type = (typ,)
         for t in (self.type) :
-            if isinstance(t,str):continue
+            if isinstance(t,str): continue
+            if isinstance(t,Accas.A_TUPLE.Tuple): continue
             if issubclass(t, Accas.UserASSD) : self.doitSenregistrerComme= t 
         self.fr = fr
         self.statut = statut
index 7d7fa449408c39862511ac546109e69b29ac041d..2e9cdc240cb3063d0b2e648976d7e7877b358871 100644 (file)
@@ -37,6 +37,7 @@ import traceback
 import re
 from .N_ASSD import ASSD
 from .N_types import isInt, isFloat_or_int, isComplex, isNumber, isStr, isSequence
+from Accas import A_TUPLE
 from Extensions.i18n import tr
 import six
 from six.moves import range
@@ -201,6 +202,12 @@ class TypeProtocol(PProtocol):
                         return obj
                 except Exception as err:
                     pass
+            elif  isinstance(type_permis, A_TUPLE.Tuple):
+                try:
+                    if type_permis.__convert__(obj):
+                        return obj
+                except Exception as err:
+                    pass
             elif  isinstance(type_permis, object):
                 try:
                     if type_permis.__convert__(obj):