Public Member Functions | |
void | CleanExit () |
void | Closed () |
UInt_t | GetNumEnabledChannels () const |
get number of channels that are scheduled to fire a pulse | |
void | UpdateNumEnabledChannels () |
void | CheckPeriod () |
void | CheckPeriodRange () |
void | CheckDelay () |
void | LoadFromFile () |
void | WriteConfigFile () |
void | PromptForBasket () |
void | StartStop () |
void | FireSingleShot (Long_t board, Long_t ch) |
void | Blink (Long_t) |
Private Member Functions | |
void | CreateWindow () |
void | Init () |
void | StartPulserController () |
void | StopPulserController () |
void | SetGuiStatus (QGuiStatus_t status) |
void | LockBoards (Bool_t doLock) |
void | Lock () |
void | Unlock () |
void | UpdateSettingsBasket () |
void | UpdateRcFile () const |
void | ReadRcFile () |
void | ProcessRcMap () |
void | SetSettingsBasket (size_t basket) |
Bool_t | LoadFromFile (const std::string &filename) |
Bool_t | WriteConfigFile (const std::string &filename) |
const char * | RcFileName () const |
Static Private Member Functions | |
static void * | MakeThread (void *arg) |
Private Attributes | |
std::map< unsigned int, QGPBoardFrame * > | fBoardFrame |
TGTab * | fTabFrame |
QGPTimingFrame * | fTimingFrame |
QGPButtonsFrame * | fButtonsFrame |
QGuiPulseNotifier * | fNotifier |
TThread * | fThread |
QPulserGuiInterface * | fHandler |
UInt_t | fNumEnabledChannels |
size_t | fSettingsBasket |
const int | kCfgVersion |
std::string | fLastCfgName |
std::map< std::string, QVdt > | fRcMap |
Classes | |
struct | PulserCfg_t |
used in LoadFromFile() to temporarily store the configuration More... |
void QGuiPulserMain::UpdateNumEnabledChannels | ( | ) |
read enable channels from all existing pulser boards and call CheckPeriod() and CheckPeriodRange().
The only reason why this method is public is that it has to be accessed by the signal/slot mechanism.
References CheckPeriod(), CheckPeriodRange(), and fBoardFrame.
Referenced by Init(), and LoadFromFile().
void QGuiPulserMain::CheckPeriod | ( | ) |
Check that period is not too small for the present number of enabled channels and for the present delay. If it is, increase it to the lowest allowed value
References QGPTimingFrame::GetDelay(), QGPTimingFrame::GetPeriod(), QGPTimingFrame::GetPeriodMax(), and QGPTimingFrame::SetPeriod().
Referenced by UpdateNumEnabledChannels().
void QGuiPulserMain::CheckPeriodRange | ( | ) |
Increase the lower bound of the allowed period values if it is too low for the present number of active channels and for the present delay.
References QGPTimingFrame::GetDelayMin(), QGPTimingFrame::GetPeriodMax(), and QGPTimingFrame::SetPeriodRange().
Referenced by Init(), and UpdateNumEnabledChannels().
void QGuiPulserMain::CheckDelay | ( | ) |
Reduce the delay to the maximum allowed value if it is too big for the present number of active channels
References QGPTimingFrame::GetDelay(), QGPTimingFrame::GetDelayMin(), QGPTimingFrame::GetPeriod(), and QGPTimingFrame::SetDelay().
void QGuiPulserMain::LoadFromFile | ( | ) |
Lock Gui, prompt user for input config file and call the private LoadFromFile() method, which actually reads the config file
References QGPLogger::GetInstance(), and QGPLogger::Log().
Referenced by ProcessRcMap().
void QGuiPulserMain::WriteConfigFile | ( | ) |
Lock Gui, prompt user for output config file and call the private WriteConfigFile() method, which actually writes the config file
References QGPLogger::GetInstance(), and QGPLogger::Log().
void QGuiPulserMain::PromptForBasket | ( | ) |
Lock Gui, prompt user for new basket and call SetSettingsBasket()
References QGPLogger::GetInstance(), SetSettingsBasket(), and QGPLogger::ShowConfigFile().
Referenced by Init().
void QGuiPulserMain::StartStop | ( | ) |
Start/stop batch pulser control job and update Gui status accordingly
References fNotifier, QGPButtonsFrame::GetStartStopStatus(), QGuiPulseNotifier::Start(), StartPulserController(), QGuiPulseNotifier::Stop(), and StopPulserController().
void QGuiPulserMain::FireSingleShot | ( | Long_t | board, | |
Long_t | ch | |||
) |
Fire single shot on the requested channel
References fBoardFrame, QPulserSingleShot::Fire(), QError::GetDescription(), QPulserSingleShot::GetError(), QGPLogger::GetInstance(), QGPLogger::Log(), and QPulserSingleShot::SetParameters().
void QGuiPulserMain::Blink | ( | Long_t | pulseId | ) |
Blink led on the requested channel
References fBoardFrame, QPulserConverter::GetBoard(), QPulserConverter::GetHwCh(), and QPulserConverter::GetInstance().
void QGuiPulserMain::CreateWindow | ( | ) | [private] |
Creates all subframes
References QGuiCompositeFrame::AddFrame(), QGuiUtils::GetBackgroundColor(), QGuiUtils::GetHints(), QGPLogger::GetInstance(), and QGuiUtils::GetInstance().
Referenced by Init().
void * QGuiPulserMain::MakeThread | ( | void * | arg | ) | [static, private] |
initialize and run the pulser control batch job
References QPulserGuiInterface::AddChannel(), fBoardFrame, fHandler, fSettingsBasket, fTimingFrame, QGPTimingFrame::GetDelay(), QGPTimingFrame::GetPeriod(), QPulserGuiInterface::SetDelay(), QPulserGuiInterface::SetPeriod(), QPulserGuiInterface::SetSettingsBasket(), and QPulserGuiInterface::Start().
Referenced by StartPulserController().
void QGuiPulserMain::Init | ( | ) | [private] |
Read configuration to be loaded (from rcfile or prompt user), call CreateWindow() and displays the Gui window
References CheckPeriodRange(), CreateWindow(), fNotifier, QGPLogger::GetInstance(), ProcessRcMap(), PromptForBasket(), ReadRcFile(), and UpdateNumEnabledChannels().
void QGuiPulserMain::StartPulserController | ( | ) | [private] |
Creates new thread and calls MakeThread() in it
References fThread, and MakeThread().
Referenced by StartStop().
void QGuiPulserMain::StopPulserController | ( | ) | [private] |
Stop execution of pulser controller batch job
References QPulserGuiInterface::Stop().
Referenced by StartStop().
void QGuiPulserMain::UpdateSettingsBasket | ( | ) | [private] |
Read configuration from db and update Gui accordingly
References fBoardFrame, QApolloDb::GetActiveChannels(), QPulserConverter::GetInstance(), QPulserConverter::HeaterName2Board(), QPulserConverter::Load(), and QDaqChannel::Mapping_s.
Referenced by SetSettingsBasket().
void QGuiPulserMain::UpdateRcFile | ( | ) | const [private] |
Write last used configuration to rcfile upon exit
void QGuiPulserMain::ReadRcFile | ( | ) | [private] |
Read content of rcfile and store the values in fRcMap
Referenced by Init().
void QGuiPulserMain::ProcessRcMap | ( | ) | [private] |
Parse fRcMap searching for meaningful entries and udates the Gui in case of success. Try with cfg file first and move to settings basket on failure.
References LoadFromFile(), and SetSettingsBasket().
Referenced by Init().
void QGuiPulserMain::SetSettingsBasket | ( | size_t | basket | ) | [private] |
Call UpdateSettingsBasket() if the requested basket is valid
References QGPLogger::GetInstance(), QGPLogger::Log(), QGPLogger::ShowBasket(), and UpdateSettingsBasket().
Referenced by LoadFromFile(), ProcessRcMap(), and PromptForBasket().
Bool_t QGuiPulserMain::LoadFromFile | ( | const std::string & | filename | ) | [private] |
Load configuration (channels and amplitudes) from filename
References fBoardFrame, QGPLogger::GetInstance(), QGPTimingFrame::SetDelay(), QGPTimingFrame::SetPeriod(), SetSettingsBasket(), QGPLogger::ShowConfigFile(), and UpdateNumEnabledChannels().
Bool_t QGuiPulserMain::WriteConfigFile | ( | const std::string & | filename | ) | [private] |
Write configuration (channels and amplitudes) to filename
References fBoardFrame, QGPTimingFrame::GetDelay(), and QGPTimingFrame::GetPeriod().
std::map<unsigned int, QGPBoardFrame*> QGuiPulserMain::fBoardFrame [private] |
key: pulser board, value: pointer to board frame object
Referenced by Blink(), FireSingleShot(), LoadFromFile(), MakeThread(), UpdateNumEnabledChannels(), UpdateSettingsBasket(), and WriteConfigFile().
QGuiPulseNotifier* QGuiPulserMain::fNotifier [private] |
used to make the led blink when the pulser fires
Referenced by Init(), and StartStop().
TThread* QGuiPulserMain::fThread [private] |
Thread used to run batch pulser control job
Referenced by StartPulserController().