Method: OpenC3::SimulatedTargetInterface#connect

Defined in:
lib/openc3/interfaces/simulated_target_interface.rb

#connectObject

Initialize the simulated target object and “connect” to the target



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/openc3/interfaces/simulated_target_interface.rb', line 42

def connect
  unless @initialized
    # Create Simulated Target Object
    @sim_target = @sim_target_class.new(@target_names[0])
    # Set telemetry rates
    @sim_target.set_rates

    @initialized = true
  end

  @count_100hz = 0

  # Save the current time + delta as the next expected tick time
  @next_tick_time = Time.now.sys + @sim_target.tick_period_seconds

  @connected = true
end