00001 #ifndef _QIGUI_MAINWINDOW__H_
00002 #define _QIGUI_MAINWINDOW__H_
00003
00004 #include <QMainWindow>
00005 #include <string>
00006 #include "ui_MainWindow.h"
00007 #include <vector>
00008 #include "QGDInclude.hh"
00009
00010 class QIGUICut;
00011 class QIGUICoCut;
00012 class QIGUISession;
00013 class QIGUIPlotWindow;
00014 class QIGUIPlotData;
00015 class QCoincidencePattern;
00016 class QComboBox;
00017 class QToolBar;
00018 class QTreeWidgetItem;
00019 class TObject;
00020
00021 typedef std::pair <QIGUICut *, QTreeWidgetItem*> QIGUICutPair;
00022 typedef std::pair <QIGUICoCut *, QTreeWidgetItem*> QIGUICoCutPair;
00023
00024 class QIGUIMainWindow: public QMainWindow, public Ui::MainWindow
00025 {
00026 Q_OBJECT
00027
00028 private:
00030 int fNSessions;
00031
00033 std::map<QString, QIGUISession*> fSessions;
00034
00036 QIGUISession * fActiveSession;
00037
00039 int fNPlotWindows;
00040
00042 std::map<QString, QIGUIPlotWindow*> fPlotWindows;
00043
00045 QIGUIPlotWindow * fActivePlotWindow;
00046
00048 int fNCuts;
00049
00051
00052 std::map<QString, QIGUICutPair > fCuts;
00053 std::map<QString, QIGUICoCutPair > fCoCuts;
00054
00056 QIGUICut * fCurrentCut;
00057 QIGUICoCut * fCurrentCoCut;
00058
00059 bool fCurrentCutUpdated;
00060 bool fCurrentCoCutUpdated;
00061
00062
00063
00064 QToolBar * fActiveToolBar;
00065 QComboBox * fActiveSessionComboBox;
00066 QComboBox * fActivePlotWindowComboBox;
00067 QComboBox * fActiveCutComboBox;
00068
00069
00071
00073 public slots:
00074
00075 void NewSession(QString name = "");
00076 void ChangeActiveSession(QString name);
00077 void DeleteSession(QString name = "");
00078
00079
00080 void ChangeActivePlotWindow(QString name);
00081 void NewPlotWindow(QString name = "");
00082 void DeletePlotWindow(QString name = "");
00083 void NotifyDeletePlotWindow(QString name = "");
00084 void Draw();
00085
00086
00087 void OpenFile(bool closeFiles = true);
00088 void AddFile();
00089 void CloseFiles();
00090 void NotifyFileChangeToWindows();
00091
00092
00093 void NewCut();
00094 QIGUICut * SaveCurrentCut();
00095 void AddCut(QIGUICut * theCut);
00096 void DeleteSelectedCuts();
00097 void ToggleCurrentCutUpdated (bool flag=true) {fCurrentCutUpdated = flag;}
00098 void ToggleCurrentCoCutUpdated (bool flag=true) {fCurrentCoCutUpdated = flag;}
00099 void NotifyChangeActiveCut(QTreeWidgetItem * item=0, int column=0);
00100 void NotifyChangeActiveCut(const QString &);
00101 void NotifyChangeCutTree(QTreeWidgetItem* item, int column=0);
00102 void NotifyCutChangeToWindows(QString name);
00103 void ResizeTreeCutsHisto(QTreeWidgetItem * , int column=0);
00104 void NotifyChangeActiveCoCut(QTreeWidgetItem * item=0, int column=0);
00105 void NotifyChangeActiveCoCut(const QString &);
00106 void SaveSelectedCuts();
00107 void LoadCutsFromFile();
00108
00109
00110 void NewCoCut();
00111 void SaveCurrentCoCut();
00112 void ClearCoCutPanel();
00113 void InitCoCutPanel();
00114 void ResetCoCutPanel();
00115 void LoadPanelFromCoCut(QIGUICoCut *);
00116 void LoadCoCutFromPanel(QIGUICoCut * );
00117 void CheckCoCutPanelConsistency(QTreeWidgetItem* , int);
00118 void SetRangeCoCutPanel(QString rangeText);
00119 void NotifyCoCutChangeToWindows(QString name);
00120 void NotifyCoSessionChangeToWindows(QString name);
00121
00122 void NewGeneralCut();
00123
00124 void AddFriend();
00125 void AddDeltaTime();
00126
00127
00128 void RunDiana();
00129 void StopDiana();
00130 void LaunchDianaPulsesViewer();
00131
00132
00133 public:
00134
00135 QIGUIMainWindow (QWidget * parent=0);
00136 virtual ~QIGUIMainWindow();
00137 void CreateActions();
00138 void CreateActiveToolBar();
00139 void CreateSignals();
00140 void DestroySignals();
00141 void CustomizeSetup();
00142
00143
00144 QToolBar * GetToolBarFile() {return toolBarFile;}
00145 QToolBar * GetToolBarSession() {return toolBarSession;}
00146 QIGUISession * GetActiveSession() {return fActiveSession;}
00147
00148
00149 void GetCurrentCut(QIGUICut * currentCut);
00150 QIGUICoCut * GetCurrentCoCut();
00151 QIGUICoCut * GetCoCut(QString name);
00152 QIGUIPlotData * GetCurrentPlotData();
00153 int GetCurrentChannel();
00154 bool CurrentCutUpdated () {return fCurrentCutUpdated;}
00155
00156
00157 void NotifyActiveSession();
00158 QString LookForAName(QString name);
00159
00160 void SetStyle();
00161 };
00162
00163 #endif