Method: OpenC3::StateParser.parse

Defined in:
lib/openc3/packets/parsers/state_parser.rb

.parse(parser, packet, cmd_or_tlm, item, warnings) ⇒ Object

Parameters:

  • parser (ConfigParser)

    Configuration parser

  • packet (Packet)

    The current packet

  • cmd_or_tlm (String)

    Whether this is a command or telemetry packet

  • item (PacketItem)

    The packet item to create states on

  • warnings (Array<String>)

    Array of string warnings which will be appended with any warnings found when parsing the limits



33
34
35
36
37
38
39
40
# File 'lib/openc3/packets/parsers/state_parser.rb', line 33

def self.parse(parser, packet, cmd_or_tlm, item, warnings)
  raise parser.error("Items with LIMITS can't define STATE") if item.limits.values
  raise parser.error("Items with UNITS can't define STATE") if item.units

  parser = StateParser.new(parser)
  parser.verify_parameters(cmd_or_tlm)
  parser.create_state(packet, cmd_or_tlm, item, warnings)
end