From ed9a5b0890d59a311c8337c4f77a1e5e013f8fa6 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Mon, 26 Oct 2015 10:05:46 -0700 Subject: [PATCH] [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. --- example/generator/bundle.json | 22 -------- .../generator/src/SinewaveTelemetrySeries.js | 8 --- example/generator/src/SinewaveTimeProvider.js | 52 ------------------ example/generator/src/SinewaveTimeSystem.js | 55 ------------------- 4 files changed, 137 deletions(-) delete mode 100644 example/generator/src/SinewaveTimeProvider.js delete mode 100644 example/generator/src/SinewaveTimeSystem.js diff --git a/example/generator/bundle.json b/example/generator/bundle.json index 6a182e6a7a..cdb4736957 100644 --- a/example/generator/bundle.json +++ b/example/generator/bundle.json @@ -8,11 +8,6 @@ "type": "provider", "provides": "telemetryService", "depends": [ "$q", "$timeout" ] - }, - { - "implementation": "SinewaveTimeProvider.js", - "type": "provider", - "provides": "timeService" } ], "capabilities": [ @@ -43,11 +38,6 @@ { "key": "yesterday", "name": "Yesterday" - }, - { - "key": "index", - "name": "Index", - "system": "generator.index" } ], "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." - } ] } } diff --git a/example/generator/src/SinewaveTelemetrySeries.js b/example/generator/src/SinewaveTelemetrySeries.js index 529d4e80a2..1e84034766 100644 --- a/example/generator/src/SinewaveTelemetrySeries.js +++ b/example/generator/src/SinewaveTelemetrySeries.js @@ -49,11 +49,6 @@ define( Math.max(Math.floor(request.start / 1000), firstTime), offset = requestStart - firstTime; - if (request.domain === 'index') { - offset = Math.floor(request.start || 0); - count = Math.ceil(request.end || endTime); - } - if (request.size !== undefined) { offset = Math.max(offset, count - request.size); } @@ -63,9 +58,6 @@ define( }; generatorData.getDomainValue = function (i, domain) { - if (domain === 'index') { - return i + offset; - } return (i + offset) * 1000 + firstTime * 1000 - (domain === 'yesterday' ? ONE_DAY : 0); }; diff --git a/example/generator/src/SinewaveTimeProvider.js b/example/generator/src/SinewaveTimeProvider.js deleted file mode 100644 index 2f2bcc2391..0000000000 --- a/example/generator/src/SinewaveTimeProvider.js +++ /dev/null @@ -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; -}); diff --git a/example/generator/src/SinewaveTimeSystem.js b/example/generator/src/SinewaveTimeSystem.js deleted file mode 100644 index 24a9e35e62..0000000000 --- a/example/generator/src/SinewaveTimeSystem.js +++ /dev/null @@ -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; -});