A class that implements the behavior of RawMultiAxisDevice objects.
More...
#include <SurgSim/Devices/MultiAxis/RawMultiAxisScaffold.h>
|
bool | registerDevice (RawMultiAxisDevice *device) |
| Registers the specified device object. More...
|
|
bool | unregisterDevice (const RawMultiAxisDevice *device) |
| Unregisters the specified device object. More...
|
|
void | setPositionScale (const RawMultiAxisDevice *device, double scale) |
| Sets the position scale for this device. More...
|
|
void | setOrientationScale (const RawMultiAxisDevice *device, double scale) |
| Sets the orientation scale for this device. More...
|
|
void | setAxisDominance (const RawMultiAxisDevice *device, bool onOff) |
| Turns on or off the axis dominance setting for this device. More...
|
|
bool | runInputFrame (DeviceData *info) |
| Executes the operations for a single input frame for a single device. More...
|
|
bool | runAfterLastFrame (DeviceData *info) |
| Executes the operations after the last input frame, as the device input loop thread is shutting down. More...
|
|
bool | updateDevice (DeviceData *info) |
| Updates the device information for a single device. More...
|
|
bool | findUnusedDeviceAndRegister (RawMultiAxisDevice *device, int *numUsedDevicesSeen) |
| Scans hardware that is present in the system, and if an unused device is found, register an object for it. More...
|
|
bool | registerIfUnused (const std::string &path, RawMultiAxisDevice *device, int *numUsedDevicesSeen) |
| Register a device object given a device path, if the same path is not already in use. More...
|
|
bool | createPerDeviceThread (DeviceData *data) |
| Creates the input loop thread. More...
|
|
bool | destroyPerDeviceThread (DeviceData *data) |
| Destroys the input loop thread. More...
|
|
std::unique_ptr< SystemInputDeviceHandle > | openDevice (const std::string &path) |
| Opens the specified device. More...
|
|
A class that implements the behavior of RawMultiAxisDevice objects.
- See also
- SurgSim::Devices::RawMultiAxisDevice
§ RawMultiAxisScaffold()
SurgSim::Devices::RawMultiAxisScaffold::RawMultiAxisScaffold |
( |
| ) |
|
§ ~RawMultiAxisScaffold()
SurgSim::Devices::RawMultiAxisScaffold::~RawMultiAxisScaffold |
( |
| ) |
|
§ buildDeviceInputData()
Builds the data layout for the application input (i.e. device output).
§ createPerDeviceThread()
bool SurgSim::Devices::RawMultiAxisScaffold::createPerDeviceThread |
( |
DeviceData * |
data | ) |
|
|
private |
Creates the input loop thread.
- Returns
- true on success.
§ destroyPerDeviceThread()
bool SurgSim::Devices::RawMultiAxisScaffold::destroyPerDeviceThread |
( |
DeviceData * |
data | ) |
|
|
private |
Destroys the input loop thread.
- Returns
- true on success.
§ findUnusedDeviceAndRegister()
bool SurgSim::Devices::RawMultiAxisScaffold::findUnusedDeviceAndRegister |
( |
RawMultiAxisDevice * |
device, |
|
|
int * |
numUsedDevicesSeen |
|
) |
| |
|
private |
Scans hardware that is present in the system, and if an unused device is found, register an object for it.
- Parameters
-
| device | The device object to register if an unused device is found. |
[out] | numUsedDevicesSeen | The number of devices that were found during the scan but were already in use. Can be used if the scan fails to determine the error message that should be displayed. |
- Returns
- true on success.
§ getOrCreateSharedInstance()
std::shared_ptr< RawMultiAxisScaffold > SurgSim::Devices::RawMultiAxisScaffold::getOrCreateSharedInstance |
( |
| ) |
|
|
static |
Gets or creates the scaffold shared by all RawMultiAxisDevice instances.
The scaffold is managed using a SharedInstance object, so it will be destroyed when all devices are released.
- Returns
- the scaffold object.
§ openDevice()
std::unique_ptr< SystemInputDeviceHandle > SurgSim::Devices::RawMultiAxisScaffold::openDevice |
( |
const std::string & |
path | ) |
|
|
private |
Opens the specified device.
- Returns
- The system-specific wrapper for the device.
§ registerDevice()
bool SurgSim::Devices::RawMultiAxisScaffold::registerDevice |
( |
RawMultiAxisDevice * |
device | ) |
|
|
private |
Registers the specified device object.
If successful, the device object will become connected to an unused hardware device.
- Parameters
-
device | The device object to be used, which should have a unique name. |
- Returns
- True if the initialization succeeds, false if it fails.
§ registerIfUnused()
bool SurgSim::Devices::RawMultiAxisScaffold::registerIfUnused |
( |
const std::string & |
path, |
|
|
RawMultiAxisDevice * |
device, |
|
|
int * |
numUsedDevicesSeen |
|
) |
| |
|
private |
Register a device object given a device path, if the same path is not already in use.
- Parameters
-
| path | A unique system path that can be used to communicate with the device. |
| device | The device object to register if the index pair is in fact unused. |
[in,out] | numUsedDevicesSeen | The number of devices that were found during the scan but were already in use; incremented when an unused device is seen. |
- Returns
- true on success.
§ runAfterLastFrame()
Executes the operations after the last input frame, as the device input loop thread is shutting down.
Should only be called from the context of the input loop thread.
- Parameters
-
info | The internal device data. |
- Returns
- true on success.
§ runInputFrame()
Executes the operations for a single input frame for a single device.
Should only be called from the context of the input loop thread.
- Parameters
-
info | The internal device data. |
- Returns
- true on success.
§ setAxisDominance()
void SurgSim::Devices::RawMultiAxisScaffold::setAxisDominance |
( |
const RawMultiAxisDevice * |
device, |
|
|
bool |
onOff |
|
) |
| |
|
private |
Turns on or off the axis dominance setting for this device.
§ setOrientationScale()
void SurgSim::Devices::RawMultiAxisScaffold::setOrientationScale |
( |
const RawMultiAxisDevice * |
device, |
|
|
double |
scale |
|
) |
| |
|
private |
Sets the orientation scale for this device.
§ setPositionScale()
void SurgSim::Devices::RawMultiAxisScaffold::setPositionScale |
( |
const RawMultiAxisDevice * |
device, |
|
|
double |
scale |
|
) |
| |
|
private |
Sets the position scale for this device.
§ unregisterDevice()
bool SurgSim::Devices::RawMultiAxisScaffold::unregisterDevice |
( |
const RawMultiAxisDevice * |
device | ) |
|
|
private |
Unregisters the specified device object.
The corresponding hardware device will become unused, and can be re-registered later.
- Parameters
-
- Returns
- true on success, false on failure.
§ updateDevice()
Updates the device information for a single device.
- Returns
- true on success.
§ RawMultiAxisDevice
§ RawMultiAxisThread
§ StateData
§ m_logger
Logger used by the scaffold and all devices.
§ m_state
std::unique_ptr<StateData> SurgSim::Devices::RawMultiAxisScaffold::m_state |
|
private |
The documentation for this class was generated from the following files: