QGSDisplayManager Class Reference

List of all members.


Detailed Description

apollo smart scope display manager

Author:
Sergio Di Domizio

Public Member Functions

 QGSDisplayManager ()
 ctor
virtual ~QGSDisplayManager ()
 dtor
void SetCanvas (TCanvas *canvas)
 set display canvas
Bool_t AddChannel (QScopeChannelInfo *chInfo)
 add display channel
void UpdateDisplay ()
 update canvas
void SetUpdatePeriodMs (UInt_t updatePeriodMs)
 set display update period in ms (defaults to 200 ms)
Bool_t SetWindowLengthMs (UInt_t winLengthMs)
 set display window length in ms
void ForceResync ()
 schedule resync with real time daq at next display update
void Print (const std::string &fileName)
 print canvas to fileName

Private Member Functions

Bool_t Update (Int_t chId, bool reSync)
void MakeUp (Int_t chId)
void SetGlobalParams ()
Float_t EvalMvPerDiv (const TH1F *histo) const
 evaluate mV/div such that histo will fit in the canvas
Int_t EvalOffset (const TH1F *histo, Float_t mVperDiv) const
 evaluate offset such that histo will fit in the canvas
void HandleMeasures (Int_t chId)
void DrawMeasures ()
void DrawConfig ()
void AddLabel (const char *text, ULong_t color, Bool_t isMeas)
void ClearLabels ()

Private Attributes

TCanvas * fCanvas
std::map< Int_t,
QScopeChannelInfo * > 
fConfigs
std::map< Int_t,
QSmartScopeChannel * > 
fScopeChannels
std::map< Int_t, TH1F * > fHistograms
std::map< Int_t, QScopeMeasuresfMeasures
std::list< TPaveLabel * > fMeasLabels
std::list< TPaveLabel * > fConfigLabels
TH1F * fAxisHisto
UInt_t fUpdatePeriodMs
UInt_t fWindowLengthMs
ULong64_t fLastIndex
Bool_t fUpdateLastIndex
const Double_t kMaxDelaySec
const Double_t kYmin
const Double_t kYmax
const Double_t kAdc2mV
ULong_t fXLabelColor

Classes

class  QScopeMeasures
 simple container for scope measurements More...

Member Function Documentation

Bool_t QGSDisplayManager::AddChannel ( QScopeChannelInfo chInfo  ) 

add display channel

Parameters:
chInfo ptr to QScopeChannelInfo object used to share configuration between gui and batch scope classes.
Returns:
true unless a channel with the same id already exists
chInfo objects are not owned by this class and should be deleted by the calling code.

References fConfigs, fHistograms, fScopeChannels, QScopeChannelInfo::GetId(), and SetGlobalParams().

Referenced by QGuiScope::SetupDisplayManager().

Bool_t QGSDisplayManager::SetWindowLengthMs ( UInt_t  winLengthMs  ) 

set display window length in ms

Returns:
true unless requested value is invalid

References fWindowLengthMs, and QScopeChannelInfo::GetAvailableWindowLengthsMs().

Referenced by QGuiScope::HandleTimeout(), and QGuiScope::SetupDisplayManager().

bool QGSDisplayManager::Update ( Int_t  chId,
bool  reSync 
) [private]

Parameters:
reSync whether to re-sync to real time daq
Returns:
true on success, false if something fails in data update
update data for histogram with channel id chId

References fConfigs, fHistograms, fLastIndex, fScopeChannels, fUpdateLastIndex, QSmartScopeChannel::GetHistogram(), QSmartScopeChannel::GetLatestIndex(), QScopeChannelInfo::GetLgChannel(), kMaxDelaySec, and QSmartScopeChannel::SetChannel().

Referenced by UpdateDisplay().

void QGSDisplayManager::MakeUp ( Int_t  chId  )  [private]

void QGSDisplayManager::SetGlobalParams (  )  [private]

propagate global settings (update period and window length) to QSmartScopeChannel objects

References fScopeChannels, fUpdatePeriodMs, and fWindowLengthMs.

Referenced by AddChannel(), and UpdateDisplay().

Float_t QGSDisplayManager::EvalMvPerDiv ( const TH1F *  histo  )  const [private]

evaluate mV/div such that histo will fit in the canvas

Parameters:
histo unscaled histogram (in ADC counts) for which mV/div must be evaluated
Returns:
the best mV/div value among the available ones

References QScopeChannelInfo::GetAvailableMvPerDiv(), kAdc2mV, kYmax, and kYmin.

