Class: Crubyflie::LogConfVariable
- Inherits:
-
Object
- Object
- Crubyflie::LogConfVariable
- Defined in:
- lib/crubyflie/crazyflie/log_conf.rb
Overview
Interface for Logging variable configuration objects this class lists methods to be implemented Python implementation is in cfclient/utils/logconfigreader.py
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#fetch_as ⇒ Object
readonly
Returns the value of attribute fetch_as.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#stored_as ⇒ Object
readonly
Returns the value of attribute stored_as.
Instance Method Summary collapse
-
#initialize(name, is_toc, stored_as, fetch_as, address = 0) ⇒ LogConfVariable
constructor
A new instance of LogConfVariable.
-
#is_toc_variable? ⇒ TrueClass, FalseClass
True if it is stored in the TOC.
-
#stored_fetch_as ⇒ Integer
type indentifier of how the variable is stored and the lower 4 bits are the type the variable should be fetched as.
Constructor Details
#initialize(name, is_toc, stored_as, fetch_as, address = 0) ⇒ LogConfVariable
Returns a new instance of LogConfVariable.
38 39 40 41 42 43 44 |
# File 'lib/crubyflie/crazyflie/log_conf.rb', line 38 def initialize(name, is_toc, stored_as, fetch_as, address=0) @name = name @is_toc = is_toc @stored_as = stored_as @fetch_as = fetch_as @address = address end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
36 37 38 |
# File 'lib/crubyflie/crazyflie/log_conf.rb', line 36 def address @address end |
#fetch_as ⇒ Object (readonly)
Returns the value of attribute fetch_as.
36 37 38 |
# File 'lib/crubyflie/crazyflie/log_conf.rb', line 36 def fetch_as @fetch_as end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
36 37 38 |
# File 'lib/crubyflie/crazyflie/log_conf.rb', line 36 def name @name end |
#stored_as ⇒ Object (readonly)
Returns the value of attribute stored_as.
36 37 38 |
# File 'lib/crubyflie/crazyflie/log_conf.rb', line 36 def stored_as @stored_as end |
Instance Method Details
#is_toc_variable? ⇒ TrueClass, FalseClass
Returns true if it is stored in the TOC.
53 54 55 |
# File 'lib/crubyflie/crazyflie/log_conf.rb', line 53 def is_toc_variable? return @is_toc == true end |
#stored_fetch_as ⇒ Integer
type indentifier of how the variable is stored and the lower 4 bits are the type the variable should be fetched as
48 49 50 |
# File 'lib/crubyflie/crazyflie/log_conf.rb', line 48 def stored_fetch_as return @stored_as << 4 | (0x0F & @fetch_as) end |