Compare commits

...

89 Commits

Author SHA1 Message Date
68d5e8c822 Merge branch 'master' into extend-lad 2021-11-30 15:44:23 -08:00
fb4a595f0d remove local telemetry object. add a check for config hidden columns 2021-11-30 15:28:59 -08:00
28a9847a20 fix remove table error 2021-11-19 11:08:00 -08:00
6a7857cf69 Merge branch 'master' of github.com:nasa/openmct into extend-lad 2021-11-18 10:05:06 -08:00
b6b19819a2 remove conflicts 2021-11-12 10:51:54 -08:00
32bebe5fee Merge LAD views refactor into feature branch (#4446)
* move all logic into classes from views
2021-11-09 16:16:44 -08:00
37a614d6be Merge branch 'master' into extend-lad 2021-11-09 15:56:03 -08:00
e30e1b875c Merge branch 'master' of github.com:nasa/openmct into extend-lad 2021-11-08 09:02:00 -08:00
872b426022 Merge branch 'master' of github.com:nasa/openmct into extend-lad 2021-11-01 12:10:08 -07:00
f589f000a2 Merge branch 'master' into extend-lad 2021-10-29 16:27:20 -07:00
1ca27456a4 remove headers 2021-10-29 13:43:42 -07:00
59d1811301 Merge branch 'master' of github.com:nasa/openmct into extend-lad 2021-10-29 13:40:24 -07:00
e00a9d5424 reconstruct tableSet telemetryObjects 2021-10-27 17:03:00 -07:00
b02f27923b Merge branch 'extend-lad' of github.com:nasa/openmct into extend-lad 2021-10-27 13:48:18 -07:00
9286f0ab30 1.pass hasUnits to ladRow.vue 2.move valueMetadat, format and timeKey toLADTableSet.js 3. add unit to LADRow.vue 2021-10-27 13:47:27 -07:00
6f7f6aa9d1 Merge branch 'master' of github.com:nasa/openmct into extend-lad 2021-10-27 13:12:26 -07:00
943b6bab5d add telemetry added event. add hasUnit check 2021-10-27 13:12:11 -07:00
c97683ddee add valueClass 2021-10-26 14:36:18 -07:00
27aa03a6ad add value formats 2021-10-26 14:31:02 -07:00
7cecdf3ab8 change lad table set back to single value. update timestamp format for lad row 2021-10-26 12:13:50 -07:00
ef26980f53 Merge branch 'master' of github.com:nasa/openmct into extend-lad 2021-10-26 11:14:02 -07:00
e952070e2d Merge branch 'master' into extend-lad 2021-10-26 11:11:17 -07:00
59f53581c3 remove sorting from lad table header row 2021-10-21 14:36:03 -07:00
8a60773858 add hide column checkboxes to inspector 2021-10-21 09:41:21 -07:00
e0a9f7c529 Merge branch 'master' of github.com:nasa/openmct into extend-lad 2021-10-21 09:20:57 -07:00
3c4dcdefa5 add editing attrbute. Make columns movable 2021-10-19 13:33:54 -07:00
1132251721 Merge branch 'master' of github.com:nasa/openmct into extend-lad 2021-10-19 13:10:47 -07:00
09519ced83 parse system timestamp with formats 2021-10-14 16:59:35 -07:00
e6860f56b2 pass telemetry object to ladRow to get time format 2021-10-14 11:17:32 -07:00
3ed1fced39 remove comments. move table events to contstructor 2021-10-13 17:03:57 -07:00
5ca507cd87 move remove table event to LadTableSet.js 2021-10-13 16:30:47 -07:00
c45bc8c189 fix lad table set showing table after removing issue 2021-10-13 14:39:26 -07:00
fcf889cbce use once instead of on for loaded event 2021-10-12 15:30:54 -07:00
0abe202216 Merge branch 'master' of github.com:nasa/openmct into extend-lad 2021-10-12 15:28:29 -07:00
967e31b554 update lad row view. render row directly from tableRows 2021-10-12 15:28:16 -07:00
7b8dbaff9c render row values 2021-10-07 14:42:46 -07:00
616f110d0e request lad data from LADRow.vue 2021-10-07 13:52:28 -07:00
639fdbd15e Merge branch 'master' of github.com:nasa/openmct into extend-lad 2021-10-07 11:13:13 -07:00
f0563671b2 lad table set redesign 2021-10-07 11:12:59 -07:00
47a3c3b8e7 update key to rerender LADRow.vue 2021-10-06 11:50:10 -07:00
3bf06a4a61 update lad rows and pass them to LADRow.vue 2021-10-05 13:35:55 -07:00
4fab8a9d42 remove header, telemetry objects getter functions 2021-10-04 11:00:39 -07:00
b1c20cdc36 fix header update event 2021-10-04 10:40:28 -07:00
ee562c8a79 add header columns. refresh headers when new table added 2021-10-04 10:37:01 -07:00
cd53f66941 get addheaders working by resolving an async issue. add configuration to lad table set domain object 2021-10-01 14:57:55 -07:00
2cb8872430 add lad tables to this.tables. Add addTelemetryObject and addHeaders functions 2021-09-30 15:15:45 -07:00
860cb98964 rename lad table set view 2021-09-30 14:10:02 -07:00
535505044d Merge branch 'master' of github.com:nasa/openmct into extend-lad 2021-09-30 14:01:59 -07:00
420c30a03d add LADTableSet.js. rename table set view. 2021-09-30 14:01:49 -07:00
f50c36577b update ladtable key to keystring 2021-09-21 21:15:55 -07:00
9c33248b46 initialize lad table when adding. 2021-09-21 20:58:00 -07:00
3ea07da33b updat add/remove telemetry table 2021-09-21 14:01:06 -07:00
8fdf109e5a update addLadTable to push new LADTable instance 2021-09-21 11:49:21 -07:00
536cd904c6 1.add lad table set type and provider. 2.update table set and component 2021-09-21 11:30:01 -07:00
92473bbe25 Merge branch 'extend-lad' of github.com:nasa/openmct into extend-lad 2021-09-20 08:41:39 -07:00
a3aafaf7d8 Merge branch 'master' of github.com:nasa/openmct into extend-lad 2021-09-20 08:41:25 -07:00
1535f2d396 fix pause reference error 2021-09-20 08:40:58 -07:00
7d06cec9fa update new lad table set key 2021-09-17 12:13:40 -07:00
e796bee9f8 exclude current lad table and update new lad key 2021-09-17 12:10:23 -07:00
4180d0ade0 Merge branch 'master' of github.com:nasa/openmct into extend-lad 2021-09-17 11:54:41 -07:00
64eb269f5e Merge branch 'master' into extend-lad 2021-09-16 16:41:26 -07:00
ac37f9b288 replace LADTableRow with telemetryTableRow. remove key check for dummyLAD Table row 2021-09-16 16:21:31 -07:00
36ae59d55a fixed ESLint formating errors 2021-09-16 15:28:43 -07:00
d4ad7344d5 override clear method for LADTableRowCollection 2021-09-16 15:06:23 -07:00
9630446d08 replace telemetrytableRow with LADTableRow. Add dummyrows for telemetry objects 2021-09-16 14:48:36 -07:00
d4be6def9c renamed LADRow. created EmptyLADTableRow. Added dummy row 2021-09-15 14:49:22 -07:00
843d38c095 revert LADRow changes 2021-09-15 13:53:44 -07:00
35725c3fdd add notes 2021-09-15 13:52:56 -07:00
6120209ce7 fix conficts in plugins.js 2021-09-15 11:53:18 -07:00
521d6c3313 add LADRow.js, add notes for changes 2021-09-15 11:49:34 -07:00
4a8533a7ed move custom addrow logic to LADTableRowCollection 2021-09-13 21:12:46 -07:00
723e228f5f disable lad table set 2021-09-10 09:21:13 -07:00
7efb6190e9 override buildOptionsFromConfiguration to set strategy and size 2021-09-09 15:19:22 -07:00
07c8ebed2e add lad table set view and provider 2021-09-09 14:29:03 -07:00
d8531b9702 remove filter 2021-09-08 14:59:00 -07:00
5df66ab08f add composition policy and LAD table set type 2021-09-08 14:57:28 -07:00
07d0e50131 modify path 2021-09-07 16:05:06 -07:00
47481d6038 Merge branch 'master' of github.com:nasa/openmct into extend-lad 2021-09-07 11:07:20 -07:00
fc97c6b274 remove ladtable.vue 2021-09-07 11:07:13 -07:00
17ee2d56ea remove row of the domain object before adding 2021-09-03 11:48:34 -07:00
563004b79f remove old rows before adding 2021-09-02 19:58:31 -07:00
e6b3be510b add only latest telemetry 2021-09-02 11:27:36 -07:00
21dbd737d8 rename provider. add strategy and size to requestoptions 2021-09-01 14:51:01 -07:00
5c80cfd708 Merge branch 'master' of github.com:nasa/openmct into extend-lad 2021-08-31 09:59:41 -07:00
66f771cef1 add constructor and super for LadTable.js 2021-08-31 09:47:41 -07:00
1d08b2f3a5 create LADTable.js for table instance functionality. Add new lad table type in ViewActions.js 2021-08-30 10:09:44 -07:00
ffadfe2a1d Merge branch 'master' of github.com:nasa/openmct into extend-lad 2021-08-27 08:43:23 -07:00
9e9f302ef8 add new lad provider to openmct telemetry 2021-08-26 11:21:07 -07:00
6cdb6a16ba extend telemetry table. creat a copy of LAD 2021-08-25 10:37:36 -07:00
18 changed files with 1073 additions and 17 deletions

View File

@ -189,7 +189,8 @@
}));
openmct.install(openmct.plugins.SummaryWidget());
openmct.install(openmct.plugins.Notebook());
openmct.install(openmct.plugins.LADTable());
// openmct.install(openmct.plugins.LADTable());
openmct.install(openmct.plugins.LADTableNEW());
openmct.install(openmct.plugins.Filters(['table', 'telemetry.plot.overlay']));
openmct.install(openmct.plugins.ObjectMigration());
openmct.install(openmct.plugins.ClearData(

View File

@ -62,7 +62,7 @@ export default {
components: {
LadRow
},
inject: ['openmct', 'objectPath', 'currentView'],
inject: ['openmct', 'objectPath', 'currentView', 'tableSet'],
props: {
domainObject: {
type: Object,
@ -95,20 +95,21 @@ export default {
}
},
mounted() {
this.composition = this.openmct.composition.get(this.domainObject);
this.composition.on('add', this.addLadTable);
this.composition.on('remove', this.removeLadTable);
this.composition.on('reorder', this.reorderLadTables);
this.composition.load();
this.tableSet.initialize();
// this.composition = this.openmct.composition.get(this.domainObject);
// this.composition.on('add', this.addLadTable);
// this.composition.on('remove', this.removeLadTable);
// this.composition.on('reorder', this.reorderLadTables);
// this.composition.load();
},
destroyed() {
this.composition.off('add', this.addLadTable);
this.composition.off('remove', this.removeLadTable);
this.composition.off('reorder', this.reorderLadTables);
this.compositions.forEach(c => {
c.composition.off('add', c.addCallback);
c.composition.off('remove', c.removeCallback);
});
// this.composition.off('add', this.addLadTable);
// this.composition.off('remove', this.removeLadTable);
// this.composition.off('reorder', this.reorderLadTables);
// this.compositions.forEach(c => {
// c.composition.off('add', c.addCallback);
// c.composition.off('remove', c.removeCallback);
// });
},
methods: {
addLadTable(domainObject) {

View File

@ -0,0 +1,65 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, 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.
*****************************************************************************/
// extend telemetryTableRow
// it should take care of rows with empty values
// import it in LADTableRowCollection
// refer to emptyChannelListRow.js
import TelemetryTableRow from '../telemetryTable/TelemetryTableRow.js';
export default class EmptyLADTableRow extends TelemetryTableRow {
constructor(columns, objectKeyString) {
super({}, columns, objectKeyString);
this.isDummyRow = true;
this.columns = columns;
this.objectKeyString = objectKeyString;
this.datum = Object.keys(columns).reduce((datum, column) => {
datum[column] = undefined;
return datum;
}, {});
}
getFormattedDatum(headers) {
return Object.keys(headers).reduce((formattedDatum, columnKey) => {
formattedDatum[columnKey] = this.getFormattedValue(columnKey);
return formattedDatum;
}, {});
}
getFormattedValue(key) {
if (this.columns[key] === undefined) {
return '';
} else {
return this.datum[key] || '--';
}
}
getRowClass() {
}
getCellLimitClasses() {
return {};
}
}

View File

@ -0,0 +1,92 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, 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.
*****************************************************************************/
import TelemetryTable from '../telemetryTable/TelemetryTable.js';
import EmptyLADTableRow from './EmptyLADTableRow.js';
import TelemetryTableRow from '../telemetryTable/TelemetryTableRow.js';
import LADTableRowCollection from './LADTableRowCollection.js';
export default class LADTable extends TelemetryTable {
constructor(domainObject, openmct) {
super(domainObject, openmct);
this.createTableRowCollections();
}
initialize() {
if (this.domainObject.type === 'LadTable') {
this.filterObserver = this.openmct.objects.observe(this.domainObject, 'configuration.filters', this.updateFilters);
this.filters = this.domainObject.configuration.filters;
this.loadComposition();
} else {
this.addTelemetryObject(this.domainObject);
}
}
addTelemetryObject(telemetryObject) {
super.addTelemetryObject(telemetryObject);
this.addDummyRowForObject(telemetryObject);
}
addDummyRowForObject(object) {
let objectKeyString = this.openmct.objects.makeKeyString(object.identifier);
let columns = this.getColumnMapForObject(objectKeyString);
let dummyRow = new EmptyLADTableRow(columns, objectKeyString);
this.tableRows.addOne(dummyRow);
this.headers = this.configuration.getVisibleHeaders();
}
getTelemetryProcessor(keyString, columnMap, limitEvaluator) {
return (telemetry) => {
//Check that telemetry object has not been removed since telemetry was requested.
if (!this.telemetryObjects[keyString]) {
return;
}
// only add the latest telemetry
let latest = telemetry[telemetry.length - 1];
let telemetryRow = new TelemetryTableRow(latest, columnMap, keyString, limitEvaluator);
if (this.paused) {
this.delayedActions.push(this.tableRows.addOne.bind(this.tableRows, telemetryRow, 'add'));
} else {
this.tableRows.addOne(telemetryRow, 'add');
}
};
}
buildOptionsFromConfiguration(telemetryObject) {
let LADOptions = {
strategy: 'latest',
size: 1
};
let options = Object.assign(super.buildOptionsFromConfiguration(telemetryObject), LADOptions);
return options;
}
createTableRowCollections() {
// need change: can this part be refactored by using super?
// split the original method
this.tableRows = new LADTableRowCollection(this.openmct);
this.tableRows.on('resetRowsFromAllData', this.resetRowsFromAllData);
}
}

View File

@ -0,0 +1,17 @@
import TableConfigurationViewProvider from '../telemetryTable/TableConfigurationViewProvider';
export default function LADTableConfigurationViewProvider(openmct) {
// extends TableConfigurationViewProvider and change type to LadTable
let tableConfiguration = new TableConfigurationViewProvider(openmct);
tableConfiguration.canView = function (selection) {
if (selection.length !== 1 || selection[0].length === 0) {
return false;
}
let object = selection[0][0].context.item;
return object && object.type === 'LadTable';
};
return tableConfiguration;
}

View File

@ -0,0 +1,79 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, 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.
*****************************************************************************/
import TableRowCollection from '../telemetryTable/collections/TableRowCollection.js';
import EmptyLADTableRow from './EmptyLADTableRow.js';
export default class LADTableRowCollection extends TableRowCollection {
constructor(openmct) {
super(openmct);
this.ladMap = new Map();
this.timeColumn = openmct.time.timeSystem().key;
}
// TODO i think this breaks filters
// this also breaks the parent's contract
addOne(item) {
if (item.isDummyRow) {
this.ladMap.set(item.objectKeyString, this.rows.length);
this.rows.push(item);
this.emit('add', [item]);
return true;
}
if (this.isNewerThanLAD(item)) {
let rowIndex = this.ladMap.get(item.objectKeyString);
let itemToReplace = this.rows[rowIndex];
this.rows[rowIndex] = item;
this.emit('remove', [itemToReplace]);
this.emit('add', [item]);
return true;
}
return false;
}
isNewerThanLAD(item) {
let rowIndex = this.ladMap.get(item.objectKeyString);
let latestRow = this.rows[rowIndex];
let newerThanLatest = latestRow === undefined
|| item.datum[this.timeColumn] > latestRow.datum[this.timeColumn]
|| latestRow.isDummyRow;
return !this.ladMap.has(item.objectKeyString) || newerThanLatest;
}
clear() {
this.rows = this.rows.map(
row => new EmptyLADTableRow(row.columns, row.objectKeyString)
);
this.rebuildLadMap();
}
rebuildLadMap() {
this.ladMap.clear();
this.rows.forEach((row, index) => {
this.ladMap.set(row.objectKeyString, index);
});
}
}

View File

@ -0,0 +1,102 @@
import EventEmitter from 'EventEmitter';
import LADTable from './LADTable';
export default class LADTableSet extends EventEmitter {
// 1. change the structure of telemetryObjects to {tablekey: {teleKey: teleObj}}
// 2. when add lad table. add an event ladtable.on('object-removed', this.removeTelemetryObj);
constructor(domainObject, openmct) {
super();
this.domainObject = domainObject;
this.openmct = openmct;
this.tables = {};
this.headers = {};
this.composition = undefined;
this.telemetryObjects = {};
this.unloadComposition = undefined;
}
initialize() {
this.unloadComposition = this.loadComposition();
}
loadComposition() {
this.composition = this.openmct.composition.get(this.domainObject);
if (this.composition !== undefined) {
this.composition.load().then((composition) => {
composition.forEach(this.addLADTable.bind(this));
this.composition.on('add', this.addLADTable.bind(this));
this.composition.on('remove', this.removeLADTable.bind(this));
this.emit('loaded');
});
return function unloadComposition() {
if (this.composition !== undefined) {
this.composition.off('add', this.addLADTable);
this.composition.off('remove', this.removeLADTable);
delete this.composition;
}
}.bind(this);
}
}
addLADTable(domainObject) {
const keyString = this.openmct.objects.makeKeyString(domainObject.identifier);
this.tables[keyString] = new LADTable(domainObject, this.openmct);
this.tables[keyString].once('loaded', () => {
this.addHeaders(this.tables[keyString]);
this.addTelemetryObjects(this.tables[keyString]);
});
this.emit('table-added', this.tables[keyString]);
}
removeLADTable(identifier) {
const keyString = this.openmct.objects.makeKeyString(identifier);
delete this.tables[keyString];
this.emit('table-removed', identifier);
}
addTelemetryObjects(ladTable) {
let telemetryObjects = ladTable.telemetryObjects;
for (let key in telemetryObjects) {
if (telemetryObjects[key]) {
let telemetryObject = {};
telemetryObject.key = this.openmct.objects.makeKeyString(telemetryObjects[key].telemetryObject.identifier);
telemetryObject.domainObject = telemetryObjects[key].telemetryObject;
telemetryObject.metadata = this.openmct.telemetry.getMetadata(telemetryObjects[key].telemetryObject);
telemetryObject.formats = this.openmct.telemetry.getFormatMap(telemetryObject.metadata);
telemetryObject.limitEvaluator = this.openmct
.telemetry
.limitEvaluator(telemetryObject.domainObject);
telemetryObject.valueMetadata = telemetryObject
.metadata
.valuesForHints(['range'])[0];
telemetryObject.valueKey = telemetryObject.valueMetadata.key;
if (!this.telemetryObjects[ladTable.keyString]) {
this.telemetryObjects[ladTable.keyString] = {};
}
this.telemetryObjects[ladTable.keyString][telemetryObject.key] = telemetryObject;
this.emit('telemetry-object-added');
}
}
}
addHeaders(ladTable) {
let headers = ladTable.headers;
Object.assign(this.headers, headers);
this.emit('headers-added');
}
destroy() {
this.unloadComposition();
}
}

View File

@ -0,0 +1,47 @@
import TableSetView from './components/LADTableSet.vue';
import LADTableSet from './LADTableSet';
import Vue from 'vue';
export default class LadTableSetView {
constructor(openmct, domainObject, objectPath) {
this.openmct = openmct;
this.domainObject = domainObject;
this.objectPath = objectPath;
this.component = undefined;
this.tableSet = new LADTableSet(domainObject, openmct);
}
show(element) {
this.component = new Vue({
el: element,
components: {
TableSetView
},
provide: {
openmct: this.openmct,
objectPath: this.objectPath,
currentView: this,
tableSet: this.tableSet
},
data: () => {
return {
domainObject: this.domainObject
};
},
template: '<table-set-view ref="TableSetView" :domain-object="domainObject"></table-set-view>'
});
}
getViewContext() {
if (!this.component) {
return {};
}
return this.component.$refs.TableSetView.getViewContext();
}
destroy(element) {
this.component.$destroy();
this.component = undefined;
}
}

View File

@ -0,0 +1,43 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, 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.
*****************************************************************************/
import LadTableSetView from './LadTableSetView';
export default function LADTableSetViewProvider(openmct) {
return {
key: 'LadTableSet.view',
name: 'LAD Table Set',
cssClass: 'icon-tabular-lad-set',
canView: function (domainObject) {
return domainObject.type === 'LadTableSet';
},
canEdit: function (domainObject) {
return domainObject.type === 'LadTableSet';
},
view: function (domainObject, objectPath) {
return new LadTableSetView(openmct, domainObject, objectPath);
},
priority: function () {
return 1;
}
};
}

View File

@ -0,0 +1,79 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, 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.
*****************************************************************************/
import TableView from '../telemetryTable/components/table.vue';
import LADTable from './LADTable.js';
import Vue from 'vue';
export default class LADTableView {
constructor(openmct, domainObject, objectPath) {
this.openmct = openmct;
this.objectPath = objectPath;
this.component = undefined;
this.table = new LADTable(domainObject, openmct);
}
show(element, editMode) {
this.component = new Vue({
el: element,
components: {
TableView
},
provide: {
openmct: this.openmct,
currentView: this,
table: this.table,
objectPath: this.objectPath
},
data: () => {
return {
isEditing: editMode,
domainObject: this.domainObject,
marking: {
disableMultiSelect: false,
enable: true,
rowName: '',
rowNamePlural: '',
useAlternateControlBar: false
}
};
},
template: '<table-view ref="tableView" :allowSorting=false :is-editing="isEditing" :allowFiltering=false :marking="marking" :domain-object="domainObject"></table-view>'
});
}
onEditModeChange(editMode) {
this.component.isEditing = editMode;
}
getViewContext() {
if (!this.component) {
return {};
}
return this.component.$refs.tableView.getViewContext();
}
destroy(element) {
this.component.$destroy();
this.component = undefined;
}
}

View File

@ -0,0 +1,48 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, 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.
*****************************************************************************/
import LADTableView from './LADTableView';
export default class LADTableViewProvider {
constructor(openmct) {
this.openmct = openmct;
this.name = 'LAD Table NEW';
this.key = 'LadTable.view';
this.cssClass = 'icon-tabular-lad';
}
canView(domainObject) {
return domainObject.type === 'LadTable';
}
canEdit(domainObject) {
return domainObject.type === 'LadTable';
}
view(domainObject, objectPath) {
return new LADTableView(this.openmct, domainObject, objectPath);
}
priority(domainObject) {
return 1;
}
}

View File

@ -0,0 +1,180 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, 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.
*****************************************************************************/
<template>
<tr
class="js-lad-table__body__row"
@contextmenu.prevent="showContextMenu"
>
<td class="js-first-data">{{ telemetryObject.telemetryObject.name }}</td>
<td class="js-second-data">{{ formattedTimestamp }}</td>
<td
class="js-third-data"
:class="valueClass"
>{{ value }}</td>
<td
v-if="hasUnits"
class="js-units"
>
{{ unit }}
</td>
</tr>
</template>
<script>
export default {
inject: ['openmct', 'currentView'],
props: {
row: {
type: Object,
required: true
},
telemetryObject: {
type: Object,
required: true
},
headers: {
type: Object,
required: true
},
pathToTable: {
type: Array,
required: true
},
hasUnits: {
type: Boolean,
require: true
}
},
data() {
return {
rowClass: this.row.getRowClass()
};
},
computed: {
domainObject() {
return this.telemetryObject.telemetryObject;
},
metadata() {
return this.openmct.telemetry.getMetadata(this.domainObject);
},
formats() {
return this.openmct.telemetry.getFormatMap(this.metadata);
},
limitEvaluator() {
return this.openmct.telemetry.limitEvaluator(this.domainObject);
},
valueMetadata() {
return this.metadata
? this.metadata.valuesForHints(['range'])[0]
: undefined;
},
valueKey() {
return this.valueMetadata
? this.valueMetadata.key
: undefined;
},
value() {
let formatter = this.formats && this.formats[this.valueKey];
if (formatter && formatter.format(this.row.datum) !== 'nan') {
return formatter.format(this.row.datum);
} else {
return '---';
}
},
headerKeys() {
return Object.keys(this.headers);
},
formattedTimestamp() {
return this.timestamp !== undefined ? this.getFormattedTimestamp(this.timestamp) : '---';
},
timestamp() {
return this.row.datum[this.timeSystemKey];
},
valueClass() {
let limit;
if (this.limitEvaluator) {
limit = this.limitEvaluator.evaluate(this.row, this.valueMetadata);
}
if (limit) {
return limit.cssClass;
} else {
return '';
}
},
unit() {
return this.valueMetadata.unit || '';
}
},
mounted() {
this.openmct.time.on('timeSystem', this.updateTimeSystem);
this.timeSystemKey = this.openmct.time.timeSystem().key;
},
destroyed() {
this.openmct.time.off('timeSystem', this.updateTimeSystem);
},
methods: {
parseValue(header) {
if (this.row[header] === undefined) {
return '--';
} else {
return this.row[header];
}
},
updateViewContext() {
this.$emit('rowContextClick', {
viewHistoricalData: true,
viewDatumAction: true,
getDatum: () => {
return this.datum;
}
});
},
getParsedTimestamp(timestamp) {
if (this.timeSystemFormat()) {
return this.formats[this.timeSystemKey].parse(timestamp);
}
},
getFormattedTimestamp(timestamp) {
if (this.timeSystemFormat()) {
return this.formats[this.timeSystemKey].format(timestamp);
}
},
timeSystemFormat() {
if (this.formats && this.formats[this.timeSystemKey]) {
return true;
} else {
console.warn(`No formatter for ${this.timeSystemKey} time system for ${this.domainObject.name}.`);
return false;
}
},
updateTimeSystem(timeSystem) {
this.timeSystemKey = timeSystem.key;
}
}
};
</script>

View File

@ -0,0 +1,201 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, 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.
*****************************************************************************/
<template>
<table class="c-table c-lad-table">
<thead>
<tr>
<th>Name</th>
<th>Timestamp</th>
<th>Value</th>
<th v-if="hasUnits">Unit</th>
</tr>
</thead>
<tbody>
<template
v-for="tableKey in tables"
>
<tr
:key="tableKey"
class="c-table__group-header js-lad-table-set__table-headers"
>
<td colspan="10">
{{ getTableName(tableKey) }}
</td>
</tr>
<LadRow
v-for="telemetryKey in telemetry[tableKey]"
:key="`${tableKey}${telemetryKey}`"
:row="ladRowData[telemetryKey]"
:telemetry-object="getTelemetryObject(tableKey, telemetryKey)"
:headers="headers"
:has-units="hasUnits"
:path-to-table="getObjectPath(tableKey)"
@rowContextClick="updateViewContext"
/>
</template>
</tbody>
</table>
</template>
<script>
import LadRow from './LADRow.vue';
export default {
components: {
LadRow
},
inject: ['openmct', 'objectPath', 'currentView', 'tableSet'],
props: {
domainObject: {
type: Object,
required: true
}
},
data() {
return {
updatingView: false,
headers: {},
compositions: [],
viewContext: {},
hasUnits: false,
tables: [],
telemetry: {},
ladRowData: {}
};
},
computed: {
},
mounted() {
this.listeners = {};
this.tableSet.on('headers-added', this.updateHeaders);
this.tableSet.on('table-added', this.addTable);
this.tableSet.on('table-removed', this.removeTable);
this.tableSet.on('telemetry-object-added', this.checkUnit);
this.tableSet.initialize();
},
destroyed() {
this.tableSet.off('headers-added', this.updateHeaders);
this.tableSet.off('table-added', this.addTable);
this.tableSet.off('table-removed', this.removeTable);
},
methods: {
updateViewContext(rowContext) {
this.viewContext.row = rowContext;
},
getViewContext() {
return this.viewContext;
},
updateHeaders() {
this.headers = this.tableSet.headers;
},
getObjectPath(key) {
const table = this.tableSet.tables[key];
return [table.domainObject, ...this.objectPath];
},
getTelemetryObject(ladTableKey, telemetryKey) {
const ladTable = this.tableSet.tables[ladTableKey];
const telemetry = ladTable.telemetryObjects[telemetryKey];
return telemetry;
},
getTableName(key) {
return this.tableSet.tables[key].domainObject.name;
},
addTable(ladTable) {
let key = this.openmct.objects.makeKeyString(ladTable.domainObject.identifier);
ladTable.on('object-added', this.addTelemetry.bind(this, key));
ladTable.on('object-removed',
(identifier) => this.removeTelemetry(identifier, ladTable.keyString));
ladTable.tableRows.on('add', this.addRow);
ladTable.initialize();
this.tables.push(key);
},
removeTable(identifier) {
let idx;
let key = this.openmct.objects.makeKeyString(identifier);
for (let i in this.tables) {
if (this.tables[i] === key) {
idx = i;
break;
}
}
if (idx !== undefined) {
this.tables.splice(idx, 1);
this.removeTelemetryObjects(key);
}
},
checkUnit() {
for (let ladKey in this.tableSet.telemetryObjects) {
if (ladKey) {
let telemetryObjects = this.tableSet.telemetryObjects[ladKey];
for (let teleKey in telemetryObjects) {
if (teleKey) {
let telemetryObject = telemetryObjects[teleKey];
let valueMetadatas = telemetryObject.metadata.valueMetadatas;
for (let metadatum of valueMetadatas) {
if (metadatum.unit !== undefined) {
this.hasUnits = true;
return;
}
}
}
}
}
}
return this.hasUnits = false;
},
addTelemetry(tableKey, telemetryObject) {
const telemetryKey = this.openmct.objects.makeKeyString(telemetryObject.identifier);
if (this.telemetry[tableKey] === undefined) {
this.$set(this.telemetry, tableKey, []);
}
this.telemetry[tableKey].push(telemetryKey);
},
removeTelemetry(objectIdentifier, ladKey) {
let key = this.openmct.objects.makeKeyString(objectIdentifier);
let filtered = this.telemetry[ladKey].filter(telemetry => {
return telemetry !== key;
});
this.telemetry[ladKey] = filtered;
},
removeLocalTelemetryObjects(tableKey) {
this.$delete(this.telemetry, tableKey);
},
addRow(telemetry) {
const ladTelemetry = telemetry[telemetry.length - 1];
this.$set(this.ladRowData, ladTelemetry.objectKeyString, ladTelemetry);
}
}
};
</script>

View File

@ -0,0 +1,33 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, 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.
*****************************************************************************/
export default function ladTableCompositionPolicy(openmct) {
return function (parent, child) {
if (parent.type === 'LadTable') {
return openmct.telemetry.isTelemetryObject(child);
} else if (parent.type === 'LadTableSet') {
return child.type === 'LadTable';
}
return true;
};
}

View File

@ -0,0 +1,61 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, 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.
*****************************************************************************/
import LADTableViewProvider from './LADTableViewProvider';
import LADTableSetViewProvider from './LADTableSetViewProvider';
import ladTableCompositionPolicy from './ladTableCompositionPolicy.js';
import LADTableConfigurationViewProvider from './LADTableConfigurationViewProvider';
export default function () {
return function install(openmct) {
openmct.objectViews.addProvider(new LADTableViewProvider(openmct));
openmct.objectViews.addProvider(new LADTableSetViewProvider(openmct));
openmct.inspectorViews.addProvider(new LADTableConfigurationViewProvider(openmct));
openmct.composition.addPolicy(ladTableCompositionPolicy(openmct));
openmct.types.addType('LadTable', {
name: "LAD Table NEW",
creatable: true,
description: "A Latest Available Data tabular view in which each row displays the values for one or more contained telemetry objects.",
cssClass: 'icon-tabular-lad',
initialize: function (domainObject) {
domainObject.composition = [];
domainObject.configuration = {
columnWidths: {},
hiddenColumns: {}
};
}
});
openmct.types.addType('LadTableSet', {
name: "LAD Table Set NEW",
creatable: true,
description: "A collection of LAD tables.",
cssClass: 'icon-tabular-lad-set',
initialize(domainObject) {
domainObject.composition = [];
domainObject.configuration = {};
}
});
};
}

View File

@ -46,6 +46,7 @@ define([
'./flexibleLayout/plugin',
'./tabs/plugin',
'./LADTable/plugin',
'./LADTable2/plugin',
'./filters/plugin',
'./objectMigration/plugin',
'./goToOriginalAction/plugin',
@ -100,6 +101,7 @@ define([
FlexibleLayout,
Tabs,
LADTable,
LADTableNEW,
Filters,
ObjectMigration,
GoToOriginalAction,
@ -207,7 +209,8 @@ define([
plugins.FolderView = FolderView;
plugins.Tabs = Tabs;
plugins.FlexibleLayout = FlexibleLayout;
plugins.LADTable = LADTable.default;
// plugins.LADTable = LADTable.default;
plugins.LADTableNEW = LADTableNEW.default;
plugins.Filters = Filters;
plugins.ObjectMigration = ObjectMigration.default;
plugins.GoToOriginalAction = GoToOriginalAction.default;

View File

@ -128,6 +128,8 @@ define([
this.tableComposition.on('add', this.addTelemetryObject);
this.tableComposition.on('remove', this.removeTelemetryObject);
this.emit('loaded');
});
}
}

View File

@ -82,8 +82,10 @@ define([
columnsToRemove.forEach((column) => {
//There may be more than one column with the same key (eg. time system columns)
if (!this.hasColumnWithKey(column.getKey())) {
delete configuration.hiddenColumns[column.getKey()];
configurationChanged = true;
if (configuration.hiddenColumns[column.getKey()]) {
delete configuration.hiddenColumns[column.getKey()];
configurationChanged = true;
}
}
});
if (configurationChanged) {