THM1176InstrumentDriver 1.1
C++ API for Metrolab THM1176
Loading...
Searching...
No Matches
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
18namespace 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
unsigned long long U64
64-bit unsigned integer.
Definition OSDefines.h:32
float F32
32-bit floating-point number.
Definition OSDefines.h:33
int I32
32-bit signed integer.
Definition OSDefines.h:27
short I16
16-bit signed integer.
Definition OSDefines.h:26
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 C++ API for Metrolab THM1176/TFM1186.
I32 BinaryToI32(const char pBinary[4])
Convert binary to I32, taking into account endedness.
std::string UnitsToString(eUnits Units)
Convert measurement units from enumeration to string.
bool TestTHM1176Types()
Test the conversion routines.
I16 BinaryToI16(const char pBinary[2])
Convert binary to I16, taking into account endedness.
U16 BinaryToU16(const char pBinary[2])
Convert binary to U16 (unimplemented).
F64 BinaryToF64(const char pBinary[8])
Convert binary to F64 (unimplemented).
bool StringToUnits(std::string SUnits, eUnits &rUnits)
Convert measurement units from string to enumeration.
F32 BinaryToF32(const char pBinary[4])
Convert binary to F32 (unimplemented).
eUnits
Enumeration of possible measurement units.
U64 BinaryToU64(const char pBinary[8])
Convert binary to U64 (unimplemented).
U32 BinaryToU32(const char pBinary[4])
Convert binary to U32 (unimplemented).
Definition THM1176.h:73