My Project
 All Classes Functions Variables Pages
mainwindow.h
1 /* LINUX issues: replace line end by using fgetss instead of fgets
2  * Qt4/Qt5: - Qt5 needs "QT += widgets" and "QT += concurrent" in MoessFit.pro
3  *
4  */
5 /* Version History:
6  * 015: - improved performance of SHc and SHp by factor three by
7  * a) introducing MoessCalc::f_lorenz_fast() (less divsion operation)
8  * b) moving "new"-commands from methods to constructor
9  * c) replacing the long Barb formula in MoessCalc::I(beta,gamma,f,i)
10  * d) removing redundant calc() command in MoessCalc::get_SC_spectrum()
11  * - introduced MoessCalc::get_afm_Powder_spectrum() for afm-powders in
12  * external field in transverse geometry
13  * - first LINUX compilation, substituted fgets() by fitmodel::fgetss()
14  * to get rid of line-end-charcter issues
15  * 016: - corrected fitmodel::interprete_commands() concerning "A0" and "I0"
16  * not to crash if linking of symbols fails
17  * - simplyfied source code by removing AnyFit_in-exceptations, i.g.
18  * assigning errors to every kind of data (RUN.err2rec) and using it
19  * - simplified source code substitution RUN struct by class with
20  * appropriated constructor
21  * - improved performance of TransmissionIntegral by factor 3
22  * - corrected global error calculation progress bar
23  * - improved global fitting (maxtry=20 & introduced line search)
24  * - introduced convergence criterium for fitting algorithm, set COMMANDS
25  * "ConvergenceCriterium"
26  * - added "plot"-buttons to play panel
27  * - added scroll option to whole play panel
28  * - added fit-checkbox to play panel
29  * - added information label to progress bar
30  * - assigned play panel to main window,
31  * - rewrite mainwindow.cpp and mainwindow.h to get rid of old unattended
32  * error-prone moessfit user interface
33  * - check for block count in mbs-file
34  * - panel update at global fitting
35  * - obj resolving in FUNCTIONS-parser corrected by sorting obj in
36  * fitmodel::link()
37  * - introduced MoessCalc::get_fm_Powder_spectrum()
38  * - corrected multithreading-TransmissionIntegral but by using run.A
39  * instead of fitmodel.Asum (Asum does not exist anymore)
40  * - introduced Voigt-profil model
41  * - introduced FeAs-model
42  * - rebuild "fit"-handling on Mainpanel
43  * - panelclick removes focus from lineedit
44  * 017: - fit errors now show 1-sigma-confidence (68%), and no more 95&
45  * confidence (28.11.2014)
46  * - shift FeAs-spectra to Moesscalc class
47  * - add noise
48  * - introduced Hesse-Ruebartsch constructor HR
49  * - improved covariant error calculation by line scan for diraction of
50  * highest correlation and downscaling of off diagonal matrix elements
51  * in case of ininvertability
52  * - ForceSimplex command
53  * - introduced maximum Error calcultion MINOS
54  * - introduced MonteCarlo Error calculation
55  * - show fit data in secondary plot if no MEM
56  * - enable mouse position in plot window
57  * - scrolling through data sets in plot2D
58  * - dataset links in plot 2D
59  * - new block definition: block ends at "##", single "#" or "\n" will
60  * continue the blok but disable the line
61  * 018: - reorganized read_theory error message handling
62  * - introduced Dyn(DiagDiag(Diag)) models
63  * - introduced MLR models
64  * - introduced mainwindow::run_testsuite() to verify new code
65  * - changed number parsing in from_fld from RegExp to trial-error
66  */
67 
68 
69 #ifndef MAINWINDOW_H
70 #define MAINWINDOW_H
71 #define SPECTRUMWIDTH 2048
72 #include <QMessageBox>
73 #include <QPainter>
74 #include <QColor>
75 #include <QBrush>
76 #include <QClipboard>
77 #include <QFileDialog>
78 #include "Moesscalc.h"
79 #include <QMainWindow>
80 #include "plot2D.h"
81 #include <QStringList>
82 #include <QProgressDialog>
83 #include "fitmodel.h"
84 #include "fold.h"
85 #include "DataTif.h"
86 #include "crystalfields.h"
87 #include <QLayout>
88 
89 
90 
91 namespace Ui {
92 class MainWindow;
93 }
94 
95 class MainWindow : public QMainWindow
96 {
97  Q_OBJECT
98 
99 public:
100  explicit MainWindow(QWidget *parent = 0, int argc = 0, char *argv[] = NULL);
101  ~MainWindow();
102 
103 private:
104  void keyPressEvent(QKeyEvent *event);
105  Ui::MainWindow *ui;
107  void start_empty();
109  bool load_from_fld(QStringList filelist);
111  bool load_from_mbs(QString filename);
112  void clear_panel();
113  void run_test_suite();
114  fitmodel* cfm;
115  QString cfmfile;
116  plot2D MoessSpectrum;
117  plot2D EnergySpectrum;
118 
119 private slots:
121  void folder_refine();
123  void folder_to_tiff();
125  void plot_current_fit_modell();
126  void toggle_EnergyPlot();
127  void toggle_AbsorbtionPlot();
128  void Absorbtion_to_clipboard();
131  void Energy_to_clipboard();
133  void child_keyevent(QKeyEvent *event);
134  void open_dialog();
136  void add_noise();
137 
138 protected:
139  void closeEvent(QCloseEvent *);
140 };
141 
142 #endif // MAINWINDOW_H
143 
144 
Definition: plot2D.h:18
Definition: ui_mainwindow.h:291
Definition: mainwindow.h:95
parser and handler of user input mbs-files
Definition: fitmodel.h:159