Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/realtime/MCWSEVRLevelStreamProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ class MCWSEVRLevelStreamProvider extends MCWSStreamProvider {
* @returns {String} The key
*/
getKey(domainObject) {
return domainObject.telemetry.level;
// only uppercase works for all mcws apis (lowercase will not work)
// see https://github.com/NASA-AMMOS/openmct-mcws/pull/412/changes
return domainObject.telemetry.level.toUpperCase();
}
}

Expand Down
29 changes: 19 additions & 10 deletions src/realtime/MCWSEVRStreamProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,29 @@ class MCWSEVRStreamProvider extends MCWSStreamProvider {
*/
getKey(domainObject) {
// Can subscribe only by EVR module even if subscribing by EVR
let module =
domainObject.telemetry &&
domainObject.telemetry.definition &&
domainObject.telemetry.definition.module &&
domainObject.telemetry.definition.module.toLowerCase();
// This is the default cause for EVRs that contain a module.
// only uppercase works for all mcws apis (lowercase will not work)
// see https://github.com/NASA-AMMOS/openmct-mcws/pull/412/changes
let module = domainObject?.telemetry?.definition?.module?.toUpperCase();

// This is the top-level vista.evrModule object, which contains
// a module definition but not in the definition object.
// This must be captured before attempting legacy EVRs,
// in case the module contains underscores.
// only uppercase works for all mcws apis (lowercase will not work)
// see https://github.com/NASA-AMMOS/openmct-mcws/pull/412/changes
if (!module?.length) {
module = domainObject?.telemetry?.module?.toUpperCase();
}

// legacy inference of module by evr_name
// if this fallback is used will break on module names containing underscores
// This should *never* occur with modern telemetry dictionaries.
if (!module || module.length <= 0) {
Comment thread
jvigliotta marked this conversation as resolved.
console.warn('Legacy domain objects should not be used anymore!');
module = domainObject.telemetry.evr_name
? domainObject.telemetry.evr_name.split('_')[0].toLowerCase()
: domainObject.telemetry.module.toLowerCase();
}
// only uppercase works for all mcws apis (lowercase will not work)
// see https://github.com/NASA-AMMOS/openmct-mcws/pull/412/changes
module = domainObject.telemetry.evr_name.split('_')[0].toUpperCase();
}

return module;
}
Expand Down
4 changes: 3 additions & 1 deletion src/realtime/MCWSStreamWorkerScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@
const data = JSON.parse(message.data);

data.forEach((datum) => {
const key = datum[property];
// only uppercase works for all mcws apis (lowercase will not work)
// see https://github.com/NASA-AMMOS/openmct-mcws/pull/412/changes
const key = datum[property].toUpperCase();

if (subscribers[key] > 0) {
self.postMessage({
Expand Down
Loading