diff --git a/src/components/widget/WidgetWrapper.vue b/src/components/widget/WidgetWrapper.vue index 6ab1c2353..fc4cc2fe8 100644 --- a/src/components/widget/WidgetWrapper.vue +++ b/src/components/widget/WidgetWrapper.vue @@ -51,6 +51,8 @@ provide(ContextKey, reactive(cloneDeep(props.context))); provide(InvalidateKey, (reason?: string) => { error.value = reason ?? 'Unknown error'; + // eslint-disable-next-line no-console + console.error(error.value); invalidateParent(reason); }); @@ -60,6 +62,8 @@ provide(ChangeWidgetTitleKey, () => startChangeWidgetTitle(props.widget)); onErrorCaptured((err: Error) => { error.value = err.message; + // eslint-disable-next-line no-console + console.trace(err); return false; }); diff --git a/src/plugins/builder/components/PartWrapper.vue b/src/plugins/builder/components/PartWrapper.vue index fe7a59aec..08826bff4 100644 --- a/src/plugins/builder/components/PartWrapper.vue +++ b/src/plugins/builder/components/PartWrapper.vue @@ -112,6 +112,8 @@ onErrorCaptured((err: Error) => { error.value = err.message; const { type, x, y } = props.part; notify.error(`${type} (${x},${y}) :${err.message}`); + // eslint-disable-next-line no-console + console.trace(err); return false; }); diff --git a/src/plugins/spark/components/widget/BlockWidgetWrapper.vue b/src/plugins/spark/components/widget/BlockWidgetWrapper.vue index cd842df95..9df1ebf82 100644 --- a/src/plugins/spark/components/widget/BlockWidgetWrapper.vue +++ b/src/plugins/spark/components/widget/BlockWidgetWrapper.vue @@ -74,6 +74,8 @@ watch( onErrorCaptured((err: Error) => { error.value = err.message; + // eslint-disable-next-line no-console + console.trace(err); return false; }); diff --git a/src/plugins/spark/components/widget/IoArray.vue b/src/plugins/spark/components/widget/IoArray.vue index 0514e53c3..9042c0f4e 100644 --- a/src/plugins/spark/components/widget/IoArray.vue +++ b/src/plugins/spark/components/widget/IoArray.vue @@ -6,6 +6,7 @@ import { BlockType, ChannelCapabilities, DigitalActuatorBlock, + DigitalInputBlock, DigitalState, FastPwmBlock, IoArrayInterfaceBlock, @@ -31,6 +32,7 @@ interface EditableChannel extends IoChannel { pwmActuator: FastPwmBlock | null; actuatorClaimed: boolean; compatibleTypes: BlockOrIntfType[]; + input: DigitalInputBlock | null; } const sparkStore = useSparkStore(); @@ -46,6 +48,9 @@ const channels = computed(() => if (c.capabilities & ChannelCapabilities.CHAN_SUPPORTS_PWM_100HZ) { compatibleTypes.push(BlockOrIntfType.FastPwm); } + if (c.capabilities & ChannelCapabilities.CHAN_SUPPORTS_DIGITAL_INPUT) { + compatibleTypes.push(BlockOrIntfType.DigitalInput); + } return { ...c, compatibleTypes, @@ -55,7 +60,8 @@ const channels = computed(() => BlockIntfType.ActuatorDigitalInterface, ), pwmActuator: ifCompatible(actuator, BlockType.FastPwm), - actuatorClaimed: actuator?.data.claimedBy.id != null, + actuatorClaimed: actuator?.data.claimedBy?.id != null, + input: ifCompatible(actuator, BlockType.DigitalInput), }; }), ); @@ -135,6 +141,12 @@ async function updatePwmSetting(channel: EditableChannel): Promise { @click="updatePwmSetting(channel)" /> +
import { BlockIntfType, + BlockType, DigitalActuatorBlock, + DigitalInputBlock, DS2408Block, DS2408ConnectMode, MotorValveBlock, @@ -33,8 +35,10 @@ function setConnectMode(mode: DS2408ConnectMode): void { } const linked = sparkStore .blocksByService(serviceId) - .filter((b): b is DigitalActuatorBlock | MotorValveBlock => - isCompatible(b.type, BlockIntfType.ActuatorDigitalInterface), + .filter( + (b): b is DigitalActuatorBlock | MotorValveBlock | DigitalInputBlock => + isCompatible(b.type, BlockIntfType.ActuatorDigitalInterface) || + b.type === BlockType.DigitalInput, ) .filter((b) => b.data.hwDevice.id === block.value.id);