From: pascale.noyret Date: Thu, 20 Apr 2017 08:07:14 +0000 (+0200) Subject: VirtualPolymer X-Git-Tag: V8_3_0~48 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5c6e6d38acf7a079b6fd9543cdf5b8dcb8441416;p=tools%2Feficas.git VirtualPolymer --- diff --git a/VirtualPolymer/Readme.tx b/VirtualPolymer/Readme.tx new file mode 100644 index 00000000..b3d7bd00 --- /dev/null +++ b/VirtualPolymer/Readme.tx @@ -0,0 +1 @@ +source opt/MAP/map-2016.1/share/map/scripts/envMAP.sh diff --git a/VirtualPolymer/VP_Cata_V1.py b/VirtualPolymer/VP_Cata_V1.py new file mode 100644 index 00000000..b51ef136 --- /dev/null +++ b/VirtualPolymer/VP_Cata_V1.py @@ -0,0 +1,413 @@ +# coding: utf-8 +import types +from Accas import * +import sys,os +sys.path.append('/home/A96028/opt/MAP/map-2016.1/lib/python2.7/site-packages/mapy/components/c_pre_polymer_data_management') +sys.path.append('/home/A96028/opt/MAP/map-2016.1/lib/python2.7/site-packages/mapy/virtual_polymer_common') +sys.path.append('/home/A96028/opt/MAP/map-2016.1/lib/python2.7/site-packages/') +import pckdb, class_data, instruction, equation_part, utils + + +monDico= { 'Equation_Liste' : ('initiation', 'propagation', 'termination', 'stabilization'), + 'Modele_TechnicalUse' : ('cable', 'coating', 'pipes'), + } + +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 + +class classeVisuEquation : + def __init__(self,dicoListeAffiche, listEquation, listModele,listPostTraitement): + self.dicoListeAffiche=dicoListeAffiche + self.listEquation=listEquation + self.listModele=listModele + self.listPostTraitement=listPostTraitement + + +def maFunc(): + return ('a1','a2','a3') + +def maFuncWithArg(monMC): + if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return + monMC.dsMaFunct = True + + editor=monMC.jdc.editor + if monMC.valeur == 'POOH->P' : monInto=('a1','a2','a3') + else : monInto=('b1','b2','b3') + + change=editor.changeIntoDefMC('AGING', ('Equation', 'b_approved','b_type_creation','Equation_Modification','Type2'), monInto ) + if change : + print ('j ai change le into') + editor.reCalculeValiditeMCApresChgtInto('AGING', 'Type2', ('Equation', 'b_approved','b_type_creation','Equation_Modification')) + if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau() + + monMC.dsMaFunct = False + +def recupereDicoGenerique(monMC): + if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return + print ('je passe dans la recuperation') + editor=monMC.jdc.editor + valeurDB=editor.getValeur('Equation','Equation_DB',()) + if valeurDB == None : valeurDB=editor.getValeur('Modele','Modele_DB',()) + correspond=pckdb.DBRENAME + if valeurDB != None : + listEquation, listModele,listPostTraitement=pckdb.read_pckdb(correspond[valeurDB]) + monMC.dsMaFunct = False + return listEquation, listModele,listPostTraitement + +def recupereDicoEquation(monMC): + if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return + listEquation, listModele,listePostTraitement=recupereDicoGenerique(monMC) + editor=monMC.jdc.editor + + valeurEquationListe=editor.getValeur('Equation','Equation_Liste',('b_type_show',)) + valeurAgingType=editor.getValeur('Equation','Equation_reaction',('b_type_show','b_reaction_type',)) + if valeurAgingType == None : + valeurAgingType=editor.getValeur('Equation','Equation_reaction',('b_type_show','b_aging_type',)) + if valeurAgingType == None : monMC.dsMaFunct = False; return + + listeEquationPourIhm = [] + listeReprEquationPourIhm = [] + dicoListeAffiche={} + for equation in listEquation : + if valeurEquationListe == 'aging_type' : + if equation.type_vieil == valeurAgingType : + listeEquationPourIhm.append(equation) + listeReprEquationPourIhm.append(equation.representation) + dicoListeAffiche[equation.representation]=equation + else: + if equation.type_react == valeurAgingType : + listeEquationPourIhm.append(equation) + listeReprEquationPourIhm.append(equation.representation) + dicoListeAffiche[equation.representation]=equation + change=editor.changeIntoDefMC('Equation', ('b_type_show','ListeEquation'), listeReprEquationPourIhm ) + if change : + editor.reCalculeValiditeMCApresChgtInto('Equation', 'listeEquation', ('b_type_show',)) + if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau() + editor.maClasseVisuEquation = classeVisuEquation(dicoListeAffiche,listEquation, listModele,listPostTraitement) + monMC.dsMaFunct = False + +def afficheValeurEquation(monMC): + if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return + editor=monMC.jdc.editor + valeur=monMC.valeur + if valeur == None : + monMC.dsMaFunct = False + return + editor.maClasseVisuEquation.valeurEquationChoisie=valeur + monMC.dsMaFunct = False + + +def instancieChemicalFormulation(monMC): + if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return + if monMC.valeur == False : return + + editor=monMC.jdc.editor + if hasattr(editor,'dsMaFunct') and editor.dsMaFunct== True : return + editor.dsMaFunct = True + + print ('ds instancie') + v=editor.maClasseVisuEquation.valeurEquationChoisie + monEquation=editor.maClasseVisuEquation.dicoListeAffiche[v] + type_react=monEquation.type_react + type_vieil=monEquation.type_vieil + print (v, type_react, type_vieil) + #editor.changeIntoMCandSet('Equation', ('b_type_show','b_modification','b_modif','ChemicalFormulation'),( v,),v ) + change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Reaction_Type'),type_react ) + change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Aging_Type'), type_vieil ) + + for index,valeurConstituant in enumerate(monEquation.constituants): + valeurEquation=monEquation.equation[index] + editor.ajoutMC(monMC.etape,'OptionnelConstituant',None,('b_type_show','b_modification','b_modif',)) + print (index,valeurConstituant,valeurEquation) + + #OptionnelConstituant = FACT ( statut = 'f',max = '**', + # Constituant = SIMP (statut = 'o', typ = 'TXM'), + # Differential_Equation = SIMP(statut= 'o',typ= 'TXM'), + for index,valeurConstituant in enumerate(monEquation.const_cine_nom): + valeurArrhe=monEquation.arrhenius[index] + if valeurArrhe : valeurConstanteType='Arrhenius type' + else : valeurConstanteType='non Arrhenius type' + + print (index,valeurConstituant,valeurConstanteType) + #OptionnelleConstante = FACT (statut = 'f', max = '**', + # ConstanteName= SIMP (statut = 'o', typ = 'TXM',), + # ConstanteType = SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'), + change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Commentaire'),monEquation.comment ) + print (monEquation.comment ) + #if change : + if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau() + monMC.dsMaFunct = False + editor.dsMaFunct = False + +# TEMPORAIRE +# TODO TODO TODO +# PNPNPNPNPN + + +maClasseDeModele=class_data.Modele() + +def recupereDicoModele(monMC): + if monMC.valeur == None: return + if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return + print ('je passe dans recupereDicoModele') + listEquation, listModele,listPostTraitement=recupereDicoGenerique(monMC) + editor=monMC.jdc.editor + editor.maClasseVisuEquation = classeVisuEquation({},listEquation, listModele,listPostTraitement) + monMC.dsMaFunct = False + + +def creeListeEquation(monMC): + if monMC.valeur == None: return + if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return + + editor=monMC.jdc.editor +# TEMPORAIRE +# TODO TODO TODO + listeEquationsAAfficher=[] + listeConstantesAAfficher=[] + for index,equation in enumerate( editor.maClasseVisuEquation.listEquation): + if index in maClasseDeModele.equa: + listeEquationsAAfficher.append(equation.representation) + listeConstantesAAfficher.append(equation.const_cine_nom) + + monMC.dsMaFunct = False + + # listeEquation_stabilization=SIMP(statut='o', homo='SansOrdreNiDoublon', max='**', min=0 ), + +def recupereModeleEquation(monMC): + if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return + if monMC.valeur==False : return + editor=monMC.jdc.editor + if hasattr(editor,'dsMaFunct') and editor.dsMaFunct== True : return + + editor.dsMaFunct = True + dicoListeEquationAAfficher={} + + for valeurReactionType in monDico['Equation_Liste']: + dicoListeEquationAAfficher[valeurReactionType] = [] + for index,equation in enumerate( editor.maClasseVisuEquation.listEquation): + if equation.type_react==valeurReactionType : + dicoListeEquationAAfficher[valeurReactionType].append(equation.representation) + print (dicoListeEquationAAfficher) + + change=editor.changeIntoDefMC('Modele', ('b_type_creation','b_ajout_equation','listeEquation_initiation'),dicoListeEquationAAfficher['initiation'] ) + change=editor.changeIntoDefMC('Modele', ('b_type_creation','b_ajout_equation','listeEquation_propagation'),dicoListeEquationAAfficher['propagation'] ) + change=editor.changeIntoDefMC('Modele', ('b_type_creation','b_ajout_equation','listeEquation_termination'),dicoListeEquationAAfficher['termination'] ) + change=editor.changeIntoDefMC('Modele', ('b_type_creation','b_ajout_equation','listeEquation_stabilization'),dicoListeEquationAAfficher['stabilization'] ) + if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau() + editor.dsMaFunct = False + +def prepareDiffusion(monMC): + print ('je suis dans prepareDiffusion') + if monMC.valeur==False : return + if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return + monMC.dsMaFunct=True + editor=monMC.jdc.editor + if hasattr(editor,'dsMaFunct') and editor.dsMaFunct== True : return + editor.dsMaFunct = True + editor.dicoCoefS={} + editor.dicoCoefD={} + for c in maClasseDeModele.coef[0].keys() : + if c[0]=='S': + clef=c[1:] + valeur= maClasseDeModele.coef[0][c] + editor.dicoCoefS[clef]=valeur + if c[0]=='D': + clef=c[1:] + valeur= maClasseDeModele.coef[0][c] + editor.dicoCoefD[clef]=valeur + print (editor.dicoCoefS,editor.dicoCoefD) + monMC.dsMaFunct=False + editor.dsMaFunct = False + + +def ajouteDiffusion(monMC): + print ('je suis dans ajouteDiffusion') + if monMC.valeur == None : return + print (monMC.valeur) + if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return + monMC.dsMaFunct=True + editor=monMC.jdc.editor + if hasattr(editor,'dsMaFunct') and editor.dsMaFunct== True : return + editor.dsMaFunct = True + + + for v in monMC.valeur : + print (v) + mesValeurs=editor.dicoCoefS[v] + print (editor.dicoCoefS) + print (mesValeurs) + MCFils='S'+v + for e in monMC.jdc.etapes: + if e.nom == Modele :break + + print (e) + editor.ajoutDefinitionMC(e,('b_type_creation','b_diffusion'),MCFils,typ='TXM',statut='o' ) + print ('ggggg') + editor.ajoutMC(e,MCFils,mesValeurs,('b_type_creation','b_diffusion',)) + print ('______') + if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau() + monMC.dsMaFunct=False + editor.dsMaFunct = False + +JdC = JDC_CATA(code='VP', + execmodul=None, + ) + + + +#--------------------------------- +Equation = PROC (nom="Equation", + op=None, +#--------------------------------- + Equation_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base") ), + Equation_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show equation database", "Equation creation"),), + + +# --------------------------------------------------------------------------- + b_type_show = BLOC(condition = " Equation_Type == 'Show equation database'", +# --------------------------------------------------------------------------- + Equation_Liste=SIMP(statut= 'o',typ= 'TXM', into=('reaction_type','aging_type')), + + b_reaction_type = BLOC(condition = " Equation_Liste == 'reaction_type'", + Equation_reaction=SIMP(statut= 'o',typ= 'TXM', into=monDico['Equation_Liste'],siValide=recupereDicoEquation), + ), # Fin b_reaction_type + + b_aging_type = BLOC(condition = " Equation_Liste == 'aging_type'", + Equation_reaction=SIMP(statut= 'o',typ= 'TXM', into=('All', 'thermo', 'radio'),siValide=recupereDicoEquation), + ), # Fin b_reaction_type + + ListeEquation = SIMP(statut='o', typ='TXM', homo='SansOrdreNiDoublon',siValide=afficheValeurEquation), + b_modification = BLOC(condition = " ListeEquation != None ", + modification = SIMP(typ = bool, statut = 'o',defaut = False, fr='toto', ang='toto en anglais', siValide=instancieChemicalFormulation), + + b_modif = BLOC(condition = "modification == True", + Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],), + Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'),), + + OptionnelConstituant = FACT ( statut = 'f',max = '**', + Constituant = SIMP (statut = 'o', typ = 'TXM'), + Differential_Equation = SIMP(statut= 'o',typ= 'TXM'), + ), # fin Const_Equa + OptionnelleConstante = FACT (statut = 'f', max = '**', + ConstanteName= SIMP (statut = 'o', typ = 'TXM',), + ConstanteType = SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'), + ),# fin ConstanteOptionnelle + Commentaire = SIMP (statut = 'f', typ = 'TXM', defaut = ' '), + + ),# fin b_modif + + ), # fin b_modification + ), # Fin b_type_show + + +# --------------------------------------------------------------------------- + b_type_creation = BLOC(condition = " Equation_Type == 'Equation creation'", +# --------------------------------------------------------------------------- + Equation_Modification = FACT ( statut = 'o', + + ChemicalFormulation = SIMP(statut='o', typ='TXM', defaut = 'POOH -> 2P'), + + Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],), + Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'),), + + Constituants = FACT ( statut = 'o', + ConstituantPOOH = SIMP (statut = 'f', typ = 'TXM', into = ('POOH',), defaut= 'POOH'), + b_pooh = BLOC(condition = " ConstituantPOOH == 'POOH'" , + Differential_Equation = SIMP(statut= 'o',typ= 'TXM', defaut = '-ku1*POOH'), + ), # Fin b_pooh + ConstituantP = SIMP (statut = 'f', typ = 'TXM', into = ('P',),defaut='P'), + b_p = BLOC(condition = " ConstituantP == 'P'" , + Differential_Equation = SIMP(statut= 'o',typ= 'TXM', defaut = '2*ku1*POOH'), + ), # Fin b_p + OptionnelConstituant = FACT ( statut = 'f',max = '**', + Constituant = SIMP (statut = 'o', typ = 'TXM'), + Differential_Equation = SIMP(statut= 'o',typ= 'TXM'), + ), # fin Const_Equa + ),# Fin Constituants + + Constante = FACT ( statut = 'o', + Constanteku1 = SIMP (statut = 'f', typ = 'TXM', into = ('ku1',), defaut= 'ku1'), + b_cku1 = BLOC(condition = "Constanteku1 == 'ku1'" , + ConstanteType = SIMP(statut= 'o',typ= 'TXM', into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'), + ), + OptionnelleConstante = FACT (statut = 'f', max = '**', + ConstanteName= SIMP (statut = 'o', typ = 'TXM',), + ConstanteType = SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'), + ),# fin ConstanteOptionnelle + ), # fin constante + Commentaire = SIMP (statut = 'f', typ = 'TXM', defaut = ' '), + + ), # Fin Equation_Modification + + #Chemical_Formulation = SIMP(statut= 'o',typ= 'TXM', defaut = 'POOH->P',siValide=maFuncWithArg), + #Type1 = SIMP(statut='o', typ = 'TXM', into=maFunc), + #Type2 = SIMP(statut='o', typ = 'TXM'), + + ), # fin b_type_creation + + +) # Fin Equation + +#--------------------------------- +Modele = PROC (nom="Modele", + op=None, + Modele_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base"),siValide=recupereDicoModele ), + Modele_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show modele database", "Modele creation"),siValide=creeListeEquation), +# --------------------------------------------------------------------------- + b_type_creation = BLOC(condition = " Modele_Type == 'Modele creation'", +# --------------------------------------------------------------------------- + technicalUse= SIMP(statut= 'o',typ= 'TXM',into=monDico['Modele_TechnicalUse'],defaut=maClasseDeModele.technical_use ), + modeleName=SIMP(statut='o',typ='TXM',defaut=maClasseDeModele.nom,), + material=SIMP(statut='o',typ='TXM',defaut=maClasseDeModele.materiaux[0],), + stabilizer = SIMP(typ = bool, statut = 'o',defaut = maClasseDeModele.stabilise), + model_developed_by_for_EDF = SIMP(typ = bool, statut = 'o',defaut = maClasseDeModele.dvt_EDF[0]), + documentation=SIMP(statut='o',typ='TXM',defaut=maClasseDeModele.reference,), + + # ajouter la liste des equations et le remove (il faut garder ceux qu on a enlever) + + + AjoutEquation=SIMP(statut= 'o',typ= bool, defaut=False, siValide=recupereModeleEquation), + b_ajout_equation = BLOC(condition = " AjoutEquation == True", + listeEquation_initiation=SIMP(statut='o', typ='TXM',homo='SansOrdreNiDoublon', max='**', min=0, defaut=[] ), + listeEquation_propagation=SIMP(statut='o', typ='TXM',homo='SansOrdreNiDoublon', max='**', min=0, defaut=[] ), + listeEquation_termination=SIMP(statut='o', typ='TXM',homo='SansOrdreNiDoublon', max='**', min=0, defaut=[] ), + listeEquation_stabilization=SIMP(statut='o',typ='TXM', homo='SansOrdreNiDoublon', max='**', min=0, defaut=[] ), + ),# fin b_ajout_equation + + # coefficients maClasseDeModele.coef = liste de dictionnaire mais il faut prendre que le 0 + # on enleve ceux qui commence par D, S et B(casse imprtante) + # la clef est le coef, puis les valeurs + + Aging_Type=SIMP(statut= 'o',typ='TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'), defaut=maClasseDeModele.type_vieil), + Diffusion = SIMP(typ = bool, statut = 'o',defaut = maClasseDeModele.diffusion,siValide = prepareDiffusion), + + b_diffusion = BLOC(condition = " Diffusion == True", + #coefficients maClasseDeModele.coef = liste de dictionnaire mais il faut prendre que le 0 + # on met ceux qui commence par D, S et pas les B ni les aitres( casse imprtante) + listeProduitPourLaDiffusion=SIMP(statut='o', typ='TXM', max='**', min=1,homo='SansOrdreNiDoublon', into = maClasseDeModele.param_ini.keys(),siValide=ajouteDiffusion), + ), # fin b_diffusion + + ), # fin b_type_creation + + + #AjoutEquation=Fact(statut='f', + # Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],siValide=recupereModeleEquation), + #), # fin AjoutEquation + + Commentaire = SIMP (statut = 'f', typ = 'TXM'), +) # Fin Modele diff --git a/VirtualPolymer/VP_Cata_V1.py.equation b/VirtualPolymer/VP_Cata_V1.py.equation new file mode 100644 index 00000000..5296cdb0 --- /dev/null +++ b/VirtualPolymer/VP_Cata_V1.py.equation @@ -0,0 +1,260 @@ +# coding: utf-8 +import types +from Accas import * +import sys,os +sys.path.append('/home/A96028/opt/MAP/map-2016.1/lib/python2.7/site-packages/mapy/components/c_pre_polymer_data_management') +sys.path.append('/home/A96028/opt/MAP/map-2016.1/lib/python2.7/site-packages/mapy/virtual_polymer_common') +sys.path.append('/home/A96028/opt/MAP/map-2016.1/lib/python2.7/site-packages/') +import pckdb, class_data, instruction, equation_part, utils + + +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 + +class classeVisuEquation : + def __init__(self,dicoListeAffiche): + self.dicoListeAffiche=dicoListeAffiche + + +def maFunc(): + return ('a1','a2','a3') + +def maFuncWithArg(monMC): + if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return + monMC.dsMaFunct = True + + editor=monMC.jdc.editor + if monMC.valeur == 'POOH->P' : monInto=('a1','a2','a3') + else : monInto=('b1','b2','b3') + + change=editor.changeIntoDefMC('AGING', ('Equation', 'b_approved','b_type_creation','Equation_Modification','Type2'), monInto ) + if change : + print ('j ai change le into') + editor.reCalculeValiditeMCApresChgtInto('AGING', 'Type2', ('Equation', 'b_approved','b_type_creation','Equation_Modification')) + if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau() + + monMC.dsMaFunct = False + +def recupereDicoGenerique(monMC): + if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return + print ('je passe dans la recuperation') + editor=monMC.jdc.editor + valeurDB=editor.getValeur('Equation','Equation_DB',()) + print ('valeurDB',valeurDB) + correspond=pckdb.DBRENAME + if valeurDB != None : + listEquation, listModele,listePostTraitement=pckdb.read_pckdb(correspond[valeurDB]) + print (listEquation, listModele,listePostTraitement) + monMC.dsMaFunct = False + return listEquation, listModele,listePostTraitement + +def recupereDicoEquation(monMC): + if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return + listEquation, listModele,listePostTraitement=recupereDicoGenerique(monMC) + editor=monMC.jdc.editor + + valeurEquationListe=editor.getValeur('Equation','Equation_Liste',('b_type_show',)) + valeurAgingType=editor.getValeur('Equation','Equation_reaction',('b_type_show','b_reaction_type',)) + if valeurAgingType == None : + print ('dans reaction-type') + valeurAgingType=editor.getValeur('Equation','Equation_reaction',('b_type_show','b_aging_type',)) + if valeurAgingType == None : monMC.dsMaFunct = False; return + + print ('valeurType',valeurAgingType) + listeEquationPourIhm = [] + listeReprEquationPourIhm = [] + dicoListeAffiche={} + for equation in listEquation : + if valeurEquationListe == 'aging_type' : + if equation.type_vieil == valeurAgingType : + listeEquationPourIhm.append(equation) + listeReprEquationPourIhm.append(equation.representation) + dicoListeAffiche[equation.representation]=equation + else: + if equation.type_react == valeurAgingType : + listeEquationPourIhm.append(equation) + listeReprEquationPourIhm.append(equation.representation) + dicoListeAffiche[equation.representation]=equation + change=editor.changeIntoDefMC('Equation', ('b_type_show','ListeEquation'), listeReprEquationPourIhm ) + if change : + editor.reCalculeValiditeMCApresChgtInto('Equation', 'listeEquation', ('b_type_show',)) + if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau() + editor.maClasseVisuEquation = classeVisuEquation(dicoListeAffiche) + monMC.dsMaFunct = False + +def afficheValeurEquation(monMC): + if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return + editor=monMC.jdc.editor + valeur=monMC.valeur + if valeur == None : + monMC.dsMaFunct = False + return + print (editor.maClasseVisuEquation.dicoListeAffiche[valeur]) + print(str (editor.maClasseVisuEquation.dicoListeAffiche[valeur])) + editor.maClasseVisuEquation.valeurEquationChoisie=valeur + monMC.dsMaFunct = False + + +def instancieChemicalFormulation(monMC): + if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return + if monMC.valeur == False : return + + editor=monMC.jdc.editor + if hasattr(editor,'dsMaFunct') and editor.dsMaFunct== True : return + editor.dsMaFunct = True + + print ('ds instancie') + v=editor.maClasseVisuEquation.valeurEquationChoisie + monEquation=editor.maClasseVisuEquation.dicoListeAffiche[v] + type_react=monEquation.type_react + type_vieil=monEquation.type_vieil + print (v, type_react, type_vieil) + #editor.changeIntoMCandSet('Equation', ('b_type_show','b_modification','b_modif','ChemicalFormulation'),( v,),v ) + change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Reaction_Type'),type_react ) + change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Aging_Type'), type_vieil ) + + for index,valeurConstituant in enumerate(monEquation.constituants): + valeurEquation=monEquation.equation[index] + editor.ajoutMC(monMC.etape,'OptionnelConstituant',None,('b_type_show','b_modification','b_modif',)) + print (index,valeurConstituant,valeurEquation) + + #OptionnelConstituant = FACT ( statut = 'f',max = '**', + # Constituant = SIMP (statut = 'o', typ = 'TXM'), + # Differential_Equation = SIMP(statut= 'o',typ= 'TXM'), + for index,valeurConstituant in enumerate(monEquation.const_cine_nom): + valeurArrhe=monEquation.arrhenius[index] + if valeurArrhe : valeurConstanteType='Arrhenius type' + else : valeurConstanteType='non Arrhenius type' + + print (index,valeurConstituant,valeurConstanteType) + #OptionnelleConstante = FACT (statut = 'f', max = '**', + # ConstanteName= SIMP (statut = 'o', typ = 'TXM',), + # ConstanteType = SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'), + change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Commentaire'),monEquation.comment ) + print (monEquation.comment ) + #if change : + if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau() + monMC.dsMaFunct = False + editor.dsMaFunct = False + + + +monDico= { 'Equation_Liste' : ('initiation', 'propagation', 'termination', 'stabilization')} + +JdC = JDC_CATA(code='VP', + execmodul=None, + ) + + + +#--------------------------------- +Equation = PROC (nom="Equation", + op=None, +#--------------------------------- + Equation_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base") ), + Equation_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show equation database", "Equation creation"),), + + +# --------------------------------------------------------------------------- + b_type_show = BLOC(condition = " Equation_Type == 'Show equation database'", +# --------------------------------------------------------------------------- + Equation_Liste=SIMP(statut= 'o',typ= 'TXM', into=('reaction_type','aging_type')), + + b_reaction_type = BLOC(condition = " Equation_Liste == 'reaction_type'", + Equation_reaction=SIMP(statut= 'o',typ= 'TXM', into=monDico['Equation_Liste'],siValide=recupereDicoEquation), + ), # Fin b_reaction_type + + b_aging_type = BLOC(condition = " Equation_Liste == 'aging_type'", + Equation_reaction=SIMP(statut= 'o',typ= 'TXM', into=('All', 'thermo', 'radio'),siValide=recupereDicoEquation), + ), # Fin b_reaction_type + + ListeEquation = SIMP(statut='o', typ='TXM', homo='SansOrdreNiDoublon',siValide=afficheValeurEquation), + b_modification = BLOC(condition = " ListeEquation != None ", + modification = SIMP(typ = bool, statut = 'o',defaut = False, fr='toto', ang='toto en anglais', siValide=instancieChemicalFormulation), + + b_modif = BLOC(condition = "modification == True", + Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],), + Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'),), + + OptionnelConstituant = FACT ( statut = 'f',max = '**', + Constituant = SIMP (statut = 'o', typ = 'TXM'), + Differential_Equation = SIMP(statut= 'o',typ= 'TXM'), + ), # fin Const_Equa + OptionnelleConstante = FACT (statut = 'f', max = '**', + ConstanteName= SIMP (statut = 'o', typ = 'TXM',), + ConstanteType = SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'), + ),# fin ConstanteOptionnelle + Commentaire = SIMP (statut = 'f', typ = 'TXM', defaut = ' '), + + ),# fin b_modif + + ), # fin b_modification + ), # Fin b_type_show + + +# --------------------------------------------------------------------------- + b_type_creation = BLOC(condition = " Equation_Type == 'Equation creation'", +# --------------------------------------------------------------------------- + Equation_Modification = FACT ( statut = 'o', + + ChemicalFormulation = SIMP(statut='o', typ='TXM', defaut = 'POOH -> 2P'), + + Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],), + Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'),), + + Constituants = FACT ( statut = 'o', + ConstituantPOOH = SIMP (statut = 'f', typ = 'TXM', into = ('POOH',), defaut= 'POOH'), + b_pooh = BLOC(condition = " ConstituantPOOH == 'POOH'" , + Differential_Equation = SIMP(statut= 'o',typ= 'TXM', defaut = '-ku1*POOH'), + ), # Fin b_pooh + ConstituantP = SIMP (statut = 'f', typ = 'TXM', into = ('P',),defaut='P'), + b_p = BLOC(condition = " ConstituantP == 'P'" , + Differential_Equation = SIMP(statut= 'o',typ= 'TXM', defaut = '2*ku1*POOH'), + ), # Fin b_p + OptionnelConstituant = FACT ( statut = 'f',max = '**', + Constituant = SIMP (statut = 'o', typ = 'TXM'), + Differential_Equation = SIMP(statut= 'o',typ= 'TXM'), + ), # fin Const_Equa + ),# Fin Constituants + + Constante = FACT ( statut = 'o', + Constanteku1 = SIMP (statut = 'f', typ = 'TXM', into = ('ku1',), defaut= 'ku1'), + b_cku1 = BLOC(condition = "Constanteku1 == 'ku1'" , + ConstanteType = SIMP(statut= 'o',typ= 'TXM', into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'), + ), + OptionnelleConstante = FACT (statut = 'f', max = '**', + ConstanteName= SIMP (statut = 'o', typ = 'TXM',), + ConstanteType = SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'), + ),# fin ConstanteOptionnelle + ), # fin constante + Commentaire = SIMP (statut = 'f', typ = 'TXM', defaut = ' '), + + ), # Fin Equation_Modification + + #Chemical_Formulation = SIMP(statut= 'o',typ= 'TXM', defaut = 'POOH->P',siValide=maFuncWithArg), + #Type1 = SIMP(statut='o', typ = 'TXM', into=maFunc), + #Type2 = SIMP(statut='o', typ = 'TXM'), + + ), # fin b_type_creation + + +) # Fin Equation + +Modele = PROC (nom="Modele", + op=None, + Commentaire = SIMP (statut = 'f', typ = 'TXM'), +) # Fin Modele diff --git a/VirtualPolymer/VP_Cata_V1.py.ok b/VirtualPolymer/VP_Cata_V1.py.ok new file mode 100644 index 00000000..1e720678 --- /dev/null +++ b/VirtualPolymer/VP_Cata_V1.py.ok @@ -0,0 +1,123 @@ +# coding: utf-8 +import types +from Accas import * + + +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 + +def maFunc(): + return ('a1','a2','a3') + +def maFuncWithArg(monMC): + if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return + monMC.dsMaFunct = True + + editor=monMC.jdc.editor + if monMC.valeur == 'POOH->P' : monInto=('a1','a2','a3') + else : monInto=('b1','b2','b3') + + change=editor.changeIntoDefMC('AGING', ('Equation', 'b_approved','b_type_creation','Equation_Modification','Type2'), monInto ) + if change : + print ('j ai change le into') + editor.reCalculeValiditeMCApresChgtInto('AGING', 'Type2', ('Equation', 'b_approved','b_type_creation','Equation_Modification')) + if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau() + + monMC.dsMaFunct = False + + + +monDico= { 'Equation_Liste' : ('initiation', 'propagation', 'termination', 'stabilization')} + +JdC = JDC_CATA(code='VP', + execmodul=None, + ) + + +AGING = PROC (nom="AGING", + op=None, + +#--------------------------------- + Equation = FACT(statut= 'o', +#--------------------------------- + Equation_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base") ), + Equation_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show equation database", "Equation creation"),), + +# --------------------------------------------------------------------------- + b_type_show = BLOC(condition = " Equation_Type == 'Show equation database'", +# --------------------------------------------------------------------------- + Equation_Liste=SIMP(statut= 'o',typ= 'TXM', into=('reaction_type','aging_type')), + + b_reaction_type = BLOC(condition = " Equation_Liste == 'reaction_type'", + Equation_reaction=SIMP(statut= 'o',typ= 'TXM', into=monDico['Equation_Liste'],), + ), # Fin b_reaction_type + + b_aging_type = BLOC(condition = " Equation_Liste == 'aging_type'", + Equation_reaction=SIMP(statut= 'o',typ= 'TXM', into=('All', 'thermo', 'radio'),), + ), # Fin b_reaction_type + + ), # Fin b_type_show + +# --------------------------------------------------------------------------- + b_type_creation = BLOC(condition = " Equation_Type == 'Equation creation'", +# --------------------------------------------------------------------------- + Equation_Modification = FACT ( statut = 'o', + Chemical_Formulation = SIMP(statut= 'o',typ= 'TXM', defaut = 'POOH->P'), + Equation_reaction1=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],), + Equation_reaction2=SIMP(statut= 'o',typ= 'TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'),), + + Constituants = FACT ( statut = 'o', + ConstituantPOOH = SIMP (statut = 'f', typ = 'TXM', into = ('POOH',), defaut= 'POOH'), + b_pooh = BLOC(condition = " ConstituantPOOH == 'POOH'" , + Differential_Equation = SIMP(statut= 'o',typ= 'TXM', defaut = '-ku1*POOH'), + ), # Fin b_pooh + ConstituantP = SIMP (statut = 'f', typ = 'TXM', into = ('P',),defaut='P'), + b_p = BLOC(condition = " ConstituantP == 'P'" , + Differential_Equation = SIMP(statut= 'o',typ= 'TXM', defaut = '2*ku1*POOH'), + ), # Fin b_p + OptionnelConstituant = FACT ( statut = 'f',max = '**', + Constituant = SIMP (statut = 'o', typ = 'TXM'), + Differential_Equation = SIMP(statut= 'o',typ= 'TXM'), + ), # fin Const_Equa + ),# Fin Constituants + + Constante = FACT ( statut = 'o', + Constanteku1 = SIMP (statut = 'f', typ = 'TXM', into = ('ku1',), defaut= 'ku1'), + b_cku1 = BLOC(condition = "Constanteku1 == 'ku1'" , + ConstanteType = SIMP(statut= 'o',typ= 'TXM', into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'), + ), + ConstanteOptionnelle = FACT (statut = 'f', max = '**', + ConstanteName= SIMP (statut = 'o', typ = 'TXM',), + ConstanteType = SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'), + ),# fin ConstanteOptionnelle + ), # fin constante + Commentaire = SIMP (statut = 'f', typ = 'TXM'), + + ), # Fin Equation_Modification + + + #Chemical_Formulation = SIMP(statut= 'o',typ= 'TXM', defaut = 'POOH->P',siValide=maFuncWithArg), + #Type1 = SIMP(statut='o', typ = 'TXM', into=maFunc), + #Type2 = SIMP(statut='o', typ = 'TXM'), + + ), # fin b_type_creation + + + ), # Fin Equation +) + +TEXTE_NEW_JDC="AGING()" diff --git a/VirtualPolymer/configuration_VP.py b/VirtualPolymer/configuration_VP.py new file mode 100644 index 00000000..b9b56fe0 --- /dev/null +++ b/VirtualPolymer/configuration_VP.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# +# +# ====================================================================== +""" + Ce module sert pour charger les paramètres de configuration d'EFICAS +""" +# Modules Python +from InterfaceQT4 import configuration +import os + + +class CONFIG(configuration.CONFIG_BASE): + + #----------------------------------- + def __init__(self,appli,repIni): + #----------------------------------- + + self.labels_user=['catalogues','lang'] + self.labels_eficas=['lang','rep_cata','catalogues'] + + configuration.CONFIG_BASE.__init__(self,appli,repIni) + + +def make_config(appli,rep): + return CONFIG(appli,rep) + diff --git a/VirtualPolymer/opsOT.py b/VirtualPolymer/opsOT.py new file mode 100644 index 00000000..e2af4083 --- /dev/null +++ b/VirtualPolymer/opsOT.py @@ -0,0 +1,20 @@ +# -*- coding: iso-8859-1 -*- + +def INCLUDE(self,FileName,**args): + """ + Fonction sd_prod pour la macro INCLUDE + """ + if hasattr(self,'change_fichier'): + delattr(self,'change_fichier') + delattr(self,'fichier_ini') + + self.make_include2(fichier=FileName) + +def INCLUDE_context(self,d): + """ + Fonction op_init pour macro INCLUDE + """ + for k,v in self.g_context.items(): + d[k]=v + + diff --git a/VirtualPolymer/prefs.py b/VirtualPolymer/prefs.py new file mode 100644 index 00000000..6554d133 --- /dev/null +++ b/VirtualPolymer/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="VP" +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/VirtualPolymer/prefs_VP.py b/VirtualPolymer/prefs_VP.py new file mode 100644 index 00000000..cec67343 --- /dev/null +++ b/VirtualPolymer/prefs_VP.py @@ -0,0 +1,45 @@ +# -*- 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='fr' + +# Codage des strings qui accepte les accents (en remplacement de 'ascii') +encoding='iso-8859-1' + +# +catalogues=( + ('VP','V1',os.path.join(repIni,'VP_Cata_V1.py'),'python','python'), +) +nombreDeBoutonParLigne=2 +closeFrameRechercheCommande = True +closeEntete = True +#closeArbre = True +afficheOptionnelVide=False + diff --git a/VirtualPolymer/properties.py b/VirtualPolymer/properties.py new file mode 100644 index 00000000..1d328a46 --- /dev/null +++ b/VirtualPolymer/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/VirtualPolymer/qtEficasVP.py b/VirtualPolymer/qtEficasVP.py new file mode 100755 index 00000000..00ced3c4 --- /dev/null +++ b/VirtualPolymer/qtEficasVP.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2013 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +""" + Ce module sert a lancer EFICAS configure pour MAP +""" +# Modules Python +# Modules Eficas +import prefs +name='prefs_'+prefs.code +__import__(name) + +import sys +reload(sys) +sys.setdefaultencoding('latin1') + +import os +sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..')) + +import prefs +from InterfaceQT4 import eficas_go +eficas_go.lance_eficas(code=prefs.code) diff --git a/VirtualPolymer/toto_VP.py b/VirtualPolymer/toto_VP.py new file mode 100644 index 00000000..006f2a8c --- /dev/null +++ b/VirtualPolymer/toto_VP.py @@ -0,0 +1,17 @@ +def model_saved(listeparam) : + editor=listeparam[0] + print (editor) + print (editor.process_VP()) + +# le dictionnaire des commandes a la structure suivante : +# la clef est la commande qui va proposer l action +# puis un tuple qui contient +# - la fonction a appeler +# - le label dans le menu du clic droit +# - un tuple contenant les parametres attendus par la fonction +# - appelable depuis Salome uniquement -) +# - appelable depuis un item valide uniquement +# - toolTip +dict_commandes={ + 'Equation':((model_saved,"model_saved",('editor','self'),False,True,""),), + }