@operato/twin-figure-capabilities 0.5.0 → 0.5.3
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/entity.d.ts +11 -13
- package/dist/entity.js +23 -11
- package/dist/generate.d.ts +7 -5
- package/dist/generate.js +17 -14
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/mobile.js +6 -2
- package/dist/module.d.ts +3 -5
- package/dist/module.js +2 -2
- package/dist/operable.js +7 -3
- package/dist/storable.js +7 -3
- package/dist/twin-capabilities.module.mjs +86 -33
- package/dist/values.js +1 -1
- package/dist/words.d.ts +13 -5
- package/dist/words.js +42 -1
- package/package.json +1 -1
package/dist/entity.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FigureAsset, FigureCapabilityDescriptor } from '@hatiolab/figure-model';
|
|
2
2
|
import { type CapabilityKey } from '@operato/ops-contract';
|
|
3
|
+
import { type Words } from './words.ts';
|
|
3
4
|
/** The twin's scene actions (ADR-0209 decision 3): `<provider>.<action>`. The twin app registers what each does. */
|
|
4
5
|
export declare const TWIN_ACTIONS: {
|
|
5
6
|
readonly preview: "twin.preview-entity";
|
|
@@ -7,40 +8,37 @@ export declare const TWIN_ACTIONS: {
|
|
|
7
8
|
readonly open: "twin.open-entity";
|
|
8
9
|
readonly command: "twin.command";
|
|
9
10
|
};
|
|
10
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* What every twin entity answers to, by meaning (ADR-0209 decision 2). Each has its words: the actions menu shows them
|
|
13
|
+
* (amendment 1 decision 8), and the handler editor shows them as the action a meaning gets (decision 7).
|
|
14
|
+
*/
|
|
11
15
|
export declare const TWIN_ENTITY_INTERACTIONS: readonly ({
|
|
12
16
|
meaning: "preview";
|
|
13
17
|
action: "twin.preview-entity";
|
|
14
|
-
label
|
|
18
|
+
label: Readonly<Record<"ko" | "en" | "ja" | "zh" | "es" | "ms", string>>;
|
|
15
19
|
} | {
|
|
16
20
|
meaning: "select";
|
|
17
21
|
action: "twin.entity-info";
|
|
18
|
-
label
|
|
22
|
+
label: Readonly<Record<"ko" | "en" | "ja" | "zh" | "es" | "ms", string>>;
|
|
19
23
|
} | {
|
|
20
24
|
meaning: "enter";
|
|
21
25
|
action: "twin.open-entity";
|
|
22
|
-
label
|
|
26
|
+
label: Readonly<Record<"ko" | "en" | "ja" | "zh" | "es" | "ms", string>>;
|
|
23
27
|
} | {
|
|
24
28
|
meaning: "actions";
|
|
25
29
|
action: "twin.entity-info";
|
|
26
|
-
label:
|
|
27
|
-
ko: string;
|
|
28
|
-
en: string;
|
|
29
|
-
};
|
|
30
|
+
label: Readonly<Record<"ko" | "en" | "ja" | "zh" | "es" | "ms", string>>;
|
|
30
31
|
} | {
|
|
31
32
|
meaning: "actions";
|
|
32
33
|
action: "twin.open-entity";
|
|
33
|
-
label:
|
|
34
|
-
ko: string;
|
|
35
|
-
en: string;
|
|
36
|
-
};
|
|
34
|
+
label: Readonly<Record<"ko" | "en" | "ja" | "zh" | "es" | "ms", string>>;
|
|
37
35
|
})[];
|
|
38
36
|
/** The settings key of the entity types */
|
|
39
37
|
export declare const ENTITY_TYPES_SETTING = "types";
|
|
40
38
|
/** The entity types a figure declares, as written. */
|
|
41
39
|
export declare function entityTypesOf(settings: Record<string, unknown> | undefined): string[];
|
|
42
40
|
/** Why the settings cannot be taken: no type declared, keys out of place. */
|
|
43
|
-
export declare function entitySettingsIssues(settings: Record<string, unknown> | undefined):
|
|
41
|
+
export declare function entitySettingsIssues(settings: Record<string, unknown> | undefined): Words[];
|
|
44
42
|
/** The capabilities the contract's standard catalog gives a type, across its systems; none for a type it does not know. */
|
|
45
43
|
export declare function standardCapabilitiesOfType(type: string): CapabilityKey[];
|
|
46
44
|
/**
|
package/dist/entity.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DOMAIN_SYSTEMS, capabilitiesForType } from '@operato/ops-contract';
|
|
2
2
|
import { TWIN_COMMAND_ACTION, TWIN_ENTITY_NAME, twinCapabilityName } from "./generate.js";
|
|
3
|
+
import { NO_ENTITY_TYPE_WORDS, unusedSettingWords } from "./words.js";
|
|
3
4
|
/*
|
|
4
5
|
* `twin.Entity` (ADR-0208 amendment 1 decision 12): the base every twin capability stands on. It says which entity types
|
|
5
6
|
* the figure draws -- a location's `type`, equipment's `kind` -- and that saying is the mapping: the twin draws an entity
|
|
@@ -14,14 +15,21 @@ export const TWIN_ACTIONS = {
|
|
|
14
15
|
open: 'twin.open-entity',
|
|
15
16
|
command: TWIN_COMMAND_ACTION
|
|
16
17
|
};
|
|
17
|
-
|
|
18
|
+
/* The words of each action, the same on every meaning it is given on */
|
|
19
|
+
const PREVIEW_WORDS = { ko: '미리보기', en: 'Preview', ja: 'プレビュー', zh: '预览', es: 'Vista previa', ms: 'Pratonton' };
|
|
20
|
+
const INFO_WORDS = { ko: '정보', en: 'Info', ja: '情報', zh: '信息', es: 'Información', ms: 'Maklumat' };
|
|
21
|
+
const OPEN_WORDS = { ko: '360 열기', en: 'Open 360', ja: '360 を開く', zh: '打开 360', es: 'Abrir 360', ms: 'Buka 360' };
|
|
22
|
+
/**
|
|
23
|
+
* What every twin entity answers to, by meaning (ADR-0209 decision 2). Each has its words: the actions menu shows them
|
|
24
|
+
* (amendment 1 decision 8), and the handler editor shows them as the action a meaning gets (decision 7).
|
|
25
|
+
*/
|
|
18
26
|
export const TWIN_ENTITY_INTERACTIONS = Object.freeze([
|
|
19
|
-
{ meaning: 'preview', action: TWIN_ACTIONS.preview },
|
|
20
|
-
{ meaning: 'select', action: TWIN_ACTIONS.info },
|
|
21
|
-
{ meaning: 'enter', action: TWIN_ACTIONS.open },
|
|
27
|
+
{ meaning: 'preview', action: TWIN_ACTIONS.preview, label: PREVIEW_WORDS },
|
|
28
|
+
{ meaning: 'select', action: TWIN_ACTIONS.info, label: INFO_WORDS },
|
|
29
|
+
{ meaning: 'enter', action: TWIN_ACTIONS.open, label: OPEN_WORDS },
|
|
22
30
|
/* The actions menu (amendment 1 decision 8): these two, then each capability's commands (`commandInteractionsOf`) */
|
|
23
|
-
{ meaning: 'actions', action: TWIN_ACTIONS.info, label:
|
|
24
|
-
{ meaning: 'actions', action: TWIN_ACTIONS.open, label:
|
|
31
|
+
{ meaning: 'actions', action: TWIN_ACTIONS.info, label: INFO_WORDS },
|
|
32
|
+
{ meaning: 'actions', action: TWIN_ACTIONS.open, label: OPEN_WORDS }
|
|
25
33
|
]);
|
|
26
34
|
/** The settings key of the entity types */
|
|
27
35
|
export const ENTITY_TYPES_SETTING = 'types';
|
|
@@ -35,9 +43,9 @@ export function entitySettingsIssues(settings) {
|
|
|
35
43
|
const out = [];
|
|
36
44
|
for (const key of Object.keys(settings ?? {}))
|
|
37
45
|
if (key !== ENTITY_TYPES_SETTING)
|
|
38
|
-
out.push(
|
|
46
|
+
out.push(unusedSettingWords(key));
|
|
39
47
|
if (!entityTypesOf(settings).length)
|
|
40
|
-
out.push(
|
|
48
|
+
out.push(NO_ENTITY_TYPE_WORDS);
|
|
41
49
|
return out;
|
|
42
50
|
}
|
|
43
51
|
/** The capabilities the contract's standard catalog gives a type, across its systems; none for a type it does not know. */
|
|
@@ -69,16 +77,20 @@ export function entityCapabilityAdvice(settings, asset, typeCapabilities = stand
|
|
|
69
77
|
export const TWIN_FIGURE_CAPABILITY_NAMES = ['twin.Operable', 'twin.Storable', 'twin.Mobile'];
|
|
70
78
|
export const ENTITY = {
|
|
71
79
|
name: TWIN_ENTITY_NAME,
|
|
72
|
-
label: { ko: '트윈 엔티티', en: 'Twin entity' },
|
|
80
|
+
label: { ko: '트윈 엔티티', en: 'Twin entity', ja: 'ツインエンティティ', zh: '孪生实体', es: 'Entidad del gemelo', ms: 'Entiti kembar' },
|
|
73
81
|
note: {
|
|
74
82
|
ko: '이 피규어가 나타내는 트윈 엔티티 종류를 정합니다. 트윈은 이 종류의 엔티티를 이 피규어로 그립니다. 운영 상태 · 보관 · 이동 능력은 이 능력 위에 켭니다.',
|
|
75
|
-
en: 'Sets the twin entity types this figure draws. The twin draws entities of these types with it. Operating status, storage and motion are turned on over this capability.'
|
|
83
|
+
en: 'Sets the twin entity types this figure draws. The twin draws entities of these types with it. Operating status, storage and motion are turned on over this capability.',
|
|
84
|
+
ja: 'この図形が表すツインエンティティの種類を決めます。ツインはこの種類のエンティティをこの図形で描きます。運用状態・保管・移動の機能はこの機能の上でオンにします。',
|
|
85
|
+
zh: '设置此图形表示的孪生实体类型。孪生用此图形绘制这些类型的实体。运行状态、存放和移动能力在此能力之上开启。',
|
|
86
|
+
es: 'Define los tipos de entidad del gemelo que dibuja esta figura. El gemelo dibuja con ella las entidades de esos tipos. El estado operativo, el almacenamiento y el movimiento se activan sobre esta capacidad.',
|
|
87
|
+
ms: 'Menetapkan jenis entiti kembar yang dilukis oleh figura ini. Kembar melukis entiti jenis tersebut dengan figura ini. Status operasi, simpanan dan pergerakan dihidupkan di atas keupayaan ini.'
|
|
76
88
|
},
|
|
77
89
|
version: '2',
|
|
78
90
|
needs: [],
|
|
79
91
|
/* The marker the twin sends with every entity's data (headless-twin entity-delta `entity`) */
|
|
80
92
|
data: [{ name: 'entity' }],
|
|
81
|
-
settings: [{ key: ENTITY_TYPES_SETTING, kind: 'choice', label: { ko: '엔티티 종류', en: 'Entity types' }, multiple: true, required: true }],
|
|
93
|
+
settings: [{ key: ENTITY_TYPES_SETTING, kind: 'choice', label: { ko: '엔티티 종류', en: 'Entity types', ja: 'エンティティの種類', zh: '实体类型', es: 'Tipos de entidad', ms: 'Jenis entiti' }, multiple: true, required: true }],
|
|
82
94
|
check: settings => entitySettingsIssues(settings),
|
|
83
95
|
takes: () => ({}),
|
|
84
96
|
/*
|
package/dist/generate.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { FigureAsset, FigureCapabilityCard, FigureCapabilityDescriptor, FigureDataBinding } from '@hatiolab/figure-model';
|
|
2
2
|
import { type CapabilityKey } from '@operato/ops-contract';
|
|
3
|
-
import type
|
|
3
|
+
import { type Words } from './words.ts';
|
|
4
4
|
/** The base capability every twin capability stands on. */
|
|
5
5
|
export declare const TWIN_ENTITY_NAME = "twin.Entity";
|
|
6
6
|
/** The scene action that sends one contract command to the entity (ADR-0209 decision 3); the twin app registers it. */
|
|
7
7
|
export declare const TWIN_COMMAND_ACTION = "twin.command";
|
|
8
8
|
/**
|
|
9
|
-
* The words of the contract's commands,
|
|
10
|
-
*
|
|
9
|
+
* The words of the contract's commands, wherever a command is offered: the actions menu (ADR-0209 amendment 1
|
|
10
|
+
* decision 8), the popup boards' buttons and the 2D cards' buttons. The module carries its own words (ADR-0172
|
|
11
|
+
* decision 7); screens read them with `capabilityText`. A capability's command with no words here is a test failure,
|
|
12
|
+
* not a menu item named by its code.
|
|
11
13
|
*/
|
|
12
14
|
export declare const COMMAND_WORDS: Readonly<Record<string, Words>>;
|
|
13
15
|
/** A capability's commands as `actions` menu items: each sends its command, with the twin's confirmation. */
|
|
@@ -15,7 +17,7 @@ export declare const commandInteractionsOf: (key: CapabilityKey) => {
|
|
|
15
17
|
meaning: "actions";
|
|
16
18
|
action: string;
|
|
17
19
|
value: string;
|
|
18
|
-
label:
|
|
20
|
+
label: Readonly<Record<"ko" | "en" | "ja" | "zh" | "es" | "ms", string>>;
|
|
19
21
|
}[];
|
|
20
22
|
/** `twin.<Capability>`, as the contract names the capability. */
|
|
21
23
|
export declare const twinCapabilityName: (key: CapabilityKey) => string;
|
|
@@ -40,7 +42,7 @@ export interface TwinCapabilitySpec {
|
|
|
40
42
|
/** The listed fields of a capability: its state fields the contract gives a closed list for. */
|
|
41
43
|
export declare const listedFieldsOf: (key: CapabilityKey) => string[];
|
|
42
44
|
/** Why the settings cannot be taken: a listed field with no part, parts the figure lacks, keys out of place. */
|
|
43
|
-
export declare function listedSettingsIssues(key: CapabilityKey, settings: Record<string, unknown> | undefined, asset: FigureAsset):
|
|
45
|
+
export declare function listedSettingsIssues(key: CapabilityKey, settings: Record<string, unknown> | undefined, asset: FigureAsset): Words[];
|
|
44
46
|
/** The tables the capability hands the figure engine (ADR-0166): each listed field's rows on its parts, by its legend role. */
|
|
45
47
|
export declare function listedDataInterface(key: CapabilityKey, settings: Record<string, unknown> | undefined): {
|
|
46
48
|
schema: {
|
package/dist/generate.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CAPABILITIES } from '@operato/ops-contract';
|
|
2
2
|
import { STATE_FIELD_WORDS, STATE_VALUE_LISTS, legendRowsOf } from "./values.js";
|
|
3
|
+
import { missingPartWords, noPartWords, unusedSettingWords } from "./words.js";
|
|
3
4
|
/*
|
|
4
5
|
* A twin capability's definition made from the contract (ADR-0208 amendment 1 decision 15): the data it reads is the
|
|
5
6
|
* capability's state fields, and each field with a closed value list gets its legend rows and a parts setting -- the one
|
|
@@ -11,18 +12,20 @@ export const TWIN_ENTITY_NAME = 'twin.Entity';
|
|
|
11
12
|
/** The scene action that sends one contract command to the entity (ADR-0209 decision 3); the twin app registers it. */
|
|
12
13
|
export const TWIN_COMMAND_ACTION = 'twin.command';
|
|
13
14
|
/**
|
|
14
|
-
* The words of the contract's commands,
|
|
15
|
-
*
|
|
15
|
+
* The words of the contract's commands, wherever a command is offered: the actions menu (ADR-0209 amendment 1
|
|
16
|
+
* decision 8), the popup boards' buttons and the 2D cards' buttons. The module carries its own words (ADR-0172
|
|
17
|
+
* decision 7); screens read them with `capabilityText`. A capability's command with no words here is a test failure,
|
|
18
|
+
* not a menu item named by its code.
|
|
16
19
|
*/
|
|
17
20
|
export const COMMAND_WORDS = Object.freeze({
|
|
18
|
-
'resource.hold': { ko: '계획 정지', en: 'Plan stop' },
|
|
19
|
-
'resource.resume': { ko: '재개', en: 'Resume' },
|
|
20
|
-
'resource.down': { ko: '고장 주입', en: 'Inject fault' },
|
|
21
|
-
'resource.repair': { ko: '수리', en: 'Repair' },
|
|
22
|
-
'resource.reset-metrics': { ko: '지표 리셋', en: 'Reset metrics' }
|
|
21
|
+
'resource.hold': { ko: '계획 정지', en: 'Plan stop', ja: '計画停止', zh: '计划停机', es: 'Parada planificada', ms: 'Henti terancang' },
|
|
22
|
+
'resource.resume': { ko: '재개', en: 'Resume', ja: '再開', zh: '恢复', es: 'Reanudar', ms: 'Sambung semula' },
|
|
23
|
+
'resource.down': { ko: '고장 주입', en: 'Inject fault', ja: '故障注入', zh: '注入故障', es: 'Inyectar fallo', ms: 'Suntik kerosakan' },
|
|
24
|
+
'resource.repair': { ko: '수리', en: 'Repair', ja: '修理', zh: '维修', es: 'Reparar', ms: 'Baiki' },
|
|
25
|
+
'resource.reset-metrics': { ko: '지표 리셋', en: 'Reset metrics', ja: '指標リセット', zh: '重置指标', es: 'Reiniciar métricas', ms: 'Set semula metrik' }
|
|
23
26
|
});
|
|
24
27
|
/** A capability's commands as `actions` menu items: each sends its command, with the twin's confirmation. */
|
|
25
|
-
export const commandInteractionsOf = (key) => CAPABILITIES[key].commands.map(command => ({ meaning: 'actions', action: TWIN_COMMAND_ACTION, value: command, label: COMMAND_WORDS[command]
|
|
28
|
+
export const commandInteractionsOf = (key) => CAPABILITIES[key].commands.map(command => ({ meaning: 'actions', action: TWIN_COMMAND_ACTION, value: command, label: COMMAND_WORDS[command] }));
|
|
26
29
|
/** `twin.<Capability>`, as the contract names the capability. */
|
|
27
30
|
export const twinCapabilityName = (key) => `twin.${key[0].toUpperCase()}${key.slice(1)}`;
|
|
28
31
|
/** The legend role of a listed field: `twin-<field>` (the operating status: `twin-status`). */
|
|
@@ -43,14 +46,14 @@ export function listedSettingsIssues(key, settings, asset) {
|
|
|
43
46
|
const out = [];
|
|
44
47
|
for (const k of Object.keys(settings ?? {}))
|
|
45
48
|
if (!keys.includes(k))
|
|
46
|
-
out.push(
|
|
49
|
+
out.push(unusedSettingWords(k));
|
|
47
50
|
for (const field of fields) {
|
|
48
51
|
const chosen = partsOf(settings, field);
|
|
49
52
|
if (!chosen.length)
|
|
50
|
-
out.push(
|
|
53
|
+
out.push(noPartWords(STATE_FIELD_WORDS[field]));
|
|
51
54
|
for (const part of chosen)
|
|
52
55
|
if (!parts.has(part))
|
|
53
|
-
out.push(
|
|
56
|
+
out.push(missingPartWords(part));
|
|
54
57
|
}
|
|
55
58
|
return out;
|
|
56
59
|
}
|
|
@@ -60,10 +63,10 @@ export function listedDataInterface(key, settings) {
|
|
|
60
63
|
if (!fields.length)
|
|
61
64
|
return undefined;
|
|
62
65
|
return {
|
|
63
|
-
schema: fields.map(field => ({ name: field, label: STATE_FIELD_WORDS[field]
|
|
66
|
+
schema: fields.map(field => ({ name: field, label: STATE_FIELD_WORDS[field].ko, kind: 'text' })),
|
|
64
67
|
bindings: fields.map(field => ({
|
|
65
68
|
id: legendRoleOf(field),
|
|
66
|
-
label: STATE_FIELD_WORDS[field]
|
|
69
|
+
label: STATE_FIELD_WORDS[field].ko,
|
|
67
70
|
accessor: field,
|
|
68
71
|
rule: 'table',
|
|
69
72
|
lookup: 'code',
|
|
@@ -86,7 +89,7 @@ export function twinCapability(spec) {
|
|
|
86
89
|
data: [...CAPABILITIES[key].stateFields, ...(spec.moreData ?? [])].map(name => ({ name })),
|
|
87
90
|
...(fields.length
|
|
88
91
|
? {
|
|
89
|
-
settings: fields.map(field => ({ key: partsSettingOf(field), kind: 'parts', label: STATE_FIELD_WORDS[field]
|
|
92
|
+
settings: fields.map(field => ({ key: partsSettingOf(field), kind: 'parts', label: STATE_FIELD_WORDS[field], required: true })),
|
|
90
93
|
check: (settings, asset) => listedSettingsIssues(key, settings, asset),
|
|
91
94
|
dataInterface: (settings) => listedDataInterface(key, settings)
|
|
92
95
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export { OPERABLE } from './operable.ts';
|
|
|
5
5
|
export { STORABLE, twinItemId, twinItemRecords, type TwinItemRecord, type TwinLocationItem } from './storable.ts';
|
|
6
6
|
export { MOBILE } from './mobile.ts';
|
|
7
7
|
export { capabilities as TWIN_FIGURE_CAPABILITIES, label as TWIN_CAPABILITY_PROVIDER_LABEL, provider as TWIN_CAPABILITY_PROVIDER, version as TWIN_CAPABILITY_MODULE_VERSION } from './module.ts';
|
|
8
|
+
export { TWIN_LANGUAGES, type TwinLanguage, type Words } from './words.ts';
|
package/dist/index.js
CHANGED
|
@@ -10,3 +10,4 @@ export { OPERABLE } from "./operable.js";
|
|
|
10
10
|
export { STORABLE, twinItemId, twinItemRecords } from "./storable.js";
|
|
11
11
|
export { MOBILE } from "./mobile.js";
|
|
12
12
|
export { capabilities as TWIN_FIGURE_CAPABILITIES, label as TWIN_CAPABILITY_PROVIDER_LABEL, provider as TWIN_CAPABILITY_PROVIDER, version as TWIN_CAPABILITY_MODULE_VERSION } from "./module.js";
|
|
13
|
+
export { TWIN_LANGUAGES } from "./words.js";
|
package/dist/mobile.js
CHANGED
|
@@ -6,10 +6,14 @@ import { twinCapability } from "./generate.js";
|
|
|
6
6
|
*/
|
|
7
7
|
export const MOBILE = twinCapability({
|
|
8
8
|
key: 'mobile',
|
|
9
|
-
label: { ko: '이동', en: 'Mobile' },
|
|
9
|
+
label: { ko: '이동', en: 'Mobile', ja: '移動', zh: '移动', es: 'Movimiento', ms: 'Pergerakan' },
|
|
10
10
|
note: {
|
|
11
11
|
ko: '트윈이 관측한 위치와 이동으로 피규어를 자리 사이에서 움직입니다. 피규어의 앞면이 진행 방향을 향합니다.',
|
|
12
|
-
en: 'Moves the figure between locations as the twin observes it moving, its front face ahead.'
|
|
12
|
+
en: 'Moves the figure between locations as the twin observes it moving, its front face ahead.',
|
|
13
|
+
ja: 'ツインが観測した位置と移動で、図形を場所の間で動かします。図形の前面が進行方向を向きます。',
|
|
14
|
+
zh: '按孪生观测到的位置和移动,在位置之间移动图形。图形的正面朝向前进方向。',
|
|
15
|
+
es: 'Mueve la figura entre ubicaciones según el gemelo la observa moverse, con su cara frontal por delante.',
|
|
16
|
+
ms: 'Menggerakkan figura antara lokasi seperti yang diperhatikan oleh kembar, dengan muka hadapannya menghala ke arah pergerakan.'
|
|
13
17
|
},
|
|
14
18
|
version: '2'
|
|
15
19
|
});
|
package/dist/module.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
+
import type { Words } from './words.ts';
|
|
1
2
|
export declare const provider = "twin";
|
|
2
3
|
/** The provider's name on the modeller's screen. */
|
|
3
|
-
export declare const label:
|
|
4
|
-
ko: string;
|
|
5
|
-
en: string;
|
|
6
|
-
};
|
|
4
|
+
export declare const label: Words;
|
|
7
5
|
/** The module's version: the package's (a test keeps them the same). */
|
|
8
|
-
export declare const version = "0.5.
|
|
6
|
+
export declare const version = "0.5.3";
|
|
9
7
|
/** The base first, then the capabilities that stand on it. */
|
|
10
8
|
export declare const capabilities: import("@hatiolab/figure-model").FigureCapabilityDescriptor[];
|
package/dist/module.js
CHANGED
|
@@ -9,8 +9,8 @@ import { OPERABLE } from "./operable.js";
|
|
|
9
9
|
import { STORABLE } from "./storable.js";
|
|
10
10
|
export const provider = 'twin';
|
|
11
11
|
/** The provider's name on the modeller's screen. */
|
|
12
|
-
export const label = { ko: '트윈', en: 'Twin' };
|
|
12
|
+
export const label = { ko: '트윈', en: 'Twin', ja: 'ツイン', zh: '孪生', es: 'Gemelo', ms: 'Kembar' };
|
|
13
13
|
/** The module's version: the package's (a test keeps them the same). */
|
|
14
|
-
export const version = '0.5.
|
|
14
|
+
export const version = '0.5.3';
|
|
15
15
|
/** The base first, then the capabilities that stand on it. */
|
|
16
16
|
export const capabilities = [ENTITY, OPERABLE, STORABLE, MOBILE];
|
package/dist/operable.js
CHANGED
|
@@ -5,12 +5,16 @@ import { twinCapability } from "./generate.js";
|
|
|
5
5
|
*/
|
|
6
6
|
export const OPERABLE = twinCapability({
|
|
7
7
|
key: 'operable',
|
|
8
|
-
label: { ko: '운영 상태', en: 'Operable' },
|
|
8
|
+
label: { ko: '운영 상태', en: 'Operable', ja: '運用状態', zh: '运行状态', es: 'Estado operativo', ms: 'Status operasi' },
|
|
9
9
|
note: {
|
|
10
10
|
ko: '트윈이 관측한 설비 상태(가동 · 준비 · 고장 · 대기 · 계획정지)를 선택한 부품의 색으로 표시합니다. 색은 설비 상태 범례를 따릅니다.',
|
|
11
|
-
en: 'Shows the equipment status the twin observes (busy, setup, down, idle, planned stop) as the colour of the parts you pick, by the equipment status legend.'
|
|
11
|
+
en: 'Shows the equipment status the twin observes (busy, setup, down, idle, planned stop) as the colour of the parts you pick, by the equipment status legend.',
|
|
12
|
+
ja: 'ツインが観測した設備状態(稼働・段取り・故障・待機・計画停止)を、選んだ部品の色で表示します。色は設備状態の凡例に従います。',
|
|
13
|
+
zh: '用所选部件的颜色显示孪生观测到的设备状态(运行、准备、故障、空闲、计划停机)。颜色遵循设备状态图例。',
|
|
14
|
+
es: 'Muestra el estado del equipo que observa el gemelo (en marcha, preparación, averiado, inactivo, parada planificada) con el color de las piezas que elija, según la leyenda de estado del equipo.',
|
|
15
|
+
ms: 'Menunjukkan status peralatan yang diperhatikan oleh kembar (sibuk, persediaan, rosak, melahu, henti terancang) dengan warna bahagian yang anda pilih, mengikut petunjuk status peralatan.'
|
|
12
16
|
},
|
|
13
17
|
version: '3',
|
|
14
18
|
/* 설비 상태 배지 — 피규어 위 */
|
|
15
|
-
cards: [{ id: 'status', anchor: 'top', label: { ko: '설비 상태', en: 'Equipment status' } }]
|
|
19
|
+
cards: [{ id: 'status', anchor: 'top', label: { ko: '설비 상태', en: 'Equipment status', ja: '設備状態', zh: '设备状态', es: 'Estado del equipo', ms: 'Status peralatan' } }]
|
|
16
20
|
});
|
package/dist/storable.js
CHANGED
|
@@ -28,10 +28,14 @@ export function twinItemRecords(items, places) {
|
|
|
28
28
|
}
|
|
29
29
|
export const STORABLE = twinCapability({
|
|
30
30
|
key: 'storable',
|
|
31
|
-
label: { ko: '보관', en: 'Storable' },
|
|
31
|
+
label: { ko: '보관', en: 'Storable', ja: '保管', zh: '存放', es: 'Almacenamiento', ms: 'Simpanan' },
|
|
32
32
|
note: {
|
|
33
33
|
ko: '트윈이 관측한 이 자리의 물품을 피규어의 적재 위치에 놓습니다. 물품의 모양은 사업장의 아이템 타입 표가 정합니다.',
|
|
34
|
-
en: 'Puts the items the twin observes at this location in the figure\'s places. How an item looks is set by the workspace\'s item type table.'
|
|
34
|
+
en: 'Puts the items the twin observes at this location in the figure\'s places. How an item looks is set by the workspace\'s item type table.',
|
|
35
|
+
ja: 'ツインが観測したこの場所の物品を、図形の積載位置に置きます。物品の形は事業所のアイテムタイプ表が決めます。',
|
|
36
|
+
zh: '把孪生观测到的此位置的物品放到图形的装载位置。物品的外观由工作区的物品类型表决定。',
|
|
37
|
+
es: 'Coloca en los puestos de la figura los artículos que el gemelo observa en esta ubicación. El aspecto de cada artículo lo define la tabla de tipos de artículo del espacio de trabajo.',
|
|
38
|
+
ms: 'Meletakkan item yang diperhatikan oleh kembar di lokasi ini pada tempat muatan figura. Rupa item ditetapkan oleh jadual jenis item ruang kerja.'
|
|
35
39
|
},
|
|
36
40
|
version: '2',
|
|
37
41
|
needs: [
|
|
@@ -41,5 +45,5 @@ export const STORABLE = twinCapability({
|
|
|
41
45
|
moreData: ['items'],
|
|
42
46
|
takesItems: true,
|
|
43
47
|
/* 점유 게이지 — 피규어 아래(상태 배지와 겹치지 않게) */
|
|
44
|
-
cards: [{ id: 'occupancy', anchor: 'bottom', label: { ko: '점유', en: 'Occupancy' } }]
|
|
48
|
+
cards: [{ id: 'occupancy', anchor: 'bottom', label: { ko: '점유', en: 'Occupancy', ja: '占有', zh: '占用', es: 'Ocupación', ms: 'Penghunian' } }]
|
|
45
49
|
});
|
|
@@ -1225,7 +1225,7 @@ var STATE_VALUE_LISTS = {
|
|
|
1225
1225
|
status: EQUIPMENT_STATUS
|
|
1226
1226
|
};
|
|
1227
1227
|
var STATE_FIELD_WORDS = {
|
|
1228
|
-
status: { ko: "\uC6B4\uC601 \uC0C1\uD0DC", en: "Operating status" }
|
|
1228
|
+
status: { ko: "\uC6B4\uC601 \uC0C1\uD0DC", en: "Operating status", ja: "\u904B\u7528\u72B6\u614B", zh: "\u8FD0\u884C\u72B6\u6001", es: "Estado operativo", ms: "Status operasi" }
|
|
1229
1229
|
};
|
|
1230
1230
|
var VALUE_COLOURS = {
|
|
1231
1231
|
busy: "#1a8f4c",
|
|
@@ -1243,17 +1243,51 @@ function legendRowsOf(field) {
|
|
|
1243
1243
|
};
|
|
1244
1244
|
}
|
|
1245
1245
|
|
|
1246
|
+
// src/words.ts
|
|
1247
|
+
var unusedSettingWords = (key) => ({
|
|
1248
|
+
ko: `${key}\uC740(\uB294) \uC774 \uB2A5\uB825\uC5D0\uC11C \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uB294 \uC124\uC815\uC785\uB2C8\uB2E4. \uC0AD\uC81C\uD558\uC138\uC694.`,
|
|
1249
|
+
en: `${key} is not a setting of this capability. Remove it.`,
|
|
1250
|
+
ja: `${key} \u306F\u3053\u306E\u6A5F\u80FD\u3067\u306F\u4F7F\u308F\u306A\u3044\u8A2D\u5B9A\u3067\u3059\u3002\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,
|
|
1251
|
+
zh: `${key} \u4E0D\u662F\u6B64\u80FD\u529B\u4F7F\u7528\u7684\u8BBE\u7F6E\u3002\u8BF7\u5220\u9664\u3002`,
|
|
1252
|
+
es: `${key} no es un ajuste de esta capacidad. Elim\xEDnelo.`,
|
|
1253
|
+
ms: `${key} bukan tetapan keupayaan ini. Padamkannya.`
|
|
1254
|
+
});
|
|
1255
|
+
var noPartWords = (field) => ({
|
|
1256
|
+
ko: `${field.ko}\uC744(\uB97C) \uD45C\uC2DC\uD560 \uBD80\uD488\uC744 \uD558\uB098 \uC774\uC0C1 \uC120\uD0DD\uD558\uC138\uC694.`,
|
|
1257
|
+
en: `Choose at least one part to show ${field.en.toLowerCase()}.`,
|
|
1258
|
+
ja: `${field.ja}\u3092\u8868\u793A\u3059\u308B\u90E8\u54C1\u3092\u4E00\u3064\u4EE5\u4E0A\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002`,
|
|
1259
|
+
zh: `\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u663E\u793A${field.zh}\u7684\u90E8\u4EF6\u3002`,
|
|
1260
|
+
es: `Elija al menos una pieza que muestre ${field.es.toLowerCase()}.`,
|
|
1261
|
+
ms: `Pilih sekurang-kurangnya satu bahagian untuk menunjukkan ${field.ms.toLowerCase()}.`
|
|
1262
|
+
});
|
|
1263
|
+
var missingPartWords = (part) => ({
|
|
1264
|
+
ko: `${part} \uBD80\uD488\uC774 \uC774 \uD53C\uADDC\uC5B4\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4. \uB2E4\uB978 \uBD80\uD488\uC744 \uC120\uD0DD\uD558\uC138\uC694.`,
|
|
1265
|
+
en: `This figure has no part ${part}. Choose another part.`,
|
|
1266
|
+
ja: `\u3053\u306E\u56F3\u5F62\u306B\u90E8\u54C1 ${part} \u306F\u3042\u308A\u307E\u305B\u3093\u3002\u5225\u306E\u90E8\u54C1\u3092\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002`,
|
|
1267
|
+
zh: `\u6B64\u56FE\u5F62\u6CA1\u6709\u90E8\u4EF6 ${part}\u3002\u8BF7\u9009\u62E9\u5176\u4ED6\u90E8\u4EF6\u3002`,
|
|
1268
|
+
es: `Esta figura no tiene la pieza ${part}. Elija otra pieza.`,
|
|
1269
|
+
ms: `Figura ini tiada bahagian ${part}. Pilih bahagian lain.`
|
|
1270
|
+
});
|
|
1271
|
+
var NO_ENTITY_TYPE_WORDS = {
|
|
1272
|
+
ko: "\uC774 \uD53C\uADDC\uC5B4\uAC00 \uB098\uD0C0\uB0B4\uB294 \uC5D4\uD2F0\uD2F0 \uC885\uB958\uB97C \uD558\uB098 \uC774\uC0C1 \uC120\uD0DD\uD558\uC138\uC694.",
|
|
1273
|
+
en: "Choose at least one entity type this figure draws.",
|
|
1274
|
+
ja: "\u3053\u306E\u56F3\u5F62\u304C\u8868\u3059\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u7A2E\u985E\u3092\u4E00\u3064\u4EE5\u4E0A\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002",
|
|
1275
|
+
zh: "\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6B64\u56FE\u5F62\u8868\u793A\u7684\u5B9E\u4F53\u7C7B\u578B\u3002",
|
|
1276
|
+
es: "Elija al menos un tipo de entidad que represente esta figura.",
|
|
1277
|
+
ms: "Pilih sekurang-kurangnya satu jenis entiti yang dilukis oleh figura ini."
|
|
1278
|
+
};
|
|
1279
|
+
|
|
1246
1280
|
// src/generate.ts
|
|
1247
1281
|
var TWIN_ENTITY_NAME = "twin.Entity";
|
|
1248
1282
|
var TWIN_COMMAND_ACTION = "twin.command";
|
|
1249
1283
|
var COMMAND_WORDS = Object.freeze({
|
|
1250
|
-
"resource.hold": { ko: "\uACC4\uD68D \uC815\uC9C0", en: "Plan stop" },
|
|
1251
|
-
"resource.resume": { ko: "\uC7AC\uAC1C", en: "Resume" },
|
|
1252
|
-
"resource.down": { ko: "\uACE0\uC7A5 \uC8FC\uC785", en: "Inject fault" },
|
|
1253
|
-
"resource.repair": { ko: "\uC218\uB9AC", en: "Repair" },
|
|
1254
|
-
"resource.reset-metrics": { ko: "\uC9C0\uD45C \uB9AC\uC14B", en: "Reset metrics" }
|
|
1284
|
+
"resource.hold": { ko: "\uACC4\uD68D \uC815\uC9C0", en: "Plan stop", ja: "\u8A08\u753B\u505C\u6B62", zh: "\u8BA1\u5212\u505C\u673A", es: "Parada planificada", ms: "Henti terancang" },
|
|
1285
|
+
"resource.resume": { ko: "\uC7AC\uAC1C", en: "Resume", ja: "\u518D\u958B", zh: "\u6062\u590D", es: "Reanudar", ms: "Sambung semula" },
|
|
1286
|
+
"resource.down": { ko: "\uACE0\uC7A5 \uC8FC\uC785", en: "Inject fault", ja: "\u6545\u969C\u6CE8\u5165", zh: "\u6CE8\u5165\u6545\u969C", es: "Inyectar fallo", ms: "Suntik kerosakan" },
|
|
1287
|
+
"resource.repair": { ko: "\uC218\uB9AC", en: "Repair", ja: "\u4FEE\u7406", zh: "\u7EF4\u4FEE", es: "Reparar", ms: "Baiki" },
|
|
1288
|
+
"resource.reset-metrics": { ko: "\uC9C0\uD45C \uB9AC\uC14B", en: "Reset metrics", ja: "\u6307\u6A19\u30EA\u30BB\u30C3\u30C8", zh: "\u91CD\u7F6E\u6307\u6807", es: "Reiniciar m\xE9tricas", ms: "Set semula metrik" }
|
|
1255
1289
|
});
|
|
1256
|
-
var commandInteractionsOf = (key) => CAPABILITIES[key].commands.map((command) => ({ meaning: "actions", action: TWIN_COMMAND_ACTION, value: command, label: COMMAND_WORDS[command]
|
|
1290
|
+
var commandInteractionsOf = (key) => CAPABILITIES[key].commands.map((command) => ({ meaning: "actions", action: TWIN_COMMAND_ACTION, value: command, label: COMMAND_WORDS[command] }));
|
|
1257
1291
|
var twinCapabilityName = (key) => `twin.${key[0].toUpperCase()}${key.slice(1)}`;
|
|
1258
1292
|
var legendRoleOf = (field) => `twin-${field}`;
|
|
1259
1293
|
var partsSettingOf = (field) => `${field}Parts`;
|
|
@@ -1267,11 +1301,11 @@ function listedSettingsIssues(key, settings, asset) {
|
|
|
1267
1301
|
const keys = fields.map(partsSettingOf);
|
|
1268
1302
|
const parts = new Set(asset.appearance.map((a) => a.target));
|
|
1269
1303
|
const out = [];
|
|
1270
|
-
for (const k of Object.keys(settings ?? {})) if (!keys.includes(k)) out.push(
|
|
1304
|
+
for (const k of Object.keys(settings ?? {})) if (!keys.includes(k)) out.push(unusedSettingWords(k));
|
|
1271
1305
|
for (const field of fields) {
|
|
1272
1306
|
const chosen = partsOf(settings, field);
|
|
1273
|
-
if (!chosen.length) out.push(
|
|
1274
|
-
for (const part of chosen) if (!parts.has(part)) out.push(
|
|
1307
|
+
if (!chosen.length) out.push(noPartWords(STATE_FIELD_WORDS[field]));
|
|
1308
|
+
for (const part of chosen) if (!parts.has(part)) out.push(missingPartWords(part));
|
|
1275
1309
|
}
|
|
1276
1310
|
return out;
|
|
1277
1311
|
}
|
|
@@ -1279,10 +1313,10 @@ function listedDataInterface(key, settings) {
|
|
|
1279
1313
|
const fields = listedFieldsOf(key).filter((field) => partsOf(settings, field).length);
|
|
1280
1314
|
if (!fields.length) return void 0;
|
|
1281
1315
|
return {
|
|
1282
|
-
schema: fields.map((field) => ({ name: field, label: STATE_FIELD_WORDS[field]
|
|
1316
|
+
schema: fields.map((field) => ({ name: field, label: STATE_FIELD_WORDS[field].ko, kind: "text" })),
|
|
1283
1317
|
bindings: fields.map((field) => ({
|
|
1284
1318
|
id: legendRoleOf(field),
|
|
1285
|
-
label: STATE_FIELD_WORDS[field]
|
|
1319
|
+
label: STATE_FIELD_WORDS[field].ko,
|
|
1286
1320
|
accessor: field,
|
|
1287
1321
|
rule: "table",
|
|
1288
1322
|
lookup: "code",
|
|
@@ -1303,7 +1337,7 @@ function twinCapability(spec) {
|
|
|
1303
1337
|
needs: [TWIN_ENTITY_NAME, ...spec.needs ?? []],
|
|
1304
1338
|
data: [...CAPABILITIES[key].stateFields, ...spec.moreData ?? []].map((name) => ({ name })),
|
|
1305
1339
|
...fields.length ? {
|
|
1306
|
-
settings: fields.map((field) => ({ key: partsSettingOf(field), kind: "parts", label: STATE_FIELD_WORDS[field]
|
|
1340
|
+
settings: fields.map((field) => ({ key: partsSettingOf(field), kind: "parts", label: STATE_FIELD_WORDS[field], required: true })),
|
|
1307
1341
|
check: (settings, asset) => listedSettingsIssues(key, settings, asset),
|
|
1308
1342
|
dataInterface: (settings) => listedDataInterface(key, settings)
|
|
1309
1343
|
} : {},
|
|
@@ -1323,13 +1357,16 @@ var TWIN_ACTIONS = {
|
|
|
1323
1357
|
open: "twin.open-entity",
|
|
1324
1358
|
command: TWIN_COMMAND_ACTION
|
|
1325
1359
|
};
|
|
1360
|
+
var PREVIEW_WORDS = { ko: "\uBBF8\uB9AC\uBCF4\uAE30", en: "Preview", ja: "\u30D7\u30EC\u30D3\u30E5\u30FC", zh: "\u9884\u89C8", es: "Vista previa", ms: "Pratonton" };
|
|
1361
|
+
var INFO_WORDS = { ko: "\uC815\uBCF4", en: "Info", ja: "\u60C5\u5831", zh: "\u4FE1\u606F", es: "Informaci\xF3n", ms: "Maklumat" };
|
|
1362
|
+
var OPEN_WORDS = { ko: "360 \uC5F4\uAE30", en: "Open 360", ja: "360 \u3092\u958B\u304F", zh: "\u6253\u5F00 360", es: "Abrir 360", ms: "Buka 360" };
|
|
1326
1363
|
var TWIN_ENTITY_INTERACTIONS = Object.freeze([
|
|
1327
|
-
{ meaning: "preview", action: TWIN_ACTIONS.preview },
|
|
1328
|
-
{ meaning: "select", action: TWIN_ACTIONS.info },
|
|
1329
|
-
{ meaning: "enter", action: TWIN_ACTIONS.open },
|
|
1364
|
+
{ meaning: "preview", action: TWIN_ACTIONS.preview, label: PREVIEW_WORDS },
|
|
1365
|
+
{ meaning: "select", action: TWIN_ACTIONS.info, label: INFO_WORDS },
|
|
1366
|
+
{ meaning: "enter", action: TWIN_ACTIONS.open, label: OPEN_WORDS },
|
|
1330
1367
|
/* The actions menu (amendment 1 decision 8): these two, then each capability's commands (`commandInteractionsOf`) */
|
|
1331
|
-
{ meaning: "actions", action: TWIN_ACTIONS.info, label:
|
|
1332
|
-
{ meaning: "actions", action: TWIN_ACTIONS.open, label:
|
|
1368
|
+
{ meaning: "actions", action: TWIN_ACTIONS.info, label: INFO_WORDS },
|
|
1369
|
+
{ meaning: "actions", action: TWIN_ACTIONS.open, label: OPEN_WORDS }
|
|
1333
1370
|
]);
|
|
1334
1371
|
var ENTITY_TYPES_SETTING = "types";
|
|
1335
1372
|
function entityTypesOf(settings) {
|
|
@@ -1338,22 +1375,26 @@ function entityTypesOf(settings) {
|
|
|
1338
1375
|
}
|
|
1339
1376
|
function entitySettingsIssues(settings) {
|
|
1340
1377
|
const out = [];
|
|
1341
|
-
for (const key of Object.keys(settings ?? {})) if (key !== ENTITY_TYPES_SETTING) out.push(
|
|
1342
|
-
if (!entityTypesOf(settings).length) out.push(
|
|
1378
|
+
for (const key of Object.keys(settings ?? {})) if (key !== ENTITY_TYPES_SETTING) out.push(unusedSettingWords(key));
|
|
1379
|
+
if (!entityTypesOf(settings).length) out.push(NO_ENTITY_TYPE_WORDS);
|
|
1343
1380
|
return out;
|
|
1344
1381
|
}
|
|
1345
1382
|
var ENTITY = {
|
|
1346
1383
|
name: TWIN_ENTITY_NAME,
|
|
1347
|
-
label: { ko: "\uD2B8\uC708 \uC5D4\uD2F0\uD2F0", en: "Twin entity" },
|
|
1384
|
+
label: { ko: "\uD2B8\uC708 \uC5D4\uD2F0\uD2F0", en: "Twin entity", ja: "\u30C4\u30A4\u30F3\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3", zh: "\u5B6A\u751F\u5B9E\u4F53", es: "Entidad del gemelo", ms: "Entiti kembar" },
|
|
1348
1385
|
note: {
|
|
1349
1386
|
ko: "\uC774 \uD53C\uADDC\uC5B4\uAC00 \uB098\uD0C0\uB0B4\uB294 \uD2B8\uC708 \uC5D4\uD2F0\uD2F0 \uC885\uB958\uB97C \uC815\uD569\uB2C8\uB2E4. \uD2B8\uC708\uC740 \uC774 \uC885\uB958\uC758 \uC5D4\uD2F0\uD2F0\uB97C \uC774 \uD53C\uADDC\uC5B4\uB85C \uADF8\uB9BD\uB2C8\uB2E4. \uC6B4\uC601 \uC0C1\uD0DC \xB7 \uBCF4\uAD00 \xB7 \uC774\uB3D9 \uB2A5\uB825\uC740 \uC774 \uB2A5\uB825 \uC704\uC5D0 \uCF2D\uB2C8\uB2E4.",
|
|
1350
|
-
en: "Sets the twin entity types this figure draws. The twin draws entities of these types with it. Operating status, storage and motion are turned on over this capability."
|
|
1387
|
+
en: "Sets the twin entity types this figure draws. The twin draws entities of these types with it. Operating status, storage and motion are turned on over this capability.",
|
|
1388
|
+
ja: "\u3053\u306E\u56F3\u5F62\u304C\u8868\u3059\u30C4\u30A4\u30F3\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u7A2E\u985E\u3092\u6C7A\u3081\u307E\u3059\u3002\u30C4\u30A4\u30F3\u306F\u3053\u306E\u7A2E\u985E\u306E\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u3092\u3053\u306E\u56F3\u5F62\u3067\u63CF\u304D\u307E\u3059\u3002\u904B\u7528\u72B6\u614B\u30FB\u4FDD\u7BA1\u30FB\u79FB\u52D5\u306E\u6A5F\u80FD\u306F\u3053\u306E\u6A5F\u80FD\u306E\u4E0A\u3067\u30AA\u30F3\u306B\u3057\u307E\u3059\u3002",
|
|
1389
|
+
zh: "\u8BBE\u7F6E\u6B64\u56FE\u5F62\u8868\u793A\u7684\u5B6A\u751F\u5B9E\u4F53\u7C7B\u578B\u3002\u5B6A\u751F\u7528\u6B64\u56FE\u5F62\u7ED8\u5236\u8FD9\u4E9B\u7C7B\u578B\u7684\u5B9E\u4F53\u3002\u8FD0\u884C\u72B6\u6001\u3001\u5B58\u653E\u548C\u79FB\u52A8\u80FD\u529B\u5728\u6B64\u80FD\u529B\u4E4B\u4E0A\u5F00\u542F\u3002",
|
|
1390
|
+
es: "Define los tipos de entidad del gemelo que dibuja esta figura. El gemelo dibuja con ella las entidades de esos tipos. El estado operativo, el almacenamiento y el movimiento se activan sobre esta capacidad.",
|
|
1391
|
+
ms: "Menetapkan jenis entiti kembar yang dilukis oleh figura ini. Kembar melukis entiti jenis tersebut dengan figura ini. Status operasi, simpanan dan pergerakan dihidupkan di atas keupayaan ini."
|
|
1351
1392
|
},
|
|
1352
1393
|
version: "2",
|
|
1353
1394
|
needs: [],
|
|
1354
1395
|
/* The marker the twin sends with every entity's data (headless-twin entity-delta `entity`) */
|
|
1355
1396
|
data: [{ name: "entity" }],
|
|
1356
|
-
settings: [{ key: ENTITY_TYPES_SETTING, kind: "choice", label: { ko: "\uC5D4\uD2F0\uD2F0 \uC885\uB958", en: "Entity types" }, multiple: true, required: true }],
|
|
1397
|
+
settings: [{ key: ENTITY_TYPES_SETTING, kind: "choice", label: { ko: "\uC5D4\uD2F0\uD2F0 \uC885\uB958", en: "Entity types", ja: "\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u306E\u7A2E\u985E", zh: "\u5B9E\u4F53\u7C7B\u578B", es: "Tipos de entidad", ms: "Jenis entiti" }, multiple: true, required: true }],
|
|
1357
1398
|
check: (settings) => entitySettingsIssues(settings),
|
|
1358
1399
|
takes: () => ({}),
|
|
1359
1400
|
/*
|
|
@@ -1366,10 +1407,14 @@ var ENTITY = {
|
|
|
1366
1407
|
// src/mobile.ts
|
|
1367
1408
|
var MOBILE = twinCapability({
|
|
1368
1409
|
key: "mobile",
|
|
1369
|
-
label: { ko: "\uC774\uB3D9", en: "Mobile" },
|
|
1410
|
+
label: { ko: "\uC774\uB3D9", en: "Mobile", ja: "\u79FB\u52D5", zh: "\u79FB\u52A8", es: "Movimiento", ms: "Pergerakan" },
|
|
1370
1411
|
note: {
|
|
1371
1412
|
ko: "\uD2B8\uC708\uC774 \uAD00\uCE21\uD55C \uC704\uCE58\uC640 \uC774\uB3D9\uC73C\uB85C \uD53C\uADDC\uC5B4\uB97C \uC790\uB9AC \uC0AC\uC774\uC5D0\uC11C \uC6C0\uC9C1\uC785\uB2C8\uB2E4. \uD53C\uADDC\uC5B4\uC758 \uC55E\uBA74\uC774 \uC9C4\uD589 \uBC29\uD5A5\uC744 \uD5A5\uD569\uB2C8\uB2E4.",
|
|
1372
|
-
en: "Moves the figure between locations as the twin observes it moving, its front face ahead."
|
|
1413
|
+
en: "Moves the figure between locations as the twin observes it moving, its front face ahead.",
|
|
1414
|
+
ja: "\u30C4\u30A4\u30F3\u304C\u89B3\u6E2C\u3057\u305F\u4F4D\u7F6E\u3068\u79FB\u52D5\u3067\u3001\u56F3\u5F62\u3092\u5834\u6240\u306E\u9593\u3067\u52D5\u304B\u3057\u307E\u3059\u3002\u56F3\u5F62\u306E\u524D\u9762\u304C\u9032\u884C\u65B9\u5411\u3092\u5411\u304D\u307E\u3059\u3002",
|
|
1415
|
+
zh: "\u6309\u5B6A\u751F\u89C2\u6D4B\u5230\u7684\u4F4D\u7F6E\u548C\u79FB\u52A8,\u5728\u4F4D\u7F6E\u4E4B\u95F4\u79FB\u52A8\u56FE\u5F62\u3002\u56FE\u5F62\u7684\u6B63\u9762\u671D\u5411\u524D\u8FDB\u65B9\u5411\u3002",
|
|
1416
|
+
es: "Mueve la figura entre ubicaciones seg\xFAn el gemelo la observa moverse, con su cara frontal por delante.",
|
|
1417
|
+
ms: "Menggerakkan figura antara lokasi seperti yang diperhatikan oleh kembar, dengan muka hadapannya menghala ke arah pergerakan."
|
|
1373
1418
|
},
|
|
1374
1419
|
version: "2"
|
|
1375
1420
|
});
|
|
@@ -1377,23 +1422,31 @@ var MOBILE = twinCapability({
|
|
|
1377
1422
|
// src/operable.ts
|
|
1378
1423
|
var OPERABLE = twinCapability({
|
|
1379
1424
|
key: "operable",
|
|
1380
|
-
label: { ko: "\uC6B4\uC601 \uC0C1\uD0DC", en: "Operable" },
|
|
1425
|
+
label: { ko: "\uC6B4\uC601 \uC0C1\uD0DC", en: "Operable", ja: "\u904B\u7528\u72B6\u614B", zh: "\u8FD0\u884C\u72B6\u6001", es: "Estado operativo", ms: "Status operasi" },
|
|
1381
1426
|
note: {
|
|
1382
1427
|
ko: "\uD2B8\uC708\uC774 \uAD00\uCE21\uD55C \uC124\uBE44 \uC0C1\uD0DC(\uAC00\uB3D9 \xB7 \uC900\uBE44 \xB7 \uACE0\uC7A5 \xB7 \uB300\uAE30 \xB7 \uACC4\uD68D\uC815\uC9C0)\uB97C \uC120\uD0DD\uD55C \uBD80\uD488\uC758 \uC0C9\uC73C\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4. \uC0C9\uC740 \uC124\uBE44 \uC0C1\uD0DC \uBC94\uB840\uB97C \uB530\uB985\uB2C8\uB2E4.",
|
|
1383
|
-
en: "Shows the equipment status the twin observes (busy, setup, down, idle, planned stop) as the colour of the parts you pick, by the equipment status legend."
|
|
1428
|
+
en: "Shows the equipment status the twin observes (busy, setup, down, idle, planned stop) as the colour of the parts you pick, by the equipment status legend.",
|
|
1429
|
+
ja: "\u30C4\u30A4\u30F3\u304C\u89B3\u6E2C\u3057\u305F\u8A2D\u5099\u72B6\u614B(\u7A3C\u50CD\u30FB\u6BB5\u53D6\u308A\u30FB\u6545\u969C\u30FB\u5F85\u6A5F\u30FB\u8A08\u753B\u505C\u6B62)\u3092\u3001\u9078\u3093\u3060\u90E8\u54C1\u306E\u8272\u3067\u8868\u793A\u3057\u307E\u3059\u3002\u8272\u306F\u8A2D\u5099\u72B6\u614B\u306E\u51E1\u4F8B\u306B\u5F93\u3044\u307E\u3059\u3002",
|
|
1430
|
+
zh: "\u7528\u6240\u9009\u90E8\u4EF6\u7684\u989C\u8272\u663E\u793A\u5B6A\u751F\u89C2\u6D4B\u5230\u7684\u8BBE\u5907\u72B6\u6001(\u8FD0\u884C\u3001\u51C6\u5907\u3001\u6545\u969C\u3001\u7A7A\u95F2\u3001\u8BA1\u5212\u505C\u673A)\u3002\u989C\u8272\u9075\u5FAA\u8BBE\u5907\u72B6\u6001\u56FE\u4F8B\u3002",
|
|
1431
|
+
es: "Muestra el estado del equipo que observa el gemelo (en marcha, preparaci\xF3n, averiado, inactivo, parada planificada) con el color de las piezas que elija, seg\xFAn la leyenda de estado del equipo.",
|
|
1432
|
+
ms: "Menunjukkan status peralatan yang diperhatikan oleh kembar (sibuk, persediaan, rosak, melahu, henti terancang) dengan warna bahagian yang anda pilih, mengikut petunjuk status peralatan."
|
|
1384
1433
|
},
|
|
1385
1434
|
version: "3",
|
|
1386
1435
|
/* 설비 상태 배지 — 피규어 위 */
|
|
1387
|
-
cards: [{ id: "status", anchor: "top", label: { ko: "\uC124\uBE44 \uC0C1\uD0DC", en: "Equipment status" } }]
|
|
1436
|
+
cards: [{ id: "status", anchor: "top", label: { ko: "\uC124\uBE44 \uC0C1\uD0DC", en: "Equipment status", ja: "\u8A2D\u5099\u72B6\u614B", zh: "\u8BBE\u5907\u72B6\u6001", es: "Estado del equipo", ms: "Status peralatan" } }]
|
|
1388
1437
|
});
|
|
1389
1438
|
|
|
1390
1439
|
// src/storable.ts
|
|
1391
1440
|
var STORABLE = twinCapability({
|
|
1392
1441
|
key: "storable",
|
|
1393
|
-
label: { ko: "\uBCF4\uAD00", en: "Storable" },
|
|
1442
|
+
label: { ko: "\uBCF4\uAD00", en: "Storable", ja: "\u4FDD\u7BA1", zh: "\u5B58\u653E", es: "Almacenamiento", ms: "Simpanan" },
|
|
1394
1443
|
note: {
|
|
1395
1444
|
ko: "\uD2B8\uC708\uC774 \uAD00\uCE21\uD55C \uC774 \uC790\uB9AC\uC758 \uBB3C\uD488\uC744 \uD53C\uADDC\uC5B4\uC758 \uC801\uC7AC \uC704\uCE58\uC5D0 \uB193\uC2B5\uB2C8\uB2E4. \uBB3C\uD488\uC758 \uBAA8\uC591\uC740 \uC0AC\uC5C5\uC7A5\uC758 \uC544\uC774\uD15C \uD0C0\uC785 \uD45C\uAC00 \uC815\uD569\uB2C8\uB2E4.",
|
|
1396
|
-
en: "Puts the items the twin observes at this location in the figure's places. How an item looks is set by the workspace's item type table."
|
|
1445
|
+
en: "Puts the items the twin observes at this location in the figure's places. How an item looks is set by the workspace's item type table.",
|
|
1446
|
+
ja: "\u30C4\u30A4\u30F3\u304C\u89B3\u6E2C\u3057\u305F\u3053\u306E\u5834\u6240\u306E\u7269\u54C1\u3092\u3001\u56F3\u5F62\u306E\u7A4D\u8F09\u4F4D\u7F6E\u306B\u7F6E\u304D\u307E\u3059\u3002\u7269\u54C1\u306E\u5F62\u306F\u4E8B\u696D\u6240\u306E\u30A2\u30A4\u30C6\u30E0\u30BF\u30A4\u30D7\u8868\u304C\u6C7A\u3081\u307E\u3059\u3002",
|
|
1447
|
+
zh: "\u628A\u5B6A\u751F\u89C2\u6D4B\u5230\u7684\u6B64\u4F4D\u7F6E\u7684\u7269\u54C1\u653E\u5230\u56FE\u5F62\u7684\u88C5\u8F7D\u4F4D\u7F6E\u3002\u7269\u54C1\u7684\u5916\u89C2\u7531\u5DE5\u4F5C\u533A\u7684\u7269\u54C1\u7C7B\u578B\u8868\u51B3\u5B9A\u3002",
|
|
1448
|
+
es: "Coloca en los puestos de la figura los art\xEDculos que el gemelo observa en esta ubicaci\xF3n. El aspecto de cada art\xEDculo lo define la tabla de tipos de art\xEDculo del espacio de trabajo.",
|
|
1449
|
+
ms: "Meletakkan item yang diperhatikan oleh kembar di lokasi ini pada tempat muatan figura. Rupa item ditetapkan oleh jadual jenis item ruang kerja."
|
|
1397
1450
|
},
|
|
1398
1451
|
version: "2",
|
|
1399
1452
|
needs: [
|
|
@@ -1403,13 +1456,13 @@ var STORABLE = twinCapability({
|
|
|
1403
1456
|
moreData: ["items"],
|
|
1404
1457
|
takesItems: true,
|
|
1405
1458
|
/* 점유 게이지 — 피규어 아래(상태 배지와 겹치지 않게) */
|
|
1406
|
-
cards: [{ id: "occupancy", anchor: "bottom", label: { ko: "\uC810\uC720", en: "Occupancy" } }]
|
|
1459
|
+
cards: [{ id: "occupancy", anchor: "bottom", label: { ko: "\uC810\uC720", en: "Occupancy", ja: "\u5360\u6709", zh: "\u5360\u7528", es: "Ocupaci\xF3n", ms: "Penghunian" } }]
|
|
1407
1460
|
});
|
|
1408
1461
|
|
|
1409
1462
|
// src/module.ts
|
|
1410
1463
|
var provider = "twin";
|
|
1411
|
-
var label = { ko: "\uD2B8\uC708", en: "Twin" };
|
|
1412
|
-
var version = "0.5.
|
|
1464
|
+
var label = { ko: "\uD2B8\uC708", en: "Twin", ja: "\u30C4\u30A4\u30F3", zh: "\u5B6A\u751F", es: "Gemelo", ms: "Kembar" };
|
|
1465
|
+
var version = "0.5.3";
|
|
1413
1466
|
var capabilities = [ENTITY, OPERABLE, STORABLE, MOBILE];
|
|
1414
1467
|
export {
|
|
1415
1468
|
capabilities,
|
package/dist/values.js
CHANGED
|
@@ -9,7 +9,7 @@ export const STATE_VALUE_LISTS = {
|
|
|
9
9
|
};
|
|
10
10
|
/** What a state field is called on the modeller's screen. */
|
|
11
11
|
export const STATE_FIELD_WORDS = {
|
|
12
|
-
status: { ko: '운영 상태', en: 'Operating status' }
|
|
12
|
+
status: { ko: '운영 상태', en: 'Operating status', ja: '運用状態', zh: '运行状态', es: 'Estado operativo', ms: 'Status operasi' }
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* The twin's colour for each listed value: the three its 2D cards have drawn (idle grey, busy green, down red), setup
|
package/dist/words.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/** The languages the twin's screens are in; every word this module gives is given in each of them. */
|
|
2
|
+
export declare const TWIN_LANGUAGES: readonly ["ko", "en", "ja", "zh", "es", "ms"];
|
|
3
|
+
export type TwinLanguage = (typeof TWIN_LANGUAGES)[number];
|
|
4
|
+
/** Words a module gives the screen (ADR-0172 decision 7): one per language the twin's screens are in, chosen by the screen. */
|
|
5
|
+
export type Words = Readonly<Record<TwinLanguage, string>>;
|
|
6
|
+
/** A settings key the capability does not use. */
|
|
7
|
+
export declare const unusedSettingWords: (key: string) => Words;
|
|
8
|
+
/** A listed field with no part chosen to show it. */
|
|
9
|
+
export declare const noPartWords: (field: Words) => Words;
|
|
10
|
+
/** A part chosen that the figure does not have. */
|
|
11
|
+
export declare const missingPartWords: (part: string) => Words;
|
|
12
|
+
/** No entity type declared. */
|
|
13
|
+
export declare const NO_ENTITY_TYPE_WORDS: Words;
|
package/dist/words.js
CHANGED
|
@@ -1 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
/** The languages the twin's screens are in; every word this module gives is given in each of them. */
|
|
2
|
+
export const TWIN_LANGUAGES = ['ko', 'en', 'ja', 'zh', 'es', 'ms'];
|
|
3
|
+
/*
|
|
4
|
+
* Why a capability's settings cannot be taken -- the words a modeller reads under the setting. Each takes the names it
|
|
5
|
+
* speaks of as they are written (a settings key, a part name) or as words (a field).
|
|
6
|
+
*/
|
|
7
|
+
/** A settings key the capability does not use. */
|
|
8
|
+
export const unusedSettingWords = (key) => ({
|
|
9
|
+
ko: `${key}은(는) 이 능력에서 사용하지 않는 설정입니다. 삭제하세요.`,
|
|
10
|
+
en: `${key} is not a setting of this capability. Remove it.`,
|
|
11
|
+
ja: `${key} はこの機能では使わない設定です。削除してください。`,
|
|
12
|
+
zh: `${key} 不是此能力使用的设置。请删除。`,
|
|
13
|
+
es: `${key} no es un ajuste de esta capacidad. Elimínelo.`,
|
|
14
|
+
ms: `${key} bukan tetapan keupayaan ini. Padamkannya.`
|
|
15
|
+
});
|
|
16
|
+
/** A listed field with no part chosen to show it. */
|
|
17
|
+
export const noPartWords = (field) => ({
|
|
18
|
+
ko: `${field.ko}을(를) 표시할 부품을 하나 이상 선택하세요.`,
|
|
19
|
+
en: `Choose at least one part to show ${field.en.toLowerCase()}.`,
|
|
20
|
+
ja: `${field.ja}を表示する部品を一つ以上選んでください。`,
|
|
21
|
+
zh: `请至少选择一个显示${field.zh}的部件。`,
|
|
22
|
+
es: `Elija al menos una pieza que muestre ${field.es.toLowerCase()}.`,
|
|
23
|
+
ms: `Pilih sekurang-kurangnya satu bahagian untuk menunjukkan ${field.ms.toLowerCase()}.`
|
|
24
|
+
});
|
|
25
|
+
/** A part chosen that the figure does not have. */
|
|
26
|
+
export const missingPartWords = (part) => ({
|
|
27
|
+
ko: `${part} 부품이 이 피규어에 없습니다. 다른 부품을 선택하세요.`,
|
|
28
|
+
en: `This figure has no part ${part}. Choose another part.`,
|
|
29
|
+
ja: `この図形に部品 ${part} はありません。別の部品を選んでください。`,
|
|
30
|
+
zh: `此图形没有部件 ${part}。请选择其他部件。`,
|
|
31
|
+
es: `Esta figura no tiene la pieza ${part}. Elija otra pieza.`,
|
|
32
|
+
ms: `Figura ini tiada bahagian ${part}. Pilih bahagian lain.`
|
|
33
|
+
});
|
|
34
|
+
/** No entity type declared. */
|
|
35
|
+
export const NO_ENTITY_TYPE_WORDS = {
|
|
36
|
+
ko: '이 피규어가 나타내는 엔티티 종류를 하나 이상 선택하세요.',
|
|
37
|
+
en: 'Choose at least one entity type this figure draws.',
|
|
38
|
+
ja: 'この図形が表すエンティティの種類を一つ以上選んでください。',
|
|
39
|
+
zh: '请至少选择一个此图形表示的实体类型。',
|
|
40
|
+
es: 'Elija al menos un tipo de entidad que represente esta figura.',
|
|
41
|
+
ms: 'Pilih sekurang-kurangnya satu jenis entiti yang dilukis oleh figura ini.'
|
|
42
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@operato/twin-figure-capabilities",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "What the twin puts on a figure (ADR-0208): the descriptors of twin.Operable, twin.Storable and twin.Mobile, their pure functions and the twin's default status table, built from the ops-contract observed states. No scene, DOM or API: the twin app registers them with its mixins, and the build makes the capability module (ADR-0172 decision 3) a figure server loads.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|