Scope
Shutter.h
1 #pragma once
2 
3 #include "daqmx/DAQmxTask.h"
4 
5 namespace scope {
6 
9 class Shutter {
10 
11 protected:
14 
16  mutable std::atomic<bool> state;
17 
19  const uint8_t ondata;
20 
22  const uint8_t offdata;
23 
24 public:
25  Shutter();
26 
28  ~Shutter();
29 
31  void Initialize(const std::wstring& _outputline);
32 
34  void Open(void);
35 
37  void Close(void);
38 
40  void Set(const bool& _open);
41 
43  bool GetState() const { return state; }
44 };
45 
46 }
void Set(const bool &_open)
Open/Closes the shutter.
Definition: Shutter.cpp:40
void Open(void)
Opens the shutter.
Definition: Shutter.cpp:26
bool GetState() const
Definition: Shutter.h:43
~Shutter()
Shutter gets closed on destruction.
Definition: Shutter.cpp:13
void Close(void)
Closes the shutter.
Definition: Shutter.cpp:33
void Initialize(const std::wstring &_outputline)
Shutter gets closed on initialization.
Definition: Shutter.cpp:18
Wraps a DAQmx Digital Output task.
Definition: DAQmxTask.h:224
const uint8_t ondata
a one
Definition: Shutter.h:19
const uint8_t offdata
a zero
Definition: Shutter.h:22
Controls a shutter via DAQmx one line digital output.
Definition: Shutter.h:9
std::atomic< bool > state
current shutter state
Definition: Shutter.h:16
DAQmx::CDAQmxDigitalOutTask task
the DAQmx task
Definition: Shutter.h:13