Class: Jeti::Log::Data::MezonData
- Inherits:
-
Object
- Object
- Jeti::Log::Data::MezonData
- Defined in:
- lib/jeti/log/data/mezon_data.rb
Instance Attribute Summary collapse
-
#battery_current ⇒ Object
readonly
Returns the value of attribute battery_current.
-
#battery_voltage ⇒ Object
readonly
Returns the value of attribute battery_voltage.
-
#bec_current ⇒ Object
readonly
Returns the value of attribute bec_current.
-
#bec_voltage ⇒ Object
readonly
Returns the value of attribute bec_voltage.
-
#capacity ⇒ Object
readonly
Returns the value of attribute capacity.
-
#pwm ⇒ Object
readonly
Returns the value of attribute pwm.
-
#rpm ⇒ Object
readonly
Returns the value of attribute rpm.
-
#run_time ⇒ Object
readonly
Returns the value of attribute run_time.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(time, fields) ⇒ MezonData
constructor
A new instance of MezonData.
- #temperature(unit = :c) ⇒ Object
Constructor Details
#initialize(time, fields) ⇒ MezonData
Returns a new instance of MezonData.
15 16 17 18 19 20 |
# File 'lib/jeti/log/data/mezon_data.rb', line 15 def initialize(time, fields) raise ArgumentError unless fields.length == 9 @time = time @battery_voltage, @battery_current, @bec_voltage, @bec_current, @capacity, @rpm, @temperature, @run_time, @pwm = fields end |
Instance Attribute Details
#battery_current ⇒ Object (readonly)
Returns the value of attribute battery_current.
7 8 9 |
# File 'lib/jeti/log/data/mezon_data.rb', line 7 def battery_current @battery_current end |
#battery_voltage ⇒ Object (readonly)
Returns the value of attribute battery_voltage.
6 7 8 |
# File 'lib/jeti/log/data/mezon_data.rb', line 6 def battery_voltage @battery_voltage end |
#bec_current ⇒ Object (readonly)
Returns the value of attribute bec_current.
9 10 11 |
# File 'lib/jeti/log/data/mezon_data.rb', line 9 def bec_current @bec_current end |
#bec_voltage ⇒ Object (readonly)
Returns the value of attribute bec_voltage.
8 9 10 |
# File 'lib/jeti/log/data/mezon_data.rb', line 8 def bec_voltage @bec_voltage end |
#capacity ⇒ Object (readonly)
Returns the value of attribute capacity.
10 11 12 |
# File 'lib/jeti/log/data/mezon_data.rb', line 10 def capacity @capacity end |
#pwm ⇒ Object (readonly)
Returns the value of attribute pwm.
13 14 15 |
# File 'lib/jeti/log/data/mezon_data.rb', line 13 def pwm @pwm end |
#rpm ⇒ Object (readonly)
Returns the value of attribute rpm.
11 12 13 |
# File 'lib/jeti/log/data/mezon_data.rb', line 11 def rpm @rpm end |
#run_time ⇒ Object (readonly)
Returns the value of attribute run_time.
12 13 14 |
# File 'lib/jeti/log/data/mezon_data.rb', line 12 def run_time @run_time end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
5 6 7 |
# File 'lib/jeti/log/data/mezon_data.rb', line 5 def time @time end |
Instance Method Details
#temperature(unit = :c) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/jeti/log/data/mezon_data.rb', line 22 def temperature(unit = :c) case unit when :f (@temperature * (9.0 / 5.0)) + 32 else @temperature end end |