Sha256: 29804054fb59bd957bb22be7886e2221c7f31bfd1318320406e9ccb5c059ff83

Contents?: true

Size: 1.38 KB

Versions: 43

Compression:

Stored size: 1.38 KB

Contents

# encoding: ascii-8bit

# Copyright 2014 Ball Aerospace & Technologies Corp.
# All Rights Reserved.
#
# This program is free software; you can modify and/or redistribute it
# under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 3 with
# attribution addendums as found in the LICENSE.txt

# This file implements a class to handle responses to limits state changes.

require 'cosmos/tools/cmd_tlm_server/api'

module Cosmos
  # This class defines a #call method which is called when a PacketItem
  # goes out of limits. This class must be subclassed and the call method
  # implemented. Do NOT use this class directly.
  class LimitsResponse

    include Api

    # @param packet [Packet] Packet the limits response is assigned to
    # @param item [PacketItem] PacketItem the limits response is assigned to
    # @param old_limits_state [Symbol] Previous value of the limit. One of nil,
    #   :GREEN_HIGH, :GREEN_LOW, :YELLOW, :YELLOW_HIGH, :YELLOW_LOW,
    #   :RED, :RED_HIGH, :RED_LOW. nil if the previous limit state has not yet
    #   been established.
    def call(packet, item, old_limits_state)
      raise "call method must be defined by subclass"
    end

    def to_s
      self.class.to_s.split('::')[-1]
    end

    def to_config
      "    LIMITS_RESPONSE #{self.class.name.class_name_to_filename}\n"
    end

  end # class LimitsResponse
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
cosmos-4.5.2-java lib/cosmos/packets/limits_response.rb
cosmos-4.5.2 lib/cosmos/packets/limits_response.rb
cosmos-4.5.1-java lib/cosmos/packets/limits_response.rb
cosmos-4.5.1 lib/cosmos/packets/limits_response.rb
cosmos-4.5.0-java lib/cosmos/packets/limits_response.rb
cosmos-4.5.0 lib/cosmos/packets/limits_response.rb
cosmos-4.4.2-java lib/cosmos/packets/limits_response.rb
cosmos-4.4.2 lib/cosmos/packets/limits_response.rb
cosmos-4.4.1-java lib/cosmos/packets/limits_response.rb
cosmos-4.4.1 lib/cosmos/packets/limits_response.rb
cosmos-4.4.0-java lib/cosmos/packets/limits_response.rb
cosmos-4.4.0 lib/cosmos/packets/limits_response.rb
cosmos-4.3.0-java lib/cosmos/packets/limits_response.rb
cosmos-4.3.0 lib/cosmos/packets/limits_response.rb
cosmos-4.2.4-java lib/cosmos/packets/limits_response.rb
cosmos-4.2.4 lib/cosmos/packets/limits_response.rb
cosmos-4.2.3-java lib/cosmos/packets/limits_response.rb
cosmos-4.2.3 lib/cosmos/packets/limits_response.rb
cosmos-4.2.2-java lib/cosmos/packets/limits_response.rb
cosmos-4.2.2 lib/cosmos/packets/limits_response.rb