mirror of
https://github.com/nasa/openmct.git
synced 2024-12-21 06:03:08 +00:00
[Time Conductor] Roll back changes to example telemetry
In particular, remove the timeService implementation; this is made obsolete by a switch to a simpler format-based approach.
This commit is contained in:
parent
aa23d358cc
commit
ed9a5b0890
@ -8,11 +8,6 @@
|
|||||||
"type": "provider",
|
"type": "provider",
|
||||||
"provides": "telemetryService",
|
"provides": "telemetryService",
|
||||||
"depends": [ "$q", "$timeout" ]
|
"depends": [ "$q", "$timeout" ]
|
||||||
},
|
|
||||||
{
|
|
||||||
"implementation": "SinewaveTimeProvider.js",
|
|
||||||
"type": "provider",
|
|
||||||
"provides": "timeService"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"capabilities": [
|
"capabilities": [
|
||||||
@ -43,11 +38,6 @@
|
|||||||
{
|
{
|
||||||
"key": "yesterday",
|
"key": "yesterday",
|
||||||
"name": "Yesterday"
|
"name": "Yesterday"
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "index",
|
|
||||||
"name": "Index",
|
|
||||||
"system": "generator.index"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ranges": [
|
"ranges": [
|
||||||
@ -73,18 +63,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"constants": [
|
|
||||||
{
|
|
||||||
"key": "TIME_CONDUCTOR_DOMAINS",
|
|
||||||
"value": [
|
|
||||||
{ "key": "time", "name": "Time" },
|
|
||||||
{ "key": "yesterday", "name": "Yesterday" },
|
|
||||||
{ "key": "index", "name": "Index", "system": "generator.index" }
|
|
||||||
],
|
|
||||||
"priority": -1,
|
|
||||||
"comment": "Placeholder; to be replaced by inspection of available domains."
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,11 +49,6 @@ define(
|
|||||||
Math.max(Math.floor(request.start / 1000), firstTime),
|
Math.max(Math.floor(request.start / 1000), firstTime),
|
||||||
offset = requestStart - firstTime;
|
offset = requestStart - firstTime;
|
||||||
|
|
||||||
if (request.domain === 'index') {
|
|
||||||
offset = Math.floor(request.start || 0);
|
|
||||||
count = Math.ceil(request.end || endTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (request.size !== undefined) {
|
if (request.size !== undefined) {
|
||||||
offset = Math.max(offset, count - request.size);
|
offset = Math.max(offset, count - request.size);
|
||||||
}
|
}
|
||||||
@ -63,9 +58,6 @@ define(
|
|||||||
};
|
};
|
||||||
|
|
||||||
generatorData.getDomainValue = function (i, domain) {
|
generatorData.getDomainValue = function (i, domain) {
|
||||||
if (domain === 'index') {
|
|
||||||
return i + offset;
|
|
||||||
}
|
|
||||||
return (i + offset) * 1000 + firstTime * 1000 -
|
return (i + offset) * 1000 + firstTime * 1000 -
|
||||||
(domain === 'yesterday' ? ONE_DAY : 0);
|
(domain === 'yesterday' ? ONE_DAY : 0);
|
||||||
};
|
};
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT Web includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define*/
|
|
||||||
|
|
||||||
define([
|
|
||||||
'./SinewaveTimeSystem'
|
|
||||||
], function (
|
|
||||||
SinewaveTimeSystem
|
|
||||||
) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides date-time formatting for the Sine Wave Generator's
|
|
||||||
* `index` domain; demonstrates how to support domains which should
|
|
||||||
* not necessarily be formatted as UTC dates.
|
|
||||||
* @memberof example/generator
|
|
||||||
* @constructor
|
|
||||||
* @implements {TimeService}
|
|
||||||
*/
|
|
||||||
function SinewaveTimeProvider() {
|
|
||||||
this.indexTimeSystem = new SinewaveTimeSystem();
|
|
||||||
}
|
|
||||||
|
|
||||||
SinewaveTimeProvider.prototype.systems = function () {
|
|
||||||
return [ 'generator.index' ];
|
|
||||||
};
|
|
||||||
|
|
||||||
SinewaveTimeProvider.prototype.system = function (key) {
|
|
||||||
return key === 'generator.index' ? this.indexTimeSystem : undefined;
|
|
||||||
};
|
|
||||||
|
|
||||||
return SinewaveTimeProvider;
|
|
||||||
});
|
|
@ -1,55 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT Web includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
/*global define*/
|
|
||||||
|
|
||||||
define([
|
|
||||||
'./SinewaveTelemetrySeries'
|
|
||||||
], function (
|
|
||||||
SinewaveTelemetrySeries
|
|
||||||
) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
function SinewaveTimeSystem(now) {
|
|
||||||
}
|
|
||||||
|
|
||||||
SinewaveTimeSystem.prototype.format = function (value) {
|
|
||||||
return ('#' + Math.floor(value));
|
|
||||||
};
|
|
||||||
|
|
||||||
SinewaveTimeSystem.prototype.parse = function (text) {
|
|
||||||
return parseInt(text.substring(1), 10);
|
|
||||||
};
|
|
||||||
|
|
||||||
SinewaveTimeSystem.prototype.validate = function (text) {
|
|
||||||
return (/^#\d+$/).test(text);
|
|
||||||
};
|
|
||||||
|
|
||||||
SinewaveTimeSystem.prototype.now = function () {
|
|
||||||
return new SinewaveTelemetrySeries({}).getPointCount();
|
|
||||||
};
|
|
||||||
|
|
||||||
SinewaveTimeSystem.prototype.increment = function (scale) {
|
|
||||||
return Math.max(Math.pow(10, (scale || 0) + 1), 1);
|
|
||||||
};
|
|
||||||
|
|
||||||
return SinewaveTimeSystem;
|
|
||||||
});
|
|
Loading…
Reference in New Issue
Block a user