THM1176InstrumentManager  1.0
Qt Object abstraction for Metrolab THM1176
THM1176Types.h
Go to the documentation of this file.
1 // Copyright (c) 2020 Metrolab Technology S.A., Geneva, Switzerland (www.metrolab.com)
2 // See the included file LICENSE.txt for the licensing conditions.
3 
7 
8 #pragma once
9 
10 // Standard includes
11 #include <string>
12 #include <vector>
13 #include <cmath>
14 #include <ctime>
15 
16 // Personal includes
17 #include "OSDefines.h"
18 #include "IEEE488InstrumentTypes.h"
19 
20 namespace MTL
21 {
22 namespace Instrument
23 {
24 namespace THM1176Types
25 {
26 
27 //----------------------------------------------------------------------//
28 // Basic Types //
29 //----------------------------------------------------------------------//
30 typedef F32 tFlux;
31 
32 //----------------------------------------------------------------------//
33 // Status //
34 //----------------------------------------------------------------------//
37 {
42 };
45 {
49 };
52 {
55 
56 public:
61  : Set(S), Type(T)
62  { }
63 };
65 class RegisterList : public std::vector<sStatusRegister>
66 {
67 };
75 class StatusValues : public std::vector<U16>
76 {
77 };
78 
81 {
83  U16 RawSTB = 0;
84 
86  struct sStatusByte
87  {
88  // Contains a 1-byte status summary. The THM1176 uses the following bits:
89  U8 NA0_1 : 2;
90  U8 EAV : 1;
91  U8 QSB : 1;
92  U8 MAV : 1;
93  U8 ESB : 1;
94  U8 RQS : 1;
95  U8 OSB : 1;
97 };
100 {
102  U16 RawSE = 0;
103 
106  {
107  // Latches certain standardized events. The THM1176 uses the following bits:
109  U8 NA1 : 1;
114  U8 NA6 : 1;
115  U8 PowerOn : 1;
117 };
120 {
123 
125  struct sOPERation
126  {
127  // Captures conditions which are part of the instrument's normal operation. The THM1176 uses the following bits:
129  U16 NA1 : 1;
130  U16 RANGing : 1;
131  U16 NA3 : 1;
134  U16 NA6_15 : 10;
136 };
139 {
142 
145  {
146  // Indicates conditions that may reduce the quality of the measurement. The THM1176 sets the following bits:
147  U16 NA0_4 : 5;
149  U16 NA6_8 : 3;
151  U16 NA10_15 : 6;
153 };
154 
155 std::ostream & operator<<(std::ostream & Stream, const eStatusRegisterSet & RegSet);
156 std::ostream & operator<<(std::ostream & Stream, const eStatusRegisterType & RegType);
157 std::ostream & operator<<(std::ostream & Stream, const sStatusRegister & RegDef);
158 std::ostream & operator<<(std::ostream & Stream, const RegisterList & RegList);
159 std::ostream & operator<<(std::ostream & Stream, const StatusValues & StatusList);
160 std::ostream & operator<<(std::ostream & Stream, const uStatusByte & StatusByte);
161 std::ostream & operator<<(std::ostream & Stream, const uStandardEvent & StdEventReg);
162 std::ostream & operator<<(std::ostream & Stream, const uOPERation & OperReg);
163 std::ostream & operator<<(std::ostream & Stream, const uQUEStionable & QuestReg);
164 
165 //----------------------------------------------------------------------//
166 // Flux //
167 //----------------------------------------------------------------------//
169 class CFluxList : public std::vector<tFlux>
170 {
171 };
172 std::ostream & operator<<(std::ostream & Stream, const CFluxList & FluxList);
173 
174 //----------------------------------------------------------------------//
175 // Units //
176 //----------------------------------------------------------------------//
181 enum eUnits
182 {
183  kT,
184  kmT,
185  kuT,
186  knT,
190  kMHzp
191 };
193 class CUnitsList : public std::vector<eUnits>
194 {
195 };
202 class CDivisorList : public std::vector<U32>
203 {
204 };
205 std::ostream & operator<<(std::ostream & Stream, const eUnits & Units);
206 std::ostream & operator<<(std::ostream & Stream, const CUnitsList & UnitsList);
207 std::ostream & operator<<(std::ostream & Stream, const CDivisorList & DivisorList);
208 
209 //----------------------------------------------------------------------//
210 // Errors //
211 //----------------------------------------------------------------------//
213 struct sError
214 {
216  std::string Description;
217  std::string Context;
218 
219 public:
224  sError(I32 Code = 0, std::string Description = "", std::string Context = "")
226  { }
227  bool operator==(sError other) const;
228  bool operator!=(sError other) const;
229 };
231 class CErrorList : public std::vector<sError>
232 {
233 };
234 std::ostream & operator<<(std::ostream & Stream, const sError & Error);
235 std::ostream & operator<<(std::ostream & Stream, const CErrorList & ErrorList);
236 
237 //----------------------------------------------------------------------//
238 // Parameters //
239 //----------------------------------------------------------------------//
240 //------------------------------------------//
241 // Generic
244 template <class DataType>
246 {
247  DataType Val{};
248  DataType Min{};
249  DataType Max{};
250  DataType Def{};
251 
252 public:
258  sBoundedParm(DataType Val = 0, DataType Min = 0, DataType Max = 0, DataType Def = 0)
259  : Val(Val), Min(Min), Max(Max), Def(Def)
260  { }
261  void clear(void)
262  {
263  Val = { };
264  Min = { };
265  Max = { };
266  Def = { };
267  }
268  bool operator==(sBoundedParm other) const
269  {
270  return (
271  Val == other.Val &&
272  Min == other.Min &&
273  Max == other.Max &&
274  Def == other.Def
275  );
276  }
277  bool operator!=(sBoundedParm other) const
278  {
279  return (!operator==(other));
280  }
281  sBoundedParm & operator=(const DataType & scalar)
282  {
283  Val = scalar;
284  Min = scalar;
285  Max = scalar;
286  Def = scalar;
287  return *this;
288  }
289 };
290 
293 template <class DataType>
294 using uParm = DataType;
295 
302 template <template<class> class ParmType>
303 struct sExample
304 {
306  ParmType<F64> ExampleF64;
307  ParmType<F32> ExampleF32;
308 };
309 
310 //------------------------------------------//
311 // Version
313 struct sVersion
314 {
315  U8 Major = 0;
316  U8 Minor = 0;
317  std::string Name = "";
318 
319 public:
323  sVersion(U8 Maj = 0, U8 Min = 0)
324  : Major(Maj), Minor(Min)
325  { }
326  void clear(void);
327  bool operator==(sVersion other) const;
328  bool operator!=(sVersion other) const;
329 };
330 std::ostream & operator<<(std::ostream & Stream, const sVersion & Version);
331 
332 //------------------------------------------//
333 // Identifier
336 {
337  std::string Manufacturer;
338  std::string Model;
341  struct sVersion ProbeVersion;
342  struct sVersion FirmwareVersion;
343 
344 public:
352  sIdentifier(std::string Mfr = "", std::string Mdl = "", U32 SN = 0, struct sVersion EVsn = { }, struct sVersion PVsn = { }, struct sVersion FVsn = { })
353  : Manufacturer(Mfr), Model(Mdl), SerialNumber(SN), ElectronicsVersion(EVsn), ProbeVersion(PVsn), FirmwareVersion(FVsn)
354  { }
355  void clear(void);
356  bool operator==(sIdentifier other) const;
357  bool operator!=(sIdentifier other) const;
358 };
359 std::ostream & operator<<(std::ostream & Stream, const sIdentifier & ID);
360 
361 //------------------------------------------//
362 // Averaging
365 template <template<class> class ParmType>
367 {
368  ParmType<U16> NoPoints{};
369 
370 public:
373  sAveraging(ParmType<U16> NPts = { })
374  : NoPoints(NPts)
375  { }
376  void clear(void)
377  {
378  NoPoints = { };
379  }
380  bool operator==(sAveraging other) const
381  {
382  return (NoPoints == other.NoPoints);
383  }
384  bool operator!=(sAveraging other) const
385  {
386  return (!operator==(other));
387  }
388 };
389 std::ostream & operator<<(std::ostream & Stream, const sAveraging<uParm> & AvgParm);
390 std::ostream & operator<<(std::ostream & Stream, const sAveraging<sBoundedParm> & AvgParm);
391 
392 //------------------------------------------//
393 // Input Trigger
396 {
400 };
403 template <template<class> class ParmType>
405 {
407  ParmType<F64> Period_s{ };
408  ParmType<U16> Count{ };
409 
410 public:
415  sInputTrigger(eInputTriggerSource Src = { }, ParmType<F64> Per = { }, ParmType<U16> Cnt = { })
416  : Source(Src), Period_s(Per), Count(Cnt)
417  { }
418  void clear(void)
419  {
420  Source = { };
421  Period_s = { };
422  Count = { };
423  }
424  bool operator==(sInputTrigger other) const
425  {
426  return (
427  Source == other.Source &&
428  Period_s == other.Period_s &&
429  Count == other.Count
430  );
431  }
432  bool operator!=(sInputTrigger other) const
433  {
434  return (!operator==(other));
435  }
436 };
437 std::ostream & operator<<(std::ostream & Stream, const eInputTriggerSource & TrgSrc);
438 std::ostream & operator<<(std::ostream & Stream, const sInputTrigger<uParm> & TrigParm);
439 std::ostream & operator<<(std::ostream & Stream, const sInputTrigger<sBoundedParm> & TrigParm);
440 
441 //------------------------------------------//
442 // Format
445 {
450 };
451 std::ostream & operator<<(std::ostream & Stream, const eCommunicationFormat & CommFormat);
452 
453 //------------------------------------------//
454 // Range
456 template <template<class> class ParmType>
457 struct sRange
458 {
459  bool Auto{ };
460  ParmType<tFlux> Range{ };
461 
462 public:
466  sRange(bool A = { }, ParmType<tFlux> R = { })
467  : Auto(A), Range(R)
468  { }
469  void clear(void)
470  {
471  Auto = { };
472  Range = { };
473  }
474  bool operator==(sRange other) const
475  {
476  return (
477  Auto == other.Auto &&
478  Range == other.Range
479  );
480  }
481  bool operator!=(sRange other) const
482  {
483  return (!operator==(other));
484  }
485 };
486 std::ostream & operator<<(std::ostream & Stream, const sRange<uParm> & RangeParm);
487 std::ostream & operator<<(std::ostream & Stream, const sRange<sBoundedParm> & RangeParm);
488 
489 //------------------------------------------//
490 // Files
492 struct sFile
493 {
494  size_t Size = 0;
495  std::string Path;
496  std::string Type;
497 
498 public:
503  sFile(size_t S = 0, std::string P = "", std::string T = "")
504  : Size(S), Path(P), Type(T)
505  { }
506  void clear();
507  bool operator==(sFile other) const;
508  bool operator!=(sFile other) const;
509 };
511 typedef std::vector<sFile> tFileList;
512 
513 std::ostream & operator<<(std::ostream & Stream, const sFile & FileInfo);
514 std::ostream & operator<<(std::ostream & Stream, const tFileList & FileList);
515 
516 //----------------------------------------------------------------------//
517 // Time stamp //
518 //----------------------------------------------------------------------//
530 {
531 private:
532  std::time_t s = 0;
533  U64 ns = 0;
534 
535 public:
536  static const U64 NS_PER_SEC = 1000000000;
537  CAbsoluteTimestamp(std::time_t Seconds = 0, U64 Nanoseconds = 0);
542  bool operator==(CAbsoluteTimestamp other);
543  bool operator!=(CAbsoluteTimestamp other);
544  std::time_t seconds(void) const;
545  U64 nanoseconds(void) const;
546  void clear(void);
547 };
548 
551 std::ostream & operator<<(std::ostream & Stream, const CAbsoluteTimestamp & Timestamp);
552 
554 class CTimestampList : public std::vector<U64>
555 {
556 public:
563  bool GetEstimatedPeriod(F64 & Period);
564 };
565 std::ostream & operator<<(std::ostream & Stream, const CTimestampList & TimestampList);
566 
567 //----------------------------------------------------------------------//
568 // Measurements //
569 //----------------------------------------------------------------------//
572 {
573  bool Bx = false;
574  bool By = false;
575  bool Bz = false;
576  bool Temperature = false;
577  bool Timestamp = false;
579 
580 public:
588  sArbitraryMeasurements(bool Bx = false, bool By = false, bool Bz = false, bool Temp = false, bool Time = false, U32 NMeas = 0)
589  : Bx(Bx), By(By), Bz(Bz), Temperature(Temp), Timestamp(Time), NoMeasurements(NMeas)
590  { }
591  void clear();
592  bool operator==(sArbitraryMeasurements other) const;
593  bool operator!=(sArbitraryMeasurements other) const;
594 };
595 
598 {
601  bool UseCalibration = false;
602 
603 public:
608  sMeasurementConditions(sAveraging<uParm> AvgParms = { }, sInputTrigger<uParm> TrigParms= { }, bool UseCal = false)
609  : AveragingParms(AvgParms), TriggerParms(TrigParms), UseCalibration(UseCal)
610  { }
611  void clear();
612  bool operator==(sMeasurementConditions other) const;
613  bool operator!=(sMeasurementConditions other) const;
614 };
615 
616 std::ostream & operator<<(std::ostream & Stream, const sArbitraryMeasurements & MeasSpec);
617 std::ostream & operator<<(std::ostream & Stream, const sMeasurementConditions & MeasCond);
618 
619 } // namespace THM1176Types
620 } // namespace Instrument
621 } // namespace MTL
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent::PowerOn
U8 PowerOn
THM1176 has been powered up.
Definition: THM1176Types.h:115
MTL::Instrument::THM1176Types::uOPERation::sOPERation::NA1
U16 NA1
Not Available.
Definition: THM1176Types.h:129
MTL::Instrument::THM1176Types::sMeasurementConditions::UseCalibration
bool UseCalibration
Use calibration data.
Definition: THM1176Types.h:601
MTL::Instrument::THM1176Types::sError::sError
sError(I32 Code=0, std::string Description="", std::string Context="")
Constructor.
Definition: THM1176Types.h:224
MTL::Instrument::THM1176Types::kInputTrigSrcBus
@ kInputTrigSrcBus
Bus trigger: start measurement upon USB trigger message.
Definition: THM1176Types.h:399
MTL::Instrument::THM1176Types::uStatusByte
Union to access the Status Byte as integer or bit fields.
Definition: THM1176Types.h:81
MTL::Instrument::THM1176Types::sFile::Type
std::string Type
File type ("ASCII" or "BINARY").
Definition: THM1176Types.h:496
MTL::Instrument::THM1176Types::sStatusRegister::Type
eStatusRegisterType Type
SCPI register type.
Definition: THM1176Types.h:54
MTL::Instrument::THM1176Types::RegisterList
List of SCPI status registers.
Definition: THM1176Types.h:66
MTL::Instrument::THM1176Types::sVersion::Name
std::string Name
Version name.
Definition: THM1176Types.h:317
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent::QueryError
U8 QueryError
Error in preceding query.
Definition: THM1176Types.h:110
MTL::Instrument::THM1176Types::sRange::Range
ParmType< tFlux > Range
Measurement range, if auto-ranging is not enabled.
Definition: THM1176Types.h:460
IEEE488InstrumentTypes.h
Abstract IEEE488 instrument class: type definitions.
MTL::Instrument::THM1176Types::sInputTrigger::Period_s
ParmType< F64 > Period_s
Trigger period, for timed trigger.
Definition: THM1176Types.h:407
MTL::Instrument::THM1176Types::kStatusOperationStatusRegister
@ kStatusOperationStatusRegister
Operation Status Register.
Definition: THM1176Types.h:41
MTL::Instrument::THM1176Types::sAveraging::operator==
bool operator==(sAveraging other) const
Equality operator.
Definition: THM1176Types.h:380
MTL::Instrument::THM1176Types::kuT
@ kuT
Micro-Tesla.
Definition: THM1176Types.h:185
MTL::Instrument::THM1176Types::sInputTrigger::operator!=
bool operator!=(sInputTrigger other) const
Inequality operator.
Definition: THM1176Types.h:432
MTL::Instrument::THM1176Types::eStatusRegisterSet
eStatusRegisterSet
Enumeration of SCPI status register sets.
Definition: THM1176Types.h:37
MTL::Instrument::THM1176Types::eUnits
eUnits
Enumeration of possible measurement units.
Definition: THM1176Types.h:182
MTL::Instrument::THM1176Types::kStatusCondition
@ kStatusCondition
Condition register.
Definition: THM1176Types.h:47
MTL::Instrument::THM1176Types::sMeasurementConditions::clear
void clear()
Clear to default values.
Definition: THM1176Types.cpp:504
F32
float F32
32-bit floating-point number.
Definition: OSDefines.h:34
MTL::Instrument::THM1176Types::sMeasurementConditions::AveragingParms
sAveraging< uParm > AveragingParms
Averaging parameters.
Definition: THM1176Types.h:599
MTL::Instrument::THM1176Types::kStatusEnable
@ kStatusEnable
Enable register.
Definition: THM1176Types.h:48
MTL::Instrument::THM1176Types::sFile::operator!=
bool operator!=(sFile other) const
Inequality operator.
Definition: THM1176Types.cpp:320
MTL::Instrument::THM1176Types::uStandardEvent::StandardEvent
struct MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent StandardEvent
Access the Standard Event Status Register as bit fields.
U64
unsigned long long U64
64-bit unsigned integer.
Definition: OSDefines.h:33
MTL::Instrument::THM1176Types::sArbitraryMeasurements::operator!=
bool operator!=(sArbitraryMeasurements other) const
Inequality operator.
Definition: THM1176Types.cpp:499
MTL::Instrument::THM1176Types::sAveraging::operator!=
bool operator!=(sAveraging other) const
Inequality operator.
Definition: THM1176Types.h:384
MTL::Instrument::THM1176Types::uStatusByte::sStatusByte::OSB
U8 OSB
OPERation status summary bit.
Definition: THM1176Types.h:95
MTL::Instrument::THM1176Types::uParm
DataType uParm
Parameter template, with only current value.
Definition: THM1176Types.h:294
MTL::Instrument::THM1176Types::eStatusRegisterType
eStatusRegisterType
Enumeration of SCPI status register types.
Definition: THM1176Types.h:45
MTL::Instrument::THM1176Types::uQUEStionable::sQUEStionable::NA0_4
U16 NA0_4
Not Available.
Definition: THM1176Types.h:147
MTL::Instrument::THM1176Types::uOPERation::RawOPER
U16 RawOPER
Access the Operation Status Register as unsigned integer.
Definition: THM1176Types.h:122
MTL::Instrument::THM1176Types::sVersion::operator!=
bool operator!=(sVersion other) const
Inequality operator.
Definition: THM1176Types.cpp:185
MTL::Instrument::THM1176Types::uQUEStionable::sQUEStionable::NA10_15
U16 NA10_15
Not Available.
Definition: THM1176Types.h:151
MTL::Instrument::THM1176Types::uStatusByte::StatusByte
struct MTL::Instrument::THM1176Types::uStatusByte::sStatusByte StatusByte
Access the Status Byte as bit fields.
MTL::Instrument::THM1176Types::sArbitraryMeasurements
Specify the measurement data to be returned.
Definition: THM1176Types.h:572
MTL::Instrument::THM1176Types::sBoundedParm::operator==
bool operator==(sBoundedParm other) const
Equality operator.
Definition: THM1176Types.h:268
MTL::Instrument::THM1176Types::kGauss
@ kGauss
Gauss.
Definition: THM1176Types.h:187
MTL::Instrument::THM1176Types::sBoundedParm
Parameter template, with current/min/max/default values.
Definition: THM1176Types.h:246
MTL::Instrument::THM1176Types::CTimestampList::GetEstimatedPeriod
bool GetEstimatedPeriod(F64 &Period)
Estimate the measurement period from this timestamp list, by means of a least-squares fit.
Definition: THM1176Types.cpp:424
MTL::Instrument::THM1176Types::sMeasurementConditions
Summary of the parameters used to make a measurement.
Definition: THM1176Types.h:598
MTL::Instrument::THM1176Types::sBoundedParm::Min
DataType Min
Lower bound.
Definition: THM1176Types.h:248
MTL::Instrument::THM1176Types::uStatusByte::sStatusByte::NA0_1
U8 NA0_1
Not Available.
Definition: THM1176Types.h:89
MTL::Instrument::THM1176Types::sAveraging::clear
void clear(void)
Clear to default (zero).
Definition: THM1176Types.h:376
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent::ExecutionError
U8 ExecutionError
Error detected during command execution.
Definition: THM1176Types.h:112
MTL::Instrument::THM1176Types::sIdentifier::sIdentifier
sIdentifier(std::string Mfr="", std::string Mdl="", U32 SN=0, struct sVersion EVsn={ }, struct sVersion PVsn={ }, struct sVersion FVsn={ })
Constructor.
Definition: THM1176Types.h:352
MTL::Instrument::THM1176Types::sVersion::sVersion
sVersion(U8 Maj=0, U8 Min=0)
Constructor.
Definition: THM1176Types.h:323
MTL::Instrument::THM1176Types::sVersion::clear
void clear(void)
Clear to default (zeroes).
Definition: THM1176Types.cpp:174
MTL::Instrument::THM1176Types::uOPERation::sOPERation::NA6_15
U16 NA6_15
Not Available.
Definition: THM1176Types.h:134
MTL::Instrument::THM1176Types::sError::Description
std::string Description
Error description.
Definition: THM1176Types.h:216
MTL::Instrument::THM1176Types::uQUEStionable::sQUEStionable::Frequency
U16 Frequency
Acquisition buffer or the timed trigger has been overrun.
Definition: THM1176Types.h:148
MTL::Instrument::THM1176Types::sRange
Measurement range parameter.
Definition: THM1176Types.h:458
MTL::Instrument::THM1176Types::uStatusByte::sStatusByte::ESB
U8 ESB
Standard Event Status Register summary bit.
Definition: THM1176Types.h:93
MTL::Instrument::THM1176Types::sExample
Sample parameter template.
Definition: THM1176Types.h:304
MTL::Instrument::THM1176Types::sFile::Path
std::string Path
File path.
Definition: THM1176Types.h:495
MTL::Instrument::THM1176Types::sExample::ExampleF32
ParmType< F32 > ExampleF32
Example of an F32 element.
Definition: THM1176Types.h:307
MTL::Instrument::THM1176Types::sBoundedParm::Max
DataType Max
Upper bound.
Definition: THM1176Types.h:249
MTL::Instrument::THM1176Types::kComFormatAscii
@ kComFormatAscii
Human-legible text.
Definition: THM1176Types.h:446
MTL::Instrument::THM1176Types::uQUEStionable::RawQUES
U16 RawQUES
Access the Questionable Status Register as unsigned integer.
Definition: THM1176Types.h:141
MTL::Instrument::THM1176Types::sArbitraryMeasurements::clear
void clear()
Clear to default values.
Definition: THM1176Types.cpp:483
MTL::Instrument::THM1176Types::sExample::ExampleState
bool ExampleState
Example of a boolean element.
Definition: THM1176Types.h:305
MTL::Instrument::THM1176Types::sBoundedParm::operator!=
bool operator!=(sBoundedParm other) const
Inequality operator.
Definition: THM1176Types.h:277
MTL::Instrument::THM1176Types::sArbitraryMeasurements::NoMeasurements
U32 NoMeasurements
Return this number of measurements.
Definition: THM1176Types.h:578
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent::CommandError
U8 CommandError
Error in preceding command.
Definition: THM1176Types.h:113
MTL::Instrument::THM1176Types::CDivisorList
List of divisors, one per measurement unit.
Definition: THM1176Types.h:203
MTL::Instrument::THM1176Types::sIdentifier::FirmwareVersion
struct sVersion FirmwareVersion
Version numbers of firmware.
Definition: THM1176Types.h:342
MTL::Instrument::THM1176Types::sFile::clear
void clear()
Clear to default values.
Definition: THM1176Types.cpp:306
MTL::Instrument::THM1176Types::sStatusRegister::Set
eStatusRegisterSet Set
SCPI register set.
Definition: THM1176Types.h:53
MTL::Instrument::THM1176Types::knT
@ knT
Nano-Tesla.
Definition: THM1176Types.h:186
MTL::Instrument::THM1176Types::operator-
CAbsoluteTimestamp operator-(CAbsoluteTimestamp a, CAbsoluteTimestamp b)
Timestamp subtraction operator.
Definition: THM1176Types.cpp:389
MTL::Instrument::THM1176Types::sError::operator!=
bool operator!=(sError other) const
Inequality operator.
Definition: THM1176Types.cpp:153
MTL::Instrument::THM1176Types::sIdentifier
Instrument's identification string - parsed version.
Definition: THM1176Types.h:336
MTL::Instrument::THM1176Types::uOPERation::sOPERation::NA3
U16 NA3
Not Available.
Definition: THM1176Types.h:131
MTL::Instrument::THM1176Types::uOPERation::sOPERation::WaitingForTRIGger
U16 WaitingForTRIGger
Waiting for trigger.
Definition: THM1176Types.h:133
MTL::Instrument::THM1176Types::sInputTrigger::sInputTrigger
sInputTrigger(eInputTriggerSource Src={ }, ParmType< F64 > Per={ }, ParmType< U16 > Cnt={ })
Constructor.
Definition: THM1176Types.h:415
MTL::Instrument::THM1176Types::operator+
CAbsoluteTimestamp operator+(CAbsoluteTimestamp a, CAbsoluteTimestamp b)
Timestamp addition operator.
Definition: THM1176Types.cpp:378
MTL::Instrument::THM1176Types::sRange::Auto
bool Auto
Auto-ranging enabled.
Definition: THM1176Types.h:459
MTL::Instrument::THM1176Types::eCommunicationFormat
eCommunicationFormat
Enumeration of possible formats for returned data.
Definition: THM1176Types.h:445
MTL::Instrument::THM1176Types::uQUEStionable::sQUEStionable::Overrange
U16 Overrange
Measurement was over-range.
Definition: THM1176Types.h:150
MTL::Instrument::THM1176Types::sVersion::Minor
U8 Minor
Minor version number.
Definition: THM1176Types.h:316
MTL::Instrument::THM1176Types::sRange::clear
void clear(void)
Clear to default values.
Definition: THM1176Types.h:469
MTL
Definition: CTHM1176InstrumentManager.h:179
MTL::Instrument::THM1176Types::sInputTrigger::Count
ParmType< U16 > Count
Trigger count: take this many measurements before sending results.
Definition: THM1176Types.h:408
MTL::Instrument::THM1176Types::operator<<
std::ostream & operator<<(std::ostream &Stream, const eStatusRegisterSet &RegSet)
Status register set stream output.
Definition: THM1176Types.cpp:27
MTL::Instrument::THM1176Types::kStatusQuestionableStatusRegister
@ kStatusQuestionableStatusRegister
Questionable Status Register.
Definition: THM1176Types.h:40
MTL::Instrument::THM1176Types::uStatusByte::sStatusByte::MAV
U8 MAV
Message Available.
Definition: THM1176Types.h:92
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent::NA6
U8 NA6
Not Available.
Definition: THM1176Types.h:114
MTL::Instrument::THM1176Types::sBoundedParm::Val
DataType Val
Current value.
Definition: THM1176Types.h:247
MTL::Instrument::THM1176Types::kStandardEventStatusRegister
@ kStandardEventStatusRegister
Standard Event Status Register.
Definition: THM1176Types.h:39
MTL::Instrument::THM1176Types::sArbitraryMeasurements::Bz
bool Bz
Return the flux density Z-component.
Definition: THM1176Types.h:575
MTL::Instrument::THM1176Types::eInputTriggerSource
eInputTriggerSource
Enumeration of possible trigger sources.
Definition: THM1176Types.h:396
MTL::Instrument::THM1176Types::sMeasurementConditions::sMeasurementConditions
sMeasurementConditions(sAveraging< uParm > AvgParms={ }, sInputTrigger< uParm > TrigParms={ }, bool UseCal=false)
Constructor.
Definition: THM1176Types.h:608
MTL::Instrument::THM1176Types::kmGauss
@ kmGauss
Milli-Gauss.
Definition: THM1176Types.h:189
MTL::Instrument::THM1176Types::kkGauss
@ kkGauss
Kilo-Gauss.
Definition: THM1176Types.h:188
MTL::Instrument::THM1176Types::sAveraging
Averaging parameter.
Definition: THM1176Types.h:367
MTL::Instrument::THM1176Types::sVersion::operator==
bool operator==(sVersion other) const
Equality operator.
Definition: THM1176Types.cpp:179
MTL::Instrument::THM1176Types::kmT
@ kmT
Milli-Tesla.
Definition: THM1176Types.h:184
MTL::Instrument::THM1176Types::sIdentifier::operator==
bool operator==(sIdentifier other) const
Equality oeprator.
Definition: THM1176Types.cpp:207
MTL::Instrument::THM1176Types::kInputTrigSrcImmediate
@ kInputTrigSrcImmediate
Immediate trigger: start measurement immediately after previous one completes.
Definition: THM1176Types.h:397
MTL::Instrument::THM1176Types::uStatusByte::sStatusByte::RQS
U8 RQS
ReQuest for Service.
Definition: THM1176Types.h:94
MTL::Instrument::THM1176Types::sMeasurementConditions::operator!=
bool operator!=(sMeasurementConditions other) const
Inequality operator.
Definition: THM1176Types.cpp:518
MTL::Instrument::THM1176Types::kStatusByte
@ kStatusByte
Status Byte.
Definition: THM1176Types.h:38
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::operator!=
bool operator!=(CAbsoluteTimestamp other)
Inequality operator.
Definition: THM1176Types.cpp:357
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::nanoseconds
U64 nanoseconds(void) const
Fetch the number of nanoseconds.
Definition: THM1176Types.cpp:365
MTL::Instrument::THM1176Types::kStatusEvent
@ kStatusEvent
Event register.
Definition: THM1176Types.h:46
MTL::Instrument::THM1176Types::uStatusByte::sStatusByte::EAV
U8 EAV
Error Available in Error / Event Queue.
Definition: THM1176Types.h:90
MTL::Instrument::THM1176Types::sIdentifier::Manufacturer
std::string Manufacturer
Manufacturer name ("Metrolab Technology SA")
Definition: THM1176Types.h:337
MTL::Instrument::THM1176Types::tFileList
std::vector< sFile > tFileList
List of directory entries.
Definition: THM1176Types.h:511
MTL::Instrument::THM1176Types::sMeasurementConditions::operator==
bool operator==(sMeasurementConditions other) const
Equality operator.
Definition: THM1176Types.cpp:510
MTL::Instrument::THM1176Types::sArbitraryMeasurements::Timestamp
bool Timestamp
Return the timestamp.
Definition: THM1176Types.h:577
I32
int I32
32-bit signed integer.
Definition: OSDefines.h:28
MTL::Instrument::THM1176Types::CAbsoluteTimestamp
Timestamp for a measurement.
Definition: THM1176Types.h:530
MTL::Instrument::THM1176Types::uStatusByte::RawSTB
U16 RawSTB
Access the Status Byte as unsigned integer.
Definition: THM1176Types.h:83
MTL::Instrument::THM1176Types::CTimestampList
List of timestamps.
Definition: THM1176Types.h:555
MTL::Instrument::THM1176Types::uQUEStionable
Union to access the Questionable Status Register as integer or bit fields.
Definition: THM1176Types.h:139
MTL::Instrument::THM1176Types::sIdentifier::Model
std::string Model
Model name (e.g. "THM1176-MF")
Definition: THM1176Types.h:338
MTL::Instrument::THM1176Types::sExample::ExampleF64
ParmType< F64 > ExampleF64
Example of an F64 element.
Definition: THM1176Types.h:306
MTL::Instrument::THM1176Types::StatusValues
List of values returned for several SCPI status registers.
Definition: THM1176Types.h:76
MTL::Instrument::THM1176Types::sError::Context
std::string Context
SCPI commands being executed at time of error.
Definition: THM1176Types.h:217
MTL::Instrument::THM1176Types::sInputTrigger::clear
void clear(void)
Clear to default.
Definition: THM1176Types.h:418
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::NS_PER_SEC
static const U64 NS_PER_SEC
Definition: THM1176Types.h:536
MTL::Instrument::THM1176Types::sRange::sRange
sRange(bool A={ }, ParmType< tFlux > R={ })
Constructor.
Definition: THM1176Types.h:466
MTL::Instrument::THM1176Types::sAveraging::sAveraging
sAveraging(ParmType< U16 > NPts={ })
Constructor.
Definition: THM1176Types.h:373
MTL::Instrument::THM1176Types::uOPERation::sOPERation::RANGing
U16 RANGing
Changing range.
Definition: THM1176Types.h:130
MTL::Instrument::THM1176Types::sArbitraryMeasurements::sArbitraryMeasurements
sArbitraryMeasurements(bool Bx=false, bool By=false, bool Bz=false, bool Temp=false, bool Time=false, U32 NMeas=0)
Constructor.
Definition: THM1176Types.h:588
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::CAbsoluteTimestamp
CAbsoluteTimestamp(std::time_t Seconds=0, U64 Nanoseconds=0)
Constructor.
Definition: THM1176Types.cpp:341
MTL::Instrument::THM1176Types::kMHzp
@ kMHzp
Equivalent proton NMR resonant frequency, in Mega-Hertz.
Definition: THM1176Types.h:190
MTL::Instrument::THM1176Types::uQUEStionable::QUEStionable
struct MTL::Instrument::THM1176Types::uQUEStionable::sQUEStionable QUEStionable
Access the Questionable Status Register as bit fields.
MTL::Instrument::THM1176Types::sVersion::Major
U8 Major
Major version number.
Definition: THM1176Types.h:315
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent::NA1
U8 NA1
Not Available.
Definition: THM1176Types.h:109
MTL::Instrument::THM1176Types::uOPERation
Union to access the Operation Status Register as integer or bit fields.
Definition: THM1176Types.h:120
MTL::Instrument::THM1176Types::sFile::sFile
sFile(size_t S=0, std::string P="", std::string T="")
Constructor.
Definition: THM1176Types.h:503
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent::DeviceDependentError
U8 DeviceDependentError
Errors specific to the THM1176, including internal errors.
Definition: THM1176Types.h:111
MTL::Instrument::THM1176Types::kT
@ kT
Tesla.
Definition: THM1176Types.h:183
MTL::Instrument::THM1176Types::sInputTrigger
Input trigger parameter.
Definition: THM1176Types.h:405
MTL::Instrument::THM1176Types::sStatusRegister
Complete identification of a SCPI status register.
Definition: THM1176Types.h:52
MTL::Instrument::THM1176Types::CUnitsList
List of measurement units.
Definition: THM1176Types.h:194
MTL::Instrument::THM1176Types::uOPERation::sOPERation::CALibrating
U16 CALibrating
Measuring zero-offset.
Definition: THM1176Types.h:128
MTL::Instrument::THM1176Types::sMeasurementConditions::TriggerParms
sInputTrigger< uParm > TriggerParms
Trigger parameters.
Definition: THM1176Types.h:600
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent::OperationComplete
U8 OperationComplete
*OPC has flagged operation complete
Definition: THM1176Types.h:108
MTL::Instrument::THM1176Types::kComFormatInteger
@ kComFormatInteger
Binary (32-bit integers)
Definition: THM1176Types.h:447
MTL::Instrument::THM1176Types::CFluxList
List of flux density values.
Definition: THM1176Types.h:170
MTL::Instrument::THM1176Types::sError::operator==
bool operator==(sError other) const
Equality operator.
Definition: THM1176Types.cpp:145
MTL::Instrument::THM1176Types::sError
Error returned by the instrument.
Definition: THM1176Types.h:214
MTL::Instrument::THM1176Types::sFile::operator==
bool operator==(sFile other) const
Equality operator.
Definition: THM1176Types.cpp:312
MTL::Instrument::THM1176Types::sArbitraryMeasurements::Temperature
bool Temperature
Return the sensor temperature.
Definition: THM1176Types.h:576
MTL::Instrument::THM1176Types::uStatusByte::sStatusByte
Access the Status Byte as bit fields.
Definition: THM1176Types.h:87
MTL::Instrument::THM1176Types::uOPERation::sOPERation::MEASuring
U16 MEASuring
Measuring magnetic field strength.
Definition: THM1176Types.h:132
MTL::Instrument::THM1176Types::sRange::operator!=
bool operator!=(sRange other) const
Inequality operator.
Definition: THM1176Types.h:481
MTL::Instrument::THM1176Types::uOPERation::OPERation
struct MTL::Instrument::THM1176Types::uOPERation::sOPERation OPERation
Access the Operation Status Register as bit fields.
MTL::Instrument::THM1176Types::uQUEStionable::sQUEStionable
Access the Questionable Status Register as bit fields.
Definition: THM1176Types.h:145
U8
unsigned char U8
Unsigned byte.
Definition: OSDefines.h:30
MTL::Instrument::THM1176Types::uStandardEvent::RawSE
U16 RawSE
Access the Standard Event Status Register as unsigned integer.
Definition: THM1176Types.h:102
MTL::Instrument::THM1176Types::uQUEStionable::sQUEStionable::NA6_8
U16 NA6_8
Not Available.
Definition: THM1176Types.h:149
MTL::Instrument::THM1176Types::CErrorList
List of errors returned by the instrument.
Definition: THM1176Types.h:232
MTL::Instrument::THM1176Types::sInputTrigger::Source
eInputTriggerSource Source
Trigger source.
Definition: THM1176Types.h:406
U16
unsigned short U16
16-bit unsigned integer.
Definition: OSDefines.h:31
OSDefines.h
Platform Dependent Definitions.
MTL::Instrument::THM1176Types::sIdentifier::ElectronicsVersion
struct sVersion ElectronicsVersion
Version numbers of electronics.
Definition: THM1176Types.h:340
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::operator==
bool operator==(CAbsoluteTimestamp other)
Equality operator.
Definition: THM1176Types.cpp:353
MTL::Instrument::THM1176Types::uOPERation::sOPERation
Access the Operation Status Register as bit fields.
Definition: THM1176Types.h:126
MTL::Instrument::THM1176Types::sBoundedParm::sBoundedParm
sBoundedParm(DataType Val=0, DataType Min=0, DataType Max=0, DataType Def=0)
Constructor.
Definition: THM1176Types.h:258
MTL::Instrument::THM1176Types::sArbitraryMeasurements::Bx
bool Bx
Return the flux density X-component.
Definition: THM1176Types.h:573
F64
double F64
64-bit floating-point number.
Definition: OSDefines.h:35
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent
Access the Standard Event Status Register as bit fields.
Definition: THM1176Types.h:106
MTL::Instrument::THM1176Types::sStatusRegister::sStatusRegister
sStatusRegister(eStatusRegisterSet S={ }, eStatusRegisterType T={ })
Constructor.
Definition: THM1176Types.h:60
MTL::Instrument::THM1176Types::sFile::Size
size_t Size
File size, in bytes.
Definition: THM1176Types.h:494
MTL::Instrument::THM1176Types::sFile
Directory entry in the instrument's file system.
Definition: THM1176Types.h:493
U32
unsigned int U32
32-bit unsigned integer.
Definition: OSDefines.h:32
MTL::Instrument::THM1176Types::sRange::operator==
bool operator==(sRange other) const
Equality operator.
Definition: THM1176Types.h:474
MTL::Instrument::THM1176Types::sBoundedParm::Def
DataType Def
Default value.
Definition: THM1176Types.h:250
MTL::Instrument::THM1176Types::sAveraging::NoPoints
ParmType< U16 > NoPoints
Number of points in block average.
Definition: THM1176Types.h:368
MTL::Instrument::THM1176Types::sIdentifier::clear
void clear(void)
Clear to default.
Definition: THM1176Types.cpp:198
MTL::Instrument::THM1176Types::sBoundedParm::clear
void clear(void)
Clear the parameter to default values.
Definition: THM1176Types.h:261
MTL::Instrument::THM1176Types::uStatusByte::sStatusByte::QSB
U8 QSB
QUEStionable status summary bit.
Definition: THM1176Types.h:91
MTL::Instrument::THM1176Types::sError::Code
I32 Code
Error code.
Definition: THM1176Types.h:215
MTL::Instrument::THM1176Types::sVersion
Major and minor version numbers.
Definition: THM1176Types.h:314
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::seconds
std::time_t seconds(void) const
Fetch the number of seconds.
Definition: THM1176Types.cpp:361
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::operator=
CAbsoluteTimestamp & operator=(const CAbsoluteTimestamp &Value)
Assignment operator.
Definition: THM1176Types.cpp:347
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::clear
void clear(void)
Clear to default values (zeroes)
Definition: THM1176Types.cpp:369
MTL::Instrument::THM1176Types::sArbitraryMeasurements::operator==
bool operator==(sArbitraryMeasurements other) const
Equality operator.
Definition: THM1176Types.cpp:488
MTL::Instrument::THM1176Types::kComFormatPacked2Byte
@ kComFormatPacked2Byte
Binary packed: first field value as I32, remainder deltas as I16.
Definition: THM1176Types.h:448
MTL::Instrument::THM1176Types::sIdentifier::ProbeVersion
struct sVersion ProbeVersion
Version numbers of probe.
Definition: THM1176Types.h:341
MTL::Instrument::THM1176Types::sArbitraryMeasurements::By
bool By
Return the flux density Y-component.
Definition: THM1176Types.h:574
MTL::Instrument::THM1176Types::uStandardEvent
Union to access the Standard Event Status Register as integer or bit fields.
Definition: THM1176Types.h:100
MTL::Instrument::THM1176Types::sBoundedParm::operator=
sBoundedParm & operator=(const DataType &scalar)
Set value, min, max and default to given value.
Definition: THM1176Types.h:281
MTL::Instrument::THM1176Types::sInputTrigger::operator==
bool operator==(sInputTrigger other) const
Equality operator.
Definition: THM1176Types.h:424
MTL::Instrument::THM1176Types::sIdentifier::operator!=
bool operator!=(sIdentifier other) const
Inequality operator.
Definition: THM1176Types.cpp:218
MTL::Instrument::THM1176Types::sIdentifier::SerialNumber
U32 SerialNumber
Serial number.
Definition: THM1176Types.h:339
MTL::Instrument::THM1176Types::kComFormatPacked1Byte
@ kComFormatPacked1Byte
Binary packed: first field value as I32, remainder deltas as I8.
Definition: THM1176Types.h:449
MTL::Instrument::THM1176Types::tFlux
F32 tFlux
Flux density value, as 32-bit floating-point number.
Definition: THM1176Types.h:30
MTL::Instrument::THM1176Types::kInputTrigSrcTimer
@ kInputTrigSrcTimer
Timed trigger: start measurement at regular intervals.
Definition: THM1176Types.h:398