418{
419 QString ClassName =
ui->ClassCombo->currentText();
420 bool SubClasses =
ui->SubclassesCheckBox->isChecked();
421
423 ClassName.toStdString(), SubClasses );
424
425 std::vector<dref> candidates;
426 std::copy ( tmprefs.begin(), tmprefs.end(), std::back_inserter ( candidates ) );
427
428 if ( !candidates.empty() )
429 {
430 filter ( candidates, ClassName );
431 }
432
433 if ( candidates.empty() )
434 {
435 QMessageBox::information ( this, tr ( "Message" ), tr ( "No objects match filter!" ) );
436 }
437 else
438 {
439 int NumberOfColumns = 1;
440 bool AttributeEnabled = false;
441 bool RelationshipEnabled = false;
442
443 if (
ui->AttributeComboBox->isEnabled() )
444 {
445 AttributeEnabled = true;
446 NumberOfColumns++;
447 }
448
449 if (
ui->RelationshipComboBox->isEnabled() )
450 {
451 RelationshipEnabled = true;
452 NumberOfColumns++;
453 }
454
455 m_filter_table = std::unique_ptr<QTableWidget> (
new QTableWidget() );
456 m_filter_table->setWindowTitle ( tr (
"Objects matching filter" ) );
459
460 for ( size_t i = 0; i < candidates.size(); i++ )
461 {
462 QTableWidgetItem * AttributeValue;
463 QTableWidgetItem * RelationshipValue;
464
465 QTableWidgetItem * ObjectUid = new QTableWidgetItem (
466 tr ( "%1@%2" ).arg ( candidates.at ( i ).UID().c_str() ).arg (
467 candidates.at ( i ).class_name().c_str() ) );
469
470 if ( AttributeEnabled )
471 {
473 ui->AttributeComboBox->currentText(), ClassName );
474
475 QStringList AttributeValueList
476 {
478 Attribute ) };
479
480 AttributeValue = new QTableWidgetItem ( AttributeValueList.join ( " " ) );
482 }
483
484 if ( RelationshipEnabled )
485 {
487 ui->RelationshipComboBox->currentText(), ClassName );
488
489 QStringList RelationshipList
490 {
491 dbegraph::linked::through::relation<QStringList> (
492 candidates.at ( i ).ref(), Relationship ) };
493
494 RelationshipValue = new QTableWidgetItem ( RelationshipList.join ( " " ) );
496 }
497 }
498
499 QStringList Headers;
500 Headers << "Object Id";
501
502 if ( AttributeEnabled )
503 {
504 Headers <<
ui->AttributeComboBox->currentText();
505 }
506
507 if ( RelationshipEnabled )
508 {
509 Headers <<
ui->RelationshipComboBox->currentText();
510 }
511
513
515 HeaderView->setStretchLastSection ( true );
518 }
519}
static std::vector< dbe::inner::configobject::tref > objects(std::string const &cname, bool const keep_inherited=true)
dunedaq::conffwk::relationship_t match(T const &, T const &)
dunedaq::conffwk::attribute_t attributematch(QString const &, QString const &)