MNE-CPP  beta 1.0
editorwindow.h
Go to the documentation of this file.
1 //=============================================================================================================
40 #ifndef EDITORWINDOW_H
41 #define EDITORWINDOW_H
42 
43 //*************************************************************************************************************
44 //=============================================================================================================
45 // INCLUDES
46 //=============================================================================================================
47 
48 #include <mne/mne.h>
49 #include <utils/mp/fixdictmp.h>
50 
51 //*************************************************************************************************************
52 //=============================================================================================================
53 // Qt INCLUDES
54 //=============================================================================================================
55 
56 #include <QMainWindow>
57 #include <QModelIndex>
58 #include <QtXml/QtXml>
59 #include <QDomDocument>
60 
61 //=============================================================================================================
62 // USED NAMESPACES
63 
64 using namespace MNELIB;
65 
66 namespace Ui
67 {
68  class EditorWindow;
69 }
70 //=============================================================================================================
71 
72 class AtomWindow;
73 class XAxisAtomWindow;
74 
75 class EditorWindow : public QMainWindow
76 {
77  Q_OBJECT
78 
79 public:
80 
81  //*********************************************************************************************************
82  //constructor
83  explicit EditorWindow(QWidget *parent = 0);
84  //*********************************************************************************************************
85 
86  ~EditorWindow();
87  enum AtomType
88  {
89  Gauss,
90  Chirp
91  };
92 
93 private:
94 
95  //========================================================================================================
105  void read_dicts();
106 
107  //========================================================================================================
117  void deleteDicts();
118 
119  //========================================================================================================
129  void calc_scale_value();
130 
131  //========================================================================================================
141  void calc_modu_value();
142 
143  //========================================================================================================
153  void calc_phase_value();
154 
155  //========================================================================================================
165  void calc_chirp_value();
166 
167  //========================================================================================================
177  void calc_atom_count_all_combined();
178 
179  //========================================================================================================
192  QList<qreal> calc_lin_pos_parameters(qreal startValue, qreal linStepValue);
193 
194  //========================================================================================================
207  QList<qreal> calc_lin_neg_parameters(qreal startValue, qreal linStepValue);
208 
209  //========================================================================================================
222  QList<qreal> calc_exp_pos_parameters(qreal startValue, qreal expStepValue);
223 
224  //========================================================================================================
237  QList<qreal> calc_exp_neg_parameters(qreal startValue, qreal expStepValue);
238 
239  //========================================================================================================
254  QList<qreal> calc_all_comb_parameter_values_scale(qreal startValue, qreal endvalue, qreal linStepValue, qreal expStepValue);
255 
256  //========================================================================================================
271  QList<qreal> calc_all_comb_parameter_values_modu(qreal startValue, qreal endvalue, qreal linStepValue, qreal expStepValue);
272 
273  //========================================================================================================
288  QList<qreal> calc_all_comb_parameter_values_phase(qreal startValue, qreal endvalue, qreal linStepValue, qreal expStepValue);
289 
290  //========================================================================================================
305  QList<qreal> calc_all_comb_parameter_values_chirp(qreal startValue, qreal endvalue, qreal linStepValue, qreal expStepValue);
306 
307  //========================================================================================================
321  QList<qreal> calc_parameter_values_scale(qreal startValue, qreal linStepValue, qreal expStepValue);
322 
323  //========================================================================================================
337  QList<qreal> calc_parameter_values_modu(qreal startValue, qreal linStepValue, qreal expStepValue);
338 
339  //========================================================================================================
353  QList<qreal> calc_parameter_values_phase(qreal startValue, qreal linStepValue, qreal expStepValue);
354 
355  //========================================================================================================
369  QList<qreal> calc_parameter_values_chirp(qreal startValue, qreal linStepValue, qreal expStepValue);
370 
371  //========================================================================================================
372 
373 private slots:
374  void on_btt_CalcAtoms_clicked();
375  void on_spb_AtomCount_valueChanged(int arg1);
376  void on_dspb_StartValueScale_editingFinished();
377  void on_rb_PosCountScale_toggled();
378  void on_rb_NoStepScale_toggled(bool checked);
379  void on_rb_LinStepScale_toggled(bool checked);
380  void on_rb_ExpStepScale_toggled(bool checked);
381  void on_dspb_ExpStepScale_editingFinished();
382  void on_rb_NegCountScale_toggled();
383  void on_dspb_LinStepScale_editingFinished();
384  void on_rb_NoStepModu_toggled(bool checked);
385  void on_rb_NoStepPhase_toggled(bool checked);
386  void on_rb_NoStepChirp_toggled(bool checked);
387  void on_dspb_LinStepPhase_editingFinished();
388  void on_dspb_LinStepModu_editingFinished();
389  void on_dspb_ExpStepModu_editingFinished();
390  void on_dspb_StartValueModu_editingFinished();
391  void on_rb_PosCountModu_toggled();
392  void on_rb_NegCountModu_toggled();
393  void on_dspb_ExpStepPhase_editingFinished();
394  void on_dspb_StartValuePhase_editingFinished();
395  void on_rb_PosCountPhase_toggled();
396  void on_rb_NegCountPhase_toggled();
397  void on_dspb_LinStepChirp_editingFinished();
398  void on_dspb_ExpStepChirp_editingFinished();
399  void on_dspb_StartValueChirp_editingFinished();
400  void on_rb_PosCountChirp_toggled();
401  void on_rb_NegCountChirp_toggled();
402  void on_rb_LinStepModu_toggled(bool checked);
403  void on_rb_ExpStepModu_toggled(bool checked);
404  void on_rb_LinStepPhase_toggled(bool checked);
405  void on_rb_ExpStepPhase_toggled(bool checked);
406  void on_rb_LinStepChirp_toggled(bool checked);
407  void on_rb_ExpStepChirp_toggled(bool checked);
408  void on_rb_GaussAtomType_toggled(bool checked);
409  void on_rb_ChirpAtomType_toggled(bool checked);
410  void on_spb_AtomLength_editingFinished();
411  void on_tb_PartDictName_editingFinished();
412  void on_chb_CombAllPara_toggled(bool checked);
413  void on_dspb_EndValueScale_editingFinished();
414  void on_dspb_EndValueModu_editingFinished();
415  void on_dspb_EndValuePhase_editingFinished();
416  void on_dspb_EndValueChirp_editingFinished();
417  void on_btt_ToNewDict_clicked();
418  void on_list_AllDict_doubleClicked();
419  void on_btt_ToAlldict_clicked();
420  void on_list_NewDict_doubleClicked();
421  void on_btt_DeleteDict_clicked();
422  void on_list_AllDict_itemSelectionChanged();
423  void on_list_NewDict_itemSelectionChanged();
424  void on_btt_SaveDicts_clicked();
425  void on_save_dicts();
426  void animation_finished();
427  void on_btt_extended_clicked();
428  void on_li_all_dicts_itemSelectionChanged();
429  void on_btt_next_dict_clicked();
430  void on_btt_prev_dict_clicked();
431  void atom_changed(qint32 atom_number);
432 
433  void on_spb_atom_number_editingFinished();
434 
435  void on_gb_atom_editor_toggled(bool arg1);
436 
437  void on_gb_dict_editor_toggled(bool arg1);
438 
439  void on_gb_atom_viewer_toggled(bool arg1);
440 
441 signals:
442  void dict_saved();
443 
444 
445 private:
446  qint32 current_atom_number;
447  Ui::EditorWindow *ui;
448  AtomWindow *callAtomWindow;
449  XAxisAtomWindow *callXAxisAtomWindow;
450  Dictionary current_dict;
451  void closeEvent(QCloseEvent * event);
452  void resizeEvent(QResizeEvent *event);
453 
454 protected:
455  void keyReleaseEvent(QKeyEvent *event);
456 };
457 
458 //*************************************************************************************************************
459 // Widget to paint inputsignal
460 class AtomWindow : public QWidget
461 {
462  Q_OBJECT
463 //private:
464  //fiff_int_t press_pos;
465 
466 protected:
467  void paintEvent(QPaintEvent *event);
468  //void mouseMoveEvent(QMouseEvent *event);
469  //void mousePressEvent(QMouseEvent *event);
470  //void mouseReleaseEvent(QMouseEvent *event);
471  //void wheelEvent (QWheelEvent *event);
472 
473 public:
474  //==========================================================================================================
487  void paint_signal(MatrixXd atom_matrix, QSize window_size);
488 
489 //signals:
490  // void read_new();
491 
492  //==========================================================================================================
493 };
494 
495 // Widget to paint x-axis
496 class XAxisAtomWindow : public QWidget
497 {
498  Q_OBJECT
499 
500 protected:
501  void paintEvent(QPaintEvent *event);
502 
503 public:
504  //==========================================================================================================
517  void paint_axis(MatrixXd atom_matrix, QSize window_size);
518 
519  //==========================================================================================================
520 };
521 
522 
523 #endif // EDITORWINDOW_H
Definition: aboutwindow.h:52