16 #ifndef SURGSIM_DEVICES_LABJACK_LABJACKDEVICE_H 17 #define SURGSIM_DEVICES_LABJACK_LABJACKDEVICE_H 21 #include <unordered_map> 22 #include <unordered_set> 31 class LabJackScaffold;
287 virtual bool initialize()
override;
290 bool isInitialized()
const;
320 void enableDigitalInput(
int channel);
325 void setDigitalInputs(
const std::unordered_set<int>& digitalInputChannels);
328 const std::unordered_set<int>& getDigitalInputs()
const;
333 void enableDigitalOutput(
int channel);
338 void setDigitalOutputs(
const std::unordered_set<int>& digitalOutputChannels);
341 const std::unordered_set<int>& getDigitalOutputs()
const;
356 void setTimerClockDivisor(
int divisor);
359 int getTimerClockDivisor()
const;
364 void setTimerCounterPinOffset(
int offset);
367 int getTimerCounterPinOffset()
const;
393 void setTimers(
const std::unordered_map<int, LabJack::TimerSettings>& timers);
396 const std::unordered_map<int, LabJack::TimerSettings>& getTimers()
const;
401 void setMaximumUpdateRate(
double rate);
404 double getMaximumUpdateRate()
const;
412 void enableAnalogInput(
int positiveChannel,
LabJack::Range range,
int negativeChannel);
425 void setAnalogInputs(
const std::unordered_map<int, LabJack::AnalogInputSettings>& analogInputs);
428 const std::unordered_map<int, LabJack::AnalogInputSettings>& getAnalogInputs()
const;
433 void enableAnalogOutput(
int channel);
439 void setAnalogOutputs(
const std::unordered_set<int>& analogOutputChannels);
442 const std::unordered_set<int>& getAnalogOutputs()
const;
449 void setAnalogInputResolution(
int resolution);
452 int getAnalogInputResolution()
const;
459 void setAnalogInputSettling(
int settling);
462 int getAnalogInputSettling()
const;
468 virtual bool finalize()
override;
508 std::unordered_map<int, LabJack::TimerSettings>
m_timers;
523 #endif // SURGSIM_DEVICES_LABJACK_LABJACKDEVICE_H Definition: LabJackDevice.h:82
Definition: DriveElementFromInputBehavior.cpp:27
Definition: LabJackDevice.h:99
AIN
Definition: LabJackDevice.h:87
Definition: LabJackDevice.h:198
Definition: LabJackDevice.h:119
CIO_LINE
Definition: LabJackDevice.h:72
Definition: LabJackDevice.h:147
int m_analogInputSettling
The settling time for all the analog inputs.
Definition: LabJackDevice.h:517
Definition: LabJackDevice.h:63
Definition: LabJackDevice.h:142
Definition: LabJackDevice.h:173
Definition: LabJackDevice.h:64
Definition: LabJackDevice.h:160
std::unordered_set< int > m_digitalOutputChannels
The line numbers for the digital outputs.
Definition: LabJackDevice.h:491
Definition: LabJackDevice.h:42
DAC
Definition: LabJackDevice.h:107
Definition: LabJackDevice.h:208
Definition: LabJackDevice.h:90
Definition: LabJackDevice.h:56
Definition: LabJackDevice.h:167
Definition: LabJackDevice.h:149
Definition: LabJackDevice.h:152
Definition: LabJackDevice.h:50
Definition: LabJackDevice.h:84
EIO_LINE
Definition: LabJackDevice.h:60
Definition: LabJackDevice.h:168
Definition: LabJackDevice.h:40
LabJack::Connection m_connection
The type of communication connection, e.g., USB.
Definition: LabJackDevice.h:479
Definition: LabJackDevice.h:169
Model
The models of LabJack devices. Numbers come from LabJackUD.h.
Definition: LabJackDevice.h:115
Definition: LabJackDevice.h:204
Definition: LabJackDevice.h:69
std::string m_address
The address, or a zero-length string to indicate the first-found device of this type on this connecti...
Definition: LabJackDevice.h:482
Definition: LabJackDevice.h:104
Definition: LabJackDevice.h:75
Definition: LabJackDevice.h:100
Definition: LabJackDevice.h:162
int m_timerCounterPinOffset
The number of the lowest FIO pin that is a timer or counter.
Definition: LabJackDevice.h:505
Definition: LabJackDevice.h:52
Definition: LabJackDevice.h:93
Definition: LabJackDevice.h:171
Definition: LabJackDevice.h:97
Definition: LabJackDevice.h:67
Definition: LabJackDevice.h:109
Definition: LabJackDevice.h:164
Definition: LabJackDevice.h:120
Definition: LabJackDevice.h:95
string(TOUPPER ${DEVICE}DEVICE_UPPER_CASE) option(BUILD_DEVICE_ $
Definition: CMakeLists.txt:35
Definition: LabJackDevice.h:43
Definition: LabJackDevice.h:141
Definition: LabJackDevice.h:200
Definition: LabJackDevice.h:129
Definition: LabJackDevice.h:54
TimerMode mode
The mode.
Definition: LabJackDevice.h:189
Definition: LabJackDevice.h:96
Definition: LabJackDevice.h:206
Definition: LabJackDevice.h:65
Definition: LabJackDevice.h:91
Definition: LabJackDevice.h:66
Definition: LabJackDevice.h:207
Definition: LabJackDevice.h:130
Range
The analog input ranges. Equivalent to gain. Ignored for Linux scaffold, which auto-ranges.
Definition: LabJackDevice.h:196
LabJack::TimerBase m_timerBase
The timer base, which is the frequency of all the output timers unless it ends in "_DIV"...
Definition: LabJackDevice.h:499
Definition: LabJackDevice.h:51
Definition: LabJackDevice.h:145
Definition: LabJackDevice.h:117
double m_threadRate
The maximum update rate for the LabJackThread.
Definition: LabJackDevice.h:511
Definition: LabJackDevice.h:101
Definition: LabJackDevice.h:126
TimerMode
The timer modes.
Definition: LabJackDevice.h:158
Definition: LabJackDevice.h:138
Definition: LabJackDevice.h:140
Definition: LabJackDevice.h:161
Definition: LabJackDevice.h:144
FIO_LINE
Definition: LabJackDevice.h:48
TimerBase
The timer base frequencies for LabJacks.
Definition: LabJackDevice.h:136
Definition: LabJackDevice.h:53
MIO_LINE
Definition: LabJackDevice.h:80
Definition: LabJackDevice.h:170
Definition: LabJackDevice.h:94
Definition: LabJackDevice.h:103
A struct holding the data to be associated with a Timer.
Definition: LabJackDevice.h:178
Definition: LabJackDevice.h:146
bool operator==(const TimerSettings &other) const
Equality comparison.
Definition: LabJackDevice.h:183
Definition: LabJackDevice.h:139
Definition: LabJackDevice.h:62
Definition: LabJackDevice.h:57
Definition: LabJackDevice.h:172
Definition: LabJackDevice.h:151
Definition: LabJackDevice.h:76
Connection
The connection (i.e., communication media) for LabJacks. Numbers come from LabJackUD.h.
Definition: LabJackDevice.h:124
std::unordered_set< int > m_digitalInputChannels
The line numbers for the digital inputs.
Definition: LabJackDevice.h:485
std::unordered_set< int > m_analogOutputChannels
The line numbers for the analog outputs.
Definition: LabJackDevice.h:494
SurgSim::DataStructures::OptionalValue< int > initialValue
The initial value.
Definition: LabJackDevice.h:192
Definition: LabJackDevice.h:166
int m_analogInputResolution
The resolution for all the analog inputs.
Definition: LabJackDevice.h:514
Definition: LabJackDevice.h:203
std::unordered_map< int, LabJack::AnalogInputSettings > m_analogInputs
The analog inputs. The key is the positive channel.
Definition: LabJackDevice.h:488
Definition: LabJackDevice.h:127
Definition: LabJackDevice.h:150
Definition: LabJackDevice.h:45
Definition: LabJackDevice.h:165
Definition: LabJackDevice.h:118
Definition: LabJackDevice.h:89
int m_timerClockDivisor
The timer clock's divisor, see m_timerBase.
Definition: LabJackDevice.h:502
Definition: LabJackDevice.h:199
Definition: LabJackDevice.h:74
A class implementing the communication with a LabJack data acquisition (DAQ) device.
Definition: LabJackDevice.h:272
LabJack::Model m_model
The model, e.g., U6.
Definition: LabJackDevice.h:476
Definition: LabJackDevice.h:143
Definition: LabJackDevice.h:202
TIMER
Definition: LabJackDevice.h:38
Definition: LabJackDevice.h:44
Definition: LabJackDevice.h:163
Definition: LabJackDevice.h:205
Definition: LabJackDevice.h:110
Definition: LabJackDevice.h:128
Definition: LabJackDevice.h:68
Definition: LabJackDevice.h:98
A class that implements the behavior of LabJackDevice objects.
Definition: LabJackScaffold.h:41
Definition: LabJackDevice.h:102
Definition: LabJackDevice.h:174
Definition: LabJackDevice.h:41
Definition: LabJackDevice.h:55
std::unordered_map< int, LabJack::TimerSettings > m_timers
A map from the timers' line numbers to their mode and optional initial value.
Definition: LabJackDevice.h:508
Definition: LabJackDevice.h:83
Definition: LabJackDevice.h:92
Definition: LabJackDevice.h:201
Definition: LabJackDevice.h:77
Definition: LabJackDevice.h:148
std::shared_ptr< LabJackScaffold > m_scaffold
The single scaffold object that handles communications with all instances of LabJackDevice.
Definition: LabJackDevice.h:473