Scope
XYControl.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 XYControl {
15 
16 protected:
19 
22 
24  std::future<bool> fut;
25 
28 
30  std::array<ScopeNumber<double>*, 2> pos;
31 
33  uint32_t pollinterval;
34 
35 protected:
38 
41 
42 public:
43  XYControl();
44 
46  ~XYControl();
47 
52  virtual void Initialize(parameters::XYControl& _params);
53 
55  virtual void StartPolling();
56 
58  virtual void StopPolling();
59 
61  virtual void UpdatePositionValues();
62 
64  virtual void SetZero() {}
65 
67  virtual void ZeroXAxis() {}
68 
70  virtual void ZeroYAxis() {}
71 
73  virtual void MoveRelative(const double& xrel, const double& yrel) {}
74 
76  virtual void MoveAbsolute(const double& xabs, const double& yabs) {}
77 };
78 
79 }
Main controller of microscope hardware and acquisition, also interface to the GUI.
virtual void ZeroXAxis()
Sets current X position as zero.
Definition: XYControl.h:67
virtual void ZeroYAxis()
Sets current Y position as zero.
Definition: XYControl.h:70
virtual void Initialize(parameters::XYControl &_params)
Initialize hardware.
Definition: XYControl.cpp:17
Thread-safe lock-free bool to signal a requested stop to the worker function currently executed in th...
Definition: helpers.h:87
bool initialized
true if initialized called successfully
Definition: XYControl.h:18
Parameters for a general xy stage.
Definition: Devices.h:134
virtual void StartPolling()
Start the worker function in the pollthread.
Definition: XYControl.cpp:29
virtual void MoveAbsolute(const double &xabs, const double &yabs)
Absolute movement.
Definition: XYControl.h:76
virtual void StopPolling()
Stop the worker function.
Definition: XYControl.cpp:42
uint32_t pollinterval
interval (in milliseconds) to poll device
Definition: XYControl.h:33
std::future< bool > fut
future for the async polling thread
Definition: XYControl.h:24
std::array< ScopeNumber< double > *, 2 > pos
pointers to a ScopeNumber that is updated with the polled x and y positions
Definition: XYControl.h:30
XYControl operator=(XYControl)
disable assignment
virtual void SetZero()
Sets current position as zero.
Definition: XYControl.h:64
StopCondition stop
to signal the async polling thread to stop
Definition: XYControl.h:21
~XYControl()
If pollthread was started, request stop and wait for finish.
Definition: XYControl.cpp:13
A templated class for a thread-safe numeric value, with signals that are called on value changes...
Definition: XYControl.h:7
virtual void MoveRelative(const double &xrel, const double &yrel)
Relative movement.
Definition: XYControl.h:73
Base class to control an xy-stage.
Definition: XYControl.h:14
ScopeController scope_controller
our ScopeController here
Definition: XYControl.h:27
virtual void UpdatePositionValues()
Updates xpos and ypos with the current device position.
Definition: XYControl.cpp:48