]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Observers declaration in progress
authorAndré Ribes <andre.ribes@edf.fr>
Mon, 27 Feb 2012 10:57:15 +0000 (11:57 +0100)
committerAndré Ribes <andre.ribes@edf.fr>
Mon, 27 Feb 2012 10:57:15 +0000 (11:57 +0100)
bin/AdaoCatalogGenerator.py
src/daSalome/daYacsSchemaCreator/infos_daComposant.py

index dfa0535f9a294ead7c96daa744fbd6a4a61febfa..651189c52d0087790d0372564e1f8d9b8bba9073 100644 (file)
@@ -91,6 +91,19 @@ assim_data_choice = """
                                                  ),
 """
 
+observers_choice = """
+                                       ${var_name} = BLOC (condition=" '${var_name}' in set(SELECTION) ",
+                                                      FREQUENCY = SIMP(statut = "o", typ = "TXM")
+                                                          ),
+"""
+
+observers_method = """
+def F_Observers(statut) : return FACT(statut=statut,
+                                      SELECTION = SIMP(statut="o", defaut=[], typ="TXM", max="**", validators=NoRepeat(), into=(${choices})),
+${decl_choices}
+                                     )
+"""
+
 assim_study = """
 
 def F_variables(statut) : return FACT(statut=statut,
@@ -115,7 +128,8 @@ ASSIMILATION_STUDY = PROC(nom="ASSIMILATION_STUDY",
                           UserDataInit        = F_Init("f"),
                           UserPostAnalysis    = F_UserPostAnalysis("f"),
                           InputVariables      = F_variables("f"),
-                          OutputVariables     = F_variables("f")
+                          OutputVariables     = F_variables("f"),
+                          Observers           = F_Observers("f")
                          )
 """
 
@@ -124,6 +138,8 @@ data_method = string.Template(data_method)
 assim_data_method = string.Template(assim_data_method)
 assim_data_choice = string.Template(assim_data_choice)
 assim_study = string.Template(assim_study)
+observers_method = string.Template(observers_method)
+observers_choice = string.Template(observers_choice)
 
 #----------- End of Templates Part ---------------#
 
@@ -223,6 +239,13 @@ for opt_name in infos.OptDict.keys():
 # TODO uniformiser avec le step 3
 mem_file.write(init_method)
 
+# Step 5: Add observers
+decl_choices = ""
+for obs_var in infos.ObserversList:
+  decl_choices += observers_choice.substitute(var_name=obs_var)
+mem_file.write(observers_method.substitute(choices = infos.ObserversList,
+                                           decl_choices = decl_choices))
+
 # Final step: Add algorithm and assim_study
 algos_names = ""
 decl_algos = ""
index 3ec7f4b8466cf8bce95e3e36d1f61db52a35a3a9..3c03f5e33de88cf124bb65adf3e4458f86eb7112 100644 (file)
@@ -112,3 +112,7 @@ OptDict = {}
 OptDict["UserPostAnalysis"]   = ["String", "Script"]
 OptDefaultDict = {}
 OptDefaultDict["UserPostAnalysis"]   = "Script"
+
+
+# Observers
+ObserversList = ["CostFunctionJ","CostFunctionJb","CostFunctionJo","GradientOfCostFunctionJ","GradientOfCostFunctionJb","GradientOfCostFunctionJo","CurrentState","Analysis","Innovation","SigmaObs2","SigmaBck2","OMA","OMB","BMA","CovarianceAPosteriori"]