@things-factory/headless-twin 10.0.9 → 10.0.10
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-server/engine/canonical-ingest.d.ts +2 -2
- package/dist-server/engine/canonical-ingest.js +24 -2
- package/dist-server/engine/canonical-ingest.js.map +1 -1
- package/dist-server/engine/command-routing.js +1 -1
- package/dist-server/engine/command-routing.js.map +1 -1
- package/dist-server/engine/energy-topology.d.ts +86 -0
- package/dist-server/engine/energy-topology.js +144 -0
- package/dist-server/engine/energy-topology.js.map +1 -0
- package/dist-server/engine/index.d.ts +8 -3
- package/dist-server/engine/index.js +10 -3
- package/dist-server/engine/index.js.map +1 -1
- package/dist-server/engine/kpi-baseline.d.ts +1 -1
- package/dist-server/engine/kpi-baseline.js.map +1 -1
- package/dist-server/engine/kpi-fold.d.ts +137 -1
- package/dist-server/engine/kpi-fold.js +225 -0
- package/dist-server/engine/kpi-fold.js.map +1 -1
- package/dist-server/engine/kpi-query.d.ts +1 -1
- package/dist-server/engine/kpi-query.js +212 -18
- package/dist-server/engine/kpi-query.js.map +1 -1
- package/dist-server/engine/kpi-target.d.ts +17 -0
- package/dist-server/engine/kpi-target.js +24 -2
- package/dist-server/engine/kpi-target.js.map +1 -1
- package/dist-server/engine/live-feed-registry.d.ts +25 -0
- package/dist-server/engine/live-feed-registry.js +51 -0
- package/dist-server/engine/live-feed-registry.js.map +1 -0
- package/dist-server/engine/load-meter.d.ts +181 -0
- package/dist-server/engine/load-meter.js +267 -0
- package/dist-server/engine/load-meter.js.map +1 -0
- package/dist-server/engine/local-declarations.d.ts +262 -0
- package/dist-server/engine/local-declarations.js +528 -0
- package/dist-server/engine/local-declarations.js.map +1 -0
- package/dist-server/engine/model-basis.d.ts +39 -6
- package/dist-server/engine/model-basis.js +69 -9
- package/dist-server/engine/model-basis.js.map +1 -1
- package/dist-server/engine/{board-vocabulary.d.ts → model-vocabulary.d.ts} +4 -4
- package/dist-server/engine/{board-vocabulary.js → model-vocabulary.js} +37 -19
- package/dist-server/engine/model-vocabulary.js.map +1 -0
- package/dist-server/engine/oee-accumulator.d.ts +28 -0
- package/dist-server/engine/oee-accumulator.js +26 -1
- package/dist-server/engine/oee-accumulator.js.map +1 -1
- package/dist-server/engine/operation-basis.d.ts +32 -0
- package/dist-server/engine/operation-basis.js +87 -0
- package/dist-server/engine/operation-basis.js.map +1 -0
- package/dist-server/engine/property-effects.d.ts +30 -0
- package/dist-server/engine/property-effects.js +192 -0
- package/dist-server/engine/property-effects.js.map +1 -0
- package/dist-server/engine/runtime-key.d.ts +1 -1
- package/dist-server/engine/runtime-key.js +1 -1
- package/dist-server/engine/runtime-key.js.map +1 -1
- package/dist-server/engine/spec-coverage.js +3 -3
- package/dist-server/engine/spec-coverage.js.map +1 -1
- package/dist-server/engine/state-axes.d.ts +7 -2
- package/dist-server/engine/state-axes.js +8 -3
- package/dist-server/engine/state-axes.js.map +1 -1
- package/dist-server/engine/structure-diff.js +1 -1
- package/dist-server/engine/structure-diff.js.map +1 -1
- package/dist-server/engine/travel-estimator.d.ts +9 -2
- package/dist-server/engine/travel-estimator.js +11 -6
- package/dist-server/engine/travel-estimator.js.map +1 -1
- package/dist-server/engine/twin-engine.d.ts +332 -47
- package/dist-server/engine/twin-engine.js +1314 -279
- package/dist-server/engine/twin-engine.js.map +1 -1
- package/dist-server/engine/warm-start.d.ts +38 -4
- package/dist-server/engine/warm-start.js +38 -9
- package/dist-server/engine/warm-start.js.map +1 -1
- package/dist-server/index.d.ts +1 -0
- package/dist-server/index.js +17 -11
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/1786000000000-RenameTwinInstanceBoardToModel.d.ts +5 -0
- package/dist-server/migrations/1786000000000-RenameTwinInstanceBoardToModel.js +48 -0
- package/dist-server/migrations/1786000000000-RenameTwinInstanceBoardToModel.js.map +1 -0
- package/dist-server/migrations/index.d.ts +2 -0
- package/dist-server/migrations/index.js +10 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/service/index.d.ts +3 -2
- package/dist-server/service/index.js +25 -17
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/reference/discovery-result.d.ts +1 -1
- package/dist-server/service/reference/discovery-result.js +2 -2
- package/dist-server/service/reference/discovery-result.js.map +1 -1
- package/dist-server/service/reference/ingest-space.d.ts +24 -1
- package/dist-server/service/reference/ingest-space.js +17 -1
- package/dist-server/service/reference/ingest-space.js.map +1 -1
- package/dist-server/service/reference/reference-live.d.ts +23 -0
- package/dist-server/service/reference/reference-live.js +121 -4
- package/dist-server/service/reference/reference-live.js.map +1 -1
- package/dist-server/service/reference/reference-master.d.ts +194 -13
- package/dist-server/service/reference/reference-master.js +159 -28
- package/dist-server/service/reference/reference-master.js.map +1 -1
- package/dist-server/service/reference/reference-resolver.d.ts +31 -1
- package/dist-server/service/reference/reference-resolver.js +223 -12
- package/dist-server/service/reference/reference-resolver.js.map +1 -1
- package/dist-server/service/reference/template-registry.d.ts +19 -3
- package/dist-server/service/reference/template-registry.js.map +1 -1
- package/dist-server/service/twin-audit/command-audit.d.ts +37 -0
- package/dist-server/service/twin-audit/command-audit.js +53 -0
- package/dist-server/service/twin-audit/command-audit.js.map +1 -0
- package/dist-server/service/twin-audit/index.d.ts +4 -0
- package/dist-server/service/twin-audit/index.js +8 -0
- package/dist-server/service/twin-audit/index.js.map +1 -0
- package/dist-server/service/twin-audit/twin-audit-event.d.ts +24 -0
- package/dist-server/service/twin-audit/twin-audit-event.js +125 -0
- package/dist-server/service/twin-audit/twin-audit-event.js.map +1 -0
- package/dist-server/service/twin-audit/twin-audit-query.d.ts +4 -0
- package/dist-server/service/twin-audit/twin-audit-query.js +76 -0
- package/dist-server/service/twin-audit/twin-audit-query.js.map +1 -0
- package/dist-server/service/twin-control/twin-control-mutation.js +21 -1
- package/dist-server/service/twin-control/twin-control-mutation.js.map +1 -1
- package/dist-server/service/twin-event/twin-event-keys.d.ts +1 -1
- package/dist-server/service/twin-event/twin-event-keys.js +1 -1
- package/dist-server/service/twin-event/twin-event-keys.js.map +1 -1
- package/dist-server/service/twin-event/twin-event.d.ts +14 -5
- package/dist-server/service/twin-event/twin-event.js +46 -14
- package/dist-server/service/twin-event/twin-event.js.map +1 -1
- package/dist-server/service/twin-forecast/forecast-metrics.d.ts +13 -0
- package/dist-server/service/twin-forecast/forecast-metrics.js +57 -0
- package/dist-server/service/twin-forecast/forecast-metrics.js.map +1 -0
- package/dist-server/service/twin-forecast/forecast-tuning.d.ts +12 -0
- package/dist-server/service/twin-forecast/forecast-tuning.js +44 -0
- package/dist-server/service/twin-forecast/forecast-tuning.js.map +1 -0
- package/dist-server/service/twin-forecast/gap-analytics.d.ts +28 -2
- package/dist-server/service/twin-forecast/gap-analytics.js +43 -17
- package/dist-server/service/twin-forecast/gap-analytics.js.map +1 -1
- package/dist-server/service/twin-forecast/twin-forecast-query.js +217 -38
- package/dist-server/service/twin-forecast/twin-forecast-query.js.map +1 -1
- package/dist-server/service/twin-instance/twin-instance.d.ts +38 -5
- package/dist-server/service/twin-instance/twin-instance.js +66 -20
- package/dist-server/service/twin-instance/twin-instance.js.map +1 -1
- package/dist-server/service/twin-journal/twin-journal-query.d.ts +5 -2
- package/dist-server/service/twin-journal/twin-journal-query.js +71 -9
- package/dist-server/service/twin-journal/twin-journal-query.js.map +1 -1
- package/dist-server/service/twin-lifecycle/twin-lifecycle-mutation.d.ts +3 -5
- package/dist-server/service/twin-lifecycle/twin-lifecycle-mutation.js +24 -27
- package/dist-server/service/twin-lifecycle/twin-lifecycle-mutation.js.map +1 -1
- package/dist-server/service/twin-metrics/twin-metrics-query.d.ts +1 -0
- package/dist-server/service/twin-metrics/twin-metrics-query.js +62 -0
- package/dist-server/service/twin-metrics/twin-metrics-query.js.map +1 -1
- package/dist-server/service/twin-model/epcis-coverage.d.ts +14 -0
- package/dist-server/service/twin-model/epcis-coverage.js +174 -0
- package/dist-server/service/twin-model/epcis-coverage.js.map +1 -0
- package/dist-server/service/twin-model/iec61850-coverage.d.ts +14 -0
- package/dist-server/service/twin-model/iec61850-coverage.js +98 -0
- package/dist-server/service/twin-model/iec61850-coverage.js.map +1 -0
- package/dist-server/service/twin-model/index.d.ts +13 -0
- package/dist-server/service/twin-model/index.js +29 -0
- package/dist-server/service/twin-model/index.js.map +1 -0
- package/dist-server/service/twin-model/isa95-coverage.d.ts +48 -0
- package/dist-server/service/twin-model/isa95-coverage.js +155 -0
- package/dist-server/service/twin-model/isa95-coverage.js.map +1 -0
- package/dist-server/service/twin-model/project-structure.d.ts +16 -0
- package/dist-server/service/twin-model/project-structure.js +173 -0
- package/dist-server/service/twin-model/project-structure.js.map +1 -0
- package/dist-server/service/twin-model/standard-coverage.d.ts +9 -0
- package/dist-server/service/twin-model/standard-coverage.js +37 -0
- package/dist-server/service/twin-model/standard-coverage.js.map +1 -0
- package/dist-server/service/twin-model/twin-equipment.d.ts +64 -0
- package/dist-server/service/twin-model/twin-equipment.js +134 -0
- package/dist-server/service/twin-model/twin-equipment.js.map +1 -0
- package/dist-server/service/twin-model/twin-lineage-query.d.ts +3 -0
- package/dist-server/service/twin-model/twin-lineage-query.js +206 -0
- package/dist-server/service/twin-model/twin-lineage-query.js.map +1 -0
- package/dist-server/service/twin-model/twin-location.d.ts +58 -0
- package/dist-server/service/twin-model/twin-location.js +130 -0
- package/dist-server/service/twin-model/twin-location.js.map +1 -0
- package/dist-server/service/twin-model/twin-model-item-query.d.ts +141 -0
- package/dist-server/service/twin-model/twin-model-item-query.js +852 -0
- package/dist-server/service/twin-model/twin-model-item-query.js.map +1 -0
- package/dist-server/service/twin-model/twin-model-mutation.d.ts +57 -0
- package/dist-server/service/twin-model/twin-model-mutation.js +490 -0
- package/dist-server/service/twin-model/twin-model-mutation.js.map +1 -0
- package/dist-server/service/twin-model/twin-model-query.d.ts +43 -0
- package/dist-server/service/twin-model/twin-model-query.js +551 -0
- package/dist-server/service/twin-model/twin-model-query.js.map +1 -0
- package/dist-server/service/twin-model/twin-model-tree-query.d.ts +3 -0
- package/dist-server/service/twin-model/twin-model-tree-query.js +158 -0
- package/dist-server/service/twin-model/twin-model-tree-query.js.map +1 -0
- package/dist-server/service/twin-model/twin-operation.d.ts +61 -0
- package/dist-server/service/twin-model/twin-operation.js +137 -0
- package/dist-server/service/twin-model/twin-operation.js.map +1 -0
- package/dist-server/service/twin-space/move-space.d.ts +65 -0
- package/dist-server/service/twin-space/move-space.js +166 -0
- package/dist-server/service/twin-space/move-space.js.map +1 -0
- package/dist-server/service/twin-space/space-integrity.d.ts +97 -0
- package/dist-server/service/twin-space/space-integrity.js +182 -0
- package/dist-server/service/twin-space/space-integrity.js.map +1 -0
- package/dist-server/service/twin-space/twin-space-area.js +4 -4
- package/dist-server/service/twin-space/twin-space-area.js.map +1 -1
- package/dist-server/service/twin-space/twin-space-representation.js +6 -6
- package/dist-server/service/twin-space/twin-space-representation.js.map +1 -1
- package/dist-server/service/twin-space/twin-space-resolver.d.ts +63 -1
- package/dist-server/service/twin-space/twin-space-resolver.js +356 -18
- package/dist-server/service/twin-space/twin-space-resolver.js.map +1 -1
- package/dist-server/service/twin-space/twin-space.d.ts +17 -1
- package/dist-server/service/twin-space/twin-space.js +15 -5
- package/dist-server/service/twin-space/twin-space.js.map +1 -1
- package/dist-server/service/twin-structure/twin-structure.d.ts +1 -1
- package/dist-server/service/twin-structure/twin-structure.js +8 -8
- package/dist-server/service/twin-structure/twin-structure.js.map +1 -1
- package/dist-shared/axis-read.d.ts +12 -0
- package/dist-shared/axis-read.js +32 -0
- package/dist-shared/axis-read.js.map +1 -0
- package/{dist-server/engine → dist-shared}/entity-delta.d.ts +3 -0
- package/{dist-server/engine → dist-shared}/entity-delta.js +102 -2
- package/dist-shared/entity-delta.js.map +1 -0
- package/dist-shared/kpi-broadcast.js.map +1 -0
- package/dist-shared/twin-level.js.map +1 -0
- package/package.json +14 -12
- package/server/engine/canonical-ingest.ts +36 -4
- package/server/engine/command-routing.ts +1 -1
- package/server/engine/energy-topology.ts +189 -0
- package/server/engine/index.ts +10 -3
- package/server/engine/kpi-baseline.ts +1 -1
- package/server/engine/kpi-fold.ts +389 -1
- package/server/engine/kpi-query.ts +214 -19
- package/server/engine/kpi-target.ts +24 -2
- package/server/engine/live-feed-registry.ts +58 -0
- package/server/engine/load-meter.ts +384 -0
- package/server/engine/local-declarations.ts +700 -0
- package/server/engine/model-basis.ts +78 -10
- package/server/engine/{board-vocabulary.ts → model-vocabulary.ts} +36 -15
- package/server/engine/oee-accumulator.ts +34 -1
- package/server/engine/operation-basis.ts +100 -0
- package/server/engine/property-effects.ts +199 -0
- package/server/engine/runtime-key.ts +1 -1
- package/server/engine/spec-coverage.ts +3 -3
- package/server/engine/state-axes.ts +8 -3
- package/server/engine/structure-diff.ts +1 -1
- package/server/engine/travel-estimator.ts +11 -6
- package/server/engine/twin-engine.ts +1414 -274
- package/server/engine/warm-start.ts +83 -12
- package/server/index.ts +13 -10
- package/server/migrations/1786000000000-RenameTwinInstanceBoardToModel.ts +43 -0
- package/server/migrations/index.ts +7 -0
- package/server/service/index.ts +9 -1
- package/server/service/reference/discovery-result.ts +2 -2
- package/server/service/reference/ingest-space.ts +35 -1
- package/server/service/reference/reference-live.ts +119 -4
- package/server/service/reference/reference-master.ts +276 -35
- package/server/service/reference/reference-resolver.ts +232 -12
- package/server/service/reference/template-registry.ts +20 -5
- package/server/service/twin-audit/command-audit.ts +81 -0
- package/server/service/twin-audit/index.ts +5 -0
- package/server/service/twin-audit/twin-audit-event.ts +112 -0
- package/server/service/twin-audit/twin-audit-query.ts +72 -0
- package/server/service/twin-control/twin-control-mutation.ts +22 -1
- package/server/service/twin-event/twin-event-keys.ts +1 -1
- package/server/service/twin-event/twin-event.ts +52 -15
- package/server/service/twin-forecast/forecast-metrics.ts +60 -0
- package/server/service/twin-forecast/forecast-tuning.ts +40 -0
- package/server/service/twin-forecast/gap-analytics.ts +48 -9
- package/server/service/twin-forecast/twin-forecast-query.ts +208 -36
- package/server/service/twin-instance/twin-instance.ts +126 -25
- package/server/service/twin-journal/twin-journal-query.ts +74 -10
- package/server/service/twin-lifecycle/twin-lifecycle-mutation.ts +23 -22
- package/server/service/twin-metrics/twin-metrics-query.ts +59 -2
- package/server/service/twin-model/epcis-coverage.ts +195 -0
- package/server/service/twin-model/iec61850-coverage.ts +117 -0
- package/server/service/twin-model/index.ts +25 -0
- package/server/service/twin-model/isa95-coverage.ts +190 -0
- package/server/service/twin-model/project-structure.ts +199 -0
- package/server/service/twin-model/standard-coverage.ts +35 -0
- package/server/service/twin-model/twin-equipment.ts +150 -0
- package/server/service/twin-model/twin-lineage-query.ts +193 -0
- package/server/service/twin-model/twin-location.ts +140 -0
- package/server/service/twin-model/twin-model-item-query.ts +848 -0
- package/server/service/twin-model/twin-model-mutation.ts +503 -0
- package/server/service/twin-model/twin-model-query.ts +537 -0
- package/server/service/twin-model/twin-model-tree-query.ts +180 -0
- package/server/service/twin-model/twin-operation.ts +150 -0
- package/server/service/twin-space/move-space.ts +262 -0
- package/server/service/twin-space/space-integrity.ts +293 -0
- package/server/service/twin-space/twin-space-area.ts +4 -4
- package/server/service/twin-space/twin-space-representation.ts +6 -6
- package/server/service/twin-space/twin-space-resolver.ts +355 -21
- package/server/service/twin-space/twin-space.ts +40 -6
- package/server/service/twin-structure/twin-structure.ts +10 -10
- package/shared/axis-read.ts +28 -0
- package/{server/engine → shared}/entity-delta.ts +96 -1
- package/test/adopt-structure-live.test.ts +133 -0
- package/test/attention-digest.test.ts +3 -3
- package/test/axis-read.test.ts +87 -0
- package/test/boot-resume.test.ts +205 -0
- package/test/canonical-ingest-vocabularies.test.ts +118 -0
- package/test/capability-mapping.test.ts +1 -1
- package/test/command-routing.test.ts +1 -1
- package/test/declaration-reaches-model.test.ts +178 -0
- package/test/discovery-result.test.ts +1 -1
- package/test/energy-topology.test.ts +113 -0
- package/test/entity-delta.test.ts +171 -1
- package/test/event-time-column.test.ts +67 -0
- package/test/forecast-metrics.test.ts +71 -0
- package/test/forecast-tuning.test.ts +42 -0
- package/test/gap-analytics.test.ts +34 -7
- package/test/ingest-bench.test.ts +6 -6
- package/test/ingest-running-guard.test.ts +136 -0
- package/test/ingest-space.test.ts +29 -1
- package/test/instance-cache-lifecycle.test.ts +110 -0
- package/test/kernel-kind-guard.test.ts +96 -0
- package/test/kpi-baseline-db.test.ts +3 -1
- package/test/kpi-baseline.test.ts +3 -3
- package/test/kpi-fold.test.ts +393 -2
- package/test/kpi-query-bench.test.ts +5 -3
- package/test/lineage-survives-restart.test.ts +203 -0
- package/test/live-feed-registry.test.ts +67 -0
- package/test/live-kernel-facts.test.ts +161 -0
- package/test/live-mirror-parity.test.ts +22 -15
- package/test/load-meter.test.ts +314 -0
- package/test/local-declarations.test.ts +554 -0
- package/test/master-to-twin.test.ts +121 -33
- package/test/model-basis.test.ts +56 -1
- package/test/{board-vocabulary.test.ts → model-vocabulary.test.ts} +25 -25
- package/test/move-space.test.ts +149 -0
- package/test/mutation-gate.test.ts +19 -5
- package/test/oee-accumulator.test.ts +26 -7
- package/test/operation-basis.test.ts +100 -0
- package/test/operations-capability-db.test.ts +165 -0
- package/test/project-structure-db.test.ts +226 -0
- package/test/projection-reaches-screen.test.ts +272 -0
- package/test/property-effects.test.ts +96 -0
- package/test/resync-origin-site.test.ts +77 -0
- package/test/scale-twin-bench.test.ts +5 -5
- package/test/snapshot-freshness.test.ts +60 -0
- package/test/space-integrity.test.ts +223 -0
- package/test/standard-coverage.test.ts +94 -0
- package/test/state-axes.test.ts +1 -1
- package/test/streamline-e2e.test.ts +14 -14
- package/test/structure-revision-db.test.ts +11 -11
- package/test/tenant-registry-db.test.ts +5 -5
- package/test/twin-audit.test.ts +83 -0
- package/test/twin-model-item-db.test.ts +275 -0
- package/test/twin-model-tree-db.test.ts +176 -0
- package/test/twin-origin-resync.test.ts +114 -0
- package/test/warm-start-seam.test.ts +6 -6
- package/test/warm-start.test.ts +88 -3
- package/tsconfig.json +6 -1
- package/tsconfig.shared.json +23 -0
- package/tsconfig.shared.tsbuildinfo +1 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/dist-server/engine/board-vocabulary.js.map +0 -1
- package/dist-server/engine/entity-delta.js.map +0 -1
- package/dist-server/engine/kpi-broadcast.js.map +0 -1
- package/dist-server/engine/twin-level.js.map +0 -1
- package/dist-server/service/twin-event/backfill-keys.d.ts +0 -11
- package/dist-server/service/twin-event/backfill-keys.js +0 -63
- package/dist-server/service/twin-event/backfill-keys.js.map +0 -1
- package/dist-server/tsconfig.tsbuildinfo +0 -1
- package/server/service/twin-event/backfill-keys.ts +0 -72
- /package/{dist-server/engine → dist-shared}/kpi-broadcast.d.ts +0 -0
- /package/{dist-server/engine → dist-shared}/kpi-broadcast.js +0 -0
- /package/{dist-server/engine → dist-shared}/twin-level.d.ts +0 -0
- /package/{dist-server/engine → dist-shared}/twin-level.js +0 -0
- /package/{server/engine → shared}/kpi-broadcast.ts +0 -0
- /package/{server/engine → shared}/twin-level.ts +0 -0
|
@@ -16,6 +16,20 @@ import { computeTwinKpi, resolveTwinTargets } from '../../engine/kpi-query.js'
|
|
|
16
16
|
* twinReplay : 내구 저널을 replay 해 상태 재구성(재부팅 복구·시간여행) — untilRevision 으로 임의 과거.
|
|
17
17
|
* (실시간 스트림은 twinState subscription, 명령은 twin-control mutation. 이건 '질의' 표면.)
|
|
18
18
|
*/
|
|
19
|
+
/**
|
|
20
|
+
* 시각 필터 값을 날짜로 — 배열(between)이면 원소마다.
|
|
21
|
+
*
|
|
22
|
+
* 못 읽는 값은 **그대로 둔다.** 여기서 지어내면 사용자가 요청하지 않은 구간을 조회하게 된다.
|
|
23
|
+
*/
|
|
24
|
+
function toDateValue(v: any): any {
|
|
25
|
+
const one = (x: any) => {
|
|
26
|
+
if (x instanceof Date) return x
|
|
27
|
+
const t = typeof x === 'string' ? Date.parse(x) : NaN
|
|
28
|
+
return Number.isNaN(t) ? x : new Date(t)
|
|
29
|
+
}
|
|
30
|
+
return Array.isArray(v) ? v.map(one) : one(v)
|
|
31
|
+
}
|
|
32
|
+
|
|
19
33
|
@Resolver()
|
|
20
34
|
export class TwinJournalQuery {
|
|
21
35
|
@Query(returns => [TwinEvent], {
|
|
@@ -32,8 +46,8 @@ export class TwinJournalQuery {
|
|
|
32
46
|
): Promise<TwinEvent[]> {
|
|
33
47
|
const where: any = { domain: { id: context.state.domain.id }, instanceId }
|
|
34
48
|
if (eventType) where.eventType = eventType
|
|
35
|
-
/* 시각 커서(untilTime, ISO) 우선 — eventTime ≤ T(공유 clock).
|
|
36
|
-
if (untilTime != null) where.eventTime = LessThanOrEqual(untilTime)
|
|
49
|
+
/* 시각 커서(untilTime, ISO) 우선 — eventTime ≤ T(공유 clock). 컬럼이 날짜라 **날짜로 넘긴다.** */
|
|
50
|
+
if (untilTime != null) where.eventTime = LessThanOrEqual(new Date(untilTime))
|
|
37
51
|
else if (fromRevision != null && toRevision != null) where.revision = Between(fromRevision, toRevision)
|
|
38
52
|
else if (fromRevision != null) where.revision = MoreThanOrEqual(fromRevision)
|
|
39
53
|
else if (toRevision != null) where.revision = LessThanOrEqual(toRevision)
|
|
@@ -91,7 +105,16 @@ export class TwinJournalQuery {
|
|
|
91
105
|
pagination: { page: params.pagination?.page ?? 1, limit },
|
|
92
106
|
/* 기본 정렬은 시각 내림차순 — 여러 트윈을 합칠 때 공통 축은 revision(트윈별 카운터)이 아니라
|
|
93
107
|
* **시각**이다. revision 으로 섞으면 서로 다른 트윈의 무관한 카운터가 뒤엉킨다. */
|
|
94
|
-
sortings: params.sortings?.length ? params.sortings : [{ name: 'eventTime', desc: true }]
|
|
108
|
+
sortings: params.sortings?.length ? params.sortings : [{ name: 'eventTime', desc: true }],
|
|
109
|
+
/*
|
|
110
|
+
* 시각 필터는 **날짜로 바꿔서** 질의 빌더에 넘긴다.
|
|
111
|
+
*
|
|
112
|
+
* 화면은 ISO 문자열(`2026-08-07T11:00:00.000Z`)을 보내는데 eventTime 은 날짜 컬럼이고,
|
|
113
|
+
* sqlite 는 그것을 공백 구분 형식(`2026-08-07 11:00:00.000`)으로 저장한다. 문자열 그대로
|
|
114
|
+
* 비교하면 사전식으로 어긋나 **오류 없이 빈 결과**가 나온다(실측으로 확인했다).
|
|
115
|
+
* 화면이 날짜를 어떻게 적어 보내든 서버가 받아 주는 편이 맞다 — 계약을 좁히는 대신 경계에서 옮긴다.
|
|
116
|
+
*/
|
|
117
|
+
filters: (params.filters ?? []).map(f => (f.name === 'eventTime' ? { ...f, value: toDateValue(f.value) } : f))
|
|
95
118
|
}
|
|
96
119
|
|
|
97
120
|
const qb = getQueryBuilderFromListParams({
|
|
@@ -99,7 +122,7 @@ export class TwinJournalQuery {
|
|
|
99
122
|
params: effective,
|
|
100
123
|
domain,
|
|
101
124
|
/* 전부 인덱스 가능한 승격 컬럼 — 자유 검색어는 서버가 이 축들로 펼친다. */
|
|
102
|
-
searchables: ['epc', 'orderId', 'locationId', 'moverId', 'bizStep', 'eventType'],
|
|
125
|
+
searchables: ['epc', 'orderId', 'locationId', 'moverId', 'bizStep', 'eventType', 'correlationId'],
|
|
103
126
|
/* 정렬은 인덱스가 받쳐 주는 축으로만 — 큰 저널에서 임의 컬럼 정렬은 전체 정렬 스캔이다. */
|
|
104
127
|
sortables: ['eventTime', 'revision', 'eventType', 'bizStep'],
|
|
105
128
|
defaultLimit: 100,
|
|
@@ -118,7 +141,7 @@ export class TwinJournalQuery {
|
|
|
118
141
|
}
|
|
119
142
|
|
|
120
143
|
/**
|
|
121
|
-
* 업무 KPI — 시간창 처리량·소요시간·자원 점유. 저널을 **접어서** 만든다(새 계측을
|
|
144
|
+
* 업무 KPI — 시간창 처리량·소요시간·자원 점유. 저널을 **접어서** 만든다(새 계측을 주입하지 않는다).
|
|
122
145
|
*
|
|
123
146
|
* `twinMetrics`(초당 이벤트 수 = 인프라 부하)와 **다른 것**이다: 이건 "지난 한 시간에 몇 건 처리했고
|
|
124
147
|
* 한 건에 얼마나 걸렸나" 다. 이름이 비슷해 헷갈리기 쉬우므로 설명에 명시한다.
|
|
@@ -128,7 +151,7 @@ export class TwinJournalQuery {
|
|
|
128
151
|
*/
|
|
129
152
|
@Query(returns => ScalarObject, {
|
|
130
153
|
description:
|
|
131
|
-
'Windowed business KPI folded from the event journal, for one space (every running twin in it, folded together — averaging per-twin percentiles would be wrong) or one twin: throughput (completed tasks / orders), lead / work / wait time distributions (p50·p90), and per-resource busy ratio. Distinct from twinMetrics, which reports infrastructure throughput (events per second). When toTime is omitted the window ends at the twin\'s own last recorded event time, not wall clock — a simulated twin lives on its own clock, so asking for \'the last hour\' in real time would always find nothing. The basis used is reported in window.basis. Pass groupBy (resource | taskKind | location | order | area | shift) to break the same window down by that perspective. The shift axis is **computed, not stored**: the journal records only times, and the shift is derived from each completion\'s time plus the declared site shifts and time zone — so correcting a shift definition re-counts history correctly instead of leaving it frozen under the old boundaries. Sites that declare no shifts report every group as unknown rather than inventing shift names — per-group numbers use the same rules as the totals, so group counts sum to the total, and groups beyond groupLimit are reported as groups.truncated (how many groups) and groups.truncatedTasks (how much work those groups held) rather than silently dropped. Pass compareTo (previous | yesterday) to fold the same-length window shifted back and get comparison.delta (current minus that window); when the comparison window has no records, comparison.measured is false and no delta is produced rather than reporting zero change. Passing groupBy together with compareTo crosses the two: each group carries prevTasks / deltaTasks / deltaWorkP50Ms, groups absent from the comparison window are flagged isNew (no delta, so growth is not implied), and groups that had work before but none now are returned in groups.disappeared so a stopped area is never silently missing from the table. Area breakdown needs
|
|
154
|
+
'Windowed business KPI folded from the event journal, for one space (every running twin in it, folded together — averaging per-twin percentiles would be wrong) or one twin: throughput (completed tasks / orders), lead / work / wait time distributions (p50·p90), and per-resource busy ratio. Distinct from twinMetrics, which reports infrastructure throughput (events per second). When toTime is omitted the window ends at the twin\'s own last recorded event time, not wall clock — a simulated twin lives on its own clock, so asking for \'the last hour\' in real time would always find nothing. The basis used is reported in window.basis. Pass groupBy (resource | taskKind | location | order | area | shift) to break the same window down by that perspective. The shift axis is **computed, not stored**: the journal records only times, and the shift is derived from each completion\'s time plus the declared site shifts and time zone — so correcting a shift definition re-counts history correctly instead of leaving it frozen under the old boundaries. Sites that declare no shifts report every group as unknown rather than inventing shift names — per-group numbers use the same rules as the totals, so group counts sum to the total, and groups beyond groupLimit are reported as groups.truncated (how many groups) and groups.truncatedTasks (how much work those groups held) rather than silently dropped. Pass compareTo (previous | yesterday) to fold the same-length window shifted back and get comparison.delta (current minus that window); when the comparison window has no records, comparison.measured is false and no delta is produced rather than reporting zero change. Passing groupBy together with compareTo crosses the two: each group carries prevTasks / deltaTasks / deltaWorkP50Ms, groups absent from the comparison window are flagged isNew (no delta, so growth is not implied), and groups that had work before but none now are returned in groups.disappeared so a stopped area is never silently missing from the table. Area breakdown needs model locations to carry a parent area; when they do not, groups.note says so instead of implying there was no work. When the journal read hits its row cap, eventsCapped is true and every number is a lower bound — narrow the window and ask again rather than reading the smaller figures as a drop in performance. When operational targets are set for the space or instance, `targets` carries the verdicts [{metric, actual, target, direction, met, ratio}] — ratio is normalised so that 1 or more is always good, letting throughput and duration metrics be compared on one scale. A metric with no target, or with no measurement in the window, is absent from `targets` rather than reported as a miss, because a period with no work would otherwise read as a perfect score on duration metrics. Completions are counted in the window they complete; starts are looked up before the window, and any completion whose start was not found is reported in `unpaired` rather than silently dropped. Pass baselinePeriods (1-14, with baselineStride day | week) to fold the same time-of-day window on each of the last N days (or the same weekday on each of the last N weeks) and get `baseline.metrics` — per metric the distribution of those windows (min / median / max) plus where the current window sits: `rank` (1 = smallest, direction-free) and `standing` (best | better-than-typical | typical | worse-than-typical | worst, which does apply the metric direction). This answers what a single comparison cannot: comparing to yesterday alone is useless if yesterday was also bad. Every requested window is returned in `samples` with `measured` true or false — windows without records are kept and counted (measuredCount vs requested) rather than dropped, so "the last 7 days" never silently means 3. No position is reported when the current window has no value or fewer than two baseline windows were measured; `noPosition` says which, because a missing distribution drawn as neutral would read as "typical". The baseline is produced even when the current window itself has no records, since that is exactly when knowing the usual level matters (a stopped line).'
|
|
132
155
|
})
|
|
133
156
|
async twinKpi(
|
|
134
157
|
@Ctx() context: ResolverContext,
|
|
@@ -227,7 +250,7 @@ export class TwinJournalQuery {
|
|
|
227
250
|
@Arg('unitsPerDay', type => Float) unitsPerDay: number,
|
|
228
251
|
/**
|
|
229
252
|
* 가용 시간을 잴 기준 주의 시작(ISO, 월요일). 공휴일이 없는 평상주여야 한다 —
|
|
230
|
-
* 공휴일은 연간 가용량을 따로 깎지, 이 공장의 평상시
|
|
253
|
+
* 공휴일은 연간 가용량을 따로 깎지, 이 공장의 평상시 상한을 정하지 않는다.
|
|
231
254
|
*/
|
|
232
255
|
@Arg('sampleWeekStart', { nullable: true }) sampleWeekStart: string,
|
|
233
256
|
@Ctx() context: ResolverContext
|
|
@@ -239,8 +262,8 @@ export class TwinJournalQuery {
|
|
|
239
262
|
if (!(unitsPerDay > 0)) throw new Error('unitsPerDay must be greater than zero')
|
|
240
263
|
|
|
241
264
|
/*
|
|
242
|
-
* 기준 주를 안 주면 **이번 주 월요일**을 쓴다. 그 주에 공휴일이 끼면
|
|
243
|
-
* 그것은 조용한 오류가 아니라 **이번 주의 실제 가용 시간**이라 답으로서 정직하다. 평상시
|
|
265
|
+
* 기준 주를 안 주면 **이번 주 월요일**을 쓴다. 그 주에 공휴일이 끼면 상한이 조금 낮게 나오는데,
|
|
266
|
+
* 그것은 조용한 오류가 아니라 **이번 주의 실제 가용 시간**이라 답으로서 정직하다. 평상시 상한을
|
|
244
267
|
* 보려는 호출자는 평상주를 지정한다.
|
|
245
268
|
*/
|
|
246
269
|
const base = sampleWeekStart ? Date.parse(sampleWeekStart) : Date.now()
|
|
@@ -251,9 +274,50 @@ export class TwinJournalQuery {
|
|
|
251
274
|
return TwinEngine.capacity(context.state.domain.id, { instanceId, spaceId }, unitsPerDay, monday)
|
|
252
275
|
}
|
|
253
276
|
|
|
277
|
+
@Query(returns => ScalarObject, {
|
|
278
|
+
nullable: true,
|
|
279
|
+
description:
|
|
280
|
+
'Operations capability of a twin for a time window (ISA-95 Part 4 OperationsCapability): per operation the ceiling for that window split into Committed (already promised), Unattainable (lost to resources that cannot be used — down, held, off-shift, expired qualification) and Available (what is left). Answers "can we take more work?" — which the steady-state rate alone cannot. Null when the twin is not running.'
|
|
281
|
+
})
|
|
282
|
+
async twinOperationsCapability(
|
|
283
|
+
@Arg('instanceId', { nullable: true }) instanceId: string,
|
|
284
|
+
@Arg('spaceId', { nullable: true }) spaceId: string,
|
|
285
|
+
@Arg('unitsPerDay', type => Float) unitsPerDay: number,
|
|
286
|
+
/** 능력을 물을 구간 — **구간 없이 능력은 존재하지 않는다**(표준 StartTime/EndTime). */
|
|
287
|
+
@Arg('fromTime') fromTime: string,
|
|
288
|
+
@Arg('toTime') toTime: string,
|
|
289
|
+
@Arg('sampleWeekStart', { nullable: true }) sampleWeekStart: string,
|
|
290
|
+
@Ctx() context: ResolverContext
|
|
291
|
+
): Promise<any> {
|
|
292
|
+
if (instanceId && !(await TwinEngine.ownsRegistered(context.state.domain.id, instanceId))) {
|
|
293
|
+
throw new Error(`twin instance not found in this tenant: ${instanceId}`)
|
|
294
|
+
}
|
|
295
|
+
if (!instanceId && !spaceId) throw new Error('either spaceId or instanceId is required')
|
|
296
|
+
if (!(unitsPerDay > 0)) throw new Error('unitsPerDay must be greater than zero')
|
|
297
|
+
/* 구간은 **부르는 쪽이 말해야 한다** — 기본값을 두면 화면마다 다른 구간을 보면서 같은 값으로 읽는다. */
|
|
298
|
+
const from = Date.parse(fromTime)
|
|
299
|
+
const to = Date.parse(toTime)
|
|
300
|
+
if (Number.isNaN(from) || Number.isNaN(to)) throw new Error(`window is not a valid ISO time: ${fromTime} ~ ${toTime}`)
|
|
301
|
+
if (to <= from) throw new Error(`window is inverted: ${fromTime} ~ ${toTime}`)
|
|
302
|
+
|
|
303
|
+
/* 기준 주 규율은 `twinCapacity` 와 같다(같은 계산을 쓰므로 같은 주를 골라야 한다). */
|
|
304
|
+
const base = sampleWeekStart ? Date.parse(sampleWeekStart) : from
|
|
305
|
+
if (Number.isNaN(base)) throw new Error(`sampleWeekStart is not a valid ISO time: ${sampleWeekStart}`)
|
|
306
|
+
const d = new Date(base)
|
|
307
|
+
const monday = Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate() - ((d.getUTCDay() + 6) % 7))
|
|
308
|
+
|
|
309
|
+
return TwinEngine.operationsCapability(
|
|
310
|
+
context.state.domain.id,
|
|
311
|
+
{ instanceId, spaceId },
|
|
312
|
+
unitsPerDay,
|
|
313
|
+
monday,
|
|
314
|
+
{ fromTime, toTime }
|
|
315
|
+
)
|
|
316
|
+
}
|
|
317
|
+
|
|
254
318
|
@Query(returns => ScalarObject, {
|
|
255
319
|
description:
|
|
256
|
-
"Structural revisions a twin has been through, newest last: when each took effect, how many journal events happened under it, and what changed from the previous one (counts by location type and equipment kind). The
|
|
320
|
+
"Structural revisions a twin has been through, newest last: when each took effect, how many journal events happened under it, and what changed from the previous one (counts by location type and equipment kind). The model itself is not returned — a revision holds the whole plant, but what a person wants is the difference."
|
|
257
321
|
})
|
|
258
322
|
async twinStructures(@Arg('instanceId') instanceId: string, @Ctx() context: ResolverContext): Promise<any> {
|
|
259
323
|
/* 이력 질문이므로 **등록부**에 소유를 묻는다 — 꺼진 트윈의 이력도 읽을 수 있어야 한다. */
|
|
@@ -4,7 +4,7 @@ import { ScalarObject } from '@things-factory/shell'
|
|
|
4
4
|
|
|
5
5
|
import { TwinEngine } from '../../engine/index.js'
|
|
6
6
|
|
|
7
|
-
import type {
|
|
7
|
+
import type { TwinModelDef } from '@operato/twin-kernel'
|
|
8
8
|
|
|
9
9
|
/* 도메인 어휘 카탈로그(시스템별 노드 타입) — 커널이 SSOT. 앱/UI 는 이걸 소싱하고 재선언하지 않는다(방언 금지).
|
|
10
10
|
* 조합은 domain-catalog.ts 가 소유 — 리졸버와 서버측 소비자(board-ai 도구 등)가 같은 형태를 본다. */
|
|
@@ -14,39 +14,40 @@ import { domainCatalog } from './domain-catalog.js'
|
|
|
14
14
|
* 트윈 인스턴스 생명주기 채널 — 프로비저닝(상향, ADR-0015).
|
|
15
15
|
* State/Command/Scenario 는 이미 running 인 인스턴스를 다루지만, 이 채널은 인스턴스 자체를 만들고/설정하고/없앤다.
|
|
16
16
|
* 생명주기: provision(save, 미기동) → start → stop → delete. 모두 domain 스코프(context.state.domain.id).
|
|
17
|
-
*
|
|
17
|
+
* model(TwinModelDef+layout)=구조, scenario=자극 은 분리 — 여기선 구조만 세운다. 자극은 controlTwinScenario 로.
|
|
18
18
|
*/
|
|
19
19
|
@Resolver()
|
|
20
20
|
export class TwinLifecycleMutation {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
): Promise<boolean> {
|
|
32
|
-
await TwinEngine.provision(context.state.domain.id, instanceId, kind, board as BoardDef)
|
|
33
|
-
return true
|
|
34
|
-
}
|
|
21
|
+
/*
|
|
22
|
+
* `saveTwinInstance` 는 **없앴다**(2026-08-08, ADR-0028).
|
|
23
|
+
*
|
|
24
|
+
* 트윈의 구조를 임의의 model 로 덮어쓰는 문이었고, 유일한 소비자는 손저작 편집기였다.
|
|
25
|
+
* 구조는 원본에서 온다 — 템플릿(`createFromTemplate`)이나 커넥터(`ingestMaster`)가 그 길이다.
|
|
26
|
+
* 문을 열어 두면 화면만 지워도 다음 소비자가 다시 생긴다.
|
|
27
|
+
*
|
|
28
|
+
* 시뮬 트윈을 세우는 것은 여전히 가능하다. 다만 그 입구는 **원본을 만드는 쪽**이지
|
|
29
|
+
* 트윈을 고치는 쪽이 아니다(ADR-0029 — 시뮬레이터는 원본의 한 종류).
|
|
30
|
+
*/
|
|
35
31
|
|
|
36
|
-
/** 기동 —
|
|
32
|
+
/** 기동 — model 를 주면 provision+start, 없으면 레지스트리에 저장된 구조로 start. */
|
|
37
33
|
@Directive('@privilege(category: "twin", privilege: "mutation", domainOwnerGranted: true, superUserGranted: true)')
|
|
38
34
|
@Mutation(returns => Boolean, {
|
|
39
|
-
description: 'Start a twin runtime instance and begin the worker tick. If
|
|
35
|
+
description: 'Start a twin runtime instance and begin the worker tick. If model is given it provisions first; otherwise it starts from the saved registry model.'
|
|
40
36
|
})
|
|
41
37
|
async startTwinInstance(
|
|
42
38
|
@Arg('instanceId') instanceId: string,
|
|
43
39
|
@Ctx() context: ResolverContext,
|
|
44
40
|
@Arg('kind', { nullable: true }) kind?: string,
|
|
45
|
-
@Arg('
|
|
41
|
+
@Arg('model', type => ScalarObject, { nullable: true }) model?: any
|
|
46
42
|
): Promise<boolean> {
|
|
47
43
|
const domainId = context.state.domain.id
|
|
48
44
|
// 시각 기준은 **공간**이 갖는다(테넌트 아님) — 교대의 HH:MM 을 어느 기준으로 읽나.
|
|
49
|
-
if (
|
|
45
|
+
if (model) {
|
|
46
|
+
/* model 를 함께 주는 것은 프로비저닝이다 — 그러면 종류도 말해야 한다.
|
|
47
|
+
예전에는 `kind ?? 'wms'` 로 메웠는데, 종류를 빠뜨린 야드/생산 트윈이 **창고로 조용히 기동**했다. */
|
|
48
|
+
if (!kind) throw new Error('kind is required when model is given — it decides which domain kernel runs this twin')
|
|
49
|
+
TwinEngine.start(instanceId, domainId, kind, await TwinEngine.withSpaceTimeBase(model as TwinModelDef, domainId))
|
|
50
|
+
}
|
|
50
51
|
else await TwinEngine.startFromRegistry(domainId, instanceId)
|
|
51
52
|
return true
|
|
52
53
|
}
|
|
@@ -85,8 +86,8 @@ export class TwinLifecycleMutation {
|
|
|
85
86
|
return TwinEngine.list(context.state.domain.id)
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
/** 단건 상세 — 프로비저닝 에디터용
|
|
89
|
-
@Query(returns => ScalarObject, { nullable: true, description: 'Get one provisioned twin instance with its
|
|
89
|
+
/** 단건 상세 — 프로비저닝 에디터용 model(구조+layout) 포함. */
|
|
90
|
+
@Query(returns => ScalarObject, { nullable: true, description: 'Get one provisioned twin instance with its TwinModelDef (structure + layout) for editing.' })
|
|
90
91
|
async twinInstanceDetail(@Arg('instanceId') instanceId: string, @Ctx() context: ResolverContext): Promise<any | null> {
|
|
91
92
|
return TwinEngine.detail(context.state.domain.id, instanceId)
|
|
92
93
|
}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import { Arg, Ctx, Query, Resolver } from 'type-graphql'
|
|
1
|
+
import { Arg, Ctx, Directive, Query, Resolver } from 'type-graphql'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { In } from 'typeorm'
|
|
4
|
+
|
|
5
|
+
import { Domain, getRepository, ScalarObject } from '@things-factory/shell'
|
|
4
6
|
|
|
5
7
|
import { TwinEngine } from '../../engine/index.js'
|
|
8
|
+
import { newCpuSampler, sampleCpu } from '../../engine/load-meter.js'
|
|
6
9
|
|
|
7
10
|
/*
|
|
8
11
|
* 트윈 처리량 계측(모니터, ④-1) — 라이브 동기 인터페이스 부하를 읽는 일급 지표.
|
|
9
12
|
* 유입률(ingestRate)·방송률(broadcastRate)·저널률(journalRate)·백로그(backlog)·누적. 폴링으로 라이브 관측.
|
|
10
13
|
* (부하가 화면에 안 보인다던 문제의 정공법 — "얼마나 들어오고 얼마나 방송/기록되나"를 수치로.)
|
|
11
14
|
*/
|
|
15
|
+
/* CPU 는 누적값이라 **표본 사이의 차이**로만 점유율이 나온다. 그래서 호출 사이에 상태가 남아야 한다. */
|
|
16
|
+
const CPU_SAMPLER = newCpuSampler()
|
|
17
|
+
|
|
12
18
|
@Resolver()
|
|
13
19
|
export class TwinMetricsQuery {
|
|
14
20
|
@Query(returns => ScalarObject, { nullable: true, description: 'Live throughput metrics of one twin instance (ingest/broadcast/journal rate, backlog). Null if not a live instance or not in the current domain.' })
|
|
@@ -21,4 +27,55 @@ export class TwinMetricsQuery {
|
|
|
21
27
|
async twinMetricsAll(@Ctx() context: ResolverContext): Promise<any[]> {
|
|
22
28
|
return TwinEngine.allMetrics(context.state.domain.id) // 도메인 스코프
|
|
23
29
|
}
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
* ── 이벤트 루프 부하 — **운영 계기판이다. 테넌트 기능이 아니다.** ─────────────
|
|
33
|
+
*
|
|
34
|
+
* `twinMetrics` 는 "얼마나 들어오고 나가나"(초당 이벤트)를 답한다. 여기서 묻는 것은 "그 일을 하느라
|
|
35
|
+
* 이벤트 루프를 얼마나 붙잡고 있나" 다. 시뮬 틱은 트윈마다 setInterval 로 **메인 루프에서 동기로**
|
|
36
|
+
* 돌기 때문에, 한 트윈이 느려지면 HTTP·구독이 함께 느려진다. 실제로 그 상태를 겪었는데 볼 계기판이
|
|
37
|
+
* 없어서 "포트는 열렸는데 응답이 없다" 로만 보였다.
|
|
38
|
+
*
|
|
39
|
+
* ── 왜 도메인으로 자르지 않나 ───────────────────────────────────────────────
|
|
40
|
+
* 처음에는 호출자의 도메인만 냈다. 테넌트 격리로는 맞아 보이지만 **이벤트 루프는 프로세스 하나가
|
|
41
|
+
* 공유한다.** 실측으로 드러났다: 한 도메인 트윈 22개가 CPU 를 110% 쓰는 동안, 다른 도메인 화면은
|
|
42
|
+
* `실행 중 0 · 루프 점유 —` 였다. "내 도메인은 한가한데 왜 느리지" 를 설명할 수 없었다.
|
|
43
|
+
*
|
|
44
|
+
* 그렇다고 테넌트에게 남의 부하를 조금 보여 주는 것도 답이 아니다 — 쓸 수 없는 정보이고 봐서도 안 된다.
|
|
45
|
+
* 층이 잘못이었다: 이것은 **프로세스를 운영하는 사람의 계기판**이다. 그래서 도메인으로 자르지 않고
|
|
46
|
+
* (전 테넌트 합산) **슈퍼유저에게만** 연다.
|
|
47
|
+
*/
|
|
48
|
+
@Directive('@privilege(superUserGranted: true)')
|
|
49
|
+
@Query(returns => ScalarObject, {
|
|
50
|
+
description:
|
|
51
|
+
'Event-loop load of every twin in this process, for system operators (superuser only). Deliberately NOT scoped to the caller\'s domain: the event loop is shared by the whole process, so a tenant-scoped view reports an idle domain while the machine is saturated by someone else. Reports how many instances are running (by mode), how many forecast forks have been created, and per instance how long each kind of work takes (kernel tick, state snapshot, broadcast payload, publish, journal write, live ingest, Monte-Carlo forecast, fork trajectory). Each instance reports both `recent` (the last closed sampling window — what it is doing now) and `total` (cumulative since boot), with `busyRatio` telling how much of the window that twin held the loop. `fleetBusyRatio` above 1 means the twins together cannot finish inside one tick interval, which is when HTTP and subscriptions start to stall. Work that has never been measured is reported as null rather than zero, because zero would read as "instant".'
|
|
52
|
+
})
|
|
53
|
+
async twinLoad(@Ctx() context: ResolverContext): Promise<any> {
|
|
54
|
+
const fleet = TwinEngine.fleet() // 프로세스 전체 — 도메인으로 자르지 않는다(위 주석)
|
|
55
|
+
|
|
56
|
+
/* 도메인 id 는 UUID 라 사람이 못 읽는다. 읽을 수 있는 이름을 채운다 — **모르면 id 를 그대로 둔다**
|
|
57
|
+
(지어내지 않는다). 라이브 인스턴스에는 이미 붙어 있고, 시뮬은 여기서 한 번 조회한다. */
|
|
58
|
+
const ids = [...new Set((fleet.byDomain ?? []).map((d: any) => d.domainId).filter((v: any) => v && v !== '(unknown)'))]
|
|
59
|
+
if (ids.length) {
|
|
60
|
+
const found = await getRepository(Domain).find({ where: { id: In(ids as string[]) } })
|
|
61
|
+
const nameOf = new Map(found.map(d => [d.id, d.subdomain || d.name]))
|
|
62
|
+
for (const d of fleet.byDomain) if (nameOf.get(d.domainId)) d.label = nameOf.get(d.domainId) as string
|
|
63
|
+
for (const r of fleet.slowest ?? []) if (r.domainId && nameOf.get(r.domainId)) r.domainLabel = nameOf.get(r.domainId)
|
|
64
|
+
for (const r of fleet.details ?? []) if (r.domainId && nameOf.get(r.domainId)) r.domainLabel = nameOf.get(r.domainId)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/*
|
|
68
|
+
* 프로세스가 실제로 쓴 CPU — **계기판의 다른 숫자와 뜻이 다르다.**
|
|
69
|
+
*
|
|
70
|
+
* 위의 값들은 트윈의 계측된 작업만 잰 것이라, 그 밖의 일(GraphQL·TypeORM·GC·webpack·HTTP)은
|
|
71
|
+
* 분모에도 분자에도 없다. "루프 점유 <1%" 인데 CPU 는 110% 였던 상태를 실제로 겪었다. 두 숫자를
|
|
72
|
+
* 나란히 두어야 **트윈이 범인인지** 가릴 수 있다.
|
|
73
|
+
*
|
|
74
|
+
* 표본 간 차이라 첫 호출은 `null` 이다 — 0 이 아니다.
|
|
75
|
+
*/
|
|
76
|
+
const usage = process.cpuUsage()
|
|
77
|
+
const cpu = sampleCpu(CPU_SAMPLER, usage.user + usage.system, Date.now())
|
|
78
|
+
|
|
79
|
+
return { ...fleet, processCpuRatio: cpu?.ratio ?? null, processCpuSpanMs: cpu?.spanMs ?? null }
|
|
80
|
+
}
|
|
24
81
|
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* GS1 EPCIS 2.0 적합성 기준 — **물류·제조 트윈이 표준의 어디를 채우고 있나.**
|
|
3
|
+
*
|
|
4
|
+
* ── 왜 따로 있나 ────────────────────────────────────────────────────────────
|
|
5
|
+
* 적합성 패널이 ISA-95 하나만 말하고 있었다. 그런데 창고·야드·공장 트윈에서 「무슨 일이 있었나」와
|
|
6
|
+
* 「이 번호가 무엇을 가리키나」를 정하는 것은 EPCIS 다. ISA-95 표만 보이면 그 트윈이 기대는 기준의
|
|
7
|
+
* 절반이 화면에 없다.
|
|
8
|
+
*
|
|
9
|
+
* ── 수준은 근거를 보고 적었다 ───────────────────────────────────────────────
|
|
10
|
+
* 「있다/없다」를 기억으로 적지 않는다. 각 줄의 판단 근거:
|
|
11
|
+
* · 타입 선언 — 커널 `epcis.ts`(이벤트·필드의 모양)
|
|
12
|
+
* · 실제 사용 — 커널 도메인(`mes-kernel`·`face2-adapter`·`observed-reducer`)과 호스트 인제스트
|
|
13
|
+
* · 화면 노출 — 저널·계보·엔티티 360
|
|
14
|
+
* 모양만 있고 아무도 채우지 않는 필드는 **구조만 있음**으로 적는다(그게 사실이다).
|
|
15
|
+
*
|
|
16
|
+
* ISA-95 표와 같은 규율이다(`isa95-coverage.ts` 머리말): 사람이 판단해 적고, 틀리면 여기를 고친다.
|
|
17
|
+
*/
|
|
18
|
+
import type { Isa95Concept, CoverageLevel } from './isa95-coverage.js'
|
|
19
|
+
|
|
20
|
+
/* Part: EPCIS 2.0 의 사건 종류 — 무엇이 일어났는가. */
|
|
21
|
+
const EVENTS: Isa95Concept[] = [
|
|
22
|
+
{
|
|
23
|
+
std: 'ObjectEvent',
|
|
24
|
+
part: 'events',
|
|
25
|
+
label: 'twin.epcis.ObjectEvent',
|
|
26
|
+
axis: 'items',
|
|
27
|
+
structure: 'full',
|
|
28
|
+
behavior: 'full',
|
|
29
|
+
surface: 'full',
|
|
30
|
+
note: 'twin.epcis.note.ObjectEvent'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
std: 'AggregationEvent',
|
|
34
|
+
part: 'events',
|
|
35
|
+
label: 'twin.epcis.AggregationEvent',
|
|
36
|
+
axis: null,
|
|
37
|
+
shownOn: ['items'],
|
|
38
|
+
structure: 'full',
|
|
39
|
+
behavior: 'full',
|
|
40
|
+
surface: 'partial',
|
|
41
|
+
note: 'twin.epcis.note.AggregationEvent'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
std: 'TransactionEvent',
|
|
45
|
+
part: 'events',
|
|
46
|
+
label: 'twin.epcis.TransactionEvent',
|
|
47
|
+
axis: 'orders',
|
|
48
|
+
structure: 'full',
|
|
49
|
+
behavior: 'full',
|
|
50
|
+
surface: 'partial',
|
|
51
|
+
note: 'twin.epcis.note.TransactionEvent'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
std: 'TransformationEvent',
|
|
55
|
+
part: 'events',
|
|
56
|
+
label: 'twin.epcis.TransformationEvent',
|
|
57
|
+
axis: null,
|
|
58
|
+
shownOn: ['items', 'operations'],
|
|
59
|
+
structure: 'full',
|
|
60
|
+
behavior: 'full',
|
|
61
|
+
surface: 'full',
|
|
62
|
+
note: 'twin.epcis.note.TransformationEvent'
|
|
63
|
+
},
|
|
64
|
+
/* EPCIS 2.0 이 더한 사건 — 우리는 타입조차 두지 않았다. 없는 것은 없다고 적는다. */
|
|
65
|
+
{
|
|
66
|
+
std: 'AssociationEvent',
|
|
67
|
+
part: 'events',
|
|
68
|
+
label: 'twin.epcis.AssociationEvent',
|
|
69
|
+
axis: null,
|
|
70
|
+
structure: 'none',
|
|
71
|
+
behavior: 'none',
|
|
72
|
+
surface: 'none',
|
|
73
|
+
note: 'twin.epcis.note.AssociationEvent'
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
/* Part: 사건이 답하는 다섯 가지 — 무엇을·어디서·언제·왜, 그리고 어떤 거래로. */
|
|
78
|
+
const FIELDS: Isa95Concept[] = [
|
|
79
|
+
{
|
|
80
|
+
std: 'epcList / quantityList',
|
|
81
|
+
part: 'fields',
|
|
82
|
+
label: 'twin.epcis.identity',
|
|
83
|
+
axis: 'items',
|
|
84
|
+
structure: 'full',
|
|
85
|
+
behavior: 'full',
|
|
86
|
+
surface: 'full',
|
|
87
|
+
note: 'twin.epcis.note.identity'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
std: 'bizStep / disposition (CBV)',
|
|
91
|
+
part: 'fields',
|
|
92
|
+
label: 'twin.epcis.cbv',
|
|
93
|
+
axis: null,
|
|
94
|
+
shownOn: ['items', 'tasks'],
|
|
95
|
+
structure: 'full',
|
|
96
|
+
behavior: 'full',
|
|
97
|
+
surface: 'full',
|
|
98
|
+
note: 'twin.epcis.note.cbv'
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
std: 'readPoint / bizLocation',
|
|
102
|
+
part: 'fields',
|
|
103
|
+
label: 'twin.epcis.where',
|
|
104
|
+
axis: 'locations',
|
|
105
|
+
structure: 'full',
|
|
106
|
+
behavior: 'full',
|
|
107
|
+
surface: 'full',
|
|
108
|
+
note: 'twin.epcis.note.where'
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
std: 'bizTransactionList',
|
|
112
|
+
part: 'fields',
|
|
113
|
+
label: 'twin.epcis.bizTransaction',
|
|
114
|
+
axis: 'orders',
|
|
115
|
+
structure: 'full',
|
|
116
|
+
behavior: 'full',
|
|
117
|
+
surface: 'partial',
|
|
118
|
+
note: 'twin.epcis.note.bizTransaction'
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
std: 'ilmd',
|
|
122
|
+
part: 'fields',
|
|
123
|
+
label: 'twin.epcis.ilmd',
|
|
124
|
+
axis: null,
|
|
125
|
+
shownOn: ['items'],
|
|
126
|
+
structure: 'full',
|
|
127
|
+
behavior: 'full',
|
|
128
|
+
surface: 'partial',
|
|
129
|
+
note: 'twin.epcis.note.ilmd'
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
std: 'errorDeclaration',
|
|
133
|
+
part: 'fields',
|
|
134
|
+
label: 'twin.epcis.errorDeclaration',
|
|
135
|
+
axis: null,
|
|
136
|
+
shownOn: ['items'],
|
|
137
|
+
structure: 'full',
|
|
138
|
+
behavior: 'partial',
|
|
139
|
+
surface: 'none',
|
|
140
|
+
note: 'twin.epcis.note.errorDeclaration'
|
|
141
|
+
},
|
|
142
|
+
/* 모양만 있고 아무도 채우지 않는 것들 — 구조만 있음. */
|
|
143
|
+
{
|
|
144
|
+
std: 'sourceList / destinationList',
|
|
145
|
+
part: 'fields',
|
|
146
|
+
label: 'twin.epcis.sourceDestination',
|
|
147
|
+
axis: null,
|
|
148
|
+
structure: 'partial',
|
|
149
|
+
behavior: 'none',
|
|
150
|
+
surface: 'none',
|
|
151
|
+
note: 'twin.epcis.note.sourceDestination'
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
std: 'persistentDisposition',
|
|
155
|
+
part: 'fields',
|
|
156
|
+
label: 'twin.epcis.persistentDisposition',
|
|
157
|
+
axis: null,
|
|
158
|
+
structure: 'partial',
|
|
159
|
+
behavior: 'none',
|
|
160
|
+
surface: 'none',
|
|
161
|
+
note: 'twin.epcis.note.persistentDisposition'
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
std: 'sensorElementList',
|
|
165
|
+
part: 'fields',
|
|
166
|
+
label: 'twin.epcis.sensorElement',
|
|
167
|
+
axis: null,
|
|
168
|
+
structure: 'partial',
|
|
169
|
+
behavior: 'none',
|
|
170
|
+
surface: 'none',
|
|
171
|
+
note: 'twin.epcis.note.sensorElement'
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
|
|
175
|
+
export const EPCIS_CONCEPTS: Isa95Concept[] = [...EVENTS, ...FIELDS]
|
|
176
|
+
|
|
177
|
+
export function epcisCoverage(axes: string[]): {
|
|
178
|
+
model: string
|
|
179
|
+
concepts: (Isa95Concept & { axisMissing?: boolean })[]
|
|
180
|
+
totals: { concepts: number; structure: number; behavior: number; surface: number }
|
|
181
|
+
} {
|
|
182
|
+
const known = new Set(axes)
|
|
183
|
+
const concepts = EPCIS_CONCEPTS.map(c => {
|
|
184
|
+
const axisMissing = !!c.axis && !known.has(c.axis)
|
|
185
|
+
const shownOn = c.shownOn?.filter(a => known.has(a))
|
|
186
|
+
const fixed = shownOn && shownOn.length !== c.shownOn?.length ? { ...c, shownOn } : c
|
|
187
|
+
return axisMissing ? { ...fixed, structure: 'none' as CoverageLevel, axisMissing } : fixed
|
|
188
|
+
})
|
|
189
|
+
const count = (k: 'structure' | 'behavior' | 'surface') => concepts.filter(c => c[k] === 'full').length
|
|
190
|
+
return {
|
|
191
|
+
model: 'GS1 EPCIS 2.0',
|
|
192
|
+
concepts,
|
|
193
|
+
totals: { concepts: concepts.length, structure: count('structure'), behavior: count('behavior'), surface: count('surface') }
|
|
194
|
+
}
|
|
195
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* IEC 61850 적합성 기준 — **에너지 트윈이 표준의 어디를 채우고 있나.**
|
|
3
|
+
*
|
|
4
|
+
* ── 왜 따로 있나 ────────────────────────────────────────────────────────────
|
|
5
|
+
* 인스펙션의 적합성 패널은 트윈 종류와 무관하게 ISA-95 하나만 말하고 있었다. 에너지 트윈에서 그것은
|
|
6
|
+
* 거짓은 아니지만(설비·계층·속성은 에너지에서도 ISA-95 자원이다) **부족하다** — 계량기·차단기·태양광·
|
|
7
|
+
* 축전지의 어휘를 주는 것은 IEC 61850 이고, 무엇이 비었는지도 그 목록으로만 셀 수 있다.
|
|
8
|
+
*
|
|
9
|
+
* ── 주장 수준을 못 박는다 ───────────────────────────────────────────────────
|
|
10
|
+
* 여기서 재는 것은 **어휘와 모델**이다. 프로토콜(MMS·GOOSE·샘플드값)을 구현했다는 뜻이 아니며,
|
|
11
|
+
* 그 주장은 적합성 시험이 뒷받침해야 한다. 표 이름을 「IEC 61850 (vocabulary)」로 쓰는 이유다.
|
|
12
|
+
*
|
|
13
|
+
* ── 값은 관측이 아니라 선언이다 ─────────────────────────────────────────────
|
|
14
|
+
* ISA-95 표와 같은 규율이다(`isa95-coverage.ts` 머리말): 사람이 판단해 적고, 틀리면 여기를 고친다.
|
|
15
|
+
* 자동으로 알 수 있는 것 하나만 자동으로 한다 — 축 이름이 커널 축 목록에 없으면 구조가 없는 것이다.
|
|
16
|
+
*/
|
|
17
|
+
import type { Isa95Concept, CoverageLevel } from './isa95-coverage.js'
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
* Part 7-4 — 논리 노드 클래스. 이 프로파일이 쓰는 것만 적는다(표준 전체를 옮기지 않는다):
|
|
21
|
+
* 계량·계측·개폐·발전·저장.
|
|
22
|
+
*/
|
|
23
|
+
const LOGICAL_NODES: Isa95Concept[] = [ // vocabulary-guard: allow — IEC 61850 의 「논리 노드(logical node)」는 표준 용어다(우리가 은퇴시킨 node 어휘가 아니다)
|
|
24
|
+
/*
|
|
25
|
+
* 계량(적산) — 커넥터가 누적 전력량을 실어 오고 상태가 지점별로 들고 있다. 화면은 계량 컴포넌트가
|
|
26
|
+
* 지점의 값을 보인다.
|
|
27
|
+
*/
|
|
28
|
+
{
|
|
29
|
+
std: 'MMTR',
|
|
30
|
+
part: '7-4',
|
|
31
|
+
label: 'twin.iec61850.MMTR',
|
|
32
|
+
axis: 'equipment',
|
|
33
|
+
structure: 'full',
|
|
34
|
+
behavior: 'full',
|
|
35
|
+
surface: 'full',
|
|
36
|
+
note: 'twin.iec61850.note.MMTR'
|
|
37
|
+
},
|
|
38
|
+
/*
|
|
39
|
+
* 계측(유효전력·역률) — 표본이 수요 구간으로 접히고, 구간·피크·계약 대비가 그 위에 선다.
|
|
40
|
+
* 이 프로파일에서 가장 두껍게 채운 자리다.
|
|
41
|
+
*/
|
|
42
|
+
{
|
|
43
|
+
std: 'MMXU',
|
|
44
|
+
part: '7-4',
|
|
45
|
+
label: 'twin.iec61850.MMXU',
|
|
46
|
+
axis: 'demandWindows',
|
|
47
|
+
structure: 'full',
|
|
48
|
+
behavior: 'full',
|
|
49
|
+
surface: 'full',
|
|
50
|
+
note: 'twin.iec61850.note.MMXU'
|
|
51
|
+
},
|
|
52
|
+
/*
|
|
53
|
+
* ── 셋이 함께 올라갔다 (2026-08-15) ──────────────────────────────────────
|
|
54
|
+
* 개폐·발전·저장은 오래 「구조만 있음」이었다. 능력이 상태 필드를 선언해 두었는데 **값을 받는 문이
|
|
55
|
+
* 없었기 때문**이다. 이제 셋 다 실제로 돈다: 설비 상태가 계약에 서고(`EquipmentState`), 커널이
|
|
56
|
+
* `energy.equipment` 로 받아 그 설비에 적고, 씬 컴포넌트가 그린다.
|
|
57
|
+
*
|
|
58
|
+
* 세 층을 함께 올리는 이유: 값이 없는데 화면만 만들면 영원히 「—」인 카드가 되고, 화면이 없는데
|
|
59
|
+
* 기능만 올리면 아무도 그 값을 보지 못한다. 「값이 먼저, 컴포넌트는 그 다음」의 결과다.
|
|
60
|
+
*/
|
|
61
|
+
{
|
|
62
|
+
std: 'XCBR',
|
|
63
|
+
part: '7-4',
|
|
64
|
+
label: 'twin.iec61850.XCBR',
|
|
65
|
+
axis: null,
|
|
66
|
+
shownOn: ['equipment'],
|
|
67
|
+
structure: 'full',
|
|
68
|
+
behavior: 'full',
|
|
69
|
+
surface: 'full',
|
|
70
|
+
note: 'twin.iec61850.note.XCBR'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
std: 'DPVA',
|
|
74
|
+
part: '7-4',
|
|
75
|
+
label: 'twin.iec61850.DPVA',
|
|
76
|
+
axis: null,
|
|
77
|
+
shownOn: ['equipment'],
|
|
78
|
+
structure: 'full',
|
|
79
|
+
behavior: 'full',
|
|
80
|
+
surface: 'full',
|
|
81
|
+
note: 'twin.iec61850.note.DPVA'
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
std: 'ZBAT',
|
|
85
|
+
part: '7-4',
|
|
86
|
+
label: 'twin.iec61850.ZBAT',
|
|
87
|
+
axis: null,
|
|
88
|
+
shownOn: ['equipment'],
|
|
89
|
+
structure: 'full',
|
|
90
|
+
behavior: 'full',
|
|
91
|
+
surface: 'full',
|
|
92
|
+
note: 'twin.iec61850.note.ZBAT'
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
export const IEC61850_CONCEPTS: Isa95Concept[] = [...LOGICAL_NODES] // vocabulary-guard: allow — 표준 용어(위 주석)
|
|
97
|
+
|
|
98
|
+
export function iec61850Coverage(axes: string[]): {
|
|
99
|
+
model: string
|
|
100
|
+
concepts: (Isa95Concept & { axisMissing?: boolean })[]
|
|
101
|
+
totals: { concepts: number; structure: number; behavior: number; surface: number }
|
|
102
|
+
} {
|
|
103
|
+
const known = new Set(axes)
|
|
104
|
+
const concepts = IEC61850_CONCEPTS.map(c => {
|
|
105
|
+
const axisMissing = !!c.axis && !known.has(c.axis)
|
|
106
|
+
const shownOn = c.shownOn?.filter(a => known.has(a))
|
|
107
|
+
const fixed = shownOn && shownOn.length !== c.shownOn?.length ? { ...c, shownOn } : c
|
|
108
|
+
return axisMissing ? { ...fixed, structure: 'none' as CoverageLevel, axisMissing } : fixed
|
|
109
|
+
})
|
|
110
|
+
const count = (k: 'structure' | 'behavior' | 'surface') => concepts.filter(c => c[k] === 'full').length
|
|
111
|
+
return {
|
|
112
|
+
/* 이름에 (vocabulary) 를 달아 둔다 — 프로토콜 적합성으로 읽히지 않게. */
|
|
113
|
+
model: 'IEC 61850 (vocabulary)',
|
|
114
|
+
concepts,
|
|
115
|
+
totals: { concepts: concepts.length, structure: count('structure'), behavior: count('behavior'), surface: count('surface') }
|
|
116
|
+
}
|
|
117
|
+
}
|