@operato/scene-mpi 9.1.1 → 10.0.0-beta.1
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/auto-clicker.d.ts +238 -2
- package/dist/auto-clicker.js +6 -4
- package/dist/auto-clicker.js.map +1 -1
- package/dist/boot-button.d.ts +237 -1
- package/dist/boot-button.js +4 -2
- package/dist/boot-button.js.map +1 -1
- package/dist/gateway.d.ts +2 -2
- package/dist/gateway.js +17 -4
- package/dist/gateway.js.map +1 -1
- package/dist/indicator-user-action.js +3 -3
- package/dist/indicator-user-action.js.map +1 -1
- package/dist/indicator.d.ts +240 -2
- package/dist/indicator.js +26 -25
- package/dist/indicator.js.map +1 -1
- package/dist/reply-button.d.ts +238 -2
- package/dist/reply-button.js +4 -2
- package/dist/reply-button.js.map +1 -1
- package/dist/segment-display.js +25 -12
- package/dist/segment-display.js.map +1 -1
- package/dist/seven-segment.d.ts +238 -2
- package/package.json +13 -13
package/dist/auto-clicker.d.ts
CHANGED
|
@@ -1,5 +1,241 @@
|
|
|
1
|
-
import { ComponentNature, Shape } from '@hatiolab/things-scene';
|
|
2
|
-
declare const AutoClicker_base:
|
|
1
|
+
import { Component, ComponentNature, Shape } from '@hatiolab/things-scene';
|
|
2
|
+
declare const AutoClicker_base: (new (...args: any[]) => {
|
|
3
|
+
contains(x: number, y: number): boolean;
|
|
4
|
+
get path(): {
|
|
5
|
+
x: any;
|
|
6
|
+
y: any;
|
|
7
|
+
}[];
|
|
8
|
+
set path(path: {
|
|
9
|
+
x: any;
|
|
10
|
+
y: any;
|
|
11
|
+
}[]): any;
|
|
12
|
+
get anchors(): {
|
|
13
|
+
name: string;
|
|
14
|
+
position: {
|
|
15
|
+
x: any;
|
|
16
|
+
y: any;
|
|
17
|
+
};
|
|
18
|
+
}[];
|
|
19
|
+
get bounds(): any;
|
|
20
|
+
set bounds(bounds: any): any;
|
|
21
|
+
render(ctx: CanvasRenderingContext2D): void;
|
|
22
|
+
_app: any;
|
|
23
|
+
_model: any;
|
|
24
|
+
_state: any;
|
|
25
|
+
_delta: any;
|
|
26
|
+
_animation: any;
|
|
27
|
+
_animate: any;
|
|
28
|
+
_parent: any;
|
|
29
|
+
_disposed: any;
|
|
30
|
+
_textHidden: any;
|
|
31
|
+
_text_substitutor: any;
|
|
32
|
+
_value_substitutor: any;
|
|
33
|
+
_mappings: any;
|
|
34
|
+
_realObject: import("@hatiolab/things-scene").IRealObject | undefined;
|
|
35
|
+
_cachedState: any;
|
|
36
|
+
updatedAt: any;
|
|
37
|
+
fontSize: any;
|
|
38
|
+
__cache__: any;
|
|
39
|
+
created(): void;
|
|
40
|
+
added(parent: any): void;
|
|
41
|
+
removed(parent: any): void;
|
|
42
|
+
ready(): Promise<void>;
|
|
43
|
+
touch(): void;
|
|
44
|
+
clearCache(...attrs: any[]): void;
|
|
45
|
+
removeSelf(completely: any): void;
|
|
46
|
+
resetAnimation(): void;
|
|
47
|
+
dispose(): void;
|
|
48
|
+
get nature(): import("@hatiolab/things-scene").ComponentNature;
|
|
49
|
+
get disposed(): boolean;
|
|
50
|
+
isLayer(): boolean;
|
|
51
|
+
isGroup(): boolean;
|
|
52
|
+
isContainer(): this is import("@hatiolab/things-scene/dist-types/types/component.js").Container;
|
|
53
|
+
isLine(): boolean;
|
|
54
|
+
isRoot(): boolean;
|
|
55
|
+
isRootModel(): boolean;
|
|
56
|
+
is3dish(): boolean;
|
|
57
|
+
get is3dMode(): boolean;
|
|
58
|
+
isIn3DSpace(): boolean;
|
|
59
|
+
isTemplate(): boolean;
|
|
60
|
+
isHTMLElement(): boolean;
|
|
61
|
+
isConnectable(): boolean;
|
|
62
|
+
isIdentifiable(): boolean;
|
|
63
|
+
isPositionable(): boolean;
|
|
64
|
+
replaceRefids(replaceMap: any): void;
|
|
65
|
+
get(property: any): any;
|
|
66
|
+
set(props: any, propval?: any): any;
|
|
67
|
+
getState(property: any): any;
|
|
68
|
+
setState(props: any, propval?: any): any;
|
|
69
|
+
get model(): any;
|
|
70
|
+
get state(): any;
|
|
71
|
+
get hierarchy(): any;
|
|
72
|
+
get volatile(): never[];
|
|
73
|
+
_applyProps(target: any, props: any, options: any): any;
|
|
74
|
+
move(offset: {
|
|
75
|
+
x: number;
|
|
76
|
+
y: number;
|
|
77
|
+
}, ...args: boolean[]): void;
|
|
78
|
+
symmetryX(x?: number): void;
|
|
79
|
+
symmetryY(y: number): void;
|
|
80
|
+
adjustResize(bounds: import("@hatiolab/things-scene").BOUNDS, origin_bounds: import("@hatiolab/things-scene").BOUNDS, diagonal: boolean): {
|
|
81
|
+
left: any;
|
|
82
|
+
top: any;
|
|
83
|
+
width: any;
|
|
84
|
+
height: any;
|
|
85
|
+
};
|
|
86
|
+
adjustRotation(rotation: number, step: boolean): number;
|
|
87
|
+
outline(progress: number): any;
|
|
88
|
+
get center(): import("@hatiolab/things-scene").POINT;
|
|
89
|
+
set center(p: import("@hatiolab/things-scene").POINT): any;
|
|
90
|
+
get location(): import("@hatiolab/things-scene").POINT;
|
|
91
|
+
set location(l: import("@hatiolab/things-scene").POINT): any;
|
|
92
|
+
get rotate(): import("@hatiolab/things-scene").POINT;
|
|
93
|
+
set rotate(r: import("@hatiolab/things-scene").POINT): any;
|
|
94
|
+
get dimension(): import("@hatiolab/things-scene").DIMENSION;
|
|
95
|
+
set dimension(d: import("@hatiolab/things-scene").DIMENSION): any;
|
|
96
|
+
get drawPath(): import("@hatiolab/things-scene").POINT[];
|
|
97
|
+
get rotatePoint(): import("@hatiolab/things-scene").POINT;
|
|
98
|
+
get mutable(): boolean;
|
|
99
|
+
get resizable(): boolean;
|
|
100
|
+
get rotatable(): boolean;
|
|
101
|
+
buildRealObject(): import("@hatiolab/things-scene").IRealObject | undefined;
|
|
102
|
+
get realObject(): import("@hatiolab/things-scene").IRealObject | undefined;
|
|
103
|
+
draw(context?: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
104
|
+
prerender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
105
|
+
postrender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
106
|
+
prepare(resolve: (component: Component) => void, reject: (reason: any) => void): void;
|
|
107
|
+
prepareIf(condition: boolean): void;
|
|
108
|
+
drawText(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
109
|
+
drawStroke(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
110
|
+
drawFill(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
111
|
+
get strokeStyle(): any;
|
|
112
|
+
set strokeStyle(v: any): any;
|
|
113
|
+
get fillStyle(): any;
|
|
114
|
+
set fillStyle(v: any): any;
|
|
115
|
+
get fontColor(): string;
|
|
116
|
+
set fontColor(v: string): any;
|
|
117
|
+
get rotation(): number;
|
|
118
|
+
set rotation(v: number): any;
|
|
119
|
+
get decorators(): string[];
|
|
120
|
+
get decotag(): string;
|
|
121
|
+
get hidden(): boolean;
|
|
122
|
+
set hidden(v: boolean): any;
|
|
123
|
+
get tag(): string;
|
|
124
|
+
set tag(v: string): any;
|
|
125
|
+
get appendum(): any;
|
|
126
|
+
set appendum(v: any): any;
|
|
127
|
+
defaultTextSubstitutor(): string;
|
|
128
|
+
textLines(context?: import("@hatiolab/things-scene").SceneRenderContext): any[][];
|
|
129
|
+
get font(): string;
|
|
130
|
+
get lineHeight(): number;
|
|
131
|
+
get textSubstitutor(): () => string;
|
|
132
|
+
get text(): string;
|
|
133
|
+
set text(v: string): any;
|
|
134
|
+
get textBounds(): import("@hatiolab/things-scene").BOUNDS;
|
|
135
|
+
get textRotation(): number;
|
|
136
|
+
get textHidden(): boolean;
|
|
137
|
+
set textHidden(v: boolean): any;
|
|
138
|
+
get hasTextProperty(): boolean;
|
|
139
|
+
animate(opts: import("@hatiolab/things-scene").AnimationConfig): any;
|
|
140
|
+
effect(context: import("@hatiolab/things-scene").SceneRenderContext, model: any): void;
|
|
141
|
+
serialize(...others: any[]): string;
|
|
142
|
+
trim(): void;
|
|
143
|
+
closeScene(data: any): void;
|
|
144
|
+
delta(attr?: string | object, value?: any): any;
|
|
145
|
+
invalidate(): void;
|
|
146
|
+
get value(): any;
|
|
147
|
+
set value(v: any): any;
|
|
148
|
+
get data(): any;
|
|
149
|
+
set data(v: any): any;
|
|
150
|
+
set tap(v: any): any;
|
|
151
|
+
get mappings(): any[];
|
|
152
|
+
get retention(): number;
|
|
153
|
+
get animation(): import("@hatiolab/things-scene").AnimationController | undefined;
|
|
154
|
+
get started(): boolean;
|
|
155
|
+
set started(v: boolean): any;
|
|
156
|
+
get controls(): import("@hatiolab/things-scene").Control[] | undefined;
|
|
157
|
+
findFirst(finder: string | ((c: Component) => boolean), ...others: any[]): Component | undefined;
|
|
158
|
+
findAll(s: string | ((c: Component) => boolean), ...others: any[]): any[] | undefined;
|
|
159
|
+
capture(x: number, y: number, except?: (c: Component) => boolean): any;
|
|
160
|
+
findAnchor(name: string): any;
|
|
161
|
+
isDescendible(container: Component): boolean;
|
|
162
|
+
getContext(component?: unknown): any;
|
|
163
|
+
get root(): Component;
|
|
164
|
+
get rootModel(): Component;
|
|
165
|
+
get parent(): Component;
|
|
166
|
+
set parent(v: Component): any;
|
|
167
|
+
get scalable(): boolean;
|
|
168
|
+
get stuck(): boolean;
|
|
169
|
+
get capturable(): boolean;
|
|
170
|
+
get position(): string;
|
|
171
|
+
get origin(): string;
|
|
172
|
+
get offset(): import("@hatiolab/things-scene").POINT;
|
|
173
|
+
get app(): import("@hatiolab/things-scene").ApplicationContext;
|
|
174
|
+
drawEffect(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
175
|
+
prepareFill(resolve: Function, reject: Function): void;
|
|
176
|
+
prepareFillIf(condition: boolean): void;
|
|
177
|
+
onchangeFill(after: Record<string, any>, before: Record<string, any>): void;
|
|
178
|
+
drawImage(context: import("@hatiolab/things-scene").SceneRenderContext, image: HTMLImageElement, left: number, top: number, width: number, height: number): void;
|
|
179
|
+
mutateBounds(logic: ((bounds: import("@hatiolab/things-scene").BOUNDS) => import("@hatiolab/things-scene").BOUNDS | void) | null, context?: any): void;
|
|
180
|
+
mutatePath(beforeLogic: ((path: import("@hatiolab/things-scene").POINT[]) => import("@hatiolab/things-scene").POINT[] | void) | null, afterLogic: ((path: import("@hatiolab/things-scene").POINT[]) => import("@hatiolab/things-scene").POINT[] | void) | null, context?: any): void;
|
|
181
|
+
access(accessor: string): any;
|
|
182
|
+
substitute(template: string, data: any): string | undefined;
|
|
183
|
+
onchangeMappings(after: Record<string, any>, before: Record<string, any>): void;
|
|
184
|
+
onchangeData(after: Record<string, any>, before: Record<string, any>): void;
|
|
185
|
+
buildMappings(): void;
|
|
186
|
+
executeMappings(force?: boolean): void;
|
|
187
|
+
disposeMappings(): void;
|
|
188
|
+
ondropfile(transfered: FileList, files: string[]): void;
|
|
189
|
+
transcoordS2P(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
190
|
+
transcoordP2S(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
191
|
+
transcoordS2T(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
192
|
+
transcoordT2P(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
193
|
+
transcoordT2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
194
|
+
transcoordS2TR(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
195
|
+
transcoordS2O(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
196
|
+
transcoordC2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
197
|
+
transcoordS2C(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
198
|
+
toParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
199
|
+
fromParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
200
|
+
toScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
201
|
+
fromScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
202
|
+
toLocal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
203
|
+
toGlobal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
204
|
+
toOther(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
205
|
+
on(name: string | object, callback: Function, context?: any): any;
|
|
206
|
+
off(name?: string | object, callback?: Function, context?: any): any;
|
|
207
|
+
once(name: string | object, callback: Function, context?: any): any;
|
|
208
|
+
trigger(name: string, ...args: any[]): any;
|
|
209
|
+
delegate_on(delegator: any): any;
|
|
210
|
+
delegate_off(delegator: any): any;
|
|
211
|
+
onchange(after: Record<string, any>, before: Record<string, any>): void;
|
|
212
|
+
calculateBounds?(): void;
|
|
213
|
+
oncreate_element?(element: HTMLElement): void;
|
|
214
|
+
removeComponent(component: Component, ghost?: boolean): void;
|
|
215
|
+
addComponent(component: Component, ghost?: boolean): void;
|
|
216
|
+
insertComponentAt(component: Component, index: number, ghost?: boolean): void;
|
|
217
|
+
getOverlay(component: Component): HTMLElement | undefined;
|
|
218
|
+
findById(id: string): Component | undefined;
|
|
219
|
+
findByRefid(ref: string | number): Component | undefined;
|
|
220
|
+
findAllById(id: string): Component[];
|
|
221
|
+
resize(): void;
|
|
222
|
+
fit(type?: string): void;
|
|
223
|
+
get components(): Component[] | undefined;
|
|
224
|
+
get layout(): any;
|
|
225
|
+
get auxOverlay(): HTMLElement | undefined;
|
|
226
|
+
get isReady(): boolean;
|
|
227
|
+
get unitScale(): number;
|
|
228
|
+
get selected(): Component[];
|
|
229
|
+
set selected(_v: Component[]): any;
|
|
230
|
+
get focused(): Component | null;
|
|
231
|
+
set focused(_v: Component | null): any;
|
|
232
|
+
get hasSameParentForAllSelected(): boolean;
|
|
233
|
+
set hasSameParentForAllSelected(_v: boolean): any;
|
|
234
|
+
get fitMode(): string | undefined;
|
|
235
|
+
set fitMode(_v: string | undefined): any;
|
|
236
|
+
get element(): HTMLElement | null;
|
|
237
|
+
set element(_v: HTMLElement | null): any;
|
|
238
|
+
}) & typeof Shape;
|
|
3
239
|
export default class AutoClicker extends AutoClicker_base {
|
|
4
240
|
autoClicker: any;
|
|
5
241
|
dispose(): void;
|
package/dist/auto-clicker.js
CHANGED
|
@@ -40,6 +40,7 @@ const NATURE = {
|
|
|
40
40
|
help: 'scene/component/auto-clicker'
|
|
41
41
|
};
|
|
42
42
|
let AutoClicker = class AutoClicker extends RectPath(Shape) {
|
|
43
|
+
autoClicker;
|
|
43
44
|
dispose() {
|
|
44
45
|
clearTimeout(this.autoClicker);
|
|
45
46
|
delete this.autoClicker;
|
|
@@ -55,16 +56,17 @@ let AutoClicker = class AutoClicker extends RectPath(Shape) {
|
|
|
55
56
|
onmousedown(e, hint) {
|
|
56
57
|
var autoClicker = () => {
|
|
57
58
|
this.autoClicker = setTimeout(() => {
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
if (target && target.onmousedown) {
|
|
60
|
+
;
|
|
61
|
+
target.onmousedown.call(target, e, hint);
|
|
62
|
+
}
|
|
60
63
|
autoClicker();
|
|
61
64
|
}, interval);
|
|
62
65
|
};
|
|
63
66
|
var pp = { true: true, false: false };
|
|
64
|
-
//@ts-ignore
|
|
65
67
|
var currentSwitchState = pp[this.getState('switch')];
|
|
66
68
|
var interval = this.getState('interval');
|
|
67
|
-
var target = this.root.findById(this.getState('target'));
|
|
69
|
+
var target = this.root.findById?.(this.getState('target'));
|
|
68
70
|
this.setState('switch', !currentSwitchState);
|
|
69
71
|
currentSwitchState = !currentSwitchState;
|
|
70
72
|
this.text = currentSwitchState ? 'ON' : 'OFF';
|
package/dist/auto-clicker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-clicker.js","sourceRoot":"","sources":["../src/auto-clicker.ts"],"names":[],"mappings":";AAAA,OAAO,EAA8B,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACpG,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAEvD,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,OAAO;YACpB,QAAQ,EAAE;gBACR,OAAO,EAAE;oBACP;wBACE,OAAO,EAAE,KAAK;wBACd,KAAK,EAAE,OAAO;qBACf;oBACD;wBACE,OAAO,EAAE,IAAI;wBACb,KAAK,EAAE,MAAM;qBACd;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,EAAE;SAChB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,GAAG;SACjB;KACF;IACD,IAAI,EAAE,8BAA8B;CACrC,CAAA;AAGc,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,QAAQ,CAAC,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"auto-clicker.js","sourceRoot":"","sources":["../src/auto-clicker.ts"],"names":[],"mappings":";AAAA,OAAO,EAA8B,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACpG,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAEvD,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QA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c,CAAC;GACV,WAAW,CAoD/B;eApDoB,WAAW","sourcesContent":["import { Component, ComponentNature, RectPath, Shape, sceneComponent } from '@hatiolab/things-scene'\nimport { consoleLogger } from './gateway-on-message.js'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'select',\n name: 'switch',\n label: 'switch',\n placeholder: 'false',\n property: {\n options: [\n {\n display: 'OFF',\n value: 'false'\n },\n {\n display: 'ON',\n value: 'true'\n }\n ]\n }\n },\n {\n type: 'string',\n name: 'target',\n label: 'target',\n placeholder: ''\n },\n {\n type: 'number',\n name: 'interval',\n label: 'interval',\n placeholder: '0'\n }\n ],\n help: 'scene/component/auto-clicker'\n}\n\n@sceneComponent('auto-clicker')\nexport default class AutoClicker extends RectPath(Shape) {\n autoClicker: any\n\n dispose() {\n clearTimeout(this.autoClicker)\n delete this.autoClicker\n super.dispose()\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n\n context.rect(left, top, width, height)\n\n this.drawFill(context)\n this.drawStroke(context)\n }\n\n onmousedown(e: Event, hint: any) {\n var autoClicker = () => {\n this.autoClicker = setTimeout(() => {\n if (target && (target as any).onmousedown) {\n ;(target as any).onmousedown.call(target, e, hint)\n }\n autoClicker()\n }, interval)\n }\n\n var pp: Record<string, boolean> = { true: true, false: false }\n var currentSwitchState = pp[this.getState('switch')]\n var interval = this.getState('interval')\n var target = this.root.findById?.(this.getState('target'))\n\n this.setState('switch', !currentSwitchState)\n currentSwitchState = !currentSwitchState\n\n this.text = currentSwitchState ? 'ON' : 'OFF'\n this.setState('fontColor', currentSwitchState ? 'rgb(0, 173, 31)' : 'rgb(254, 3, 3)')\n consoleLogger('Auto response:', currentSwitchState)\n\n if (currentSwitchState && target && interval >= 1000) {\n autoClicker()\n } else {\n clearTimeout(this.autoClicker)\n }\n }\n\n get nature() {\n return NATURE\n }\n}\n"]}
|
package/dist/boot-button.d.ts
CHANGED
|
@@ -3,7 +3,243 @@ export declare const buttons: {
|
|
|
3
3
|
icon: string;
|
|
4
4
|
handler: typeof onclickBoot;
|
|
5
5
|
}[];
|
|
6
|
-
declare const BootButton_base:
|
|
6
|
+
declare const BootButton_base: (new (...args: any[]) => {
|
|
7
|
+
contains(x: number, y: number): boolean;
|
|
8
|
+
get path(): {
|
|
9
|
+
x: any;
|
|
10
|
+
y: any;
|
|
11
|
+
}[];
|
|
12
|
+
set path(path: {
|
|
13
|
+
x: any;
|
|
14
|
+
y: any;
|
|
15
|
+
}[]): any;
|
|
16
|
+
get anchors(): {
|
|
17
|
+
name: string;
|
|
18
|
+
position: {
|
|
19
|
+
x: any;
|
|
20
|
+
y: any;
|
|
21
|
+
};
|
|
22
|
+
}[];
|
|
23
|
+
get bounds(): any;
|
|
24
|
+
set bounds(bounds: any): any;
|
|
25
|
+
render(ctx: CanvasRenderingContext2D): void;
|
|
26
|
+
_app: any;
|
|
27
|
+
_model: any;
|
|
28
|
+
_state: any;
|
|
29
|
+
_delta: any;
|
|
30
|
+
_animation: any;
|
|
31
|
+
_animate: any;
|
|
32
|
+
_parent: any;
|
|
33
|
+
_disposed: any;
|
|
34
|
+
_textHidden: any;
|
|
35
|
+
_text_substitutor: any;
|
|
36
|
+
_value_substitutor: any;
|
|
37
|
+
_mappings: any;
|
|
38
|
+
_realObject: import("@hatiolab/things-scene").IRealObject | undefined;
|
|
39
|
+
_cachedState: any;
|
|
40
|
+
updatedAt: any;
|
|
41
|
+
fontSize: any;
|
|
42
|
+
__cache__: any;
|
|
43
|
+
created(): void;
|
|
44
|
+
added(parent: any): void;
|
|
45
|
+
removed(parent: any): void;
|
|
46
|
+
ready(): Promise<void>;
|
|
47
|
+
touch(): void;
|
|
48
|
+
clearCache(...attrs: any[]): void;
|
|
49
|
+
removeSelf(completely: any): void;
|
|
50
|
+
resetAnimation(): void;
|
|
51
|
+
dispose(): void;
|
|
52
|
+
get nature(): import("@hatiolab/things-scene").ComponentNature;
|
|
53
|
+
get disposed(): boolean;
|
|
54
|
+
isLayer(): boolean;
|
|
55
|
+
isGroup(): boolean;
|
|
56
|
+
isContainer(): this is import("@hatiolab/things-scene/dist-types/types/component.js").Container;
|
|
57
|
+
isLine(): boolean;
|
|
58
|
+
isRoot(): boolean;
|
|
59
|
+
isRootModel(): boolean;
|
|
60
|
+
is3dish(): boolean;
|
|
61
|
+
get is3dMode(): boolean;
|
|
62
|
+
isIn3DSpace(): boolean;
|
|
63
|
+
isTemplate(): boolean;
|
|
64
|
+
isHTMLElement(): boolean;
|
|
65
|
+
isConnectable(): boolean;
|
|
66
|
+
isIdentifiable(): boolean;
|
|
67
|
+
isPositionable(): boolean;
|
|
68
|
+
replaceRefids(replaceMap: any): void;
|
|
69
|
+
get(property: any): any;
|
|
70
|
+
set(props: any, propval?: any): any;
|
|
71
|
+
getState(property: any): any;
|
|
72
|
+
setState(props: any, propval?: any): any;
|
|
73
|
+
get model(): any;
|
|
74
|
+
get state(): any;
|
|
75
|
+
get hierarchy(): any;
|
|
76
|
+
get volatile(): never[];
|
|
77
|
+
_applyProps(target: any, props: any, options: any): any;
|
|
78
|
+
move(offset: {
|
|
79
|
+
x: number;
|
|
80
|
+
y: number;
|
|
81
|
+
}, ...args: boolean[]): void;
|
|
82
|
+
symmetryX(x?: number): void;
|
|
83
|
+
symmetryY(y: number): void;
|
|
84
|
+
adjustResize(bounds: import("@hatiolab/things-scene").BOUNDS, origin_bounds: import("@hatiolab/things-scene").BOUNDS, diagonal: boolean): {
|
|
85
|
+
left: any;
|
|
86
|
+
top: any;
|
|
87
|
+
width: any;
|
|
88
|
+
height: any;
|
|
89
|
+
};
|
|
90
|
+
adjustRotation(rotation: number, step: boolean): number;
|
|
91
|
+
outline(progress: number): any;
|
|
92
|
+
get center(): import("@hatiolab/things-scene").POINT;
|
|
93
|
+
set center(p: import("@hatiolab/things-scene").POINT): any;
|
|
94
|
+
get location(): import("@hatiolab/things-scene").POINT;
|
|
95
|
+
set location(l: import("@hatiolab/things-scene").POINT): any;
|
|
96
|
+
get rotate(): import("@hatiolab/things-scene").POINT;
|
|
97
|
+
set rotate(r: import("@hatiolab/things-scene").POINT): any;
|
|
98
|
+
get dimension(): import("@hatiolab/things-scene").DIMENSION;
|
|
99
|
+
set dimension(d: import("@hatiolab/things-scene").DIMENSION): any;
|
|
100
|
+
get drawPath(): import("@hatiolab/things-scene").POINT[];
|
|
101
|
+
get rotatePoint(): import("@hatiolab/things-scene").POINT;
|
|
102
|
+
get mutable(): boolean;
|
|
103
|
+
get resizable(): boolean;
|
|
104
|
+
get rotatable(): boolean;
|
|
105
|
+
buildRealObject(): import("@hatiolab/things-scene").IRealObject | undefined;
|
|
106
|
+
get realObject(): import("@hatiolab/things-scene").IRealObject | undefined;
|
|
107
|
+
draw(context?: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
108
|
+
prerender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
109
|
+
postrender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
110
|
+
prepare(resolve: (component: Component) => void, reject: (reason: any) => void): void;
|
|
111
|
+
prepareIf(condition: boolean): void;
|
|
112
|
+
drawText(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
113
|
+
drawStroke(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
114
|
+
drawFill(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
115
|
+
get strokeStyle(): any;
|
|
116
|
+
set strokeStyle(v: any): any;
|
|
117
|
+
get fillStyle(): any;
|
|
118
|
+
set fillStyle(v: any): any;
|
|
119
|
+
get fontColor(): string;
|
|
120
|
+
set fontColor(v: string): any;
|
|
121
|
+
get rotation(): number;
|
|
122
|
+
set rotation(v: number): any;
|
|
123
|
+
get decorators(): string[];
|
|
124
|
+
get decotag(): string;
|
|
125
|
+
get hidden(): boolean;
|
|
126
|
+
set hidden(v: boolean): any;
|
|
127
|
+
get tag(): string;
|
|
128
|
+
set tag(v: string): any;
|
|
129
|
+
get appendum(): any;
|
|
130
|
+
set appendum(v: any): any;
|
|
131
|
+
defaultTextSubstitutor(): string;
|
|
132
|
+
textLines(context?: import("@hatiolab/things-scene").SceneRenderContext): any[][];
|
|
133
|
+
get font(): string;
|
|
134
|
+
get lineHeight(): number;
|
|
135
|
+
get textSubstitutor(): () => string;
|
|
136
|
+
get text(): string;
|
|
137
|
+
set text(v: string): any;
|
|
138
|
+
get textBounds(): import("@hatiolab/things-scene").BOUNDS;
|
|
139
|
+
get textRotation(): number;
|
|
140
|
+
get textHidden(): boolean;
|
|
141
|
+
set textHidden(v: boolean): any;
|
|
142
|
+
get hasTextProperty(): boolean;
|
|
143
|
+
animate(opts: import("@hatiolab/things-scene").AnimationConfig): any;
|
|
144
|
+
effect(context: import("@hatiolab/things-scene").SceneRenderContext, model: any): void;
|
|
145
|
+
serialize(...others: any[]): string;
|
|
146
|
+
trim(): void;
|
|
147
|
+
closeScene(data: any): void;
|
|
148
|
+
delta(attr?: string | object, value?: any): any;
|
|
149
|
+
invalidate(): void;
|
|
150
|
+
get value(): any;
|
|
151
|
+
set value(v: any): any;
|
|
152
|
+
get data(): any;
|
|
153
|
+
set data(v: any): any;
|
|
154
|
+
set tap(v: any): any;
|
|
155
|
+
get mappings(): any[];
|
|
156
|
+
get retention(): number;
|
|
157
|
+
get animation(): import("@hatiolab/things-scene").AnimationController | undefined;
|
|
158
|
+
get started(): boolean;
|
|
159
|
+
set started(v: boolean): any;
|
|
160
|
+
get controls(): import("@hatiolab/things-scene").Control[] | undefined;
|
|
161
|
+
findFirst(finder: string | ((c: Component) => boolean), ...others: any[]): Component | undefined;
|
|
162
|
+
findAll(s: string | ((c: Component) => boolean), ...others: any[]): any[] | undefined;
|
|
163
|
+
capture(x: number, y: number, except?: (c: Component) => boolean): any;
|
|
164
|
+
findAnchor(name: string): any;
|
|
165
|
+
isDescendible(container: Component): boolean;
|
|
166
|
+
getContext(component?: unknown): any;
|
|
167
|
+
get root(): Component;
|
|
168
|
+
get rootModel(): Component;
|
|
169
|
+
get parent(): Component;
|
|
170
|
+
set parent(v: Component): any;
|
|
171
|
+
get scalable(): boolean;
|
|
172
|
+
get stuck(): boolean;
|
|
173
|
+
get capturable(): boolean;
|
|
174
|
+
get position(): string;
|
|
175
|
+
get origin(): string;
|
|
176
|
+
get offset(): import("@hatiolab/things-scene").POINT;
|
|
177
|
+
get app(): import("@hatiolab/things-scene").ApplicationContext;
|
|
178
|
+
drawEffect(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
179
|
+
prepareFill(resolve: Function, reject: Function): void;
|
|
180
|
+
prepareFillIf(condition: boolean): void;
|
|
181
|
+
onchangeFill(after: Record<string, any>, before: Record<string, any>): void;
|
|
182
|
+
drawImage(context: import("@hatiolab/things-scene").SceneRenderContext, image: HTMLImageElement, left: number, top: number, width: number, height: number): void;
|
|
183
|
+
mutateBounds(logic: ((bounds: import("@hatiolab/things-scene").BOUNDS) => import("@hatiolab/things-scene").BOUNDS | void) | null, context?: any): void;
|
|
184
|
+
mutatePath(beforeLogic: ((path: import("@hatiolab/things-scene").POINT[]) => import("@hatiolab/things-scene").POINT[] | void) | null, afterLogic: ((path: import("@hatiolab/things-scene").POINT[]) => import("@hatiolab/things-scene").POINT[] | void) | null, context?: any): void;
|
|
185
|
+
access(accessor: string): any;
|
|
186
|
+
substitute(template: string, data: any): string | undefined;
|
|
187
|
+
onchangeMappings(after: Record<string, any>, before: Record<string, any>): void;
|
|
188
|
+
onchangeData(after: Record<string, any>, before: Record<string, any>): void;
|
|
189
|
+
buildMappings(): void;
|
|
190
|
+
executeMappings(force?: boolean): void;
|
|
191
|
+
disposeMappings(): void;
|
|
192
|
+
ondropfile(transfered: FileList, files: string[]): void;
|
|
193
|
+
transcoordS2P(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
194
|
+
transcoordP2S(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
195
|
+
transcoordS2T(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
196
|
+
transcoordT2P(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
197
|
+
transcoordT2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
198
|
+
transcoordS2TR(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
199
|
+
transcoordS2O(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
200
|
+
transcoordC2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
201
|
+
transcoordS2C(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
202
|
+
toParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
203
|
+
fromParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
204
|
+
toScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
205
|
+
fromScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
206
|
+
toLocal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
207
|
+
toGlobal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
208
|
+
toOther(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
209
|
+
on(name: string | object, callback: Function, context?: any): any;
|
|
210
|
+
off(name?: string | object, callback?: Function, context?: any): any;
|
|
211
|
+
once(name: string | object, callback: Function, context?: any): any;
|
|
212
|
+
trigger(name: string, ...args: any[]): any;
|
|
213
|
+
delegate_on(delegator: any): any;
|
|
214
|
+
delegate_off(delegator: any): any;
|
|
215
|
+
onchange(after: Record<string, any>, before: Record<string, any>): void;
|
|
216
|
+
calculateBounds?(): void;
|
|
217
|
+
oncreate_element?(element: HTMLElement): void;
|
|
218
|
+
removeComponent(component: Component, ghost?: boolean): void;
|
|
219
|
+
addComponent(component: Component, ghost?: boolean): void;
|
|
220
|
+
insertComponentAt(component: Component, index: number, ghost?: boolean): void;
|
|
221
|
+
getOverlay(component: Component): HTMLElement | undefined;
|
|
222
|
+
findById(id: string): Component | undefined;
|
|
223
|
+
findByRefid(ref: string | number): Component | undefined;
|
|
224
|
+
findAllById(id: string): Component[];
|
|
225
|
+
resize(): void;
|
|
226
|
+
fit(type?: string): void;
|
|
227
|
+
get components(): Component[] | undefined;
|
|
228
|
+
get layout(): any;
|
|
229
|
+
get auxOverlay(): HTMLElement | undefined;
|
|
230
|
+
get isReady(): boolean;
|
|
231
|
+
get unitScale(): number;
|
|
232
|
+
get selected(): Component[];
|
|
233
|
+
set selected(_v: Component[]): any;
|
|
234
|
+
get focused(): Component | null;
|
|
235
|
+
set focused(_v: Component | null): any;
|
|
236
|
+
get hasSameParentForAllSelected(): boolean;
|
|
237
|
+
set hasSameParentForAllSelected(_v: boolean): any;
|
|
238
|
+
get fitMode(): string | undefined;
|
|
239
|
+
set fitMode(_v: string | undefined): any;
|
|
240
|
+
get element(): HTMLElement | null;
|
|
241
|
+
set element(_v: HTMLElement | null): any;
|
|
242
|
+
}) & typeof Shape;
|
|
7
243
|
export default class BootButton extends BootButton_base {
|
|
8
244
|
static _image: HTMLImageElement;
|
|
9
245
|
static get image(): HTMLImageElement;
|
package/dist/boot-button.js
CHANGED
|
@@ -24,7 +24,9 @@ const NATURE = {
|
|
|
24
24
|
],
|
|
25
25
|
help: 'scene/component/boot-button'
|
|
26
26
|
};
|
|
27
|
-
let BootButton =
|
|
27
|
+
let BootButton = class BootButton extends RectPath(Shape) {
|
|
28
|
+
static { BootButton_1 = this; }
|
|
29
|
+
static _image;
|
|
28
30
|
static get image() {
|
|
29
31
|
if (!BootButton_1._image) {
|
|
30
32
|
BootButton_1._image = new Image();
|
|
@@ -34,7 +36,7 @@ let BootButton = BootButton_1 = class BootButton extends RectPath(Shape) {
|
|
|
34
36
|
}
|
|
35
37
|
get publisher() {
|
|
36
38
|
if (this.state.publisher) {
|
|
37
|
-
return this.root.findById(this.state.publisher);
|
|
39
|
+
return this.root.findById?.(this.state.publisher);
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
render(context) {
|
package/dist/boot-button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot-button.js","sourceRoot":"","sources":["../src/boot-button.ts"],"names":[],"mappings":";;AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,6BAA6B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AACzE,OAAO,EAA8B,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEpG,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAEvD,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB;QACE,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,WAAW;KACrB;CACF,CAAA;AAED,MAAM,cAAc,GAAG,EAAE,CAAA;AAEzB,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,WAAW;SACnB;KACF;IACD,IAAI,EAAE,6BAA6B;CACpC,CAAA;AAGc,IAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"boot-button.js","sourceRoot":"","sources":["../src/boot-button.ts"],"names":[],"mappings":";;AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,6BAA6B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AACzE,OAAO,EAA8B,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEpG,OAA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AC;QACzC,wDAAwD;QACxD,sCAAsC;QACtC,YAAY;QAEZ,+CAA+C;QAC/C,oBAAoB;QACpB,MAAM;QACN,MAAM,CAAC,SAAU,CAAC,IAAI,GAAG;YACvB,UAAU,EAAE;gBACV,EAAE,EAAE,IAAI,EAAE;gBACV,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE;gBAChB,OAAO,EAAE,YAAY;gBACrB,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;gBACtB,QAAQ,EAAE,KAAK;aAChB;YACD,IAAI,EAAE;gBACJ,MAAM,EAAE,aAAa;gBACrB,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;aAChB;SACF,CAAA;QAED,aAAa,CAAC,kBAAkB,EAAE,MAAM,CAAC,SAAU,CAAC,IAAI,CAAC,CAAA;IAC3D,CAAC;AACH,CAAC","sourcesContent":["const boot = new URL('../../icons/boot-button.png', import.meta.url).href\nimport { Component, ComponentNature, RectPath, Shape, sceneComponent } from '@hatiolab/things-scene'\n\nimport { uuid } from './uuid.js'\n\nimport { consoleLogger } from './gateway-on-message.js'\n\nexport const buttons = [\n {\n icon: boot,\n handler: onclickBoot\n }\n]\n\nconst BUTTONS_MARGIN = 10\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'string',\n name: 'publisher',\n label: 'publisher'\n }\n ],\n help: 'scene/component/boot-button'\n}\n\n@sceneComponent('boot-button')\nexport default class BootButton extends RectPath(Shape) {\n static _image: HTMLImageElement\n\n static get image() {\n if (!BootButton._image) {\n BootButton._image = new Image()\n BootButton._image.src = boot\n }\n\n return BootButton._image\n }\n\n get publisher() {\n if (this.state.publisher) {\n return this.root.findById?.(this.state.publisher)\n }\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n\n context.rect(left, top, width, height)\n\n this.drawFill(context)\n this.drawStroke(context)\n\n this.drawImage(context, BootButton.image, left, top, width, height)\n }\n\n onmousedown(e: MouseEvent, hint: any) {\n var { left, top, width, height } = this.bounds\n\n var { x, y } = this.transcoordC2S(e.offsetX, e.offsetY)\n\n var button = this.buttonContains(x - left - BUTTONS_MARGIN, y - top - BUTTONS_MARGIN)\n if (button) {\n button.handler(this)\n }\n }\n\n buttonContains(x: number, y: number) {\n return buttons[0]\n }\n\n get nature() {\n return NATURE\n }\n}\n\nfunction onclickBoot(button: BootButton) {\n consoleLogger('onclickBoot')\n if (!button.data) return\n var gateways = button.data\n for (let i = 0; i < gateways.length; i++) {\n // var gatewayObjects = gateways.map((value, index) => {\n // return this.root.findById(value);\n // }, this);\n\n // gatewayObjects.forEach((gateway, index) => {\n // gateway.boot();\n // });\n button.publisher!.data = {\n properties: {\n id: uuid(),\n time: Date.now(),\n dest_id: 'mps_server',\n source_id: gateways[i],\n is_reply: false\n },\n body: {\n action: 'GW_INIT_REQ',\n id: gateways[i]\n }\n }\n\n consoleLogger('sent GW_INIT_REQ', button.publisher!.data)\n }\n}\n"]}
|
package/dist/gateway.d.ts
CHANGED
|
@@ -40,13 +40,13 @@ export default class Gateway extends Container {
|
|
|
40
40
|
get replyPublisher(): Component | undefined;
|
|
41
41
|
get replyGraphQl(): Component | undefined;
|
|
42
42
|
get reqPublisher(): Component | undefined;
|
|
43
|
-
get timer(): Component;
|
|
43
|
+
get timer(): Component | undefined;
|
|
44
44
|
startBlinkingLed(): void;
|
|
45
45
|
stopBlinkingLed(): void;
|
|
46
46
|
startBlinkingLedBar(): void;
|
|
47
47
|
stopBlinkingLedBar(): void;
|
|
48
48
|
boot(): void;
|
|
49
|
-
off():
|
|
49
|
+
off(name?: string | object, callback?: Function, context?: any): this;
|
|
50
50
|
setTimer(timestamp: number): void;
|
|
51
51
|
timerOn(): void;
|
|
52
52
|
timerOff(): void;
|
package/dist/gateway.js
CHANGED
|
@@ -76,7 +76,17 @@ const NATURE = {
|
|
|
76
76
|
],
|
|
77
77
|
help: 'scene/component/gateway'
|
|
78
78
|
};
|
|
79
|
-
let Gateway =
|
|
79
|
+
let Gateway = class Gateway extends Container {
|
|
80
|
+
static { Gateway_1 = this; }
|
|
81
|
+
static _image;
|
|
82
|
+
static _buttonImages = [];
|
|
83
|
+
timeflow;
|
|
84
|
+
ledBlinker;
|
|
85
|
+
ledBarBlinker;
|
|
86
|
+
_focusedButton;
|
|
87
|
+
version;
|
|
88
|
+
publisher;
|
|
89
|
+
time;
|
|
80
90
|
static get image() {
|
|
81
91
|
if (!Gateway_1._image) {
|
|
82
92
|
Gateway_1._image = new Image();
|
|
@@ -312,9 +322,12 @@ let Gateway = Gateway_1 = class Gateway extends Container {
|
|
|
312
322
|
}
|
|
313
323
|
consoleLogger('sent GW_INIT_REQ', publisher.data);
|
|
314
324
|
}
|
|
315
|
-
off() {
|
|
325
|
+
off(name, callback, context) {
|
|
326
|
+
if (name !== undefined) {
|
|
327
|
+
return super.off(name, callback, context);
|
|
328
|
+
}
|
|
316
329
|
if (this.state.power_flag == 'false')
|
|
317
|
-
return;
|
|
330
|
+
return this;
|
|
318
331
|
this.timerOff();
|
|
319
332
|
this.stopBlinkingLed();
|
|
320
333
|
this.stopBlinkingLedBar();
|
|
@@ -326,6 +339,7 @@ let Gateway = Gateway_1 = class Gateway extends Container {
|
|
|
326
339
|
indicator.lightOff();
|
|
327
340
|
});
|
|
328
341
|
consoleLogger('turned off ' + this.model.id);
|
|
342
|
+
return this;
|
|
329
343
|
}
|
|
330
344
|
setTimer(timestamp) {
|
|
331
345
|
if (!this.timer)
|
|
@@ -393,7 +407,6 @@ let Gateway = Gateway_1 = class Gateway extends Container {
|
|
|
393
407
|
return NATURE;
|
|
394
408
|
}
|
|
395
409
|
};
|
|
396
|
-
Gateway._buttonImages = [];
|
|
397
410
|
Gateway = Gateway_1 = __decorate([
|
|
398
411
|
sceneComponent('gateway')
|
|
399
412
|
], Gateway);
|