Compare commits

..

15 Commits

Author SHA1 Message Date
9553e0c64f Tutorial packages 2017-02-27 19:28:21 -08:00
da40f4c96e [Plot] Add current conductor bounds to telemetry requests via the old API. Replaces telemetry decorator. Fixes #1458 2017-02-27 19:26:51 -08:00
6fa5a31217 Merge pull request #1433 from nasa/open1432
[Build] Installed sound suppression system for Bourbon deprecation messages.
2017-02-27 11:12:27 -08:00
5bc7a701dc Merge pull request #1455 from nasa/api-conductor-config
[Conductor] Allow configuration of conductor defaults
2017-02-24 14:58:50 -08:00
5cd0516048 Enable TC by default and hide
Set up TC so that it is always enabled and defaults to realtime mode.

This allows us to have warp-like functionality without showing
the TC interface, and simplifies a lot of tutorials.  We can still
reconfigure the TC by re-installing the plugin with different settings
2017-02-24 14:56:18 -08:00
48a603ece8 Merge branch 'api-legacy-telemetry-provider-v2' 2017-02-24 14:47:10 -08:00
abfa56464a Merge branch 'plugins-functions' 2017-02-24 14:34:54 -08:00
c1d6e21c3c Added tests. Fixes #1364 2017-02-23 13:50:14 -08:00
3bd556a406 Fixed failing tests 2017-02-23 10:21:33 -08:00
347fb6d882 Fixed style errors 2017-02-23 10:19:10 -08:00
b3cf7a5d93 Added support for new style telemetry providers from old screens. Converted SWG to new style data adapter 2017-02-23 09:58:46 -08:00
c7cffdeb3b Merge pull request #1453 from nasa/restore-search-navigation
[Search] Allow navigation from results
2017-02-22 13:21:03 -08:00
d45ae7908d [Search] Allow navigation from results
Fix search item so that navigation occurs after clicking on
a search result, while still properly preventing navigation
when required.

Related to #1366
2017-02-22 13:08:54 -08:00
b10fb4533e All builtin plugins now standardized as functions 2017-02-22 12:51:49 -08:00
77d0134e2e [Build] Added Bourbon deprecation warning suppression system. 2017-02-10 10:03:05 -08:00
22 changed files with 96 additions and 143 deletions

View File

