SCENE C++ API  2.0.27
Public Member Functions | List of all members
LSScanner Class Reference

The general interface to connect and communicate with a FARO Focus laser scanner. More...

#include <lsscanner.h>

+ Inheritance diagram for LSScanner:

Public Member Functions

 LSScanner ()
 Constructs a new scanner interface. More...
 
virtual ~LSScanner ()
 Destroys the scanner interface. More...
 
LSResult::Result connect (LSString address)
 Attempts to connect the scanner interface to the given address. More...
 
LSResult::Result disconnect ()
 Disconnects the scanner interface from any connected scanner. More...
 
ref_ptr< LSFutureTasktakeScan ()
 Take a scan which is stored locally on the scanner itself. More...
 
ref_ptr< LSFutureTasktakeRemoteScan (LSString filePath)
 Take a scan which is streamed over the network. More...
 
void stopScan ()
 Stops a running scan.
 
bool shutdown ()
 Shutdown the connected scanner. More...
 
ref_ptr< LSAttributeContainergetCurrentScanProfile () const
 Gets the currently active scan profile. More...
 
bool setCurrentScanProfile (ref_ptr< LSAttributeContainer > scanProfile)
 Sets the currently active scan profile. More...
 
LSPod< std::vector< ref_ptr< LSAttributeContainer > > > getScanProfiles () const
 Gets the list of available scan profiles. More...
 
bool selectScanProfile (LSString profileID)
 Selects a profile from the list of available scan profiles and sets it as the currently active scan profile. More...
 
bool addScanProfile (ref_ptr< LSAttributeContainer > scanProfile)
 Adds a new profile to the list of available scan profiles. More...
 
bool removeScanProfile (LSString profileID)
 Removes a profile from the list of available scan profiles. More...
 
LSPod< std::vector< ref_ptr< LSAttributeContainer > > > getScanProjects () const
 Gets the list of available scan projects. More...
 
bool selectScanProject (LSString projectID)
 Selects a project from the list of available scan projects and sets it as the currently active scan project. More...
 
bool addScanProject (ref_ptr< LSAttributeContainer > scanProject)
 Adds a new project to the list of available scan projects. More...
 
bool removeScanProject (LSString projectID)
 Removes a project from the list of available scan projects. More...
 
LSPod< std::vector< ref_ptr< LSAttributeContainer > > > getOperators () const
 Gets the list of available operators. More...
 
bool selectOperator (LSString operatorID)
 Selects an operator from the list of available operators and sets it as the currently active operator. More...
 
bool addOperator (ref_ptr< LSAttributeContainer > scanOperator)
 Adds a new operator to the list of available operators. More...
 
bool removeOperator (LSString operatorID)
 Removes an operator from the list of available operators. More...
 
ref_ptr< LSAttributeContainergetGeneralSettings () const
 Gets the general settings data container from the scanner. More...
 
bool setGeneralSettings (ref_ptr< LSAttributeContainer > settings)
 Sets the general settings for the scanner. More...
 
LSPod< std::vector< ref_ptr< LSAttributeContainer > > > getScans () const
 Gets a list of the scans which are stored on the scanner. More...
 
ref_ptr< LSAttributeContainergetScanProperties (LSString scanFile) const
 Gets the properties of a scan which is stored on the scanner. More...
 
ref_ptr< LSAttributeContainergetServiceInformation () const
 Gets the service information data container from the scanner. More...
 
ref_ptr< LSAttributeContainergetSensorInformation () const
 Gets the sensor information data container from the scanner. More...
 
ref_ptr< LSAttributeContainergetSystemVersion () const
 Gets the system version data container from the scanner. More...
 
ref_ptr< LSAttributeContainergetFirmwareVersion () const
 Gets the firmware version data container from the scanner. More...
 
ref_ptr< LSAttributeContainergetScannerStatus () const
 Gets the scanner status data container from the scanner. More...
 
LSPod< std::vector< ref_ptr< LSAttributeContainer > > > getStatusMessages () const
 Gets a list of the stored status messages from the scanner. More...
 
