NSCL DDAS
12.1-001
Support for XIA DDAS at FRIB
|
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... | |
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.
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.
DAQ::DDAS::SystemBooter::SystemBooter | ( | ) |
Constructor.
Enables verbose output by default.
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.
void DAQ::DDAS::SystemBooter::bootModuleByIndex | ( | int | modIndex, |
Configuration & | m_config, | ||
BootType | type | ||
) |
Boot a single module.
modIndex | Index of the module in the system. |
m_config | The system configuration. |
type | Boot style (load firmware or settings only). |
std::runtime_error | If hardware type is unknown. |
CDDASException | If 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.
|
inline |
Return the boot mode of the system.
|
inline |
Return the state of verbosity.
void DAQ::DDAS::SystemBooter::populateHardwareMap | ( | Configuration & | config | ) |
Read and store hardware info from each of the modules in the system.
config | The system configuration. |
CDDASException | If 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.
void DAQ::DDAS::SystemBooter::setOfflineMode | ( | unsigned short | mode | ) |
Enable or disable online boot.
mode | Boot mode, 0 for online, 1 for offline. |
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.
void DAQ::DDAS::SystemBooter::setVerbose | ( | bool | enable | ) |
Enable or disable verbose output.
enable | Enables 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.