Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
MeanderScanMethod.h
Go to the documentation of this file.
1#pragma once
5
6namespace sf::ipj
7{
8
9// Forward definition.
10class MeanderScanMethodFrame;
11
12class MeanderScanMethod final : public ScanMethod
13{
14 public:
15 // Constructor.
16 explicit MeanderScanMethod(const Parameters&);
17
18 // Destructor.
20
21 // Overloaded from base class.
22 bool Initialize() override;
23
24 // Overloaded from base class.
26
27 // Overloaded from base class.
28 bool HandleCommand(ECommand cmd) override;
29
30 // Overloaded from base class.
31 void Read(IniProfile* ini) override;
32
33 // Overloaded from base class.
34 void Write(IniProfile* ini) override;
35
36 // Overloaded from base class.
37 bool CreateFrame() override;
38
39 // Overloaded from base class.
40 bool GetIndexPos(gmi::AxesCoord& pos, int index, double frac, bool rect) override;
41
42 // Overloaded from base class.
43 bool Sustain(const timespec& ts) override;
44
45 // Overloaded from base class.
47 gmi::AxesCoord& dest,// Returned focus coordinate.
48 const gmi::AxesCoord& src,// Source physical coordinate.
49 bool to_focus// Direction focus or physical.
50 ) const override
51 {
52 return false;
53 }
54
55 bool GetIndexVel(gmi::AxesCoord& vel, int index) override
56 {
57 return false;
58 }
59
60 bool SetAcqParams(int index, double scan_factor) override
61 {
62 return false;
63 }
64
65 // Exportable variable parameters.
78 // Holds the local variable pointers that hold the parameters.
80
81 // Event handler for local variables.
82 void variableEvent(Variable::EEvent event, const Variable& caller, Variable& link, bool same_inst);
83 void variableAxisEvent(Variable::EEvent event, const Variable& caller, Variable& link, bool same_inst);
84 //
87
88 //
89 // PreStart ScanStep(s) PostStop
90 // +----->-----+-------->-------+------>-----+
91 // | |
92 // | |
93 // +--------<-------+
94 // ScanStart ScanStop
95 //
96
119
120 // Holds the current stage when the scan method is active.
122 // Holds the previous stage.
124 // Holds the next stage when moving.
126
127 // Returns the positon for the given stage at given index in the passed axes coordinate reference.
128 // Returns true on succes of retrieving.
129 bool GetStagePos(EScanCycleStage stage, int index, int step, gmi::AxesCoord& stage_pos);
130 // Returns true on successful starting the controller to move.
131 bool MoveToStage(EScanCycleStage stage, int index = -1, int step = -1);
132 // Returns true is the current controller position is equals the
133 // stage position.
134 bool CheckStagePos(EScanCycleStage stage, int index, int step);
135 // Sets the next stage and assigns the current to the previous member.
137 // Returns the name of the stage.
138 const char* GetStageName(int stage);
139 // Returns the normally the output stream of the scan method frame but if the frame is not created. The global output stream 'cout' is returned.
140 std::ostream& Cout();
141 int GetIndex();
142 // Get the frame pointer.
144 // Holds the current command being executed.
146 // Holds the current index for step axis.
148 // Holds the index for step and go measurements.
150 // Timer for debugging.
152 // Flag indicating that the sustain must wait for the script to finish.
154 // Special script which does the storing of a single scan line.
156 // Overloaded from base class.
158
159 protected:
160 void StateChange(EState prev, EState cur) override;
162 bool GetFocusPos(gmi::AxesCoord& dest, int index, double frac) override;
163 bool GetTriggerValue(gmi::AxisValue& trigger_value) override;
165
167};
168
173
174}// namespace sf::ipj
Class for reading and writing ini-profiles.
Definition IniProfile.h:17
Timer class that has fixed time intervals at which it becomes true.
Definition IntervalTimer.h:14
Create a local variable by calling the protected constructor.
Definition Variable.h:947
Dialog containing multiple property pages.
Definition qt/PropertySheetDialog.h:14
Definition ScanMethod.h:28
ECommand
Available commands.
Definition ScanMethod.h:118
EState
States of operation.
Definition ScanMethod.h:403
QWidget * GetFrame()
Called by a derived class to get its UI frame pointer.
String list with optional object association and sorting.
Definition TStringList.h:12
Template for linking pointers of member function to Variable instances.
Definition VariableHandler.h:38
EEvent
Events send to the handler set with sf::Variable::setHandler.
Definition VariableTypes.h:130
Class for creating and referencing global or local created parameters or settings called variables....
Definition Variable.h:16
All axis values in one structure accompanied by some handy manipulation methods.
Definition AxesCoord.h:13
Single position, speed or acceleration value of a specific axis.
Definition GmiTypes.h:174
Definition MeanderScanMethodScript.h:9
Definition MeanderScanMethodFrame.h:19
Definition MeanderScanMethod.h:13
LocalVariable _vStepCount
Definition MeanderScanMethod.h:73
const EScanCycleStage _prevStage
Definition MeanderScanMethod.h:123
LocalVariable _vStepStart
Definition MeanderScanMethod.h:75
bool GetStagePos(EScanCycleStage stage, int index, int step, gmi::AxesCoord &stage_pos)
void AddPropertyPages(PropertySheetDialog *sheet) override
Adds scan method specific property pages to the passed sheet. Can be overloaded by a derived class.
bool HandleCommand(ECommand cmd) override
Handles the command given by Execute(). Must be overridden in a derived class.
bool SetAcqParams(int index, double scan_factor) override
Sets the project acquisition parameters/variables based on the passed index. Must be overloaded by a ...
Definition MeanderScanMethod.h:60
bool GetTriggerValue(gmi::AxisValue &trigger_value) override
Gets the axis used for triggering measurements or when the axis location is #sf::EAxisLocation::alNA ...
AcquireScript _acquireScript
Definition MeanderScanMethod.h:155
bool CreateFrame() override
Creates a scan method UI frame if possible. Can be overloaded by a derived class.
Variable::PtrVector _vars
Definition MeanderScanMethod.h:79
TVariableHandler< MeanderScanMethod > _variableEventHandler
Definition MeanderScanMethod.h:85
ECommand _command
Definition MeanderScanMethod.h:145
int _curIndex
Definition MeanderScanMethod.h:147
void Read(IniProfile *ini) override
Reads the settings from the passed inifile.
MeanderScanMethodFrame * GetMeanderFrame()
Definition MeanderScanMethod.h:169
LocalVariable _vTravAxis
Definition MeanderScanMethod.h:69
IntervalTimer _debugDelayTimer
Definition MeanderScanMethod.h:151
bool GetGenericInfoList(StringList &) override
Gets the list of linked variables or results. Must be overridden in a derived class.
MeanderScanMethod(const Parameters &)
bool MoveToStage(EScanCycleStage stage, int index=-1, int step=-1)
void Write(IniProfile *ini) override
Writes the settings to the passed inifile.
void SetStage(EScanCycleStage stage)
LocalVariable _vStepAxis
Definition MeanderScanMethod.h:77
const EScanCycleStage _stage
Definition MeanderScanMethod.h:121
ScriptLink * GetScriptLink() override
Gets the script link when one is associated. Can be overridden by a derived class.
bool CheckStagePos(EScanCycleStage stage, int index, int step)
LocalVariable _vStepSize
Definition MeanderScanMethod.h:76
LocalVariable _vDensity
Definition MeanderScanMethod.h:71
LocalVariable _vStepMode
Definition MeanderScanMethod.h:72
bool GetIndexPos(gmi::AxesCoord &pos, int index, double frac, bool rect) override
Gets the axes position of specified index and scan fraction. Must be overridden in a derived class.
LocalVariable _vStepStop
Definition MeanderScanMethod.h:74
void StateChange(EState prev, EState cur) override
Is called when the current state changes for a derived class to act up on. Must be overridden by a de...
bool _waitForScript
Definition MeanderScanMethod.h:153
void variableEvent(Variable::EEvent event, const Variable &caller, Variable &link, bool same_inst)
LocalVariable _vTravVel
Definition MeanderScanMethod.h:68
LocalVariable _vMeasCount
Definition MeanderScanMethod.h:70
bool ConvertPosition(gmi::AxesCoord &dest, const gmi::AxesCoord &src, bool to_focus) const override
Converts a physical position to or from a focus position using the scan's configuration.
Definition MeanderScanMethod.h:46
bool Sustain(const timespec &ts) override
Can be overloaded to do background processing.
bool Initialize() override
Initializes the scan method. Must be overridden by a derived class.
bool GetIndexVel(gmi::AxesCoord &vel, int index) override
Gets the velocity calculated by the derived scan mode. Must be overridden in a derived class.
Definition MeanderScanMethod.h:55
EScanCycleStage
Stages of operation of this scan method.
Definition MeanderScanMethod.h:101
@ scsSCANSTEP
No movement and position is at scan step.
Definition MeanderScanMethod.h:113
@ scsACQUIRE
No movement and time for handling acquisition.
Definition MeanderScanMethod.h:107
@ scsMOVING
Movement is between stages.
Definition MeanderScanMethod.h:105
@ scsPRESTART
No movement and position is at project start.
Definition MeanderScanMethod.h:109
@ scsIDLE
Do nothing.
Definition MeanderScanMethod.h:103
@ scsPOSTSTOP
No movement and position is at post stop.
Definition MeanderScanMethod.h:117
@ scsSCANSTART
No movement and position is at scan measure start.
Definition MeanderScanMethod.h:111
@ scsSCANSTOP
No movement and position is at scan measure stop.
Definition MeanderScanMethod.h:115
void variableAxisEvent(Variable::EEvent event, const Variable &caller, Variable &link, bool same_inst)
bool GetFocusPos(gmi::AxesCoord &dest, int index, double frac) override
Gets the focus position of specified index and scan fraction. Must be overridden in a derived class.
LocalVariable _vTravStart
Definition MeanderScanMethod.h:66
gmi::EAxisLocation GetScanAxis() override
Gets the scan and index axis for position calculations. Must be overloaded by a derived class.
const EScanCycleStage _moveStage
Definition MeanderScanMethod.h:125
int _curStep
Definition MeanderScanMethod.h:149
LocalVariable _vTravStop
Definition MeanderScanMethod.h:67
TVariableHandler< MeanderScanMethod > _variableAxisEventHandler
Definition MeanderScanMethod.h:86
const char * GetStageName(int stage)
EAxisLocation
Enumeration of axis locations.
Definition GmiTypes.h:81
Definition LineScanMethod.h:6
Mandatory structure for initialization of derived class.
Definition ScanMethod.h:34