Class: Crubyflie::LogConfVariable

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#addressObject (readonly)

Returns the value of attribute address


36
37
38
# File 'lib/crubyflie/crazyflie/log_conf.rb', line 36

def address
  @address
end

#fetch_asObject (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

#nameObject (readonly)

Returns the value of attribute name


36
37
38
# File 'lib/crubyflie/crazyflie/log_conf.rb', line 36

def name
  @name
end

#stored_asObject (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.

Returns:

  • (TrueClass, FalseClass)

    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_asInteger

type indentifier of how the variable is stored and the lower 4 bits are the type the variable should be fetched as

Returns:

  • (Integer)

    a byte where the upper 4 bits are the


48
49
50
# File 'lib/crubyflie/crazyflie/log_conf.rb', line 48

def stored_fetch_as
    return @stored_as << 4 | (0x0F & @fetch_as)
end