@babylonjs/core 6.33.1 → 6.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animationGroup.js +2 -2
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/animationGroupMask.d.ts +4 -0
- package/Animations/animationGroupMask.js +4 -0
- package/Animations/animationGroupMask.js.map +1 -1
- package/Compute/computeShader.d.ts +5 -0
- package/Compute/computeShader.js +42 -32
- package/Compute/computeShader.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js +4 -2
- package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/engine.d.ts +16 -10
- package/Engines/thinEngine.js +3 -2
- package/Engines/thinEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.d.ts +296 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +758 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -0
- package/FlowGraph/Blocks/Data/Math/index.d.ts +1 -5
- package/FlowGraph/Blocks/Data/Math/index.js +1 -5
- package/FlowGraph/Blocks/Data/Math/index.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +3 -3
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +3 -3
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +5 -0
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +25 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +22 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +11 -5
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +12 -6
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.d.ts +19 -0
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js +22 -0
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/index.d.ts +1 -0
- package/FlowGraph/Blocks/Data/index.js +1 -0
- package/FlowGraph/Blocks/Data/index.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +10 -5
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +15 -5
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js +2 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js +3 -2
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +0 -5
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +2 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +2 -2
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +13 -5
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +14 -12
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +2 -6
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +3 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.d.ts +16 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js +26 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.d.ts +1 -6
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +4 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +4 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +3 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +6 -5
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/index.d.ts +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/index.js +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/index.js.map +1 -1
- package/FlowGraph/Blocks/Execution/{flowGraphLogBlock.d.ts → flowGraphConsoleLogBlock.d.ts} +3 -2
- package/FlowGraph/Blocks/Execution/{flowGraphLogBlock.js → flowGraphConsoleLogBlock.js} +7 -6
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.d.ts +16 -8
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +17 -10
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +4 -3
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +7 -6
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +12 -7
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +10 -9
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/index.d.ts +1 -2
- package/FlowGraph/Blocks/Execution/index.js +1 -3
- package/FlowGraph/Blocks/Execution/index.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +3 -1
- package/FlowGraph/flowGraph.js +6 -2
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphAsyncExecutionBlock.d.ts +6 -2
- package/FlowGraph/flowGraphAsyncExecutionBlock.js +2 -1
- package/FlowGraph/flowGraphAsyncExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphBlock.d.ts +7 -2
- package/FlowGraph/flowGraphBlock.js +36 -14
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +9 -5
- package/FlowGraph/flowGraphContext.js +7 -2
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +4 -5
- package/FlowGraph/flowGraphCoordinator.js +12 -7
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphEventBlock.js +1 -1
- package/FlowGraph/flowGraphEventBlock.js.map +1 -1
- package/FlowGraph/flowGraphExecutionBlock.d.ts +3 -2
- package/FlowGraph/flowGraphExecutionBlock.js +7 -11
- package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphPath.d.ts +20 -2
- package/FlowGraph/flowGraphPath.js +27 -7
- package/FlowGraph/flowGraphPath.js.map +1 -1
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.d.ts +3 -3
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js +3 -3
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js.map +1 -1
- package/FlowGraph/index.d.ts +3 -0
- package/FlowGraph/index.js +3 -0
- package/FlowGraph/index.js.map +1 -1
- package/FlowGraph/serialization.js +20 -6
- package/FlowGraph/serialization.js.map +1 -1
- package/FlowGraph/typeDefinitions.d.ts +33 -0
- package/FlowGraph/typeDefinitions.js +2 -0
- package/FlowGraph/typeDefinitions.js.map +1 -0
- package/Lights/light.d.ts +15 -0
- package/Lights/light.js +18 -0
- package/Lights/light.js.map +1 -1
- package/Lights/shadowLight.d.ts +18 -1
- package/Lights/shadowLight.js +34 -1
- package/Lights/shadowLight.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlock.js +9 -1
- package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
- package/Meshes/abstractMesh.js +3 -1
- package/Meshes/abstractMesh.js.map +1 -1
- package/XR/features/WebXRMeshDetector.d.ts +14 -2
- package/XR/features/WebXRMeshDetector.js +43 -8
- package/XR/features/WebXRMeshDetector.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +1 -2
- package/scene.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.d.ts +0 -172
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js +0 -235
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.d.ts +0 -269
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js +0 -429
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.d.ts +0 -115
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js +0 -146
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.d.ts +0 -155
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js +0 -190
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.d.ts +0 -116
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js +0 -144
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js.map +0 -1
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
2
2
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
3
3
|
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
4
|
-
import {
|
|
4
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock";
|
|
5
5
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
6
|
+
/**
|
|
7
|
+
* @experimental
|
|
8
|
+
*/
|
|
9
|
+
export interface IFlowGraphDoNBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
10
|
+
startIndex: number;
|
|
11
|
+
}
|
|
6
12
|
/**
|
|
7
13
|
* A block that executes a branch a set number of times.
|
|
8
14
|
* @experimental
|
|
9
15
|
*/
|
|
10
|
-
export declare class FlowGraphDoNBlock extends
|
|
16
|
+
export declare class FlowGraphDoNBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
17
|
+
config: IFlowGraphDoNBlockConfiguration;
|
|
11
18
|
/**
|
|
12
19
|
* Input connection: Resets the counter
|
|
13
20
|
*/
|
|
@@ -15,12 +22,13 @@ export declare class FlowGraphDoNBlock extends FlowGraphWithOnDoneExecutionBlock
|
|
|
15
22
|
/**
|
|
16
23
|
* Input connection: The maximum number of times the block can be executed.
|
|
17
24
|
*/
|
|
18
|
-
readonly
|
|
25
|
+
readonly n: FlowGraphDataConnection<number>;
|
|
19
26
|
/**
|
|
20
27
|
* Output connection: The number of times the block has been executed.
|
|
21
28
|
*/
|
|
22
|
-
readonly
|
|
23
|
-
constructor(config?:
|
|
29
|
+
readonly value: FlowGraphDataConnection<number>;
|
|
30
|
+
constructor(config?: IFlowGraphDoNBlockConfiguration);
|
|
24
31
|
_execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void;
|
|
25
32
|
getClassName(): string;
|
|
33
|
+
static ClassName: string;
|
|
26
34
|
}
|
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
import { RichTypeNumber } from "../../../flowGraphRichTypes.js";
|
|
2
|
-
import {
|
|
2
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock.js";
|
|
3
3
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
4
|
/**
|
|
5
5
|
* A block that executes a branch a set number of times.
|
|
6
6
|
* @experimental
|
|
7
7
|
*/
|
|
8
|
-
export class FlowGraphDoNBlock extends
|
|
9
|
-
constructor(config) {
|
|
8
|
+
export class FlowGraphDoNBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
9
|
+
constructor(config = { startIndex: 0 }) {
|
|
10
10
|
super(config);
|
|
11
|
+
this.config = config;
|
|
11
12
|
this.reset = this._registerSignalInput("reset");
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
13
|
+
this.n = this.registerDataInput("n", RichTypeNumber);
|
|
14
|
+
this.value = this.registerDataOutput("value", RichTypeNumber);
|
|
14
15
|
}
|
|
15
16
|
_execute(context, callingSignal) {
|
|
16
17
|
if (callingSignal === this.reset) {
|
|
17
|
-
this.
|
|
18
|
+
this.value.setValue(this.config.startIndex, context);
|
|
18
19
|
}
|
|
19
20
|
else {
|
|
20
|
-
const currentCountValue = this.
|
|
21
|
-
if (currentCountValue < this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
21
|
+
const currentCountValue = this.value.getValue(context);
|
|
22
|
+
if (currentCountValue < this.n.getValue(context)) {
|
|
23
|
+
this.value.setValue(currentCountValue + 1, context);
|
|
24
|
+
this.out._activateSignal(context);
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
getClassName() {
|
|
28
|
-
return
|
|
29
|
+
return FlowGraphDoNBlock.ClassName;
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
+
FlowGraphDoNBlock.ClassName = "FGDoNBlock";
|
|
33
|
+
RegisterClass(FlowGraphDoNBlock.ClassName, FlowGraphDoNBlock);
|
|
32
34
|
//# sourceMappingURL=flowGraphDoNBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphDoNBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"flowGraphDoNBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAS3D;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,oCAAoC;IAcvE,YAAmB,SAA0C,EAAE,UAAU,EAAE,CAAC,EAAE;QAC1E,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAqD;QAE1E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QACrD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAClE,CAAC;IAEM,QAAQ,CAAC,OAAyB,EAAE,aAAwC;QAC/E,IAAI,aAAa,KAAK,IAAI,CAAC,KAAK,EAAE;YAC9B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;SACxD;aAAM;YACH,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACvD,IAAI,iBAAiB,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;gBAC9C,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,iBAAiB,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;gBACpD,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;aACrC;SACJ;IACL,CAAC;IAEM,YAAY;QACf,OAAO,iBAAiB,CAAC,SAAS,CAAC;IACvC,CAAC;;AAEa,2BAAS,GAAG,YAAY,CAAC;AAE3C,aAAa,CAAC,iBAAiB,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\n\r\n/**\r\n * @experimental\r\n */\r\nexport interface IFlowGraphDoNBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n startIndex: number;\r\n}\r\n/**\r\n * A block that executes a branch a set number of times.\r\n * @experimental\r\n */\r\nexport class FlowGraphDoNBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: Resets the counter\r\n */\r\n public readonly reset: FlowGraphSignalConnection;\r\n /**\r\n * Input connection: The maximum number of times the block can be executed.\r\n */\r\n public readonly n: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The number of times the block has been executed.\r\n */\r\n public readonly value: FlowGraphDataConnection<number>;\r\n\r\n constructor(public config: IFlowGraphDoNBlockConfiguration = { startIndex: 0 }) {\r\n super(config);\r\n this.reset = this._registerSignalInput(\"reset\");\r\n this.n = this.registerDataInput(\"n\", RichTypeNumber);\r\n this.value = this.registerDataOutput(\"value\", RichTypeNumber);\r\n }\r\n\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n if (callingSignal === this.reset) {\r\n this.value.setValue(this.config.startIndex, context);\r\n } else {\r\n const currentCountValue = this.value.getValue(context);\r\n if (currentCountValue < this.n.getValue(context)) {\r\n this.value.setValue(currentCountValue + 1, context);\r\n this.out._activateSignal(context);\r\n }\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphDoNBlock.ClassName;\r\n }\r\n\r\n public static ClassName = \"FGDoNBlock\";\r\n}\r\nRegisterClass(FlowGraphDoNBlock.ClassName, FlowGraphDoNBlock);\r\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
2
2
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
3
|
-
import {
|
|
3
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock.js";
|
|
4
4
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
5
5
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
6
6
|
/**
|
|
7
7
|
* @experimental
|
|
8
8
|
* Block that executes an action in a loop.
|
|
9
9
|
*/
|
|
10
|
-
export declare class FlowGraphForLoopBlock extends
|
|
10
|
+
export declare class FlowGraphForLoopBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
11
11
|
/**
|
|
12
12
|
* Input connection: The start index of the loop.
|
|
13
13
|
*/
|
|
@@ -28,10 +28,6 @@ export declare class FlowGraphForLoopBlock extends FlowGraphWithOnDoneExecutionB
|
|
|
28
28
|
* Output connection: The signal that is activated when the loop body is executed.
|
|
29
29
|
*/
|
|
30
30
|
readonly onLoop: FlowGraphSignalConnection;
|
|
31
|
-
/**
|
|
32
|
-
* Output connection: The signal that is activated when the loop is done.
|
|
33
|
-
*/
|
|
34
|
-
readonly onDone: FlowGraphSignalConnection;
|
|
35
31
|
constructor(config?: IFlowGraphBlockConfiguration);
|
|
36
32
|
private _executeLoop;
|
|
37
33
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock.js";
|
|
2
2
|
import { RichTypeNumber } from "../../../flowGraphRichTypes.js";
|
|
3
3
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
4
|
/**
|
|
5
5
|
* @experimental
|
|
6
6
|
* Block that executes an action in a loop.
|
|
7
7
|
*/
|
|
8
|
-
export class FlowGraphForLoopBlock extends
|
|
8
|
+
export class FlowGraphForLoopBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
9
9
|
constructor(config) {
|
|
10
10
|
super(config);
|
|
11
11
|
this.startIndex = this.registerDataInput("startIndex", RichTypeNumber);
|
|
@@ -13,7 +13,6 @@ export class FlowGraphForLoopBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
|
13
13
|
this.step = this.registerDataInput("step", RichTypeNumber);
|
|
14
14
|
this.index = this.registerDataOutput("index", RichTypeNumber);
|
|
15
15
|
this.onLoop = this._registerSignalOutput("onLoop");
|
|
16
|
-
this.onDone = this._registerSignalOutput("onDone");
|
|
17
16
|
}
|
|
18
17
|
_executeLoop(context) {
|
|
19
18
|
let index = context._getExecutionVariable(this, "index");
|
|
@@ -27,7 +26,7 @@ export class FlowGraphForLoopBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
|
27
26
|
this._executeLoop(context);
|
|
28
27
|
}
|
|
29
28
|
else {
|
|
30
|
-
this.
|
|
29
|
+
this.out._activateSignal(context);
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphForLoopBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"flowGraphForLoopBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,sDAAyD;AAExG,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,oCAAoC;IAsB3E,YAAmB,MAAqC;QACpD,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;QACvE,IAAI,CAAC,QAAQ,GAAG,IAA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,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACpD,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC1D,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAClD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAEM,YAAY;QACf,OAAO,gBAAgB,CAAC;IAC5B,CAAC;CACJ;AACD,aAAa,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"core/FlowGraph/flowGraphWithOnDoneExecutionBlock\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\n/**\r\n * @experimental\r\n * Block that executes an action in a loop.\r\n */\r\nexport class FlowGraphForLoopBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The start index of the loop.\r\n */\r\n public readonly startIndex: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The end index of the loop.\r\n */\r\n public readonly endIndex: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The step of the loop.\r\n */\r\n public readonly step: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The current index of the loop.\r\n */\r\n public readonly index: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The signal that is activated when the loop body is executed.\r\n */\r\n public readonly onLoop: FlowGraphSignalConnection;\r\n\r\n public constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.startIndex = this.registerDataInput(\"startIndex\", RichTypeNumber);\r\n this.endIndex = this.registerDataInput(\"endIndex\", RichTypeNumber);\r\n this.step = this.registerDataInput(\"step\", RichTypeNumber);\r\n\r\n this.index = this.registerDataOutput(\"index\", RichTypeNumber);\r\n this.onLoop = this._registerSignalOutput(\"onLoop\");\r\n }\r\n\r\n private _executeLoop(context: FlowGraphContext) {\r\n let index = context._getExecutionVariable(this, \"index\");\r\n const endIndex = context._getExecutionVariable(this, \"endIndex\");\r\n if (index < endIndex) {\r\n this.index.setValue(index, context);\r\n this.onLoop._activateSignal(context);\r\n const step = context._getExecutionVariable(this, \"step\", 1);\r\n index += step;\r\n context._setExecutionVariable(this, \"index\", index);\r\n this._executeLoop(context);\r\n } else {\r\n this.out._activateSignal(context);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext): void {\r\n const index = this.startIndex.getValue(context);\r\n const endIndex = this.endIndex.getValue(context);\r\n const step = this.step.getValue(context);\r\n context._setExecutionVariable(this, \"index\", index);\r\n context._setExecutionVariable(this, \"endIndex\", endIndex);\r\n context._setExecutionVariable(this, \"step\", step);\r\n this._executeLoop(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGForLoopBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGForLoopBlock\", FlowGraphForLoopBlock);\r\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
2
|
+
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
3
|
+
import { FlowGraphExecutionBlock } from "../../../flowGraphExecutionBlock";
|
|
4
|
+
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
5
|
+
export interface IFlowGraphSequenceBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
6
|
+
numberOutputFlows: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class FlowGraphSequenceBlock extends FlowGraphExecutionBlock {
|
|
9
|
+
config: IFlowGraphSequenceBlockConfiguration;
|
|
10
|
+
outFlows: FlowGraphSignalConnection[];
|
|
11
|
+
constructor(config: IFlowGraphSequenceBlockConfiguration);
|
|
12
|
+
configure(): void;
|
|
13
|
+
_execute(context: FlowGraphContext): void;
|
|
14
|
+
getClassName(): string;
|
|
15
|
+
static ClassName: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
2
|
+
import { FlowGraphExecutionBlock } from "../../../flowGraphExecutionBlock.js";
|
|
3
|
+
export class FlowGraphSequenceBlock extends FlowGraphExecutionBlock {
|
|
4
|
+
constructor(config) {
|
|
5
|
+
super(config);
|
|
6
|
+
this.config = config;
|
|
7
|
+
}
|
|
8
|
+
configure() {
|
|
9
|
+
super.configure();
|
|
10
|
+
this.outFlows = [];
|
|
11
|
+
for (let i = 0; i < this.config.numberOutputFlows; i++) {
|
|
12
|
+
this.outFlows.push(this._registerSignalOutput(`${i}`));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
_execute(context) {
|
|
16
|
+
for (let i = 0; i < this.config.numberOutputFlows; i++) {
|
|
17
|
+
this.outFlows[i]._activateSignal(context);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
getClassName() {
|
|
21
|
+
return FlowGraphSequenceBlock.ClassName;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
FlowGraphSequenceBlock.ClassName = "FGSequenceBlock";
|
|
25
|
+
RegisterClass(FlowGraphSequenceBlock.ClassName, FlowGraphSequenceBlock);
|
|
26
|
+
//# sourceMappingURL=flowGraphSequenceBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowGraphSequenceBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAO3E,MAAM,OAAO,sBAAuB,SAAQ,uBAAuB;IAG/D,YAAmB,MAA4C;QAC3D,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAsC;IAE/D,CAAC;IAEM,SAAS;QACZ,KAAK,CAAC,SAAS,EAAE,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,EAAE,EAAE;YACpD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;SAC1D;IACL,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,EAAE,EAAE;YACpD,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;SAC7C;IACL,CAAC;IAEM,YAAY;QACf,OAAO,sBAAsB,CAAC,SAAS,CAAC;IAC5C,CAAC;;AAEa,gCAAS,GAAG,iBAAiB,CAAC;AAEhD,aAAa,CAAC,sBAAsB,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport { FlowGraphExecutionBlock } from \"../../../flowGraphExecutionBlock\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\n\r\nexport interface IFlowGraphSequenceBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n numberOutputFlows: number;\r\n}\r\n\r\nexport class FlowGraphSequenceBlock extends FlowGraphExecutionBlock {\r\n public outFlows: FlowGraphSignalConnection[];\r\n\r\n constructor(public config: IFlowGraphSequenceBlockConfiguration) {\r\n super(config);\r\n }\r\n\r\n public configure(): void {\r\n super.configure();\r\n this.outFlows = [];\r\n for (let i = 0; i < this.config.numberOutputFlows; i++) {\r\n this.outFlows.push(this._registerSignalOutput(`${i}`));\r\n }\r\n }\r\n\r\n public _execute(context: FlowGraphContext) {\r\n for (let i = 0; i < this.config.numberOutputFlows; i++) {\r\n this.outFlows[i]._activateSignal(context);\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphSequenceBlock.ClassName;\r\n }\r\n\r\n public static ClassName = \"FGSequenceBlock\";\r\n}\r\nRegisterClass(FlowGraphSequenceBlock.ClassName, FlowGraphSequenceBlock);\r\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
2
2
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
3
3
|
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
4
|
-
import {
|
|
4
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock";
|
|
5
5
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
6
6
|
/**
|
|
7
7
|
* @experimental
|
|
8
8
|
* A block that throttles the execution of its output flow.
|
|
9
9
|
*/
|
|
10
|
-
export declare class FlowGraphThrottleBlock extends
|
|
10
|
+
export declare class FlowGraphThrottleBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
11
11
|
/**
|
|
12
12
|
* Input connection: The duration of the throttle, in ms.
|
|
13
13
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { RichTypeNumber } from "../../../flowGraphRichTypes.js";
|
|
2
|
-
import {
|
|
2
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock.js";
|
|
3
3
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
4
|
/**
|
|
5
5
|
* @experimental
|
|
6
6
|
* A block that throttles the execution of its output flow.
|
|
7
7
|
*/
|
|
8
|
-
export class FlowGraphThrottleBlock extends
|
|
8
|
+
export class FlowGraphThrottleBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
9
9
|
constructor(config) {
|
|
10
10
|
super(config);
|
|
11
11
|
this.reset = this._registerSignalInput("reset");
|
|
@@ -19,7 +19,7 @@ export class FlowGraphThrottleBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
|
19
19
|
if (callingSignal === this.reset || lastExecutedTime === undefined || currentTime - lastExecutedTime > durationValue) {
|
|
20
20
|
//activate the output flow
|
|
21
21
|
this.timeRemaining.setValue(0, context);
|
|
22
|
-
this.
|
|
22
|
+
this.out._activateSignal(context);
|
|
23
23
|
context._setExecutionVariable(this, "lastExecutedTime", currentTime);
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphThrottleBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"flowGraphThrottleBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAElG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC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,iBAAiB,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * A block that throttles the execution of its output flow.\r\n */\r\nexport class FlowGraphThrottleBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The duration of the throttle, in ms.\r\n */\r\n public readonly duration: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: Resets the throttle.\r\n */\r\n public readonly reset: FlowGraphSignalConnection;\r\n /**\r\n * Output connection: The time remaining before the throttle is done, in ms.\r\n */\r\n public readonly timeRemaining: FlowGraphDataConnection<number>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.reset = this._registerSignalInput(\"reset\");\r\n this.duration = this.registerDataInput(\"duration\", RichTypeNumber);\r\n this.timeRemaining = this.registerDataOutput(\"timeRemaining\", RichTypeNumber);\r\n }\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n const lastExecutedTime = context._getExecutionVariable(this, \"lastExecutedTime\");\r\n const durationValue = this.duration.getValue(context);\r\n const currentTime = Date.now();\r\n if (callingSignal === this.reset || lastExecutedTime === undefined || currentTime - lastExecutedTime > durationValue) {\r\n //activate the output flow\r\n this.timeRemaining.setValue(0, context);\r\n this.out._activateSignal(context);\r\n context._setExecutionVariable(this, \"lastExecutedTime\", currentTime);\r\n } else {\r\n //activate the output flow after the remaining time\r\n const remaining = durationValue - (currentTime - lastExecutedTime);\r\n this.timeRemaining.setValue(remaining, context);\r\n }\r\n }\r\n public getClassName(): string {\r\n return \"FGThrottleBlock\";\r\n }\r\n}\r\nRegisterClass(\"FGThrottleBlock\", FlowGraphThrottleBlock);\r\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
2
|
-
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
3
2
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
4
3
|
import { FlowGraphAsyncExecutionBlock } from "../../../flowGraphAsyncExecutionBlock";
|
|
5
4
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
@@ -13,11 +12,6 @@ export declare class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {
|
|
|
13
12
|
* Input connection: The timeout of the timer.
|
|
14
13
|
*/
|
|
15
14
|
readonly timeout: FlowGraphDataConnection<number>;
|
|
16
|
-
/**
|
|
17
|
-
* Output connection: The signal that is activated when the timer is done.
|
|
18
|
-
* This signal is activated asynchronically.
|
|
19
|
-
*/
|
|
20
|
-
readonly onTimerDone: FlowGraphSignalConnection;
|
|
21
15
|
constructor(config?: IFlowGraphBlockConfiguration);
|
|
22
16
|
_preparePendingTasks(context: FlowGraphContext): void;
|
|
23
17
|
/**
|
|
@@ -27,4 +21,5 @@ export declare class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {
|
|
|
27
21
|
private _onEnded;
|
|
28
22
|
_cancelPendingTasks(context: FlowGraphContext): void;
|
|
29
23
|
getClassName(): string;
|
|
24
|
+
static ClassName: string;
|
|
30
25
|
}
|
|
@@ -12,7 +12,6 @@ export class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {
|
|
|
12
12
|
constructor(config) {
|
|
13
13
|
super(config);
|
|
14
14
|
this.timeout = this.registerDataInput("timeout", RichTypeNumber);
|
|
15
|
-
this.onTimerDone = this._registerSignalOutput("onTimerDone");
|
|
16
15
|
}
|
|
17
16
|
_preparePendingTasks(context) {
|
|
18
17
|
const currentTimeout = this.timeout.getValue(context);
|
|
@@ -34,7 +33,7 @@ export class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {
|
|
|
34
33
|
*/
|
|
35
34
|
_execute(context) {
|
|
36
35
|
this._startPendingTasks(context);
|
|
37
|
-
this.
|
|
36
|
+
this.out._activateSignal(context);
|
|
38
37
|
}
|
|
39
38
|
_onEnded(timer, context) {
|
|
40
39
|
const timers = context._getExecutionVariable(this, "runningTimers") || [];
|
|
@@ -46,7 +45,7 @@ export class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {
|
|
|
46
45
|
Tools.Warn("FlowGraphTimerBlock: Timer ended but was not found in the running timers list");
|
|
47
46
|
}
|
|
48
47
|
context._removePendingBlock(this);
|
|
49
|
-
this.
|
|
48
|
+
this.done._activateSignal(context);
|
|
50
49
|
}
|
|
51
50
|
_cancelPendingTasks(context) {
|
|
52
51
|
const timers = context._getExecutionVariable(this, "runningTimers") || [];
|
|
@@ -56,8 +55,9 @@ export class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {
|
|
|
56
55
|
context._deleteExecutionVariable(this, "runningTimers");
|
|
57
56
|
}
|
|
58
57
|
getClassName() {
|
|
59
|
-
return
|
|
58
|
+
return FlowGraphTimerBlock.ClassName;
|
|
60
59
|
}
|
|
61
60
|
}
|
|
61
|
+
FlowGraphTimerBlock.ClassName = "FGTimerBlock";
|
|
62
62
|
RegisterClass("FGTimerBlock", FlowGraphTimerBlock);
|
|
63
63
|
//# sourceMappingURL=flowGraphTimerBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphTimerBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flowGraphTimerBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/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;IAED;;OAEG;IACI,QAAQ,CAAC,OAAyB;QACrC,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEO,QAAQ,CAAC,KAAoB,EAAE,OAAyB;QAC5D,MAAM,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,CAAC;QAC1E,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACpC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YACd,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SAC3B;aAAM;YACH,KAAK,CAAC,IAAI,CAAC,+EAA+E,CAAC,CAAC;SAC/F;QACD,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAEM,mBAAmB,CAAC,OAAyB;QAChD,MAAM,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,CAAC;QAC1E,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;YACxB,KAAK,CAAC,OAAO,EAAE,CAAC;SACnB;QACD,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAC5D,CAAC;IAEM,YAAY;QACf,OAAO,mBAAmB,CAAC,SAAS,CAAC;IACzC,CAAC;;AAEa,6BAAS,GAAG,cAAc,CAAC;AAE7C,aAAa,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { AdvancedTimer } from \"../../../../Misc/timer\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport { FlowGraphAsyncExecutionBlock } from \"../../../flowGraphAsyncExecutionBlock\";\r\nimport { RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport { Tools } from \"../../../../Misc/tools\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Block that provides two different output flows. One is started immediately once the block is executed,\r\n * and the other is executed after a set time. The timer for this block runs based on the scene's render loop.\r\n */\r\nexport class FlowGraphTimerBlock extends FlowGraphAsyncExecutionBlock {\r\n /**\r\n * Input connection: The timeout of the timer.\r\n */\r\n public readonly timeout: FlowGraphDataConnection<number>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.timeout = this.registerDataInput(\"timeout\", RichTypeNumber);\r\n }\r\n\r\n public _preparePendingTasks(context: FlowGraphContext): void {\r\n const currentTimeout = this.timeout.getValue(context);\r\n\r\n if (currentTimeout !== undefined && currentTimeout >= 0) {\r\n const timers = context._getExecutionVariable(this, \"runningTimers\") || [];\r\n const scene = context.configuration.scene;\r\n const timer: AdvancedTimer = new AdvancedTimer({\r\n timeout: currentTimeout,\r\n contextObservable: scene.onBeforeRenderObservable,\r\n onEnded: () => this._onEnded(timer, context),\r\n });\r\n timer.start();\r\n\r\n timers.push(timer);\r\n context._setExecutionVariable(this, \"runningTimers\", timers);\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext) {\r\n this._startPendingTasks(context);\r\n this.out._activateSignal(context);\r\n }\r\n\r\n private _onEnded(timer: AdvancedTimer, context: FlowGraphContext) {\r\n const timers = context._getExecutionVariable(this, \"runningTimers\") || [];\r\n const index = timers.indexOf(timer);\r\n if (index !== -1) {\r\n timers.splice(index, 1);\r\n } else {\r\n Tools.Warn(\"FlowGraphTimerBlock: Timer ended but was not found in the running timers list\");\r\n }\r\n context._removePendingBlock(this);\r\n this.done._activateSignal(context);\r\n }\r\n\r\n public _cancelPendingTasks(context: FlowGraphContext): void {\r\n const timers = context._getExecutionVariable(this, \"runningTimers\") || [];\r\n for (const timer of timers) {\r\n timer.dispose();\r\n }\r\n context._deleteExecutionVariable(this, \"runningTimers\");\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphTimerBlock.ClassName;\r\n }\r\n\r\n public static ClassName = \"FGTimerBlock\";\r\n}\r\nRegisterClass(\"FGTimerBlock\", FlowGraphTimerBlock);\r\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
2
2
|
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
3
|
-
import {
|
|
3
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock";
|
|
4
4
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
5
5
|
/**
|
|
6
6
|
* @experimental
|
|
@@ -16,7 +16,7 @@ export interface IFlowGraphWaitAllBlockConfiguration extends IFlowGraphBlockConf
|
|
|
16
16
|
* @experimental
|
|
17
17
|
* A block that waits for all input flows to be activated before activating its output flow.
|
|
18
18
|
*/
|
|
19
|
-
export declare class FlowGraphWaitAllBlock extends
|
|
19
|
+
export declare class FlowGraphWaitAllBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
20
20
|
config: IFlowGraphWaitAllBlockConfiguration;
|
|
21
21
|
/**
|
|
22
22
|
* Input connection: Resets the block.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock.js";
|
|
2
2
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
3
3
|
/**
|
|
4
4
|
* @experimental
|
|
5
5
|
* A block that waits for all input flows to be activated before activating its output flow.
|
|
6
6
|
*/
|
|
7
|
-
export class FlowGraphWaitAllBlock extends
|
|
7
|
+
export class FlowGraphWaitAllBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
8
8
|
constructor(config) {
|
|
9
9
|
super(config);
|
|
10
10
|
this.config = config;
|
|
@@ -44,7 +44,7 @@ export class FlowGraphWaitAllBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
|
44
44
|
activationState[i] = false;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
else if (callingSignal === this.
|
|
47
|
+
else if (callingSignal === this.in) {
|
|
48
48
|
activationState[0] = true;
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
@@ -55,7 +55,7 @@ export class FlowGraphWaitAllBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
|
55
55
|
}
|
|
56
56
|
context._setExecutionVariable(this, "activationState", activationState.slice());
|
|
57
57
|
if (activationState.every((value) => value)) {
|
|
58
|
-
this.
|
|
58
|
+
this.out._activateSignal(context);
|
|
59
59
|
for (let i = 0; i < this.config.numberInputFlows; i++) {
|
|
60
60
|
activationState[i] = false;
|
|
61
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphWaitAllBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"flowGraphWaitAllBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAElG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAY3D;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,oCAAoC;IAW3E,YAAmB,MAA2C;QAC1D,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAqC;QAN9D;;WAEG;QACa,YAAO,GAAgC,EAAE,CAAC;QA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flowGraphSignalConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * @experimental\r\n * Configuration for the wait all block.\r\n */\r\nexport interface IFlowGraphWaitAllBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * The number of input flows. There will always be at least one input flow.\r\n */\r\n numberInputFlows: number;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * A block that waits for all input flows to be activated before activating its output flow.\r\n */\r\nexport class FlowGraphWaitAllBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: Resets the block.\r\n */\r\n public reset: FlowGraphSignalConnection;\r\n /**\r\n * Input connection: The 2nd to nth input flows (the first is named onStart)\r\n */\r\n public readonly inFlows: FlowGraphSignalConnection[] = [];\r\n private _cachedActivationState: boolean[] = [];\r\n\r\n constructor(public config: IFlowGraphWaitAllBlockConfiguration) {\r\n super(config);\r\n\r\n this.reset = this._registerSignalInput(\"reset\");\r\n }\r\n\r\n configure(): void {\r\n // The first inFlow is the default input signal all execution blocks have\r\n for (let i = 1; i < this.config.numberInputFlows; i++) {\r\n this.inFlows.push(this._registerSignalInput(`in${i}`));\r\n }\r\n }\r\n\r\n private _getCurrentActivationState(context: FlowGraphContext) {\r\n const activationState = this._cachedActivationState;\r\n activationState.length = 0;\r\n if (!context._hasExecutionVariable(this, \"activationState\")) {\r\n for (let i = 0; i < this.config.numberInputFlows; i++) {\r\n activationState.push(false);\r\n }\r\n } else {\r\n const contextActivationState = context._getExecutionVariable(this, \"activationState\");\r\n for (let i = 0; i < contextActivationState.length; i++) {\r\n activationState.push(contextActivationState[i]);\r\n }\r\n }\r\n return activationState;\r\n }\r\n\r\n public _execute(context: FlowGraphContext, callingSignal: FlowGraphSignalConnection): void {\r\n const activationState = this._getCurrentActivationState(context);\r\n if (callingSignal === this.reset) {\r\n for (let i = 0; i < this.config.numberInputFlows; i++) {\r\n activationState[i] = false;\r\n }\r\n } else if (callingSignal === this.in) {\r\n activationState[0] = true;\r\n } else {\r\n const index = this.inFlows.indexOf(callingSignal);\r\n if (index >= 0) {\r\n activationState[index + 1] = true;\r\n }\r\n }\r\n\r\n context._setExecutionVariable(this, \"activationState\", activationState.slice());\r\n\r\n if (activationState.every((value: boolean) => value)) {\r\n this.out._activateSignal(context);\r\n for (let i = 0; i < this.config.numberInputFlows; i++) {\r\n activationState[i] = false;\r\n }\r\n }\r\n }\r\n\r\n public getClassName(): string {\r\n return \"FGWaitAllBlock\";\r\n }\r\n\r\n public serialize(serializationObject?: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.config.numberInputFlows = this.config.numberInputFlows;\r\n }\r\n}\r\nRegisterClass(\"FGWaitAllBlock\", FlowGraphWaitAllBlock);\r\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
2
2
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
3
3
|
import type { FlowGraphSignalConnection } from "../../../flowGraphSignalConnection";
|
|
4
|
-
import { FlowGraphWithOnDoneExecutionBlock } from "../../../flowGraphWithOnDoneExecutionBlock";
|
|
5
4
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
5
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock";
|
|
6
6
|
/**
|
|
7
7
|
* @experimental
|
|
8
8
|
* Configuration for the while loop block.
|
|
@@ -17,7 +17,7 @@ export interface IFlowGraphWhileLoopBlockConfiguration extends IFlowGraphBlockCo
|
|
|
17
17
|
* @experimental
|
|
18
18
|
* A block that executes a branch while a condition is true.
|
|
19
19
|
*/
|
|
20
|
-
export declare class FlowGraphWhileLoopBlock extends
|
|
20
|
+
export declare class FlowGraphWhileLoopBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
21
21
|
config?: IFlowGraphWhileLoopBlockConfiguration | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* Input connection: The condition to evaluate.
|
|
@@ -30,5 +30,6 @@ export declare class FlowGraphWhileLoopBlock extends FlowGraphWithOnDoneExecutio
|
|
|
30
30
|
constructor(config?: IFlowGraphWhileLoopBlockConfiguration | undefined);
|
|
31
31
|
_execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void;
|
|
32
32
|
getClassName(): string;
|
|
33
|
+
static ClassName: string;
|
|
33
34
|
serialize(serializationObject?: any): void;
|
|
34
35
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { RichTypeBoolean } from "../../../flowGraphRichTypes.js";
|
|
2
|
-
import { FlowGraphWithOnDoneExecutionBlock } from "../../../flowGraphWithOnDoneExecutionBlock.js";
|
|
3
2
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
3
|
+
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphWithOnDoneExecutionBlock.js";
|
|
4
4
|
/**
|
|
5
5
|
* @experimental
|
|
6
6
|
* A block that executes a branch while a condition is true.
|
|
7
7
|
*/
|
|
8
|
-
export class FlowGraphWhileLoopBlock extends
|
|
8
|
+
export class FlowGraphWhileLoopBlock extends FlowGraphExecutionBlockWithOutSignal {
|
|
9
9
|
constructor(config) {
|
|
10
10
|
super(config);
|
|
11
11
|
this.config = config;
|
|
@@ -22,10 +22,10 @@ export class FlowGraphWhileLoopBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
|
22
22
|
this.loopBody._activateSignal(context);
|
|
23
23
|
conditionValue = this.condition.getValue(context);
|
|
24
24
|
}
|
|
25
|
-
this.
|
|
25
|
+
this.out._activateSignal(context);
|
|
26
26
|
}
|
|
27
27
|
getClassName() {
|
|
28
|
-
return
|
|
28
|
+
return FlowGraphWhileLoopBlock.ClassName;
|
|
29
29
|
}
|
|
30
30
|
serialize(serializationObject) {
|
|
31
31
|
var _a;
|
|
@@ -33,5 +33,6 @@ export class FlowGraphWhileLoopBlock extends FlowGraphWithOnDoneExecutionBlock {
|
|
|
33
33
|
serializationObject.isDo = (_a = this.config) === null || _a === void 0 ? void 0 : _a.isDo;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
FlowGraphWhileLoopBlock.ClassName = "FGWhileLoopBlock";
|
|
37
|
+
RegisterClass(FlowGraphWhileLoopBlock.ClassName, FlowGraphWhileLoopBlock);
|
|
37
38
|
//# sourceMappingURL=flowGraphWhileLoopBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphWhileLoopBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphWhileLoopBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAYlG;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,oCAAoC;IAU7E,YAAmB,MAA8C;QAC7D,KAAK,CAAC,MAAM,CAAC,CAAC;QADC,WAAM,GAAN,MAAM,CAAwC;QAG7D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;QACtE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAC3D,CAAC;IAEM,QAAQ,CAAC,OAAyB,EAAE,cAAyC;;QAChF,IAAI,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtD,IAAI,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,IAAI,KAAI,CAAC,cAAc,EAAE;YACtC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;SAC1C;QACD,OAAO,cAAc,EAAE;YACnB,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YACvC,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;SACrD;QACD,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEM,YAAY;QACf,OAAO,uBAAuB,CAAC,SAAS,CAAC;IAC7C,CAAC;IAIM,SAAS,CAAC,mBAAyB;;QACtC,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,IAAI,GAAG,MAAA,IAAI,CAAC,MAAM,0CAAE,IAAI,CAAC;IACjD,CAAC;;AALa,iCAAS,GAAG,kBAAkB,CAAC;AAOjD,aAAa,CAAC,uBAAuB,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { RichTypeBoolean } from \"../../../flowGraphRichTypes\";\r\nimport type { FlowGraphSignalConnection } from \"../../../flowGraphSignalConnection\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphWithOnDoneExecutionBlock\";\r\n/**\r\n * @experimental\r\n * Configuration for the while loop block.\r\n */\r\nexport interface IFlowGraphWhileLoopBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * If true, the loop body will be executed at least once.\r\n */\r\n isDo?: boolean;\r\n}\r\n\r\n/**\r\n * @experimental\r\n * A block that executes a branch while a condition is true.\r\n */\r\nexport class FlowGraphWhileLoopBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The condition to evaluate.\r\n */\r\n public readonly condition: FlowGraphDataConnection<boolean>;\r\n /**\r\n * Output connection: The loop body.\r\n */\r\n public readonly loopBody: FlowGraphSignalConnection;\r\n\r\n constructor(public config?: IFlowGraphWhileLoopBlockConfiguration) {\r\n super(config);\r\n\r\n this.condition = this.registerDataInput(\"condition\", RichTypeBoolean);\r\n this.loopBody = this._registerSignalOutput(\"loopBody\");\r\n }\r\n\r\n public _execute(context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void {\r\n let conditionValue = this.condition.getValue(context);\r\n if (this.config?.isDo && !conditionValue) {\r\n this.loopBody._activateSignal(context);\r\n }\r\n while (conditionValue) {\r\n this.loopBody._activateSignal(context);\r\n conditionValue = this.condition.getValue(context);\r\n }\r\n this.out._activateSignal(context);\r\n }\r\n\r\n public getClassName(): string {\r\n return FlowGraphWhileLoopBlock.ClassName;\r\n }\r\n\r\n public static ClassName = \"FGWhileLoopBlock\";\r\n\r\n public serialize(serializationObject?: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.isDo = this.config?.isDo;\r\n }\r\n}\r\nRegisterClass(FlowGraphWhileLoopBlock.ClassName, FlowGraphWhileLoopBlock);\r\n"]}
|
|
@@ -10,4 +10,5 @@ export * from "./flowGraphCounterBlock.js";
|
|
|
10
10
|
export * from "./flowGraphWhileLoopBlock.js";
|
|
11
11
|
export * from "./flowGraphDebounceBlock.js";
|
|
12
12
|
export * from "./flowGraphFlipFlopBlock.js";
|
|
13
|
+
export * from "./flowGraphSequenceBlock.js";
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC","sourcesContent":["export * from \"./flowGraphBranchBlock\";\r\nexport * from \"./flowGraphDoNBlock\";\r\nexport * from \"./flowGraphForLoopBlock\";\r\nexport * from \"./flowGraphThrottleBlock\";\r\nexport * from \"./flowGraphTimerBlock\";\r\nexport * from \"./flowGraphMultiGateBlock\";\r\nexport * from \"./flowGraphSwitchBlock\";\r\nexport * from \"./flowGraphWaitAllBlock\";\r\nexport * from \"./flowGraphCounterBlock\";\r\nexport * from \"./flowGraphWhileLoopBlock\";\r\nexport * from \"./flowGraphDebounceBlock\";\r\nexport * from \"./flowGraphFlipFlopBlock\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/ControlFlow/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC","sourcesContent":["export * from \"./flowGraphBranchBlock\";\r\nexport * from \"./flowGraphDoNBlock\";\r\nexport * from \"./flowGraphForLoopBlock\";\r\nexport * from \"./flowGraphThrottleBlock\";\r\nexport * from \"./flowGraphTimerBlock\";\r\nexport * from \"./flowGraphMultiGateBlock\";\r\nexport * from \"./flowGraphSwitchBlock\";\r\nexport * from \"./flowGraphWaitAllBlock\";\r\nexport * from \"./flowGraphCounterBlock\";\r\nexport * from \"./flowGraphWhileLoopBlock\";\r\nexport * from \"./flowGraphDebounceBlock\";\r\nexport * from \"./flowGraphFlipFlopBlock\";\r\nexport * from \"./flowGraphSequenceBlock\";\r\n"]}
|