THM1176InstrumentDriver  1.0
C++ API for Metrolab THM1176
THM1176.cpp File Reference

THM1176 API. More...

#include <regex>
#include <thread>
#include <chrono>
#include <set>
#include <iostream>
#include "THM1176.h"
#include "THM1176TypeConversions.h"
#include "OSDefines.h"
#include "Helpers.h"
#include "Exception.h"
#include "SCPIParsing.h"
#include <sstream>
#include <iomanip>
#include <locale>
Include dependency graph for THM1176.cpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEBUG_MTL_INSTRUMENT_THM1176   1
 
#define DEBUG_MTL_INSTRUMENT_THM1176_ERRORS_ONLY   0
 
#define MTL_INSTRUMENT_THM1176_DEBUG_COUT(__X__)
 
#define MTL_INSTRUMENT_THM1176_DEBUG_CERR(__X__)
 

Functions

static const I32 THM1176_FATAL_ERROR_CODE_LIMIT (200)
 
static const U32 THM1176_FILE_ACCESS_TIMEOUT (20000)
 
static const U32 THM1176_CALIBRATION_TIMEOUT (30000)
 
static const std::string THM1176_CALIBRATION_FILE_NAME ("cal.dat")
 
static const std::string THM1176_INFO_FILE_NAME ("info.dat")
 
static const U32 THM1176_CAL_FILE_OFFSET_VERSION (32)
 
static const U32 THM1176_CAL_FILE_OFFSET_MATRIX_V2 (116)
 
static const F64 THM1176_IMMEDIATE_TIME_PER_ACQ (1.0281823091218700E-04)
 
static const F64 THM1176_IMMEDIATE_TIME_PER_MEAS (4.4532792007542600E-05)
 
static std::string l_ToString (F32 number, int precision=7, const char *locale="C")
 
static std::string l_ToString (F64 number, int precision=15, const char *locale="C")
 
static void l_ParseErrorString (std::string &rErrStr, const std::string &rContext, sError &rError)
 
static std::string l_ParseRegexError (std::regex_error &rE)
 

Variables

static const char * STATUS_SET_CMDS [4][3]
 
static const char * STATUS_GET_CMDS [4][3]
 
static const std::set< std::string > MODELS_NOT_TO_CALIBRATE
 

Detailed Description

THM1176 API.

Definition in file THM1176.cpp.

Macro Definition Documentation

◆ DEBUG_MTL_INSTRUMENT_THM1176

#define DEBUG_MTL_INSTRUMENT_THM1176   1

Definition at line 26 of file THM1176.cpp.

◆ DEBUG_MTL_INSTRUMENT_THM1176_ERRORS_ONLY

#define DEBUG_MTL_INSTRUMENT_THM1176_ERRORS_ONLY   0

Definition at line 27 of file THM1176.cpp.

◆ MTL_INSTRUMENT_THM1176_DEBUG_CERR

#define MTL_INSTRUMENT_THM1176_DEBUG_CERR (   __X__)

Definition at line 37 of file THM1176.cpp.

◆ MTL_INSTRUMENT_THM1176_DEBUG_COUT

#define MTL_INSTRUMENT_THM1176_DEBUG_COUT (   __X__)

Definition at line 36 of file THM1176.cpp.

Function Documentation

◆ l_ParseErrorString()

static void l_ParseErrorString ( std::string &  rErrStr,
const std::string &  rContext,
sError rError 
)
static

Definition at line 111 of file THM1176.cpp.

◆ l_ParseRegexError()

static std::string l_ParseRegexError ( std::regex_error &  rE)
static

Definition at line 123 of file THM1176.cpp.

◆ l_ToString() [1/2]

static std::string l_ToString ( F32  number,
int  precision = 7,
const char *  locale = "C" 
)
static

Definition at line 84 of file THM1176.cpp.

◆ l_ToString() [2/2]

static std::string l_ToString ( F64  number,
int  precision = 15,
const char *  locale = "C" 
)
static

Definition at line 96 of file THM1176.cpp.

◆ THM1176_CAL_FILE_OFFSET_MATRIX_V2()

static const U32 THM1176_CAL_FILE_OFFSET_MATRIX_V2 ( 116  )
static

◆ THM1176_CAL_FILE_OFFSET_VERSION()

static const U32 THM1176_CAL_FILE_OFFSET_VERSION ( 32  )
static

◆ THM1176_CALIBRATION_FILE_NAME()

static const std::string THM1176_CALIBRATION_FILE_NAME ( "cal.dat"  )
static

◆ THM1176_CALIBRATION_TIMEOUT()

static const U32 THM1176_CALIBRATION_TIMEOUT ( 30000  )
static

◆ THM1176_FATAL_ERROR_CODE_LIMIT()

static const I32 THM1176_FATAL_ERROR_CODE_LIMIT ( 200  )
static

◆ THM1176_FILE_ACCESS_TIMEOUT()

static const U32 THM1176_FILE_ACCESS_TIMEOUT ( 20000  )
static

◆ THM1176_IMMEDIATE_TIME_PER_ACQ()

static const F64 THM1176_IMMEDIATE_TIME_PER_ACQ ( 1.0281823091218700E-  04)
static

◆ THM1176_IMMEDIATE_TIME_PER_MEAS()

static const F64 THM1176_IMMEDIATE_TIME_PER_MEAS ( 4.4532792007542600E-  05)
static

◆ THM1176_INFO_FILE_NAME()

static const std::string THM1176_INFO_FILE_NAME ( "info.dat"  )
static

Variable Documentation

◆ MODELS_NOT_TO_CALIBRATE

const std::set<std::string> MODELS_NOT_TO_CALIBRATE
static
Initial value:
=
{
std::string("TFM1186")
}

Definition at line 66 of file THM1176.cpp.

◆ STATUS_GET_CMDS

const char* STATUS_GET_CMDS[4][3]
static
Initial value:
=
{
{ "*STB?", "", "*SRE?" },
{ "*ESR?", "", "*ESE?" },
{ ":STAT:QUES:EVEN?", ":STAT:QUES:COND?", ":STAT:QUES:ENAB?" },
{ ":STAT:OPER:EVEN?", ":STAT:OPER:COND?", ":STAT:OPER:ENAB?" }
}

Definition at line 58 of file THM1176.cpp.

◆ STATUS_SET_CMDS

const char* STATUS_SET_CMDS[4][3]
static
Initial value:
=
{
{ "", "", "*SRE" },
{ "", "", "*ESE" },
{ "", "", ":STAT:QUES:ENAB" },
{ "", "", ":STAT:OPER:ENAB" }
}

Definition at line 50 of file THM1176.cpp.