Referenced by MakeUp().

Int_t QGSDisplayManager::EvalOffset ( const TH1F *  histo,
Float_t  mVperDiv 
) const [private]

evaluate offset such that histo will fit in the canvas

Parameters:
histo unscaled histogram (in ADC counts) for which offset must be evaluated
mVperDiv mV/div that will be used for display
Returns:
best offset in mV

References kAdc2mV, kYmax, and kYmin.

Referenced by MakeUp().

void QGSDisplayManager::HandleMeasures ( Int_t  chId  )  [private]

void QGSDisplayManager::DrawMeasures (  )  [private]

void QGSDisplayManager::DrawConfig (  )  [private]

void QGSDisplayManager::AddLabel ( const char *  text,
ULong_t  color,
Bool_t  isMeas 
) [private]

add label with the given text and color (int Pixel_t units)

Parameters:
isMeas whether label represents a measurement or general channel information. This is used to determine whether to draw the label on the left (false) or on the right (true) of the screen.

References fConfigLabels, and fMeasLabels.

Referenced by DrawConfig(), and DrawMeasures().

void QGSDisplayManager::ClearLabels (  )  [private]

delete drawn labels and clear fConfigLabels and fMeasLabels

References fConfigLabels, and fMeasLabels.

Referenced by UpdateDisplay(), and ~QGSDisplayManager().


Member Data Documentation

TCanvas* QGSDisplayManager::fCanvas [private]

canvas used for display

Referenced by Print(), SetCanvas(), and UpdateDisplay().

std::map<Int_t, QScopeChannelInfo*> QGSDisplayManager::fConfigs [private]

map of configurations. key: channel id, value: configuration

Referenced by AddChannel(), DrawConfig(), DrawMeasures(), HandleMeasures(), MakeUp(), QGSDisplayManager(), Update(), and UpdateDisplay().

map of scope channels. key: channel id, value: scope channel

Referenced by AddChannel(), QGSDisplayManager(), SetGlobalParams(), Update(), and ~QGSDisplayManager().

std::map<Int_t, TH1F*> QGSDisplayManager::fHistograms [private]

map of histograms used for display. key: channel id, value: histogram

Referenced by AddChannel(), HandleMeasures(), MakeUp(), Update(), UpdateDisplay(), and ~QGSDisplayManager().

std::map<Int_t, QScopeMeasures> QGSDisplayManager::fMeasures [private]

key: channel id, value: corresponding QScopeMeasures object

Referenced by DrawMeasures(), and HandleMeasures().

std::list<TPaveLabel*> QGSDisplayManager::fMeasLabels [private]

list of drawn measure labels, used to keep memory of existing labels

Referenced by AddLabel(), and ClearLabels().

std::list<TPaveLabel*> QGSDisplayManager::fConfigLabels [private]

list of drawn config labels, used to keep memory of existing labels

Referenced by AddLabel(), and ClearLabels().

histogram used to draw axes

Referenced by QGSDisplayManager(), UpdateDisplay(), and ~QGSDisplayManager().

display update period in ms, same for all channels

Referenced by SetGlobalParams(), and SetUpdatePeriodMs().

display window length in ms, same for all channels

Referenced by DrawConfig(), SetGlobalParams(), and SetWindowLengthMs().

ULong64_t QGSDisplayManager::fLastIndex [private]

index for QSmartScopeChannel buffer

Referenced by Update(), and UpdateDisplay().

whether last index should be updated to re-sync with real time daq

Referenced by ForceResync(), Update(), and UpdateDisplay().

const Double_t QGSDisplayManager::kMaxDelaySec [private]

max delay to be accumulated before re-syncing with real time daq

Referenced by Update().

const Double_t QGSDisplayManager::kYmin [private]

axis histogram minimum

Referenced by EvalMvPerDiv(), EvalOffset(), and QGSDisplayManager().

const Double_t QGSDisplayManager::kYmax [private]

axis histogram minimum

Referenced by EvalMvPerDiv(), EvalOffset(), and QGSDisplayManager().

const Double_t QGSDisplayManager::kAdc2mV [private]

yet another definiton of the ADC2mV conversion

Referenced by EvalMvPerDiv(), EvalOffset(), and MakeUp().

color of on screen X axis information label

Referenced by DrawConfig(), and QGSDisplayManager().


The documentation for this class was generated from the following files:

Generated on Tue Nov 16 10:50:06 2010 for CUORE Software by  doxygen 1.5.6