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::Devices::LabJackDevice
◆ LabJackScaffold()
SurgSim::Devices::LabJackScaffold::LabJackScaffold |
( |
| ) |
|
◆ ~LabJackScaffold()
SurgSim::Devices::LabJackScaffold::~LabJackScaffold |
( |
| ) |
|
◆ buildDeviceInputData()
Builds the data layout for the application input (i.e. device output).
◆ configureAnalog()
bool SurgSim::Devices::LabJackScaffold::configureAnalog |
( |
DeviceData * |
deviceData | ) |
|
|
private |
One-time configuration of the analog inputs.
- Parameters
-
deviceData | The internal device data. |
- Returns
- False if any errors.
◆ configureClock()
bool SurgSim::Devices::LabJackScaffold::configureClock |
( |
DeviceData * |
deviceData | ) |
|
|
private |
One-time configuration of the clock.
- Parameters
-
deviceData | The internal device data. |
- Returns
- False if any errors.
◆ configureClockAndTimers()
bool SurgSim::Devices::LabJackScaffold::configureClockAndTimers |
( |
DeviceData * |
deviceData | ) |
|
|
private |
One-time configuration of the clock and timers.
- Parameters
-
deviceData | The internal device data. |
- Returns
- False if any errors.
◆ configureDevice()
void SurgSim::Devices::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. |
◆ configureDigital()
bool SurgSim::Devices::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.
◆ configureNumberOfTimers()
bool SurgSim::Devices::LabJackScaffold::configureNumberOfTimers |
( |
DeviceData * |
deviceData | ) |
|
|
private |
One-time configuration of the number of timers.
- Parameters
-
deviceData | The internal device data. |
- Returns
- False if any errors.
◆ configureTimers()
bool SurgSim::Devices::LabJackScaffold::configureTimers |
( |
DeviceData * |
deviceData | ) |
|
|
private |
One-time configuration of the timers.
- Parameters
-
deviceData | The internal device data. |
- Returns
- False if any errors.
◆ destroyPerDeviceThread()
bool SurgSim::Devices::LabJackScaffold::destroyPerDeviceThread |
( |
DeviceData * |
data | ) |
|
|
private |
Destroys the input loop thread.
- Parameters
-
data | The internal device data. |
- Returns
- true on success.
◆ getOrCreateSharedInstance()
std::shared_ptr< LabJackScaffold > SurgSim::Devices::LabJackScaffold::getOrCreateSharedInstance |
( |
| ) |
|
|
static |
Gets or creates the scaffold shared by all LabJackDevice instances.
The scaffold is managed using a SharedInstance object, so it will be destroyed when all devices are released.
- Returns
- the scaffold object.
◆ registerDevice()
bool SurgSim::Devices::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.
◆ 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 to keep the LabJackThread running.
◆ unregisterDevice()
bool SurgSim::Devices::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.
◆ updateDevice()
Updates the device information for a single device.
- Parameters
-
info | The internal device data. |
- Returns
- true on success.
◆ LabJackDevice
◆ LabJackThread
◆ StateData
◆ m_logger
Logger used by the scaffold and all devices.
◆ m_state
std::unique_ptr<StateData> SurgSim::Devices::LabJackScaffold::m_state |
|
private |
The documentation for this class was generated from the following files: