QGPChannelFrame.hh
Go to the documentation of this file.00001
00002 #ifndef _QGP_CHANNEL_FRAME_HH_
00003 #define _QGP_CHANNEL_FRAME_HH_
00004
00005 #include "QGuiCompositeFrame.hh"
00006
00007 #include <TGNumberEntry.h>
00008
00009 class TGCheckButton;
00010 class TGTextButton;
00011 class QGuiLed;
00012
00020 class QGPChannelFrame: public QGuiCompositeFrame
00021 {
00022 public:
00028 QGPChannelFrame(UInt_t channel, UInt_t boardId,
00029 const TGWindow* parent, UInt_t w, UInt_t h);
00030 virtual ~QGPChannelFrame();
00031
00036 void SetEnabled(Bool_t enabled)
00037 { fEnabled = enabled; fEnableButton->SetOn(fEnabled); }
00038
00043 void SetLoaded(Bool_t loaded)
00044 { fLoaded = loaded; if(!loaded) Lock(); }
00045
00050 bool SetAmplitude(UInt_t amplitude)
00051 {
00052 if(amplitude < 0 || amplitude > 5000) return false;
00053 fNumberEntry->SetNumber(amplitude);
00054 return true;
00055 }
00056
00058 void Blink();
00059
00061 bool GetEnabled() const { return fEnabled; }
00062
00064 unsigned int GetAmplitude() const
00065 { return (unsigned int)fNumberEntry->GetNumber(); }
00066
00068 void Lock();
00070 void Unlock();
00071
00072 void EnableToggled()
00073 { UpdateEnabled(); Emit("EnableToggled()"); }
00074
00075 void OneShotPressed(Long_t) { Emit("OneShotPressed(Long_t)",(Long_t)fChannel);}
00076
00077 private:
00078 UInt_t fChannel;
00079 UInt_t fBoardId;
00080 Bool_t fEnabled;
00081 Bool_t fLoaded;
00082 TGNumberEntry* fNumberEntry;
00083 TGCheckButton* fEnableButton;
00084 TGTextButton* fOneShotButton;
00085 QGuiLed * fLedWidget;
00086
00087 void UpdateEnabled();
00088
00089 ClassDef(QGPChannelFrame,0)
00090 };
00091 #endif