From 59c61e72b81494cbca910fd0c0c29223fbf218ca Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Wed, 29 Mar 2017 17:15:29 -0700 Subject: [PATCH] [Features] Added option to specify a type to exclusively apply the Autoflow view to --- platform/features/autoflow/plugin.js | 81 ++++++++++++++-------------- src/plugins/plugins.js | 13 +++-- 2 files changed, 52 insertions(+), 42 deletions(-) diff --git a/platform/features/autoflow/plugin.js b/platform/features/autoflow/plugin.js index 86affe181a..5d17cfbf09 100755 --- a/platform/features/autoflow/plugin.js +++ b/platform/features/autoflow/plugin.js @@ -7,45 +7,48 @@ define([ AutoflowTabularController, MCTAutoflowTable ) { - return function (openmct) { - openmct.legacyRegistry.register("platform/features/autoflow", { - "name": "WARP Telemetry Adapter", - "description": "Retrieves telemetry from the WARP Server and provides related types and views.", - "resources": "res", - "extensions": { - "views": [ - { - "key": "autoflow", - "name": "Autoflow Tabular", - "cssClass": "icon-packet", - "description": "A tabular view of packet contents.", - "template": autoflowTabularTemplate, - "needs": [ - "telemetry" - ], - "delegation": true - } - ], - "controllers": [ - { - "key": "AutoflowTabularController", - "implementation": AutoflowTabularController, - "depends": [ - "$scope", - "$timeout", - "telemetrySubscriber" - ] - } - ], - "directives": [ - { - "key": "mctAutoflowTable", - "implementation": MCTAutoflowTable - } - ] - } - }); - openmct.legacyRegistry.enable("platform/features/autoflow"); + return function (options) { + return function (openmct) { + openmct.legacyRegistry.register("platform/features/autoflow", { + "name": "WARP Telemetry Adapter", + "description": "Retrieves telemetry from the WARP Server and provides related types and views.", + "resources": "res", + "extensions": { + "views": [ + { + "key": "autoflow", + "name": "Autoflow Tabular", + "cssClass": "icon-packet", + "description": "A tabular view of packet contents.", + "template": autoflowTabularTemplate, + "type": options && options.type, + "needs": [ + "telemetry" + ], + "delegation": true + } + ], + "controllers": [ + { + "key": "AutoflowTabularController", + "implementation": AutoflowTabularController, + "depends": [ + "$scope", + "$timeout", + "telemetrySubscriber" + ] + } + ], + "directives": [ + { + "key": "mctAutoflowTable", + "implementation": MCTAutoflowTable + } + ] + } + }); + openmct.legacyRegistry.enable("platform/features/autoflow"); + }; }; }); diff --git a/src/plugins/plugins.js b/src/plugins/plugins.js index c1c5962923..70730a44dc 100644 --- a/src/plugins/plugins.js +++ b/src/plugins/plugins.js @@ -57,9 +57,16 @@ define([ }; }; - plugins.AutoflowView = function () { - return AutoflowPlugin; - }; + /** + * A tabular view showing the latest values of multiple telemetry points at + * once. Formatted so that labels and values are aligned. + * + * @param {Object} [options] Optional settings to apply to the autoflow + * tabular view. Currently supports one option, 'type'. + * @param {string} [options.type] The key of an object type to apply this view + * to exclusively. + */ + plugins.AutoflowView = AutoflowPlugin; var conductorInstalled = false;