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 apps/SchemaEditor/SchemaCustomMethodModel.cpp).
5
7
8using namespace dunedaq::oks;
9
10dbse::CustomMethodModel::CustomMethodModel ( OksClass * ClassInfo, QStringList Headers,
11 bool Derived )
12 : CustomModelInterface ( Headers ),
13 SchemaClass ( ClassInfo ),
14 SchemaDerived ( Derived )
15{
16 setupModel();
17}
18
20{
21 Data.clear();
22 const std::list<OksMethod *> * MethodList;
23 std::set<std::string> direct_methods;
24 auto methods = SchemaClass->direct_methods();
25 if (methods != nullptr) {
26 for (auto method : *methods) {
27 direct_methods.insert(method->get_name());
28 }
29 }
30
31 if ( SchemaDerived )
32 {
33 MethodList = SchemaClass->all_methods();
34 }
35 else
36 {
37 MethodList = SchemaClass->direct_methods();
38 }
39
40 if ( MethodList != nullptr )
41 {
42 for ( OksMethod * Method : *MethodList )
43 {
44 QStringList row;
45 auto name = Method->get_name();
46 row.append ( QString::fromStdString ( name ) );
47 if (direct_methods.contains(name)) {
48 row.append("D");
49 }
50 else {
51 row.append("I");
52 }
53 Data.append ( row );
54 }
55 }
56}
57
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:205
OKS method class.
Definition method.hpp:158