NSCL DDAS
1.0
Support for XIA DDAS at the NSCL
|
The SystemBooter class. More...
#include <SystemBooter.h>
Public Types | |
enum | BootType { FullBoot = 0x7f, SettingsOnly =0x70 } |
Public Member Functions | |
SystemBooter () | |
enable or disable output More... | |
void | boot (Configuration &config, BootType type) |
Boot the entire system. More... | |
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 |
void | populateHardwareMap (Configuration &config) |
Read and store hardware info from each of the modules in the system. More... | |
The SystemBooter class.
A class to manage the booting process for DDAS. All Readout and nscope program 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 | ( | ) |
enable or disable output
Constructor.
Enables verbose output by default.
void DAQ::DDAS::SystemBooter::boot | ( | Configuration & | config, |
BootType | type | ||
) |
Boot the entire system.
config | a configuration describing the system |
type | style of boot |
std::runtime_error | if Pixie16InitSystem() call returns an error |
std::runtime_error | if populateHardwareMap() throws |
std::runtime_error | if bootModuleByIndex() throws |
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 |
std::runtime_error | if Pixie16BootModule returns an error code |
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.
bool DAQ::DDAS::SystemBooter::isVerbose | ( | ) | const |
void DAQ::DDAS::SystemBooter::populateHardwareMap | ( | Configuration & | config | ) |
Read and store hardware info from each of the modules in the system.
config | the system configuration |
std::runtime_error | if Pixie16ReadModuleInfo returns error code |
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::setVerbose | ( | bool | enable | ) |
Enable or disable verbose output.
enable | enables output messages |
By default, the output verbosity setting is enabled. If it is disabled, there will be no output printed to the terminal.