![]() |
Scanframe Modular Application 0.1.0
|
Keeps the project and all scan areas to inspect. More...
#include <ProjectData.h>


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. | |
| QString | getStateName () |
| Gets the name of the current state the project is in. | |
| ScanEntry * | addScan () |
| Gets a pointer to a newly created scan entry instance. | |
| bool | initialize () |
| Initializes or reinitializes the project binder and all its scans. | |
| bool | start (unsigned index) |
| Start scanning at the 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) |
| Queries for a surface position by the user. | |
| bool | moveTo (int scan, int index, double frac=0.0, bool perp=false) |
| Moves controller to the location on the surface of a scan area. | |
| bool | activate (unsigned index) |
| Activates the scan method. This makes the mode export 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 stop 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 the argument lock is non-zero, regardless force is used. When the argument 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 the lock argument 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 (const 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 a 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. | |
| void | setSelectedScanIndex (int index) |
| Sets the selected scan entry index enter -1 for none. | |
| 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. | |
| 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 the 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 PartInspection *part_inspection) |
| Sets the part-inspection of this project. | |
| PartInspection * | getPartInspection () const |
| Gets the part-inspection of this project. | |
| void | setWidget (ProjectWidget *project_widget) |
| Sets the frame. | |
| ProjectWidget * | getWidget () |
| Gets the project's frame. | |
| QWidget * | getViewerParent () |
| Gets the parent for the scan method viewers. | |
| ScanEntry * | getScan (ssize_t index) |
| Gets the scan entry pointer of the given index. | |
| ssize_t | getScanCount () |
| Gets the number 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-machine'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 number of available scan methods. | |
| std::string | getScanMethodName (ssize_t index) |
| Gets the name of the scan method at the given index. | |
| const QColor & | getColor (Color color) const |
| Gets the color corresponding with the given value. | |
| const ConfigStore & | getConfigStore () const |
| Gets a fresh copy of the config store. | |
Public Member Functions inherited from sf::ProjectScriptObject | |
| 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. | |
Public Member Functions inherited from sf::ScriptObject | |
| 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. | |
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 &ts) |
| 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 the ScanEntry instance to attach itself to this project. | |
| void | detach (ScanEntry *entry) |
| Called from the 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. | |
Protected Member Functions inherited from sf::ProjectScriptObject | |
| 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. | |
Protected Member Functions inherited from sf::ScriptObject | |
| 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 |
Additional Inherited Members | |
Static Public Member Functions inherited from sf::ScriptObject | |
| static const IdInfo * | getInfoUnknown () |
| Returns the static Info structure for unknowns. | |
Keeps the project and all scan areas to inspect.
| enum sf::ProjectData::Color : int |
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 export its variables. Only one scan method is activated at a time.
| index | Scan entry by index/row to activate. |
| 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 a pointer to a newly created scan entry instance.
|
protected |
Called from the 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 the lock argument 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::debug | ( | ) |
Just for development and debugging.
|
protected |
Called from the ScanEntry instance to detach itself to this project.
| entry | Scan entry. |
| bool sf::ProjectData::disableProject | ( | bool | disable | ) |
Disables or enables a 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 the argument lock is non-zero, regardless force is used. When the argument lock is -1, the inspection is unlocked and 1 to lock.
| lock |
| ScanEntry * sf::ProjectData::getActiveScan | ( | ) |
Gets the active scan.
| int sf::ProjectData::getActiveScanIndex | ( | ) |
Gets the active scan entry index.
| const TCalibrationSets & sf::ProjectData::getCalibrationSets | ( | ) |
Gets the calibration sets.
| const QColor & sf::ProjectData::getColor | ( | Color | color | ) | const |
Gets the color corresponding with the given value.
| 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)
|
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.
| QString sf::ProjectData::getPart | ( | ) | const |
Gets the part name of the loaded project.
| PartInspection * 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.
| ReportOptions sf::ProjectData::getReportOptions | ( | ) |
Gets the report options of the project.
| QString sf::ProjectData::getReportTemplate | ( | ) |
Gets the report template file.
| ScanEntry * sf::ProjectData::getScan | ( | ssize_t | index | ) |
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 number of scans in the current scan plan list.
| IniEnvelope sf::ProjectData::getScanIni | ( | const 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 number 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 the scan method at the given index.
| index | Scan method list index. |
| double sf::ProjectData::getScanProgress | ( | ) |
Gets the progress of the current active scan.
| ScanEntry * sf::ProjectData::getSelectedScan | ( | ) |
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.
| EState sf::ProjectData::getState | ( | ) |
Gets the current state of the project data state machine.
| QString sf::ProjectData::getStateName | ( | ) |
Gets the name of the current state the project is in.
| QString sf::ProjectData::getStateName | ( | int | state | ) |
Gets the state-machine's name of the given state.
| QWidget * sf::ProjectData::getViewerParent | ( | ) |
Gets the parent for the scan method viewers.
| ProjectWidget * sf::ProjectData::getWidget | ( | ) |
Gets the project's frame.
| 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 | perp = false |
||
| ) |
Moves 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. |
| bool sf::ProjectData::moveToQuery | ( | int | scan | ) |
Queries for a surface position by the user.
| 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 | Input stream. |
| 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::setPartInspection | ( | const PartInspection * | 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 the report template file.
| templ |
| void sf::ProjectData::setScanBinderName | ( | const QString & | name | ) |
Sets scan-binder name and so change the implementation.
| name |
| void sf::ProjectData::setSelectedScanIndex | ( | int | index | ) |
Sets the selected scan entry index enter -1 for none.
|
protected |
Sets the new state.
| state | New state. |
| void sf::ProjectData::setWidget | ( | ProjectWidget * | project_widget | ) |
Sets the frame.
| project_widget |
| bool sf::ProjectData::shouldWaitForEvent | ( | ) |
Allows state machines to wait for a user event.
| bool sf::ProjectData::start | ( | unsigned | index | ) |
Start scanning at the specified index in the list of scans.
| index |
|
protected |
Initiates the start of storing data.
| bool sf::ProjectData::stop | ( | ) |
Signals a stop 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.
| ts | 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 |
|
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.