From 0e0535d5ec2bf558c8b2df85837718b87c9acee9 Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Sun, 16 Jun 2013 20:19:58 +0200 Subject: [PATCH] Improving default text values and adding an observer template --- bin/AdaoCatalogGenerator.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/bin/AdaoCatalogGenerator.py b/bin/AdaoCatalogGenerator.py index aec9be4..d5425df 100644 --- a/bin/AdaoCatalogGenerator.py +++ b/bin/AdaoCatalogGenerator.py @@ -110,7 +110,7 @@ observers_choice = """ ${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"), + Info = SIMP(statut = "f", typ = "TXM", defaut = "${var_name}"), NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "", into=("String", "Script", "Template")), PythonScript = BLOC (condition = " NodeType == 'String' ", Value = SIMP(statut = "o", typ = "TXM") @@ -119,15 +119,18 @@ observers_choice = """ 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", "ValueGnuPlotter", "ValueSerieGnuPlotter")), + Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "", into=("ValuePrinter", "ValueSeriePrinter", "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[:]" ), + ), ValueGnuPlotter = BLOC (condition = " Template == 'ValueGnuPlotter' ", - ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import Gnuplot\\nglobal gp\\ntry:\\n gp('set style data lines')\\nexcept:\\n gp = Gnuplot.Gnuplot(persist=1)\\n gp('set style data lines')\\ngp('set title \\"'+str(info)+'\\"')\\ngp.plot( Gnuplot.Data( var[-1], with_='lines lw 2' ) )" ), + 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' ) )" ), ), ValueSerieGnuPlotter = BLOC (condition = " Template == 'ValueSerieGnuPlotter' ", - ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import Gnuplot\\nglobal gp\\ntry:\\n gp('set style data lines')\\nexcept:\\n gp = Gnuplot.Gnuplot(persist=1)\\n gp('set style data lines')\\ngp('set title \\"'+str(info)+'\\"')\\ngp.plot( Gnuplot.Data( var[:], with_='lines lw 2' ) )" ), + 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' ) )" ), ), ), ), @@ -152,7 +155,7 @@ def F_variables(statut) : return FACT(statut=statut, ASSIMILATION_STUDY = PROC(nom="ASSIMILATION_STUDY", op=None, repetable = "n", - Study_name = SIMP(statut="o", typ = "TXM"), + Study_name = SIMP(statut="o", typ = "TXM", defaut="ADAO Calculation Case"), Study_repertory = SIMP(statut="f", typ = "Repertoire", min=1, max=1), Debug = SIMP(statut="o", typ = "I", into=(0, 1), defaut=0), Algorithm = SIMP(statut="o", typ = "TXM", into=(${algos_names})), @@ -175,7 +178,7 @@ ASSIMILATION_STUDY = PROC(nom="ASSIMILATION_STUDY", CHECKING_STUDY = PROC(nom="CHECKING_STUDY", op=None, repetable = "n", - Study_name = SIMP(statut="o", typ = "TXM"), + Study_name = SIMP(statut="o", typ = "TXM", defaut="ADAO Checking Case"), Study_repertory = SIMP(statut="f", typ = "Repertoire", min=1, max=1), Debug = SIMP(statut="o", typ = "I", into=(0, 1), defaut=0), Algorithm = SIMP(statut="o", typ = "TXM", into=(${check_names})), -- 2.39.2