Class: FeedbackOffset

Inherits:
Base
  • Object
show all
Defined in:
lib/functions/feedback_offset.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#frame_optimized, #name

Instance Method Summary collapse

Methods inherited from Base

#add_arduino_code, #add_cycle_level_scope, #add_top_level_scope, #append_tsortable, #buildit, #cycle_level_arduino_code, #depends_on, #resolve_frame_optimized, #top_level_scope_arduino_code

Constructor Details

#initialize(params) ⇒ FeedbackOffset

Returns a new instance of FeedbackOffset.



19
20
21
22
# File 'lib/functions/feedback_offset.rb', line 19

def initialize(params)
  super(params)
  @frame_optimized = false
end

Instance Attribute Details

#feedbackObject

Returns the value of attribute feedback.



16
17
18
# File 'lib/functions/feedback_offset.rb', line 16

def feedback
  @feedback
end

#inputObject

Returns the value of attribute input.



15
16
17
# File 'lib/functions/feedback_offset.rb', line 15

def input
  @input
end

#offsetObject

Returns the value of attribute offset.



17
18
19
# File 'lib/functions/feedback_offset.rb', line 17

def offset
  @offset
end

Instance Method Details

#arduino_codeObject



28
29
30
31
32
# File 'lib/functions/feedback_offset.rb', line 28

def arduino_code
  [
    "feedback_offset(i, PIXEL_COUNT, #{@input.name}, #{@feedback.name}, #{@offset.name}, #{@name}_storage, #{@name});"
  ]
end

#param_keysObject



24
25
26
# File 'lib/functions/feedback_offset.rb', line 24

def param_keys
  [:input, :feedback, :offset]
end

#top_level_scope_codeObject



34
35
36
37
38
39
# File 'lib/functions/feedback_offset.rb', line 34

def top_level_scope_code
  [
    "long #{@name}[3];",
    "long #{@name}_storage[PIXEL_COUNT][3];"
  ]
end