DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dbe::config::api::set Namespace Reference

Namespaces

namespace  noactions

Functions

void attribute (dbe::inner::configobject::tref objectref, dunedaq::conffwk::attribute_t const &attribute_info, QStringList const &attribute_values)
void relation (dbe::inner::configobject::tref src, dunedaq::conffwk::relationship_t const &edge, QStringList const &targets)

Function Documentation

◆ attribute()

void dbe::config::api::set::attribute ( dbe::inner::configobject::tref objectref,
dunedaq::conffwk::attribute_t const & attribute_info,
QStringList const & attribute_values )

Change the value of an attribute and set it appropriately to new values by generating action commands, register this to the undo stack

Parameters
objectref
attribute_infoa single or multi-value attribute, with name, and class information
attribute_valuesis a list (can have only one) of values

Definition at line 100 of file config_api_set.cpp.

101{
102 switch (attribute_info.p_type) {
104 if (attribute_info.p_is_multi_value) {
105 commands::modobj(Object, attribute_info, convert::to<std::vector<bool>>(values, attribute_info.p_int_format));
106 } else {
107 commands::modobj(Object, attribute_info, convert::to<bool>(values, attribute_info.p_int_format));
108 }
109
110 break;
111 }
112
118 if (attribute_info.p_is_multi_value) {
119 commands::modobj(Object, attribute_info, convert::to<std::vector<std::string>>(values));
120 } else {
121 commands::modobj(Object, attribute_info, convert::to<std::string>(values));
122 }
123
124 break;
125 }
126
128 if (attribute_info.p_is_multi_value) {
129 commands::modobj(Object, attribute_info, convert::to<std::vector<float>>(values, attribute_info.p_int_format));
130 } else {
131 commands::modobj(Object, attribute_info, convert::to<float>(values, attribute_info.p_int_format));
132 }
133
134 break;
135 }
136
138 if (attribute_info.p_is_multi_value) {
139 commands::modobj(Object, attribute_info, convert::to<std::vector<double>>(values, attribute_info.p_int_format));
140 } else {
141 commands::modobj(Object, attribute_info, convert::to<double>(values, attribute_info.p_int_format));
142 }
143
144 break;
145 }
146
148 if (attribute_info.p_is_multi_value) {
149 commands::modobj(Object, attribute_info, convert::to<std::vector<int8_t>>(values, attribute_info.p_int_format));
150 } else {
151 commands::modobj(Object, attribute_info, convert::to<int8_t>(values, attribute_info.p_int_format));
152 }
153
154 break;
155 }
156
158 if (attribute_info.p_is_multi_value) {
160 Object, attribute_info, convert::to<std::vector<int16_t>>(values, attribute_info.p_int_format));
161 } else {
162 commands::modobj(Object, attribute_info, convert::to<int16_t>(values, attribute_info.p_int_format));
163 }
164
165 break;
166 }
167
169 if (attribute_info.p_is_multi_value) {
171 Object, attribute_info, convert::to<std::vector<int32_t>>(values, attribute_info.p_int_format));
172 } else {
173 commands::modobj(Object, attribute_info, convert::to<int32_t>(values, attribute_info.p_int_format));
174 }
175
176 break;
177 }
178
180 if (attribute_info.p_is_multi_value) {
182 Object, attribute_info, convert::to<std::vector<int64_t>>(values, attribute_info.p_int_format));
183 } else {
184 commands::modobj(Object, attribute_info, convert::to<int64_t>(values, attribute_info.p_int_format));
185 }
186
187 break;
188 }
189
191 if (attribute_info.p_is_multi_value) {
193 Object, attribute_info, convert::to<std::vector<u_int8_t>>(values, attribute_info.p_int_format));
194 } else {
195 commands::modobj(Object, attribute_info, convert::to<u_int8_t>(values, attribute_info.p_int_format));
196 }
197
198 break;
199 }
200
202 if (attribute_info.p_is_multi_value) {
204 Object, attribute_info, convert::to<std::vector<u_int16_t>>(values, attribute_info.p_int_format));
205 } else {
206 commands::modobj(Object, attribute_info, convert::to<u_int16_t>(values, attribute_info.p_int_format));
207 }
208
209 break;
210 }
211
213 if (attribute_info.p_is_multi_value) {
215 Object, attribute_info, convert::to<std::vector<u_int32_t>>(values, attribute_info.p_int_format));
216 } else {
217 commands::modobj(Object, attribute_info, convert::to<u_int32_t>(values, attribute_info.p_int_format));
218 }
219
220 break;
221 }
222
224 if (attribute_info.p_is_multi_value)
226 Object, attribute_info, convert::to<std::vector<u_int64_t>>(values, attribute_info.p_int_format));
227 else
228 commands::modobj(Object, attribute_info, convert::to<u_int64_t>(values, attribute_info.p_int_format));
229
230 break;
231 }
232
233 default:
234 break;
235 }
236}
void modobj(tref Object, dunedaq::conffwk::attribute_t const &AttributeData, T Value)
int8_t to< int8_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
u_int64_t to< u_int64_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
int16_t to< int16_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
u_int8_t to< u_int8_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
int64_t to< int64_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
T to(QStringList const &DataList)
std::string to< std::string >(QStringList const &DataList)
int32_t to< int32_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
u_int32_t to< u_int32_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
double to< double >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
u_int16_t to< u_int16_t >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)
float to< float >(QStringList const &DataList, dunedaq::conffwk::int_format_t Format)

◆ relation()

void dbe::config::api::set::relation ( dbe::inner::configobject::tref src,
dunedaq::conffwk::relationship_t const & edge,
QStringList const & targets )

Link an object with one or many other objects by generating action commands, register this to the undo stack

object->objects

objects linked must be of the relation class type

Parameters
objectfrom which an outgoing link is set
relation_infothe associate relation type information
object_namesthe name of the objects to be linked

Definition at line 86 of file config_api_set.cpp.

87{
88 std::vector<std::string> targetnames;
89
90 for (QString const& name : targets) {
91 targetnames.push_back(name.toStdString());
92 }
93
94 commands::modobj(src, edge, targetnames);
95}