Compare commits

...

4 Commits

Author SHA1 Message Date
Mandlik, Nikhil K. (ARC-TI)[KBR Wyle Services, LLC]
d5a9ea1ac3 added override image name in example.imagery plugin sample images. 2021-05-11 14:25:38 -07:00
Mandlik, Nikhil K. (ARC-TI)[KBR Wyle Services, LLC]
9d843d8057 updated imageDownloadName Telemetry Metadata Value Hints in API docs. 2021-05-11 10:57:08 -07:00
Mandlik, Nikhil K. (ARC-TI)[KBR Wyle Services, LLC]
03d6672d79 using metadata to get Image Download Name 2021-05-11 10:56:42 -07:00
Joshi
0a4ff80f96 Version 1.4.0 2020-11-09 10:42:42 -08:00
4 changed files with 38 additions and 5 deletions

1
API.md
View File

@@ -430,6 +430,7 @@ Known hints:
* `domain`: Values with a `domain` hint will be used for the x-axis of a plot, and tables will render columns for these values first.
* `range`: Values with a `range` hint will be used as the y-axis on a plot, and tables will render columns for these values after the `domain` values.
* `image`: Indicates that the value may be interpreted as the URL to an image file, in which case appropriate views will be made available.
* `imageDownloadName`: Indicates that the value may be interpreted as the name of the image file.
##### The Time Conductor and Telemetry

View File

@@ -50,11 +50,16 @@ define([
const IMAGE_DELAY = 20000;
function pointForTimestamp(timestamp, name) {
const url = IMAGE_SAMPLES[Math.floor(timestamp / IMAGE_DELAY) % IMAGE_SAMPLES.length];
const urlItems = url.split('/');
const imageDownloadName = `example.imagery.${urlItems[urlItems.length - 1]}`;
return {
name: name,
name,
utc: Math.floor(timestamp / IMAGE_DELAY) * IMAGE_DELAY,
local: Math.floor(timestamp / IMAGE_DELAY) * IMAGE_DELAY,
url: IMAGE_SAMPLES[Math.floor(timestamp / IMAGE_DELAY) % IMAGE_SAMPLES.length]
url,
imageDownloadName
};
}
@@ -139,6 +144,14 @@ define([
hints: {
image: 1
}
},
{
name: 'Image Download Name',
key: 'imageDownloadName',
format: 'imageDownloadName',
hints: {
imageDownloadName: 1
}
}
]
};

View File

@@ -1,6 +1,6 @@
{
"name": "openmct",
"version": "1.3.3-SNAPSHOT",
"version": "1.4.0",
"description": "The Open MCT core platform",
"dependencies": {},
"devDependencies": {

View File

@@ -87,9 +87,14 @@
:class="{ selected: focusedImageIndex === index && isPaused }"
@click="setFocusedImage(index, thumbnailClick)"
>
<img class="c-thumb__image"
:src="formatImageUrl(datum)"
<a :href="datum.url"
:download="datum.imageDownloadName"
@click.prevent
>
<img class="c-thumb__image"
:src="datum.url"
>
</a>
<div class="c-thumb__timestamp">{{ formatTime(datum) }}</div>
</div>
</div>
@@ -156,6 +161,9 @@ export default {
canTrackDuration() {
return this.openmct.time.clock() && this.timeSystem.isUTCBased;
},
focusedImageDownloadName() {
return this.getImageDownloadName(this.focusedImage);
},
isNextDisabled() {
let disabled = false;
@@ -214,6 +222,7 @@ export default {
this.metadata = this.openmct.telemetry.getMetadata(this.domainObject);
this.durationFormatter = this.getFormatter(this.timeSystem.durationFormat || DEFAULT_DURATION_FORMATTER);
this.imageFormatter = this.openmct.telemetry.getValueFormatter(this.metadata.valuesForHints(['image'])[0]);
this.imageDownloadNameHints = { ...this.metadata.valuesForHints(['imageDownloadName'])[0]};
// initialize
this.timeKey = this.timeSystem.key;
@@ -275,6 +284,15 @@ export default {
// Replace ISO "T" with a space to allow wrapping
return dateTimeStr.replace("T", " ");
},
getImageDownloadName(datum) {
let imageDownloadName = '';
if (datum) {
const key = this.imageDownloadNameHints.key;
imageDownloadName = datum[key];
}
return imageDownloadName;
},
parseTime(datum) {
if (!datum) {
return;
@@ -393,6 +411,7 @@ export default {
return;
}
datum.imageDownloadName = this.getImageDownloadName(datum);
this.imageHistory.push(datum);
if (setFocused) {