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 scanfactor, bool rect) override;
77
81 bool GetFocusPos(gmi::AxesCoord& dest, int index, double frac) override;
82
86 bool GetMeasureOffset(Vector3D& vector, int index, double frac, bool rect) 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 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
161 QString GetAnimationPath(const QString& filename) const;
162
163 protected:
167 virtual void handleVariableEvent(Variable::EEvent event, const Variable& caller, Variable& link, bool same_inst) = 0;
168
194
195 private:
196 Variable::PtrVector _exportVars;
197 ToolInformation _toolInfo;
198 ElementInformation _elementInfo;
199 bool _otherAxesSolution;
200 bool _toggleAxesSolution;
201 bool _noSurfaceAxisCalc;
202 QString _partDirectory;
203
204 protected:
206
209};
210
212{
213 _exportVars.add(var);
214}
215
217{
218 return _exportVars;
219}
220
221inline QString ToolBaseScanMethod::GetAnimationPath(const QString& filename) const
222{
223 return _partDirectory + QDir::separator() + filename + ".dxfani";
224}
225
226}// 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:947
Dialog containing multiple property pages.
Definition qt/PropertySheetDialog.h:14
Definition ScanMethod.h:28
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
size_type add(const T &t)
Adds item at the end of the vector.
Holds the needed 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 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
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 slaved variable.
Definition ToolBaseScanMethod.h:180
LocalVariable VAngleCalculation
Determines the way the gates are positioned.
Definition ToolBaseScanMethod.h:170
const ElementInformation & GetElement() const
Gets the element information.
Value GetInterfacePosition() const
Gets the interface position where it should be.
Variable VGate1Range
Linked Gate 1 delay variable.
Definition ToolBaseScanMethod.h:181
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
Determines the way the given angles are used in the calculations.
Definition ToolBaseScanMethod.h:171
Variable VAscanRange
Linked A-scan position delay variable.
Definition ToolBaseScanMethod.h:176
bool GetIndexPos(gmi::AxesCoord &pos, int index, double scanfactor, bool rect) override
Overridden from base class.
bool FControlAscan
Holds the actual depth after calculation.
Definition ToolBaseScanMethod.h:193
virtual bool GetSurface(Matrix44 &surface, int index, double frac)=0
Abstract method which must be oerridden to retrieve the combined surface matrix with applied angles.
void Read(IniProfile *inifile) override
Overridden from base class.
Variable VAscanDelay
Material angle B from the surface normal in the material.
Definition ToolBaseScanMethod.h:175
LocalVariable VDepthMax
Linked Gate 2 range variable.
Definition ToolBaseScanMethod.h:189
Variable VIfRange
Linked Gate position delay variable.
Definition ToolBaseScanMethod.h:178
void AddPropertyPages(PropertySheetDialog *sheet) override
Overridden from base class.
bool InitializeBase()
Reads the tool and element information and returns true on succes.
Variable VGate2Delay
Linked Gate 2 slaved variable.
Definition ToolBaseScanMethod.h:183
void ExportVariables(bool exported)
Export or revokes exported variables in the variable list.
Variable VGate2Range
Linked Gate 2 delay variable.
Definition ToolBaseScanMethod.h:184
LocalVariable VDepth
Holds the depth correction factor for when angles are used.
Definition ToolBaseScanMethod.h:192
bool GetMeasureOffset(Vector3D &vector, int index, double frac, bool rect) override
Overridden from base class.
Variable VIfDelay
Linked A-scan position range variable.
Definition ToolBaseScanMethod.h:177
Variable::PtrVector & GetVars()
Gets the variable list reference.
Definition ToolBaseScanMethod.h:216
~ToolBaseScanMethod() override
Destructor.
LocalVariable VDepthFactor
Holds the offset which is subtracted from the retrieved depth.
Definition ToolBaseScanMethod.h:191
Variable VGate2Slaved
Linked Gate 1 range variable.
Definition ToolBaseScanMethod.h:182
const ToolInformation & GetTool() const
Gets the tool information.
LocalVariable VDepthOffset
Definition ToolBaseScanMethod.h:190
LocalVariable VMaterialAngleA
Material angle B from the surface normal.
Definition ToolBaseScanMethod.h:173
void Write(IniProfile *inifile) override
Overridden from base class.
bool GetFocusPos(gmi::AxesCoord &dest, int index, double frac) override
Overridden from base class.
std::string GetParamSection() const
Gets the parameter section name.
Variable VGate1Slaved
Linked Gate position range variable.
Definition ToolBaseScanMethod.h:179
bool SetAscanAndGates(double distance=-1.0)
Apply UT settings for the passed material distance. When negative use the depth variable value.
void AddVar(Variable *var)
Adds the given variable to the list.
Definition ToolBaseScanMethod.h:211
LocalVariable VSurfaceAngleB
Material angle A from the surface normal.
Definition ToolBaseScanMethod.h:172
QString GetAnimationPath(const QString &filename) const
Gets the animation file path of the given filename.
Definition ToolBaseScanMethod.h:221
LocalVariable VGateMode
Definition ToolBaseScanMethod.h:169
TVariableHandler< ToolBaseScanMethod > _variableHandler
Holds the retrieved part directory at construction.
Definition ToolBaseScanMethod.h:205
bool GetGenericInfoList(StringList &) override
Overridden from base class.
LocalVariable VMaterialAngleB
Material angle A from the surface normal in the material.
Definition ToolBaseScanMethod.h:174
bool GetSurfaceWithAngles(Matrix44 &angle, int index, double frac)
Gets the combined surface matrix with applied angles. calls the overridden method GetSurface().
Definition LineScanMethod.h:6
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
Signal gate is on the surface.
Definition ToolBaseScanMethod.h:24
@ itBACKWALL
Signal gate is on the back wall.
Definition ToolBaseScanMethod.h:28
@ itMANUAL
No settings are change automatically.
Definition ToolBaseScanMethod.h:22
@ itMATERIAL
Signal gate is in the material.
Definition ToolBaseScanMethod.h:26
Mandatory structure for initialization of derived class.
Definition ScanMethod.h:34