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:
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user