-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add inject_tlm to javascript api #438
Conversation
Codecov ReportBase: 75.76% // Head: 74.73% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #438 +/- ##
==========================================
- Coverage 75.76% 74.73% -1.04%
==========================================
Files 383 455 +72
Lines 25403 27689 +2286
Branches 592 592
==========================================
+ Hits 19247 20692 +1445
- Misses 6062 6903 +841
Partials 94 94
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the one existing typo
@@ -335,7 +335,7 @@ export class OpenC3Api { | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 333 has a bug: Invalid data type ${packet_name}
... it should be ${value_type}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a bug. packet_name is the second positional argument, and this case is for the two argument case.
@@ -335,7 +335,7 @@ export class OpenC3Api { | |||
} | |||
} else { | |||
data = await this.exec('tlm', [target_name, packet_name, item_name], { | |||
type: data_type, | |||
type: value_type, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not at all consistent with the term data_type
vs value_type
throughout the code. I assume you're indicating you like value_type going forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data_type = :INT, :UINT, :FLOAT, :STRING, :BLOCK, :DERIVED
value_type = :RAW, :CONVERTED, :FORMATTED, :WITH_UNITS
@@ -118,7 +118,8 @@ def set_tlm(*args, type: :CONVERTED, scope: $openc3_scope, token: $openc3_token) | |||
# @param type [Symbol] Telemetry type, :RAW, :CONVERTED (default), :FORMATTED, or :WITH_UNITS | |||
def inject_tlm(target_name, packet_name, item_hash = nil, type: :CONVERTED, scope: $openc3_scope, token: $openc3_token) | |||
authorize(permission: 'tlm_set', target_name: target_name, packet_name: packet_name, scope: scope, token: token) | |||
unless CvtModel::VALUE_TYPES.include?(type.intern) | |||
type = type.to_s.intern | |||
unless CvtModel::VALUE_TYPES.include?(type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change? You can call intern
on an existing symbol ... it's a noop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handles nil and strings coming in (which is what was happening in inject_tlm)
closes #436