Scope
XYZControl.h
1 #pragma once
2 
3 #include "controllers/ScopeController.h"
4 
5 // Forward declarations
6 namespace scope {
7 template <class T> class ScopeNumber;
8 }
9 
10 namespace scope {
11 
14 class XYZControl {
15 
16 protected:
19 
22 
24  std::future<bool> fut;
25 
27  std::array<ScopeNumber<double>*, 3> xyzpos;
28 
30  uint32_t pollinterval;
31 
32 protected:
35 
38 
39 public:
40  XYZControl();
41 
43  ~XYZControl();
44 
50  virtual void Initialize(parameters::XYZControl& _params);
51 
53  virtual void StartPolling();
54 
56  virtual void StopPolling();
57 
59  virtual void UpdatePositionValues();
60 
62  virtual double CurrentXPosition() { return 0.0; }
63 
65  virtual double CurrentYPosition() { return 0.0; }
66 
68  virtual double CurrentZPosition() { return 0.0; }
69 
71  virtual void SetZero();
72 
74  virtual void SetZeroXAxis() {}
75 
77  virtual void SetZeroYAxis() {}
78 
80  virtual void SetZeroZAxis() {}
81 
83  virtual void MoveRelative(const double& _xrel, const double& _yrel, const double& _zrel) {}
84 
86  virtual void MoveAbsolute(const double& _xabs, const double& _yabs, const double& _zabs) {}
87 };
88 
89 }
XYZControl operator=(XYZControl)
disable assignment
uint32_t pollinterval
interval (in milliseconds) to poll device
Definition: XYZControl.h:30
Thread-safe lock-free bool to signal a requested stop to the worker function currently executed in th...
Definition: helpers.h:87
~XYZControl()
If pollthread was started, request stop and wait for finish.
Definition: XYZControl.cpp:12
virtual double CurrentXPosition()
Definition: XYZControl.h:62
virtual double CurrentYPosition()
Definition: XYZControl.h:65
virtual void SetZero()
Sets current xyz position as zero.
Definition: XYZControl.cpp:49
std::future< bool > fut
future for the async polling thread
Definition: XYZControl.h:24
virtual void MoveAbsolute(const double &_xabs, const double &_yabs, const double &_zabs)
Absolute movement in um.
Definition: XYZControl.h:86
bool initialized
true if initialized called successfully
Definition: XYZControl.h:18
virtual void SetZeroYAxis()
Sets current Y position as zero.
Definition: XYZControl.h:77
virtual void MoveRelative(const double &_xrel, const double &_yrel, const double &_zrel)
Relative movement in um.
Definition: XYZControl.h:83
StopCondition stop
to signal the async polling thread to stop
Definition: XYZControl.h:21
virtual void SetZeroZAxis()
Sets current Z position as zero.
Definition: XYZControl.h:80
virtual void SetZeroXAxis()
Sets current X position as zero.
Definition: XYZControl.h:74
Parameters for a general XYZ stage.
Definition: Devices.h:19
virtual void UpdatePositionValues()
Updates xpos, ypos, and zpos with the current device position.
Definition: XYZControl.cpp:45
virtual void Initialize(parameters::XYZControl &_params)
Initialize hardware.
Definition: XYZControl.cpp:16
virtual void StopPolling()
Stop the worker function.
Definition: XYZControl.cpp:39
std::array< ScopeNumber< double > *, 3 > xyzpos
pointers to a ScopeNumber that is updated with the polled x, y, and z positions
Definition: XYZControl.h:27
virtual double CurrentZPosition()
Definition: XYZControl.h:68
virtual void StartPolling()
Start the worker function in the pollthread.
Definition: XYZControl.cpp:29
Base class to control an xyz-stage.
Definition: XYZControl.h:14