Method: OpenC3::StateParser#create_state

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

#create_state(packet, cmd_or_tlm, item, warnings) ⇒ Object

Parameters:

  • 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



64
65
66
67
68
69
70
71
# File 'lib/openc3/packets/parsers/state_parser.rb', line 64

def create_state(packet, cmd_or_tlm, item, warnings)
  item.states ||= {}

  state_name = get_state_name()
  check_for_duplicate_states(item, warnings)
  item.states[state_name] = get_state_value(item.data_type)
  parse_additional_parameters(packet, cmd_or_tlm, item)
end