mirror of
https://github.com/nasa/openmct.git
synced 2025-03-25 13:28:38 +00:00
rudimentary expression editor
This commit is contained in:
parent
0113ec08db
commit
a0a2ead5e7
@ -24,6 +24,14 @@ export default class CompsManager extends EventEmitter {
|
||||
this.#telemetryLoadedPromises = [];
|
||||
}
|
||||
|
||||
persist() {
|
||||
this.#openmct.objects.mutate(
|
||||
this.#domainObject,
|
||||
'configuration.comps',
|
||||
this.#domainObject.configuration.comps
|
||||
);
|
||||
}
|
||||
|
||||
getTelemetryObjects() {
|
||||
return this.#telemetryObjects;
|
||||
}
|
||||
@ -132,7 +140,7 @@ export default class CompsManager extends EventEmitter {
|
||||
}
|
||||
|
||||
getExpression() {
|
||||
return 'a + b ';
|
||||
return this.#domainObject.configuration.expression;
|
||||
}
|
||||
|
||||
#waitForDebounce() {
|
||||
|
@ -68,6 +68,7 @@ export default class CompsTelemetryProvider {
|
||||
'🏟️ 2 Telemetry for comps:',
|
||||
specificCompsManager.requestUnderlyingTelemetry()
|
||||
);
|
||||
console.debug('🏟️ expression:', expression);
|
||||
this.#requestPromises[callbackID] = { resolve, reject };
|
||||
this.#sharedWorker.port.postMessage({
|
||||
type: 'calculateRequest',
|
||||
|
@ -65,7 +65,17 @@
|
||||
<div class="c-cs__header c-section__header">
|
||||
<div class="c-cs__header-label c-section__label">Expression</div>
|
||||
</div>
|
||||
<div class="c-cs__content"></div>
|
||||
<div class="c-cs__content">
|
||||
<div v-if="!isEditing">{{ domainObject.configuration.expression }}</div>
|
||||
<div v-else>
|
||||
<textarea
|
||||
v-model="domainObject.configuration.expression"
|
||||
class="c-cs__expression__input"
|
||||
placeholder="Enter an expression"
|
||||
@change="compsManager.persist"
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -35,7 +35,12 @@ export default function CompsPlugin() {
|
||||
creatable: true,
|
||||
cssClass: 'icon-telemetry',
|
||||
initialize: function (domainObject) {
|
||||
domainObject.configuration = {};
|
||||
domainObject.configuration = {
|
||||
comps: {
|
||||
expression: '',
|
||||
parameters: []
|
||||
}
|
||||
};
|
||||
domainObject.composition = [];
|
||||
domainObject.telemetry = {};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user