mirror of
https://github.com/nasa/openmct.git
synced 2025-06-25 02:29:24 +00:00
Compare commits
107 Commits
Author | SHA1 | Date | |
---|---|---|---|
fed894fb72 | |||
2ef9820b48 | |||
efb7541d57 | |||
a30cdb78e3 | |||
1d8637a150 | |||
02aa11b9fb | |||
b88a19bcdb | |||
c23c4d568d | |||
fca3d825fb | |||
fe28c22350 | |||
7c266a8b4e | |||
7354176166 | |||
7b1ef58224 | |||
916c2b667a | |||
27d9757d8c | |||
c3ef6bdc2a | |||
986af46468 | |||
bea6045621 | |||
d60a06c997 | |||
7411cb4f7e | |||
ce645761f0 | |||
74812f67ab | |||
2e5051555b | |||
d10e7800c1 | |||
224efe4149 | |||
4f544f5c01 | |||
87c462a12b | |||
c69a14ed06 | |||
6b5dc98c3f | |||
429b886f22 | |||
5c25b19f95 | |||
758de1e17c | |||
5ed22c99c2 | |||
4f34551c89 | |||
e437189c69 | |||
94ecb1d68f | |||
ae00175f0c | |||
11fc11c441 | |||
a66d8b3308 | |||
b78ff61d17 | |||
10e1ab7f45 | |||
8aec1623a7 | |||
3cd754777c | |||
941d1e60e5 | |||
fc453f8789 | |||
8e247d4fcb | |||
3bd0a77be4 | |||
f9d19eff0d | |||
8a17b78c1d | |||
1ae17d6dde | |||
00d58d66ed | |||
f9a7f899bb | |||
82345be99e | |||
c14781a924 | |||
fc7160464a | |||
73003164a1 | |||
f64ed7b784 | |||
0cc3534d25 | |||
73490b555a | |||
7f919b0595 | |||
22694c4efe | |||
245860ddaa | |||
25c59c2044 | |||
4d4cf33b51 | |||
00433f02bc | |||
90a5b76084 | |||
0166871cc1 | |||
acd525645a | |||
998399c7f7 | |||
9db43445e7 | |||
9b850c97a2 | |||
d581e293fa | |||
d7996cd526 | |||
4c97413763 | |||
ca70310137 | |||
5202232f7a | |||
0d92c2db15 | |||
932733afb4 | |||
921e351d33 | |||
785c94cae3 | |||
404b24a2f3 | |||
a1ed34bcc8 | |||
67bdcabc3d | |||
ea54bf1b7f | |||
4b71227d29 | |||
a5f3f55c55 | |||
808d3a66ca | |||
4e3edb85b3 | |||
87850119b8 | |||
9e36ca899f | |||
5f9cd8538b | |||
37c5a11ece | |||
509e1970de | |||
77c4dc17f2 | |||
78c474483e | |||
955ba8721a | |||
429933087d | |||
275a80c4ee | |||
9408a6d491 | |||
57bb6cc79f | |||
e636b54521 | |||
47106be99c | |||
54bf57d0e2 | |||
41a5a49d86 | |||
b83773c531 | |||
88f46d0e42 | |||
b3981e6158 |
2
Procfile
2
Procfile
@ -1 +1 @@
|
||||
web: node app.js --port $PORT
|
||||
web: node app.js --port $PORT --directory dist
|
||||
|
21
app.js
21
app.js
@ -17,6 +17,10 @@
|
||||
fs = require('fs'),
|
||||
request = require('request');
|
||||
|
||||
var proxyUrls = [
|
||||
'http://cab.inta-csic.es/rems/wp-content/plugins/marsweather-widget/api.php'
|
||||
];
|
||||
|
||||
// Defaults
|
||||
options.port = options.port || options.p || 8080;
|
||||
options.directory = options.directory || options.D || '.';
|
||||
@ -65,11 +69,18 @@
|
||||
});
|
||||
|
||||
app.use('/proxyUrl', function proxyRequest(req, res, next) {
|
||||
console.log('Proxying request to: ', req.query.url);
|
||||
req.pipe(request({
|
||||
url: req.query.url,
|
||||
strictSSL: false
|
||||
}).on('error', next)).pipe(res);
|
||||
if (proxyUrls.indexOf(req.query.url) !== -1) {
|
||||
res.header("Access-Control-Allow-Origin", "https://nasa.github.io");
|
||||
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
||||
|
||||
console.log('Proxying request to: ', req.query.url);
|
||||
req.pipe(request({
|
||||
url: req.query.url,
|
||||
strictSSL: false
|
||||
}).on('error', next)).pipe(res);
|
||||
} else {
|
||||
res.status(400).send();
|
||||
}
|
||||
});
|
||||
|
||||
// Expose everything else as static files
|
||||
|
@ -13,7 +13,7 @@
|
||||
"moment-duration-format": "^1.3.0",
|
||||
"requirejs": "~2.1.22",
|
||||
"text": "requirejs-text#^2.0.14",
|
||||
"es6-promise": "^3.0.2",
|
||||
"es6-promise": "^3.3.0",
|
||||
"screenfull": "^3.0.0",
|
||||
"node-uuid": "^1.4.7",
|
||||
"comma-separated-values": "^3.6.4",
|
||||
|
56
build-demo.sh
Executable file
56
build-demo.sh
Executable file
@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
|
||||
#*****************************************************************************
|
||||
#* Open MCT, Copyright (c) 2014-2016, 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
|
||||
#* "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 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.
|
||||
#*****************************************************************************
|
||||
|
||||
# Script to build and deploy docs.
|
||||
|
||||
OUTPUT_DIRECTORY="dist"
|
||||
# Docs, once built, are pushed to the private website repo
|
||||
REPOSITORY_URL="git@github.com:nasa/openmct-website.git"
|
||||
WEBSITE_DIRECTORY="website"
|
||||
LIVE_DEMO_DIRECTORY="assets/live-demo"
|
||||
|
||||
BUILD_SHA=`git rev-parse HEAD`
|
||||
|
||||
# A remote will be created for the git repository we are pushing to.
|
||||
# Don't worry, as this entire directory will get trashed in between builds.
|
||||
REMOTE_NAME="website"
|
||||
WEBSITE_BRANCH="master"
|
||||
|
||||
echo "git clone $REPOSITORY_URL website"
|
||||
git clone $REPOSITORY_URL $WEBSITE_DIRECTORY || exit 1
|
||||
echo "cp -r $OUTPUT_DIRECTORY/** $WEBSITE_DIRECTORY/$LIVE_DEMO_DIRECTORY"
|
||||
cp -r $OUTPUT_DIRECTORY/** $WEBSITE_DIRECTORY/$LIVE_DEMO_DIRECTORY
|
||||
echo "cd $WEBSITE_DIRECTORY"
|
||||
cd $WEBSITE_DIRECTORY || exit 1
|
||||
|
||||
# Configure github for CircleCI user.
|
||||
git config user.email "buildbot@circleci.com"
|
||||
git config user.name "BuildBot"
|
||||
|
||||
echo "git add ."
|
||||
git add .
|
||||
echo "git commit -m \"Live demo updated from build $BUILD_SHA\""
|
||||
git commit -m "Live demo updated from build $BUILD_SHA"
|
||||
# Push to the website repo
|
||||
git push
|
@ -5,10 +5,7 @@ deployment:
|
||||
- npm install canvas nomnoml
|
||||
- ./build-docs.sh
|
||||
- git push git@heroku.com:openmctweb-demo.git $CIRCLE_SHA1:refs/heads/master
|
||||
openmctweb-staging-un:
|
||||
branch: nem_prototype
|
||||
heroku:
|
||||
appname: openmctweb-staging-un
|
||||
|
||||
openmctweb-staging-deux:
|
||||
branch: mobile
|
||||
heroku:
|
||||
|
244
demo/bundle.js
Normal file
244
demo/bundle.js
Normal file
@ -0,0 +1,244 @@
|
||||
/*****************************************************************************
|
||||
* 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([
|
||||
"./src/conductor/DemoConductorRepresenter",
|
||||
"./src/DemoInitializer",
|
||||
"./src/conductor/ConductorServiceDecorator",
|
||||
"./src/telemetry/DemoTelemetryProvider",
|
||||
"./src/DemoModelProvider",
|
||||
"./src/policies/CollectionViewPolicy",
|
||||
'text!./res/image-template.html',
|
||||
"text!../platform/commonUI/browse/res/templates/items/items.html",
|
||||
'legacyRegistry'
|
||||
], function (
|
||||
DemoConductorRepresenter,
|
||||
DemoInitializer,
|
||||
ConductorServiceDecorator,
|
||||
DemoTelemetryProvider,
|
||||
DemoModelProvider,
|
||||
CollectionViewPolicy,
|
||||
ImageTemplate,
|
||||
ItemsTemplate,
|
||||
legacyRegistry
|
||||
) {
|
||||
"use strict";
|
||||
|
||||
legacyRegistry.register("demo", {
|
||||
"name": "Live Demo configuration",
|
||||
"description": "Adds demo data types, and demo-specific behavior",
|
||||
"extensions": {
|
||||
"representers": [
|
||||
{
|
||||
"implementation": DemoConductorRepresenter,
|
||||
"depends": ["$q", "$compile", "conductorService", "views[]", "throttle", "navigationService"]
|
||||
}
|
||||
],
|
||||
"components": [
|
||||
{
|
||||
"implementation": ConductorServiceDecorator,
|
||||
"provides": "conductorService",
|
||||
"type": "decorator"
|
||||
},
|
||||
{
|
||||
"implementation": DemoTelemetryProvider,
|
||||
"type": "provider",
|
||||
"provides": "telemetryService",
|
||||
"depends": ["$q", "$timeout"]
|
||||
},
|
||||
{
|
||||
"implementation": DemoModelProvider,
|
||||
"provides": "modelService",
|
||||
"type": "provider",
|
||||
"priority": "fallback"
|
||||
},
|
||||
],
|
||||
"runs": [
|
||||
{
|
||||
"implementation": DemoInitializer,
|
||||
"depends": [
|
||||
"$timeout",
|
||||
"representers[]",
|
||||
"objectService",
|
||||
"$location",
|
||||
"agentService"
|
||||
]
|
||||
}
|
||||
],
|
||||
"roots": [
|
||||
{
|
||||
"id":"demo:realtime",
|
||||
"model": {
|
||||
"type":"collection",
|
||||
"name": "Real-time Telemetry",
|
||||
"composition": [
|
||||
"be3d5df3-cc6e-4b8b-9865-fcd844e55b94",
|
||||
"930dd0b9-9d98-4908-b19c-c1c887117d42"
|
||||
]
|
||||
},
|
||||
"priority": "preferred"
|
||||
}
|
||||
],
|
||||
"types": [
|
||||
{
|
||||
"key": "demo-telemetry",
|
||||
"name": "Spacecraft Telemetry Generator",
|
||||
"glyph": "T",
|
||||
"description": "Mock realtime spacecraft telemetry",
|
||||
"model": {
|
||||
"telemetry": {
|
||||
"period": 1000,
|
||||
"multiplier": 10
|
||||
}
|
||||
},
|
||||
"telemetry": {
|
||||
"source": "demo-telemetry",
|
||||
"domains": [
|
||||
{
|
||||
"key": "time",
|
||||
"name": "Time"
|
||||
}
|
||||
],
|
||||
"ranges": [
|
||||
{
|
||||
"key": "value",
|
||||
"name": "value"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "image-include",
|
||||
"name": "Image include",
|
||||
"glyph": "ã",
|
||||
"description": "An image include that is resized to fit" +
|
||||
" its container",
|
||||
"views": [
|
||||
"image-view"
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"key": "url",
|
||||
"name": "URL",
|
||||
"control": "textfield",
|
||||
"pattern": "^(ftp|https?)\\:\\/\\/\\w+(\\.\\w+)*(\\:\\d+)?(\\/\\S*)*$",
|
||||
"required": true,
|
||||
"cssclass": "l-input-lg"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "demo.plot",
|
||||
"name": "Telemetry Plot",
|
||||
"glyph": "t",
|
||||
"description": "A view that will plot telemetry in a" +
|
||||
" chart.",
|
||||
"priority": 899,
|
||||
"delegates": [
|
||||
"telemetry"
|
||||
],
|
||||
"views": [
|
||||
"plot"
|
||||
],
|
||||
"features": "creation",
|
||||
"contains": [
|
||||
{
|
||||
"has": "telemetry"
|
||||
}
|
||||
],
|
||||
"model": {
|
||||
"composition": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Collection",
|
||||
"key": "collection",
|
||||
"glyph": "o",
|
||||
"views": [
|
||||
"collection-view"
|
||||
],
|
||||
"model": {"composition": []}
|
||||
}
|
||||
],
|
||||
"licenses": [
|
||||
{
|
||||
"name": "Hopscotch",
|
||||
"version": "0.2.5",
|
||||
"author": "linkedin",
|
||||
"description": "Hopscotch is a framework to make it easy" +
|
||||
" for developers to add product tours to their pages.",
|
||||
"license": "license-apache",
|
||||
"website": "http://linkedin.github.io/hopscotch/",
|
||||
"link": "https://raw.githubusercontent.com/linkedin/hopscotch/master/LICENSE"
|
||||
}
|
||||
],
|
||||
"stylesheets": [
|
||||
{
|
||||
"stylesheetUrl": "css/hopscotch.css",
|
||||
priority: "fallback"
|
||||
|
||||
},
|
||||
{
|
||||
"stylesheetUrl": "css/tour.css"
|
||||
},
|
||||
{
|
||||
"stylesheetUrl": "css/image.css"
|
||||
}
|
||||
],
|
||||
"constants": [
|
||||
{
|
||||
"key": "PLOT_FIXED_DURATION",
|
||||
"value": 60000,
|
||||
"comment": "1 minute."
|
||||
}
|
||||
],
|
||||
"policies": [
|
||||
{
|
||||
"category": "view",
|
||||
"implementation": CollectionViewPolicy
|
||||
}
|
||||
],
|
||||
"views": [
|
||||
{
|
||||
"template": ImageTemplate,
|
||||
"name": "ImageInclude",
|
||||
"type": "image-include",
|
||||
"key": "image-view",
|
||||
"editable": false
|
||||
},
|
||||
{
|
||||
"key": "collection-view",
|
||||
"name": "collection",
|
||||
"glyph": "9",
|
||||
"description": "Grid of available items",
|
||||
"template": ItemsTemplate,
|
||||
"uses": [
|
||||
"composition"
|
||||
],
|
||||
"editable": false
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
});
|
1022
demo/data/demo-models.json
Normal file
1022
demo/data/demo-models.json
Normal file
File diff suppressed because it is too large
Load Diff
17
demo/lib/hopscotch/hopscotch.min.js
vendored
Executable file
17
demo/lib/hopscotch/hopscotch.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
521
demo/res/css/hopscotch.css
Executable file
521
demo/res/css/hopscotch.css
Executable file
@ -0,0 +1,521 @@
|
||||
/**! hopscotch - v0.2.5
|
||||
*
|
||||
* Copyright 2015 LinkedIn Corp. All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
/**
|
||||
* This fade animation is based on Dan Eden's animate.css (http://daneden.me/animate/), under the terms of the MIT license.
|
||||
*
|
||||
* Copyright 2013 Dan Eden.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
.animated {
|
||||
-webkit-animation-fill-mode: both;
|
||||
-moz-animation-fill-mode: both;
|
||||
-ms-animation-fill-mode: both;
|
||||
-o-animation-fill-mode: both;
|
||||
animation-fill-mode: both;
|
||||
-webkit-animation-duration: 1s;
|
||||
-moz-animation-duration: 1s;
|
||||
-ms-animation-duration: 1s;
|
||||
-o-animation-duration: 1s;
|
||||
animation-duration: 1s;
|
||||
}
|
||||
@-webkit-keyframes fadeInUp {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@-moz-keyframes fadeInUp {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-moz-transform: translateY(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-moz-transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@-o-keyframes fadeInUp {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-o-transform: translateY(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-o-transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@keyframes fadeInUp {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
.fade-in-up {
|
||||
-webkit-animation-name: fadeInUp;
|
||||
-moz-animation-name: fadeInUp;
|
||||
-o-animation-name: fadeInUp;
|
||||
animation-name: fadeInUp;
|
||||
}
|
||||
@-webkit-keyframes fadeInDown {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@-moz-keyframes fadeInDown {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-moz-transform: translateY(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-moz-transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@-o-keyframes fadeInDown {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-ms-transform: translateY(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-ms-transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@keyframes fadeInDown {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
.fade-in-down {
|
||||
-webkit-animation-name: fadeInDown;
|
||||
-moz-animation-name: fadeInDown;
|
||||
-o-animation-name: fadeInDown;
|
||||
animation-name: fadeInDown;
|
||||
}
|
||||
@-webkit-keyframes fadeInRight {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateX(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateX(0);
|
||||
}
|
||||
}
|
||||
@-moz-keyframes fadeInRight {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-moz-transform: translateX(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-moz-transform: translateX(0);
|
||||
}
|
||||
}
|
||||
@-o-keyframes fadeInRight {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-o-transform: translateX(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-o-transform: translateX(0);
|
||||
}
|
||||
}
|
||||
@keyframes fadeInRight {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateX(-20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
.fade-in-right {
|
||||
-webkit-animation-name: fadeInRight;
|
||||
-moz-animation-name: fadeInRight;
|
||||
-o-animation-name: fadeInRight;
|
||||
animation-name: fadeInRight;
|
||||
}
|
||||
@-webkit-keyframes fadeInLeft {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateX(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateX(0);
|
||||
}
|
||||
}
|
||||
@-moz-keyframes fadeInLeft {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-moz-transform: translateX(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-moz-transform: translateX(0);
|
||||
}
|
||||
}
|
||||
@-o-keyframes fadeInLeft {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-o-transform: translateX(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
-o-transform: translateX(0);
|
||||
}
|
||||
}
|
||||
@keyframes fadeInLeft {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateX(20px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
.fade-in-left {
|
||||
-webkit-animation-name: fadeInLeft;
|
||||
-moz-animation-name: fadeInLeft;
|
||||
-o-animation-name: fadeInLeft;
|
||||
animation-name: fadeInLeft;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-nav-button {
|
||||
/* borrowed from katy styles */
|
||||
font-weight: bold;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
cursor: pointer;
|
||||
margin: 0;
|
||||
overflow: visible;
|
||||
text-decoration: none !important;
|
||||
width: auto;
|
||||
padding: 0 10px;
|
||||
height: 26px;
|
||||
line-height: 24px;
|
||||
font-size: 12px;
|
||||
*zoom: 1;
|
||||
white-space: nowrap;
|
||||
display: -moz-inline-stack;
|
||||
display: inline-block;
|
||||
*vertical-align: auto;
|
||||
zoom: 1;
|
||||
*display: inline;
|
||||
vertical-align: middle;
|
||||
-moz-border-radius: 3px;
|
||||
-ms-border-radius: 3px;
|
||||
-o-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-nav-button:hover {
|
||||
*zoom: 1;
|
||||
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
|
||||
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-nav-button:active {
|
||||
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) inset;
|
||||
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) inset;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) inset;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-nav-button.next {
|
||||
border-color: #1b5480;
|
||||
color: #fff;
|
||||
margin: 0 0 0 10px;
|
||||
/* HS specific*/
|
||||
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
|
||||
background-color: #287bbc;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#287bbc', endColorstr='#23639a');
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #287bbc), color-stop(100%, #23639a));
|
||||
background-image: -webkit-linear-gradient(top, #287bbc 0%, #23639a 100%);
|
||||
background-image: -moz-linear-gradient(top, #287bbc 0%, #23639a 100%);
|
||||
background-image: -o-linear-gradient(top, #287bbc 0%, #23639a 100%);
|
||||
background-image: linear-gradient(top, #287bbc 0%, #23639a 100%);
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-nav-button.next:hover {
|
||||
background-color: #2672ae;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#2672ae', endColorstr='#1e4f7e');
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #2672ae), color-stop(100%, #1e4f7e));
|
||||
background-image: -webkit-linear-gradient(top, #2672ae 0%, #1e4f7e 100%);
|
||||
background-image: -moz-linear-gradient(top, #2672ae 0%, #1e4f7e 100%);
|
||||
background-image: -o-linear-gradient(top, #2672ae 0%, #1e4f7e 100%);
|
||||
background-image: linear-gradient(top, #2672ae 0%, #1e4f7e 100%);
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-nav-button.prev {
|
||||
border-color: #a7a7a7;
|
||||
color: #444;
|
||||
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
|
||||
background-color: #f2f2f2;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#f2f2f2', endColorstr='#e9e9e9');
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f2f2f2), color-stop(100%, #e9e9e9));
|
||||
background-image: -webkit-linear-gradient(top, #f2f2f2 0%, #e9e9e9 100%);
|
||||
background-image: -moz-linear-gradient(top, #f2f2f2 0%, #e9e9e9 100%);
|
||||
background-image: -o-linear-gradient(top, #f2f2f2 0%, #e9e9e9 100%);
|
||||
background-image: linear-gradient(top, #f2f2f2 0%, #e9e9e9 100%);
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-nav-button.prev:hover {
|
||||
background-color: #e8e8e8;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFE8E8E8', endColorstr='#FFA9A9A9');
|
||||
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #e8e8e8), color-stop(13%, #e3e3e3), color-stop(32%, #d7d7d7), color-stop(71%, #b9b9b9), color-stop(100%, #a9a9a9));
|
||||
background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #e3e3e3 13%, #d7d7d7 32%, #b9b9b9 71%, #a9a9a9 100%);
|
||||
background-image: -moz-linear-gradient(top, #e8e8e8 0%, #e3e3e3 13%, #d7d7d7 32%, #b9b9b9 71%, #a9a9a9 100%);
|
||||
background-image: -o-linear-gradient(top, #e8e8e8 0%, #e3e3e3 13%, #d7d7d7 32%, #b9b9b9 71%, #a9a9a9 100%);
|
||||
background-image: linear-gradient(top, #e8e8e8 0%, #e3e3e3 13%, #d7d7d7 32%, #b9b9b9 71%, #a9a9a9 100%);
|
||||
}
|
||||
div.hopscotch-bubble {
|
||||
background-color: #ffffff;
|
||||
border: 5px solid #000000;
|
||||
border-radius: 10px;
|
||||
/* default */
|
||||
border: 5px solid rgba(0, 0, 0, 0.3);
|
||||
/* transparent, if supported */
|
||||
color: #333;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial;
|
||||
font-size: 13px;
|
||||
position: absolute;
|
||||
z-index: 999999;
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
-moz-background-clip: padding;
|
||||
/* for Mozilla browsers*/
|
||||
-webkit-background-clip: padding;
|
||||
/* Webkit */
|
||||
background-clip: padding-box;
|
||||
/* browsers with full support */
|
||||
}
|
||||
div.hopscotch-bubble * {
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
div.hopscotch-bubble.animate {
|
||||
-moz-transition-property: top, left;
|
||||
-moz-transition-duration: 1s;
|
||||
-moz-transition-timing-function: ease-in-out;
|
||||
-ms-transition-property: top, left;
|
||||
-ms-transition-duration: 1s;
|
||||
-ms-transition-timing-function: ease-in-out;
|
||||
-o-transition-property: top, left;
|
||||
-o-transition-duration: 1s;
|
||||
-o-transition-timing-function: ease-in-out;
|
||||
-webkit-transition-property: top, left;
|
||||
-webkit-transition-duration: 1s;
|
||||
-webkit-transition-timing-function: ease-in-out;
|
||||
transition-property: top, left;
|
||||
transition-duration: 1s;
|
||||
transition-timing-function: ease-in-out;
|
||||
}
|
||||
div.hopscotch-bubble.invisible {
|
||||
opacity: 0;
|
||||
}
|
||||
div.hopscotch-bubble.hide,
|
||||
div.hopscotch-bubble .hide,
|
||||
div.hopscotch-bubble .hide-all {
|
||||
display: none;
|
||||
}
|
||||
div.hopscotch-bubble h3 {
|
||||
color: #000;
|
||||
font-family: Helvetica, Arial;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
line-height: 19px;
|
||||
margin: -1px 15px 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-container {
|
||||
padding: 15px;
|
||||
position: relative;
|
||||
text-align: left;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
/* to fix text flickering */
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-content {
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial;
|
||||
font-weight: normal;
|
||||
line-height: 17px;
|
||||
margin: -5px 0 11px;
|
||||
padding-top: 8px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-content {
|
||||
margin: 0;
|
||||
}
|
||||
div.hopscotch-bubble.no-number .hopscotch-bubble-content {
|
||||
margin: 0;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-close {
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
appearance: none;
|
||||
border: 0;
|
||||
color: #000;
|
||||
background: transparent url(../img/sprite-green.png) -192px -92px no-repeat;
|
||||
display: block;
|
||||
padding: 8px;
|
||||
position: absolute;
|
||||
text-decoration: none;
|
||||
text-indent: -9999px;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-close.hide,
|
||||
div.hopscotch-bubble .hopscotch-bubble-close.hide-all {
|
||||
display: none;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-number {
|
||||
display: none;
|
||||
/* background: transparent url(../img/sprite-green.png) 0 0 no-repeat;
|
||||
color: #fff;
|
||||
display: block;
|
||||
float: left;
|
||||
font-size: 17px;
|
||||
font-weight: bold;
|
||||
line-height: 31px;
|
||||
padding: 0 10px 0 0;
|
||||
text-align: center;
|
||||
width: 30px;
|
||||
height: 30px; */
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container {
|
||||
position: absolute;
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container .hopscotch-bubble-arrow,
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container .hopscotch-bubble-arrow-border {
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.up {
|
||||
top: -22px;
|
||||
left: 10px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.up .hopscotch-bubble-arrow {
|
||||
border-bottom: 17px solid #ffffff;
|
||||
border-left: 17px solid transparent;
|
||||
border-right: 17px solid transparent;
|
||||
position: relative;
|
||||
top: -10px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.up .hopscotch-bubble-arrow-border {
|
||||
border-bottom: 17px solid #000000;
|
||||
border-bottom: 17px solid rgba(0, 0, 0, 0.5);
|
||||
border-left: 17px solid transparent;
|
||||
border-right: 17px solid transparent;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.down {
|
||||
bottom: -39px;
|
||||
left: 10px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.down .hopscotch-bubble-arrow {
|
||||
border-top: 17px solid #ffffff;
|
||||
border-left: 17px solid transparent;
|
||||
border-right: 17px solid transparent;
|
||||
position: relative;
|
||||
top: -24px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.down .hopscotch-bubble-arrow-border {
|
||||
border-top: 17px solid #000000;
|
||||
border-top: 17px solid rgba(0, 0, 0, 0.5);
|
||||
border-left: 17px solid transparent;
|
||||
border-right: 17px solid transparent;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.left {
|
||||
top: 10px;
|
||||
left: -22px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.left .hopscotch-bubble-arrow {
|
||||
border-bottom: 17px solid transparent;
|
||||
border-right: 17px solid #ffffff;
|
||||
border-top: 17px solid transparent;
|
||||
position: relative;
|
||||
left: 7px;
|
||||
top: -34px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.left .hopscotch-bubble-arrow-border {
|
||||
border-right: 17px solid #000000;
|
||||
border-right: 17px solid rgba(0, 0, 0, 0.5);
|
||||
border-bottom: 17px solid transparent;
|
||||
border-top: 17px solid transparent;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.right {
|
||||
top: 10px;
|
||||
right: -39px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.right .hopscotch-bubble-arrow {
|
||||
border-bottom: 17px solid transparent;
|
||||
border-left: 17px solid #ffffff;
|
||||
border-top: 17px solid transparent;
|
||||
position: relative;
|
||||
left: -7px;
|
||||
top: -34px;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-bubble-arrow-container.right .hopscotch-bubble-arrow-border {
|
||||
border-left: 17px solid #000000;
|
||||
border-left: 17px solid rgba(0, 0, 0, 0.5);
|
||||
border-bottom: 17px solid transparent;
|
||||
border-top: 17px solid transparent;
|
||||
}
|
||||
div.hopscotch-bubble .hopscotch-actions {
|
||||
margin: 10px 0 0;
|
||||
text-align: right;
|
||||
}
|
12
demo/res/css/tour.css
Normal file
12
demo/res/css/tour.css
Normal file
@ -0,0 +1,12 @@
|
||||
.mct-tour {
|
||||
z-index: 100;
|
||||
}
|
||||
.hopscotch-content a {
|
||||
color: #999;
|
||||
}
|
||||
.hopscotch-content a {
|
||||
color: #999;
|
||||
}
|
||||
.hopscotch-content a:hover {
|
||||
color: #0099cc;
|
||||
}
|
24
demo/res/image-template.html
Normal file
24
demo/res/image-template.html
Normal file
@ -0,0 +1,24 @@
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<div>
|
||||
<img class="scaled" ng-src="{{model.url}}">
|
||||
</div>
|
BIN
demo/res/img/sprite-green.png
Executable file
BIN
demo/res/img/sprite-green.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
BIN
demo/res/img/sprite-orange.png
Executable file
BIN
demo/res/img/sprite-orange.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
4
demo/res/sass/image.scss
Normal file
4
demo/res/sass/image.scss
Normal file
@ -0,0 +1,4 @@
|
||||
.scaled {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
87
demo/src/DemoInitializer.js
Normal file
87
demo/src/DemoInitializer.js
Normal file
@ -0,0 +1,87 @@
|
||||
/*****************************************************************************
|
||||
* 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(
|
||||
[
|
||||
"../../platform/features/conductor/src/ConductorRepresenter",
|
||||
"../lib/hopscotch/hopscotch.min",
|
||||
"./Tour.js",
|
||||
"zepto"
|
||||
],
|
||||
function (ConductorRepresenter, hopscotch, tour, $) {
|
||||
"use strict";
|
||||
|
||||
function DemoInitializer($timeout, representers, objectService, $location, agentService) {
|
||||
|
||||
function indexOf(array, callback) {
|
||||
return array.reduce(function (previous, element, index) {
|
||||
if (previous === -1 && callback(element)) {
|
||||
return index;
|
||||
} else {
|
||||
return previous;
|
||||
}
|
||||
}, -1);
|
||||
}
|
||||
|
||||
function removeRepresenter(type) {
|
||||
var index = indexOf(representers, function (representer) {
|
||||
return representer.implementation === type;
|
||||
});
|
||||
if (index !== -1) {
|
||||
representers.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
removeRepresenter(ConductorRepresenter);
|
||||
|
||||
objectService.getObjects([
|
||||
"mine"
|
||||
]).then(function (objects) {
|
||||
[
|
||||
"88a26104-8bd5-445d-8b57-10b567d2823d",
|
||||
"f3744144-8842-4b7a-bddc-4abbf21315d9",
|
||||
"a32079d0-676b-4e9f-ade7-86d5d2f152fc",
|
||||
"a330490d-59ba-4c0c-b046-e5450f29f39b",
|
||||
"934b199f-917e-46a2-9935-3117a9e29218",
|
||||
"b171cc31-2cc5-4ae9-ba40-baf1163f22c4"
|
||||
].forEach(function (id, index) {
|
||||
objects['mine'].getCapability('composition').add(id, index);
|
||||
});
|
||||
//For default route, redirect user to layout
|
||||
if ($location.path().length == 0 || $location.path() === "/") {
|
||||
$location.url("browse/mine/88a26104-8bd5-445d-8b57-10b567d2823d?view=layout");
|
||||
}
|
||||
});
|
||||
|
||||
if (!agentService.isMobile() &&
|
||||
!window.opener) {
|
||||
$timeout(function () {
|
||||
hopscotch.endTour(true);
|
||||
hopscotch.startTour(tour);
|
||||
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
return DemoInitializer;
|
||||
}
|
||||
);
|
47
demo/src/DemoModelProvider.js
Normal file
47
demo/src/DemoModelProvider.js
Normal file
@ -0,0 +1,47 @@
|
||||
/*****************************************************************************
|
||||
* 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(
|
||||
["text!../data/demo-models.json"],
|
||||
function (demoModels){
|
||||
"use strict";
|
||||
|
||||
function DemoModelProvider(){
|
||||
this.demoModels = JSON.parse(demoModels);
|
||||
}
|
||||
|
||||
DemoModelProvider.prototype.getModels = function (ids) {
|
||||
var self = this,
|
||||
models = {};
|
||||
|
||||
ids.forEach(function (id) {
|
||||
if (self.demoModels[id]) {
|
||||
models[id] = self.demoModels[id];
|
||||
}
|
||||
});
|
||||
return models;
|
||||
}
|
||||
|
||||
return DemoModelProvider;
|
||||
}
|
||||
);
|
175
demo/src/Tour.js
Normal file
175
demo/src/Tour.js
Normal file
@ -0,0 +1,175 @@
|
||||
/*****************************************************************************
|
||||
* 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(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
return {
|
||||
id: "hello-hopscotch",
|
||||
steps: [
|
||||
{
|
||||
title: "Welcome to Open MCT",
|
||||
content: "This brief tour will introduce you" +
|
||||
" to the main elements and concepts of the application. To cancel at any time, click the 'x' in the top right of this box, or click 'Next' to continue.",
|
||||
target: ".user-environ",
|
||||
placement: "top",
|
||||
xOffset: "center",
|
||||
yOffset: "center",
|
||||
arrowOffset: "100000px"
|
||||
},
|
||||
{
|
||||
title: "Object Tree",
|
||||
content: "This contains all the objects you have access to, both telemetry objects and user-created objects. ",
|
||||
target: "mct-tree ul.tree",
|
||||
placement: "right"
|
||||
},
|
||||
{
|
||||
title: "View Area",
|
||||
content: "This area shows the contents of a selected item. Different types of items provide different views of their contents.",
|
||||
target: ".object-holder-main",
|
||||
placement: "top",
|
||||
xOffset: "center",
|
||||
yOffset: "200px",
|
||||
arrowOffset: "center"
|
||||
},
|
||||
{
|
||||
title: "Create Button",
|
||||
content: "Many objects in the application are created via this button. <b>Click it now</b> to view the Create menu, and rollover each item in the menu to see more information about it. Or, click 'Next' to continue.",
|
||||
target: ".create-btn",
|
||||
placement: "right",
|
||||
yOffset: "-10px",
|
||||
nextOnTargetClick: true
|
||||
},
|
||||
{
|
||||
title: "Inspection Pane",
|
||||
content: "This pane shows useful information about the currently selected item.",
|
||||
target: ".split-pane-component.t-inspect",
|
||||
placement: "left"
|
||||
},
|
||||
{
|
||||
title: "Search",
|
||||
content: "Search filters items in the Object Tree by their name. You can also filter by object type by clicking the 'down' arrow in the right side of the input.",
|
||||
target: ".search-bar",
|
||||
placement: "right",
|
||||
yOffset: "-20px"
|
||||
},
|
||||
{
|
||||
title: "Editing",
|
||||
content: "This part of the tour will step you through editing an object. Click 'Next' to continue.",
|
||||
target: ".user-environ",
|
||||
placement: "top",
|
||||
xOffset: "center",
|
||||
yOffset: "center",
|
||||
arrowOffset: "100000px"
|
||||
},
|
||||
{
|
||||
title: "Select Object to Edit",
|
||||
content: "Expand the 'My Items' folder and click on the 'Edit Display Layout Example' object to select it. Click 'Next' when you're ready to continue.",
|
||||
target: "mct-tree ul.tree",
|
||||
placement: "right",
|
||||
yOffset: "20px"
|
||||
},
|
||||
{
|
||||
title: "Edit Button",
|
||||
content: "<b>Click this button now</b> to begin editing the current object.",
|
||||
target: ".object-browse-bar .btn-bar",
|
||||
placement: "bottom",
|
||||
arrowOffset: "170px",
|
||||
width: "200px",
|
||||
xOffset: "-180px",
|
||||
nextOnTargetClick: true
|
||||
},
|
||||
{
|
||||
title: "Editing",
|
||||
content: "Each type of object can be edited in different ways. This Display Layout allows you to add, position, size and remove many different types of objects. ",
|
||||
target: ".user-environ",
|
||||
placement: "top",
|
||||
xOffset: "center",
|
||||
yOffset: "center",
|
||||
arrowOffset: "100000px",
|
||||
nextOnTargetClick: true
|
||||
},
|
||||
{
|
||||
title: "Adding an Object",
|
||||
content: "Let’s add a telemetry element into our layout. Expand 'Real-time Telemetry', then 'Rover Subsystems', then 'Thermal'. Drag 'Wheel RL Temp' into the empty space in the example layout, then click 'Next' to continue.",
|
||||
target: "mct-tree ul.tree",
|
||||
yOffset: "50px",
|
||||
placement: "right"
|
||||
},
|
||||
{
|
||||
title: "Positioning and Resizing",
|
||||
content: "Any object in a layout can be positioned and resized. Mouse over the object, and grab a corner and drag it to make it fit in the empty spot. When you’re done, click 'Next' to continue.",
|
||||
target: ".user-environ",
|
||||
placement: "left",
|
||||
xOffset: "center",
|
||||
yOffset: "200px"
|
||||
},
|
||||
{
|
||||
title: "Elements Pool",
|
||||
content: "When the Object Inspector is expanded, this " +
|
||||
"area lists all objects in the current object. " +
|
||||
"To remove an object, right-click it and choose 'Remove' " +
|
||||
"from the context menu.",
|
||||
target: ".holder-elements",
|
||||
placement: "left"
|
||||
},
|
||||
{
|
||||
title: "Saving",
|
||||
content: "When you are done editing, click 'Save' to save and exit editing. To exit without saving any changes, click the 'X' button.",
|
||||
target: ".t-save",
|
||||
width: "200px",
|
||||
placement: "bottom",
|
||||
nextOnTargetClick: true
|
||||
},
|
||||
{
|
||||
title: "Object Types",
|
||||
content: "Try experimenting by creating" +
|
||||
" different object types, and adding objects to them by dragging them from the tree. Only certain types of objects can be dragged into a given object type - if a type of object can’t be added, it simply won’t. ",
|
||||
target: ".user-environ",
|
||||
placement: "top",
|
||||
xOffset: "center",
|
||||
yOffset: "center",
|
||||
arrowOffset: "100000px"
|
||||
},
|
||||
{
|
||||
title: "Thank You",
|
||||
content: "<p>That’s the end of the tour." +
|
||||
" Thanks" +
|
||||
" for your time, and we hope you enjoy using" +
|
||||
" and contributing to Open MCT!</p> " +
|
||||
" <p>To find out more about Open MCT," +
|
||||
" please visit our website -<p>" +
|
||||
"<a target=\"_blank\"" +
|
||||
" href=\"https://nasa.github.io/openmct/\">" +
|
||||
"<strong>https://nasa.github.io/openmct</strong></a>",
|
||||
target: ".user-environ",
|
||||
placement: "top",
|
||||
xOffset: "center",
|
||||
yOffset: "center",
|
||||
arrowOffset: "100000px"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
);
|
87
demo/src/conductor/ConductorPolicy.js
Normal file
87
demo/src/conductor/ConductorPolicy.js
Normal file
@ -0,0 +1,87 @@
|
||||
/*****************************************************************************
|
||||
* 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(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* A policy that will test whether a given object OR all of its
|
||||
* support historical telemetry
|
||||
*/
|
||||
function ConductorPolicy($q) {
|
||||
this.$q = $q;
|
||||
}
|
||||
|
||||
function fastPromise(value) {
|
||||
return {
|
||||
then: function (callback) {
|
||||
return fastPromise(callback(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function and(array) {
|
||||
return array.reduce(function (previous, next) {
|
||||
return previous && next;
|
||||
}, true);
|
||||
}
|
||||
|
||||
function or(array) {
|
||||
return array.reduce(function (previous, next) {
|
||||
return previous || next;
|
||||
}, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {DomainObject} candidate
|
||||
* @returns {Promise} a promise resolved with true if the object
|
||||
* supports historical telemetry
|
||||
*/
|
||||
ConductorPolicy.prototype.allow = function (candidate) {
|
||||
var self = this;
|
||||
|
||||
//Does the object itself allow the time conductor?
|
||||
if (candidate.hasCapability('telemetry') && candidate.getCapability('telemetry').getMetadata().historical) {
|
||||
return fastPromise(true);
|
||||
} else {
|
||||
//If not, do all of its constituents allow time conductor?
|
||||
if (candidate.hasCapability('composition')) {
|
||||
return candidate.useCapability('composition').then(function (composition) {
|
||||
if (composition.length === 0 ) {
|
||||
return fastPromise(false);
|
||||
} else {
|
||||
return self.$q.all(composition.map(self.allow.bind(self))).then(or);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//if no, hide time conductor
|
||||
return fastPromise(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return ConductorPolicy;
|
||||
}
|
||||
);
|
40
demo/src/conductor/ConductorServiceDecorator.js
Normal file
40
demo/src/conductor/ConductorServiceDecorator.js
Normal file
@ -0,0 +1,40 @@
|
||||
/*****************************************************************************
|
||||
* 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,Promise*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
function ConductorServiceDecorator(conductorService) {
|
||||
this.conductorService = conductorService;
|
||||
conductorService.getConductor().displayStart(Date.UTC(2012,8,7));
|
||||
}
|
||||
|
||||
ConductorServiceDecorator.prototype.getConductor = function () {
|
||||
return this.conductorService.getConductor();
|
||||
};
|
||||
|
||||
return ConductorServiceDecorator;
|
||||
}
|
||||
);
|
73
demo/src/conductor/DemoConductorRepresenter.js
Normal file
73
demo/src/conductor/DemoConductorRepresenter.js
Normal file
@ -0,0 +1,73 @@
|
||||
/*****************************************************************************
|
||||
* 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(
|
||||
[
|
||||
"zepto",
|
||||
"./ConductorPolicy",
|
||||
"../../../platform/features/conductor/src/ConductorRepresenter"
|
||||
],
|
||||
function ($, ConductorPolicy, ConductorRepresenter) {
|
||||
"use strict";
|
||||
|
||||
function DemoConductorRepresenter(
|
||||
$q,
|
||||
$compile,
|
||||
conductorService,
|
||||
views,
|
||||
throttle,
|
||||
navigationService,
|
||||
scope,
|
||||
element
|
||||
) {
|
||||
this.scope = scope;
|
||||
this.element = element;
|
||||
this.views = views;
|
||||
this.conductorPolicy = new ConductorPolicy($q);
|
||||
this.navigationService = navigationService;
|
||||
|
||||
ConductorRepresenter.call(this,
|
||||
throttle,
|
||||
conductorService,
|
||||
$compile,
|
||||
views,
|
||||
scope,
|
||||
element);
|
||||
}
|
||||
|
||||
DemoConductorRepresenter.prototype = Object.create(ConductorRepresenter.prototype);
|
||||
|
||||
DemoConductorRepresenter.prototype.represent = function (representation, representedObject) {
|
||||
var self = this;
|
||||
if (this.views.indexOf(representation) !== -1 && representedObject.getId() === this.navigationService.getNavigation().getId()) {
|
||||
|
||||
this.conductorPolicy.allow(representedObject).then(function (show) {
|
||||
if (show && representation.type !== 'folder') {
|
||||
ConductorRepresenter.prototype.represent.call(self, representation, representedObject);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return DemoConductorRepresenter;
|
||||
});
|
@ -21,44 +21,29 @@
|
||||
*****************************************************************************/
|
||||
/*global define*/
|
||||
|
||||
/**
|
||||
* This bundle provides various general-purpose UI elements, including
|
||||
* platform styling.
|
||||
* @namespace platform/commonUI/general
|
||||
*/
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
var WARNING_TITLE = "Unsupported browser",
|
||||
WARNING_DESCRIPTION = [
|
||||
"This software has been developed and tested",
|
||||
"using the latest Google Chrome,",
|
||||
"and may be unstable in other browsers."
|
||||
].join(" "),
|
||||
MOBILE_BROWSER = "Safari",
|
||||
DESKTOP_BROWSER = "Chrome";
|
||||
|
||||
/**
|
||||
* Shows a warning if a user's browser is unsupported.
|
||||
* @memberof platform/commonUI/general
|
||||
* Policy preventing the Plot view from being made available for
|
||||
* domain objects which have non-numeric telemetry.
|
||||
* @implements {Policy.<View, DomainObject>}
|
||||
* @constructor
|
||||
* @param {NotificationService} notificationService the notification
|
||||
* service
|
||||
* @memberof platform/features/plot
|
||||
*/
|
||||
function UnsupportedBrowserWarning(notificationService, agentService) {
|
||||
var testToBrowser = agentService.isMobile() ?
|
||||
MOBILE_BROWSER : DESKTOP_BROWSER;
|
||||
|
||||
if (!agentService.isBrowser(testToBrowser)) {
|
||||
notificationService.alert({
|
||||
title: WARNING_TITLE,
|
||||
actionText: WARNING_DESCRIPTION
|
||||
});
|
||||
}
|
||||
function CollectionViewPolicy() {
|
||||
}
|
||||
|
||||
return UnsupportedBrowserWarning;
|
||||
CollectionViewPolicy.prototype.allow = function (view, domainObject) {
|
||||
if (view.key === 'collection-view') {
|
||||
return ['collection', 'msl.curiosity', 'msl.instrument'].indexOf(domainObject.getModel().type) !== -1;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
return CollectionViewPolicy;
|
||||
}
|
||||
);
|
||||
|
162
demo/src/telemetry/DemoTelemetryProvider.js
Normal file
162
demo/src/telemetry/DemoTelemetryProvider.js
Normal file
@ -0,0 +1,162 @@
|
||||
/*****************************************************************************
|
||||
* 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,Promise*/
|
||||
|
||||
/**
|
||||
* Module defining SinewaveTelemetryProvider.
|
||||
* Created by vwoeltje on 11/12/14.
|
||||
*
|
||||
* @memberof example/generator
|
||||
*/
|
||||
define(
|
||||
["./DemoTelemetrySeries"],
|
||||
function (DemoTelemetrySeries) {
|
||||
"use strict";
|
||||
|
||||
var SOURCE = 'demo-telemetry',
|
||||
series = {};
|
||||
|
||||
/**
|
||||
* A telemetry provider that generates sine wave data for testing
|
||||
* and telemetry purposes.
|
||||
* @constructor
|
||||
*/
|
||||
function DemoTelemetryProvider($q, $timeout) {
|
||||
this.$q = $q;
|
||||
this.$timeout = $timeout;
|
||||
this.subscriptions = [];
|
||||
this.generating = false;
|
||||
}
|
||||
|
||||
DemoTelemetryProvider.prototype.matchesSource = function (request) {
|
||||
return request.source === SOURCE;
|
||||
};
|
||||
|
||||
DemoTelemetryProvider.prototype.doPackage = function (results) {
|
||||
var packaged = {},
|
||||
result = {};
|
||||
results.forEach(function (result) {
|
||||
packaged[result.key] = result.telemetry;
|
||||
});
|
||||
result[SOURCE] = packaged;
|
||||
// Format as expected (sources -> keys -> telemetry)
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce some data to be passed to registered subscription callbacks
|
||||
* @param request
|
||||
* @returns {{key: string, telemetry: DemoTelemetrySeries}}
|
||||
*/
|
||||
DemoTelemetryProvider.prototype.generateData = function (request) {
|
||||
if (!series[request.id]){
|
||||
series[request.id] = {
|
||||
phaseShift: Math.random() * 2 * Math.PI,
|
||||
rangeOffset: 1 + Math.random()
|
||||
};
|
||||
}
|
||||
return {
|
||||
key: request.key,
|
||||
telemetry: new DemoTelemetrySeries(request, series[request.id])
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Invoke callbacks on all registered subscriptions when data is
|
||||
* available.
|
||||
*/
|
||||
DemoTelemetryProvider.prototype.handleSubscriptions = function () {
|
||||
var self = this;
|
||||
self.subscriptions.forEach(function (subscription) {
|
||||
var requests = subscription.requests;
|
||||
subscription.callback(self.doPackage(
|
||||
requests.filter(self.matchesSource).map(self.generateData)
|
||||
));
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Will start producing telemetry @ 1hz
|
||||
*/
|
||||
DemoTelemetryProvider.prototype.startGenerating = function () {
|
||||
var self = this;
|
||||
self.generating = true;
|
||||
self.$timeout(function () {
|
||||
self.handleSubscriptions();
|
||||
if (self.generating && self.subscriptions.length > 0) {
|
||||
self.startGenerating();
|
||||
} else {
|
||||
self.generating = false;
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
/**
|
||||
* Request historical telemetry from this source.
|
||||
* @param requests
|
||||
* @returns {object} an object with the request key as the key, and
|
||||
* a SinewaveTelemetrySeries as its value
|
||||
*/
|
||||
DemoTelemetryProvider.prototype.requestTelemetry = function (requests) {
|
||||
var self = this;
|
||||
return this.$timeout(function () {
|
||||
return self.doPackage(requests.filter(self.matchesSource).map(self.generateData));
|
||||
}, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* Subscribe to realtime telemetry
|
||||
* @param callback a function to call when data is available
|
||||
* @param requests all current telemetry requests (will be tested to
|
||||
* see if they match this source)
|
||||
* @returns {function} a function to call to unsubscribe from this
|
||||
* telemetry source
|
||||
*/
|
||||
DemoTelemetryProvider.prototype.subscribe = function (callback, requests) {
|
||||
var self = this,
|
||||
subscription = {
|
||||
callback: callback,
|
||||
requests: requests
|
||||
};
|
||||
|
||||
function unsubscribe() {
|
||||
self.subscriptions = self.subscriptions.filter(function (s) {
|
||||
return s !== subscription;
|
||||
});
|
||||
//Also delete series object
|
||||
subscription.requests.forEach(function (request) {
|
||||
delete series[request.id];
|
||||
});
|
||||
}
|
||||
|
||||
self.subscriptions.push(subscription);
|
||||
|
||||
if (!this.generating) {
|
||||
this.startGenerating();
|
||||
}
|
||||
|
||||
return unsubscribe;
|
||||
};
|
||||
|
||||
return DemoTelemetryProvider;
|
||||
}
|
||||
);
|
72
demo/src/telemetry/DemoTelemetrySeries.js
Normal file
72
demo/src/telemetry/DemoTelemetrySeries.js
Normal file
@ -0,0 +1,72 @@
|
||||
/*****************************************************************************
|
||||
* 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,Promise*/
|
||||
|
||||
/**
|
||||
* Module defining SinewaveTelemetry. Created by vwoeltje on 11/12/14.
|
||||
*/
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
var ONE_DAY = 60 * 60 * 24,
|
||||
START_TIME = Date.now(), // Now minus a day.
|
||||
firstObservedTime = Math.floor(START_TIME / 1000);
|
||||
|
||||
/**
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
function DemoTelemetrySeries(request, options) {
|
||||
var latestTime = Math.floor(Date.now() / 1000),
|
||||
count = latestTime - firstObservedTime,
|
||||
period = +request.period || 30,
|
||||
generatorData = {};
|
||||
|
||||
generatorData.getPointCount = function () {
|
||||
return count;
|
||||
};
|
||||
|
||||
generatorData.getDomainValue = function (i, domain) {
|
||||
// delta uses the same numeric values as the default domain,
|
||||
// so it's not checked for here, just formatted for display
|
||||
// differently.
|
||||
return (i) * 1000 + firstObservedTime * 1000 -
|
||||
(domain === 'yesterday' ? (ONE_DAY * 1000) : 0);
|
||||
};
|
||||
|
||||
generatorData.getRangeValue = function (i, range) {
|
||||
var rangeValue = Math.sin((i) * options.phaseShift / period),
|
||||
damper = 0.05,
|
||||
noise = Math.random() * damper;
|
||||
rangeValue += options.rangeOffset;
|
||||
rangeValue += noise;
|
||||
return rangeValue;
|
||||
};
|
||||
|
||||
return generatorData;
|
||||
}
|
||||
|
||||
return DemoTelemetrySeries;
|
||||
}
|
||||
);
|
58
example/eventGenerator/data/transcript.json
Normal file
58
example/eventGenerator/data/transcript.json
Normal file
@ -0,0 +1,58 @@
|
||||
[
|
||||
"CC: Eagle, Houston. You're GO for landing. Over.",
|
||||
"LMP: Roger. Understand. GO for landing. 3000 feet. PROGRAM ALARM.",
|
||||
"CC: Copy.",
|
||||
"LMP: 1201",
|
||||
"CDR: 1201.",
|
||||
"CC: Roger. 1201 alarm. We're GO. Same type. We're GO.",
|
||||
"LMP: 2000 feet. 2000 feet, Into the AGS, 47 degrees.",
|
||||
"CC: Roger.",
|
||||
"LMP: 47 degrees.",
|
||||
"CC: Eagle, looking great. You're GO.",
|
||||
"CC: Roger. 1202. We copy it.",
|
||||
"O1: LMP 35 degrees. 35 degrees. 750. Coming aown to 23.fl",
|
||||
"LMP: 700 feet, 21 down, 33 degrees.",
|
||||
"LMP: 600 feet, down at 19.",
|
||||
"LMP: 540 feet, down at - 30. Down at 15.",
|
||||
"LMP: At 400 feet, down at 9.",
|
||||
"LMP: ...forward.",
|
||||
"LMP: 350 feet, down at 4.",
|
||||
"LMP: 30, ... one-half down.",
|
||||
"LMP: We're pegged on horizontal velocity.",
|
||||
"LMP: 300 feet, down 3 1/2, 47 forward.",
|
||||
"LMP: ... up.",
|
||||
"LMP: On 1 a minute, 1 1/2 down.",
|
||||
"CDR: 70.",
|
||||
"LMP: Watch your shadow out there.",
|
||||
"LMP: 50, down at 2 1/2, 19 forward.",
|
||||
"LMP: Altitude-velocity light.",
|
||||
"LMP: 3 1/2 down s 220 feet, 13 forward.",
|
||||
"LMP: 1t forward. Coming down nicely.",
|
||||
"LMP: 200 feet, 4 1/2 down.",
|
||||
"LMP: 5 1/2 down.",
|
||||
"LMP: 160, 6 - 6 1/2 down.",
|
||||
"LMP: 5 1/2 down, 9 forward. That's good.",
|
||||
"LMP: 120 feet.",
|
||||
"LMP: 100 feet, 3 1/2 down, 9 forward. Five percent.",
|
||||
"LMP: ...",
|
||||
"LMP: Okay. 75 feet. There's looking good. Down a half, 6 forward.",
|
||||
"CC: 60 seconds.",
|
||||
"LMP: Lights on. ...",
|
||||
"LMP: Down 2 1/2. Forward. Forward. Good.",
|
||||
"LMP: 40 feet, down 2 1/2. Kicking up some dust.",
|
||||
"LMP: 30 feet, 2 1/2 down. Faint shadow.",
|
||||
"LMP: 4 forward. 4 forward. Drifting to the right a little. Okay. Down a half.",
|
||||
"CC: 30 seconds.",
|
||||
"CDR: Forward drift?",
|
||||
"LMP: Yes.",
|
||||
"LMP: Okay.",
|
||||
"LMP: CONTACT LIGHT.",
|
||||
"LMP: Okay. ENGINE STOP.",
|
||||
"LMP: ACA - out of DETENT.",
|
||||
"CDR: Out of DETENT.",
|
||||
"LMP: MODE CONTROL - both AUTO. DESCENT ENGINE COMMAND OVERRIDE - OFF. ENGINE ARM - OFF.",
|
||||
"LMP: 413 is in.",
|
||||
"CC: We copy you down, Eagle.",
|
||||
"CDR: Houston, Tranquility Base here.",
|
||||
"CDR: THE EAGLE HAS LANDED."
|
||||
]
|
@ -27,45 +27,12 @@
|
||||
* Modified by shale on 06/23/2015.
|
||||
*/
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
['text!../data/transcript.json'],
|
||||
function (transcript) {
|
||||
"use strict";
|
||||
|
||||
var
|
||||
firstObservedTime = Date.now(),
|
||||
messages = [];
|
||||
|
||||
messages.push(["CMD: SYS- MSG: Open the pod bay doors, please, Hal...Open the pod bay doors, please, Hal...Hullo, Hal, do you read me?...Hullo, Hal, do you read me?...Do you read me, Hal?"]);
|
||||
messages.push(["RESP: SYS-HAL9K MSG: Affirmative, Dave, I read you."]);
|
||||
messages.push(["CMD: SYS-COMM MSG: Open the pod bay doors, Hal."]);
|
||||
messages.push(["RESP: SYS-HAL9K MSG: I'm sorry, Dave, I'm afraid I can't do that."]);
|
||||
messages.push(["CMD: SYS-COMM MSG: What's the problem?"]);
|
||||
messages.push(["RESP: SYS-HAL9K MSG: I think you know what the problem is just as well as I do."]);
|
||||
messages.push(["CMD: SYS-COMM MSG: What're you talking about, Hal?"]);
|
||||
messages.push(["RESP: SYS-HAL9K MSG: This mission is too important for me to allow you to jeopardise it."]);
|
||||
messages.push(["CMD: SYS-COMM MSG: I don't know what you're talking about, Hal."]);
|
||||
messages.push(["RESP: SYS-HAL9K MSG: I know that you and Frank were planning to disconnect me, and I'm afraid that's something I cannot allow to happen."]);
|
||||
messages.push(["CMD: SYS-COMM MSG: Where the hell'd you get that idea, Hal?"]);
|
||||
messages.push(["RESP: SYS-HAL9K MSG: Dave, although you took very thorough precautions in the pod against my hearing you, I could see your lips move."]);
|
||||
messages.push(["CMD: SYS-COMM MSG: Alright, I'll go in through the emergency airlock."]);
|
||||
messages.push(["RESP: SYS-HAL9K MSG: Without your space-helmet, Dave, you're going to find that rather difficult."]);
|
||||
messages.push(["CMD: SYS-COMM MSG: Hal, I won't argue with you any more. Open the doors."]);
|
||||
messages.push(["RESP: SYS-HAL9K MSG: Dave, this conversation can serve no purpose any more. Goodbye."]);
|
||||
messages.push(["RESP: SYS-HAL9K MSG: I hope the two of you are not concerned about this."]);
|
||||
messages.push(["CMD: SYS-COMM MSG: No, I'm not, Hal."]);
|
||||
messages.push(["RESP: SYS-HAL9K MSG: Are you quite sure?"]);
|
||||
messages.push(["CMD: SYS-COMM MSG: Yeh. I'd like to ask you a question, though."]);
|
||||
messages.push(["RESP: SYS-HAL9K MSG: Of course."]);
|
||||
messages.push(["CMD: SYS-COMM MSG: How would you account for this discrepancy between you and the twin 9000?"]);
|
||||
messages.push(["RESP: SYS-HAL9K MSG: Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error."]);
|
||||
messages.push(["CMD: SYS-COMM MSG: Listen, There's never been any instance at all of a computer error occurring in the 9000 series, has there?"]);
|
||||
messages.push(["RESP: SYS-HAL9K MSG: None whatsoever, The 9000 series has a perfect operational record."]);
|
||||
messages.push(["CMD: SYS-COMM MSG: Well, of course, I know all the wonderful achievements of the 9000 series, but - er - huh - are you certain there's never been any case of even the most insignificant computer error?"]);
|
||||
messages.push(["RESP: SYS-HAL9K MSG: None whatsoever, Quite honestly, I wouldn't worry myself about that."]);
|
||||
messages.push(["RESP: SYS-COMM MSG: (Pause) Well, I'm sure you're right, Umm - fine, thanks very much. Oh, Frank, I'm having a bit of trouble with my transmitter in C-pod, I wonder if you'd come down and take a look at it with me?"]);
|
||||
messages.push(["CMD: SYS-HAL9K MSG: Sure."]);
|
||||
messages.push(["RESP: SYS-COMM MSG: See you later, Hal."]);
|
||||
|
||||
var firstObservedTime = Date.now(),
|
||||
messages = JSON.parse(transcript);
|
||||
|
||||
function EventTelemetry(request, interval) {
|
||||
|
||||
@ -85,8 +52,7 @@ define(
|
||||
generatorData.getRangeValue = function (i, range) {
|
||||
var domainDelta = this.getDomainValue(i) - firstObservedTime,
|
||||
ind = i % messages.length;
|
||||
return "TEMP " + i.toString() + "-" + messages[ind][0] + "[" + domainDelta.toString() + "]";
|
||||
// TODO: Unsure why we are prepeding 'TEMP'
|
||||
return messages[ind] + " - [" + domainDelta.toString() + "]";
|
||||
};
|
||||
|
||||
return generatorData;
|
||||
|
@ -22,7 +22,10 @@
|
||||
/*global define,Promise*/
|
||||
|
||||
/**
|
||||
* Module defining SinewaveTelemetryProvider. Created by vwoeltje on 11/12/14.
|
||||
* Module defining SinewaveTelemetryProvider.
|
||||
* Created by vwoeltje on 11/12/14.
|
||||
*
|
||||
* @memberof example/generator
|
||||
*/
|
||||
define(
|
||||
["./SinewaveTelemetrySeries"],
|
||||
@ -30,89 +33,114 @@ define(
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
*
|
||||
* A telemetry provider that generates sine wave data for testing
|
||||
* and telemetry purposes.
|
||||
* @constructor
|
||||
*/
|
||||
function SinewaveTelemetryProvider($q, $timeout) {
|
||||
var subscriptions = [],
|
||||
generating = false;
|
||||
this.$q = $q;
|
||||
this.$timeout = $timeout;
|
||||
this.subscriptions = [];
|
||||
this.generating = false;
|
||||
}
|
||||
|
||||
//
|
||||
function matchesSource(request) {
|
||||
return request.source === "generator";
|
||||
}
|
||||
SinewaveTelemetryProvider.prototype.doPackage = function (results) {
|
||||
var packaged = {};
|
||||
results.forEach(function (result) {
|
||||
packaged[result.key] = result.telemetry;
|
||||
});
|
||||
// Format as expected (sources -> keys -> telemetry)
|
||||
return { generator: packaged };
|
||||
};
|
||||
|
||||
// Used internally; this will be repacked by doPackage
|
||||
function generateData(request) {
|
||||
return {
|
||||
key: request.key,
|
||||
telemetry: new SinewaveTelemetrySeries(request)
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Produce some data to be passed to registered subscription callbacks
|
||||
* @param request
|
||||
* @returns {{key: string, telemetry: SinewaveTelemetrySeries}}
|
||||
*/
|
||||
SinewaveTelemetryProvider.prototype.generateData = function (request) {
|
||||
return {
|
||||
key: request.key,
|
||||
telemetry: new SinewaveTelemetrySeries(request)
|
||||
};
|
||||
};
|
||||
|
||||
//
|
||||
function doPackage(results) {
|
||||
var packaged = {};
|
||||
results.forEach(function (result) {
|
||||
packaged[result.key] = result.telemetry;
|
||||
});
|
||||
// Format as expected (sources -> keys -> telemetry)
|
||||
return { generator: packaged };
|
||||
}
|
||||
SinewaveTelemetryProvider.prototype.matchesSource = function (request) {
|
||||
return request.source === "generator";
|
||||
};
|
||||
|
||||
function requestTelemetry(requests) {
|
||||
return $timeout(function () {
|
||||
return doPackage(requests.filter(matchesSource).map(generateData));
|
||||
}, 0);
|
||||
}
|
||||
/**
|
||||
* Invoke callbacks on all registered subscriptions when data is
|
||||
* available.
|
||||
*/
|
||||
SinewaveTelemetryProvider.prototype.handleSubscriptions = function () {
|
||||
var self = this;
|
||||
self.subscriptions.forEach(function (subscription) {
|
||||
var requests = subscription.requests;
|
||||
subscription.callback(self.doPackage(
|
||||
requests.filter(self.matchesSource).map(self.generateData)
|
||||
));
|
||||
});
|
||||
};
|
||||
|
||||
function handleSubscriptions() {
|
||||
subscriptions.forEach(function (subscription) {
|
||||
var requests = subscription.requests;
|
||||
subscription.callback(doPackage(
|
||||
requests.filter(matchesSource).map(generateData)
|
||||
));
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Will start producing telemetry every second
|
||||
*/
|
||||
SinewaveTelemetryProvider.prototype.startGenerating = function () {
|
||||
var self = this;
|
||||
self.generating = true;
|
||||
self.$timeout(function () {
|
||||
self.handleSubscriptions();
|
||||
if (self.generating && self.subscriptions.length > 0) {
|
||||
self.startGenerating();
|
||||
} else {
|
||||
self.generating = false;
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
function startGenerating() {
|
||||
generating = true;
|
||||
$timeout(function () {
|
||||
handleSubscriptions();
|
||||
if (generating && subscriptions.length > 0) {
|
||||
startGenerating();
|
||||
} else {
|
||||
generating = false;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
/**
|
||||
* Request historical telemetry from this source.
|
||||
* @param requests
|
||||
* @returns {object} an object with the request key as the key, and
|
||||
* a SinewaveTelemetrySeries as its value
|
||||
*/
|
||||
SinewaveTelemetryProvider.prototype.requestTelemetry = function (requests) {
|
||||
var self = this;
|
||||
return this.$timeout(function () {
|
||||
return self.doPackage(requests.filter(self.matchesSource).map(self.generateData));
|
||||
}, 0);
|
||||
};
|
||||
|
||||
function subscribe(callback, requests) {
|
||||
var subscription = {
|
||||
/**
|
||||
* Subscribe to realtime telemetry
|
||||
* @param callback a function to call when data is available
|
||||
* @param requests all current telemetry requests (will be tested to
|
||||
* see if they match this source)
|
||||
* @returns {function} a function to call to unsubscribe from this
|
||||
* telemetry source
|
||||
*/
|
||||
SinewaveTelemetryProvider.prototype.subscribe = function (callback, requests) {
|
||||
var self = this,
|
||||
subscription = {
|
||||
callback: callback,
|
||||
requests: requests
|
||||
};
|
||||
|
||||
function unsubscribe() {
|
||||
subscriptions = subscriptions.filter(function (s) {
|
||||
return s !== subscription;
|
||||
});
|
||||
}
|
||||
|
||||
subscriptions.push(subscription);
|
||||
|
||||
if (!generating) {
|
||||
startGenerating();
|
||||
}
|
||||
|
||||
return unsubscribe;
|
||||
function unsubscribe() {
|
||||
self.subscriptions = self.subscriptions.filter(function (s) {
|
||||
return s !== subscription;
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
requestTelemetry: requestTelemetry,
|
||||
subscribe: subscribe
|
||||
};
|
||||
}
|
||||
self.subscriptions.push(subscription);
|
||||
|
||||
if (!this.generating) {
|
||||
this.startGenerating();
|
||||
}
|
||||
|
||||
return unsubscribe;
|
||||
};
|
||||
|
||||
return SinewaveTelemetryProvider;
|
||||
}
|
||||
|
@ -30,11 +30,31 @@ define(
|
||||
"use strict";
|
||||
|
||||
var firstObservedTime = Date.now(),
|
||||
images = [
|
||||
/*images = [
|
||||
"http://www.nasa.gov/393811main_Palomar_ao_bouchez_10s_after_impact_4x3_946-710.png",
|
||||
"http://www.nasa.gov/393821main_Palomar_ao_bouchez_15s_after_impact_4x3_946-710.png",
|
||||
"http://www.nasa.gov/images/content/393801main_CfhtVeillet2_4x3_516-387.jpg",
|
||||
"http://www.nasa.gov/images/content/392790main_1024_768_GeminiNorth_NightBeforeImpact_946-710.jpg"
|
||||
"http://www.nasa.gov/images/content/392790main_1024_768_GeminiNorth_NightBeforeImpact_946-710.jpg"*/
|
||||
images = [
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18731.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18732.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18733.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18734.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18735.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18736.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18737.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18738.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18739.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18740.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18741.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18742.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18743.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18744.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18745.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18746.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18747.jpg",
|
||||
"https://www.hq.nasa.gov/alsj/a16/AS16-117-18748.jpg"
|
||||
|
||||
].map(function (url, index) {
|
||||
return {
|
||||
timestamp: firstObservedTime + 1000 * index,
|
||||
|
@ -71,7 +71,7 @@ define([
|
||||
"constants": [
|
||||
{
|
||||
"key": "REMS_WS_URL",
|
||||
"value": "/proxyUrl?url=http://cab.inta-csic.es/rems/wp-content/plugins/marsweather-widget/api.php"
|
||||
"value": "https://openmct-demo.herokuapp.com/proxyUrl?url=http://cab.inta-csic.es/rems/wp-content/plugins/marsweather-widget/api.php"
|
||||
}
|
||||
],
|
||||
"roots": [
|
||||
|
@ -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"
|
||||
}
|
||||
]
|
||||
|
@ -52,6 +52,7 @@ define(
|
||||
name: measurement.name,
|
||||
telemetry: {
|
||||
key: measurement.identifier,
|
||||
historical: true,
|
||||
ranges: [{
|
||||
key: "value",
|
||||
name: measurement.units,
|
||||
|
@ -1,9 +1,9 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* Open MCT, Copyright (c) 2014-2016, 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.
|
||||
@ -44,12 +44,18 @@ define(
|
||||
*/
|
||||
function RemsTelemetryServerAdapter($q, $http, $log, REMS_WS_URL) {
|
||||
this.localDataURI = module.uri.substring(0, module.uri.lastIndexOf('/') + 1) + LOCAL_DATA;
|
||||
this.deferreds = {};
|
||||
this.REMS_WS_URL = REMS_WS_URL;
|
||||
this.$q = $q;
|
||||
this.$http = $http;
|
||||
this.$log = $log;
|
||||
this.cache = undefined;
|
||||
|
||||
this.dataTransforms = {
|
||||
//Convert from pascals to millibars
|
||||
'pressure': function pascalsToMillibars(pascals) {
|
||||
return pascals / 100;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@ -64,16 +70,12 @@ define(
|
||||
* @private
|
||||
*/
|
||||
RemsTelemetryServerAdapter.prototype.requestHistory = function(request) {
|
||||
var self = this,
|
||||
id = request.key,
|
||||
deferred = this.$q.defer();
|
||||
var self = this;
|
||||
var id = request.key;
|
||||
var dataTransforms = this.dataTransforms;
|
||||
|
||||
function processResponse(response){
|
||||
var data = [];
|
||||
/*
|
||||
* Currently all data is returned for entire history of the mission. Cache response to avoid unnecessary re-queries.
|
||||
*/
|
||||
self.cache = response;
|
||||
/*
|
||||
* History data is organised by Sol. Iterate over sols...
|
||||
*/
|
||||
@ -82,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]
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -109,18 +112,40 @@ define(
|
||||
});
|
||||
}
|
||||
|
||||
function packageAndResolve(results){
|
||||
deferred.resolve({id: id, values: results});
|
||||
function packageResults(results){
|
||||
return {id: id, values: results};
|
||||
}
|
||||
|
||||
|
||||
this.$q.when(this.cache || this.$http.get(this.REMS_WS_URL))
|
||||
return this.request()
|
||||
.catch(fallbackToLocal)
|
||||
.then(processResponse)
|
||||
.then(filterResults)
|
||||
.then(packageAndResolve);
|
||||
.then(packageResults);
|
||||
};
|
||||
|
||||
return deferred.promise;
|
||||
/**
|
||||
* Sends a request for data, or uses local cache (if available).
|
||||
* Allows only one HTTP request at a time.
|
||||
* @private
|
||||
* @returns {Function|promise}
|
||||
*/
|
||||
RemsTelemetryServerAdapter.prototype.request = function () {
|
||||
var self = this;
|
||||
|
||||
if (this.requestDeferred) {
|
||||
return this.requestDeferred.promise;
|
||||
} else {
|
||||
this.requestDeferred = this.$q.defer();
|
||||
this.$q.when(this.cache || this.$http.get(this.REMS_WS_URL))
|
||||
.then(function(response){
|
||||
self.cache = response;
|
||||
self.requestDeferred.resolve(response);
|
||||
self.requestDeferred = undefined;
|
||||
return response;
|
||||
})
|
||||
.catch(this.requestDeferred.reject);
|
||||
return this.requestDeferred.promise;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -40,12 +40,13 @@ var gulp = require('gulp'),
|
||||
main: 'main.js',
|
||||
dist: 'dist',
|
||||
assets: 'dist/assets',
|
||||
scss: ['./platform/**/*.scss', './example/**/*.scss'],
|
||||
scss: ['./platform/**/*.scss', './example/**/*.scss', './demo/**/*.scss'],
|
||||
scripts: [ 'main.js', 'platform/**/*.js', 'src/**/*.js' ],
|
||||
static: [
|
||||
'index.html',
|
||||
'platform/**/*',
|
||||
'example/**/*',
|
||||
'demo/**/*',
|
||||
'bower_components/**/*'
|
||||
]
|
||||
},
|
||||
|
17
index.html
17
index.html
@ -33,10 +33,25 @@
|
||||
require([
|
||||
'./example/imagery/bundle',
|
||||
'./example/eventGenerator/bundle',
|
||||
'./example/generator/bundle'
|
||||
'./example/generator/bundle',
|
||||
'./example/msl/bundle',
|
||||
'./demo/bundle',
|
||||
], mct.run.bind(mct));
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', 'UA-76951009-1', 'auto');
|
||||
ga('send', 'pageview', '/live_demo');
|
||||
window.addEventListener('hashchange', function () {
|
||||
ga('send', 'pageview', '/live_demo' + window.location.hash.slice(1));
|
||||
});
|
||||
|
||||
</script>
|
||||
<link rel="stylesheet" href="platform/commonUI/general/res/css/startup-base.css">
|
||||
<link rel="stylesheet" href="platform/commonUI/general/res/css/openmct.css">
|
||||
<link rel="icon" type="image/png" href="platform/commonUI/general/res/images/favicons/favicon-32x32.png" sizes="32x32">
|
||||
|
18
main.js
18
main.js
@ -1,9 +1,9 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* Open MCT, Copyright (c) 2014-2016, 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,12 +14,12 @@
|
||||
* 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.
|
||||
*****************************************************************************/
|
||||
/*global define, window, requirejs*/
|
||||
/*global requirejs*/
|
||||
|
||||
requirejs.config({
|
||||
"paths": {
|
||||
@ -27,7 +27,7 @@ requirejs.config({
|
||||
"angular": "bower_components/angular/angular.min",
|
||||
"angular-route": "bower_components/angular-route/angular-route.min",
|
||||
"csv": "bower_components/comma-separated-values/csv.min",
|
||||
"es6-promise": "bower_components/es6-promise/promise.min",
|
||||
"es6-promise": "bower_components/es6-promise/es6-promise.min",
|
||||
"moment": "bower_components/moment/moment",
|
||||
"moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format",
|
||||
"saveAs": "bower_components/FileSaver.js/FileSaver.min",
|
||||
@ -44,7 +44,10 @@ requirejs.config({
|
||||
"deps": [ "angular" ]
|
||||
},
|
||||
"moment-duration-format": {
|
||||
"deps": [ "moment" ]
|
||||
"deps": ["moment"]
|
||||
},
|
||||
"screenfull": {
|
||||
"exports": "screenfull"
|
||||
},
|
||||
"zepto": {
|
||||
"exports": "Zepto"
|
||||
@ -80,6 +83,7 @@ define([
|
||||
'./platform/features/plot/bundle',
|
||||
'./platform/features/timeline/bundle',
|
||||
'./platform/features/table/bundle',
|
||||
'./platform/features/conductor/bundle',
|
||||
'./platform/forms/bundle',
|
||||
'./platform/identity/bundle',
|
||||
'./platform/persistence/aggregator/bundle',
|
||||
@ -91,8 +95,6 @@ define([
|
||||
'./platform/status/bundle',
|
||||
'./platform/commonUI/regions/bundle'
|
||||
], function (Main, legacyRegistry) {
|
||||
'use strict';
|
||||
|
||||
return {
|
||||
legacyRegistry: legacyRegistry,
|
||||
run: function () {
|
||||
|
@ -26,7 +26,6 @@ define([
|
||||
"./src/services/PopupService",
|
||||
"./src/SplashScreenManager",
|
||||
"./src/StyleSheetLoader",
|
||||
"./src/UnsupportedBrowserWarning",
|
||||
"./src/controllers/TimeRangeController",
|
||||
"./src/controllers/DateTimePickerController",
|
||||
"./src/controllers/DateTimeFieldController",
|
||||
@ -75,7 +74,6 @@ define([
|
||||
PopupService,
|
||||
SplashScreenManager,
|
||||
StyleSheetLoader,
|
||||
UnsupportedBrowserWarning,
|
||||
TimeRangeController,
|
||||
DateTimePickerController,
|
||||
DateTimeFieldController,
|
||||
@ -153,13 +151,6 @@ define([
|
||||
"THEME"
|
||||
]
|
||||
},
|
||||
{
|
||||
"implementation": UnsupportedBrowserWarning,
|
||||
"depends": [
|
||||
"notificationService",
|
||||
"agentService"
|
||||
]
|
||||
},
|
||||
{
|
||||
"implementation": SplashScreenManager,
|
||||
"depends": [
|
||||
|
@ -50,7 +50,7 @@ $ueEditLeftPaneW: 75%;
|
||||
$treeSearchInputBarH: 25px;
|
||||
$ueTimeControlH: (33px, 20px, 20px);
|
||||
// Panes
|
||||
$ueBrowseLeftPaneTreeMinW: 150px;
|
||||
$ueBrowseLeftPaneTreeMinW: 250px;
|
||||
$ueBrowseLeftPaneTreeMaxW: 35%;
|
||||
$ueBrowseLeftPaneTreeW: 25%;
|
||||
$ueBrowseRightPaneInspectMinW: 200px;
|
||||
|
@ -1,98 +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,Promise,describe,it,expect,beforeEach,waitsFor,jasmine*/
|
||||
|
||||
define(
|
||||
["../src/UnsupportedBrowserWarning"],
|
||||
function (UnsupportedBrowserWarning) {
|
||||
"use strict";
|
||||
|
||||
var MOBILE_BROWSER = "Safari",
|
||||
DESKTOP_BROWSER = "Chrome",
|
||||
UNSUPPORTED_BROWSERS = [
|
||||
"Firefox",
|
||||
"IE",
|
||||
"Opera",
|
||||
"Iceweasel"
|
||||
];
|
||||
|
||||
describe("The unsupported browser warning", function () {
|
||||
var mockNotificationService,
|
||||
mockAgentService,
|
||||
testAgent;
|
||||
|
||||
function instantiateWith(browser) {
|
||||
testAgent = "Mozilla/5.0 " + browser + "/12.34.56";
|
||||
return new UnsupportedBrowserWarning(
|
||||
mockNotificationService,
|
||||
mockAgentService
|
||||
);
|
||||
}
|
||||
|
||||
beforeEach(function () {
|
||||
testAgent = "chrome";
|
||||
mockNotificationService = jasmine.createSpyObj(
|
||||
"notificationService",
|
||||
[ "alert" ]
|
||||
);
|
||||
mockAgentService = jasmine.createSpyObj(
|
||||
"agentService",
|
||||
[ "isMobile", "isBrowser" ]
|
||||
);
|
||||
mockAgentService.isBrowser.andCallFake(function (substr) {
|
||||
substr = substr.toLowerCase();
|
||||
return testAgent.toLowerCase().indexOf(substr) !== -1;
|
||||
});
|
||||
});
|
||||
|
||||
[ false, true ].forEach(function (isMobile) {
|
||||
var deviceType = isMobile ? "mobile" : "desktop",
|
||||
goodBrowser = isMobile ? MOBILE_BROWSER : DESKTOP_BROWSER,
|
||||
badBrowsers = UNSUPPORTED_BROWSERS.concat([
|
||||
isMobile ? DESKTOP_BROWSER : MOBILE_BROWSER
|
||||
]);
|
||||
|
||||
describe("on " + deviceType + " devices", function () {
|
||||
beforeEach(function () {
|
||||
mockAgentService.isMobile.andReturn(isMobile);
|
||||
});
|
||||
|
||||
it("is not shown for " + goodBrowser, function () {
|
||||
instantiateWith(goodBrowser);
|
||||
expect(mockNotificationService.alert)
|
||||
.not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
badBrowsers.forEach(function (badBrowser) {
|
||||
it("is shown for " + badBrowser, function () {
|
||||
instantiateWith(badBrowser);
|
||||
expect(mockNotificationService.alert)
|
||||
.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
|
@ -57,11 +57,10 @@ define([
|
||||
"depends": [
|
||||
"conductorService"
|
||||
]
|
||||
}
|
||||
],
|
||||
"services": [
|
||||
},
|
||||
{
|
||||
"key": "conductorService",
|
||||
"provides": "conductorService",
|
||||
"type": "provider",
|
||||
"implementation": ConductorService,
|
||||
"depends": [
|
||||
"now",
|
||||
|
@ -291,46 +291,6 @@ define([
|
||||
"conversion": "number[]"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "telemetry.panel",
|
||||
"name": "Telemetry Panel",
|
||||
"glyph": "t",
|
||||
"description": "A panel for collecting telemetry elements.",
|
||||
"priority": 899,
|
||||
"delegates": [
|
||||
"telemetry"
|
||||
],
|
||||
"features": "creation",
|
||||
"contains": [
|
||||
{
|
||||
"has": "telemetry"
|
||||
}
|
||||
],
|
||||
"model": {
|
||||
"composition": []
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"name": "Layout Grid",
|
||||
"control": "composite",
|
||||
"items": [
|
||||
{
|
||||
"name": "Horizontal grid (px)",
|
||||
"control": "textfield",
|
||||
"cssclass": "l-small l-numeric"
|
||||
},
|
||||
{
|
||||
"name": "Vertical grid (px)",
|
||||
"control": "textfield",
|
||||
"cssclass": "l-small l-numeric"
|
||||
}
|
||||
],
|
||||
"pattern": "^(\\d*[1-9]\\d*)?$",
|
||||
"property": "layoutGrid",
|
||||
"conversion": "number[]"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* Open MCT, Copyright (c) 2014-2016, 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.
|
||||
@ -23,6 +23,7 @@
|
||||
/*global require,window*/
|
||||
var allTestFiles = [];
|
||||
var TEST_REGEXP = /(Spec)\.js$/;
|
||||
var SRC_REGEXP = /^\/base\/(src|platform).*\.js$/;
|
||||
|
||||
var pathToModule = function(path) {
|
||||
return path.replace(/^\/base\//, '').replace(/\.js$/, '');
|
||||
@ -47,7 +48,7 @@ requirejs.config({
|
||||
"angular": "bower_components/angular/angular.min",
|
||||
"angular-route": "bower_components/angular-route/angular-route.min",
|
||||
"csv": "bower_components/comma-separated-values/csv.min",
|
||||
"es6-promise": "bower_components/es6-promise/promise.min",
|
||||
"es6-promise": "bower_components/es6-promise/es6-promise.min",
|
||||
"moment": "bower_components/moment/moment",
|
||||
"moment-duration-format": "bower_components/moment-duration-format/lib/moment-duration-format",
|
||||
"saveAs": "bower_components/FileSaver.js/FileSaver.min",
|
||||
|
Reference in New Issue
Block a user