Class: Spektrum::Log::FlightLogRecord

Inherits:
Record
  • Object
show all
Defined in:
lib/spektrum/log/records.rb

Instance Attribute Summary

Attributes inherited from Record

#timestamp

Instance Method Summary collapse

Methods inherited from Record

#raw_hex_string, #type, #valid?

Constructor Details

#initialize(timestamp, raw_data) ⇒ FlightLogRecord

Returns a new instance of FlightLogRecord.



131
132
133
# File 'lib/spektrum/log/records.rb', line 131

def initialize(timestamp, raw_data)
  super timestamp, raw_data
end

Instance Method Details

#rx_voltageFloat

Note:

This conversion has been verified via Spektrum STi

Gets the receiver pack voltage data.

Returns:

  • (Float)

    rx voltage data, in volts



139
140
141
# File 'lib/spektrum/log/records.rb', line 139

def rx_voltage
  raw_rx_voltage / 100.0
end

#rx_voltage?Boolean

Determines if there is receiver voltage data contained within.

Returns:

  • (Boolean)

    true if there is rx voltage data, false otherwise



146
147
148
# File 'lib/spektrum/log/records.rb', line 146

def rx_voltage?
  raw_rx_voltage != 0x7FFF
end