|
| LabJackDevice (const std::string &uniqueName) |
| Constructor. More...
|
|
| SURGSIM_CLASSNAME (SurgSim::Devices::LabJackDevice) |
|
virtual | ~LabJackDevice () |
| Destructor.
|
|
bool | initialize () override |
| Fully initialize the device. More...
|
|
bool | isInitialized () const override |
|
void | setModel (LabJack::Model model) |
| Set the model, e.g., U6. More...
|
|
LabJack::Model | getModel () const |
|
void | setConnection (LabJack::Connection connection) |
| Set the connection type of the LabJack, e.g., USB. More...
|
|
LabJack::Connection | getConnection () const |
|
void | setAddress (std::string address) |
| Set the address of the LabJack, e.g., "1" or "192.168.7.23". More...
|
|
const std::string & | getAddress () const |
|
void | setResetOnDestruct (bool reset) |
| Reset LabJack during destruct. More...
|
|
bool | getResetOnDestruct () const |
| Get whether or not the hardware should reset when the LabJackDevice object destructs. More...
|
|
void | enableDigitalInput (int channel) |
| Enable digital input line. More...
|
|
void | setDigitalInputs (const std::unordered_set< int > &digitalInputChannels) |
| Set which digital input lines are enabled. More...
|
|
const std::unordered_set< int > & | getDigitalInputs () const |
|
void | enableDigitalOutput (int channel) |
| Enable digital output line. More...
|
|
void | setDigitalOutputs (const std::unordered_set< int > &digitalOutputChannels) |
| Set which digital output lines are enabled. More...
|
|
const std::unordered_set< int > & | getDigitalOutputs () const |
|
void | setTimerBase (LabJack::TimerBase base) |
| Set the timer base rate. More...
|
|
LabJack::TimerBase | getTimerBase () const |
|
void | setTimerClockDivisor (int divisor) |
| If the Timer type ends in "_DIV", then the actual timer frequency is divided by the divisor. More...
|
|
int | getTimerClockDivisor () const |
|
void | setTimerCounterPinOffset (int offset) |
| The timers and counters are always on consecutive pins, but the start pin can be varied within limits. More...
|
|
int | getTimerCounterPinOffset () const |
|
void | enableTimer (int index, LabJack::TimerMode mode) |
| Enable timer. More...
|
|
void | enableTimer (int index, LabJack::TimerMode mode, int initialValue) |
| Enable timer with an initial value. More...
|
|
void | setTimers (const std::unordered_map< int, LabJack::TimerSettings > &timers) |
| Set which timers are enabled. More...
|
|
const std::unordered_map< int, LabJack::TimerSettings > & | getTimers () const |
|
void | setMaximumUpdateRate (double rate) |
| Set the maximum update rate for the LabJackThread. More...
|
|
double | getMaximumUpdateRate () const |
|
void | enableAnalogInput (int positiveChannel, LabJack::Range range, int negativeChannel) |
| Enable differential analog input. More...
|
|
void | enableAnalogInput (int channel, LabJack::Range range) |
| Enable single-ended analog input. More...
|
|
void | setAnalogInputs (const std::unordered_map< int, LabJack::AnalogInputSettings > &analogInputs) |
| Set which analog inputs are enabled. More...
|
|
const std::unordered_map< int, LabJack::AnalogInputSettings > & | getAnalogInputs () const |
|
void | enableAnalogOutput (int channel) |
| Enable analog output. More...
|
|
void | setAnalogOutputs (const std::unordered_set< int > &analogOutputChannels) |
| Set which analog outputs are enabled. More...
|
|
const std::unordered_set< int > & | getAnalogOutputs () const |
|
void | setAnalogInputResolution (int resolution) |
| Set the resolution for all the analog inputs. More...
|
|
int | getAnalogInputResolution () const |
|
void | setAnalogInputSettling (int settling) |
| Set the settling time for all the analog inputs. More...
|
|
int | getAnalogInputSettling () const |
|
| CommonDevice (const std::string &name) |
| Constructor. More...
|
|
| CommonDevice (const std::string &name, const DataStructures::DataGroup &inputData) |
| Constructor. More...
|
|
| CommonDevice (const std::string &name, DataStructures::DataGroup &&inputData) |
| Constructor. More...
|
|
virtual | ~CommonDevice () |
| Destructor.
|
|
std::string | getName () const override |
| Return a (hopefully unique) device name.
|
|
std::string | getClassName () const override |
| The class name for this class. More...
|
|
void | setNameForCallback (const std::string &name) |
| Set the name used for calling the input consumers and output producer. More...
|
|
std::string | getNameForCallback () const |
| Get the name used for calling the input consumers and output producer. More...
|
|
bool | addInputConsumer (std::shared_ptr< InputConsumerInterface > inputConsumer) override |
| Adds an input consumer that will be notified when the application input state is updated. More...
|
|
bool | removeInputConsumer (std::shared_ptr< InputConsumerInterface > inputConsumer) override |
| Removes an input consumer previously added via addInputConsumer. More...
|
|
void | clearInputConsumers () override |
| Removes all InputConsumers.
|
|
bool | setOutputProducer (std::shared_ptr< OutputProducerInterface > outputProducer) override |
| Sets an output producer that will be asked for application output state when the device needs it. More...
|
|
bool | removeOutputProducer (std::shared_ptr< OutputProducerInterface > outputProducer) override |
| Removes an output producer previously added via setOutputProducer. More...
|
|
bool | hasOutputProducer () override |
| Query if this object has output producer. More...
|
|
void | clearOutputProducer () override |
| Removes any OutputProducer.
|
|
virtual | ~DeviceInterface () |
| Virtual destructor (empty).
|
|
| Accessible () |
| Default Constructor.
|
|
| ~Accessible () |
| Destructor.
|
|
template<class T > |
T | getValue (const std::string &name) const |
| Retrieves the value with the name by executing the getter if it is found and tries to convert it to the given type. More...
|
|
boost::any | getValue (const std::string &name) const |
| Retrieves the value with the name by executing the getter if it is found. More...
|
|
template<class T > |
bool | getValue (const std::string &name, T *value) const |
| Retrieves the value with the name by executing the getter if it is found, and converts it to the type of the output parameter. More...
|
|
void | setValue (const std::string &name, const boost::any &value) |
| Sets a value of a property that has setter. More...
|
|
bool | isReadable (const std::string &name) const |
| Check whether a property is readable. More...
|
|
bool | isWriteable (const std::string &name) const |
| Check whether a property is writable. More...
|
|
void | setGetter (const std::string &name, GetterType func) |
| Sets a getter for a given property. More...
|
|
void | setSetter (const std::string &name, SetterType func) |
| Sets a setter for a given property. More...
|
|
void | setAccessors (const std::string &name, GetterType getter, SetterType setter) |
| Sets the accessors getter and setter in one function. More...
|
|
void | removeAccessors (const std::string &name) |
| Removes all the accessors (getter and setter) for a given property. More...
|
|
void | forwardProperty (const std::string &name, const Accessible &target, const std::string &targetProperty) |
| Adds a property with the given name that uses the targets accessors, in effect forwarding the value to the target. More...
|
|
void | setSerializable (const std::string &name, EncoderType encoder, DecoderType decoder) |
| Sets the functions used to convert data from and to a YAML::Node. More...
|
|
void | setDecoder (const std::string &name, DecoderType decoder) |
| Sets the functions used to convert data from a YAML::Node. More...
|
|
YAML::Node | encode () const |
| Encode this Accessible to a YAML::Node. More...
|
|
void | decode (const YAML::Node &node, const std::vector< std::string > &ignoredProperties=std::vector< std::string >()) |
| Decode this Accessible from a YAML::Node, will throw an exception if the data type cannot be converted. More...
|
|
std::vector< std::string > | getProperties () |
|
template<> |
boost::any | getValue (const std::string &name) const |
|
A class implementing the communication with a LabJack data acquisition (DAQ) device.
Should work for the U3, U6, and U9 models on Windows and the U3 and U6 on Linux. See the manual(s) for your LabJack device(s) to understand the input and output data, the configuration parameters, timing limitations, etc. The various parameters and inputs are almost always passed through unchanged to the device driver. Timers, digital input/output, and analog input/output are supported. Currently not supported are counters, using the same channel as the positive channel for multiple analog inputs, and reconfiguring the device after initialization.
- Warning
- The LabJack device is configurable to such a degree that neither this class nor LabJackScaffold are able to do significant error-checking. If the output DataGroup and the calls (e.g., addTimer) to this class are not in agreement, the requests to the LabJack device driver will not be correct.
- Application input provided by the device:
type | name | |
scalar | "analogInput0" | Analog input with AIN0 as the positive channel |
scalar | "analogInput1" | Analog input with AIN1 as the positive channel |
... | ... | ... |
scalar | "analogInput16" | Analog input with AIN16 as the positive channel |
boolean | "digitalInput0" | Digital input, line #0, true for high input, false for low |
boolean | "digitalInput1" | Digital input, line #1, true for high input, false for low |
... | ... | ... |
boolean | "digitalInput23" | Digital input, line #23, true for high input, false for low |
scalar | "timerInput0" | The input from timer #0 if that timer provides input values |
scalar | "timerInput1" | The input from timer #1 if that timer provides input values |
... | ... | ... |
scalar | "timerInput6" | The input from timer #6 if that timer provides input values |
- Application output used by the device:
type | name | |
scalar | "analogOutput0" | Analog output, DAC0 |
scalar | "analogOutput1" | Analog output, DAC1 |
boolean | "digitalOutput0" | Digital output, line #0, true for high output, false for low |
boolean | "digitalOutput1" | Digital output, line #1, true for high output, false for low |
... | ... | ... |
boolean | "digitalOutput23" | Digital output, line #23, true for high output, false for low |
scalar | "timerOutput0" | The output for timer #0 if that timer accepts output values |
scalar | "timerOutput1" | The output for timer #1 if that timer accepts output values |
... | ... | ... |
scalar | "timerOutput6" | The output for timer #6 if that timer accepts output values |
- See also
- SurgSim::Input::CommonDevice, SurgSim::Input::DeviceInterface, LabJackScaffold