00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _QGUI_SMART_SCOPE_HH_
00014 #define _QGUI_SMART_SCOPE_HH_
00015
00016
00017
00018
00019 #include "QGUIDataCollector.hh"
00020 #include "QGUIBaseFrame.hh"
00021 #include "QGUIScopeChannel.hh"
00022
00023 #include <map>
00024 #include <vector>
00025
00026
00027 #include "Rtypes.h"
00028 #include "TTimer.h"
00029 #include "TH1F.h"
00030
00031
00032
00033
00034 class TGObject;
00035 class TRootEmbeddedCanvas;
00036 class TGNumberEntry;
00037 class TGTextEntry;
00038 class TGTextButton;
00039 class QSmartScopeChannel;
00040 class QGUINumberSelector;
00041
00042 class QGUISmartScope: public QGUIBaseFrame
00043 {
00044
00045 public:
00046
00047
00048 QGUISmartScope(const TGWindow* p,
00049 unsigned int Width,
00050 unsigned int Height,
00051 const QGUIDataCollector& Status);
00052
00053
00054 virtual ~QGUISmartScope();
00055
00056
00057
00058 void UpdateUpperEdge();
00059 void UpdateLowerEdge();
00060 void UpdateChannel();
00061
00063 void Close();
00064
00066 void DoRefresh();
00067
00069 void UpdateTimeCtr();
00070
00072 void StartHistoUpdate();
00073
00075 void StopHistoUpdate();
00076
00077
00078 void SetAutoRange(bool isTrue);
00079
00080
00081 void FlipAutoRange();
00082
00083
00084 void SetRefreshTime(long Time);
00085
00086
00087 void StartRefreshTime();
00088
00089
00090 void StopRefreshTime();
00091
00092 private:
00093
00094
00095 std::vector<unsigned short> fActiveChannels;
00096
00097
00098 const QGUIDataCollector& fStatus;
00099
00100
00101 TTimer fRefreshTimer;
00102 TTimer fRealTimer;
00103
00104 unsigned long fTimeCtr;
00105
00106 bool fIsHistoUpdate;
00107
00108 bool fAutoRangeChanged;
00109
00110
00111 QSmartScopeChannel *fScope;
00112
00113
00114 TH1F fh1;
00115
00116
00117 QGUIScopeChannel fGraphix;
00118
00119 QGUINumberSelector* fChSelector;
00120
00121
00122 TGCompositeFrame* fTopHFrame;
00123 TGCompositeFrame* fBottomHFrame;
00124 TGCompositeFrame* fControlVFrame;
00125 TGCompositeFrame* fCanvasHFrame;
00126 TRootEmbeddedCanvas* fEmbCanvas;
00127
00128 TGCompositeFrame* fStartStopVFrame;
00129
00130 TGTextEntry* fRunNumb;
00131 TGTextEntry* fChDisplay;
00132
00133 TGTextButton* fAutoRangeBtn;
00134 TGNumberEntry* fUpperEntry;
00135 TGNumberEntry* fLowerEntry;
00136
00137 TGTextEntry* fMeanVal;
00138 TGTextEntry* fSigmaVal;
00139 TGTextEntry* fMaxVal;
00140 TGTextEntry* fMinVal;
00141
00142 TGTextButton* fStartBtn;
00143 TGTextButton* fStopBtn;
00144 TGTextButton* fExitBtn;
00145
00146
00147 void _Init();
00148
00149
00150 void GetActiveChannels();
00151
00152
00153 void _InitRefreshTimer(long Time);
00154
00155
00156 void _CreateFrames();
00157
00158
00159 void _AddLateralWidgets();
00160
00161
00162 void _AddStartStopButtons();
00163
00164
00165 void _Zeros();
00166
00167
00168 void _SetStyleOptions();
00169
00170
00171 void _DrawHistogram(TH1F& Histo);
00172
00173
00174 inline const bool _IsHistoUpdate() const {return fIsHistoUpdate;}
00175
00176 ClassDef(QGUISmartScope,0)
00177 };
00178
00179 #endif // _QGUI_SMART_SCOPE_HH_