initial implementation of integral types
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user