Class: SGS::Config

Inherits:
RedisBase show all
Defined in:
lib/sgs/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RedisBase

#count, #count_name, #load, load, #make_redis_name, #publish, redis, redis_handle, #redis_read_var, #save, #save_and_publish, setup, subscribe, to_redis, var_init

Constructor Details

#initializeConfig

Returns a new instance of Config.



41
42
43
44
45
46
47
48
# File 'lib/sgs/config.rb', line 41

def initialize
  @mission_file = "/etc/mission.yaml"
  @otto_device = "/dev/ttyu0"
  @gps_device = "/dev/ttyu1"
  @comm_device = "/dev/ttyu2"
  @otto_speed = @gps_speed = @comm_speed = 9600
  super()
end

Instance Attribute Details

#comm_deviceObject

Returns the value of attribute comm_device.



37
38
39
# File 'lib/sgs/config.rb', line 37

def comm_device
  @comm_device
end

#comm_speedObject

Returns the value of attribute comm_speed.



38
39
40
# File 'lib/sgs/config.rb', line 38

def comm_speed
  @comm_speed
end

#gps_deviceObject

Returns the value of attribute gps_device.



37
38
39
# File 'lib/sgs/config.rb', line 37

def gps_device
  @gps_device
end

#gps_speedObject

Returns the value of attribute gps_speed.



38
39
40
# File 'lib/sgs/config.rb', line 38

def gps_speed
  @gps_speed
end

#mission_fileObject

Returns the value of attribute mission_file.



39
40
41
# File 'lib/sgs/config.rb', line 39

def mission_file
  @mission_file
end

#otto_deviceObject

Returns the value of attribute otto_device.



37
38
39
# File 'lib/sgs/config.rb', line 37

def otto_device
  @otto_device
end

#otto_speedObject

Returns the value of attribute otto_speed.



38
39
40
# File 'lib/sgs/config.rb', line 38

def otto_speed
  @otto_speed
end

Class Method Details

.configure_allObject

Set up the Redis configuration with some basic data



52
53
54
55
56
57
58
59
# File 'lib/sgs/config.rb', line 52

def self.configure_all
  Config.setup
  MissionStatus.setup
  Alarm.setup
  GPS.setup
  Otto.setup
  Timing.setup
end