Class: FANUC::Ekg::EkgData

Inherits:
Object
  • Object
show all
Defined in:
lib/fanuc-ekg.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEkgData

Returns a new instance of EkgData.



131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/fanuc-ekg.rb', line 131

def initialize
	@bins = {
		:zero => Bin.new,
		:v1t1 => Bin.new,
		:v2t1 => Bin.new,
		:v1t2 => Bin.new,
		:v2t2 => Bin.new
	}
	@alarms = {
		:recent => [],
		:worst => []
	}
end

Instance Attribute Details

#alarmsObject

Returns the value of attribute alarms.



130
131
132
# File 'lib/fanuc-ekg.rb', line 130

def alarms
  @alarms
end

#binsObject

Returns the value of attribute bins.



130
131
132
# File 'lib/fanuc-ekg.rb', line 130

def bins
  @bins
end

Instance Method Details

#axis(id) ⇒ Object



145
146
147
148
149
150
151
152
# File 'lib/fanuc-ekg.rb', line 145

def axis(id)
	@sum = 0
	@bins.each do |key,bin|
		@sum += bin[id]
	end
	# should i remove bin 0?
	@sum
end