@ -74,7 +74,7 @@ define([
openmct.legacyExtension(type, extension)
})
});
openmct.types.register("generator", {
openmct.types.addType("generator", {
label: "Sine Wave Generator",
description: "For development use. Generates example streaming telemetry data using a simple sine wave algorithm.",
cssClass: "icon-telemetry",

View File

@ -25,28 +25,32 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title></title>
<script src="openmct-tutorial/lib/http.js">
</script>
<script src="bower_components/requirejs/require.js">
</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>
require(['openmct'], function (openmct, generatorPlugin) {
require(['openmct'], function (openmct) {
[
'example/imagery',
'example/eventGenerator'
].forEach(
openmct.legacyRegistry.enable.bind(openmct.legacyRegistry)
);
openmct.install(openmct.plugins.myItems);
openmct.install(openmct.plugins.localStorage);
openmct.install(openmct.plugins.espresso);
openmct.install(openmct.plugins.MyItems());
openmct.install(openmct.plugins.LocalStorage());
openmct.install(openmct.plugins.Espresso());
openmct.install(openmct.plugins.Generator());
openmct.install(openmct.plugins.UTCTimeSystem());
openmct.install(openmct.plugins.Conductor({
defaultTimeSystem: 'utc',
defaultTimespan: 30 * 60 * 1000,
showConductor: true
}));
openmct.install(DictionaryPlugin());
openmct.install(RealtimeTelemetryPlugin());
openmct.install(HistoricalTelemetryPlugin());
openmct.start();
});
</script>

1
openmct-tutorial Submodule

Submodule openmct-tutorial added at 7076a15d3a

View File

@ -84,5 +84,11 @@ define([
return new Main().run(defaultRegistry);
});
// For now, install conductor by default
openmct.install(openmct.plugins.Conductor({
showConductor: false
}));
return openmct;
});

View File

@ -118,7 +118,7 @@ define(
formModel = this.createModel(formValue);
formModel.location = parent.getId();
this.domainObject.useCapability("mutation", function (model) {
this.domainObject.useCapability("mutation", function () {
return formModel;
});
return this.domainObject;

View File

@ -19,6 +19,7 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
$output-bourbon-deprecation-warnings: false;
@import "bourbon";
@import "logo-and-bg";

View File

@ -19,7 +19,7 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
$output-bourbon-deprecation-warnings: false;
@import "bourbon";
@import "../../../../general/res/sass/_mixins";

View File

@ -19,7 +19,7 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
$output-bourbon-deprecation-warnings: false;
@import "bourbon";
@import "../../../../general/res/sass/_mixins";

View File

@ -21,11 +21,9 @@
*****************************************************************************/
define([
"./src/ConductorTelemetryDecorator",
"./src/ConductorRepresenter",
'legacyRegistry'
], function (
ConductorTelemetryDecorator,
ConductorRepresenter,
legacyRegistry
) {
@ -39,16 +37,6 @@ define([
"openmct"
]
}
],
"components": [
{
"type": "decorator",
"provides": "telemetryService",
"implementation": ConductorTelemetryDecorator,
"depends": [
"openmct"
]
}
]
}
});

View File

@ -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;
}
);

View File

@ -19,6 +19,7 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
$output-bourbon-deprecation-warnings: false;
@import "bourbon";
@import "../../../../../commonUI/general/res/sass/constants";
@import "../../../../../commonUI/general/res/sass/mixins";

View File

@ -19,6 +19,7 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
$output-bourbon-deprecation-warnings: false;
@import "bourbon";
@import "../../../../../commonUI/general/res/sass/constants";
@import "../../../../../commonUI/general/res/sass/mixins";

View File

@ -68,6 +68,11 @@ define(
this.modes = conductorViewService.availableModes();
this.validation = new TimeConductorValidation(this.conductor);
this.formatService = formatService;
//Check if the default mode defined is actually available
if (this.modes[DEFAULT_MODE] === undefined) {
DEFAULT_MODE = 'fixed';
}
this.DEFAULT_MODE = DEFAULT_MODE;
// Construct the provided time system definitions

View File

@ -131,8 +131,9 @@ define(['./TimeConductorController'], function (TimeConductorController) {
{conductor: mockTimeConductor},
mockConductorViewService,
mockFormatService,
"fixed",
'fixed',
true
);
tsListener = getListener(mockTimeConductor.on, "timeSystem");

View File

@ -19,6 +19,7 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
$output-bourbon-deprecation-warnings: false;
@import "bourbon";
@import "../../../../commonUI/general/res/sass/constants";

View File

@ -19,6 +19,7 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
$output-bourbon-deprecation-warnings: false;
@import "bourbon";
@import "../../../../commonUI/general/res/sass/constants";

View File

@ -19,6 +19,7 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
$output-bourbon-deprecation-warnings: false;
@import "bourbon";
@import "../../../../commonUI/general/res/sass/constants";

View File

@ -18,14 +18,14 @@
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 class="search-result-item l-flex-row flex-elem grows"
ng-class="{selected: ngModel.selectedObject.getId() === domainObject.getId()}">
<mct-representation key="'label'"
mct-object="domainObject"
ng-model="ngModel"
ng-click="ngModel.selectedObject = domainObject"
ng-click="ngModel.allowSelection(domainObject) && ngModel.onSelection(domainObject)"
class="l-flex-row flex-elem grows">
</mct-representation>
</div>
</div>

View File

@ -139,7 +139,8 @@ define(
type = domainObject.getCapability("type"),
typeRequest = (type && type.getDefinition().telemetry) || {},
modelTelemetry = domainObject.getModel().telemetry,
fullRequest = Object.create(typeRequest);
fullRequest = Object.create(typeRequest),
bounds;
// Add properties from the telemetry field of this
// specific domain object.
@ -160,6 +161,12 @@ define(
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;
};
@ -215,7 +222,6 @@ define(
return telemetryService.requestTelemetry([fullRequest]);
}
// TODO: Adapt request / options?
if (isLegacyProvider) {
// If a telemetryService is not available,
// getTelemetryService() should reject, and this should

View File

@ -97,7 +97,15 @@ define(
});
mockAPI = {
telemetry: mockTelemetryAPI
telemetry: mockTelemetryAPI,
conductor: {
bounds: function () {
return {
start: 0,
end: 1
};
}
}
};
telemetry = new TelemetryCapability(
@ -150,7 +158,9 @@ define(
expect(telemetry.getMetadata()).toEqual({
id: "testId", // from domain object
source: "testSource",
key: "testKey"
key: "testKey",
start: 0,
end: 1
});
});
@ -164,7 +174,9 @@ define(
expect(telemetry.getMetadata()).toEqual({
id: "testId", // from domain object
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
source: "testSource",
key: "testKey"
key: "testKey",
start: 0,
end: 1
}]
);

View File

@ -51,7 +51,7 @@ define(['./Type'], function (Type) {
* @method addType
* @memberof module:openmct.TypeRegistry#
*/
TypeRegistry.prototype.register = function (typeKey, typeDef) {
TypeRegistry.prototype.addType = function (typeKey, typeDef) {
this.types[typeKey] = new Type(typeDef);
};

View File

@ -30,17 +30,19 @@ define([
GeneratorPlugin
) {
var bundleMap = {
couchDB: 'platform/persistence/couch',
elasticsearch: 'platform/persistence/elastic',
espresso: 'platform/commonUI/themes/espresso',
localStorage: 'platform/persistence/local',
myItems: 'platform/features/my-items',
snow: 'platform/commonUI/themes/snow'
CouchDB: 'platform/persistence/couch',
Elasticsearch: 'platform/persistence/elastic',
Espresso: 'platform/commonUI/themes/espresso',
LocalStorage: 'platform/persistence/local',
MyItems: 'platform/features/my-items',
Snow: 'platform/commonUI/themes/snow'
};
var plugins = _.mapValues(bundleMap, function (bundleName, pluginName) {
return function (openmct) {
openmct.legacyRegistry.enable(bundleName);
return function pluginConstructor() {
return function (openmct) {
openmct.legacyRegistry.enable(bundleName);
};
};
});
@ -53,6 +55,8 @@ define([
};
};
var conductorInstalled = false;
plugins.Conductor = function (options) {
if (!options) {
options = {};
@ -80,13 +84,15 @@ define([
openmct.legacyExtension('constants', {
key: 'DEFAULT_TIMECONDUCTOR_MODE',
value: options.showConductor ? 'fixed' : 'realtime',
priority: 'mandatory'
});
openmct.legacyExtension('constants', {
key: 'SHOW_TIMECONDUCTOR',
value: options.showConductor,
priority: 'mandatory'
priority: conductorInstalled ? 'mandatory' : 'fallback'
});
if (options.showConductor !== undefined) {
openmct.legacyExtension('constants', {
key: 'SHOW_TIMECONDUCTOR',
value: options.showConductor,
priority: conductorInstalled ? 'mandatory' : 'fallback'
});
}
if (options.defaultTimeSystem !== undefined || options.defaultTimespan !== undefined) {
openmct.legacyExtension('runs', {
implementation: applyDefaults,
@ -94,8 +100,11 @@ define([
});
}
openmct.legacyRegistry.enable('platform/features/conductor/core');
openmct.legacyRegistry.enable('platform/features/conductor/compatibility');
if (!conductorInstalled) {
openmct.legacyRegistry.enable('platform/features/conductor/core');
openmct.legacyRegistry.enable('platform/features/conductor/compatibility');
}
conductorInstalled = true;
};
};
@ -117,7 +126,7 @@ define([
openmct.legacyRegistry.enable(bundleName);
}
openmct.legacyRegistry.enable(bundleMap.couchDB);
openmct.legacyRegistry.enable(bundleMap.CouchDB);
};
};
@ -139,7 +148,7 @@ define([
openmct.legacyRegistry.enable(bundleName);
}
openmct.legacyRegistry.enable(bundleMap.elasticsearch);
openmct.legacyRegistry.enable(bundleMap.Elasticsearch);
};
};