[Example] Add domain

Add a second domain to example telemetry, to support
addition of a domain selector to the time conductor;
nasa/openmctweb#115
This commit is contained in:
Victor Woeltjen 2015-09-23 16:43:58 -07:00
parent 0260e6fff4
commit 0b0cee3afb
2 changed files with 9 additions and 4 deletions

View File

@ -34,6 +34,10 @@
{
"key": "time",
"name": "Time"
},
{
"key": "yesterday",
"name": "Yesterday"
}
],
"ranges": [
@ -61,4 +65,4 @@
}
]
}
}
}

View File

@ -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) {