Would it be possible currently to have multiple 'types' of input and output ports so that only certain outputs can link with certain inputs.
So something like:
An input Inp1 which has type IA and thus only allows connections with outputs of types OA
It's a pretty easy extension of the library, I acheived this by overloading the canLinkToPort(port: SimPortModel): boolean function in my extension of PortModel. You can then add your type to this in your constructor, and implement whatever connection as to whether connection is allowed through canLinkToPort.
Good luck!
@cullenmcmahon Thank you for the info, this worked nicely for a specific type of link for my "top" port.
canLinkToPort(port) {
if (port.type === "PortTypeStr" && this.position === "top") {
return true;
}
return false;
}
Most helpful comment
It's a pretty easy extension of the library, I acheived this by overloading the canLinkToPort(port: SimPortModel): boolean function in my extension of PortModel. You can then add your type to this in your constructor, and implement whatever connection as to whether connection is allowed through canLinkToPort.
Good luck!