![]() |
Scanframe Modular Application 0.1.0
|
#include <ProjectData.h>
Public Types | |
enum | EState { psNONE , psABORTED , psERROR , psDISABLED , psUNINITIALIZED , psINITIALIZING , psINITIALIZED , psINITFAILED , psREADY , psPREPARING , psPREPARED , psTOOLCHANGING , psTOOLCHANGED , psAPPROACHING , psAPPROACHED , psCHECKING , psCHECKED , psSCANNING , psSCANNED , psDATASAVING , psDATASAVED , psEVALUATING , psEVALUATED , psREPORTING , psREPORTED , psRETREATING , psRETREATED , psFINISHING , psFINISHED , psSUSPENDING , psSUSPENDED , psSTOPPING , psSTOPPED , psMOVING , psMOVED , psRESETTING , psRESUMING , psACCOMMODATING , psACCOMMODATED , psLASTENTRY } |
Project states in the machine. 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 | |
ProjectData () | |
Default constructor. | |
~ProjectData () override | |
Virtual overridden destructor. | |
void | debug () |
Just for development and debugging. | |
void | addPropertyPages (PropertySheetDialog *sheet) |
Adds the project property pages to the given property sheet. | |
void | addModulePropertyPages (PropertySheetDialog *sheet) |
Add the module property pages from this project to the given property sheet. | |
bool | read (std::istream &is) |
Reads the project from the stream. | |
bool | write (std::ostream &os) |
Writes the project information to the output stream. | |
bool | isValidPart () |
Check if the part this project data is referring to is valid. | |
void | createFrame (QWidget *parent) |
Creates the frame and sets the parent. When the frame exists this function is ignored. | |
void | destroyFrame () |
Destroys the frame. | |
void | setFrameSaveState (bool rd) |
Stores the frames state. | |
QString | getStateName () |
Gets the name of the current state the project is in. | |
ScanEntry * | addScan () |
Gets pointer to a new created scan entry instance. | |
bool | initialize () |
Initializes or reinitializes the project binder and all its scans. | |
bool | start (unsigned index) |
Start scanning at specified index in the list of scans. | |
bool | evaluate (unsigned index, int file_index=-1) |
Starts evaluating. | |
bool | moveToSysPos (ESystemPosition sp) |
Makes the manipulator move to a predefined system position. | |
bool | moveToQuery (int scan) |
bool | moveTo (int scan, int index, double frac=0.0, bool rect=false) |
bool | activate (unsigned index) |
Activates the scan method. This makes the mode exports its variables. Only one scan method is activated at a time. | |
bool | suspend () |
Tries to signal the current scan to hold. | |
bool | stop () |
Signals a stops to the current active scan method. | |
bool | abort () |
Aborts the current active scan method immediately. | |
bool | rotate (int scan_entry) |
Starts rotating the scan axis if possible. | |
bool | isRotating () |
Checks iof the rotating axis is rotating currently. | |
bool | finalize (int lock=0) |
Finalizes the project so it is locked for changes. When lock is non-zero regardless force is used. When lock is -1 the inspection is unlocked and 1 to lock. | |
bool | isFinalized () const |
Checks if the project is finalized. | |
bool | canInitialize () |
Checks if it is possible to 'Initialize' at the current time. | |
bool | canStart (int scan_entry) |
Checks if it is possible to 'Start' at the current time. | |
bool | canStop () |
Checks if it is possible to 'Stop' at the current time. | |
bool | canAbort () |
Checks if it is possible to 'Abort' at the current time. | |
bool | canSuspend () |
Checks if it is possible to 'Suspend' at the current time. | |
bool | canRotate (int scan_entry) |
Checks if it is possible to 'Rotate' at the current time. | |
bool | canEvaluate (int scan_entry) |
Checks if it is possible to 'Evaluate' at the current time. | |
bool | canFinalize (int lock=0) |
Checks if it is possible to 'finalize' at the current time. When lock is non-zero regardless force is used. | |
bool | canMoveTo () |
Checks if the MoveTo function can be executed successfully. | |
void | clear () |
Clears the all scan entries of the current project. | |
IniEnvelope | GetScanIni (QString scan_area) |
Gets an ini file descendant with information about the scan area configuration. | |
ConfigStore | GetPartStateIni () |
Gets an ini file descendant with screen position information. | |
bool | isScanArea (const QString &name) |
Gets if the given scan area name exists. | |
void | removeScan (unsigned index) |
Removes the scan at the given index. | |
void | moveScan (unsigned src, unsigned dest) |
Moves the scan area in the list from the given source to a destination index. | |
void | swapScan (unsigned idx1, unsigned idx2) |
Swaps to scan entries in the list between the 3 given indices. | |
int | indexOf (ScanEntry *) const |
Gets the index in the scan entry in the list. | |
int | getScanListIndex (const ScanMethod *sm) const |
Gets scan method entry index in the scan list. | |
bool | disableProject (bool disable) |
Disables or enables project when other is running. | |
bool | storeFilterList (bool rd) |
Read or writes the filter list file. | |
const TCalibrationSets & | getCalibrationSets () |
Gets the calibration sets. | |
bool | shouldWaitForEvent () |
Allows state machines to wait for a user event . | |
ScanEntry * | getActiveScan () |
Gets the active scan. | |
int | getActiveScanIndex () |
Gets the active scan entry index. | |
int | getSelectedScanIndex () |
Gets the selected scan entry index. | |
ScanEntry * | getSelectedScan () |
Gets the selected scan entry pointer. | |
double | getScanProgress () |
Gets the progress of the current active scan. | |
QString | getScanBinderName () |
Gets current scan-binder name. | |
void | setScanBinderName (const QString &name) |
Sets scan-binder name and so change the implementation. | |
ScanBinder * | GetScanBinder () |
Gets the Scan binder derived instance pointer of the implementation. | |
InformationTypes::id_type | getScanMethodIdOffset () |
Gets the scan method id-offset for derived scan methods. Scan methods use the id-offset to determine the actual ids. | |
InformationTypes::id_type | getScanBinderIdOffset () |
Gets the scan method ID offset for the derived scan binder. The scan binder uses the id-offset to determine the actual ids. | |
std::string | getNamePrefix () |
Gets the name prefix of the exported parameters. | |
QString | getErrorText () |
Gets the last error text set. | |
QWidget * | getScanFrameParent () |
Gets the parent for each scan area frame. | |
void | setScanFrameParent (QWidget *parent) |
Sets the parent for the scan methods frame. | |
DataFilterList * | getFilterList () |
Gets the selected or used filter list. (same as global for now) | |
QString | getMediumName () |
Gets the medium name of the project like 'water'. | |
void | SetReportOptions (ReportOptions options) |
Sets the report options of the project. | |
ReportOptions | getReportOptions () |
Gets the report options of the project. | |
QString | getReportTemplate () |
Gets the report template file. | |
void | setReportTemplate (const QString &templ) |
Sets thew report template file. | |
void | setPartProject (const PartProject *part_project) |
Assigment clears the scan list and sets the part name. This must be done before this instance can be used. Otherwise, the class cannot locate its resources. | |
PartProject * | getPartProject () const |
Gets the part-project pointer of the current project. | |
void | setPartInspection (const TPartInspection *part_inspection) |
Sets the part-inspection of this project. | |
TPartInspection * | getPartInspection () const |
Gets the part-inspection of this project. | |
QWidget * | getFrame () |
Gets the projects frame. | |
ScanEntry * | getScan (ssize_t index) |
Gets the scan entry pointer of the given index. | |
ssize_t | getScanCount () |
Gets the amount of scans in the current scan plan list. | |
EState | GetState () |
Gets the current state of the project data state machine. | |
QString | GetStateName (int state) |
Gets the state-machines's name of the given state. | |
QString | getPart () const |
Gets the part name of the loaded project. | |
void | setDirty (bool tf=true) |
Set or resets the dirty flag. Calls attached method of the onDirty closure. When dirty the project can be saved. | |
bool | isDirty () const |
Get the dirty flag. | |
ssize_t | getScanMethodCount () |
Gets the amount of available scan methods. | |
std::string | getScanMethodName (ssize_t index) |
Gets the name of scan method at the given index. | |
TProjectFrame * | GetProjectFrame () |
Casts the FFrame pointer to a TProjectFrame. | |
const ConfigStore & | getConfigStore () const |
Gets a fresh copy of the config store. | |
![]() | |
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 overloaded 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. | |
Public Attributes | |
TClosure< void, void * > | onDirty |
Closure method to notify changes on the dirty flag. The attached handler is called when a scan of the project has been modified. | |
Protected Member Functions | |
bool | sustain (const timespec &t) |
Handler set using the _sustainEntry. | |
bool | process (const timespec &ts) |
Called from sustain. | |
bool | setError (const QString &error_text) |
Sets the error state and the SetState function to set the psERROR state. Called from process() to allow immediate returns. | |
bool | setState (EState state) |
Sets the new state. | |
void | attach (ScanEntry *entry) |
Called from ScanEntry instance to attach itself to this project. | |
void | detach (ScanEntry *entry) |
Called from ScanEntry instance to detach itself to this project. | |
bool | storeProfile (IniProfile &ini_profile, bool rd) |
Reads or writes all project data to or from the given ini-profile instance. | |
void | storeConfig (bool rd) |
Reads or writes the module configuration information. | |
bool | initializeScans () |
Initializes all scan methods. | |
const IdInfo * | getInfo (const std::string &name) const override |
Overridden from base class ProjectScriptObject. | |
bool | getSetValue (const IdInfo *info, Value *value, Value::vector_type *params, bool flag_set) override |
Overridden from base class ProjectScriptObject. | |
bool | startDataSaving () |
Initiates the start of storing data. | |
bool | isDataSavingReady () const |
Checks is saving data is completed. | |
![]() | |
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. | |
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. | |
Protected Attributes | |
TSustain< ProjectData > | _sustainEntry |
Hooks the sustain function into the sustain interface. | |
Friends | |
class | ScanEntry |
class | ProjectDataPropertyPage |
class | InformationVariables::DataCursor |
Additional Inherited Members | |
![]() | |
static const IdInfo * | getInfoUnknown () |
Returns the static Info structure for unknowns. | |
Project states in the machine.
sf::ProjectData::ProjectData | ( | ) |
Default constructor.
|
override |
Virtual overridden destructor.
bool sf::ProjectData::abort | ( | ) |
Aborts the current active scan method immediately.
bool sf::ProjectData::activate | ( | unsigned | index | ) |
Activates the scan method. This makes the mode exports its variables. Only one scan method is activated at a time.
index |
void sf::ProjectData::addModulePropertyPages | ( | PropertySheetDialog * | sheet | ) |
Add the module property pages from this project to the given property sheet.
void sf::ProjectData::addPropertyPages | ( | PropertySheetDialog * | sheet | ) |
Adds the project property pages to the given property sheet.
ScanEntry * sf::ProjectData::addScan | ( | ) |
Gets pointer to a new created scan entry instance.
|
protected |
Called from ScanEntry instance to attach itself to this project.
entry | Scan entry. |
bool sf::ProjectData::canAbort | ( | ) |
Checks if it is possible to 'Abort' at the current time.
bool sf::ProjectData::canEvaluate | ( | int | scan_entry | ) |
Checks if it is possible to 'Evaluate' at the current time.
bool sf::ProjectData::canFinalize | ( | int | lock = 0 | ) |
Checks if it is possible to 'finalize' at the current time. When lock is non-zero regardless force is used.
bool sf::ProjectData::canInitialize | ( | ) |
Checks if it is possible to 'Initialize' at the current time.
bool sf::ProjectData::canMoveTo | ( | ) |
Checks if the MoveTo function can be executed successfully.
bool sf::ProjectData::canRotate | ( | int | scan_entry | ) |
Checks if it is possible to 'Rotate' at the current time.
bool sf::ProjectData::canStart | ( | int | scan_entry | ) |
Checks if it is possible to 'Start' at the current time.
bool sf::ProjectData::canStop | ( | ) |
Checks if it is possible to 'Stop' at the current time.
bool sf::ProjectData::canSuspend | ( | ) |
Checks if it is possible to 'Suspend' at the current time.
void sf::ProjectData::clear | ( | ) |
Clears the all scan entries of the current project.
void sf::ProjectData::createFrame | ( | QWidget * | parent | ) |
Creates the frame and sets the parent. When the frame exists this function is ignored.
parent |
void sf::ProjectData::debug | ( | ) |
Just for development and debugging.
void sf::ProjectData::destroyFrame | ( | ) |
Destroys the frame.
|
protected |
Called from ScanEntry instance to detach itself to this project.
entry | Scan entry. |
bool sf::ProjectData::disableProject | ( | bool | disable | ) |
Disables or enables project when other is running.
disable | Set true to disable. |
bool sf::ProjectData::evaluate | ( | unsigned | index, |
int | file_index = -1 |
||
) |
Starts evaluating.
index | |
file_index |
bool sf::ProjectData::finalize | ( | int | lock = 0 | ) |
Finalizes the project so it is locked for changes. When lock is non-zero regardless force is used. When lock is -1 the inspection is unlocked and 1 to lock.
lock |
|
inline |
Gets the active scan.
|
inline |
Gets the active scan entry index.
|
inline |
Gets the calibration sets.
const ConfigStore & sf::ProjectData::getConfigStore | ( | ) | const |
Gets a fresh copy of the config store.
QString sf::ProjectData::getErrorText | ( | ) |
Gets the last error text set.
DataFilterList * sf::ProjectData::getFilterList | ( | ) |
Gets the selected or used filter list. (same as global for now)
QWidget * sf::ProjectData::getFrame | ( | ) |
Gets the projects frame.
|
overrideprotectedvirtual |
Overridden from base class ProjectScriptObject.
Implements sf::ScriptObject.
QString sf::ProjectData::getMediumName | ( | ) |
Gets the medium name of the project like 'water'.
std::string sf::ProjectData::getNamePrefix | ( | ) |
Gets the name prefix of the exported parameters.
|
inline |
Gets the part name of the loaded project.
TPartInspection * sf::ProjectData::getPartInspection | ( | ) | const |
Gets the part-inspection of this project.
PartProject * sf::ProjectData::getPartProject | ( | ) | const |
Gets the part-project pointer of the current project.
ConfigStore sf::ProjectData::GetPartStateIni | ( | ) |
Gets an ini file descendant with screen position information.
TProjectFrame * sf::ProjectData::GetProjectFrame | ( | ) |
Casts the FFrame pointer to a TProjectFrame.
ReportOptions sf::ProjectData::getReportOptions | ( | ) |
Gets the report options of the project.
QString sf::ProjectData::getReportTemplate | ( | ) |
Gets the report template file.
|
inline |
Gets the scan entry pointer of the given index.
index | Index to retrieve. |
ScanBinder * sf::ProjectData::GetScanBinder | ( | ) |
Gets the Scan binder derived instance pointer of the implementation.
InformationTypes::id_type sf::ProjectData::getScanBinderIdOffset | ( | ) |
Gets the scan method ID offset for the derived scan binder. The scan binder uses the id-offset to determine the actual ids.
QString sf::ProjectData::getScanBinderName | ( | ) |
Gets current scan-binder name.
ssize_t sf::ProjectData::getScanCount | ( | ) |
Gets the amount of scans in the current scan plan list.
QWidget * sf::ProjectData::getScanFrameParent | ( | ) |
Gets the parent for each scan area frame.
IniEnvelope sf::ProjectData::GetScanIni | ( | QString | scan_area | ) |
Gets an ini file descendant with information about the scan area configuration.
scan_area |
int sf::ProjectData::getScanListIndex | ( | const ScanMethod * | sm | ) | const |
Gets scan method entry index in the scan list.
sm | Scan method pointer to find. |
ssize_t sf::ProjectData::getScanMethodCount | ( | ) |
Gets the amount of available scan methods.
InformationTypes::id_type sf::ProjectData::getScanMethodIdOffset | ( | ) |
Gets the scan method id-offset for derived scan methods. Scan methods use the id-offset to determine the actual ids.
std::string sf::ProjectData::getScanMethodName | ( | ssize_t | index | ) |
Gets the name of scan method at the given index.
index | Scan method list index. |
double sf::ProjectData::getScanProgress | ( | ) |
Gets the progress of the current active scan.
|
inline |
Gets the selected scan entry pointer.
int sf::ProjectData::getSelectedScanIndex | ( | ) |
Gets the selected scan entry index.
|
overrideprotectedvirtual |
Overridden from base class ProjectScriptObject.
Implements sf::ScriptObject.
|
inline |
Gets the current state of the project data state machine.
|
inline |
Gets the name of the current state the project is in.
QString sf::ProjectData::GetStateName | ( | int | state | ) |
Gets the state-machines's name of the given state.
int sf::ProjectData::indexOf | ( | ScanEntry * | ) | const |
Gets the index in the scan entry in the list.
bool sf::ProjectData::initialize | ( | ) |
Initializes or reinitializes the project binder and all its scans.
|
protected |
Initializes all scan methods.
|
protected |
Checks is saving data is completed.
bool sf::ProjectData::isDirty | ( | ) | const |
Get the dirty flag.
bool sf::ProjectData::isFinalized | ( | ) | const |
Checks if the project is finalized.
bool sf::ProjectData::isRotating | ( | ) |
Checks iof the rotating axis is rotating currently.
bool sf::ProjectData::isScanArea | ( | const QString & | name | ) |
Gets if the given scan area name exists.
name | Name of the scan area. |
bool sf::ProjectData::isValidPart | ( | ) |
Check if the part this project data is referring to is valid.
void sf::ProjectData::moveScan | ( | unsigned | src, |
unsigned | dest | ||
) |
Moves the scan area in the list from the given source to a destination index.
src | Source index. |
dest | Destination index. |
bool sf::ProjectData::moveTo | ( | int | scan, |
int | index, | ||
double | frac = 0.0 , |
||
bool | rect = false |
||
) |
bool sf::ProjectData::moveToQuery | ( | int | scan | ) |
bool sf::ProjectData::moveToSysPos | ( | ESystemPosition | sp | ) |
Makes the manipulator move to a predefined system position.
sp | Designated system position. |
|
protected |
Called from sustain.
ts | Current time. |
bool sf::ProjectData::read | ( | std::istream & | is | ) |
Reads the project from the stream.
is |
void sf::ProjectData::removeScan | ( | unsigned | index | ) |
Removes the scan at the given index.
index | Scan index in the list. |
bool sf::ProjectData::rotate | ( | int | scan_entry | ) |
Starts rotating the scan axis if possible.
scan_entry |
void sf::ProjectData::setDirty | ( | bool | tf = true | ) |
Set or resets the dirty flag. Calls attached method of the onDirty closure. When dirty the project can be saved.
tf | Default is true. |
|
protected |
Sets the error state and the SetState function to set the psERROR state. Called from process() to allow immediate returns.
error_text | Error text. |
void sf::ProjectData::setFrameSaveState | ( | bool | rd | ) |
Stores the frames state.
rd |
void sf::ProjectData::setPartInspection | ( | const TPartInspection * | part_inspection | ) |
Sets the part-inspection of this project.
void sf::ProjectData::setPartProject | ( | const PartProject * | part_project | ) |
Assigment clears the scan list and sets the part name. This must be done before this instance can be used. Otherwise, the class cannot locate its resources.
part_project |
void sf::ProjectData::SetReportOptions | ( | ReportOptions | options | ) |
Sets the report options of the project.
options |
void sf::ProjectData::setReportTemplate | ( | const QString & | templ | ) |
Sets thew report template file.
templ |
void sf::ProjectData::setScanBinderName | ( | const QString & | name | ) |
Sets scan-binder name and so change the implementation.
name |
|
inline |
Sets the parent for the scan methods frame.
parent |
|
protected |
Sets the new state.
state | New state. |
bool sf::ProjectData::shouldWaitForEvent | ( | ) |
Allows state machines to wait for a user event .
bool sf::ProjectData::start | ( | unsigned | index | ) |
Start scanning at specified index in the list of scans.
index |
|
protected |
Initiates the start of storing data.
bool sf::ProjectData::stop | ( | ) |
Signals a stops to the current active scan method.
|
protected |
Reads or writes the module configuration information.
rd | True to read and false to write. |
bool sf::ProjectData::storeFilterList | ( | bool | rd | ) |
Read or writes the filter list file.
rd | True to read, false to write. |
|
protected |
Reads or writes all project data to or from the given ini-profile instance.
ini_profile | |
rd | True to read and false to write. |
bool sf::ProjectData::suspend | ( | ) |
Tries to signal the current scan to hold.
|
protected |
Handler set using the _sustainEntry.
t | Current time. |
void sf::ProjectData::swapScan | ( | unsigned | idx1, |
unsigned | idx2 | ||
) |
Swaps to scan entries in the list between the 3 given indices.
idx1 | Index 1 |
idx2 | Index 2 |
bool sf::ProjectData::write | ( | std::ostream & | os | ) |
Writes the project information to the output stream.
os |
|
friend |
|
friend |
|
friend |
|
protected |
Hooks the sustain function into the sustain interface.
TClosure<void, void*> sf::ProjectData::onDirty |
Closure method to notify changes on the dirty flag. The attached handler is called when a scan of the project has been modified.