Main MRPT website > C++ reference for MRPT 1.9.9
xssyncsetting.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-2018, 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 #ifndef XSSYNCSETTINGS_H
10 #define XSSYNCSETTINGS_H
11 
12 #include "pstdint.h"
13 #include "xstypesconfig.h"
14 #include "xssyncline.h"
15 #include "xssyncfunction.h"
16 #include "xssyncpolarity.h"
17 
18 struct XsSyncSetting;
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #else
23 #define XSSYNCSETTINGS_INITIALIZER \
24  { \
25  XSL_Invalid, XSF_Invalid, XSP_None, 1, 0, 0, 0, 0, 0 \
26  }
27 #endif
28 
29 XSTYPES_DLL_API int XsSyncSetting_isInput(const struct XsSyncSetting* thisPtr);
30 XSTYPES_DLL_API int XsSyncSetting_isOutput(const struct XsSyncSetting* thisPtr);
32  struct XsSyncSetting* a, struct XsSyncSetting* b);
33 
34 #ifdef __cplusplus
35 } // extern "C"
36 #endif
37 
38 /*! \brief A structure for storing all xsens sync settings */
40 {
41  XsSyncLine m_line; /*!< The sync lines enabled. \see XsSyncLine. */
42  XsSyncFunction m_function; /*!< The action to be performed, when an input
43  sync line changes \see XsSyncFunction. */
44  XsSyncPolarity m_polarity; /*!< The edge on which the action is performed,
45  \see XsSyncPolarity. */
46  uint32_t m_pulseWidth; /*!< The time to keep the line polarity before
47  toggling back, in microseconds. */
48  int32_t m_offset; /*!< The time between reception of a line change and the
49  execution of the sync action, in microseconds. */
50  uint16_t m_skipFirst; /*!< The number of frames to skip before executing the
51  action. */
52  uint16_t
53  m_skipFactor; /*!< The number of frames to skip between 2 actions. */
54  uint16_t m_clockPeriod; /*!< The frequency of the external clock in
55  milliseconds, only valid when action is
56  STE_ResetTimer. */
57  uint8_t
58  m_triggerOnce; /*!< Whether the action is repeated for each frame. */
59 
60 #ifdef __cplusplus
61  //! \brief Default constructor, initializes to the given (default) settings
62  explicit XsSyncSetting(
64  XsSyncPolarity polarity = XSP_RisingEdge, uint32_t pulseWidth = 1000,
65  int32_t offset = 0, uint16_t skipFirst = 0, uint16_t skipFactor = 0,
66  uint16_t clockPeriod = 0, uint8_t triggerOnce = 0)
67  : m_line(line),
68  m_function(function),
69  m_polarity(polarity),
70  m_pulseWidth(pulseWidth),
72  m_skipFirst(skipFirst),
73  m_skipFactor(skipFactor),
74  m_clockPeriod(clockPeriod),
75  m_triggerOnce(triggerOnce)
76  {
77  }
78 
79  //! \brief Construct a XsSyncSetting as a copy of \a other.
80  XsSyncSetting(const XsSyncSetting& other)
81  {
82  memcpy(this, &other, sizeof(XsSyncSetting));
83  }
84 
85  //! \brief Copy values of \a other into this.
86  const XsSyncSetting& operator=(const XsSyncSetting& other)
87  {
88  if (this != &other) memcpy(this, &other, sizeof(XsSyncSetting));
89  return *this;
90  }
91 
92  //! \brief \copybrief XsSyncSetting_isInput
93  inline bool isInput() const { return 0 != XsSyncSetting_isInput(this); }
94  //! \brief \copybrief XsSyncSetting_isOutput
95  inline bool isOutput() const { return 0 != XsSyncSetting_isOutput(this); }
96  /*! \brief Swap the contents with \a other
97  */
98  inline void swap(XsSyncSetting& other) { XsSyncSetting_swap(this, &other); }
99  /*! \brief Return true if \a other is identical to this
100  */
101  inline bool operator==(const XsSyncSetting& other) const
102  {
103  return (this == &other) ||
104  (m_line == other.m_line && m_function == other.m_function &&
105  m_polarity == other.m_polarity &&
106  m_pulseWidth == other.m_pulseWidth &&
107  m_offset == other.m_offset &&
108  m_skipFirst == other.m_skipFirst &&
109  m_skipFactor == other.m_skipFactor &&
110  m_clockPeriod == other.m_clockPeriod &&
111  m_triggerOnce == other.m_triggerOnce);
112  }
113 #endif
114 };
115 
117 
118 #endif // file guard
xssyncline.h
XsSyncSetting_isOutput
XSTYPES_DLL_API int XsSyncSetting_isOutput(const struct XsSyncSetting *thisPtr)
uint16_t
unsigned __int16 uint16_t
Definition: rptypes.h:44
XSL_Invalid
@ XSL_Invalid
Definition: xssyncline.h:42
XsSyncSetting::m_skipFirst
uint16_t m_skipFirst
Definition: xssyncsetting.h:50
uint8_t
unsigned char uint8_t
Definition: rptypes.h:41
mrpt::img::operator==
bool operator==(const mrpt::img::TCamera &a, const mrpt::img::TCamera &b)
Definition: TCamera.cpp:201
XsSyncPolarity
XsSyncPolarity
Signal polarity.
Definition: xssyncpolarity.h:16
offset
GLintptr offset
Definition: glext.h:3925
XsSyncSetting::m_clockPeriod
uint16_t m_clockPeriod
Definition: xssyncsetting.h:54
XsSyncSetting::m_line
XsSyncLine m_line
Definition: xssyncsetting.h:41
XsSyncSetting
struct XsSyncSetting XsSyncSetting
Definition: xssyncsetting.h:116
xssyncfunction.h
b
GLubyte GLubyte b
Definition: glext.h:6279
XsSyncSetting::m_function
XsSyncFunction m_function
Definition: xssyncsetting.h:42
XsSyncSetting
A structure for storing all xsens sync settings.
Definition: xssyncsetting.h:39
XsSyncSetting::m_pulseWidth
uint32_t m_pulseWidth
Definition: xssyncsetting.h:46
xstypesconfig.h
int32_t
__int32 int32_t
Definition: rptypes.h:46
pstdint.h
XSP_RisingEdge
@ XSP_RisingEdge
React to a rising edge on input.
Definition: xssyncpolarity.h:20
XsSyncSetting::m_polarity
XsSyncPolarity m_polarity
Definition: xssyncsetting.h:44
XsSyncLine
XsSyncLine
Synchronization line identifiers.
Definition: xssyncline.h:16
XSTYPES_DLL_API
#define XSTYPES_DLL_API
Definition: xstypesconfig.h:9
XsSyncSetting::m_skipFactor
uint16_t m_skipFactor
Definition: xssyncsetting.h:53
XsSyncSetting::m_offset
int32_t m_offset
Definition: xssyncsetting.h:48
XsSyncSetting_isInput
XSTYPES_DLL_API int XsSyncSetting_isInput(const struct XsSyncSetting *thisPtr)
XSF_Invalid
@ XSF_Invalid
Invalid action.
Definition: xssyncfunction.h:54
XsSyncFunction
XsSyncFunction
Actions to be taken on input triggers.
Definition: xssyncfunction.h:16
xssyncpolarity.h
XsSyncSetting_swap
XSTYPES_DLL_API void XsSyncSetting_swap(struct XsSyncSetting *a, struct XsSyncSetting *b)
uint32_t
unsigned __int32 uint32_t
Definition: rptypes.h:47
a
GLubyte GLubyte GLubyte a
Definition: glext.h:6279
XsSyncSetting::m_triggerOnce
uint8_t m_triggerOnce
Definition: xssyncsetting.h:58
mrpt::system::os::memcpy
void memcpy(void *dest, size_t destSize, const void *src, size_t copyCount) noexcept
An OS and compiler independent version of "memcpy".
Definition: os.cpp:356



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST