DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SchemaCustomMethodModel.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/SchemaCustomMethodModel.cpp to
5// apps/SchemaEditor/SchemaCustomMethodModel.cpp).
6
8
9using namespace dunedaq::oks;
10
11dbse::CustomMethodModel::CustomMethodModel(OksClass* ClassInfo, QStringList Headers, bool Derived)
12 : CustomModelInterface(Headers)
13 , SchemaClass(ClassInfo)
14 , SchemaDerived(Derived)
15{
16 setupModel();
17}
18
19void
21{
22 Data.clear();
23 const std::list<OksMethod*>* MethodList;
24 std::set<std::string> direct_methods;
25 auto methods = SchemaClass->direct_methods();
26 if (methods != nullptr) {
27 for (auto method : *methods) {
28 direct_methods.insert(method->get_name());
29 }
30 }
31
32 if (SchemaDerived) {
33 MethodList = SchemaClass->all_methods();
34 } else {
35 MethodList = SchemaClass->direct_methods();
36 }
37
38 if (MethodList != nullptr) {
39 for (OksMethod* Method : *MethodList) {
40 QStringList row;
41 auto name = Method->get_name();
42 row.append(QString::fromStdString(name));
43 if (direct_methods.contains(name)) {
44 row.append("D");
45 } else {
46 row.append("I");
47 }
48 Data.append(row);
49 }
50 }
51}
52
CustomMethodModel(dunedaq::oks::OksClass *ClassInfo, QStringList Headers, bool Derived=false)
dunedaq::oks::OksClass * SchemaClass
CustomModelInterface(QStringList Headers, QObject *parent=nullptr)
Including Schema Editor.
The OKS class.
Definition class.hpp:223
OKS method class.
Definition method.hpp:147