Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
ToolBaseScanMethod.h
Go to the documentation of this file.
1#pragma once
3#include <ipj/sm/toolbase/global.h>
5#include <ktm/Nipscan.h>
6
7namespace sf::ipj
8{
18
30
34class _TBSM_CLASS ToolBaseScanMethod : public ScanMethod
35{
36 protected:
41
46
47 public:
52
57
62
66 const ToolInformation& GetTool() const;
67
71 bool ConvertPosition(gmi::AxesCoord& dest, const gmi::AxesCoord& src, bool to_focus) const override;
72
76 bool GetIndexPos(gmi::AxesCoord& pos, int index, double frac, bool perp) override;
77
81 bool GetFocusPos(gmi::AxesCoord& dest, int index, double frac) override;
82
86 bool GetMeasureOffset(Vector3D& vector, int index, double frac, bool perp) override;
87
91 void Read(IniProfile* inifile) override;
92
96 void Write(IniProfile* inifile) override;
97
102 std::string GetParamSection() const;
103
107 void AddVar(Variable* var);
108
112 Variable::PtrVector& GetVars();
113
118
127 virtual bool GetSurfaceWithAngles(Matrix44& angle, int index, double frac);
128
136 virtual bool GetSurface(Matrix44& surface, int index, double frac) = 0;
137
142
149 bool SetAscanAndGates(double distance = -1.0);
150
154 void ExportVariables(bool exported);
155
160 QString GetGraphOverlayDir() const;
161
162 protected:
166 virtual void handleVariableEvent(Variable::EEvent event, const Variable& caller, Variable& link, bool same_inst) = 0;
167
213
214 private:
216 Variable::PtrVector _exportVars;
218 ToolInformation _toolInfo;
220 ElementInformation _elementInfo;
222 bool _otherAxesSolution;
224 bool _toggleAxesSolution;
226 bool _noSurfaceAxisCalc;
228 QString _partDirectory;
229
230 protected:
233
236};
237
239{
240 _exportVars.add(var);
241}
242
244{
245 return _exportVars;
246}
247
249{
250 return _partDirectory;
251}
252
253}// namespace sf::ipj
Holds the information on the transducer.
Definition ElementInformation.h:12
Class for reading and writing ini-profiles.
Definition IniProfile.h:17
Create a local variable by calling the protected constructor.
Definition Variable.h:948
Dialog containing multiple property pages.
Definition qt/PropertySheetDialog.h:15
Definition ScanMethod.h:24
Template for linking pointers of member function to Variable instances.
Definition VariableHandler.h:38
size_type add(const T &t)
Adds item at the end of the vector.
Holds all the necessary information on a tool to make calculations.
Definition ToolInformation.h:13
Value container class able to performing arithmetic functions.
Definition Value.h:19
EEvent
Events sent to the handler set with Variable::setHandler. For broadcast events the variable paramet...
Definition VariableTypes.h:129
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
Page to control some properties when translating coords to a Nipscan.
Definition NipscanTranslatePropertyPage.h:20
Definition ScanDepthPropertyPage.h:18
Base class for scan methods using a common tool description.
Definition ToolBaseScanMethod.h:35
Variable VGate1Delay
Linked Gate 1 delay variable.
Definition ToolBaseScanMethod.h:191
LocalVariable VAngleCalculation
Determines the way the given angles are used in the calculations.
Definition ToolBaseScanMethod.h:171
const ElementInformation & GetElement() const
Gets the element information.
bool GetMeasureOffset(Vector3D &vector, int index, double frac, bool perp) override
Overridden from base class.
Value GetInterfacePosition() const
Gets the interface position where it should be.
Variable VGate1Range
Linked Gate 1 range variable.
Definition ToolBaseScanMethod.h:193
virtual void handleVariableEvent(Variable::EEvent event, const Variable &caller, Variable &link, bool same_inst)=0
Event handler for local variables.
bool ConvertPosition(gmi::AxesCoord &dest, const gmi::AxesCoord &src, bool to_focus) const override
Overridden from base class.
ToolBaseScanMethod(const Parameters &)
Constructor.
LocalVariable VSurfaceAngleA
Material angle A from the surface normal.
Definition ToolBaseScanMethod.h:173
Variable VAscanRange
Linked A-scan position range variable.
Definition ToolBaseScanMethod.h:183
virtual bool GetSurface(Matrix44 &surface, int index, double frac)=0
Abstract method which must be overridden to retrieve the combined surface matrix with applied angles.
void Read(IniProfile *inifile) override
Overridden from base class.
Variable VAscanDelay
Linked A-scan position delay variable.
Definition ToolBaseScanMethod.h:181
LocalVariable VDepthMax
Holds the depth of the measurement. This is the length in meters from the surface to the end of the s...
Definition ToolBaseScanMethod.h:204
Variable VIfRange
Linked Gate position range variable.
Definition ToolBaseScanMethod.h:187
void AddPropertyPages(PropertySheetDialog *sheet) override
Overridden from base class.
bool InitializeBase()
Reads the tool and element information and returns true on success.
Variable VGate2Delay
Linked Gate 2 delay variable.
Definition ToolBaseScanMethod.h:197
virtual bool GetSurfaceWithAngles(Matrix44 &angle, int index, double frac)
Gets the combined surface matrix with applied angles. calls the overridden method GetSurface().
void ExportVariables(bool exported)
Export or revokes exported variables in the variable list.
Variable VGate2Range
Linked Gate 2 range variable.
Definition ToolBaseScanMethod.h:199
LocalVariable VDepth
Holds the actual depth after calculation.
Definition ToolBaseScanMethod.h:210
Variable VIfDelay
Linked Gate position delay variable.
Definition ToolBaseScanMethod.h:185
Variable::PtrVector & GetVars()
Gets the variable list reference.
Definition ToolBaseScanMethod.h:243
~ToolBaseScanMethod() override
Destructor.
LocalVariable VDepthFactor
Holds the depth correction factor for when angles are used.
Definition ToolBaseScanMethod.h:208
bool _controlAscan
Holds the flag telling the A-scan is controlled by the scan method.
Definition ToolBaseScanMethod.h:212
Variable VGate2Slaved
Linked Gate 2 slaved variable.
Definition ToolBaseScanMethod.h:195
const ToolInformation & GetTool() const
Gets the tool information.
QString GetGraphOverlayDir() const
Gets the animation file path of the given filename.
Definition ToolBaseScanMethod.h:248
LocalVariable VDepthOffset
Holds the offset which is subtracted from the retrieved depth.
Definition ToolBaseScanMethod.h:206
LocalVariable VMaterialAngleA
Material angle A from the surface normal in the material.
Definition ToolBaseScanMethod.h:177
void Write(IniProfile *inifile) override
Overridden from base class.
bool GetFocusPos(gmi::AxesCoord &dest, int index, double frac) override
Overridden from base class.
bool GetIndexPos(gmi::AxesCoord &pos, int index, double frac, bool perp) override
Overridden from base class.
std::string GetParamSection() const
Gets the parameter section name.
Variable VGate1Slaved
Linked Gate 1 slaved variable.
Definition ToolBaseScanMethod.h:189
bool SetAscanAndGates(double distance=-1.0)
Apply UT settings for the passed material distance. When distance is negative, use the depth variable...
void AddVar(Variable *var)
Adds the given variable to the list.
Definition ToolBaseScanMethod.h:238
LocalVariable VSurfaceAngleB
Material angle B from the surface normal.
Definition ToolBaseScanMethod.h:175
LocalVariable VGateMode
Determines the way the gates are positioned.
Definition ToolBaseScanMethod.h:169
TVariableHandler< ToolBaseScanMethod > _variableHandler
Handle allowing linkage of the $handleVariableEvent() virtual method.
Definition ToolBaseScanMethod.h:232
bool GetGenericInfoList(StringList &) override
Overridden from base class.
LocalVariable VMaterialAngleB
Material angle B from the surface normal in the material.
Definition ToolBaseScanMethod.h:179
Definition CircleScanMethod.h:5
EAngleCalculation
Some constants to improve source reading.
Definition ToolBaseScanMethod.h:13
@ acSURFACE
Definition ToolBaseScanMethod.h:16
@ acNONE
Definition ToolBaseScanMethod.h:14
@ acMATERIAL
Definition ToolBaseScanMethod.h:15
EInsectionType
Definition ToolBaseScanMethod.h:20
@ itSURFACE
The signal gate is on the surface.
Definition ToolBaseScanMethod.h:24
@ itBACKWALL
The signal gate is on the back wall.
Definition ToolBaseScanMethod.h:28
@ itMANUAL
No settings are change automatically.
Definition ToolBaseScanMethod.h:22
@ itMATERIAL
The signal gate is in the material.
Definition ToolBaseScanMethod.h:26
Mandatory structure for initialization of derived class.
Definition ScanMethod.h:30