DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
MainWindow.hpp
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 dbe/MainWindow.h to include/dbe/MainWindow.hpp).
5
6#ifndef MAINWINDOW_H
7#define MAINWINDOW_H
8
10#include <QMainWindow>
11#include <QMap>
12#include <QMessageBox>
13#include <QSet>
14#include <QSettings>
15#include <QString>
16
17#include <QDragEnterEvent>
18#include <QDropEvent>
19#include <QTabWidget>
20
22#include "ui_DBE.h"
23
26#include "dbe/FileModel.hpp"
27// #include "dbe/OracleWidget.hpp"
28#include "dbe/TableTab.hpp"
29#include "dbe/subtreeproxy.hpp"
30#include "dbe/table.hpp"
32#include "dbe/tree.hpp"
33#include "dbe/treeselection.hpp"
34
35// /// Including IPC
36// #include <ipc/partition.h>
37// #include <rdb/rdb.hh>
38
39#include <atomic>
40
41namespace dbe {
42namespace Ui {
43class MainWindow;
44} // namespace Ui
45
47 : public QMainWindow
48 , private dbe::Ui::MainWindow
49{
50 Q_OBJECT
51public:
52 explicit MainWindow(QMap<QString, QString> const& CommandLine, QWidget* parent = nullptr);
53
54 static MainWindow* findthis();
55
56 [[nodiscard]] bool check_ready() const;
57
58 [[nodiscard]] cptr<dbe::CustomTreeView> get_view() const;
59
60 [[nodiscard]] QString find_db_repository_dir();
61
62private:
63 // typedef QMap<QString, bool> RDBMap;
64
65 QSet<QString> allFiles;
66
69 QSortFilterProxyModel this_filesort;
70
73
74 // OracleWidget * this_oraclewidget;
75
76 std::atomic<bool> isArchivedConf;
77
78 std::vector<dbe::tref> ProcessQuery(QString const&);
79
80 void closeEvent(QCloseEvent* event);
81
82 bool eventFilter(QObject* Target, QEvent* Event);
83
84 bool check_close();
85
86 void init();
87
88 void attach();
89
90 bool dbopen(QString const&, dbinfo const&);
91
92 bool dbload();
93
94 bool dbreload();
95
96 void setinternals();
97
99 void build_table_model();
100
101public:
102 void build_file_model();
103
104private:
105 void apply_settings(QSettings& setting);
106
107 void WriteSettings();
108 void argsparse(QMap<QString, QString> const&);
109 // void init_rdb_menu();
110 // void lookForRDBServers ( const IPCPartition & p );
111 void init_tabs();
112
113 void edit_object_at(const QModelIndex& Index);
114
116 void display_message_box(const QString& title, const QString& msg, const QMessageBox::Icon& icon);
118private slots:
119 void slot_create_newdb();
121 void slot_load_db_from_create_widget(const QString&);
122
123 // void slot_rdb_selected ( QAction * );
124 // void slot_rdb_found (const QString& p, const RDBMap& rdbs);
125
126 // void slot_oracle_prepare();
127 // void slot_load_oracle ( const QString & );
128
129 bool slot_commit_database(bool Exit = false);
130
131 void slot_abort_changes();
133
135 void slot_edit_object_from_class_view(QModelIndex const&);
136
137 void slot_fetch_data(treenode const*);
138
141
143
144 void slot_filter_query();
145 void slot_filter_textchange(const QString&);
146 void slot_filter_table_textchange(const QString&);
147
148 void slot_tree_reset();
149 void slot_model_rebuild();
150
151 void slot_whatisthis();
152
154 void slot_show_userguide();
156
159
161 void slot_add_tab();
162 void slot_remove_tab(int i);
163
165
166 void slot_update_committed_files(const std::list<std::string>&, const std::string&);
167
168 void slot_loaded_db_file(QString);
169
171public slots:
173 void slot_batch_change_stop(const QList<QPair<QString, QString>>&);
174
175 void slot_information_message(QString const, QString const);
176 void slot_warning_message(QString const, QString const);
177 void slot_error_message(QString const, QString const);
178
179signals:
180 // void signal_rdb_found (const QString& p, const RDBMap& rdbs);
181 void signal_batch_change_stopped(const QList<QPair<QString, QString>>&);
185};
186
187} // namespace dbe
188
189#endif // MAINWINDOW_H
Definition cptr.hpp:56
void slot_fetch_data(treenode const *)
void slot_information_message(QString const, QString const)
void edit_object_at(const QModelIndex &Index)
bool dbopen(QString const &, dbinfo const &)
void slot_show_userchanges()
void slot_update_committed_files(const std::list< std::string > &, const std::string &)
void slot_warning_message(QString const, QString const)
std::atomic< bool > isArchivedConf
void slot_batch_change_start()
void slot_loaded_db_file(QString)
void slot_batch_change_stop(const QList< QPair< QString, QString > > &)
void slot_remove_tab(int i)
dbe::models::tree * this_classes
void slot_launch_object_editor(tref)
void slot_abort_changes()
void slot_process_externalchanges()
void slot_toggle_casesensitive_for_treeview(bool)
void load_default_settings()
void display_message_box(const QString &title, const QString &msg, const QMessageBox::Icon &icon)
void slot_launch_batchchange_on_table()
void build_class_tree_model()
QSet< QString > allFiles
void slot_toggle_commit_button()
void closeEvent(QCloseEvent *event)
void slot_load_db_from_create_widget(const QString &)
void build_file_model()
bool slot_commit_database(bool Exit=false)
void argsparse(QMap< QString, QString > const &)
void slot_launch_batchchange()
void apply_settings(QSettings &setting)
cptr< dbe::CustomTreeView > get_view() const
models::treeselection * this_treefilter
void slot_error_message(QString const, QString const)
bool eventFilter(QObject *Target, QEvent *Event)
void slot_open_database_from_file()
void slot_abort_external_changes()
void signal_new_file_model()
QString find_db_repository_dir()
void build_table_model()
FileModel * this_files
void slot_create_newdb()
void slot_show_userguide()
static MainWindow * findthis()
void slot_undo_allchanges()
void slot_model_rebuild()
bool m_batch_change_in_progress
void slot_edit_object_from_class_view(QModelIndex const &)
void slot_filter_table_textchange(const QString &)
void signal_db_loaded()
void slot_filter_textchange(const QString &)
void signal_externalchanges_processed()
std::vector< dbe::tref > ProcessQuery(QString const &)
void signal_batch_change_stopped(const QList< QPair< QString, QString > > &)
void update_total_objects()
void reload_default_settings()
bool check_ready() const
MainWindow(QMap< QString, QString > const &CommandLine, QWidget *parent=nullptr)
void slot_launch_preferences()
QSortFilterProxyModel this_filesort
void slot_show_information_about_dbe()
Include QT Headers.
inner::configobject::tref tref
Definition tref.hpp:36
dbinfo
Definition dbinfo.hpp:19