Knot node switch pin

This commit is contained in:
barsdeveloper
2022-11-13 20:50:14 +01:00
parent 5d3a614d78
commit 92e4735d47
21 changed files with 315 additions and 121 deletions

View File

@@ -75,11 +75,13 @@ export default class NodeElement extends ISelectableDraggableElement {
#pins
/** @param {ObjectEntity} entity */
constructor(entity) {
super(entity, new (NodeElement.getTypeTemplate(entity))())
this.#pins = this.getPinEntities().filter(v => !v.isHidden()).map(v => new PinElement(v))
this.#pins.forEach(pin => pin.nodeElement = this)
/**
* @param {ObjectEntity} entity
* @param {NodeTemplate} template
*/
constructor(entity, template = undefined) {
super(entity, template ?? new (NodeElement.getTypeTemplate(entity))())
this.#pins = this.template.createPinElements()
this.nodeClass = this.entity.getClass()
this.name = this.entity.getObjectName()
this.advancedPinDisplay = this.entity.AdvancedPinDisplay?.toString()

View File

@@ -106,9 +106,12 @@ export default class PinElement extends IElement {
connections = 0
/** @param {PinEntity<T>} entity */
constructor(entity) {
super(entity, new (PinElement.getTypeTemplate(entity))())
/**
* @param {PinEntity<T>} entity
* @param {PinTemplate} template
*/
constructor(entity, template = undefined) {
super(entity, template ?? new (PinElement.getTypeTemplate(entity))())
this.pinType = this.entity.getType()
this.advancedView = this.entity.bAdvancedView
this.defaultValue = this.entity.getDefaultValue()