81 const char *lbl1,
const char *lbl2,
const char *dsp1,
82 const char *dsp2,
int id)
127 if (!counterFont)
return;
131 if (!textFont)
return;
135 if (!labelFont)
return;
149 for (i=1; i<4; i++) {
157 for (i=0; i<5; i++) {
161 if (
mark[4] < 1000.0)
break;
172 for (i=0; i<5; i++) {
176 if (
mark[4] > 99.9 )
break;
257 if (!glowImage || !glowImage->
IsValid()) {
258 Error(
"TGSpeedo::Glow",
"glow_green.png not found");
264 if (!glowImage || !glowImage->
IsValid()) {
265 Error(
"TGSpeedo::Glow",
"glow_orange.png not found");
271 if (!glowImage || !glowImage->
IsValid()) {
272 Error(
"TGSpeedo::Glow",
"glow_red.png not found");
297 if ((
event->fX > (xc - 26)) && (
event->fX < (xc + 26)) &&
298 (
event->fY < (yc + 50)) && (
event->fY > (yc + 28))) {
302 else if ((
event->fX > (xc + 30)) && (
event->fX < (xc + 40)) &&
303 (
event->fY > (yc + 57)) && (
event->fY < (yc + 67))) {
450 if ((damping > 0) || (
gVirtualX->InheritsFrom(
"TGX11")))
457 Float_t diff_ratio = diff_scale / diff_angle;
461 if (new_angle > old_angle) {
462 for (i=old_angle; i<new_angle; i+=step) {
469 if (new_angle < old_angle) {
470 for (i=old_angle; i>new_angle; i-=step) {
505 Int_t xch0, xch1, ych0, ych1;
506 Int_t xpk0, ypk0, xpk1, ypk1;
507 Int_t xmn0, ymn0, xmn1, ymn1;
532 if (!img || !img->
IsValid())
return;
534 img->
DrawLine(xpk0, ypk0, xpk1, ypk1,
"#00ff00", 3);
535 img->
DrawLine(xpk0, ypk0, xpk1, ypk1,
"#ffffff", 1);
538 img->
DrawLine(xmn0, ymn0, xmn1, ymn1,
"#ffff00", 3);
539 img->
DrawLine(xmn0, ymn0, xmn1, ymn1,
"#ff0000", 1);
542 img->
DrawLine(xch0, ych0, xch1, ych1,
"#ff0000", 2);
578 if (nexe%3 == 0 && ww < 10000)
break;
584 snprintf(sval, 80,
"%04d", (
int)ww);
585 snprintf(dsval, 80,
"%c %c %c %c", sval[0], sval[1], sval[2], sval[3]);
613 Int_t xch0, xch1, ych0, ych1;
614 Int_t xpk0, ypk0, xpk1, ypk1;
615 Int_t xmn0, ymn0, xmn1, ymn1;
658 if (nexe%3 == 0 && ww < 10000)
break;
664 snprintf(sval, 80,
"%04d", (
int)ww);
665 snprintf(dsval, 80,
"%c %c %c %c", sval[0], sval[1], sval[2], sval[3]);
683 if (!img || !img->
IsValid())
return;
685 img->
DrawLine(xpk0, ypk0, xpk1, ypk1,
"#00ff00", 3);
686 img->
DrawLine(xpk0, ypk0, xpk1, ypk1,
"#ffffff", 1);
689 img->
DrawLine(xmn0, ymn0, xmn1, ymn1,
"#ffff00", 3);
690 img->
DrawLine(xmn0, ymn0, xmn1, ymn1,
"#ff0000", 1);
693 img->
DrawLine(xch0, ych0, xch1, ych1,
"#ff0000", 2);
const Mask_t kButtonPressMask
const Mask_t kButtonReleaseMask
Handle_t FontStruct_t
Pointer to font structure.
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint angle
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.
Encapsulate fonts used in the GUI system.
FontStruct_t GetFontStruct() const
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
void DoRedraw() override
Redraw the frame.
TGClient * fClient
Connection to display server.
Handle_t fId
X11/Win32 Window identifier.
const TGPicture * GetPicture(const char *name)
Get a picture from the picture pool.
TGSpeedo is a widget looking like a speedometer, with a needle, a counter and a small odometer window...
const TGPicture * fBase
picture used as background
Int_t fBufferSize
circular buffer size
void SetOdoValue(Int_t val)
Set actual value of odo meter.
Float_t GetMean()
Compute and return the mean of the circular buffer content.
Bool_t HandleButton(Event_t *event) override
Handle mouse button event.
TString fLabel1
main label (first line)
void StepScale(Float_t step)
Increment/decrement scale (needle position) of "step" value.
EGlowColor fThresholdColor[3]
glowing threshold colors
void SetDisplayText(const char *text1, const char *text2="")
Set small display text (two lines).
TString fDisplay1
first line in the small display
~TGSpeedo() override
TGSpeedo widget Destructor.
void Glow(EGlowColor col=kGreen)
Make speedo glowing.
void SetMinMaxScale(Float_t min, Float_t max)
Set min and max scale values.
Float_t fMeanVal
mean value mark
TGSpeedo(const TGWindow *p=nullptr, int id=-1)
TGSpeedo widget constructor.
Int_t fCounter
small odo meter (4 digits)
TImage * fImage
image used as background
void SetBufferSize(Int_t size)
Change the circular buffer size (used for the automatic mean calculation).
FontStruct_t fCounterFS
font structures for text rendering
void DrawText()
Draw text in speedo widget.
TString fDisplay2
second line in the small display
Float_t fScaleMax
needle min and max scale
Float_t fPeakVal
maximum peak mark
Int_t fBufferCount
circular buffer count
TString fPicName
name of picture used as background
Bool_t fThresholdActive
kTRUE if glowing thresholds are active
void Translate(Float_t val, Float_t angle, Int_t *x, Int_t *y)
Translate distance from center and angle to xy coordinates.
Float_t fThreshold[3]
glowing thresholds
void SetLabelText(const char *text1, const char *text2="")
Set main label text (two lines).
TImage * fImage2
intermediate image used as background
void SetScaleValue(Float_t val)
Set actual scale (needle position) value.
Bool_t fMeanMark
kTRUE if mean mark is active
std::vector< Float_t > fBuffer
circular buffer for mean calculation
TString fLabel2
main label (second line)
Float_t fAngleMax
needle min and max angle
TGDimension GetDefaultSize() const override
Return default dimension of the widget.
void Build()
Build TGSpeedo widget.
void DoRedraw() override
Redraw speedo widget.
void DrawNeedle()
Draw needle in speedo widget.
Bool_t fPeakMark
kTRUE if peak mark is active
Float_t fValue
needle angle and corresponding value
ROOT GUI Window base class.
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 *=nullptr, const char *="fixed", EText3DType=TImage::kPlain, const char *=nullptr, 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 *="")
TObject * Clone(const char *) const override
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.