NSCL DDAS  12.1-001
Support for XIA DDAS at FRIB
CPixieSystemUtilities.h
Go to the documentation of this file.
1 
7 #ifndef CPIXIESYSTEMUTILITIES_H
8 #define CPIXIESYSTEMUTILITIES_H
9 
10 #include <vector>
11 
12 #include <Configuration.h>
13 
30 {
31 private:
32  DAQ::DDAS::Configuration m_config;
33  int m_bootMode;
34  bool m_booted;
35  bool m_ovrSetFile;
36  unsigned short m_numModules;
37  std::vector<int> m_modEvtLength;
38  std::vector<unsigned short> m_modADCMSPS;
39  std::vector<unsigned short> m_modADCBits;
40  std::vector<unsigned short> m_modRev;
41  std::vector<unsigned short> m_modClockCal;
42 
43 public:
46 
53  int Boot();
61  int SaveSetFile(char* fileName);
69  int LoadSetFile(char* fileName);
76  int ExitSystem();
82  void SetBootMode(int mode) {m_bootMode = mode;};
90  int GetBootMode() {return m_bootMode;};
97  bool GetBootStatus() {return m_booted;};
102  unsigned short GetNumModules() {return m_numModules;};
110  int GetModuleMSPS(int module);
111 };
112 
115 extern "C" {
118  {
119  return new CPixieSystemUtilities();
120  }
121 
124  {
125  return utils->Boot();
126  }
129  CPixieSystemUtilities* utils, char* fName
130  )
131  {
132  return utils->SaveSetFile(fName);
133  }
136  CPixieSystemUtilities* utils, char* fName
137  )
138  {
139  return utils->LoadSetFile(fName);
140  }
143  {
144  return utils->ExitSystem();
145  }
146 
149  CPixieSystemUtilities* utils, int mode
150  )
151  {
152  return utils->SetBootMode(mode);
153  }
156  {
157  return utils->GetBootMode();
158  }
161  {
162  return utils->GetBootStatus();
163  }
166  CPixieSystemUtilities* utils
167  )
168  {
169  return utils->GetNumModules();
170  }
173  CPixieSystemUtilities* utils, int mod
174  )
175  {
176  return utils->GetModuleMSPS(mod);
177  }
178 
181  {
182  if(utils) {
183  delete utils;
184  utils = nullptr;
185  }
186  };
187 }
188 
189 #endif
int CPixieSystemUtilities_GetBootMode(CPixieSystemUtilities *utils)
Wrapper to get the boot mode.
Definition: CPixieSystemUtilities.h:155
void CPixieSystemUtilities_delete(CPixieSystemUtilities *utils)
Wrapper for the class destructor.
Definition: CPixieSystemUtilities.h:180
bool CPixieSystemUtilities_GetBootStatus(CPixieSystemUtilities *utils)
Wrapper to get the boot status.
Definition: CPixieSystemUtilities.h:160
int CPixieSystemUtilities_SaveSetFile(CPixieSystemUtilities *utils, char *fName)
Wrapper to save a settings file.
Definition: CPixieSystemUtilities.h:128
int CPixieSystemUtilities_ExitSystem(CPixieSystemUtilities *utils)
Wrapper to exit the system file.
Definition: CPixieSystemUtilities.h:142
unsigned short CPixieSystemUtilities_GetNumModules(CPixieSystemUtilities *utils)
Wrapper to get the number of modules.
Definition: CPixieSystemUtilities.h:165
int CPixieSystemUtilities_LoadSetFile(CPixieSystemUtilities *utils, char *fName)
Wrapper to load a settings file.
Definition: CPixieSystemUtilities.h:135
int CPixieSystemUtilities_GetModuleMSPS(CPixieSystemUtilities *utils, int mod)
Wrapper to get a single module ADC MSPS from the HW map.
Definition: CPixieSystemUtilities.h:172
int CPixieSystemUtilities_Boot(CPixieSystemUtilities *utils)
Wrapper to boot the crate.
Definition: CPixieSystemUtilities.h:123
CPixieSystemUtilities * CPixieSystemUtilities_new()
Wrapper for the class constructor.
Definition: CPixieSystemUtilities.h:117
void CPixieSystemUtilities_SetBootMode(CPixieSystemUtilities *utils, int mode)
Wrapper to set the boot mode.
Definition: CPixieSystemUtilities.h:148
Defines a class for storing system configuration information.
System manager class for DDAS.
Definition: CPixieSystemUtilities.h:30
bool GetBootStatus()
Get the crate boot status.
Definition: CPixieSystemUtilities.h:97
int GetBootMode()
Get the boot mode.
Definition: CPixieSystemUtilities.h:90
int GetModuleMSPS(int module)
Get the module ADC sampling rate in MSPS.
Definition: CPixieSystemUtilities.cpp:221
int LoadSetFile(char *fileName)
Load a new settings file.
Definition: CPixieSystemUtilities.cpp:152
int ExitSystem()
Exit the system and release resources from the modules.
Definition: CPixieSystemUtilities.cpp:192
CPixieSystemUtilities()
Constructor.
Definition: CPixieSystemUtilities.cpp:25
unsigned short GetNumModules()
Get the number of installed modules.
Definition: CPixieSystemUtilities.h:102
int SaveSetFile(char *fileName)
Save the currently loaded DSP settings to a settings file.
Definition: CPixieSystemUtilities.cpp:122
void SetBootMode(int mode)
Set the boot mode.
Definition: CPixieSystemUtilities.h:82
int Boot()
Boot the entire system.
Definition: CPixieSystemUtilities.cpp:35
Store the system configuration information needed by Readout.
Definition: Configuration.h:81