This example compares what the system time function gmtime and localtime give with what gives TGaxis.
It can be used as referenced test to check if TGaxis is working properly. The original code was developed by Philippe Gras (CEA Saclay. IRFU/SEDI)
#include <ctime>
#include <cstdio>
{
else
char buf[256];
strftime(buf,
sizeof(buf),
"%Y-%m-%d %H:%M:%S %Z",
tt);
else
strftime(buf,
sizeof(buf),
"%Y-%m-%d %H:%M:%S",
tt);
}
{
tex1.SetTextSize(0.055 *
f);
tex3.SetTextSize(0.07 *
f);
tex2.SetTextSize(0.07 *
f);
time_t
offset[] = {0, 0, 1325376000, 1341100800};
time_t t[] = {1331150400, 1336417200, 0, 36000};
for (int i = 0; i < 4; ++i) {
const char *opt = (
gmt ?
"gmt" :
"local");
ga->SetTimeFormat(
"TGaxis label: #color[2]{%Y-%m-%d %H:%M:%S}");
ga->SetLabelOffset(0.04 *
f);
ga->SetLabelSize(0.07 *
f);
char buf[256];
snprintf(buf, 256,
"#splitline{%s, %s}{offset: %ld, option %s}",
stime(t + i).Data(),
} else {
int m = (t[i] - 3600 *
h) / 60;
int s = (t[i] -
h * 3600 -
m * 60);
snprintf(buf, 256,
"#splitline{%d h %d m %d s}{offset: %s, option %s}",
h,
m, s,
}
tex1.DrawLatex(.01, .75, buf);
tex3.DrawLatex(.01, .24, buf);
if (i > 0)
}
}
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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
Class to manage histogram axis.
To draw Mathematical Formula.
Use the TLine constructor to create a simple line.
virtual TLine * DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
- Authors
- Philippe Gras, Bertrand Bellenot, Olivier Couet
Definition in file timeonaxis3.C.