NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
Public Types | Public Member Functions | List of all members
DAQ::DDAS::SystemBooter Class Reference

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...
 

Detailed Description

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.

using namespace DAQ::DDAS;
unique_ptr<Configuration> pConfig = Configuration::generator("DDASFirmwareVersions.txt", "cfgPixie16.txt");
SystemBooter booter;
booter.boot(*pConfig, SystemBooter::FullBoot);

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.

Constructor & Destructor Documentation

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

enable or disable output

Constructor.

Enables verbose output by default.

Member Function Documentation

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

Boot the entire system.

Parameters
configa configuration describing the system
typestyle of boot
Exceptions
std::runtime_errorif Pixie16InitSystem() call returns an error
std::runtime_errorif populateHardwareMap() throws
std::runtime_errorif 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

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
std::runtime_errorif 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.

Todo:
Check that the firmware file paths are less than 256 characters in length.
bool DAQ::DDAS::SystemBooter::isVerbose ( ) const
Returns
the state of verbosity
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
std::runtime_errorif 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.

Parameters
enableenables output messages

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: