+++ /dev/null
-# coding: utf-8\r
-import types\r
-from Accas import *\r
-import sys,os\r
-sys.path.append('/home/A96028/opt/MAP/map-2016.1/lib/python2.7/site-packages/mapy/components/c_pre_polymer_data_management')\r
-sys.path.append('/home/A96028/opt/MAP/map-2016.1/lib/python2.7/site-packages/mapy/virtual_polymer_common')\r
-sys.path.append('/home/A96028/opt/MAP/map-2016.1/lib/python2.7/site-packages/')\r
-import pckdb, class_data, instruction, equation_part, utils\r
-\r
-\r
-class Tuple:\r
- def __init__(self,ntuple):\r
- self.ntuple=ntuple\r
-\r
- def __convert__(self,valeur):\r
- if type(valeur) == types.StringType: return None\r
- if len(valeur) != self.ntuple: return None\r
- return valeur\r
-\r
- def info(self):\r
- return "Tuple de %s elements" % self.ntuple\r
-\r
- __repr__=info\r
- __str__=info\r
-\r
-#class ObjetUtilisateur(ASSD): pass\r
-\r
-class classeVisuEquation :\r
- def __init__(self,dicoListeAffiche):\r
- self.dicoListeAffiche=dicoListeAffiche\r
- \r
-\r
-def maFunc():\r
- return ('a1','a2','a3')\r
- \r
-def maFuncWithArg(monMC):\r
- if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return\r
- monMC.dsMaFunct = True\r
-\r
- editor=monMC.jdc.editor\r
- if monMC.valeur == 'POOH->P' : monInto=('a1','a2','a3')\r
- else : monInto=('b1','b2','b3')\r
-\r
- change=editor.changeIntoDefMC('AGING', ('Equation', 'b_approved','b_type_creation','Equation_Modification','Type2'), monInto )\r
- if change :\r
- print ('j ai change le into')\r
- editor.reCalculeValiditeMCApresChgtInto('AGING', 'Type2', ('Equation', 'b_approved','b_type_creation','Equation_Modification')) \r
- if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()\r
-\r
- monMC.dsMaFunct = False\r
-\r
-def recupereDicoGenerique(monMC):\r
- if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return\r
- print ('je passe dans la recuperation')\r
- editor=monMC.jdc.editor\r
- valeurDB=editor.getValeur('Equation','Equation_DB',())\r
- print ('valeurDB',valeurDB)\r
- correspond=pckdb.DBRENAME\r
- if valeurDB != None :\r
- listEquation, listModele,listePostTraitement=pckdb.read_pckdb(correspond[valeurDB])\r
- print (listEquation, listModele,listePostTraitement)\r
- monMC.dsMaFunct = False\r
- return listEquation, listModele,listePostTraitement\r
-\r
-def recupereDicoEquation(monMC):\r
- if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return\r
- listEquation, listModele,listePostTraitement=recupereDicoGenerique(monMC)\r
- editor=monMC.jdc.editor\r
-\r
- valeurEquationListe=editor.getValeur('Equation','Equation_Liste',('b_type_show',))\r
- valeurAgingType=editor.getValeur('Equation','Equation_reaction',('b_type_show','b_reaction_type',))\r
- if valeurAgingType == None :\r
- print ('dans reaction-type')\r
- valeurAgingType=editor.getValeur('Equation','Equation_reaction',('b_type_show','b_aging_type',))\r
- if valeurAgingType == None : monMC.dsMaFunct = False; return\r
-\r
- print ('valeurType',valeurAgingType)\r
- listeEquationPourIhm = []\r
- listeReprEquationPourIhm = []\r
- dicoListeAffiche={}\r
- for equation in listEquation :\r
- if valeurEquationListe == 'aging_type' :\r
- if equation.type_vieil == valeurAgingType : \r
- listeEquationPourIhm.append(equation)\r
- listeReprEquationPourIhm.append(equation.representation)\r
- dicoListeAffiche[equation.representation]=equation\r
- else:\r
- if equation.type_react == valeurAgingType : \r
- listeEquationPourIhm.append(equation)\r
- listeReprEquationPourIhm.append(equation.representation)\r
- dicoListeAffiche[equation.representation]=equation\r
- change=editor.changeIntoDefMC('Equation', ('b_type_show','ListeEquation'), listeReprEquationPourIhm )\r
- if change :\r
- editor.reCalculeValiditeMCApresChgtInto('Equation', 'listeEquation', ('b_type_show',)) \r
- if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()\r
- editor.maClasseVisuEquation = classeVisuEquation(dicoListeAffiche)\r
- monMC.dsMaFunct = False\r
-\r
-def afficheValeurEquation(monMC):\r
- if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return\r
- editor=monMC.jdc.editor\r
- valeur=monMC.valeur\r
- if valeur == None : \r
- monMC.dsMaFunct = False\r
- return\r
- print (editor.maClasseVisuEquation.dicoListeAffiche[valeur])\r
- print(str (editor.maClasseVisuEquation.dicoListeAffiche[valeur]))\r
- editor.maClasseVisuEquation.valeurEquationChoisie=valeur\r
- monMC.dsMaFunct = False\r
- \r
-\r
-def instancieChemicalFormulation(monMC):\r
- if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return\r
- if monMC.valeur == False : return\r
-\r
- editor=monMC.jdc.editor\r
- if hasattr(editor,'dsMaFunct') and editor.dsMaFunct== True : return\r
- editor.dsMaFunct = True\r
-\r
- print ('ds instancie')\r
- v=editor.maClasseVisuEquation.valeurEquationChoisie\r
- monEquation=editor.maClasseVisuEquation.dicoListeAffiche[v]\r
- type_react=monEquation.type_react\r
- type_vieil=monEquation.type_vieil\r
- print (v, type_react, type_vieil)\r
- #editor.changeIntoMCandSet('Equation', ('b_type_show','b_modification','b_modif','ChemicalFormulation'),( v,),v )\r
- change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Reaction_Type'),type_react )\r
- change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Aging_Type'), type_vieil )\r
-\r
- for index,valeurConstituant in enumerate(monEquation.constituants):\r
- valeurEquation=monEquation.equation[index] \r
- editor.ajoutMC(monMC.etape,'OptionnelConstituant',None,('b_type_show','b_modification','b_modif',))\r
- print (index,valeurConstituant,valeurEquation)\r
-\r
- #OptionnelConstituant = FACT ( statut = 'f',max = '**',\r
- # Constituant = SIMP (statut = 'o', typ = 'TXM'),\r
- # Differential_Equation = SIMP(statut= 'o',typ= 'TXM'),\r
- for index,valeurConstituant in enumerate(monEquation.const_cine_nom):\r
- valeurArrhe=monEquation.arrhenius[index] \r
- if valeurArrhe : valeurConstanteType='Arrhenius type'\r
- else : valeurConstanteType='non Arrhenius type'\r
-\r
- print (index,valeurConstituant,valeurConstanteType)\r
- #OptionnelleConstante = FACT (statut = 'f', max = '**',\r
- # ConstanteName= SIMP (statut = 'o', typ = 'TXM',),\r
- # ConstanteType = SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'),\r
- change=editor.changeDefautDefMC('Equation', ('b_type_show','b_modification','b_modif','Commentaire'),monEquation.comment )\r
- print (monEquation.comment )\r
- #if change :\r
- if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()\r
- monMC.dsMaFunct = False\r
- editor.dsMaFunct = False\r
- \r
-\r
-\r
-monDico= { 'Equation_Liste' : ('initiation', 'propagation', 'termination', 'stabilization')}\r
-\r
-JdC = JDC_CATA(code='VP',\r
- execmodul=None,\r
- )\r
-\r
-\r
- \r
-#---------------------------------\r
-Equation = PROC (nom="Equation",\r
- op=None,\r
-#---------------------------------\r
- Equation_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base") ),\r
- Equation_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show equation database", "Equation creation"),),\r
-\r
- \r
-# ---------------------------------------------------------------------------\r
- b_type_show = BLOC(condition = " Equation_Type == 'Show equation database'",\r
-# ---------------------------------------------------------------------------\r
- Equation_Liste=SIMP(statut= 'o',typ= 'TXM', into=('reaction_type','aging_type')),\r
-\r
- b_reaction_type = BLOC(condition = " Equation_Liste == 'reaction_type'",\r
- Equation_reaction=SIMP(statut= 'o',typ= 'TXM', into=monDico['Equation_Liste'],siValide=recupereDicoEquation),\r
- ), # Fin b_reaction_type\r
-\r
- b_aging_type = BLOC(condition = " Equation_Liste == 'aging_type'",\r
- Equation_reaction=SIMP(statut= 'o',typ= 'TXM', into=('All', 'thermo', 'radio'),siValide=recupereDicoEquation),\r
- ), # Fin b_reaction_type\r
-\r
- ListeEquation = SIMP(statut='o', typ='TXM', homo='SansOrdreNiDoublon',siValide=afficheValeurEquation),\r
- b_modification = BLOC(condition = " ListeEquation != None ",\r
- modification = SIMP(typ = bool, statut = 'o',defaut = False, fr='toto', ang='toto en anglais', siValide=instancieChemicalFormulation),\r
- \r
- b_modif = BLOC(condition = "modification == True",\r
- Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],),\r
- Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'),),\r
-\r
- OptionnelConstituant = FACT ( statut = 'f',max = '**',\r
- Constituant = SIMP (statut = 'o', typ = 'TXM'),\r
- Differential_Equation = SIMP(statut= 'o',typ= 'TXM'),\r
- ), # fin Const_Equa\r
- OptionnelleConstante = FACT (statut = 'f', max = '**',\r
- ConstanteName= SIMP (statut = 'o', typ = 'TXM',),\r
- ConstanteType = SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'),\r
- ),# fin ConstanteOptionnelle\r
- Commentaire = SIMP (statut = 'f', typ = 'TXM', defaut = ' '),\r
-\r
- ),# fin b_modif\r
- \r
- ), # fin b_modification\r
- ), # Fin b_type_show\r
-\r
-\r
-# ---------------------------------------------------------------------------\r
- b_type_creation = BLOC(condition = " Equation_Type == 'Equation creation'",\r
-# ---------------------------------------------------------------------------\r
- Equation_Modification = FACT ( statut = 'o',\r
- \r
- ChemicalFormulation = SIMP(statut='o', typ='TXM', defaut = 'POOH -> 2P'),\r
-\r
- Reaction_Type=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],),\r
- Aging_Type=SIMP(statut= 'o',typ= 'TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'),),\r
-\r
- Constituants = FACT ( statut = 'o',\r
- ConstituantPOOH = SIMP (statut = 'f', typ = 'TXM', into = ('POOH',), defaut= 'POOH'),\r
- b_pooh = BLOC(condition = " ConstituantPOOH == 'POOH'" ,\r
- Differential_Equation = SIMP(statut= 'o',typ= 'TXM', defaut = '-ku1*POOH'),\r
- ), # Fin b_pooh\r
- ConstituantP = SIMP (statut = 'f', typ = 'TXM', into = ('P',),defaut='P'),\r
- b_p = BLOC(condition = " ConstituantP == 'P'" ,\r
- Differential_Equation = SIMP(statut= 'o',typ= 'TXM', defaut = '2*ku1*POOH'),\r
- ), # Fin b_p\r
- OptionnelConstituant = FACT ( statut = 'f',max = '**',\r
- Constituant = SIMP (statut = 'o', typ = 'TXM'),\r
- Differential_Equation = SIMP(statut= 'o',typ= 'TXM'),\r
- ), # fin Const_Equa\r
- ),# Fin Constituants\r
-\r
- Constante = FACT ( statut = 'o',\r
- Constanteku1 = SIMP (statut = 'f', typ = 'TXM', into = ('ku1',), defaut= 'ku1'),\r
- b_cku1 = BLOC(condition = "Constanteku1 == 'ku1'" ,\r
- ConstanteType = SIMP(statut= 'o',typ= 'TXM', into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'),\r
- ),\r
- OptionnelleConstante = FACT (statut = 'f', max = '**',\r
- ConstanteName= SIMP (statut = 'o', typ = 'TXM',),\r
- ConstanteType = SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'),\r
- ),# fin ConstanteOptionnelle\r
- ), # fin constante\r
- Commentaire = SIMP (statut = 'f', typ = 'TXM', defaut = ' '),\r
- \r
- ), # Fin Equation_Modification\r
-\r
- #Chemical_Formulation = SIMP(statut= 'o',typ= 'TXM', defaut = 'POOH->P',siValide=maFuncWithArg),\r
- #Type1 = SIMP(statut='o', typ = 'TXM', into=maFunc),\r
- #Type2 = SIMP(statut='o', typ = 'TXM'),\r
-\r
- ), # fin b_type_creation\r
- \r
- \r
-) # Fin Equation\r
-\r
-Modele = PROC (nom="Modele",\r
- op=None,\r
- Commentaire = SIMP (statut = 'f', typ = 'TXM'),\r
-) # Fin Modele\r
+++ /dev/null
-# coding: utf-8\r
-import types\r
-from Accas import *\r
-\r
-\r
-class Tuple:\r
- def __init__(self,ntuple):\r
- self.ntuple=ntuple\r
-\r
- def __convert__(self,valeur):\r
- if type(valeur) == types.StringType: return None\r
- if len(valeur) != self.ntuple: return None\r
- return valeur\r
-\r
- def info(self):\r
- return "Tuple de %s elements" % self.ntuple\r
-\r
- __repr__=info\r
- __str__=info\r
-\r
-#class ObjetUtilisateur(ASSD): pass\r
-\r
-def maFunc():\r
- return ('a1','a2','a3')\r
- \r
-def maFuncWithArg(monMC):\r
- if hasattr(monMC,'dsMaFunct') and monMC.dsMaFunct== True : return\r
- monMC.dsMaFunct = True\r
-\r
- editor=monMC.jdc.editor\r
- if monMC.valeur == 'POOH->P' : monInto=('a1','a2','a3')\r
- else : monInto=('b1','b2','b3')\r
-\r
- change=editor.changeIntoDefMC('AGING', ('Equation', 'b_approved','b_type_creation','Equation_Modification','Type2'), monInto )\r
- if change :\r
- print ('j ai change le into')\r
- editor.reCalculeValiditeMCApresChgtInto('AGING', 'Type2', ('Equation', 'b_approved','b_type_creation','Equation_Modification')) \r
- if editor.fenetreCentraleAffichee : editor.fenetreCentraleAffichee.node.affichePanneau()\r
-\r
- monMC.dsMaFunct = False\r
-\r
-\r
-\r
-monDico= { 'Equation_Liste' : ('initiation', 'propagation', 'termination', 'stabilization')}\r
-\r
-JdC = JDC_CATA(code='VP',\r
- execmodul=None,\r
- )\r
-\r
-\r
-AGING = PROC (nom="AGING",\r
- op=None,\r
- \r
-#---------------------------------\r
- Equation = FACT(statut= 'o',\r
-#---------------------------------\r
- Equation_DB=SIMP(statut= 'o',typ= 'TXM', into=("Approved data base", "My data base") ),\r
- Equation_Type = SIMP(statut= 'o',typ= 'TXM', into=("Show equation database", "Equation creation"),),\r
-\r
-# ---------------------------------------------------------------------------\r
- b_type_show = BLOC(condition = " Equation_Type == 'Show equation database'",\r
-# ---------------------------------------------------------------------------\r
- Equation_Liste=SIMP(statut= 'o',typ= 'TXM', into=('reaction_type','aging_type')),\r
-\r
- b_reaction_type = BLOC(condition = " Equation_Liste == 'reaction_type'",\r
- Equation_reaction=SIMP(statut= 'o',typ= 'TXM', into=monDico['Equation_Liste'],),\r
- ), # Fin b_reaction_type\r
-\r
- b_aging_type = BLOC(condition = " Equation_Liste == 'aging_type'",\r
- Equation_reaction=SIMP(statut= 'o',typ= 'TXM', into=('All', 'thermo', 'radio'),),\r
- ), # Fin b_reaction_type\r
-\r
- ), # Fin b_type_show\r
-\r
-# ---------------------------------------------------------------------------\r
- b_type_creation = BLOC(condition = " Equation_Type == 'Equation creation'",\r
-# ---------------------------------------------------------------------------\r
- Equation_Modification = FACT ( statut = 'o',\r
- Chemical_Formulation = SIMP(statut= 'o',typ= 'TXM', defaut = 'POOH->P'),\r
- Equation_reaction1=SIMP(statut= 'o',typ= 'TXM', min=1,into=monDico['Equation_Liste'],),\r
- Equation_reaction2=SIMP(statut= 'o',typ= 'TXM', min=1,max='**', homo='SansOrdreNiDoublon', into=('All', 'thermo', 'radio'),),\r
-\r
- Constituants = FACT ( statut = 'o',\r
- ConstituantPOOH = SIMP (statut = 'f', typ = 'TXM', into = ('POOH',), defaut= 'POOH'),\r
- b_pooh = BLOC(condition = " ConstituantPOOH == 'POOH'" ,\r
- Differential_Equation = SIMP(statut= 'o',typ= 'TXM', defaut = '-ku1*POOH'),\r
- ), # Fin b_pooh\r
- ConstituantP = SIMP (statut = 'f', typ = 'TXM', into = ('P',),defaut='P'),\r
- b_p = BLOC(condition = " ConstituantP == 'P'" ,\r
- Differential_Equation = SIMP(statut= 'o',typ= 'TXM', defaut = '2*ku1*POOH'),\r
- ), # Fin b_p\r
- OptionnelConstituant = FACT ( statut = 'f',max = '**',\r
- Constituant = SIMP (statut = 'o', typ = 'TXM'),\r
- Differential_Equation = SIMP(statut= 'o',typ= 'TXM'),\r
- ), # fin Const_Equa\r
- ),# Fin Constituants\r
-\r
- Constante = FACT ( statut = 'o',\r
- Constanteku1 = SIMP (statut = 'f', typ = 'TXM', into = ('ku1',), defaut= 'ku1'),\r
- b_cku1 = BLOC(condition = "Constanteku1 == 'ku1'" ,\r
- ConstanteType = SIMP(statut= 'o',typ= 'TXM', into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'),\r
- ),\r
- ConstanteOptionnelle = FACT (statut = 'f', max = '**',\r
- ConstanteName= SIMP (statut = 'o', typ = 'TXM',),\r
- ConstanteType = SIMP(statut= 'o',typ= 'TXM', min=1,into=('Arrhenius type','non Arrhenius type'),defaut='Arrhenius type'),\r
- ),# fin ConstanteOptionnelle\r
- ), # fin constante\r
- Commentaire = SIMP (statut = 'f', typ = 'TXM'),\r
- \r
- ), # Fin Equation_Modification\r
-\r
-\r
- #Chemical_Formulation = SIMP(statut= 'o',typ= 'TXM', defaut = 'POOH->P',siValide=maFuncWithArg),\r
- #Type1 = SIMP(statut='o', typ = 'TXM', into=maFunc),\r
- #Type2 = SIMP(statut='o', typ = 'TXM'),\r
-\r
- ), # fin b_type_creation\r
- \r
- \r
- ), # Fin Equation\r
-)\r
-\r
-TEXTE_NEW_JDC="AGING()"\r