Imagery Age to be displayed for realtime mode in Imagery View (#3308)
* fix linting errors * removing testing units * WIP: stubbe in age in template, adding getAge function * WIP: stubbed in age in template, dummy function to start * added image age for realtime mode, ready for styling * reverting unnecesarry telemetryview file changes, not needed for this issue * checking for age tracking conditions on mount * Image age styling and changes - Cleaned up code in ImageryPlugin to use const instead of var, changed image delay time into a const * Image age styling and changes - WIP! - Layout changes for Imagery control-bar; - New animation effect, WIP; * Image age styling and changes - Markup and CSS updates for Imagery view; - Final layout for age indicator; * parsing image timestamp in case it is a string * using moment for human readable durations above 8 hours * UTC based timesystem check * reset "new" css class on image age when "time" updates * WIP: debuggin weird imagery plugin issue for first selection of image in thumbnails * fixing pause overwriting clicked images selection * making isImageNew a computed value * WIP: pr updates * WIP: tabling PR edits to focus on lower hanging PR edits for testathon * WIP * overhaul of imagery plugin logic for optimization PLUS imagery age * adding next/prev functionality to refactored plugin * added arrow left and right keys to navigate next and previous * added arrow key scrolling and scrolling thumbnail into view and hold down scrolling * adding in missing class * component based key listening, PR updates * refactor to use just imageIndex to track focused image, utilized more caching, PR comment edits Co-authored-by: David Tsay <david.e.tsay@nasa.gov> Co-authored-by: charlesh88 <charlesh88@gmail.com>
This commit is contained in:
@@ -27,7 +27,7 @@ define([
|
||||
) {
|
||||
function ImageryPlugin() {
|
||||
|
||||
var IMAGE_SAMPLES = [
|
||||
const IMAGE_SAMPLES = [
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18731.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18732.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18733.jpg",
|
||||
@@ -47,13 +47,14 @@ define([
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18747.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18748.jpg"
|
||||
];
|
||||
const IMAGE_DELAY = 20000;
|
||||
|
||||
function pointForTimestamp(timestamp, name) {
|
||||
return {
|
||||
name: name,
|
||||
utc: Math.floor(timestamp / 5000) * 5000,
|
||||
local: Math.floor(timestamp / 5000) * 5000,
|
||||
url: IMAGE_SAMPLES[Math.floor(timestamp / 5000) % IMAGE_SAMPLES.length]
|
||||
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]
|
||||
};
|
||||
}
|
||||
|
||||
@@ -64,7 +65,7 @@ define([
|
||||
subscribe: function (domainObject, callback) {
|
||||
var interval = setInterval(function () {
|
||||
callback(pointForTimestamp(Date.now(), domainObject.name));
|
||||
}, 5000);
|
||||
}, IMAGE_DELAY);
|
||||
|
||||
return function () {
|
||||
clearInterval(interval);
|
||||
@@ -81,9 +82,9 @@ define([
|
||||
var start = options.start;
|
||||
var end = Math.min(options.end, Date.now());
|
||||
var data = [];
|
||||
while (start <= end && data.length < 5000) {
|
||||
while (start <= end && data.length < IMAGE_DELAY) {
|
||||
data.push(pointForTimestamp(start, domainObject.name));
|
||||
start += 5000;
|
||||
start += IMAGE_DELAY;
|
||||
}
|
||||
|
||||
return Promise.resolve(data);
|
||||
|
||||
Reference in New Issue
Block a user