Method: OpenC3::Telemetry#all_item_strings

Defined in:
lib/openc3/packets/telemetry.rb

#all_item_strings(include_hidden = false, splash = nil) ⇒ Object

Returns an array with a “TARGET_NAME PACKET_NAME ITEM_NAME” string for every item in the system



406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
# File 'lib/openc3/packets/telemetry.rb', line 406

def all_item_strings(include_hidden = false, splash = nil)
  strings = []
  tnames = target_names()
  total = tnames.length.to_f
  tnames.each_with_index do |target_name, index|
    if splash
      splash.message = "Processing #{target_name} telemetry"
      splash.progress = index / total
    end

    # Note: System only has declared target structures but telemetry may have more
    system_target = System.targets[target_name]
    if system_target
      ignored_items = system_target.ignored_items
    else
      ignored_items = []
    end

    packets(target_name).each do |packet_name, packet|
      # We don't audit against hidden or disabled packets
      next if !include_hidden and (packet.hidden || packet.disabled)

      packet.items.each_key do |item_name|
        # Skip ignored items
        next if !include_hidden and ignored_items.include? item_name

        strings << "#{target_name} #{packet_name} #{item_name}"
      end
    end
  end
  strings
end