lib/openc3/api/tlm_api.rb in openc3-5.11.3 vs lib/openc3/api/tlm_api.rb in openc3-5.12.0
- old
+ new
@@ -65,26 +65,23 @@
#
# @param args [String|Array<String>] See the description for calling style
# @param type [Symbol] Telemetry type, :RAW, :CONVERTED (default), :FORMATTED, or :WITH_UNITS
# @return [Object] The telemetry value formatted as requested
def tlm(*args, type: :CONVERTED, cache_timeout: 0.1, scope: $openc3_scope, token: $openc3_token)
- target_name, packet_name, item_name = tlm_process_args(args, 'tlm', cache_timeout: cache_timeout, scope: scope)
+ target_name, packet_name, item_name = _tlm_process_args(args, 'tlm', cache_timeout: cache_timeout, scope: scope)
authorize(permission: 'tlm', target_name: target_name, packet_name: packet_name, scope: scope, token: token)
CvtModel.get_item(target_name, packet_name, item_name, type: type.intern, cache_timeout: cache_timeout, scope: scope)
end
- # @deprecated Use tlm with type: :RAW
def tlm_raw(*args, cache_timeout: 0.1, scope: $openc3_scope, token: $openc3_token)
tlm(*args, type: :RAW, cache_timeout: cache_timeout, scope: scope, token: token)
end
- # @deprecated Use tlm with type: :FORMATTED
def tlm_formatted(*args, cache_timeout: 0.1, scope: $openc3_scope, token: $openc3_token)
tlm(*args, type: :FORMATTED, cache_timeout: cache_timeout, scope: scope, token: token)
end
- # @deprecated Use tlm with type: :WITH_UNITS
def tlm_with_units(*args, cache_timeout: 0.1, scope: $openc3_scope, token: $openc3_token)
tlm(*args, type: :WITH_UNITS, cache_timeout: cache_timeout, scope: scope, token: token)
end
# @deprecated Use tlm with type:
@@ -106,11 +103,11 @@
# Favor the first syntax where possible as it is more succinct.
#
# @param args [String|Array<String>] See the description for calling style
# @param type [Symbol] Telemetry type, :RAW, :CONVERTED (default), :FORMATTED, or :WITH_UNITS
def set_tlm(*args, type: :CONVERTED, scope: $openc3_scope, token: $openc3_token)
- target_name, packet_name, item_name, value = set_tlm_process_args(args, __method__, scope: scope)
+ target_name, packet_name, item_name, value = _set_tlm_process_args(args, __method__, scope: scope)
authorize(permission: 'tlm_set', target_name: target_name, packet_name: packet_name, scope: scope, token: token)
CvtModel.set_item(target_name, packet_name, item_name, value, type: type.intern, scope: scope)
end
# Injects a packet into the system as if it was received from an interface
@@ -167,11 +164,11 @@
# @param args The args must either be a string followed by a value or
# three strings followed by a value (see the calling style in the
# description).
# @param type [Symbol] Telemetry type, :ALL (default), :RAW, :CONVERTED, :FORMATTED, :WITH_UNITS
def override_tlm(*args, type: :ALL, scope: $openc3_scope, token: $openc3_token)
- target_name, packet_name, item_name, value = set_tlm_process_args(args, __method__, scope: scope)
+ target_name, packet_name, item_name, value = _set_tlm_process_args(args, __method__, scope: scope)
authorize(permission: 'tlm_set', target_name: target_name, packet_name: packet_name, scope: scope, token: token)
CvtModel.override(target_name, packet_name, item_name, value, type: type.intern, scope: scope)
end
# Get the list of CVT overrides
@@ -192,11 +189,11 @@
# @param args The args must either be a string or three strings
# (see the calling style in the description).
# @param type [Symbol] Telemetry type, :ALL (default), :RAW, :CONVERTED, :FORMATTED, :WITH_UNITS
# Also takes :ALL which means to normalize all telemetry types
def normalize_tlm(*args, type: :ALL, scope: $openc3_scope, token: $openc3_token)
- target_name, packet_name, item_name = tlm_process_args(args, __method__, scope: scope)
+ target_name, packet_name, item_name = _tlm_process_args(args, __method__, scope: scope)
authorize(permission: 'tlm_set', target_name: target_name, packet_name: packet_name, scope: scope, token: token)
CvtModel.normalize(target_name, packet_name, item_name, type: type.intern, scope: scope)
end
# Returns the raw buffer for a telemetry packet.
@@ -387,11 +384,11 @@
end
# Get the transmit counts for telemetry packets
#
# @param target_packets [Array<Array<String, String>>] Array of arrays containing target_name, packet_name
- # @return [Numeric] Transmit count for the command
+ # @return [Array<Numeric>] Receive count for the telemetry packets
def get_tlm_cnts(target_packets, scope: $openc3_scope, token: $openc3_token)
authorize(permission: 'system', scope: scope, token: token)
counts = []
target_packets.each do |target_name, packet_name|
target_name = target_name.upcase
@@ -428,11 +425,11 @@
return 'U'
end
return nil
end
- def tlm_process_args(args, method_name, cache_timeout: 0.1, scope: $openc3_scope, token: $openc3_token)
+ def _tlm_process_args(args, method_name, cache_timeout: 0.1, scope: $openc3_scope, token: $openc3_token)
case args.length
when 1
target_name, packet_name, item_name = extract_fields_from_tlm_text(args[0])
when 3
target_name = args[0]
@@ -454,10 +451,10 @@
end
return [target_name, packet_name, item_name]
end
- def set_tlm_process_args(args, method_name, scope: $openc3_scope, token: $openc3_token)
+ def _set_tlm_process_args(args, method_name, scope: $openc3_scope, token: $openc3_token)
case args.length
when 1
target_name, packet_name, item_name, value = extract_fields_from_set_tlm_text(args[0])
when 4
target_name = args[0]