400{
401 dunedaq::conffwk::class_t const & classdef =
405
406 for ( dunedaq::conffwk::attribute_t const & attr : attributes )
407
408 {
409 QString name = QString::fromStdString ( attr.p_name );
410
411 if ( attr.p_is_multi_value )
412 {
413 widgets::editors::multiattr * widget = new widgets::editors::multiattr ( attr, this,
416
419 connect ( widget, SIGNAL ( signal_value_change() ),
this, SLOT (
UpdateActions() ),
420 Qt::UniqueConnection );
421 connect ( widget, SIGNAL ( signal_value_change() ),
this, SLOT (
ObjectChanged() ),
422 Qt::UniqueConnection );
424 }
425 else
426 {
427 switch ( attr.p_type )
428 {
429
431
433 {
434 widgets::editors::combo * Widget = new widgets::editors::combo ( attr, this, true );
438 connect ( Widget->Combo, SIGNAL ( activated ( QString ) ),
this, SLOT (
UpdateActions() ),
439 Qt::UniqueConnection );
440 connect ( Widget, SIGNAL ( signal_value_change() ),
this, SLOT (
ObjectChanged() ),
441 Qt::UniqueConnection );
443 break;
444 }
445
447
449
451
453
455
457
459
461
463
465 {
466 widgets::editors::numericattr * Widget =
467 new widgets::editors::numericattr ( attr,
this,
true,
m_readonly );
471 connect ( Widget, SIGNAL ( signal_value_change() ),
this, SLOT (
UpdateActions() ),
472 Qt::UniqueConnection );
473 connect ( Widget, SIGNAL ( signal_value_change() ),
this, SLOT (
ObjectChanged() ),
474 Qt::UniqueConnection );
476 break;
477 }
478
480
482
484 {
485 widgets::editors::stringattr * Widget =
486 new widgets::editors::stringattr ( attr,
this,
true,
m_readonly );
490 connect ( Widget, SIGNAL ( signal_value_change() ),
this, SLOT (
UpdateActions() ),
491 Qt::UniqueConnection );
492 connect ( Widget, SIGNAL ( signal_value_change() ),
this, SLOT (
ObjectChanged() ),
493 Qt::UniqueConnection );
495 break;
496 }
497
499 {
500 widgets::editors::combo * Widget = new widgets::editors::combo ( attr, this, true );
504 connect ( Widget->Combo, SIGNAL ( activated ( QString ) ),
this, SLOT (
UpdateActions() ),
505 Qt::UniqueConnection );
506 connect ( Widget, SIGNAL ( signal_value_change() ),
this, SLOT (
ObjectChanged() ),
507 Qt::UniqueConnection );
509 break;
510 }
511 }
512 }
513 }
514
515 for ( dunedaq::conffwk::relationship_t const & arelation :
516 relations )
517 {
518 widgets::editors::relation * widget = new widgets::editors::relation ( arelation, this,
520 QString name = QString::fromStdString ( arelation.p_name );
522
524 {
525 std::vector<tref> DataList;
526
528 {
529 try
530 {
531 DataList.push_back (
533 }
534 catch ( daq::dbe::config_object_retrieval_result_is_null const & e )
535 {
536
537 }
538 }
539 else
540 {
542 }
543
544 for (
tref const & i : DataList )
545 {
546 if ( not i.is_null() )
547 {
548 Data.push_back ( QString::fromStdString ( i.full_name() ) );
549 }
550 }
551 }
552
553 widget->setdata ( Data );
554 widget->SetEditor();
555
558 connect ( widget, SIGNAL ( signal_value_change() ),
this, SLOT (
UpdateActions() ),
559 Qt::UniqueConnection );
560 connect ( widget, SIGNAL ( signal_value_change() ),
this, SLOT (
ObjectChanged() ),
561 Qt::UniqueConnection );
563 Qt::UniqueConnection );
564 connect (
this, SIGNAL (
LoadedInitials() ), widget, SLOT ( slot_set_initial_loaded() ),
565 Qt::UniqueConnection );
568 }
569}
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