initial implementation of integral types

This commit is contained in:
2026-01-02 23:51:58 -05:00
parent 458c94c2ad
commit 791518eb3d
17 changed files with 307 additions and 52 deletions

View File

@@ -2,6 +2,7 @@
import {
type CommandParameterData,
type DynamicDataType,
getLimits,
isBooleanType,
isNumericType,
} from '@/composables/dynamic.ts';
@@ -40,7 +41,8 @@ watch([command_info], ([cmd_info]) => {
switch (model_param_value.type) {
case 'constant':
if (
typeof model_param_value.value == 'number' &&
(typeof model_param_value.value == 'number' ||
typeof model_param_value.value == 'bigint') &&
!isNumericType(param.data_type)
) {
model_param_value = undefined;
@@ -59,7 +61,11 @@ watch([command_info], ([cmd_info]) => {
if (model_param_value === undefined) {
let default_value: DynamicDataType = 0;
if (isNumericType(param.data_type)) {
default_value = 0;
if (getLimits(param.data_type).is_big) {
default_value = 0n;
} else {
default_value = 0;
}
} else if (isBooleanType(param.data_type)) {
default_value = false;
}