38 class TGSpeedo :
public TGFrame,
public TGWidget {
41 enum EGlowColor { kNoglow, kGreen, kOrange, kRed };
46 const TGPicture *fBase;
47 FontStruct_t fTextFS, fCounterFS;
54 Float_t fAngle, fValue;
57 Float_t fAngleMin, fAngleMax;
58 Float_t fScaleMin, fScaleMax;
59 Float_t fThreshold[3];
60 EGlowColor fThresholdColor[3];
61 Bool_t fThresholdActive;
65 virtual void DoRedraw();
68 void Translate(Float_t val, Float_t angle, Int_t *x, Int_t *y);
71 TGSpeedo(
const TGWindow *p = 0,
int id = -1);
72 TGSpeedo(
const TGWindow *p, Float_t smin, Float_t smax,
73 const char *lbl1 =
"",
const char *lbl2 =
"",
74 const char *dsp1 =
"",
const char *dsp2 =
"",
int id = -1);
77 virtual TGDimension GetDefaultSize()
const;
78 virtual Bool_t HandleButton(Event_t *event);
80 const TGPicture *GetPicture()
const {
return fBase; }
81 TImage *GetImage()
const {
return fImage; }
82 Float_t GetPeakVal()
const {
return fPeakVal; }
83 Float_t GetScaleMin()
const {
return fScaleMin; }
84 Float_t GetScaleMax()
const {
return fScaleMax; }
85 Bool_t IsThresholdActive() {
return fThresholdActive; }
88 void Glow(EGlowColor col = kGreen);
89 void StepScale(Float_t step);
90 void SetScaleValue(Float_t val);
91 void SetScaleValue(Float_t val, Int_t damping);
92 void SetOdoValue(Int_t val);
93 void SetDisplayText(
const char *text1,
const char *text2 =
"");
94 void SetLabelText(
const char *text1,
const char *text2 =
"");
95 void SetMinMaxScale(Float_t min, Float_t max);
96 void SetThresholds(Float_t th1 = 0.0, Float_t th2 = 0.0, Float_t th3 = 0.0)
97 { fThreshold[0] = th1; fThreshold[1] = th2; fThreshold[2] = th3; }
98 void SetThresholdColors(EGlowColor col1, EGlowColor col2, EGlowColor col3)
99 { fThresholdColor[0] = col1; fThresholdColor[1] = col2; fThresholdColor[2] = col3; }
100 void EnableThreshold() { fThresholdActive = kTRUE; }
101 void DisableThreshold() { fThresholdActive = kFALSE; Glow(kNoglow); fClient->NeedRedraw(
this);}
102 void EnablePeakMark() { fPeakMark = kTRUE; }
103 void DisablePeakMark() { fPeakMark = kFALSE; }
104 void EnableMeanMark() { fMeanMark = kTRUE; }
105 void DisableMeanMark() { fMeanMark = kFALSE; }
106 void ResetPeakVal() { fPeakVal = fValue; fClient->NeedRedraw(
this); }
107 void SetMeanValue(Float_t mean) { fMeanVal = mean; fClient->NeedRedraw(
this); }
109 void OdoClicked() { Emit(
"OdoClicked()"); }
110 void LedClicked() { Emit(
"LedClicked()"); }