diff --git a/.gitignore b/.gitignore index b2b642d..862807e 100644 --- a/.gitignore +++ b/.gitignore @@ -32,8 +32,6 @@ protractor/logs # npm-debug log npm-debug.log -test_data/ - # auto-env files for those that use them. .env dist diff --git a/loader.js b/loader.js index d0c0bf7..3d96142 100644 --- a/loader.js +++ b/loader.js @@ -127,6 +127,10 @@ define([ aboutHtml: insertBuildInfo(AboutTemplate), }); + // do not show telemetry if it falls out of bounds + // even if there is no new telemetry + openmct.telemetry.greedyLAD(false); + persistenceLoadedPromise.then(() => { openmct.start(); window.openmct = openmct; diff --git a/src/channelTable/channelTablePlugin/ChannelTable.js b/src/channelTable/channelTablePlugin/ChannelTable.js index a334472..cb2cf86 100644 --- a/src/channelTable/channelTablePlugin/ChannelTable.js +++ b/src/channelTable/channelTablePlugin/ChannelTable.js @@ -35,14 +35,11 @@ define([ this.tableRows = new ChannelTableRowCollection(this.openmct); let sortOptions = this.configuration.getConfiguration().sortOptions; - - //If no persisted sort order, default to sorting by time system, ascending. - sortOptions = sortOptions || { - key: this.openmct.time.timeSystem().key, - direction: 'asc' - }; - this.tableRows.sortBy(sortOptions); + if (sortOptions) { + this.tableRows.sortBy(sortOptions); + } + this.tableRows.on('resetRowsFromAllData', this.resetRowsFromAllData); } diff --git a/src/channelTable/channelTablePlugin/ChannelTableRowCollection.js b/src/channelTable/channelTablePlugin/ChannelTableRowCollection.js index f4c3539..cd28bc3 100644 --- a/src/channelTable/channelTablePlugin/ChannelTableRowCollection.js +++ b/src/channelTable/channelTablePlugin/ChannelTableRowCollection.js @@ -23,8 +23,7 @@ define( addOrUpdateRow(row) { if (this.isLADRow(row)) { - this.removeRowsByObject(row.objectKeyString); - super.addRows([row], 'add'); + this.addRows([row]); } } @@ -38,7 +37,7 @@ define( return !isStaleData; } - addOne (item) { + addOne(item) { if (item.isDummyRow) { this.ladMap.set(item.objectKeyString, this.rows.length); this.rows.push(item); @@ -48,20 +47,44 @@ define( 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.removeExistingByKeystring(item.objectKeyString); this.emit('add', [item]); return true; } return false; } + addRows(rows) { + let rowsToAdd = this.filterRows(rows); + + if (rowsToAdd.length > 0) { + rowsToAdd.forEach(this.addOne.bind(this)); + this.emit('add', rowsToAdd); + } + } + removeAllRowsForObject(objectKeyString) { super.removeAllRowsForObject(objectKeyString); this.rebuildLadMap(); } + removeExistingByKeystring(keyString) { + let removed = []; + + this.rows.forEach((row) => { + if (row.objectKeyString === keyString) { + removed.push(row); + + return false; + } else { + return true; + } + }); + + this.emit('remove', removed); + } + rebuildLadMap() { this.ladMap.clear(); this.rows.forEach((row, index) => { @@ -69,7 +92,7 @@ define( }); } - reorder (reorderPlan) { + reorder(reorderPlan) { let oldRows = this.rows.slice(); reorderPlan.forEach(reorderEvent => { let item = oldRows[reorderEvent.oldIndex]; diff --git a/src/multipleHistoricalSessions/sessionSelector/historicalSessionSelector.vue b/src/multipleHistoricalSessions/sessionSelector/historicalSessionSelector.vue index 747d5f9..e8ea483 100644 --- a/src/multipleHistoricalSessions/sessionSelector/historicalSessionSelector.vue +++ b/src/multipleHistoricalSessions/sessionSelector/historicalSessionSelector.vue @@ -256,6 +256,7 @@ export default { this.closeOverlay(); }, closeOverlay() { + this.table.clearColumnFilters(); if (this.overlay) { this.overlay.dismiss(); delete this.overlay; diff --git a/src/multipleHistoricalSessions/sessionTable/SessionTable.js b/src/multipleHistoricalSessions/sessionTable/SessionTable.js index d32e39b..597cc73 100644 --- a/src/multipleHistoricalSessions/sessionTable/SessionTable.js +++ b/src/multipleHistoricalSessions/sessionTable/SessionTable.js @@ -95,6 +95,11 @@ export default class SessionTable extends TelemetryTable { this.tableRows.clearRowsFromTableAndFilter(rows); } + clearColumnFilters() { + Object.keys(this.tableRows.columnFilters) + .forEach(filter => this.tableRows.setColumnFilter(filter, '')); + } + clearAndUpdateData(data) { this.data = data; this.clearData(); diff --git a/src/packetQuery/components/PacketQueryView.vue b/src/packetQuery/components/PacketQueryView.vue index 9495b2a..16e2d66 100644 --- a/src/packetQuery/components/PacketQueryView.vue +++ b/src/packetQuery/components/PacketQueryView.vue @@ -195,7 +195,7 @@ export default { this.initializeQueryModel(); - this.openmct.forms.showForm(formStructure, options) + this.openmct.forms.showCustomForm(formStructure, options) .then(this.resolveFormPromise.bind(this)); this.runQueryButton = this.formElement.querySelector('.c-button.c-button--major'); diff --git a/src/services/mcws/MIO.js b/src/services/mcws/MIO.js index 329d1ea..984ad48 100644 --- a/src/services/mcws/MIO.js +++ b/src/services/mcws/MIO.js @@ -78,8 +78,7 @@ export default class MIO { } async getMetadata() { - const response = await this.request(this.metadataUrl, 'GET', { output: 'json' }); - const metadataResponse = await response.json(); + const metadataResponse = await this.request(this.metadataUrl, 'GET', { output: 'json' }); return { get(subject, predicate) { diff --git a/test_data/ChannelDictionary.json b/test_data/ChannelDictionary.json new file mode 100644 index 0000000..78bd672 --- /dev/null +++ b/test_data/ChannelDictionary.json @@ -0,0 +1,30 @@ +[ + { + "channel_id": "CPU-0001", + "channel_name": "CPU_UTIL", + "data_type": "FLOAT", + "something": "whatever", + "dn_units": "percentage", + "dn_to_eu": "OFF", + "eu_units": "none", + "channel_format": "F32" + }, + { + "channel_id": "ENG-0001", + "channel_name": "main_engine_turn_on", + "data_type": "ENUM", + "dn_units": "none", + "dn_to_eu": "OFF", + "eu_units": "none", + "channel_format": "I8" + }, + { + "channel_id": "ENG-0002", + "channel_name": "someone_set_us_up", + "data_type": "ENUM", + "dn_units": "none", + "dn_to_eu": "OFF", + "eu_units": "none", + "channel_format": "I8" + } +] diff --git a/test_data/ChannelEnumerationDictionary.json b/test_data/ChannelEnumerationDictionary.json new file mode 100644 index 0000000..214b24c --- /dev/null +++ b/test_data/ChannelEnumerationDictionary.json @@ -0,0 +1,30 @@ +[ + { + "channel_id": "ENG-0002", + "channel_type": "ENUM", + "channel_format": "I8", + "enum_value": "0", + "enum_string": "UNINITIALIZED" + }, + { + "channel_id": "ENG-0002", + "channel_type": "ENUM", + "channel_format": "I8", + "enum_value": "1", + "enum_string": "RECV_ONLY_STATE" + }, + { + "channel_id": "ENG-0002", + "channel_type": "ENUM", + "channel_format": "I8", + "enum_value": "2", + "enum_string": "ACTIVE_WINDOW" + }, + { + "channel_id": "ENG-0002", + "channel_type": "ENUM", + "channel_format": "I8", + "enum_value": "3", + "enum_string": "CONTINGENCY_STATE" + } +] diff --git a/test_data/EVRDictionary.json b/test_data/EVRDictionary.json new file mode 100644 index 0000000..4951934 --- /dev/null +++ b/test_data/EVRDictionary.json @@ -0,0 +1,22 @@ +[ + { + "record_type": "evr_dictionary", + "evr_id": "1", + "evr_name": "TEST_CBM_EVR_BKGD_DONE", + "level": "ACTIVITY_HI", + "module": "TEST_CBM", + "ops_cat": "", + "nargs": "5", + "format": "Established background state for mode %d with bkgd row %d, x-band id %d, uhf id %d, eha row %d" + }, + { + "record_type": "evr_dictionary", + "evr_id": "2", + "evr_name": "TEST_CBM_EVR_BKGD_START", + "level": "ACTIVITY_LO", + "module": "TEST_CBM", + "ops_cat": "", + "nargs": "5", + "format": "Start background state for mode %d with bkgd row %d, x-band id %d, uhf id %d, eha row %d" + } +] diff --git a/test_data/Session.json b/test_data/Session.json new file mode 100644 index 0000000..3489e6a --- /dev/null +++ b/test_data/Session.json @@ -0,0 +1,170 @@ +[ + { + "record_type": "session", + "number": 1220, + "name": "someSessionName", + "type": "someSessionType", + "description": "Testing session for datas", + "user": "vista_test", + "host": "testbed1", + "downlink_connection_type": "", + "uplink_connection_type": "", + "start_time": "2016-01-01T12:14:33", + "end_time": "2016-01-01T12:14:33", + "output_directory": "/some/dir", + "output_dir_overridden": true, + "fsw_version": "1.3.0235", + "sse_version": "4.2.371", + "fsw_dictionary_directory": "/some/dir", + "sse_dictionary_directory": "/some/dir", + "input_format": "UNKNOWN", + "testbed_name": "zed", + "downlink_stream_id": "zorb", + "spacecraft_id": 127, + "ampcs_version": "R7.3", + "full_name": "session name full", + "fsw_downlink_host": "some host", + "fsw_uplink_host": "other host", + "fsw_downlink_port": 1234, + "fsw_uplink_port": 5678, + "sse_host": "someHost", + "sse_downlink_port": 1235, + "sse_uplink_port": 5679, + "input_file": "", + "topic": "ampcs.vista.testbed.peterr", + "jms_subtopic": "abcd", + "session_dss_id": 0, + "session_vcid": "", + "run_fsw_downlink": false, + "run_sse_downlink": false, + "run_uplink": false, + "database_session_key": "", + "database_session_host": "" + }, + { + "record_type": "session", + "number": 1244, + "name": "someSessionName", + "type": "someSessionType", + "description": "Testing session for datas", + "user": "vista_test", + "host": "testbed1", + "downlink_connection_type": "", + "uplink_connection_type": "", + "start_time": "2016-01-01T12:14:33", + "end_time": "2016-01-01T12:14:33", + "output_directory": "/some/dir", + "output_dir_overridden": true, + "fsw_version": "1.3.0235", + "sse_version": "4.2.371", + "fsw_dictionary_directory": "/some/dir", + "sse_dictionary_directory": "/some/dir", + "input_format": "UNKNOWN", + "testbed_name": "zed", + "downlink_stream_id": "zorb", + "spacecraft_id": 127, + "ampcs_version": "R7.3", + "full_name": "session name full", + "fsw_downlink_host": "some host", + "fsw_uplink_host": "other host", + "fsw_downlink_port": 1234, + "fsw_uplink_port": 5678, + "sse_host": "someHost", + "sse_downlink_port": 1235, + "sse_uplink_port": 5679, + "input_file": "", + "topic": "ampcs.vista.testbed.peterr", + "jms_subtopic": "abcd", + "session_dss_id": 0, + "session_vcid": "", + "run_fsw_downlink": false, + "run_sse_downlink": false, + "run_uplink": false, + "database_session_key": "", + "database_session_host": "" + }, + { + "record_type": "session", + "number": 1382, + "name": "someSessionName", + "type": "someSessionType", + "description": "Testing session for datas", + "user": "vista_test", + "host": "testbed1", + "downlink_connection_type": "", + "uplink_connection_type": "", + "start_time": "2016-01-01T12:14:33", + "end_time": "2016-01-01T12:14:33", + "output_directory": "/some/dir", + "output_dir_overridden": true, + "fsw_version": "1.3.0235", + "sse_version": "4.2.371", + "fsw_dictionary_directory": "/some/dir", + "sse_dictionary_directory": "/some/dir", + "input_format": "UNKNOWN", + "testbed_name": "zed", + "downlink_stream_id": "zorb", + "spacecraft_id": 127, + "ampcs_version": "R7.3", + "full_name": "session name full", + "fsw_downlink_host": "some host", + "fsw_uplink_host": "other host", + "fsw_downlink_port": 1234, + "fsw_uplink_port": 5678, + "sse_host": "someHost", + "sse_downlink_port": 1235, + "sse_uplink_port": 5679, + "input_file": "", + "topic": "ampcs.vista.testbed.dsanto", + "jms_subtopic": "abcd", + "session_dss_id": 0, + "session_vcid": "", + "run_fsw_downlink": false, + "run_sse_downlink": false, + "run_uplink": false, + "database_session_key": "", + "database_session_host": "" + }, + { + "record_type": "session", + "number": 1393, + "name": "someSessionName", + "type": "someSessionType", + "description": "Testing session for datas", + "user": "vista_test", + "host": "testbed2", + "downlink_connection_type": "", + "uplink_connection_type": "", + "start_time": "2016-01-01T12:14:33", + "end_time": "2016-01-01T12:14:33", + "output_directory": "/some/dir", + "output_dir_overridden": true, + "fsw_version": "1.3.0235", + "sse_version": "4.2.371", + "fsw_dictionary_directory": "/some/dir", + "sse_dictionary_directory": "/some/dir", + "input_format": "UNKNOWN", + "testbed_name": "zed", + "downlink_stream_id": "zorb", + "spacecraft_id": 127, + "ampcs_version": "R7.3", + "full_name": "session name full", + "fsw_downlink_host": "some host", + "fsw_uplink_host": "other host", + "fsw_downlink_port": 1234, + "fsw_uplink_port": 5678, + "sse_host": "someHost", + "sse_downlink_port": 1235, + "sse_uplink_port": 5679, + "input_file": "", + "topic": "ampcs.vista.testbed.dsanto", + "jms_subtopic": "abcd", + "session_dss_id": 0, + "session_vcid": "", + "run_fsw_downlink": false, + "run_sse_downlink": false, + "run_uplink": false, + "database_session_key": "", + "database_session_host": "" + } +]