System manager class for DDAS.
More...
#include <CPixieSystemUtilities.h>
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.
◆ CPixieSystemUtilities()
CPixieSystemUtilities::CPixieSystemUtilities |
( |
| ) |
|
Constructor.
Default: boot in online mode and read the settings file specified in cfgPixie16.txt.
◆ Boot()
int CPixieSystemUtilities::Boot |
( |
| ) |
|
Boot the entire system.
- Returns
- int
- Return values
-
0 | On successful boot. |
-1 | If 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
-
0 | Success. |
!=0 | XIA 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
-
0 | Online mode. |
1 | Offline mode (no hardware). |
◆ GetBootStatus()
bool CPixieSystemUtilities::GetBootStatus |
( |
| ) |
|
|
inline |
Get the crate boot status.
- Returns
- bool
- Return values
-
true | If the system has been booted. |
false | Otherwise. |
◆ GetModuleMSPS()
int CPixieSystemUtilities::GetModuleMSPS |
( |
int |
module | ) |
|
Get the module ADC sampling rate in MSPS.
- Exceptions
-
std::runtime_error | If the module number is invalid. |
- Returns
- The module ADC sampling rate in MSPS.
- Return values
-
-1 | if the system is not booted. |
-2 | if 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
-
fileName | Settings file name we are attempting to open. |
- Returns
- int
- Return values
-
0 | Success. |
!=0 | XIA 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
-
fileName | Name of file to save. |
- Returns
- int
- Return values
-
0 | Success. |
!=0 | XIA 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
-
mode | Set the boot mode to this value. |
The documentation for this class was generated from the following files: