Method: OpenC3::LimitsEventTopic.out_of_limits

Defined in:
lib/openc3/topics/limits_event_topic.rb

.out_of_limits(scope:) ⇒ Object



114
115
116
117
118
119
120
121
122
123
124
# File 'lib/openc3/topics/limits_event_topic.rb', line 114

def self.out_of_limits(scope:)
  out_of_limits = []
  limits = Store.hgetall("#{scope}__current_limits")
  limits.each do |item, limits_state|
    if %w(RED RED_HIGH RED_LOW YELLOW YELLOW_HIGH YELLOW_LOW).include?(limits_state)
      target_name, packet_name, item_name = item.split('__')
      out_of_limits << [target_name, packet_name, item_name, limits_state]
    end
  end
  out_of_limits
end