FUNCTIONDICT_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=(OnlyStr()), fr="OBSOLETE : conservé pour compatibilité avec la version 6.5, sera supprimé dans le futur", ang="OBSOLETE: keeped for compatibility with the 6.5 version, will be removed in the future"),
),
+ TEMPLATE_DATA = BLOC (condition = " FROM in ( 'Template', ) ",
+ Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "AnalysisPrinter", into=("AnalysisPrinter", "AnalysisSaver", "AnalysisPrinterAndSaver")),
+ AnalysisPrinter = BLOC (condition = " Template == 'AnalysisPrinter' ",
+ ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\\nxa=numpy.ravel(ADD.get('Analysis')[-1])\\nprint 'Analysis:',xa" ),
+ ),
+ AnalysisSaver = BLOC (condition = " Template == 'AnalysisSaver' ",
+ ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\\nxa=numpy.ravel(ADD.get('Analysis')[-1])\\nf='/tmp/analysis.txt'\\nprint 'Analysis saved in \\"%s\\"'%f\\nnumpy.savetxt(f,xa)" ),
+ ),
+ AnalysisPrinterAndSaver = BLOC (condition = " Template == 'AnalysisPrinterAndSaver' ",
+ ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\\nxa=numpy.ravel(ADD.get('Analysis')[-1])\\nprint 'Analysis:',xa\\nf='/tmp/analysis.txt'\\nprint 'Analysis saved in \\"%s\\"'%f\\nnumpy.savetxt(f,xa)" ),
+ ),
+ ),
)
"""
${var_name} = BLOC (condition=" '${var_name}' in set(SELECTION) ",
${var_name}_data = FACT(statut = "o",
Scheduler = SIMP(statut = "f", typ = "TXM"),
- Info = SIMP(statut = "f", typ = "TXM", defaut = "${var_name}"),
- NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "", into=("String", "Script", "Template")),
+ Info = SIMP(statut = "o", typ = "TXM", defaut = "${var_name}"),
+ NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
PythonScript = BLOC (condition = " NodeType == 'String' ",
Value = SIMP(statut = "o", typ = "TXM")
),
Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=(OnlyStr()))
),
ObserverTemplate = BLOC (condition = " NodeType == 'Template' ",
- Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "", into=("ValuePrinter", "ValueSeriePrinter", "ValueGnuPlotter", "ValueSerieGnuPlotter")),
+ Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "ValuePrinter", into=("ValuePrinter", "ValueSeriePrinter", "ValueSaver", "ValueSerieSaver", "ValuePrinterAndSaver", "ValueSeriePrinterAndSaver", "ValueGnuPlotter", "ValueSerieGnuPlotter")),
ValuePrinter = BLOC (condition = " Template == 'ValuePrinter' ",
ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print info,var[-1]" ),
),
ValueSeriePrinter = BLOC (condition = " Template == 'ValueSeriePrinter' ",
ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print info,var[:]" ),
),
+ ValueSaver = BLOC (condition = " Template == 'ValueSaver' ",
+ ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy,re\\nv=numpy.array((var[-1]))\\nglobal istep\\ntry:\\n istep += 1\\nexcept:\\n istep = 0\\nf='/tmp/value_%s_%05i.txt'%(info,istep)\\nf=re.sub('\\s','_',f)\\nprint 'Value saved in \\"%s\\"'%f\\nnumpy.savetxt(f,v)" ),
+ ),
+ ValueSerieSaver = BLOC (condition = " Template == 'ValueSerieSaver' ",
+ ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy,re\\nv=numpy.array((var[:])) \\nglobal istep\\ntry:\\n istep += 1\\nexcept:\\n istep = 0\\nf='/tmp/value_%s_%05i.txt'%(info,istep)\\nf=re.sub('\\s','_',f)\\nprint 'Value saved in \\"%s\\"'%f\\nnumpy.savetxt(f,v)" ),
+ ),
+ ValuePrinterAndSaver = BLOC (condition = " Template == 'ValuePrinterAndSaver' ",
+ ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy,re\\nv=numpy.array((var[-1]))\\nprint info,v\\nglobal istep\\ntry:\\n istep += 1\\nexcept:\\n istep = 0\\nf='/tmp/value_%s_%05i.txt'%(info,istep)\\nf=re.sub('\\s','_',f)\\nprint 'Value saved in \\"%s\\"'%f\\nnumpy.savetxt(f,v)" ),
+ ),
+ ValueSeriePrinterAndSaver = BLOC (condition = " Template == 'ValueSeriePrinterAndSaver' ",
+ ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy,re\\nv=numpy.array((var[:])) \\nprint info,v\\nglobal istep\\ntry:\\n istep += 1\\nexcept:\\n istep = 0\\nf='/tmp/value_%s_%05i.txt'%(info,istep)\\nf=re.sub('\\s','_',f)\\nprint 'Value saved in \\"%s\\"'%f\\nnumpy.savetxt(f,v)" ),
+ ),
ValueGnuPlotter = BLOC (condition = " Template == 'ValueGnuPlotter' ",
- ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import Gnuplot\\nglobal nfig,gp\\ntry:\\n nfig += 1\\n gp('set style data lines')\\nexcept:\\n nfig = 0\\n gp = Gnuplot.Gnuplot(persist=1)\\n gp('set style data lines')\\ngp('set title \\"'+str(info)+' (Figure %i)\\"'%nfig)\\ngp.plot( Gnuplot.Data( var[-1], with_='lines lw 2' ) )" ),
+ ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import Gnuplot\\nglobal ifig,gp\\ntry:\\n ifig += 1\\n gp('set style data lines')\\nexcept:\\n ifig = 0\\n gp = Gnuplot.Gnuplot(persist=1)\\n gp('set style data lines')\\ngp('set title \\"%s (Figure %i)\\"'%(info,ifig))\\ngp.plot( Gnuplot.Data( var[-1], with_='lines lw 2' ) )" ),
),
ValueSerieGnuPlotter = BLOC (condition = " Template == 'ValueSerieGnuPlotter' ",
- ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import Gnuplot\\nglobal nfig,gp\\ntry:\\n nfig += 1\\n gp('set style data lines')\\nexcept:\\n nfig = 0\\n gp = Gnuplot.Gnuplot(persist=1)\\n gp('set style data lines')\\ngp('set title \\"'+str(info)+' (Figure %i)\\"'%nfig)\\ngp.plot( Gnuplot.Data( var[:], with_='lines lw 2' ) )" ),
+ ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import Gnuplot\\nglobal ifig,gp\\ntry:\\n ifig += 1\\n gp('set style data lines')\\nexcept:\\n ifig = 0\\n gp = Gnuplot.Gnuplot(persist=1)\\n gp('set style data lines')\\ngp('set title \\"%s (Figure %i)\\"'%(info,ifig))\\ngp.plot( Gnuplot.Data( var[:], with_='lines lw 2' ) )" ),
),
),
),