QIGUIMainWindow.hh

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 QIGUIGeneralCut;
00013 class QIGUISession;
00014 class QIGUIPlotWindow;
00015 class QIGUIPlotData;
00016 class QCoincidencePattern;
00017 class QComboBox;
00018 class QToolBar;
00019 class QTreeWidgetItem;
00020 class TObject;
00021 
00022 typedef std::pair <QIGUICut *, QTreeWidgetItem*> QIGUICutPair;
00023 typedef std::pair <QIGUICoCut *, QTreeWidgetItem*> QIGUICoCutPair;
00024 
00025 class QIGUIMainWindow: public QMainWindow, public Ui::MainWindow
00026 {
00027   Q_OBJECT
00028 
00029   private:
00031      int fNSessions;
00032 
00034      std::map<QString, QIGUISession*> fSessions;
00035 
00037      QIGUISession *  fActiveSession;
00038     
00040      int fNPlotWindows;
00041 
00043      std::map<QString, QIGUIPlotWindow*> fPlotWindows;
00044 
00046      QIGUIPlotWindow * fActivePlotWindow;
00047 
00049      int fNCuts;
00050 
00052      //std::map<QString, (std::pair<QIGUICut*, QTreeWidgetItem *>) > fCuts;
00053      std::map<QString, QIGUICutPair > fCuts;
00054      std::map<QString, QIGUICoCutPair > fCoCuts;
00055 
00057      QIGUICut * fCurrentCut;
00058      QIGUICoCut * fCurrentCoCut;
00059 
00060       bool fCurrentCutUpdated;
00061       bool fCurrentCoCutUpdated;
00062 
00063 
00064      // active toolbar: spinbox with active session, cut and plotwindow
00065      QToolBar * fActiveToolBar;
00066      QComboBox * fActiveSessionComboBox;
00067      QComboBox * fActivePlotWindowComboBox;
00068      QComboBox * fActiveCutComboBox;
00069     
00070 
00072   // SLOTS
00074   public slots:
00075     // Sessions
00076     void NewSession(QString name = "");
00077     void ChangeActiveSession(QString name);
00078     void DeleteSession(QString name = "");
00079 
00080     // Ntupla
00081     void AddFriend();
00082     void AddDeltaTime();
00083     void SaveNtuplaWithSelectedCuts();
00084     void DumpCoincidenceEventList();
00085 
00086     // PlotWindows
00087     void ChangeActivePlotWindow(QString name);
00088     void NewPlotWindow(QString name = "");
00089     void DeletePlotWindow(QString name = "");
00090     void NotifyDeletePlotWindow(QString name = "");
00091     void Draw();
00092     void ToggleMdiArea();
00093 
00094     // Files
00095     void OpenFile(bool closeFiles = true);
00096     void AddFile();
00097     void CloseFiles();
00098     void NotifyFileChangeToWindows();
00099 
00100     // CUts
00101     void NewCut();
00102     QIGUICut * SaveCurrentCut();
00103     void AddCut(QIGUICut * theCut);
00104     void DeleteSelectedCuts();
00105     void ToggleCurrentCutUpdated (bool flag=true) {fCurrentCutUpdated = flag;}
00106     void ToggleCurrentCoCutUpdated (bool flag=true) {fCurrentCoCutUpdated = flag;}
00107     void NotifyChangeActiveCut(QTreeWidgetItem * item=0, int column=0);
00108     void NotifyChangeActiveCut(const QString &);
00109     void NotifyChangeCutTree(QTreeWidgetItem* item, int column=0);
00110     void NotifyCutChangeToWindows(QString name);
00111     void ResizeTreeCutsHisto(QTreeWidgetItem * , int column=0);
00112     void NotifyChangeActiveCoCut(QTreeWidgetItem * item=0, int column=0);
00113     void NotifyChangeActiveCoCut(const QString &);
00114     void SaveSelectedCuts();
00115     void LoadCutsFromFile();
00116     void DisplayCutStat();
00117 
00118     // CoCuts
00119     void NewCoCut();
00120     void SaveCurrentCoCut();
00121     void ClearCoCutPanel();
00122     void InitCoCutPanel();
00123     void ResetCoCutPanel();
00124     void LoadPanelFromCoCut(QIGUICoCut *);
00125     void LoadCoCutFromPanel(QIGUICoCut * );
00126     void CheckCoCutPanelConsistency(QTreeWidgetItem* , int);
00127     void SetRangeCoCutPanel(QString rangeText);
00128     void NotifyCoCutChangeToWindows(QString name);
00129     void NotifyCoSessionChangeToWindows(QString name);
00130     void NotifyChangeCoCutTree(QTreeWidgetItem* item, int column);
00131     void DeleteSelectedCoCut();
00132 
00133     // General Cuts
00134     QIGUIGeneralCut * NewGeneralCut(const char * name="");
00135     void SaveGeneralCut();
00136     void LoadGeneralCutFromFile();
00137 
00138 
00139     // Diana Comunication
00140     void RunDiana();
00141     void StopDiana();
00142     void LaunchDianaPulsesViewer();
00143 
00144     // Terminate
00145     void Terminate();
00146 
00147     // Preferences
00148     void ReloadPreferences();
00149 
00150   public:
00151     // Ctr, Dtr, Initialization
00152     QIGUIMainWindow (QWidget * parent=0);
00153     virtual ~QIGUIMainWindow();
00154     void CreateActions();
00155     void CreateActiveToolBar();
00156     void CreateSignals();
00157     void DestroySignals();
00158     void CustomizeSetup();
00159 
00160     // Getters and Setters
00161     QToolBar * GetToolBarFile() {return toolBarFile;}
00162     QToolBar * GetToolBarSession() {return toolBarSession;}
00163     QIGUISession * GetActiveSession() {return fActiveSession;}
00164 
00165     // Cuts Getters and Setters
00166     void GetCurrentCut(QIGUICut * currentCut);
00167     QIGUICoCut * GetCurrentCoCut();
00168     QIGUICoCut * GetCoCut(QString name);
00169     QIGUIPlotData * GetCurrentPlotData();
00170     int GetCurrentChannel();
00171     bool CurrentCutUpdated () {return fCurrentCutUpdated;}
00172 
00173 
00174     // auxiliar
00175     void NotifyActiveSession();
00176     QString LookForAName(QString name);
00177     void FillVariablesComboPlots();
00178 
00179     void SetStyle();
00180 };
00181 
00182 #endif

Generated on Tue Nov 16 10:49:59 2010 for CUORE Software by  doxygen 1.5.6