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;
33 SURGSIM_STATIC_REGISTRATION(LabJackDevice);
286 bool initialize()
override;
288 bool isInitialized()
const override;
310 void setAddress(std::string address);
313 const std::string& getAddress()
const;
324 void setResetOnDestruct(
bool reset);
328 bool getResetOnDestruct()
const;
333 void enableDigitalInput(
int channel);
338 void setDigitalInputs(
const std::unordered_set<int>& digitalInputChannels);
341 const std::unordered_set<int>& getDigitalInputs()
const;
346 void enableDigitalOutput(
int channel);
351 void setDigitalOutputs(
const std::unordered_set<int>& digitalOutputChannels);
354 const std::unordered_set<int>& getDigitalOutputs()
const;
369 void setTimerClockDivisor(
int divisor);
372 int getTimerClockDivisor()
const;
377 void setTimerCounterPinOffset(
int offset);
380 int getTimerCounterPinOffset()
const;
406 void setTimers(
const std::unordered_map<int, LabJack::TimerSettings>& timers);
409 const std::unordered_map<int, LabJack::TimerSettings>& getTimers()
const;
414 void setMaximumUpdateRate(
double rate);
417 double getMaximumUpdateRate()
const;
425 void enableAnalogInput(
int positiveChannel,
LabJack::Range range,
int negativeChannel);
438 void setAnalogInputs(
const std::unordered_map<int, LabJack::AnalogInputSettings>& analogInputs);
441 const std::unordered_map<int, LabJack::AnalogInputSettings>& getAnalogInputs()
const;
446 void enableAnalogOutput(
int channel);
452 void setAnalogOutputs(
const std::unordered_set<int>& analogOutputChannels);
455 const std::unordered_set<int>& getAnalogOutputs()
const;
462 void setAnalogInputResolution(
int resolution);
465 int getAnalogInputResolution()
const;
472 void setAnalogInputSettling(
int settling);
475 int getAnalogInputSettling()
const;
480 bool finalize()
override;
521 std::unordered_map<int, LabJack::TimerSettings>
m_timers;
536 #endif // SURGSIM_DEVICES_LABJACK_LABJACKDEVICE_H Definition: LabJackDevice.h:52
Definition: LabJackDevice.h:45
Definition: LabJackDevice.h:152
Definition: LabJackDevice.h:42
Definition: LabJackDevice.h:58
Definition: LabJackDevice.h:165
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:521
Definition: LabJackDevice.h:162
Definition: CompoundShapeToGraphics.cpp:29
Definition: LabJackDevice.h:85
Definition: LabJackDevice.h:131
Definition: LabJackDevice.h:57
Definition: LabJackDevice.h:206
Definition: LabJackDevice.h:76
Definition: LabJackDevice.h:77
Definition: LabJackDevice.h:147
Definition: LabJackDevice.h:128
Connection
The connection (i.e., communication media) for LabJacks. Numbers come from LabJackUD.h.
Definition: LabJackDevice.h:126
Definition: LabJackDevice.h:112
Definition: LabJackDevice.h:130
Definition: LabJackDevice.h:210
Definition: LabJackDevice.h:66
std::shared_ptr< LabJackScaffold > m_scaffold
The single scaffold object that handles communications with all instances of LabJackDevice.
Definition: LabJackDevice.h:483
Definition: LabJackDevice.h:170
Definition: LabJackDevice.h:167
Definition: LabJackDevice.h:103
Definition: LabJackDevice.h:121
DAC
Definition: LabJackDevice.h:109
TimerMode
The timer modes.
Definition: LabJackDevice.h:160
LabJack::Model m_model
The model, e.g., U6.
Definition: LabJackDevice.h:486
Definition: LabJackDevice.h:132
Definition: LabJackDevice.h:120
Definition: LabJackDevice.h:122
int m_timerClockDivisor
The timer clock's divisor, see m_timerBase.
Definition: LabJackDevice.h:515
Definition: LabJackDevice.h:140
Definition: LabJackDevice.h:43
Definition: LabJackDevice.h:102
int m_analogInputResolution
The resolution for all the analog inputs.
Definition: LabJackDevice.h:527
Definition: LabJackDevice.h:86
Definition: LabJackDevice.h:145
Definition: LabJackDevice.h:91
int m_timerCounterPinOffset
The number of the lowest FIO pin that is a timer or counter.
Definition: LabJackDevice.h:518
Definition: LabJackDevice.h:202
Model
The models of LabJack devices. Numbers come from LabJackUD.h.
Definition: LabJackDevice.h:117
Definition: LabJackDevice.h:95
Definition: LabJackDevice.h:46
Definition: LabJackDevice.h:100
Definition: LabJackDevice.h:143
Definition: LabJackDevice.h:47
Definition: LabJackDevice.h:151
Definition: LabJackDevice.h:205
A class implementing the communication with a LabJack data acquisition (DAQ) device.
Definition: LabJackDevice.h:274
Definition: LabJackDevice.h:153
#define SURGSIM_CLASSNAME(ClassName)
Declare the class name of a class with the appropriate function header, do not use quotes...
Definition: Macros.h:21
Definition: LabJackDevice.h:94
Definition: LabJackDevice.h:209
Definition: LabJackDevice.h:93
Definition: LabJackDevice.h:174
TimerBase
The timer base frequencies for LabJacks.
Definition: LabJackDevice.h:138
Definition: LabJackDevice.h:101
Definition: LabJackDevice.h:55
Definition: LabJackDevice.h:142
AIN
Definition: LabJackDevice.h:89
Definition: LabJackDevice.h:129
Definition: LabJackDevice.h:171
MIO_LINE
Definition: LabJackDevice.h:82
EIO_LINE
Definition: LabJackDevice.h:62
Definition: LabJackDevice.h:70
Definition: LabJackDevice.h:96
Definition: LabJackDevice.h:104
Definition: LabJackDevice.h:149
Definition: LabJackDevice.h:201
A class that implements the behavior of LabJackDevice objects.
Definition: LabJackScaffold.h:41
Definition: LabJackDevice.h:208
int m_analogInputSettling
The settling time for all the analog inputs.
Definition: LabJackDevice.h:530
Definition: LabJackDevice.h:53
Definition: LabJackDevice.h:119
Definition: LabJackDevice.h:79
Definition: LabJackDevice.h:106
Definition: LabJackDevice.h:67
Definition: LabJackDevice.h:163
Definition: LabJackDevice.h:92
Definition: LabJackDevice.h:111
Definition: LabJackDevice.h:97
Definition: LabJackDevice.h:44
double m_threadRate
The maximum update rate for the LabJackThread.
Definition: LabJackDevice.h:524
Definition: LabJackDevice.h:150
Definition: LabJackDevice.h:203
LabJack::TimerBase m_timerBase
The timer base, which is the frequency of all the output timers unless it ends in "_DIV"...
Definition: LabJackDevice.h:512
Definition: LabJackDevice.h:78
FIO_LINE
Definition: LabJackDevice.h:50
Definition: LabJackDevice.h:141
CIO_LINE
Definition: LabJackDevice.h:74
Definition: LabJackDevice.h:168
Definition: LabJackDevice.h:69
Definition: LabJackDevice.h:144
Definition: LabJackDevice.h:105
Definition: LabJackDevice.h:204
Definition: LabJackDevice.h:176
Definition: LabJackDevice.h:99
TIMER
Definition: LabJackDevice.h:40
Definition: LabJackDevice.h:64
std::unordered_set< int > m_digitalInputChannels
The line numbers for the digital inputs.
Definition: LabJackDevice.h:498
Definition: LabJackDevice.h:166
std::unordered_map< int, LabJack::AnalogInputSettings > m_analogInputs
The analog inputs. The key is the positive channel.
Definition: LabJackDevice.h:501
Definition: LabJackDevice.h:173
Definition: LabJackDevice.h:172
std::unordered_set< int > m_analogOutputChannels
The line numbers for the analog outputs.
Definition: LabJackDevice.h:507
Definition: LabJackDevice.h:59
A struct holding the data to be associated with a Timer.
Definition: LabJackDevice.h:180
TimerMode mode
The mode.
Definition: LabJackDevice.h:191
SurgSim::DataStructures::OptionalValue< int > initialValue
The initial value.
Definition: LabJackDevice.h:194
LabJack::Connection m_connection
The type of communication connection, e.g., USB.
Definition: LabJackDevice.h:489
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:492
bool operator==(const TimerSettings &other) const
Equality comparison.
Definition: LabJackDevice.h:185
Definition: LabJackDevice.h:175
std::unordered_set< int > m_digitalOutputChannels
The line numbers for the digital outputs.
Definition: LabJackDevice.h:504
Definition: LabJackDevice.h:164
Definition: LabJackDevice.h:169
Definition: LabJackDevice.h:200
Definition: LabJackDevice.h:207
Definition: LabJackDevice.h:154
Definition: LabJackDevice.h:65
Definition: LabJackDevice.h:146
Definition: LabJackDevice.h:98
bool m_reset
Whether or not the hardware should reset when this object destructs.
Definition: LabJackDevice.h:495
Range
The analog input ranges. Equivalent to gain. Ignored for Linux scaffold, which auto-ranges.
Definition: LabJackDevice.h:198
Definition: LabJackDevice.h:54
Definition: LabJackDevice.h:84
Definition: LabJackDevice.h:71
Definition: LabJackDevice.h:68
Definition: LabJackDevice.h:56
Definition: LabJackDevice.h:148