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, QScopeMeasures > | fMeasures |
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... |
Bool_t QGSDisplayManager::AddChannel | ( | QScopeChannelInfo * | chInfo | ) |
add display channel
chInfo | ptr to QScopeChannelInfo object used to share configuration between gui and batch scope classes. |
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
References fWindowLengthMs, and QScopeChannelInfo::GetAvailableWindowLengthsMs().
Referenced by QGuiScope::HandleTimeout(), and QGuiScope::SetupDisplayManager().
bool QGSDisplayManager::Update | ( | Int_t | chId, | |
bool | reSync | |||
) | [private] |
reSync | whether to re-sync to real time daq |
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] |
perform graphic manipulation fro histogram with channel id chId
References EvalMvPerDiv(), EvalOffset(), fConfigs, fHistograms, QScopeChannelInfo::GetAdjustOffset(), QScopeChannelInfo::GetAutoScale(), QScopeChannelInfo::GetMvPerDiv(), QScopeChannelInfo::GetOffsetMv(), QScopeChannelInfo::GetWaveformColor(), kAdc2mV, QScopeChannelInfo::SetAdjustOffset(), QScopeChannelInfo::SetAutoScale(), QScopeChannelInfo::SetMvPerDiv(), and QScopeChannelInfo::SetOffsetMv().
Referenced by UpdateDisplay().
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
histo | unscaled histogram (in ADC counts) for which mV/div must be evaluated |
References QScopeChannelInfo::GetAvailableMvPerDiv(), kAdc2mV, kYmax, and kYmin.
Referenced by MakeUp().
Int_t QGSDisplayManager::EvalOffset | ( | const TH1F * | histo, | |
Float_t | mVperDiv | |||
) | const [private] |
void QGSDisplayManager::HandleMeasures | ( | Int_t | chId | ) | [private] |
perform measurements for the requested channel
References fConfigs, fHistograms, fMeasures, QScopeChannelInfo::GetMeasAverage(), QScopeChannelInfo::GetMeasMaxMin(), QScopeChannelInfo::GetMeasRMS(), QScopeChannelInfo::GetMvPerDiv(), and QScopeChannelInfo::GetOffsetMv().
Referenced by UpdateDisplay().
void QGSDisplayManager::DrawMeasures | ( | ) | [private] |
draw measurements in the canvas
References AddLabel(), QGSDisplayManager::QScopeMeasures::fAverage, fConfigs, QGSDisplayManager::QScopeMeasures::fMaxMin, fMeasures, QGSDisplayManager::QScopeMeasures::fRMS, QScopeChannelInfo::GetEnabled(), QScopeChannelInfo::GetId(), QScopeChannelInfo::GetMeasAverage(), QScopeChannelInfo::GetMeasMaxMin(), QScopeChannelInfo::GetMeasRMS(), and QScopeChannelInfo::GetWaveformColor().
Referenced by UpdateDisplay().
void QGSDisplayManager::DrawConfig | ( | ) | [private] |
draw active channels and mV/div for each of them
References AddLabel(), fConfigs, fWindowLengthMs, fXLabelColor, QScopeChannelInfo::GetEnabled(), QScopeChannelInfo::GetLgChannel(), QScopeChannelInfo::GetMvPerDiv(), and QScopeChannelInfo::GetWaveformColor().
Referenced by UpdateDisplay().
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)
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().
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().
std::map<Int_t, QSmartScopeChannel*> QGSDisplayManager::fScopeChannels [private] |
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().
TH1F* QGSDisplayManager::fAxisHisto [private] |
histogram used to draw axes
Referenced by QGSDisplayManager(), UpdateDisplay(), and ~QGSDisplayManager().
UInt_t QGSDisplayManager::fUpdatePeriodMs [private] |
display update period in ms, same for all channels
Referenced by SetGlobalParams(), and SetUpdatePeriodMs().
UInt_t QGSDisplayManager::fWindowLengthMs [private] |
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().
Bool_t QGSDisplayManager::fUpdateLastIndex [private] |
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().
ULong_t QGSDisplayManager::fXLabelColor [private] |
color of on screen X axis information label
Referenced by DrawConfig(), and QGSDisplayManager().