NSCL DDAS  12.1-001
Support for XIA DDAS at FRIB
SystemBooter.h
Go to the documentation of this file.
1 
6 #ifndef SYSTEMBOOTER_H
7 #define SYSTEMBOOTER_H
8 
9 #include <stddef.h>
10 
12 namespace DAQ {
14  namespace DDAS {
15 
16  class Configuration;
17  struct FirmwareConfiguration;
18 
56  {
57  public:
59  enum BootType {
60  FullBoot = 0x7f,
61  SettingsOnly = 0x70
62  };
63 
64  private:
65  bool m_verbose;
70  unsigned short m_offlineMode;
71 
72  public:
74  SystemBooter();
75  /*
76  * @brief Boot the entire system.
77  * @param config A configuration describing the system.
78  * @param type Style of boot.
79  * @throw CXIAException If Pixie16InitSystem() call returns
80  * an error.
81  * @throw CXIAException If populateHardwareMap() throws.
82  * @throw std::runtime_error If registered hardware is
83  * unrecognized when attempting to boot.
84  * @throws CXIAException If the Pixie boot fails.
85  */
86  void boot(Configuration& config, BootType type);
95  void bootModuleByIndex(
96  int modIndex, Configuration& config, BootType type
97  );
102  void setVerbose(bool enable);
107  bool isVerbose() const { return m_verbose; };
113  void setOfflineMode(unsigned short mode);
118  unsigned short getOfflineMode() const { return m_offlineMode; };
125  void populateHardwareMap(Configuration &config);
126 
127  private:
135  unsigned int computeBootMask(BootType type);
144  void logModuleInfo(
145  int modIndex, unsigned short ModRev, unsigned short ModSerNum,
146  unsigned short ModADCBits, unsigned short ModADCMSPS
147  );
155  void checkFWPathLengths(
156  FirmwareConfiguration& fwConfig, const size_t maxLen
157  );
158  };
159 
162  } // end DDAS namespace
163 } // end DAQ namespace
164 
165 #endif // SYSTEMBOOTER_H
166 
Store the system configuration information needed by Readout.
Definition: Configuration.h:81
Manages the booting process for DDAS.
Definition: SystemBooter.h:56
void populateHardwareMap(Configuration &config)
Read and store hardware info from each of the modules in the system.
Definition: SystemBooter.cpp:199
void setOfflineMode(unsigned short mode)
Enable or disable online boot.
Definition: SystemBooter.cpp:186
SystemBooter()
Constructor.
Definition: SystemBooter.cpp:24
void boot(Configuration &config, BootType type)
Definition: SystemBooter.cpp:38
void bootModuleByIndex(int modIndex, Configuration &config, BootType type)
Boot a single module.
Definition: SystemBooter.cpp:82
bool isVerbose() const
Return the state of verbosity.
Definition: SystemBooter.h:107
void setVerbose(bool enable)
Enable or disable verbose output.
Definition: SystemBooter.cpp:175
BootType
An enum for boot type bitmasks.
Definition: SystemBooter.h:59
@ FullBoot
Bitmask for full boot with firmware load.
Definition: SystemBooter.h:60
@ SettingsOnly
Bitmask for boot with settings only.
Definition: SystemBooter.h:61
unsigned short getOfflineMode() const
Return the boot mode of the system.
Definition: SystemBooter.h:118
Storage for hardware-type firmware/settings paths.
Definition: Configuration.h:42