Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
b4fdabf
adding telemetry collections to condition manager
jvigliotta Sep 12, 2024
5bd5ca9
handling telemetry collection data not datum
jvigliotta Sep 12, 2024
4ab19e3
adding from maaster
jvigliotta Sep 12, 2024
b467f9c
addressing PR comments
jvigliotta Sep 16, 2024
3f66140
Merge branch 'master' into conditional-style-performance
jvigliotta Sep 16, 2024
6482135
update unit test to work with telemetry collections
jvigliotta Sep 17, 2024
54c90e0
fixing tests
jvigliotta Sep 17, 2024
94a4ff3
removing unnecessary addition
jvigliotta Sep 17, 2024
7cba09b
removing focused describe
jvigliotta Sep 17, 2024
405b497
removing focused it
jvigliotta Sep 17, 2024
1581216
Merge branch 'master' into conditional-style-performance
jvigliotta Sep 17, 2024
5b385ea
fix weird test bleed
jvigliotta Sep 17, 2024
73489cd
Merge branch 'conditional-style-performance' of https://github.com/na…
jvigliotta Sep 17, 2024
23cf829
Add realtime output of telemetry data in conditionals and add support…
khalidadil Sep 19, 2024
21e94fd
Cleanup and add missing files
khalidadil Sep 21, 2024
101baa5
Fix issue with missing data
khalidadil Sep 30, 2024
7896f36
Update emitted values
khalidadil Sep 30, 2024
4b39ea2
Addressing feedback
khalidadil Sep 30, 2024
b975554
Creating a const for telemetry value
khalidadil Oct 1, 2024
7727a90
Cleanup
khalidadil Oct 1, 2024
f544a1d
Pass through plot options
khalidadil Oct 1, 2024
1180597
Cleanup
khalidadil Oct 2, 2024
39a73cf
Fix problem introduced with const
khalidadil Oct 3, 2024
0f2f71f
Add back initialize on mount
khalidadil Oct 3, 2024
4a3b0b9
Compensate for missing data at certain timestamps
khalidadil Oct 3, 2024
a739d61
Rename file
khalidadil Oct 3, 2024
488178a
Rename file
khalidadil Oct 3, 2024
f239d4b
Update metadata provider
khalidadil Oct 4, 2024
f4c2b79
Update condition set metadata
khalidadil Oct 11, 2024
bd3f00c
Fix zero issue
khalidadil Oct 11, 2024
cba2056
Try removing the default format for better data inspection
khalidadil Oct 11, 2024
848fbb9
merging fork
jvigliotta Aug 26, 2025
7702e8f
pulled over changes that were made after copying whole repo in a dump
jvigliotta Aug 26, 2025
a88fa39
pulling over from file dump
jvigliotta Aug 26, 2025
4611faa
remove debug
jvigliotta Aug 26, 2025
f057602
handle "none" output situations
jvigliotta Aug 27, 2025
a992d32
removing telemetry when output condition is "none"
jvigliotta Aug 27, 2025
3d4eb3f
adding license info
jvigliotta Aug 27, 2025
2b4d785
one last tweak to get none to work correctly without messin up other …
jvigliotta Aug 27, 2025
559eb30
Merge branch 'master' into feature/historical-conditions
jvigliotta Aug 27, 2025
4cba005
Merge branch 'master' into feature/historical-conditions
jvigliotta Oct 6, 2025
d9cc238
Merge branch 'master' into feature/historical-conditions
jvigliotta Oct 6, 2025
1c8cae3
Merge branch 'master' into feature/historical-conditions
jvigliotta Oct 9, 2025
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
Next Next commit
adding telemetry collections to condition manager
  • Loading branch information