ref_ptr< LSAttributeContainergetWarningMessage () const
 Gets the current warning message from the scanner. More...
 
ref_ptr< LSAttributeContainergetScannerParameters () const
 Gets the current set of scanner parameters from the scanner. More...
 
bool setScannerParameters (ref_ptr< LSAttributeContainer > parameters)
 Sets the current set of scanner parameters for the scanner. More...
 
LSPod< std::vector< std::pair< LSString, LSString > > > detectScanners (int waitForMs=1000) const
 Fetches a list of scanners available in the network. More...
 
bool getSensorTemperature (double &temperature) const
 Gets the temperature of the sensor from inside the scanner. More...
 

Detailed Description

The general interface to connect and communicate with a FARO Focus laser scanner.

Version
SCENE API Version 2.0.0.

Constructor & Destructor Documentation

◆ LSScanner()

LSScanner ( )

Constructs a new scanner interface.

Version
SCENE API Version 2.0.0.

◆ ~LSScanner()

virtual ~LSScanner ( )
virtual

Destroys the scanner interface.

Version
SCENE API Version 2.0.0.

Member Function Documentation

◆ connect()

LSResult::Result connect ( LSString  address)

Attempts to connect the scanner interface to the given address.

Parameters
addressThe scanner address in the format IP:Port (e.g. 192.168.0.1:8765). Keep in mind that the port is not related to the port for the web user interface that can be changed in the scanner UI. The port is fixed and should be always 8765.
Returns
An LSResult code.
Version
SCENE API Version 2.0.0.

◆ disconnect()

LSResult::Result disconnect ( )

Disconnects the scanner interface from any connected scanner.

Returns
An LSResult code. Returns LSResult::Ok if not connected at the end of the call.
Version
SCENE API Version 2.0.6.

◆ takeScan()

ref_ptr<LSFutureTask> takeScan ( )

Take a scan which is stored locally on the scanner itself.

Returns
A LSFutureTask object which can be used to query the completion state and result of the requested operation.
Version
SCENE API Version 2.0.0.

◆ takeRemoteScan()

ref_ptr<LSFutureTask> takeRemoteScan ( LSString  filePath)

Take a scan which is streamed over the network.

No SD card required. This can be used to store a scan on the PC that controls the scanner. The supplied file path must be writable for the process that calls this method. For example it could be a local path or even a path to a SMB network share. Examples would be L"C:\\folder\\scan.fls" or L"\\\\host\\folder\\scan.fls". Currently the future will not report useful progress information. This method will return an error if the filePath already exists!

Parameters
filePathThe file system path to the file in which the scan will be stored. Do not forget to escape any backslashes!
Returns
A LSFutureTask object which can be used to query the completion state and result of the requested operation.
Version
SCENE API Version 2.0.0.

◆ shutdown()

bool shutdown ( )

Shutdown the connected scanner.

Returns
true if the scanner could be shut down, false otherwise.
Version
SCENE API Version 2.0.0.

◆ getCurrentScanProfile()

ref_ptr<LSAttributeContainer> getCurrentScanProfile ( ) const

Gets the currently active scan profile.

Returns
The current scan profile or a nullptr if the profile could not be acquired (e.g. before the scanner was connected).
Version
SCENE API Version 2.0.0.

◆ setCurrentScanProfile()

bool setCurrentScanProfile ( ref_ptr< LSAttributeContainer scanProfile)

Sets the currently active scan profile.

Parameters
scanProfileThe scan profile to be set.
Version
SCENE API Version 2.0.0.

◆ getScanProfiles()

LSPod<std::vector<ref_ptr<LSAttributeContainer> > > getScanProfiles ( ) const

Gets the list of available scan profiles.

Returns
The list of available scan profiles.
Version
SCENE API Version 2.0.0.

◆ selectScanProfile()

bool selectScanProfile ( LSString  profileID)

Selects a profile from the list of available scan profiles and sets it as the currently active scan profile.

Parameters
profileIDThe profile ID of the profile to be selected.
Returns
bool if the profile could be selected, false otherwise.
Version
SCENE API Version 2.0.0.

◆ addScanProfile()

