diff --git a/example/generator/GeneratorMetadataProvider.js b/example/generator/GeneratorMetadataProvider.js
index 1668d72d4c..fecf996ffe 100644
--- a/example/generator/GeneratorMetadataProvider.js
+++ b/example/generator/GeneratorMetadataProvider.js
@@ -33,12 +33,19 @@ define([
formatString: '%0.2f',
hints: {
range: 1
- }
+ },
+ filters: [
+ {
+ comparator: 'equals',
+ possibleValues: [1,2,3,4]
+ }
+ ]
},
{
key: "cos",
name: "Cosine",
formatString: '%0.2f',
+ filters: ['equals'],
hints: {
range: 2
}
diff --git a/index.html b/index.html
index bb4babbf54..7a43151700 100644
--- a/index.html
+++ b/index.html
@@ -81,6 +81,7 @@
openmct.install(openmct.plugins.Tabs());
openmct.install(openmct.plugins.FlexibleLayout());
openmct.install(openmct.plugins.LADTable());
+ openmct.install(openmct.plugins.Filters(['table', 'telemetry.plot.overlay']));
openmct.install(openmct.plugins.ObjectMigration());
openmct.start();
diff --git a/src/api/telemetry/TelemetryAPI.js b/src/api/telemetry/TelemetryAPI.js
index 2c833ccbd8..d32b57d361 100644
--- a/src/api/telemetry/TelemetryAPI.js
+++ b/src/api/telemetry/TelemetryAPI.js
@@ -297,7 +297,7 @@ define([
* @returns {Function} a function which may be called to terminate
* the subscription
*/
- TelemetryAPI.prototype.subscribe = function (domainObject, callback) {
+ TelemetryAPI.prototype.subscribe = function (domainObject, callback, options) {
var provider = this.findSubscriptionProvider(domainObject);
if (!this.subscribeCache) {
@@ -316,7 +316,7 @@ define([
subscriber.callbacks.forEach(function (cb) {
cb(value);
});
- });
+ }, options);
} else {
subscriber.unsubscribe = function () {};
}
diff --git a/src/api/telemetry/TelemetryMetadataManager.js b/src/api/telemetry/TelemetryMetadataManager.js
index 8ab1d7441d..df3fbc6320 100644
--- a/src/api/telemetry/TelemetryMetadataManager.js
+++ b/src/api/telemetry/TelemetryMetadataManager.js
@@ -124,6 +124,10 @@ define([
return sortedMetadata;
};
+ TelemetryMetadataManager.prototype.getFilterableValues = function () {
+ return this.valueMetadatas.filter(metadatum => metadatum.filters && metadatum.filters.length > 0);
+ }
+
TelemetryMetadataManager.prototype.getDefaultDisplayValue = function () {
let valueMetadata = this.valuesForHints(['range'])[0];
diff --git a/src/plugins/filters/components/FilterField.vue b/src/plugins/filters/components/FilterField.vue
new file mode 100644
index 0000000000..e2a4d5d1ab
--- /dev/null
+++ b/src/plugins/filters/components/FilterField.vue
@@ -0,0 +1,113 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/plugins/filters/filtersInspectorViewProvider.js b/src/plugins/filters/filtersInspectorViewProvider.js
new file mode 100644
index 0000000000..80e00c7aff
--- /dev/null
+++ b/src/plugins/filters/filtersInspectorViewProvider.js
@@ -0,0 +1,73 @@
+/*****************************************************************************
+ * Open MCT, Copyright (c) 2014-2018, 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.
+ *****************************************************************************/
+
+define([
+ './components/FiltersView.vue',
+ 'vue'
+], function (
+ FiltersView,
+ Vue
+) {
+
+ function FiltersInspectorViewProvider(openmct, supportedObjectTypesArray) {
+ return {
+ key: 'filters-inspector',
+ name: 'Filters Inspector View',
+ canView: function (selection) {
+ if (selection.length === 0) {
+ return false;
+ }
+ let object = selection[0].context.item;
+
+ return object && supportedObjectTypesArray.some(type => object.type === type);
+ },
+ view: function (selection) {
+ let component;
+ let providedObject = selection[0].context.item;
+
+ return {
+ show: function (element) {
+ component = new Vue({
+ provide: {
+ openmct,
+ providedObject
+ },
+ components: {
+ FiltersView: FiltersView.default
+ },
+ template: 'Filters
+