DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
dbe
apps
SchemaEditor
SchemaCustomRelationshipModel.cpp
Go to the documentation of this file.
1
// DUNE DAQ modification notice:
2
// This file has been modified from the original ATLAS dbe source for the DUNE DAQ project.
3
// Fork baseline commit: dbe-02-12-17 (2022-05-12).
4
// Renamed since fork: yes (from src/SchemaEditor/SchemaCustomRelationshipModel.cpp to
5
// apps/SchemaEditor/SchemaCustomRelationshipModel.cpp).
6
7
#include "
dbe/SchemaCustomRelationshipModel.hpp
"
8
9
using namespace
dunedaq::oks
;
10
11
dbse::CustomRelationshipModel::CustomRelationshipModel
(
OksClass
* ClassInfo, QStringList Headers,
bool
Derived)
12
:
CustomModelInterface
(Headers)
13
,
SchemaClass
(ClassInfo)
14
,
SchemaDerived
(Derived)
15
{
16
setupModel
();
17
}
18
19
void
20
dbse::CustomRelationshipModel::setupModel
()
21
{
22
Data
.clear();
23
const
std::list<OksRelationship*>* RelationshipList;
24
25
if
(
SchemaDerived
) {
26
RelationshipList =
SchemaClass
->all_relationships();
27
}
else
{
28
RelationshipList =
SchemaClass
->direct_relationships();
29
}
30
31
if
(RelationshipList) {
32
for
(
OksRelationship
* Relationship : *RelationshipList) {
33
QStringList Row;
34
Row.append(QString::fromStdString(Relationship->get_name()));
35
Row.append(QString::fromStdString(Relationship->get_type()));
36
Row.append(QString(Relationship->card2str(Relationship->get_low_cardinality_constraint())));
37
Row.append(QString(Relationship->card2str(Relationship->get_high_cardinality_constraint())));
38
Data
.append(Row);
39
}
40
}
41
}
42
43
dbse::CustomRelationshipModel::~CustomRelationshipModel
() =
default
;
SchemaCustomRelationshipModel.hpp
dbse::CustomModelInterface::CustomModelInterface
CustomModelInterface(QStringList Headers, QObject *parent=nullptr)
Including Schema Editor.
Definition
SchemaCustomModelInterface.cpp:12
dbse::CustomModelInterface::Data
QList< QStringList > Data
Definition
SchemaCustomModelInterface.hpp:31
dbse::CustomRelationshipModel::SchemaClass
dunedaq::oks::OksClass * SchemaClass
Definition
SchemaCustomRelationshipModel.hpp:25
dbse::CustomRelationshipModel::setupModel
void setupModel()
Definition
SchemaCustomRelationshipModel.cpp:20
dbse::CustomRelationshipModel::CustomRelationshipModel
CustomRelationshipModel(dunedaq::oks::OksClass *ClassInfo, QStringList Headers, bool Derived=false)
Definition
SchemaCustomRelationshipModel.cpp:11
dbse::CustomRelationshipModel::SchemaDerived
bool SchemaDerived
Definition
SchemaCustomRelationshipModel.hpp:26
dbse::CustomRelationshipModel::~CustomRelationshipModel
~CustomRelationshipModel()
dunedaq::oks::OksClass
The OKS class.
Definition
class.hpp:223
dunedaq::oks::OksRelationship
Definition
relationship.hpp:100
dunedaq::oks
Definition
SchemaCommand.hpp:17
Generated on
for DUNE-DAQ by
1.18.0