85 const char *lbl1,
const char *lbl2,
const char *dsp1,
86 const char *dsp2,
int id)
128 Int_t i, nexe, offset;
131 if (!counterFont)
return;
135 if (!textFont)
return;
139 if (!labelFont)
return;
153 for (i=1; i<4; i++) {
161 for (i=0; i<5; i++) {
165 if (
mark[4] < 1000.0)
break;
176 for (i=0; i<5; i++) {
180 if (
mark[4] > 99.9 )
break;
261 if (!glowImage || !glowImage->
IsValid()) {
262 Error(
"TGSpeedo::Glow",
"glow_green.png not found");
268 if (!glowImage || !glowImage->
IsValid()) {
269 Error(
"TGSpeedo::Glow",
"glow_orange.png not found");
275 if (!glowImage || !glowImage->
IsValid()) {
276 Error(
"TGSpeedo::Glow",
"glow_red.png not found");
301 if ((event->
fX > (xc - 26)) && (event->
fX < (xc + 26)) &&
302 (event->
fY < (yc + 50)) && (event->
fY > (yc + 28))) {
306 else if ((event->
fX > (xc + 30)) && (event->
fX < (xc + 40)) &&
307 (event->
fY > (yc + 57)) && (event->
fY < (yc + 67))) {
328 if (size < 0) size = 0;
454 if ((damping > 0) || (
gVirtualX->InheritsFrom(
"TGX11")))
461 Float_t diff_ratio = diff_scale / diff_angle;
465 if (new_angle > old_angle) {
466 for (i=old_angle; i<new_angle; i+=step) {
473 if (new_angle < old_angle) {
474 for (i=old_angle; i>new_angle; i-=step) {
509 Int_t xch0, xch1, ych0, ych1;
510 Int_t xpk0, ypk0, xpk1, ypk1;
511 Int_t xmn0, ymn0, xmn1, ymn1;
536 if (!img || !img->
IsValid())
return;
538 img->
DrawLine(xpk0, ypk0, xpk1, ypk1,
"#00ff00", 3);
539 img->
DrawLine(xpk0, ypk0, xpk1, ypk1,
"#ffffff", 1);
542 img->
DrawLine(xmn0, ymn0, xmn1, ymn1,
"#ffff00", 3);
543 img->
DrawLine(xmn0, ymn0, xmn1, ymn1,
"#ff0000", 1);
546 img->
DrawLine(xch0, ych0, xch1, ych1,
"#ff0000", 2);
582 if (nexe%3 == 0 && ww < 10000)
break;
588 snprintf(sval, 80,
"%04d", (
int)ww);
589 snprintf(dsval, 80,
"%c %c %c %c", sval[0], sval[1], sval[2], sval[3]);
617 Int_t xch0, xch1, ych0, ych1;
618 Int_t xpk0, ypk0, xpk1, ypk1;
619 Int_t xmn0, ymn0, xmn1, ymn1;
662 if (nexe%3 == 0 && ww < 10000)
break;
668 snprintf(sval, 80,
"%04d", (
int)ww);
669 snprintf(dsval, 80,
"%c %c %c %c", sval[0], sval[1], sval[2], sval[3]);
687 if (!img || !img->
IsValid())
return;
689 img->
DrawLine(xpk0, ypk0, xpk1, ypk1,
"#00ff00", 3);
690 img->
DrawLine(xpk0, ypk0, xpk1, ypk1,
"#ffffff", 1);
693 img->
DrawLine(xmn0, ymn0, xmn1, ymn1,
"#ffff00", 3);
694 img->
DrawLine(xmn0, ymn0, xmn1, ymn1,
"#ff0000", 1);
697 img->
DrawLine(xch0, ych0, xch1, ych1,
"#ff0000", 2);
const Mask_t kButtonPressMask
const Mask_t kButtonReleaseMask
Handle_t FontStruct_t
Pointer to font structure.
R__EXTERN TSystem * gSystem
TGFont * GetFont(const char *font, Bool_t fixedDefault=kTRUE)
Get a font from the font pool.
TGPicturePool * GetPicturePool() const
void FreePicture(const TGPicture *pic)
Free picture resource.
FontStruct_t GetFontStruct() const
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
virtual void DoRedraw()
Redraw the frame.
const TGPicture * GetPicture(const char *name)
Get a picture from the picture pool.
void SetOdoValue(Int_t val)
Set actual value of odo meter.
virtual ~TGSpeedo()
TGSpeedo widget Destructor.
Float_t GetMean()
Compute and return the mean of the circular buffer content.
void StepScale(Float_t step)
Increment/decrement scale (needle position) of "step" value.
EGlowColor fThresholdColor[3]
void SetDisplayText(const char *text1, const char *text2="")
Set small display text (two lines).
virtual void DoRedraw()
Redraw speedo widget.
void Glow(EGlowColor col=kGreen)
Make speedo glowing.
void SetMinMaxScale(Float_t min, Float_t max)
Set min and max scale values.
void SetBufferSize(Int_t size)
Change the circular buffer size (used for the automatic mean calculation).
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event.
void DrawText()
Draw text in speedo widget.
virtual TGDimension GetDefaultSize() const
Return default dimension of the widget.
void Translate(Float_t val, Float_t angle, Int_t *x, Int_t *y)
Translate distance from center and angle to xy coordinates.
void SetLabelText(const char *text1, const char *text2="")
Set main label text (two lines).
void SetScaleValue(Float_t val)
Set actual scale (needle position) value.
std::vector< Float_t > fBuffer
void Build()
Build TGSpeedo widget.
void DrawNeedle()
Draw needle in speedo widget.
TGSpeedo(const TGWindow *p=0, int id=-1)
TGSpeedo widget constructor.
An abstract interface to image processing library.
static TImage * Open(const char *file, EImageFileTypes type=kUnknown)
Open a specified image file.
virtual void DrawText(Int_t=0, Int_t=0, const char *="", Int_t=12, const char *=0, const char *="fixed", EText3DType=TImage::kPlain, const char *=0, Float_t=0)
virtual void DrawLine(UInt_t, UInt_t, UInt_t, UInt_t, const char *="#000000", UInt_t=1)
virtual Bool_t IsValid() const
virtual void Merge(const TImage *, const char *="alphablend", Int_t=0, Int_t=0)
virtual Pixmap_t GetPixmap()
virtual void PaintImage(Drawable_t, Int_t, Int_t, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0, Option_t *="")
virtual TObject * Clone(const char *) const
Make a clone of an object using the Streamer facility.
virtual Pixmap_t GetMask()
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
const char * Data() const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
EGEventType fType
of event (see EGEventType)
Int_t fY
pointer x, y coordinates in event window
UInt_t fCode
key or button code