12 ScannerVectorFrameBasic::Preset::Preset()
13 : name(L
"None", L
"Name")
14 , pixeltime(10, 0.4, 15, L
"Pixeltime_us")
15 , scannerdelay(0, -1000, 1000, L
"Scannerdelay_us")
16 , averages(1, 1, 32, L
"Averages")
17 , xres(256, 16, 10000, L
"XResolution_Pixel")
18 , yres(256, 16, 10000, L
"YResolution_Pixel")
19 , xaspectratio(1, 0.0001, 10000, L
"XAspectRatio")
20 , yaspectratio(1, 0.0001, 10000, L
"YAspectRatio")
21 , squarepixels(false, false, true, L
"SquarePixels") {
37 name.AddToPropertyTree(pt);
38 pixeltime.AddToPropertyTree(pt);
39 scannerdelay.AddToPropertyTree(pt);
40 averages.AddToPropertyTree(pt);
48 ScannerVectorFrameBasic::ScannerVectorFrameBasic()
50 ,
xres(256, 16, 10000, L
"XResolution_Pixel")
51 ,
yres(256, 16, 10000, L
"YResolution_Pixel")
55 ,
zoom(1.0, 1.0 , 20.0, L
"Zoom")
56 ,
xoffset(0.0, -1.0, 1.0, L
"XOffset_Fraction")
57 ,
yoffset(0.0, -1.0, 1.0, L
"YOffset_Fraction")
58 ,
fastz(0.0, -5.0, 5.0, L
"FastZ_um")
59 ,
pockels(0.0, 0.0, 1.0, L
"Pockels_Fraction")
60 ,
xrotation(0.0, 0.0, 90.0, L
"XRotation_Degree")
61 ,
yrotation(0.0, 0.0, 90.0, L
"YRotation_Degree") {
80 wptree presetstree = pt.get_child(L
"presets");
81 for (
auto subtree : presetstree ) {
84 std::shared_ptr<ScannerVectorFrameBasic::Preset> p =
MakePreset();
85 p->Load(subtree.second);
88 }
catch (boost::property_tree::ptree_bad_path) {
89 DBOUT(L
"Bad path while loading presets");
112 name.Format(L
"preset%d", i++);
113 ptpresets.add_child(name.GetString(), subtree);
115 pt.add_child(L
"presets", ptpresets);
119 switch ( static_cast<RunStateHelper::Mode>(_runstate) ) {
120 case RunStateHelper::Mode::Stopped:
136 case RunStateHelper::Mode::RunningSingle:
137 case RunStateHelper::Mode::RunningStack:
138 case RunStateHelper::Mode::RunningTimeseries:
147 case RunStateHelper::Mode::RunningContinuous:
164 auto samename = std::find_if(std::begin(
presets), std::end(
presets), [&](std::shared_ptr<ScannerVectorFrameBasic::Preset> _pres)
165 {
return _pres->name() == _name; } );
166 if (
presets.end() != samename )
179 case ScannerVectorTypeHelper::Sawtooth:
181 case ScannerVectorTypeHelper::Bidirectional:
183 case ScannerVectorTypeHelper::Planehopper:
191 std::vector<boost::signals2::connection> conns;
232 ScannerVectorFrameSaw::ScannerVectorFrameSaw()
233 : xcutoff(0.1, 0, 0.5, L
"XCutoff_Fraction")
234 , ycutoff(0.1, 0, 0.5, L
"YCutoff_Fraction")
235 , xretrace(0.1, 0, 0.5, L
"XRetrace_Fraction")
236 , yretrace(0.1, 0, 0.5, L
"YRetrace_Fraction") {
272 ScannerVectorFrameSaw::Preset::Preset()
273 : xcutoff(0.1, 0, 0.5, L
"XCutoff_Fraction")
274 , ycutoff(0.1, 0, 0.5, L
"YCutoff_Fraction")
275 , xretrace(0.1, 0, 0.5, L
"XRetrace_Fraction")
276 , yretrace(0.1, 0, 0.5, L
"YRetrace_Fraction") {
313 bool enabler = (
static_cast<RunStateHelper::Mode>(_runstate)==RunStateHelper::Mode::Stopped)?
true:
false;
326 std::shared_ptr<Preset> p = std::make_shared<Preset>();
337 auto samename = std::find_if(std::begin(
presets), std::end(
presets), [&](std::shared_ptr<ScannerVectorFrameBasic::Preset> _pres)
338 {
return _pres->name() == _name; } );
339 if (
presets.end() != samename )
345 auto which = std::find_if(std::begin(
presets), std::end(
presets), [&](std::shared_ptr<ScannerVectorFrameBasic::Preset> _pres)
346 {
return _pres->name() == _name; } );
347 if ( which == std::end(
presets) )
352 _daq.
averages = (*which)->averages();
353 xres = (*which)->xres();
354 yres = (*which)->yres();
364 ScannerVectorFrameBiDi::ScannerVectorFrameBiDi()
365 : xturnfraction(0.1, 0, 0.5, L
"XTurning_Fraction")
366 ,
ycutoff(0.1, 0, 0.5, L
"YCutoff_Fraction")
367 ,
yretrace(0.1, 0, 0.5, L
"YRetrace_Fraction") {
399 ScannerVectorFrameBiDi::Preset::Preset()
400 : xturnfraction(0.1, 0, 0.5, L
"XTurning_Fraction")
401 , ycutoff(0.1, 0, 0.5, L
"YCutoff_Fraction")
402 , yretrace(0.1, 0, 0.5, L
"YRetrace_Fraction") {
435 bool enabler = (
static_cast<RunStateHelper::Mode>(_runstate)==RunStateHelper::Mode::Stopped)?
true:
false;
446 std::shared_ptr<Preset> p = std::make_shared<Preset>();
456 auto samename = std::find_if(std::begin(
presets), std::end(
presets), [&](std::shared_ptr<ScannerVectorFrameBasic::Preset> _pres)
457 {
return _pres->name() == _name; } );
458 if (
presets.end() != samename )
464 auto which = std::find_if(std::begin(
presets), std::end(
presets), [&](std::shared_ptr<ScannerVectorFrameBasic::Preset> _pres)
465 {
return _pres->name() == _name; } );
466 if ( which == std::end(
presets) )
470 _daq.
averages = (*which)->averages();
471 xres = (*which)->xres();
472 yres = (*which)->yres();
479 ScannerVectorFramePlaneHopper::Preset::Preset()
485 for (
auto& p :
planes ) {
486 conns.push_back(p.pockels.ConnectOther(_slot));
487 conns.push_back(p.position.ConnectOther(_slot));
495 for (
auto& p :
planes ) {
496 p.pockels.ConnectOther(_slot);
497 p.position.ConnectOther(_slot);
503 for (
auto& p :
planes ) {
504 p.pockels.ConnectOther(_slot);
505 p.position.ConnectOther(_slot);
511 for (
auto& p :
planes ) {
512 p.pockels.ConnectOther(_slot);
513 p.position.ConnectOther(_slot);
527 ScannerVectorFramePlaneHopper::ScannerVectorFramePlaneHopper()
540 std::wstring name(L
"");
542 for (
const auto& p :
planes ) {
544 p.position.AddToPropertyTree(pt);
545 p.pockels.AddToPropertyTree(pt);
558 std::shared_ptr<Preset> p = std::make_shared<Preset>();
566 auto samename = std::find_if(std::begin(
presets), std::end(
presets), [&](std::shared_ptr<ScannerVectorFrameBasic::Preset> _pres)
567 {
return _pres->name() == _name; } );
568 if (
presets.end() != samename )
575 auto which = std::find_if(std::begin(
presets), std::end(
presets), [&](std::shared_ptr<ScannerVectorFrameBasic::Preset> _pres)
576 {
return _pres->name() == _name; } );
577 if ( which == std::end(
presets) )
581 _daq.
averages = (*which)->averages();
582 xres = (*which)->xres();
583 yres = (*which)->yres();
589 ScannerVectorFrameResonance::ScannerVectorFrameResonance()
590 : xturnfraction(0.1, 0, 0.5, L
"XTurning_Fraction")
591 , ycutoff(0.1, 0, 0.5, L
"YCutoff_Fraction")
592 , yretrace(0.1, 0, 0.5, L
"YRetrace_Fraction")
593 , waitafterenqueuestorage(2, 0, 1000, L
"WaitAfterEnqueueStorage_Millisecond")
594 , waitafterenqueuedisplay(5, 0, 1000, L
"WaitAfterEnqueueDisplay_Millisecond") {
636 ScannerVectorFrameResonance::Preset::Preset()
637 : xturnfraction(0.1, 0, 0.5, L
"XTurning_Fraction")
638 , ycutoff(0.1, 0, 0.5, L
"YCutoff_Fraction")
639 , yretrace(0.1, 0, 0.5, L
"YRetrace_Fraction")
640 , waitafterenqueuestorage(2, 0, 1000, L
"WaitAfterEnqueueStorage_Millisecond")
641 , waitafterenqueuedisplay(5, 0, 1000, L
"WaitAfterEnqueueDisplay_Millisecond") {
682 bool enabler = (
static_cast<RunStateHelper::Mode>(_runstate)==RunStateHelper::Mode::Stopped)?
true:
false;
695 std::shared_ptr<Preset> p = std::make_shared<Preset>();
707 auto samename = std::find_if(std::begin(
presets), std::end(
presets), [&](std::shared_ptr<ScannerVectorFrameBasic::Preset> _pres)
708 {
return _pres->name() == _name; } );
709 if (
presets.end() != samename )
715 auto which = std::find_if(std::begin(
presets), std::end(
presets), [&](std::shared_ptr<ScannerVectorFrameBasic::Preset> _pres)
716 {
return _pres->name() == _name; } );
717 if ( which == std::end(
presets) )
721 _daq.
averages = (*which)->averages();
722 xres = (*which)->xres();
723 yres = (*which)->yres();
ScopeNumber< double > pixeltime
pixel dwell time in microseconds, this is also the analog out sampling interval
virtual void ConnectRateUpdate(signalchange_t::slot_type _slot)
Connect a slot that is called if something in the ScannerVector changes that renders a recalculation ...
void ConnectOnlineUpdate(signalchange_t::slot_type _slot) override
Connect a slot that is called if something in the ScannerVector (which is displayed on the GUI) chang...
void Save(wptree &pt) const override
save parameters into a boost:property_tree
std::unique_ptr< ScannerVectorFrameBasic::Preset > MakePreset() const override
Since preset loading is done in base class (here), we need to generate a derived preset, this can be done by calling this function and overriding it in derived classes.
ScopeNumber< double > xcutoff
Cutoff fraction at beginning of line, total pixels per line = xres * (1 + xcutoff + xretrace) ...
virtual void ConnectResolutionUpdate(signalchange_t::slot_type _slot)
Connect a slot that is called if something in the ScannerVector changes that renders a recalculation ...
void SetReadOnlyWhileScanning(const RunState &_runstate) override
set values that must not be changed to read-only during scanning.
virtual std::vector< boost::signals2::connection > ConnectCopyTrigger(signalchange_t::slot_type _slot)
Connect a slot that is called if some member parameter changes, this can be used to copy certain chan...
ScopeNumber< uint32_t > averages
number of images to average
ScopeNumber< uint32_t > yres
y resolution of the image (lines)
void SetReadOnlyWhileScanning(const RunState &_runstate) override
set values that must not be changed to read-only during scanning.
virtual T Set(const T &_v, const bool &_callguisignal=true, const bool &_callothersignal=true, const bool &_callatnochange=false)
Sets the value and calls both change signals if the value actually changed.
ScopeString name
name of the preset
static std::unique_ptr< ScannerVectorFrameBasic > Factory(const ScannerVectorType &_type, const ScannerVectorFrameBasic *const _o=nullptr)
Factory method to generate parameter sets for different scan types and put them into a ScannerVectorF...
ScopeNumber< double > pixeltime
pixel dwell time in microseconds, this is also the analog out sampling interval
virtual void CoerceYResolution()
Changes the y resolution to the allowed values for the resonance scanner.
ScopeNumber< double > pockels
pockels cell value
ScopeNumber< uint32_t > waitafterenqueuestorage
Time (in milliseconds) to wait after the PipelineController has enqueued the image to the storage que...
ScopeNumber< double > yrotation
Rotation angle around the Y axis in degrees.
virtual void DeletePreset(const std::wstring &_name)
Deletes a preset.
void Load(const wptree &pt) override
Load from boost property tree.
ScopeNumber< double > scannerdelay
compensate, by waiting, that scanners lag behind the command voltage
void ConnectOnlineUpdate(signalchange_t::slot_type _slot) override
Connect a slot that is called if something in the ScannerVector (which is displayed on the GUI) chang...
static std::unique_ptr< ScannerVectorFrameBasic > Create()
Create function for factory.
void ConnectRateUpdate(signalchange_t::slot_type _slot) override
Connect a slot that is called if something in the ScannerVector changes that renders a recalculation ...
ScopeNumber< double > yaspectratio
aspect ratio in y direction
void LoadFromPreset(const std::wstring &_name, Daq &_daq) override
Load parameters from a preset.
std::vector< boost::signals2::connection > ConnectCopyTrigger(signalchange_t::slot_type _slot) override
Connect a slot that is called if some member parameter changes, this can be used to copy certain chan...
void Save(wptree &pt) const override
Save to boost property tree.
void AddToPropertyTree(boost::property_tree::wptree &pt) const
Adds the value to a Boost property tree, using its name and value.
virtual uint32_t XImagePixels() const
ScopeNumber< double > ycutoff
Cutoff fraction at beginning of frame, total lines per frame = yres * (1 + ycutoff + yretrace) ...
ScopeNumber< double > yretrace
Cutoff fraction for retrace at end of frame.
void Save(wptree &pt) const override
save parameters into a boost:property_tree
virtual void ConnectResolutionChange(signalchange_t::slot_type _slot)
Connect a slot that is called if xres or yres in the ScannerVector are changed This usually is ScopeC...
virtual void Save(wptree &pt) const
Save to boost property tree.
ScopeNumber< double > xturnfraction
fraction spent for turning the x galvo around
ScopeNumber< uint32_t > xres
x resolution of the image (linewidth)
All parameters for scanner data generation and pixel acquisition If you add/remove parameters or deri...
ScopeNumber< double > xturnfraction
fraction spent for turning the x resonance scanner around
T SetLimits(const T &_ll, const T &_ul, const bool &_callguisignal=true, const bool &_callothersignal=true, const bool &_callatnochange=false)
Sets the limits and coerces the value accordingly change signal is called if value has to be coerced...
ScopeNumber< double > xaspectratio
aspect ratio in x direction
std::vector< boost::signals2::connection > ConnectCopyTrigger(signalchange_t::slot_type _slot) override
Connect a slot that is called if some member parameter changes, this can be used to copy certain chan...
ScopeNumber< double > xretrace
Cutoff fraction for retrace at end of line.
virtual void UpdateXTurnFraction()
Updates the x turn fraction for the resonance scanner.
ScopeNumber< double > xrotation
Rotation angle around the X axis in degrees.
ScopeNumber< uint32_t > xres
x resolution of the image (linewidth)
ScopeNumber< double > yaspectratio
aspect ratio in y direction
ScopeNumber< double > ycutoff
Cutoff fraction at beginning of frame, total lines per frame = yres * (1 + ycutoff + yretrace) ...
Base class for all Scope datatypes here, provides a uniform interface (and saves typing...).
void Load(const wptree &pt) override
load parameters from a boost::property_tree
static std::unique_ptr< ScannerVectorFrameBasic > Create()
Create function for factory.
ScopeNumber< double > ycutoff
Cutoff fraction at beginning of frame, total lines per frame = yres * (1 + ycutoff + yretrace) ...
void ConnectOnlineUpdate(signalchange_t::slot_type _slot) override
Connect a slot that is called if something in the ScannerVector (which is displayed on the GUI) chang...
ScopeNumber< double > yretrace
Cutoff fraction for retrace at end of frame.
virtual std::unique_ptr< ScannerVectorFrameBasic::Preset > MakePreset() const
Since preset loading is done in base class (here), we need to generate a derived preset, this can be done by calling this function and overriding it in derived classes.
std::vector< std::shared_ptr< Preset > > presets
A vector with presets.
ScopeNumber< double > xturnfraction
fraction spent for turning the x galvo around
void ConnectOnlineUpdate(signalchange_t::slot_type _slot) override
Connect a slot that is called if something in the ScannerVector (which is displayed on the GUI) chang...
void ConnectMicronPerPixelUpdate(signalchange_t::slot_type _slot) override
Connect a slot that is called if something in the ScannerVector changes that renders a recalculation ...
This is the include file for standard system include files, or project specific include files that ar...
std::vector< PlaneProperties > planes
vector with properties for all planes
T::Mode t
the enum from the template class
void Save(wptree &pt) const override
Save to boost property tree.
virtual void ConnectOnlineUpdate(signalchange_t::slot_type _slot)
Connect a slot that is called if something in the ScannerVector (which is displayed on the GUI) chang...
ScopeNumber< bool > squarepixels
pixels are square (thus FOV rectangular) when true, when false pixels are rectangular (thus FOV squar...
ScopeNumber< uint32_t > waitafterenqueuedisplay
Time (in milliseconds) to wait after the PipelineController has enqueued the image to the display que...
uint32_t XTotalPixels() const override
void ConnectMicronPerPixelUpdate(signalchange_t::slot_type _slot) override
Connect a slot that is called if something in the ScannerVector changes that renders a recalculation ...
ScopeNumber< double > ycutoff
Cutoff fraction at beginning of frame, total lines per frame = yres * (1 + ycutoff + yretrace) ...
void ConnectMicronPerPixelUpdate(signalchange_t::slot_type _slot) override
Connect a slot that is called if something in the ScannerVector changes that renders a recalculation ...
std::unique_ptr< ScannerVectorFrameBasic::Preset > MakePreset() const override
Since preset loading is done in base class (here), we need to generate a derived preset, this can be done by calling this function and overriding it in derived classes.
void ConnectRateUpdate(signalchange_t::slot_type _slot) override
Connect a slot that is called if something in the ScannerVector changes that renders a recalculation ...
void Load(const wptree &pt) override
Load from boost property tree.
void Load(const wptree &pt) override
load parameters from a boost::property_tree
ScopeNumber< double > xturnfraction
fraction spent for turning the x resonance scanner around
ScopeNumber< double > xoffset
x offset
#define DBOUT(s)
A debug output to the debug console.
std::unique_ptr< ScannerVectorFrameBasic::Preset > MakePreset() const override
Since preset loading is done in base class (here), we need to generate a derived preset, this can be done by calling this function and overriding it in derived classes.
void ConnectRateUpdate(signalchange_t::slot_type _slot) override
Connect a slot that is called if something in the ScannerVector changes that renders a recalculation ...
void SaveToPreset(const std::wstring &_name, const Daq &_daq) override
Save parameters into a preset.
std::unique_ptr< ScannerVectorFrameBasic::Preset > MakePreset() const override
Since preset loading is done in base class (here), we need to generate a derived preset, this can be done by calling this function and overriding it in derived classes.
void Load(const wptree &pt) override
load parameters from a boost::property_tree
void ConnectRateUpdate(signalchange_t::slot_type _slot) override
Connect a slot that is called if something in the ScannerVector changes that renders a recalculation ...
static std::unique_ptr< ScannerVectorFrameBasic > Create()
Create function for factory.
virtual void Load(const wptree &pt)
Load from boost property tree.
void Save(wptree &pt) const override
save parameters into a boost:property_tree
void SaveToPreset(const std::wstring &_name, const Daq &_daq) override
Save parameters into a preset.
void SaveToPreset(const std::wstring &_name, const Daq &_daq) override
Save parameters into a preset.
void LoadFromPreset(const std::wstring &_name, Daq &_daq) override
Load parameters from a preset.
ScopeNumber< uint32_t > averages
number of images to average
void Load(const wptree &pt) override
load parameters from a boost::property_tree
ScopeNumber< double > yoffset
y offset
std::vector< boost::signals2::connection > ConnectCopyTrigger(signalchange_t::slot_type _slot) override
Connect a slot that is called if some member parameter changes, this can be used to copy certain chan...
void SetRWState(const bool &_state)
Sets readonly/read-write state.
void SetReadOnlyWhileScanning(const RunState &_runstate) override
set values that must not be changed to read-only during scanning.
Parameters for a ScannerVectorFrameBasic.
ScopeNumber< double > ycutoff
Cutoff fraction at beginning of frame, total lines per frame = yres * (1 + ycutoff + yretrace) ...
void Save(wptree &pt) const override
Save to boost property tree.
ScopeNumber< double > zoom
current zoom factor (from 1 to 20).
static std::unique_ptr< ScannerVectorFrameBasic > Create()
Create function for factory.
void SetReadOnlyWhileScanning(const RunState &_runstate) override
set values that must not be changed to read-only during scanning.
ScopeNumber< double > fastz
current fast z position
ScopeNumber< double > yretrace
Cutoff fraction for retrace at end of frame.
virtual void CoerceOffset()
Changes the limits of xoffset and yoffset to account for the maximum allowed offset depending on zoom...
ScopeNumber< uint32_t > waitafterenqueuedisplay
Time (in milliseconds) to wait after the PipelineController has enqueued the image to the display que...
ScopeNumber< double > ycutoff
Cutoff fraction at beginning of frame, total lines per frame = yres * (1 + ycutoff + yretrace) ...
void SetReadOnlyWhileScanning(const RunState &_runstate) override
set values that must not be changed to read-only during scanning.
Mode
Enum for the run state of the scope, stopped, continuously scanning, single scan, stack scan...
std::vector< boost::signals2::connection > ConnectCopyTrigger(signalchange_t::slot_type _slot) override
Connect a slot that is called if some member parameter changes, this can be used to copy certain chan...
boost::signals2::connection ConnectOther(signalchange_t::slot_type slot)
Connect signal to slot to other stuff.
ScopeNumber< uint32_t > waitafterenqueuestorage
Time (in milliseconds) to wait after the PipelineController has enqueued the image to the storage que...
ScopeNumber< uint32_t > yres
y resolution of the image (lines)
void SetFromPropertyTree(const boost::property_tree::wptree &pt)
Set value from a Boost property, using its name as a key.
void Load(const wptree &pt) override
Load from boost property tree.
void Save(wptree &pt) const override
Save to boost property tree.
ScopeNumber< double > yretrace
Cutoff fraction for retrace at end of frame.
void Save(wptree &pt) const override
save parameters into a boost:property_tree
void ConnectMicronPerPixelUpdate(signalchange_t::slot_type _slot) override
Connect a slot that is called if something in the ScannerVector changes that renders a recalculation ...
ScopeNumber< double > yretrace
Cutoff fraction for retrace at end of frame.
ScopeNumber< bool > squarepixels
pixels are square (thus FOV rectangular) when true, when false pixels are rectangular (thus FOV squar...
ScopeNumber< double > scannerdelay
compensate, by waiting, the time that scanners lag behind the command voltage, in microseconds ...
ScopeNumber< double > xcutoff
Cutoff fraction at beginning of line, total pixels per line = xres * (1 + xcutoff + xretrace) ...
void LoadFromPreset(const std::wstring &_name, Daq &_daq) override
Load parameters from a preset.
void Save(wptree &pt) const override
save parameters into a boost:property_tree
void Load(const wptree &pt) override
Load from boost property tree.
void SaveToPreset(const std::wstring &_name, const Daq &_daq) override
Save parameters into a preset.
void Load(const wptree &pt) override
load parameters from a boost::property_tree
void LoadFromPreset(const std::wstring &_name, Daq &_daq) override
Load parameters from a preset.
ScopeNumber< double > yretrace
Cutoff fraction for retrace at end of frame.
virtual void ConnectMicronPerPixelUpdate(signalchange_t::slot_type _slot)
Connect a slot that is called if something in the ScannerVector changes that renders a recalculation ...
ScopeNumber< double > xaspectratio
aspect ratio in x direction
ScopeNumber< double > xretrace
Cutoff fraction for retrace at end of line.