269{
270 std::string AttributeName =
ui->AttributeNameLineEdit->text().toStdString();
271 std::string AttributeType =
ui->AttributeTypeComboBox->currentText().toStdString();
272 char AttributeFormatChar = (
ui->AttributeFormatComboBox->currentText().toStdString())[0];
273
275
276 switch (AttributeFormatChar) {
277 case 'D':
278 AttributeFormat = OksAttribute::Format::Dec;
279 break;
280
281 case 'O':
282 AttributeFormat = OksAttribute::Format::Oct;
283 break;
284
285 case 'H':
286 AttributeFormat = OksAttribute::Format::Hex;
287 break;
288
289 default:
290 AttributeFormat = OksAttribute::Format::Dec;
291 break;
292 }
293
295 int Index =
ui->AttributeTypeComboBox->currentIndex();
296
297 if (Index == 0 || Index >= 9) {
298 AttributeFormat = OksAttribute::Format::Dec;
299 }
300
301 bool IsMultivariable = false;
302
303 switch (
ui->AttributeIsMultivariable->currentIndex()) {
304 case 0:
305 IsMultivariable = true;
306 break;
307
308 case 1:
309 IsMultivariable = false;
310 break;
311
312 default:
313 IsMultivariable = false;
314 break;
315 }
316
317 bool IsNotNull = false;
318
319 switch (
ui->AttributeIsNotNull->currentIndex()) {
320 case 0:
321 IsNotNull = true;
322 break;
323
324 case 1:
325 IsNotNull = false;
326 break;
327
328 default:
329 IsNotNull = false;
330 break;
331 }
332
333 std::string AttributeDescription =
ui->AttributeDescriptionTextBox->toPlainText().toStdString();
334 std::string AttributeRange =
ui->AttributeRangeLineEdit->text().toStdString();
335 std::string AttributeInitial =
ui->AttributeInitialValue->text().toStdString();
336
339 AttributeName,
340 AttributeType,
341 IsMultivariable,
342 AttributeRange,
343 AttributeInitial,
344 AttributeDescription,
345 IsNotNull,
346 AttributeFormat);
348 close();
349}
void PushAddAttributeCommand(dunedaq::oks::OksClass *Class, std::string name, std::string type, bool is_mv, std::string range, std::string init_values, std::string description, bool is_null, dunedaq::oks::OksAttribute::Format format=dunedaq::oks::OksAttribute::Format::Dec)