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

Manages the booting process for DDAS. More...

#include <SystemBooter.h>

Public Types

enum  BootType { FullBoot = 0x7f , SettingsOnly = 0x70 }
 An enum for boot type bitmasks. More...
 

Public Member Functions

 SystemBooter ()
 Constructor. More...
 
void boot (Configuration &config, BootType type)
 
void bootModuleByIndex (int modIndex, Configuration &config, BootType type)
 Boot a single module. More...
 
void setVerbose (bool enable)
 Enable or disable verbose output. More...
 
bool isVerbose () const
 Return the state of verbosity. More...
 
void setOfflineMode (unsigned short mode)
 Enable or disable online boot. More...
 
unsigned short getOfflineMode () const
 Return the boot mode of the system. More...
 
void populateHardwareMap (Configuration &config)
 Read and store hardware info from each of the modules in the system. More...
 

Detailed Description

Manages the booting process for DDAS.

All Readout and slow controls programs rely on this class to boot the system. There are two separate boot types: FullBoot and SettingsOnly. The former loads firmware and settings into the system while the latter just loads the settings. The basic usage pattern is demonstrated below.

using namespace DAQ::DDAS;
unique_ptr<Configuration> pConfig = Configuration::generator(
"DDASFirmwareVersions.txt", "cfgPixie16.txt"
);
SystemBooter booter;
booter.boot(*pConfig, SystemBooter::FullBoot);
SystemBooter()
Constructor.
Definition: SystemBooter.cpp:24
@ FullBoot
Bitmask for full boot with firmware load.
Definition: SystemBooter.h:60

One should realize that this does not handle any of the logic regarding when and when not to synchronize or load firmware. External logic to this class will determine whether the system should load the firmware or not. Synchronization is unrelated to the boot process besides the fact that a firmware load could ruin synchronization.

Member Enumeration Documentation

◆ BootType

An enum for boot type bitmasks.

Enumerator
FullBoot 

Bitmask for full boot with firmware load.

SettingsOnly 

Bitmask for boot with settings only.

Constructor & Destructor Documentation

◆ SystemBooter()

DAQ::DDAS::SystemBooter::SystemBooter ( )

Constructor.

Enables verbose output by default.

Member Function Documentation

◆ boot()

void DAQ::DDAS::SystemBooter::boot ( Configuration config,
BootType  type 
)

Provided a configuration, all modules will be booted. The configuration contains the firmware files for each hardware type, the slot map, and the number of modules. During the course of booting, the hardware will be queried as well to determine the the serial number, revision, ADC frequency, and resolution. The revision, adc frequency, and resolution will all be parsed and the information will be stored in the configuration as a HardwareRegistry::HardwareType.

◆ bootModuleByIndex()

void DAQ::DDAS::SystemBooter::bootModuleByIndex ( int  modIndex,
Configuration m_config,
BootType  type 
)

Boot a single module.

Parameters
modIndexIndex of the module in the system.
m_configThe system configuration.
typeBoot style (load firmware or settings only).
Exceptions
std::runtime_errorIf hardware type is unknown.
CDDASExceptionIf Pixie16BootModule returns an error.

The system is booted into a usable state. The mechanics of booting involve either loading firmware and settings or just settings, depending on the type parameter that was passed as a second argument to the method. If the user chooses to boot with a firmware load, the firmware files stored in the configuration associated with the hardware will be used. The settings file that will be used in any boot type, will be the path stored in the configuration.

◆ getOfflineMode()

unsigned short DAQ::DDAS::SystemBooter::getOfflineMode ( ) const
inline

Return the boot mode of the system.

Returns
The boot mode.

◆ isVerbose()

bool DAQ::DDAS::SystemBooter::isVerbose ( ) const
inline

Return the state of verbosity.

Returns
The state.

◆ populateHardwareMap()

void DAQ::DDAS::SystemBooter::populateHardwareMap ( Configuration config)

Read and store hardware info from each of the modules in the system.

Parameters
configThe system configuration.
Exceptions
CDDASExceptionIf Pixie16ReadModuleInfo returns an error.

To retrieve information about all of the modules in the system, Pixie16ReadModuleInfo is called for each module index. The resulting revision number, ADC bits, and ADC frequency is printed (if verbose output enabled) and the hardware mapping is stored in the configuration that was passed in.

Todo:
(ASC 12/14/23): For the API transition we want to read the module_config struct. We may not even need to log it (just put them in a vector)

◆ setOfflineMode()

void DAQ::DDAS::SystemBooter::setOfflineMode ( unsigned short  mode)

Enable or disable online boot.

Parameters
modeBoot mode, 0 for online, 1 for offline.
Warning
Offline boot mode is only supported in XIA API v2!

By default, the boot mode is set to online mode. If it is set to offline mode, calls to the API functions can still be tested with no modules present.

◆ setVerbose()

void DAQ::DDAS::SystemBooter::setVerbose ( bool  enable)

Enable or disable verbose output.

Parameters
enableEnables output messages if true.

By default, the output verbosity setting is enabled. If it is disabled, there will be no output printed to the terminal.


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