QGUINumberSelector.hh

Go to the documentation of this file.
00001 
00014 #ifndef _QGUI_NUMBER_SELECTOR_HH
00015 #define _QGUI_NUMBER_SELECTOR_HH
00016 
00017 
00018 // Apollo Includes
00019 #include "TGFrame.h"
00020 #include "TGNumberEntry.h"
00021 #include "QCuore.hh"
00022 
00023 // Root Includes
00024 #include "Rtypes.h"
00025 #include "TTimer.h"
00026 #include "TQObject.h"
00027 
00028 // C/C++ Includes
00029 #include <iostream>
00030 #include <vector>
00031 
00032 
00033 class TGTextButton;
00034 class TGTextEntry;
00035 
00036 class QGUINumberSelector: public TQObject
00037 {
00038 public:
00039   
00045    QGUINumberSelector(const std::vector<int>& validNumbers);
00046    
00047    
00053    QGUINumberSelector(const std::vector<unsigned short>& validNumbers);
00054   
00055 
00057    virtual ~QGUINumberSelector();
00058 
00059    inline int GetCurrent() const {return fCurrent;}
00060 
00061 
00062 
00066    void HandleValueSet();
00067 
00073    void UpdateCurrentNumber();
00074 
00075    // Signals
00076    void Loaded()  {Emit("Loaded()");}   //*SIGNAL*
00077    void Changed() {Emit("Changed()");}  //*SIGNAL*
00078 
00079    TGNumberEntry* GetSelector(const TGWindow* parent);
00080    TGTextEntry* GetDisplay(const TGWindow* parent);
00081 
00082 protected:
00083 
00084 
00085 private:
00086   
00088    enum QDirection_t
00089       {
00090          QUP  =true,
00091          QDOWN=false
00092       };
00093 
00094    // Vector of Active Channel
00095    std::vector<int>  fValidNumbers;
00096 
00097    
00098    int fPrevious; 
00099    int fCurrent;  
00101    // Timer
00102    TTimer  fTimer;
00103   
00104    TGNumberEntry     *fSelector;   
00105    TGTextEntry       *fLoadText; 
00108    inline int GetSelected() const {return (int)(fSelector->GetNumber());}
00109 
00115    bool IsValid(int value) const;
00116 
00123    int GetNextValid(int current, QDirection_t dir) const;
00124 
00126    int GetFirstValid() const;
00127   
00129    int GetLastValid() const;
00130 
00134    void SetCurrent(int value);
00135   
00136    void Init();
00137 
00138    void StartTimer();
00139 
00140   ClassDef(QGUINumberSelector,0)
00141 };
00142 
00143 #endif // _QGUI_NUMBER_SELECTOR_HH

Generated on Fri Mar 6 13:40:39 2009 for CUORE Software by  doxygen 1.5.1