381{
385
386 for (dunedaq::conffwk::attribute_t const& attr : attributes)
387
388 {
389 QString name = QString::fromStdString(attr.p_name);
390
391 if (attr.p_is_multi_value) {
392 widgets::editors::multiattr* widget =
new widgets::editors::multiattr(attr,
this,
true,
m_readonly);
394
397 connect(widget, SIGNAL(signal_value_change()),
this, SLOT(
UpdateActions()), Qt::UniqueConnection);
398 connect(widget, SIGNAL(signal_value_change()),
this, SLOT(
ObjectChanged()), Qt::UniqueConnection);
400 } else {
401 switch (attr.p_type) {
402
404
406 widgets::editors::combo* Widget = new widgets::editors::combo(attr, this, true);
410 connect(Widget->Combo, SIGNAL(activated(QString)),
this, SLOT(
UpdateActions()), Qt::UniqueConnection);
411 connect(Widget, SIGNAL(signal_value_change()),
this, SLOT(
ObjectChanged()), Qt::UniqueConnection);
413 break;
414 }
415
417
419
421
423
425
427
429
431
433
435 widgets::editors::numericattr* Widget =
new widgets::editors::numericattr(attr,
this,
true,
m_readonly);
439 connect(Widget, SIGNAL(signal_value_change()),
this, SLOT(
UpdateActions()), Qt::UniqueConnection);
440 connect(Widget, SIGNAL(signal_value_change()),
this, SLOT(
ObjectChanged()), Qt::UniqueConnection);
442 break;
443 }
444
446
448
450 widgets::editors::stringattr* Widget =
new widgets::editors::stringattr(attr,
this,
true,
m_readonly);
454 connect(Widget, SIGNAL(signal_value_change()),
this, SLOT(
UpdateActions()), Qt::UniqueConnection);
455 connect(Widget, SIGNAL(signal_value_change()),
this, SLOT(
ObjectChanged()), Qt::UniqueConnection);
457 break;
458 }
459
461 widgets::editors::combo* Widget = new widgets::editors::combo(attr, this, true);
465 connect(Widget->Combo, SIGNAL(activated(QString)),
this, SLOT(
UpdateActions()), Qt::UniqueConnection);
466 connect(Widget, SIGNAL(signal_value_change()),
this, SLOT(
ObjectChanged()), Qt::UniqueConnection);
468 break;
469 }
470 }
471 }
472 }
473
474 for (dunedaq::conffwk::relationship_t const& arelation : relations)
475 {
476 widgets::editors::relation* widget =
new widgets::editors::relation(arelation,
this,
true,
m_readonly);
477 QString name = QString::fromStdString(arelation.p_name);
479
481 std::vector<tref> DataList;
482
484 try {
486 } catch (daq::dbe::config_object_retrieval_result_is_null const& e) {
487
488 }
489 } else {
491 }
492
493 for (
tref const& i : DataList) {
494 if (not i.is_null()) {
495 Data.push_back(QString::fromStdString(i.full_name()));
496 }
497 }
498 }
499
500 widget->setdata(Data);
501 widget->SetEditor();
502
505 connect(widget, SIGNAL(signal_value_change()),
this, SLOT(
UpdateActions()), Qt::UniqueConnection);
506 connect(widget, SIGNAL(signal_value_change()),
this, SLOT(
ObjectChanged()), Qt::UniqueConnection);
508 connect(
this, SIGNAL(
LoadedInitials()), widget, SLOT(slot_set_initial_loaded()), Qt::UniqueConnection);
511 }
512}
void set_attribute_widget(dunedaq::conffwk::attribute_t const &, widgets::editors::base *)
void set_tooltip(dunedaq::conffwk::attribute_t const &, widgets::editors::base *)
void ResetObjectChanged()
void register_attribute_widget(QString const &name, widgets::editors::base *widget)
void register_relation_widget(QString const &name, widgets::editors::base *widget)
static dunedaq::conffwk::class_t definition(std::string const &cn, bool direct_only)
std::vector< T > attributes(tref const &item)
tref relation< tref >(tref object, dunedaq::conffwk::relationship_t const &r)
T relation(tref item, dunedaq::conffwk::relationship_t const &relation)
std::vector< T > relations(tref const &item)
bool is_simple(dunedaq::conffwk::relationship_t const &)
inner::configobject::tref tref
const std::vector< attribute_t > p_attributes
const std::vector< relationship_t > p_relationships