Compare commits
4 Commits
prepublish
...
new-tutori
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9553e0c64f | ||
|
|
da40f4c96e | ||
|
|
6fa5a31217 | ||
|
|
77d0134e2e |
11
index.html
11
index.html
@@ -25,8 +25,16 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
<title></title>
|
<title></title>
|
||||||
|
<script src="openmct-tutorial/lib/http.js">
|
||||||
|
</script>
|
||||||
<script src="bower_components/requirejs/require.js">
|
<script src="bower_components/requirejs/require.js">
|
||||||
</script>
|
</script>
|
||||||
|
<script src="openmct-tutorial/dictionary-plugin.js">
|
||||||
|
</script>
|
||||||
|
<script src="openmct-tutorial/realtime-telemetry-plugin.js">
|
||||||
|
</script>
|
||||||
|
<script src="openmct-tutorial/historical-telemetry-plugin.js">
|
||||||
|
</script>
|
||||||
<script>
|
<script>
|
||||||
require(['openmct'], function (openmct) {
|
require(['openmct'], function (openmct) {
|
||||||
[
|
[
|
||||||
@@ -40,6 +48,9 @@
|
|||||||
openmct.install(openmct.plugins.Espresso());
|
openmct.install(openmct.plugins.Espresso());
|
||||||
openmct.install(openmct.plugins.Generator());
|
openmct.install(openmct.plugins.Generator());
|
||||||
openmct.install(openmct.plugins.UTCTimeSystem());
|
openmct.install(openmct.plugins.UTCTimeSystem());
|
||||||
|
openmct.install(DictionaryPlugin());
|
||||||
|
openmct.install(RealtimeTelemetryPlugin());
|
||||||
|
openmct.install(HistoricalTelemetryPlugin());
|
||||||
openmct.start();
|
openmct.start();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
1
openmct-tutorial
Submodule
1
openmct-tutorial
Submodule
Submodule openmct-tutorial added at 7076a15d3a
@@ -5,7 +5,9 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"express": "^4.13.1",
|
"express": "^4.13.1",
|
||||||
"minimist": "^1.1.1",
|
"minimist": "^1.1.1",
|
||||||
"request": "^2.69.0",
|
"request": "^2.69.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
"bower": "^1.7.7",
|
"bower": "^1.7.7",
|
||||||
"git-rev-sync": "^1.4.0",
|
"git-rev-sync": "^1.4.0",
|
||||||
"glob": ">= 3.0.0",
|
"glob": ">= 3.0.0",
|
||||||
@@ -48,7 +50,7 @@
|
|||||||
"jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api",
|
"jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api",
|
||||||
"otherdoc": "node docs/gendocs.js --in docs/src --out dist/docs --suppress-toc 'docs/src/index.md|docs/src/process/index.md'",
|
"otherdoc": "node docs/gendocs.js --in docs/src --out dist/docs --suppress-toc 'docs/src/index.md|docs/src/process/index.md'",
|
||||||
"docs": "npm run jsdoc ; npm run otherdoc",
|
"docs": "npm run jsdoc ; npm run otherdoc",
|
||||||
"postinstall": "node ./node_modules/bower/bin/bower install && node ./node_modules/gulp/bin/gulp.js install"
|
"prepublish": "node ./node_modules/bower/bin/bower install && node ./node_modules/gulp/bin/gulp.js install"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
$output-bourbon-deprecation-warnings: false;
|
||||||
@import "bourbon";
|
@import "bourbon";
|
||||||
@import "logo-and-bg";
|
@import "logo-and-bg";
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
$output-bourbon-deprecation-warnings: false;
|
||||||
@import "bourbon";
|
@import "bourbon";
|
||||||
|
|
||||||
@import "../../../../general/res/sass/_mixins";
|
@import "../../../../general/res/sass/_mixins";
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
$output-bourbon-deprecation-warnings: false;
|
||||||
@import "bourbon";
|
@import "bourbon";
|
||||||
|
|
||||||
@import "../../../../general/res/sass/_mixins";
|
@import "../../../../general/res/sass/_mixins";
|
||||||
|
|||||||
@@ -21,11 +21,9 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
"./src/ConductorTelemetryDecorator",
|
|
||||||
"./src/ConductorRepresenter",
|
"./src/ConductorRepresenter",
|
||||||
'legacyRegistry'
|
'legacyRegistry'
|
||||||
], function (
|
], function (
|
||||||
ConductorTelemetryDecorator,
|
|
||||||
ConductorRepresenter,
|
ConductorRepresenter,
|
||||||
legacyRegistry
|
legacyRegistry
|
||||||
) {
|
) {
|
||||||
@@ -39,16 +37,6 @@ define([
|
|||||||
"openmct"
|
"openmct"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "decorator",
|
|
||||||
"provides": "telemetryService",
|
|
||||||
"implementation": ConductorTelemetryDecorator,
|
|
||||||
"depends": [
|
|
||||||
"openmct"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,87 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
|
||||||
* Administration. All rights reserved.
|
|
||||||
*
|
|
||||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
*
|
|
||||||
* Open MCT Web includes source code licensed under additional open source
|
|
||||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
|
||||||
* this source code distribution or the Licensing information page available
|
|
||||||
* at runtime from the About dialog for additional information.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
define(
|
|
||||||
function () {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Decorates the `telemetryService` such that requests are
|
|
||||||
* mediated by the time conductor. This is a modified version of the
|
|
||||||
* decorator used in the old TimeConductor that integrates with the
|
|
||||||
* new TimeConductor API.
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
* @memberof platform/features/conductor
|
|
||||||
* @implements {TelemetryService}
|
|
||||||
* @param {platform/features/conductor.TimeConductor} conductor
|
|
||||||
* the service which exposes the global time conductor
|
|
||||||
* @param {TelemetryService} telemetryService the decorated service
|
|
||||||
*/
|
|
||||||
function ConductorTelemetryDecorator(openmct, telemetryService) {
|
|
||||||
this.conductor = openmct.conductor;
|
|
||||||
this.telemetryService = telemetryService;
|
|
||||||
|
|
||||||
this.amendRequests = ConductorTelemetryDecorator.prototype.amendRequests.bind(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
function amendRequest(request, bounds, timeSystem) {
|
|
||||||
request = request || {};
|
|
||||||
request.start = bounds.start;
|
|
||||||
request.end = bounds.end;
|
|
||||||
request.domain = timeSystem.metadata.key;
|
|
||||||
|
|
||||||
return request;
|
|
||||||
}
|
|
||||||
|
|
||||||
ConductorTelemetryDecorator.prototype.amendRequests = function (requests) {
|
|
||||||
var bounds = this.conductor.bounds(),
|
|
||||||
timeSystem = this.conductor.timeSystem();
|
|
||||||
|
|
||||||
return (requests || []).map(function (request) {
|
|
||||||
return amendRequest(request, bounds, timeSystem);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
ConductorTelemetryDecorator.prototype.requestTelemetry = function (requests) {
|
|
||||||
return this.telemetryService
|
|
||||||
.requestTelemetry(this.amendRequests(requests));
|
|
||||||
};
|
|
||||||
|
|
||||||
ConductorTelemetryDecorator.prototype.subscribe = function (callback, requests) {
|
|
||||||
var unsubscribeFunc = this.telemetryService.subscribe(callback, this.amendRequests(requests)),
|
|
||||||
conductor = this.conductor,
|
|
||||||
self = this;
|
|
||||||
|
|
||||||
function amendRequests() {
|
|
||||||
return self.amendRequests(requests);
|
|
||||||
}
|
|
||||||
|
|
||||||
conductor.on('bounds', amendRequests);
|
|
||||||
return function () {
|
|
||||||
unsubscribeFunc();
|
|
||||||
conductor.off('bounds', amendRequests);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
return ConductorTelemetryDecorator;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
$output-bourbon-deprecation-warnings: false;
|
||||||
@import "bourbon";
|
@import "bourbon";
|
||||||
@import "../../../../../commonUI/general/res/sass/constants";
|
@import "../../../../../commonUI/general/res/sass/constants";
|
||||||
@import "../../../../../commonUI/general/res/sass/mixins";
|
@import "../../../../../commonUI/general/res/sass/mixins";
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
$output-bourbon-deprecation-warnings: false;
|
||||||
@import "bourbon";
|
@import "bourbon";
|
||||||
@import "../../../../../commonUI/general/res/sass/constants";
|
@import "../../../../../commonUI/general/res/sass/constants";
|
||||||
@import "../../../../../commonUI/general/res/sass/mixins";
|
@import "../../../../../commonUI/general/res/sass/mixins";
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
$output-bourbon-deprecation-warnings: false;
|
||||||
@import "bourbon";
|
@import "bourbon";
|
||||||
|
|
||||||
@import "../../../../commonUI/general/res/sass/constants";
|
@import "../../../../commonUI/general/res/sass/constants";
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
$output-bourbon-deprecation-warnings: false;
|
||||||
@import "bourbon";
|
@import "bourbon";
|
||||||
|
|
||||||
@import "../../../../commonUI/general/res/sass/constants";
|
@import "../../../../commonUI/general/res/sass/constants";
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
* this source code distribution or the Licensing information page available
|
* this source code distribution or the Licensing information page available
|
||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
$output-bourbon-deprecation-warnings: false;
|
||||||
@import "bourbon";
|
@import "bourbon";
|
||||||
|
|
||||||
@import "../../../../commonUI/general/res/sass/constants";
|
@import "../../../../commonUI/general/res/sass/constants";
|
||||||
|
|||||||
@@ -139,7 +139,8 @@ define(
|
|||||||
type = domainObject.getCapability("type"),
|
type = domainObject.getCapability("type"),
|
||||||
typeRequest = (type && type.getDefinition().telemetry) || {},
|
typeRequest = (type && type.getDefinition().telemetry) || {},
|
||||||
modelTelemetry = domainObject.getModel().telemetry,
|
modelTelemetry = domainObject.getModel().telemetry,
|
||||||
fullRequest = Object.create(typeRequest);
|
fullRequest = Object.create(typeRequest),
|
||||||
|
bounds;
|
||||||
|
|
||||||
// Add properties from the telemetry field of this
|
// Add properties from the telemetry field of this
|
||||||
// specific domain object.
|
// specific domain object.
|
||||||
@@ -160,6 +161,12 @@ define(
|
|||||||
fullRequest.key = domainObject.getId();
|
fullRequest.key = domainObject.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (request.start === undefined && request.end === undefined) {
|
||||||
|
bounds = this.openmct.conductor.bounds();
|
||||||
|
fullRequest.start = bounds.start;
|
||||||
|
fullRequest.end = bounds.end;
|
||||||
|
}
|
||||||
|
|
||||||
return fullRequest;
|
return fullRequest;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,15 @@ define(
|
|||||||
});
|
});
|
||||||
|
|
||||||
mockAPI = {
|
mockAPI = {
|
||||||
telemetry: mockTelemetryAPI
|
telemetry: mockTelemetryAPI,
|
||||||
|
conductor: {
|
||||||
|
bounds: function () {
|
||||||
|
return {
|
||||||
|
start: 0,
|
||||||
|
end: 1
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
telemetry = new TelemetryCapability(
|
telemetry = new TelemetryCapability(
|
||||||
@@ -150,7 +158,9 @@ define(
|
|||||||
expect(telemetry.getMetadata()).toEqual({
|
expect(telemetry.getMetadata()).toEqual({
|
||||||
id: "testId", // from domain object
|
id: "testId", // from domain object
|
||||||
source: "testSource",
|
source: "testSource",
|
||||||
key: "testKey"
|
key: "testKey",
|
||||||
|
start: 0,
|
||||||
|
end: 1
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -164,7 +174,9 @@ define(
|
|||||||
expect(telemetry.getMetadata()).toEqual({
|
expect(telemetry.getMetadata()).toEqual({
|
||||||
id: "testId", // from domain object
|
id: "testId", // from domain object
|
||||||
source: "testSource", // from model
|
source: "testSource", // from model
|
||||||
key: "testId" // from domain object
|
key: "testId", // from domain object
|
||||||
|
start: 0,
|
||||||
|
end: 1
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -243,7 +255,9 @@ define(
|
|||||||
[{
|
[{
|
||||||
id: "testId", // from domain object
|
id: "testId", // from domain object
|
||||||
source: "testSource",
|
source: "testSource",
|
||||||
key: "testKey"
|
key: "testKey",
|
||||||
|
start: 0,
|
||||||
|
end: 1
|
||||||
}]
|
}]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user