314{
315 std::vector<dref> Objects;
316
317 BOOST_SCOPE_EXIT(&Objects, this_)
318 {
319 QList<QPair<QString, QString>> objs;
320 for(const auto& o : Objects) {
321 objs.append(QPair<QString, QString>(QString::fromStdString(o.class_name()),
322 QString::fromStdString(o.UID())));
323 }
324
326
327
328 QApplication::restoreOverrideCursor();
329 this_->ui->ChangeButton->setEnabled(true);
331 }
332 BOOST_SCOPE_EXIT_END
333
334 ui->ChangeButton->setEnabled(
false);
335 QApplication::setOverrideCursor(Qt::WaitCursor);
337
338 bool SubClasses =
ui->SubclassesCheckBox->isChecked();
339 QString ClassName =
ui->ClassCombo->currentText();
340
341 std::unique_ptr<dbe::interface::messenger::batch_guard> batchmode (
343
345
347 {
349 ClassName.toStdString(), SubClasses );
350
351 std::copy ( tmprefs.begin(), tmprefs.end(), std::back_inserter ( Objects ) );
352
353 if ( not Objects.empty() )
354 {
355 filter ( Objects, ClassName );
356 }
357 }
358 else
359 {
361 }
362
363 if ( Objects.empty() ) QMessageBox::information ( this, tr ( "Message" ),
364 tr ( "No objects match filter!" ) );
365 else
366 {
368 ClassName.toStdString(), false );
369 const std::vector<dunedaq::conffwk::attribute_t> AttributeList = ClassInfo.
p_attributes;
370 const std::vector<dunedaq::conffwk::relationship_t> RelationshipList = ClassInfo
372 dunedaq::conffwk::attribute_t AttributeChange;
373 dunedaq::conffwk::relationship_t RelationshipChange;
374
375 for ( dunedaq::conffwk::attribute_t i : AttributeList )
376 if ( i.p_name ==
ui->NewAttributeComboBox->currentText().toStdString() )
377 {
378 AttributeChange = i;
379 break;
380 }
381
382 for ( dunedaq::conffwk::relationship_t i : RelationshipList )
383 if ( i.p_name ==
ui->NewRelationshipComboBox->currentText().toStdString() )
384 {
385 RelationshipChange = i;
386 break;
387 }
388
389 QStringList AttributeChangeList;
390
391 if ( !
ui->AttributeEdit->text().isEmpty() ) AttributeChangeList
392 <<
ui->AttributeEdit->text();
393
394 for ( auto objects_iter = Objects.begin(); objects_iter != Objects.end(); ++objects_iter )
395 {
396 tref Object = objects_iter->
ref();
397
398 QStringList RelationshipChangeList;
399
400 if (
ui->ChangeAtrributeCheckBox->isChecked() )
401 {
402 if ( !AttributeChangeList.isEmpty() )
403 {
405 }
406 }
407
408 if (
ui->ChangeRelationshipCheckBox->isChecked() )
409 {
410 if (
ui->AddCheckBox->isChecked() )
411 {
412 RelationshipChangeList =
414 Object, RelationshipChange );
415 }
416
417 RelationshipChangeList <<
ui->RelationshipEdit->currentText();
419 }
420 }
421 }
422}
static confaccessor & ref()
dunedaq::conffwk::ConfigObject & ref(bool check_null=true) const
static std::unique_ptr< batch_guard > batchmode()
void relation(dbe::inner::configobject::tref src, dunedaq::conffwk::relationship_t const &edge, QStringList const &targets)
void attribute(dbe::inner::configobject::tref objectref, dunedaq::conffwk::attribute_t const &attribute_info, QStringList const &attribute_values)
inner::configobject::tref tref