307{
308 std::string AttributeName =
ui->AttributeNameLineEdit->text().toStdString();
309 std::string AttributeType =
ui->AttributeTypeComboBox->currentText().toStdString();
310 char AttributeFormatChar = (
ui->AttributeFormatComboBox->currentText().toStdString() ) [0];
311
313
314 switch ( AttributeFormatChar )
315 {
316 case 'D':
317 AttributeFormat = OksAttribute::Format::Dec;
318 break;
319
320 case 'O':
321 AttributeFormat = OksAttribute::Format::Oct;
322 break;
323
324 case 'H':
325 AttributeFormat = OksAttribute::Format::Hex;
326 break;
327
328 default:
329 AttributeFormat = OksAttribute::Format::Dec;
330 break;
331 }
332
334 int Index =
ui->AttributeTypeComboBox->currentIndex();
335
336 if ( Index == 0 || Index >= 9 )
337 {
338 AttributeFormat = OksAttribute::Format::Dec;
339 }
340
341 bool IsMultivariable = false;
342
343 switch (
ui->AttributeIsMultivariable->currentIndex() )
344 {
345 case 0:
346 IsMultivariable = true;
347 break;
348
349 case 1:
350 IsMultivariable = false;
351 break;
352
353 default:
354 IsMultivariable = false;
355 break;
356 }
357
358 bool IsNotNull = false;
359
360 switch (
ui->AttributeIsNotNull->currentIndex() )
361 {
362 case 0:
363 IsNotNull = true;
364 break;
365
366 case 1:
367 IsNotNull = false;
368 break;
369
370 default:
371 IsNotNull = false;
372 break;
373 }
374
375 std::string AttributeDescription =
376 ui->AttributeDescriptionTextBox->toPlainText().toStdString();
377 std::string AttributeRange =
ui->AttributeRangeLineEdit->text().toStdString();
378 std::string AttributeInitial =
ui->AttributeInitialValue->text().toStdString();
379
382 AttributeType, IsMultivariable,
383 AttributeRange, AttributeInitial,
384 AttributeDescription, IsNotNull,
385 AttributeFormat );
387 close();
388}
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)