allow panels to hold commands
This commit is contained in:
@@ -23,6 +23,11 @@ import { AXIS_DATA, type AxisData } from '@/graph/axis';
|
||||
import ValueLabel from '@/components/ValueLabel.vue';
|
||||
import { type Point, PointLine } from '@/graph/line';
|
||||
import TooltipDialog from '@/components/TooltipDialog.vue';
|
||||
import {
|
||||
type DynamicDataType,
|
||||
isBooleanType,
|
||||
isNumericType,
|
||||
} from '@/composables/dynamic.ts';
|
||||
|
||||
const props = defineProps<{
|
||||
data: string;
|
||||
@@ -98,13 +103,9 @@ watch([value], ([val]) => {
|
||||
if (val_t >= min_x) {
|
||||
const raw_item_val = val.value[telemetry_data.value!.data_type];
|
||||
let item_val = 0;
|
||||
if (
|
||||
['Float32', 'Float64'].some(
|
||||
(e) => e == telemetry_data.value!.data_type,
|
||||
)
|
||||
) {
|
||||
if (isNumericType(telemetry_data.value!.data_type)) {
|
||||
item_val = raw_item_val as number;
|
||||
} else if (telemetry_data.value!.data_type == 'Boolean') {
|
||||
} else if (isBooleanType(telemetry_data.value!.data_type)) {
|
||||
item_val = (raw_item_val as boolean) ? 1 : 0;
|
||||
}
|
||||
const new_item = {
|
||||
@@ -140,15 +141,13 @@ watch(
|
||||
const response = (await res.json()) as TelemetryDataItem[];
|
||||
for (const data_item of response) {
|
||||
const val_t = Date.parse(data_item.timestamp);
|
||||
const raw_item_val = data_item.value[type];
|
||||
const raw_item_val = data_item.value[
|
||||
type
|
||||
] as DynamicDataType;
|
||||
let item_val = 0;
|
||||
if (
|
||||
['Float32', 'Float64'].some(
|
||||
(e) => e == telemetry_data.value!.data_type,
|
||||
)
|
||||
) {
|
||||
if (isNumericType(type)) {
|
||||
item_val = raw_item_val as number;
|
||||
} else if (type == 'Boolean') {
|
||||
} else if (isBooleanType(type)) {
|
||||
item_val = (raw_item_val as boolean) ? 1 : 0;
|
||||
}
|
||||
const new_item = {
|
||||
|
||||
Reference in New Issue
Block a user