From 0b0cee3afb6be83327d2c53f8cc3e3f99a3b4726 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Wed, 23 Sep 2015 16:43:58 -0700 Subject: [PATCH] [Example] Add domain Add a second domain to example telemetry, to support addition of a domain selector to the time conductor; nasa/openmctweb#115 --- example/generator/bundle.json | 6 +++++- example/generator/src/SinewaveTelemetrySeries.js | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/example/generator/bundle.json b/example/generator/bundle.json index a13bbdc8f8..cdb4736957 100644 --- a/example/generator/bundle.json +++ b/example/generator/bundle.json @@ -34,6 +34,10 @@ { "key": "time", "name": "Time" + }, + { + "key": "yesterday", + "name": "Yesterday" } ], "ranges": [ @@ -61,4 +65,4 @@ } ] } -} \ No newline at end of file +} diff --git a/example/generator/src/SinewaveTelemetrySeries.js b/example/generator/src/SinewaveTelemetrySeries.js index 5b7914a867..dbab6dcac5 100644 --- a/example/generator/src/SinewaveTelemetrySeries.js +++ b/example/generator/src/SinewaveTelemetrySeries.js @@ -29,7 +29,8 @@ define( function () { "use strict"; - var firstObservedTime = Math.floor(Date.now() / 1000); + var ONE_DAY = 1000 * 60 * 60 * 24, + firstObservedTime = Math.floor(Date.now() / 1000); /** * @@ -56,8 +57,8 @@ define( }; generatorData.getDomainValue = function (i, domain) { - return (i + offset) * 1000 + - (domain !== 'delta' ? (firstObservedTime * 1000) : 0); + return (i + offset) * 1000 + firstObservedTime * 1000 - + (domain === 'yesterday' ? ONE_DAY : 0); }; generatorData.getRangeValue = function (i, range) {