mirror of
https://github.com/nasa/openmct.git
synced 2025-04-09 20:31:26 +00:00
[Telemetry] Remove unused scripts
Remove unused scripts from the platform/telemetry bundle in preparation for integration. WTD-575.
This commit is contained in:
parent
052f07f725
commit
4fcb59e181
@ -23,12 +23,6 @@
|
||||
"implementation": "TelemetryCapability.js",
|
||||
"depends": [ "telemetryService" ]
|
||||
}
|
||||
],
|
||||
"services": [
|
||||
{
|
||||
"key": "telemetryHelper",
|
||||
"implementation": "TelemetryHelper.js"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
/*global define*/
|
||||
|
||||
/**
|
||||
* Module defining Telemetry. Created by vwoeltje on 11/12/14.
|
||||
*/
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
function Telemetry(array, defaults) {
|
||||
// Assume array-of-arrays if not otherwise specified,
|
||||
// where first value is x, second is y
|
||||
defaults = defaults || {
|
||||
domain: 0,
|
||||
range: 1
|
||||
};
|
||||
|
||||
return {
|
||||
getPointCount: function () {
|
||||
return array.length;
|
||||
},
|
||||
getRangeValue: function (index, range) {
|
||||
return array[index][range || defaults.range];
|
||||
},
|
||||
getDomainValue: function (index, domain) {
|
||||
return array[index][domain || defaults.domain];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return Telemetry;
|
||||
}
|
||||
);
|
@ -1,73 +0,0 @@
|
||||
/*global define,Float32Array*/
|
||||
|
||||
/**
|
||||
* Module defining TelemetryHelper. Created by vwoeltje on 11/14/14.
|
||||
*/
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Helps to interpret the contents of Telemetry objects.
|
||||
* @constructor
|
||||
*/
|
||||
function TelemetryHelper() {
|
||||
return {
|
||||
getBufferedForm: function (telemetry, start, end, domain, range) {
|
||||
var arr = [],
|
||||
domainMin = Number.MAX_VALUE,
|
||||
rangeMin = Number.MAX_VALUE,
|
||||
domainMax = Number.MIN_VALUE,
|
||||
rangeMax = Number.MIN_VALUE,
|
||||
domainValue,
|
||||
rangeValue,
|
||||
count,
|
||||
i;
|
||||
|
||||
function trackBounds(domainValue, rangeValue) {
|
||||
domainMin = Math.min(domainMin, domainValue);
|
||||
domainMax = Math.max(domainMax, domainValue);
|
||||
rangeMin = Math.min(rangeMin, rangeValue);
|
||||
rangeMax = Math.max(rangeMax, rangeValue);
|
||||
}
|
||||
|
||||
function applyOffset() {
|
||||
var j;
|
||||
for (j = 0; j < arr.length; j += 2) {
|
||||
arr[j] -= domainMin;
|
||||
arr[j + 1] -= rangeMin;
|
||||
}
|
||||
}
|
||||
|
||||
count = telemetry.getPointCount();
|
||||
|
||||
if (start === undefined) {
|
||||
start = telemetry.getDomainValue(0, domain);
|
||||
}
|
||||
|
||||
if (end === undefined) {
|
||||
end = telemetry.getDomainValue(count - 1, domain);
|
||||
}
|
||||
|
||||
for (i = 0; i < telemetry.getPointCount(); i += 1) {
|
||||
// TODO: Binary search for start, end
|
||||
domainValue = telemetry.getDomainValue(i, domain);
|
||||
|
||||
if (domainValue >= start && domainValue <= end) {
|
||||
rangeValue = telemetry.getRangeValue(i, range);
|
||||
arr.push(domainValue);
|
||||
arr.push(rangeValue);
|
||||
trackBounds(domainValue, rangeValue);
|
||||
}
|
||||
}
|
||||
|
||||
applyOffset();
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return TelemetryHelper;
|
||||
}
|
||||
);
|
Loading…
x
Reference in New Issue
Block a user