@operato/scene-visualizer 1.2.16 → 1.2.18
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/CHANGELOG.md +18 -0
- package/db.sqlite +0 -0
- package/dist/threed/real-object-sprite-2d.d.ts +4 -0
- package/dist/threed/real-object-sprite-2d.js +13 -1
- package/dist/threed/real-object-sprite-2d.js.map +1 -1
- package/dist/visualizer.js +44 -48
- package/dist/visualizer.js.map +1 -1
- package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +6 -16
- package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +10 -5
- package/logs/application-2023-03-12-00.log +6 -0
- package/logs/application-2023-03-12-01.log +6 -0
- package/logs/connections-2023-03-12-00.log +35 -0
- package/logs/connections-2023-03-12-01.log +35 -0
- package/package.json +2 -2
- package/src/threed/real-object-sprite-2d.ts +17 -1
- package/src/visualizer.ts +46 -51
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/button.d.ts +0 -10
- package/dist/button.js +0 -30
- package/dist/button.js.map +0 -1
- package/dist/templates/button.d.ts +0 -20
- package/dist/templates/button.js +0 -21
- package/dist/templates/button.js.map +0 -1
- package/logs/application-2023-03-08-00.log +0 -6
- package/logs/application-2023-03-09-18.log +0 -12
- package/logs/application-2023-03-09-21.log +0 -1
- package/logs/application-2023-03-09-22.log +0 -2
- package/logs/connections-2023-02-23-21.log +0 -35
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
### [1.2.18](https://github.com/things-scene/operato-scene/compare/v1.2.17...v1.2.18) (2023-03-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* support data binding for real-object-sprite-2d ([797ed0b](https://github.com/things-scene/operato-scene/commit/797ed0b6589e2d23c2dc072be9ca4a9b39b0b43e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### [1.2.17](https://github.com/things-scene/operato-scene/compare/v1.2.16...v1.2.17) (2023-03-11)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### :bug: Bug Fix
|
|
19
|
+
|
|
20
|
+
* visualizer stock data handling ([1582551](https://github.com/things-scene/operato-scene/commit/1582551f271b32663efb1489b316ac752059f9d6))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
### [1.2.16](https://github.com/things-scene/operato-scene/compare/v1.2.15...v1.2.16) (2023-03-09)
|
|
7
25
|
|
|
8
26
|
|
package/db.sqlite
CHANGED
|
Binary file
|
|
@@ -16,7 +16,7 @@ export class RealObjectSprite2D extends RealObjectSprite {
|
|
|
16
16
|
z: scale
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
update() {
|
|
20
20
|
var material = this.object3d.material;
|
|
21
21
|
if (material) {
|
|
22
22
|
material.dispose();
|
|
@@ -27,5 +27,17 @@ export class RealObjectSprite2D extends RealObjectSprite {
|
|
|
27
27
|
});
|
|
28
28
|
this.object3d.material.sizeAttenuation = false;
|
|
29
29
|
}
|
|
30
|
+
updateFillStyle() {
|
|
31
|
+
this.update();
|
|
32
|
+
}
|
|
33
|
+
updateStrokeStyle() {
|
|
34
|
+
this.update();
|
|
35
|
+
}
|
|
36
|
+
updateAlpha() {
|
|
37
|
+
this.update();
|
|
38
|
+
}
|
|
39
|
+
updateText() {
|
|
40
|
+
this.update();
|
|
41
|
+
}
|
|
30
42
|
}
|
|
31
43
|
//# sourceMappingURL=real-object-sprite-2d.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"real-object-sprite-2d.js","sourceRoot":"","sources":["../../src/threed/real-object-sprite-2d.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,C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AE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;QAE1C,OAAO;YACL,CAAC,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,WAAW;YAChC,CAAC,EAAE,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,YAAY;YAClC,CAAC,EAAE,KAAK;SACT,CAAA;IACH,CAAC;IAED,MAAM;QACJ,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAgC,CAAA;QAC7D,IAAI,QAAQ,EAAE;YACZ,QAAQ,CAAC,OAAO,EAAE,CAAA;SACnB;QAED,IAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,KAAK,CAAC,cAAc,CAAC;YAChD,GAAG,EAAE,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC;YACxC,SAAS,EAAE,GAAG;SACf,CAAC,CAAA;QAEF,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,eAAe,GAAG,KAAK,CAAA;IAChD,CAAC;IAED,eAAe;QACb,IAAI,CAAC,MAAM,EAAE,CAAA;IACf,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,MAAM,EAAE,CAAA;IACf,CAAC;IAED,WAAW;QACT,IAAI,CAAC,MAAM,EAAE,CAAA;IACf,CAAC;IAED,UAAU;QACR,IAAI,CAAC,MAAM,EAAE,CAAA;IACf,CAAC;CACF","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport * as THREE from 'three'\nimport { RealObjectSprite } from './real-object-sprite'\nimport { createCanvasTexture } from './texture/canvas-texture'\n\nexport class RealObjectSprite2D extends RealObjectSprite {\n buildMaterial() {}\n\n get scale() {\n const { width, height } = this.component.bounds\n const { width: parentWidth, height: parentHeight } = this.threeContainer!.bounds\n const { scale = 1 } = this.component.state\n\n return {\n x: (scale * width) / parentWidth,\n y: (scale * height) / parentHeight,\n z: scale\n }\n }\n\n update() {\n var material = this.object3d.material as THREE.SpriteMaterial\n if (material) {\n material.dispose()\n }\n\n this.object3d.material = new THREE.SpriteMaterial({\n map: createCanvasTexture(this.component),\n alphaTest: 0.1\n })\n\n this.object3d.material.sizeAttenuation = false\n }\n\n updateFillStyle() {\n this.update()\n }\n\n updateStrokeStyle() {\n this.update()\n }\n\n updateAlpha() {\n this.update()\n }\n\n updateText() {\n this.update()\n }\n}\n"]}
|
package/dist/visualizer.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { Component, ScenePopup } from '@hatiolab/things-scene';
|
|
5
5
|
import './three-layout';
|
|
6
6
|
import { ThreeContainer } from './three-container';
|
|
7
|
+
import { Stock } from './stock';
|
|
7
8
|
const NATURE = {
|
|
8
9
|
mutable: false,
|
|
9
10
|
resizable: true,
|
|
@@ -193,57 +194,52 @@ export class Visualizer extends ThreeContainer {
|
|
|
193
194
|
super.onchange(after, before);
|
|
194
195
|
}
|
|
195
196
|
onchangeData() {
|
|
196
|
-
|
|
197
|
+
if (typeof this.data !== 'object') {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
197
200
|
var data = this.data;
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Array type data
|
|
202
|
-
* (e.g. data: [{
|
|
203
|
-
* 'loc' : 'location1',
|
|
204
|
-
* 'description': 'description1'
|
|
205
|
-
* },
|
|
206
|
-
* ...
|
|
207
|
-
* ])
|
|
208
|
-
*/
|
|
209
|
-
data = data.reduce((acc, value, i, arr) => {
|
|
210
|
-
var val = JSON.parse(JSON.stringify(value));
|
|
211
|
-
var id = locationField;
|
|
212
|
-
if (!val[id]) {
|
|
213
|
-
// Rack 데이터가 아니면
|
|
214
|
-
id = 'id';
|
|
215
|
-
}
|
|
216
|
-
// 하나의 로케이션에 여러 레코드 정보가 올 수 있으므로, 하나이 로케이션의 스탁정보를 items 배열에 담는다.
|
|
217
|
-
if (acc[value[id]]) {
|
|
218
|
-
if (!acc[value[id]]['items']) {
|
|
219
|
-
var clone = JSON.parse(JSON.stringify(acc[value[id]]));
|
|
220
|
-
acc[value[id]] = { items: [] };
|
|
221
|
-
acc[value[id]]['items'].push(clone);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
acc[value[id]] = { items: [] };
|
|
226
|
-
}
|
|
227
|
-
acc[value[id]]['items'].push(val);
|
|
228
|
-
return acc;
|
|
229
|
-
}, {});
|
|
230
|
-
}
|
|
201
|
+
var locationField = this.getState('locationField') || 'location';
|
|
202
|
+
if (data instanceof Array) {
|
|
231
203
|
/**
|
|
232
|
-
*
|
|
233
|
-
* (e.g. data: {
|
|
234
|
-
* '
|
|
204
|
+
* Array type data
|
|
205
|
+
* (e.g. data: [{
|
|
206
|
+
* 'location' : 'A0101-01',
|
|
207
|
+
* 'description': 'description1',
|
|
235
208
|
* ...
|
|
236
|
-
* }
|
|
209
|
+
* }, {
|
|
210
|
+
* ...
|
|
211
|
+
* }])
|
|
237
212
|
*/
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
if (
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
213
|
+
data = data.reduce((acc, value, i, arr) => {
|
|
214
|
+
var location = value[locationField];
|
|
215
|
+
if (!location) {
|
|
216
|
+
return acc;
|
|
217
|
+
}
|
|
218
|
+
// 하나의 로케이션에 여러 레코드 정보가 올 수 있으므로, 하나이 로케이션의 스탁정보를 items 배열에 담는다.
|
|
219
|
+
if (acc[location]) {
|
|
220
|
+
acc[location]['items'].push(value);
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
acc[location] = { items: [value] };
|
|
224
|
+
}
|
|
225
|
+
return acc;
|
|
226
|
+
}, {});
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Object type data
|
|
230
|
+
* (e.g. data: {
|
|
231
|
+
* 'A0101-01': { items: [{ location: 'A0101-01', qty: 10, description: 'description', ... }, {...}] },
|
|
232
|
+
* ...
|
|
233
|
+
* })
|
|
234
|
+
*/
|
|
235
|
+
for (var key in data) {
|
|
236
|
+
let id = key;
|
|
237
|
+
if (data.hasOwnProperty(id)) {
|
|
238
|
+
let d = data[id];
|
|
239
|
+
let object = this.getObject(id);
|
|
240
|
+
if (object) {
|
|
241
|
+
;
|
|
242
|
+
object.onchangeStockData(d);
|
|
247
243
|
}
|
|
248
244
|
}
|
|
249
245
|
}
|
|
@@ -267,7 +263,7 @@ export class Visualizer extends ThreeContainer {
|
|
|
267
263
|
var object = this.getObjectByRaycast();
|
|
268
264
|
var realObject = object === null || object === void 0 ? void 0 : object.userData.context;
|
|
269
265
|
if (realObject) {
|
|
270
|
-
if (ref && realObject
|
|
266
|
+
if (ref && realObject instanceof Stock) {
|
|
271
267
|
;
|
|
272
268
|
realObject.onmouseup(e, this, (data) => {
|
|
273
269
|
ScenePopup.show(this, ref, {
|
package/dist/visualizer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visualizer.js","sourceRoot":"","sources":["../src/visualizer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAA+B,MAAM,wBAAwB,CAAA;AAI3F,OAAO,gBAAgB,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAGlD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,KAAK;SAChB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,MAAM;SACjB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,KAAK;SAChB;QACD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AAC,CAAC,CAAA;aAC1C;iBAAM;gBACL,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;aAC3B;YAED,IAAI,CAAC,UAAU,EAAE,CAAA;YAEjB,CAAC,CAAC,eAAe,EAAE,CAAA;SACpB;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { Component, ScenePopup, Properties, ComponentNature } from '@hatiolab/things-scene'\nimport * as THREE from 'three'\n\nimport { RealObject } from './threed/real-object'\nimport './three-layout'\nimport { ThreeContainer } from './three-container'\nimport { Stock } from './stock'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'number',\n label: 'fov',\n name: 'fov',\n property: 'fov'\n },\n {\n type: 'number',\n label: 'near',\n name: 'near',\n property: 'near'\n },\n {\n type: 'number',\n label: 'far',\n name: 'far',\n property: 'far'\n },\n {\n type: 'number',\n label: 'zoom',\n name: 'zoom',\n property: 'zoom'\n },\n {\n type: 'number',\n label: 'camera-x',\n name: 'cameraX'\n },\n {\n type: 'number',\n label: 'camera-y',\n name: 'cameraY'\n },\n {\n type: 'number',\n label: 'camera-z',\n name: 'cameraZ'\n },\n {\n type: 'select',\n label: 'precision',\n name: 'precision',\n property: {\n options: [\n {\n display: 'High',\n value: 'highp'\n },\n {\n display: 'Medium',\n value: 'mediump'\n },\n {\n display: 'Low',\n value: 'lowp'\n }\n ]\n }\n },\n {\n type: 'checkbox',\n label: 'anti-alias',\n name: 'antialias',\n property: 'antialias'\n },\n {\n type: 'checkbox',\n label: 'auto-rotate',\n name: 'autoRotate',\n property: 'autoRotate'\n },\n {\n type: 'checkbox',\n label: 'show-axis',\n name: 'showAxis',\n property: 'showAxis'\n },\n {\n type: 'checkbox',\n label: '3dmode',\n name: 'threed',\n property: 'threed'\n },\n {\n type: 'checkbox',\n label: 'debug',\n name: 'debug',\n property: 'debug'\n },\n {\n type: 'string',\n label: 'location-field',\n name: 'locationField',\n placeHolder: 'location'\n },\n {\n type: 'board-selector',\n label: 'popup-scene',\n name: 'popupScene'\n },\n {\n type: 'id-input',\n label: 'legend-target',\n name: 'legendTarget',\n property: {\n component: 'legend'\n }\n },\n {\n type: 'number',\n label: 'rotation-speed',\n name: 'rotationSpeed'\n },\n {\n type: 'checkbox',\n label: 'hide-empty-stock',\n name: 'hideEmptyStock'\n },\n {\n type: 'select',\n label: 'popup-position',\n name: 'popupPosition',\n property: {\n options: [\n { display: '', value: '' },\n { display: 'CENTER', value: 'center' },\n { display: 'LEFTTOP', value: 'left-top' },\n { display: 'RIGHTTOP', value: 'right-top' },\n { display: 'LEFTBOTTOM', value: 'left-bottom' },\n { display: 'RIGHTBOTTOM', value: 'right-bottom' }\n ]\n }\n }\n ],\n help: 'scene/component/visualizer'\n}\n\nconst WEBGL_NO_SUPPORT_TEXT = 'WebGL no support'\n\nexport class Visualizer extends ThreeContainer {\n _legendTarget?: Component\n\n _objects: { [id: string]: RealObject } = {}\n\n _stock_materials: THREE.Material[] = []\n _default_material?: THREE.Material /* only for Stock */\n _empty_material?: THREE.Material /* only for Stock */\n\n get legendTarget() {\n var { legendTarget } = this.state\n\n if (!this._legendTarget && legendTarget) {\n this._legendTarget = this.root.findById(legendTarget)\n this._legendTarget && this._legendTarget.on('change', this.onLegendTargetChanged, this)\n }\n\n return this._legendTarget\n }\n\n putObject(id: string, object: RealObject) {\n id && (this._objects[id] = object)\n }\n\n getObject(id: string): RealObject {\n return this._objects[id]\n }\n\n /* Container Overides .. */\n\n dispose() {\n this._legendTarget && this._legendTarget.off('change', this.onLegendTargetChanged, this)\n delete this._legendTarget\n\n super.dispose()\n }\n\n get nature(): ComponentNature {\n return NATURE\n }\n\n resetMaterials() {\n this._stock_materials.forEach(m => {\n if (m.dispose) m.dispose()\n })\n\n this._stock_materials = []\n }\n\n /* Event Handlers */\n\n onchange(after: Properties, before: Properties) {\n if (before.hasOwnProperty('legendTarget') || after.hasOwnProperty('legendTarget')) {\n this._legendTarget && this._legendTarget.off('change', this.onLegendTargetChanged, this)\n delete this._legendTarget\n this.resetMaterials()\n }\n\n super.onchange(after, before)\n }\n\n onchangeData(): void {\n var locationField = this.getState('locationField') || 'location'\n var data = this.data\n\n if (data) {\n if (data instanceof Array) {\n /**\n * Array type data\n * (e.g. data: [{\n * 'loc' : 'location1',\n * 'description': 'description1'\n * },\n * ...\n * ])\n */\n\n data = data.reduce((acc, value, i, arr) => {\n var val = JSON.parse(JSON.stringify(value))\n var id = locationField\n\n if (!val[id]) {\n // Rack 데이터가 아니면\n id = 'id'\n }\n\n // 하나의 로케이션에 여러 레코드 정보가 올 수 있으므로, 하나이 로케이션의 스탁정보를 items 배열에 담는다.\n if (acc[value[id]]) {\n if (!acc[value[id]]['items']) {\n var clone = JSON.parse(JSON.stringify(acc[value[id]]))\n acc[value[id]] = { items: [] }\n acc[value[id]]['items'].push(clone)\n }\n } else {\n acc[value[id]] = { items: [] }\n }\n\n acc[value[id]]['items'].push(val)\n\n return acc\n }, {})\n }\n\n /**\n * Object type data\n * (e.g. data: {\n * 'location1': { items: [{ qty: 10, description: 'description', ... }, ...] },\n * ...\n * })\n */\n for (var key in data) {\n let id = key\n if (data.hasOwnProperty(id)) {\n let d = data[id]\n let object = this.getObject(id)\n if (object) {\n ;(object as Stock).onchangeStockData(d)\n }\n }\n }\n }\n }\n\n onLegendTargetChanged(after: { [key: string]: any }, before: { [key: string]: any }) {\n if (after.hasOwnProperty('status') && before.hasOwnProperty('status')) this.resetMaterials()\n }\n\n onmouseup(e: MouseEvent) {\n if (this._controls) {\n if (this._lastFocused) {\n ;(this._lastFocused as any)._focused = false\n }\n\n const { popupScene, left, top, width, height } = this.state\n\n var ref = popupScene\n var pointer = this.transcoordC2S(e.offsetX, e.offsetY)\n\n this._mouse!.x = ((pointer.x - left) / width) * 2 - 1\n this._mouse!.y = -((pointer.y - top) / height) * 2 + 1\n\n var object = this.getObjectByRaycast()\n var realObject = object?.userData.context\n\n if (realObject) {\n if (ref && (realObject as any).onmouseup) {\n ;(realObject as any).onmouseup(e, this, (data: any) => {\n ScenePopup.show(this, ref, {\n data,\n modal: false,\n closable: true,\n output: false,\n location: this.state.popupPosition || 'right-top'\n })\n })\n }\n\n ;(realObject as any)._focused = true\n ;(realObject as any)._focusedAt = performance.now()\n this._lastFocused = realObject\n realObject.component?.trigger('click', e)\n } else {\n ScenePopup.hide(this.root)\n }\n\n this.invalidate()\n\n e.stopPropagation()\n }\n }\n}\n\nComponent.register('visualizer', Visualizer)\n"]}
|
|
1
|
+
{"version":3,"file":"visualizer.js","sourceRoot":"","sources":["../src/visualizer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAA+B,MAAM,wBAAwB,CAAA;AAI3F,OAAO,gBAAgB,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,KAAK;SAChB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,MAAM;SACjB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,KAAK;SAChB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,MAAM;SACjB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAA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AAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,IAAS,EAAE,EAAE;wBACpD,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE;4BACzB,IAAI;4BACJ,KAAK,EAAE,KAAK;4BACZ,QAAQ,EAAE,IAAI;4BACd,MAAM,EAAE,KAAK;4BACb,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,WAAW;yBAClD,CAAC,CAAA;oBACJ,CAAC,CAAC,CAAA;iBACH;gBAED,CAAC;gBAAC,UAAkB,CAAC,QAAQ,GAAG,IAAI,CACnC;gBAAC,UAAkB,CAAC,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAA;gBACnD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAA;gBAC9B,MAAA,UAAU,CAAC,SAAS,0CAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;aAC1C;iBAAM;gBACL,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;aAC3B;YAED,IAAI,CAAC,UAAU,EAAE,CAAA;YAEjB,CAAC,CAAC,eAAe,EAAE,CAAA;SACpB;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { Component, ScenePopup, Properties, ComponentNature } from '@hatiolab/things-scene'\nimport * as THREE from 'three'\n\nimport { RealObject } from './threed/real-object'\nimport './three-layout'\nimport { ThreeContainer } from './three-container'\nimport { Stock } from './stock'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'number',\n label: 'fov',\n name: 'fov',\n property: 'fov'\n },\n {\n type: 'number',\n label: 'near',\n name: 'near',\n property: 'near'\n },\n {\n type: 'number',\n label: 'far',\n name: 'far',\n property: 'far'\n },\n {\n type: 'number',\n label: 'zoom',\n name: 'zoom',\n property: 'zoom'\n },\n {\n type: 'number',\n label: 'camera-x',\n name: 'cameraX'\n },\n {\n type: 'number',\n label: 'camera-y',\n name: 'cameraY'\n },\n {\n type: 'number',\n label: 'camera-z',\n name: 'cameraZ'\n },\n {\n type: 'select',\n label: 'precision',\n name: 'precision',\n property: {\n options: [\n {\n display: 'High',\n value: 'highp'\n },\n {\n display: 'Medium',\n value: 'mediump'\n },\n {\n display: 'Low',\n value: 'lowp'\n }\n ]\n }\n },\n {\n type: 'checkbox',\n label: 'anti-alias',\n name: 'antialias',\n property: 'antialias'\n },\n {\n type: 'checkbox',\n label: 'auto-rotate',\n name: 'autoRotate',\n property: 'autoRotate'\n },\n {\n type: 'checkbox',\n label: 'show-axis',\n name: 'showAxis',\n property: 'showAxis'\n },\n {\n type: 'checkbox',\n label: '3dmode',\n name: 'threed',\n property: 'threed'\n },\n {\n type: 'checkbox',\n label: 'debug',\n name: 'debug',\n property: 'debug'\n },\n {\n type: 'string',\n label: 'location-field',\n name: 'locationField',\n placeHolder: 'location'\n },\n {\n type: 'board-selector',\n label: 'popup-scene',\n name: 'popupScene'\n },\n {\n type: 'id-input',\n label: 'legend-target',\n name: 'legendTarget',\n property: {\n component: 'legend'\n }\n },\n {\n type: 'number',\n label: 'rotation-speed',\n name: 'rotationSpeed'\n },\n {\n type: 'checkbox',\n label: 'hide-empty-stock',\n name: 'hideEmptyStock'\n },\n {\n type: 'select',\n label: 'popup-position',\n name: 'popupPosition',\n property: {\n options: [\n { display: '', value: '' },\n { display: 'CENTER', value: 'center' },\n { display: 'LEFTTOP', value: 'left-top' },\n { display: 'RIGHTTOP', value: 'right-top' },\n { display: 'LEFTBOTTOM', value: 'left-bottom' },\n { display: 'RIGHTBOTTOM', value: 'right-bottom' }\n ]\n }\n }\n ],\n help: 'scene/component/visualizer'\n}\n\nconst WEBGL_NO_SUPPORT_TEXT = 'WebGL no support'\n\nexport class Visualizer extends ThreeContainer {\n _legendTarget?: Component\n\n _objects: { [id: string]: RealObject } = {}\n\n _stock_materials: THREE.Material[] = []\n _default_material?: THREE.Material /* only for Stock */\n _empty_material?: THREE.Material /* only for Stock */\n\n get legendTarget() {\n var { legendTarget } = this.state\n\n if (!this._legendTarget && legendTarget) {\n this._legendTarget = this.root.findById(legendTarget)\n this._legendTarget && this._legendTarget.on('change', this.onLegendTargetChanged, this)\n }\n\n return this._legendTarget\n }\n\n putObject(id: string, object: RealObject) {\n id && (this._objects[id] = object)\n }\n\n getObject(id: string): RealObject {\n return this._objects[id]\n }\n\n /* Container Overides .. */\n\n dispose() {\n this._legendTarget && this._legendTarget.off('change', this.onLegendTargetChanged, this)\n delete this._legendTarget\n\n super.dispose()\n }\n\n get nature(): ComponentNature {\n return NATURE\n }\n\n resetMaterials() {\n this._stock_materials.forEach(m => {\n if (m.dispose) m.dispose()\n })\n\n this._stock_materials = []\n }\n\n /* Event Handlers */\n\n onchange(after: Properties, before: Properties) {\n if (before.hasOwnProperty('legendTarget') || after.hasOwnProperty('legendTarget')) {\n this._legendTarget && this._legendTarget.off('change', this.onLegendTargetChanged, this)\n delete this._legendTarget\n this.resetMaterials()\n }\n\n super.onchange(after, before)\n }\n\n onchangeData(): void {\n if (typeof this.data !== 'object') {\n return\n }\n\n var data = this.data\n var locationField = this.getState('locationField') || 'location'\n\n if (data instanceof Array) {\n /**\n * Array type data\n * (e.g. data: [{\n * 'location' : 'A0101-01',\n * 'description': 'description1',\n * ...\n * }, {\n * ...\n * }])\n */\n\n data = data.reduce((acc, value, i, arr) => {\n var location = value[locationField]\n\n if (!location) {\n return acc\n }\n\n // 하나의 로케이션에 여러 레코드 정보가 올 수 있으므로, 하나이 로케이션의 스탁정보를 items 배열에 담는다.\n if (acc[location]) {\n acc[location]['items'].push(value)\n } else {\n acc[location] = { items: [value] }\n }\n\n return acc\n }, {})\n }\n\n /**\n * Object type data\n * (e.g. data: {\n * 'A0101-01': { items: [{ location: 'A0101-01', qty: 10, description: 'description', ... }, {...}] },\n * ...\n * })\n */\n for (var key in data) {\n let id = key\n if (data.hasOwnProperty(id)) {\n let d = data[id]\n let object = this.getObject(id)\n if (object) {\n ;(object as Stock).onchangeStockData(d)\n }\n }\n }\n }\n\n onLegendTargetChanged(after: { [key: string]: any }, before: { [key: string]: any }) {\n if (after.hasOwnProperty('status') && before.hasOwnProperty('status')) this.resetMaterials()\n }\n\n onmouseup(e: MouseEvent) {\n if (this._controls) {\n if (this._lastFocused) {\n ;(this._lastFocused as any)._focused = false\n }\n\n const { popupScene, left, top, width, height } = this.state\n\n var ref = popupScene\n var pointer = this.transcoordC2S(e.offsetX, e.offsetY)\n\n this._mouse!.x = ((pointer.x - left) / width) * 2 - 1\n this._mouse!.y = -((pointer.y - top) / height) * 2 + 1\n\n var object = this.getObjectByRaycast()\n var realObject = object?.userData.context\n\n if (realObject) {\n if (ref && realObject instanceof Stock) {\n ;(realObject as any).onmouseup(e, this, (data: any) => {\n ScenePopup.show(this, ref, {\n data,\n modal: false,\n closable: true,\n output: false,\n location: this.state.popupPosition || 'right-top'\n })\n })\n }\n\n ;(realObject as any)._focused = true\n ;(realObject as any)._focusedAt = performance.now()\n this._lastFocused = realObject\n realObject.component?.trigger('click', e)\n } else {\n ScenePopup.hide(this.root)\n }\n\n this.invalidate()\n\n e.stopPropagation()\n }\n }\n}\n\nComponent.register('visualizer', Visualizer)\n"]}
|
|
@@ -6,24 +6,14 @@
|
|
|
6
6
|
"auditLog": "logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json",
|
|
7
7
|
"files": [
|
|
8
8
|
{
|
|
9
|
-
"date":
|
|
10
|
-
"name": "logs/application-2023-03-
|
|
11
|
-
"hash": "
|
|
9
|
+
"date": 1678547855156,
|
|
10
|
+
"name": "logs/application-2023-03-12-00.log",
|
|
11
|
+
"hash": "966190e8bd6eec1e1252e75c6026d8b3e543ea24526e5e3761b018945464284c"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
"date":
|
|
15
|
-
"name": "logs/application-2023-03-
|
|
16
|
-
"hash": "
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"date": 1678365554167,
|
|
20
|
-
"name": "logs/application-2023-03-09-21.log",
|
|
21
|
-
"hash": "6c005f242442ed6c82b043613647ad3603be0a66d3fc6f259eb619892f6053d9"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"date": 1678368882057,
|
|
25
|
-
"name": "logs/application-2023-03-09-22.log",
|
|
26
|
-
"hash": "001c3b40ba91bfe3f3ef29a95e544f600c6eff2b767b38bba98b29eb22f12adc"
|
|
14
|
+
"date": 1678553973241,
|
|
15
|
+
"name": "logs/application-2023-03-12-01.log",
|
|
16
|
+
"hash": "274d773240f5738338b75cf03ae40b982faf050da7fd43fde32a9eb38c1016a8"
|
|
27
17
|
}
|
|
28
18
|
],
|
|
29
19
|
"hashType": "sha256"
|
|
@@ -5,11 +5,6 @@
|
|
|
5
5
|
},
|
|
6
6
|
"auditLog": "logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json",
|
|
7
7
|
"files": [
|
|
8
|
-
{
|
|
9
|
-
"date": 1677156625756,
|
|
10
|
-
"name": "logs/connections-2023-02-23-21.log",
|
|
11
|
-
"hash": "7cfdba3a3bdf354544fab6c9dab2e53d0000426022860f5e70235d9343a17220"
|
|
12
|
-
},
|
|
13
8
|
{
|
|
14
9
|
"date": 1677405743470,
|
|
15
10
|
"name": "logs/connections-2023-02-26-19.log",
|
|
@@ -74,6 +69,16 @@
|
|
|
74
69
|
"date": 1678352487543,
|
|
75
70
|
"name": "logs/connections-2023-03-09-18.log",
|
|
76
71
|
"hash": "bcae84d7ae8e66068b2babe596ddc3050aa6f7378beba39c770aeeb324e4edc4"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"date": 1678547856575,
|
|
75
|
+
"name": "logs/connections-2023-03-12-00.log",
|
|
76
|
+
"hash": "45febd6b151ca9ef18d6eb81351c63daf2668c13446091d28f11fcfed0f08dd4"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"date": 1678553974809,
|
|
80
|
+
"name": "logs/connections-2023-03-12-01.log",
|
|
81
|
+
"hash": "e6932d9e12f5ff76989112bff463c1ab68db56a747e4dd81c254784e68be0da5"
|
|
77
82
|
}
|
|
78
83
|
],
|
|
79
84
|
"hashType": "sha256"
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
2023-03-12T00:17:35+09:00 info: File Storage is Ready.
|
|
2
|
+
2023-03-12T00:17:36+09:00 error: oracledb module loading failed
|
|
3
|
+
2023-03-12T00:17:37+09:00 info: Default DataSource established
|
|
4
|
+
2023-03-12T00:17:37+09:00 info: Transaction DataSource established
|
|
5
|
+
2023-03-12T00:17:38+09:00 info: 🚀 Server ready at http://0.0.0.0:3000/graphql
|
|
6
|
+
2023-03-12T00:17:38+09:00 info: 🚀 Subscriptions ready at ws://0.0.0.0:3000/graphql
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
2023-03-12T01:59:33+09:00 info: File Storage is Ready.
|
|
2
|
+
2023-03-12T01:59:35+09:00 error: oracledb module loading failed
|
|
3
|
+
2023-03-12T01:59:35+09:00 info: Default DataSource established
|
|
4
|
+
2023-03-12T01:59:35+09:00 info: Transaction DataSource established
|
|
5
|
+
2023-03-12T01:59:36+09:00 info: 🚀 Server ready at http://0.0.0.0:3000/graphql
|
|
6
|
+
2023-03-12T01:59:36+09:00 info: 🚀 Subscriptions ready at ws://0.0.0.0:3000/graphql
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
2023-03-12T00:17:38+09:00 info: Initializing ConnectionManager...
|
|
2
|
+
2023-03-12T00:17:38+09:00 info: Connector 'echo-back-server' started to ready
|
|
3
|
+
2023-03-12T00:17:38+09:00 info: Connector 'echo-back' started to ready
|
|
4
|
+
2023-03-12T00:17:38+09:00 info: Connector 'http-connector' started to ready
|
|
5
|
+
2023-03-12T00:17:38+09:00 info: Connector 'graphql-connector' started to ready
|
|
6
|
+
2023-03-12T00:17:38+09:00 info: Connector 'sqlite-connector' started to ready
|
|
7
|
+
2023-03-12T00:17:38+09:00 info: Connector 'postgresql-connector' started to ready
|
|
8
|
+
2023-03-12T00:17:38+09:00 info: Connector 'mqtt-connector' started to ready
|
|
9
|
+
2023-03-12T00:17:38+09:00 info: Connector 'mssql-connector' started to ready
|
|
10
|
+
2023-03-12T00:17:38+09:00 info: Connector 'oracle-connector' started to ready
|
|
11
|
+
2023-03-12T00:17:38+09:00 info: Connector 'mysql-connector' started to ready
|
|
12
|
+
2023-03-12T00:17:38+09:00 info: Connector 'socket-server' started to ready
|
|
13
|
+
2023-03-12T00:17:38+09:00 info: echo-back-servers are ready
|
|
14
|
+
2023-03-12T00:17:38+09:00 info: echo-back connections are ready
|
|
15
|
+
2023-03-12T00:17:38+09:00 info: http-connector connections are ready
|
|
16
|
+
2023-03-12T00:17:38+09:00 info: graphql-connector connections are ready
|
|
17
|
+
2023-03-12T00:17:38+09:00 info: sqlite-connector connections are ready
|
|
18
|
+
2023-03-12T00:17:38+09:00 info: postgresql-connector connections are ready
|
|
19
|
+
2023-03-12T00:17:38+09:00 info: mqtt-connector connections are ready
|
|
20
|
+
2023-03-12T00:17:38+09:00 info: mssql-connector connections are ready
|
|
21
|
+
2023-03-12T00:17:38+09:00 info: oracle-connector connections are ready
|
|
22
|
+
2023-03-12T00:17:38+09:00 info: mysql-connector connections are ready
|
|
23
|
+
2023-03-12T00:17:38+09:00 info: socket servers are ready
|
|
24
|
+
2023-03-12T00:17:38+09:00 info: All connector for 'echo-back-server' ready
|
|
25
|
+
2023-03-12T00:17:38+09:00 info: All connector for 'echo-back' ready
|
|
26
|
+
2023-03-12T00:17:38+09:00 info: All connector for 'http-connector' ready
|
|
27
|
+
2023-03-12T00:17:38+09:00 info: All connector for 'graphql-connector' ready
|
|
28
|
+
2023-03-12T00:17:38+09:00 info: All connector for 'sqlite-connector' ready
|
|
29
|
+
2023-03-12T00:17:38+09:00 info: All connector for 'postgresql-connector' ready
|
|
30
|
+
2023-03-12T00:17:38+09:00 info: All connector for 'mqtt-connector' ready
|
|
31
|
+
2023-03-12T00:17:38+09:00 info: All connector for 'mssql-connector' ready
|
|
32
|
+
2023-03-12T00:17:38+09:00 info: All connector for 'oracle-connector' ready
|
|
33
|
+
2023-03-12T00:17:38+09:00 info: All connector for 'mysql-connector' ready
|
|
34
|
+
2023-03-12T00:17:38+09:00 info: All connector for 'socket-server' ready
|
|
35
|
+
2023-03-12T00:17:38+09:00 info: ConnectionManager initialization done:
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
2023-03-12T01:59:36+09:00 info: Initializing ConnectionManager...
|
|
2
|
+
2023-03-12T01:59:36+09:00 info: Connector 'echo-back-server' started to ready
|
|
3
|
+
2023-03-12T01:59:36+09:00 info: Connector 'echo-back' started to ready
|
|
4
|
+
2023-03-12T01:59:36+09:00 info: Connector 'http-connector' started to ready
|
|
5
|
+
2023-03-12T01:59:36+09:00 info: Connector 'graphql-connector' started to ready
|
|
6
|
+
2023-03-12T01:59:36+09:00 info: Connector 'sqlite-connector' started to ready
|
|
7
|
+
2023-03-12T01:59:36+09:00 info: Connector 'postgresql-connector' started to ready
|
|
8
|
+
2023-03-12T01:59:36+09:00 info: Connector 'mqtt-connector' started to ready
|
|
9
|
+
2023-03-12T01:59:36+09:00 info: Connector 'mssql-connector' started to ready
|
|
10
|
+
2023-03-12T01:59:36+09:00 info: Connector 'oracle-connector' started to ready
|
|
11
|
+
2023-03-12T01:59:36+09:00 info: Connector 'mysql-connector' started to ready
|
|
12
|
+
2023-03-12T01:59:36+09:00 info: Connector 'socket-server' started to ready
|
|
13
|
+
2023-03-12T01:59:36+09:00 info: echo-back-servers are ready
|
|
14
|
+
2023-03-12T01:59:36+09:00 info: echo-back connections are ready
|
|
15
|
+
2023-03-12T01:59:36+09:00 info: http-connector connections are ready
|
|
16
|
+
2023-03-12T01:59:36+09:00 info: graphql-connector connections are ready
|
|
17
|
+
2023-03-12T01:59:36+09:00 info: sqlite-connector connections are ready
|
|
18
|
+
2023-03-12T01:59:36+09:00 info: postgresql-connector connections are ready
|
|
19
|
+
2023-03-12T01:59:36+09:00 info: mqtt-connector connections are ready
|
|
20
|
+
2023-03-12T01:59:36+09:00 info: mssql-connector connections are ready
|
|
21
|
+
2023-03-12T01:59:36+09:00 info: oracle-connector connections are ready
|
|
22
|
+
2023-03-12T01:59:36+09:00 info: mysql-connector connections are ready
|
|
23
|
+
2023-03-12T01:59:36+09:00 info: socket servers are ready
|
|
24
|
+
2023-03-12T01:59:36+09:00 info: All connector for 'echo-back-server' ready
|
|
25
|
+
2023-03-12T01:59:36+09:00 info: All connector for 'echo-back' ready
|
|
26
|
+
2023-03-12T01:59:36+09:00 info: All connector for 'http-connector' ready
|
|
27
|
+
2023-03-12T01:59:36+09:00 info: All connector for 'graphql-connector' ready
|
|
28
|
+
2023-03-12T01:59:36+09:00 info: All connector for 'sqlite-connector' ready
|
|
29
|
+
2023-03-12T01:59:36+09:00 info: All connector for 'postgresql-connector' ready
|
|
30
|
+
2023-03-12T01:59:36+09:00 info: All connector for 'mqtt-connector' ready
|
|
31
|
+
2023-03-12T01:59:36+09:00 info: All connector for 'mssql-connector' ready
|
|
32
|
+
2023-03-12T01:59:36+09:00 info: All connector for 'oracle-connector' ready
|
|
33
|
+
2023-03-12T01:59:36+09:00 info: All connector for 'mysql-connector' ready
|
|
34
|
+
2023-03-12T01:59:36+09:00 info: All connector for 'socket-server' ready
|
|
35
|
+
2023-03-12T01:59:36+09:00 info: ConnectionManager initialization done:
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/scene-visualizer",
|
|
3
3
|
"description": "visualizer component for operato-scene",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "1.2.
|
|
5
|
+
"version": "1.2.18",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
8
8
|
"things-scene": true,
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"prettier --write"
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "36da8d4c5d7eedbc89761dad26bed19af6d7ba10"
|
|
65
65
|
}
|
|
@@ -21,7 +21,7 @@ export class RealObjectSprite2D extends RealObjectSprite {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
update() {
|
|
25
25
|
var material = this.object3d.material as THREE.SpriteMaterial
|
|
26
26
|
if (material) {
|
|
27
27
|
material.dispose()
|
|
@@ -34,4 +34,20 @@ export class RealObjectSprite2D extends RealObjectSprite {
|
|
|
34
34
|
|
|
35
35
|
this.object3d.material.sizeAttenuation = false
|
|
36
36
|
}
|
|
37
|
+
|
|
38
|
+
updateFillStyle() {
|
|
39
|
+
this.update()
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
updateStrokeStyle() {
|
|
43
|
+
this.update()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
updateAlpha() {
|
|
47
|
+
this.update()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
updateText() {
|
|
51
|
+
this.update()
|
|
52
|
+
}
|
|
37
53
|
}
|
package/src/visualizer.ts
CHANGED
|
@@ -217,62 +217,57 @@ export class Visualizer extends ThreeContainer {
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
onchangeData(): void {
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
if (typeof this.data !== 'object') {
|
|
221
|
+
return
|
|
222
|
+
}
|
|
222
223
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Array type data
|
|
227
|
-
* (e.g. data: [{
|
|
228
|
-
* 'loc' : 'location1',
|
|
229
|
-
* 'description': 'description1'
|
|
230
|
-
* },
|
|
231
|
-
* ...
|
|
232
|
-
* ])
|
|
233
|
-
*/
|
|
234
|
-
|
|
235
|
-
data = data.reduce((acc, value, i, arr) => {
|
|
236
|
-
var val = JSON.parse(JSON.stringify(value))
|
|
237
|
-
var id = locationField
|
|
238
|
-
|
|
239
|
-
if (!val[id]) {
|
|
240
|
-
// Rack 데이터가 아니면
|
|
241
|
-
id = 'id'
|
|
242
|
-
}
|
|
224
|
+
var data = this.data
|
|
225
|
+
var locationField = this.getState('locationField') || 'location'
|
|
243
226
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
227
|
+
if (data instanceof Array) {
|
|
228
|
+
/**
|
|
229
|
+
* Array type data
|
|
230
|
+
* (e.g. data: [{
|
|
231
|
+
* 'location' : 'A0101-01',
|
|
232
|
+
* 'description': 'description1',
|
|
233
|
+
* ...
|
|
234
|
+
* }, {
|
|
235
|
+
* ...
|
|
236
|
+
* }])
|
|
237
|
+
*/
|
|
254
238
|
|
|
255
|
-
|
|
239
|
+
data = data.reduce((acc, value, i, arr) => {
|
|
240
|
+
var location = value[locationField]
|
|
256
241
|
|
|
242
|
+
if (!location) {
|
|
257
243
|
return acc
|
|
258
|
-
}
|
|
259
|
-
}
|
|
244
|
+
}
|
|
260
245
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
246
|
+
// 하나의 로케이션에 여러 레코드 정보가 올 수 있으므로, 하나이 로케이션의 스탁정보를 items 배열에 담는다.
|
|
247
|
+
if (acc[location]) {
|
|
248
|
+
acc[location]['items'].push(value)
|
|
249
|
+
} else {
|
|
250
|
+
acc[location] = { items: [value] }
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return acc
|
|
254
|
+
}, {})
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Object type data
|
|
259
|
+
* (e.g. data: {
|
|
260
|
+
* 'A0101-01': { items: [{ location: 'A0101-01', qty: 10, description: 'description', ... }, {...}] },
|
|
261
|
+
* ...
|
|
262
|
+
* })
|
|
263
|
+
*/
|
|
264
|
+
for (var key in data) {
|
|
265
|
+
let id = key
|
|
266
|
+
if (data.hasOwnProperty(id)) {
|
|
267
|
+
let d = data[id]
|
|
268
|
+
let object = this.getObject(id)
|
|
269
|
+
if (object) {
|
|
270
|
+
;(object as Stock).onchangeStockData(d)
|
|
276
271
|
}
|
|
277
272
|
}
|
|
278
273
|
}
|
|
@@ -300,7 +295,7 @@ export class Visualizer extends ThreeContainer {
|
|
|
300
295
|
var realObject = object?.userData.context
|
|
301
296
|
|
|
302
297
|
if (realObject) {
|
|
303
|
-
if (ref &&
|
|
298
|
+
if (ref && realObject instanceof Stock) {
|
|
304
299
|
;(realObject as any).onmouseup(e, this, (data: any) => {
|
|
305
300
|
ScenePopup.show(this, ref, {
|
|
306
301
|
data,
|