mirror of
https://github.com/nasa/openmct.git
synced 2025-03-18 10:05:22 +00:00
Added phase shift to telemetry
This commit is contained in:
parent
9408a6d491
commit
275a80c4ee
@ -51,12 +51,23 @@ define(
|
||||
var offsets = {};
|
||||
|
||||
function wrapSeries(telemetrySeries, offset) {
|
||||
var phaseOffset = Math.floor(Math.random(1000));
|
||||
function phaseShift(index, length) {
|
||||
return (phaseOffset + index) % length;
|
||||
}
|
||||
return {
|
||||
getDomainValue: function (index, domain) {
|
||||
return telemetrySeries.getDomainValue(index, domain);
|
||||
},
|
||||
getRangeValue: function (index, range) {
|
||||
return Math.random(1)/50 + telemetrySeries.getRangeValue(index, range) + offset;
|
||||
// Sine wave 'carrier' signal, with random phase shift
|
||||
return telemetrySeries.getRangeValue(phaseShift(index,telemetrySeries.getPointCount()) , range)
|
||||
// Introduce some random variability so that line is
|
||||
// not straight or perfectly curved
|
||||
+ Math.random(1)/50
|
||||
//Add a random range offset so that lines
|
||||
// are not all bunched together
|
||||
+ offset;
|
||||
},
|
||||
getPointCount: function () {
|
||||
return telemetrySeries.getPointCount();
|
||||
|
Loading…
x
Reference in New Issue
Block a user