Main MRPT website
>
C++ reference for MRPT 1.9.9
xSens_MT4
xcommunication
include
xsens
xcommunicationconfig.h
Go to the documentation of this file.
1
/* +------------------------------------------------------------------------+
2
| Mobile Robot Programming Toolkit (MRPT) |
3
| http://www.mrpt.org/ |
4
| |
5
| Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6
| See: http://www.mrpt.org/Authors - All rights reserved. |
7
| Released under BSD License. See details in http://www.mrpt.org/License |
8
+------------------------------------------------------------------------+ */
9
#define XSENS_NO_AUTOLIB
10
// include this file in Visual Studio using C/C++->Advanced->Force Includes (the
11
// /FI option)
12
#ifndef XCOMMUNICATION_CONFIG_H
13
#define XCOMMUNICATION_CONFIG_H
14
15
// define to build with Journaller
16
#ifndef HAVE_JOURNALLER
17
//#define HAVE_JOURNALLER
18
#endif
19
20
//////////////////////////////////////////////////
21
// generic preprocessor defines
22
23
// make sure both _WIN32 and WIN32 are defined if either of them is.
24
#if defined(_WIN32) || defined(_M_IX86)
25
#ifndef WIN32
26
#define WIN32
27
#endif
28
#define XSENS_WINDOWS
29
#endif
30
31
#ifdef WIN32
32
#ifndef _WIN32
33
#define _WIN32
34
#define XSENS_WINDOWS
35
#endif
36
#endif
37
38
#ifdef _WIN32
39
#define USE_WINUSB
40
#else
41
#define XSENS_NO_PORT_NUMBERS
42
#endif
43
44
// make things as secure as possible without modifying the code...
45
#ifndef _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
46
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
47
#endif
48
#ifndef _CRT_SECURE_NO_WARNINGS
49
#define _CRT_SECURE_NO_WARNINGS
50
#endif
51
52
#ifdef __GNUC__
53
#include <limits.h>
54
#if __WORDSIZE == 64
55
#define XSENS_64BIT
56
#else
57
#define XSENS_32BIT
58
#endif
59
#endif
60
61
#if defined(_WIN64) || defined(_M_X64) || defined(_M_IA64)
62
#ifndef XSENS_64BIT
63
#define XSENS_64BIT
64
#endif
65
#ifndef XSENS_WINDOWS
66
#define XSENS_WINDOWS
67
#endif
68
#ifndef WIN64
69
#define WIN64
70
#endif
71
#else
72
#ifndef XSENS_32BIT
73
#define XSENS_32BIT
74
#endif
75
#endif
76
77
// all xsens libraries should use unicode
78
#ifndef UNICODE
79
#define UNICODE
80
#endif
81
82
// use XSENS_32BIT and XSENS_64BIT to check for 32/64 bit builds in your
83
// application
84
// on non-windows systems these should be defined in this file
85
86
/*
87
Configuration | Runtime | DebInfo | Defines
88
--------------+---------------------------------------
89
Debug | MDd | Yes | XSENS_DEBUG;_DEBUG
90
RelWithDeb | MD | Yes | XSENS_DEBUG;XSENS_RELEASE;NDEBUG
91
Release | MD | No | XSENS_RELEASE;NDEBUG
92
93
The common way to setup configuration-dependent defines:
94
#if defined(XSENS_DEBUG)
95
//// Debug or RelWithDeb build
96
#if defined(XSENS_RELEASE)
97
//// RelWithDeb build
98
#else
99
//// Debug build
100
#endif
101
#else
102
//// Release build
103
#endif
104
*/
105
106
#if defined(XSENS_DEBUG)
107
//// Debug or RelWithDeb build
108
#define LOG_RX_TX // Lowest level byte receive and send (binary log)
109
//#define LOG_RX_TX_FLUSH // Flush after each log operation (can cause
110
// hickups in timing, 300ms is not unheard of)
111
112
#if defined(XSENS_RELEASE)
113
//// RelWithDeb build
114
#if !defined(QT_DEBUG) && !defined(QT_NO_DEBUG)
115
#define QT_NO_DEBUG 1
116
#endif
117
#ifdef HAVE_JOURNALLER
118
#define JLLOGLEVEL JLL_DEBUG
119
#define RUN_LL JLL_DEBUG // JLL_ALERT
120
#define DEBUG_LL JLL_ERROR
121
#endif
122
#else
123
//// Debug build
124
#if !defined(QT_DEBUG) && !defined(QT_NO_DEBUG)
125
#define QT_DEBUG 1
126
#endif
127
#ifdef HAVE_JOURNALLER
128
#define JLLOGLEVEL JLL_TRACE
129
#define RUN_LL JLL_DEBUG
130
#define DEBUG_LL JLL_ERROR
131
#endif
132
#endif
133
#else
134
//// Release build
135
#if !defined(QT_DEBUG) && !defined(QT_NO_DEBUG)
136
#define QT_NO_DEBUG 1
137
#endif
138
#ifdef HAVE_JOURNALLER
139
#define JLLOGLEVEL JLL_ALERT
140
#define RUN_LL JLL_ERROR
141
#define DEBUG_LL JLL_FATAL
142
#endif
143
#endif
144
145
//////////////////////////////////////////////////
146
// more generic preprocessor defines
147
//! Add this macro to the start of a class definition to prevent automatic
148
//! creation of copy functions
149
#define XSENS_DISABLE_COPY(className) \
150
private: \
151
className(const className&); \
152
className& operator=(const className&);
153
154
#ifdef __cplusplus
155
#ifdef HAVE_JOURNALLER
156
#include <journaller/journaller.h>
157
#else
158
class
Journaller;
159
#endif
160
extern
Journaller* gJournal;
161
#endif
162
163
#if defined(HAVE_JOURNALLER) && (defined(XSENS_DEBUG) || defined(XS_LOG_ALWAYS))
164
#define XSEXITLOGC(j) \
165
JournalValueJanitor<int> _xsExitLogC( \
166
j, m_lastResult, std::string(__FUNCTION__) + " exit, lastResult = ")
167
#define XSEXITLOGD(j) \
168
XSEXITLOGC(j) // JournalValueJanitor<int> _xsExitLogD(j, d->m_lastResult,
169
// std::string(__FUNCTION__) + " exit, lastResult = ")
170
#define XSEXITLOGN(j) \
171
JournalValueJanitor<std::string> _xsExitLogN( \
172
j, std::string(), std::string(__FUNCTION__) + " exit")
173
#ifndef DIDLOG
174
#define DIDLOG(d) JLHEXLOG(d)
175
#endif
176
#else
177
#define XSEXITLOGC(j) ((void)0)
178
#define XSEXITLOGD(j) ((void)0)
179
#define XSEXITLOGN(j) ((void)0)
180
#ifndef DIDLOG
181
#define DIDLOG(d) ""
182
#endif
183
184
#if !defined(HAVE_JOURNALLER) && !defined(JLDEBUG)
185
#define JLTRACE(...) ((void)0)
186
#define JLTRACE_NODEC(...) ((void)0)
187
#define JLDEBUG(...) ((void)0)
188
#define JLDEBUG_NODEC(...) ((void)0)
189
#define JLALERT(...) ((void)0)
190
#define JLALERT_NODEC(...) ((void)0)
191
#define JLERROR(...) ((void)0)
192
#define JLERROR_NODEC(...) ((void)0)
193
#define JLFATAL(...) ((void)0)
194
#define JLFATAL_NODEC(...) ((void)0)
195
#endif
196
197
#endif
198
199
#endif // file guard
Page generated by
Doxygen 1.8.14
for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019