C++Instrument Catalog MFC 1.2
Metrolab C++InstrumentCatalog for MFC
Loading...
Searching...
No Matches
MFC3045Device.h
Go to the documentation of this file.
1
5
6#pragma once
7
8// Standard includes
9#include <string>
10
11// Personal includes
12#include "VISAInstrument.h"
13#include "MFC3045.h"
14#include "MFCDevice.h"
15#include "InstrumentCatalog.h"
16#include "MFCController.h"
17#include "Helpers.h"
18
19using namespace MTL;
20using namespace MTL::Instrument;
21
22namespace MTL {
23
24 //--------------------------------------------------------------------------//
25 // MFC3045 Device
26 //--------------------------------------------------------------------------//
27
29 {
30 //--------------------------------------------------------------------------//
31 // Attributes
32 //--------------------------------------------------------------------------//
33 private:
34 CMFCController & m_rMFCController;
35 CMFC3045Instrument m_MFC3045;
36 sSerialPortSettings m_SerialParms;
37
38 std::string m_PaSerialNum;
39 U8 m_NbProbesPA;
41 U64 m_MaxMeasTimeOutMs;
42 sStatusAllReg m_AllRegStatus;
43
44 MTL::CerrSinkRedir::tOutputSink m_PreviousCerrSink; //to store previous CERR sink before redirection
45
46 //constants:
47 const int SEARCH_POLLING_PERIOD_MS = 100;
48 const int MEAS_POLLING_PERIOD_MS = 100;
49
50 //--------------------------------------------------------------------------//
51 // Constructor / Destructor
52 //--------------------------------------------------------------------------//
53 public:
54 CMFC3045Device ( CMFCController & rMFCController, CVISAResourceManager & rRM,
56 virtual ~CMFC3045Device ();
57
58 //--------------------------------------------------------------------------//
59 // Utilities
60 //--------------------------------------------------------------------------//
61 private:
62 F32 l_ConvertNormdHzToMHz (const I32 & rFreqdHz);
63 I32 l_ConvertNormMHzTodHz (const F32 & rFreqMHz);
64
65 bool l_UtcToStrDateISO8601(const std::time_t & rUtcDate, std::string & rStrDate);
66 bool l_ParseSerialSettings ( const CInstrumentCatalog::sMFC3045SerialPortSettings & rSerialSetting,
67 sSerialPortSettings & rVisaSerialSetting);
68 bool l_SerialCommunicationSuccess();
69 bool l_CheckPAConnected(bool & rPAPresent);
70 bool l_ConfigurationChanged (CInstrumentCatalog::sInstrumentState lastcfg, CInstrumentCatalog::sInstrumentState newcfg);
71 bool l_ConfigureForOperation (const CInstrumentCatalog::sInstrumentState & rInstrState, sMFCDeviceError & rError);
72 bool l_ComputeMaxMeasTimeout(U64 & rMaxTimeOutMs);
73 void l_ComputeAveraging (const std::vector<U32> & rFluxListdHz, F64 & rReturnedAveragingMHz, F64 & rReturnedStdDevppm);
74 bool l_WriteNormalizationRAM(const CInstrumentCatalog::tNormalizationTable & rNewNormalizationTable, sMFCDeviceError & rError);
75
76 public:
77 bool AbortInstrument ();
81
82 //--------------------------------------------------------------------------//
83 // Available Operations
84 //--------------------------------------------------------------------------//
85 public:
88 CInstrumentCatalog::sInstrumentConfiguration & rInstrConfig, bool &rPaInfoChanged);
92 CInstrumentCatalog::sNormalization & rReturnedNormalization);
95 sMFCDeviceError RemoteBoxButtonStatus (bool & rRemoteStartPressed);
97 }; // class
98} // namespace MTL
Interface definition for C++ API for Metrolab MFC3045.
Collection of utility macros for error messages.
C++ wrapper for NI-VISA: interface definition.
std::string tResourceName
std::function< void(const std::string &)> tOutputSink
Definition Helpers.h:33
std::vector< tNormalizationCorrection > tNormalizationTable
sMFCDeviceError ChangeSerialParmsOnConnectedInstr(const CInstrumentCatalog::sMFC3045SerialPortSettings &rNewSerialSetting)
sMFCDeviceError Measure(const CInstrumentCatalog::sInstrumentState &rInstrState)
CMFC3045Device(CMFCController &rMFCController, CVISAResourceManager &rRM, tResourceName Rsrc, CInstrumentCatalog::sMFC3045SerialPortSettings &rSerialSetting)
sMFCDeviceError GetNormalizationDate(CInstrumentCatalog::tISO8601DateTime &rNormDate)
sMFCDeviceError NewNormalizationRequest(const CInstrumentCatalog::sNormalization &rNewNormalizationRequest, CInstrumentCatalog::sNormalization &rReturnedNormalization)
sMFCDeviceError ScanPA(CInstrumentCatalog::sProbeArrayInformation &rPAInfo, CInstrumentCatalog::sInstrumentConfiguration &rInstrConfig, bool &rPaInfoChanged)
sMFCDeviceError RemoteBoxButtonStatus(bool &rRemoteStartPressed)
sMFCDeviceError Search(const CInstrumentCatalog::sInstrumentState &rInstrState)
sMFCDeviceError Connect(CInstrumentCatalog::sInstrumentInformation &rInstrInfo)
sMFCDeviceError SetRBBusyLedState(const CInstrumentCatalog::eRemoteBoxBusyLedState &rRBBusyLedState)
MFC3045 instrument class.
Definition MFC3045.h:27
VISA Resource Manager class.