Compare commits
2 Commits
remove-dep
...
trac-code-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7f9407097 | ||
|
|
15c158cbb1 |
@@ -194,6 +194,7 @@
|
|||||||
['table', 'telemetry.plot.overlay', 'telemetry.plot.stacked'],
|
['table', 'telemetry.plot.overlay', 'telemetry.plot.stacked'],
|
||||||
{indicator: true}
|
{indicator: true}
|
||||||
));
|
));
|
||||||
|
//openmct.install(openmct.plugins.CodeWalkthrough);
|
||||||
openmct.start();
|
openmct.start();
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default function plugin() {
|
|||||||
openmct.objectViews.addProvider(new LADTableSetViewProvider(openmct));
|
openmct.objectViews.addProvider(new LADTableSetViewProvider(openmct));
|
||||||
|
|
||||||
openmct.types.addType('LadTable', {
|
openmct.types.addType('LadTable', {
|
||||||
name: "LAD Table",
|
name: "Latest Data Table",
|
||||||
creatable: true,
|
creatable: true,
|
||||||
description: "A Latest Available Data tabular view in which each row displays the values for one or more contained telemetry objects.",
|
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',
|
cssClass: 'icon-tabular-lad',
|
||||||
|
|||||||
63
src/plugins/codeWalkthrough/plugin.js
Normal file
63
src/plugins/codeWalkthrough/plugin.js
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
export default function install(openmct) {
|
||||||
|
openmct.objectViews.addProvider({
|
||||||
|
name: "Data Table",
|
||||||
|
key: "data-table",
|
||||||
|
cssClass: "icon-packet",
|
||||||
|
description: "Tabular view of telemetry",
|
||||||
|
canView(domainObject) {
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
view(domainObject) {
|
||||||
|
return {
|
||||||
|
async show(element) {
|
||||||
|
let telemetryMetadata = openmct.telemetry.getMetadata(domainObject).values();
|
||||||
|
let table = document.createElement('table');
|
||||||
|
let tableHead = document.createElement('thead');
|
||||||
|
let tableBody = document.createElement('tbody');
|
||||||
|
let tableHeadRow = document.createElement('tr');
|
||||||
|
|
||||||
|
tableHead.appendChild(tableHeadRow);
|
||||||
|
table.appendChild(tableHead);
|
||||||
|
table.appendChild(tableBody);
|
||||||
|
element.appendChild(table);
|
||||||
|
|
||||||
|
telemetryMetadata.forEach(metadatum => {
|
||||||
|
let tableHeadCell = document.createElement('td');
|
||||||
|
tableHeadRow.appendChild(tableHeadCell);
|
||||||
|
|
||||||
|
tableHeadCell.innerText = metadatum.name;
|
||||||
|
});
|
||||||
|
|
||||||
|
async function requestTelemetry() {
|
||||||
|
let telemetry = await openmct.telemetry.request(domainObject);
|
||||||
|
telemetry.forEach((datum) => {
|
||||||
|
let dataRow = document.createElement('tr');
|
||||||
|
telemetryMetadata.forEach(metadatum => {
|
||||||
|
let dataCell = document.createElement('td');
|
||||||
|
let formatter = openmct.telemetry.getValueFormatter(metadatum);
|
||||||
|
|
||||||
|
let telemetryValue = formatter.format(datum[metadatum.key]);
|
||||||
|
dataCell.innerText = telemetryValue;
|
||||||
|
dataRow.appendChild(dataCell);
|
||||||
|
});
|
||||||
|
tableBody.appendChild(dataRow);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
openmct.time.on('bounds', () => {
|
||||||
|
tableBody.innerHTML = '';
|
||||||
|
requestTelemetry();
|
||||||
|
});
|
||||||
|
|
||||||
|
requestTelemetry();
|
||||||
|
|
||||||
|
// openmct.telemetry.subscribe(domainObject, (datum) => {
|
||||||
|
// element.innerText = JSON.stringify(datum);
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
destroy() {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -65,7 +65,8 @@ define([
|
|||||||
'./interceptors/plugin',
|
'./interceptors/plugin',
|
||||||
'./performanceIndicator/plugin',
|
'./performanceIndicator/plugin',
|
||||||
'./CouchDBSearchFolder/plugin',
|
'./CouchDBSearchFolder/plugin',
|
||||||
'./timeline/plugin'
|
'./timeline/plugin',
|
||||||
|
'./codeWalkthrough/plugin'
|
||||||
], function (
|
], function (
|
||||||
_,
|
_,
|
||||||
UTCTimeSystem,
|
UTCTimeSystem,
|
||||||
@@ -111,7 +112,8 @@ define([
|
|||||||
ObjectInterceptors,
|
ObjectInterceptors,
|
||||||
PerformanceIndicator,
|
PerformanceIndicator,
|
||||||
CouchDBSearchFolder,
|
CouchDBSearchFolder,
|
||||||
Timeline
|
Timeline,
|
||||||
|
CodeWalkthrough
|
||||||
) {
|
) {
|
||||||
const bundleMap = {
|
const bundleMap = {
|
||||||
LocalStorage: 'platform/persistence/local',
|
LocalStorage: 'platform/persistence/local',
|
||||||
@@ -212,6 +214,7 @@ define([
|
|||||||
plugins.PerformanceIndicator = PerformanceIndicator.default;
|
plugins.PerformanceIndicator = PerformanceIndicator.default;
|
||||||
plugins.CouchDBSearchFolder = CouchDBSearchFolder.default;
|
plugins.CouchDBSearchFolder = CouchDBSearchFolder.default;
|
||||||
plugins.Timeline = Timeline.default;
|
plugins.Timeline = Timeline.default;
|
||||||
|
plugins.CodeWalkthrough = CodeWalkthrough.default;
|
||||||
|
|
||||||
return plugins;
|
return plugins;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user