otsdaq  v2_00_00
IterateConfiguration.h
1 #ifndef _ots_IterateConfiguration_h_
2 #define _ots_IterateConfiguration_h_
3 
4 #include "otsdaq-core/ConfigurationDataFormats/ConfigurationBase.h"
5 
6 
7 namespace ots
8 {
9 
11 {
12 
13 public:
14 
16  virtual ~IterateConfiguration(void);
17 
18  //Methods
19  void init(ConfigurationManager *configManager);
20 
21  //Getters
22 
23  struct CommandTarget {
24  std::string table_;
25  std::string UID_;
26  };
27 
28  struct Command {
29  void addTarget() {targets_.push_back(CommandTarget());}
30  std::string type_;
31  std::vector<CommandTarget> targets_;
32  std::map<
33  std::string /*param name*/,
34  std::string /*param value*/> params_;
35  };
36 
37  std::vector<IterateConfiguration::Command> getPlanCommands(ConfigurationManager *configManager, const std::string& plan) const;
38 
39 
40  static const std::string COMMAND_BEGIN_LABEL;
41  static const std::string COMMAND_CHOOSE_FSM;
42  static const std::string COMMAND_CONFIGURE_ACTIVE_GROUP;
43  static const std::string COMMAND_CONFIGURE_ALIAS;
44  static const std::string COMMAND_CONFIGURE_GROUP;
45  static const std::string COMMAND_EXECUTE_FE_MACRO;
46  static const std::string COMMAND_EXECUTE_MACRO;
47  static const std::string COMMAND_MODIFY_ACTIVE_GROUP;
48  static const std::string COMMAND_REPEAT_LABEL;
49  static const std::string COMMAND_RUN;
50 
51  static const std::string ITERATE_TABLE;
52  static const std::string PLAN_TABLE;
53  static const std::string TARGET_TABLE;
54 
55  static const std::map<std::string,std::string> commandToTableMap_;
56  static std::map<std::string,std::string> createCommandToTableMap()
57  {
58  std::map<std::string,std::string> m;
59  m[COMMAND_BEGIN_LABEL] = "IterationCommandBeginLabelConfiguration";
60  m[COMMAND_CHOOSE_FSM] = "IterationCommandChooseFSMConfiguration";
61  m[COMMAND_CONFIGURE_ACTIVE_GROUP] = ""; //no parameters
62  m[COMMAND_CONFIGURE_ALIAS] = "IterationCommandConfigureAliasConfiguration";
63  m[COMMAND_CONFIGURE_GROUP] = "IterationCommandConfigureGroupConfiguration";
64  m[COMMAND_EXECUTE_FE_MACRO] = "IterationCommandExecuteFEMacroConfiguration";
65  m[COMMAND_EXECUTE_MACRO] = "IterationCommandExecuteMacroConfiguration";
66  m[COMMAND_MODIFY_ACTIVE_GROUP] = "IterationCommandModifyGroupConfiguration";
67  m[COMMAND_REPEAT_LABEL] = "IterationCommandRepeatLabelConfiguration";
68  m[COMMAND_RUN] = "IterationCommandRunConfiguration";
69  return m;
70  }
71 
73  {
74  const std::string Label_ = "Label";
75  } commandBeginLabelParams_;
76  static struct CommandChooseFSMParams
77  {
78  const std::string NameOfFSM_ = "NameOfStateMachine"; //by default ""
79  } commandChooseFSMParams_;
81  {
82  //no parameters
83  } commandConfigureActiveParams_;
85  {
86  const std::string SystemAlias_ = "SystemAlias";
87  } commandConfigureAliasParams_;
89  {
90  const std::string GroupName_ = "GroupName";
91  const std::string GroupKey_ = "GroupKey";
92  } commandConfigureGroupParams_;
94  {
95  //targets
96  const std::string FEMacroName_ = "FEMacroName";
97  //macro parameters
98  } commandExecuteFEMacroParams_;
100  {
101  //targets
102  const std::string MacroName_ = "MacroName";
103  //macro parameters
104  } commandExecuteMacroParams_;
106  {
107  //targets
108  const std::string DoTrackGroupChanges_ = "DoTrackGroupChanges";
109  const std::string RelativePathToField_ = "RelativePathToField";
110  const std::string FieldStartValue_ = "FieldStartValue";
111  const std::string FieldIterationStepSize_ = "FieldIterationStepSize";
112  } commandModifyActiveParams_;
114  {
115  const std::string Label_ = "Label";
116  const std::string NumberOfRepetitions_ = "NumberOfRepetitions";
117  } commandRepeatLabelParams_;
118  static struct CommandRunParams
119  {
120  const std::string WaitOnRunningThreads_ = "WaitForAllFrontEndsRunningThread";
121  const std::string DurationInSeconds_ = "DurationInSeconds";
122  } commandRunParams_;
123 
124 
125  //for targets
126  static struct TargetParams
127  {
128  const std::string Tables_ = "CSVTargetTables";
129  const std::string UIDs_ = "CSVTargetUIDs";
130  } targetParams_;
131  static struct CommandTargetColumns
132  {
133  const std::string TargetsLink_ = "LinkToTargets";
134  const std::string TargetsLinkGroupID_ = "LinkToTargetsGroupID";
135 
136  } commandTargetCols_;
137  static struct TargetTableColumns
138  {
139  const std::string GroupID_ = "IterationTargetGroupID";
140  const std::string TargetLink_ = "LinkToTarget";
141  const std::string TargetLinkUID_ = "LinkToTargetUID";
142  } targetCols_;
143 
144 
145  //Table hierarchy is as follows:
146  // Iterate
147  // |- Plan
148  // |-Command Type 1
149  // |-Command Type 2 ...
150  // |-Command Type n
151 
152  //Column names
153 
154  static struct IterateTableColumns
155  {
156  const std::string PlanLink_ = "LinkToIterationPlanConfiguration";
157  } iterateTableCols_;
158 
159  static struct PlanTableColumns
160  {
161  const std::string Status_ = ViewColumnInfo::COL_NAME_STATUS;
162  const std::string GroupID_ = "IterationPlanGroupID";
163  const std::string CommandLink_ = "LinkToCommandUID";
164  const std::string CommandType_ = "CommandType";
165  } planTableCols_;
166 
167 
168 
169 };
170 }
171 #endif