Method: OpenC3::Target#initialize

Defined in:
lib/openc3/system/target.rb

#initialize(target_name, path, gem_path = nil) ⇒ Target

Creates a new target by processing the target.txt file in the directory given by the path joined with the target_name. Records all the command and telemetry definition files found in the targets cmd_tlm directory. System uses this list and processes them using PacketConfig.

Parameters:

  • target_name (String)

    The name of the target.

  • path (String)

    Path to the target directory

  • gem_path (String) (defaults to: nil)

    Path to the gem file or nil if there is no gem



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/openc3/system/target.rb', line 85

def initialize(target_name, path, gem_path = nil)
  @requires = []
  @ignored_parameters = []
  @ignored_items = []
  @cmd_tlm_files = []
  # @auto_screen_substitute = false
  @interface = nil
  @routers = []
  @cmd_cnt = 0
  @tlm_cnt = 0
  @cmd_unique_id_mode = false
  @tlm_unique_id_mode = false
  @name = target_name.clone.upcase.freeze
  get_target_dir(path, gem_path)
  process_target_config_file()

  # If target.txt didn't specify specific cmd/tlm files then add everything
  if @cmd_tlm_files.empty?
    @cmd_tlm_files = add_all_cmd_tlm()
  else
    add_cmd_tlm_partials()
  end
end