From: pascale.noyret Date: Mon, 17 Sep 2018 09:22:50 +0000 (+0200) Subject: sauvegarde VP X-Git-Tag: avantMenage~74 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=150556c2f5ce8efb58922d60945a02af17a7061d;p=tools%2Feficas.git sauvegarde VP --- diff --git a/VirtualPolymer/VP_Cata_V2.py b/VirtualPolymer/VP_Cata_V2.py index d73b3192..4c575ebc 100644 --- a/VirtualPolymer/VP_Cata_V2.py +++ b/VirtualPolymer/VP_Cata_V2.py @@ -1,303 +1,535 @@ -# coding: utf-8 -import types -from Accas import * - -import lienDB -import listesDB - -monDico= { 'Equation_Liste' : ('initiation', 'propagation', 'termination', 'stabilization'), - 'Modele_TechnicalUse' : ('cable', 'coating', 'pipes'), - 'Aging_Factor' : { 'predefinedSimulationTime' : ('40years BR top', '40years BR bottom')}, - 'Boundary_Conditions' : ('flux_volume','flux_surface','constant_constration','convection_flux'), - 'posttraitement_Typ' : ('chimique','mecanique','physique'), - } - -monModele=listesDB.sModele().monModele -monPost=listesDB.sModele().monPost - -import types -class Tuple: - def __init__(self,ntuple): - self.ntuple=ntuple - - def __convert__(self,valeur): - if type(valeur) == types.StringType: - return None - if len(valeur) != self.ntuple: - return None - return valeur - - def info(self): - return "Tuple de %s elements" % self.ntuple - - -JdC = JDC_CATA(code='VP', - execmodul=None, - ) - - -#--------------------------------- -DataBase = PROC (nom="DataBase", - op=None, -#--------------------------------- - Equation_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base") ), - #b_suite = BLOC(condition = "Equation_DB == 'My data base' ", - Equation_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show equation database", "Equation creation"),), - #), - #b_suite_2 = BLOC(condition = "Equation_DB == 'Approved data base' ", - #Equation_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show equation database", ),), - #), - -# --------------------------------------------------------------------------- - 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=lienDB.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=lienDB.recupereDicoEquation), - ), # Fin b_reaction_type - - ListeEquation = SIMP(statut='o', typ='TXM', homo='SansOrdreNiDoublon',siValide=lienDB.afficheValeurEquation), - #ListeEquation = SIMP(statut='o', typ='TXM', homo='SansOrdreNiDoublon'), - b_modification = BLOC(condition = " ListeEquation != None ", - modification = SIMP(typ = bool, statut = 'o',defaut = False, fr='toto', ang='toto en anglais', siValide=lienDB.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'),), - ChemicalFormulation = SIMP(statut='o', typ='TXM', defaut = 'POOH -> 2P'), - - 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',)), - b_pooh = BLOC(condition = " ConstituantPOOH == 'POOH'" , - Differential_Equation_POOH = SIMP(statut= 'o',typ= 'TXM', defaut = '-ku1*POOH'), - ), # Fin b_pooh - #ConstituantP = SIMP (statut = 'f', typ = 'TXM', into = ('P',)), - #b_p = BLOC(condition = " ConstituantP == 'P'" , - # Differential_Equation_P = SIMP(statut= 'o',typ= 'TXM', defaut = '2*ku1*POOH'), - #), # Fin b_p - ConstituantP = FACT ( statut = 'f', - ConstituantP = SIMP (statut = 'f', typ = 'TXM', into = ('P',)), - Differential_Equation_P = SIMP(statut= 'o',typ= 'TXM', defaut = '2*ku1*POOH'), - ), # Fin ConstituantP - - 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 - ), # fin b_type_creation - - -) # Fin Equation - -#--------------------------------- -ODE = PROC (nom="ODE", - op=None, - Modele_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base"),siValide=lienDB.recupereDicoModele ), - Modele_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show modele database", "Modele creation"),siValide=lienDB.creeListeEquation), -# --------------------------------------------------------------------------- - b_type_creation = BLOC(condition = " Modele_Type == 'Modele creation'", -# --------------------------------------------------------------------------- - ID=FACT(statut='o', - technicalUse= SIMP(statut= 'o',typ= 'TXM',into=monDico['Modele_TechnicalUse'],defaut=monModele.technical_use ), - modeleName=SIMP(statut='o',typ='TXM',defaut=monModele.nom,), - material=SIMP(statut='o',typ='TXM',defaut=monModele.materiaux[0],), - agingType=SIMP(statut= 'o',typ='TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'), defaut=monModele.type_vieil), - stabilizer = SIMP(typ = bool, statut = 'o',defaut = monModele.stabilise), - material_thickness = SIMP(typ = 'TXM', statut = 'o',defaut = monModele.thickness, into = ['thin','thick']), - # il faudrait que position=global_jdc fonctionne - model_developed_by_for_EDF = SIMP(typ = bool, statut = 'o',defaut = monModele.dvt_EDF[0]), - documentation=SIMP(statut='o',typ='TXM',defaut=monModele.reference,), - - ), # fin ID - # ajouter la liste des equations et le remove (il faut garder ceux qu on a enlever) - - Chemical_Equation = FACT( statut='o', - Initial_Equation_List=SIMP(statut='o',typ='TXM',max="**",homo='SansOrdreNiDoublon',into=[],defaut=[], siValide=lienDB.recupereModeleEquation), - - AjoutEquation=SIMP(statut= 'o',typ= bool, defaut=False, siValide=lienDB.recupereModeleEquation), - b_ajout_equation = BLOC(condition = " AjoutEquation == True", - listeEquation_initiation=SIMP(statut='o', typ='TXM',homo='SansOrdreNiDoublon', max='**', min=0, defaut=[],siValide=lienDB.ajoutDUneEquation ), - listeEquation_propagation=SIMP(statut='o', typ='TXM',homo='SansOrdreNiDoublon', max='**', min=0, defaut=[],siValide=lienDB.ajoutDUneEquation ), - listeEquation_termination=SIMP(statut='o', typ='TXM',homo='SansOrdreNiDoublon', max='**', min=0, defaut=[],siValide=lienDB.ajoutDUneEquation ), - listeEquation_stabilization=SIMP(statut='o',typ='TXM', homo='SansOrdreNiDoublon', max='**', min=0, defaut=[],siValide=lienDB.ajoutDUneEquation ), - ),# fin b_ajout_equation - - ), # fin Equation - # coefficients monModele.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 - - - #b_material_thickness = BLOC(condition = "material_thickness == 'thick'", - # si position=global fonctionne - Transport = FACT( statut = 'o', - #Diffusion = SIMP(typ = bool, statut = 'o',defaut = monModele.diffusion,siValide = lienDB.prepareDiffusion), - Diffusion = SIMP(typ = bool, statut = 'o',defaut = False ,siValide = lienDB.prepareDiffusion), - - b_diffusion = BLOC(condition = " Diffusion == True", - listeProduitPourLaDiffusion=SIMP(statut='o', typ='TXM', max='**', min=1,homo='SansOrdreNiDoublon', into = [],siValide=lienDB.ajouteDiffusion), - ), # fin b_diffusion - - Evaporation = SIMP(typ = bool, statut = 'o',defaut = False ,siValide = lienDB.prepareDiffusion), - b_evaporation = BLOC(condition = " Evaporation == True", - listeProduitPourLEvaporation=SIMP(statut='o', typ='TXM', max='**', min=1,homo='SansOrdreNiDoublon', into = [],siValide=lienDB.ajouteEvaporation), - ), # fin b_evaporation - - - ), # fin TRANSPORT - #), # fin b_material_thickness - - Coefficients = FACT( statut = 'o', - Coef_k2 = SIMP (statut ='o', typ='R'), - Coef_ku1 = SIMP (statut ='o', typ=Tuple(2),validators = VerifTypeTuple(('R','R')),), - ), - Parametres_Initiaux = FACT( statut = 'o', - Param_POOH=SIMP (statut ='o', typ='R'), - # La liste est la meme que le INTO des listeProduitsPourlaDiffusion - # la valeur par defaut si elle existe est contenue dans modele.param_ini['POOH'] - ), - - - #AjoutEquation=Fact(statut='f', - # Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],siValide=lienDB.recupereModeleEquation), - #), # fin AjoutEquation - ), # fin Creation -# --------------------------------------------------------------------------- - b_type_modification = BLOC(condition = " Modele_Type == 'Show modele database'", -# --------------------------------------------------------------------------- - technicalUse= SIMP(statut= 'o',typ= 'TXM',into=monDico['Modele_TechnicalUse'],siValide=lienDB.creeListeMateriauxSelonModele), - b_technicalUse = BLOC (condition = 'technicalUse != None and technicalUse != ""', - material= SIMP (statut ='o', typ='TXM',siValide=lienDB.creeListeModelesPossibles), - modele= SIMP (statut ='o', typ='TXM',siValide=lienDB.choisitModele), - b_modele = BLOC (condition = 'modele != None and modele != ""', - action = SIMP (statut ='o', typ='TXM',into = ['display','use','modify'], siValide=lienDB.choisitActionModele), -# --------------------------------------------------------------------------- - b_type_modify = BLOC(condition = " action == 'modify'", -# --------------------------------------------------------------------------- - ID=FACT(statut='o', - modeleName=SIMP(statut='o',typ='TXM'), - technicalUse= SIMP(statut= 'o',typ= 'TXM', into=monDico['Modele_TechnicalUse'] ), - material=SIMP(statut='o',typ='TXM'), - agingType=SIMP(statut= 'o',typ='TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio')), - stabilizer = SIMP(typ = bool, statut = 'o',), - material_thickness = SIMP(typ = 'TXM', statut = 'o', into = ['thin','thick']), - # il faudrait que position=global_jdc fonctionne - model_developed_by_for_EDF = SIMP(typ = bool, statut = 'o',), - documentation=SIMP(statut='o',typ='TXM',), - - -# il faut recopier toute la suite en changeant eventuellement le nom du modele -# il faut cocher toutes les equations par defaut - - ), # fin ID - ), # fin b_type_modify -# --------------------------------------------------------------------------- - b_type_use = BLOC(condition = " action == 'use'", -# --------------------------------------------------------------------------- - simulationName=SIMP(statut='o',typ='TXM'), - outputFolder = SIMP(statut="o", typ="Repertoire",siValide=lienDB.creeCoefAModifier), - ), # fin b_type_use -# --------------------------------------------------------------------------- - b_type_use2 = BLOC(condition = " action == 'use'", -# --------------------------------------------------------------------------- - Aging_Factor = FACT(statut='o', - predefinedSimulationTime = SIMP(statut='o',typ='TXM',into=monDico['Aging_Factor']['predefinedSimulationTime'],siValide=lienDB.remplirAgingFactor), - simulationTime=SIMP(statut='o',typ='R',), - numberOfNodes=SIMP(statut='o',typ='I',val_min=3,siValide=lienDB.creeInitialParameter), - sampleThickness=SIMP(statut='o',typ='R',), - #debitOfDose=SIMP(statut='o',typ='R',), - temperature=SIMP(statut='o',typ='R',), - oxygenPressure=SIMP(statut='o',typ='R',), - polymerConcentration=SIMP(statut='o',typ='R',), - ), - Initial_Parameter = FACT(statut='o', - max='**', - ), - Boundary_Conditions_Param = FACT(statut='o', - diffusionSpecies=SIMP(statut='o',typ='TXM',defaut='O2', into=['O2',]), - nodeNumber = SIMP(statut='o',typ='I',defaut=1, into=[1]), # tjours1 - Boundary_Conditions_O2_1 = SIMP(statut='o',typ='TXM',into=monDico['Boundary_Conditions']), - BC_Value_Espece_1=SIMP(statut='o',typ='R'), - nodeNumber_Espece_4 = SIMP(statut='o',typ='I',defaut=4, into=[4]), # numberOfNodes+1 - Boundary_Conditions_Espece_4 = SIMP(statut='o',typ='TXM',into=monDico['Boundary_Conditions']), - BC_Value_Espece_4=SIMP(statut='o',typ='R'), - ), - - ), # fin b_type_use2 - ), # fin b_modele - ), # fin b_technicalUse - ), # fin modification - - Commentaire = SIMP (statut = 'f', typ = 'TXM'), -) # Fin Modele -#--------------------------------- -AnalyticModel = PROC (nom="AnalyticModel", - op=None, - posttraitement_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base") ), - posttraitement_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show post-traitement database", "post-traitement creation"),), -# --------------------------------------------------------------------------- - b_post_creation = BLOC(condition = " posttraitement_Type == 'post-traitement creation'", - posttraitement_Name=SIMP(statut= 'o',typ= 'TXM',defaut=monPost.nom,), - generic=SIMP(statut= 'o',typ= bool,defaut=monPost.general,), - posttraitement_Typ = SIMP(statut= 'o',typ= 'TXM', into=monDico['posttraitement_Typ'],homo='SansOrdreNiDoublon',max='**',defaut=monPost.type_post), - calculation= FACT(statut='o', - # il faut un fact horizontal - calculation_results=SIMP(statut= 'o',typ= 'TXM', min=0,max='**', intoSug=monPost.calculation_results,defaut=monPost.calculation_results), - results_units=SIMP(statut= 'o',typ= 'TXM', min=0,max='**', intoSug=monPost.results_units,defaut=monPost.results_units), - #integrate=SIMP(statut= 'o',typ= 'TXM', min=0,max='**', intoSug=monPost.results_units,defaut=monPost.results_units), - prerequisite=SIMP(statut= 'o',typ= 'TXM', min=0,max='**', intoSug=monPost.prerequisite,defaut=monPost.prerequisite), - - ), - constituant=SIMP(statut= 'o',typ= 'TXM', min=0,max='**', intoSug=monPost.constituants,defaut=monPost.constituants) - - )# fin b_post_creation -# --------------------------------------------------------------------------- -#--------------------------------- -) #Posttraitement +# -*- coding: utf-8 -*- +import types +from Accas import * + +import lienDB +import listesDB + +monDico= { 'Equation_Liste' : ('initiation', 'propagation', 'termination', 'stabilization'), + 'Modele_TechnicalUse' : ('cable', 'coating', 'pipes'), + 'Aging_Factor' : { 'predefinedSimulationTime' : ('40years BR top', '40years BR bottom')}, + 'Boundary_Conditions' : ('flux_volume','flux_surface','constant_constration','convection_flux'), + 'posttraitement_Typ' : ('chimique','mecanique','physique'), + } + +monModele=listesDB.sModele().monModele +monPost=listesDB.sModele().monPost + +import types +class Tuple: + def __init__(self,ntuple): + self.ntuple=ntuple + + def __convert__(self,valeur): + if type(valeur) == types.StringType: + return None + if len(valeur) != self.ntuple: + return None + return valeur + + def info(self): + return "Tuple de %s elements" % self.ntuple + + +JdC = JDC_CATA(code='VP', + execmodul=None, + ) + +# ------------------------------------------ +Database = PROC (nom="Database", op=None, +# ------------------------------------------ + Database_Type = SIMP(statut= 'o',typ= 'TXM', into=("Local database", "Standard database"),), + Model_Type = SIMP(statut= 'o',typ= 'TXM', into=("master model", "analytic model" ,"mechanistic model") ), + + AA= FACT(statut = 'o', max='**', + ChemicalFormulation = SIMP(statut='o', typ='TXM', defaut = 'POOH -> 2P'), + ), + +# ------------------------------------------------------------------------ + b_Model_Mechanistic = BLOC(condition = "Model_Type == 'mechanistic model'", +# ------------------------------------------------------------------------ + Type_chgt = SIMP (statut= 'o',typ= 'TXM',into=('modify equation', 'create equation', 'modify model', 'create model') ), + b_creation_equation = BLOC (condition = 'Type_chgt == "create equation"', + Creation = FACT ( statut = 'o', + ChemicalFormulation = SIMP(statut='o', typ='TXM', defaut = 'POOH -> 2P'), + Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max=1, into=('All', 'thermo', 'radio'),), + + Constituants = FACT ( statut = 'o', + POOH = SIMP (statut = 'o', typ = bool, defaut=False), + b_pooh = BLOC(condition = " POOH == True" , + Differential_Equation_POOH = SIMP(statut= 'o',typ= 'TXM', defaut = '-ku1*POOH'), + ), # Fin b_pooh + PO = SIMP (statut = 'o', typ = bool, defaut=False), + b_po = BLOC(condition = " PO == True" , + Differential_Equation_PO = SIMP(statut= 'o',typ= 'TXM', defaut = '-ku1*POOH'), + ), # Fin b_po + New = SIMP (statut = 'o', typ = bool, defaut=False), + b_new = BLOC(condition = " New == True" , + Constituant = FACT ( statut = 'o', min=1, max='**', + Name = SIMP(statut= 'o',typ= 'TXM'), + Differential_Equation = SIMP(statut= 'o',typ= 'TXM'), + ), + ), # b new + ), # fin constituants + + Constantes = FACT ( statut = 'o', # self.const_cine_nom + KU1 = SIMP (statut = 'o', typ = bool, defaut=False), + New = SIMP (statut = 'o', typ = bool, defaut=False), + b_new = BLOC(condition = " New == True" , + Constante = FACT ( statut = 'o', min=1, max='**', + Name = SIMP (statut = 'o', typ = 'TXM'), + ), # fin constante + ), #fin b_new + ), # fin constantes + + Arrhenius = SIMP (statut = 'o', typ = bool, defaut=False), + Comment = SIMP(statut= 'o',typ= 'TXM', defaut = ' '), + ), # fin creation mechanistic model + ), # fin b_create_equation + + b_modify_equation = BLOC (condition = 'Type_chgt == "modify equation"', +# les valeurs par defaut seront lues dans la base de données + Filtre = FACT (statut='o', + Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],), +# Filtre getMechanisticEquation(Reaction_Type) +# diictionnaire key : nom de l equation / valeur classe instancies liste de nom d'equation + Equation_List=SIMP(statut= 'o',typ= 'TXM', min=1,into=['E','quation_Liste'],), + ), + # lorsque le choix est fait on peut recuperer les valeurs par defaut + #ChemicalFormulation = SIMP(statut='o', typ='TXM', defaut = 'POOH -> 2P'), + Modification = FACT (statut='o', + ChemicalFormulation = SIMP(statut='o', typ='TXM', ), # classe.representation + Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste']), # classe.type_react + Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max=1, into=('All', 'thermo', 'radio'),), # classe.type_vieil + + Constituants = FACT ( statut = 'o', # classe.constituants --> liste de nom. les equations sont dans le meme ordre self.equation + POOH = SIMP (statut = 'o', typ = bool, defaut=False), + b_pooh = BLOC(condition = " POOH == True" , + Differential_Equation_POOH = SIMP(statut= 'o',typ= 'TXM', defaut = '-ku1*POOH'), + ), # Fin b_pooh + PO = SIMP (statut = 'o', typ = bool, defaut=False), + b_po = BLOC(condition = " PO == True" , + Differential_Equation_PO = SIMP(statut= 'o',typ= 'TXM', defaut = '-ku1*POOH'), + ), # Fin b_po + New = SIMP (statut = 'o', typ = bool, defaut=False), + b_new = BLOC(condition = " New == True" , + Constituant = FACT ( statut = 'o', min=1, max='**', + Name = SIMP (statut = 'o', typ = 'TXM'), + Differential_Equation = SIMP(statut= 'o',typ= 'TXM'), + ), # Fin Constituant + ), # Fin b_new + ),# Fin Constituants + + Constantes = FACT ( statut = 'o', # self.const_cine_nom + KU1 = SIMP (statut = 'o', typ = bool, defaut=False), + New = SIMP (statut = 'o', typ = bool, defaut=False), + b_new = BLOC(condition = " New == True" , + Constante = FACT ( statut = 'o', min=1, max='**', + Name = SIMP (statut = 'o', typ = 'TXM'), + ), # fin constante + ), #fin b_new + ), # fin constantes + Arrhenius = SIMP (statut = 'o', typ = bool, ), # classe.arrhenius[0] + Comment = SIMP(statut= 'o',typ= 'TXM',), # classe.comment + ), # fin modification + ), # fin b_modify_equation + + + b_create_model = BLOC (condition = 'Type_chgt == "create model"', +# Filtre getMechanisticTechnicalUse(Filtre_TechnicalUse) +# dictionnaire key : nom du modele / valeur classe instancies liste de nom modele +# la classe par defaut getDefaultMechanistic +# renvoie un obj instancie + Creation = FACT (statut='o', + ID=FACT (statut='o', + Name =SIMP(statut='o',typ='TXM'), # obj.nom + Material=SIMP(statut='o',typ='TXM',),# obj.materiaux[0] + TechnicalUse = SIMP(statut= 'o',typ= 'TXM',into=monDico['Modele_TechnicalUse']),#defaut=obj.technical_use + Reference=SIMP(statut='o',typ='TXM',), # defaut=monModele.reference, momModele = obj par la suite + Model_Developed_For_EDF = SIMP(typ = bool, statut = 'o'), #defaut = monModele.dvt_EDF[0] + Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max=1, into=('all', 'thermo', 'radio'),), # defaut = monModele.type_vieil +# attention c est une liste --> a reflechir + Stabilizer = SIMP(typ = bool, statut = 'o'), #,defaut = monModele.stabilise + material_thickness = SIMP(typ = 'TXM', statut = 'o', into = ['thin','thick']), # monModele.thickness + Diffusion = SIMP(typ = bool, statut = 'o'),# defaut = monModele.diffusion ,siValide = lienDB.prepareDiffusion + Evaporation = SIMP(typ = bool, statut = 'o'), # defaut monModele.evaporation + Comment = SIMP(statut= 'o',typ= 'TXM',), # classe.comment + ), #fin id + Equations = FACT (statut = 'o', +# remplir avec getEquation sur modele +# dictionnaire avec comme clef 'base' puis initiation ... + Liste=SIMP(statut= 'o',typ='TXM', min=1,max='**', homo='SansOrdreNiDoublon',into =['POOH -> 2P [k]' , 'A [K5,Y5]', 'B', 'C']), +# quand coche je recupere le nom entre crochet + split sur , attention sans blanc +# et on cree le SIMP apres pour recuperer la valeur + K5=SIMP (statut = 'o', typ = 'R' ), + New = SIMP (statut = 'o', typ = bool, defaut=False), +# + b_new = BLOC(condition = " New == True" , + Add=FACT(statut = 'o',max='**', + Filtre = SIMP(statut= 'o',typ= 'TXM',into=monDico['Equation_Liste']), + Equations=SIMP(statut= 'o',typ='TXM', min=1,max='**', homo='SansOrdreNiDoublon',into =['POOH -> 2P' , 'A', 'B', 'C']) + ) + ), # b new + ) # fin equations + ), #fin creation + ), # fin create model + + b_modify_model = BLOC (condition = 'Type_chgt == "modify model"', +# Filtre getMechanisticTechnicalUse(Filtre_TechnicalUse) +# dictionnaire key : nom du modele / valeur classe instancies liste de nom modele +# la classe par defaut getDefaultMechanistic +# renvoie un obj instancie + Filtre = FACT (statut='o', + TechnicalUse=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Modele_TechnicalUse'],), +# si valide + ModeleName=SIMP(statut='o',typ='TXM',into=['A','B']), # a choisir dans la liste des clefs + ), + Modification = FACT (statut='o', + ID=FACT (statut='o', + Name =SIMP(statut='o',typ='TXM'), # obj.nom + Material=SIMP(statut='o',typ='TXM',),# obj.materiaux[0] + TechnicalUse = SIMP(statut= 'o',typ= 'TXM',into=monDico['Modele_TechnicalUse']),#defaut=obj.technical_use + Reference=SIMP(statut='o',typ='TXM',), # defaut=monModele.reference, momModele = obj par la suite + Model_Developed_For_EDF = SIMP(typ = bool, statut = 'o'), #defaut = monModele.dvt_EDF[0] + Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max=1, into=('all', 'thermo', 'radio'),), # defaut = monModele.type_vieil +# attention c est une liste --> a reflechir + Stabilizer = SIMP(typ = bool, statut = 'o'), #,defaut = monModele.stabilise + material_thickness = SIMP(typ = 'TXM', statut = 'o', into = ['thin','thick']), # monModele.thickness + Diffusion = SIMP(typ = bool, statut = 'o'),# defaut = monModele.diffusion ,siValide = lienDB.prepareDiffusion + Evaporation = SIMP(typ = bool, statut = 'o'), # defaut monModele.evaporation + Comment = SIMP(statut= 'o',typ= 'TXM',), # classe.comment + ), #fin id + Equations = FACT (statut = 'o', +# remplir avec getEquation sur modele +# dictionnaire avec comme clef 'base' puis initiation ... + Liste=SIMP(statut= 'o',typ='TXM', min=1,max='**', homo='SansOrdreNiDoublon',into =['POOH -> 2P [k]' , 'A [K5,Y5]', 'B', 'C']), +# quand coche je recupere le nom entre crochet + split sur , attention sans blanc +# et on cree le SIMP apres pour recuperer la valeur + K5=SIMP (statut = 'o', typ = 'R' ), + New = SIMP (statut = 'o', typ = bool, defaut=False), +# + b_new = BLOC(condition = " New == True" , + Add=FACT(statut = 'o',max='**', + Filtre = SIMP(statut= 'o',typ= 'TXM',into=monDico['Equation_Liste']), + Equations=SIMP(statut= 'o',typ='TXM', min=1,max='**', homo='SansOrdreNiDoublon',into =['POOH -> 2P' , 'A', 'B', 'C']) + ) + ), # b new + ) # fin equations + ), #fin modification + ), # fin modify model + + ), # Fin mechanistic +# ------------------------------------------------------------------------ + b_Model_Analytic = BLOC(condition = "Model_Type == 'analytic model'", + Type_chgt = SIMP (statut= 'o',typ= 'TXM',into=('modify equation', 'create equation', 'modify model', 'create model') ), + + b_creation_equation = BLOC (condition = 'Type_chgt == "create equation"', + Creation = FACT(statut = 'o', + Name=SIMP(statut= 'o',typ= 'TXM',), # defaut o.nom + Equation_Type = SIMP(statut= 'o',typ= 'TXM',into=monDico['posttraitement_Typ']), # defaut o.type_equa + PostProcessing = SIMP (statut = 'o', typ = bool,),# o.post_processing + Calculation_Result = SIMP(statut= 'o',typ= 'TXM'), # defaut o.calculation_result +# dans o.parameters on a une liste + Parameters=SIMP(statut= 'o',typ='TXM', min=1,max='**', homo='SansOrdreNiDoublon',into =['A', 'Ea', 'C']), + New = SIMP (statut = 'o', typ = bool, defaut=False), + b_new = BLOC(condition = " New == True" , + Param = FACT(statut = 'o', max='**', + Name=SIMP(statut= 'o',typ= 'TXM',), + ), #param + ), # b_new + Equation = SIMP(statut= 'o',typ= 'TXM'), # defaut o.equation + Universal_Constants=SIMP(statut= 'o',typ='TXM', min=1,max='**', homo='SansOrdreNiDoublon',into =['A', 'B', 'C']), + Results_Unit = SIMP(statut= 'o',typ= 'TXM'), # defaut o.results_unit + Integrate = SIMP (statut = 'o', typ = bool),# defaut o.integrate + Comment = SIMP(statut= 'o',typ= 'TXM'), # defaut o.comment + ),# Fact creation + ), #bloc b_creation_equation + + b_modification_equation = BLOC (condition = 'Type_chgt == "modify equation"', + Filtre = FACT(statut = 'o', + Equation_Type = SIMP(statut= 'o',typ= 'TXM',into=monDico['posttraitement_Typ']), # defaut o.type_equa + Equation_Choice = SIMP(statut= 'o',typ= 'TXM',into=['A','B','C']), + ), + Modification = FACT(statut = 'o', + Name=SIMP(statut= 'o',typ= 'TXM',), # defaut o.nom + Equation_Type = SIMP(statut= 'o',typ= 'TXM',into=monDico['posttraitement_Typ']), # defaut o.type_equa + PostProcessing = SIMP (statut = 'o', typ = bool,),# o.post_processing + Calculation_Result = SIMP(statut= 'o',typ= 'TXM'), # defaut o.calculation_result +# dans o.parameters on a une liste + Parameters=SIMP(statut= 'o',typ='TXM', min=1,max='**', homo='SansOrdreNiDoublon',into =['A', 'Ea', 'C']), + New = SIMP (statut = 'o', typ = bool, defaut=False), + b_new = BLOC(condition = " New == True" , + Param = FACT(statut = 'o', max='**', + Name=SIMP(statut= 'o',typ= 'TXM',), + ), #param + ), # b_new + Equation = SIMP(statut= 'o',typ= 'TXM'), # defaut o.equation + Universal_Constants=SIMP(statut= 'o',typ='TXM', min=1,max='**', homo='SansOrdreNiDoublon',into =['A', 'B', 'C']), + Results_Unit = SIMP(statut= 'o',typ= 'TXM'), # defaut o.results_unit + Integrate = SIMP (statut = 'o', typ = bool),# defaut o.integrate + Comment = SIMP(statut= 'o',typ= 'TXM'), # defaut o.comment + ),# Fact Modification + + ), #bloc b_modification_equation + ), # Fin model analytic +# ------------------------------------------------------------------------ +# --------------------------------------------------------------------------- + + b_model_master=BLOC(condition = 'Model_Type == "master model"', + Type_chgt = SIMP (statut= 'o',typ= 'TXM',into=('modify model', 'create model') ), + ), +) +## --------------------------------------------------------------------------- +## Est- un Bloc ? +# Equation_Modification = FACT ( statut = 'f', +# +# 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'),), +# Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max=1, into=('All', 'thermo', 'radio'),), +# +## Si un constituant ou une constante est a false il faut faire une liste d elements supprimes en sortie +# Constituants = FACT ( statut = 'o', +# POOH = SIMP (statut = 'o', typ = bool, defaut=False), +# b_pooh = BLOC(condition = " POOH == True" , +# Differential_Equation_POOH = SIMP(statut= 'o',typ= 'TXM', defaut = '-ku1*POOH'), +# ), # Fin b_pooh +# PO = SIMP (statut = 'o', typ = bool, defaut=False), +# b_po = BLOC(condition = " PO == True" , +# Differential_Equation_PO = SIMP(statut= 'o',typ= 'TXM', defaut = '-ku1*POOH'), +# ), # Fin b_po +# New = SIMP (statut = 'o', typ = bool, defaut=False), +# b_new = BLOC(condition = " New == True" , +# Constituant = FACT ( statut = 'o', min=1, max='**', +# Name = SIMP (statut = 'o', typ = 'TXM'), +# Differential_Equation = SIMP(statut= 'o',typ= 'TXM'), +# ), # Fin Constituant +# ), # Fin b_new +# ),# Fin Constituants +# +# +# +# Constantes = FACT ( statut = 'o', +# KU1 = SIMP (statut = 'o', typ = bool, defaut=False), +# New = SIMP (statut = 'o', typ = bool, defaut=False), +# b_new = BLOC(condition = " New == True" , +# Constante = FACT ( statut = 'o', min=1, max='**', +# Name = SIMP (statut = 'o', typ = 'TXM'), +# ), # fin constante +# ), #fin b_new +# ), # fin constantes +# +# Arrhenius = SIMP (statut = 'o', typ = bool, defaut=False), +# Comment = SIMP(statut= 'o',typ= 'TXM', defaut = ' '), +# ), # Fin Equation_Modification +# +# +# +## _____________________________________________ +# +# Equation_Modification2 = FACT ( statut = 'f', +# Name = SIMP (statut = 'o', typ = 'TXM', defaut = 'Arrhenuis'), +# PostProcessing = SIMP (statut = 'o', typ = bool, defaut=False), +# Parameters = FACT ( statut = 'o', +# POOH = SIMP (statut = 'o', typ = bool, defaut=False), +# PO = SIMP (statut = 'o', typ = bool, defaut=False), +# New = SIMP (statut = 'o', typ = bool, defaut=False), +# b_new = BLOC(condition = " New == True" , +# Parametre = FACT ( statut = 'o', min=1, max='**', +# Name = SIMP (statut = 'o', typ = 'TXM'), +# ), +# ), +# ), +# Universal_Constantes = FACT ( statut = 'o', +# R = SIMP (statut = 'o', typ = bool, defaut=False), +# New = SIMP (statut = 'o', typ = bool, defaut=False), +# b_new = BLOC(condition = " New == True" , +# Equation = FACT ( statut = 'o', min=1, max='**', +# Name = SIMP (statut = 'o', typ = 'TXM'), +# Equation = SIMP (statut = 'o', typ = 'TXM'), +# Unit = SIMP (statut = 'o', typ = 'TXM', defaut = "mol.l-1"), +# Integrate = SIMP (statut = 'o', typ = bool, defaut=True), +# ), +# ), +# ), +# +# Comment = SIMP(statut= 'o',typ= 'TXM', defaut = ' '), +# Reference = SIMP(statut= 'o',typ= 'TXM', defaut = ' '), +# ), # Fin Modification 2 +# +## ---------------------------------------------------------------------------- +## b_type_mechanistic_a = BLOC(condition = " Model_Type == 'mechanistic model'", +## -------------------------------------------------------------------------- +## Model_Mechanistic = FACT ( statut = 'f', +# ModeleName=SIMP(statut='o',typ='TXM',defaut=monModele.nom,), +# Material=SIMP(statut='o',typ='TXM',defaut=monModele.materiaux[0],), +# TechnicalUse = SIMP(statut= 'o',typ= 'TXM',into=monDico['Modele_TechnicalUse'],defaut=monModele.technical_use ), +# Documentation=SIMP(statut='o',typ='TXM',defaut=monModele.reference,), +# Model_Developed_For_EDF = SIMP(typ = bool, statut = 'o',defaut = monModele.dvt_EDF[0]), +# #Aging_Type=SIMP(statut= 'o',typ='TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'), defaut=monModele.type_vieil), +# Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max=1, into=('both', 'thermo', 'radio'),), +# Stabilizer = SIMP(typ = bool, statut = 'o',defaut = monModele.stabilise), +# Diffusion = SIMP(typ = bool, statut = 'o',defaut = False ,siValide = lienDB.prepareDiffusion), +# b_diffusion = BLOC(condition = " Diffusion == True", +# ForDiffusion=SIMP(statut='o', typ='TXM', max='**', min=1,homo='SansOrdreNiDoublon', into = [],siValide=lienDB.ajouteDiffusion), +# ), # fin b_diffusion +# +# Evaporation = SIMP(typ = bool, statut = 'o',defaut = False ,siValide = lienDB.prepareDiffusion), +# b_evaporation = BLOC(condition = " Evaporation == True", +# ForEvaporation=SIMP(statut='o', typ='TXM', max='**', min=1,homo='SansOrdreNiDoublon', into = [],siValide=lienDB.ajouteEvaporation), +# ), # fin b_evaporation +# ), + +# ), # fin bloc b_type_mechanistic + + +# ---------------------------------------------- +Calculation = PROC (nom="Calculation", op=None, +# ---------------------------------------------- + Database=SIMP(statut= 'o',typ= 'TXM', into=("local database", "standard database") ), + Model=SIMP(statut= 'o',typ= 'TXM', into=("master model", "analytic model" ,"mechanistic model") ), + b_Model_Name = BLOC(condition = 'Model in ("master model","mechanistic model")', + TechnicalUse= SIMP(statut= 'o',typ= 'TXM',into=monDico['Modele_TechnicalUse'],defaut=monModele.technical_use ), + ModeleName=SIMP(statut='o',typ='TXM',defaut=monModele.nom,), +# filtre_calculation_mechanistic - > 3 dictionnaires +# la clef du 1er niveau est le modele qui remplit SimulationName + ), + + +# MASTER MODEL + b_simulation_modele = BLOC(condition = 'Model == "master model"', + Analytical_Equations = FACT(statut= 'o', max='**', + Consigne = SIMP(statut ="o", homo="information", typ="TXM", defaut = "Equation A"), + Clef1=SIMP(statut='o',typ='R'), + Clef2=SIMP(statut='o',typ='R'), + ), + ChemicalKinetics = FACT ( statut = 'o', + SimulationName=SIMP(statut='o',typ='TXM'), + OutputFolder = SIMP(statut="o", typ="Repertoire"), + Time=SIMP(statut='o',typ='R',), + Temperature=SIMP(statut='o',typ='R',), + DebitOfDose=SIMP(statut='o',typ='R',), + Thickness=SIMP(statut='o',typ='R',), + Dicretization= SIMP(statut='o',typ='R',), +# remplir les equations + InitialValue = SIMP(statut ='o', typ=Tuple(2),validators = VerifTypeTuple(('TXM','R')),max='**'), + + Boundary_Conditions = FACT(statut='o', + Product=FACT(statut='o', max='**', +# a remplir avec le filtre une liste des boundary +# ----------------------------------- + Consigne = SIMP(statut ="o", homo="information", typ="TXM", defaut = "Diffusion Product"), + Node_0 = FACT (statut='o', + Boundary_Condition_Type = SIMP(statut='o',typ='TXM',into=monDico['Boundary_Conditions']), + Value=SIMP(statut='o',typ='R',defaut=0), + ), + Node_N = FACT (statut='o', + Boundary_Condition_Type = SIMP(statut='o',typ='TXM',into=monDico['Boundary_Conditions']), + Value=SIMP(statut='o',typ='R',defaut=0), + ), + ), + ), + ),# fin ChemicalKinetics + Analytical_Equations_PostTreatment = FACT(statut= 'o', max='**', + Consigne = SIMP(statut ="o", homo="information", typ="TXM", defaut = "Equation A"), + Clef1=SIMP(statut='o',typ='R'), + Clef2=SIMP(statut='o',typ='R'), + ), + ), # fin bloc b_simulation_modele + + + + + +# MECHANISTIC MODEL +# filtre_calculation_mechanistic - > 3 dictionnaires +# la clef du 1er niveau est le modele qui remplit SimulationName +# + b_mechanistic = BLOC(condition = 'Model == "mechanistic model"', + ChimicalKinetics = FACT ( statut = 'o', + SimulationName=SIMP(statut='o',typ='TXM'), + OutputFolder = SIMP(statut="o", typ="Repertoire"), + Time=SIMP(statut='o',typ='R',), + Temperature=SIMP(statut='o',typ='R',), +# si dans le dictionnaire debit_of_dose = True je rentre la ligne suivante + DebitOfDose=SIMP(statut='o',typ='R',), + Thickness=SIMP(statut='o',typ='R',), + Dicretization= SIMP(statut='o',typ='R',), +# initial_parameter pour remplir cela + InitialValue = SIMP(statut ='o', typ=Tuple(2),validators = VerifTypeTuple(('TXM','R')),max='**'), + ), + +# si la liste est vide pas de Boundary_Conditions_Param sinon on cree les products + Boundary_Conditions_Param = FACT(statut='o', + Product=FACT(statut='o', max='**', +# a remplir avec le filtre une liste des boundary +# ----------------------------------- + Consigne = SIMP(statut ="o", homo="information", typ="TXM", defaut = "Diffusion Product"), + Node_0 = FACT (statut='o', + Boundary_Condition_Type = SIMP(statut='o',typ='TXM',into=monDico['Boundary_Conditions']), + Value=SIMP(statut='o',typ='R',defaut=0), + ), + Node_N = FACT (statut='o', + Boundary_Condition_Type = SIMP(statut='o',typ='TXM',into=monDico['Boundary_Conditions']), + Value=SIMP(statut='o',typ='R',defaut=0), + ), + ), + ), + ), # fin bloc b_simulation_modele + +# ANALYTIC MODEL + b_analytic_model = BLOC(condition = 'Model == "analytic model"', + Equation_Ty = SIMP(statut= 'o',typ= 'TXM',into=monDico['Equation_Liste']), + ModeleName=SIMP(statut='o',typ='TXM',defaut=monModele.nom,), + ChimicalKinetics = FACT ( statut = 'o', + SimulationName=SIMP(statut='o',typ='TXM'), + OutputFolder = SIMP(statut="o", typ="Repertoire"), +# remplir les equations + Equation = FACT(statut= 'o', max='**', + Consigne = SIMP(statut ="o", homo="information", typ="TXM", defaut = "Equation A"), +# dictionnaire cief de filtre_calculation_analitic avec clef = clef1, clef2... et valeur = coef[cle1] + Clef1=SIMP(statut='o',typ='R'), + Clef2=SIMP(statut='o',typ='R'), + ), + ), + ), # fin bloc b_analytic_model + +) + +# diffusionSpecies=SIMP(statut='o',typ='TXM',defaut='O2', into=['O2',]), +# nodeNumber = SIMP(statut='o',typ='I',defaut=1, into=[1]), # tjours1 +# BC_Value_Espece_1=SIMP(statut='o',typ='R'), +# nodeNumber_Espece_4 = SIMP(statut='o',typ='I',defaut=4, into=[4]), # numberOfNodes+1 +# Boundary_Conditions_Espece_4 = SIMP(statut='o',typ='TXM',into=monDico['Boundary_Conditions']), +# BC_Value_Espece_4=SIMP(statut='o',typ='R'), + + + +##--------------------------------- +#Equation = PROC (nom="Equation", +# op=None, +##--------------------------------- +# Equation_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base") ), +# #b_suite = BLOC(condition = "Equation_DB == 'My data base' ", +# Equation_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show equation database", "Equation creation"),), +# #), +# #b_suite_2 = BLOC(condition = "Equation_DB == 'Approved data base' ", +# #Equation_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show equation database", ),), +# #), +# +## --------------------------------------------------------------------------- +# 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=lienDB.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=lienDB.recupereDicoEquation), +# ), # Fin b_reaction_type +# +# ListeEquation = SIMP(statut='o', typ='TXM', homo='SansOrdreNiDoublon',siValide=lienDB.afficheValeurEquation), +# #ListeEquation = SIMP(statut='o', typ='TXM', homo='SansOrdreNiDoublon'), +# b_modification = BLOC(condition = " ListeEquation != None ", diff --git a/VirtualPolymer/lienDB.py b/VirtualPolymer/lienDB.py index b834fc4d..ab2eb206 100644 --- a/VirtualPolymer/lienDB.py +++ b/VirtualPolymer/lienDB.py @@ -220,7 +220,7 @@ def recupereModeleEquation(monMC): maClasseDelistesDB.dictParametresInitiaux[equation.representation]=equation #print (dicoListeEquationAAfficher) #print('maClasseDelistesDB.dictParametresInitiaux', maClasseDelistesDB.dictParametresInitiaux) - prepareDiffusionSansMC(editor,monMC.nom) + prepareDiffusionSansMC(editor,monMC.nom,monMC) change=editor.changeIntoDefMC('Modele', ('b_type_creation','Chemical_Equation','b_ajout_equation','listeEquation_initiation'),dicoListeEquationAAfficher['initiation']) change=editor.changeIntoDefMC('Modele', ('b_type_creation','Chemical_Equation','b_ajout_equation','listeEquation_propagation'),dicoListeEquationAAfficher['propagation'] ) @@ -236,7 +236,7 @@ def ajoutDUneEquation(monMC): if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return if monMC.valeur==False : return editor=monMC.jdc.editor - prepareDiffusionSansMC(editor,monMC.nom) + prepareDiffusionSansMC(editor,monMC) if hasattr(editor,'dsMaFunct') and editor.dsMaFunct== True : return editor.dsMaFunct = False monMC.dsMaFunct = False @@ -249,22 +249,29 @@ def prepareDiffusion(monMC): if hasattr(editor,'dsMaFunct') and editor.dsMaFunct== True : return editor.dsMaFunct = True print ('je suis dans prepareDiffusion', monMC.nom) - prepareDiffusionSansMC(editor,monMC.nom) + prepareDiffusionSansMC(editor,monMC) print ('fin de prepareDiffusion', monMC.nom) monMC.dsMaFunct=False editor.dsMaFunct = False -def prepareDiffusionSansMC(editor,monMCNom): - lInitialBadCoche=editor.getValeur('Modele', 'Initial_Equation_List',('b_type_creation','Chemical_Equation'),) +def prepareDiffusionSansMC(editor,monMC): + #lInitialBadCoche=editor.getValeur('Modele', 'Initial_Equation_List',('b_type_creation','Chemical_Equation'),) + monMCNom = monMC.nom + monEtape = monMC.getEtape() + lInitialBadCoche=editor.getValeurDsEtape(monEtape, 'ForDiffusion',('b_type_mechanistic','Model_Mechanistic','b_diffusion'),) + if lInitialBadCoche == None : lInitialBadCoche=[] lInitialCoche=[] for equ in lInitialBadCoche: lInitialCoche.append(equ.split('\t')[0]) - lInititiationCoche=editor.getValeur('Modele','listeEquation_initiation', ('b_type_creation','Chemical_Equation',)) - lPropagationCoche =editor.getValeur('Modele', 'listeEquation_propagation',('b_type_creation','Chemical_Equation',)) - lTerminationCoche=editor.getValeur('Modele','listeEquation_termination', ('b_type_creation','Chemical_Equation',)) - lStabilizationCoche=editor.getValeur('Modele','listeEquation_stabilization', ('b_type_creation','Chemical_Equation',)) + print (lInitialCoche) + print ('kkkkkkkkkkkkhhhhhhhhhhhhhhhhhhhhhhhhhhh') - print (lInitialCoche,lInititiationCoche,lPropagationCoche,lTerminationCoche,lStabilizationCoche) - for liste in (lInitialCoche,lInititiationCoche,lPropagationCoche,lTerminationCoche,lStabilizationCoche): + #PropagationCoche =editor.getValeur('Modele', 'listeEquation_propagation',('b_type_creation','Chemical_Equation',)) + #TerminationCoche=editor.getValeur('Modele','listeEquation_termination', ('b_type_creation','Chemical_Equation',)) + #lStabilizationCoche=editor.getValeur('Modele','listeEquation_stabilization', ('b_type_creation','Chemical_Equation',)) + + #print (lInitialCoche,lInititiationCoche,lPropagationCoche,lTerminationCoche,lStabilizationCoche) + #for liste in (lInitialCoche,lInititiationCoche,lPropagationCoche,lTerminationCoche,lStabilizationCoche): + for liste in (lInitialCoche,): # Il est possible qu'une liste soit vide lors de l initialisation if liste == None : continue for equation in liste : @@ -278,6 +285,7 @@ def prepareDiffusionSansMC(editor,monMCNom): if coef not in maClasseDelistesDB.listeCoefInitiaux : maClasseDelistesDB.listeCoefInitiaux.append(coef) #print('maClasseDelistesDB.dictParametresInitiaux', maClasseDelistesDB.dictParametresInitiaux) + print (maClasseDelistesDB.listeParametresInitiaux) if monMCNom == 'Diffusion' : change=editor.changeIntoDefMC('Modele', ('b_type_creation','Transport','b_diffusion','listeProduitPourLaDiffusion'), maClasseDelistesDB.listeParametresInitiaux ) if monMCNom == 'Evaporation' : diff --git a/VirtualPolymer/prefs_VP.py b/VirtualPolymer/prefs_VP.py index 05f4f643..0d8010ce 100644 --- a/VirtualPolymer/prefs_VP.py +++ b/VirtualPolymer/prefs_VP.py @@ -37,9 +37,10 @@ encoding='iso-8859-1' catalogues=( ('VP','V1',os.path.join(repIni,'VP_Cata_V2.py'),'python','python'), ) -nombreDeBoutonParLigne=3 +nombreDeBoutonParLigne=2 closeFrameRechercheCommande = True closeEntete = True #closeArbre = True afficheOptionnelVide=False +#### il faut afficher les listes pliees