|
| 1 | +/***************************************************************************** |
| 2 | + * Open MCT Web, Copyright (c) 2014-2015, United States Government |
| 3 | + * as represented by the Administrator of the National Aeronautics and Space |
| 4 | + * Administration. All rights reserved. |
| 5 | + * |
| 6 | + * Open MCT Web is licensed under the Apache License, Version 2.0 (the |
| 7 | + * "License"); you may not use this file except in compliance with the License. |
| 8 | + * You may obtain a copy of the License at |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0. |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | + * License for the specific language governing permissions and limitations |
| 15 | + * under the License. |
| 16 | + * |
| 17 | + * Open MCT Web includes source code licensed under additional open source |
| 18 | + * licenses. See the Open Source Licenses file (LICENSES.md) included with |
| 19 | + * this source code distribution or the Licensing information page available |
| 20 | + * at runtime from the About dialog for additional information. |
| 21 | + *****************************************************************************/ |
| 22 | + |
| 23 | +define([ |
| 24 | + |
| 25 | +], function ( |
| 26 | + |
| 27 | +) { |
| 28 | + |
| 29 | + function Conductor(timeConductor) { |
| 30 | + this.timeConductor = timeConductor; |
| 31 | + } |
| 32 | + |
| 33 | + Conductor.prototype.displayStart = function () { |
| 34 | + return this.timeConductor.bounds().start; |
| 35 | + }; |
| 36 | + |
| 37 | + Conductor.prototype.displayEnd = function () { |
| 38 | + return this.timeConductor.bounds().end; |
| 39 | + }; |
| 40 | + |
| 41 | + Conductor.prototype.domainOptions = function () { |
| 42 | + throw new Error([ |
| 43 | + 'domainOptions not implemented in compatibility layer,', |
| 44 | + ' you must be using some crazy unknown code' |
| 45 | + ].join('')); |
| 46 | + }; |
| 47 | + |
| 48 | + Conductor.prototype.domain = function () { |
| 49 | + var system = this.timeConductor.timeSystem(); |
| 50 | + return { |
| 51 | + key: system.metadata.key, |
| 52 | + name: system.metadata.name, |
| 53 | + format: system.formats()[0] |
| 54 | + }; |
| 55 | + }; |
| 56 | + |
| 57 | + /** |
| 58 | + * Small compatibility layer that implements old conductor service by |
| 59 | + * wrapping new time conductor. This allows views that previously depended |
| 60 | + * directly on the conductor service to continue to do so without |
| 61 | + * modification. |
| 62 | + */ |
| 63 | + function ConductorService(timeConductor) { |
| 64 | + this.tc = new Conductor(timeConductor); |
| 65 | + } |
| 66 | + |
| 67 | + ConductorService.prototype.getConductor = function () { |
| 68 | + return this.tc; |
| 69 | + } |
| 70 | + |
| 71 | + return ConductorService; |
| 72 | +}); |
0 commit comments