NSCL DDAS  12.1-001
Support for XIA DDAS at FRIB
Public Member Functions | List of all members
CPixieSystemUtilities Class Reference

System manager class for DDAS. More...

#include <CPixieSystemUtilities.h>

Public Member Functions

 CPixieSystemUtilities ()
 Constructor. More...
 
int Boot ()
 Boot the entire system. More...
 
int SaveSetFile (char *fileName)
 Save the currently loaded DSP settings to a settings file. More...
 
int LoadSetFile (char *fileName)
 Load a new settings file. More...
 
int ExitSystem ()
 Exit the system and release resources from the modules. More...
 
void SetBootMode (int mode)
 Set the boot mode. More...
 
int GetBootMode ()
 Get the boot mode. More...
 
bool GetBootStatus ()
 Get the crate boot status. More...
 
unsigned short GetNumModules ()
 Get the number of installed modules. More...
 
int GetModuleMSPS (int module)
 Get the module ADC sampling rate in MSPS. More...
 

Detailed Description

System manager class for DDAS.

This class manages the Pixie DAQ system. It controls loading and saving settings files, booting and exiting, and stores information about the state of the system which can be accessed across the ctypes interface.

Constructor & Destructor Documentation

◆ CPixieSystemUtilities()

CPixieSystemUtilities::CPixieSystemUtilities ( )

Constructor.

Default: boot in online mode and read the settings file specified in cfgPixie16.txt.

Member Function Documentation

◆ Boot()

int CPixieSystemUtilities::Boot ( )

Boot the entire system.

Returns
int
Return values
0On successful boot.
-1If the boot fails.

Reads in configuration information from cfgPixie16.txt, loads settings file information, boots modules and saves configuration info.

Note
(ASC 9/11/24): Check the same envvar as e.g. the readout code to determine whether to perform a full boot or settings-only boot. In principle this could be configurable on the QtScope GUI but for now the boot mode is set the same way as it is for the readout code. An important thing to keep in mind is that getenv("DDAS_BOOT_WHEN_REQUESTED") is false iff DDAS_BOOT_WHEN_REQUESTED is not set (getenv() returns pointer to the value string which evaluates to true regardless of the value itself). When running a containerized NSCLDAQ one needs to make sure the envvar is set inside the container.

◆ ExitSystem()

int CPixieSystemUtilities::ExitSystem ( )

Exit the system and release resources from the modules.

Returns
int
Return values
0Success.
!=0XIA API error code.

If the call to Pixie16ExitSystem() fails for any module, return the error code and set the booted state flag to false. The system is likely in a bad state.

◆ GetBootMode()

int CPixieSystemUtilities::GetBootMode ( )
inline

Get the boot mode.

Warning
Offline boot mode is currently only allowed for XIA API 2!
Returns
The boot mode.
Return values
0Online mode.
1Offline mode (no hardware).

◆ GetBootStatus()

bool CPixieSystemUtilities::GetBootStatus ( )
inline

Get the crate boot status.

Returns
bool
Return values
trueIf the system has been booted.
falseOtherwise.

◆ GetModuleMSPS()

int CPixieSystemUtilities::GetModuleMSPS ( int  module)

Get the module ADC sampling rate in MSPS.

Exceptions
std::runtime_errorIf the module number is invalid.
Returns
The module ADC sampling rate in MSPS.
Return values
-1if the system is not booted.
-2if the module number is invalid.

◆ GetNumModules()

unsigned short CPixieSystemUtilities::GetNumModules ( )
inline

Get the number of installed modules.

Returns
The number of modules in the crate.

◆ LoadSetFile()

int CPixieSystemUtilities::LoadSetFile ( char *  fileName)

Load a new settings file.

Parameters
fileNameSettings file name we are attempting to open.
Returns
int
Return values
0Success.
!=0XIA API error code.

Check and see if the system is booted. If so, load the parameters from the settings file. If not flag that a new settings file path (potentially different from that in the cfgPixie16.txt) has been set. The flag is checked at boot to load the new settings file.

◆ SaveSetFile()

int CPixieSystemUtilities::SaveSetFile ( char *  fileName)

Save the currently loaded DSP settings to a settings file.

Parameters
fileNameName of file to save.
Returns
int
Return values
0Success.
!=0XIA API error code.

File format depends on what is supported by the version of the XIA API being used. Version 3+ will save the settings file as a JSON file while in version 2 it is binary.

◆ SetBootMode()

void CPixieSystemUtilities::SetBootMode ( int  mode)
inline

Set the boot mode.

Warning
Offline boot mode is currently only allowed for XIA API 2!
Parameters
modeSet the boot mode to this value.

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