A class that implements the behavior of LabJackDevice objects.
More...
#include <SurgSim/Devices/LabJack/LabJackScaffold.h>
A class that implements the behavior of LabJackDevice objects.
- See also
- SurgSim::Device::LabJackDevice
SurgSim::Device::LabJackScaffold::LabJackScaffold |
( |
| ) |
|
SurgSim::Device::LabJackScaffold::~LabJackScaffold |
( |
| ) |
|
Builds the data layout for the application input (i.e. device output).
bool SurgSim::Device::LabJackScaffold::configureAnalog |
( |
DeviceData * |
deviceData | ) |
|
|
private |
One-time configuration of the analog inputs.
- Parameters
-
deviceData | The internal device data. |
- Returns
- False if any errors.
bool SurgSim::Device::LabJackScaffold::configureClock |
( |
DeviceData * |
deviceData | ) |
|
|
private |
One-time configuration of the clock.
- Parameters
-
deviceData | The internal device data. |
- Returns
- False if any errors.
bool SurgSim::Device::LabJackScaffold::configureClockAndTimers |
( |
DeviceData * |
deviceData | ) |
|
|
private |
One-time configuration of the clock and timers.
- Parameters
-
deviceData | The internal device data. |
- Returns
- False if any errors.
bool SurgSim::Device::LabJackScaffold::configureDevice |
( |
DeviceData * |
device | ) |
|
Does one-time configuration of the LabJack for timers, counters, and analog inputs.
Must be called by the LabJackThread because the LabJack separates all commands by the calling thread.
- Parameters
-
device | The internal device data. |
- Returns
- False if any errors.
bool SurgSim::Device::LabJackScaffold::configureDigital |
( |
DeviceData * |
deviceData | ) |
|
|
private |
One-time configuration of the digital inputs and outputs.
- Parameters
-
deviceData | The internal device data. |
- Returns
- False if any errors.
bool SurgSim::Device::LabJackScaffold::configureNumberOfTimers |
( |
DeviceData * |
deviceData | ) |
|
|
private |
One-time configuration of the number of timers.
- Parameters
-
deviceData | The internal device data. |
- Returns
- False if any errors.
bool SurgSim::Device::LabJackScaffold::configureTimers |
( |
DeviceData * |
deviceData | ) |
|
|
private |
One-time configuration of the timers.
- Parameters
-
deviceData | The internal device data. |
- Returns
- False if any errors.
bool SurgSim::Device::LabJackScaffold::destroyPerDeviceThread |
( |
DeviceData * |
data | ) |
|
|
private |
Destroys the input loop thread.
- Parameters
-
data | The internal device data. |
- Returns
- true on success.
Gets the logger used by this object and the devices it manages.
- Returns
- The logger.
std::shared_ptr< LabJackScaffold > SurgSim::Device::LabJackScaffold::getOrCreateSharedInstance |
( |
| ) |
|
|
static |
Gets or creates the scaffold shared by all LabJackDevice instances.
The scaffold is managed using a SingleInstance object, so it will be destroyed when all devices are released.
- Returns
- the scaffold object.
bool SurgSim::Device::LabJackScaffold::registerDevice |
( |
LabJackDevice * |
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.
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 to keep the LabJackThread running.
bool SurgSim::Device::LabJackScaffold::unregisterDevice |
( |
const LabJackDevice * |
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.
Updates the device information for a single device.
- Parameters
-
info | The internal device data. |
- Returns
- true on success.
Logger used by the scaffold and all devices.
std::unique_ptr<StateData> SurgSim::Device::LabJackScaffold::m_state |
|
private |
The documentation for this class was generated from the following files: