Class: Phidgets::TemperatureSensor::TemperatureSensorSensors
- Inherits:
-
Object
- Object
- Phidgets::TemperatureSensor::TemperatureSensorSensors
- Defined in:
- lib/phidgets-ffi/temperature_sensor.rb
Overview
This class represents a thermocouple sensor attached for a PhidgetTemperatureSensor. All the properties of an thermocouple sensor are stored and modified in this class.
Constant Summary collapse
- Klass =
Phidgets::FFI::CPhidgetTemperatureSensor
Instance Method Summary collapse
-
#index ⇒ Integer
Returns index of the thermocouple sensor, or raises an error.
-
#inspect ⇒ Object
Displays data for the thermocouple sensor.
-
#potential ⇒ Float
Returns the potential of the thermocouple sensor, in mV, or raises an error.
-
#potential_max ⇒ Float
Returns the largest potential that the thermocouple sensor can return, in mV, or raises an error.
-
#potential_min ⇒ Float
Returns the smallest potential that the thermocouple sensor can return, in mV, or raises an error.
-
#sensitivity ⇒ Float
Returns the temperature change trigger sensitivity for the thermocouple sensor, or raises an error.
-
#sensitivity=(new_sensitivity) ⇒ Float
Sets the temperature change trigger sensitivity of the thermocouple sensor, or raises an error.
-
#temperature ⇒ Float
Returns the temperature of the thermocouple sensor, in degrees celcius, or raises an error.
-
#temperature_max ⇒ Float
Returns the maximum temperature value that the thermocouple sensor can return, in degrees celcius, or raises an error.
-
#temperature_min ⇒ Float
Returns the minimum temperature value that the thermocouple sensor can return, in degrees celcius, or raises an error.
-
#type ⇒ Phidgets::FFI::TemperatureSensorThermocoupleTypes
Returns the thermocouple type of the thermocouple sensor, or raises an error.
-
#type=(new_type) ⇒ Phidgets::FFI::TemperatureSensorThermocoupleTypes
Sets the thermocouple type of the thermocouple sensor, or raises an error.
Instance Method Details
#index ⇒ Integer
Returns index of the thermocouple sensor, or raises an error.
57 58 59 |
# File 'lib/phidgets-ffi/temperature_sensor.rb', line 57 def index @index end |
#inspect ⇒ Object
Displays data for the thermocouple sensor.
52 53 54 |
# File 'lib/phidgets-ffi/temperature_sensor.rb', line 52 def inspect "#<#{self.class} @index=#{index}, @sensitivity=#{sensitivity}, @temperature_min=#{temperature_min}, @temperature_max=#{temperature_max}, @type=#{type}>" end |
#potential ⇒ Float
Returns the potential of the thermocouple sensor, in mV, or raises an error.
62 63 64 65 66 |
# File 'lib/phidgets-ffi/temperature_sensor.rb', line 62 def potential ptr = ::FFI::MemoryPointer.new(:double) Klass.getPotential(@handle, @index, ptr) ptr.get_double(0) end |
#potential_max ⇒ Float
Returns the largest potential that the thermocouple sensor can return, in mV, or raises an error.
76 77 78 79 80 |
# File 'lib/phidgets-ffi/temperature_sensor.rb', line 76 def potential_max ptr = ::FFI::MemoryPointer.new(:double) Klass.getPotentialMax(@handle, @index, ptr) ptr.get_double(0) end |
#potential_min ⇒ Float
Returns the smallest potential that the thermocouple sensor can return, in mV, or raises an error.
69 70 71 72 73 |
# File 'lib/phidgets-ffi/temperature_sensor.rb', line 69 def potential_min ptr = ::FFI::MemoryPointer.new(:double) Klass.getPotentialMin(@handle, @index, ptr) ptr.get_double(0) end |
#sensitivity ⇒ Float
Returns the temperature change trigger sensitivity for the thermocouple sensor, or raises an error.
83 84 85 86 87 |
# File 'lib/phidgets-ffi/temperature_sensor.rb', line 83 def sensitivity ptr = ::FFI::MemoryPointer.new(:double) Klass.getTemperatureChangeTrigger(@handle, @index, ptr) ptr.get_double(0) end |
#sensitivity=(new_sensitivity) ⇒ Float
Sets the temperature change trigger sensitivity of the thermocouple sensor, or raises an error.
92 93 94 95 |
# File 'lib/phidgets-ffi/temperature_sensor.rb', line 92 def sensitivity=(new_sensitivity) Klass.setTemperatureChangeTrigger(@handle, @index, new_sensitivity.to_f) new_sensitivity end |
#temperature ⇒ Float
Returns the temperature of the thermocouple sensor, in degrees celcius, or raises an error.
98 99 100 101 102 |
# File 'lib/phidgets-ffi/temperature_sensor.rb', line 98 def temperature ptr = ::FFI::MemoryPointer.new(:double) Klass.getTemperature(@handle, @index, ptr) ptr.get_double(0) end |
#temperature_max ⇒ Float
Returns the maximum temperature value that the thermocouple sensor can return, in degrees celcius, or raises an error.
112 113 114 115 116 |
# File 'lib/phidgets-ffi/temperature_sensor.rb', line 112 def temperature_max ptr = ::FFI::MemoryPointer.new(:double) Klass.getTemperatureMax(@handle, @index, ptr) ptr.get_double(0) end |
#temperature_min ⇒ Float
Returns the minimum temperature value that the thermocouple sensor can return, in degrees celcius, or raises an error.
105 106 107 108 109 |
# File 'lib/phidgets-ffi/temperature_sensor.rb', line 105 def temperature_min ptr = ::FFI::MemoryPointer.new(:double) Klass.getTemperatureMin(@handle, @index, ptr) ptr.get_double(0) end |
#type ⇒ Phidgets::FFI::TemperatureSensorThermocoupleTypes
Returns the thermocouple type of the thermocouple sensor, or raises an error.
119 120 121 122 123 |
# File 'lib/phidgets-ffi/temperature_sensor.rb', line 119 def type ptr = ::FFI::MemoryPointer.new(:int) Klass.getThermocoupleType(@handle, @index, ptr) Phidgets::FFI::TemperatureSensorThermocoupleTypes[ptr.get_int(0)] end |
#type=(new_type) ⇒ Phidgets::FFI::TemperatureSensorThermocoupleTypes
Sets the thermocouple type of the thermocouple sensor, or raises an error.
128 129 130 131 132 |
# File 'lib/phidgets-ffi/temperature_sensor.rb', line 128 def type=(new_type) ptr = ::FFI::MemoryPointer.new(:int) Klass.setThermocoupleType(@handle, @index, Phidgets::FFI::TemperatureSensorThermocoupleTypes[new_type]) new_type end |