Debian Codegraph @

avogadro/qtplugins/cp2kinput/cp2kinputdialog.h

raw
1 /******************************************************************************
2 This source file is part of the Avogadro project.
3 This source code is released under the 3-Clause BSD License, (see "LICENSE").
4 ******************************************************************************/
5
6 #ifndef CP2KINPUTDIALOG_H
7 #define CP2KINPUTDIALOG_H
8
9 #include <QButtonGroup>
10 #include <QDialog>
11 #include <QModelIndex>
12
13 #include "ui_cp2kinputdialog.h"
14
15 #include <QtCore/QSettings>
16
17 class QJsonObject;
18
19 namespace Avogadro {
20 namespace MoleQueue {
21 class JobObject;
22 }
23 namespace QtGui {
24 class Molecule;
25 }
26
27 namespace QtPlugins {
28 // class GamessHighlighter;
29
30 class Cp2kInputDialog : public QDialog
31 {
32 Q_OBJECT
33
34 enum CalculateOption
35 {
36 CalculateEnergy = 0,
37 CalculateEnergyAndForces,
38 CalculateMolecularDynamics,
39 CalculateGeometryOptimization,
40
41 CalculateCount
42 };
43
44 enum BasisOption
45 {
46 BasisSZVGTH = 0,
47 BasisDZVGTH,
48 BasisDZVPGTH,
49 BasisTZVPGTH,
50 BasisTZV2PGTH,
51
52 BasisCount
53 };
54
55 public:
56 explicit Cp2kInputDialog(QWidget* parent_ = nullptr,
57 Qt::WindowFlags f = Qt::WindowFlags());
58 ~Cp2kInputDialog() override;
59
60 void setMolecule(QtGui::Molecule* mol);
61
62 signals:
63 /**
64 * Emitted when the user requests that a job's output be loaded in Avogadro.
65 */
66 void openJobOutput(const Avogadro::MoleQueue::JobObject& job);
67
68 protected:
69 void showEvent(QShowEvent* e) override;
70
71 private slots:
72 void updatePreviewText();
73
74 void defaultsClicked();
75 void resetClicked();
76 void generateClicked();
77 void computeClicked();
78
79 void updateTitlePlaceholder();
80
81 private:
82 void connectBasic();
83 void connectPreview();
84 void connectButtons();
85
86 void buildOptions();
87 void updateOptionCache();
88 void restoreOptionCache();
89
90 void buildCalculateOptions();
91 void buildFunctionalOptions();
92 void buildMethodOptions();
93 void buildBasisOptions();
94 void buildStateOptions();
95 void buildMultiplicityOptions();
96 void buildChargeOptions();
97
98 void buildEWALDTypeOptions();
99
100 void buildSCFGuessOptions();
101 void buildOTMinimizerOptions();
102
103 void setBasicDefaults();
104
105 /// @return valid values for CP2K RUN_TYPE
106 static QString fromCalcEnum(CalculateOption option);
107 QString generateJobTitle() const;
108
109 Ui::Cp2kInputDialog ui;
110 QtGui::Molecule* m_molecule;
111 // GamessHighlighter *m_highlighter;
112
113 bool m_updatePending;
114 QMap<QComboBox*, int> m_optionCache;
115 };
116
117 } // end namespace QtPlugins
118 } // end namespace Avogadro
119
120 #endif // CP2KINPUTDIALOG_H