![]() |
Scanframe Modular Application 0.1.0
|
Abstract base class for implementing scan binders. More...
#include <ScanBinder.h>
Classes | |
struct | InfoBase |
Structure used a base class for derived binder classes to store scan dependant information. More... | |
struct | Parameters |
Mandatory structure for initialization of derive class. More... | |
Public Types | |
enum | EState { sbsCFG_ERR = -2 , sbsERROR = -1 , sbsNO_INIT = 0 , sbsABORTED , sbsREADY , sbsWAITING , sbsSUSPENDED , sbsACTIVE , sbsCHECKING , sbsSCANNING , sbsEVALUATING } |
Enumeration of states of a scan binder. More... | |
![]() | |
enum | EIdentifier { idUnknown = 0 , idConstant , idVariable , idFunction , idTypedef , idKeyword } |
Keyword identifiers. More... | |
typedef std::string::size_type | pos_type |
Source position type. | |
typedef ssize_t | ip_type |
Instruction pointer type. | |
Public Member Functions | |
ScanBinder (const Parameters ¶meters) | |
Constructor for passing general structure for derived classes for the class factory. | |
~ScanBinder () override | |
Virtual overridden destructor. | |
void | storeConfig (bool rd) |
Reads and writes system configuration data. | |
ConfigStore & | getConfigStore () |
Gets configuration store instance for reading and write the state of a derived class. | |
virtual void | addPropertyPages (PropertySheetDialog *sheet) |
Adds the scan binder property pages of the base class. May be overridden by derived class. | |
void | createScanEntry (ScanEntry *se) |
Called by the project to make the binder create the additional information. | |
void | destroyScanEntry (const ScanEntry *se) |
Called by the project to make the binder delete the additional information. | |
void | doAddPropertyPages (PropertySheetDialog *sheet, bool scan) |
Adds property pages for derived classes by calling virtual method AddPropertyPages. When scan is true it gets the property pages which are scan related when false it gets the project selected property pages. | |
QWidget * | doGetFrame () |
Creates a scan binder frame if possible. | |
void | doReadProfile (IniProfile &inifile) |
Reads the settings from the passed inifile. | |
void | doWriteProfile (IniProfile &inifile) |
Writes the settings to the passed inifile. | |
bool | doPreInitialize () |
Do some initialization which must be done before scan initializations. | |
bool | doInitialize () |
Initializes the scan method. Is each time a project changes. | |
void | doSustain (const timespec &ts) |
Called from the project and rooted to the virtual Sustain function. | |
void | doClear () |
Clears any settings of the scan binder to their initial state. | |
bool | doSuspend (bool immediate) |
Suspends action at a convenient position or immediate. | |
bool | doResume () |
Resumes a suspended action. | |
bool | doStop () |
Stops activity immediately. | |
bool | doAbort () |
Abort immediately stop all movement. | |
bool | doMoveTo (int scan, int index=-1, double frac=0.0, bool perp=false) |
Moves the manipulator to a specific position of the scan area. | |
bool | doMoveToQuery (int scan) |
Queries for a surface position of the user. | |
bool | doMoveToSysPos (ESystemPosition sp) |
Moves to one of the system positions. | |
bool | doCheck (int scan) |
Starts position checking mode and a scan method in checking mode. This means the angle on the surface is always zero degree to get a better signal from the surface. | |
bool | doStartScan (int scan) |
Starts scan movements and a scan method for data recording. | |
bool | doEvaluate (int scan) |
Start in evaluation mode and a scan method in evaluation mode. This means the angle on the surface is the same as when evaluating but movements are initiated by the DoMoveTo function. | |
bool | doActivate (int scan) |
Activates possible added links and parameters in a derived instance. | |
bool | doRotate (int scan, int index=-1) |
Starts rotating the scan axis if one is available for rotation. It uses the scan rotation speed at the passed index or when index is -1 it uses the last index position. | |
bool | canRotate (int scan) const |
Checks if the passed scan-index is able to rotate regardless the current state. | |
bool | isRotating () const |
Checks if the rotating is active. | |
int | doGetIndex () const |
Gets the current scanning index. This is mainly for displaying progress purposes. | |
Vector3D | doGetOffset () const |
Gets the sum of offsets generated by the derived scan binder. When not, this method returns the same value as the fixture offset. | |
std::string_view | getStateName () const |
Gets the current state name. | |
EState | getState () const |
Gets the state of the instance. | |
const gmi::AxesCoord & | getVelocity () const |
Gets the velocity used to manipulate. | |
const gmi::AxesCoord & | getAcceleration () const |
Gets the acceleration used to manipulate. | |
const gmi::AxesCoord & | getParkPosition () const |
Gets the project park position. | |
const gmi::AxesCoord & | getToolPosition () const |
Gets the project park position. | |
const Vector3D & | getFixtureOffset () const |
Gets the fixture offset for the project applied on each scan. | |
const Variable & | getMediumVelocity () const |
Gets the medium sound velocity variable. | |
int | getActiveScanIndex () const |
Gets the active scan index when the state is active or higher an -1 when not active. | |
double | getScanProgress () const |
Gets the scan progress when scanning otherwise it returns -1. | |
bool | canAllocateController () const |
Gets true if the controller can be allocated. | |
bool | isControllerAllocated () const |
Gets true is the controller is allocated. | |
bool | allocateController (bool alloc) |
Allocates or frees the controller for this project. | |
gmi::Controller * | getController () |
Gets the allocated controller for this project if not allocated it throws an exception and should be regarded as a design error. | |
const gmi::Controller * | getController () const |
void | setAcqPopManual (RsaTypes::EPopManual pop_manual) |
Sets the pop to manual state on the acquisition device. | |
bool | isAcqPopManualReady () const |
Gets true if the pop manual process is completed. | |
void | setProgVelocityEnable (bool enabled) |
Enables or disables programming velocity. | |
bool | isProgVelocityEnable () const |
Checks is programming velocity is enabled. | |
const Variable::PtrVector & | getVars () const |
Gets the local variables of the scan binder. | |
![]() | |
ProjectScriptObject (const char *type_name) | |
Constructor. | |
~ProjectScriptObject () override | |
Virtual overridden destructor. | |
void | AddScriptParam (const std::string &name, Variable *variable) |
Adds the passed variable as a parameter in the script. | |
![]() | |
ScriptObject (const char *type_name, ScriptObject *parent=nullptr) | |
virtual | ~ScriptObject ()=default |
Virtual destructor which can be overridden to clean up objects. | |
virtual std::string | getStatusText () |
Gets the status text of this object for debugging purposes. | |
int | getRefCount () const |
Gets the reference count. | |
operator Value () const | |
Cast operator to be able to return this instance as a Value. | |
std::string | getTypeName () const |
Returns the type name Set at the constructor. | |
ScriptObject * | getParent () |
Gets the script object owner. | |
const ScriptObject * | getParent () const |
Gets the script object owner. | |
ScriptObject * | castToObject (const Value &value) |
Casts a sf::Value::vitCustom typed sf::Value to a ScriptObject typed pointer. | |
Static Public Member Functions | |
static std::string_view | getStateName (EState state) |
Gets the state name string. | |
![]() | |
static const IdInfo * | getInfoUnknown () |
Returns the static Info structure for unknowns. | |
Protected Member Functions | |
bool | getScanPos (gmi::AxesCoord &pos, int scan, int index, double frac, bool perp) const |
Gets the scan position at the passed scan index. | |
int | getScanIndex () |
Gets the current project active scan index. | |
ScanMethod * | getScan (int scan) const |
Gets the scan method of the project. | |
bool | setState (EState state) |
Sets the state of the binder. | |
InfoBase * | getScanInfoBase (int scan) |
Gets the scan base information of the passed project scan list index. | |
const InfoBase * | getScanInfoBase (int scan) const |
Gets the const scan base information of the passed project scan list index. | |
InfoBase * | getScanInfoBase (const ScanMethod *sm) |
Gets the scan information of the passed scan method pointer. | |
const InfoBase * | getScanInfoBase (const ScanMethod *sm) const |
Gets the const scan information of the passed scan method pointer. | |
virtual InfoBase * | createScanInfo ()=0 |
Must be overridden in a derived class. | |
virtual void | stateChange (EState prev, EState cur)=0 |
Abstract method which is called when the current state changes. | |
virtual void | addPropertyPages (PropertySheetDialog *sheet, bool scan)=0 |
Abstract method which adds property pages to the passed sheet. See DoAddPropertyPages. | |
virtual void | readProfile (IniProfile &inifile)=0 |
Abstract method which reads the settings from the passed inifile. | |
virtual void | writeProfile (IniProfile &inifile)=0 |
Abstract method which writes the settings to the passed inifile. | |
virtual int | getIndex ()=0 |
Abstract method which gets the current scanned index. | |
virtual void | clear ()=0 |
Abstract method which clears the settings of the derived instance initial state. | |
virtual void | sustain (const timespec &ts)=0 |
Abstract method which is called regularly to do background processing. | |
virtual bool | initialize ()=0 |
Abstract method which initializes the instance for action. | |
virtual bool | suspend (bool immediate)=0 |
Abstract method which suspends action. | |
virtual bool | resume ()=0 |
Abstract method which resumes a suspended action. | |
virtual bool | stop ()=0 |
Abstract method which stops activity immediately. | |
virtual bool | abort ()=0 |
Abstract method which aborts and immediately stop all movement. | |
virtual bool | moveTo (int scan, int index, double frac, bool perp)=0 |
Abstract method which moves the controller to the location on the surface of a scan area. | |
virtual bool | check (int scan)=0 |
Abstract method which checks the scan binder. | |
virtual bool | startScan (int scan)=0 |
Abstract method which starts scan movements and a scan method for acquisition. | |
virtual bool | evaluate (int scan)=0 |
Abstract method which starts evaluation on the passed scan. | |
virtual bool | activate (int scan)=0 |
Abstract method which activates the parameters or links for the passed scan on the derived class. | |
virtual bool | rotate (int scan, int index)=0 |
Abstract method which starts rotation on the passed scan and index position for velocity calculations. | |
virtual QWidget * | GetFrame ()=0 |
Abstract method which gets the scan binder control widget. | |
virtual Vector3D | getOffset () const |
Gets the sum of offsets generated by a derived class if overridden. | |
virtual bool | getGenericInfoList (StringList &)=0 |
Abstract method which retrieves the list of linked variables or results. The name contains the description and the object the GII object pointer. | |
ProjectData * | getProjectData () |
Gets the project data pointer. | |
const IdInfo * | getInfo (const std::string &name) const override |
Overridden from base class. | |
bool | getSetValue (const IdInfo *info, Value *value, Value::vector_type *params, bool flag_set) override |
Overridden from base class. | |
virtual void | doStoreConfig (IniEnvelope &ini, bool rd) |
Abstract method which can be overridden to read and write additional configuration settings. | |
![]() | |
void | destroyObject (bool &should_delete) override |
Overridden from base class. | |
![]() | |
void | makeParent (ScriptObject *so) |
Makes this object the owner of the other object. | |
void | setParent (ScriptObject *parent) |
Sets the owner to the pass script object. | |
Abstract base class for implementing scan binders.
Enumeration of states of a scan binder.
|
explicit |
Constructor for passing general structure for derived classes for the class factory.
parameters |
|
override |
Virtual overridden destructor.
|
protectedpure virtual |
Abstract method which aborts and immediately stop all movement.
Implemented in sf::DefaultScanBinder.
|
protectedpure virtual |
Abstract method which activates the parameters or links for the passed scan on the derived class.
scan | Scan index to activate. |
Implemented in sf::DefaultScanBinder.
|
virtual |
Adds the scan binder property pages of the base class. May be overridden by derived class.
Reimplemented in sf::DefaultScanBinder.
|
protectedpure virtual |
Abstract method which adds property pages to the passed sheet. See DoAddPropertyPages.
sheet | The property sheet to add them too. |
scan | True for scan specific pages. |
Implemented in sf::DefaultScanBinder.
bool sf::ScanBinder::allocateController | ( | bool | alloc | ) |
Allocates or frees the controller for this project.
bool sf::ScanBinder::canAllocateController | ( | ) | const |
Gets true if the controller can be allocated.
bool sf::ScanBinder::canRotate | ( | int | scan | ) | const |
Checks if the passed scan-index is able to rotate regardless the current state.
|
protectedpure virtual |
Abstract method which checks the scan binder.
scan | Scan index to check. |
Implemented in sf::DefaultScanBinder.
|
protectedpure virtual |
Abstract method which clears the settings of the derived instance initial state.
Implemented in sf::DefaultScanBinder.
void sf::ScanBinder::createScanEntry | ( | ScanEntry * | se | ) |
Called by the project to make the binder create the additional information.
se | Scan entry added. |
|
protectedpure virtual |
Must be overridden in a derived class.
Implemented in sf::DefaultScanBinder.
void sf::ScanBinder::destroyScanEntry | ( | const ScanEntry * | se | ) |
Called by the project to make the binder delete the additional information.
se | Scan entry removed. |
bool sf::ScanBinder::doAbort | ( | ) |
Abort immediately stop all movement.
bool sf::ScanBinder::doActivate | ( | int | scan | ) |
Activates possible added links and parameters in a derived instance.
void sf::ScanBinder::doAddPropertyPages | ( | PropertySheetDialog * | sheet, |
bool | scan | ||
) |
Adds property pages for derived classes by calling virtual method AddPropertyPages. When scan is true it gets the property pages which are scan related when false it gets the project selected property pages.
sheet | |
scan |
bool sf::ScanBinder::doCheck | ( | int | scan | ) |
Starts position checking mode and a scan method in checking mode. This means the angle on the surface is always zero degree to get a better signal from the surface.
void sf::ScanBinder::doClear | ( | ) |
Clears any settings of the scan binder to their initial state.
bool sf::ScanBinder::doEvaluate | ( | int | scan | ) |
Start in evaluation mode and a scan method in evaluation mode. This means the angle on the surface is the same as when evaluating but movements are initiated by the DoMoveTo function.
QWidget * sf::ScanBinder::doGetFrame | ( | ) |
Creates a scan binder frame if possible.
int sf::ScanBinder::doGetIndex | ( | ) | const |
Gets the current scanning index. This is mainly for displaying progress purposes.
Vector3D sf::ScanBinder::doGetOffset | ( | ) | const |
Gets the sum of offsets generated by the derived scan binder. When not, this method returns the same value as the fixture offset.
bool sf::ScanBinder::doInitialize | ( | ) |
Initializes the scan method. Is each time a project changes.
bool sf::ScanBinder::doMoveTo | ( | int | scan, |
int | index = -1 , |
||
double | frac = 0.0 , |
||
bool | perp = false |
||
) |
Moves the manipulator to a specific position of the scan area.
bool sf::ScanBinder::doMoveToQuery | ( | int | scan | ) |
Queries for a surface position of the user.
bool sf::ScanBinder::doMoveToSysPos | ( | ESystemPosition | sp | ) |
Moves to one of the system positions.
bool sf::ScanBinder::doPreInitialize | ( | ) |
Do some initialization which must be done before scan initializations.
void sf::ScanBinder::doReadProfile | ( | IniProfile & | inifile | ) |
Reads the settings from the passed inifile.
bool sf::ScanBinder::doResume | ( | ) |
Resumes a suspended action.
bool sf::ScanBinder::doRotate | ( | int | scan, |
int | index = -1 |
||
) |
Starts rotating the scan axis if one is available for rotation. It uses the scan rotation speed at the passed index or when index is -1 it uses the last index position.
scan | Scan list-index and when scan is -1 the rotation stops. |
index | Step index of the scan area. |
bool sf::ScanBinder::doStartScan | ( | int | scan | ) |
Starts scan movements and a scan method for data recording.
bool sf::ScanBinder::doStop | ( | ) |
Stops activity immediately.
|
inlineprotectedvirtual |
Abstract method which can be overridden to read and write additional configuration settings.
Reimplemented in sf::DefaultScanBinder.
bool sf::ScanBinder::doSuspend | ( | bool | immediate | ) |
Suspends action at a convenient position or immediate.
void sf::ScanBinder::doSustain | ( | const timespec & | ts | ) |
Called from the project and rooted to the virtual Sustain function.
void sf::ScanBinder::doWriteProfile | ( | IniProfile & | inifile | ) |
Writes the settings to the passed inifile.
|
protectedpure virtual |
Abstract method which starts evaluation on the passed scan.
scan | Scan index to start evaluating. |
Implemented in sf::DefaultScanBinder.
const gmi::AxesCoord & sf::ScanBinder::getAcceleration | ( | ) | const |
Gets the acceleration used to manipulate.
int sf::ScanBinder::getActiveScanIndex | ( | ) | const |
Gets the active scan index when the state is active or higher an -1 when not active.
ConfigStore & sf::ScanBinder::getConfigStore | ( | ) |
Gets configuration store instance for reading and write the state of a derived class.
gmi::Controller * sf::ScanBinder::getController | ( | ) |
Gets the allocated controller for this project if not allocated it throws an exception and should be regarded as a design error.
const gmi::Controller * sf::ScanBinder::getController | ( | ) | const |
const Vector3D & sf::ScanBinder::getFixtureOffset | ( | ) | const |
Gets the fixture offset for the project applied on each scan.
|
protectedpure virtual |
Abstract method which gets the scan binder control widget.
Implemented in sf::DefaultScanBinder.
|
protectedpure virtual |
Abstract method which retrieves the list of linked variables or results. The name contains the description and the object the GII object pointer.
Implemented in sf::DefaultScanBinder.
|
protectedpure virtual |
Abstract method which gets the current scanned index.
Implemented in sf::DefaultScanBinder.
|
overrideprotectedvirtual |
Overridden from base class.
Reimplemented from sf::ProjectScriptObject.
const Variable & sf::ScanBinder::getMediumVelocity | ( | ) | const |
Gets the medium sound velocity variable.
|
protectedvirtual |
Gets the sum of offsets generated by a derived class if overridden.
Reimplemented in sf::DefaultScanBinder.
const gmi::AxesCoord & sf::ScanBinder::getParkPosition | ( | ) | const |
Gets the project park position.
|
protected |
Gets the project data pointer.
|
protected |
Gets the scan method of the project.
scan | Index into the project scan list. |
|
protected |
Gets the current project active scan index.
|
protected |
Gets the scan information of the passed scan method pointer.
sm | Scan method pointer. |
|
protected |
Gets the const scan information of the passed scan method pointer.
sm | Scan method pointer. |
|
protected |
Gets the scan base information of the passed project scan list index.
scan | Index of the scan area list. |
|
protected |
Gets the const scan base information of the passed project scan list index.
scan | Index of the scan area list. |
|
protected |
Gets the scan position at the passed scan index.
pos | Returned axes coordinated. |
scan | Scan list index. |
index | Measurement index. |
frac | Scan line fraction. |
perp | When true the perpendicular position if possible is returned. |
double sf::ScanBinder::getScanProgress | ( | ) | const |
Gets the scan progress when scanning otherwise it returns -1.
|
overrideprotectedvirtual |
Overridden from base class.
Reimplemented from sf::ProjectScriptObject.
EState sf::ScanBinder::getState | ( | ) | const |
Gets the state of the instance.
std::string_view sf::ScanBinder::getStateName | ( | ) | const |
Gets the current state name.
|
static |
Gets the state name string.
const gmi::AxesCoord & sf::ScanBinder::getToolPosition | ( | ) | const |
Gets the project park position.
const Variable::PtrVector & sf::ScanBinder::getVars | ( | ) | const |
Gets the local variables of the scan binder.
const gmi::AxesCoord & sf::ScanBinder::getVelocity | ( | ) | const |
Gets the velocity used to manipulate.
|
protectedpure virtual |
Abstract method which initializes the instance for action.
Implemented in sf::DefaultScanBinder.
bool sf::ScanBinder::isAcqPopManualReady | ( | ) | const |
Gets true if the pop manual process is completed.
bool sf::ScanBinder::isControllerAllocated | ( | ) | const |
Gets true is the controller is allocated.
bool sf::ScanBinder::isProgVelocityEnable | ( | ) | const |
Checks is programming velocity is enabled.
bool sf::ScanBinder::isRotating | ( | ) | const |
Checks if the rotating is active.
|
protectedpure virtual |
Abstract method which moves the controller to the location on the surface of a scan area.
scan | Targeted scan area by list index. |
index | Targeted measurement index of the scanned area. |
frac | Targeted measurement fraction of the scanned area. |
perp | Ignore the angle and move perpendicular to the surface. When scan is negative the index is considered to be a system position. When scan has a valid value and index is negative the part is approached. When frac is negative an input query is started for a surface position. |
Implemented in sf::DefaultScanBinder.
|
protectedpure virtual |
Abstract method which reads the settings from the passed inifile.
inifile |
Implemented in sf::DefaultScanBinder.
|
protectedpure virtual |
Abstract method which resumes a suspended action.
Implemented in sf::DefaultScanBinder.
|
protectedpure virtual |
Abstract method which starts rotation on the passed scan and index position for velocity calculations.
scan | Scan list index. |
index | Scan index speed to use and when -1 the current or last index position or center index is to be used. |
Implemented in sf::DefaultScanBinder.
void sf::ScanBinder::setAcqPopManual | ( | RsaTypes::EPopManual | pop_manual | ) |
Sets the pop to manual state on the acquisition device.
void sf::ScanBinder::setProgVelocityEnable | ( | bool | enabled | ) |
Enables or disables programming velocity.
|
protected |
Sets the state of the binder.
state | New state. |
|
protectedpure virtual |
Abstract method which starts scan movements and a scan method for acquisition.
scan | Scan index to start scanning. |
Implemented in sf::DefaultScanBinder.
Abstract method which is called when the current state changes.
prev | The previous state. |
cur | The current state. |
Implemented in sf::DefaultScanBinder.
|
protectedpure virtual |
Abstract method which stops activity immediately.
Implemented in sf::DefaultScanBinder.
void sf::ScanBinder::storeConfig | ( | bool | rd | ) |
Reads and writes system configuration data.
rd | True to read false to write. |
|
protectedpure virtual |
Abstract method which suspends action.
immediate | When true immediate and when false at a convenient position. |
Implemented in sf::DefaultScanBinder.
|
protectedpure virtual |
Abstract method which is called regularly to do background processing.
Implemented in sf::DefaultScanBinder.
|
protectedpure virtual |
Abstract method which writes the settings to the passed inifile.
inifile |
Implemented in sf::DefaultScanBinder.