GoPxL SDK

- Home
- Files
- Namespace

GoSystem.h
Go to the documentation of this file.
1
9 #ifndef GO_PXL_SDK_SYSTEM_H
10 #define GO_PXL_SDK_SYSTEM_H
11
12 #include <GoPxLSdk/Def.h>
13 #include <GoPxLSdk/GoRestClient.h>
14
15 #include <kApi/kApiDef.h>
16 #include <kApi/Io/kNetwork.h>
17
18 namespace GoPxLSdk
19 {
25 class GoPxLSdkClass GoSystem
26 {
27 /*
28 * Constant member value declarations;
29 */
30 private:
31
46 static constexpr k64u START_TIMEOUT_MSEC = 15000;
47 static constexpr k64u STOP_TIMEOUT_MSEC = 15000;
48 static constexpr k64u RUNNING_STATE_TIMEOUT_MSEC = 15000;
49 static constexpr k64u SENSOR_PATH_TIMEOUT_MSEC = 15000;
50 static constexpr k64u CHILD_PATH_TIMEOUT_MSEC = 15000;
51
52 public:
53 enum class State
54 {
55 Ready = 0,
56 Running = 1,
57 Conflict = 2
58 };
59
71 GoSystem() = default;
72
86 explicit GoSystem(const kIpAddress& address, k32u port = GO_PXL_SDK_DEFAULT_CONTROL_PORT);
87
94 ~GoSystem() = default;
95
104 void SetAddress(const kIpAddress& ipAddress);
105
112 kIpAddress Address() const;
113
123 void SetControlPort(k32u port);
124
131 k32u ControlPort() const;
132
140 void Connect();
141
149 void Disconnect();
150
158 bool IsConnected();
159
170 void Start();
171
182 void Stop();
183
195 State RunningState();
196
204 GoRestClient& Client();
205
218 ResourcePath SensorPath(SerialNum serialNum);
219
220 // Private member variables.
221 private:
222 GoRestClient restClient;
223
224 kIpAddress address = { };
225 k32u port = GO_PXL_SDK_DEFAULT_CONTROL_PORT;
226
227 // Private member functions.
228 private:
240 std::vector<ResourcePath> GetChildPaths(const ResourcePath& path);
241 };
242
243 }
244
245 #endif
GoPxLSdk::SerialNum
std::string SerialNum
Definition: Def.h:50
GoPxLSdkClass
#define GoPxLSdkClass
Definition: Def.h:35
GoPxLSdk::ResourcePath
std::string ResourcePath
Definition: Def.h:51
GoRestClient.h
GoPxLSdk::GoSystem
Represents a single Gocator system.
Definition: GoSystem.h:25
GoPxLSdk::GoRestClient
Definition: GoRestClient.h:36
Def.h
Declares the general SDK definitions.
GoPxLSdk::GoSystem::State
State
Definition: GoSystem.h:53
GO_PXL_SDK_DEFAULT_CONTROL_PORT
constexpr k32u GO_PXL_SDK_DEFAULT_CONTROL_PORT
Definition: Def.h:39
GoPxLSdk
Definition: Def.h:46