QGuiPulserMain Class Reference
[Apollo GuiApollo]

List of all members.


Detailed Description

pulser control gui main window

Author:
Sergio Di Domizio

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
QGPTimingFramefTimingFrame
QGPButtonsFramefButtonsFrame
QGuiPulseNotifierfNotifier
TThread * fThread
QPulserGuiInterfacefHandler
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...

Member Function Documentation

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 
)

void QGuiPulserMain::Blink ( Long_t  pulseId  ) 

void QGuiPulserMain::CreateWindow (  )  [private]

void * QGuiPulserMain::MakeThread ( void *  arg  )  [static, private]

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]

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]

Bool_t QGuiPulserMain::LoadFromFile ( const std::string &  filename  )  [private]

Bool_t QGuiPulserMain::WriteConfigFile ( const std::string &  filename  )  [private]

Write configuration (channels and amplitudes) to filename

References fBoardFrame, QGPTimingFrame::GetDelay(), and QGPTimingFrame::GetPeriod().


Member Data Documentation

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().

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().


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