Implement Fixes for Project Nautilus Integration (#12)

**Rationale:**

Some bugs were discovered in Project Nautilus integration.

**Changes:**

- Command and Telemetry paths now support `.`
- Telemetry Values now work with Boolean types in the frontend
- Constant Command Parameters no longer reset in the panel editor when you open the inspector

Reviewed-on: #12
Co-authored-by: Sergey Savelyev <sergeysav.nn@gmail.com>
Co-committed-by: Sergey Savelyev <sergeysav.nn@gmail.com>
This commit was merged in pull request #12.
This commit is contained in:
2026-01-02 12:29:35 -08:00
committed by sergeysav
parent 09eeceb212
commit 458c94c2ad
12 changed files with 43 additions and 38 deletions

View File

@@ -23,10 +23,13 @@ const is_boolean = computed(() => {
// Initialize the parameter to some value:
onMounted(() => {
if (is_numeric.value) {
model.value = 0.0;
} else if (is_boolean.value) {
model.value = false;
if (model.value === undefined) {
if (is_numeric.value) {
model.value = 0.0;
} else if (is_boolean.value) {
debugger;
model.value = false;
}
}
});
</script>

View File

@@ -56,7 +56,7 @@ watch([command_info], ([cmd_info]) => {
break;
}
}
if (!model_param_value) {
if (model_param_value === undefined) {
let default_value: DynamicDataType = 0;
if (isNumericType(param.data_type)) {
default_value = 0;

View File

@@ -6,6 +6,8 @@ import {
type WebsocketHandle,
} from '@/composables/websocket.ts';
import NumericText from '@/components/NumericText.vue';
import BooleanText from '@/components/BooleanText.vue';
import { isBooleanType, isNumericType } from '@/composables/dynamic.ts';
const max_update_rate = 50; // ms
const default_update_rate = 200; // ms
@@ -33,30 +35,23 @@ const value = websocket.value.listen_to_telemetry(
const is_data_present = computed(() => {
return value.value != null;
});
const numeric_data = computed(() => {
const val = value.value;
if (val) {
const type = telemetry_data.value!.data_type;
const item_val = val.value[type];
if (typeof item_val == 'number') {
return item_val;
}
}
return null;
});
</script>
<template>
<span v-if="!is_data_present" v-bind="$attrs"> No Data </span>
<template v-else>
<NumericText
v-if="numeric_data"
v-if="isNumericType(telemetry_data!.data_type)"
v-bind="$attrs"
:value="numeric_data"
:value="value!.value[telemetry_data!.data_type]"
:max_width="10"
include_span
></NumericText>
<BooleanText
v-else-if="isBooleanType(telemetry_data!.data_type)"
v-bind="$attrs"
:value="value!.value[telemetry_data!.data_type]"
></BooleanText>
<span v-else v-bind="$attrs">
Cannot Display Data of Type {{ telemetry_data!.data_type }}
</span>