From: pascale.noyret Date: Wed, 31 Jan 2018 14:36:59 +0000 (+0100) Subject: debut demandes MT et readerXML X-Git-Tag: EficasTUIV0~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cc58b73faa45c7f415972e6fe7ef9897a4683cba;p=modules%2Feficas.git debut demandes MT et readerXML --- diff --git a/CataTests/CataAZ.py b/CataTests/CataAZ.py new file mode 100755 index 00000000..b6e6494e --- /dev/null +++ b/CataTests/CataAZ.py @@ -0,0 +1,210 @@ +# coding: utf-8 +import types +from Accas import * + +class grno(GEOM): + """ + Classe servant à définir le nom d'un groupe de noeuds dans le fichier de commande + En clair : un chaine de longueur 24. + """ + def __convert__(cls,valeur): + """ + Fonction de verification de la longueur de la chaine + """ + if isinstance(valeur, (str,unicode)) and len(valeur.strip()) <= 24: + return valeur.strip() + raise ValueError(_(u'On attend une chaine de caractères (de longueur <= 24).')) + __convert__ = classmethod(__convert__) + +class grma(GEOM): + """ + Classe servant à définir le nom d'un groupe de mailles dans le fichier de commande + En clair : un chaine de longueur 24. + """ + def __convert__(cls,valeur): + """ + Fonction de verification de la longueur de la chaine + """ + if isinstance(valeur, (str,unicode)) and len(valeur.strip()) <= 24: + return valeur.strip() + raise ValueError(_(u'On attend une chaine de caractères (de longueur <= 24).')) + __convert__ = classmethod(__convert__) + + +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 + + __repr__=info + __str__=info + +class ObjetUtilisateur(ASSD): pass + + +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'))), + InSalome = SIMP(statut ='o', typ = SalomeEntry), + + 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 = "**"), + LInSalome = SIMP(statut ='o', typ = SalomeEntry, 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/CataTests/Elementary_Lists_52996_Cata.py b/CataTests/Elementary_Lists_52996_Cata.py new file mode 100644 index 00000000..f3cc11c8 --- /dev/null +++ b/CataTests/Elementary_Lists_52996_Cata.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +from Accas import * + +#class myMesh(ASSD): pass +class myModel(ASSD): pass + +JdC = JDC_CATA(code='PATTERNS', + execmodul=None, + regles=(#AU_PLUS_UN('DEBUT', 'POURSUITE'), + AU_PLUS_UN('ALL_LISTS'), + #AU_PLUS_UN('FIN'), + A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN') + ) +) + +class grma(): + def __convert__(cls,valeur): + if isinstance(valeur, (str,unicode)) and len(valeur.strip()) <= 24 : #and ("item" in (valeur.strip())) + return valeur.strip() + raise ValueError("Name length does not contain \"test\" and is longer than allowed, 24") + __convert__ = classmethod(__convert__) + +def mySeveral(suffix,num): + out=list() + for i in range(1,num+1): + out.append(suffix+str(i).zfill(2)) + return out + +switch_facultatif=True #change 'o' to 'f' of some widgets in the loop +#empty_defauts=True + +def myBloc(num): + myNum=str(num).zfill(2) + list_item_body="Item_"+myNum+"_" + defauts0=["","",True,"'phenomena_"+myNum+"'",mySeveral(list_item_body,2)] #presence of default values + defauts_mask=[False,False,True,True,True] #switch off defaults of some types + defauts=list() + for id0 in range(len(defauts0)): + if defauts_mask[id0]: + item=", defaut="+str(defauts0[id0]) + else: + item="" + defauts.append(item) + #print defauts + + opt=['o','o','o','o','o'] #initial default obligation of items in FACT groups + #make different widgets optional, one by one: + myLen=len(opt) + if switch_facultatif: + make_f=(num)%myLen + opt[make_f]='f' + #print opt + #if empty_defauts: + # clean_defaut=num%myLen + + myString="BLOC(condition=\"MESH==\'mesh_"+myNum+"'\""+defauts[0]+", AFFE=FACT(statut='"+opt[1]+"'"+defauts[1]+", ALL=SIMP(statut='"+opt[2]+"', typ=bool,ang='ALL "+myNum+" help EN'"+defauts[2]+"),PHENOMENA=SIMP(statut='"+opt[3]+"',typ='TXM',into=mySeveral('phenomena_',"+str(num)+")"+defauts[3]+"), MODELISATION=SIMP(statut='"+opt[4]+"',typ='TXM', min=2,max='**',into=mySeveral('"+list_item_body+"',"+str(num*4)+")"+defauts[4]+", ang='Input "+myNum+" list EN', fr='Input "+myNum+" list FR'),),)" + print myString + return eval(myString) + +ALL_LISTS=OPER(nom="ALL_LISTS",op=18,sd_prod=myModel, + UIinfo={"groupes":("Group1",)}, + ang="Model mesh definition EN", + reentrant='n', + #regles=(AU_MOINS_UN('LIST_O_CHECKTEXT','LIST_F_CHECKTEXT','LIST_O_ANY','LIST_F_ANY')), + + #LIST_O_NOREPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,validators=NoRepeat(),min=3, max='**'), + #LIST_F_NOREPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,validators=NoRepeat(),min=3, max='**'), + #LIST_F_REPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,min=3, max='**'), + #LIST_O_REPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,min=3, max='**'), + + #LIST_F_NOREPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',validators=NoRepeat(),min=3, max='**'), + #LIST_O_NOREPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3,validators=NoRepeat(), max='**'), + #LIST_O_REPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3, max='**'), + #LIST_F_REPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',min=3, max='**'), + + #LIST_O_NOREPEAT_CHECKTEXT_ADD=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03",), min=3, max='**'), + #LIST_F_REPEAT_ANYTEXT_ADD=SIMP(statut='f',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03",), min=3, max='**'), + + LIST_O_NOREPEAT_CHECKTEXT_ADD_NODEFAUT=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03","item04","text04",), min=3, max='**'), + #LIST_O_NOREPEAT_CHECKTEXT_ADD_DEFAUT=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03",), defaut=('item01','item02','item03'), min=3, max='**'), +) + +Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','ALL_LISTS','FIN') + +Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','ALL_LISTS','FIN') diff --git a/CataTests/Elementary_Lists_53000_Cata.py b/CataTests/Elementary_Lists_53000_Cata.py new file mode 100644 index 00000000..0dbba473 --- /dev/null +++ b/CataTests/Elementary_Lists_53000_Cata.py @@ -0,0 +1,52 @@ +# coding: utf-8 +from Accas import * + +#class myMesh(ASSD): pass +class myModel(ASSD): pass + +JdC = JDC_CATA(code='PATTERNS', + execmodul=None, + regles=(#AU_PLUS_UN('DEBUT', 'POURSUITE'), + AU_PLUS_UN('ALL_LISTS'), + #AU_PLUS_UN('FIN'), + A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN') + ) +) + + +ALL_LISTS=OPER(nom="ALL_LISTS",op=18,sd_prod=myModel, + UIinfo={"groupes":("Group1",)}, + ang="Model mesh definition EN", + reentrant='n', + LIST_O_NOREPEAT_CHECKTEXT_ADD_DEFAUT=SIMP(statut='o',typ="TXM",validators=NoRepeat(), + into=("item01","text01","item02","text02","item03","text03","item04","text04","item05","text05",), + defaut=('item01','item02','item03'), + homo="SansOrdreNiDoublon", + min=3, max='**'), + + #regles=(AU_MOINS_UN('LIST_O_CHECKTEXT','LIST_F_CHECKTEXT','LIST_O_ANY','LIST_F_ANY')), + + #LIST_O_NOREPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,validators=NoRepeat(),min=3, max='**'), + #LIST_F_NOREPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,validators=NoRepeat(),min=3, max='**'), + #LIST_F_REPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,min=3, max='**'), + #LIST_O_REPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,min=3, max='**'), + + #LIST_F_NOREPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',validators=NoRepeat(),min=3, max='**'), + #LIST_O_NOREPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3,validators=NoRepeat(), max='**'), + #LIST_O_REPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3, max='**'), + #LIST_F_REPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',min=3, max='**'), + + #LIST_O_NOREPEAT_CHECKTEXT_ADD=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03",), min=3, max='**'), + #LIST_F_REPEAT_ANYTEXT_ADD=SIMP(statut='f',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03",), min=3, max='**'), + + #LIST_O_NOREPEAT_CHECKTEXT_ADD_NODEFAUT=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03","item04","text04",), min=3, max='**'), + + + #LIST_O_SANSORDRENODOUBLON_CHECKTEXT_DEFAUT=SIMP(statut='o',typ=grma,homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03",), defaut=('item01','item02','item03'), min=3, max='**'), +) + + + +Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','ALL_LISTS','FIN') + +Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','ALL_LISTS','FIN') diff --git a/CataTests/Elementary_Lists_53013_Cata.py b/CataTests/Elementary_Lists_53013_Cata.py new file mode 100644 index 00000000..cf371ff2 --- /dev/null +++ b/CataTests/Elementary_Lists_53013_Cata.py @@ -0,0 +1,59 @@ +# coding: utf-8 +from Accas import * + +class myModel(ASSD): pass + +JdC = JDC_CATA(code='PATTERNS', + execmodul=None, + regles=(#AU_PLUS_UN('DEBUT', 'POURSUITE'), + AU_PLUS_UN('ALL_LISTS'), + #AU_PLUS_UN('FIN'), + A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN') + ) +) + +class grma(): + def __convert__(cls,valeur): + if isinstance(valeur, (str,unicode)) and len(valeur.strip()) <= 12 and ("item" in (valeur.strip()).lower()): # + return valeur.strip() + raise ValueError("Name length does not contain \"test\" and is longer than allowed, 12") + __convert__ = classmethod(__convert__) + +def mySeveral(suffix,num): + out=list() + for i in range(1,num+1): + out.append(suffix+str(i).zfill(2)) + return out + +ALL_LISTS=OPER(nom="ALL_LISTS",op=18,sd_prod=myModel, + UIinfo={"groupes":("Group1",)}, + fr="All lists definition FR", + ang="All lists definition EN", + reentrant='n', + #regles=(AU_MOINS_UN('LIST_O_CHECKTEXT','LIST_F_CHECKTEXT','LIST_O_ANY','LIST_F_ANY')), + + L1_LIST_O_NOREPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,validators=NoRepeat(),min=3, max='**', ang='Obligatory, No Repetitions, checked text, EN'), + L2_LIST_F_NOREPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,validators=NoRepeat(),min=3, max='**', ang='Optional, No Repetitions, checked text, EN'), + L3_LIST_F_REPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,min=3, max='**',ang='Optional, Allowed Repetitions, checked text, EN'), + L4_LIST_O_REPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,min=3, max='**',ang='Obligatory, Allowed Repetitions, checked text, EN'), + + L5_LIST_F_NOREPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',validators=NoRepeat(),min=3, max='**',ang='Optional, No Repetitions, any text, EN'), + L6_LIST_O_NOREPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3,validators=NoRepeat(), max='**',ang='Obligatory, No Repetitions, any text, EN'), + L7_LIST_O_REPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3, max='**',ang='Obligatory, Allowed Repetitions, any text, EN'), + L8_LIST_F_REPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',min=3, max='**',ang='Optional, Allowed Repetitions, any text, EN'), + + L9_LIST_O_NOREPEAT_CHECKTEXT_ADD=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With spare list, Obligatory, No Repetitions, checked text, EN',), + L10_LIST_F_REPEAT_ANYTEXT_ADD=SIMP(statut='f',typ='TXM', into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With spare list, Optional, Allowed Repetitions, any text, EN'), + L11_LIST_O_REPEAT_CHECKTEXT_ADD_NODEFAUT=SIMP(statut='o',typ=grma, into=("item01","text01","item02","text02","item03","text03","item04","text04"),ang='With spare list, obligatory, No Repetitions, checked text, no default values, EN', min=3, max='**'), + L12_LIST_O_NOREPEAT_CHECKTEXT_ADD_DEFAUT=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03","item04","text04","item05","text05",), defaut=('item01','item02','item03'), min=3, max='**',ang='With spare list, Obligatory, No Repetitions, checked text, with default values EN'), + + L13_LIST_F_SANSORDRENODOUBLON_ANYTEXT_NODEFAUT=SIMP(statut='f',typ='TXM',homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With check boxes, Optional, any text, no defaults, EN'), + L14_LIST_O_SANSORDRENODOUBLON_CHECKTEXT_NODEFAUT=SIMP(statut='o',typ=grma,homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With check boxes, Obligatory, checked text, EN'), + L15_LIST_O_SANSORDRENODOUBLON_CHECKTEXT_DEFAUT=SIMP(statut='o',typ=grma,homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03","item02","text02","item01","text01",), defaut=('item01','item02','item03'), min=3, max='**', ang='With check boxes, Obligatory, checked text, with default values, EN'), +) + + + +Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','ALL_LISTS','FIN') + +Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','ALL_LISTS','FIN') diff --git a/CataTests/Elementary_Lists_53036_Cata.py b/CataTests/Elementary_Lists_53036_Cata.py new file mode 100644 index 00000000..5cdc0faa --- /dev/null +++ b/CataTests/Elementary_Lists_53036_Cata.py @@ -0,0 +1,59 @@ +# coding: utf-8 +from Accas import * + +class myModel(ASSD): pass + +JdC = JDC_CATA(code='PATTERNS', + execmodul=None, + regles=(#AU_PLUS_UN('DEBUT', 'POURSUITE'), + AU_PLUS_UN('ALL_LISTS'), + #AU_PLUS_UN('FIN'), + A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN') + ) +) + +class grma(): + def __convert__(cls,valeur): + if isinstance(valeur, (str,unicode)) and len(valeur.strip()) <= 12 and ("item" in (valeur.strip()).lower()): # + return valeur.strip() + raise ValueError("Name length does not contain \"item\" and is longer than allowed, 12") + __convert__ = classmethod(__convert__) + +def mySeveral(suffix,num): + out=list() + for i in range(1,num+1): + out.append(suffix+str(i).zfill(2)) + return out + +ALL_LISTS=OPER(nom="ALL_LISTS",op=18,sd_prod=myModel, + UIinfo={"groupes":("Group1",)}, + fr="All lists definition FR", + ang="All lists definition EN", + reentrant='n', + #regles=(AU_MOINS_UN('LIST_O_CHECKTEXT','LIST_F_CHECKTEXT','LIST_O_ANY','LIST_F_ANY')), + + L1_LIST_O_NOREPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,validators=NoRepeat(),min=3, max='**', ang='Obligatory, No Repetitions, checked text, EN'), + L2_LIST_F_NOREPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,validators=NoRepeat(),min=3, max='**', ang='Optional, No Repetitions, checked text, EN'), + L3_LIST_F_REPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,min=3, max='**',ang='Optional, Allowed Repetitions, checked text, EN'), + L4_LIST_O_REPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,min=3, max='**',ang='Obligatory, Allowed Repetitions, checked text, EN'), + + L5_LIST_F_NOREPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',validators=NoRepeat(),min=3, max='**',ang='Optional, No Repetitions, any text, EN'), + L6_LIST_O_NOREPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3,validators=NoRepeat(), max='**',ang='Obligatory, No Repetitions, any text, EN'), + L7_LIST_O_REPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3, max='**',ang='Obligatory, Allowed Repetitions, any text, EN'), + L8_LIST_F_REPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',min=3, max='**',ang='Optional, Allowed Repetitions, any text, EN'), + + L9_LIST_O_NOREPEAT_CHECKTEXT_ADD=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With spare list, Obligatory, No Repetitions, checked text, EN',), + L10_LIST_F_REPEAT_ANYTEXT_ADD=SIMP(statut='f',typ='TXM', into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With spare list, Optional, Allowed Repetitions, any text, EN'), + L11_LIST_O_REPEAT_CHECKTEXT_ADD_NODEFAUT=SIMP(statut='o',typ=grma, into=("item01","text01","item02","text02","item03","text03","item04","text04"),ang='With spare list, obligatory, No Repetitions, checked text, no default values, EN', min=3, max='**'), + L12_LIST_O_NOREPEAT_CHECKTEXT_ADD_DEFAUT=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03","item04","text04","item05","text05",), defaut=('item01','item02','item03'), min=3, max='**',ang='With spare list, Obligatory, No Repetitions, checked text, with default values EN'), + + L13_LIST_F_SANSORDRENODOUBLON_ANYTEXT_NODEFAUT=SIMP(statut='f',typ='TXM',homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With check boxes, Optional, any text, no defaults, EN'), + L14_LIST_O_SANSORDRENODOUBLON_CHECKTEXT_NODEFAUT=SIMP(statut='o',typ=grma,homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With check boxes, Obligatory, checked text, EN'), + L15_LIST_O_SANSORDRENODOUBLON_CHECKTEXT_NOREPEAT_DEFAUT=SIMP(statut='o',typ=grma,homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03","item03","text03","item02","text02","item01","text01",), defaut=('item01','item02','item03'), min=3, max='**', ang='With check boxes, Obligatory, checked text, with default values, EN'), #validators=NoRepeat(), +) + + + +Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','ALL_LISTS','FIN') + +Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','ALL_LISTS','FIN') diff --git a/CataTests/Elementary_Lists_Cata.py b/CataTests/Elementary_Lists_Cata.py new file mode 100755 index 00000000..92d20b35 --- /dev/null +++ b/CataTests/Elementary_Lists_Cata.py @@ -0,0 +1,59 @@ +# coding: utf-8 +from Accas import * + +class myModel(ASSD): pass + +JdC = JDC_CATA(code='PATTERNS', + execmodul=None, + regles=(#AU_PLUS_UN('DEBUT', 'POURSUITE'), + AU_PLUS_UN('ALL_LISTS'), + #AU_PLUS_UN('FIN'), + A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN') + ) +) + +class grma(): + def __convert__(cls,valeur): + if isinstance(valeur, (str,unicode)) and len(valeur.strip()) <= 12 and ("item" in (valeur.strip()).lower()): # + return valeur.strip() + raise ValueError("Name length does not contain \"test\" and is longer than allowed, 12") + __convert__ = classmethod(__convert__) + +def mySeveral(suffix,num): + out=list() + for i in range(1,num+1): + out.append(suffix+str(i).zfill(2)) + return out + +ALL_LISTS=OPER(nom="ALL_LISTS",op=18,sd_prod=myModel, + UIinfo={"groupes":("Group1",)}, + fr="All lists definition FR", + ang="All lists definition EN", + reentrant='n', + #regles=(AU_MOINS_UN('LIST_O_CHECKTEXT','LIST_F_CHECKTEXT','LIST_O_ANY','LIST_F_ANY')), + + L1_LIST_O_NOREPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,validators=NoRepeat(),min=3, max='**', ang='Obligatory, No Repetitions, checked text, EN'), + L2_LIST_F_NOREPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,validators=NoRepeat(),min=3, max='**', ang='Optional, No Repetitions, checked text, EN'), + L3_LIST_F_REPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,min=3, max='**',ang='Optional, Allowed Repetitions, checked text, EN'), + L4_LIST_O_REPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,min=3, max='**',ang='Obligatory, Allowed Repetitions, checked text, EN'), + + L5_LIST_F_NOREPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',validators=NoRepeat(),min=3, max='**',ang='Optional, No Repetitions, any text, EN'), + L6_LIST_O_NOREPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3,validators=NoRepeat(), max='**',ang='Obligatory, No Repetitions, any text, EN'), + L7_LIST_O_REPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3, max='**',ang='Obligatory, Allowed Repetitions, any text, EN'), + L8_LIST_F_REPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',min=3, max='**',ang='Optional, Allowed Repetitions, any text, EN'), + + L9_LIST_O_NOREPEAT_CHECKTEXT_ADD=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With spare list, Obligatory, No Repetitions, checked text, EN',), + L10_LIST_F_REPEAT_ANYTEXT_ADD=SIMP(statut='f',typ='TXM', into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With spare list, Optional, Allowed Repetitions, any text, EN'), + L11_LIST_O_REPEAT_CHECKTEXT_ADD_NODEFAUT=SIMP(statut='o',typ=grma, into=("item01","text01","item02","text02","item03","text03","item04","text04"),ang='With spare list, obligatory, No Repetitions, checked text, no default values, EN', min=3, max='**'), + L12_LIST_O_NOREPEAT_CHECKTEXT_ADD_DEFAUT=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03","item04","text04","item05","text05",), defaut=('item01','item02','item03'), min=3, max='**',ang='With spare list, Obligatory, No Repetitions, checked text, with default values EN'), + + L13_LIST_F_SANSORDRENODOUBLON_ANYTEXT_NODEFAUT=SIMP(statut='f',typ='TXM',homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With check boxes, Optional, any text, no defaults, EN'), + L14_LIST_O_SANSORDRENODOUBLON_CHECKTEXT_NODEFAUT=SIMP(statut='o',typ=grma,homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With check boxes, Obligatory, checked text, EN'), + L15_LIST_O_SANSORDRENODOUBLON_CHECKTEXT_DEFAUT=SIMP(statut='o',typ=grma,homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03",), defaut=('item01','item02','item03'), min=3, max='**', ang='With check boxes, Obligatory, checked text, with default values, EN'), +) + + + +Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','ALL_LISTS','FIN') + +Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','ALL_LISTS','FIN') diff --git a/CataTests/Global_Condition_Cata.py b/CataTests/Global_Condition_Cata.py new file mode 100755 index 00000000..02396340 --- /dev/null +++ b/CataTests/Global_Condition_Cata.py @@ -0,0 +1,53 @@ +# coding: utf-8 +from Accas import * +#class myModel(ASSD): pass + +JdC = JDC_CATA(code='GLOB_COND', + execmodul=None, + regles=(AU_PLUS_UN('TYPES',), + AU_PLUS_UN('INITS',), + AU_PLUS_UN('DATAS',), + #A_CLASSER('TYPES','INITS','DATAS') + ) +); + +TYPES=PROC(nom='TYPES',op=None,UIinfo={"groupes":("Global_Workflow",)}, #sd_prod=myModel, + MODE=SIMP( + typ='TXM', + statut='o', + position='global_jdc', + into=("MANUAL","AUTOMATIC","MIXED"), + defaut="AUTOMATIC", + ), +); + +liste_condition=('INITS', 'DATAS') + +INITS=PROC(nom='INITS',op=None,UIinfo={"groupes":("INI_param",)}, + ini_manual=BLOC(condition="MODE == 'MANUAL'", + Informer=SIMP(statut='o',typ='TXM', defaut="INITS MANUAL"), + ), + ini_auto=BLOC(condition="MODE == 'AUTOMATIC'", + Informer=SIMP(statut='o', typ='TXM', defaut="INITS AUTOMATIC",), + ), + ini_mixed=BLOC(condition="MODE == 'MIXED'", + Informer=SIMP(statut='o',typ='TXM', defaut="INITS MIXED",), + ), +); +DATAS=PROC(nom='DATAS',op=None,UIinfo={"groupes":("DATAS",)}, + data_manual=BLOC(condition="MODE == 'MANUAL'", + Informer=SIMP(statut='o',typ='TXM', defaut="DATAS MANUAL", + ), + ), + data_auto=BLOC(condition="MODE == 'AUTOMATIC'", + Informer=SIMP(statut='o', typ='TXM', defaut="DATAS AUTOMATIC", + ), + ), + data_mixed=BLOC(condition="MODE == 'MIXED'", + Informer=SIMP(statut='o',typ='TXM', defaut="DATAS MIXED", + ), + ), +); + +Classement_Commandes_Ds_Arbre=('TYPES','INITS','DATAS') +Ordre_Des_Commandes = ('TYPES','INITS','DATAS') diff --git a/CataTests/Many_Concepts_52983_Cata.py b/CataTests/Many_Concepts_52983_Cata.py new file mode 100644 index 00000000..70f099ac --- /dev/null +++ b/CataTests/Many_Concepts_52983_Cata.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +from Accas import * + +#class myMesh(ASSD): pass +class myModel(ASSD): pass + +JdC = JDC_CATA(code='PATTERNS', + execmodul=None, + regles=(UN_PARMI('DEBUT', 'POURSUITE'), + AU_MOINS_UN('FIN'), + A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN'))) + +DEBUT=PROC(nom="DEBUT", op=68, repetable='n', UIinfo={"groupes":("Group1",)}, ang="Debut Eng help", + PAR_LOT=SIMP(ang="Debut Par Lot help En",statut='o',typ=bool, defaut=True), +) +AFFE_MODELE=OPER(nom="AFFE_MODELE",op=None,sd_prod=myModel, + UIinfo={"groupes":("Group1",)}, + ang="Model mesh definition EN", + MESH=SIMP(statut='o',typ='TXM',into=("mesh_01","mesh_02","mesh_03","mesh_04",) , defaut="mesh_01"), + #reentrant='n', + #regles=(AU_MOINS_UN('AFFE','AFFE_SOUS_STRUC'),UN_PARMI('MAILLAGE','GRILLE')), + + + block_mesh_01=BLOC(condition="MESH=='mesh_01'", + AFFE=FACT(statut='o', + ALL=SIMP(statut='o', typ=bool,ang='ALL 01 help EN', defaut=True), + PHENOMENA=SIMP(statut='o',typ='TXM',into=('phenomena_01','phenomena_02',), defaut='phenomena_01'), + #MODELISATION=SIMP(statut='o',typ='TXM', min=2,max='**', into=("mesh_01","mesh_02","mesh_03","mesh_04",) ,ang='Input 01 list EN', fr='Input 01 list FR'), + MODELISATION=SIMP(statut='o',typ='TXM', min=2,max='**', into=('Item_01_01','Item_01_02',) ,ang='Input 01 list EN', fr='Input 01 list FR'), + ), + ), +) +FIN=PROC(nom="FIN",op=9999,repetable='n',ang="Finish help EN",UIinfo={"groupes":("Group1",)}, + FORMAT_HDF =SIMP(ang="Save HDF EN",statut='f',typ='TXM',defaut="NON",into=("OUI","NON",) ), +) + +Classement_Commandes_Ds_Arbre=('DEBUT','MESH','AFFE_MODELE','FIN') +Ordre_Des_Commandes = ('DEBUT','MESH','AFFE_MODELE','FIN') diff --git a/CataTests/Many_Concepts_52988_Cata.py b/CataTests/Many_Concepts_52988_Cata.py new file mode 100644 index 00000000..52d4f10f --- /dev/null +++ b/CataTests/Many_Concepts_52988_Cata.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +from Accas import * + +class myMesh(ASSD): pass +class myModel(ASSD): pass + +JdC = JDC_CATA(code='PATTERNS', + execmodul=None, + regles=(AU_PLUS_UN('DEBUT', 'POURSUITE'), + AU_PLUS_UN('AFFE_MODELE'), + AU_PLUS_UN('FIN'), + A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN'))) + +def mySeveral(suffix,num): + out=list() + for i in range(1,num+1): + out.append(suffix+str(i).zfill(2)) + return out + +switch_facultatif=True #change 'o' to 'f' of some widgets in the loop +empty_defauts=True + +def myBloc(num): + myNum=str(num).zfill(2) + list_item_body="Item_"+myNum+"_" + defauts0=["","",True,"'phenomena_"+myNum+"'",mySeveral(list_item_body,2)] #presence of default values + defauts_mask=[False,False,True,True,True] #switch off defaults of some types + defauts=list() + for id0 in range(len(defauts0)): + if defauts_mask[id0]: + item=", defaut="+str(defauts0[id0]) + else: + item="" + defauts.append(item) + #print defauts + + opt=['o','o','o','o','o'] #initial default obligation of items in FACT groups + #make some widgets optional: + myLen=len(opt) + if switch_facultatif: + make_f=(num)%myLen + opt[make_f]='f' + #print opt + if empty_defauts: + clean_defaut=num%myLen + + myString="BLOC(condition=\"MESH==\'mesh_"+myNum+"'\""+defauts[0]+", AFFE=FACT(statut='"+opt[1]+"'"+defauts[1]+", ALL=SIMP(statut='"+opt[2]+"', typ=bool,ang='ALL "+myNum+" help EN'"+defauts[2]+"),PHENOMENA=SIMP(statut='"+opt[3]+"',typ='TXM',into=mySeveral('phenomena_',"+str(num)+")"+defauts[3]+"), MODELISATION=SIMP(statut='"+opt[4]+"',typ='TXM', min=2,max='**',into=mySeveral('"+list_item_body+"',"+str(num*4)+")"+defauts[4]+", ang='Input "+myNum+" list EN', fr='Input "+myNum+" list FR'),),)" + print myString + return eval(myString) + +DEBUT=PROC(nom="DEBUT", op=10, repetable='n', UIinfo={"groupes":("Group1",)}, ang="Debut Eng help", + PAR_LOT=SIMP(ang="Debut Par Lot help En",statut='o',typ=bool, defaut=True), +); + +AFFE_MODELE=OPER(nom="AFFE_MODELE",op=18,sd_prod=myModel, + UIinfo={"groupes":("Group1",)}, + ang="Model mesh definition EN", + reentrant='n', + regles=(AU_MOINS_UN('APPROVED')), + MESH=SIMP(statut='o',typ='TXM',into=mySeveral("mesh_",4) ,defaut="mesh_01"), + APPROVED=SIMP(statut="o", typ=bool), + block_mesh_01=myBloc(1), + block_mesh_02=myBloc(2), + block_mesh_03=myBloc(3), + block_mesh_04=myBloc(4), +) + + +FIN=PROC(nom="FIN",op=9999,repetable='n',ang="Finish help EN",UIinfo={"groupes":("Group1",)}, + FORMAT_HDF =SIMP(ang="Save HDF EN",statut='f',typ='TXM',defaut="NON",into=("OUI","NON",) ), +); + +Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','AFFE_MODELE','FIN') + +Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','AFFE_MODELE','FIN') diff --git a/CataTests/Many_Concepts_52989_Cata.py b/CataTests/Many_Concepts_52989_Cata.py new file mode 100644 index 00000000..930d9e89 --- /dev/null +++ b/CataTests/Many_Concepts_52989_Cata.py @@ -0,0 +1,77 @@ +# coding: utf-8 + +from Accas import * + +#class myMesh(ASSD): pass +class myModel(ASSD): pass + +JdC = JDC_CATA(code='PATTERNS', + execmodul=None, + regles=(AU_PLUS_UN('DEBUT', 'POURSUITE'), + AU_PLUS_UN('AFFE_MODELE'), + AU_PLUS_UN('FIN'), + A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN'))) + +def mySeveral(suffix,num): + out=list() + for i in range(1,num+1): + out.append(suffix+str(i).zfill(2)) + return out + +switch_facultatif=True #change 'o' to 'f' of some widgets in the loop +#empty_defauts=True + +def myBloc(num): + myNum=str(num).zfill(2) + list_item_body="Item_"+myNum+"_" + defauts0=["","",True,"'phenomena_"+myNum+"'",mySeveral(list_item_body,2)] #presence of default values + defauts_mask=[False,False,True,True,True] #switch off defaults of some types + defauts=list() + for id0 in range(len(defauts0)): + if defauts_mask[id0]: + item=", defaut="+str(defauts0[id0]) + else: + item="" + defauts.append(item) + #print defauts + + opt=['o','o','o','o','o'] #initial default obligation of items in FACT groups + #make different widgets optional, one by one: + myLen=len(opt) + if switch_facultatif: + make_f=(num)%myLen + opt[make_f]='f' + #print opt + #if empty_defauts: + # clean_defaut=num%myLen + + myString="BLOC(condition=\"MESH==\'mesh_"+myNum+"'\""+defauts[0]+", AFFE=FACT(statut='"+opt[1]+"'"+defauts[1]+", ALL=SIMP(statut='"+opt[2]+"', typ=bool,ang='ALL "+myNum+" help EN'"+defauts[2]+"),PHENOMENA=SIMP(statut='"+opt[3]+"',typ='TXM',into=mySeveral('phenomena_',"+str(num)+")"+defauts[3]+"), MODELISATION=SIMP(statut='"+opt[4]+"',typ='TXM', min=2,max='**',into=mySeveral('"+list_item_body+"',"+str(num*4)+")"+defauts[4]+", ang='Input "+myNum+" list EN', fr='Input "+myNum+" list FR'),),)" + print myString + return eval(myString) + +DEBUT=PROC(nom="DEBUT", op=10, repetable='n', UIinfo={"groupes":("Group1",)}, ang="Debut Eng help", + PAR_LOT=SIMP(ang="Debut Par Lot help En",statut='o',typ=bool, defaut=True), +); + +AFFE_MODELE=OPER(nom="AFFE_MODELE",op=18,sd_prod=myModel, + UIinfo={"groupes":("Group1",)}, + ang="Model mesh definition EN", + reentrant='n', + regles=(AU_MOINS_UN('APPROVED')), + MESH=SIMP(statut='o',typ='TXM',into=mySeveral("mesh_",4) ,defaut="mesh_01"), + APPROVED=SIMP(statut="f", typ=bool), # presence of this item will validate the whole group + PAR_LOT=SIMP(ang="Debut Par Lot help En",statut='o',typ='I', defaut=True), + block_mesh_01=myBloc(1), + block_mesh_02=myBloc(2), + block_mesh_03=myBloc(3), + block_mesh_04=myBloc(4), +) + + +FIN=PROC(nom="FIN",op=9999,repetable='n',ang="Finish help EN",UIinfo={"groupes":("Group1",)}, + FORMAT_HDF =SIMP(ang="Save HDF EN",statut='f',typ='TXM',defaut="NON",into=("OUI","NON",) ), +); + +Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','AFFE_MODELE','FIN') + +Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','AFFE_MODELE','FIN') diff --git a/CataTests/Many_Concepts_52992_Cata.py b/CataTests/Many_Concepts_52992_Cata.py new file mode 100644 index 00000000..13145b96 --- /dev/null +++ b/CataTests/Many_Concepts_52992_Cata.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +from Accas import * + +#class myMesh(ASSD): pass +class myModel(ASSD): pass + +JdC = JDC_CATA(code='PATTERNS', + execmodul=None, + regles=(AU_PLUS_UN('DEBUT', 'POURSUITE'), + AU_PLUS_UN('AFFE_MODELE'), + AU_PLUS_UN('FIN'), + A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN'))) + +def mySeveral(suffix,num): + out=list() + for i in range(1,num+1): + out.append(suffix+str(i).zfill(2)) + return out + +switch_facultatif=True #change 'o' to 'f' of some widgets in the loop +#empty_defauts=True + +def myBloc(num): + myNum=str(num).zfill(2) + list_item_body="Item_"+myNum+"_" + defauts0=["","",True,"'phenomena_"+myNum+"'",mySeveral(list_item_body,2)] #presence of default values + defauts_mask=[False,False,True,True,False] #switch off defaults of some types + defauts=list() + for id0 in range(len(defauts0)): + if defauts_mask[id0]: + item=", defaut="+str(defauts0[id0]) + else: + item="" + defauts.append(item) + #print defauts + + opt=['o','o','o','o','o'] #initial default obligation of items in FACT groups + #make different widgets optional, one by one: + myLen=len(opt) + if switch_facultatif: + make_f=(num)%myLen + opt[make_f]='f' + #print opt + #if empty_defauts: + # clean_defaut=num%myLen + + myString="BLOC(condition=\"MESH==\'mesh_"+myNum+"'\""+defauts[0]+", AFFE=FACT(statut='"+opt[1]+"'"+defauts[1]+", ALL=SIMP(statut='"+opt[2]+"', typ=bool,ang='ALL "+myNum+" help EN'"+defauts[2]+"),PHENOMENA=SIMP(statut='"+opt[3]+"',typ='TXM',into=mySeveral('phenomena_',"+str(num)+")"+defauts[3]+"), MODELISATION=SIMP(statut='"+opt[4]+"',typ='TXM', min=4,max='**',into=mySeveral('"+list_item_body+"',"+str(num*4)+")"+defauts[4]+", ang='Input "+myNum+" list EN', fr='Input "+myNum+" list FR'),),)" + print myString + return eval(myString) + +DEBUT=PROC(nom="DEBUT", op=10, repetable='n', UIinfo={"groupes":("Group1",)}, ang="Debut Eng help", + PAR_LOT=SIMP(ang="Debut Par Lot help En",statut='o',typ=bool, defaut=True), +); + +AFFE_MODELE=OPER(nom="AFFE_MODELE",op=18,sd_prod=myModel, + UIinfo={"groupes":("Group1",)}, + ang="Model mesh definition EN", + reentrant='n', + regles=(AU_MOINS_UN('APPROVED')), + MESH=SIMP(statut='o',typ='TXM',into=mySeveral("mesh_",4) ,defaut="mesh_01"), + APPROVED=SIMP(statut="f", typ=bool), # presence of this item will validate the whole group + block_mesh_01=myBloc(1), + block_mesh_02=myBloc(2), + block_mesh_03=myBloc(3), + block_mesh_04=myBloc(4), +) + + +FIN=PROC(nom="FIN",op=9999,repetable='n',ang="Finish help EN",UIinfo={"groupes":("Group1",)}, + FORMAT_HDF =SIMP(ang="Save HDF EN",statut='f',typ='TXM',defaut="NON",into=("OUI","NON",) ), +); + +Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','AFFE_MODELE','FIN') + +Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','AFFE_MODELE','FIN') diff --git a/CataTests/Matrix_Cata.py b/CataTests/Matrix_Cata.py new file mode 100644 index 00000000..0e47d7b1 --- /dev/null +++ b/CataTests/Matrix_Cata.py @@ -0,0 +1,87 @@ +# coding: utf-8 +from Accas import * + +class loi ( ASSD ) : pass +class variable ( ASSD ) : pass + +class Matrice: + def __init__(self,nbLigs=None,nbCols=None,methodeCalculTaille=None,formatSortie="ligne",valSup=None,valMin=None,structure=None): + self.nbLigs=nbLigs + self.nbCols=nbCols + self.methodeCalculTaille=methodeCalculTaille + self.formatSortie=formatSortie + self.valSup=valSup + self.valMin=valMin + self.structure=structure + + def __convert__(self,valeur): + # Attention ne verifie pas grand chose + if type(valeur) != types.ListType : + return None + return valeur + + def info(self): + return "Matrice %s x %s" % (self.nbLigs, self.nbCols) + + __repr__=info + __str__=info + + + +class myModel(ASSD): pass + +JdC = JDC_CATA(code='PATTERNS', + execmodul=None, + regles=(AU_MOINS_UN ( 'CORRELATION' ), + ) +) + +DETERMINISTICVARIABLE = OPER ( nom = "DETERMINISTICVARIABLE", + sd_prod = variable, + op = None, + fr = "Variable deterministe", + ang = "Deterministic variable", + + N = SIMP ( statut = 'o', typ = "TXM", fr = "Nom", ang = "Name", defaut = "Var1" ), + T = SIMP ( statut = 'o', defaut = "in", into = ( "in" , "out", ), typ = "TXM", fr = "Type", ang = "Type" ), + R = SIMP ( statut = 'o', defaut = 0, typ = "I", fr = "Rang", ang = "Rank" ), +) + +DISTRIBUTION = OPER ( nom = "DISTRIBUTION", + sd_prod = loi, + op = 68, + fr = "Definitions des lois marginales utilisees par les variables d'entree", + + R = SIMP ( statut = "o", typ = "R", max = 1, val_min = 0., fr = "Parametre R de la loi | R > 0", ang = "R parameter | R > 0", defaut = 0.5 ), + # T > R + T = SIMP ( statut = "o", typ = "R", max = 1, val_min = 0., fr = "Parametre T de la loi | T > R", ang = "T parameter | T > R", defaut = 0.7 ), + A = SIMP ( statut = "o", typ = "R", max = 1, fr = "Borne inferieure du support de la loi", ang = "Support lower bound", defaut = 0.1 ), + # B > A + B = SIMP ( statut = "o", typ = "R", max = 1, fr = "Borne superieure du support de la loi", ang = "Support upper bound", defaut = 0.3 ), +) + +VARIABLE = PROC ( nom = "VARIABLE", + op = None, + docu = "", + fr = "Variable probabiliste", + ang = "Probabilistic variable", + + ModelVariable = SIMP ( statut = "o", typ = ( variable, ), fr = "Variable d'entrée du modèle", ang = "Input variable of the model" ), + Distribution = SIMP ( statut = "o", typ = ( loi, ), fr = "Modélisation probabiliste", ang = "Probabilistic modelisation" ), +) + +CORRELATION = PROC ( nom = 'CORRELATION', + op = None, + docu = "", + fr = "Correlation entre variables", + ang = "Variable correlation", + + CorrelationMatrix = SIMP ( statut = "o", typ = Matrice(nbLigs=None, + nbCols=None, + methodeCalculTaille='nbDeVariables', + valSup=1, + valMin=-1, + structure="symetrique"), + fr = "Matrice de correlation entre les variables d'entree", + ang = "Correlation matrix for input variables" ), +) diff --git a/CataTests/Nested_Cond_52945_Cata.py b/CataTests/Nested_Cond_52945_Cata.py new file mode 100644 index 00000000..9d3b119d --- /dev/null +++ b/CataTests/Nested_Cond_52945_Cata.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +from Accas import * + +class loi(): pass + +JdC = JDC_CATA (code = 'PATTERNS', + execmodul = None, + ) +use_and=False #switch off second condition about MAX_ROWS while it does not work for blocks greater than 2 +def cond2(myMax=False): + if use_and: + if myMax: + out= " and MAX_ROWS>="+str(myMax) + else: + out="" + else: + out="" + print out + return out + +PROC_01 = PROC(nom = "PROC_01",op = None, ang="Help for PROC_01 EN", + MAX_ROWS=SIMP(statut='o',typ='I',val_min=1,val_max=8, defaut=8), + PROCGROUP1=SIMP(statut='o',typ='TXM',into=("1A","2A","add new row",)), + wideblock1=BLOC(condition='PROCGROUP1=="add new row"'+cond2(1), + PROCGROUP2=SIMP(statut='o',typ='TXM',into=("1A","add new row","3A",)), + wideblock2=BLOC(condition='PROCGROUP2=="add new row"'+cond2(2), + PROCGROUP3=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), + PROCGROUP689=SIMP(statut='o',typ='TXM',), + wideblock3=BLOC(condition='PROCGROUP3=="add new row"'+cond2(3), + PROCGROUP4=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), + wideblock4=BLOC(condition='PROCGROUP4=="add new row"'+cond2(4), + PROCGROUP5=SIMP(statut='o',typ='TXM',into=("add new row","2","3",)), + wideblock5=BLOC(condition='PROCGROUP5=="add new row"'+cond2(5), + PROCGROUP6=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), + wideblock6=BLOC(condition='PROCGROUP6=="add new row"'+cond2(6), + PROCGROUP7=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), + wideblock7=BLOC(condition='PROCGROUP7=="add new row"'+cond2(7), + PROCGROUP8=SIMP(statut='o',typ='TXM',into=("add new row","2","3",)), + wideblock8=BLOC(condition='PROCGROUP8=="add new row"'+cond2(8), + ) + ) + ) + ) + ) + ) + ) + ) +) + +#LEV1 = OPER( nom = "LEV1", +# sd_prod=loi, +# op=68, +# fr='LEV1 FR', +# Boolean01=SIMP( statut = 'o',typ = bool, defaut=True, fr = 'Bool mandatory FR', ang = 'Bool mandatory EN'), +# SelectedItem=SIMP(statut = 'o',typ = 'TXM', into=["01_01","01_02","01_03","01_04"], fr="FR"), +#) + +Classement_Commandes_Ds_Arbre=('PROC_01',) + +Ordre_Des_Commandes = ('PROC_01',) diff --git a/CataTests/Nested_Cond_52946_Cata.py b/CataTests/Nested_Cond_52946_Cata.py new file mode 100644 index 00000000..fef5edf0 --- /dev/null +++ b/CataTests/Nested_Cond_52946_Cata.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +from Accas import * + +class loi(): pass + +JdC = JDC_CATA (code = 'PATTERNS', + execmodul = None, + ) +use_and=True #switch off second condition about MAX_ROWS while it does not work for blocks greater than 2 +def cond2(myMax=False): + if use_and: + if myMax: + out= " and MAX_ROWS>="+str(myMax) + else: + out="" + else: + out="" + print out + return out + +PROC_01 = PROC(nom = "PROC_01",op = None, ang="Help for PROC_01 EN", + MAX_ROWS=SIMP(statut='o',typ='I',val_min=1,val_max=8, defaut=8), + PROCGROUP1=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), + wideblock1=BLOC(condition='PROCGROUP1=="add new row"'+cond2(1), + PROCGROUP2=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), + #wideblock2=BLOC(condition='PROCGROUP2=="add new row"', + wideblock2=BLOC(condition='MAX_ROWS == 8', + #wideblock2=BLOC(condition='PROCGROUP2=="add new row" and (MAX_ROWS > 2)', + PROCGROUP3=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), + wideblock3=BLOC(condition='PROCGROUP3=="add new row"'+cond2(3), + PROCGROUP4=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), + wideblock4=BLOC(condition='PROCGROUP4=="add new row"'+cond2(4), + PROCGROUP5=SIMP(statut='o',typ='TXM',into=("add new row","2","3",)), + wideblock5=BLOC(condition='PROCGROUP5=="add new row"'+cond2(5), + PROCGROUP6=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), + wideblock6=BLOC(condition='PROCGROUP6=="add new row"'+cond2(6), + PROCGROUP7=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), + wideblock7=BLOC(condition='PROCGROUP7=="add new row"'+cond2(7), + PROCGROUP8=SIMP(statut='o',typ='TXM',into=("add new row","2","3",)), + wideblock8=BLOC(condition='PROCGROUP8=="add new row"'+cond2(8), + ) + ) + ) + ) + ) + ) + ) + ) +) + +#LEV1 = OPER( nom = "LEV1", +# sd_prod=loi, +# op=68, +# fr='LEV1 FR', +# Boolean01=SIMP( statut = 'o',typ = bool, defaut=True, fr = 'Bool mandatory FR', ang = 'Bool mandatory EN'), +# SelectedItem=SIMP(statut = 'o',typ = 'TXM', into=["01_01","01_02","01_03","01_04"], fr="FR"), +#) + +Classement_Commandes_Ds_Arbre=('PROC_01',) + +Ordre_Des_Commandes = ('PROC_01',) diff --git a/CataTests/Nested_Cond_52947_Cata.py b/CataTests/Nested_Cond_52947_Cata.py new file mode 100644 index 00000000..bf3be39e --- /dev/null +++ b/CataTests/Nested_Cond_52947_Cata.py @@ -0,0 +1,17 @@ +# coding: utf-8 + +from Accas import * + +class loi(): pass + +JdC = JDC_CATA (code = 'PATTERNS', + execmodul = None, + ) + +PROC_01 = PROC(nom = "PROC_01",op = None, ang="Help for PROC_01 EN", + PROCGROUP1=SIMP(statut='o',typ='TXM',into=("a1","a2","a3",)), +) + +Classement_Commandes_Ds_Arbre=('PROC_01',) + +Ordre_Des_Commandes = ('PROC_01',) diff --git a/CataTests/Nested_Cond_52948_Cata.py b/CataTests/Nested_Cond_52948_Cata.py new file mode 100644 index 00000000..81f216f8 --- /dev/null +++ b/CataTests/Nested_Cond_52948_Cata.py @@ -0,0 +1,21 @@ +# coding: utf-8 + +from Accas import * + +class loi(ASSD): pass + +JdC = JDC_CATA (code = 'PATTERNS', + execmodul = None, + ) + +PER_01 = OPER( nom = "PER_01", + sd_prod=loi, + op=68, + fr='LEV1 FR', + Boolean01=SIMP( statut = 'o',typ = bool, defaut=True, fr = 'Bool mandatory FR', ang = 'Bool mandatory EN'), + SelectedItem=SIMP(statut = 'o',typ = 'TXM', into=["01_01","01_02","01_03","01_04"], fr="FR"), +) + +#Classement_Commandes_Ds_Arbre=('OPER_01',) + +#Ordre_Des_Commandes = ('OPER_01',) diff --git a/CataTests/Nested_Cond_52949_Cata.py b/CataTests/Nested_Cond_52949_Cata.py new file mode 100644 index 00000000..d09011a3 --- /dev/null +++ b/CataTests/Nested_Cond_52949_Cata.py @@ -0,0 +1,19 @@ +# coding: utf-8 + +from Accas import * + +JdC = JDC_CATA (code = 'PATTERNS', + execmodul = None, + ) + +PROC_01 = PROC(nom = "PROC_01",op = None, ang="Help for PROC_01 EN", + MAX_ROWS=SIMP(statut='o',typ='I',val_min=1,val_max=8, defaut=8), + PROCGROUP1=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), + wideblock1=BLOC(condition='PROCGROUP1 in "add new row"', + PROCGROUP2=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), + ) +) + +Classement_Commandes_Ds_Arbre=('PROC_01',) + +Ordre_Des_Commandes = ('PROC_01',) diff --git a/CataTests/Nested_Cond_52952_Cata.py b/CataTests/Nested_Cond_52952_Cata.py new file mode 100644 index 00000000..47a8d7c5 --- /dev/null +++ b/CataTests/Nested_Cond_52952_Cata.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +from Accas import * + +class loi(): pass + +JdC = JDC_CATA (code = 'PATTERNS', + execmodul = None, + ) +use_and=False #switch off second condition about MAX_ROWS while it does not work for blocks greater than 2 +def cond2(myMax=False): + if use_and: + if myMax: + out= " and MAX_ROWS>="+str(myMax) + else: + out="" + else: + out="" + #print out + return out + +PROC_01 = PROC(nom = "PROC_01",op = None, ang="Help for PROC_01 EN", + MAX_ROWS=SIMP(statut='o',typ='I',val_min=1,val_max=8, defaut=8), + PROCGROUP1=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), + wideblock1=BLOC(condition='PROCGROUP1=="add new row"'+cond2(1), + PROCGROUP2=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), + wideblock2=BLOC(condition='PROCGROUP2=="add new row"'+cond2(2), + PROCGROUP3=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), + wideblock3=BLOC(condition='PROCGROUP3=="add new row"'+cond2(3), + PROCGROUP4=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), + wideblock4=BLOC(condition='PROCGROUP4=="add new row"'+cond2(4), + PROCGROUP5=SIMP(statut='o',typ='TXM',into=("add new row","2","3",)), + wideblock5=BLOC(condition='PROCGROUP5=="add new row"'+cond2(5), + PROCGROUP6=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), + wideblock6=BLOC(condition='PROCGROUP6=="add new row"'+cond2(6), + PROCGROUP7=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), + wideblock7=BLOC(condition='PROCGROUP7=="add new row"'+cond2(7), + PROCGROUP8=SIMP(statut='o',typ='TXM',into=("add new row","2","3",)), + wideblock8=BLOC(condition='PROCGROUP8=="add new row"'+cond2(8), + ) + ) + ) + ) + ) + ) + ) + ) +) + +#LEV1 = OPER( nom = "LEV1", +# sd_prod=loi, +# op=68, +# fr='LEV1 FR', +# Boolean01=SIMP( statut = 'o',typ = bool, defaut=True, fr = 'Bool mandatory FR', ang = 'Bool mandatory EN'), +# SelectedItem=SIMP(statut = 'o',typ = 'TXM', into=["01_01","01_02","01_03","01_04"], fr="FR"), +#) + +Classement_Commandes_Ds_Arbre=('PROC_01',) + +Ordre_Des_Commandes = ('PROC_01',) diff --git a/CataTests/Separate_Blocks_52958_Cata.py b/CataTests/Separate_Blocks_52958_Cata.py new file mode 100644 index 00000000..1327a3fb --- /dev/null +++ b/CataTests/Separate_Blocks_52958_Cata.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +from Accas import * + +JdC = JDC_CATA (code = 'PATTERNS', + execmodul = None, + ) +def several(suffix,num): + out=list() + for i in range(1,num+1): + out.append(suffix+str(i).zfill(2)) + return out + +NUMERICAL_PARAMETERS=PROC(nom = "NUMERICAL_PARAMETERS", op=None, ang="Help for NUMERICAL_PARAMETERS, English version", + #Equations=SIMP(statut = 'o',typ = 'TXM',into=("EF","VF","BS"),defaut="EF"), + Solver_definition=FACT(statut = 'o', + Solver = SIMP(statut = 'o',typ = 'TXM', into=several("Solver_",12), defaut="Solver_06"), + ) +) +PASCALE=PROC(nom = "PASCALE", op=None, ang="Help for NUMERICAL_PARAMETERS, English version", + Equations=SIMP(statut = 'o',typ = 'TXM',into=("EF","VF","BS"),defaut="EF"), + Solver_definition=FACT(statut = 'o', + Solver = SIMP(statut = 'o',typ = 'TXM', into=several("Solver_",12), defaut="Solver_06"), + ) +) + +Classement_Commandes_Ds_Arbre=('NUMERICAL_PARAMETERS',) + +Ordre_Des_Commandes = ('NUMERICAL_PARAMETERS',) diff --git a/CataTests/Separate_Blocks_52963_Cata.py b/CataTests/Separate_Blocks_52963_Cata.py new file mode 100644 index 00000000..c115196f --- /dev/null +++ b/CataTests/Separate_Blocks_52963_Cata.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +from Accas import * + +JdC = JDC_CATA (code = 'PATTERNS', + execmodul = None, + ) +def mySeveral(suffix,num): + out=list() + for i in range(1,num+1): + out.append(suffix+str(i).zfill(2)) + return out + +def myFact(num): + myNum=str(num).zfill(2) + list_item_body="Item_"+myNum+"_" + myString="FACT(statut = 'f', List_"+myNum+" = SIMP(statut = 'o',typ = 'TXM', into=mySeveral('"+list_item_body+"',12), defaut='"+list_item_body+myNum+"'),Real_"+myNum+" = SIMP(statut = 'o',typ = 'R', defaut = "+str(num/100.)+", ang='Real "+myNum+" help EN'),Integer_"+myNum+" = SIMP(statut = 'o',typ = 'I', defaut = "+str(100+num)+",ang='Max_Iter "+myNum+" help EN'))" + print myString + return eval(myString) + + +PROC_01=PROC(nom = "PROC_01", op=None, ang="Help for PROC_01, English version",fr="Help for PROC_01, French version", docu="", + Radio_01=SIMP(statut = 'f',typ = 'TXM',into=("EF","VF","BS"),defaut="EF"), + FACT_01=myFact(1), + FACT_02=myFact(2), + FACT_03=myFact(3), + FACT_04=myFact(4), + FACT_05=myFact(5), + FACT_06=myFact(6), + FACT_07=myFact(7), + FACT_08=myFact(8), + FACT_09=myFact(9), + FACT_10=myFact(10), + FACT_11=myFact(11), + FACT_12=myFact(12), +) + +Classement_Commandes_Ds_Arbre=('PROC_01',) + +Ordre_Des_Commandes = ('PROC_01',) diff --git a/CataTests/Separate_Blocks_52966_Cata.py b/CataTests/Separate_Blocks_52966_Cata.py new file mode 100644 index 00000000..baef1eb1 --- /dev/null +++ b/CataTests/Separate_Blocks_52966_Cata.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +from Accas import * + +JdC = JDC_CATA (code = 'PATTERNS', + execmodul = None, + ) +def mySeveral(suffix,num): + out=list() + for i in range(1,num+1): + out.append(suffix+str(i).zfill(2)) + return out + +switch_facultatif=False #change 'o' to 'f' of some widgets in the loop + +def myFact(num): + opt=['o','f','o','o'] + if switch_facultatif: + myLen=len(opt) + make_f=(num-1)%myLen + opt[make_f]='f' + #print opt + myNum=str(num).zfill(2) + list_item_body="Item_"+myNum+"_" + myString="FACT(statut = '"+opt[0]+"', List_"+myNum+" = SIMP(statut = '"+opt[1]+"',typ = 'TXM', into=mySeveral('"+list_item_body+"',12), defaut='"+list_item_body+myNum+"'),Real_"+myNum+" = SIMP(statut = '"+opt[2]+"',typ = 'R', defaut = "+str(num/100.)+", ang='Real "+myNum+" help EN'),Integer_"+myNum+" = SIMP(statut = '"+opt[3]+"',typ = 'I', defaut = "+str(100+num)+",ang='Max_Iter "+myNum+" help EN'))" + print myString + return eval(myString) + + +PROC_01=PROC(nom = "PROC_01", op=None, ang="Help for PROC_01, English version",fr="Help for PROC_01, French version", docu="", + Radio_01=SIMP(statut = 'o',typ = 'TXM',into=("EF","VF","BS"),defaut="EF"), + FACT_01=myFact(1), + FACT_02=myFact(2), + FACT_03=myFact(3), + FACT_04=myFact(4), + FACT_05=myFact(5), + FACT_06=myFact(6), + FACT_07=myFact(7), + FACT_08=myFact(8), + FACT_09=myFact(9), + FACT_10=myFact(10), + FACT_11=myFact(11), + FACT_12=myFact(12), +) + +Classement_Commandes_Ds_Arbre=('PROC_01',) + +Ordre_Des_Commandes = ('PROC_01',) diff --git a/CataTests/Separate_Blocks_52972_Cata.py b/CataTests/Separate_Blocks_52972_Cata.py new file mode 100644 index 00000000..88927e49 --- /dev/null +++ b/CataTests/Separate_Blocks_52972_Cata.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +from Accas import * + +JdC = JDC_CATA (code = 'PATTERNS', + execmodul = None, + ) +def mySeveral(suffix,num): + out=list() + for i in range(1,num+1): + out.append(suffix+str(i).zfill(2)) + return out + +switch_facultatif=True #change 'o' to 'f' of some widgets in the loop +empty_defauts=True + +def myFact(num): + myNum=str(num).zfill(2) + list_item_body="Item_"+myNum+"_" + + defauts0=["","'"+list_item_body+myNum+"'", str(num/100.), str(100+num), "'Text_"+myNum+"'" ] #presence of default values + defauts_mask=[False,True,True,False,True] #switch off defaults of some types + defauts=list() + for id0 in range(len(defauts0)): + if defauts_mask[id0]: + item=", defaut="+defauts0[id0] + else: + item="" + defauts.append(item) + print defauts + + opt=['o','o','o','o','o'] #initial default obligation of items in FACT groups + #make some widgets optional: + myLen=len(opt) + if switch_facultatif: + make_f=(num)%myLen + opt[make_f]='f' + #print opt + if empty_defauts: + clean_defaut=num%myLen + + + myString="FACT(statut = '"+opt[0]+"', List_"+myNum+" = SIMP(statut = '"+opt[1]+"',typ = 'TXM', into=mySeveral('"+list_item_body+"',12)"+defauts[1]+"),Real_"+myNum+" = SIMP(statut = '"+opt[2]+"',typ = 'R'"+defauts[2]+", ang='Real "+myNum+" help EN'),Integer_"+myNum+" = SIMP(statut = '"+opt[3]+"',typ = 'I'"+defauts[3]+",ang='Integer "+myNum+" help EN'),Text_"+myNum+" = SIMP(statut = '"+opt[4]+"',typ = 'TXM'"+defauts[4]+",ang='Text "+myNum+" help EN'))" + print myString + return eval(myString) + + +PROC_01=PROC(nom = "PROC_01", op=None, ang="Help for PROC_01, English version",fr="Help for PROC_01, French version", docu="", + Radio_01=SIMP(statut = 'o',typ = 'TXM',into=("EF","VF","BS"),defaut="EF"), + FACT_01=myFact(1), + FACT_02=myFact(2), + FACT_03=myFact(3), + FACT_04=myFact(4), + FACT_05=myFact(5), + #FACT_06=myFact(6), + #FACT_07=myFact(7), + #FACT_08=myFact(8), + #FACT_09=myFact(9), + #FACT_10=myFact(10), + #FACT_11=myFact(11), + #FACT_12=myFact(12), +) + +Classement_Commandes_Ds_Arbre=('PROC_01',) + +Ordre_Des_Commandes = ('PROC_01',) diff --git a/CataTests/Separate_Blocks_52975_Cata.py b/CataTests/Separate_Blocks_52975_Cata.py new file mode 100644 index 00000000..88927e49 --- /dev/null +++ b/CataTests/Separate_Blocks_52975_Cata.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +from Accas import * + +JdC = JDC_CATA (code = 'PATTERNS', + execmodul = None, + ) +def mySeveral(suffix,num): + out=list() + for i in range(1,num+1): + out.append(suffix+str(i).zfill(2)) + return out + +switch_facultatif=True #change 'o' to 'f' of some widgets in the loop +empty_defauts=True + +def myFact(num): + myNum=str(num).zfill(2) + list_item_body="Item_"+myNum+"_" + + defauts0=["","'"+list_item_body+myNum+"'", str(num/100.), str(100+num), "'Text_"+myNum+"'" ] #presence of default values + defauts_mask=[False,True,True,False,True] #switch off defaults of some types + defauts=list() + for id0 in range(len(defauts0)): + if defauts_mask[id0]: + item=", defaut="+defauts0[id0] + else: + item="" + defauts.append(item) + print defauts + + opt=['o','o','o','o','o'] #initial default obligation of items in FACT groups + #make some widgets optional: + myLen=len(opt) + if switch_facultatif: + make_f=(num)%myLen + opt[make_f]='f' + #print opt + if empty_defauts: + clean_defaut=num%myLen + + + myString="FACT(statut = '"+opt[0]+"', List_"+myNum+" = SIMP(statut = '"+opt[1]+"',typ = 'TXM', into=mySeveral('"+list_item_body+"',12)"+defauts[1]+"),Real_"+myNum+" = SIMP(statut = '"+opt[2]+"',typ = 'R'"+defauts[2]+", ang='Real "+myNum+" help EN'),Integer_"+myNum+" = SIMP(statut = '"+opt[3]+"',typ = 'I'"+defauts[3]+",ang='Integer "+myNum+" help EN'),Text_"+myNum+" = SIMP(statut = '"+opt[4]+"',typ = 'TXM'"+defauts[4]+",ang='Text "+myNum+" help EN'))" + print myString + return eval(myString) + + +PROC_01=PROC(nom = "PROC_01", op=None, ang="Help for PROC_01, English version",fr="Help for PROC_01, French version", docu="", + Radio_01=SIMP(statut = 'o',typ = 'TXM',into=("EF","VF","BS"),defaut="EF"), + FACT_01=myFact(1), + FACT_02=myFact(2), + FACT_03=myFact(3), + FACT_04=myFact(4), + FACT_05=myFact(5), + #FACT_06=myFact(6), + #FACT_07=myFact(7), + #FACT_08=myFact(8), + #FACT_09=myFact(9), + #FACT_10=myFact(10), + #FACT_11=myFact(11), + #FACT_12=myFact(12), +) + +Classement_Commandes_Ds_Arbre=('PROC_01',) + +Ordre_Des_Commandes = ('PROC_01',) diff --git a/CataTests/a b/CataTests/a new file mode 100644 index 00000000..0018d1d5 --- /dev/null +++ b/CataTests/a @@ -0,0 +1,110 @@ +ESSAI_FACT=OPER(nom="ESSAI_FACT", + sd_prod=ObjetUtilisateur, + op=None, + fr=tr("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= ma ,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= tr("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= ma ,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=ma ,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=table_sdaster), + 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=tr("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 = tr("Noeud: 3 valeurs (triangulaire supérieure par colonne)"), + regles = (UN_PARMI('Maille','GroupeMailles','Noeud','GROUP_NO'),), + Noeud = SIMP(statut='f',typ=no ,validators=NoRepeat(),max='**'), + GROUP_NO = SIMP(statut='f',typ=grno,validators=NoRepeat(),max='**'), + Maille = SIMP(statut='f',typ=ma ,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/CataTests/cata_diapo.py b/CataTests/cata_diapo.py new file mode 100644 index 00000000..0c5268ef --- /dev/null +++ b/CataTests/cata_diapo.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +from Accas import * +class Tuple: + def __init__(self,ntuple): + self.ntuple=ntuple + + def __convert__(self,valeur): + import types + 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 + + __repr__=info + __str__=info + + + +class forme ( ASSD ) : pass + +JdC = JDC_CATA (code = 'MED', + execmodul = None, + ) + +FORME_GEOMETRIQUE=OPER(nom='FORME_GEOMETRIQUE',sd_prod =forme ,op=None, + Forme=SIMP(statut="o",typ='TXM',into=[ 'carre', 'cercle', 'triangle' ],defaut='carre'), + bloc_pour_Carre = BLOC (condition = "Forme=='carre'", + Cote=SIMP(statut="o",typ='I'), ) , # fin bloc_pour_carre + bloc_pour_cercle = BLOC (condition ="Forme=='cercle'", + rayon=SIMP(statut="o",typ='I'), ) , # fin bloc_pour_cercle + + DE_NOMBREUSES_WIDGETS= FACT(statut="o", + Stop_Criteria = SIMP(statut = 'o',typ = Tuple(3),validators = VerifTypeTuple(('R','R','R'))), + Fichier_Med = SIMP( statut = 'o', typ = ('Fichier', 'Med Files (*.med);;All Files (*)',),), + ListeDeChoixPlusGrande=SIMP(statut="o",typ='TXM',into=['a','b,','c','d','e','f','g','h'], + homo="SansOrdreNiDoublon",), + Un_Parametre_Facultatif=SIMP(statut="f",typ='TXM') + + ), + Couleur=SIMP(statut = 'f',typ='TXM'), + Matiere=SIMP(statut = 'f',typ='TXM'), +); + diff --git a/CataTests/cata_med.py b/CataTests/cata_med.py new file mode 100644 index 00000000..4640f81e --- /dev/null +++ b/CataTests/cata_med.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +from Accas import * + +JdC = JDC_CATA (code = 'MED', + execmodul = None, + ) +FAS=PROC(nom='FAS',op=None, + FAMILY_MESH_NAME_REF = FACT(statut='o', max='**', + + NAME=SIMP(statut="o",typ='TXM'), + ELEM=FACT(statut="f", max="**", + NUM=SIMP(statut="o",typ='TXM',), + NAME=SIMP(statut="o",typ='TXM',), + ATT=FACT(statut="f", + NBR=SIMP(statut="o", max=1 , typ = 'I'), + DES=SIMP(statut="o", max="**", typ = 'TXM'), + IDE=SIMP(statut="o", max="**", typ = 'I'), + VAL=SIMP(statut="o", max="**", typ = 'I'), + ), + GRO=FACT(statut="f", + NBR=SIMP(statut="o", max=1 , typ = 'I'), + NOM=SIMP(statut="o", max="**", typ='TXM'), + ), + ), + ), +); + + diff --git a/CataTests/configuration_MED.py b/CataTests/configuration_MED.py new file mode 100644 index 00000000..9a068500 --- /dev/null +++ b/CataTests/configuration_MED.py @@ -0,0 +1,43 @@ +# -*- 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. +# +# +# ====================================================================== +""" + Ce module sert pour charger les paramètres de configuration d'EFICAS +""" +# Modules Python +from InterfaceQT4 import configuration +import os + + +class CONFIG(configuration.configBase): + + #----------------------------------- + def __init__(self,appli,repIni): + #----------------------------------- + + self.labels_user=['catalogues','lang'] + self.labels_eficas=['lang','rep_cata','catalogues'] + + configuration.configBase.__init__(self,appli,'.Eficas_monCode') + + +def make_config(appli,rep): + return CONFIG(appli,rep) + diff --git a/CataTests/images/essaiAster.png b/CataTests/images/essaiAster.png new file mode 100644 index 00000000..d01c5de8 Binary files /dev/null and b/CataTests/images/essaiAster.png differ diff --git a/CataTests/items_integer_space.txt b/CataTests/items_integer_space.txt new file mode 100644 index 00000000..8e17136e --- /dev/null +++ b/CataTests/items_integer_space.txt @@ -0,0 +1,2 @@ +"4" "3" "2" "1" +"4" "5" "6" "7" \ No newline at end of file diff --git a/CataTests/monCode_qtEficas.py b/CataTests/monCode_qtEficas.py new file mode 100755 index 00000000..7bbb62b3 --- /dev/null +++ b/CataTests/monCode_qtEficas.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2012 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 Code_Aster +""" +# Modules Python +# Modules Eficas + +import sys,os +sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..')) + +from PyQt4.QtCore import * +import prefs +from InterfaceQT4 import eficas_go +eficas_go.lanceEficas(code=prefs.code) diff --git a/CataTests/prefs.py b/CataTests/prefs.py new file mode 100644 index 00000000..2e9d0a2e --- /dev/null +++ b/CataTests/prefs.py @@ -0,0 +1,22 @@ +# Copyright (C) 2007-2012 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 +# +code="MED" +import sys, os +if os.path.dirname(os.path.abspath(__file__)) not in sys.path : + sys.path.insert(0,os.path.dirname(os.path.abspath(__file__))) diff --git a/CataTests/prefs_MED.py b/CataTests/prefs_MED.py new file mode 100644 index 00000000..2fc3062e --- /dev/null +++ b/CataTests/prefs_MED.py @@ -0,0 +1,48 @@ +# -*- 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='en' + +# Codage des strings qui accepte les accents (en remplacement de 'ascii') +encoding='iso-8859-1' +docPath=repIni + +# +catalogues=( + #('med','med',os.path.join(repIni,'cata_med.py'),'dico','python'), + ('med','med',os.path.join(repIni,'CataAZ.py'),'python','python'), +) + +simpleClic=True +nombreDeBoutonParLigne = 4 +dicoImages={ +'CREEOBJET' : os.path.join(repIni,'images/essaiAster.png') +} + diff --git a/CataTests/prefs_monCode.py b/CataTests/prefs_monCode.py new file mode 100644 index 00000000..319c6599 --- /dev/null +++ b/CataTests/prefs_monCode.py @@ -0,0 +1,68 @@ +# -*- 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='en' + +# Codage des strings qui accepte les accents (en remplacement de 'ascii') +encoding='iso-8859-1' +docPath=repIni + +# +catalogues=( + ('monCode','med',os.path.join(repIni,'CataAZ.py'),'python','python'), +# ('monCode','53036',os.path.join(repIni,'Elementary_Lists_53036_Cata.py'),'dico','python'), +# ('monCode','53033',os.path.join(repIni,'Tuples_Cata.py'),'dico','python'), +# ('monCode','53031',os.path.join(repIni,'Tuples_Cata.py'),'dico','python'), +# ('monCode','53030',os.path.join(repIni,'Tuples_Cata.py'),'dico','python'), +# ('monCode','53020',os.path.join(repIni,'Nested_Cond_52945_Cata.py'),'dico','python'), +# ('monCode','53013',os.path.join(repIni,'Elementary_Lists_53013_Cata.py'),'dico','python'), +# ('monCode','53000',os.path.join(repIni,'Elementary_Lists_53030_Cata.py'),'dico','python'), +# ('monCode','52996',os.path.join(repIni,'Elementary_Lists_52996_Cata.py'),'dico','python'), +# ('monCode','52992',os.path.join(repIni,'Many_Concepts_52992_Cata.py'),'dico','python'), +# ('monCode','52989',os.path.join(repIni,'Many_Concepts_52989_Cata.py'),'dico','python'), +# ('monCode','52988',os.path.join(repIni,'Many_Concepts_52988_Cata.py'),'dico','python'), +# ('monCode','52985',os.path.join(repIni,'fin_52985_Cata.py'),'dico','python'), +# ('monCode','52983',os.path.join(repIni,'Many_Concepts_52983_Cata.py'),'dico','python'), +# ('monCode','52975',os.path.join(repIni,'Separate_Blocks_52975_Cata.py'),'dico','python'), +# ('monCode','52972',os.path.join(repIni,'Separate_Blocks_52972_Cata.py'),'dico','python'), +# ('monCode','52958',os.path.join(repIni,'Separate_Blocks_52958_Cata.py'),'dico','python'), +# ('monCode','52952',os.path.join(repIni,'Nested_Cond_52952_Cata.py'),'dico','python'), +# ('monCode','52949',os.path.join(repIni,'Nested_Cond_52949_Cata.py'),'dico','python'), +# ('monCode','52947',os.path.join(repIni,'Nested_Cond_52947_Cata.py'),'dico','python'), +# ('monCode','52946',os.path.join(repIni,'Nested_Cond_52946_Cata.py'),'dico','python'), +# ('monCode','52945',os.path.join(repIni,'Nested_Cond_52945_Cata.py'),'dico','python'), +# ('monCode','Global',os.path.join(repIni,'Global_Condition_Cata.py'),'dico','python'), +## resolu ('monCode','52948',os.path.join(repIni,'Nested_Cond_52948_Cata.py'),'dico','python'), +# pb d afffichage des optionnels ('monCode','52963',os.path.join(repIni,'Separate_Blocks_52963_Cata.py'),'dico','python'), +# pb d afffichage des optionnels ('monCode','52966',os.path.join(repIni,'Separate_Blocks_52966_Cata.py'),'dico','python'), + +# ('monCode','test',os.path.join(repIni,'monCode_Cata1.py'),'dico','python'), +) + diff --git a/CataTests/properties.py b/CataTests/properties.py new file mode 100644 index 00000000..1d328a46 --- /dev/null +++ b/CataTests/properties.py @@ -0,0 +1,24 @@ +#@ MODIF properties Accas DATE 11/06/2008 AUTEUR aster M.ADMINISTRATEUR +# RESPONSABLE D6BHHHH J-P.LEFEBVRE +# ====================================================================== +# COPYRIGHT (C) 1991 - 2001 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. +# ====================================================================== +# IDENTIFICATION DU GESTIONNAIRE DE COMMANDE ACCAS A PARTIR +# DE LA VERSION DU CODE_ASTER ASSOCIE +#---------------------------------------------------------------------- +version = "1.2" +date = "25/05/2010" +exploit = False diff --git a/CataTests/qtEficas_AZ.py b/CataTests/qtEficas_AZ.py new file mode 100755 index 00000000..de3797de --- /dev/null +++ b/CataTests/qtEficas_AZ.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2012 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 Code_Aster +""" +# Modules Python +# Modules Eficas + +import sys,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/CataTests/qtEficas_Med.py b/CataTests/qtEficas_Med.py new file mode 100755 index 00000000..de3797de --- /dev/null +++ b/CataTests/qtEficas_Med.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2012 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 Code_Aster +""" +# Modules Python +# Modules Eficas + +import sys,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/InterfaceQT4/browser.py b/InterfaceQT4/browser.py index 82e75086..230bbffe 100644 --- a/InterfaceQT4/browser.py +++ b/InterfaceQT4/browser.py @@ -67,7 +67,7 @@ class JDCTree( QTreeWidget,GereRegles ): self.childrenComplete=[] self.racine=self.item.itemNode(self,self.item) - self.itemCourrant=None + self.itemCourant=None self.itemClicked.connect(self.handleOnItem) self.itemCollapsed.connect(self.handleCollapsedItem) @@ -107,6 +107,7 @@ class JDCTree( QTreeWidget,GereRegles ): """ #print "handleContextMenu" if item == None : return + self.itemCourant=item if item.existeMenu == 0 : return if item.menu == None: item.createPopUpMenu() @@ -119,6 +120,7 @@ class JDCTree( QTreeWidget,GereRegles ): def handleCollapsedItem(self,item): #print "dans CollapsedItem", self.inhibeExpand if self.inhibeExpand == True : return + self.itemCourant=item # On traite le cas de l item non selectionne itemParent=item while not (hasattr (itemParent,'getPanel')) : @@ -137,6 +139,7 @@ class JDCTree( QTreeWidget,GereRegles ): #import traceback #traceback.print_stack() if self.inhibeExpand == True : return + self.itemCourant=item self.inhibeExpand = True itemParent=item while not (hasattr (itemParent,'getPanel')) : @@ -151,11 +154,11 @@ class JDCTree( QTreeWidget,GereRegles ): def handleOnItem(self,item,int): - #print "je passe dans handleOnItem pour ",self, item.item.nom, item, item.item + #print ("je passe dans handleOnItem pour ",self, item.item.nom, item, item.item, item.item.getLabelText()) from InterfaceQT4 import composimp self.inhibeExpand = True - self.itemCourrant=item + self.itemCourant=item itemParent=item while not (hasattr (itemParent,'getPanel')) : @@ -163,11 +166,8 @@ class JDCTree( QTreeWidget,GereRegles ): itemParent=itemParent.treeParent if itemParent.fenetre != self.editor.fenetreCentraleAffichee : - estUneFeuille=(isinstance(item,composimp.Node)) # il faut afficher le parent - #print "estUneFeuille", estUneFeuille - #print "afficheCommandesPliees", self.editor.afficheCommandesPliees if estUneFeuille : itemParent.affichePanneau() elif self.editor.afficheCommandesPliees : itemParent.plieToutEtReafficheSaufItem(item) else : itemParent.affichePanneau() @@ -226,8 +226,12 @@ class JDCNode(QTreeWidgetItem,GereRegles): else: name = tr(item.getLabelText()[0]) if item.nom != tr(item.nom) : name = str(tr(item.nom)+" :") value = tr(str( item.getText() ) ) + + # si specialisation de la fenetre + if self.item.object.definition == None : self.fenetreIhm = None + # Cas des listes de mots_clefs + else : self.fenetreIhm = self.item.object.definition.fenetreIhm - if self.editor.enteteQTree=='complet':mesColonnes=(name,value) else : mesColonnes=(name,) @@ -333,13 +337,8 @@ class JDCNode(QTreeWidgetItem,GereRegles): return None - def deplieCeNiveau(self): - - if self.fenetre == None : - print ('PNPNPN a programmer') - #self.fenetre=self.getPanelGroupe(self.editor) - #print ((self.item.panel)) - print (self.fenetre) + def afficheCeNiveau(self): + #print ('afficheCeNiveau pour ', self.item.nom, self.item.getLabelText()) for indiceWidget in range(self.editor.widgetCentraleLayout.count()): widget=self.editor.widgetCentraleLayout.itemAt(indiceWidget) self.editor.widgetCentraleLayout.removeItem(widget) @@ -353,12 +352,20 @@ class JDCNode(QTreeWidgetItem,GereRegles): maDefinition=self.item.get_definition() monObjet=self.item.object self.maFenetreCadre=MonWidgetNiveauFact(self,self.editor,maDefinition,monObjet) - #self.maFenetreCadre.commandesLayout.insertWidget(-1,self.fenetre) + self.fenetre=self.maFenetreCadre self.editor.widgetCentraleLayout.addWidget(self.maFenetreCadre) - #print ("j ajoute ", self.fenetre, self.fenetre.node.item.nom) self.editor.fenetreCentraleAffichee=self.maFenetreCadre - self.tree.node_selected= self - + self.select() + #print ('fin afficheCeNiveau pour ', self.item.nom) + + + def getPanelModifie(self): + + if self.fenetreIhm == None : return None + if self.fenetreIhm=='deplie1Niveau': + from InterfaceQT4.monWidgetCommandeDeplie1Niveau import MonWidgetCommandeDeplie1Niveau + return MonWidgetCommandeDeplie1Niveau (self,self.editor ,self.item.object) + return None def affichePanneau(self) : @@ -366,6 +373,7 @@ class JDCNode(QTreeWidgetItem,GereRegles): # posera des pb si un code decide d appeler FIN un mot clef # on resoudera a ce moment la # pour l instant pas de poussiere sous le tapis + #print ('_________________ds affichePanneau pour', self.item.nom) if not(self.item.isActif()) : from .monWidgetInactif import MonWidgetInactif self.fenetre = MonWidgetInactif(self,self.editor) @@ -373,10 +381,13 @@ class JDCNode(QTreeWidgetItem,GereRegles): itemParent=self while not (hasattr (itemParent,'getPanel')) : itemParent=itemParent.treeParent if itemParent!=self : + #print ('j appelle affichePanneau pour ', itemParent.item.nom , 'par', self.item.nom) itemParent.affichePanneau() + #print ('fin _________________ds affichePanneau pour', self.item.nom) return - self.fenetre=self.getPanel() - #self.editor.restoreSplitterSizes() + self.fenetre=self.getPanelModifie() + if self.fenetre == None : self.fenetre=self.getPanel() + self.editor.restoreSplitterSizes() for indiceWidget in range(self.editor.widgetCentraleLayout.count()): widget=self.editor.widgetCentraleLayout.itemAt(indiceWidget) @@ -399,7 +410,7 @@ class JDCNode(QTreeWidgetItem,GereRegles): self.tree.inhibeExpand=True self.tree.expandItem(self) self.tree.inhibeExpand=False - #print( 'fin affichePanneau pour', self.item.nom) + #print( '_________________fin affichePanneau pour', self.item.nom) def createPopUpMenu(self): @@ -824,7 +835,6 @@ class JDCNode(QTreeWidgetItem,GereRegles): return child def plieToutEtReafficheSaufItem(self, itemADeplier): - #print "je suis dans plieToutEtReaffiche", self.item.getNom() self.inhibeExpand=True from InterfaceQT4 import compojdc if (isinstance(self, compojdc.Node)) : @@ -843,6 +853,10 @@ class JDCNode(QTreeWidgetItem,GereRegles): self.inhibeExpand=False def plieToutEtReaffiche(self): + if self.item.getNom() == 'RAFFINEMENT' : + import traceback + traceback.print_stack() + print (a) from InterfaceQT4 import compojdc if (isinstance(self, compojdc.Node)) : self.affichePanneau(); return self.inhibeExpand=True @@ -853,6 +867,7 @@ class JDCNode(QTreeWidgetItem,GereRegles): if (isinstance(item,compobloc.Node)) : continue item.setPlie() self.affichePanneau() + #print ("fin plieToutEtReaffiche", self.item.getNom()) def deplieToutEtReaffiche(self): self.editor.deplier = True @@ -879,15 +894,17 @@ class JDCNode(QTreeWidgetItem,GereRegles): # item.appartientAUnNoeudPlie=False def setPlieChildren(self): - #print ("dans setPlieChildren pour", self.item.nom) self.plie=True + from InterfaceQT4 import composimp + if isinstance(self,composimp.Node) : return for c in self.children : c.setPlieChildren() #print "dans setPlieChildren appartientAUnNoeudPlie=True ", c, c.item.getLabelText()[0] c.appartientAUnNoeudPlie=True c.plie=True #print "dans setPlieChildren plie", c.item.nom - c.setExpanded(False) + # 01/2018 PNPN : boucle sur MT __ La ligne suivante ne me semble pas necessaire + #if not (isinstance(c,composimp.Node)) :c.setExpanded(False) # Pour les blocs et les motcles list # on affiche un niveau de plus @@ -899,17 +916,9 @@ class JDCNode(QTreeWidgetItem,GereRegles): niveauPere=niveauPere.treeParent for c in self.children : c.appartientAUnNoeudPlie=niveauPere.appartientAUnNoeudPlie - #print "dans setPlieChildren appartientAUnNoeudPlie=True ", c, c.item.getLabelText()[0], "mis a la valeur ", niveauPere.appartientAUnNoeudPlie + #print ("dans setPlieChildren appartientAUnNoeudPlie=True ", c, c.item.getLabelText()[0], "mis a la valeur ", niveauPere.appartientAUnNoeudPlie) c.setExpanded(False) - # on affiche un niveau de plus - #if isinstance(self,compomclist.Node) : - #if isinstance(self,compobloc.Node) : - # niveauPere=self.treeParent - # while (isinstance(niveauPere,compobloc.Node)): - # niveauPere=niveauPere.treeParent - # for c in self.children : - # c.appartientAUnNoeudPlie=niveauPere.appartientAUnNoeudPlie def setDeplie(self): #print "dans setPlieChildren pour", self.item.nom diff --git a/InterfaceQT4/compomacro.py b/InterfaceQT4/compomacro.py index 5074adca..64a9d63f 100644 --- a/InterfaceQT4/compomacro.py +++ b/InterfaceQT4/compomacro.py @@ -27,9 +27,9 @@ import traceback # Modules Eficas from Editeur import Objecttreeitem from Extensions.i18n import tr -from . import compooper -from . import browser -from . import typeNode +from InterfaceQT4 import compooper +from InterfaceQT4 import browser +from InterfaceQT4 import typeNode from PyQt5.QtWidgets import QAction from PyQt5.QtCore import Qt diff --git a/InterfaceQT4/compomclist.py b/InterfaceQT4/compomclist.py index fd3b5a1b..34f6b2f1 100644 --- a/InterfaceQT4/compomclist.py +++ b/InterfaceQT4/compomclist.py @@ -41,18 +41,18 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): monObjet=self.item.object monNom=self.item.nom maCommande=commande - #print "ds getPanelGroupe" , self.item.nom if hasattr(parentQt,'niveau'): self.niveau=parentQt.niveau+1 else : self.niveau=1 + # attention si l objet est une mclist on utilise bloc if not (monObjet.isMCList()) : if hasattr(self,'plie') and self.plie==True : - from .monWidgetFactPlie import MonWidgetFactPlie + from InterfaceQT4.monWidgetFactPlie import MonWidgetFactPlie widget=MonWidgetFactPlie(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande,insertIn) else: - from .monWidgetFact import MonWidgetFact + from InterfaceQT4.monWidgetFact import MonWidgetFact widget=MonWidgetFact(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande,insertIn) else : - from .monWidgetBloc import MonWidgetBloc + from InterfaceQT4.monWidgetBloc import MonWidgetBloc widget=MonWidgetBloc(self,self.editor,parentQt,maDefinition,monObjet,self.niveau,maCommande) return widget @@ -100,7 +100,7 @@ class MCListTreeItem(Objecttreeitem.SequenceTreeItem,compofact.FACTTreeItem): FACTPanel. Si la liste est plus longue on utilise le panneau MCLISTPanel. """ - print ('he suis dans panel de MCListTreeItem') + print ('je suis dans panel de MCListTreeItem') if len(self._object) > 1: return MCLISTPanel(jdcdisplay,pane,node) elif isinstance(self._object.data[0],ErrorObj): diff --git a/InterfaceQT4/compooper.py b/InterfaceQT4/compooper.py index 060f14b3..d2f23bdf 100644 --- a/InterfaceQT4/compooper.py +++ b/InterfaceQT4/compooper.py @@ -183,15 +183,15 @@ class EtapeTreeItem(Objecttreeitem.ObjectTreeItem): # if v.nom == name : return v # return None - def getType_sd_prod(self): - """ - Retourne le nom du type du concept résultat de l'étape - """ - sd_prod=self.object.getType_produit() - if sd_prod: - return sd_prod.__name__ - else: - return "" + # def getType_sd_prod(self): + # """ + # Retourne le nom du type du concept résultat de l'étape + # """ + # sd_prod=self.object.getType_produit() + # if sd_prod: + # return sd_prod.__name__ + # else: + # return "" def addItem(self,name,pos): mcent = self._object.addEntite(name,pos) diff --git a/InterfaceQT4/configuration.py b/InterfaceQT4/configuration.py index 7e43cb90..977694e4 100644 --- a/InterfaceQT4/configuration.py +++ b/InterfaceQT4/configuration.py @@ -123,6 +123,7 @@ class configBase(object): self.ficIcones=None self.repIcones=None self.differencieSiDefaut=False + self.typeDeCata='Python' diff --git a/InterfaceQT4/editor.py b/InterfaceQT4/editor.py index be0577d9..a3a3586c 100755 --- a/InterfaceQT4/editor.py +++ b/InterfaceQT4/editor.py @@ -44,7 +44,6 @@ from Editeur import session from Editeur import comploader from Editeur import Objecttreeitem from InterfaceQT4 import browser -from InterfaceQT4 import readercata from desBaseWidget import Ui_baseWidget from InterfaceQT4.monViewTexte import ViewText diff --git a/InterfaceQT4/editorSsIhm.py b/InterfaceQT4/editorSsIhm.py index b02a36d7..88faf702 100755 --- a/InterfaceQT4/editorSsIhm.py +++ b/InterfaceQT4/editorSsIhm.py @@ -39,7 +39,6 @@ import convert, generator from Editeur import session from Editeur import comploader from Editeur import Objecttreeitem -from InterfaceQT4 import readercata DictExtensions= {"MAP" : ".map", "TELEMAC" : '.cas'} debug = False @@ -84,6 +83,12 @@ class JDCEditorSsIhm : if not hasattr ( self.appliEficas, 'readercata') or self.appliEficas.multi==True: + if self.maConfiguration.typeDeCata == 'XML' : + from InterfaceQT4 import readercataXML as readercata + else : + from InterfaceQT4 import readercata + print (self.maConfiguration.typeDeCata) + print (readercata) self.readercata = readercata.READERCATA( self, self.appliEficas ) self.appliEficas.readercata=self.readercata self.appliEficas.code=self.code @@ -197,7 +202,7 @@ class JDCEditorSsIhm : pareil,texteNew=self.verifieChecksum(p.text) if not pareil : - self.informe(tr("fichier modifie"),tr("Attention! fichier change hors EFICAS"),False) + self.informe(("fichier modifie"),("Attention! fichier change hors EFICAS"),False) p.text=texteNew memeVersion,texteNew=self.verifieVersionCataDuJDC(p.text) diff --git a/InterfaceQT4/groupe.py b/InterfaceQT4/groupe.py index de6ac3ff..7bc6245f 100644 --- a/InterfaceQT4/groupe.py +++ b/InterfaceQT4/groupe.py @@ -37,10 +37,11 @@ class Groupe(QWidget,FacultatifOuOptionnel): """ """ def __init__(self,node,editor,parentQt,definition,obj,niveau,commande=None): + #print ("groupe : ",self.node.item.nom," ",self.node.fenetre) QWidget.__init__(self,None) self.node=node self.node.fenetre=self - #print "groupe : ",self.node.item.nom," ",self.node.fenetre + if self.node.item.nom == 'MASSES' : traceback.print_stack() self.setupUi(self) self.editor=editor self.obj=obj @@ -74,10 +75,8 @@ class Groupe(QWidget,FacultatifOuOptionnel): def afficheMots(self): - #print "ds afficheMots ",self.node.item.nom + #print ("ds afficheMots ",self.node.item.nom,self.node.plie) for node in self.node.children: - #if node.item.nom == "Background" :print "afficheMots ",node," " ,node.item.nom, " ",node.plie ," ", node.appartientAUnNoeudPlie,node.getPanelGroupe - #if node.item.nom == "BackgroundError" :print "afficheMots ",node," " ,node.item.nom, " ",node.plie ," ", node.appartientAUnNoeudPlie,node.getPanelGroupe # non return mais continue car il faut tenir compte des blocs if node.appartientAUnNoeudPlie==True : continue #print "je suis apres le if pour ",node.item.nom @@ -189,28 +188,11 @@ class Groupe(QWidget,FacultatifOuOptionnel): def setPlie(self): self.node.setPlie() - if self.editor.code== 'MT' and (self.maCommande.obj.nom == "ZONE") : - #if (len(self.node.item.getGenealogie())==2): - index=self.maCommande.commandesLayout.indexOf(self) - self.maCommande.reafficheSeulement(self,index) - return - #else : - # self.reaffiche(self.node) - #return - #print ('je reaffiche dans Plie') self.reaffiche(self.node) def setDeplie(self): + #print ('je passe ds setDeplie de groupe') self.node.setDeplie() - if self.editor.code== 'MT' and (self.maCommande.obj.nom == "ZONE") : - #if (len(self.node.item.getGenealogie())==2): - index=self.parentQt.commandesLayout.indexOf(self) - self.maCommande.reafficheSeulement(self,index) - return - #else : - # self.reaffiche(self.node) - #return - #print ('je reaffiche dans Plie') self.reaffiche(self.node) diff --git a/InterfaceQT4/monBoutonValide.py b/InterfaceQT4/monBoutonValide.py index 50075e0b..0d3b9f24 100644 --- a/InterfaceQT4/monBoutonValide.py +++ b/InterfaceQT4/monBoutonValide.py @@ -46,7 +46,7 @@ class MonBoutonValide(QToolButton) : #print "dans mousePressEvent" if self.parent.node.item.object.isValid() : myToolTip=tr("objet valide") - if self.parent.editor.configuration.differencieSiDefaut : + if self.parent.editor.maConfiguration.differencieSiDefaut : if self.parent.node.item.object.valeur != self.parent.node.item.object.definition.defaut : myToolTip+='\ndefaut : \n'+str(self.parent.node.item.object.definition.defaut) diff --git a/InterfaceQT4/monWidgetBloc.py b/InterfaceQT4/monWidgetBloc.py index 7d5d8239..1dc33526 100644 --- a/InterfaceQT4/monWidgetBloc.py +++ b/InterfaceQT4/monWidgetBloc.py @@ -29,7 +29,7 @@ class MonWidgetBloc(Ui_WidgetBloc,Groupe): """ """ def __init__(self,node,editor,parentQt,definition, obj, niveau,commande): - #print "bloc : ",node.item.nom + #print ("bloc : ",node.item.nom) Groupe.__init__(self,node,editor,parentQt, definition,obj,niveau,commande) self.parentQt.commandesLayout.insertWidget(-1,self,1) diff --git a/InterfaceQT4/monWidgetCommande.py b/InterfaceQT4/monWidgetCommande.py index a06baa90..b4295874 100644 --- a/InterfaceQT4/monWidgetCommande.py +++ b/InterfaceQT4/monWidgetCommande.py @@ -214,15 +214,11 @@ class MonWidgetCommande(Ui_WidgetCommande,Groupe): pass def nomChange(self): - print (1) nom = str(self.LENom.text()) nom = nom.strip() if nom == '' : return # si pas de nom, on ressort sans rien faire - print (2) test,mess = self.node.item.nommeSd(nom) - print (test,mess) self.editor.afficheCommentaire(mess) - print (3) #Notation scientifique if test : diff --git a/InterfaceQT4/monWidgetFact.py b/InterfaceQT4/monWidgetFact.py index 80e1f112..e3dd432a 100644 --- a/InterfaceQT4/monWidgetFact.py +++ b/InterfaceQT4/monWidgetFact.py @@ -58,6 +58,7 @@ class MonWidgetFactCommun(Groupe): #print "delayAffiche, self.doitAfficherOptionnel = ", self.doitAfficherOptionnel if self.doitAfficherOptionnel and self.editor.code != "CARMELCND" :self.afficheOptionnel() + class MonWidgetFact(Ui_WidgetFact,MonWidgetFactCommun): def __init__(self,node,editor,parentQt,definition, obj, niveau,commande,insertIn=True): MonWidgetFactCommun.__init__(self,node,editor,parentQt, definition,obj,niveau,commande,insertIn) diff --git a/InterfaceQT4/monWidgetFactPlie.py b/InterfaceQT4/monWidgetFactPlie.py index 8e87786e..17d79b58 100644 --- a/InterfaceQT4/monWidgetFactPlie.py +++ b/InterfaceQT4/monWidgetFactPlie.py @@ -30,6 +30,7 @@ class MonWidgetFactPlie(Ui_WidgetFactPlie,Groupe): """ def __init__(self,node,editor,parentQt,definition, obj, niveau,commande,insertIn=-1): #print "fact plie : ",node.item.nom + node.fenetreAAfficher=self Groupe.__init__(self,node,editor,parentQt, definition,obj,niveau,commande) self.groupBox.setText(self.node.item.getLabelText()[0]) self.parentQt.commandesLayout.insertWidget(insertIn,self) diff --git a/InterfaceQT4/monWidgetNiveauFact.py b/InterfaceQT4/monWidgetNiveauFact.py index a044a96a..b70a5c14 100644 --- a/InterfaceQT4/monWidgetNiveauFact.py +++ b/InterfaceQT4/monWidgetNiveauFact.py @@ -49,254 +49,117 @@ class MonWidgetNiveauFact(Ui_WidgetNiveauFact,Groupe): """ """ def __init__(self,node,editor,definition,obj): - #QWidget.__init__(self,editor) - #self.setupUi(self) self.listeAffichageWidget=[] Groupe.__init__(self,node,editor,None,definition,obj,1,self) + self.afficheOptionnel() def reaffiche(self,nodeAVoir=None): - print ('PNPNPN a programmer') -# -# self.listeAffichageWidget=[] -# self.inhibe=0 -# self.ensure=0 -# editor.inhibeSplitter=1 -# editor.inhibeSplitter=0 -# -# self.frameAffichage.setMinimumHeight(20) -# if node.item.getFr() != "" : self.labelDoc.setText(node.item.getFr()) -# else : -# self.labelDoc.close() -# self.frameAffichage.resize(self.frameAffichage.width(),50) -# -# #if (etape.getType_produit()==None): self.LENom.close() -# #test,mess = self.node.item.nommeSd('ee') -# if not(hasattr(etape.definition,'sd_prod')) or (etape.definition.sd_prod==None): self.LENom.close() -# elif (hasattr(etape.definition,'sd_prod') and type(etape.definition.sd_prod)== types.FunctionType):self.LENom.close() -# elif (hasattr(etape, 'sdnom')) and etape.sdnom != "sansnom" and etape.sdnom != None: self.LENom.setText(etape.sdnom) -# else : self.LENom.setText("") -# -# -# maPolice= QFont("Times", 10,) -# self.setFont(maPolice) -# self.labelNomCommande.setText(tr(self.obj.nom)) -# -# -# if self.editor.maConfiguration.closeAutreCommande == True : self.closeAutreCommande() -# else : -# try : -# self.bCatalogue.clicked.connect(self.afficheCatalogue) -# self.bAvant.clicked.connect(self.afficheAvant) -# self.bApres.clicked.connect(self.afficheApres) -# except : -# pass -# self.LENom.returnPressed.connect(self.nomChange) -# -# if self.editor.code in ['Adao','ADAO'] and self.editor.closeFrameRechercheCommande==True : -# self.frameAffichage.close() -# -# if self.editor.code in ['CARMELCND',] : self.closeAutreCommande() -# self.racine=self.node.tree.racine -# if self.node.item.getIconName() == "ast-red-square" : self.LENom.setDisabled(True) -# -# self.setAcceptDrops(True) -# self.etablitOrdre() -# -# if self.editor.code == "CARMELCND" : -# self.RBPoubelle.close() # JDC Fige -# return # Pas de MC Optionnels pour Carmel -# -# from .monWidgetOptionnel import MonWidgetOptionnel -# if self.editor.widgetOptionnel!= None : -# self.monOptionnel=self.editor.widgetOptionnel -# else : -# self.editor.inhibeSplitter=1 -# self.monOptionnel=MonWidgetOptionnel(self.editor) -# self.editor.widgetOptionnel=self.monOptionnel -# self.editor.splitter.addWidget(self.monOptionnel) -# self.editor.ajoutOptionnel() -# self.editor.inhibeSplitter=0 -# self.afficheOptionnel() -# #self.editor.restoreSplitterSizes() -# -# #print "fin init de widget Commande" -# -# -# def closeAutreCommande(self): -# self.bCatalogue.close() -# self.bAvant.close() -# self.bApres.close() -# -# def donnePremier(self): -# #print "dans donnePremier" -# QApplication.processEvents() -# if self.listeAffichageWidget != [] : -# self.listeAffichageWidget[0].setFocus(7) -# QApplication.processEvents() -# #print self.focusWidget() -# -# -# def focusNextPrevChild(self, next): -# # on s assure que ce n est pas un chgt de fenetre -# #print "je passe dans focusNextPrevChild" -# if self.editor.fenetreCentraleAffichee != self : return True -# f=self.focusWidget() -# if f not in self.listeAffichageWidget : -# i=0 -# while not hasattr (f,'AAfficher') : -# if f==None :i=-1; break -# f=f.parentWidget() -# if hasattr(f,'AAfficher') : f=f.AAfficher -# if i != -1 : i=self.listeAffichageWidget.index(f) -# else :i=self.listeAffichageWidget.index(f) -# if (i==len(self.listeAffichageWidget) -1) and next and not self.inhibe: -# try : -# self.listeAffichageWidget[1].setFocus(7) -# w=self.focusWidget() -# self.inhibe=1 -# w.focusPreviousChild() -# self.inhibe=0 -# return True -# except : -# pass -# #print self.listeAffichageWidget -# #print "souci ds focusNextPrevChild" -# if i==0 and next==False and not self.inhibe: -# if hasattr(self.editor.fenetreCentraleAffichee,'scrollArea'): -# self.editor.fenetreCentraleAffichee.scrollArea.ensureWidgetVisible(self.listeAffichageWidget[-1]) -# self.listeAffichageWidget[-2].setFocus(7) -# self.inhibe=1 -# w=self.focusWidget() -# w.focusNextChild() -# self.inhibe=0 -# return True -# if i==0 and next==True and not self.inhibe: -# self.listeAffichageWidget[0].setFocus(7) -# self.inhibe=1 -# w=self.focusWidget() -# w.focusNextChild() -# self.inhibe=0 -# return True -# if i>0 and next==False and not self.inhibe: -# if isinstance(self.listeAffichageWidget[i-1],QRadioButton): -# self.listeAffichageWidget[i-1].setFocus(7) -# return True -# return QWidget.focusNextPrevChild(self, next) -# -# def etablitOrdre(self): -# i=0 -# while(i +1 < len(self.listeAffichageWidget)): -# self.setTabOrder(self.listeAffichageWidget[i],self.listeAffichageWidget[i+1]) -# i=i+1 -# # si on boucle on perd l'ordre -# -# def afficheNieme(self,n): -# #print ('ds afficheNieme') -# self.listeAffichageWidget[n].setFocus(7) -# -# def afficheSuivant(self,f): -# #print ('ds afficheSuivant') -# try : -# i=self.listeAffichageWidget.index(f) -# next=i+1 -# except : -# next=1 -# if (next==len(self.listeAffichageWidget) ): next =0 -# #self.f=next -# #QTimer.singleShot(1, self.rendVisible) -# try : -# self.listeAffichageWidget[next].setFocus(7) -# except : -# pass -# -# -# def afficheOptionnel(self): -# # N a pas de parentQt. doit donc etre redefini -# liste,liste_rouge=self.ajouteMCOptionnelDesBlocs() -# #print "dans afficheOptionnel", self.monOptionnel -# # dans le cas ou l insertion n a pas eu leiu (souci d ordre par exemple) -# #if self.monOptionnel == None : return -# self.monOptionnel.parentCommande=self -# self.monOptionnel.titre(self.obj.nom) -# self.monGroupe=self.monOptionnel.afficheOptionnel(liste,liste_rouge,self) -# -# -# def focusInEvent(self,event): -# #print "je mets a jour dans focusInEvent de monWidget Commande " -# if self.editor.code == "CARMELCND" : return #Pas de MC Optionnels pour Carmel -# self.afficheOptionnel() -# -# -# def reaffiche(self,nodeAVoir=None): -# # Attention delicat. les appels de fonctions ne semblent pas pouvoir etre supprimes! -# self.avantH=self.editor.fenetreCentraleAffichee.scrollAreaCommandes.horizontalScrollBar().sliderPosition() -# self.avantV=self.editor.fenetreCentraleAffichee.scrollAreaCommandes.verticalScrollBar().sliderPosition() -# self.inhibeExpand=True -# self.node.affichePanneau() -# #QTimer.singleShot(1, self.recentre) -# if nodeAVoir != None and nodeAVoir!=0: -# self.f=nodeAVoir.fenetre -# if self.f==None : -# newNode=nodeAVoir.treeParent.chercheNoeudCorrespondant(nodeAVoir.item.object) -# self.f = newNode.fenetre -# if self.f != None and self.f.isVisible() : self.inhibeExpand=False; return -# if self.f != None : self.rendVisible() -# else : self.recentre() -# else : self.recentre() -# self.inhibeExpand=False -# -# def reafficheSeulement(self,nodeAReafficher,index): -# #print ('ds reafficheSeulement', nodeAReafficher) -# parentNodeAReafficher=nodeAReafficher.parentQt -# index=parentNodeAReafficher.commandesLayout.indexOf(nodeAReafficher) -# oldFenetre=nodeAReafficher.node.fenetre -# newWidget=nodeAReafficher.node.getPanelGroupe(parentNodeAReafficher,self,index) -# nodeAReafficher.node.fenetre=newWidget -# oldFenetre.setParent(None) -# oldFenetre.close() -# oldFenetre.deleteLater() -# #print ("fin pour " , self.node.item.nom) -# -# -# def recentre(self): -# QApplication.processEvents() -# s=self.editor.fenetreCentraleAffichee.scrollAreaCommandes -# s.horizontalScrollBar().setSliderPosition(self.avantH) -# s.verticalScrollBar().setSliderPosition(self.avantV) -# -# def rendVisibleNoeud(self,node): -# self.f=node.fenetre -# #print "dans rendVisibleNoeud",self.f -# QTimer.singleShot(1, self.rendVisible) -# -# def rendVisible(self): -# #print "dans rendVisible",self.f -# QApplication.processEvents() -# self.f.setFocus(7) -# self.editor.fenetreCentraleAffichee.scrollAreaCommandes.ensureWidgetVisible(self.f) -# -# def afficheCatalogue(self): -# if self.editor.widgetOptionnel != None : self.monOptionnel.hide() -# self.racine.affichePanneau() -# if self.node : self.node.select() -# else : self.racine.select() -# -# def afficheApres(self): -# self.node.selectApres() -# -# def afficheAvant(self): -# self.node.selectAvant() -# -# def setValide(self): -# if not(hasattr (self,'RBValide')) : return -# icon = QIcon() -# if self.node.item.object.isValid() : -# icon=QIcon(self.repIcon+"/ast-green-ball.png") -# else : -# icon=QIcon(self.repIcon+"/ast-red-ball.png") -# if self.node.item.getIconName() == "ast-yellow-square" : -# icon=QIcon(self.repIcon+"/ast-yel-ball.png") -# self.LENom.setDisabled(False) -# if self.node.item.getIconName() == "ast-red-square" : self.LENom.setDisabled(True) -# self.RBValide.setIcon(icon) -# + self.node.setDeplieChildren() + self.node.afficheCeNiveau() + self.editor.fenetreCentraleAffichee.labelDoc.setText(self.node.item.getFr()) + self.editor.fenetreCentraleAffichee.labelNomCommande.setText(self.node.item.getLabelText()[0]) + + def getPanel(self): + # necessaire pour handleOnItem de browser.py + # non appele + pass + + def donnePremier(self): + #print "dans donnePremier" + QApplication.processEvents() + if self.listeAffichageWidget != [] : + self.listeAffichageWidget[0].setFocus(7) + QApplication.processEvents() + #print self.focusWidget() + + + def focusNextPrevChild(self, next): + # on s assure que ce n est pas un chgt de fenetre + #print "je passe dans focusNextPrevChild" + if self.editor.fenetreCentraleAffichee != self : return True + f=self.focusWidget() + + if f not in self.listeAffichageWidget : + i=0 + while not hasattr (f,'AAfficher') : + if f==None :i=-1; break + f=f.parentWidget() + if hasattr(f,'AAfficher') : f=f.AAfficher + if i != -1 : i=self.listeAffichageWidget.index(f) + else :i=self.listeAffichageWidget.index(f) + if (i==len(self.listeAffichageWidget) -1) and next and not self.inhibe: + try : + self.listeAffichageWidget[1].setFocus(7) + w=self.focusWidget() + self.inhibe=1 + w.focusPreviousChild() + self.inhibe=0 + return True + except : pass + + if i==0 and next==False and not self.inhibe: + if hasattr(self.editor.fenetreCentraleAffichee,'scrollArea'): + self.editor.fenetreCentraleAffichee.scrollArea.ensureWidgetVisible(self.listeAffichageWidget[-1]) + self.listeAffichageWidget[-2].setFocus(7) + self.inhibe=1 + w=self.focusWidget() + w.focusNextChild() + self.inhibe=0 + return True + + if i==0 and next==True and not self.inhibe: + self.listeAffichageWidget[0].setFocus(7) + self.inhibe=1 + w=self.focusWidget() + w.focusNextChild() + self.inhibe=0 + return True + + if i>0 and next==False and not self.inhibe: + if isinstance(self.listeAffichageWidget[i-1],QRadioButton): + self.listeAffichageWidget[i-1].setFocus(7) + return True + return QWidget.focusNextPrevChild(self, next) + + def etablitOrdre(self): + # si on boucle on perd l'ordre + i=0 + while(i +1 < len(self.listeAffichageWidget)): + self.setTabOrder(self.listeAffichageWidget[i],self.listeAffichageWidget[i+1]) + i=i+1 + + def afficheSuivant(self,f): + #print ('ds afficheSuivant') + try : + i=self.listeAffichageWidget.index(f) + next=i+1 + except : + next=1 + if (next==len(self.listeAffichageWidget) ): next =0 + try : + self.listeAffichageWidget[next].setFocus(7) + except : + pass + + + def afficheOptionnel(self): + # N a pas de parentQt. doit donc etre redefini + #print ('ds afficheOptionnel') + if self.editor.widgetOptionnel!= None : + self.monOptionnel=self.editor.widgetOptionnel + else : + self.editor.inhibeSplitter=1 + self.monOptionnel=MonWidgetOptionnel(self.editor) + self.editor.widgetOptionnel=self.monOptionnel + self.editor.splitter.addWidget(self.monOptionnel) + self.editor.ajoutOptionnel() + self.editor.inhibeSplitter=0 + self.monOptionnel.vireTous() + + + liste,liste_rouge=self.ajouteMCOptionnelDesBlocs() + self.monOptionnel.parentCommande=self + self.monOptionnel.titre(self.obj.nom) + self.monGroupe=self.monOptionnel.afficheOptionnel(liste,liste_rouge,self) + + diff --git a/InterfaceQT4/monWidgetOptionnel.py b/InterfaceQT4/monWidgetOptionnel.py index 1c3d91d8..f9bb4140 100644 --- a/InterfaceQT4/monWidgetOptionnel.py +++ b/InterfaceQT4/monWidgetOptionnel.py @@ -61,6 +61,11 @@ class MonWidgetOptionnel (QWidget,Ui_WidgetOptionnel): del self.dicoMCWidgetOptionnel[k] #print( "fin vireLesAutres") + def vireTous(self): + for k in list(self.dicoMCWidgetOptionnel.keys()): + self.dicoMCWidgetOptionnel[k].close() + del self.dicoMCWidgetOptionnel[k] + def afficheOptionnelVide(self): self.GeneaLabel.setText("") for k in list(self.dicoMCWidgetOptionnel.keys()): diff --git a/InterfaceQT4/politiquesValidation.py b/InterfaceQT4/politiquesValidation.py index ba882731..a93175d7 100644 --- a/InterfaceQT4/politiquesValidation.py +++ b/InterfaceQT4/politiquesValidation.py @@ -56,7 +56,7 @@ class Validation(object) : if not validite and commentaire is None: commentaire = "impossible d'evaluer : %s " %repr(valeurentree) - print ('ds testeUneValeur', valeur, validite, commentaire) + #print ('ds testeUneValeur', valeur, validite, commentaire) return valeur, validite, commentaire # ---------------------------------------------------------------------------------------- diff --git a/InterfaceQT4/qtEficas.py b/InterfaceQT4/qtEficas.py index b0966b65..7864a01b 100755 --- a/InterfaceQT4/qtEficas.py +++ b/InterfaceQT4/qtEficas.py @@ -947,12 +947,8 @@ class Appli(AppliSsIhm,Ui_Eficas,QMainWindow): if self.maConfiguration.boutonDsMenuBar == False : return if not hasattr(self, 'readercata') : return from monLayoutBouton import MonLayoutBouton - if hasattr(self,'monLayoutBoutonRempli') : - print ('double passage dans le readerCata') - self.monLayoutBoutonRempli.close() + if hasattr(self,'monLayoutBoutonRempli') : return self.monLayoutBoutonRempli=MonLayoutBouton(self) - #for - #self.toolBarCommande.close() def handleAjoutEtape(self,nomEtape): self.viewmanager.handleAjoutEtape(nomEtape) diff --git a/InterfaceQT4/readercata.py b/InterfaceQT4/readercata.py index 3924916d..f3cd73b5 100644 --- a/InterfaceQT4/readercata.py +++ b/InterfaceQT4/readercata.py @@ -181,8 +181,7 @@ class READERCATA(object): self.cata=(self.cata,) self.titre=self.VERSION_EFICAS+" "+tr( " avec le catalogue ") + os.path.basename(self.fic_cata) - if self.appliEficas.ssIhm == False : - self.appliEficas.setWindowTitle(self.titre) + if self.appliEficas.ssIhm == False : self.appliEficas.setWindowTitle(self.titre) self.appliEficas.titre=self.titre self.QWParent.titre=self.titre @@ -225,7 +224,7 @@ class READERCATA(object): Pour chaque entite du catlogue on cree une liste de nom ordre_mc qui contient le nom des mots cles dans le bon ordre """ - self.cata_ordonne_dico,self.appliEficas.liste_simp_reel=autre_analyse_cata.analyseCatalogue(self.cata) + self.cata_ordonne_dico, self.appliEficas.liste_simp_reel=autre_analyse_cata.analyseCatalogue(self.cata) def retrouveOrdreCataStandard(self): """ diff --git a/InterfaceQT4/readercataXML.py b/InterfaceQT4/readercataXML.py new file mode 100644 index 00000000..2dc217f0 --- /dev/null +++ b/InterfaceQT4/readercataXML.py @@ -0,0 +1,77 @@ +# -*- 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 lire un catalogue et a construire + un objet CataItem pour Eficas. + Il s'appuie sur la classe READERCATA +""" +# Modules Python +import sys, os +sys.path.insert(0,os.path.abspath(os.path.join(os.getcwd(),'..','EssaiInit',))) +import autre_analyse_cata + + +# Modules Eficas + +from monChoixCata import MonChoixCata +from Extensions.i18n import tr +from Extensions.eficas_exception import EficasException +import uiinfo + + +class READERCATA: + + def __init__(self,QWParent, appliEficas): + self.QWParent=QWParent + self.appliEficas=appliEficas + self.VERSION_EFICAS=self.appliEficas.VERSION_EFICAS + self.code=self.appliEficas.code + self.ssCode=self.appliEficas.ssCode + self.appliEficas.format_fichier='python' + self.appliEficas.format_fichier_in ='xml' + self.modeNouvCommande=self.appliEficas.maConfiguration.modeNouvCommande + self.versionCode=self.appliEficas.versionCode + self.version_cata=None + self.fic_cata=None + self.OpenCata() + self.cataitem=None + self.titre='Eficas XML' + self.Ordre_Des_Commandes=None + self.Classement_Commandes_Ds_Arbre=() + + #self.traiteIcones() + #self.creeDicoInverse() + + + def OpenCata(self): + + self.fic_cata = 'Cata_MED_FAM.xml' + + import readerEfficas + xml = open('/home/A96028/QT5GitEficasTravail/XMLEficas/EssaiInit/Cata_MED_FAM.xml').read() + SchemaMed = readerEfficas.efficas.CreateFromDocument(xml) + SchemaMed.exploreCata() + self.cata=(SchemaMed,) + uiinfo.traite_UIinfo(self.cata[0]) + self.Commandes_Ordre_Catalogue=[] + self.cata_ordonne_dico,self.appliEficas.liste_simp_reel=autre_analyse_cata.analyseCatalogue(self.cata[0]) + self.liste_groupes=None + + diff --git a/InterfaceQT4/typeNode.py b/InterfaceQT4/typeNode.py index 920dc511..396436d2 100644 --- a/InterfaceQT4/typeNode.py +++ b/InterfaceQT4/typeNode.py @@ -64,22 +64,8 @@ class PopUpMenuNodeMinimal(object) : self.dict_commandes_mesScripts=self.appliEficas.mesScripts[self.editor.code].dict_commandes if self.tree.currentItem().item.getNom() in self.dict_commandes_mesScripts : self.ajoutScript() - if self.appliEficas.code == 'MT' : - item=self - depth=0 - while(item!=None) : - depth = depth+1 - item = item.parent() - if depth != 3 : return - from InterfaceQT4 import composimp - if (isinstance(self,composimp.Node)) : return - label=('Deplie ce niveau') - self.actionDeplie=QAction(label,self.tree) - self.actionDeplie.triggered.connect(self.deplieCeNiveau) - self.menu.addAction(self.actionDeplie) def ajoutScript(self): - # cochon mais je n arrive pas a faire mieux avec le mecanisme de plugin # a revoir avec un menu et un connect sur le triggered sur le menu ? if hasattr(self.appliEficas, 'mesScripts'): diff --git a/MED/CataAZ.py b/MED/CataAZ.py deleted file mode 100755 index b6e6494e..00000000 --- a/MED/CataAZ.py +++ /dev/null @@ -1,210 +0,0 @@ -# coding: utf-8 -import types -from Accas import * - -class grno(GEOM): - """ - Classe servant à définir le nom d'un groupe de noeuds dans le fichier de commande - En clair : un chaine de longueur 24. - """ - def __convert__(cls,valeur): - """ - Fonction de verification de la longueur de la chaine - """ - if isinstance(valeur, (str,unicode)) and len(valeur.strip()) <= 24: - return valeur.strip() - raise ValueError(_(u'On attend une chaine de caractères (de longueur <= 24).')) - __convert__ = classmethod(__convert__) - -class grma(GEOM): - """ - Classe servant à définir le nom d'un groupe de mailles dans le fichier de commande - En clair : un chaine de longueur 24. - """ - def __convert__(cls,valeur): - """ - Fonction de verification de la longueur de la chaine - """ - if isinstance(valeur, (str,unicode)) and len(valeur.strip()) <= 24: - return valeur.strip() - raise ValueError(_(u'On attend une chaine de caractères (de longueur <= 24).')) - __convert__ = classmethod(__convert__) - - -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 - - __repr__=info - __str__=info - -class ObjetUtilisateur(ASSD): pass - - -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'))), - InSalome = SIMP(statut ='o', typ = SalomeEntry), - - 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 = "**"), - LInSalome = SIMP(statut ='o', typ = SalomeEntry, 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/MED/Elementary_Lists_52996_Cata.py b/MED/Elementary_Lists_52996_Cata.py deleted file mode 100644 index f3cc11c8..00000000 --- a/MED/Elementary_Lists_52996_Cata.py +++ /dev/null @@ -1,86 +0,0 @@ -# coding: utf-8 - -from Accas import * - -#class myMesh(ASSD): pass -class myModel(ASSD): pass - -JdC = JDC_CATA(code='PATTERNS', - execmodul=None, - regles=(#AU_PLUS_UN('DEBUT', 'POURSUITE'), - AU_PLUS_UN('ALL_LISTS'), - #AU_PLUS_UN('FIN'), - A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN') - ) -) - -class grma(): - def __convert__(cls,valeur): - if isinstance(valeur, (str,unicode)) and len(valeur.strip()) <= 24 : #and ("item" in (valeur.strip())) - return valeur.strip() - raise ValueError("Name length does not contain \"test\" and is longer than allowed, 24") - __convert__ = classmethod(__convert__) - -def mySeveral(suffix,num): - out=list() - for i in range(1,num+1): - out.append(suffix+str(i).zfill(2)) - return out - -switch_facultatif=True #change 'o' to 'f' of some widgets in the loop -#empty_defauts=True - -def myBloc(num): - myNum=str(num).zfill(2) - list_item_body="Item_"+myNum+"_" - defauts0=["","",True,"'phenomena_"+myNum+"'",mySeveral(list_item_body,2)] #presence of default values - defauts_mask=[False,False,True,True,True] #switch off defaults of some types - defauts=list() - for id0 in range(len(defauts0)): - if defauts_mask[id0]: - item=", defaut="+str(defauts0[id0]) - else: - item="" - defauts.append(item) - #print defauts - - opt=['o','o','o','o','o'] #initial default obligation of items in FACT groups - #make different widgets optional, one by one: - myLen=len(opt) - if switch_facultatif: - make_f=(num)%myLen - opt[make_f]='f' - #print opt - #if empty_defauts: - # clean_defaut=num%myLen - - myString="BLOC(condition=\"MESH==\'mesh_"+myNum+"'\""+defauts[0]+", AFFE=FACT(statut='"+opt[1]+"'"+defauts[1]+", ALL=SIMP(statut='"+opt[2]+"', typ=bool,ang='ALL "+myNum+" help EN'"+defauts[2]+"),PHENOMENA=SIMP(statut='"+opt[3]+"',typ='TXM',into=mySeveral('phenomena_',"+str(num)+")"+defauts[3]+"), MODELISATION=SIMP(statut='"+opt[4]+"',typ='TXM', min=2,max='**',into=mySeveral('"+list_item_body+"',"+str(num*4)+")"+defauts[4]+", ang='Input "+myNum+" list EN', fr='Input "+myNum+" list FR'),),)" - print myString - return eval(myString) - -ALL_LISTS=OPER(nom="ALL_LISTS",op=18,sd_prod=myModel, - UIinfo={"groupes":("Group1",)}, - ang="Model mesh definition EN", - reentrant='n', - #regles=(AU_MOINS_UN('LIST_O_CHECKTEXT','LIST_F_CHECKTEXT','LIST_O_ANY','LIST_F_ANY')), - - #LIST_O_NOREPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,validators=NoRepeat(),min=3, max='**'), - #LIST_F_NOREPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,validators=NoRepeat(),min=3, max='**'), - #LIST_F_REPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,min=3, max='**'), - #LIST_O_REPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,min=3, max='**'), - - #LIST_F_NOREPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',validators=NoRepeat(),min=3, max='**'), - #LIST_O_NOREPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3,validators=NoRepeat(), max='**'), - #LIST_O_REPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3, max='**'), - #LIST_F_REPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',min=3, max='**'), - - #LIST_O_NOREPEAT_CHECKTEXT_ADD=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03",), min=3, max='**'), - #LIST_F_REPEAT_ANYTEXT_ADD=SIMP(statut='f',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03",), min=3, max='**'), - - LIST_O_NOREPEAT_CHECKTEXT_ADD_NODEFAUT=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03","item04","text04",), min=3, max='**'), - #LIST_O_NOREPEAT_CHECKTEXT_ADD_DEFAUT=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03",), defaut=('item01','item02','item03'), min=3, max='**'), -) - -Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','ALL_LISTS','FIN') - -Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','ALL_LISTS','FIN') diff --git a/MED/Elementary_Lists_53000_Cata.py b/MED/Elementary_Lists_53000_Cata.py deleted file mode 100644 index 0dbba473..00000000 --- a/MED/Elementary_Lists_53000_Cata.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 -from Accas import * - -#class myMesh(ASSD): pass -class myModel(ASSD): pass - -JdC = JDC_CATA(code='PATTERNS', - execmodul=None, - regles=(#AU_PLUS_UN('DEBUT', 'POURSUITE'), - AU_PLUS_UN('ALL_LISTS'), - #AU_PLUS_UN('FIN'), - A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN') - ) -) - - -ALL_LISTS=OPER(nom="ALL_LISTS",op=18,sd_prod=myModel, - UIinfo={"groupes":("Group1",)}, - ang="Model mesh definition EN", - reentrant='n', - LIST_O_NOREPEAT_CHECKTEXT_ADD_DEFAUT=SIMP(statut='o',typ="TXM",validators=NoRepeat(), - into=("item01","text01","item02","text02","item03","text03","item04","text04","item05","text05",), - defaut=('item01','item02','item03'), - homo="SansOrdreNiDoublon", - min=3, max='**'), - - #regles=(AU_MOINS_UN('LIST_O_CHECKTEXT','LIST_F_CHECKTEXT','LIST_O_ANY','LIST_F_ANY')), - - #LIST_O_NOREPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,validators=NoRepeat(),min=3, max='**'), - #LIST_F_NOREPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,validators=NoRepeat(),min=3, max='**'), - #LIST_F_REPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,min=3, max='**'), - #LIST_O_REPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,min=3, max='**'), - - #LIST_F_NOREPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',validators=NoRepeat(),min=3, max='**'), - #LIST_O_NOREPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3,validators=NoRepeat(), max='**'), - #LIST_O_REPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3, max='**'), - #LIST_F_REPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',min=3, max='**'), - - #LIST_O_NOREPEAT_CHECKTEXT_ADD=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03",), min=3, max='**'), - #LIST_F_REPEAT_ANYTEXT_ADD=SIMP(statut='f',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03",), min=3, max='**'), - - #LIST_O_NOREPEAT_CHECKTEXT_ADD_NODEFAUT=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03","item04","text04",), min=3, max='**'), - - - #LIST_O_SANSORDRENODOUBLON_CHECKTEXT_DEFAUT=SIMP(statut='o',typ=grma,homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03",), defaut=('item01','item02','item03'), min=3, max='**'), -) - - - -Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','ALL_LISTS','FIN') - -Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','ALL_LISTS','FIN') diff --git a/MED/Elementary_Lists_53013_Cata.py b/MED/Elementary_Lists_53013_Cata.py deleted file mode 100644 index cf371ff2..00000000 --- a/MED/Elementary_Lists_53013_Cata.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 -from Accas import * - -class myModel(ASSD): pass - -JdC = JDC_CATA(code='PATTERNS', - execmodul=None, - regles=(#AU_PLUS_UN('DEBUT', 'POURSUITE'), - AU_PLUS_UN('ALL_LISTS'), - #AU_PLUS_UN('FIN'), - A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN') - ) -) - -class grma(): - def __convert__(cls,valeur): - if isinstance(valeur, (str,unicode)) and len(valeur.strip()) <= 12 and ("item" in (valeur.strip()).lower()): # - return valeur.strip() - raise ValueError("Name length does not contain \"test\" and is longer than allowed, 12") - __convert__ = classmethod(__convert__) - -def mySeveral(suffix,num): - out=list() - for i in range(1,num+1): - out.append(suffix+str(i).zfill(2)) - return out - -ALL_LISTS=OPER(nom="ALL_LISTS",op=18,sd_prod=myModel, - UIinfo={"groupes":("Group1",)}, - fr="All lists definition FR", - ang="All lists definition EN", - reentrant='n', - #regles=(AU_MOINS_UN('LIST_O_CHECKTEXT','LIST_F_CHECKTEXT','LIST_O_ANY','LIST_F_ANY')), - - L1_LIST_O_NOREPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,validators=NoRepeat(),min=3, max='**', ang='Obligatory, No Repetitions, checked text, EN'), - L2_LIST_F_NOREPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,validators=NoRepeat(),min=3, max='**', ang='Optional, No Repetitions, checked text, EN'), - L3_LIST_F_REPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,min=3, max='**',ang='Optional, Allowed Repetitions, checked text, EN'), - L4_LIST_O_REPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,min=3, max='**',ang='Obligatory, Allowed Repetitions, checked text, EN'), - - L5_LIST_F_NOREPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',validators=NoRepeat(),min=3, max='**',ang='Optional, No Repetitions, any text, EN'), - L6_LIST_O_NOREPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3,validators=NoRepeat(), max='**',ang='Obligatory, No Repetitions, any text, EN'), - L7_LIST_O_REPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3, max='**',ang='Obligatory, Allowed Repetitions, any text, EN'), - L8_LIST_F_REPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',min=3, max='**',ang='Optional, Allowed Repetitions, any text, EN'), - - L9_LIST_O_NOREPEAT_CHECKTEXT_ADD=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With spare list, Obligatory, No Repetitions, checked text, EN',), - L10_LIST_F_REPEAT_ANYTEXT_ADD=SIMP(statut='f',typ='TXM', into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With spare list, Optional, Allowed Repetitions, any text, EN'), - L11_LIST_O_REPEAT_CHECKTEXT_ADD_NODEFAUT=SIMP(statut='o',typ=grma, into=("item01","text01","item02","text02","item03","text03","item04","text04"),ang='With spare list, obligatory, No Repetitions, checked text, no default values, EN', min=3, max='**'), - L12_LIST_O_NOREPEAT_CHECKTEXT_ADD_DEFAUT=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03","item04","text04","item05","text05",), defaut=('item01','item02','item03'), min=3, max='**',ang='With spare list, Obligatory, No Repetitions, checked text, with default values EN'), - - L13_LIST_F_SANSORDRENODOUBLON_ANYTEXT_NODEFAUT=SIMP(statut='f',typ='TXM',homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With check boxes, Optional, any text, no defaults, EN'), - L14_LIST_O_SANSORDRENODOUBLON_CHECKTEXT_NODEFAUT=SIMP(statut='o',typ=grma,homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With check boxes, Obligatory, checked text, EN'), - L15_LIST_O_SANSORDRENODOUBLON_CHECKTEXT_DEFAUT=SIMP(statut='o',typ=grma,homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03","item02","text02","item01","text01",), defaut=('item01','item02','item03'), min=3, max='**', ang='With check boxes, Obligatory, checked text, with default values, EN'), -) - - - -Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','ALL_LISTS','FIN') - -Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','ALL_LISTS','FIN') diff --git a/MED/Elementary_Lists_53036_Cata.py b/MED/Elementary_Lists_53036_Cata.py deleted file mode 100644 index 5cdc0faa..00000000 --- a/MED/Elementary_Lists_53036_Cata.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 -from Accas import * - -class myModel(ASSD): pass - -JdC = JDC_CATA(code='PATTERNS', - execmodul=None, - regles=(#AU_PLUS_UN('DEBUT', 'POURSUITE'), - AU_PLUS_UN('ALL_LISTS'), - #AU_PLUS_UN('FIN'), - A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN') - ) -) - -class grma(): - def __convert__(cls,valeur): - if isinstance(valeur, (str,unicode)) and len(valeur.strip()) <= 12 and ("item" in (valeur.strip()).lower()): # - return valeur.strip() - raise ValueError("Name length does not contain \"item\" and is longer than allowed, 12") - __convert__ = classmethod(__convert__) - -def mySeveral(suffix,num): - out=list() - for i in range(1,num+1): - out.append(suffix+str(i).zfill(2)) - return out - -ALL_LISTS=OPER(nom="ALL_LISTS",op=18,sd_prod=myModel, - UIinfo={"groupes":("Group1",)}, - fr="All lists definition FR", - ang="All lists definition EN", - reentrant='n', - #regles=(AU_MOINS_UN('LIST_O_CHECKTEXT','LIST_F_CHECKTEXT','LIST_O_ANY','LIST_F_ANY')), - - L1_LIST_O_NOREPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,validators=NoRepeat(),min=3, max='**', ang='Obligatory, No Repetitions, checked text, EN'), - L2_LIST_F_NOREPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,validators=NoRepeat(),min=3, max='**', ang='Optional, No Repetitions, checked text, EN'), - L3_LIST_F_REPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,min=3, max='**',ang='Optional, Allowed Repetitions, checked text, EN'), - L4_LIST_O_REPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,min=3, max='**',ang='Obligatory, Allowed Repetitions, checked text, EN'), - - L5_LIST_F_NOREPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',validators=NoRepeat(),min=3, max='**',ang='Optional, No Repetitions, any text, EN'), - L6_LIST_O_NOREPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3,validators=NoRepeat(), max='**',ang='Obligatory, No Repetitions, any text, EN'), - L7_LIST_O_REPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3, max='**',ang='Obligatory, Allowed Repetitions, any text, EN'), - L8_LIST_F_REPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',min=3, max='**',ang='Optional, Allowed Repetitions, any text, EN'), - - L9_LIST_O_NOREPEAT_CHECKTEXT_ADD=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With spare list, Obligatory, No Repetitions, checked text, EN',), - L10_LIST_F_REPEAT_ANYTEXT_ADD=SIMP(statut='f',typ='TXM', into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With spare list, Optional, Allowed Repetitions, any text, EN'), - L11_LIST_O_REPEAT_CHECKTEXT_ADD_NODEFAUT=SIMP(statut='o',typ=grma, into=("item01","text01","item02","text02","item03","text03","item04","text04"),ang='With spare list, obligatory, No Repetitions, checked text, no default values, EN', min=3, max='**'), - L12_LIST_O_NOREPEAT_CHECKTEXT_ADD_DEFAUT=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03","item04","text04","item05","text05",), defaut=('item01','item02','item03'), min=3, max='**',ang='With spare list, Obligatory, No Repetitions, checked text, with default values EN'), - - L13_LIST_F_SANSORDRENODOUBLON_ANYTEXT_NODEFAUT=SIMP(statut='f',typ='TXM',homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With check boxes, Optional, any text, no defaults, EN'), - L14_LIST_O_SANSORDRENODOUBLON_CHECKTEXT_NODEFAUT=SIMP(statut='o',typ=grma,homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With check boxes, Obligatory, checked text, EN'), - L15_LIST_O_SANSORDRENODOUBLON_CHECKTEXT_NOREPEAT_DEFAUT=SIMP(statut='o',typ=grma,homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03","item03","text03","item02","text02","item01","text01",), defaut=('item01','item02','item03'), min=3, max='**', ang='With check boxes, Obligatory, checked text, with default values, EN'), #validators=NoRepeat(), -) - - - -Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','ALL_LISTS','FIN') - -Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','ALL_LISTS','FIN') diff --git a/MED/Elementary_Lists_Cata.py b/MED/Elementary_Lists_Cata.py deleted file mode 100755 index 92d20b35..00000000 --- a/MED/Elementary_Lists_Cata.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 -from Accas import * - -class myModel(ASSD): pass - -JdC = JDC_CATA(code='PATTERNS', - execmodul=None, - regles=(#AU_PLUS_UN('DEBUT', 'POURSUITE'), - AU_PLUS_UN('ALL_LISTS'), - #AU_PLUS_UN('FIN'), - A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN') - ) -) - -class grma(): - def __convert__(cls,valeur): - if isinstance(valeur, (str,unicode)) and len(valeur.strip()) <= 12 and ("item" in (valeur.strip()).lower()): # - return valeur.strip() - raise ValueError("Name length does not contain \"test\" and is longer than allowed, 12") - __convert__ = classmethod(__convert__) - -def mySeveral(suffix,num): - out=list() - for i in range(1,num+1): - out.append(suffix+str(i).zfill(2)) - return out - -ALL_LISTS=OPER(nom="ALL_LISTS",op=18,sd_prod=myModel, - UIinfo={"groupes":("Group1",)}, - fr="All lists definition FR", - ang="All lists definition EN", - reentrant='n', - #regles=(AU_MOINS_UN('LIST_O_CHECKTEXT','LIST_F_CHECKTEXT','LIST_O_ANY','LIST_F_ANY')), - - L1_LIST_O_NOREPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,validators=NoRepeat(),min=3, max='**', ang='Obligatory, No Repetitions, checked text, EN'), - L2_LIST_F_NOREPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,validators=NoRepeat(),min=3, max='**', ang='Optional, No Repetitions, checked text, EN'), - L3_LIST_F_REPEAT_CHECKTEXT=SIMP(statut='f',typ=grma,min=3, max='**',ang='Optional, Allowed Repetitions, checked text, EN'), - L4_LIST_O_REPEAT_CHECKTEXT=SIMP(statut='o',typ=grma,min=3, max='**',ang='Obligatory, Allowed Repetitions, checked text, EN'), - - L5_LIST_F_NOREPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',validators=NoRepeat(),min=3, max='**',ang='Optional, No Repetitions, any text, EN'), - L6_LIST_O_NOREPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3,validators=NoRepeat(), max='**',ang='Obligatory, No Repetitions, any text, EN'), - L7_LIST_O_REPEAT_ANYTEXT=SIMP(statut='o',typ='TXM',min=3, max='**',ang='Obligatory, Allowed Repetitions, any text, EN'), - L8_LIST_F_REPEAT_ANYTEXT=SIMP(statut='f',typ='TXM',min=3, max='**',ang='Optional, Allowed Repetitions, any text, EN'), - - L9_LIST_O_NOREPEAT_CHECKTEXT_ADD=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With spare list, Obligatory, No Repetitions, checked text, EN',), - L10_LIST_F_REPEAT_ANYTEXT_ADD=SIMP(statut='f',typ='TXM', into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With spare list, Optional, Allowed Repetitions, any text, EN'), - L11_LIST_O_REPEAT_CHECKTEXT_ADD_NODEFAUT=SIMP(statut='o',typ=grma, into=("item01","text01","item02","text02","item03","text03","item04","text04"),ang='With spare list, obligatory, No Repetitions, checked text, no default values, EN', min=3, max='**'), - L12_LIST_O_NOREPEAT_CHECKTEXT_ADD_DEFAUT=SIMP(statut='o',typ=grma,validators=NoRepeat(), into=("item01","text01","item02","text02","item03","text03","item04","text04","item05","text05",), defaut=('item01','item02','item03'), min=3, max='**',ang='With spare list, Obligatory, No Repetitions, checked text, with default values EN'), - - L13_LIST_F_SANSORDRENODOUBLON_ANYTEXT_NODEFAUT=SIMP(statut='f',typ='TXM',homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With check boxes, Optional, any text, no defaults, EN'), - L14_LIST_O_SANSORDRENODOUBLON_CHECKTEXT_NODEFAUT=SIMP(statut='o',typ=grma,homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03",), min=3, max='**',ang='With check boxes, Obligatory, checked text, EN'), - L15_LIST_O_SANSORDRENODOUBLON_CHECKTEXT_DEFAUT=SIMP(statut='o',typ=grma,homo="SansOrdreNiDoublon", into=("item01","text01","item02","text02","item03","text03",), defaut=('item01','item02','item03'), min=3, max='**', ang='With check boxes, Obligatory, checked text, with default values, EN'), -) - - - -Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','ALL_LISTS','FIN') - -Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','ALL_LISTS','FIN') diff --git a/MED/Global_Condition_Cata.py b/MED/Global_Condition_Cata.py deleted file mode 100755 index 02396340..00000000 --- a/MED/Global_Condition_Cata.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 -from Accas import * -#class myModel(ASSD): pass - -JdC = JDC_CATA(code='GLOB_COND', - execmodul=None, - regles=(AU_PLUS_UN('TYPES',), - AU_PLUS_UN('INITS',), - AU_PLUS_UN('DATAS',), - #A_CLASSER('TYPES','INITS','DATAS') - ) -); - -TYPES=PROC(nom='TYPES',op=None,UIinfo={"groupes":("Global_Workflow",)}, #sd_prod=myModel, - MODE=SIMP( - typ='TXM', - statut='o', - position='global_jdc', - into=("MANUAL","AUTOMATIC","MIXED"), - defaut="AUTOMATIC", - ), -); - -liste_condition=('INITS', 'DATAS') - -INITS=PROC(nom='INITS',op=None,UIinfo={"groupes":("INI_param",)}, - ini_manual=BLOC(condition="MODE == 'MANUAL'", - Informer=SIMP(statut='o',typ='TXM', defaut="INITS MANUAL"), - ), - ini_auto=BLOC(condition="MODE == 'AUTOMATIC'", - Informer=SIMP(statut='o', typ='TXM', defaut="INITS AUTOMATIC",), - ), - ini_mixed=BLOC(condition="MODE == 'MIXED'", - Informer=SIMP(statut='o',typ='TXM', defaut="INITS MIXED",), - ), -); -DATAS=PROC(nom='DATAS',op=None,UIinfo={"groupes":("DATAS",)}, - data_manual=BLOC(condition="MODE == 'MANUAL'", - Informer=SIMP(statut='o',typ='TXM', defaut="DATAS MANUAL", - ), - ), - data_auto=BLOC(condition="MODE == 'AUTOMATIC'", - Informer=SIMP(statut='o', typ='TXM', defaut="DATAS AUTOMATIC", - ), - ), - data_mixed=BLOC(condition="MODE == 'MIXED'", - Informer=SIMP(statut='o',typ='TXM', defaut="DATAS MIXED", - ), - ), -); - -Classement_Commandes_Ds_Arbre=('TYPES','INITS','DATAS') -Ordre_Des_Commandes = ('TYPES','INITS','DATAS') diff --git a/MED/Many_Concepts_52983_Cata.py b/MED/Many_Concepts_52983_Cata.py deleted file mode 100644 index 70f099ac..00000000 --- a/MED/Many_Concepts_52983_Cata.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -from Accas import * - -#class myMesh(ASSD): pass -class myModel(ASSD): pass - -JdC = JDC_CATA(code='PATTERNS', - execmodul=None, - regles=(UN_PARMI('DEBUT', 'POURSUITE'), - AU_MOINS_UN('FIN'), - A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN'))) - -DEBUT=PROC(nom="DEBUT", op=68, repetable='n', UIinfo={"groupes":("Group1",)}, ang="Debut Eng help", - PAR_LOT=SIMP(ang="Debut Par Lot help En",statut='o',typ=bool, defaut=True), -) -AFFE_MODELE=OPER(nom="AFFE_MODELE",op=None,sd_prod=myModel, - UIinfo={"groupes":("Group1",)}, - ang="Model mesh definition EN", - MESH=SIMP(statut='o',typ='TXM',into=("mesh_01","mesh_02","mesh_03","mesh_04",) , defaut="mesh_01"), - #reentrant='n', - #regles=(AU_MOINS_UN('AFFE','AFFE_SOUS_STRUC'),UN_PARMI('MAILLAGE','GRILLE')), - - - block_mesh_01=BLOC(condition="MESH=='mesh_01'", - AFFE=FACT(statut='o', - ALL=SIMP(statut='o', typ=bool,ang='ALL 01 help EN', defaut=True), - PHENOMENA=SIMP(statut='o',typ='TXM',into=('phenomena_01','phenomena_02',), defaut='phenomena_01'), - #MODELISATION=SIMP(statut='o',typ='TXM', min=2,max='**', into=("mesh_01","mesh_02","mesh_03","mesh_04",) ,ang='Input 01 list EN', fr='Input 01 list FR'), - MODELISATION=SIMP(statut='o',typ='TXM', min=2,max='**', into=('Item_01_01','Item_01_02',) ,ang='Input 01 list EN', fr='Input 01 list FR'), - ), - ), -) -FIN=PROC(nom="FIN",op=9999,repetable='n',ang="Finish help EN",UIinfo={"groupes":("Group1",)}, - FORMAT_HDF =SIMP(ang="Save HDF EN",statut='f',typ='TXM',defaut="NON",into=("OUI","NON",) ), -) - -Classement_Commandes_Ds_Arbre=('DEBUT','MESH','AFFE_MODELE','FIN') -Ordre_Des_Commandes = ('DEBUT','MESH','AFFE_MODELE','FIN') diff --git a/MED/Many_Concepts_52988_Cata.py b/MED/Many_Concepts_52988_Cata.py deleted file mode 100644 index 52d4f10f..00000000 --- a/MED/Many_Concepts_52988_Cata.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -from Accas import * - -class myMesh(ASSD): pass -class myModel(ASSD): pass - -JdC = JDC_CATA(code='PATTERNS', - execmodul=None, - regles=(AU_PLUS_UN('DEBUT', 'POURSUITE'), - AU_PLUS_UN('AFFE_MODELE'), - AU_PLUS_UN('FIN'), - A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN'))) - -def mySeveral(suffix,num): - out=list() - for i in range(1,num+1): - out.append(suffix+str(i).zfill(2)) - return out - -switch_facultatif=True #change 'o' to 'f' of some widgets in the loop -empty_defauts=True - -def myBloc(num): - myNum=str(num).zfill(2) - list_item_body="Item_"+myNum+"_" - defauts0=["","",True,"'phenomena_"+myNum+"'",mySeveral(list_item_body,2)] #presence of default values - defauts_mask=[False,False,True,True,True] #switch off defaults of some types - defauts=list() - for id0 in range(len(defauts0)): - if defauts_mask[id0]: - item=", defaut="+str(defauts0[id0]) - else: - item="" - defauts.append(item) - #print defauts - - opt=['o','o','o','o','o'] #initial default obligation of items in FACT groups - #make some widgets optional: - myLen=len(opt) - if switch_facultatif: - make_f=(num)%myLen - opt[make_f]='f' - #print opt - if empty_defauts: - clean_defaut=num%myLen - - myString="BLOC(condition=\"MESH==\'mesh_"+myNum+"'\""+defauts[0]+", AFFE=FACT(statut='"+opt[1]+"'"+defauts[1]+", ALL=SIMP(statut='"+opt[2]+"', typ=bool,ang='ALL "+myNum+" help EN'"+defauts[2]+"),PHENOMENA=SIMP(statut='"+opt[3]+"',typ='TXM',into=mySeveral('phenomena_',"+str(num)+")"+defauts[3]+"), MODELISATION=SIMP(statut='"+opt[4]+"',typ='TXM', min=2,max='**',into=mySeveral('"+list_item_body+"',"+str(num*4)+")"+defauts[4]+", ang='Input "+myNum+" list EN', fr='Input "+myNum+" list FR'),),)" - print myString - return eval(myString) - -DEBUT=PROC(nom="DEBUT", op=10, repetable='n', UIinfo={"groupes":("Group1",)}, ang="Debut Eng help", - PAR_LOT=SIMP(ang="Debut Par Lot help En",statut='o',typ=bool, defaut=True), -); - -AFFE_MODELE=OPER(nom="AFFE_MODELE",op=18,sd_prod=myModel, - UIinfo={"groupes":("Group1",)}, - ang="Model mesh definition EN", - reentrant='n', - regles=(AU_MOINS_UN('APPROVED')), - MESH=SIMP(statut='o',typ='TXM',into=mySeveral("mesh_",4) ,defaut="mesh_01"), - APPROVED=SIMP(statut="o", typ=bool), - block_mesh_01=myBloc(1), - block_mesh_02=myBloc(2), - block_mesh_03=myBloc(3), - block_mesh_04=myBloc(4), -) - - -FIN=PROC(nom="FIN",op=9999,repetable='n',ang="Finish help EN",UIinfo={"groupes":("Group1",)}, - FORMAT_HDF =SIMP(ang="Save HDF EN",statut='f',typ='TXM',defaut="NON",into=("OUI","NON",) ), -); - -Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','AFFE_MODELE','FIN') - -Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','AFFE_MODELE','FIN') diff --git a/MED/Many_Concepts_52989_Cata.py b/MED/Many_Concepts_52989_Cata.py deleted file mode 100644 index 930d9e89..00000000 --- a/MED/Many_Concepts_52989_Cata.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -from Accas import * - -#class myMesh(ASSD): pass -class myModel(ASSD): pass - -JdC = JDC_CATA(code='PATTERNS', - execmodul=None, - regles=(AU_PLUS_UN('DEBUT', 'POURSUITE'), - AU_PLUS_UN('AFFE_MODELE'), - AU_PLUS_UN('FIN'), - A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN'))) - -def mySeveral(suffix,num): - out=list() - for i in range(1,num+1): - out.append(suffix+str(i).zfill(2)) - return out - -switch_facultatif=True #change 'o' to 'f' of some widgets in the loop -#empty_defauts=True - -def myBloc(num): - myNum=str(num).zfill(2) - list_item_body="Item_"+myNum+"_" - defauts0=["","",True,"'phenomena_"+myNum+"'",mySeveral(list_item_body,2)] #presence of default values - defauts_mask=[False,False,True,True,True] #switch off defaults of some types - defauts=list() - for id0 in range(len(defauts0)): - if defauts_mask[id0]: - item=", defaut="+str(defauts0[id0]) - else: - item="" - defauts.append(item) - #print defauts - - opt=['o','o','o','o','o'] #initial default obligation of items in FACT groups - #make different widgets optional, one by one: - myLen=len(opt) - if switch_facultatif: - make_f=(num)%myLen - opt[make_f]='f' - #print opt - #if empty_defauts: - # clean_defaut=num%myLen - - myString="BLOC(condition=\"MESH==\'mesh_"+myNum+"'\""+defauts[0]+", AFFE=FACT(statut='"+opt[1]+"'"+defauts[1]+", ALL=SIMP(statut='"+opt[2]+"', typ=bool,ang='ALL "+myNum+" help EN'"+defauts[2]+"),PHENOMENA=SIMP(statut='"+opt[3]+"',typ='TXM',into=mySeveral('phenomena_',"+str(num)+")"+defauts[3]+"), MODELISATION=SIMP(statut='"+opt[4]+"',typ='TXM', min=2,max='**',into=mySeveral('"+list_item_body+"',"+str(num*4)+")"+defauts[4]+", ang='Input "+myNum+" list EN', fr='Input "+myNum+" list FR'),),)" - print myString - return eval(myString) - -DEBUT=PROC(nom="DEBUT", op=10, repetable='n', UIinfo={"groupes":("Group1",)}, ang="Debut Eng help", - PAR_LOT=SIMP(ang="Debut Par Lot help En",statut='o',typ=bool, defaut=True), -); - -AFFE_MODELE=OPER(nom="AFFE_MODELE",op=18,sd_prod=myModel, - UIinfo={"groupes":("Group1",)}, - ang="Model mesh definition EN", - reentrant='n', - regles=(AU_MOINS_UN('APPROVED')), - MESH=SIMP(statut='o',typ='TXM',into=mySeveral("mesh_",4) ,defaut="mesh_01"), - APPROVED=SIMP(statut="f", typ=bool), # presence of this item will validate the whole group - PAR_LOT=SIMP(ang="Debut Par Lot help En",statut='o',typ='I', defaut=True), - block_mesh_01=myBloc(1), - block_mesh_02=myBloc(2), - block_mesh_03=myBloc(3), - block_mesh_04=myBloc(4), -) - - -FIN=PROC(nom="FIN",op=9999,repetable='n',ang="Finish help EN",UIinfo={"groupes":("Group1",)}, - FORMAT_HDF =SIMP(ang="Save HDF EN",statut='f',typ='TXM',defaut="NON",into=("OUI","NON",) ), -); - -Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','AFFE_MODELE','FIN') - -Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','AFFE_MODELE','FIN') diff --git a/MED/Many_Concepts_52992_Cata.py b/MED/Many_Concepts_52992_Cata.py deleted file mode 100644 index 13145b96..00000000 --- a/MED/Many_Concepts_52992_Cata.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -from Accas import * - -#class myMesh(ASSD): pass -class myModel(ASSD): pass - -JdC = JDC_CATA(code='PATTERNS', - execmodul=None, - regles=(AU_PLUS_UN('DEBUT', 'POURSUITE'), - AU_PLUS_UN('AFFE_MODELE'), - AU_PLUS_UN('FIN'), - A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN'))) - -def mySeveral(suffix,num): - out=list() - for i in range(1,num+1): - out.append(suffix+str(i).zfill(2)) - return out - -switch_facultatif=True #change 'o' to 'f' of some widgets in the loop -#empty_defauts=True - -def myBloc(num): - myNum=str(num).zfill(2) - list_item_body="Item_"+myNum+"_" - defauts0=["","",True,"'phenomena_"+myNum+"'",mySeveral(list_item_body,2)] #presence of default values - defauts_mask=[False,False,True,True,False] #switch off defaults of some types - defauts=list() - for id0 in range(len(defauts0)): - if defauts_mask[id0]: - item=", defaut="+str(defauts0[id0]) - else: - item="" - defauts.append(item) - #print defauts - - opt=['o','o','o','o','o'] #initial default obligation of items in FACT groups - #make different widgets optional, one by one: - myLen=len(opt) - if switch_facultatif: - make_f=(num)%myLen - opt[make_f]='f' - #print opt - #if empty_defauts: - # clean_defaut=num%myLen - - myString="BLOC(condition=\"MESH==\'mesh_"+myNum+"'\""+defauts[0]+", AFFE=FACT(statut='"+opt[1]+"'"+defauts[1]+", ALL=SIMP(statut='"+opt[2]+"', typ=bool,ang='ALL "+myNum+" help EN'"+defauts[2]+"),PHENOMENA=SIMP(statut='"+opt[3]+"',typ='TXM',into=mySeveral('phenomena_',"+str(num)+")"+defauts[3]+"), MODELISATION=SIMP(statut='"+opt[4]+"',typ='TXM', min=4,max='**',into=mySeveral('"+list_item_body+"',"+str(num*4)+")"+defauts[4]+", ang='Input "+myNum+" list EN', fr='Input "+myNum+" list FR'),),)" - print myString - return eval(myString) - -DEBUT=PROC(nom="DEBUT", op=10, repetable='n', UIinfo={"groupes":("Group1",)}, ang="Debut Eng help", - PAR_LOT=SIMP(ang="Debut Par Lot help En",statut='o',typ=bool, defaut=True), -); - -AFFE_MODELE=OPER(nom="AFFE_MODELE",op=18,sd_prod=myModel, - UIinfo={"groupes":("Group1",)}, - ang="Model mesh definition EN", - reentrant='n', - regles=(AU_MOINS_UN('APPROVED')), - MESH=SIMP(statut='o',typ='TXM',into=mySeveral("mesh_",4) ,defaut="mesh_01"), - APPROVED=SIMP(statut="f", typ=bool), # presence of this item will validate the whole group - block_mesh_01=myBloc(1), - block_mesh_02=myBloc(2), - block_mesh_03=myBloc(3), - block_mesh_04=myBloc(4), -) - - -FIN=PROC(nom="FIN",op=9999,repetable='n',ang="Finish help EN",UIinfo={"groupes":("Group1",)}, - FORMAT_HDF =SIMP(ang="Save HDF EN",statut='f',typ='TXM',defaut="NON",into=("OUI","NON",) ), -); - -Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','AFFE_MODELE','FIN') - -Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','AFFE_MODELE','FIN') diff --git a/MED/Matrix_Cata.py b/MED/Matrix_Cata.py deleted file mode 100644 index 0e47d7b1..00000000 --- a/MED/Matrix_Cata.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 -from Accas import * - -class loi ( ASSD ) : pass -class variable ( ASSD ) : pass - -class Matrice: - def __init__(self,nbLigs=None,nbCols=None,methodeCalculTaille=None,formatSortie="ligne",valSup=None,valMin=None,structure=None): - self.nbLigs=nbLigs - self.nbCols=nbCols - self.methodeCalculTaille=methodeCalculTaille - self.formatSortie=formatSortie - self.valSup=valSup - self.valMin=valMin - self.structure=structure - - def __convert__(self,valeur): - # Attention ne verifie pas grand chose - if type(valeur) != types.ListType : - return None - return valeur - - def info(self): - return "Matrice %s x %s" % (self.nbLigs, self.nbCols) - - __repr__=info - __str__=info - - - -class myModel(ASSD): pass - -JdC = JDC_CATA(code='PATTERNS', - execmodul=None, - regles=(AU_MOINS_UN ( 'CORRELATION' ), - ) -) - -DETERMINISTICVARIABLE = OPER ( nom = "DETERMINISTICVARIABLE", - sd_prod = variable, - op = None, - fr = "Variable deterministe", - ang = "Deterministic variable", - - N = SIMP ( statut = 'o', typ = "TXM", fr = "Nom", ang = "Name", defaut = "Var1" ), - T = SIMP ( statut = 'o', defaut = "in", into = ( "in" , "out", ), typ = "TXM", fr = "Type", ang = "Type" ), - R = SIMP ( statut = 'o', defaut = 0, typ = "I", fr = "Rang", ang = "Rank" ), -) - -DISTRIBUTION = OPER ( nom = "DISTRIBUTION", - sd_prod = loi, - op = 68, - fr = "Definitions des lois marginales utilisees par les variables d'entree", - - R = SIMP ( statut = "o", typ = "R", max = 1, val_min = 0., fr = "Parametre R de la loi | R > 0", ang = "R parameter | R > 0", defaut = 0.5 ), - # T > R - T = SIMP ( statut = "o", typ = "R", max = 1, val_min = 0., fr = "Parametre T de la loi | T > R", ang = "T parameter | T > R", defaut = 0.7 ), - A = SIMP ( statut = "o", typ = "R", max = 1, fr = "Borne inferieure du support de la loi", ang = "Support lower bound", defaut = 0.1 ), - # B > A - B = SIMP ( statut = "o", typ = "R", max = 1, fr = "Borne superieure du support de la loi", ang = "Support upper bound", defaut = 0.3 ), -) - -VARIABLE = PROC ( nom = "VARIABLE", - op = None, - docu = "", - fr = "Variable probabiliste", - ang = "Probabilistic variable", - - ModelVariable = SIMP ( statut = "o", typ = ( variable, ), fr = "Variable d'entrée du modèle", ang = "Input variable of the model" ), - Distribution = SIMP ( statut = "o", typ = ( loi, ), fr = "Modélisation probabiliste", ang = "Probabilistic modelisation" ), -) - -CORRELATION = PROC ( nom = 'CORRELATION', - op = None, - docu = "", - fr = "Correlation entre variables", - ang = "Variable correlation", - - CorrelationMatrix = SIMP ( statut = "o", typ = Matrice(nbLigs=None, - nbCols=None, - methodeCalculTaille='nbDeVariables', - valSup=1, - valMin=-1, - structure="symetrique"), - fr = "Matrice de correlation entre les variables d'entree", - ang = "Correlation matrix for input variables" ), -) diff --git a/MED/Nested_Cond_52945_Cata.py b/MED/Nested_Cond_52945_Cata.py deleted file mode 100644 index 9d3b119d..00000000 --- a/MED/Nested_Cond_52945_Cata.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -from Accas import * - -class loi(): pass - -JdC = JDC_CATA (code = 'PATTERNS', - execmodul = None, - ) -use_and=False #switch off second condition about MAX_ROWS while it does not work for blocks greater than 2 -def cond2(myMax=False): - if use_and: - if myMax: - out= " and MAX_ROWS>="+str(myMax) - else: - out="" - else: - out="" - print out - return out - -PROC_01 = PROC(nom = "PROC_01",op = None, ang="Help for PROC_01 EN", - MAX_ROWS=SIMP(statut='o',typ='I',val_min=1,val_max=8, defaut=8), - PROCGROUP1=SIMP(statut='o',typ='TXM',into=("1A","2A","add new row",)), - wideblock1=BLOC(condition='PROCGROUP1=="add new row"'+cond2(1), - PROCGROUP2=SIMP(statut='o',typ='TXM',into=("1A","add new row","3A",)), - wideblock2=BLOC(condition='PROCGROUP2=="add new row"'+cond2(2), - PROCGROUP3=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), - PROCGROUP689=SIMP(statut='o',typ='TXM',), - wideblock3=BLOC(condition='PROCGROUP3=="add new row"'+cond2(3), - PROCGROUP4=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), - wideblock4=BLOC(condition='PROCGROUP4=="add new row"'+cond2(4), - PROCGROUP5=SIMP(statut='o',typ='TXM',into=("add new row","2","3",)), - wideblock5=BLOC(condition='PROCGROUP5=="add new row"'+cond2(5), - PROCGROUP6=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), - wideblock6=BLOC(condition='PROCGROUP6=="add new row"'+cond2(6), - PROCGROUP7=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), - wideblock7=BLOC(condition='PROCGROUP7=="add new row"'+cond2(7), - PROCGROUP8=SIMP(statut='o',typ='TXM',into=("add new row","2","3",)), - wideblock8=BLOC(condition='PROCGROUP8=="add new row"'+cond2(8), - ) - ) - ) - ) - ) - ) - ) - ) -) - -#LEV1 = OPER( nom = "LEV1", -# sd_prod=loi, -# op=68, -# fr='LEV1 FR', -# Boolean01=SIMP( statut = 'o',typ = bool, defaut=True, fr = 'Bool mandatory FR', ang = 'Bool mandatory EN'), -# SelectedItem=SIMP(statut = 'o',typ = 'TXM', into=["01_01","01_02","01_03","01_04"], fr="FR"), -#) - -Classement_Commandes_Ds_Arbre=('PROC_01',) - -Ordre_Des_Commandes = ('PROC_01',) diff --git a/MED/Nested_Cond_52946_Cata.py b/MED/Nested_Cond_52946_Cata.py deleted file mode 100644 index fef5edf0..00000000 --- a/MED/Nested_Cond_52946_Cata.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -from Accas import * - -class loi(): pass - -JdC = JDC_CATA (code = 'PATTERNS', - execmodul = None, - ) -use_and=True #switch off second condition about MAX_ROWS while it does not work for blocks greater than 2 -def cond2(myMax=False): - if use_and: - if myMax: - out= " and MAX_ROWS>="+str(myMax) - else: - out="" - else: - out="" - print out - return out - -PROC_01 = PROC(nom = "PROC_01",op = None, ang="Help for PROC_01 EN", - MAX_ROWS=SIMP(statut='o',typ='I',val_min=1,val_max=8, defaut=8), - PROCGROUP1=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), - wideblock1=BLOC(condition='PROCGROUP1=="add new row"'+cond2(1), - PROCGROUP2=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), - #wideblock2=BLOC(condition='PROCGROUP2=="add new row"', - wideblock2=BLOC(condition='MAX_ROWS == 8', - #wideblock2=BLOC(condition='PROCGROUP2=="add new row" and (MAX_ROWS > 2)', - PROCGROUP3=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), - wideblock3=BLOC(condition='PROCGROUP3=="add new row"'+cond2(3), - PROCGROUP4=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), - wideblock4=BLOC(condition='PROCGROUP4=="add new row"'+cond2(4), - PROCGROUP5=SIMP(statut='o',typ='TXM',into=("add new row","2","3",)), - wideblock5=BLOC(condition='PROCGROUP5=="add new row"'+cond2(5), - PROCGROUP6=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), - wideblock6=BLOC(condition='PROCGROUP6=="add new row"'+cond2(6), - PROCGROUP7=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), - wideblock7=BLOC(condition='PROCGROUP7=="add new row"'+cond2(7), - PROCGROUP8=SIMP(statut='o',typ='TXM',into=("add new row","2","3",)), - wideblock8=BLOC(condition='PROCGROUP8=="add new row"'+cond2(8), - ) - ) - ) - ) - ) - ) - ) - ) -) - -#LEV1 = OPER( nom = "LEV1", -# sd_prod=loi, -# op=68, -# fr='LEV1 FR', -# Boolean01=SIMP( statut = 'o',typ = bool, defaut=True, fr = 'Bool mandatory FR', ang = 'Bool mandatory EN'), -# SelectedItem=SIMP(statut = 'o',typ = 'TXM', into=["01_01","01_02","01_03","01_04"], fr="FR"), -#) - -Classement_Commandes_Ds_Arbre=('PROC_01',) - -Ordre_Des_Commandes = ('PROC_01',) diff --git a/MED/Nested_Cond_52947_Cata.py b/MED/Nested_Cond_52947_Cata.py deleted file mode 100644 index bf3be39e..00000000 --- a/MED/Nested_Cond_52947_Cata.py +++ /dev/null @@ -1,17 +0,0 @@ -# coding: utf-8 - -from Accas import * - -class loi(): pass - -JdC = JDC_CATA (code = 'PATTERNS', - execmodul = None, - ) - -PROC_01 = PROC(nom = "PROC_01",op = None, ang="Help for PROC_01 EN", - PROCGROUP1=SIMP(statut='o',typ='TXM',into=("a1","a2","a3",)), -) - -Classement_Commandes_Ds_Arbre=('PROC_01',) - -Ordre_Des_Commandes = ('PROC_01',) diff --git a/MED/Nested_Cond_52948_Cata.py b/MED/Nested_Cond_52948_Cata.py deleted file mode 100644 index 81f216f8..00000000 --- a/MED/Nested_Cond_52948_Cata.py +++ /dev/null @@ -1,21 +0,0 @@ -# coding: utf-8 - -from Accas import * - -class loi(ASSD): pass - -JdC = JDC_CATA (code = 'PATTERNS', - execmodul = None, - ) - -PER_01 = OPER( nom = "PER_01", - sd_prod=loi, - op=68, - fr='LEV1 FR', - Boolean01=SIMP( statut = 'o',typ = bool, defaut=True, fr = 'Bool mandatory FR', ang = 'Bool mandatory EN'), - SelectedItem=SIMP(statut = 'o',typ = 'TXM', into=["01_01","01_02","01_03","01_04"], fr="FR"), -) - -#Classement_Commandes_Ds_Arbre=('OPER_01',) - -#Ordre_Des_Commandes = ('OPER_01',) diff --git a/MED/Nested_Cond_52949_Cata.py b/MED/Nested_Cond_52949_Cata.py deleted file mode 100644 index d09011a3..00000000 --- a/MED/Nested_Cond_52949_Cata.py +++ /dev/null @@ -1,19 +0,0 @@ -# coding: utf-8 - -from Accas import * - -JdC = JDC_CATA (code = 'PATTERNS', - execmodul = None, - ) - -PROC_01 = PROC(nom = "PROC_01",op = None, ang="Help for PROC_01 EN", - MAX_ROWS=SIMP(statut='o',typ='I',val_min=1,val_max=8, defaut=8), - PROCGROUP1=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), - wideblock1=BLOC(condition='PROCGROUP1 in "add new row"', - PROCGROUP2=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), - ) -) - -Classement_Commandes_Ds_Arbre=('PROC_01',) - -Ordre_Des_Commandes = ('PROC_01',) diff --git a/MED/Nested_Cond_52952_Cata.py b/MED/Nested_Cond_52952_Cata.py deleted file mode 100644 index 47a8d7c5..00000000 --- a/MED/Nested_Cond_52952_Cata.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -from Accas import * - -class loi(): pass - -JdC = JDC_CATA (code = 'PATTERNS', - execmodul = None, - ) -use_and=False #switch off second condition about MAX_ROWS while it does not work for blocks greater than 2 -def cond2(myMax=False): - if use_and: - if myMax: - out= " and MAX_ROWS>="+str(myMax) - else: - out="" - else: - out="" - #print out - return out - -PROC_01 = PROC(nom = "PROC_01",op = None, ang="Help for PROC_01 EN", - MAX_ROWS=SIMP(statut='o',typ='I',val_min=1,val_max=8, defaut=8), - PROCGROUP1=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), - wideblock1=BLOC(condition='PROCGROUP1=="add new row"'+cond2(1), - PROCGROUP2=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), - wideblock2=BLOC(condition='PROCGROUP2=="add new row"'+cond2(2), - PROCGROUP3=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), - wideblock3=BLOC(condition='PROCGROUP3=="add new row"'+cond2(3), - PROCGROUP4=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), - wideblock4=BLOC(condition='PROCGROUP4=="add new row"'+cond2(4), - PROCGROUP5=SIMP(statut='o',typ='TXM',into=("add new row","2","3",)), - wideblock5=BLOC(condition='PROCGROUP5=="add new row"'+cond2(5), - PROCGROUP6=SIMP(statut='o',typ='TXM',into=("1","2","add new row",)), - wideblock6=BLOC(condition='PROCGROUP6=="add new row"'+cond2(6), - PROCGROUP7=SIMP(statut='o',typ='TXM',into=("1","add new row","3",)), - wideblock7=BLOC(condition='PROCGROUP7=="add new row"'+cond2(7), - PROCGROUP8=SIMP(statut='o',typ='TXM',into=("add new row","2","3",)), - wideblock8=BLOC(condition='PROCGROUP8=="add new row"'+cond2(8), - ) - ) - ) - ) - ) - ) - ) - ) -) - -#LEV1 = OPER( nom = "LEV1", -# sd_prod=loi, -# op=68, -# fr='LEV1 FR', -# Boolean01=SIMP( statut = 'o',typ = bool, defaut=True, fr = 'Bool mandatory FR', ang = 'Bool mandatory EN'), -# SelectedItem=SIMP(statut = 'o',typ = 'TXM', into=["01_01","01_02","01_03","01_04"], fr="FR"), -#) - -Classement_Commandes_Ds_Arbre=('PROC_01',) - -Ordre_Des_Commandes = ('PROC_01',) diff --git a/MED/Separate_Blocks_52958_Cata.py b/MED/Separate_Blocks_52958_Cata.py deleted file mode 100644 index 1327a3fb..00000000 --- a/MED/Separate_Blocks_52958_Cata.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding: utf-8 - -from Accas import * - -JdC = JDC_CATA (code = 'PATTERNS', - execmodul = None, - ) -def several(suffix,num): - out=list() - for i in range(1,num+1): - out.append(suffix+str(i).zfill(2)) - return out - -NUMERICAL_PARAMETERS=PROC(nom = "NUMERICAL_PARAMETERS", op=None, ang="Help for NUMERICAL_PARAMETERS, English version", - #Equations=SIMP(statut = 'o',typ = 'TXM',into=("EF","VF","BS"),defaut="EF"), - Solver_definition=FACT(statut = 'o', - Solver = SIMP(statut = 'o',typ = 'TXM', into=several("Solver_",12), defaut="Solver_06"), - ) -) -PASCALE=PROC(nom = "PASCALE", op=None, ang="Help for NUMERICAL_PARAMETERS, English version", - Equations=SIMP(statut = 'o',typ = 'TXM',into=("EF","VF","BS"),defaut="EF"), - Solver_definition=FACT(statut = 'o', - Solver = SIMP(statut = 'o',typ = 'TXM', into=several("Solver_",12), defaut="Solver_06"), - ) -) - -Classement_Commandes_Ds_Arbre=('NUMERICAL_PARAMETERS',) - -Ordre_Des_Commandes = ('NUMERICAL_PARAMETERS',) diff --git a/MED/Separate_Blocks_52963_Cata.py b/MED/Separate_Blocks_52963_Cata.py deleted file mode 100644 index c115196f..00000000 --- a/MED/Separate_Blocks_52963_Cata.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding: utf-8 - -from Accas import * - -JdC = JDC_CATA (code = 'PATTERNS', - execmodul = None, - ) -def mySeveral(suffix,num): - out=list() - for i in range(1,num+1): - out.append(suffix+str(i).zfill(2)) - return out - -def myFact(num): - myNum=str(num).zfill(2) - list_item_body="Item_"+myNum+"_" - myString="FACT(statut = 'f', List_"+myNum+" = SIMP(statut = 'o',typ = 'TXM', into=mySeveral('"+list_item_body+"',12), defaut='"+list_item_body+myNum+"'),Real_"+myNum+" = SIMP(statut = 'o',typ = 'R', defaut = "+str(num/100.)+", ang='Real "+myNum+" help EN'),Integer_"+myNum+" = SIMP(statut = 'o',typ = 'I', defaut = "+str(100+num)+",ang='Max_Iter "+myNum+" help EN'))" - print myString - return eval(myString) - - -PROC_01=PROC(nom = "PROC_01", op=None, ang="Help for PROC_01, English version",fr="Help for PROC_01, French version", docu="", - Radio_01=SIMP(statut = 'f',typ = 'TXM',into=("EF","VF","BS"),defaut="EF"), - FACT_01=myFact(1), - FACT_02=myFact(2), - FACT_03=myFact(3), - FACT_04=myFact(4), - FACT_05=myFact(5), - FACT_06=myFact(6), - FACT_07=myFact(7), - FACT_08=myFact(8), - FACT_09=myFact(9), - FACT_10=myFact(10), - FACT_11=myFact(11), - FACT_12=myFact(12), -) - -Classement_Commandes_Ds_Arbre=('PROC_01',) - -Ordre_Des_Commandes = ('PROC_01',) diff --git a/MED/Separate_Blocks_52966_Cata.py b/MED/Separate_Blocks_52966_Cata.py deleted file mode 100644 index baef1eb1..00000000 --- a/MED/Separate_Blocks_52966_Cata.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -from Accas import * - -JdC = JDC_CATA (code = 'PATTERNS', - execmodul = None, - ) -def mySeveral(suffix,num): - out=list() - for i in range(1,num+1): - out.append(suffix+str(i).zfill(2)) - return out - -switch_facultatif=False #change 'o' to 'f' of some widgets in the loop - -def myFact(num): - opt=['o','f','o','o'] - if switch_facultatif: - myLen=len(opt) - make_f=(num-1)%myLen - opt[make_f]='f' - #print opt - myNum=str(num).zfill(2) - list_item_body="Item_"+myNum+"_" - myString="FACT(statut = '"+opt[0]+"', List_"+myNum+" = SIMP(statut = '"+opt[1]+"',typ = 'TXM', into=mySeveral('"+list_item_body+"',12), defaut='"+list_item_body+myNum+"'),Real_"+myNum+" = SIMP(statut = '"+opt[2]+"',typ = 'R', defaut = "+str(num/100.)+", ang='Real "+myNum+" help EN'),Integer_"+myNum+" = SIMP(statut = '"+opt[3]+"',typ = 'I', defaut = "+str(100+num)+",ang='Max_Iter "+myNum+" help EN'))" - print myString - return eval(myString) - - -PROC_01=PROC(nom = "PROC_01", op=None, ang="Help for PROC_01, English version",fr="Help for PROC_01, French version", docu="", - Radio_01=SIMP(statut = 'o',typ = 'TXM',into=("EF","VF","BS"),defaut="EF"), - FACT_01=myFact(1), - FACT_02=myFact(2), - FACT_03=myFact(3), - FACT_04=myFact(4), - FACT_05=myFact(5), - FACT_06=myFact(6), - FACT_07=myFact(7), - FACT_08=myFact(8), - FACT_09=myFact(9), - FACT_10=myFact(10), - FACT_11=myFact(11), - FACT_12=myFact(12), -) - -Classement_Commandes_Ds_Arbre=('PROC_01',) - -Ordre_Des_Commandes = ('PROC_01',) diff --git a/MED/Separate_Blocks_52972_Cata.py b/MED/Separate_Blocks_52972_Cata.py deleted file mode 100644 index 88927e49..00000000 --- a/MED/Separate_Blocks_52972_Cata.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -from Accas import * - -JdC = JDC_CATA (code = 'PATTERNS', - execmodul = None, - ) -def mySeveral(suffix,num): - out=list() - for i in range(1,num+1): - out.append(suffix+str(i).zfill(2)) - return out - -switch_facultatif=True #change 'o' to 'f' of some widgets in the loop -empty_defauts=True - -def myFact(num): - myNum=str(num).zfill(2) - list_item_body="Item_"+myNum+"_" - - defauts0=["","'"+list_item_body+myNum+"'", str(num/100.), str(100+num), "'Text_"+myNum+"'" ] #presence of default values - defauts_mask=[False,True,True,False,True] #switch off defaults of some types - defauts=list() - for id0 in range(len(defauts0)): - if defauts_mask[id0]: - item=", defaut="+defauts0[id0] - else: - item="" - defauts.append(item) - print defauts - - opt=['o','o','o','o','o'] #initial default obligation of items in FACT groups - #make some widgets optional: - myLen=len(opt) - if switch_facultatif: - make_f=(num)%myLen - opt[make_f]='f' - #print opt - if empty_defauts: - clean_defaut=num%myLen - - - myString="FACT(statut = '"+opt[0]+"', List_"+myNum+" = SIMP(statut = '"+opt[1]+"',typ = 'TXM', into=mySeveral('"+list_item_body+"',12)"+defauts[1]+"),Real_"+myNum+" = SIMP(statut = '"+opt[2]+"',typ = 'R'"+defauts[2]+", ang='Real "+myNum+" help EN'),Integer_"+myNum+" = SIMP(statut = '"+opt[3]+"',typ = 'I'"+defauts[3]+",ang='Integer "+myNum+" help EN'),Text_"+myNum+" = SIMP(statut = '"+opt[4]+"',typ = 'TXM'"+defauts[4]+",ang='Text "+myNum+" help EN'))" - print myString - return eval(myString) - - -PROC_01=PROC(nom = "PROC_01", op=None, ang="Help for PROC_01, English version",fr="Help for PROC_01, French version", docu="", - Radio_01=SIMP(statut = 'o',typ = 'TXM',into=("EF","VF","BS"),defaut="EF"), - FACT_01=myFact(1), - FACT_02=myFact(2), - FACT_03=myFact(3), - FACT_04=myFact(4), - FACT_05=myFact(5), - #FACT_06=myFact(6), - #FACT_07=myFact(7), - #FACT_08=myFact(8), - #FACT_09=myFact(9), - #FACT_10=myFact(10), - #FACT_11=myFact(11), - #FACT_12=myFact(12), -) - -Classement_Commandes_Ds_Arbre=('PROC_01',) - -Ordre_Des_Commandes = ('PROC_01',) diff --git a/MED/Separate_Blocks_52975_Cata.py b/MED/Separate_Blocks_52975_Cata.py deleted file mode 100644 index 88927e49..00000000 --- a/MED/Separate_Blocks_52975_Cata.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -from Accas import * - -JdC = JDC_CATA (code = 'PATTERNS', - execmodul = None, - ) -def mySeveral(suffix,num): - out=list() - for i in range(1,num+1): - out.append(suffix+str(i).zfill(2)) - return out - -switch_facultatif=True #change 'o' to 'f' of some widgets in the loop -empty_defauts=True - -def myFact(num): - myNum=str(num).zfill(2) - list_item_body="Item_"+myNum+"_" - - defauts0=["","'"+list_item_body+myNum+"'", str(num/100.), str(100+num), "'Text_"+myNum+"'" ] #presence of default values - defauts_mask=[False,True,True,False,True] #switch off defaults of some types - defauts=list() - for id0 in range(len(defauts0)): - if defauts_mask[id0]: - item=", defaut="+defauts0[id0] - else: - item="" - defauts.append(item) - print defauts - - opt=['o','o','o','o','o'] #initial default obligation of items in FACT groups - #make some widgets optional: - myLen=len(opt) - if switch_facultatif: - make_f=(num)%myLen - opt[make_f]='f' - #print opt - if empty_defauts: - clean_defaut=num%myLen - - - myString="FACT(statut = '"+opt[0]+"', List_"+myNum+" = SIMP(statut = '"+opt[1]+"',typ = 'TXM', into=mySeveral('"+list_item_body+"',12)"+defauts[1]+"),Real_"+myNum+" = SIMP(statut = '"+opt[2]+"',typ = 'R'"+defauts[2]+", ang='Real "+myNum+" help EN'),Integer_"+myNum+" = SIMP(statut = '"+opt[3]+"',typ = 'I'"+defauts[3]+",ang='Integer "+myNum+" help EN'),Text_"+myNum+" = SIMP(statut = '"+opt[4]+"',typ = 'TXM'"+defauts[4]+",ang='Text "+myNum+" help EN'))" - print myString - return eval(myString) - - -PROC_01=PROC(nom = "PROC_01", op=None, ang="Help for PROC_01, English version",fr="Help for PROC_01, French version", docu="", - Radio_01=SIMP(statut = 'o',typ = 'TXM',into=("EF","VF","BS"),defaut="EF"), - FACT_01=myFact(1), - FACT_02=myFact(2), - FACT_03=myFact(3), - FACT_04=myFact(4), - FACT_05=myFact(5), - #FACT_06=myFact(6), - #FACT_07=myFact(7), - #FACT_08=myFact(8), - #FACT_09=myFact(9), - #FACT_10=myFact(10), - #FACT_11=myFact(11), - #FACT_12=myFact(12), -) - -Classement_Commandes_Ds_Arbre=('PROC_01',) - -Ordre_Des_Commandes = ('PROC_01',) diff --git a/MED/a b/MED/a deleted file mode 100644 index 0018d1d5..00000000 --- a/MED/a +++ /dev/null @@ -1,110 +0,0 @@ -ESSAI_FACT=OPER(nom="ESSAI_FACT", - sd_prod=ObjetUtilisateur, - op=None, - fr=tr("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= ma ,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= tr("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= ma ,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=ma ,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=table_sdaster), - 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=tr("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 = tr("Noeud: 3 valeurs (triangulaire supérieure par colonne)"), - regles = (UN_PARMI('Maille','GroupeMailles','Noeud','GROUP_NO'),), - Noeud = SIMP(statut='f',typ=no ,validators=NoRepeat(),max='**'), - GROUP_NO = SIMP(statut='f',typ=grno,validators=NoRepeat(),max='**'), - Maille = SIMP(statut='f',typ=ma ,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/MED/cata_diapo.py b/MED/cata_diapo.py deleted file mode 100644 index 0c5268ef..00000000 --- a/MED/cata_diapo.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding: utf-8 - -from Accas import * -class Tuple: - def __init__(self,ntuple): - self.ntuple=ntuple - - def __convert__(self,valeur): - import types - 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 - - __repr__=info - __str__=info - - - -class forme ( ASSD ) : pass - -JdC = JDC_CATA (code = 'MED', - execmodul = None, - ) - -FORME_GEOMETRIQUE=OPER(nom='FORME_GEOMETRIQUE',sd_prod =forme ,op=None, - Forme=SIMP(statut="o",typ='TXM',into=[ 'carre', 'cercle', 'triangle' ],defaut='carre'), - bloc_pour_Carre = BLOC (condition = "Forme=='carre'", - Cote=SIMP(statut="o",typ='I'), ) , # fin bloc_pour_carre - bloc_pour_cercle = BLOC (condition ="Forme=='cercle'", - rayon=SIMP(statut="o",typ='I'), ) , # fin bloc_pour_cercle - - DE_NOMBREUSES_WIDGETS= FACT(statut="o", - Stop_Criteria = SIMP(statut = 'o',typ = Tuple(3),validators = VerifTypeTuple(('R','R','R'))), - Fichier_Med = SIMP( statut = 'o', typ = ('Fichier', 'Med Files (*.med);;All Files (*)',),), - ListeDeChoixPlusGrande=SIMP(statut="o",typ='TXM',into=['a','b,','c','d','e','f','g','h'], - homo="SansOrdreNiDoublon",), - Un_Parametre_Facultatif=SIMP(statut="f",typ='TXM') - - ), - Couleur=SIMP(statut = 'f',typ='TXM'), - Matiere=SIMP(statut = 'f',typ='TXM'), -); - diff --git a/MED/cata_med.py b/MED/cata_med.py deleted file mode 100644 index 4640f81e..00000000 --- a/MED/cata_med.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding: utf-8 - -from Accas import * - -JdC = JDC_CATA (code = 'MED', - execmodul = None, - ) -FAS=PROC(nom='FAS',op=None, - FAMILY_MESH_NAME_REF = FACT(statut='o', max='**', - - NAME=SIMP(statut="o",typ='TXM'), - ELEM=FACT(statut="f", max="**", - NUM=SIMP(statut="o",typ='TXM',), - NAME=SIMP(statut="o",typ='TXM',), - ATT=FACT(statut="f", - NBR=SIMP(statut="o", max=1 , typ = 'I'), - DES=SIMP(statut="o", max="**", typ = 'TXM'), - IDE=SIMP(statut="o", max="**", typ = 'I'), - VAL=SIMP(statut="o", max="**", typ = 'I'), - ), - GRO=FACT(statut="f", - NBR=SIMP(statut="o", max=1 , typ = 'I'), - NOM=SIMP(statut="o", max="**", typ='TXM'), - ), - ), - ), -); - - diff --git a/MED/configuration_MED.py b/MED/configuration_MED.py deleted file mode 100644 index 9a068500..00000000 --- a/MED/configuration_MED.py +++ /dev/null @@ -1,43 +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. -# -# -# ====================================================================== -""" - Ce module sert pour charger les paramètres de configuration d'EFICAS -""" -# Modules Python -from InterfaceQT4 import configuration -import os - - -class CONFIG(configuration.configBase): - - #----------------------------------- - def __init__(self,appli,repIni): - #----------------------------------- - - self.labels_user=['catalogues','lang'] - self.labels_eficas=['lang','rep_cata','catalogues'] - - configuration.configBase.__init__(self,appli,'.Eficas_monCode') - - -def make_config(appli,rep): - return CONFIG(appli,rep) - diff --git a/MED/images/essaiAster.png b/MED/images/essaiAster.png deleted file mode 100644 index d01c5de8..00000000 Binary files a/MED/images/essaiAster.png and /dev/null differ diff --git a/MED/items_integer_space.txt b/MED/items_integer_space.txt deleted file mode 100644 index 8e17136e..00000000 --- a/MED/items_integer_space.txt +++ /dev/null @@ -1,2 +0,0 @@ -"4" "3" "2" "1" -"4" "5" "6" "7" \ No newline at end of file diff --git a/MED/monCode_qtEficas.py b/MED/monCode_qtEficas.py deleted file mode 100755 index 7bbb62b3..00000000 --- a/MED/monCode_qtEficas.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2012 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 Code_Aster -""" -# Modules Python -# Modules Eficas - -import sys,os -sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..')) - -from PyQt4.QtCore import * -import prefs -from InterfaceQT4 import eficas_go -eficas_go.lanceEficas(code=prefs.code) diff --git a/MED/prefs.py b/MED/prefs.py deleted file mode 100644 index 2e9d0a2e..00000000 --- a/MED/prefs.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (C) 2007-2012 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 -# -code="MED" -import sys, os -if os.path.dirname(os.path.abspath(__file__)) not in sys.path : - sys.path.insert(0,os.path.dirname(os.path.abspath(__file__))) diff --git a/MED/prefs_MED.py b/MED/prefs_MED.py deleted file mode 100644 index 2fc3062e..00000000 --- a/MED/prefs_MED.py +++ /dev/null @@ -1,48 +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='en' - -# Codage des strings qui accepte les accents (en remplacement de 'ascii') -encoding='iso-8859-1' -docPath=repIni - -# -catalogues=( - #('med','med',os.path.join(repIni,'cata_med.py'),'dico','python'), - ('med','med',os.path.join(repIni,'CataAZ.py'),'python','python'), -) - -simpleClic=True -nombreDeBoutonParLigne = 4 -dicoImages={ -'CREEOBJET' : os.path.join(repIni,'images/essaiAster.png') -} - diff --git a/MED/prefs_monCode.py b/MED/prefs_monCode.py deleted file mode 100644 index 319c6599..00000000 --- a/MED/prefs_monCode.py +++ /dev/null @@ -1,68 +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='en' - -# Codage des strings qui accepte les accents (en remplacement de 'ascii') -encoding='iso-8859-1' -docPath=repIni - -# -catalogues=( - ('monCode','med',os.path.join(repIni,'CataAZ.py'),'python','python'), -# ('monCode','53036',os.path.join(repIni,'Elementary_Lists_53036_Cata.py'),'dico','python'), -# ('monCode','53033',os.path.join(repIni,'Tuples_Cata.py'),'dico','python'), -# ('monCode','53031',os.path.join(repIni,'Tuples_Cata.py'),'dico','python'), -# ('monCode','53030',os.path.join(repIni,'Tuples_Cata.py'),'dico','python'), -# ('monCode','53020',os.path.join(repIni,'Nested_Cond_52945_Cata.py'),'dico','python'), -# ('monCode','53013',os.path.join(repIni,'Elementary_Lists_53013_Cata.py'),'dico','python'), -# ('monCode','53000',os.path.join(repIni,'Elementary_Lists_53030_Cata.py'),'dico','python'), -# ('monCode','52996',os.path.join(repIni,'Elementary_Lists_52996_Cata.py'),'dico','python'), -# ('monCode','52992',os.path.join(repIni,'Many_Concepts_52992_Cata.py'),'dico','python'), -# ('monCode','52989',os.path.join(repIni,'Many_Concepts_52989_Cata.py'),'dico','python'), -# ('monCode','52988',os.path.join(repIni,'Many_Concepts_52988_Cata.py'),'dico','python'), -# ('monCode','52985',os.path.join(repIni,'fin_52985_Cata.py'),'dico','python'), -# ('monCode','52983',os.path.join(repIni,'Many_Concepts_52983_Cata.py'),'dico','python'), -# ('monCode','52975',os.path.join(repIni,'Separate_Blocks_52975_Cata.py'),'dico','python'), -# ('monCode','52972',os.path.join(repIni,'Separate_Blocks_52972_Cata.py'),'dico','python'), -# ('monCode','52958',os.path.join(repIni,'Separate_Blocks_52958_Cata.py'),'dico','python'), -# ('monCode','52952',os.path.join(repIni,'Nested_Cond_52952_Cata.py'),'dico','python'), -# ('monCode','52949',os.path.join(repIni,'Nested_Cond_52949_Cata.py'),'dico','python'), -# ('monCode','52947',os.path.join(repIni,'Nested_Cond_52947_Cata.py'),'dico','python'), -# ('monCode','52946',os.path.join(repIni,'Nested_Cond_52946_Cata.py'),'dico','python'), -# ('monCode','52945',os.path.join(repIni,'Nested_Cond_52945_Cata.py'),'dico','python'), -# ('monCode','Global',os.path.join(repIni,'Global_Condition_Cata.py'),'dico','python'), -## resolu ('monCode','52948',os.path.join(repIni,'Nested_Cond_52948_Cata.py'),'dico','python'), -# pb d afffichage des optionnels ('monCode','52963',os.path.join(repIni,'Separate_Blocks_52963_Cata.py'),'dico','python'), -# pb d afffichage des optionnels ('monCode','52966',os.path.join(repIni,'Separate_Blocks_52966_Cata.py'),'dico','python'), - -# ('monCode','test',os.path.join(repIni,'monCode_Cata1.py'),'dico','python'), -) - diff --git a/MED/properties.py b/MED/properties.py deleted file mode 100644 index 1d328a46..00000000 --- a/MED/properties.py +++ /dev/null @@ -1,24 +0,0 @@ -#@ MODIF properties Accas DATE 11/06/2008 AUTEUR aster M.ADMINISTRATEUR -# RESPONSABLE D6BHHHH J-P.LEFEBVRE -# ====================================================================== -# COPYRIGHT (C) 1991 - 2001 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. -# ====================================================================== -# IDENTIFICATION DU GESTIONNAIRE DE COMMANDE ACCAS A PARTIR -# DE LA VERSION DU CODE_ASTER ASSOCIE -#---------------------------------------------------------------------- -version = "1.2" -date = "25/05/2010" -exploit = False diff --git a/MED/qtEficas_AZ.py b/MED/qtEficas_AZ.py deleted file mode 100755 index de3797de..00000000 --- a/MED/qtEficas_AZ.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2012 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 Code_Aster -""" -# Modules Python -# Modules Eficas - -import sys,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/MED/qtEficas_Med.py b/MED/qtEficas_Med.py deleted file mode 100755 index de3797de..00000000 --- a/MED/qtEficas_Med.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (C) 2007-2012 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 Code_Aster -""" -# Modules Python -# Modules Eficas - -import sys,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/MED/typescript b/MED/typescript deleted file mode 100644 index f070be17..00000000 --- a/MED/typescript +++ /dev/null @@ -1,34 +0,0 @@ -Le script a débuté sur mar. 29 nov. 2016 15:37:06 CET -]0;A96028@dsp0780471: ~/QT5GitEficasTravail/eficas/monCodeA96028@dsp0780471:~/QT5GitEficasTravail/eficas/monCode$ ./qtEficas_Med.py /tmp/a.commoo.comm -eficas_en /home/A96028/QT5GitEficasTravail/eficas/monCode/../Extensions/../UiQT4 -() -{'typ': 'TXM', 'statut': 'o'} -() -{'typ': 'TXM', 'statut': 'o'} -() -{'typ': 'TXM', 'statut': 'o'} -() -{'max': 1, 'typ': 'I', 'statut': 'o'} -() -{'max': '**', 'typ': 'TXM', 'statut': 'o'} -() -{'max': '**', 'typ': 'I', 'statut': 'o'} -() -{'max': '**', 'typ': 'I', 'statut': 'o'} -() -{'NBR': , 'IDE': , 'DES': , 'VAL': , 'statut': 'f'} -() -{'max': 1, 'typ': 'I', 'statut': 'o'} -() -{'max': '**', 'typ': 'TXM', 'statut': 'o'} -() -{'NOM': , 'NBR': , 'statut': 'f'} -() -{'NAME': , 'statut': 'f', 'max': '**', 'ATT': , 'NUM': , 'GRO': } -() -{'NAME': , 'ELEM': , 'statut': 'o'} -() -{'nom': 'FAS', 'FAMILY_MESH_NAME_REF': , 'op': None} -]0;A96028@dsp0780471: ~/QT5GitEficasTravail/eficas/monCodeA96028@dsp0780471:~/QT5GitEficasTravail/eficas/monCode$ exit - -Script terminé sur mar. 29 nov. 2016 15:37:13 CET diff --git a/MT/MT_Cata_V2017.py b/MT/MT_Cata_V2017.py index f4d252b5..26d53b97 100755 --- a/MT/MT_Cata_V2017.py +++ b/MT/MT_Cata_V2017.py @@ -22,9 +22,6 @@ - - - from Accas import * # @@ -161,7 +158,11 @@ ZONE = MACRO(nom = 'ZONE', reentrant = 'n', UIinfo = {"groupes":("Machine tournante",)}, fr = "Description d'une zone (comportant noeuds et elements, et en option masses ponctuelles et fissures)", - regles = (AU_MOINS_UN("ELEMENTS")), + fenetreIhm='deplie1Niveau', + #regles = (AU_MOINS_UN("ELEMENTS")), + regles=(AU_MOINS_UN('A1','B'),), + A1=SIMP(statut='f',typ='TXM',), + B=SIMP(statut='f',typ='TXM',), MASSE = FACT(statut='f', min=0, max='**', diff --git a/MT/mesScripts_MT.py b/MT/mesScripts_MT.py index 010ea2d6..329f8f8a 100644 --- a/MT/mesScripts_MT.py +++ b/MT/mesScripts_MT.py @@ -52,6 +52,12 @@ def import_zone(listeparam): oldItem.select() oldItem.supprimeNoeud() +def import_zone_from_menu(editor,etape): + texte="ZONE(NOEUDS=(_F(NOM='N1',POSITION_AXIALE=0.0,), _F(NOM='N2',POSITION_AXIALE=0.1,), _F(NOM='N3',POSITION_AXIALE=0.2,), _F(NOM='N4',POSITION_AXIALE=0.3,),),)," + retour = editor.updateJdcAfterEtape(etape,texte) + +def import_ligne(listeparam): + print ('in import_ligne') # le dictionnaire des commandes a la structure suivante : # la clef est la commande qui va proposer l action @@ -68,3 +74,21 @@ dict_commandes={ (view_zone,"View",('item',),False,True,"affiche dans Geom la representation de la zone "), (import_zone,"import_zone",('editor','self'),False,False,"import de fichier zone"),) } + +# le dictionnaire des menus a la structure suivante +# la clef qui est le titre du menu +# (pour l instant 1 seul menu) --> devlop si besoin de plusieurs menus +# une liste de tuple +# + +# Chaque tuple contient +# - la fonction a appeler +# - le label dans le menu +# - un tuple contenant les parametres attendus par la fonction +dict_menu = { + 'Ajout Elts' : ( + #(import_zone,"import_zone",('editor','self'),False,False,"import de fichier zone"), + (import_zone_from_menu,"import_zone",('editor','etapeCourante'),), + (import_ligne,"import_ligne",('editor','etapeCourante'),), + ) + } diff --git a/MT/prefs_MT.py b/MT/prefs_MT.py index 7d55a9eb..e452cfa0 100644 --- a/MT/prefs_MT.py +++ b/MT/prefs_MT.py @@ -37,7 +37,7 @@ encoding='iso-8859-1' catalogues=( ('MT','V2017',os.path.join(repIni,'MT_Cata_V2017.py'),'python','python'), ) -#nombreDeBoutonParLigne=4 +nombreDeBoutonParLigne=4 simpleClic=True closeFrameRechercheCommande=True boutonDsMenuBar=True diff --git a/Noyau/N_BLOC.py b/Noyau/N_BLOC.py index e33b077a..e1b24e8f 100644 --- a/Noyau/N_BLOC.py +++ b/Noyau/N_BLOC.py @@ -70,6 +70,7 @@ class BLOC(N_ENTITE.ENTITE): self.fr = fr self.ang = ang self.docu = docu + self.fenetreIhm=None if type(regles) == tuple: self.regles = regles else: diff --git a/Noyau/N_FACT.py b/Noyau/N_FACT.py index 58993e13..721f76d0 100644 --- a/Noyau/N_FACT.py +++ b/Noyau/N_FACT.py @@ -54,7 +54,7 @@ class FACT(N_ENTITE.ENTITE): list_instance = N_MCLIST.MCList label = 'FACT' - def __init__(self, fr="", docu="", regles=(), statut='f', defaut=None,ang="", + def __init__(self, fr="", docu="", regles=(), statut='f', defaut=None,ang="",fenetreIhm=None, min=0, max=1, validators=None, **args): """ Un mot-clé facteur est caractérisé par les attributs suivants : @@ -67,6 +67,7 @@ class FACT(N_ENTITE.ENTITE): - max - position - docu + - fenetreIhm """ N_ENTITE.ENTITE.__init__(self, validators) # Initialisation des attributs @@ -86,6 +87,7 @@ class FACT(N_ENTITE.ENTITE): self.entites = args self.position = None self.affecter_parente() + self.fenetreIhm = fenetreIhm def __call__(self, val, nom, parent): """ diff --git a/Noyau/N_JDC_CATA.py b/Noyau/N_JDC_CATA.py index 99b335a8..6ce9f5c6 100644 --- a/Noyau/N_JDC_CATA.py +++ b/Noyau/N_JDC_CATA.py @@ -69,6 +69,7 @@ class JDC_CATA(N_ENTITE.ENTITE): # courant à None CONTEXT.unsetCurrentCata() CONTEXT.setCurrentCata(self) + self.fenetreIhm=None def __call__(self, procedure=None, cata=None, cata_ord_dico=None, nom='SansNom', parent=None, **args): diff --git a/Noyau/N_MACRO.py b/Noyau/N_MACRO.py index 0dfda4e5..a80f98e4 100644 --- a/Noyau/N_MACRO.py +++ b/Noyau/N_MACRO.py @@ -87,7 +87,7 @@ class MACRO(N_ENTITE.ENTITE): nommage = nommage def __init__( - self, nom, op, sd_prod=None, reentrant='n', repetable='o', fr="",ang="", + self, nom, op, sd_prod=None, reentrant='n', repetable='o', fr="",ang="",fenetreIhm=None, docu="", regles=(), op_init=None, niveau = None, fichier_ini=0, UIinfo=None, **args): """ Méthode d'initialisation de l'objet MACRO. Les arguments sont utilisés pour initialiser @@ -113,6 +113,7 @@ class MACRO(N_ENTITE.ENTITE): self.ang=ang self.repetable = repetable self.docu = docu + self.fenetreIhm=fenetreIhm if type(regles) == tuple: self.regles = regles else: diff --git a/Noyau/N_OPER.py b/Noyau/N_OPER.py index 988d9ffa..0ab3f555 100644 --- a/Noyau/N_OPER.py +++ b/Noyau/N_OPER.py @@ -86,7 +86,7 @@ class OPER(N_ENTITE.ENTITE): label = 'OPER' nommage = nommage - def __init__(self, nom, op, sd_prod, reentrant='n', repetable='o', fr="",ang="", + def __init__(self, nom, op, sd_prod, reentrant='n', repetable='o', fr="",ang="",fenetreIhm=None, docu="", regles=(), op_init=None, niveau = None, UIinfo=None, **args): """ Méthode d'initialisation de l'objet OPER. Les arguments sont utilisés pour initialiser @@ -100,6 +100,7 @@ class OPER(N_ENTITE.ENTITE): self.ang = ang self.repetable = repetable self.docu = docu + self.fenetreIhm= fenetreIhm if type(regles) == tuple: self.regles = regles else: diff --git a/Noyau/N_PROC.py b/Noyau/N_PROC.py index 4547dcfd..97c120df 100644 --- a/Noyau/N_PROC.py +++ b/Noyau/N_PROC.py @@ -71,6 +71,8 @@ class PROC(N_ENTITE.ENTITE): rangés par niveau. Ils apparaissent alors exclusivement dans leur niveau de rangement. Si niveau vaut None, l'opérateur est rangé au niveau global. + - fenetreIhm : specification de la fenetre + - entites : dictionnaire dans lequel sont stockés les sous entités de l'opérateur. Il s'agit des entités de définition pour les mots-clés : FACT, BLOC, SIMP. Cet attribut est initialisé avec args, c'est à dire les arguments d'appel restants. @@ -80,29 +82,30 @@ class PROC(N_ENTITE.ENTITE): class_instance = N_PROC_ETAPE.PROC_ETAPE label = 'PROC' - def __init__(self, nom, op=None, reentrant='n', repetable='o', fr="",ang="", + def __init__(self, nom, op=None, reentrant='n', repetable='o', fr="",ang="", fenetreIhm=None, docu="", regles=(), op_init=None, niveau = None, UIinfo=None, **args): """ Méthode d'initialisation de l'objet PROC. Les arguments sont utilisés pour initialiser les attributs de meme nom """ - self.nom = nom - self.op = op - self.reentrant = reentrant - self.repetable = repetable - self.fr = fr + self.nom = nom + self.op = op + self.reentrant = reentrant + self.repetable = repetable + self.fenetreIhm = fenetreIhm + self.fr = fr #self.ang="" - self.ang=ang - self.docu = docu + self.ang = ang + self.docu = docu if type(regles) == tuple: self.regles = regles else: self.regles = (regles,) # Attribut op_init : Fonction a appeler a la construction de l # operateur sauf si == None - self.op_init = op_init - self.entites = args - current_cata = CONTEXT.getCurrentCata() + self.op_init = op_init + self.entites = args + current_cata = CONTEXT.getCurrentCata() if niveau == None: self.niveau = None current_cata.enregistre(self) diff --git a/Noyau/N_SIMP.py b/Noyau/N_SIMP.py index ea63e983..e9cb4986 100644 --- a/Noyau/N_SIMP.py +++ b/Noyau/N_SIMP.py @@ -49,7 +49,7 @@ class SIMP(N_ENTITE.ENTITE): def __init__(self, typ,ang="", fr="", statut='f', into=None, intoSug = None,siValide = None, defaut=None, min=1, max=1, homo=1, position='local', val_min=float('-inf'), val_max=float('inf'), docu="", validators=None, - sug=None): + sug=None,fenetreIhm=None): """ Un mot-clé simple est caractérisé par les attributs suivants : - type : cet attribut est obligatoire et indique le type de valeur attendue @@ -60,13 +60,14 @@ class SIMP(N_ENTITE.ENTITE): - defaut : valeur par défaut - min : nombre minimal de valeurs - max : nombre maximal de valeurs - - homo : ? + - homo : un certatin nb de choses qui il faut redispacher ailleurs (information, constant) - ang : doc - position : si global, le mot-clé peut-être lu n'importe où dans la commande - val_min : valeur minimale autorisée - val_max : valeur maximale autorisée - - docu : ? - - sug : ? + - docu : clef sur de la documentation utilisateur + - sug : valeur suggere + - fenetreIhm=None """ N_ENTITE.ENTITE.__init__(self, validators) # Initialisation des attributs @@ -93,6 +94,7 @@ class SIMP(N_ENTITE.ENTITE): if self.val_max == '**' : self.val_max = float('inf') if self.min == '**' : self.min = float('-inf') if self.val_min == '**' : self.val_min = float('-inf') + self.fenetreIhm=fenetreIhm def verifCata(self): """ diff --git a/Telemac/prefs_TELEMAC.py b/Telemac/prefs_TELEMAC.py index 2994e140..e5a1a4ae 100644 --- a/Telemac/prefs_TELEMAC.py +++ b/Telemac/prefs_TELEMAC.py @@ -52,3 +52,4 @@ mode_nouv_commande="figee" affiche = "ordre" translatorFichier = os.path.join(repIni,'labelCataToIhm') closeFrameRecherche=True +differencieSiDefaut = True diff --git a/Traducteur/movemocle.py b/Traducteur/movemocle.py index 5641d36f..d75ae999 100644 --- a/Traducteur/movemocle.py +++ b/Traducteur/movemocle.py @@ -214,7 +214,7 @@ def moveMCFToCommand(jdc,command,factsource,commandcible,factcible): jdcSet.add(commandcible) #----------------------------------------------------- -def fusionMotCleToFact(jdc,command,liste_mc,factcible,defaut=0): +def fusionMotCleToFact(jdc,command,listeMc,factcible,defaut=0): #----------------------------------------------------- if command not in jdcSet : return boolChange=0 @@ -225,7 +225,7 @@ def fusionMotCleToFact(jdc,command,liste_mc,factcible,defaut=0): list_val=[] trouveUnMC=0 for mc in c.childNodes: - if mc.name not in liste_mc : continue + if mc.name not in listeMc : continue val=mc.getText(jdc).split("=")[1].split(",")[0] list_val.append(val) trouveUnMC=1 @@ -238,12 +238,12 @@ def fusionMotCleToFact(jdc,command,liste_mc,factcible,defaut=0): boolChange=1 if boolChange : jdc.reset(jdc.getSource()) - for mc in liste_mc : + for mc in listeMc : removemocle.removeMotCle(jdc,command,mc) jdc.reset(jdc.getSource()) #----------------------------------------------------- -def fusionMotCleInFact(jdc,command,fact,liste_mc,new_name,defaut=0): +def fusionMotCleInFact(jdc,command,fact,listeMc,new_name,defaut=0): #----------------------------------------------------- if command not in jdcSet : return boolChange=0 @@ -257,7 +257,7 @@ def fusionMotCleInFact(jdc,command,fact,liste_mc,new_name,defaut=0): if mcF.name != fact: continue for ll in mcF.childNodes[:]: for mc in ll.childNodes: - if mc.name not in liste_mc : continue + if mc.name not in listeMc : continue val=mc.getText(jdc).split("=")[1].split(",")[0] list_val.append(val) trouveUnMC=1 @@ -268,12 +268,12 @@ def fusionMotCleInFact(jdc,command,fact,liste_mc,new_name,defaut=0): boolChange=1 if boolChange : jdc.reset(jdc.getSource()) - for mc in liste_mc : + for mc in listeMc : removemocle.removeMotCleInFact(jdc,command,fact,mc) jdc.reset(jdc.getSource()) #----------------------------------------------------- -def fusionMCFToMCF(jdc,command,liste_mcf,factcible,defaut=0): +def fusionMCFToMCF(jdc,command,listeMcF,factcible,defaut=0): #----------------------------------------------------- if command not in jdcSet : return boolChange=0 @@ -287,7 +287,7 @@ def fusionMCFToMCF(jdc,command,liste_mcf,factcible,defaut=0): esp1=' '*len(TexteMC) pp=0 for mcF in c.childNodes: - if mcF.name not in liste_mcf : continue + if mcF.name not in listeMcF : continue trouveUnMC=1 val=mcF.getText(jdc) # esp=esp1+(inseremocle.chercheDebutFacteur(jdc,mcF)-len(mcF.name))*' ' @@ -312,7 +312,7 @@ def fusionMCFToMCF(jdc,command,liste_mcf,factcible,defaut=0): boolChange=1 if boolChange : jdc.reset(jdc.getSource()) - for mcF in liste_mcf : + for mcF in listeMcF : removemocle.removeMotCle(jdc,command,mcF) jdc.reset(jdc.getSource()) diff --git a/Traducteur/traduitV11V12.py b/Traducteur/traduitV11V12.py index 688227c9..37212deb 100755 --- a/Traducteur/traduitV11V12.py +++ b/Traducteur/traduitV11V12.py @@ -323,9 +323,9 @@ def traduc(infile,outfile,flog=None): removeMotCleInFact(jdc,"DEFI_MATERIAU","UMAT","NB_VALE",pasDeRegle(),0) removeMotCleInFact(jdc,"DEFI_MATERIAU","UMAT_FO","NB_VALE",pasDeRegle(),0) - liste_mc=["C"+str(i) for i in range(1,198)] - fusionMotCleInFact(jdc,"DEFI_MATERIAU","UMAT",liste_mc,"LISTE_COEF") - fusionMotCleInFact(jdc,"DEFI_MATERIAU","UMAT_FO",liste_mc,"LISTE_COEF") + listeMc=["C"+str(i) for i in range(1,198)] + fusionMotCleInFact(jdc,"DEFI_MATERIAU","UMAT",listeMc,"LISTE_COEF") + fusionMotCleInFact(jdc,"DEFI_MATERIAU","UMAT_FO",listeMc,"LISTE_COEF") removeMotCle(jdc,"DEFI_MATERIAU","LABORD_1D",pasDeRegle(),0) diff --git a/UiQT5/CMakeLists.txt b/UiQT5/CMakeLists.txt index 823e4db3..45e511c9 100644 --- a/UiQT5/CMakeLists.txt +++ b/UiQT5/CMakeLists.txt @@ -70,12 +70,14 @@ eficas_compile_ui ( desWidgetCBIntoSug.ui ) eficas_compile_ui ( desWidgetCommentaire.ui ) eficas_compile_ui ( desWidgetDate.ui ) eficas_compile_ui ( desWidgetFact.ui ) -eficas_compile_ui_2 ( desWidgetFactPlie.ui ) +eficas_compile_ui ( desWidgetFactPlie.ui ) +eficas_compile_ui ( desWidgetFactTableau.ui ) eficas_compile_ui ( desWidgetHeure.ui ) eficas_compile_ui ( desWidgetInactif.ui ) eficas_compile_ui ( desWidgetInformation.ui ) eficas_compile_ui ( desWidgetIntoSug.ui ) eficas_compile_ui ( desWidgetMatrice.ui ) +eficas_compile_ui ( desWidgetNiveauFact.ui ) eficas_compile_ui ( desWidgetParam.ui ) eficas_compile_ui ( desWidgetPlusieursBase.ui ) eficas_compile_ui ( desWidgetPlusieursInto.ui ) diff --git a/UiQT5/desWidgetCommande.ui b/UiQT5/desWidgetCommande.ui index ba7ff77c..2e177793 100644 --- a/UiQT5/desWidgetCommande.ui +++ b/UiQT5/desWidgetCommande.ui @@ -631,7 +631,7 @@ border-radius : 12px 669 - + 0 diff --git a/UiQT5/desWidgetFactPlie.ui b/UiQT5/desWidgetFactPlie.ui index bd9e9c30..766ca93b 100644 --- a/UiQT5/desWidgetFactPlie.ui +++ b/UiQT5/desWidgetFactPlie.ui @@ -62,7 +62,8 @@ - ../Editeur/icons/plusnode.png../Editeur/icons/plusnode.png + ../Editeur/icons/plusnode.png + ../Editeur/icons/ast-red-ball.png../Editeur/icons/plusnode.png diff --git a/UiQT5/desWidgetNiveauFact.ui b/UiQT5/desWidgetNiveauFact.ui new file mode 100644 index 00000000..7593f854 --- /dev/null +++ b/UiQT5/desWidgetNiveauFact.ui @@ -0,0 +1,649 @@ + + + WidgetNiveauFact + + + + 0 + 0 + 1353 + 596 + + + + + 0 + 0 + + + + + 0 + 0 + + + + DCommandeUnique + + + + + + background-color : rgb(224,223,222); +font : 'times' 9px + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 130 + + + + + 16777215 + 130 + + + + background-color:rgb(224,223,222) + + + + 2 + + + 3 + + + 2 + + + + + + 0 + 0 + + + + QFrame::Box + + + QFrame::Raised + + + + 0 + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 13 + 20 + + + + + + + + + 17 + 31 + + + + + 21 + 31 + + + + Qt::ClickFocus + + + Affiche le rapport de validité de la commande + + + border : 0px + + + ... + + + + ../../../.designer/Editeur/icons/ast-green-ball.png../../../.designer/Editeur/icons/ast-green-ball.png + + + + 21 + 31 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 13 + 20 + + + + + + + + + 0 + 0 + + + + + 150 + 31 + + + + QFrame::NoFrame + + + QFrame::Raised + + + <html><head/><body><p><span style=" color:#0000ff;">commande </span></p></body></html> + + + + + + + Qt::Horizontal + + + QSizePolicy::Maximum + + + + 2 + 40 + + + + + + + + Qt::Horizontal + + + + 108 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Ignored + + + + 2 + 40 + + + + + + + + 4 + + + QLayout::SetFixedSize + + + + + + 21 + 31 + + + + + 21 + 31 + + + + Qt::ClickFocus + + + Lance un script associé à la commande + + + border : 0px + + + ... + + + + ../../../.designer/Editeur/icons/roue.png../../../.designer/Editeur/icons/roue.png + + + + 21 + 31 + + + + + + + + + 0 + 0 + + + + + 0 + 38 + + + + true + + + + + + + + 21 + 31 + + + + + 31 + 31 + + + + Qt::ClickFocus + + + ouvre un navigateur sur l'aide contextuelle + + + border : 0px + + + ... + + + + ../../../.designer/Editeur/icons/point-interrogation.png../../../.designer/Editeur/icons/point-interrogation.png + + + + 21 + 31 + + + + + + + + + 21 + 31 + + + + + 31 + 31 + + + + Qt::ClickFocus + + + affiche les régles de validité + + + border : 0px + + + ... + + + + ../../../.designer/Editeur/icons/lettreRblanc30.png../../../.designer/Editeur/icons/lettreRblanc30.png + + + + 21 + 31 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 13 + 20 + + + + + + + + + 21 + 31 + + + + + 21 + 31 + + + + Qt::ClickFocus + + + Détruit la commande + + + border : 0px + + + ... + + + + ../../../.designer/Editeur/icons/deleteRond.png../../../.designer/Editeur/icons/deleteRond.png + + + + 21 + 31 + + + + + + RBValide + labelNomCommande + horizontalSpacer_3 + horizontalSpacer_4 + RBPoubelle + horizontalSpacer_5 + horizontalSpacer_7 + + + + + + TextLabel + + + + + + + 0 + + + + + + 0 + 0 + + + + + 60 + 24 + + + + + 60 + 24 + + + + Qt::ClickFocus + + + Affiche le formulaire de la commande précédente + + + background-color:rgb(104,110,149); +color :white; +border-radius : 12px + + + + << + + + Shift+A, Alt+A, Alt+A, Alt+A + + + true + + + true + + + + + + + + 0 + 0 + + + + + 60 + 24 + + + + + 60 + 24 + + + + Qt::ClickFocus + + + Affiche le formulaire de la commande suivante + + + background-color:rgb(104,110,149); +color :white; +border-radius : 12px + + + + >> + + + Shift+A, Alt+A, Alt+A, Alt+A + + + true + + + true + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + + + + + + + 0 + 81 + + + + background : rgb(247,247,247) + + + + + + QFrame::NoFrame + + + Qt::ScrollBarAsNeeded + + + Qt::ScrollBarAsNeeded + + + true + + + + + 0 + 0 + 1353 + 466 + + + + + + + 1 + + + + + + + Qt::Vertical + + + + 20 + 5 + + + + + + + + + + + + qPixmapFromMimeSource + + + MonBoutonValide + QToolButton +
monBoutonValide.h
+
+ + MonLabelClic + QLabel +
monLabelClic.h
+
+
+ + +
diff --git a/Validation/V_MCCOMPO.py b/Validation/V_MCCOMPO.py index f81e6ec2..e943d623 100644 --- a/Validation/V_MCCOMPO.py +++ b/Validation/V_MCCOMPO.py @@ -98,7 +98,7 @@ class MCCOMPO(object): - testglob = booleen 1 si toutes les regles OK, 0 sinon """ # On verifie les regles avec les defauts affectes - dictionnaire = self.dict_mc_presents(restreint='non') + dictionnaire = self.dictMcPresents(restreint='non') texte = [''] testglob = 1 for r in self.definition.regles: @@ -109,7 +109,7 @@ class MCCOMPO(object): texte = os.linesep.join(texte) return texte, testglob - def dict_mc_presents(self, restreint='non'): + def dictMcPresents(self, restreint='non'): """ Retourne le dictionnaire {mocle : objet} construit a partir de self.mc_liste Si restreint == 'non' : on ajoute tous les mots-cles simples du catalogue qui ont diff --git a/convert/parseur_python.py b/convert/parseur_python.py index a52542a5..e3f28ba3 100644 --- a/convert/parseur_python.py +++ b/convert/parseur_python.py @@ -119,14 +119,14 @@ number_kw_pattern=re.compile(r""" ) """,re.VERBOSE|re.MULTILINE) -def construitGenea(texte,liste_mc): +def construitGenea(texte,listeMc): """ Retourne un dictionnaire dont les cles sont des reels et les valeurs sont leurs representations textuelles. Realise un filtrage sur les reels : - Ne garde que les reels pour lesquels str ne donne pas une bonne representation. - - Ne garde que les reels derriere un argument keyword dont le nom est dans liste_mc + - Ne garde que les reels derriere un argument keyword dont le nom est dans listeMc >>> s = '''a=+21.3e-5*85,b=-.1234,c=81.6 , d= -8 , e=_F(x=342.67,y=-1), f=+1.1, g=(1.3,-5,1.54E-3), ... #POMPE_PRIMA._BOUCLE_N._2_ELEMENT_NUMERO:0239 @@ -142,7 +142,7 @@ def construitGenea(texte,liste_mc): #argument keyword mot=m[:-1] else: - if mot not in liste_mc:continue + if mot not in listeMc:continue #valeur key=eval(m) if str(key) != m: d[key]=m diff --git a/generator/oldCodes/generator_ini.py b/generator/oldCodes/generator_ini.py index 3fa2dd9b..f1a60a9d 100644 --- a/generator/oldCodes/generator_ini.py +++ b/generator/oldCodes/generator_ini.py @@ -87,7 +87,7 @@ class IniGenerator(object): Tous les mots-cles facteurs sont convertis en sections Un mot-cle facteur ne peut contenir que des mots-cles simples. Sinon => erreur """ - liste_mcfact=[] + listeMcFact=[] sect_defaut='' if isinstance(obj,MCList): if len(obj.data) > 1: @@ -100,9 +100,9 @@ class IniGenerator(object): if len(mocle.data) > 1: raise EficasException(tr("Pas supporte")) else: - liste_mcfact.append(self.generMCFACT(mocle.data[0])) + listeMcFact.append(self.generMCFACT(mocle.data[0])) elif isinstance(mocle,MCFACT): - liste_mcfact.append(self.generMCFACT(mocle)) + listeMcFact.append(self.generMCFACT(mocle)) elif isinstance(mocle,MCSIMP): sect_defaut=sect_defaut+self.generMCSIMP(mocle) else: @@ -111,7 +111,7 @@ class IniGenerator(object): self.text='' if sect_defaut != '': self.text="[DEFAULT]\n"+sect_defaut - self.text=self.text + ''.join(liste_mcfact,'\n') + self.text=self.text + ''.join(listeMcFact,'\n') return self.text def generMCFACT(self,obj): diff --git a/monCode/Catalogues/Cata_MED_FAM v2.xml b/monCode/Catalogues/Cata_MED_FAM v2.xml new file mode 100755 index 00000000..b11b6367 --- /dev/null +++ b/monCode/Catalogues/Cata_MED_FAM v2.xml @@ -0,0 +1,130 @@ + + + + + + + TXM + + + + + + + + I + + + TXM + + + + DES IDE VAL + + + I + + + TXM + + + I + + + I + + + + + I + + + TXM + + + + + + + + 0 + + + + 0 + + + I + + + + DES IDE VAL + + + I + + + TXM + + + I + + + I + + + + + + + + + + + I + + + TXM + + + + DES IDE VAL + + + I + + + TXM + + + I + + + I + + + + + I + + + TXM + + + + + + + + diff --git a/monCode/Catalogues/Cata_MED_FAM.xml b/monCode/Catalogues/Cata_MED_FAM.xml new file mode 100755 index 00000000..8cd49fb4 --- /dev/null +++ b/monCode/Catalogues/Cata_MED_FAM.xml @@ -0,0 +1,35 @@ + + + + + + TXM + + + TXM + TXM + + DES IDE VAL + I + TXM + I + I + + + I + TXM + + + TXM + + + + TXM + + + + + diff --git a/monCode/Global_Condition_Cata.py b/monCode/Global_Condition_Cata.py deleted file mode 100755 index 02396340..00000000 --- a/monCode/Global_Condition_Cata.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 -from Accas import * -#class myModel(ASSD): pass - -JdC = JDC_CATA(code='GLOB_COND', - execmodul=None, - regles=(AU_PLUS_UN('TYPES',), - AU_PLUS_UN('INITS',), - AU_PLUS_UN('DATAS',), - #A_CLASSER('TYPES','INITS','DATAS') - ) -); - -TYPES=PROC(nom='TYPES',op=None,UIinfo={"groupes":("Global_Workflow",)}, #sd_prod=myModel, - MODE=SIMP( - typ='TXM', - statut='o', - position='global_jdc', - into=("MANUAL","AUTOMATIC","MIXED"), - defaut="AUTOMATIC", - ), -); - -liste_condition=('INITS', 'DATAS') - -INITS=PROC(nom='INITS',op=None,UIinfo={"groupes":("INI_param",)}, - ini_manual=BLOC(condition="MODE == 'MANUAL'", - Informer=SIMP(statut='o',typ='TXM', defaut="INITS MANUAL"), - ), - ini_auto=BLOC(condition="MODE == 'AUTOMATIC'", - Informer=SIMP(statut='o', typ='TXM', defaut="INITS AUTOMATIC",), - ), - ini_mixed=BLOC(condition="MODE == 'MIXED'", - Informer=SIMP(statut='o',typ='TXM', defaut="INITS MIXED",), - ), -); -DATAS=PROC(nom='DATAS',op=None,UIinfo={"groupes":("DATAS",)}, - data_manual=BLOC(condition="MODE == 'MANUAL'", - Informer=SIMP(statut='o',typ='TXM', defaut="DATAS MANUAL", - ), - ), - data_auto=BLOC(condition="MODE == 'AUTOMATIC'", - Informer=SIMP(statut='o', typ='TXM', defaut="DATAS AUTOMATIC", - ), - ), - data_mixed=BLOC(condition="MODE == 'MIXED'", - Informer=SIMP(statut='o',typ='TXM', defaut="DATAS MIXED", - ), - ), -); - -Classement_Commandes_Ds_Arbre=('TYPES','INITS','DATAS') -Ordre_Des_Commandes = ('TYPES','INITS','DATAS') diff --git a/monCode/Many_Concepts_52992_Cata.py b/monCode/Many_Concepts_52992_Cata.py deleted file mode 100644 index 13145b96..00000000 --- a/monCode/Many_Concepts_52992_Cata.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -from Accas import * - -#class myMesh(ASSD): pass -class myModel(ASSD): pass - -JdC = JDC_CATA(code='PATTERNS', - execmodul=None, - regles=(AU_PLUS_UN('DEBUT', 'POURSUITE'), - AU_PLUS_UN('AFFE_MODELE'), - AU_PLUS_UN('FIN'), - A_CLASSER(('DEBUT', 'POURSUITE'), 'FIN'))) - -def mySeveral(suffix,num): - out=list() - for i in range(1,num+1): - out.append(suffix+str(i).zfill(2)) - return out - -switch_facultatif=True #change 'o' to 'f' of some widgets in the loop -#empty_defauts=True - -def myBloc(num): - myNum=str(num).zfill(2) - list_item_body="Item_"+myNum+"_" - defauts0=["","",True,"'phenomena_"+myNum+"'",mySeveral(list_item_body,2)] #presence of default values - defauts_mask=[False,False,True,True,False] #switch off defaults of some types - defauts=list() - for id0 in range(len(defauts0)): - if defauts_mask[id0]: - item=", defaut="+str(defauts0[id0]) - else: - item="" - defauts.append(item) - #print defauts - - opt=['o','o','o','o','o'] #initial default obligation of items in FACT groups - #make different widgets optional, one by one: - myLen=len(opt) - if switch_facultatif: - make_f=(num)%myLen - opt[make_f]='f' - #print opt - #if empty_defauts: - # clean_defaut=num%myLen - - myString="BLOC(condition=\"MESH==\'mesh_"+myNum+"'\""+defauts[0]+", AFFE=FACT(statut='"+opt[1]+"'"+defauts[1]+", ALL=SIMP(statut='"+opt[2]+"', typ=bool,ang='ALL "+myNum+" help EN'"+defauts[2]+"),PHENOMENA=SIMP(statut='"+opt[3]+"',typ='TXM',into=mySeveral('phenomena_',"+str(num)+")"+defauts[3]+"), MODELISATION=SIMP(statut='"+opt[4]+"',typ='TXM', min=4,max='**',into=mySeveral('"+list_item_body+"',"+str(num*4)+")"+defauts[4]+", ang='Input "+myNum+" list EN', fr='Input "+myNum+" list FR'),),)" - print myString - return eval(myString) - -DEBUT=PROC(nom="DEBUT", op=10, repetable='n', UIinfo={"groupes":("Group1",)}, ang="Debut Eng help", - PAR_LOT=SIMP(ang="Debut Par Lot help En",statut='o',typ=bool, defaut=True), -); - -AFFE_MODELE=OPER(nom="AFFE_MODELE",op=18,sd_prod=myModel, - UIinfo={"groupes":("Group1",)}, - ang="Model mesh definition EN", - reentrant='n', - regles=(AU_MOINS_UN('APPROVED')), - MESH=SIMP(statut='o',typ='TXM',into=mySeveral("mesh_",4) ,defaut="mesh_01"), - APPROVED=SIMP(statut="f", typ=bool), # presence of this item will validate the whole group - block_mesh_01=myBloc(1), - block_mesh_02=myBloc(2), - block_mesh_03=myBloc(3), - block_mesh_04=myBloc(4), -) - - -FIN=PROC(nom="FIN",op=9999,repetable='n',ang="Finish help EN",UIinfo={"groupes":("Group1",)}, - FORMAT_HDF =SIMP(ang="Save HDF EN",statut='f',typ='TXM',defaut="NON",into=("OUI","NON",) ), -); - -Classement_Commandes_Ds_Arbre=('DEBUT','MESH_TYPES','AFFE_MODELE','FIN') - -Ordre_Des_Commandes = ('DEBUT','MESH_TYPES','AFFE_MODELE','FIN') diff --git a/monCode/Matrix_Cata.py b/monCode/Matrix_Cata.py deleted file mode 100644 index 268a77bf..00000000 --- a/monCode/Matrix_Cata.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 -from Accas import * - -class loi ( ASSD ) : pass -class variable ( ASSD ) : pass - -class Matrice: - def __init__(self,nbLigs=None,nbCols=None,methodeCalculTaille=None,formatSortie="ligne",valSup=None,valMin=None,structure=None): - self.nbLigs=nbLigs - self.nbCols=nbCols - self.methodeCalculTaille=methodeCalculTaille - self.formatSortie=formatSortie - self.valSup=valSup - self.valMin=valMin - self.structure=structure - - def __convert__(self,valeur): - # Attention ne verifie pas grand chose - if type(valeur) != types.ListType : - return None - return valeur - - def info(self): - return "Matrice %s x %s" % (self.nbLigs, self.nbCols) - - __repr__=info - __str__=info - - - -class myModel(ASSD): pass - -JdC = JDC_CATA(code='PATTERNS', - execmodul=None, - regles=(AU_MOINS_UN ( 'CORRELATION' ), - ) -) - -DETERMINISTICVARIABLE = OPER ( nom = "DETERMINISTICVARIABLE", - sd_prod = variable, - op = None, - fr = "Variable deterministe", - ang = "Deterministic variable", - - N = SIMP ( statut = 'o', typ = "TXM", fr = "Nom", ang = "Name", defaut = "Var1" ), - T = SIMP ( statut = 'o', defaut = "in", into = ( "in" , "out", ), typ = "TXM", fr = "Type", ang = "Type" ), - R = SIMP ( statut = 'o', defaut = 0, typ = "I", fr = "Rang", ang = "Rank" ), -) - -DISTRIBUTION = OPER ( nom = "DISTRIBUTION", - sd_prod = loi, - op = 68, - fr = "Definitions des lois marginales utilisees par les variables d'entree", - - R = SIMP ( statut = "o", typ = "R", max = 1, val_min = 0., fr = "Parametre R de la loi | R > 0", ang = "R parameter | R > 0", defaut = 0.5 ), - # T > R - T = SIMP ( statut = "o", typ = "R", max = 1, val_min = 0., fr = "Parametre T de la loi | T > R", ang = "T parameter | T > R", defaut = 0.7 ), - A = SIMP ( statut = "o", typ = "R", max = 1, fr = "Borne inferieure du support de la loi", ang = "Support lower bound", defaut = 0.1 ), - # B > A - B = SIMP ( statut = "o", typ = "R", max = 1, fr = "Borne superieure du support de la loi", ang = "Support upper bound", defaut = 0.3 ), -) - -VARIABLE = PROC ( nom = "VARIABLE", - op = None, - docu = "", - fr = "Variable probabiliste", - ang = "Probabilistic variable", - - ModelVariable = SIMP ( statut = "o", typ = ( variable, ), fr = "Variable d'entrée du modèle", ang = "Input variable of the model" ), - Distribution = SIMP ( statut = "o", typ = ( loi, ), fr = "Modélisation probabiliste", ang = "Probabilistic modelisation" ), -) - -CORRELATION = PROC ( nom = 'CORRELATION', - op = None, - docu = "", - fr = "Correlation entre variables", - ang = "Variable correlation", - - CorrelationMatrix = SIMP ( statut = "o", typ = Matrice(nbLigs=None, - nbCols=None, - methodeCalculTaille='NbDeVariables', - valSup=1, - valMin=-1, - structure="symetrique"), - fr = "Matrice de correlation entre les variables d'entree", - ang = "Correlation matrix for input variables" ), -) diff --git a/monCode/ModeleEficas/Model Efficas (1.1) v6 ext.xsd b/monCode/ModeleEficas/Model Efficas (1.1) v6 ext.xsd new file mode 100755 index 00000000..22e488ec --- /dev/null +++ b/monCode/ModeleEficas/Model Efficas (1.1) v6 ext.xsd @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + La portée pouurait devenir un attribut de SIMP. Une autre solution consisterait a créer un SIMPG pour distinguer les @nom uniques des SIMP a portée globale des autres. + + + + + + + + + + + + + + La valeur -1 equivaut à oo + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/monCode/ModeleEficas/Model Efficas (1.1) v6.xsd b/monCode/ModeleEficas/Model Efficas (1.1) v6.xsd new file mode 100755 index 00000000..2492a38b --- /dev/null +++ b/monCode/ModeleEficas/Model Efficas (1.1) v6.xsd @@ -0,0 +1,732 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SIMP devrait être selectionné que si .//SIMP[portee='Global'] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SIMP devrait être selectionné que si .//SIMP[portee='Global'] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SIMP devrait être selectionné que si .//SIMP[portee='Global'] + + + + + + + + + + + + + + + + + + + La valeur -1 equivaut à oo + + + + + + + + + + + + + + SIMP devrait être selectionné que si .//SIMP[portee='Global'] + + + + + + + + + + + + + + + + + + + + + + + + La portée pouurait devenir un attribut de SIMP. Une autre solution consisterait a créer un SIMPG pour distinguer les @nom uniques des SIMP a portée globale des autres. + + + + + + + + + + + + + + La valeur -1 equivaut à oo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Référence une position dans un fichier maître contenant une liste de références à des pages de documentations + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/monCode/configuration_MED.py b/monCode/configuration_MED.py new file mode 100644 index 00000000..0ce59dad --- /dev/null +++ b/monCode/configuration_MED.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2008-2016 EDF R&D +# +# This file is part of SALOME ADAO 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 +# + +""" + Ce module sert pour charger les paramètres de configuration d'EFICAS +""" +# Modules Python +import os, sys, string, types, re + + +# Modules Eficas +from InterfaceQT4 import configuration + +# Classe de base permettant de lire, afficher +# et sauvegarder les fichiers utilisateurs + +class CONFIG(configuration.configBase): + + def __init__(self,appli,repIni): + + self.labels_eficas=['lang','rep_cata','catalogues','closeAutreCommande','closeFrameRechercheCommande','closeEntete','taille'] + configuration.configBase.__init__(self,appli,repIni) + + self.rep_user = os.environ["HOME"] + self.appli = appli + self.code = appli.code + self.rep_ini = repIni + self.savedir = self.rep_user + +def make_config(appli,rep): + return CONFIG(appli,rep) + diff --git a/monCode/prefs.py b/monCode/prefs.py new file mode 100644 index 00000000..2e9d0a2e --- /dev/null +++ b/monCode/prefs.py @@ -0,0 +1,22 @@ +# Copyright (C) 2007-2012 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 +# +code="MED" +import sys, os +if os.path.dirname(os.path.abspath(__file__)) not in sys.path : + sys.path.insert(0,os.path.dirname(os.path.abspath(__file__))) diff --git a/monCode/prefs_MED.py b/monCode/prefs_MED.py new file mode 100644 index 00000000..1fda3add --- /dev/null +++ b/monCode/prefs_MED.py @@ -0,0 +1,42 @@ +# -*- 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. +# +# +# ====================================================================== + +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='en' + +# Codage des strings qui accepte les accents (en remplacement de 'ascii') +encoding='iso-8859-1' +docPath=repIni + +# +typeDeCata='XML' +catalogues=( + ('med','med',os.path.join(repIni,'cata_med.py'),'dico','xml'), +) + diff --git a/monCode/prefs_monCode.py b/monCode/prefs_monCode.py deleted file mode 100644 index 819a4085..00000000 --- a/monCode/prefs_monCode.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- 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. -# -# -# ====================================================================== - -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='en' - -# Codage des strings qui accepte les accents (en remplacement de 'ascii') -encoding='iso-8859-1' -docPath=repIni -fileName="docMonCode.png" -image=1 - -# -catalogues=( - ('monCode','53038',os.path.join(repIni,'Matrix_Cata.py'),'dico','python'), - ('monCode','53036',os.path.join(repIni,'Elementary_Lists_53036_Cata.py'),'dico','python'), - ('monCode','53033',os.path.join(repIni,'Tuples_Cata.py'),'dico','python'), - ('monCode','53031',os.path.join(repIni,'Tuples_Cata.py'),'dico','python'), - ('monCode','53030',os.path.join(repIni,'Tuples_Cata.py'),'dico','python'), - ('monCode','53020',os.path.join(repIni,'Nested_Cond_52945_Cata.py'),'dico','python'), - ('monCode','53013',os.path.join(repIni,'Elementary_Lists_53013_Cata.py'),'dico','python'), - ('monCode','53000',os.path.join(repIni,'Elementary_Lists_53030_Cata.py'),'dico','python'), - ('monCode','52996',os.path.join(repIni,'Elementary_Lists_52996_Cata.py'),'dico','python'), - ('monCode','52992',os.path.join(repIni,'Many_Concepts_52992_Cata.py'),'dico','python'), - ('monCode','52989',os.path.join(repIni,'Many_Concepts_52989_Cata.py'),'dico','python'), - ('monCode','52988',os.path.join(repIni,'Many_Concepts_52988_Cata.py'),'dico','python'), - ('monCode','52985',os.path.join(repIni,'fin_52985_Cata.py'),'dico','python'), - ('monCode','52983',os.path.join(repIni,'Many_Concepts_52983_Cata.py'),'dico','python'), - ('monCode','52975',os.path.join(repIni,'Separate_Blocks_52975_Cata.py'),'dico','python'), - ('monCode','52972',os.path.join(repIni,'Separate_Blocks_52972_Cata.py'),'dico','python'), - ('monCode','52958',os.path.join(repIni,'Separate_Blocks_52958_Cata.py'),'dico','python'), - ('monCode','52952',os.path.join(repIni,'Nested_Cond_52952_Cata.py'),'dico','python'), - ('monCode','52949',os.path.join(repIni,'Nested_Cond_52949_Cata.py'),'dico','python'), - ('monCode','52947',os.path.join(repIni,'Nested_Cond_52947_Cata.py'),'dico','python'), - ('monCode','52946',os.path.join(repIni,'Nested_Cond_52946_Cata.py'),'dico','python'), - ('monCode','52945',os.path.join(repIni,'Nested_Cond_52945_Cata.py'),'dico','python'), - ('monCode','Global',os.path.join(repIni,'Global_Condition_Cata.py'),'dico','python'), -# resolu ('monCode','52948',os.path.join(repIni,'Nested_Cond_52948_Cata.py'),'dico','python'), -# pb d afffichage des optionnels ('monCode','52963',os.path.join(repIni,'Separate_Blocks_52963_Cata.py'),'dico','python'), -# pb d afffichage des optionnels ('monCode','52966',os.path.join(repIni,'Separate_Blocks_52966_Cata.py'),'dico','python'), - -# ('monCode','test',os.path.join(repIni,'monCode_Cata1.py'),'dico','python'), -) diff --git a/monCode/qtEficas_Med.py b/monCode/qtEficas_Med.py new file mode 100755 index 00000000..05eaee9a --- /dev/null +++ b/monCode/qtEficas_Med.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2017 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 + +# Modules Eficas +import prefs +name='prefs_'+prefs.code +__import__(name) + +#import sys +#reload(sys) +#sys.setdefaultencoding('latin1') + +from InterfaceQT4 import eficas_go +print eficas_go +eficas_go.lanceEficas(code=prefs.code)