@vived/component-pneumatic-panel 1.0.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/README.md +74 -0
- package/dist/.gitkeep +0 -0
- package/dist/Domain/Adapters/pneumaticPanelPMAdapter.d.ts +10 -0
- package/dist/Domain/Adapters/pneumaticPanelPMAdapter.d.ts.map +1 -0
- package/dist/Domain/Controllers/checkPressure.d.ts +11 -0
- package/dist/Domain/Controllers/checkPressure.d.ts.map +1 -0
- package/dist/Domain/Controllers/createPneumaticPanel.d.ts +12 -0
- package/dist/Domain/Controllers/createPneumaticPanel.d.ts.map +1 -0
- package/dist/Domain/Controllers/tryToggleExhaust.d.ts +11 -0
- package/dist/Domain/Controllers/tryToggleExhaust.d.ts.map +1 -0
- package/dist/Domain/Controllers/tryToggleLock.d.ts +11 -0
- package/dist/Domain/Controllers/tryToggleLock.d.ts.map +1 -0
- package/dist/Domain/Entities/PneumaticPanelEntity.d.ts +32 -0
- package/dist/Domain/Entities/PneumaticPanelEntity.d.ts.map +1 -0
- package/dist/Domain/Entities/PneumaticPanelRepo.d.ts +28 -0
- package/dist/Domain/Entities/PneumaticPanelRepo.d.ts.map +1 -0
- package/dist/Domain/Factory/PneumaticPanelFeatureFactory.d.ts +26 -0
- package/dist/Domain/Factory/PneumaticPanelFeatureFactory.d.ts.map +1 -0
- package/dist/Domain/Mocks/MockPneumaticPanelCheckPressureUC.d.ts +10 -0
- package/dist/Domain/Mocks/MockPneumaticPanelCheckPressureUC.d.ts.map +1 -0
- package/dist/Domain/Mocks/MockPneumaticPanelPM.d.ts +11 -0
- package/dist/Domain/Mocks/MockPneumaticPanelPM.d.ts.map +1 -0
- package/dist/Domain/Mocks/MockPneumaticPanelToggleActiveUC.d.ts +9 -0
- package/dist/Domain/Mocks/MockPneumaticPanelToggleActiveUC.d.ts.map +1 -0
- package/dist/Domain/Mocks/MockPneumaticPanelToggleExhaustUC.d.ts +11 -0
- package/dist/Domain/Mocks/MockPneumaticPanelToggleExhaustUC.d.ts.map +1 -0
- package/dist/Domain/Mocks/MockPneumaticPanelToggleLockUC.d.ts +10 -0
- package/dist/Domain/Mocks/MockPneumaticPanelToggleLockUC.d.ts.map +1 -0
- package/dist/Domain/PMs/PneumaticPanelPM.d.ts +30 -0
- package/dist/Domain/PMs/PneumaticPanelPM.d.ts.map +1 -0
- package/dist/Domain/UCs/PneumaticPanelCheckPressureUC.d.ts +19 -0
- package/dist/Domain/UCs/PneumaticPanelCheckPressureUC.d.ts.map +1 -0
- package/dist/Domain/UCs/PneumaticPanelToggleActiveUC.d.ts +9 -0
- package/dist/Domain/UCs/PneumaticPanelToggleActiveUC.d.ts.map +1 -0
- package/dist/Domain/UCs/PneumaticPanelToggleExhaustUC.d.ts +25 -0
- package/dist/Domain/UCs/PneumaticPanelToggleExhaustUC.d.ts.map +1 -0
- package/dist/Domain/UCs/PneumaticPanelToggleLockUC.d.ts +22 -0
- package/dist/Domain/UCs/PneumaticPanelToggleLockUC.d.ts.map +1 -0
- package/dist/Factory/PneumaticPanelFeatureFactory.d.ts +26 -0
- package/dist/Factory/PneumaticPanelFeatureFactory.d.ts.map +1 -0
- package/dist/Frameworks/Babylon/PneumaticPanelBabylonView.d.ts +23 -0
- package/dist/Frameworks/Babylon/PneumaticPanelBabylonView.d.ts.map +1 -0
- package/dist/Frameworks/Babylon/createBabylonPneumaticPanel.d.ts +13 -0
- package/dist/Frameworks/Babylon/createBabylonPneumaticPanel.d.ts.map +1 -0
- package/dist/component.config.d.ts +18 -0
- package/dist/component.config.d.ts.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +441 -0
- package/dist/studio.env +0 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# @vived/component-pneumatic-panel
|
|
2
|
+
|
|
3
|
+
A 3D interactive pneumatic control panel for VIVED slide applications. Features a rotatable exhaust valve, safety lock mechanism with ghost-lock preview, and a pressure gauge — all with enforced interlocking business rules.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Exhaust Valve** — Click to toggle open/closed with smooth animated rotation. Automatically manages pressure (0 PSI when open, 60 PSI when closed).
|
|
8
|
+
- **Safety Lock** — Engage when the exhaust is open to prevent toggling. Ghost-lock preview appears on hover. Clicking a locked exhaust knob triggers a shake animation and red flash on the lock.
|
|
9
|
+
- **Pressure Gauge** — Click to display current pressure via alert dialog.
|
|
10
|
+
- **Multi-instance** — Create multiple independent panels in the same scene.
|
|
11
|
+
|
|
12
|
+
## Quick Start
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @vived/component-pneumatic-panel @vived/core @babylonjs/core
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { makeAppObjectRepo, makeDomainFactoryRepo } from "@vived/core";
|
|
20
|
+
import {
|
|
21
|
+
makePneumaticPanelFeatureFactory,
|
|
22
|
+
createBabylonPneumaticPanel,
|
|
23
|
+
tryToggleExhaust,
|
|
24
|
+
tryToggleLock,
|
|
25
|
+
} from "@vived/component-pneumatic-panel";
|
|
26
|
+
|
|
27
|
+
const appObjects = makeAppObjectRepo();
|
|
28
|
+
const factoryRepo = makeDomainFactoryRepo(appObjects);
|
|
29
|
+
makePneumaticPanelFeatureFactory(appObjects);
|
|
30
|
+
factoryRepo.setupDomain();
|
|
31
|
+
|
|
32
|
+
const appObject = await createBabylonPneumaticPanel("panel-1", appObjects);
|
|
33
|
+
|
|
34
|
+
tryToggleExhaust("panel-1", appObjects); // open exhaust
|
|
35
|
+
tryToggleLock("panel-1", appObjects); // engage lock
|
|
36
|
+
tryToggleExhaust("panel-1", appObjects); // false — blocked by lock
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## API
|
|
40
|
+
|
|
41
|
+
| Controller | Returns | Description |
|
|
42
|
+
| ------------------ | --------- | --------------------------------------------------------- |
|
|
43
|
+
| `tryToggleExhaust` | `boolean` | Toggle exhaust valve. Returns `false` if locked. |
|
|
44
|
+
| `tryToggleLock` | `boolean` | Toggle safety lock. Returns `false` if exhaust is closed. |
|
|
45
|
+
| `checkPressure` | `void` | Shows current pressure in an alert dialog. |
|
|
46
|
+
|
|
47
|
+
### View Model
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
interface PneumaticPanelVM {
|
|
51
|
+
exhaustOpen: boolean;
|
|
52
|
+
isLocked: boolean;
|
|
53
|
+
pressure: number;
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Subscribe to state changes via `pneumaticPanelPMAdapter.subscribe(id, appObjects, callback)`.
|
|
58
|
+
|
|
59
|
+
## Development
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npm install
|
|
63
|
+
npm run dev # playground
|
|
64
|
+
npm run test # run tests
|
|
65
|
+
npm run build # production build
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Architecture
|
|
69
|
+
|
|
70
|
+
See [COMPONENT_ARCHITECTURE.md](COMPONENT_ARCHITECTURE.md) for internal design details.
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
Proprietary — VIVED Learning
|
package/dist/.gitkeep
ADDED
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type PmAdapter } from "@vived/core";
|
|
2
|
+
import { type PneumaticPanelVM } from "../PMs/PneumaticPanelPM";
|
|
3
|
+
/**
|
|
4
|
+
* PM Adapter for Pneumatic Panel
|
|
5
|
+
*
|
|
6
|
+
* Connects UI views to the PneumaticPanelPM. Use this adapter in
|
|
7
|
+
* React components or Babylon views to subscribe to VM updates.
|
|
8
|
+
*/
|
|
9
|
+
export declare const pneumaticPanelPMAdapter: PmAdapter<PneumaticPanelVM>;
|
|
10
|
+
//# sourceMappingURL=pneumaticPanelPMAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pneumaticPanelPMAdapter.d.ts","sourceRoot":"","sources":["../../../src/Domain/Adapters/pneumaticPanelPMAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAEjC;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,CAAC,gBAAgB,CAuC7D,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AppObjectRepo } from "@vived/core";
|
|
2
|
+
/**
|
|
3
|
+
* Controller to check and display the current pressure.
|
|
4
|
+
* Resolves the UC for the given panel ID and delegates to its checkPressure method.
|
|
5
|
+
* Shows a dialog/alert with the current pressure reading.
|
|
6
|
+
*
|
|
7
|
+
* @param id - The ID of the Pneumatic Panel instance.
|
|
8
|
+
* @param appObjects - The AppObject repository.
|
|
9
|
+
*/
|
|
10
|
+
export declare function checkPressure(id: string, appObjects: AppObjectRepo): void;
|
|
11
|
+
//# sourceMappingURL=checkPressure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkPressure.d.ts","sourceRoot":"","sources":["../../../src/Domain/Controllers/checkPressure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,aAAa,GACxB,IAAI,CAYN"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AppObjectRepo } from "@vived/core";
|
|
2
|
+
/**
|
|
3
|
+
* Controller to create a new Pneumatic Panel instance.
|
|
4
|
+
* Resolves the singleton PneumaticPanelRepo and delegates to its
|
|
5
|
+
* createPneumaticPanelEntity method.
|
|
6
|
+
*
|
|
7
|
+
* @param id - The ID for the new instance.
|
|
8
|
+
* @param appObjects - The AppObject repository.
|
|
9
|
+
* @returns The created AppObject, or undefined if the repo is not found.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createPneumaticPanel(id: string, appObjects: AppObjectRepo): import("@vived/core").AppObject | undefined;
|
|
12
|
+
//# sourceMappingURL=createPneumaticPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPneumaticPanel.d.ts","sourceRoot":"","sources":["../../../src/Domain/Controllers/createPneumaticPanel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,aAAa,+CAc1B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AppObjectRepo } from "@vived/core";
|
|
2
|
+
/**
|
|
3
|
+
* Controller to toggle the exhaust valve open/closed.
|
|
4
|
+
* Resolves the UC for the given panel ID and delegates to its toggleExhaust method.
|
|
5
|
+
*
|
|
6
|
+
* @param id - The ID of the Pneumatic Panel instance.
|
|
7
|
+
* @param appObjects - The AppObject repository.
|
|
8
|
+
* @returns true if toggle was successful, false if blocked (e.g., by lock).
|
|
9
|
+
*/
|
|
10
|
+
export declare function tryToggleExhaust(id: string, appObjects: AppObjectRepo): boolean;
|
|
11
|
+
//# sourceMappingURL=tryToggleExhaust.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tryToggleExhaust.d.ts","sourceRoot":"","sources":["../../../src/Domain/Controllers/tryToggleExhaust.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,aAAa,GACxB,OAAO,CAYT"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AppObjectRepo } from "@vived/core";
|
|
2
|
+
/**
|
|
3
|
+
* Controller to toggle the lock state.
|
|
4
|
+
* Resolves the UC for the given panel ID and delegates to its toggleLock method.
|
|
5
|
+
*
|
|
6
|
+
* @param id - The ID of the Pneumatic Panel instance.
|
|
7
|
+
* @param appObjects - The AppObject repository.
|
|
8
|
+
* @returns true if toggle was successful, false if blocked (e.g., exhaust is open).
|
|
9
|
+
*/
|
|
10
|
+
export declare function tryToggleLock(id: string, appObjects: AppObjectRepo): boolean;
|
|
11
|
+
//# sourceMappingURL=tryToggleLock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tryToggleLock.d.ts","sourceRoot":"","sources":["../../../src/Domain/Controllers/tryToggleLock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,aAAa,GACxB,OAAO,CAYT"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AppObject, AppObjectEntity, AppObjectRepo } from "@vived/core";
|
|
2
|
+
/**
|
|
3
|
+
* Pneumatic Panel Entity
|
|
4
|
+
*
|
|
5
|
+
* Manages the state for a single Pneumatic Panel instance.
|
|
6
|
+
* Uses memoized primitives for efficient change notification.
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class PneumaticPanelEntity extends AppObjectEntity {
|
|
9
|
+
static readonly type = "PneumaticPanelEntity";
|
|
10
|
+
/** Whether the exhaust valve is open */
|
|
11
|
+
abstract get exhaustOpen(): boolean;
|
|
12
|
+
abstract set exhaustOpen(val: boolean);
|
|
13
|
+
/** Whether the exhaust is locked (cannot toggle when locked) */
|
|
14
|
+
abstract get isLocked(): boolean;
|
|
15
|
+
abstract set isLocked(val: boolean);
|
|
16
|
+
/** Current pressure reading */
|
|
17
|
+
abstract get pressure(): number;
|
|
18
|
+
abstract set pressure(val: number);
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves the entity from an AppObject
|
|
21
|
+
*/
|
|
22
|
+
static get(appObj: AppObject): PneumaticPanelEntity | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves the entity by AppObject ID
|
|
25
|
+
*/
|
|
26
|
+
static getById(id: string, appObjects: AppObjectRepo): PneumaticPanelEntity | undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Factory function to create a new PneumaticPanelEntity
|
|
30
|
+
*/
|
|
31
|
+
export declare function makePneumaticPanelEntity(appObject: AppObject): PneumaticPanelEntity;
|
|
32
|
+
//# sourceMappingURL=PneumaticPanelEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PneumaticPanelEntity.d.ts","sourceRoot":"","sources":["../../../src/Domain/Entities/PneumaticPanelEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,aAAa,EAGd,MAAM,aAAa,CAAC;AAErB;;;;;GAKG;AACH,8BAAsB,oBAAqB,SAAQ,eAAe;IAChE,MAAM,CAAC,QAAQ,CAAC,IAAI,0BAA0B;IAE9C,wCAAwC;IACxC,QAAQ,KAAK,WAAW,IAAI,OAAO,CAAC;IACpC,QAAQ,KAAK,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE;IAEvC,gEAAgE;IAChE,QAAQ,KAAK,QAAQ,IAAI,OAAO,CAAC;IACjC,QAAQ,KAAK,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE;IAEpC,+BAA+B;IAC/B,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC;IAChC,QAAQ,KAAK,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE;IAEnC;;OAEG;IACH,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,GAAG,oBAAoB,GAAG,SAAS;IAI/D;;OAEG;IACH,MAAM,CAAC,OAAO,CACZ,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,aAAa,GACxB,oBAAoB,GAAG,SAAS;CAKpC;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,SAAS,GACnB,oBAAoB,CAEtB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AppObject, AppObjectEntityRepo, AppObjectRepo } from "@vived/core";
|
|
2
|
+
import { PneumaticPanelEntity } from "./PneumaticPanelEntity";
|
|
3
|
+
/** Factory function type for creating PneumaticPanelEntity instances */
|
|
4
|
+
export type PneumaticPanelEntityFactory = (id: string) => PneumaticPanelEntity;
|
|
5
|
+
/**
|
|
6
|
+
* PneumaticPanelRepo
|
|
7
|
+
*
|
|
8
|
+
* Singleton repository managing all Pneumatic Panel instances.
|
|
9
|
+
* Provides creation, deletion, and lookup for component entities.
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class PneumaticPanelRepo extends AppObjectEntityRepo<PneumaticPanelEntity> {
|
|
12
|
+
static readonly type = "PneumaticPanelRepo";
|
|
13
|
+
/** Injectable factory for creating entities with associated components */
|
|
14
|
+
abstract pneumaticPanelEntityFactory: PneumaticPanelEntityFactory;
|
|
15
|
+
/** Create a new entity instance, optionally with a specific ID */
|
|
16
|
+
abstract createPneumaticPanelEntity(id?: string): PneumaticPanelEntity;
|
|
17
|
+
/** Delete an entity by its AppObject ID */
|
|
18
|
+
abstract deletePneumaticPanelEntity(id: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Global accessor for the singleton repository
|
|
21
|
+
*/
|
|
22
|
+
static get(appObjects: AppObjectRepo): PneumaticPanelRepo | undefined;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Factory function to create a new PneumaticPanelRepo
|
|
26
|
+
*/
|
|
27
|
+
export declare function makePneumaticPanelRepo(appObject: AppObject): PneumaticPanelRepo;
|
|
28
|
+
//# sourceMappingURL=PneumaticPanelRepo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PneumaticPanelRepo.d.ts","sourceRoot":"","sources":["../../../src/Domain/Entities/PneumaticPanelRepo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,aAAa,EAGd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EAErB,MAAM,wBAAwB,CAAC;AAEhC,wEAAwE;AACxE,MAAM,MAAM,2BAA2B,GAAG,CACxC,EAAE,EAAE,MAAM,KACP,oBAAoB,CAAC;AAE1B;;;;;GAKG;AACH,8BAAsB,kBAAmB,SAAQ,mBAAmB,CAAC,oBAAoB,CAAC;IACxF,MAAM,CAAC,QAAQ,CAAC,IAAI,wBAAwB;IAE5C,0EAA0E;IAC1E,QAAQ,CAAC,2BAA2B,EAAE,2BAA2B,CAAC;IAElE,kEAAkE;IAClE,QAAQ,CAAC,0BAA0B,CACjC,EAAE,CAAC,EAAE,MAAM,GACV,oBAAoB;IAEvB,2CAA2C;IAC3C,QAAQ,CAAC,0BAA0B,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAErD;;OAEG;IACH,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,aAAa,GAAG,kBAAkB,GAAG,SAAS;CAMtE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,SAAS,GACnB,kBAAkB,CAEpB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AppObjectRepo, DomainFactory } from "@vived/core";
|
|
2
|
+
/**
|
|
3
|
+
* PneumaticPanelFeatureFactory
|
|
4
|
+
*
|
|
5
|
+
* Orchestrates creation and wiring of the Pneumatic Panel feature.
|
|
6
|
+
* Follows the four-phase setup pattern:
|
|
7
|
+
* 1. setupEntities — Create singleton repository
|
|
8
|
+
* 2. setupUCs — Create singleton use cases (if any)
|
|
9
|
+
* 3. setupPMs — Create singleton PMs (if any)
|
|
10
|
+
* 4. finalSetup — Cross-component wiring
|
|
11
|
+
*
|
|
12
|
+
* Per-instance UCs and PMs are created on-demand via the entity factory.
|
|
13
|
+
*/
|
|
14
|
+
export declare class PneumaticPanelFeatureFactory extends DomainFactory {
|
|
15
|
+
factoryName: string;
|
|
16
|
+
private repo;
|
|
17
|
+
setupEntities(): void;
|
|
18
|
+
setupUCs(): void;
|
|
19
|
+
setupPMs(): void;
|
|
20
|
+
finalSetup(): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates and registers the PneumaticPanelFeatureFactory
|
|
24
|
+
*/
|
|
25
|
+
export declare function makePneumaticPanelFeatureFactory(appObjects: AppObjectRepo): PneumaticPanelFeatureFactory;
|
|
26
|
+
//# sourceMappingURL=PneumaticPanelFeatureFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PneumaticPanelFeatureFactory.d.ts","sourceRoot":"","sources":["../../../src/Domain/Factory/PneumaticPanelFeatureFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAe3D;;;;;;;;;;;GAWG;AACH,qBAAa,4BAA6B,SAAQ,aAAa;IAC7D,WAAW,SAAkC;IAE7C,OAAO,CAAC,IAAI,CAAmC;IAE/C,aAAa,IAAI,IAAI;IAOrB,QAAQ,IAAI,IAAI;IAIhB,QAAQ,IAAI,IAAI;IAKhB,UAAU,IAAI,IAAI;CAGnB;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,UAAU,EAAE,aAAa,GACxB,4BAA4B,CAG9B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AppObject } from "@vived/core";
|
|
2
|
+
import { PneumaticPanelCheckPressureUC } from "../UCs/PneumaticPanelCheckPressureUC";
|
|
3
|
+
/**
|
|
4
|
+
* Mock UC for testing views and components in isolation.
|
|
5
|
+
*/
|
|
6
|
+
export declare class MockPneumaticPanelCheckPressureUC extends PneumaticPanelCheckPressureUC {
|
|
7
|
+
checkPressure: () => void;
|
|
8
|
+
constructor(appObject: AppObject);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=MockPneumaticPanelCheckPressureUC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockPneumaticPanelCheckPressureUC.d.ts","sourceRoot":"","sources":["../../../src/Domain/Mocks/MockPneumaticPanelCheckPressureUC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AAErF;;GAEG;AACH,qBAAa,iCACX,SAAQ,6BAA6B;IAErC,aAAa,QAAO,IAAI,CAEtB;gBAEU,SAAS,EAAE,SAAS;CAGjC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AppObject } from "@vived/core";
|
|
2
|
+
import { PneumaticPanelPM } from "../PMs/PneumaticPanelPM";
|
|
3
|
+
/**
|
|
4
|
+
* Mock PM for testing views and adapters in isolation.
|
|
5
|
+
* Always suppresses duplicate emission in tests.
|
|
6
|
+
*/
|
|
7
|
+
export declare class MockPneumaticPanelPM extends PneumaticPanelPM {
|
|
8
|
+
vmsAreEqual: () => boolean;
|
|
9
|
+
constructor(appObject: AppObject);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=MockPneumaticPanelPM.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockPneumaticPanelPM.d.ts","sourceRoot":"","sources":["../../../src/Domain/Mocks/MockPneumaticPanelPM.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACL,gBAAgB,EAEjB,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,gBAAgB;IACxD,WAAW,QAAO,OAAO,CAAS;gBAEtB,SAAS,EAAE,SAAS;CAGjC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated This mock has been replaced by three separate mock UCs:
|
|
3
|
+
* - MockPneumaticPanelToggleExhaustUC
|
|
4
|
+
* - MockPneumaticPanelToggleLockUC
|
|
5
|
+
* - MockPneumaticPanelCheckPressureUC
|
|
6
|
+
*
|
|
7
|
+
* This file is kept for backwards compatibility but should not be used.
|
|
8
|
+
*/
|
|
9
|
+
//# sourceMappingURL=MockPneumaticPanelToggleActiveUC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockPneumaticPanelToggleActiveUC.d.ts","sourceRoot":"","sources":["../../../src/Domain/Mocks/MockPneumaticPanelToggleActiveUC.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AppObject } from "@vived/core";
|
|
2
|
+
import { PneumaticPanelToggleExhaustUC } from "../UCs/PneumaticPanelToggleExhaustUC";
|
|
3
|
+
/**
|
|
4
|
+
* Mock UC for testing views and components in isolation.
|
|
5
|
+
*/
|
|
6
|
+
export declare class MockPneumaticPanelToggleExhaustUC extends PneumaticPanelToggleExhaustUC {
|
|
7
|
+
maxPressure: number;
|
|
8
|
+
toggleExhaust: () => boolean;
|
|
9
|
+
constructor(appObject: AppObject);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=MockPneumaticPanelToggleExhaustUC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockPneumaticPanelToggleExhaustUC.d.ts","sourceRoot":"","sources":["../../../src/Domain/Mocks/MockPneumaticPanelToggleExhaustUC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AAErF;;GAEG;AACH,qBAAa,iCACX,SAAQ,6BAA6B;IAErC,WAAW,SAAM;IACjB,aAAa,QAAO,OAAO,CAAS;gBAExB,SAAS,EAAE,SAAS;CAGjC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AppObject } from "@vived/core";
|
|
2
|
+
import { PneumaticPanelToggleLockUC } from "../UCs/PneumaticPanelToggleLockUC";
|
|
3
|
+
/**
|
|
4
|
+
* Mock UC for testing views and components in isolation.
|
|
5
|
+
*/
|
|
6
|
+
export declare class MockPneumaticPanelToggleLockUC extends PneumaticPanelToggleLockUC {
|
|
7
|
+
toggleLock: () => boolean;
|
|
8
|
+
constructor(appObject: AppObject);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=MockPneumaticPanelToggleLockUC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockPneumaticPanelToggleLockUC.d.ts","sourceRoot":"","sources":["../../../src/Domain/Mocks/MockPneumaticPanelToggleLockUC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAE/E;;GAEG;AACH,qBAAa,8BACX,SAAQ,0BAA0B;IAElC,UAAU,QAAO,OAAO,CAAS;gBAErB,SAAS,EAAE,SAAS;CAGjC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AppObject, AppObjectPM, AppObjectRepo } from "@vived/core";
|
|
2
|
+
/**
|
|
3
|
+
* View Model for Pneumatic Panel UI rendering.
|
|
4
|
+
* Immutable snapshot of component state suitable for views.
|
|
5
|
+
*/
|
|
6
|
+
export interface PneumaticPanelVM {
|
|
7
|
+
/** Whether the exhaust valve is open */
|
|
8
|
+
exhaustOpen: boolean;
|
|
9
|
+
/** Whether the exhaust is locked */
|
|
10
|
+
isLocked: boolean;
|
|
11
|
+
/** Current pressure reading */
|
|
12
|
+
pressure: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* PneumaticPanelPM
|
|
16
|
+
*
|
|
17
|
+
* Presentation Manager that observes the PneumaticPanelEntity and
|
|
18
|
+
* emits immutable view models for UI consumption. Suppresses redundant
|
|
19
|
+
* updates when state hasn't changed.
|
|
20
|
+
*/
|
|
21
|
+
export declare abstract class PneumaticPanelPM extends AppObjectPM<PneumaticPanelVM> {
|
|
22
|
+
static readonly type = "PneumaticPanelPM";
|
|
23
|
+
static get(appObj: AppObject): PneumaticPanelPM | undefined;
|
|
24
|
+
static getById(id: string, appObjects: AppObjectRepo): PneumaticPanelPM | undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Factory function to create a new PneumaticPanelPM
|
|
28
|
+
*/
|
|
29
|
+
export declare function makePneumaticPanelPM(appObject: AppObject): PneumaticPanelPM;
|
|
30
|
+
//# sourceMappingURL=PneumaticPanelPM.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PneumaticPanelPM.d.ts","sourceRoot":"","sources":["../../../src/Domain/PMs/PneumaticPanelPM.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGpE;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,WAAW,EAAE,OAAO,CAAC;IACrB,oCAAoC;IACpC,QAAQ,EAAE,OAAO,CAAC;IAClB,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,8BAAsB,gBAAiB,SAAQ,WAAW,CAAC,gBAAgB,CAAC;IAC1E,MAAM,CAAC,QAAQ,CAAC,IAAI,sBAAsB;IAE1C,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,GAAG,gBAAgB,GAAG,SAAS;IAI3D,MAAM,CAAC,OAAO,CACZ,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,aAAa,GACxB,gBAAgB,GAAG,SAAS;CAGhC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,SAAS,GACnB,gBAAgB,CAElB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AppObject, AppObjectRepo, AppObjectUC } from "@vived/core";
|
|
2
|
+
/**
|
|
3
|
+
* PneumaticPanelCheckPressureUC
|
|
4
|
+
*
|
|
5
|
+
* Use Case for displaying the current pressure reading.
|
|
6
|
+
* Shows a dialog/alert with the current pressure value.
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class PneumaticPanelCheckPressureUC extends AppObjectUC {
|
|
9
|
+
static readonly type = "PneumaticPanelCheckPressureUC";
|
|
10
|
+
/** Display the current pressure */
|
|
11
|
+
abstract checkPressure(): void;
|
|
12
|
+
static get(appObj: AppObject): PneumaticPanelCheckPressureUC | undefined;
|
|
13
|
+
static getById(id: string, appObjects: AppObjectRepo): PneumaticPanelCheckPressureUC | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Factory function to create a new PneumaticPanelCheckPressureUC
|
|
17
|
+
*/
|
|
18
|
+
export declare function makePneumaticPanelCheckPressureUC(appObject: AppObject): PneumaticPanelCheckPressureUC;
|
|
19
|
+
//# sourceMappingURL=PneumaticPanelCheckPressureUC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PneumaticPanelCheckPressureUC.d.ts","sourceRoot":"","sources":["../../../src/Domain/UCs/PneumaticPanelCheckPressureUC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAkBpE;;;;;GAKG;AACH,8BAAsB,6BAA8B,SAAQ,WAAW;IACrE,MAAM,CAAC,QAAQ,CAAC,IAAI,mCAAmC;IAEvD,mCAAmC;IACnC,QAAQ,CAAC,aAAa,IAAI,IAAI;IAE9B,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,GAAG,6BAA6B,GAAG,SAAS;IAIxE,MAAM,CAAC,OAAO,CACZ,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,aAAa,GACxB,6BAA6B,GAAG,SAAS;CAK7C;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,SAAS,EAAE,SAAS,GACnB,6BAA6B,CAE/B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated This file has been replaced by three separate UCs:
|
|
3
|
+
* - PneumaticPanelToggleExhaustUC
|
|
4
|
+
* - PneumaticPanelToggleLockUC
|
|
5
|
+
* - PneumaticPanelCheckPressureUC
|
|
6
|
+
*
|
|
7
|
+
* This file is kept for backwards compatibility but should not be used.
|
|
8
|
+
*/
|
|
9
|
+
//# sourceMappingURL=PneumaticPanelToggleActiveUC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PneumaticPanelToggleActiveUC.d.ts","sourceRoot":"","sources":["../../../src/Domain/UCs/PneumaticPanelToggleActiveUC.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AppObject, AppObjectRepo, AppObjectUC } from "@vived/core";
|
|
2
|
+
/**
|
|
3
|
+
* PneumaticPanelToggleExhaustUC
|
|
4
|
+
*
|
|
5
|
+
* Use Case for toggling the exhaust valve open/closed.
|
|
6
|
+
* Cannot toggle if the panel is locked.
|
|
7
|
+
* Automatically manages pressure: 0 when open, maxPressure when closed.
|
|
8
|
+
*
|
|
9
|
+
* Returns true if toggle was successful, false if blocked by lock.
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class PneumaticPanelToggleExhaustUC extends AppObjectUC {
|
|
12
|
+
static readonly type = "PneumaticPanelToggleExhaustUC";
|
|
13
|
+
/** Maximum pressure when exhaust is closed. Configurable per instance. */
|
|
14
|
+
abstract get maxPressure(): number;
|
|
15
|
+
abstract set maxPressure(val: number);
|
|
16
|
+
/** Toggle the exhaust valve. Returns true if successful, false if locked. */
|
|
17
|
+
abstract toggleExhaust(): boolean;
|
|
18
|
+
static get(appObj: AppObject): PneumaticPanelToggleExhaustUC | undefined;
|
|
19
|
+
static getById(id: string, appObjects: AppObjectRepo): PneumaticPanelToggleExhaustUC | undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Factory function to create a new PneumaticPanelToggleExhaustUC
|
|
23
|
+
*/
|
|
24
|
+
export declare function makePneumaticPanelToggleExhaustUC(appObject: AppObject): PneumaticPanelToggleExhaustUC;
|
|
25
|
+
//# sourceMappingURL=PneumaticPanelToggleExhaustUC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PneumaticPanelToggleExhaustUC.d.ts","sourceRoot":"","sources":["../../../src/Domain/UCs/PneumaticPanelToggleExhaustUC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGpE;;;;;;;;GAQG;AACH,8BAAsB,6BAA8B,SAAQ,WAAW;IACrE,MAAM,CAAC,QAAQ,CAAC,IAAI,mCAAmC;IAEvD,0EAA0E;IAC1E,QAAQ,KAAK,WAAW,IAAI,MAAM,CAAC;IACnC,QAAQ,KAAK,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE;IAEtC,6EAA6E;IAC7E,QAAQ,CAAC,aAAa,IAAI,OAAO;IAEjC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,GAAG,6BAA6B,GAAG,SAAS;IAIxE,MAAM,CAAC,OAAO,CACZ,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,aAAa,GACxB,6BAA6B,GAAG,SAAS;CAK7C;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,SAAS,EAAE,SAAS,GACnB,6BAA6B,CAE/B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AppObject, AppObjectRepo, AppObjectUC } from "@vived/core";
|
|
2
|
+
/**
|
|
3
|
+
* PneumaticPanelToggleLockUC
|
|
4
|
+
*
|
|
5
|
+
* Use Case for toggling the lock state.
|
|
6
|
+
* Cannot toggle lock to engaged if exhaust is open.
|
|
7
|
+
* Always succeeds when unlocking.
|
|
8
|
+
*
|
|
9
|
+
* Returns true if toggle was successful, false if blocked (exhaust open).
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class PneumaticPanelToggleLockUC extends AppObjectUC {
|
|
12
|
+
static readonly type = "PneumaticPanelToggleLockUC";
|
|
13
|
+
/** Toggle the lock state. Returns true if successful, false if exhaust is open. */
|
|
14
|
+
abstract toggleLock(): boolean;
|
|
15
|
+
static get(appObj: AppObject): PneumaticPanelToggleLockUC | undefined;
|
|
16
|
+
static getById(id: string, appObjects: AppObjectRepo): PneumaticPanelToggleLockUC | undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Factory function to create a new PneumaticPanelToggleLockUC
|
|
20
|
+
*/
|
|
21
|
+
export declare function makePneumaticPanelToggleLockUC(appObject: AppObject): PneumaticPanelToggleLockUC;
|
|
22
|
+
//# sourceMappingURL=PneumaticPanelToggleLockUC.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PneumaticPanelToggleLockUC.d.ts","sourceRoot":"","sources":["../../../src/Domain/UCs/PneumaticPanelToggleLockUC.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGpE;;;;;;;;GAQG;AACH,8BAAsB,0BAA2B,SAAQ,WAAW;IAClE,MAAM,CAAC,QAAQ,CAAC,IAAI,gCAAgC;IAEpD,mFAAmF;IACnF,QAAQ,CAAC,UAAU,IAAI,OAAO;IAE9B,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,GAAG,0BAA0B,GAAG,SAAS;IAIrE,MAAM,CAAC,OAAO,CACZ,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,aAAa,GACxB,0BAA0B,GAAG,SAAS;CAK1C;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,SAAS,GACnB,0BAA0B,CAE5B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AppObjectRepo, DomainFactory } from "@vived/core";
|
|
2
|
+
/**
|
|
3
|
+
* PneumaticPanelFeatureFactory
|
|
4
|
+
*
|
|
5
|
+
* Orchestrates creation and wiring of the Pneumatic Panel feature.
|
|
6
|
+
* Follows the four-phase setup pattern:
|
|
7
|
+
* 1. setupEntities — Create singleton repository
|
|
8
|
+
* 2. setupUCs — Create singleton use cases (if any)
|
|
9
|
+
* 3. setupPMs — Create singleton PMs (if any)
|
|
10
|
+
* 4. finalSetup — Cross-component wiring
|
|
11
|
+
*
|
|
12
|
+
* Per-instance UCs and PMs are created on-demand via the entity factory.
|
|
13
|
+
*/
|
|
14
|
+
export declare class PneumaticPanelFeatureFactory extends DomainFactory {
|
|
15
|
+
factoryName: string;
|
|
16
|
+
private repo;
|
|
17
|
+
setupEntities(): void;
|
|
18
|
+
setupUCs(): void;
|
|
19
|
+
setupPMs(): void;
|
|
20
|
+
finalSetup(): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates and registers the PneumaticPanelFeatureFactory
|
|
24
|
+
*/
|
|
25
|
+
export declare function makePneumaticPanelFeatureFactory(appObjects: AppObjectRepo): PneumaticPanelFeatureFactory;
|
|
26
|
+
//# sourceMappingURL=PneumaticPanelFeatureFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PneumaticPanelFeatureFactory.d.ts","sourceRoot":"","sources":["../../src/Factory/PneumaticPanelFeatureFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAe3D;;;;;;;;;;;GAWG;AACH,qBAAa,4BAA6B,SAAQ,aAAa;IAC7D,WAAW,SAAkC;IAE7C,OAAO,CAAC,IAAI,CAAmC;IAE/C,aAAa,IAAI,IAAI;IAOrB,QAAQ,IAAI,IAAI;IAIhB,QAAQ,IAAI,IAAI;IAKhB,UAAU,IAAI,IAAI;CAGnB;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,UAAU,EAAE,aAAa,GACxB,4BAA4B,CAG9B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AbstractMesh } from "@babylonjs/core";
|
|
2
|
+
import { AppObject, AppObjectView } from "@vived/core";
|
|
3
|
+
/**
|
|
4
|
+
* PneumaticPanelBabylonView
|
|
5
|
+
*
|
|
6
|
+
* Babylon.js view for the Pneumatic Panel. Subscribes to the PM
|
|
7
|
+
* and updates the 3D representation when the view model changes.
|
|
8
|
+
*
|
|
9
|
+
* Replace the implementation with your actual Babylon.js rendering logic.
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class PneumaticPanelBabylonView extends AppObjectView {
|
|
12
|
+
static readonly type = "PneumaticPanelBabylonView";
|
|
13
|
+
/** Set up the view by subscribing to the PM */
|
|
14
|
+
abstract setupView(): Promise<void>;
|
|
15
|
+
/** Bind loaded meshes to this view for rendering */
|
|
16
|
+
abstract bindMeshes(meshes: AbstractMesh[]): void;
|
|
17
|
+
static get(appObj: AppObject): PneumaticPanelBabylonView | undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Factory function to create a PneumaticPanelBabylonView
|
|
21
|
+
*/
|
|
22
|
+
export declare function makePneumaticPanelBabylonView(appObject: AppObject): PneumaticPanelBabylonView;
|
|
23
|
+
//# sourceMappingURL=PneumaticPanelBabylonView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PneumaticPanelBabylonView.d.ts","sourceRoot":"","sources":["../../../src/Frameworks/Babylon/PneumaticPanelBabylonView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMvD;;;;;;;GAOG;AACH,8BAAsB,yBAA0B,SAAQ,aAAa;IACnE,MAAM,CAAC,QAAQ,CAAC,IAAI,+BAA+B;IAEnD,+CAA+C;IAC/C,QAAQ,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAEnC,oDAAoD;IACpD,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI;IAEjD,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,GAAG,yBAAyB,GAAG,SAAS;CAGrE;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,SAAS,GACnB,yBAAyB,CAE3B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AppObjectRepo } from "@vived/core";
|
|
2
|
+
import { PneumaticPanelBabylonView } from "./PneumaticPanelBabylonView";
|
|
3
|
+
export interface CreateBabylonPneumaticPanelOptions {
|
|
4
|
+
id: string;
|
|
5
|
+
appObjects: AppObjectRepo;
|
|
6
|
+
createIfMissing?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Babylon composition helper to bridge domain setup with Babylon view setup.
|
|
10
|
+
* Keeps framework-specific wiring out of the domain layers.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createBabylonPneumaticPanel(options: CreateBabylonPneumaticPanelOptions): Promise<PneumaticPanelBabylonView | undefined>;
|
|
13
|
+
//# sourceMappingURL=createBabylonPneumaticPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createBabylonPneumaticPanel.d.ts","sourceRoot":"","sources":["../../../src/Frameworks/Babylon/createBabylonPneumaticPanel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,EACL,yBAAyB,EAE1B,MAAM,6BAA6B,CAAC;AAErC,MAAM,WAAW,kCAAkC;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,aAAa,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,kCAAkC,GAC1C,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC,CAoChD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
/** Machine-friendly name (used in package name, imports) */
|
|
3
|
+
name: string;
|
|
4
|
+
/** Human-friendly display name */
|
|
5
|
+
displayName: string;
|
|
6
|
+
/** Semantic version */
|
|
7
|
+
version: string;
|
|
8
|
+
/** Whether multiple instances can exist in a scene */
|
|
9
|
+
multiInstance: boolean;
|
|
10
|
+
/** 3D asset files to include in the build */
|
|
11
|
+
assets: {
|
|
12
|
+
name: string;
|
|
13
|
+
id: string;
|
|
14
|
+
file: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
18
|
+
//# sourceMappingURL=component.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.config.d.ts","sourceRoot":"","sources":["../src/component.config.ts"],"names":[],"mappings":";IACE,4DAA4D;;IAG5D,kCAAkC;;IAGlC,uBAAuB;;IAGvB,sDAAsD;;IAGtD,6CAA6C;;;;;;;AAb/C,wBAqBE"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pneumatic Panel — VIVED Smart Component
|
|
3
|
+
*
|
|
4
|
+
* Public API: re-exports all component layers for consumer use.
|
|
5
|
+
*/
|
|
6
|
+
export { PneumaticPanelEntity, makePneumaticPanelEntity, } from "./Domain/Entities/PneumaticPanelEntity";
|
|
7
|
+
export { PneumaticPanelRepo, makePneumaticPanelRepo, type PneumaticPanelEntityFactory, } from "./Domain/Entities/PneumaticPanelRepo";
|
|
8
|
+
export { PneumaticPanelToggleExhaustUC, makePneumaticPanelToggleExhaustUC, } from "./Domain/UCs/PneumaticPanelToggleExhaustUC";
|
|
9
|
+
export { PneumaticPanelToggleLockUC, makePneumaticPanelToggleLockUC, } from "./Domain/UCs/PneumaticPanelToggleLockUC";
|
|
10
|
+
export { PneumaticPanelCheckPressureUC, makePneumaticPanelCheckPressureUC, } from "./Domain/UCs/PneumaticPanelCheckPressureUC";
|
|
11
|
+
export { tryToggleExhaust } from "./Domain/Controllers/tryToggleExhaust";
|
|
12
|
+
export { tryToggleLock } from "./Domain/Controllers/tryToggleLock";
|
|
13
|
+
export { checkPressure } from "./Domain/Controllers/checkPressure";
|
|
14
|
+
export { PneumaticPanelPM, makePneumaticPanelPM, type PneumaticPanelVM, } from "./Domain/PMs/PneumaticPanelPM";
|
|
15
|
+
export { pneumaticPanelPMAdapter } from "./Domain/Adapters/pneumaticPanelPMAdapter";
|
|
16
|
+
export { PneumaticPanelBabylonView, makePneumaticPanelBabylonView, } from "./Frameworks/Babylon/PneumaticPanelBabylonView";
|
|
17
|
+
export { PneumaticPanelFeatureFactory, makePneumaticPanelFeatureFactory, } from "./Domain/Factory/PneumaticPanelFeatureFactory";
|
|
18
|
+
export { createBabylonPneumaticPanel, type CreateBabylonPneumaticPanelOptions, } from "./Frameworks/Babylon/createBabylonPneumaticPanel";
|
|
19
|
+
export { MockPneumaticPanelPM } from "./Domain/Mocks/MockPneumaticPanelPM";
|
|
20
|
+
export { MockPneumaticPanelToggleExhaustUC } from "./Domain/Mocks/MockPneumaticPanelToggleExhaustUC";
|
|
21
|
+
export { MockPneumaticPanelToggleLockUC } from "./Domain/Mocks/MockPneumaticPanelToggleLockUC";
|
|
22
|
+
export { MockPneumaticPanelCheckPressureUC } from "./Domain/Mocks/MockPneumaticPanelCheckPressureUC";
|
|
23
|
+
export { default as componentConfig } from "./component.config";
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,KAAK,2BAA2B,GACjC,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,GAClC,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,GAC/B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,GAClC,MAAM,4CAA4C,CAAC;AAGpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAGnE,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,gBAAgB,GACtB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAGpF,OAAO,EACL,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,gDAAgD,CAAC;AAGxD,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,GACjC,MAAM,+CAA+C,CAAC;AAGvD,OAAO,EACL,2BAA2B,EAC3B,KAAK,kCAAkC,GACxC,MAAM,kDAAkD,CAAC;AAG1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,iCAAiC,EAAE,MAAM,kDAAkD,CAAC;AACrG,OAAO,EAAE,8BAA8B,EAAE,MAAM,+CAA+C,CAAC;AAC/F,OAAO,EAAE,iCAAiC,EAAE,MAAM,kDAAkD,CAAC;AAGrG,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
import { AppObjectEntity as d, MemoizedBoolean as g, MemoizedNumber as f, AppObjectEntityRepo as C, getSingletonComponent as x, generateUniqueID as k, AppObjectUC as p, AppObjectPM as w, AppObjectView as b, DomainFactory as E } from "@vived/core";
|
|
2
|
+
class a extends d {
|
|
3
|
+
static type = "PneumaticPanelEntity";
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves the entity from an AppObject
|
|
6
|
+
*/
|
|
7
|
+
static get(e) {
|
|
8
|
+
return e.getComponent(this.type);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves the entity by AppObject ID
|
|
12
|
+
*/
|
|
13
|
+
static getById(e, n) {
|
|
14
|
+
return n.get(e)?.getComponent(this.type);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function y(t) {
|
|
18
|
+
return new O(t);
|
|
19
|
+
}
|
|
20
|
+
class O extends a {
|
|
21
|
+
memoizedExhaustOpen = new g(
|
|
22
|
+
!1,
|
|
23
|
+
this.notifyOnChange
|
|
24
|
+
);
|
|
25
|
+
memoizedIsLocked = new g(!1, this.notifyOnChange);
|
|
26
|
+
memoizedPressure = new f(60, this.notifyOnChange);
|
|
27
|
+
get exhaustOpen() {
|
|
28
|
+
return this.memoizedExhaustOpen.val;
|
|
29
|
+
}
|
|
30
|
+
set exhaustOpen(e) {
|
|
31
|
+
this.memoizedExhaustOpen.val = e;
|
|
32
|
+
}
|
|
33
|
+
get isLocked() {
|
|
34
|
+
return this.memoizedIsLocked.val;
|
|
35
|
+
}
|
|
36
|
+
set isLocked(e) {
|
|
37
|
+
this.memoizedIsLocked.val = e;
|
|
38
|
+
}
|
|
39
|
+
get pressure() {
|
|
40
|
+
return this.memoizedPressure.val;
|
|
41
|
+
}
|
|
42
|
+
set pressure(e) {
|
|
43
|
+
this.memoizedPressure.val = e;
|
|
44
|
+
}
|
|
45
|
+
constructor(e) {
|
|
46
|
+
super(e, a.type);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
class r extends C {
|
|
50
|
+
static type = "PneumaticPanelRepo";
|
|
51
|
+
/**
|
|
52
|
+
* Global accessor for the singleton repository
|
|
53
|
+
*/
|
|
54
|
+
static get(e) {
|
|
55
|
+
return x(
|
|
56
|
+
r.type,
|
|
57
|
+
e
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function U(t) {
|
|
62
|
+
return new L(t);
|
|
63
|
+
}
|
|
64
|
+
class L extends r {
|
|
65
|
+
pneumaticPanelEntityFactory = (e) => {
|
|
66
|
+
const n = this.appObjects.getOrCreate(e);
|
|
67
|
+
return y(n);
|
|
68
|
+
};
|
|
69
|
+
createPneumaticPanelEntity(e) {
|
|
70
|
+
const n = e ?? k(), s = this.pneumaticPanelEntityFactory(n);
|
|
71
|
+
return this.add(s), s;
|
|
72
|
+
}
|
|
73
|
+
deletePneumaticPanelEntity(e) {
|
|
74
|
+
const n = this.getForAppObject(e);
|
|
75
|
+
if (!n) {
|
|
76
|
+
this.warn(`Cannot delete: entity with id '${e}' not found`);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
n.appObject.dispose(), this.removeForAppObject(e);
|
|
80
|
+
}
|
|
81
|
+
constructor(e) {
|
|
82
|
+
super(e, r.type);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
class c extends p {
|
|
86
|
+
static type = "PneumaticPanelToggleExhaustUC";
|
|
87
|
+
static get(e) {
|
|
88
|
+
return e.getComponent(this.type);
|
|
89
|
+
}
|
|
90
|
+
static getById(e, n) {
|
|
91
|
+
return n.get(e)?.getComponent(this.type);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function I(t) {
|
|
95
|
+
return new M(t);
|
|
96
|
+
}
|
|
97
|
+
class M extends c {
|
|
98
|
+
_maxPressure = 60;
|
|
99
|
+
get entity() {
|
|
100
|
+
try {
|
|
101
|
+
return this.getCachedLocalComponent(
|
|
102
|
+
a.type
|
|
103
|
+
);
|
|
104
|
+
} catch {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
get maxPressure() {
|
|
109
|
+
return this._maxPressure;
|
|
110
|
+
}
|
|
111
|
+
set maxPressure(e) {
|
|
112
|
+
this._maxPressure = e;
|
|
113
|
+
}
|
|
114
|
+
toggleExhaust() {
|
|
115
|
+
const e = this.entity;
|
|
116
|
+
return e ? e.isLocked ? !1 : (e.exhaustOpen = !e.exhaustOpen, e.pressure = e.exhaustOpen ? 0 : this._maxPressure, !0) : (this.warn("Missing PneumaticPanelEntity"), !1);
|
|
117
|
+
}
|
|
118
|
+
constructor(e) {
|
|
119
|
+
super(e, c.type);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
class u extends p {
|
|
123
|
+
static type = "PneumaticPanelToggleLockUC";
|
|
124
|
+
static get(e) {
|
|
125
|
+
return e.getComponent(this.type);
|
|
126
|
+
}
|
|
127
|
+
static getById(e, n) {
|
|
128
|
+
return n.get(e)?.getComponent(this.type);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function v(t) {
|
|
132
|
+
return new A(t);
|
|
133
|
+
}
|
|
134
|
+
class A extends u {
|
|
135
|
+
get entity() {
|
|
136
|
+
try {
|
|
137
|
+
return this.getCachedLocalComponent(
|
|
138
|
+
a.type
|
|
139
|
+
);
|
|
140
|
+
} catch {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
toggleLock() {
|
|
145
|
+
const e = this.entity;
|
|
146
|
+
return e ? e.isLocked ? (e.isLocked = !1, !0) : e.exhaustOpen ? !1 : (e.isLocked = !0, !0) : (this.warn("Missing PneumaticPanelEntity"), !1);
|
|
147
|
+
}
|
|
148
|
+
constructor(e) {
|
|
149
|
+
super(e, u.type);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
class o extends p {
|
|
153
|
+
static type = "PneumaticPanelCheckPressureUC";
|
|
154
|
+
static get(e) {
|
|
155
|
+
return e.getComponent(this.type);
|
|
156
|
+
}
|
|
157
|
+
static getById(e, n) {
|
|
158
|
+
return n.get(e)?.getComponent(this.type);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
function B(t) {
|
|
162
|
+
return new T(t);
|
|
163
|
+
}
|
|
164
|
+
class T extends o {
|
|
165
|
+
get entity() {
|
|
166
|
+
try {
|
|
167
|
+
return this.getCachedLocalComponent(
|
|
168
|
+
a.type
|
|
169
|
+
);
|
|
170
|
+
} catch {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
get showAlertUC() {
|
|
175
|
+
try {
|
|
176
|
+
const e = this.appObjects?.get("ShowAlertUC");
|
|
177
|
+
return e ? e.getComponent("ShowAlertUC") : void 0;
|
|
178
|
+
} catch {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
checkPressure() {
|
|
183
|
+
const e = this.entity;
|
|
184
|
+
if (!e) {
|
|
185
|
+
this.warn("Missing PneumaticPanelEntity");
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const n = this.showAlertUC;
|
|
189
|
+
if (!n) {
|
|
190
|
+
this.warn("Missing ShowAlertUC - unable to display pressure dialog");
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
const s = {
|
|
194
|
+
title: "Pneumatic Panel Pressure",
|
|
195
|
+
message: `${e.pressure} PSI`,
|
|
196
|
+
closeButtonLabel: "OK",
|
|
197
|
+
closeCallback: () => {
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
n.showAlert(s);
|
|
201
|
+
}
|
|
202
|
+
constructor(e) {
|
|
203
|
+
super(e, o.type);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function D(t, e) {
|
|
207
|
+
const n = c.getById(t, e);
|
|
208
|
+
return n ? n.toggleExhaust() : (e.submitWarning(
|
|
209
|
+
"tryToggleExhaust",
|
|
210
|
+
"Unable to find PneumaticPanelToggleExhaustUC"
|
|
211
|
+
), !1);
|
|
212
|
+
}
|
|
213
|
+
function R(t, e) {
|
|
214
|
+
const n = u.getById(t, e);
|
|
215
|
+
return n ? n.toggleLock() : (e.submitWarning(
|
|
216
|
+
"tryToggleLock",
|
|
217
|
+
"Unable to find PneumaticPanelToggleLockUC"
|
|
218
|
+
), !1);
|
|
219
|
+
}
|
|
220
|
+
function q(t, e) {
|
|
221
|
+
const n = o.getById(t, e);
|
|
222
|
+
if (!n) {
|
|
223
|
+
e.submitWarning(
|
|
224
|
+
"checkPressure",
|
|
225
|
+
"Unable to find PneumaticPanelCheckPressureUC"
|
|
226
|
+
);
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
n.checkPressure();
|
|
230
|
+
}
|
|
231
|
+
class i extends w {
|
|
232
|
+
static type = "PneumaticPanelPM";
|
|
233
|
+
static get(e) {
|
|
234
|
+
return e.getComponent(this.type);
|
|
235
|
+
}
|
|
236
|
+
static getById(e, n) {
|
|
237
|
+
return n.get(e)?.getComponent(this.type);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
function V(t) {
|
|
241
|
+
return new j(t);
|
|
242
|
+
}
|
|
243
|
+
class j extends i {
|
|
244
|
+
get entity() {
|
|
245
|
+
return this.getCachedLocalComponent(
|
|
246
|
+
a.type
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
vmsAreEqual(e, n) {
|
|
250
|
+
return e.exhaustOpen === n.exhaustOpen && e.isLocked === n.isLocked && e.pressure === n.pressure;
|
|
251
|
+
}
|
|
252
|
+
onEntityChange = () => {
|
|
253
|
+
const e = this.entity;
|
|
254
|
+
e && this.doUpdateView({
|
|
255
|
+
exhaustOpen: e.exhaustOpen,
|
|
256
|
+
isLocked: e.isLocked,
|
|
257
|
+
pressure: e.pressure
|
|
258
|
+
});
|
|
259
|
+
};
|
|
260
|
+
constructor(e) {
|
|
261
|
+
super(e, i.type), this.entity?.addChangeObserver(this.onEntityChange), this.onEntityChange();
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
const N = {
|
|
265
|
+
defaultVM: {
|
|
266
|
+
exhaustOpen: !1,
|
|
267
|
+
isLocked: !1,
|
|
268
|
+
pressure: 60
|
|
269
|
+
},
|
|
270
|
+
subscribe: (t, e, n) => {
|
|
271
|
+
if (!t) return;
|
|
272
|
+
const s = i.getById(t, e);
|
|
273
|
+
if (!s) {
|
|
274
|
+
e.submitWarning(
|
|
275
|
+
"pneumaticPanelPMAdapter",
|
|
276
|
+
"Unable to find PneumaticPanelPM"
|
|
277
|
+
);
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
s.addView(n);
|
|
281
|
+
},
|
|
282
|
+
unsubscribe: (t, e, n) => {
|
|
283
|
+
if (!t) return;
|
|
284
|
+
const s = i.getById(t, e);
|
|
285
|
+
s && s.removeView(n);
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
class h extends b {
|
|
289
|
+
static type = "PneumaticPanelBabylonView";
|
|
290
|
+
static get(e) {
|
|
291
|
+
return e.getComponent(this.type);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
function F(t) {
|
|
295
|
+
return new z(t);
|
|
296
|
+
}
|
|
297
|
+
class z extends h {
|
|
298
|
+
pm;
|
|
299
|
+
async setupView() {
|
|
300
|
+
if (this.pm = this.getCachedLocalComponent(
|
|
301
|
+
i.type
|
|
302
|
+
), !this.pm) {
|
|
303
|
+
this.warn("Missing PneumaticPanelPM for view");
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
this.pm.addView(this.applyView);
|
|
307
|
+
}
|
|
308
|
+
bindMeshes(e) {
|
|
309
|
+
}
|
|
310
|
+
applyView = (e) => {
|
|
311
|
+
};
|
|
312
|
+
dispose() {
|
|
313
|
+
this.pm && this.pm.removeView(this.applyView), super.dispose();
|
|
314
|
+
}
|
|
315
|
+
constructor(e) {
|
|
316
|
+
super(e, h.type);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
class S extends E {
|
|
320
|
+
factoryName = "PneumaticPanelFeatureFactory";
|
|
321
|
+
repo = null;
|
|
322
|
+
setupEntities() {
|
|
323
|
+
this.repo = U(this.appObject), this.repo.pneumaticPanelEntityFactory = W(this.appObjects);
|
|
324
|
+
}
|
|
325
|
+
setupUCs() {
|
|
326
|
+
}
|
|
327
|
+
setupPMs() {
|
|
328
|
+
}
|
|
329
|
+
finalSetup() {
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
function $(t) {
|
|
333
|
+
const e = t.getOrCreate("PneumaticPanels");
|
|
334
|
+
return new S(e);
|
|
335
|
+
}
|
|
336
|
+
function W(t) {
|
|
337
|
+
return function(e) {
|
|
338
|
+
const n = t.getOrCreate(e), s = y(n);
|
|
339
|
+
return I(n), v(n), B(n), V(n), s;
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
async function K(t) {
|
|
343
|
+
const { id: e, appObjects: n, createIfMissing: s = !0 } = t;
|
|
344
|
+
if (!e) {
|
|
345
|
+
n.submitWarning(
|
|
346
|
+
"createBabylonPneumaticPanel",
|
|
347
|
+
"Expected non-empty component id"
|
|
348
|
+
);
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
const m = r.get(n);
|
|
352
|
+
if (!m) {
|
|
353
|
+
n.submitWarning(
|
|
354
|
+
"createBabylonPneumaticPanel",
|
|
355
|
+
"Unable to find PneumaticPanelRepo"
|
|
356
|
+
);
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
let l = a.getById(e, n);
|
|
360
|
+
if (!l && s && (l = m.createPneumaticPanelEntity(e)), !l) {
|
|
361
|
+
n.submitWarning(
|
|
362
|
+
"createBabylonPneumaticPanel",
|
|
363
|
+
"Unable to find PneumaticPanelEntity"
|
|
364
|
+
);
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
const P = F(l.appObject);
|
|
368
|
+
return await P.setupView(), P;
|
|
369
|
+
}
|
|
370
|
+
class G extends i {
|
|
371
|
+
vmsAreEqual = () => !0;
|
|
372
|
+
constructor(e) {
|
|
373
|
+
super(e, i.type);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
class H extends c {
|
|
377
|
+
maxPressure = 60;
|
|
378
|
+
toggleExhaust = () => !0;
|
|
379
|
+
constructor(e) {
|
|
380
|
+
super(e, c.type);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
class J extends u {
|
|
384
|
+
toggleLock = () => !0;
|
|
385
|
+
constructor(e) {
|
|
386
|
+
super(e, u.type);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
class Q extends o {
|
|
390
|
+
checkPressure = () => {
|
|
391
|
+
};
|
|
392
|
+
constructor(e) {
|
|
393
|
+
super(e, o.type);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
const X = {
|
|
397
|
+
/** Machine-friendly name (used in package name, imports) */
|
|
398
|
+
name: "PneumaticPanel",
|
|
399
|
+
/** Human-friendly display name */
|
|
400
|
+
displayName: "Pneumatic Panel",
|
|
401
|
+
/** Semantic version */
|
|
402
|
+
version: "0.1.0",
|
|
403
|
+
/** Whether multiple instances can exist in a scene */
|
|
404
|
+
multiInstance: !0,
|
|
405
|
+
/** 3D asset files to include in the build */
|
|
406
|
+
assets: [
|
|
407
|
+
{
|
|
408
|
+
name: "default",
|
|
409
|
+
id: "TODO_ASSET_ID",
|
|
410
|
+
file: "PneumaticPanel.glb"
|
|
411
|
+
}
|
|
412
|
+
]
|
|
413
|
+
};
|
|
414
|
+
export {
|
|
415
|
+
Q as MockPneumaticPanelCheckPressureUC,
|
|
416
|
+
G as MockPneumaticPanelPM,
|
|
417
|
+
H as MockPneumaticPanelToggleExhaustUC,
|
|
418
|
+
J as MockPneumaticPanelToggleLockUC,
|
|
419
|
+
h as PneumaticPanelBabylonView,
|
|
420
|
+
o as PneumaticPanelCheckPressureUC,
|
|
421
|
+
a as PneumaticPanelEntity,
|
|
422
|
+
S as PneumaticPanelFeatureFactory,
|
|
423
|
+
i as PneumaticPanelPM,
|
|
424
|
+
r as PneumaticPanelRepo,
|
|
425
|
+
c as PneumaticPanelToggleExhaustUC,
|
|
426
|
+
u as PneumaticPanelToggleLockUC,
|
|
427
|
+
q as checkPressure,
|
|
428
|
+
X as componentConfig,
|
|
429
|
+
K as createBabylonPneumaticPanel,
|
|
430
|
+
F as makePneumaticPanelBabylonView,
|
|
431
|
+
B as makePneumaticPanelCheckPressureUC,
|
|
432
|
+
y as makePneumaticPanelEntity,
|
|
433
|
+
$ as makePneumaticPanelFeatureFactory,
|
|
434
|
+
V as makePneumaticPanelPM,
|
|
435
|
+
U as makePneumaticPanelRepo,
|
|
436
|
+
I as makePneumaticPanelToggleExhaustUC,
|
|
437
|
+
v as makePneumaticPanelToggleLockUC,
|
|
438
|
+
N as pneumaticPanelPMAdapter,
|
|
439
|
+
D as tryToggleExhaust,
|
|
440
|
+
R as tryToggleLock
|
|
441
|
+
};
|
package/dist/studio.env
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vived/component-pneumatic-panel",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Pneumatic Panel — VIVED Smart Component",
|
|
5
|
+
"private": false,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "vite build && tsc --project tsconfig.build.json --emitDeclarationOnly",
|
|
20
|
+
"dev": "vite --config vite.playground.config.ts",
|
|
21
|
+
"dev:watch": "vite build --watch",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest",
|
|
24
|
+
"test:coverage": "vitest run --coverage",
|
|
25
|
+
"lint": "eslint src/",
|
|
26
|
+
"upload-asset": "tsx scripts/upload-asset.ts"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@babylonjs/core": "^9.0.0",
|
|
30
|
+
"@vived/core": "^2.0.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@babylonjs/core": "^9.0.0",
|
|
34
|
+
"@babylonjs/inspector": "^9.0.0",
|
|
35
|
+
"@babylonjs/loaders": "^9.0.0",
|
|
36
|
+
"@eslint/js": "^9.0.0",
|
|
37
|
+
"@types/node": "^22.0.0",
|
|
38
|
+
"@vived/app": "^6.2.0",
|
|
39
|
+
"@vived/core": "^2.0.0",
|
|
40
|
+
"aws-amplify": "^6.16.0",
|
|
41
|
+
"eslint": "^9.0.0",
|
|
42
|
+
"tsx": "^4.0.0",
|
|
43
|
+
"typescript": "^5.8.3",
|
|
44
|
+
"typescript-eslint": "^8.0.0",
|
|
45
|
+
"vite": "^7.0.0",
|
|
46
|
+
"vitest": "^2.0.0"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=18"
|
|
50
|
+
}
|
|
51
|
+
}
|