import { Component } from '@hatiolab/things-scene' import ControlBase, { DIRECTION, INOUT, NODE, PIPELINE } from './base/control-base' const IMAGE = new URL('../icons/control-bus.png', import.meta.url).href const NATURE = { mutable: false, resizable: false, rotatable: false, properties: [] } export default class ControlBus extends ControlBase { static IMAGE: HTMLImageElement static get nature() { return NATURE } get nodes(): NODE[] { return [ { name: 'In', description: 'Message inlet', inout: INOUT.IN, type: PIPELINE.MESSAGE, direction: DIRECTION.NORTH, multiplicity: 1 } ] } getImageElement(): HTMLImageElement { if (!ControlBus.IMAGE) { ControlBus.IMAGE = new Image() ControlBus.IMAGE.src = IMAGE } return ControlBus.IMAGE } } Component.register('control-bus', ControlBus)