From: André Ribes Date: Mon, 27 Feb 2012 10:57:15 +0000 (+0100) Subject: Observers declaration in progress X-Git-Tag: V6_5_0~25^2~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4218d03ad0bf1caa2620b59f38cf85c6b8c6f632;p=modules%2Fadao.git Observers declaration in progress --- diff --git a/bin/AdaoCatalogGenerator.py b/bin/AdaoCatalogGenerator.py index dfa0535..651189c 100644 --- a/bin/AdaoCatalogGenerator.py +++ b/bin/AdaoCatalogGenerator.py @@ -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 = "" diff --git a/src/daSalome/daYacsSchemaCreator/infos_daComposant.py b/src/daSalome/daYacsSchemaCreator/infos_daComposant.py index 3ec7f4b..3c03f5e 100644 --- a/src/daSalome/daYacsSchemaCreator/infos_daComposant.py +++ b/src/daSalome/daYacsSchemaCreator/infos_daComposant.py @@ -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"]