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



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/openc3/system/target.rb', line 77

def initialize(target_name, path, gem_path = nil)
  @language = 'ruby'
  @requires = []
  @ignored_parameters = []
  @ignored_items = []
  @cmd_tlm_files = []
  @interface = nil
  @routers = []
  @cmd_cnt = 0
  @tlm_cnt = 0
  @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