-
Notifications
You must be signed in to change notification settings - Fork 7
Add AMPCS session info in exported plot image filename #328
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
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
444f838
default exported plot image filenames to the main object name if no f…
jvigliotta 12cd532
update core dependency, add the imageexport modifer to our action mod…
jvigliotta ab88fac
removing github prefix
jvigliotta 0c83d21
point to core omm working branch
jvigliotta b286af9
update to CORRECT omm core working branch
jvigliotta faaa7ae
adding github prefix to core dependency, since it is considered best …
jvigliotta d48da1c
add type to name intead of manual plot
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
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 |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import SessionService from 'services/session/SessionService'; | ||
| import { formatNumberSequence } from 'ommUtils/strings'; | ||
|
|
||
| function imageExportModifier(openmct) { | ||
| const PNGImageExportAction = openmct.actions._allActions['export-as-png']; | ||
| const JPGImageExportAction = openmct.actions._allActions['export-as-jpg']; | ||
| const imageExportActions = [PNGImageExportAction, JPGImageExportAction]; | ||
| const sessionService = SessionService(); | ||
|
|
||
| imageExportActions.forEach((action) => { | ||
| const invoke = action.invoke; | ||
|
|
||
| action.invoke = (objectPath, view) => { | ||
| const domainObject = objectPath[0]; | ||
| let filename = domainObject.name; | ||
| const type = domainObject.type; | ||
| const sessionFilter = sessionService.getHistoricalSessionFilter(); | ||
|
|
||
| if (sessionFilter) { | ||
| filename = `${filename} - ${historicalFilterString(sessionFilter)}`; | ||
| } | ||
|
|
||
| filename = `${filename} - ${type}`; | ||
|
|
||
| invoke(objectPath, view, filename); | ||
| }; | ||
| }); | ||
| } | ||
|
|
||
| function historicalFilterString(sessionFilter) { | ||
| let filterString = formatNumberSequence(sessionFilter.numbers); | ||
|
|
||
| filterString = filterString.replaceAll('...', '-'); | ||
| filterString = filterString.replaceAll(', ', '_'); | ||
|
|
||
| return `${sessionFilter.host}_${filterString}`; | ||
| } | ||
|
|
||
| export default imageExportModifier; |
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
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.
Uh oh!
There was an error while loading. Please reload this page.