@p100-web/core 100.2.14 → 100.2.15
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/dist/GameContext.d.ts +21 -6
- package/dist/GameContext.d.ts.map +1 -1
- package/dist/GameContext.js +151 -36
- package/dist/GameContext.js.map +1 -1
- package/dist/IDBApp.d.ts +4 -2
- package/dist/IDBApp.d.ts.map +1 -1
- package/dist/IDBLogic.d.ts +7 -0
- package/dist/IDBLogic.d.ts.map +1 -0
- package/dist/IDBLogic.js +2 -0
- package/dist/IDBLogic.js.map +1 -0
- package/dist/IDBValue.d.ts +19 -0
- package/dist/IDBValue.d.ts.map +1 -0
- package/dist/IDBValue.js +2 -0
- package/dist/IDBValue.js.map +1 -0
- package/dist/IEntity.d.ts +4 -0
- package/dist/IEntity.d.ts.map +1 -0
- package/dist/IEntity.js +2 -0
- package/dist/IEntity.js.map +1 -0
- package/dist/PComponent.d.ts +9 -13
- package/dist/PComponent.d.ts.map +1 -1
- package/dist/PComponent.js +17 -28
- package/dist/PComponent.js.map +1 -1
- package/dist/PEnums.d.ts +10 -1
- package/dist/PEnums.d.ts.map +1 -1
- package/dist/PEnums.js +11 -1
- package/dist/PEnums.js.map +1 -1
- package/dist/PLogic.d.ts +19 -0
- package/dist/PLogic.d.ts.map +1 -0
- package/dist/PLogic.js +24 -0
- package/dist/PLogic.js.map +1 -0
- package/dist/PNode.d.ts +1 -1
- package/dist/PNode.d.ts.map +1 -1
- package/dist/PNode.js +6 -5
- package/dist/PNode.js.map +1 -1
- package/dist/PTypes.d.ts +5 -1
- package/dist/PTypes.d.ts.map +1 -1
- package/dist/PValue.d.ts +20 -0
- package/dist/PValue.d.ts.map +1 -0
- package/dist/PValue.js +68 -0
- package/dist/PValue.js.map +1 -0
- package/dist/index.d.ts +15 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -3
- package/dist/index.js.map +1 -1
- package/dist/pcomponents/BaseMaterial.d.ts +0 -1
- package/dist/pcomponents/BaseMaterial.d.ts.map +1 -1
- package/dist/pcomponents/PAnimator.d.ts +9 -9
- package/dist/pcomponents/PAnimator.d.ts.map +1 -1
- package/dist/pcomponents/PBackground.d.ts +0 -1
- package/dist/pcomponents/PBackground.d.ts.map +1 -1
- package/dist/pcomponents/PBasicMaterial.d.ts +2 -2
- package/dist/pcomponents/PBasicMaterial.d.ts.map +1 -1
- package/dist/pcomponents/PCallAction.d.ts +4 -4
- package/dist/pcomponents/PCallAction.d.ts.map +1 -1
- package/dist/pcomponents/PCameraPosition.d.ts +6 -6
- package/dist/pcomponents/PCameraPosition.d.ts.map +1 -1
- package/dist/pcomponents/PCameraTarget.d.ts +6 -6
- package/dist/pcomponents/PCameraTarget.d.ts.map +1 -1
- package/dist/pcomponents/PCollider.d.ts +4 -4
- package/dist/pcomponents/PCollider.d.ts.map +1 -1
- package/dist/pcomponents/PCompare.d.ts +8 -7
- package/dist/pcomponents/PCompare.d.ts.map +1 -1
- package/dist/pcomponents/PCompare.js +3 -2
- package/dist/pcomponents/PCompare.js.map +1 -1
- package/dist/pcomponents/PControllerInput.d.ts +5 -5
- package/dist/pcomponents/PControllerInput.d.ts.map +1 -1
- package/dist/pcomponents/PDebug.d.ts +2 -2
- package/dist/pcomponents/PDebug.d.ts.map +1 -1
- package/dist/pcomponents/PFadeAnimation.d.ts +6 -6
- package/dist/pcomponents/PFadeAnimation.d.ts.map +1 -1
- package/dist/pcomponents/PImageDetector.d.ts +2 -2
- package/dist/pcomponents/PImageDetector.d.ts.map +1 -1
- package/dist/pcomponents/PInteger.d.ts +9 -9
- package/dist/pcomponents/PInteger.d.ts.map +1 -1
- package/dist/pcomponents/PIntegerAnimator.d.ts +6 -6
- package/dist/pcomponents/PIntegerAnimator.d.ts.map +1 -1
- package/dist/pcomponents/PLayerManager.d.ts +7 -7
- package/dist/pcomponents/PLayerManager.d.ts.map +1 -1
- package/dist/pcomponents/PMaterialModifier.d.ts +5 -5
- package/dist/pcomponents/PMaterialModifier.d.ts.map +1 -1
- package/dist/pcomponents/PModelAnnotation.d.ts +7 -7
- package/dist/pcomponents/PModelAnnotation.d.ts.map +1 -1
- package/dist/pcomponents/PModelAnnotations.d.ts +7 -7
- package/dist/pcomponents/PModelAnnotations.d.ts.map +1 -1
- package/dist/pcomponents/PModelGLTF.d.ts +3 -3
- package/dist/pcomponents/PModelGLTF.d.ts.map +1 -1
- package/dist/pcomponents/PMoveAnimation.d.ts +2 -2
- package/dist/pcomponents/PMoveAnimation.d.ts.map +1 -1
- package/dist/pcomponents/PMoveToAnimation.d.ts +3 -3
- package/dist/pcomponents/PMoveToAnimation.d.ts.map +1 -1
- package/dist/pcomponents/PNodeVariable.d.ts +8 -7
- package/dist/pcomponents/PNodeVariable.d.ts.map +1 -1
- package/dist/pcomponents/PNodeVariable.js +2 -1
- package/dist/pcomponents/PNodeVariable.js.map +1 -1
- package/dist/pcomponents/PNumberAnimator.d.ts +8 -8
- package/dist/pcomponents/PNumberAnimator.d.ts.map +1 -1
- package/dist/pcomponents/PPhysicalMaterial.d.ts +2 -2
- package/dist/pcomponents/PPhysicalMaterial.d.ts.map +1 -1
- package/dist/pcomponents/PPlaneDetector.d.ts +2 -2
- package/dist/pcomponents/PPlaneDetector.d.ts.map +1 -1
- package/dist/pcomponents/PProjectRoot.d.ts +11 -11
- package/dist/pcomponents/PProjectRoot.d.ts.map +1 -1
- package/dist/pcomponents/PRotateAnimation.d.ts +5 -5
- package/dist/pcomponents/PRotateAnimation.d.ts.map +1 -1
- package/dist/pcomponents/PScaleAnimation.d.ts +3 -3
- package/dist/pcomponents/PScaleAnimation.d.ts.map +1 -1
- package/dist/pcomponents/PSceneContainer.d.ts +5 -5
- package/dist/pcomponents/PSceneContainer.d.ts.map +1 -1
- package/dist/pcomponents/PSceneRoot.d.ts +2 -2
- package/dist/pcomponents/PSceneRoot.d.ts.map +1 -1
- package/dist/pcomponents/PSlider.d.ts +5 -5
- package/dist/pcomponents/PSlider.d.ts.map +1 -1
- package/dist/pcomponents/PSound.d.ts +6 -6
- package/dist/pcomponents/PSound.d.ts.map +1 -1
- package/dist/pcomponents/PSpriteSheet.d.ts +4 -4
- package/dist/pcomponents/PSpriteSheet.d.ts.map +1 -1
- package/dist/pcomponents/PText.d.ts +4 -4
- package/dist/pcomponents/PText.d.ts.map +1 -1
- package/dist/pcomponents/PVarList.d.ts +10 -11
- package/dist/pcomponents/PVarList.d.ts.map +1 -1
- package/dist/pcomponents/PVarList.js +5 -8
- package/dist/pcomponents/PVarList.js.map +1 -1
- package/dist/pcomponents/PVideoPlayer.d.ts +6 -6
- package/dist/pcomponents/PVideoPlayer.d.ts.map +1 -1
- package/dist/pcomponents/PVisibility.d.ts +10 -10
- package/dist/pcomponents/PVisibility.d.ts.map +1 -1
- package/dist/pcomponents/PXRTools.d.ts +7 -7
- package/dist/pcomponents/PXRTools.d.ts.map +1 -1
- package/dist/plogics/PLAnd.d.ts +18 -0
- package/dist/plogics/PLAnd.d.ts.map +1 -0
- package/dist/plogics/PLAnd.js +45 -0
- package/dist/plogics/PLAnd.js.map +1 -0
- package/dist/plogics/PLCompare.d.ts +28 -0
- package/dist/plogics/PLCompare.d.ts.map +1 -0
- package/dist/plogics/PLCompare.js +63 -0
- package/dist/plogics/PLCompare.js.map +1 -0
- package/dist/plogics/PLEquals.d.ts +18 -0
- package/dist/plogics/PLEquals.d.ts.map +1 -0
- package/dist/plogics/PLEquals.js +46 -0
- package/dist/plogics/PLEquals.js.map +1 -0
- package/dist/plogics/PLOr.d.ts +18 -0
- package/dist/plogics/PLOr.d.ts.map +1 -0
- package/dist/plogics/PLOr.js +43 -0
- package/dist/plogics/PLOr.js.map +1 -0
- package/dist/ports/{IDBLink.d.ts → IDBEventLink.d.ts} +5 -5
- package/dist/ports/IDBEventLink.d.ts.map +1 -0
- package/dist/ports/IDBEventLink.js +2 -0
- package/dist/ports/IDBEventLink.js.map +1 -0
- package/dist/ports/IDBValueLink.d.ts +14 -0
- package/dist/ports/IDBValueLink.d.ts.map +1 -0
- package/dist/ports/IDBValueLink.js +2 -0
- package/dist/ports/IDBValueLink.js.map +1 -0
- package/dist/ports/PInEventPort.d.ts +8 -6
- package/dist/ports/PInEventPort.d.ts.map +1 -1
- package/dist/ports/PInEventPort.js +10 -5
- package/dist/ports/PInEventPort.js.map +1 -1
- package/dist/ports/PInValuePort.d.ts +13 -10
- package/dist/ports/PInValuePort.d.ts.map +1 -1
- package/dist/ports/PInValuePort.js +22 -38
- package/dist/ports/PInValuePort.js.map +1 -1
- package/dist/ports/PLink.d.ts +7 -5
- package/dist/ports/PLink.d.ts.map +1 -1
- package/dist/ports/PLink.js +12 -9
- package/dist/ports/PLink.js.map +1 -1
- package/dist/ports/POutEventPort.d.ts +9 -7
- package/dist/ports/POutEventPort.d.ts.map +1 -1
- package/dist/ports/POutEventPort.js +47 -31
- package/dist/ports/POutEventPort.js.map +1 -1
- package/dist/ports/POutValuePort.d.ts +16 -6
- package/dist/ports/POutValuePort.d.ts.map +1 -1
- package/dist/ports/POutValuePort.js +29 -6
- package/dist/ports/POutValuePort.js.map +1 -1
- package/dist/ports/PPort.d.ts +5 -2
- package/dist/ports/PPort.d.ts.map +1 -1
- package/dist/ports/PPort.js.map +1 -1
- package/dist/ports/PValueLink.d.ts +20 -0
- package/dist/ports/PValueLink.d.ts.map +1 -0
- package/dist/ports/PValueLink.js +39 -0
- package/dist/ports/PValueLink.js.map +1 -0
- package/package.json +29 -29
- package/dist/ports/IDBInValue.d.ts +0 -6
- package/dist/ports/IDBInValue.d.ts.map +0 -1
- package/dist/ports/IDBInValue.js +0 -2
- package/dist/ports/IDBInValue.js.map +0 -1
- package/dist/ports/IDBLink.d.ts.map +0 -1
- package/dist/ports/IDBLink.js +0 -2
- package/dist/ports/IDBLink.js.map +0 -1
- package/dist/ports/IDBPayloadValue.d.ts +0 -5
- package/dist/ports/IDBPayloadValue.d.ts.map +0 -1
- package/dist/ports/IDBPayloadValue.js +0 -2
- package/dist/ports/IDBPayloadValue.js.map +0 -1
- package/dist/ports/IValue.d.ts +0 -10
- package/dist/ports/IValue.d.ts.map +0 -1
- package/dist/ports/IValue.js +0 -2
- package/dist/ports/IValue.js.map +0 -1
- package/dist/ports/PInValue.d.ts +0 -17
- package/dist/ports/PInValue.d.ts.map +0 -1
- package/dist/ports/PInValue.js +0 -31
- package/dist/ports/PInValue.js.map +0 -1
- package/dist/ports/PPayloadValue.d.ts +0 -16
- package/dist/ports/PPayloadValue.d.ts.map +0 -1
- package/dist/ports/PPayloadValue.js +0 -28
- package/dist/ports/PPayloadValue.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDBValueLink.js","sourceRoot":"","sources":["../../src/ports/IDBValueLink.ts"],"names":[],"mappings":""}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { PortTypes, DataType } from "../PEnums";
|
|
2
2
|
import PLink from "./PLink";
|
|
3
|
-
import { DBOutPort } from "./POutEventPort";
|
|
4
3
|
import PPort, { PortCallback, PortOwner, type Payload } from "./PPort";
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
interface IDBInEventPort {
|
|
5
|
+
portId: number;
|
|
6
|
+
label: string | null;
|
|
7
|
+
}
|
|
8
|
+
export { type IDBInEventPort };
|
|
7
9
|
export default class PInEventPort extends PPort {
|
|
8
10
|
links: PLink[];
|
|
9
11
|
callback: PortCallback;
|
|
10
|
-
label:
|
|
11
|
-
constructor(portType: PortTypes, owner: PortOwner, portId: number, pid: number, componentPid: number, name: string,
|
|
12
|
-
toDB():
|
|
12
|
+
label: string | null;
|
|
13
|
+
constructor(portType: PortTypes, owner: PortOwner, portId: number, pid: number, componentPid: number, name: string, dbItem: IDBInEventPort | null | undefined, dataType: DataType, callback: PortCallback);
|
|
14
|
+
toDB(): IDBInEventPort | undefined;
|
|
13
15
|
active(): boolean;
|
|
14
16
|
onEmit(payload: Payload): void;
|
|
15
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PInEventPort.d.ts","sourceRoot":"","sources":["../../src/ports/PInEventPort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"PInEventPort.d.ts","sourceRoot":"","sources":["../../src/ports/PInEventPort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvE,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,OAAO,EAAE,KAAK,cAAc,EAAE,CAAC;AAE/B,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,KAAK;IAC7C,KAAK,EAAE,KAAK,EAAE,CAAM;IAEpB,QAAQ,EAAE,YAAY,CAAC;IAGvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAQ;gBAG1B,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,EACzC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,YAAY;IAUxB,IAAI,IAAI,cAAc,GAAG,SAAS;IAQlC,MAAM;IAIN,MAAM,CAAC,OAAO,EAAE,OAAO;CAGxB"}
|
|
@@ -3,16 +3,21 @@ export default class PInEventPort extends PPort {
|
|
|
3
3
|
links = [];
|
|
4
4
|
callback;
|
|
5
5
|
// Port label
|
|
6
|
-
label;
|
|
7
|
-
constructor(portType, owner, portId, pid, componentPid, name,
|
|
6
|
+
label = null;
|
|
7
|
+
constructor(portType, owner, portId, pid, componentPid, name, dbItem, dataType, callback) {
|
|
8
8
|
super(portType, owner, pid, componentPid, portId, name, dataType);
|
|
9
|
-
this.label = label;
|
|
10
9
|
this.callback = callback;
|
|
10
|
+
if (dbItem) {
|
|
11
|
+
this.label = dbItem.label || null;
|
|
12
|
+
}
|
|
11
13
|
}
|
|
12
14
|
toDB() {
|
|
13
|
-
if (this.label
|
|
15
|
+
if (!this.label)
|
|
14
16
|
return undefined;
|
|
15
|
-
return
|
|
17
|
+
return {
|
|
18
|
+
portId: this.portId,
|
|
19
|
+
label: this.label,
|
|
20
|
+
};
|
|
16
21
|
}
|
|
17
22
|
active() {
|
|
18
23
|
return this.owner.active();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PInEventPort.js","sourceRoot":"","sources":["../../src/ports/PInEventPort.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PInEventPort.js","sourceRoot":"","sources":["../../src/ports/PInEventPort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAgD,MAAM,SAAS,CAAC;AASvE,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,KAAK;IAC7C,KAAK,GAAY,EAAE,CAAC;IAEpB,QAAQ,CAAe;IAEvB,aAAa;IACb,KAAK,GAAkB,IAAI,CAAC;IAE5B,YACE,QAAmB,EACnB,KAAgB,EAChB,MAAc,EACd,GAAW,EACX,YAAoB,EACpB,IAAY,EACZ,MAAyC,EACzC,QAAkB,EAClB,QAAsB;QAEtB,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAClE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC;QACpC,CAAC;IACH,CAAC;IAED,IAAI;QACF,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO,SAAS,CAAC;QAClC,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,OAAgB;QACrB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC7C,CAAC;CACF"}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import GameContext from "../GameContext";
|
|
2
|
-
import PComponent from "../PComponent";
|
|
3
1
|
import { DataType, PortTypes } from "../PEnums";
|
|
4
|
-
import PPort, { Payload } from "./PPort";
|
|
5
|
-
import
|
|
2
|
+
import PPort, { Payload, PortOwner } from "./PPort";
|
|
3
|
+
import PValueLink from "./PValueLink";
|
|
4
|
+
interface IDBInValuePort {
|
|
5
|
+
portId: number;
|
|
6
|
+
label: string | null;
|
|
7
|
+
staticValue: string | null;
|
|
8
|
+
}
|
|
9
|
+
export { type IDBInValuePort };
|
|
6
10
|
/**
|
|
7
11
|
* PInValuePort only exists on PNodes at the moment.
|
|
8
12
|
*/
|
|
9
13
|
export default class PInValuePort extends PPort {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
link(context: GameContext, value: PInValue): void;
|
|
14
|
+
links: PValueLink | null;
|
|
15
|
+
staticValue: string | null;
|
|
16
|
+
label: string | null;
|
|
17
|
+
constructor(portType: PortTypes, owner: PortOwner, portId: number, pid: number, componentPid: number, name: string, dbItem: IDBInValuePort | null | undefined, pinDataType: DataType);
|
|
18
|
+
toDB(): IDBInValuePort | undefined;
|
|
16
19
|
runtime_value(): Payload;
|
|
17
20
|
}
|
|
18
21
|
//# sourceMappingURL=PInValuePort.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PInValuePort.d.ts","sourceRoot":"","sources":["../../src/ports/PInValuePort.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"PInValuePort.d.ts","sourceRoot":"","sources":["../../src/ports/PInValuePort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,OAAO,EAAE,KAAK,cAAc,EAAE,CAAC;AAE/B;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,KAAK;IAC7C,KAAK,EAAE,UAAU,GAAG,IAAI,CAAQ;IAChC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAElC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAQ;gBAG1B,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,EACzC,WAAW,EAAE,QAAQ;IASvB,IAAI,IAAI,cAAc,GAAG,SAAS;IASlC,aAAa,IAAI,OAAO;CASzB"}
|
|
@@ -1,51 +1,35 @@
|
|
|
1
|
-
import { DataType, PortTypes } from "../PEnums";
|
|
2
1
|
import PPort from "./PPort";
|
|
3
2
|
/**
|
|
4
3
|
* PInValuePort only exists on PNodes at the moment.
|
|
5
4
|
*/
|
|
6
5
|
export default class PInValuePort extends PPort {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
link(context, value) {
|
|
16
|
-
this.value = value;
|
|
17
|
-
value.inPort = this;
|
|
18
|
-
// Are we linked? Might happen if set from admin
|
|
19
|
-
if (value.outPort) {
|
|
20
|
-
const index = value.outPort.links.indexOf(value);
|
|
21
|
-
if (index >= 0)
|
|
22
|
-
value.outPort.links.splice(index, 1);
|
|
23
|
-
value.outPort = null;
|
|
24
|
-
}
|
|
25
|
-
// Are we linked to a node?
|
|
26
|
-
if (value.portType & (PortTypes.PNode | PortTypes.Variable)) {
|
|
27
|
-
value.outPort = context.findOutValuePort(value);
|
|
28
|
-
if (value.outPort) {
|
|
29
|
-
value.outPort.links.push(value);
|
|
30
|
-
}
|
|
6
|
+
links = null;
|
|
7
|
+
staticValue = null;
|
|
8
|
+
label = null;
|
|
9
|
+
constructor(portType, owner, portId, pid, componentPid, name, dbItem, pinDataType) {
|
|
10
|
+
super(portType, owner, pid, componentPid, portId, name, pinDataType);
|
|
11
|
+
if (dbItem) {
|
|
12
|
+
this.label = dbItem.label;
|
|
13
|
+
this.staticValue = dbItem.staticValue;
|
|
31
14
|
}
|
|
32
15
|
}
|
|
16
|
+
toDB() {
|
|
17
|
+
if (!this.label && !this.staticValue)
|
|
18
|
+
return undefined;
|
|
19
|
+
return {
|
|
20
|
+
portId: this.portId,
|
|
21
|
+
label: this.label || null,
|
|
22
|
+
staticValue: this.staticValue || null,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
33
25
|
runtime_value() {
|
|
34
|
-
if (this.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return
|
|
38
|
-
if (this.dataType === DataType.Scene) {
|
|
39
|
-
return this.value.pid.toString();
|
|
40
|
-
}
|
|
41
|
-
else if (this.dataType === DataType.Node) {
|
|
42
|
-
return this.value.pid.toString();
|
|
26
|
+
if (this.links !== null) {
|
|
27
|
+
if (this.links.outPort !== null)
|
|
28
|
+
return this.links.outPort.runtime_value();
|
|
29
|
+
return "";
|
|
43
30
|
}
|
|
44
31
|
else {
|
|
45
|
-
|
|
46
|
-
this.value.staticValue === undefined)
|
|
47
|
-
return "";
|
|
48
|
-
return this.value.staticValue;
|
|
32
|
+
return this.staticValue || "";
|
|
49
33
|
}
|
|
50
34
|
}
|
|
51
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PInValuePort.js","sourceRoot":"","sources":["../../src/ports/PInValuePort.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PInValuePort.js","sourceRoot":"","sources":["../../src/ports/PInValuePort.ts"],"names":[],"mappings":"AACA,OAAO,KAA6B,MAAM,SAAS,CAAC;AAWpD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,KAAK;IAC7C,KAAK,GAAsB,IAAI,CAAC;IAChC,WAAW,GAAkB,IAAI,CAAC;IAElC,KAAK,GAAkB,IAAI,CAAC;IAE5B,YACE,QAAmB,EACnB,KAAgB,EAChB,MAAc,EACd,GAAW,EACX,YAAoB,EACpB,IAAY,EACZ,MAAyC,EACzC,WAAqB;QAErB,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;QACrE,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;YAC1B,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;QACxC,CAAC;IACH,CAAC;IAED,IAAI;QACF,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,WAAW;YAAE,OAAO,SAAS,CAAC;QACvD,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI;YACzB,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,IAAI;SACtC,CAAC;IACJ,CAAC;IAED,aAAa;QACX,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,KAAK,IAAI;gBAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;YAC5C,OAAO,EAAE,CAAC;QACZ,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;QAChC,CAAC;IACH,CAAC;CACF"}
|
package/dist/ports/PLink.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import PInEventPort from "./PInEventPort";
|
|
2
2
|
import POutEventPort from "./POutEventPort";
|
|
3
|
-
import { type
|
|
3
|
+
import { type IDBEventLink } from "./IDBEventLink";
|
|
4
4
|
import { PortTypes } from "../PEnums";
|
|
5
|
-
import PPayloadValue from "./PPayloadValue";
|
|
6
5
|
import PItem from "../PItem";
|
|
6
|
+
import PInValuePort from "./PInValuePort";
|
|
7
7
|
export default class PLink extends PItem {
|
|
8
8
|
index: number;
|
|
9
9
|
outPortType: PortTypes;
|
|
@@ -14,10 +14,12 @@ export default class PLink extends PItem {
|
|
|
14
14
|
inPid: number;
|
|
15
15
|
inComponentPid: number;
|
|
16
16
|
inPortId: number;
|
|
17
|
-
|
|
17
|
+
inValuePort: PInValuePort;
|
|
18
18
|
outPort: POutEventPort | null;
|
|
19
19
|
inPort: PInEventPort | null;
|
|
20
|
-
constructor(dbItem:
|
|
21
|
-
toDB():
|
|
20
|
+
constructor(dbItem: IDBEventLink);
|
|
21
|
+
toDB(): IDBEventLink;
|
|
22
|
+
active(): boolean;
|
|
23
|
+
hasCustomPayload(): boolean;
|
|
22
24
|
}
|
|
23
25
|
//# sourceMappingURL=PLink.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PLink.d.ts","sourceRoot":"","sources":["../../src/ports/PLink.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"PLink.d.ts","sourceRoot":"","sources":["../../src/ports/PLink.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAY,SAAS,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,KAAK;IACtC,KAAK,EAAE,MAAM,CAAC;IAEd,WAAW,EAAE,SAAS,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,SAAS,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IAEjB,WAAW,EAAE,YAAY,CAAC;IAG1B,OAAO,EAAE,aAAa,GAAG,IAAI,CAAQ;IACrC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAQ;gBAEvB,MAAM,EAAE,YAAY;IA2BhC,IAAI,IAAI,YAAY;IAoBpB,MAAM,IAAI,OAAO;IAIjB,gBAAgB;CAKjB"}
|
package/dist/ports/PLink.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { DataType, PortTypes } from "../PEnums";
|
|
2
2
|
import PItem from "../PItem";
|
|
3
|
+
import PInValuePort from "./PInValuePort";
|
|
3
4
|
export default class PLink extends PItem {
|
|
4
5
|
index;
|
|
5
6
|
outPortType;
|
|
@@ -10,7 +11,8 @@ export default class PLink extends PItem {
|
|
|
10
11
|
inPid;
|
|
11
12
|
inComponentPid;
|
|
12
13
|
inPortId;
|
|
13
|
-
|
|
14
|
+
inValuePort;
|
|
15
|
+
// Bound ports
|
|
14
16
|
outPort = null;
|
|
15
17
|
inPort = null;
|
|
16
18
|
constructor(dbItem) {
|
|
@@ -24,12 +26,7 @@ export default class PLink extends PItem {
|
|
|
24
26
|
this.inPid = dbItem.inPid;
|
|
25
27
|
this.inComponentPid = dbItem.inComponentPid;
|
|
26
28
|
this.inPortId = dbItem.inPortId;
|
|
27
|
-
|
|
28
|
-
this.payload = new PPayloadValue(dbItem.payload);
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
this.payload = null;
|
|
32
|
-
}
|
|
29
|
+
this.inValuePort = new PInValuePort(PortTypes.EventLink, this, 1, this.pid, 0, "Payload Value", dbItem.inValuePort, DataType.None);
|
|
33
30
|
}
|
|
34
31
|
toDB() {
|
|
35
32
|
return {
|
|
@@ -43,8 +40,14 @@ export default class PLink extends PItem {
|
|
|
43
40
|
inPid: this.inPid,
|
|
44
41
|
inComponentPid: this.inComponentPid,
|
|
45
42
|
inPortId: this.inPortId,
|
|
46
|
-
|
|
43
|
+
inValuePort: this.inValuePort.toDB(),
|
|
47
44
|
};
|
|
48
45
|
}
|
|
46
|
+
active() {
|
|
47
|
+
return this.outPort.owner.active() && this.inPort.owner.active();
|
|
48
|
+
}
|
|
49
|
+
hasCustomPayload() {
|
|
50
|
+
return (this.inValuePort.links !== null || this.inValuePort.staticValue !== null);
|
|
51
|
+
}
|
|
49
52
|
}
|
|
50
53
|
//# sourceMappingURL=PLink.js.map
|
package/dist/ports/PLink.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PLink.js","sourceRoot":"","sources":["../../src/ports/PLink.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,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QAAQ,CAAC,IAAI,CACd,CAAC;IACJ,CAAC;IAED,IAAI;QACF,OAAO;YACL,GAAG,KAAK,CAAC,IAAI,EAAE;YAEf,KAAK,EAAE,IAAI,CAAC,KAAK;YAEjB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,SAAS,EAAE,IAAI,CAAC,SAAS;YAEzB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ;YAEvB,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE;SACrC,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,OAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,IAAI,CAAC,MAAO,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IACrE,CAAC;IAED,gBAAgB;QACd,OAAO,CACL,IAAI,CAAC,WAAW,CAAC,KAAK,KAAK,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,WAAW,KAAK,IAAI,CACzE,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import GameContext from "../GameContext";
|
|
2
1
|
import { DataType, PortTypes } from "../PEnums";
|
|
3
2
|
import PLink from "./PLink";
|
|
4
3
|
import PInEventPort from "./PInEventPort";
|
|
5
4
|
import PPort, { Payload, PortOwner } from "./PPort";
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
interface IDBOutEventPort {
|
|
6
|
+
portId: number;
|
|
7
|
+
label: string | null;
|
|
8
|
+
}
|
|
9
|
+
export { type IDBOutEventPort };
|
|
8
10
|
export default class POutEventPort extends PPort {
|
|
9
11
|
links: PLink[];
|
|
10
|
-
label:
|
|
11
|
-
constructor(portType: PortTypes, owner: PortOwner, portId: number, pid: number, componentPid: number, name: string,
|
|
12
|
-
toDB():
|
|
12
|
+
label: string | null;
|
|
13
|
+
constructor(portType: PortTypes, owner: PortOwner, portId: number, pid: number, componentPid: number, name: string, dbItem: IDBOutEventPort | null | undefined, dataType: DataType);
|
|
14
|
+
toDB(): IDBOutEventPort | undefined;
|
|
13
15
|
/**
|
|
14
16
|
* This can be called from all Out Event Port types: Nodes, Events and Variables.
|
|
15
17
|
*/
|
|
16
|
-
link(
|
|
18
|
+
link(inPort: PInEventPort, plink: PLink): void;
|
|
17
19
|
isLinked(to: PInEventPort): boolean;
|
|
18
20
|
emit(payload: Payload): void;
|
|
19
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"POutEventPort.d.ts","sourceRoot":"","sources":["../../src/ports/POutEventPort.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"POutEventPort.d.ts","sourceRoot":"","sources":["../../src/ports/POutEventPort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpD,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,OAAO,EAAE,KAAK,eAAe,EAAE,CAAC;AAEhC,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK;IAC9C,KAAK,EAAE,KAAK,EAAE,CAAM;IAGpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAQ;gBAG1B,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,EAC1C,QAAQ,EAAE,QAAQ;IASpB,IAAI,IAAI,eAAe,GAAG,SAAS;IAQnC;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK;IAmCvC,QAAQ,CAAC,EAAE,EAAE,YAAY;IAIzB,IAAI,CAAC,OAAO,EAAE,OAAO;CAsBtB"}
|
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
import { PortTypes } from "../PEnums";
|
|
2
1
|
import PPort from "./PPort";
|
|
3
2
|
export default class POutEventPort extends PPort {
|
|
4
3
|
links = [];
|
|
5
4
|
// Port label
|
|
6
|
-
label;
|
|
7
|
-
constructor(portType, owner, portId, pid, componentPid, name,
|
|
5
|
+
label = null;
|
|
6
|
+
constructor(portType, owner, portId, pid, componentPid, name, dbItem, dataType) {
|
|
8
7
|
super(portType, owner, pid, componentPid, portId, name, dataType);
|
|
9
8
|
this.owner = owner;
|
|
10
|
-
|
|
9
|
+
if (dbItem) {
|
|
10
|
+
this.label = dbItem.label || null;
|
|
11
|
+
}
|
|
11
12
|
}
|
|
12
13
|
toDB() {
|
|
13
|
-
if (this.label
|
|
14
|
+
if (!this.label)
|
|
14
15
|
return undefined;
|
|
15
|
-
return
|
|
16
|
+
return {
|
|
17
|
+
portId: this.portId,
|
|
18
|
+
label: this.label,
|
|
19
|
+
};
|
|
16
20
|
}
|
|
17
21
|
/**
|
|
18
22
|
* This can be called from all Out Event Port types: Nodes, Events and Variables.
|
|
19
23
|
*/
|
|
20
|
-
link(
|
|
24
|
+
link(inPort, plink) {
|
|
21
25
|
plink.outPort = this;
|
|
22
26
|
plink.inPort = inPort;
|
|
23
27
|
this.links.push(plink);
|
|
@@ -25,39 +29,51 @@ export default class POutEventPort extends PPort {
|
|
|
25
29
|
// Set index
|
|
26
30
|
plink.index = this.links.length - 1;
|
|
27
31
|
// Payload override?
|
|
28
|
-
if (plink.payload) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
// if (plink.payload) {
|
|
33
|
+
// // We bind here, since this is the owner port for this value link
|
|
34
|
+
// const pvalue = plink.payload;
|
|
35
|
+
// pvalue.plink = plink;
|
|
36
|
+
// // Are we linked to a node?
|
|
37
|
+
// if (
|
|
38
|
+
// pvalue.portType &
|
|
39
|
+
// (PortTypes.PNode |
|
|
40
|
+
// PortTypes.Variable |
|
|
41
|
+
// PortTypes.Value |
|
|
42
|
+
// PortTypes.Logic)
|
|
43
|
+
// ) {
|
|
44
|
+
// pvalue.outPort = context.findOutValuePort(pvalue);
|
|
45
|
+
// if (!pvalue.outPort) {
|
|
46
|
+
// console.error("outPort not found", pvalue);
|
|
47
|
+
// return;
|
|
48
|
+
// }
|
|
49
|
+
// // And add to from port value array
|
|
50
|
+
// pvalue.outPort!.links.push(pvalue);
|
|
51
|
+
// }
|
|
52
|
+
// }
|
|
39
53
|
}
|
|
40
54
|
isLinked(to) {
|
|
41
55
|
return this.links.some((l) => l.inPort === to);
|
|
42
56
|
}
|
|
43
57
|
emit(payload) {
|
|
44
58
|
for (const link of this.links) {
|
|
59
|
+
// Skip unrendered nodes
|
|
45
60
|
if (!link.inPort?.active())
|
|
46
61
|
continue;
|
|
47
|
-
if (link.
|
|
48
|
-
|
|
49
|
-
// Check target data type
|
|
50
|
-
if (link.payload.pid > 0) {
|
|
51
|
-
payload = link.payload.pid.toString();
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
payload = link.payload.staticValue;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
else if (link.payload.outPort !== null) {
|
|
58
|
-
payload = link.payload.outPort.runtime_value();
|
|
59
|
-
}
|
|
62
|
+
if (link.inValuePort.links !== null) {
|
|
63
|
+
payload = link.inValuePort.runtime_value();
|
|
60
64
|
}
|
|
65
|
+
// if (link.payload !== null) {
|
|
66
|
+
// if (link.payload.portType === PortTypes.Static) {
|
|
67
|
+
// // Check target data type
|
|
68
|
+
// if (link.payload.pid > 0) {
|
|
69
|
+
// payload = link.payload.pid.toString();
|
|
70
|
+
// } else {
|
|
71
|
+
// payload = link.payload.staticValue;
|
|
72
|
+
// }
|
|
73
|
+
// } else if (link.payload.outPort !== null) {
|
|
74
|
+
// payload = link.payload.outPort.runtime_value();
|
|
75
|
+
// }
|
|
76
|
+
// }
|
|
61
77
|
link.inPort?.onEmit(payload);
|
|
62
78
|
}
|
|
63
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"POutEventPort.js","sourceRoot":"","sources":["../../src/ports/POutEventPort.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"POutEventPort.js","sourceRoot":"","sources":["../../src/ports/POutEventPort.ts"],"names":[],"mappings":"AAGA,OAAO,KAA6B,MAAM,SAAS,CAAC;AASpD,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK;IAC9C,KAAK,GAAY,EAAE,CAAC;IAEpB,aAAa;IACb,KAAK,GAAkB,IAAI,CAAC;IAE5B,YACE,QAAmB,EACnB,KAAgB,EAChB,MAAc,EACd,GAAW,EACX,YAAoB,EACpB,IAAY,EACZ,MAA0C,EAC1C,QAAkB;QAElB,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAClE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC;QACpC,CAAC;IACH,CAAC;IAED,IAAI;QACF,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO,SAAS,CAAC;QAClC,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,M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,gCAAgC;YAChC,kCAAkC;YAClC,+CAA+C;YAC/C,eAAe;YACf,4CAA4C;YAC5C,QAAQ;YACR,gDAAgD;YAChD,sDAAsD;YACtD,MAAM;YACN,IAAI;YACJ,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { DataType, PortTypes } from "../PEnums";
|
|
2
2
|
import PPort, { OutValueGetter, PortOwner } from "./PPort";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import PInValuePort from "./PInValuePort";
|
|
4
|
+
import PValueLink from "./PValueLink";
|
|
5
|
+
interface IDBOutValuePort {
|
|
6
|
+
portId: number;
|
|
7
|
+
label: string | null;
|
|
8
|
+
}
|
|
9
|
+
export { type IDBOutValuePort };
|
|
5
10
|
export default class POutValuePort extends PPort {
|
|
6
|
-
links:
|
|
7
|
-
label:
|
|
11
|
+
links: PValueLink[];
|
|
12
|
+
label: string | null;
|
|
8
13
|
private getValue;
|
|
9
|
-
constructor(portType: PortTypes, owner: PortOwner, pid: number, componentPid: number, portId: number, name: string,
|
|
14
|
+
constructor(portType: PortTypes, owner: PortOwner, pid: number, componentPid: number, portId: number, name: string, dbItem: IDBOutValuePort | null | undefined, pinDataType: DataType, getValue: OutValueGetter);
|
|
10
15
|
runtime_value(): string | null;
|
|
11
|
-
toDB():
|
|
16
|
+
toDB(): IDBOutValuePort | undefined;
|
|
17
|
+
isLinked(to: PInValuePort): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* This can be called from all Out Event Port types: Nodes, Events and Variables.
|
|
20
|
+
*/
|
|
21
|
+
link(inPort: PInValuePort, pvalueLink: PValueLink): void;
|
|
12
22
|
}
|
|
13
23
|
//# sourceMappingURL=POutValuePort.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"POutValuePort.d.ts","sourceRoot":"","sources":["../../src/ports/POutValuePort.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2
|
export default class POutValuePort extends PPort {
|
|
3
3
|
links = [];
|
|
4
4
|
// Port label
|
|
5
|
-
label;
|
|
5
|
+
label = null;
|
|
6
6
|
getValue;
|
|
7
|
-
constructor(portType, owner, pid, componentPid, portId, name,
|
|
7
|
+
constructor(portType, owner, pid, componentPid, portId, name, dbItem, pinDataType, getValue) {
|
|
8
8
|
super(portType, owner, pid, componentPid, portId, name, pinDataType);
|
|
9
|
-
this.label = label;
|
|
10
9
|
this.getValue = getValue;
|
|
10
|
+
if (dbItem) {
|
|
11
|
+
this.label = dbItem.label;
|
|
12
|
+
}
|
|
11
13
|
}
|
|
12
14
|
runtime_value() {
|
|
13
|
-
return this.getValue.apply(this.owner);
|
|
15
|
+
return this.getValue.apply(this.owner, [this.portId]);
|
|
14
16
|
}
|
|
15
17
|
toDB() {
|
|
16
|
-
if (this.label
|
|
18
|
+
if (!this.label)
|
|
17
19
|
return undefined;
|
|
18
|
-
return
|
|
20
|
+
return {
|
|
21
|
+
portId: this.portId,
|
|
22
|
+
label: this.label,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
isLinked(to) {
|
|
26
|
+
return this.links.some((l) => l.inPort === to);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* This can be called from all Out Event Port types: Nodes, Events and Variables.
|
|
30
|
+
*/
|
|
31
|
+
link(inPort, pvalueLink) {
|
|
32
|
+
pvalueLink.outPort = this;
|
|
33
|
+
pvalueLink.inPort = inPort;
|
|
34
|
+
// Add to my out links
|
|
35
|
+
this.links.push(pvalueLink);
|
|
36
|
+
// Set as target in link (single
|
|
37
|
+
inPort.links = pvalueLink;
|
|
38
|
+
// PLink
|
|
39
|
+
// if (inPort.portType === 64) {
|
|
40
|
+
// inPort.dataType = 64;
|
|
41
|
+
// }
|
|
19
42
|
}
|
|
20
43
|
}
|
|
21
44
|
//# sourceMappingURL=POutValuePort.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"POutValuePort.js","sourceRoot":"","sources":["../../src/ports/POutValuePort.ts"],"names":[],"mappings":"AACA,OAAO,KAAoC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"POutValuePort.js","sourceRoot":"","sources":["../../src/ports/POutValuePort.ts"],"names":[],"mappings":"AACA,OAAO,KAAoC,MAAM,SAAS,CAAC;AAW3D,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK;IAC9C,KAAK,GAAiB,EAAE,CAAC;IAEzB,aAAa;IACb,KAAK,GAAkB,IAAI,CAAC;IAEpB,QAAQ,CAAiB;IAEjC,YACE,QAAmB,EACnB,KAAgB,EAChB,GAAW,EACX,YAAoB,EACpB,MAAc,EACd,IAAY,EACZ,MAA0C,EAC1C,WAAqB,EACrB,QAAwB;QAExB,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;QACrE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACxD,CAAC;IAED,IAAI;QACF,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO,SAAS,CAAC;QAClC,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;IACJ,CAAC;IAED,QAAQ,CAAC,EAAgB;QACvB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC;IACjD,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,MAAoB,EAAE,UAAsB;QAC/C,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC;QAC1B,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC;QAE3B,sBAAsB;QACtB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC5B,gCAAgC;QAChC,MAAM,CAAC,KAAK,GAAG,UAAU,CAAC;QAE1B,QAAQ;QACR,gCAAgC;QAChC,0BAA0B;QAC1B,IAAI;IACN,CAAC;CACF"}
|
package/dist/ports/PPort.d.ts
CHANGED
|
@@ -3,10 +3,13 @@ import { DataType, PortTypes } from "../PEnums";
|
|
|
3
3
|
import PComponent from "../PComponent";
|
|
4
4
|
import PEvent from "../PEvent";
|
|
5
5
|
import { PVariable } from "../PVariable";
|
|
6
|
+
import PValue from "../PValue";
|
|
7
|
+
import PLogic from "../PLogic";
|
|
8
|
+
import PLink from "./PLink";
|
|
6
9
|
type Payload = string | null;
|
|
7
10
|
type PortCallback = (payload: Payload) => void;
|
|
8
|
-
type OutValueGetter = () => string | null;
|
|
9
|
-
type PortOwner = PComponent | PEvent | PVariable;
|
|
11
|
+
type OutValueGetter = (portId: number) => string | null;
|
|
12
|
+
type PortOwner = PComponent | PEvent | PVariable | PValue | PLogic | PLink;
|
|
10
13
|
export { type Payload, type PortCallback, type PortOwner, type OutValueGetter };
|
|
11
14
|
export default abstract class PPort implements IPort {
|
|
12
15
|
owner: PortOwner;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PPort.d.ts","sourceRoot":"","sources":["../../src/ports/PPort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
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E,MAAM,EACZ,QAAQ,EAAE,QAAQ;CAUrB"}
|
package/dist/ports/PPort.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PPort.js","sourceRoot":"","sources":["../../src/ports/PPort.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PPort.js","sourceRoot":"","sources":["../../src/ports/PPort.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAC,OAAO,OAAgB,KAAK;IACjC,KAAK,CAAY;IAEjB,eAAe;IACf,QAAQ,CAAY;IAEpB,4BAA4B;IAC5B,GAAG,CAAS;IAEZ,8BAA8B;IAC9B,YAAY,CAAS;IAErB,sCAAsC;IACtC,MAAM,CAAS;IAEf,YAAY;IACZ,IAAI,CAAS;IAEb,mBAAmB;IACnB,QAAQ,CAAW;IAEnB,YACE,QAAmB,EACnB,KAAgB,EAChB,GAAW,EACX,YAAoB,EACpB,MAAc,EACd,IAAY,EACZ,QAAkB;QAElB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PortTypes } from "../PEnums";
|
|
2
|
+
import PItem from "../PItem";
|
|
3
|
+
import POutValuePort from "./POutValuePort";
|
|
4
|
+
import PInValuePort from "./PInValuePort";
|
|
5
|
+
import { IDBValueLink } from "./IDBValueLink";
|
|
6
|
+
export default class PValueLink extends PItem {
|
|
7
|
+
outPortType: PortTypes;
|
|
8
|
+
outPid: number;
|
|
9
|
+
outComponentPid: number;
|
|
10
|
+
outPortId: number;
|
|
11
|
+
inPortType: PortTypes;
|
|
12
|
+
inPid: number;
|
|
13
|
+
inComponentPid: number;
|
|
14
|
+
inPortId: number;
|
|
15
|
+
outPort: POutValuePort | null;
|
|
16
|
+
inPort: PInValuePort | null;
|
|
17
|
+
constructor(dbItem: IDBValueLink);
|
|
18
|
+
toDB(): IDBValueLink;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=PValueLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PValueLink.d.ts","sourceRoot":"","sources":["../../src/ports/PValueLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,KAAK;IAC3C,WAAW,EAAE,SAAS,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,SAAS,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IAGjB,OAAO,EAAE,aAAa,GAAG,IAAI,CAAQ;IACrC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAQ;gBAEvB,MAAM,EAAE,YAAY;IAchC,IAAI,IAAI,YAAY;CAerB"}
|