Line data Source code
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: no.
5 :
6 : #include "dbe/OracleWidget.hpp"
7 : #include "dbe/messenger.hpp"
8 : #include "ui_OracleWidget.h"
9 : #include <QMessageBox>
10 :
11 0 : dbe::OracleWidget::~OracleWidget() = default;
12 :
13 0 : dbe::OracleWidget::OracleWidget(QWidget* parent)
14 : : QWidget(parent)
15 0 : , ui(new Ui::OracleWidget)
16 : {
17 0 : ui->setupUi(this);
18 0 : SetController();
19 0 : }
20 :
21 : void
22 0 : dbe::OracleWidget::SetController()
23 : {
24 0 : connect(ui->RunButton, SIGNAL(clicked()), this, SLOT(ProcessOracleCommand()), Qt::UniqueConnection);
25 0 : }
26 :
27 : /**
28 : * Build the connection command from the arguments given to the widget and emit the signal such that
29 : * the connection can be made as needed from the appropriate window
30 : */
31 : void
32 0 : dbe::OracleWidget::ProcessOracleCommand()
33 : {
34 0 : QString connect_str = ui->connection_string_input->text();
35 :
36 0 : if (connect_str.isEmpty()) {
37 0 : ERROR("Database information invalid", "Oracle connection string has not been set");
38 0 : return;
39 : }
40 :
41 0 : QString schema_str = ui->schema_string_input->text();
42 :
43 0 : if (schema_str.isEmpty()) {
44 0 : ERROR("Database information invalid", "Oracle working schema has not been set");
45 0 : return;
46 : }
47 :
48 0 : QString version_str = ui->OracleLine->text();
49 :
50 0 : if (version_str.isEmpty()) {
51 0 : ERROR("Database information invalid", "Oracle schema version has not been set");
52 0 : return;
53 : }
54 :
55 0 : QString oracleCommand(ui->PluginLabel->text() + connect_str + ":" + schema_str + ":" + version_str);
56 :
57 0 : emit OpenOracleConfig(oracleCommand);
58 0 : }
|