Changes between Version 5 and Version 6 of GEC22Agenda/LabWiki/ModuleE/Execute
- Timestamp:
- 03/10/15 17:50:32 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GEC22Agenda/LabWiki/ModuleE/Execute
v5 v6 66 66 defProperty('sinkaddr11', '192.168.1.6', "Ping destination address") 67 67 peak_list = [] 68 68 69 count =0 69 70 … … 187 188 end 188 189 end 189 defEvent(:MY_EVENT, every: 0.5) do190 defEvent(:MY_EVENT, every: 10) do 190 191 # Query for some measurements... 191 192 # returns an array where each element is a hash representing a row from the DB … … 195 196 196 197 triggered = false 197 if !data.nil? && !(last_row = data.pop).nil? # Make sure we have some data198 next if peak_list.include?(last_row[:srcaddr]) # Do nothing if we have seen this sample before199 if !peak_list.include?(last_row[:srcaddr])200 peak_list << last_row[:srcaddr] # record that sample, so we dont trigger on it again201 #count+=1202 end203 if peak_list.size >= 1204 205 triggered = true206 207 end198 if !data.nil? 199 data.each do |test| 200 next if peak_list.include?(test[:srcaddr]) # Do nothing if we have seen this sample before 201 if !peak_list.include?(test[:srcaddr]) 202 peak_list << test[:srcaddr] # record that sample, so we dont trigger on it again 203 end 204 if peak_list.size >= 4 205 triggered = true 206 end 207 end 208 end 208 209 triggered 209 210 end … … 224 225 225 226 226 227 227 }}} 228 228 === 3.1.3 Start your application from !LabWiki ===