Skip to content

Commit

Permalink
Merge branch 'main' into release/5.0-b1
Browse files Browse the repository at this point in the history
  • Loading branch information
davetsay committed May 17, 2023
2 parents 8786c5d + e8846d3 commit 0225945
Show file tree
Hide file tree
Showing 12 changed files with 297 additions and 18 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ protractor/logs
# npm-debug log
npm-debug.log

test_data/

# auto-env files for those that use them.
.env
dist
4 changes: 4 additions & 0 deletions loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 4 additions & 7 deletions src/channelTable/channelTablePlugin/ChannelTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
35 changes: 29 additions & 6 deletions src/channelTable/channelTablePlugin/ChannelTableRowCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ define(

addOrUpdateRow(row) {
if (this.isLADRow(row)) {
this.removeRowsByObject(row.objectKeyString);
super.addRows([row], 'add');
this.addRows([row]);
}
}

Expand All @@ -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);
Expand All @@ -48,28 +47,52 @@ 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) => {
this.ladMap.set(row.objectKeyString, index);
});
}

reorder (reorderPlan) {
reorder(reorderPlan) {
let oldRows = this.rows.slice();
reorderPlan.forEach(reorderEvent => {
let item = oldRows[reorderEvent.oldIndex];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ export default {
this.closeOverlay();
},
closeOverlay() {
this.table.clearColumnFilters();
if (this.overlay) {
this.overlay.dismiss();
delete this.overlay;
Expand Down
5 changes: 5 additions & 0 deletions src/multipleHistoricalSessions/sessionTable/SessionTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/packetQuery/components/PacketQueryView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
3 changes: 1 addition & 2 deletions src/services/mcws/MIO.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
30 changes: 30 additions & 0 deletions test_data/ChannelDictionary.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
30 changes: 30 additions & 0 deletions test_data/ChannelEnumerationDictionary.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
22 changes: 22 additions & 0 deletions test_data/EVRDictionary.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
Loading

0 comments on commit 0225945

Please sign in to comment.