From 69b06364eb81034bb420c22a950030d5586c1d4a Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 27 Apr 2017 19:02:35 -0700 Subject: [PATCH 1/2] [Example] Add units to MSL example. Recreates functionality from the old live demo --- example/msl/src/MSLDataDictionary.js | 18 +++++++++--------- example/msl/src/RemsTelemetryServerAdapter.js | 12 +++++++++++- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/example/msl/src/MSLDataDictionary.js b/example/msl/src/MSLDataDictionary.js index 9e04560d45..a8a271cf40 100644 --- a/example/msl/src/MSLDataDictionary.js +++ b/example/msl/src/MSLDataDictionary.js @@ -1,9 +1,9 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2017, United States Government + * 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 is licensed under the Apache License, Version 2.0 (the + * 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. @@ -14,7 +14,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Open MCT includes source code licensed under additional open source + * 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. @@ -44,31 +44,31 @@ define( { "name": "Min. Air Temperature", "identifier": "min_temp", - "units": "degrees", + "units": "Degrees (C)", "type": "float" }, { "name": "Max. Air Temperature", "identifier": "max_temp", - "units": "degrees", + "units": "Degrees (C)", "type": "float" }, { "name": "Atmospheric Pressure", "identifier": "pressure", - "units": "pascals", + "units": "Millibars", "type": "float" }, { "name": "Min. Ground Temperature", "identifier": "min_gts_temp", - "units": "degrees", + "units": "Degrees (C)", "type": "float" }, { "name": "Max. Ground Temperature", "identifier": "max_gts_temp", - "units": "degrees", + "units": "Degrees (C)", "type": "float" } ] @@ -76,4 +76,4 @@ define( ] }; } -); +); \ No newline at end of file diff --git a/example/msl/src/RemsTelemetryServerAdapter.js b/example/msl/src/RemsTelemetryServerAdapter.js index ea6a05ac27..6fd05c2289 100644 --- a/example/msl/src/RemsTelemetryServerAdapter.js +++ b/example/msl/src/RemsTelemetryServerAdapter.js @@ -48,6 +48,13 @@ define( this.$http = $http; this.$log = $log; this.promise = undefined; + + this.dataTransforms = { + //Convert from pascals to millibars + 'pressure': function pascalsToMillibars(pascals) { + return pascals / 100; + } + }; } /** @@ -65,6 +72,8 @@ define( var self = this, id = request.key; + var dataTransforms = this.dataTransforms; + function processResponse(response){ var data = []; /* @@ -75,13 +84,14 @@ define( * Check that valid data exists */ if (!isNaN(solData[id])) { + var dataTransform = dataTransforms[id]; /* * Append each data point to the array of values * for this data point property (min. temp, etc). */ data.unshift({ date: Date.parse(solData[TERRESTRIAL_DATE]), - value: solData[id] + value: dataTransform ? dataTransform(solData[id]) : solData[id] }); } }); From 9ff602a655f33ea5ab6fae01f4d79677f57bfba4 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 1 May 2017 13:07:32 -0700 Subject: [PATCH 2/2] [Example] Updated copyright statement in MSL data dictionary --- example/msl/src/MSLDataDictionary.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/msl/src/MSLDataDictionary.js b/example/msl/src/MSLDataDictionary.js index a8a271cf40..e6b6a08415 100644 --- a/example/msl/src/MSLDataDictionary.js +++ b/example/msl/src/MSLDataDictionary.js @@ -1,9 +1,9 @@ /***************************************************************************** - * Open MCT Web, Copyright (c) 2014-2015, United States Government + * Open MCT, Copyright (c) 2014-2017, 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 + * Open MCT 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. @@ -14,7 +14,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Open MCT Web includes source code licensed under additional open source + * Open MCT 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.