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