$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #ifndef _ots_IterateTable_h_ 00002 #define _ots_IterateTable_h_ 00003 00004 #include "otsdaq-core/TableCore/TableBase.h" 00005 00006 namespace ots 00007 { 00008 class IterateTable : public TableBase 00009 { 00010 public: 00011 IterateTable(void); 00012 virtual ~IterateTable(void); 00013 00014 // Methods 00015 void init(ConfigurationManager* configManager); 00016 00017 // Getters 00018 00019 struct CommandTarget 00020 { 00021 std::string table_; 00022 std::string UID_; 00023 }; 00024 00025 struct Command 00026 { 00027 void addTarget() { targets_.push_back(CommandTarget()); } 00028 std::string type_; 00029 std::vector<CommandTarget> targets_; 00030 std::map<std::string /*param name*/, std::string /*param value*/> params_; 00031 }; 00032 00033 std::vector<IterateTable::Command> getPlanCommands( 00034 ConfigurationManager* configManager, const std::string& plan) const; 00035 00036 static const std::string COMMAND_BEGIN_LABEL; 00037 static const std::string COMMAND_CHOOSE_FSM; 00038 static const std::string COMMAND_CONFIGURE_ACTIVE_GROUP; 00039 static const std::string COMMAND_CONFIGURE_ALIAS; 00040 static const std::string COMMAND_CONFIGURE_GROUP; 00041 static const std::string COMMAND_EXECUTE_FE_MACRO; 00042 static const std::string COMMAND_EXECUTE_MACRO; 00043 static const std::string COMMAND_MODIFY_ACTIVE_GROUP; 00044 static const std::string COMMAND_REPEAT_LABEL; 00045 static const std::string COMMAND_RUN; 00046 00047 static const std::string ITERATE_TABLE; 00048 static const std::string PLAN_TABLE; 00049 static const std::string TARGET_TABLE; 00050 00051 static const std::map<std::string, std::string> commandToTableMap_; 00052 static std::map<std::string, std::string> createCommandToTableMap() 00053 { 00054 std::map<std::string, std::string> m; 00055 m[COMMAND_BEGIN_LABEL] = "IterationCommandBeginLabelTable"; 00056 m[COMMAND_CHOOSE_FSM] = "IterationCommandChooseFSMTable"; 00057 m[COMMAND_CONFIGURE_ACTIVE_GROUP] = ""; // no parameters 00058 m[COMMAND_CONFIGURE_ALIAS] = "IterationCommandConfigureAliasTable"; 00059 m[COMMAND_CONFIGURE_GROUP] = "IterationCommandConfigureGroupTable"; 00060 m[COMMAND_EXECUTE_FE_MACRO] = "IterationCommandExecuteFEMacroTable"; 00061 m[COMMAND_EXECUTE_MACRO] = "IterationCommandExecuteMacroTable"; 00062 m[COMMAND_MODIFY_ACTIVE_GROUP] = "IterationCommandModifyGroupTable"; 00063 m[COMMAND_REPEAT_LABEL] = "IterationCommandRepeatLabelTable"; 00064 m[COMMAND_RUN] = "IterationCommandRunTable"; 00065 return m; 00066 } 00067 00068 static struct CommandBeginLabelParams 00069 { 00070 const std::string Label_ = "Label"; 00071 } commandBeginLabelParams_; 00072 static struct CommandChooseFSMParams 00073 { 00074 const std::string NameOfFSM_ = "NameOfStateMachine"; // by default "" 00075 } commandChooseFSMParams_; 00076 static struct CommandConfigureActiveParams 00077 { 00078 // no parameters 00079 } commandConfigureActiveParams_; 00080 static struct CommandConfigureAliasParams 00081 { 00082 const std::string SystemAlias_ = "SystemAlias"; 00083 } commandConfigureAliasParams_; 00084 static struct CommandConfigureGroupParams 00085 { 00086 const std::string GroupName_ = "GroupName"; 00087 const std::string GroupKey_ = "GroupKey"; 00088 } commandConfigureGroupParams_; 00089 static struct CommandExecuteMacroParams // treat FE and Macro the same 00090 { 00091 // targets 00092 const std::string MacroName_ = "MacroName"; 00093 const std::string MacroParameterLink_ = "LinkToMacroDimensionalLoopTable"; 00094 const std::string EnableSavingOutput_ = "EnableSavingOutputsToFile"; 00095 const std::string OutputFilePath_ = "OutputFilePath"; 00096 const std::string OutputFileRadix_ = "OutputFileRadix"; 00097 00098 const std::string MacroArgumentString_ = "MacroArgumentString"; 00099 00100 // macro parameters 00101 } commandExecuteMacroParams_; 00102 static struct CommandModifyActiveParams 00103 { 00104 // targets 00105 const std::string DoTrackGroupChanges_ = "DoTrackGroupChanges"; 00106 const std::string RelativePathToField_ = "RelativePathToField"; 00107 const std::string FieldStartValue_ = "FieldStartValue"; 00108 const std::string FieldIterationStepSize_ = "FieldIterationStepSize"; 00109 } commandModifyActiveParams_; 00110 static struct CommandRepeatLabelParams 00111 { 00112 const std::string Label_ = "Label"; 00113 const std::string NumberOfRepetitions_ = "NumberOfRepetitions"; 00114 } commandRepeatLabelParams_; 00115 static struct CommandRunParams 00116 { 00117 const std::string WaitOnRunningThreads_ = "WaitForAllFrontEndsRunningThread"; 00118 const std::string DurationInSeconds_ = "DurationInSeconds"; 00119 } commandRunParams_; 00120 00121 // for targets 00122 static struct TargetParams 00123 { 00124 const std::string Tables_ = "CSVTargetTables"; 00125 const std::string UIDs_ = "CSVTargetUIDs"; 00126 } targetParams_; 00127 static struct CommandTargetColumns 00128 { 00129 const std::string TargetsLink_ = "LinkToTargets"; 00130 const std::string TargetsLinkGroupID_ = "LinkToTargetsGroupID"; 00131 00132 } commandTargetCols_; 00133 static struct TargetTableColumns 00134 { 00135 const std::string GroupID_ = "IterationTargetGroupID"; 00136 const std::string TargetLink_ = "LinkToTarget"; 00137 const std::string TargetLinkUID_ = "LinkToTargetUID"; 00138 } targetCols_; 00139 00140 // for macro dimensional loop parameters 00141 static struct MacroDimLoopTableColumns 00142 { 00143 const std::string Priority_ = "DimensionalLoopPriority"; 00144 const std::string NumberOfIterations_ = "NumberOfIterations"; 00145 const std::string ParamLink_ = "LinkToDimensionalLoopParameterTable"; 00146 } macroDimLoopCols_; 00147 static struct MacroParamTableColumns 00148 { 00149 const std::string Name_ = "ParameterName"; 00150 const std::string Value_ = "ParameterInitialValue"; 00151 const std::string Step_ = "ParameterStepSize"; 00152 00153 } macroParamCols_; 00154 00155 // Table hierarchy is as follows: 00156 // Iterate 00157 // |- Plan 00158 // |-Command Type 1 00159 // |-Command Type 2 ... 00160 // |-Command Type n 00161 00162 // Column names 00163 00164 static struct IterateTableColumns 00165 { 00166 const std::string PlanLink_ = "LinkToIterationPlanTable"; 00167 } iterateTableCols_; 00168 00169 static struct PlanTableColumns 00170 { 00171 const std::string Status_ = TableViewColumnInfo::COL_NAME_STATUS; 00172 const std::string GroupID_ = "IterationPlanGroupID"; 00173 const std::string CommandLink_ = "LinkToCommandUID"; 00174 const std::string CommandType_ = "CommandType"; 00175 } planTableCols_; 00176 }; 00177 } // namespace ots 00178 #endif