44 Stream <<
"regdef(" << RegDef.
Set <<
" " << RegDef.
Type <<
")";
50 for (
auto l_Reg : RegList)
51 Stream << l_Reg <<
" ";
58 for (
auto l_Value : StatusList)
59 Stream << l_Value <<
" ";
104 for (
auto l_Flux : FluxList)
105 Stream << l_Flux <<
" ";
115 Stream << ((Units ==
kT) ?
"T" :
116 (Units ==
kmT) ?
"mT" :
117 (Units ==
kuT) ?
"uT" :
118 (Units ==
knT) ?
"nT" :
119 (Units ==
kGauss) ?
"Gauss" :
122 (Units ==
kMHzp) ?
"MHzp" :
"?");
128 for (
auto l_Units : UnitsList)
129 Stream << l_Units <<
" ";
136 for (
auto l_Divisor : DivisorList)
137 Stream << l_Divisor <<
" ";
155 return (!
operator==(other));
159 Stream <<
"err(code=" << Error.
Code <<
161 " ctxt=" << Error.
Context <<
")";
166 for (
auto l_Error : ErrorList)
167 Stream << l_Error << std::endl;
187 return (!
operator==(other));
191 Stream << Version.
Major <<
"." << Version.
Minor;
222 return (!
operator==(other));
227 " mdl=" << ID.
Model <<
245 Stream <<
"avg(val=" << AvgParm.
NoPoints.Val <<
248 " def=" << AvgParm.
NoPoints.Def <<
")";
261 Stream <<
"trg(src=" << TrigParm.
Source <<
263 " cnt=" << TrigParm.
Count <<
")";
268 Stream <<
"trg(src=" << TrigParm.
Source <<
269 " per(val=" << TrigParm.
Period_s.Val <<
272 " def=" << TrigParm.
Period_s.Def <<
")" <<
273 " cnt(val=" << TrigParm.
Count.Val <<
274 " min=" << TrigParm.
Count.Min <<
275 " max=" << TrigParm.
Count.Max <<
276 " def=" << TrigParm.
Count.Def <<
"))";
291 Stream <<
"range(auto=" << RangeParm.
Auto <<
292 " rng=" << RangeParm.
Range <<
")";
297 Stream <<
"range(auto=" << RangeParm.
Auto <<
298 " rng(val=" << RangeParm.
Range.Val <<
299 " min=" << RangeParm.
Range.Min <<
300 " max=" << RangeParm.
Range.Max <<
301 " def=" << RangeParm.
Range.Def <<
"))";
324 return (!
operator==(other));
328 Stream <<
"file(siz=" << FileInfo.
Size <<
329 " path=" << FileInfo.
Path <<
330 " type=" << FileInfo.
Type <<
")";
335 for (
auto l_FileInfo : FileList)
336 Stream << l_FileInfo << std::endl;
344 s(Seconds), ns(Nanoseconds)
357 return (s == other.s && ns == other.ns);
361 return (!
operator==(other));
412 std::time_t l_Seconds = Timestamp.
seconds();
414 char l_DateTimeString[32];
415 std::strftime(l_DateTimeString, 31,
"%FT%T", std::localtime(&l_Seconds));
416 Stream << std::string(l_DateTimeString) <<
"."
417 << std::setfill(
'0') << std::setw(9)
419 << std::setfill(
' ') << std::setw(0);
429 if (this->size() < 2)
451 size_t l_n = this->size();
456 U64 l_T0 = this->at(0);
457 for (
U32 l_i = 0; l_i < l_n; l_i++)
461 l_Y(l_i) =
static_cast<F64> (this->at(l_i) - l_T0);
466 l_b = l_X.jacobiSvd(ComputeThinU | ComputeThinV).solve(l_Y);
476 for (
auto l_TimeStamp : TimestampList)
477 Stream << l_TimeStamp <<
" ";
503 return (!
operator==(other));
524 return (!
operator==(other));
528 Stream <<
"arb(Bx=" << MeasSpec.
Bx <<
529 " By=" << MeasSpec.
By <<
530 " Bz=" << MeasSpec.
Bz <<
541 " range=" << MeasCond.
Range <<
")";
unsigned long long U64
64-bit unsigned integer.
unsigned int U32
32-bit unsigned integer.
double F64
64-bit floating-point number.
Interface definition for C++ API for Metrolab THM1176/TFM1186.
Timestamp for a measurement.
static const U64 NS_PER_SEC
std::time_t seconds(void) const
Fetch the number of seconds.
bool operator!=(CAbsoluteTimestamp other)
Inequality operator.
bool operator==(CAbsoluteTimestamp other)
Equality operator.
CAbsoluteTimestamp(std::time_t Seconds=0, U64 Nanoseconds=0)
Constructor.
void clear(void)
Clear to default values (zeroes)
CAbsoluteTimestamp & operator=(const CAbsoluteTimestamp &Value)
Assignment operator.
U64 nanoseconds(void) const
Fetch the number of nanoseconds.
List of divisors, one per measurement unit.
List of errors returned by the instrument.
List of flux density values.
bool GetEstimatedPeriod(F64 &Period)
Estimate the measurement period from this timestamp list, by means of a least-squares fit.
List of measurement units.
List of SCPI status registers.
List of values returned for several SCPI status registers.
eStatusRegisterType
Enumeration of SCPI status register types.
@ kStatusEnable
Enable register.
@ kStatusCondition
Condition register.
@ kStatusEvent
Event register.
CAbsoluteTimestamp operator-(CAbsoluteTimestamp a, CAbsoluteTimestamp b)
Timestamp subtraction operator.
std::ostream & operator<<(std::ostream &Stream, const eStatusRegisterSet &RegSet)
Status register set stream output.
eCommunicationFormat
Enumeration of possible formats for returned data.
@ kComFormatInteger
Binary (32-bit integers)
@ kComFormatPacked2Byte
Binary packed: first field value as I32, remainder deltas as I16.
@ kComFormatPacked1Byte
Binary packed: first field value as I32, remainder deltas as I8.
@ kComFormatAscii
Human-legible text.
std::vector< sFile > tFileList
List of directory entries.
CAbsoluteTimestamp operator+(CAbsoluteTimestamp a, CAbsoluteTimestamp b)
Timestamp addition operator.
eInputTriggerSource
Enumeration of possible trigger sources.
@ kInputTrigSrcTimer
Timed trigger: start measurement at regular intervals.
@ kInputTrigSrcImmediate
Immediate trigger: start measurement immediately after previous one completes.
@ kInputTrigSrcBus
Bus trigger: start measurement upon USB trigger message.
eUnits
Enumeration of possible measurement units.
@ kMHzp
Equivalent proton NMR resonant frequency, in Mega-Hertz.
eStatusRegisterSet
Enumeration of SCPI status register sets.
@ kStatusByte
Status Byte.
@ kStatusQuestionableStatusRegister
Questionable Status Register.
@ kStandardEventStatusRegister
Standard Event Status Register.
@ kStatusOperationStatusRegister
Operation Status Register.
Specify the measurement data to be returned.
bool Bx
Return the flux density X-component.
bool operator==(sArbitraryMeasurements other) const
Equality operator.
bool Temperature
Return the sensor temperature.
bool operator!=(sArbitraryMeasurements other) const
Inequality operator.
bool By
Return the flux density Y-component.
bool Bz
Return the flux density Z-component.
void clear()
Clear to default values.
sArbitraryMeasurements(bool Bx=false, bool By=false, bool Bz=false, bool Temp=false, bool Time=false, U32 NMeas=0)
Constructor.
bool Timestamp
Return the timestamp.
U32 NoMeasurements
Return this number of measurements.
ParmType< U16 > NoPoints
Number of points in block average.
Error returned by the instrument.
bool operator==(sError other) const
Equality operator.
sError(I32 Code=0, std::string Description="", std::string Context="")
Constructor.
std::string Context
SCPI commands being executed at time of error.
bool operator!=(sError other) const
Inequality operator.
std::string Description
Error description.
Directory entry in the instrument's file system.
void clear()
Clear to default values.
std::string Path
File path.
bool operator==(sFile other) const
Equality operator.
bool operator!=(sFile other) const
Inequality operator.
std::string Type
File type ("ASCII" or "BINARY").
sFile(size_t S=0, std::string P="", std::string T="")
Constructor.
size_t Size
File size, in bytes.
Instrument's identification string - parsed version.
struct sVersion FirmwareVersion
Version numbers of firmware.
std::string Manufacturer
Manufacturer name ("Metrolab Technology SA")
struct sVersion ElectronicsVersion
Version numbers of electronics.
U32 SerialNumber
Serial number.
bool operator!=(sIdentifier other) const
Inequality operator.
struct sVersion ProbeVersion
Version numbers of probe.
std::string Model
Model name (e.g. "THM1176-MF")
bool operator==(sIdentifier other) const
Equality oeprator.
void clear(void)
Clear to default.
enum eInstrModel InstrModel
Enumerator of instrument model.
sIdentifier(std::string Mfr="", std::string Mdl="", U32 SN=0, struct sVersion EVsn={ }, struct sVersion PVsn={ }, struct sVersion FVsn={ }, eModelRevision ThmRev=kA, eInstrModel InstrMdl=eInstrModel::kUnknown)
Constructor.
enum eModelRevision ModelRevision
Revision of Model.
Summary of the parameters used to make a measurement.
bool UseCalibration
Use calibration data.
tFlux Range
Current range setting.
bool operator!=(sMeasurementConditions other) const
Inequality operator.
sMeasurementConditions(sAveraging< uParm > AvgParms={ }, sInputTrigger< uParm > TrigParms={ }, bool UseCal=false, tFlux RangeIn=0.)
Constructor.
void clear()
Clear to default values.
sAveraging< uParm > AveragingParms
Averaging parameters.
sInputTrigger< uParm > TriggerParms
Trigger parameters.
bool operator==(sMeasurementConditions other) const
Equality operator.
Measurement range parameter.
bool Auto
Auto-ranging enabled.
ParmType< tFlux > Range
Measurement range, if auto-ranging is not enabled.
Complete identification of a SCPI status register.
eStatusRegisterSet Set
SCPI register set.
eStatusRegisterType Type
SCPI register type.
Major and minor version numbers.
bool operator!=(sVersion other) const
Inequality operator.
void clear(void)
Clear to default (zeroes).
bool operator==(sVersion other) const
Equality operator.
U8 Minor
Minor version number.
sVersion(U8 Maj=0, U8 Min=0)
Constructor.
U8 Major
Major version number.
U16 RANGing
Changing range.
U16 CALibrating
Measuring zero-offset.
U16 WaitingForTRIGger
Waiting for trigger.
U16 MEASuring
Measuring magnetic field strength.
U16 Frequency
Acquisition buffer or the timed trigger has been overrun.
U16 Overrange
Measurement was over-range.
U8 CommandError
Error in preceding command.
U8 DeviceDependentError
Errors specific to the THM1176, including internal errors.
U8 ExecutionError
Error detected during command execution.
U8 PowerOn
THM1176 has been powered up.
U8 OperationComplete
*OPC has flagged operation complete
U8 QueryError
Error in preceding query.
U8 EAV
Error Available in Error / Event Queue.
U8 OSB
OPERation status summary bit.
U8 RQS
ReQuest for Service.
U8 ESB
Standard Event Status Register summary bit.
U8 QSB
QUEStionable status summary bit.
Union to access the Operation Status Register as integer or bit fields.
struct MTL::Instrument::THM1176Types::uOPERation::sOPERation OPERation
Access the Operation Status Register as bit fields.
Union to access the Questionable Status Register as integer or bit fields.
struct MTL::Instrument::THM1176Types::uQUEStionable::sQUEStionable QUEStionable
Access the Questionable Status Register as bit fields.
Union to access the Standard Event Status Register as integer or bit fields.
struct MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent StandardEvent
Access the Standard Event Status Register as bit fields.
Union to access the Status Byte as integer or bit fields.
struct MTL::Instrument::THM1176Types::uStatusByte::sStatusByte StatusByte
Access the Status Byte as bit fields.