-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Feature/historical conditions #8148
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
Open
jvigliotta
wants to merge
43
commits into
master
Choose a base branch
from
feature/historical-conditions
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+858
−61
Open
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 5bd5ca9
handling telemetry collection data not datum
jvigliotta 4ab19e3
adding from maaster
jvigliotta b467f9c
addressing PR comments
jvigliotta 3f66140
Merge branch 'master' into conditional-style-performance
jvigliotta 6482135
update unit test to work with telemetry collections
jvigliotta 54c90e0
fixing tests
jvigliotta 94a4ff3
removing unnecessary addition
jvigliotta 7cba09b
removing focused describe
jvigliotta 405b497
removing focused it
jvigliotta 1581216
Merge branch 'master' into conditional-style-performance
jvigliotta 5b385ea
fix weird test bleed
jvigliotta 73489cd
Merge branch 'conditional-style-performance' of https://github.com/na…
jvigliotta 23cf829
Add realtime output of telemetry data in conditionals and add support…
khalidadil 21e94fd
Cleanup and add missing files
khalidadil 101baa5
Fix issue with missing data
khalidadil 7896f36
Update emitted values
khalidadil 4b39ea2
Addressing feedback
khalidadil b975554
Creating a const for telemetry value
khalidadil 7727a90
Cleanup
khalidadil f544a1d
Pass through plot options
khalidadil 1180597
Cleanup
khalidadil 39a73cf
Fix problem introduced with const
khalidadil 0f2f71f
Add back initialize on mount
khalidadil 4a3b0b9
Compensate for missing data at certain timestamps
khalidadil a739d61
Rename file
khalidadil 488178a
Rename file
khalidadil f239d4b
Update metadata provider
khalidadil f4c2b79
Update condition set metadata
khalidadil bd3f00c
Fix zero issue
khalidadil cba2056
Try removing the default format for better data inspection
khalidadil 848fbb9
merging fork
jvigliotta 7702e8f
pulled over changes that were made after copying whole repo in a dump
jvigliotta a88fa39
pulling over from file dump
jvigliotta 4611faa
remove debug
jvigliotta f057602
handle "none" output situations
jvigliotta a992d32
removing telemetry when output condition is "none"
jvigliotta 3d4eb3f
adding license info
jvigliotta 2b4d785
one last tweak to get none to work correctly without messin up other …
jvigliotta 559eb30
Merge branch 'master' into feature/historical-conditions
jvigliotta 4cba005
Merge branch 'master' into feature/historical-conditions
jvigliotta d9cc238
Merge branch 'master' into feature/historical-conditions
jvigliotta 1c8cae3
Merge branch 'master' into feature/historical-conditions
jvigliotta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
pulled over changes that were made after copying whole repo in a dump
- Loading branch information
commit 7702e8f3f7f5ff421d06bb78ef4045ecbc8c8362
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,61 @@ | ||
/***************************************************************************** | ||
* Open MCT, Copyright (c) 2014-2024, United States Government | ||
* as represented by the Administrator of the National Aeronautics and Space | ||
* Administration. All rights reserved. | ||
* | ||
* Open MCT is licensed under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* Open MCT includes source code licensed under additional open source | ||
* licenses. See the Open Source Licenses file (LICENSES.md) included with | ||
* this source code distribution or the Licensing information page available | ||
* at runtime from the About dialog for additional information. | ||
*****************************************************************************/ | ||
|
||
import { makeKeyString } from '../../api/objects/object-utils.js'; | ||
|
||
function sortTelemetriesByDate(historicalTelemetriesPool) { | ||
const historicalTelemetryDateMap = new Map(); | ||
historicalTelemetriesPool.forEach((historicalTelemetryList) => { | ||
const { historicalTelemetry, domainObject } = historicalTelemetryList; | ||
const { identifier } = domainObject; | ||
const telemetryIdentifier = makeKeyString(identifier); | ||
historicalTelemetry.forEach((historicalTelemetryItem) => { | ||
let telemetryTimestamp = historicalTelemetryItem.utc; | ||
if (historicalTelemetryItem.timestamp) { | ||
telemetryTimestamp = new Date(historicalTelemetryItem.timestamp)?.getTime(); | ||
} | ||
if (!historicalTelemetryDateMap.get(telemetryTimestamp)) { | ||
const telemetryMap = new Map(); | ||
telemetryMap.set(telemetryIdentifier, historicalTelemetryItem); | ||
historicalTelemetryDateMap.set(telemetryTimestamp, telemetryMap); | ||
} else { | ||
const telemetryMap = historicalTelemetryDateMap.get(telemetryTimestamp); | ||
telemetryMap.set(telemetryIdentifier, historicalTelemetryItem); | ||
historicalTelemetryDateMap.set(telemetryTimestamp, telemetryMap); | ||
} | ||
(function () { | ||
function sortTelemetriesByDate(historicalTelemetriesPool) { | ||
const historicalTelemetryDateMap = new Map(); | ||
historicalTelemetriesPool.forEach((historicalTelemetryList) => { | ||
const { historicalTelemetry, domainObject } = historicalTelemetryList; | ||
const { identifier } = domainObject; | ||
const telemetryIdentifier = makeKeyString(identifier); | ||
historicalTelemetry.forEach((historicalTelemetryItem) => { | ||
let telemetryTimestamp = historicalTelemetryItem.utc; | ||
if (historicalTelemetryItem.timestamp) { | ||
telemetryTimestamp = new Date(historicalTelemetryItem.timestamp)?.getTime(); | ||
} | ||
if (!historicalTelemetryDateMap.get(telemetryTimestamp)) { | ||
const telemetryMap = new Map(); | ||
telemetryMap.set(telemetryIdentifier, historicalTelemetryItem); | ||
historicalTelemetryDateMap.set(telemetryTimestamp, telemetryMap); | ||
} else { | ||
const telemetryMap = historicalTelemetryDateMap.get(telemetryTimestamp); | ||
telemetryMap.set(telemetryIdentifier, historicalTelemetryItem); | ||
historicalTelemetryDateMap.set(telemetryTimestamp, telemetryMap); | ||
} | ||
}); | ||
}); | ||
}); | ||
return historicalTelemetryDateMap; | ||
} | ||
return historicalTelemetryDateMap; | ||
} | ||
|
||
self.onmessage = function (e) { | ||
const { type, data } = e.data; | ||
self.onmessage = function (e) { | ||
const { type, data } = e.data; | ||
|
||
if (type === 'sortTelemetries') { | ||
const sortedTelemetries = sortTelemetriesByDate(data.historicalTelemetriesPool); | ||
self.postMessage({ type: 'result', data: sortedTelemetries }); | ||
} else { | ||
self.postMessage({ type: 'error', error: 'Unknown message type' }); | ||
} | ||
}; | ||
if (type === 'sortTelemetries') { | ||
const sortedTelemetries = sortTelemetriesByDate(data.historicalTelemetriesPool); | ||
self.postMessage({ type: 'result', data: sortedTelemetries }); | ||
} else { | ||
self.postMessage({ type: 'error', error: 'Unknown message type' }); | ||
} | ||
}; | ||
})(); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Missing origin verification in `postMessage` handler Medium
Copilot Autofix
AI 5 days ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.