Scope
ScopeDatatypes.h
Go to the documentation of this file.
1 #pragma once
2 #include "ScopeDefines.h"
3 
7 namespace scope {
8 
12 enum ControllerReturnStatus {
13  none = 0x0,
14  stopped = 0x01,
15  finished = 0x02,
16  error = 0x04
17 };
18 
20 enum FPUMoveDirection {
21  left,
22  right,
23  up,
24  down
25 };
26 
27 
30 template<class T>
31 class ScopeDatatypeBase {
32 public:
34  typename T::Mode t;
35 
36 public:
38  static std::wstring NameOf(const typename T::Mode& _t) { return T::NameOf(_t); }
39 
41  static std::wstring NameOf(const uint32_t& _n) { return T::NameOf(_n); }
42 
43 
45  : t(T::Mode(0)) { }
46 
48  ScopeDatatypeBase(const typename T::Mode& _t)
49  : t(_t) { }
50 
52  ScopeDatatypeBase(const std::wstring& _str)
53  : t(T::Mode(0)) {
54  for ( uint32_t s = 0 ; s < T::S ; s++ ) {
55  if ( _str == T::NameOf(s) ) {
56  t = T::Mode(s);
57  break;
58  }
59  }
60  }
61 
64  ScopeDatatypeBase& operator=(const typename T::Mode& _t) { t = _t; return *this; }
65  bool operator==(const ScopeDatatypeBase& _sdb) const { return t == static_cast<typename T::Mode>(_sdb); }
66  bool operator==(const typename T::Mode& _t) const { return t == _t; }
67  bool operator!=(const ScopeDatatypeBase& _sdb) const { return !(operator==(_sdb)); }
68  bool operator!=(const typename T::Mode& _t) const { return !(operator==(_t)); }
69  bool operator<(const ScopeDatatypeBase& _sdb) const { return t < static_cast<typename T::Mode>(_sdb); }
70  bool operator>(const ScopeDatatypeBase& _sdb) const { return t > static_cast<typename T::Mode>(_sdb); }
71  operator typename T::Mode() const { return t; }
72  operator uint32_t() const { return static_cast<uint32_t>(t); }
73  operator std::wstring() const { return T::NameOf(t); }
75 };
76 
79 public:
81  enum Mode {
82  ZStage,
83  FastZ
84  };
85 
87  static const uint32_t S = 2;
88 
90  static std::wstring NameOf(const uint32_t& _n) {
91  static std::array<std::wstring, S> names = { L"ZStage", L"FastZ" };
92  return names[_n];
93  }
94 };
95 
97 typedef ScopeDatatypeBase<ZDeviceHelper> ZDevice;
98 
99 
102 public:
104  enum Mode {
105  Gated
106  };
107 
109  static const uint32_t S = 1;
110 
112  static std::wstring NameOf(const uint32_t& _n) {
113  static std::array<std::wstring, S> names = { L"Gated" };
114  return names[_n];
115  }
116 };
117 
119 typedef ScopeDatatypeBase<BehaviorModeHelper> BehaviorMode;
120 
121 
124 public:
126  enum Mode {
127  OnboardClock,
128  ReferenceClock,
129  External
130  };
131 
133  static const uint32_t S = 3;
134 
136  static std::wstring NameOf(const uint32_t& _n) {
137  static std::array<std::wstring, S> names = { L"OnboardClock", L"ReferenceClock", L"External" };
138  return names[_n];
139  }
140 };
141 
143 typedef ScopeDatatypeBase<DaqTimingHelper> DaqTiming;
144 
145 
150 public:
152  enum Mode {
153  full,
154  firsthalf,
155  secondhalf,
156  first4096
157  };
158 
160  static const uint32_t S = 4;
161 
163  static std::wstring NameOf(const uint32_t& _n) {
164  static std::array<std::wstring, S> names = { L"full", L"firsthalf", L"secondhalf", L"first4096" };
165  return names[_n];
166  }
167 };
168 
172 typedef ScopeDatatypeBase<Uint16RangeHelper> Uint16Range;
173 
174 
177 uint16_t Uint16LowerBoundary(const Uint16Range& r);
178 uint16_t Uint16UpperBoundary(const Uint16Range& r);
183 public:
185  enum Mode {
186  OutputsDAQmx,
190  };
191 
193  static const uint32_t S = 4;
194 
196  static std::wstring NameOf(const uint32_t& _n) {
197  static std::array<std::wstring, S> names = { L"OutputsDAQmx", L"OutputsDAQmxLineClock", L"OutputsDAQmxSlave", L"OutputsDAQmxResonance" };
198  return names[_n];
199  }
200 };
201 
203 typedef ScopeDatatypeBase<OutputsTypeHelper> OutputsType;
204 
205 
208 public:
210  enum Mode {
211  InputsDAQmx,
212  InputsFPGA,
213  InputsFPGAIO6587,
214  InputsFPGADigitalDemultiplexer,
215  InputsFPGAPhotonCounter,
216  InputsFPGAIO5771,
217  InputsFPGAIO5751,
218  InputsFPGAAnalogDemultiplexer,
219  InputsFPGAAnalogIntegrator,
220  InputsFPGAResonanceScanner
221  };
222 
224  static const uint32_t S = 10;
225 
227  static std::wstring NameOf(const uint32_t& _n) {
228  static std::array<std::wstring, S> names =
229  { L"InputsDAQmx"
230  , L"InputsFPGA"
231  , L"InputsFPGAIO6587"
232  , L"InputsFPGADigitalDemultiplexer"
233  , L"InputsFPGAPhotonCounter"
234  , L"InputsFPGAIO5771"
235  , L"InputsFPGAIO5751"
236  , L"InputsFPGAAnalogDemultiplexer"
237  , L"InputsFPGAAnalogIntegrator"
238  , L"InputsFPGAResonanceScanner" };
239  return names[_n];
240  }
241 };
242 
244 typedef ScopeDatatypeBase<InputsTypeHelper> InputsType;
245 
246 
249 public:
251  enum Mode {
252  Regular,
253  Resonance,
254  AOD,
255  Fiber
256  };
257 
259  static const uint32_t S = 4;
260 
262  static std::wstring NameOf(const uint32_t& _n) {
263  static std::array<std::wstring, S> names =
264  { L"Regular"
265  , L"Resonance"
266  , L"AOD"
267  , L"Fiber" };
268  return names[_n];
269  }
270 };
271 
273 typedef ScopeDatatypeBase<ScannerTypeHelper> ScannerType;
274 
277 public:
279  enum Mode {
280  Basic,
281  Sawtooth,
282  Bidirectional,
283  Planehopper,
284  LineStraight,
285  ResonanceBiDi,
286  ResonanceHopper
287  };
288 
290  static const uint32_t S = 7;
291 
293  static std::wstring NameOf(const uint32_t& _n) {
294  static std::array<std::wstring, S> names =
295  { L"Basic"
296  , L"Sawtooth"
297  , L"Bidirectional"
298  , L"Planehopper"
299  , L"LineStraight"
300  , L"ResonanceBiDi"
301  , L"ResonanceHopper" };
302  return names[_n];
303  }
304 };
305 
307 typedef ScopeDatatypeBase<ScannerVectorTypeHelper> ScannerVectorType;
308 
309 
312 public:
314  static std::vector<ScannerVectorTypeHelper::Mode> List(const ScannerTypeHelper::Mode& _scannertype = SCOPE_SCANNERTYPE);
315 
317  static bool IsSupported(const ScannerVectorTypeHelper::Mode& _scanmode, const ScannerTypeHelper::Mode& _scannertype = SCOPE_SCANNERTYPE);
318 
320  static bool IsBuiltinSupported(const ScannerVectorTypeHelper::Mode& _scanmode);
321 };
322 
323 
329 public:
331  enum Mode {
332  FullframeXYZP,
333  LineXPColumnYZ,
334  LineZP
335  };
336 
338  static const uint32_t S = 3;
339 
341  static std::wstring NameOf(const uint32_t& _n) {
342  static std::array<std::wstring, S> names = { L"FullframeXYZP", L"LineXPColumnYZ", L"LineZP" };
343  return names[_n];
344  }
345 };
346 
351 typedef ScopeDatatypeBase<ScannerVectorFillTypeHelper> ScannerVectorFillType;
352 
353 
356 public:
358  enum Mode {
359  Stopped,
360  RunningContinuous,
361  RunningSingle,
362  RunningStack,
363  RunningTimeseries,
364  RunningBehavior
365  };
366 
368  static const uint32_t S = 6;
369 
371  static std::wstring NameOf(const uint32_t& _n) {
372  static std::array<std::wstring, S> names = { L"Stopped", L"RunningContinuous", L"RunningSingle", L"RunningStack", L"RunningTimeseries", L"RunningBehavior" };
373  return names[_n];
374  }
375 };
376 
378 typedef ScopeDatatypeBase<RunStateHelper> RunState;
379 
380 
383 public:
385  enum Mode {
386  continuous,
387  nframes
388  };
389 
391  static const uint32_t S = 2;
392 
394  static std::wstring NameOf(const uint32_t& _n) {
395  static std::array<std::wstring, S> names = { L"continuous", L"nframes" };
396  return names[_n];
397  }
398 };
399 
401 typedef ScopeDatatypeBase<DaqModeHelper> DaqMode;
402 
406 public:
408  enum Mode {
409  SimultaneousSampling,
410  NonSimultaneousSampling
411  };
412 
414  static const uint32_t S = 2;
415 
417  static std::wstring NameOf(const uint32_t& _n) {
418  static std::array<std::wstring, S> names = { L"SimultaneousSampling", L"NonSimultaneousSampling" };
419  return names[_n];
420  }
421 };
422 
425 typedef ScopeDatatypeBase<DaqSamplingHelper> DaqSampling;
426 
427 
428 }
static const uint32_t S
Number of enumerators.
Wraps hardware connection for signal output to fast z control and pockels cell (for a slave area with...
static bool IsSupported(const ScannerVectorTypeHelper::Mode &_scanmode, const ScannerTypeHelper::Mode &_scannertype=SCOPE_SCANNERTYPE)
Returns true if a given scannervector/scanmode is supported by a given scannertypeDefault scannertype...
Describes the scanner vector types that are supported for a given scanner type.
static std::wstring NameOf(const uint32_t &_n)
Wraps hardware connection for signal input from PMTs using an NI FPGA.
Definition: InputsFPGA.h:24
static const uint32_t S
Number of enumerators.
static std::wstring NameOf(const uint32_t &_n)
static std::wstring NameOf(const typename T::Mode &_t)
static std::wstring NameOf(const uint32_t &_n)
Mode
Enum for the mode of scanning/acquisition, either continuous or a certain number of frames...
ScopeDatatypeBase(const std::wstring &_str)
Construct from string.
Describes the scanner vector fill type for different parameters::Outputs types :
static std::wstring NameOf(const uint32_t &_n)
static const uint32_t S
Number of enumerators.
Mode
The different types of scanner vector fill types.
Describes the type of scanner.
Mode
The different types of scans.
ScopeDatatypeBase(const typename T::Mode &_t)
Construct from enumerators.
static bool IsBuiltinSupported(const ScannerVectorTypeHelper::Mode &_scanmode)
Returns true if a given scannervector/scanmode is supported by the builtin/hardcoded (see ScopeDefine...
Wraps hardware connection for signal output to scanners, fast z control, and pockels cell with NI-DAQ...
static const uint32_t S
Number of enumerators.
Base class for all Scope datatypes here, provides a uniform interface (and saves typing...).
static const uint32_t S
Number of enumerators.
static const uint32_t S
Number of enumerators.
static const uint32_t S
Number of enumerators.
Wraps hardware connection for signal output to scanners, fast z control, and pockels cell with NI-DAQ...
Definition: OutputsDAQmx.h:18
Mode
The different types of inputs.
static std::wstring NameOf(const uint32_t &_n)
static const uint32_t S
Number of enumerators.
T::Mode t
the enum from the template class
static std::wstring NameOf(const uint32_t &_n)
Describes the data acquisiton mode.
Describes the type of signals output to scanners/fast z/Pockels.
How does the animal behavior trigger/gate acquisition?
Mode
Enum for the acquisition sampling type (either simultaneous or not)
static std::wstring NameOf(const uint32_t &_n)
static const uint32_t S
Number of enumerators.
static std::wstring NameOf(const uint32_t &_n)
Wraps hardware connection for signal output to scanners, fast z control, and pockels cell with NI-DAQ...
The type of z control device that is used for a stack.
static std::wstring NameOf(const uint32_t &_n)
static std::wstring NameOf(const uint32_t &_n)
Mode
The different types of scanners.
static std::wstring NameOf(const uint32_t &_n)
static std::wstring NameOf(const uint32_t &_n)
Enum for the usable data input range.
Describes the scanner vector type.
Describes the type of signal input from PMTs.
Sampling method (depending on card etc), either simultaneous (clock independent of channel number) or...
Mode
The different types of outputs.
Wraps hardware connection for signal input from PMTs with NI-DAQmx.
Definition: InputsDAQmx.h:20
Class for the DAQmx timing, either by onboard clock, through a reference clock or by an external cloc...
Mode
Enum for the run state of the scope, stopped, continuously scanning, single scan, stack scan...
static const uint32_t S
Number of enumerators.
static const uint32_t S
Number of enumerators.
Describes the actual state of the scope.
static const uint32_t S
Number of enumerators.
static std::vector< ScannerVectorTypeHelper::Mode > List(const ScannerTypeHelper::Mode &_scannertype=SCOPE_SCANNERTYPE)
Returns a vector with all supported scannervectors for a given scannertype.
static std::wstring NameOf(const uint32_t &_n)