Changeset 2150


Ignore:
Timestamp:
06/02/03 13:48:05 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2147 r2150  
    1919   * mgui/MCamDisplay.[h,cc]:
    2020     - added current support
     21
     22   * mbase/MTime.h:
     23     - preliminary changes to support currents
     24     
     25   * mhist/MH.[h,cc]:
     26     - added usescreenfactor to MakeDefCanvas
     27     
    2128
    2229
  • trunk/MagicSoft/Mars/mbase/MTime.h

    r2149 r2150  
    1717{
    1818private:
    19     UInt_t fTimeStamp[2]; // type of raw event which should be processed by this task
    20     UInt_t fDuration;     // time of validity
     19    UInt_t   fTimeStamp[2]; // type of raw event which should be processed by this task
     20    UInt_t   fDuration;     // time of validity
     21
     22    Byte_t   fHour;
     23    Byte_t   fMin;
     24    Byte_t   fSec;
     25    UInt_t   fNanoSec;
    2126
    2227public:
    23 
    2428    MTime(const char *name=NULL, const char *title=NULL)
    2529    {
     
    5963    }
    6064
     65    void SetCT1Time(UInt_t t1, UInt_t t0)
     66    {
     67        // int   isecs_since_midday; // seconds passed since midday before sunset (JD of run start)
     68        // int   isecfrac_200ns;     // fractional part of isecs_since_midday
     69        // fTime->SetTime(isecfrac_200ns, isecs_since_midday);
     70        fNanoSec  = 200*t1;
     71        fSec      = t0%60;
     72        t0 /= 60;
     73        fMin      = t0%60;
     74        t0 /= 60;
     75        fHour     = (t0+12)%24;
     76    }
     77
     78    void SetTime(Byte_t h, Byte_t m, Byte_t s, UShort_t ns)
     79    {
     80        fHour    = h;
     81        fMin     = m;
     82        fSec     = s;
     83        fNanoSec = ns;
     84    }
     85
    6186    void SetDuration(UInt_t t)
    6287    {
     
    82107        return fDuration;
    83108    }
    84 
    85     void SetTime(int, int, int, int) {}
    86109
    87110    ClassDef(MTime, 1)  //A generalized MARS time stamp
  • trunk/MagicSoft/Mars/mhist/MH.cc

    r2109 r2150  
    5555#include <TH2.h>
    5656#include <TH3.h>
     57#include <TStyle.h>       // TStyle::GetScreenFactor
    5758#include <TGaxis.h>
    5859#include <TCanvas.h>
     
    128129// number of all existing canvases plus one)
    129130//
     131// Normally the canvas size is scaled with gStyle->GetScreenFactor() so
     132// that on all screens it looks like the same part of the screen.
     133// To suppress this scaling use usescreenfactor=kFALSE. In this case
     134// you specify directly the size of the embedded pad.
     135//
    130136TCanvas *MH::MakeDefCanvas(TString name, const char *title,
    131                            const UInt_t w, const UInt_t h)
     137                           UInt_t w, UInt_t h, Bool_t usescreenfactor)
    132138{
    133139    const TList *list = (TList*)gROOT->GetListOfCanvases();
     
    139145        name += Form(" <%d>", list->GetSize()+1);
    140146
     147    if (!usescreenfactor)
     148    {
     149        const Float_t cx = gStyle->GetScreenFactor();
     150        w += 4;
     151        h += 28;
     152        w = (int)(w/cx+1);
     153        h = (int)(h/cx+1);
     154    }
     155
    141156    return new TCanvas(name, title, w, h);
    142157}
     
    147162// and title are retrieved from the given TObject.
    148163//
     164// Normally the canvas size is scaled with gStyle->GetScreenFactor() so
     165// that on all screens it looks like the same part of the screen.
     166// To suppress this scaling use usescreenfactor=kFALSE. In this case
     167// you specify directly the size of the embedded pad.
     168//
    149169TCanvas *MH::MakeDefCanvas(const TObject *obj,
    150                            const UInt_t w, const UInt_t h)
    151 {
     170                           UInt_t w, UInt_t h, Bool_t usescreenfactor)
     171{
     172    if (!usescreenfactor)
     173    {
     174        const Float_t cx = gStyle->GetScreenFactor();
     175        w += 4;
     176        h += 28;
     177        h = (int)(h/cx+1);
     178        w = (int)(w/cx+1);
     179    }
     180
    152181    return MakeDefCanvas(obj->GetName(), obj->GetTitle(), w, h);
    153182}
  • trunk/MagicSoft/Mars/mhist/MH.h

    r2117 r2150  
    3333
    3434    static TCanvas *MakeDefCanvas(TString name="", const char *title="",
    35                                   const UInt_t w=625, const UInt_t h=440);
     35                                  UInt_t w=625, UInt_t h=440,
     36                                  Bool_t usescreenfactor=kTRUE);
    3637    static TCanvas *MakeDefCanvas(const TObject *obj,
    37                                   const UInt_t w=625, const UInt_t h=440);
     38                                  UInt_t w=625, UInt_t h=440,
     39                                  Bool_t usescreenfactor=kFALSE);
    3840
    3941    // FIXME: * --> & !!!
Note: See TracChangeset for help on using the changeset viewer.