add untracked files

This commit is contained in:
David Tsay 2023-08-23 15:27:13 -07:00
parent 2c7294bb3c
commit 80ee7d3cf6
3 changed files with 357 additions and 0 deletions

View File

@ -0,0 +1,150 @@
<template>
<div class="c-inspector__numeric-data">
<div class="c-inspect-properties__header">
Numeric Data
</div>
<div v-if="hasNumericData">
<TelemetryFrame
v-for="telemetryKey in telemetryKeys"
:key="telemetryKey"
:telemetry-key="telemetryKey"
/>
</div>
<div v-else>
nothing
</div>
</div>
</template>
<script>
import TelemetryFrame from './TelemetryFrame.vue';
export default {
inject: [
'openmct'
],
components: {
TelemetryFrame
},
props: {
// bounds: {
// type: Object,
// required: true
// },
// telemetryKeys: {
// type: Array,
// default: () => []
// }
},
watch: {
// telemetryKeys: {
// handler() {
// this.renderNumericData();
// },
// deep: true
// },
// bounds: {
// handler() {
// this.renderNumericData();
// },
// deep: true
// }
},
computed: {
hasNumericData() {
return this.telemetryKeys?.length;
}
},
data() {
return {
telemetryKeys: ['9852db1e-a08a-41a0-b668-810a14327344']
}
},
mounted() {
},
methods: {
// async renderNumericData() {
// // this.destroyComponent();
// const telemetryKeys = [];
// telemetryKeys.map((telemetryKey) => this.plotObjects.push(this.openmct.objects.get(telemetryKey)));
// await Promise.all(this.plotObjects);
// // this.setIndependentTimeContextForComponent();
// // this.renderComponent();
// this.ready = true;
// },
setIndependentTimeContextForComponent() {
// this.unregisterTimeContextList = [];
// this.plotObjects.forEach((plotObject) => {
// const keyString = this.openmct.objects.makeKeyString(plotObject.identifier);
// // get an independent time context for object
// this.openmct.time.getContextForView([plotObject]);
// // set the time context of the object to the selected time range
// this.unregisterTimeContextList.push(this.openmct.time.addIndependentContext(keyString, this.bounds));
// });
},
renderComponent() {
// this.elementsList = [];
// this.componentsList = [];
// const bounds = this.bounds;
// this.plotObjects.forEach((proxyPlotObject) => {
// const plotObject = toRaw(proxyPlotObject);
// const { vNode, destroy } = mount(
// {
// components: {
// TelemetryFrame,
// },
// provide: {
// openmct: this.openmct,
// path: [ plotObject ]
// },
// data() {
// return {
// plotObject,
// bounds,
// };
// },
// template: `<TelemetryFrame
// :bounds="bounds"
// :telemetry-object="plotObject"
// >
// </TelemetryFrame>`
// },
// {
// app: this.openmct.app
// }
// );
// this.componentsList.push(destroy);
// this.elementsList.push(vNode.el);
// this.$refs.numericDataView.append(vNode.el);
// });
},
destroyComponent() {
// if (this.componentsList) {
// this.componentsList.map(destroy => destroy());
// delete this.componentsList;
// }
// if (this.elementsList) {
// this.elementsList.map((element) => element.remove());
// delete this.elementsList;
// }
// if (this.plotObjects) {
// this.plotObjects = [];
// }
// if (this.unregisterTimeContextList) {
// this.unregisterTimeContextList.map((unregisterTimeContext) => unregisterTimeContext());
// delete this.unregisterTimeContextList;
// }
}
}
}
</script>

View File

@ -0,0 +1,139 @@
<template>
<div></div>
</template>
<script>
import mount from '../../utils/mount';
export default {
inject: [
'openmct'
],
props: {
// bounds: {
// type: Object,
// required: true
// },
telemetryKey: {
type: String,
required: true
}
},
computed: {
},
data() {
return {
telemetryObject: undefined,
loaded: false
}
},
async mounted() {
this.telemetryObject = await this.openmct.objects.get(this.telemetryKey);
this.renderPlot();
this.loaded = true;
},
methods: {
renderPlot() {
const { vNode, destroy } = mount(
{
components: {
Plot: this.openmct.components.Plot
},
provide: {
openmct,
domainObject: this.telemetryObject,
path: [ this.telemetryObject ]
},
methods: {
loadingUpdated(loaded) {
this.loading = loaded;
}
},
template: `<Plot />`
},
{
app: this.openmct.app,
element: this.$el
}
);
this.component = vNode.componentInstance;
this._destroy = destroy;
},
setIndependentTimeContextForComponent() {
// this.unregisterTimeContextList = [];
// this.plotObjects.forEach((plotObject) => {
// const keyString = this.openmct.objects.makeKeyString(plotObject.identifier);
// // get an independent time context for object
// this.openmct.time.getContextForView([plotObject]);
// // set the time context of the object to the selected time range
// this.unregisterTimeContextList.push(this.openmct.time.addIndependentContext(keyString, this.bounds));
// });
},
renderComponent() {
// this.elementsList = [];
// this.componentsList = [];
// const bounds = this.bounds;
// this.plotObjects.forEach((proxyPlotObject) => {
// const plotObject = toRaw(proxyPlotObject);
// const { vNode, destroy } = mount(
// {
// components: {
// TelemetryFrame,
// },
// provide: {
// openmct: this.openmct,
// path: [ plotObject ]
// },
// data() {
// return {
// plotObject,
// bounds,
// };
// },
// template: `<TelemetryFrame
// :bounds="bounds"
// :telemetry-object="plotObject"
// >
// </TelemetryFrame>`
// },
// {
// app: this.openmct.app
// }
// );
// this.componentsList.push(destroy);
// this.elementsList.push(vNode.el);
// this.$refs.numericDataView.append(vNode.el);
// });
},
destroyComponent() {
// if (this.componentsList) {
// this.componentsList.map(destroy => destroy());
// delete this.componentsList;
// }
// if (this.elementsList) {
// this.elementsList.map((element) => element.remove());
// delete this.elementsList;
// }
// if (this.plotObjects) {
// this.plotObjects = [];
// }
// if (this.unregisterTimeContextList) {
// this.unregisterTimeContextList.map((unregisterTimeContext) => unregisterTimeContext());
// delete this.unregisterTimeContextList;
// }
}
},
beforeUnmount() {
// this.destroyComponent();
}
}
</script>

View File

@ -0,0 +1,68 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2022, 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 Pivot from './Pivot.vue';
import mount from 'utils/mount';
export default function PropertiesViewProvider(openmct) {
return {
key: 'testPlotView',
name: 'PlotView',
glyph: 'icon-info',
canView: function (selection) {
return selection.length > 0;
},
view: function (selection) {
let _destroy = null;
return {
show: function (element) {
const { destroy } = mount(
{
el: element,
components: {
Pivot
},
provide: {
openmct
},
template: `<Pivot />`
},
{
app: openmct.app,
element
}
);
_destroy = destroy;
},
priority: function () {
return openmct.priority.HIGH+100000;
},
destroy: function () {
if (_destroy) {
_destroy();
}
}
};
}
};
}