Class: OpenLighting::Devices::ComscanLed

Inherits:
OpenLighting::DmxDevice show all
Defined in:
lib/open_lighting/devices/comscan_led.rb

Overview

ComscanLed is an example subclass of DmxDevice which supplies sensible defaults

Instance Attribute Summary

Attributes inherited from OpenLighting::DmxDevice

#capabilities, #controller, #current_values, #defaults, #points, #start_address

Instance Method Summary collapse

Methods inherited from OpenLighting::DmxDevice

#buffer, #method_missing, #point, #set, #to_dmx

Constructor Details

#initialize(options = {}) ⇒ ComscanLed

Returns a new instance of ComscanLed.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/open_lighting/devices/comscan_led.rb', line 7

def initialize(options = {})
  options[:points] ||= {}
  options[:points][:center] ||= {:pan => 127, :tilt => 127}
  options[:points][:origin] ||= {:pan => 127, :tilt => 127, :strobe => 8, :gobo => 0, :dimmer => 0}

  options[:points][:strobe_blackout]  ||= {:strobe => 0}
  options[:points][:strobe_open]      ||= {:strobe => 8}
  options[:points][:strobe_slow]      ||= {:strobe => 16}
  options[:points][:strobe_fast]      ||= {:strobe => 131}
  options[:points][:strobe_slow_fast] ||= {:strobe => 140}
  options[:points][:strobe_fast_slow] ||= {:strobe => 190}
  options[:points][:strobe_random]    ||= {:strobe => 247}

  options[:points][:nocolor]  ||= {:gobo => 0}
  options[:points][:white]    ||= {:gobo => 0}
  options[:points][:yellow]   ||= {:gobo => 8}
  options[:points][:red]      ||= {:gobo => 15}
  options[:points][:green]    ||= {:gobo => 22}
  options[:points][:blue]     ||= {:gobo => 29}
  options[:points][:teardrop] ||= {:gobo => 36}
  options[:points][:polka]    ||= {:gobo => 43}
  options[:points][:teal]     ||= {:gobo => 50}
  options[:points][:rings]    ||= {:gobo => 57}

  options[:points][:on]       ||= {:dimmer => 255}
  options[:points][:off]      ||= {:dimmer => 0}

  options[:capabilities] ||= [:pan, :tilt, :strobe, :gobo, :dimmer]
  options[:defaults]     ||= {:pan => 127, :tilt => 127, :strobe => 8, :gobo => 0, :dimmer => 0}

  super(options)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class OpenLighting::DmxDevice