THM1176InstrumentManager  1.0
Qt Object abstraction for Metrolab THM1176
THM1176TypeConversions.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 <regex>
14 
15 // Personal includes
16 #include "THM1176Types.h"
17 
18 namespace MTL {
19  namespace Instrument {
20  namespace THM1176Types {
21 
22  //----------------------------------------------------------------------//
23  // Conversion Utilities //
24  //----------------------------------------------------------------------//
25  U16 BinaryToU16(const char pBinary[2]);
26  I16 BinaryToI16(const char pBinary[2]);
27  U32 BinaryToU32(const char pBinary[4]);
28  I32 BinaryToI32(const char pBinary[4]);
29  F32 BinaryToF32(const char pBinary[4]);
30  U64 BinaryToU64(const char pBinary[8]);
31  F64 BinaryToF64(const char pBinary[8]);
32 
37  bool StringToUnits(std::string SUnits, eUnits & rUnits);
38 
42  std::string UnitsToString(eUnits Units);
43 
46  bool TestTHM1176Types();
47 
48  } // namespace THM1176Types
49  } // namespace Instrument
50 } // namespace MTL
MTL::Instrument::THM1176Types::eUnits
eUnits
Enumeration of possible measurement units.
Definition: THM1176Types.h:182
MTL::Instrument::THM1176Types::BinaryToF32
F32 BinaryToF32(const char pBinary[4])
Convert binary to F32 (unimplemented).
F32
float F32
32-bit floating-point number.
Definition: OSDefines.h:34
U64
unsigned long long U64
64-bit unsigned integer.
Definition: OSDefines.h:33
THM1176Types.h
Type definitions for C++ API for Metrolab THM1176/TFM1186.
I16
short I16
16-bit signed integer.
Definition: OSDefines.h:27
MTL::Instrument::THM1176Types::StringToUnits
bool StringToUnits(std::string SUnits, eUnits &rUnits)
Convert measurement units from string to enumeration.
Definition: THM1176TypeConversions.cpp:59
MTL
Definition: CTHM1176InstrumentManager.h:179
MTL::Instrument::THM1176Types::BinaryToF64
F64 BinaryToF64(const char pBinary[8])
Convert binary to F64 (unimplemented).
MTL::Instrument::THM1176Types::UnitsToString
std::string UnitsToString(eUnits Units)
Convert measurement units from enumeration to string.
Definition: THM1176TypeConversions.cpp:73
MTL::Instrument::THM1176Types::TestTHM1176Types
bool TestTHM1176Types()
Test the conversion routines.
Definition: THM1176TypeConversions.cpp:88
MTL::Instrument::THM1176Types::BinaryToI32
I32 BinaryToI32(const char pBinary[4])
Convert binary to I32, taking into account endedness.
Definition: THM1176TypeConversions.cpp:48
I32
int I32
32-bit signed integer.
Definition: OSDefines.h:28
MTL::Instrument::THM1176Types::BinaryToU16
U16 BinaryToU16(const char pBinary[2])
Convert binary to U16 (unimplemented).
MTL::Instrument::THM1176Types::BinaryToU32
U32 BinaryToU32(const char pBinary[4])
Convert binary to U32 (unimplemented).
MTL::Instrument::THM1176Types::BinaryToI16
I16 BinaryToI16(const char pBinary[2])
Convert binary to I16, taking into account endedness.
Definition: THM1176TypeConversions.cpp:37
MTL::Instrument::THM1176Types::BinaryToU64
U64 BinaryToU64(const char pBinary[8])
Convert binary to U64 (unimplemented).
U16
unsigned short U16
16-bit unsigned integer.
Definition: OSDefines.h:31
F64
double F64
64-bit floating-point number.
Definition: OSDefines.h:35
U32
unsigned int U32
32-bit unsigned integer.
Definition: OSDefines.h:32