00001 #ifndef _ots_IterateConfiguration_h_
00002 #define _ots_IterateConfiguration_h_
00003
00004 #include "otsdaq-core/ConfigurationDataFormats/ConfigurationBase.h"
00005
00006
00007 namespace ots
00008 {
00009
00010 class IterateConfiguration : public ConfigurationBase
00011 {
00012
00013 public:
00014
00015 IterateConfiguration(void);
00016 virtual ~IterateConfiguration(void);
00017
00018
00019 void init(ConfigurationManager *configManager);
00020
00021
00022
00023 struct CommandTarget {
00024 std::string table_;
00025 std::string UID_;
00026 };
00027
00028 struct Command {
00029 void addTarget() {targets_.push_back(CommandTarget());}
00030 std::string type_;
00031 std::vector<CommandTarget> targets_;
00032 std::map<
00033 std::string ,
00034 std::string > params_;
00035 };
00036
00037 std::vector<IterateConfiguration::Command> getPlanCommands(ConfigurationManager *configManager, const std::string& plan) const;
00038
00039
00040 static const std::string COMMAND_BEGIN_LABEL;
00041 static const std::string COMMAND_CHOOSE_FSM;
00042 static const std::string COMMAND_CONFIGURE_ACTIVE_GROUP;
00043 static const std::string COMMAND_CONFIGURE_ALIAS;
00044 static const std::string COMMAND_CONFIGURE_GROUP;
00045 static const std::string COMMAND_EXECUTE_FE_MACRO;
00046 static const std::string COMMAND_EXECUTE_MACRO;
00047 static const std::string COMMAND_MODIFY_ACTIVE_GROUP;
00048 static const std::string COMMAND_REPEAT_LABEL;
00049 static const std::string COMMAND_RUN;
00050
00051 static const std::string ITERATE_TABLE;
00052 static const std::string PLAN_TABLE;
00053 static const std::string TARGET_TABLE;
00054
00055 static const std::map<std::string,std::string> commandToTableMap_;
00056 static std::map<std::string,std::string> createCommandToTableMap()
00057 {
00058 std::map<std::string,std::string> m;
00059 m[COMMAND_BEGIN_LABEL] = "IterationCommandBeginLabelConfiguration";
00060 m[COMMAND_CHOOSE_FSM] = "IterationCommandChooseFSMConfiguration";
00061 m[COMMAND_CONFIGURE_ACTIVE_GROUP] = "";
00062 m[COMMAND_CONFIGURE_ALIAS] = "IterationCommandConfigureAliasConfiguration";
00063 m[COMMAND_CONFIGURE_GROUP] = "IterationCommandConfigureGroupConfiguration";
00064 m[COMMAND_EXECUTE_FE_MACRO] = "IterationCommandExecuteFEMacroConfiguration";
00065 m[COMMAND_EXECUTE_MACRO] = "IterationCommandExecuteMacroConfiguration";
00066 m[COMMAND_MODIFY_ACTIVE_GROUP] = "IterationCommandModifyGroupConfiguration";
00067 m[COMMAND_REPEAT_LABEL] = "IterationCommandRepeatLabelConfiguration";
00068 m[COMMAND_RUN] = "IterationCommandRunConfiguration";
00069 return m;
00070 }
00071
00072 static struct CommandBeginLabelParams
00073 {
00074 const std::string Label_ = "Label";
00075 } commandBeginLabelParams_;
00076 static struct CommandChooseFSMParams
00077 {
00078 const std::string NameOfFSM_ = "NameOfStateMachine";
00079 } commandChooseFSMParams_;
00080 static struct CommandConfigureActiveParams
00081 {
00082
00083 } commandConfigureActiveParams_;
00084 static struct CommandConfigureAliasParams
00085 {
00086 const std::string SystemAlias_ = "SystemAlias";
00087 } commandConfigureAliasParams_;
00088 static struct CommandConfigureGroupParams
00089 {
00090 const std::string GroupName_ = "GroupName";
00091 const std::string GroupKey_ = "GroupKey";
00092 } commandConfigureGroupParams_;
00093 static struct CommandExecuteFEMacroParams
00094 {
00095
00096 const std::string FEMacroName_ = "FEMacroName";
00097
00098 } commandExecuteFEMacroParams_;
00099 static struct CommandExecuteMacroParams
00100 {
00101
00102 const std::string MacroName_ = "MacroName";
00103
00104 } commandExecuteMacroParams_;
00105 static struct CommandModifyActiveParams
00106 {
00107
00108 const std::string DoTrackGroupChanges_ = "DoTrackGroupChanges";
00109 const std::string RelativePathToField_ = "RelativePathToField";
00110 const std::string FieldStartValue_ = "FieldStartValue";
00111 const std::string FieldIterationStepSize_ = "FieldIterationStepSize";
00112 } commandModifyActiveParams_;
00113 static struct CommandRepeatLabelParams
00114 {
00115 const std::string Label_ = "Label";
00116 const std::string NumberOfRepetitions_ = "NumberOfRepetitions";
00117 } commandRepeatLabelParams_;
00118 static struct CommandRunParams
00119 {
00120 const std::string WaitOnRunningThreads_ = "WaitForAllFrontEndsRunningThread";
00121 const std::string DurationInSeconds_ = "DurationInSeconds";
00122 } commandRunParams_;
00123
00124
00125
00126 static struct TargetParams
00127 {
00128 const std::string Tables_ = "CSVTargetTables";
00129 const std::string UIDs_ = "CSVTargetUIDs";
00130 } targetParams_;
00131 static struct CommandTargetColumns
00132 {
00133 const std::string TargetsLink_ = "LinkToTargets";
00134 const std::string TargetsLinkGroupID_ = "LinkToTargetsGroupID";
00135
00136 } commandTargetCols_;
00137 static struct TargetTableColumns
00138 {
00139 const std::string GroupID_ = "IterationTargetGroupID";
00140 const std::string TargetLink_ = "LinkToTarget";
00141 const std::string TargetLinkUID_ = "LinkToTargetUID";
00142 } targetCols_;
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154 static struct IterateTableColumns
00155 {
00156 const std::string PlanLink_ = "LinkToIterationPlanConfiguration";
00157 } iterateTableCols_;
00158
00159 static struct PlanTableColumns
00160 {
00161 const std::string Status_ = ViewColumnInfo::COL_NAME_STATUS;
00162 const std::string GroupID_ = "IterationPlanGroupID";
00163 const std::string CommandLink_ = "LinkToCommandUID";
00164 const std::string CommandType_ = "CommandType";
00165 } planTableCols_;
00166
00167
00168
00169 };
00170 }
00171 #endif