jvigliotta committed Sep 12, 2024
commit b4fdabf301482240f96d8fdfd9800491dc02e08b
6 changes: 3 additions & 3 deletions 6 package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 28 additions & 38 deletions 66 src/plugins/condition/ConditionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class ConditionManager extends EventEmitter {
this.shouldEvaluateNewTelemetry = this.shouldEvaluateNewTelemetry.bind(this);

this.compositionLoad = this.composition.load();
this.subscriptions = {};
this.telemetryCollections = {};
this.telemetryObjects = {};
this.testData = {
conditionTestInputs: this.conditionSetDomainObject.configuration.conditionTestData,
Expand All @@ -48,55 +48,44 @@ export default class ConditionManager extends EventEmitter {
this.initialize();
}

async requestLatestValue(endpoint) {
const options = {
size: 1,
strategy: 'latest'
};
const latestData = await this.openmct.telemetry.request(endpoint, options);
subscribeToTelemetry(telemetryObject) {
const keyString = this.openmct.objects.makeKeyString(telemetryObject.identifier);

if (!latestData) {
throw new Error('Telemetry request failed by returning a falsy response');
}
if (latestData.length === 0) {
if (this.telemetryCollections[keyString]) {
return;
}
this.telemetryReceived(endpoint, latestData[0]);
}

subscribeToTelemetry(endpoint) {
const telemetryKeyString = this.openmct.objects.makeKeyString(endpoint.identifier);
if (this.subscriptions[telemetryKeyString]) {
return;
}
const requestOptions = {
size: 1,
strategy: 'latest'
};

const metadata = this.openmct.telemetry.getMetadata(endpoint);
this.telemetryCollections[keyString] = this.openmct.telemetry.requestCollection(
telemetryObject,
requestOptions
);

this.telemetryObjects[telemetryKeyString] = Object.assign({}, endpoint, {
telemetryMetaData: metadata ? metadata.valueMetadatas : []
});
const metadata = this.openmct.telemetry.getMetadata(telemetryObject);
const telemetryMetaData = metadata ? metadata.valueMetadatas : [];
const telemetryProcessor = this.telemetryReceived.bind(this, telemetryObject);

// get latest telemetry value (in case subscription is cached and no new data is coming in)
this.requestLatestValue(endpoint);
this.telemetryObjects[keyString] = Object.assign({}, telemetryObject, { telemetryMetaData });

this.telemetryCollections[keyString].on('add', telemetryProcessor);
this.telemetryCollections[keyString].load();

this.subscriptions[telemetryKeyString] = this.openmct.telemetry.subscribe(
endpoint,
this.telemetryReceived.bind(this, endpoint)
);
this.updateConditionTelemetryObjects();
}

unsubscribeFromTelemetry(endpointIdentifier) {
const id = this.openmct.objects.makeKeyString(endpointIdentifier);
if (!this.subscriptions[id]) {
console.log('no subscription to remove');

const keyString = this.openmct.objects.makeKeyString(endpointIdentifier);
if (!this.telemetryCollections[keyString]) {
return;
}

this.subscriptions[id]();
delete this.subscriptions[id];
delete this.telemetryObjects[id];
this.telemetryCollections[keyString].destroy();
delete this.telemetryCollections[keyString];
delete this.telemetryObjects[keyString];
this.removeConditionTelemetryObjects();

//force re-computation of condition set result as we might be in a state where
Expand All @@ -107,7 +96,7 @@ export default class ConditionManager extends EventEmitter {
this.timeSystems,
this.openmct.time.getTimeSystem()
);
this.updateConditionResults({ id: id });
this.updateConditionResults({ id: keyString });
this.updateCurrentCondition(latestTimestamp);

if (Object.keys(this.telemetryObjects).length === 0) {
Expand Down Expand Up @@ -507,8 +496,9 @@ export default class ConditionManager extends EventEmitter {
destroy() {
this.composition.off('add', this.subscribeToTelemetry, this);
this.composition.off('remove', this.unsubscribeFromTelemetry, this);
Object.values(this.subscriptions).forEach((unsubscribe) => unsubscribe());
delete this.subscriptions;
Object.values(this.telemetryCollections).forEach((telemetryCollection) =>
telemetryCollection.destroy()
);

this.conditions.forEach((condition) => {
condition.destroy();
Expand Down
45 changes: 20 additions & 25 deletions 45 src/plugins/plot/stackedPlot/mixins/objectStyles-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,36 +128,31 @@ export default {
}
},
updateStyle(styleObj) {
let elemToStyle = this.getStyleReceiver();
const elemToStyle = this.getStyleReceiver();

if (!styleObj || elemToStyle === undefined) {
if (!styleObj || !elemToStyle) {
return;
}

let keys = Object.keys(styleObj);

keys.forEach((key) => {
if (elemToStyle) {
if (typeof styleObj[key] === 'string' && styleObj[key].indexOf('__no_value') > -1) {
if (elemToStyle.style[key]) {
elemToStyle.style[key] = '';
}
} else {
if (
!styleObj.isStyleInvisible &&
elemToStyle.classList.contains(STYLE_CONSTANTS.isStyleInvisible)
) {
elemToStyle.classList.remove(STYLE_CONSTANTS.isStyleInvisible);
} else if (
styleObj.isStyleInvisible &&
!elemToStyle.classList.contains(styleObj.isStyleInvisible)
) {
elemToStyle.classList.add(styleObj.isStyleInvisible);
}

elemToStyle.style[key] = styleObj[key];
// handle visibility separately
if (styleObj.isStyleInvisible !== undefined) {
elemToStyle.classList.toggle(STYLE_CONSTANTS.isStyleInvisible, styleObj.isStyleInvisible);
delete styleObj.isStyleInvisible;
}

// build style string
const styleString = Object.entries(styleObj)
.map(([key, value]) => {
if (typeof value === 'string' && value.includes('__no_value')) {
return `${key}: ;`; // removes the property
}
}
return `${key}: ${value};`;
})
.join(' ');

// apply styles in one operation
requestAnimationFrame(() => {
elemToStyle.style.cssText += styleString;
});
}
}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.