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