flowGraphSignalConnection.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { FlowGraphConnection, FlowGraphConnectionType } from "./flowGraphConnection.js";
  2. import { RegisterClass } from "../Misc/typeStore.js";
  3. /**
  4. * @experimental
  5. * Represents a connection point for a signal.
  6. * When an output point is activated, it will activate the connected input point.
  7. * When an input point is activated, it will execute the block it belongs to.
  8. */
  9. export class FlowGraphSignalConnection extends FlowGraphConnection {
  10. /**
  11. * @internal
  12. * A signal input can be connected to more than one signal output,
  13. * but a signal output can only connect to one signal input
  14. * @returns true if the connection is singular
  15. */
  16. _isSingularConnection() {
  17. return this.connectionType === FlowGraphConnectionType.Output;
  18. }
  19. /**
  20. * @internal
  21. */
  22. _activateSignal(context) {
  23. if (this.connectionType === FlowGraphConnectionType.Input) {
  24. context._notifyExecuteNode(this._ownerBlock);
  25. this._ownerBlock._execute(context, this);
  26. context._increaseExecutionId();
  27. }
  28. else {
  29. this._connectedPoint[0]?._activateSignal(context);
  30. }
  31. }
  32. }
  33. RegisterClass("FlowGraphSignalConnection", FlowGraphSignalConnection);
  34. //# sourceMappingURL=flowGraphSignalConnection.js.map