Scope
Scope.h
1 #pragma once
2 
3 #include "ScopeDefines.h"
4 #include "ScopeDatatypes.h"
5 #include "helpers/ScopeNumber.h"
6 #include "helpers/ScopeString.h"
7 #include "helpers/helpers.h"
8 #include "Base.h"
9 #include "Plane.h"
10 #include "Storage.h"
11 #include "Runstates.h"
12 #include "Framescan.h"
13 #include "Devices.h"
14 #include "IO.h"
15 #include "Windows.h"
16 
17 namespace scope {
18 
20 namespace parameters {
21 
22 using boost::property_tree::wptree;
23 
27  : public Base {
28 
29 public:
30  Stimulation();
31 
34 
40 
43 
46 
49 
52 
55 
56  void Load(const wptree& pt) override;
57  void Save(wptree& pt) const override;
58  void SetReadOnlyWhileScanning(const RunState& _runstate) override;
59 };
60 
61 
64 class Area
65  : public Base {
66 
67 public:
70 
73 
76 
79 
81  SCOPE_FPUXYCONTROL_T fpuxystage;
82 
84  SCOPE_FPUZCONTROL_T fpuzstage;
85 
88 
90  std::map<ScannerVectorTypeHelper::Mode, std::unique_ptr<ScannerVectorFrameBasic>> scannervectorframesmap;
91 
102  ScopeNumber<double> micronperpixelx;
103  ScopeNumber<double> micronperpixely;
108 
111 
114 
117 
121  Area(const uint32_t& _area = 0, const bool& _isslave = false, Area * const _masterarea = nullptr);
122 
124  Area(const Area& _other);
125 
127  Area& operator=(const Area& v);
128 
130  virtual ~Area() { }
131 
133  void SetMasterArea(Area* const _masterarea);
134 
136  void CopyFromMasterArea();
137 
140 
143 
146 
149 
152 
153  void Load(const wptree& pt) override;
154  void Save(wptree& pt) const override;
155  void SetReadOnlyWhileScanning(const RunState& _runstate) override;
156 
158  virtual void SaveToPreset(const std::wstring& _name);
159 
161  virtual void LoadFromPreset(const std::wstring& _name);
162 
164  virtual void DeletePreset(const std::wstring& _name);
165 
167  virtual double FrameTime() const;
168 
170  virtual double LineTime() const;
171 
173  virtual uint32_t TotalPixelsAllChannels() const;
174 
176  virtual double XOffsetInMicron() const;
177 
179  virtual double YOffsetInMicron() const;
180 
181 protected:
184  virtual void InitializeConnections();
185 
187  virtual void ChangeScanMode();
188 
190  virtual void UpdateRates();
191 
193  virtual void UpdateFastZCalibration();
194 
196  virtual void CalculateMicronPerPixel();
197 
199  virtual void CalculateResolution();
200 };
201 
204 class Scope
205  : public Base {
206 
207 protected:
209  virtual void UpdateTotaltimeFromFrames();
210 
212  virtual void UpdateFramesFromTotaltime();
213 
214 public:
217 
220 
223 
226 
229 
231  std::array<std::unique_ptr<Area>, SCOPE_NAREAS> areas;
232 
235 
238 
241 
244 
246  SCOPE_XYZCONTROL_T stage;
247 
250 
253 
257 
263 
271 
274 
277 
280 
281 public:
282  Scope();
283 
285  Scope(const Scope& _scope);
286 
288  Scope& operator=(const Scope& _scope);
289 
291  void Load(const std::wstring& filename);
292 
294  void Save(const std::wstring& filename) const;
295 
296  void SetReadOnlyWhileScanning(const RunState& _runstate) override;
297 };
298 
299 
300 }
301 
302 }
Scope & operator=(const Scope &_scope)
Supply assignment operator because of unique_ptr (does deep copy of Areas)
Definition: Scope.cpp:420
Parameters for a whole area (includes a daq and a fpu)
Definition: Scope.h:64
Parameters for timeseries acquisition.
Definition: Runstates.h:66
void Save(wptree &pt) const override
save parameters into a boost:property_tree
Definition: Scope.cpp:32
void Save(wptree &pt) const override
save parameters into a boost:property_tree
Definition: Scope.cpp:203
ScopeNumber< double > ontime
on time of one stimulation pulse
Definition: Scope.h:51
ScopeString commontrigger
The trigger channel which is the internal common master trigger for all devices.
Definition: Scope.h:262
ScopeNumber< double > offtime
off time after stimulation pulse
Definition: Scope.h:54
ScopeNumber< double > masterfovsizey
The same for the y direction.
Definition: Scope.h:273
void CopyFromMasterArea()
Copies parts of the ScannerVectorParameters from the master area's.
Definition: Scope.cpp:143
Area * masterarea
const pointer to the master area parameters (provided in the constructor through parametes::Scope) ...
Definition: Scope.h:75
virtual void DeletePreset(const std::wstring &_name)
Delete preset in currentframe.
Definition: Scope.cpp:253
The master parameters class.
Definition: Scope.h:204
ScopeString date
current date
Definition: Scope.h:216
std::map< ScannerVectorTypeHelper::Mode, std::unique_ptr< ScannerVectorFrameBasic > > scannervectorframesmap
This map contains all ScannerVectors that are supported by the kind of scanner.
Definition: Scope.h:90
virtual void UpdateFramesFromTotaltime()
Updates number of frames from choosen duration and framerate.
Definition: Scope.cpp:470
virtual void LoadFromPreset(const std::wstring &_name)
Load from preset in currentframe.
Definition: Scope.cpp:249
Parameters for a ScannerVectorFrameBiDi.
Definition: Framescan.h:306
Stack stack
the StackParameters
Definition: Scope.h:237
virtual uint32_t TotalPixelsAllChannels() const
total number of pixels summed over all channels
Definition: Scope.cpp:265
WindowCollection frames
The parameters for windows on the screen.
Definition: Scope.h:252
virtual void InitializeConnections()
Helper for constructors and assignment to connect internal ScopeValues (as the connections in ScopeVa...
Definition: Scope.cpp:279
ScopeString comment
a comment, e.g.
Definition: Scope.h:225
virtual ~Area()
Virtual destructor, just in case we derive a something from Area somtime.
Definition: Scope.h:130
std::array< std::unique_ptr< Area >, SCOPE_NAREAS > areas
holds AreaParameters for all areas.
Definition: Scope.h:231
virtual void UpdateTotaltimeFromFrames()
Updates durations of timeseries from choosen frames and framerate.
Definition: Scope.cpp:459
Parameters for a ScannerVectorFrameResonance.
Definition: Framescan.h:439
Parameters for storage.
Definition: Storage.h:19
virtual double FrameTime() const
Time per frame in seconds.
Definition: Scope.cpp:257
All parameters for scanner data generation and pixel acquisition If you add/remove parameters or deri...
Definition: IO.h:747
All parameter classes derive from this.
Definition: Base.h:21
ScopeString channel
digital output channel
Definition: Scope.h:33
void SetMasterArea(Area *const _masterarea)
(Re)set the pointer to the master area e.g.
Definition: Scope.cpp:134
ScopeNumber< bool > enable
stimulation enabled/disabled
Definition: Scope.h:42
SCOPE_XYZCONTROL_T stage
the parameters for the xyz stage (set type in ScopeDefines.h)
Definition: Scope.h:246
virtual void CalculateResolution()
Calculates the x resolution from the x aspect ratio and the y resolution from the y aspect ratio...
Definition: Scope.cpp:333
virtual double LineTime() const
Time per line in seconds.
Definition: Scope.cpp:261
ScopeNumber< double > onset
onset of stimulation
Definition: Scope.h:45
ScopeNumber< double > framerate
Frame repetition rate in Hertz.
Definition: Scope.h:110
void Load(const std::wstring &filename)
Load all from file.
Definition: Scope.cpp:475
ScopeNumber< double > duration
total duration of stimulation
Definition: Scope.h:48
Base class for all Scope datatypes here, provides a uniform interface (and saves typing...).
Parameters for a ScannerVectorFramePlaneHopper.
Definition: Framescan.h:391
ScopeNumber< double > frametime
Time per frame in seconds.
Definition: Scope.h:113
Timeseries timeseries
the TimeseriesParameters
Definition: Scope.h:240
Behavior behavior
the BehaviorParameters
Definition: Scope.h:243
Storage storage
the StorageParameters
Definition: Scope.h:234
virtual void UpdateFastZCalibration()
Updates fast z boundaries on changed fast Z (ETL) calibration file.
Definition: Scope.cpp:319
ScopeNumber< uint32_t > histrange
Histogram range for the areas.
Definition: Scope.h:116
ScopeValue< DaqMode > requested_mode
requested acquisition mode (see DaqModeHelper)
Definition: Scope.h:279
ScopeNumber< double > basemicronperpixelx
Base scale in x direction for 256x256 pixels at zoom 1 and the (maxoutput-minoutput) range set in Daq...
Definition: Scope.h:95
virtual void SaveToPreset(const std::wstring &_name)
Save to preset in currentframe.
Definition: Scope.cpp:245
ScopeString scopecommit
Current version (git commit hash) of Scope.
Definition: Scope.h:222
Parameters for digital stimulation output.
Definition: Scope.h:26
In here all declarations for all kinds of datatypes Scope needs.
Daq daq
the DaqParameters for this area
Definition: Scope.h:78
void SetReadOnlyWhileScanning(const RunState &_runstate) override
set values that must not be changed to read-only during scanning.
Definition: Scope.cpp:566
void Save(const std::wstring &filename) const
Save all to file.
Definition: Scope.cpp:513
void SetReadOnlyWhileScanning(const RunState &_runstate) override
set values that must not be changed to read-only during scanning.
Definition: Scope.cpp:235
ScannerVectorFrameResonance & FrameResonance() const
pointer to the ScannerVectorFrameResonance if implemented or throwing an exception! ...
Definition: Scope.cpp:160
Parameters for a ScannerVectorFrameSaw.
Definition: Framescan.h:210
ScopeNumber< double > basemicronperpixely
Base scale in y direction for 256x256 pixels at zoom 1 and the (maxoutput-minoutput) range set in Daq...
Definition: Scope.h:97
virtual void CalculateMicronPerPixel()
Current scale calculated from micronperpixelx with the resolution set in currentframe.
Definition: Scope.cpp:327
ScannerVectorFramePlaneHopper & FrameHopper() const
pointer to the ScannerVectorFramePlaneHopper if implemented or throwing an exception! ...
Definition: Scope.cpp:172
ScopeNumber< double > masterfovsizex
Size of the maximally reachable field of view.
Definition: Scope.h:270
virtual void ChangeScanMode()
Force update of rates etc.
Definition: Scope.cpp:306
A templated class for a thread-safe value, with signals to GUI or other stuff that are called on valu...
Definition: ScopeValue.h:11
ScopeNumber< double > linerate
Line repetition rate in Hertz.
Definition: Scope.h:107
Area & operator=(const Area &v)
Assignment (deep copy because of the pointers in the map)
Definition: Scope.cpp:106
ScannerVectorFrameSaw & FrameSaw() const
pointer to the ScannerVectorFrameSaw if implemented or throwing an exception!
Definition: Scope.cpp:154
ScopeString time
current time
Definition: Scope.h:219
ScopeValue< RunState > run_state
current RunState
Definition: Scope.h:276
A templated class for a thread-safe std::wstring, with signals that are called on value changes...
Definition: ScopeString.h:8
void SetReadOnlyWhileScanning(const RunState &_runstate) override
set values that must not be changed to read-only during scanning.
Definition: Scope.cpp:42
Parameters for a ScannerVectorFrameBasic.
Definition: Framescan.h:45
ScannerVectorFrameBasic & Currentframe() const
pointer to the current parameters::frame.
Definition: Scope.cpp:150
ScopeNumber< uint32_t > area
the number of this area
Definition: Scope.h:69
void Load(const wptree &pt) override
load parameters from a boost::property_tree
Definition: Scope.cpp:22
Parameters for all frames/windows on screen.
Definition: Windows.h:43
ScopeString timingsource
timing source.
Definition: Scope.h:39
ScannerVectorFrameBiDi & FrameBiDi() const
pointer to the ScannerVectorFrameBiDi if implemented or throwing an exception!
Definition: Scope.cpp:166
Various helper functions and classes for Scope.
SCOPE_FPUZCONTROL_T fpuzstage
the fast z stage parameters for this FPU (set type in ScopeDefines.h)
Definition: Scope.h:84
ScopeNumber< bool > startinputsfirst
true: start inputs first, then outputs with output of area 0 as last, so it (e.g. ...
Definition: Scope.h:256
virtual double XOffsetInMicron() const
Gives the current framescan X offset in micrometers.
Definition: Scope.cpp:269
Parameters for behavior triggered acquisition.
Definition: Runstates.h:109
virtual void UpdateRates()
Updates framerate, frametime, and linerate.
Definition: Scope.cpp:313
ScopeValue< ScannerType > scannertype
Type of scanner in the microscope.
Definition: Scope.h:228
Parameters for stack acquisition.
Definition: Runstates.h:20
ScopeValue< ScannerVectorType > scanmode
the choosen scanner vector type
Definition: Scope.h:87
Stimulation stimulation
the StimulationParameters
Definition: Scope.h:249
void Load(const wptree &pt) override
load parameters from a boost::property_tree
Definition: Scope.cpp:178
virtual double YOffsetInMicron() const
Gives the current framescan Y offset in micrometers.
Definition: Scope.cpp:274
ScopeNumber< bool > isslave
true if this area is a slave area (for an n-beam system)
Definition: Scope.h:72
SCOPE_FPUXYCONTROL_T fpuxystage
the xy stage parameters for this FPU (set type in ScopeDefines.h)
Definition: Scope.h:81
Area(const uint32_t &_area=0, const bool &_isslave=false, Area *const _masterarea=nullptr)
Definition: Scope.cpp:51