bool addScanProfile ( ref_ptr< LSAttributeContainer scanProfile)

Adds a new profile to the list of available scan profiles.

Parameters
scanProfileThe profile to be added to the list of scan profiles.
Returns
true if the profile could be added, false otherwise.
Version
SCENE API Version 2.0.0.

◆ removeScanProfile()

bool removeScanProfile ( LSString  profileID)

Removes a profile from the list of available scan profiles.

Parameters
profileIDThe profile ID of the profile to be removed.
Returns
true if the profile could be removed, false otherwise.
Version
SCENE API Version 2.0.0.

◆ getScanProjects()

LSPod<std::vector<ref_ptr<LSAttributeContainer> > > getScanProjects ( ) const

Gets the list of available scan projects.

Returns
The list of available scan projects.
Version
SCENE API Version 2.0.0.

◆ selectScanProject()

bool selectScanProject ( LSString  projectID)

Selects a project from the list of available scan projects and sets it as the currently active scan project.

Parameters
projectIDThe project ID of the project to be selected.
Returns
bool if the project could be selected, false otherwise.
Version
SCENE API Version 2.0.0.

◆ addScanProject()

bool addScanProject ( ref_ptr< LSAttributeContainer scanProject)

Adds a new project to the list of available scan projects.

Parameters
scanProjectThe project to be added to the list of scan projects.
Returns
true if the project could be added, false otherwise.
Version
SCENE API Version 2.0.0.

◆ removeScanProject()

bool removeScanProject ( LSString  projectID)

Removes a project from the list of available scan projects.

Parameters
projectIDThe project ID of the project to be removed.
Returns
true if the project could be removed, false otherwise.
Version
SCENE API Version 2.0.0.

◆ getOperators()

LSPod<std::vector<ref_ptr<LSAttributeContainer> > > getOperators ( ) const

Gets the list of available operators.

Returns
The list of available operators.
Version
SCENE API Version 2.0.0.

◆ selectOperator()

bool selectOperator ( LSString  operatorID)

Selects an operator from the list of available operators and sets it as the currently active operator.

Parameters
operatorIDThe operator ID of the operator to be selected.
Returns
bool if the operator could be selected, false otherwise.
Version
SCENE API Version 2.0.0.

◆ addOperator()

bool addOperator ( ref_ptr< LSAttributeContainer scanOperator)

Adds a new operator to the list of available operators.

Parameters
scanOperatorThe operator to be added to the list of operators.
Returns
true if the operator could be added, false otherwise.
Version
SCENE API Version 2.0.0.

◆ removeOperator()

bool removeOperator ( LSString  operatorID)

Removes an operator from the list of available operators.

Parameters
operatorIDThe operator ID of the operator to be removed.
Returns
true if the operator could be removed, false otherwise.
Version
SCENE API Version 2.0.0.

◆ getGeneralSettings()

ref_ptr<LSAttributeContainer> getGeneralSettings ( ) const

Gets the general settings data container from the scanner.

Returns
The general settings data container or a nullptr if the settings could not be acquired (e.g. before the scanner was connected).
Version
SCENE API Version 2.0.0.

◆ setGeneralSettings()

bool setGeneralSettings ( ref_ptr< LSAttributeContainer settings)

Sets the general settings for the scanner.

Parameters
settingsThe general settings to be set.
Returns
true if the settings could be set, false otherwise.
Version
SCENE API Version 2.0.0.

◆ getScans()

LSPod<std::vector<ref_ptr<LSAttributeContainer> > > getScans ( ) const

Gets a list of the scans which are stored on the scanner.

Returns
The list of scans which are stored on the scanner.
Version
SCENE API Version 2.0.0.

◆ getScanProperties()

ref_ptr<LSAttributeContainer> getScanProperties ( LSString  scanFile) const

Gets the properties of a scan which is stored on the scanner.

Parameters
scanFileThe name of the scan for which the properties should be retrieved.
Returns
The properties of the scan or a nullptr if the scan properties could not be acquired (e.g. before the scanner was connected).
Version
SCENE API Version 2.0.0.

◆ getServiceInformation()

