THM1176InstrumentManager 1.1
Qt Object abstraction for Metrolab THM1176
Loading...
Searching...
No Matches
CTHM1176InstrumentManager.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
145
146#pragma once
147
149
150#if (THM1176_INSTRUMENT_TYPE_IS_VISA)
151 #include "VISAInstrument.h"
152 #define THM1176_RSRC_MGR_CLS CVISAResourceManager
153 #define THM1176_INSTR_CLS CVISAInstrument
154 #define THM1176_RSRC_FILTER "USB[0-9]*::0x1BFA::0x0498::[0-9]+::INSTR"
155 #include "VISAInstrument.h"
156#elif (THM1176_INSTRUMENT_TYPE_IS_USBTMC)
157 #include "USBTMCInstrument.h"
158 #define THM1176_RSRC_MGR_CLS CUSBTMCResourceManager
159 #define THM1176_INSTR_CLS CUSBTMCInstrument
160 #define THM1176_RSRC_FILTER "7162:1176"
161 #include "USBTMCInstrument.h"
162#else
163 #error "One of THM1176_INSTRUMENT_TYPE_IS_VISA or ..._USBTMC must be defined"
164#endif
165
166#include <QtCore/QThread>
167#include <QtCore/QTimer>
168#include <QtCore/QString>
169#include <QtCore/QDateTime>
170
171using namespace MTL;
172using namespace MTL::Instrument;
173using namespace MTL::Instrument::THM1176Types;
174
175//----------------------------------------------------------------------//
176// Type definitions //
177//----------------------------------------------------------------------//
178namespace MTL
179{
180Q_NAMESPACE
181Q_ENUM_NS(eTHM1176OperatingMode)
182Q_ENUM_NS(eTHM1176Units)
183}
184
185//----------------------------------------------------------------------//
186// Qt meta-type declarations //
187//----------------------------------------------------------------------//
188Q_DECLARE_METATYPE(eTHM1176Units)
189Q_DECLARE_METATYPE(eTHM1176OperatingMode)
190Q_DECLARE_METATYPE(eCommunicationFormat)
191
192Q_DECLARE_METATYPE(tResourceName)
193
194Q_DECLARE_METATYPE(sIdentifier)
195Q_DECLARE_METATYPE(sArbitraryMeasurements)
196Q_DECLARE_METATYPE(CMeasurement)
197
198Q_DECLARE_METATYPE(CResourceList)
199Q_DECLARE_METATYPE(CFluxList)
200Q_DECLARE_METATYPE(CTHM1176UnitsList)
201Q_DECLARE_METATYPE(CDivisorList)
202Q_DECLARE_METATYPE(CErrorList)
203
204Q_DECLARE_METATYPE(sAveraging<uParm>)
205Q_DECLARE_METATYPE(sAveraging<sBoundedParm>)
206Q_DECLARE_METATYPE(sInputTrigger<uParm>)
207Q_DECLARE_METATYPE(sInputTrigger<sBoundedParm>)
208Q_DECLARE_METATYPE(sRange<uParm>)
209Q_DECLARE_METATYPE(sRange<sBoundedParm>)
210
211//----------------------------------------------------------------------//
212// Qt meta-type declarations //
213//----------------------------------------------------------------------//
214Q_DECLARE_METATYPE(THM1176_INSTR_CLS *)
215Q_DECLARE_METATYPE(THM1176_RSRC_MGR_CLS *)
216
217namespace MTL
218{
226class CTHM1176InstrumentScanner : public QObject
227{
228 Q_OBJECT
229
230private:
231 //----------------------------------------------------------------------//
232 // THM1176 Instrument Scanner constants //
233 //----------------------------------------------------------------------//
234 static const U32 THM1176_SCAN_INTERVAL = 1000; // ms
235
236 //----------------------------------------------------------------------//
237 // THM1176 Instrument Scanner class variables //
238 //----------------------------------------------------------------------//
239 int m_TimerID;
240 CResourceList m_InstrumentList;
241 THM1176_RSRC_MGR_CLS * m_pResourceManager;
242
243 //----------------------------------------------------------------------//
244 // THM1176 Instrument Scanner private methods //
245 //----------------------------------------------------------------------//
246 void timerEvent (QTimerEvent * Event) override;
247 void HandleError (QString Description,
248 QString Context);
249
250public:
251 //----------------------------------------------------------------------//
252 // THM1176 Instrument Scanner constructor / destructor //
253 //----------------------------------------------------------------------//
256 m_pResourceManager(nullptr)
257 { }
258
260 { }
261
262public slots:
263 //----------------------------------------------------------------------//
264 // THM1176 Instrument Scanner slots //
265 //----------------------------------------------------------------------//
268 void Start (THM1176_RSRC_MGR_CLS * pResourceManager);
270 void Stop (void);
271
272signals:
273 //----------------------------------------------------------------------//
274 // THM1176 Instrument Scanner signals //
275 //----------------------------------------------------------------------//
278 void UpdateInstrumentList (CResourceList InstrumentList);
281 void UpdateErrorList (CErrorList ErrorList);
282
283}; // CTHM1176InstrumentScanner
284
285
292class CTHM1176InstrumentController : public QObject
293{
294 Q_OBJECT
295
296private:
297 //----------------------------------------------------------------------//
298 // THM1176 Instrument Controller constants //
299 //----------------------------------------------------------------------//
300 static constexpr U32 THM1176_CONNECT_TIMEOUT = 5000; // ms
301 static constexpr F32 MU0 = 1.256637061436E-6f; // Magnetic permeability of vacuum
302
303 //----------------------------------------------------------------------//
304 // THM1176 Instrument Controller class variables //
305 //----------------------------------------------------------------------//
306 // Connection
307 THM1176_RSRC_MGR_CLS * m_pResourceManager;
309 m_pTHM1176;
310 CResourceList m_InstrumentList;
311 tResourceName m_CurrentInstrument;
312
313 // Instrument information and parameter bounds:
314 sIdentifier m_Identification;
315 CFluxList m_RangeList;
316 CTHM1176UnitsList m_UnitsList;
317 CDivisorList m_DivisorList;
318 sAveraging<sBoundedParm> m_AveragingParmBounds;
319 sInputTrigger<sBoundedParm> m_TriggerParmBounds;
320 sRange<sBoundedParm> m_RangeParmBounds;
321
322 // Parameters
323 sAveraging<uParm> m_AveragingParms;
324 sInputTrigger<uParm> m_TriggerParms;
325 sArbitraryMeasurements m_OutputSelect;
326 bool m_SleepParm;
327 eTHM1176Units m_Units;
328 sRange<uParm> m_RangeParms;
329 eCommunicationFormat m_CommFormat;
330
331 // Control parameters
332 eTHM1176OperatingMode m_OperatingMode;
333 U16 m_TriggerCount;
334 int m_TimerID;
335 bool m_CalibrationOverride;
336
337 //----------------------------------------------------------------------//
338 // THM1176 Instrument Controller private methods //
339 //----------------------------------------------------------------------//
340 void HandleError (QString Description,
341 QString Context);
342 void ClearInstrumentInfo (void);
343 void GetInstrumentInfo (std::string Context);
344 void GetInstrumentParameters (std::string Context);
345 void MakeUnitsList (std::string Context);
346 void GetCurrentUnits (std::string Context);
347 void TranslateUnits (CMeasurement & Measurement,
348 eUnits Units);
349 void PublishInstrumentInfo (void);
350 void PublishInstrumentParameters (void);
351 void timerEvent (QTimerEvent * Event) override;
352
353public:
354 //----------------------------------------------------------------------//
355 // THM1176 Instrument Controller constructor / destructor //
356 //----------------------------------------------------------------------//
359 m_pResourceManager(nullptr),
360 m_pTHM1176(nullptr),
361 m_SleepParm(false),
362 m_Units(kT),
363 m_CommFormat(kComFormatAscii),
364 m_OperatingMode(kTHM1176NotConnected),
365 m_TriggerCount(0),
366 m_TimerID(0),
367 m_CalibrationOverride(false)
368 {
369 m_AveragingParmBounds.clear();
370 m_TriggerParmBounds.clear();
371 m_RangeParmBounds.clear();
372
373 m_AveragingParms.clear();
374 m_TriggerParms.clear();
375 m_OutputSelect.clear();
376 m_RangeParms.clear();
377 }
378
381 { }
382
383public slots:
384 //----------------------------------------------------------------------//
385 // THM1176 Instrument Controller slots //
386 //----------------------------------------------------------------------//
387 // Startup and shutdown.
390 void Start (THM1176_RSRC_MGR_CLS * pResourceManager);
391
393 void Stop (void);
394
395 // Connection
398 void UpdateInstrumentList (CResourceList InstrumentList);
399
402 void SetCurrentInstrument (tResourceName CurrentInstrument);
403
404 // Instrument control
407 void SetOperatingMode (eTHM1176OperatingMode OperatingMode);
408
410 void SendTrigger (void);
411
412 // Parameters
415 void SetAveragingParms (sAveraging<uParm> AveragingParms);
416
419 void SetTriggerParms (sInputTrigger<uParm> TriggerParms);
420
423 void SetOutputSelect (sArbitraryMeasurements OutputSelect);
424
427 void SetSleepParm (bool SleepParm);
428
431 void SetUnits (eTHM1176Units Units);
432
435 void SetRangeParms (sRange<uParm> RangeParms);
436
439 void SetCommFormat (eCommunicationFormat CommFormat);
440
444 void SetCalibrationOverride (bool Override);
445
446signals:
447 //----------------------------------------------------------------------//
448 // THM1176 Instrument Controller signals //
449 //----------------------------------------------------------------------//
450 // Basic instrument control:
453 void UpdateCurrentInstrument (tResourceName CurrentInstrument);
454
458
462
465 void UpdateMeasurement (CMeasurement Measurement);
466
469 void UpdateErrorList (CErrorList LatestErrors);
470
471 // Instrument information and parameter bounds:
474 void UpdateIdentification (sIdentifier Identification);
475
478 void UpdateRangeList (CFluxList RangeList);
479
483
486 void UpdateDivisorList (CDivisorList DivisorList);
487
491
495
499
500 // Parameters
504
508
512
515 void UpdateSleepParm (bool SleepParm);
516
520
524
528
529}; // CTHM1176InstrumentController
530
531
538class CTHM1176InstrumentManager : public QObject
539{
540 Q_OBJECT
541
542 //----------------------------------------------------------------------//
543 // THM1176 Instrument Manager properties //
544 //----------------------------------------------------------------------//
545 // Basic instrument control:
556
557 // Instrument information and parameter bounds:
572
573 // Parameters:
581 Q_PROPERTY(bool SleepParm READ GetSleepParm WRITE SetSleepParm NOTIFY NotifySleepParm)
583 Q_PROPERTY(eTHM1176Units Units READ GetUnits WRITE SetUnits NOTIFY NotifyUnits)
588
589private:
590 //----------------------------------------------------------------------//
591 // THM1176 Instrument Manager constants //
592 //----------------------------------------------------------------------//
593 static const U8 THM1176_MIN_VERSION_WITH_ABORTREAD = 4;
594
595 //----------------------------------------------------------------------//
596 // THM1176 Instrument Manager class variables - properties //
597 //----------------------------------------------------------------------//
598 // Basic instrument control:
599 CResourceList m_InstrumentList;
600 tResourceName m_CurrentInstrument;
601 eTHM1176OperatingMode m_OperatingMode;
602 CMeasurement m_Measurement;
603 CErrorList m_ErrorList;
604
605 // Instrument information and parameter bounds:
606 sIdentifier m_Identification;
607 CFluxList m_RangeList;
608 CTHM1176UnitsList m_UnitsList;
609 CDivisorList m_DivisorList;
610 sAveraging<sBoundedParm> m_AveragingParmBounds;
611 sInputTrigger<sBoundedParm> m_TriggerParmBounds;
612 sRange<sBoundedParm> m_RangeParmBounds;
613
614 // Parameters:
615 sAveraging<uParm> m_AveragingParms;
616 sInputTrigger<uParm> m_TriggerParms;
617 sArbitraryMeasurements m_OutputSelect;
618 bool m_SleepParm;
619 eTHM1176Units m_Units;
620 sRange<uParm> m_RangeParms;
621 eCommunicationFormat m_CommFormat;
622
623 //----------------------------------------------------------------------//
624 // THM1176 Instrument Manager class variables - other //
625 //----------------------------------------------------------------------//
626 // Instrument Controller
627 CTHM1176InstrumentController* m_pInstrumentController;
628 QThread m_InstrumentControlThread;
629
630 // Instrument Scanner
631 CTHM1176InstrumentScanner* m_pInstrumentScanner;
632 QThread m_InstrumentScanThread;
633
634 // Instrument connection
635 THM1176_RSRC_MGR_CLS * m_pResourceManager;
636 CTHM1176Instrument<THM1176_INSTR_CLS, THM1176_RSRC_MGR_CLS> *
637 m_pTHM1176;
638
639 //----------------------------------------------------------------------//
640 // THM1176 Instrument Manager private methods //
641 //----------------------------------------------------------------------//
642 void HandleError (QString Description, QString Context);
643
644public:
645 //----------------------------------------------------------------------//
646 // THM1176 Instrument Manager public constants //
647 //----------------------------------------------------------------------//
648 static const I32 THM1176_INST_MGR_ERROR = 5000;
649 static const I32 THM1176_INST_CTLR_ERROR = 5001;
650 static const I32 THM1176_INST_SCANNER_ERROR = 5002;
651
652 //----------------------------------------------------------------------//
653 // THM1176 Instrument Manager constructor / destructor //
654 //----------------------------------------------------------------------//
657 m_OperatingMode(kTHM1176NotConnected),
658 m_SleepParm(false),
659 m_Units(kT),
660 m_CommFormat(kComFormatAscii),
661 m_pInstrumentController(nullptr),
662 m_pInstrumentScanner(nullptr),
663 m_pTHM1176(nullptr)
664 {
665
666 qRegisterMetaType<eTHM1176Units>();
667 qRegisterMetaType<eTHM1176OperatingMode>();
668 qRegisterMetaType<eCommunicationFormat>();
669
670 qRegisterMetaType<tResourceName>();
671
672 qRegisterMetaType<sIdentifier>();
673 qRegisterMetaType<sArbitraryMeasurements>();
674 qRegisterMetaType<CMeasurement>();
675
676 qRegisterMetaType<CResourceList>();
677 qRegisterMetaType<CFluxList>();
678 qRegisterMetaType<CTHM1176UnitsList>();
679 qRegisterMetaType<CDivisorList>();
680 qRegisterMetaType<CErrorList>();
681
682 qRegisterMetaType<sAveraging<uParm>>();
683 qRegisterMetaType<sAveraging<sBoundedParm>>();
684 qRegisterMetaType<sInputTrigger<uParm>>();
685 qRegisterMetaType<sInputTrigger<sBoundedParm>>();
686 qRegisterMetaType<sRange<uParm>>();
687 qRegisterMetaType<sRange<sBoundedParm>>();
688
689 // Meta-types to be passed internally.
690 qRegisterMetaType<THM1176_RSRC_MGR_CLS *>();
691
692 }
693
697
698 //----------------------------------------------------------------------//
699 // THM1176 Instrument Manager property Get methods //
700 //----------------------------------------------------------------------//
701 // Basic instrument control:
705
709
713
716 bool GetIsTHMNullptr (void);
717
721
725
726 // Instrument information and parameter bounds:
730
733 CFluxList GetRangeList (void);
734
738
742
746
750
754
755 // Parameters:
759
763
767
770 bool GetSleepParm (void);
771
774 eTHM1176Units GetUnits (void);
775
779
783
788 bool GetImmediateMeasurementPeriod(const sAveraging<uParm> & rAvg, F64 & rPeriod);
789
794 inline bool ConvertTimestamp (const U64 RawTimestamp, CAbsoluteTimestamp & rTimestamp)
795 {
796 if (m_pTHM1176 == nullptr)
797 {
798 HandleError("Instrument not connected", __func__);
799 return false;
800 }
801 else
802 {
803 return m_pTHM1176->ConvertTimestamp(RawTimestamp, rTimestamp);
804 }
805 }; // CTHM1176InstrumentManager::ConvertTimestamp
806
811 bool ReadInformationDates (QDateTime & rManufacturingDate, QDateTime & rCalibrationDate);
812
813
814public slots:
815 //----------------------------------------------------------------------//
816 // THM1176 Instrument Manager property Set methods //
817 //----------------------------------------------------------------------//
818 // Basic instrument control:
822
826
827 // Parameters:
831
835
839
842 void SetSleepParm (bool SleepParm);
843
847
851
855
856private slots:
857 //----------------------------------------------------------------------//
858 // THM1176 Instrument Manager communication with Instrument Scanner //
859 //----------------------------------------------------------------------//
860 void UpdateInstrumentList (CResourceList InstrumentList);
861
862 //----------------------------------------------------------------------//
863 // THM1176 Instrument Manager communication with Instrument Controller //
864 //----------------------------------------------------------------------//
865 // Basic instrument control:
866 void UpdateCurrentInstrument (tResourceName CurrentInstrument);
867 void UpdateInstrumentPointer (CTHM1176Instrument<THM1176_INSTR_CLS, THM1176_RSRC_MGR_CLS> * pTHM1176);
868 void UpdateOperatingMode (eTHM1176OperatingMode OperatingMode);
869 void UpdateMeasurement (CMeasurement Measurement);
870 void UpdateErrorList (CErrorList ErrorList);
871
872 // Instrument information and parameter bounds:
873 void UpdateIdentification (sIdentifier Identification);
874 void UpdateRangeList (CFluxList RangeList);
875 void UpdateUnitsList (CTHM1176UnitsList UnitsList);
876 void UpdateDivisorList (CDivisorList DivisorList);
877 void UpdateAveragingParmBounds (sAveraging<sBoundedParm> AveragingParmBounds);
878 void UpdateTriggerParmBounds (sInputTrigger<sBoundedParm> TriggerParmBounds);
879 void UpdateRangeParmBounds (sRange<sBoundedParm> RangeParmBounds);
880
881 // Parameters
882 void UpdateAveragingParms (sAveraging<uParm> AveragingParms);
883 void UpdateTriggerParms (sInputTrigger<uParm> TriggerParms);
884 void UpdateOutputSelect (sArbitraryMeasurements OutputSelect);
885 void UpdateSleepParm (bool SleepParm);
886 void UpdateUnits (eTHM1176Units Units);
887 void UpdateRangeParms (sRange<uParm> RangeParms);
888 void UpdateCommFormat (eCommunicationFormat CommFormat);
889
890public slots:
891 //----------------------------------------------------------------------//
892 // THM1176 Instrument Manager slots //
893 //----------------------------------------------------------------------//
894 // Startup and shutdown:
896 void Start (void);
897
899 void Stop (void);
900
901signals:
902 //----------------------------------------------------------------------//
903 // THM1176 Instrument Manager instrument control signals //
904 //----------------------------------------------------------------------//
910 void SendTrigger (void);
911
919 void SetCalibrationOverride (bool Override);
920
921
922 //----------------------------------------------------------------------//
923 // THM1176 Instrument Manager property change notifications //
924 //----------------------------------------------------------------------//
925 // Basic instrument control:
929
933
937
941
945
946 // Instrument information and parameter bounds:
950
954
958
962
966
970
974
975 // Parameters:
979
983
987
991
995
999
1003
1004 //----------------------------------------------------------------------//
1005 // THM1176 Instrument Manager internal signals //
1006 //----------------------------------------------------------------------//
1009 void StartInstrumentScanner (THM1176_RSRC_MGR_CLS * pResourceManager);
1010
1013
1016 void StartInstrumentController (THM1176_RSRC_MGR_CLS * pResourceManager);
1017
1020
1021 //----------------------------------------------------------------------//
1022 // THM1176 Instrument Manager communication with Instrument Controller //
1023 //----------------------------------------------------------------------//
1024 // Basic instrument control:
1028
1032
1033 // Parameters
1037
1041
1045
1049
1053
1057
1061
1062}; // CTHM1176InstrumentManager
1063
1064} // namespace MTL
unsigned long long U64
64-bit unsigned integer.
Definition OSDefines.h:32
unsigned char U8
Unsigned byte.
Definition OSDefines.h:29
float F32
32-bit floating-point number.
Definition OSDefines.h:33
int I32
32-bit signed integer.
Definition OSDefines.h:27
unsigned int U32
32-bit unsigned integer.
Definition OSDefines.h:31
double F64
64-bit floating-point number.
Definition OSDefines.h:34
unsigned short U16
16-bit unsigned integer.
Definition OSDefines.h:30
Type definitions for THM1176 Instrument Manager.
USBTMC driver based on libusb: interface definition.
C++ wrapper for NI-VISA: interface definition.
Data returned for one measurement.
THM1176 Instrument Controller class: communicate with instrument.
void UpdateOutputSelect(sArbitraryMeasurements OutputSelect)
Signal a change of the output selection parameters.
void UpdateIdentification(sIdentifier Identification)
Signal to report identifier information for newly connected instrument.
~CTHM1176InstrumentController(void) override
Destructor.
void UpdateCurrentInstrument(tResourceName CurrentInstrument)
Signal that current instrument selection has changed.
void UpdateAveragingParms(sAveraging< uParm > AveragingParms)
Signal a change of the averaging parameters.
void UpdateErrorList(CErrorList LatestErrors)
Signal that new errors have been reported.
void UpdateRangeParms(sRange< uParm > RangeParms)
Signal a change of the range parameters.
void UpdateUnitsList(CTHM1176UnitsList UnitsList)
Signal to report list of valid measurement units for newly connected instrument.
void UpdateRangeList(CFluxList RangeList)
Signal to report list of valid ranges for newly connected instrument.
void SetCommFormat(eCommunicationFormat CommFormat)
Set communication format.
void UpdateRangeParmBounds(sRange< sBoundedParm > RangeParmBounds)
Signal to report bounds of range parameters for newly connected instrument.
void UpdateInstrumentList(CResourceList InstrumentList)
Update the Instrument Controller's copy of the list of detected instruments.
void UpdateUnits(eTHM1176Units Units)
Signal a change of the measurement units.
void SetAveragingParms(sAveraging< uParm > AveragingParms)
Set the averaging parameters.
void SetUnits(eTHM1176Units Units)
Select the measurement units.
void SetOutputSelect(sArbitraryMeasurements OutputSelect)
Select what data is returned.
void UpdateTriggerParms(sInputTrigger< uParm > TriggerParms)
Signal a change of the trigger parameters.
void UpdateDivisorList(CDivisorList DivisorList)
Signal to report divisors associated with valid measurement units for newly connected instrument.
void UpdateAveragingParmBounds(sAveraging< sBoundedParm > AveragingParmBounds)
Signal to report bounds of averaging parameters for newly connected instrument.
void Stop(void)
Shut down the Instrument Controller.
void UpdateMeasurement(CMeasurement Measurement)
Signal that a new measurement is available.
void Start(THM1176_RSRC_MGR_CLS *pResourceManager)
Initialize the Instrument Controller.
void SetOperatingMode(eTHM1176OperatingMode OperatingMode)
Set operating mode.
void UpdateSleepParm(bool SleepParm)
Signal a change of the sleep parameter.
void UpdateOperatingMode(eTHM1176OperatingMode OperatingMode)
Signal that the operating mode has changed.
void UpdateTriggerParmBounds(sInputTrigger< sBoundedParm > TriggerParmBounds)
Signal to report bounds of trigger parameters for newly connected instrument.
void SetCurrentInstrument(tResourceName CurrentInstrument)
Select the instrument to connect to.
void UpdateCommFormat(eCommunicationFormat CommFormat)
Signal a change of the communication format.
void SetTriggerParms(sInputTrigger< uParm > TriggerParms)
Set the trigger parameters.
void UpdateInstrumentPointer(CTHM1176Instrument< THM1176_INSTR_CLS, THM1176_RSRC_MGR_CLS > *pTHM1176)
Signal to broadcast updated pointer to THM1176 Instrument object.
void SetRangeParms(sRange< uParm > RangeParms)
Set range parameters.
void SetCalibrationOverride(bool Override)
Set whether or not to override the check for instruments whose zero offset should not be calibrated.
void SetSleepParm(bool SleepParm)
Set whether or not the instrument sleeps after each measurement.
void SetAveragingParms(sAveraging< uParm > AveragingParms)
Set the averaging parameters.
CErrorList GetErrorList(void)
Get the current error list.
void RelayOperatingMode(eTHM1176OperatingMode OperatingMode)
Internal signal to relay the operating mode selection to the Instrument Controller.
sArbitraryMeasurements GetOutputSelect(void)
Get the output selection parameters.
sAveraging< sBoundedParm > AveragingParmBounds
Bounds on averaging parameter.
bool ReadInformationDates(QDateTime &rManufacturingDate, QDateTime &rCalibrationDate)
Fetch the intrument's date information.
static const I32 THM1176_INST_MGR_ERROR
Additional error code: Instrument Manager Error.
eTHM1176Units Units
Current measurement units.
void SetSleepParm(bool SleepParm)
Set the sleep parameter.
eTHM1176Units GetUnits(void)
Get the measurement units.
eTHM1176OperatingMode GetOperatingMode(void)
Get the current operating mode.
sInputTrigger< sBoundedParm > GetTriggerParmBounds(void)
Get the bounds on trigger parameters.
void RelayTriggerParms(sInputTrigger< uParm > TriggerParms)
Internal signal to relay the trigger parameters to the Instrument Controller.
void SetOutputSelect(sArbitraryMeasurements OutputSelect)
Set the output selection parameters.
bool SleepParm
Sleep parameter: true if instrument should sleep after each measurement.
sRange< uParm > RangeParms
Current range parameters.
CTHM1176UnitsList GetUnitsList(void)
Get the list of valid measurement units for this instrument model.
CMeasurement GetMeasurement(void)
Get the last set of measurements.
sInputTrigger< uParm > GetTriggerParms(void)
Get the trigger parameters.
void NotifyTriggerParmBounds(sInputTrigger< sBoundedParm > TriggerParmBounds)
Notify that the bounds on trigger parameters have changed.
static const I32 THM1176_INST_CTLR_ERROR
Additional error code: Instrument Controller Error.
CFluxList RangeList
List of valid ranges for this instrument model.
bool ConvertTimestamp(const U64 RawTimestamp, CAbsoluteTimestamp &rTimestamp)
Convert a raw timestamp to UNIX Epoch time and nanoseconds.
eCommunicationFormat GetCommFormat(void)
Get the communication format parameters.
void RelayCurrentInstrument(tResourceName CurrentInstrument)
Internal signal to relay the instrument selection to the Instrument Controller.
void NotifyAveragingParmBounds(sAveraging< sBoundedParm > AveragingParmBounds)
Notify that the bounds on averaging parameters have changed.
CDivisorList DivisorList
List of divisors for each measurement unit for this instrument model, to convert "base" units to the ...
void NotifyAveragingParms(sAveraging< uParm > AveragingParms)
Notify that the averaging parameters have changed.
sInputTrigger< sBoundedParm > TriggerParmBounds
Bounds on trigger parameters.
bool GetIsTHMNullptr(void)
Get the test result of m_pTHM1176 pointer is Nullptr.
void NotifyUnits(eTHM1176Units Units)
Notify that the measurement units have changed.
sAveraging< uParm > GetAveragingParms(void)
Get the averaging parameters.
void NotifyCurrentInstrument(tResourceName CurrentInstrument)
Notify that the currently connected instrument has changed.
void NotifySleepParm(bool SleepParm)
Notify that the sleep parameter has changed.
void NotifyUnitsList(CTHM1176UnitsList UnitsList)
Notify that the list of valid measurement units has changed.
void NotifyRangeParms(sRange< uParm > RangeParms)
Notify that the range parameters have changed.
bool GetImmediateMeasurementPeriod(const sAveraging< uParm > &rAvg, F64 &rPeriod)
Get measurement interval for Immediate Trigger, for a given averaging parameter.
void SetCalibrationOverride(bool Override)
Set whether or not to override the check for instruments whose zero offset should not be calibrated.
sIdentifier GetIdentification(void)
Get the current instrument's identification information.
void NotifyDivisorList(CDivisorList DivisorList)
Notify that the list of divisors associated with each measurement unit for this instrument model has ...
void SendTrigger(void)
Send a bus trigger to the instrument (both slot and signal).
void RelayAveragingParms(sAveraging< uParm > AveragingParms)
Internal signal to relay the averaging parameters to the Instrument Controller.
void RelayUnits(eTHM1176Units Units)
Internal signal to relay the measurement units to the Instrument Controller.
void RelayOutputSelect(sArbitraryMeasurements OutputSelect)
Internal signal to relay the output selection parameters to the Instrument Controller.
void NotifyCommFormat(eCommunicationFormat CommFormat)
Notify that the communication format parameters have changed.
sArbitraryMeasurements OutputSelect
Output selection parameters: select what data elements are returned.
CMeasurement Measurement
Last measurement set returned.
sRange< sBoundedParm > RangeParmBounds
Bounds on range parameters.
static const I32 THM1176_INST_SCANNER_ERROR
Additional error code: Instrument Scanner Error.
void SetRangeParms(sRange< uParm > RangeParms)
Set the range parameters.
void NotifyMeasurement(CMeasurement Measurement)
Notify that a new set of measurements is available.
bool GetSleepParm(void)
Get the sleep parameter.
void SetOperatingMode(eTHM1176OperatingMode OperatingMode)
Set a new operating mode, for example to start measuring.
void NotifyTriggerParms(sInputTrigger< uParm > TriggerParms)
Notify that the trigger parameters have changed.
void StopInstrumentController(void)
Internal signal to stop the Instrument Controller.
void StopInstrumentScanner(void)
Internal signal to stop the Instrument Scanner.
void NotifyInstrumentList(CResourceList InstrumentList)
Notify that the list of detected instruments has changed.
CResourceList GetInstrumentList(void)
Get the list of connected instruments.
void RelayCommFormat(eCommunicationFormat CommFormat)
Internal signal to relay the communications format to the Instrument Controller.
void SetTriggerParms(sInputTrigger< uParm > TriggerParms)
Set the trigger parameters.
tResourceName CurrentInstrument
Currently connected instrument.
sIdentifier Identification
Identification information of currently connected instrument.
CResourceList InstrumentList
List of detected instruments.
CErrorList ErrorList
Current error list.
void StartInstrumentScanner(THM1176_RSRC_MGR_CLS *pResourceManager)
Internal signal to start the Instrument Scanner.
void SetCommFormat(eCommunicationFormat CommFormat)
Set the communication format parameters.
void StartInstrumentController(THM1176_RSRC_MGR_CLS *pResourceManager)
Internal signal to start to Instrument Controller.
void NotifyRangeParmBounds(sRange< sBoundedParm > RangeParmBounds)
Notify that the bounds on range parameters have changed.
tResourceName GetCurrentInstrument(void)
Get VISA resource name of currently connected instrument.
void NotifyOperatingMode(eTHM1176OperatingMode OperatingMode)
Notify that the operating mode has changed.
void NotifyErrorList(CErrorList ErrorList)
Notify that new errors are present.
void Start(void)
Initialize the THM1176 Instrument Manager.
void RelaySleepParm(bool SleepParm)
Internal signal to relay the sleep parameter to the Instrument Controller.
void NotifyRangeList(CFluxList RangeList)
Notify that the list of valid ranges has changed.
void Stop(void)
Shut down the THM1176 Instrument Manager.
eCommunicationFormat CommFormat
Current communication format parameter.
void RelayRangeParms(sRange< uParm > RangeParms)
Internal signal to relay the range parameters to the Instrument Controller.
sRange< uParm > GetRangeParms(void)
Get the range parameters.
sAveraging< uParm > AveragingParms
Current averaging parameters.
sRange< sBoundedParm > GetRangeParmBounds(void)
Get the bounds on range parameters.
void SetCurrentInstrument(tResourceName CurrentInstrument)
Connect a new instrument.
sAveraging< sBoundedParm > GetAveragingParmBounds(void)
Get the bounds on averaging parameters.
CDivisorList GetDivisorList(void)
Get the list of divisors associated with each measurement unit for this instrument model.
CFluxList GetRangeList(void)
Get list of valid ranges for this instrument model.
void NotifyIdentification(sIdentifier Identification)
Notify that the instrument identification information has changed.
void NotifyOutputSelect(sArbitraryMeasurements OutputSelect)
Notify that the output selection parameters have changed.
sInputTrigger< uParm > TriggerParms
Current trigger parameters.
eTHM1176OperatingMode OperatingMode
Current operating mode.
CTHM1176UnitsList UnitsList
List of valid measurement units for this instrument model.
void SetUnits(eTHM1176Units Units)
Set the measurement units.
THM1176 Instrument Scanner class: scan for connected instruments.
void UpdateErrorList(CErrorList ErrorList)
An update to the error list is available.
~CTHM1176InstrumentScanner(void) override
Destructor.
void Stop(void)
Shut down THM1176 Instrument Scanner.
void Start(THM1176_RSRC_MGR_CLS *pResourceManager)
Initialize THM1176 Instrument Scanner.
void UpdateInstrumentList(CResourceList InstrumentList)
An update to the instrument list is available.
List of VISA resource names.
THM1176 instrument class.
Definition THM1176.h:98
List of divisors, one per measurement unit.
List of errors returned by the instrument.
List of flux density values.
DataType uParm
Parameter template, with only current value.
eCommunicationFormat
Enumeration of possible formats for returned data.
@ kComFormatAscii
Human-legible text.
eUnits
Enumeration of possible measurement units.
std::string tResourceName
IEEE488 resource name.
eTHM1176OperatingMode
Operating modes used to initiate actions or provide status.
@ kTHM1176NotConnected
Disconnect instrument.
eTHM1176Units
Enumeration of possible measurement units, including "ADC".
Specify the measurement data to be returned.
Parameter template, with current/min/max/default values.
Instrument's identification string - parsed version.
Measurement range parameter.