lib/openc3/interfaces/simulated_target_interface.rb in openc3-5.5.2 vs lib/openc3/interfaces/simulated_target_interface.rb in openc3-5.6.0
- old
+ new
@@ -34,11 +34,10 @@
@next_tick_time = nil
@pending_packets = []
@sim_target_class = OpenC3.require_class sim_target_file
@sim_target = nil
@write_raw_allowed = false
- @raw_logger_pair = nil
end
# Initialize the simulated target object and "connect" to the target
def connect
unless @initialized
@@ -65,12 +64,13 @@
# @return [Packet] Returns a simulated target packet from the simulator
def read
packet = nil
if @connected
- packet = first_pending_packet()
- if packet
+ while true
+ packet = first_pending_packet()
+ break unless packet
# Support read_packet (but not read data) in protocols
# Generic protocol use is not supported
@read_protocols.each do |protocol|
packet = protocol.read_packet(packet)
if packet == :DISCONNECT
@@ -141,10 +141,10 @@
def write_raw(data)
raise "write_raw not implemented for SimulatedTargetInterface"
end
# Raise an error because raw logging is not supported for this interface
- def raw_logger_pair=(raw_logger_pair)
+ def stream_log_pair=(stream_log_pair)
raise "Raw logging not supported for SimulatedTargetInterface"
end
# Disconnect from the simulator
def disconnect