ref_ptr<LSAttributeContainer> getServiceInformation ( ) const

Gets the service information data container from the scanner.

Returns
The service information data container or a nullptr if the service information could not be acquired (e.g. before the scanner was connected).
Version
SCENE API Version 2.0.0.

◆ getSensorInformation()

ref_ptr<LSAttributeContainer> getSensorInformation ( ) const

Gets the sensor information data container from the scanner.

Returns
The sensor information data container or a nullptr if the sensor information could not be acquired (e.g. before the scanner was connected).
Version
SCENE API Version 2.0.0.

◆ getSystemVersion()

ref_ptr<LSAttributeContainer> getSystemVersion ( ) const

Gets the system version data container from the scanner.

Returns
The system version data container or a nullptr if the system version could not be acquired (e.g. before the scanner was connected).
Version
SCENE API Version 2.0.0.

◆ getFirmwareVersion()

ref_ptr<LSAttributeContainer> getFirmwareVersion ( ) const

Gets the firmware version data container from the scanner.

Returns
The firmware version data container or a nullptr if the firmware version could not be acquired (e.g. before the scanner was connected).
Version
SCENE API Version 2.0.0.

◆ getScannerStatus()

ref_ptr<LSAttributeContainer> getScannerStatus ( ) const

Gets the scanner status data container from the scanner.

Note
This method cannot be used to check if the scanner is still connected. It will typically just report an outdated status after the connection to the scanner was interrupted.
Returns
The scanner status data container or a nullptr if the status could not be acquired (e.g. before the scanner was connected).
Version
SCENE API Version 2.0.0.

◆ getStatusMessages()

LSPod<std::vector<ref_ptr<LSAttributeContainer> > > getStatusMessages ( ) const

Gets a list of the stored status messages from the scanner.

Note
Status messages are generated by the ID and the corresponding level, subject, text and solution proposition. The level defines the warning level: 1 = error, 3 = warning , 5 = info and 10 = no message. Status messages are removed from the block as soon they are no longer valid.
Returns
The list of stored status messages.
Version
SCENE API Version 2.0.0.

◆ getWarningMessage()

ref_ptr<LSAttributeContainer> getWarningMessage ( ) const

Gets the current warning message from the scanner.

Note
Warnings are generated by the ID and the corresponding level, subject, text and solution proposition. The level defines the warning level: 1 = error, 3 = warning , 5 = info and 10 = no message. In most cases it will require to manually resolve the problem on the scanner before to continue any operation.
Returns
The current warning message or a nullptr if the warning message could not be acquired (e.g. before the scanner was connected).
Version
SCENE API Version 2.0.0.

◆ getScannerParameters()

ref_ptr<LSAttributeContainer> getScannerParameters ( ) const

Gets the current set of scanner parameters from the scanner.

Returns
The current set of scanner parameters or a nullptr if the parameters could not be acquired (e.g. before the scanner was connected).
Version
SCENE API Version 2.0.0.

◆ setScannerParameters()

bool setScannerParameters ( ref_ptr< LSAttributeContainer parameters)

Sets the current set of scanner parameters for the scanner.

Parameters
parametersThe parameters to be set for the scanner.
Returns
true if the parameters could be set, false otherwise.
Version
SCENE API Version 2.0.0.

◆ detectScanners()

LSPod<std::vector<std::pair<LSString, LSString> > > detectScanners ( int  waitForMs = 1000) const

Fetches a list of scanners available in the network.

Note
Works only for V6 and V7 scanner models. Not supported by the V8 scanners.
Parameters
waitForMsdetectScanners sends a network broadcast message. waitForMS defines the time to wait until all answers are collected and returned.
Returns
list of pairs of scanner serial number and its ip address. Empty list on error.
Version
SCENE API Version 2.0.10.

◆ getSensorTemperature()

bool getSensorTemperature ( double &  temperature) const

Gets the temperature of the sensor from inside the scanner.

Parameters
temperatureOutput for the current sensor temperature in degree Celsius.
Returns
True if successful, false if the request failed due to connection loss or other problems.
Version
SCENE API Version 2.0.15.