Class: Phasor

Inherits:
Base
  • Object
show all
Defined in:
lib/functions/phasor.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, #depends_on, #initialize, #resolve_frame_optimized, #top_level_scope_arduino_code

Constructor Details

This class inherits a constructor from Base

Instance Attribute Details

#cyclesObject

Returns the value of attribute cycles.



11
12
13
# File 'lib/functions/phasor.rb', line 11

def cycles
  @cycles
end

Instance Method Details

#arduino_codeObject



17
18
19
20
21
22
23
24
25
# File 'lib/functions/phasor.rb', line 17

def arduino_code
  unless @frame_optimized 
    [
      "phasor(mils, #{@cycles.name}, #{@name});"
    ]
  else
    []
  end
end

#cycle_level_arduino_codeObject



27
28
29
30
31
32
33
34
35
# File 'lib/functions/phasor.rb', line 27

def cycle_level_arduino_code
  if @frame_optimized
    [
      "phasor(mils, #{@cycles.name}, #{@name});"
    ]
  else
    []
  end
end

#param_keysObject



13
14
15
# File 'lib/functions/phasor.rb', line 13

def param_keys
  [:cycles]
end

#top_level_scope_codeObject



37
38
39
40
41
# File 'lib/functions/phasor.rb', line 37

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