-
Notifications
You must be signed in to change notification settings - Fork 1
/
vicon.h
164 lines (154 loc) · 3.77 KB
/
vicon.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) OMG Plc 2009.
// All rights reserved. This software is protected by copyright
// law and international treaties. No part of this software / document
// may be reproduced or distributed in any form or by any means,
// whether transiently or incidentally to some other use of this software,
// without the written permission of the copyright owner.
//
///////////////////////////////////////////////////////////////////////////////
#include "Client.h"
#include <iostream>
#include <fstream>
#include <cassert>
#include <ctime>
#include <cstdlib>
#include <sstream>
#ifdef WIN32
#include <conio.h> // For _kbhit()
#include <cstdio> // For getchar()
#include <windows.h> // For Sleep()
#endif // WIN32
#include <time.h>
#include <unistd.h>
using namespace ViconDataStreamSDK::CPP;
namespace
{
std::string Adapt( const bool i_Value )
{
return i_Value ? "True" : "False";
}
std::string Adapt( const Direction::Enum i_Direction )
{
switch( i_Direction )
{
case Direction::Forward:
return "Forward";
case Direction::Backward:
return "Backward";
case Direction::Left:
return "Left";
case Direction::Right:
return "Right";
case Direction::Up:
return "Up";
case Direction::Down:
return "Down";
default:
return "Unknown";
}
}
std::string Adapt( const DeviceType::Enum i_DeviceType )
{
switch( i_DeviceType )
{
case DeviceType::ForcePlate:
return "ForcePlate";
case DeviceType::Unknown:
default:
return "Unknown";
}
}
std::string Adapt( const Unit::Enum i_Unit )
{
switch( i_Unit )
{
case Unit::Meter:
return "Meter";
case Unit::Volt:
return "Volt";
case Unit::NewtonMeter:
return "NewtonMeter";
case Unit::Newton:
return "Newton";
case Unit::Kilogram:
return "Kilogram";
case Unit::Second:
return "Second";
case Unit::Ampere:
return "Ampere";
case Unit::Kelvin:
return "Kelvin";
case Unit::Mole:
return "Mole";
case Unit::Candela:
return "Candela";
case Unit::Radian:
return "Radian";
case Unit::Steradian:
return "Steradian";
case Unit::MeterSquared:
return "MeterSquared";
case Unit::MeterCubed:
return "MeterCubed";
case Unit::MeterPerSecond:
return "MeterPerSecond";
case Unit::MeterPerSecondSquared:
return "MeterPerSecondSquared";
case Unit::RadianPerSecond:
return "RadianPerSecond";
case Unit::RadianPerSecondSquared:
return "RadianPerSecondSquared";
case Unit::Hertz:
return "Hertz";
case Unit::Joule:
return "Joule";
case Unit::Watt:
return "Watt";
case Unit::Pascal:
return "Pascal";
case Unit::Lumen:
return "Lumen";
case Unit::Lux:
return "Lux";
case Unit::Coulomb:
return "Coulomb";
case Unit::Ohm:
return "Ohm";
case Unit::Farad:
return "Farad";
case Unit::Weber:
return "Weber";
case Unit::Tesla:
return "Tesla";
case Unit::Henry:
return "Henry";
case Unit::Siemens:
return "Siemens";
case Unit::Becquerel:
return "Becquerel";
case Unit::Gray:
return "Gray";
case Unit::Sievert:
return "Sievert";
case Unit::Katal:
return "Katal";
case Unit::Unknown:
default:
return "Unknown";
}
}
#ifdef WIN32
bool Hit()
{
bool hit = false;
while( _kbhit() )
{
getchar();
hit = true;
}
return hit;
}
#endif
}