diff --git a/example/localTimeSystem/src/LocalTimeSystem.js b/example/localTimeSystem/src/LocalTimeSystem.js deleted file mode 100644 index ee309d09b0..0000000000 --- a/example/localTimeSystem/src/LocalTimeSystem.js +++ /dev/null @@ -1,79 +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. - *****************************************************************************/ - -define([ - '../../../platform/features/conductor/core/src/timeSystems/TimeSystem', - '../../../platform/features/conductor/core/src/timeSystems/LocalClock', - './LADTickSource' -], function (TimeSystem, LocalClock, LADTickSource) { - var THIRTY_MINUTES = 30 * 60 * 1000, - DEFAULT_PERIOD = 1000; - - /** - * This time system supports UTC dates and provides a ticking clock source. - * @implements TimeSystem - * @constructor - */ - function LocalTimeSystem ($timeout) { - TimeSystem.call(this); - - /** - * Some metadata, which will be used to identify the time system in - * the UI - * @type {{key: string, name: string, glyph: string}} - */ - this.metadata = { - 'key': 'local', - 'name': 'Local', - 'glyph': '\u0043' - }; - - this.fmts = ['local-format']; - this.sources = [new LocalClock($timeout, DEFAULT_PERIOD), new LADTickSource($timeout, DEFAULT_PERIOD)]; - } - - LocalTimeSystem.prototype = Object.create(TimeSystem.prototype); - - LocalTimeSystem.prototype.formats = function () { - return this.fmts; - }; - - LocalTimeSystem.prototype.deltaFormat = function () { - return 'duration'; - }; - - LocalTimeSystem.prototype.tickSources = function () { - return this.sources; - }; - - LocalTimeSystem.prototype.defaults = function (key) { - var now = Math.ceil(Date.now() / 1000) * 1000; - return { - key: 'local-default', - name: 'Local 12 hour time system defaults', - deltas: {start: THIRTY_MINUTES, end: 0}, - bounds: {start: now - THIRTY_MINUTES, end: now} - }; - }; - - return LocalTimeSystem; -}); diff --git a/index.html b/index.html index 4f29358da3..f0c938f9a8 100644 --- a/index.html +++ b/index.html @@ -28,6 +28,8 @@ diff --git a/openmct.js b/openmct.js index 112b70adaa..4c578b9b3f 100644 --- a/openmct.js +++ b/openmct.js @@ -100,11 +100,5 @@ define([ return new Main().run(defaultRegistry); }); - // For now, install conductor by default - openmct.install(openmct.plugins.Conductor({ - showConductor: false - })); - - return openmct; }); diff --git a/platform/commonUI/formats/src/UTCTimeFormat.js b/platform/commonUI/formats/src/UTCTimeFormat.js index 6f54865ba9..6d747a1391 100644 --- a/platform/commonUI/formats/src/UTCTimeFormat.js +++ b/platform/commonUI/formats/src/UTCTimeFormat.js @@ -95,45 +95,6 @@ define([ })[0][0]; } - /** - * Returns a description of the current range of the time conductor's - * bounds. - * @param timeRange - * @returns {*} - */ - UTCTimeFormat.prototype.timeUnits = function (timeRange) { - var momentified = moment.duration(timeRange); - - return [ - ["Decades", function (r) { - return r.years() > 15; - }], - ["Years", function (r) { - return r.years() > 1; - }], - ["Months", function (r) { - return r.years() === 1 || r.months() > 1; - }], - ["Days", function (r) { - return r.months() === 1 || r.days() > 1; - }], - ["Hours", function (r) { - return r.days() === 1 || r.hours() > 1; - }], - ["Minutes", function (r) { - return r.hours() === 1 || r.minutes() > 1; - }], - ["Seconds", function (r) { - return r.minutes() === 1 || r.seconds() > 1; - }], - ["Milliseconds", function (r) { - return true; - }] - ].filter(function (row) { - return row[1](momentified); - })[0][0]; - }; - /** * * @param value diff --git a/platform/features/conductor/compatibility/src/ConductorRepresenter.js b/platform/features/conductor/compatibility/src/ConductorRepresenter.js index e267c9d2f4..6969e86ff5 100644 --- a/platform/features/conductor/compatibility/src/ConductorRepresenter.js +++ b/platform/features/conductor/compatibility/src/ConductorRepresenter.js @@ -41,7 +41,7 @@ define( scope, element ) { - this.conductor = openmct.conductor; + this.timeAPI = openmct.time; this.scope = scope; this.element = element; @@ -51,24 +51,25 @@ define( } ConductorRepresenter.prototype.boundsListener = function (bounds) { + var timeSystem = this.timeAPI.timeSystem(); this.scope.$broadcast('telemetry:display:bounds', { start: bounds.start, end: bounds.end, - domain: this.conductor.timeSystem().metadata.key - }, this.conductor.follow()); + domain: timeSystem.key + }, this.timeAPI.clock() !== undefined); }; ConductorRepresenter.prototype.timeSystemListener = function (timeSystem) { - var bounds = this.conductor.bounds(); + var bounds = this.timeAPI.bounds(); this.scope.$broadcast('telemetry:display:bounds', { start: bounds.start, end: bounds.end, - domain: timeSystem.metadata.key - }, this.conductor.follow()); + domain: timeSystem.key + }, this.timeAPI.clock() !== undefined); }; ConductorRepresenter.prototype.followListener = function () { - this.boundsListener(this.conductor.bounds()); + this.boundsListener(this.timeAPI.bounds()); }; // Handle a specific representation of a specific domain object @@ -76,16 +77,16 @@ define( if (representation.key === 'browse-object') { this.destroy(); - this.conductor.on("bounds", this.boundsListener); - this.conductor.on("timeSystem", this.timeSystemListener); - this.conductor.on("follow", this.followListener); + this.timeAPI.on("bounds", this.boundsListener); + this.timeAPI.on("timeSystem", this.timeSystemListener); + this.timeAPI.on("follow", this.followListener); } }; ConductorRepresenter.prototype.destroy = function destroy() { - this.conductor.off("bounds", this.boundsListener); - this.conductor.off("timeSystem", this.timeSystemListener); - this.conductor.off("follow", this.followListener); + this.timeAPI.off("bounds", this.boundsListener); + this.timeAPI.off("timeSystem", this.timeSystemListener); + this.timeAPI.off("follow", this.followListener); }; return ConductorRepresenter; diff --git a/platform/features/conductor/core/bundle.js b/platform/features/conductor/core/bundle.js index e99e54d22b..cb22f32586 100644 --- a/platform/features/conductor/core/bundle.js +++ b/platform/features/conductor/core/bundle.js @@ -67,12 +67,10 @@ define([ "depends": [ "$scope", "$window", - "$location", "openmct", "timeConductorViewService", "formatService", - "DEFAULT_TIMECONDUCTOR_MODE", - "SHOW_TIMECONDUCTOR" + "CONDUCTOR_CONFIG" ] }, { @@ -151,13 +149,6 @@ define([ "link": "https://github.com/d3/d3/blob/master/LICENSE" } ], - "constants": [ - { - "key": "DEFAULT_TIMECONDUCTOR_MODE", - "value": "realtime", - "priority": "fallback" - } - ], "formats": [ { "key": "number", diff --git a/platform/features/conductor/core/res/templates/mode-selector/mode-menu.html b/platform/features/conductor/core/res/templates/mode-selector/mode-menu.html index db6242a154..32c026de9d 100644 --- a/platform/features/conductor/core/res/templates/mode-selector/mode-menu.html +++ b/platform/features/conductor/core/res/templates/mode-selector/mode-menu.html @@ -22,8 +22,8 @@