Class: OpenC3::XtceParser
- Defined in:
- lib/openc3/packets/parsers/xtce_parser.rb
Instance Attribute Summary collapse
-
#current_target_name ⇒ Object
Returns the value of attribute current_target_name.
Class Method Summary collapse
-
.process(commands, telemetry, warnings, filename, target_name = nil) ⇒ Object
Processes a XTCE formatted OpenC3 configuration file.
- .reverse_packet_order(target_name, cmd_or_tlm_hash) ⇒ Object
Instance Attribute Details
#current_target_name ⇒ Object
Returns the value of attribute current_target_name.
28 29 30 |
# File 'lib/openc3/packets/parsers/xtce_parser.rb', line 28 def current_target_name @current_target_name end |
Class Method Details
.process(commands, telemetry, warnings, filename, target_name = nil) ⇒ Object
Processes a XTCE formatted OpenC3 configuration file
40 41 42 |
# File 'lib/openc3/packets/parsers/xtce_parser.rb', line 40 def self.process(commands, telemetry, warnings, filename, target_name = nil) XtceParser.new(commands, telemetry, warnings, filename, target_name) end |
.reverse_packet_order(target_name, cmd_or_tlm_hash) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/openc3/packets/parsers/xtce_parser.rb', line 44 def self.reverse_packet_order(target_name, cmd_or_tlm_hash) if cmd_or_tlm_hash[target_name] packets = [] names_to_remove = [] cmd_or_tlm_hash[target_name].each do |packet_name, packet| packets << packet names_to_remove << packet_name end cmd_or_tlm_hash[target_name].length.times do |i| cmd_or_tlm_hash[target_name].delete(names_to_remove[i]) end packets.reverse_each do |packet| cmd_or_tlm_hash[target_name][packet.packet_name] = packet end end end |