@operato/scene-mpi 9.0.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/gateway.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../src/gateway.ts"],"names":[],"mappings":";;AAAA,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,yBAAyB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEtE,OAAO,EAA8B,SAAS,EAAc,MAAM,wBAAwB,CAAA;AAC1F,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAEhD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAGlE,MAAM,cAAc,GAAG,CAAC,CAAA;AACxB,MAAM,WAAW,GAAG,CAAC,CAAA;AACrB,MAAM,cAAc,GAAG,CAAC,CAAA;AACxB,MAAM,i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AAC,GAAG,IAAI,GAAG,cAAc,EAAE,CAAC,GAAG,GAAG,GAAG,cAAc,CAAC,CAAA;QAC9F,IAAI,IAAI,CAAC,cAAc,KAAK,GAAG,EAAE,CAAC;YAChC,IAAI,CAAC,UAAU,EAAE,CAAA;QACnB,CAAC;IACH,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,KAAK,CAAA;IACd,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;;AA5YM,qBAAa,GAAuB,EAAE,AAAzB,CAAyB;AAF1B,OAAO;IAD3B,cAAc,CAAC,SAAS,CAAC;GACL,OAAO,CA+Y3B;eA/YoB,OAAO","sourcesContent":["const IMAGE = new URL('../../icons/gateway.png', import.meta.url).href\n\nimport { Component, ComponentNature, Container, Properties } from '@hatiolab/things-scene'\nimport { uuid } from './uuid.js'\nimport { sceneComponent } from '@hatiolab/things-scene'\n\nimport { buttons } from './gateway-on-button.js'\n\nimport { onmessage, consoleLogger } from './gateway-on-message.js'\nimport Indicator from './indicator.js'\n\nconst BUTTONS_MARGIN = 0\nconst BUTTONS_GAP = 0\nconst BUTTONS_RADIUS = 0\nconst BUTTOMS_ICON_SIZE = 0\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'string',\n name: 'replyPublisher',\n label: 'reply_publisher',\n placeholder: ''\n },\n {\n type: 'string',\n name: 'reqPublisher',\n label: 'req_publisher',\n placeholder: ''\n },\n {\n type: 'select',\n label: 'power_flag',\n name: 'power_flag',\n property: {\n options: [\n {\n display: 'true',\n value: 'true'\n },\n {\n display: 'false',\n value: 'false'\n }\n ]\n }\n },\n {\n type: 'select',\n label: 'boot_flag',\n name: 'boot_flag',\n property: {\n options: [\n {\n display: 'true',\n value: 'true'\n },\n {\n display: 'false',\n value: 'false'\n }\n ]\n }\n },\n {\n type: 'string',\n name: 'pubTopic',\n label: 'pub_topic',\n placeholder: ''\n },\n {\n type: 'string',\n name: 'subTopic',\n label: 'sub_topic',\n placeholder: ''\n }\n ],\n help: 'scene/component/gateway'\n}\n\n@sceneComponent('gateway')\nexport default class Gateway extends Container {\n static _image?: HTMLImageElement\n static _buttonImages: HTMLImageElement[] = []\n\n private timeflow?: any\n private ledBlinker?: any\n private ledBarBlinker?: any\n\n private _focusedButton?: any\n\n public version?: any\n public publisher?: any\n public time?: any\n\n static get image() {\n if (!Gateway._image) {\n Gateway._image = new Image()\n Gateway._image.src = IMAGE\n }\n\n return Gateway._image\n }\n\n static get buttonImages() {\n if (!Gateway._buttonImages) {\n Gateway._buttonImages = []\n\n buttons.forEach(button => {\n let image = new Image()\n image.src = button.icon\n\n Gateway._buttonImages.push(image)\n })\n }\n\n return Gateway._buttonImages\n }\n\n dispose() {\n this.timerOff()\n\n delete this.timeflow\n delete this.ledBlinker\n delete this.ledBarBlinker\n\n super.dispose()\n }\n\n buttonContains(x: number, y: number) {\n var rx = BUTTONS_RADIUS\n var ry = BUTTONS_RADIUS\n\n return buttons.find((button, idx) => {\n let cx = idx * BUTTONS_GAP + BUTTONS_RADIUS / 2\n let cy = BUTTONS_RADIUS\n\n let normx = (x - cx) / (rx * 2 - 0.5)\n let normy = (y - cy) / (ry * 2 - 0.5)\n\n return normx * normx + normy * normy < 0.25\n })\n }\n\n passIndicatorsMessage(indicatorMessage: any) {\n if (!this.state.power_flag || !this.state.boot_flag) return\n if (indicatorMessage.action == 'IND_ON_RES') {\n this.reqPublisher!.data = {\n properties: this.generateMessageProperties(),\n body: indicatorMessage\n }\n consoleLogger(\n 'sent ' + (indicatorMessage.action ? indicatorMessage.action : 'indicator message'),\n this.reqPublisher!.data\n )\n } else {\n this.replyPublisher!.data = {\n properties: this.generateMessageProperties(),\n body: indicatorMessage\n }\n consoleLogger(\n 'sent ' + (indicatorMessage.action ? indicatorMessage.action : 'indicator message'),\n this.replyPublisher!.data\n )\n }\n }\n\n generateMessageProperties() {\n return {\n id: uuid(),\n time: Date.now(),\n dest_id: this.getState('subTopic'),\n source_id: this.getState('pubTopic'),\n is_reply: false\n }\n }\n\n generateReplyMessage(messageId: string, destId: string, action: string, body: any) {\n var msg = {\n properties: {\n id: messageId,\n time: Date.now(),\n dest_id: this.getState('pubTopic'),\n source_id: this.getState('subTopic'),\n is_reply: true\n },\n body: {\n action: action + '_ACK'\n } as any\n }\n switch (action) {\n case 'IND_ON_REQ':\n msg.body = {\n action: 'IND_ON_REQ_ACK',\n biz_type: body.biz_type,\n action_type: body.action_type,\n ret_args: body.ret_args,\n read_only: body.read_only,\n ind_on: body.ind_on.map((ind: any) => {\n let indOn = {} as any\n indOn.id = ind.id\n indOn.biz_id = ind.biz_id\n if (ind.stock_taking_id) indOn.stock_taking_id = ind.stock_taking_id\n return indOn\n })\n }\n break\n case 'LED_ON_REQ':\n case 'LED_OFF_REQ':\n msg.body = {\n action: action + '_ACK',\n id: body.id\n }\n break\n }\n\n return msg\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, Gateway.image, left + width - 62 - 5, top + 5, 62, 32)\n\n Gateway.buttonImages.forEach((image, idx) => {\n context.beginPath()\n\n if (buttons[idx] === this._focusedButton) {\n context.ellipse(\n BUTTONS_MARGIN + left + idx * BUTTONS_GAP + BUTTOMS_ICON_SIZE / 2,\n BUTTONS_MARGIN + top + BUTTOMS_ICON_SIZE / 2,\n BUTTONS_RADIUS,\n BUTTONS_RADIUS,\n 0,\n 0,\n 2 * Math.PI\n )\n context.fillStyle = 'lightgray'\n context.fill()\n }\n\n this.drawImage(\n context,\n image,\n BUTTONS_MARGIN + left + idx * BUTTONS_GAP,\n BUTTONS_MARGIN + top,\n BUTTOMS_ICON_SIZE,\n BUTTOMS_ICON_SIZE\n )\n })\n }\n\n get indicators(): Indicator[] {\n var groups = this.findAll('group') as Component[]\n\n if (groups.length == 0) {\n return this.findAll('indicator') as Indicator[]\n }\n\n var indicators = groups.map(function (group: Component, index: number) {\n var indicator = group.findFirst('indicator') as Indicator\n return indicator\n })\n\n return indicators\n }\n\n get replyPublisher() {\n if (this.state.replyPublisher) {\n return this.findById(this.state.replyPublisher)\n } else {\n return this.findFirst('mqtt')\n }\n }\n\n get replyGraphQl() {\n if (this.state.replyPublisher) {\n return this.findById(this.state.replyPublisher)\n } else {\n return this.findFirst('graphql-client')\n }\n }\n\n get reqPublisher() {\n if (this.state.reqPublisher) {\n return this.findById(this.state.reqPublisher)\n } else {\n return this.findFirst('mqtt')\n }\n }\n\n get timer() {\n return this.findFirst('seven-segment')\n }\n\n startBlinkingLed() {\n this.ledBlinker = setTimeout(() => {\n this.indicators.forEach((indicator, index) => {\n // 인디케이터가 켜져있고,\n var isLightOn = indicator.state.boot_flag == 'true' && indicator.lit\n // 버튼 모드가 BLINK이고,\n var isBtnModeBlink = indicator.getConf.btn_mode === indicator.btnModes.BLINK\n // display 상태가 아닐 때\n var isNotDisplay = indicator.currentTask !== indicator.tasks.DISPLAY\n // 또는 인디케이터가 FULL 상태이며 이 상태에서 깜박임 옵션이 true일 때\n var isFullState = indicator.currentTask == indicator.tasks.FULL\n if (isLightOn && ((isBtnModeBlink && isNotDisplay) || (indicator.getConf.blink_if_full && isFullState))) {\n indicator.getState('buttonColor') === '#0000'\n ? indicator.setState('buttonColor', String(indicator.colors[indicator.store.color]) || '#0000')\n : indicator.setState('buttonColor', String('#0000'))\n }\n })\n if (this.ledBlinker) this.startBlinkingLed()\n }, this.indicators[0].getConf.btn_intvl * 100)\n }\n\n stopBlinkingLed() {\n clearTimeout(this.ledBlinker)\n }\n\n startBlinkingLedBar() {\n this.ledBarBlinker = setTimeout(() => {\n this.indicators.forEach((indicator, index) => {\n if (indicator.ledLit && indicator.getConf.led_bar_mode === indicator.btnModes.BLINK) {\n if (indicator.ledRect.strokeStyle === '#0000') {\n indicator.ledRect.strokeStyle =\n '#f00' + Math.round((indicator.getConf.led_bar_brtns * 15) / 10).toString(16)\n } else {\n indicator.ledRect.strokeStyle = '#0000'\n }\n }\n })\n if (this.ledBarBlinker) this.startBlinkingLedBar()\n }, this.indicators[0].getConf.led_bar_intvl * 100)\n }\n\n stopBlinkingLedBar() {\n clearTimeout(this.ledBarBlinker)\n }\n\n boot() {\n if (this.state.boot_flag == 'true') return\n var { indicators, publisher } = this\n\n consoleLogger('onclickStart')\n\n // 2.1 indicator ready\n this.indicators.forEach(indicator => {\n var segLen = indicator.displays.length * indicator.displays[0].pattern.length\n // 2.2 indicater ID 점등\n if (indicator.model.id) {\n // id가 있으면 점등\n indicator.displayMessage(indicator.model.id)\n } else {\n // id가 없으면 무작위값 점등\n indicator.displayMessage(\n ('0'.repeat(segLen - 1) + Math.floor(Math.random() * parseInt(1 + '0'.repeat(segLen)))).substr(-segLen)\n )\n }\n })\n\n // 2.3 gateway ready\n this.setState('power_flag', 'true')\n\n // 2.4 boot request to M/W\n if (publisher) {\n publisher.data = {\n properties: this.generateMessageProperties(),\n body: {\n action: 'GW_INIT_REQ',\n id: this.model.id //.split('/')[this.model.id.split('/').length - 1]\n }\n }\n }\n consoleLogger('sent GW_INIT_REQ', publisher.data)\n }\n\n off() {\n if (this.state.power_flag == 'false') return\n\n this.timerOff()\n this.stopBlinkingLed()\n this.stopBlinkingLedBar()\n\n this.setState('power_flag', String('false'))\n this.setState('boot_flag', String('false'))\n\n this.indicators.forEach((indicator: Indicator) => {\n indicator.setState('boot_flag', String('false'))\n indicator.ledRect.strokeStyle = '#0000'\n indicator.lightOff()\n })\n consoleLogger('turned off ' + this.model.id)\n }\n\n setTimer(timestamp: number) {\n if (!this.timer) return\n var digitalClock =\n ('0' + new Date(timestamp).getHours()).substr(-2) +\n ':' +\n ('0' + new Date(timestamp).getMinutes()).substr(-2) +\n ':' +\n ('0' + new Date(timestamp).getSeconds()).substr(-2)\n this.timer.value = digitalClock\n }\n\n timerOn() {\n // if (this.timer) {\n // consoleLogger(this.model.id, \"timer on\");\n // let hms = this.timer.value.split(':').map(t => {\n // return parseInt(t);\n // });\n // this.timeflow = setInterval(() => {\n // if (!this.root || !this.timer) { this.timerOff(); delete this.timeflow; return; }\n // hms[2]++;\n // if (hms[2] >= 60) {\n // hms[2] = 0;\n // hms[1]++;\n // if (hms[1] >= 60) {\n // hms[1] = 0;\n // hms[0]++;\n // if (hms[0] >= 24) {\n // hms[0] = 0;\n // }\n // }\n // }\n // this.timer.value = (\"0\" + hms[0]).substr(-2) + \":\" + (\"0\" + hms[1]).substr(-2) + \":\" + (\"0\" + hms[2]).substr(-2);\n // }, 990);\n // }\n }\n\n timerOff() {\n consoleLogger(this.model.id, 'timer off')\n\n clearInterval(this.timeflow)\n }\n\n onchangeData(after: Properties, before: Properties) {\n super.onchangeData(after, before)\n\n onmessage(this, after.data)\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 onmousemove(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 old = this._focusedButton\n this._focusedButton = this.buttonContains(x - left - BUTTONS_MARGIN, y - top - BUTTONS_MARGIN)\n if (this._focusedButton !== old) {\n this.invalidate()\n }\n }\n\n get hasTextProperty() {\n return false\n }\n\n get nature() {\n return NATURE\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../src/gateway.ts"],"names":[],"mappings":";;AAAA,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,yBAAyB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEtE,OAAO,EAA8B,SAAS,EAAc,MAAM,wBAAwB,CAAA;AAC1F,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE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C,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;QAEvD,IAAI,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,GAAG,IAAI,GAAG,cAAc,EAAE,CAAC,GAAG,GAAG,GAAG,cAAc,CAAC,CAAA;QACrF,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACtB,CAAC;IACH,CAAC;IAED,WAAW,CAAC,CAAa,EAAE,IAAS;QAClC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9C,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;QAEvD,IAAI,GAAG,GAAG,IAAI,CAAC,cAAc,CAAA;QAC7B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,GAAG,IAAI,GAAG,cAAc,EAAE,CAAC,GAAG,GAAG,GAAG,cAAc,CAAC,CAAA;QAC9F,IAAI,IAAI,CAAC,cAAc,KAAK,GAAG,EAAE,CAAC;YAChC,IAAI,CAAC,UAAU,EAAE,CAAA;QACnB,CAAC;IACH,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,KAAK,CAAA;IACd,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;;AApZkB,OAAO;IAD3B,cAAc,CAAC,SAAS,CAAC;GACL,OAAO,CAqZ3B;eArZoB,OAAO","sourcesContent":["const IMAGE = new URL('../../icons/gateway.png', import.meta.url).href\n\nimport { Component, ComponentNature, Container, Properties } from '@hatiolab/things-scene'\nimport { uuid } from './uuid.js'\nimport { sceneComponent } from '@hatiolab/things-scene'\n\nimport { buttons } from './gateway-on-button.js'\n\nimport { onmessage, consoleLogger } from './gateway-on-message.js'\nimport Indicator from './indicator.js'\n\nconst BUTTONS_MARGIN = 0\nconst BUTTONS_GAP = 0\nconst BUTTONS_RADIUS = 0\nconst BUTTOMS_ICON_SIZE = 0\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'string',\n name: 'replyPublisher',\n label: 'reply_publisher',\n placeholder: ''\n },\n {\n type: 'string',\n name: 'reqPublisher',\n label: 'req_publisher',\n placeholder: ''\n },\n {\n type: 'select',\n label: 'power_flag',\n name: 'power_flag',\n property: {\n options: [\n {\n display: 'true',\n value: 'true'\n },\n {\n display: 'false',\n value: 'false'\n }\n ]\n }\n },\n {\n type: 'select',\n label: 'boot_flag',\n name: 'boot_flag',\n property: {\n options: [\n {\n display: 'true',\n value: 'true'\n },\n {\n display: 'false',\n value: 'false'\n }\n ]\n }\n },\n {\n type: 'string',\n name: 'pubTopic',\n label: 'pub_topic',\n placeholder: ''\n },\n {\n type: 'string',\n name: 'subTopic',\n label: 'sub_topic',\n placeholder: ''\n }\n ],\n help: 'scene/component/gateway'\n}\n\n@sceneComponent('gateway')\nexport default class Gateway extends Container {\n static _image?: HTMLImageElement\n static _buttonImages: HTMLImageElement[] = []\n\n private timeflow?: any\n private ledBlinker?: any\n private ledBarBlinker?: any\n\n private _focusedButton?: any\n\n public version?: any\n public publisher?: any\n public time?: any\n\n static get image() {\n if (!Gateway._image) {\n Gateway._image = new Image()\n Gateway._image.src = IMAGE\n }\n\n return Gateway._image\n }\n\n static get buttonImages() {\n if (!Gateway._buttonImages) {\n Gateway._buttonImages = []\n\n buttons.forEach(button => {\n let image = new Image()\n image.src = button.icon\n\n Gateway._buttonImages.push(image)\n })\n }\n\n return Gateway._buttonImages\n }\n\n dispose() {\n this.timerOff()\n\n delete this.timeflow\n delete this.ledBlinker\n delete this.ledBarBlinker\n\n super.dispose()\n }\n\n buttonContains(x: number, y: number) {\n var rx = BUTTONS_RADIUS\n var ry = BUTTONS_RADIUS\n\n return buttons.find((button, idx) => {\n let cx = idx * BUTTONS_GAP + BUTTONS_RADIUS / 2\n let cy = BUTTONS_RADIUS\n\n let normx = (x - cx) / (rx * 2 - 0.5)\n let normy = (y - cy) / (ry * 2 - 0.5)\n\n return normx * normx + normy * normy < 0.25\n })\n }\n\n passIndicatorsMessage(indicatorMessage: any) {\n if (!this.state.power_flag || !this.state.boot_flag) return\n if (indicatorMessage.action == 'IND_ON_RES') {\n this.reqPublisher!.data = {\n properties: this.generateMessageProperties(),\n body: indicatorMessage\n }\n consoleLogger(\n 'sent ' + (indicatorMessage.action ? indicatorMessage.action : 'indicator message'),\n this.reqPublisher!.data\n )\n } else {\n this.replyPublisher!.data = {\n properties: this.generateMessageProperties(),\n body: indicatorMessage\n }\n consoleLogger(\n 'sent ' + (indicatorMessage.action ? indicatorMessage.action : 'indicator message'),\n this.replyPublisher!.data\n )\n }\n }\n\n generateMessageProperties() {\n return {\n id: uuid(),\n time: Date.now(),\n dest_id: this.getState('subTopic'),\n source_id: this.getState('pubTopic'),\n is_reply: false\n }\n }\n\n generateReplyMessage(messageId: string, destId: string, action: string, body: any) {\n var msg = {\n properties: {\n id: messageId,\n time: Date.now(),\n dest_id: this.getState('pubTopic'),\n source_id: this.getState('subTopic'),\n is_reply: true\n },\n body: {\n action: action + '_ACK'\n } as any\n }\n switch (action) {\n case 'IND_ON_REQ':\n msg.body = {\n action: 'IND_ON_REQ_ACK',\n biz_type: body.biz_type,\n action_type: body.action_type,\n ret_args: body.ret_args,\n read_only: body.read_only,\n ind_on: body.ind_on.map((ind: any) => {\n let indOn = {} as any\n indOn.id = ind.id\n indOn.biz_id = ind.biz_id\n if (ind.stock_taking_id) indOn.stock_taking_id = ind.stock_taking_id\n return indOn\n })\n }\n break\n case 'LED_ON_REQ':\n case 'LED_OFF_REQ':\n msg.body = {\n action: action + '_ACK',\n id: body.id\n }\n break\n }\n\n return msg\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, Gateway.image, left + width - 62 - 5, top + 5, 62, 32)\n\n Gateway.buttonImages.forEach((image, idx) => {\n context.beginPath()\n\n if (buttons[idx] === this._focusedButton) {\n context.ellipse(\n BUTTONS_MARGIN + left + idx * BUTTONS_GAP + BUTTOMS_ICON_SIZE / 2,\n BUTTONS_MARGIN + top + BUTTOMS_ICON_SIZE / 2,\n BUTTONS_RADIUS,\n BUTTONS_RADIUS,\n 0,\n 0,\n 2 * Math.PI\n )\n context.fillStyle = 'lightgray'\n context.fill()\n }\n\n this.drawImage(\n context,\n image,\n BUTTONS_MARGIN + left + idx * BUTTONS_GAP,\n BUTTONS_MARGIN + top,\n BUTTOMS_ICON_SIZE,\n BUTTOMS_ICON_SIZE\n )\n })\n }\n\n get indicators(): Indicator[] {\n var groups = this.findAll('group') as Component[]\n\n if (groups.length == 0) {\n return this.findAll('indicator') as Indicator[]\n }\n\n var indicators = groups.map(function (group: Component, index: number) {\n var indicator = group.findFirst('indicator') as unknown as Indicator\n return indicator\n })\n\n return indicators\n }\n\n get replyPublisher() {\n if (this.state.replyPublisher) {\n return this.findById(this.state.replyPublisher)\n } else {\n return this.findFirst('mqtt')\n }\n }\n\n get replyGraphQl() {\n if (this.state.replyPublisher) {\n return this.findById(this.state.replyPublisher)\n } else {\n return this.findFirst('graphql-client')\n }\n }\n\n get reqPublisher() {\n if (this.state.reqPublisher) {\n return this.findById(this.state.reqPublisher)\n } else {\n return this.findFirst('mqtt')\n }\n }\n\n get timer() {\n return this.findFirst('seven-segment')\n }\n\n startBlinkingLed() {\n this.ledBlinker = setTimeout(() => {\n this.indicators.forEach((indicator, index) => {\n // 인디케이터가 켜져있고,\n var isLightOn = indicator.state.boot_flag == 'true' && indicator.lit\n // 버튼 모드가 BLINK이고,\n var isBtnModeBlink = indicator.getConf.btn_mode === indicator.btnModes.BLINK\n // display 상태가 아닐 때\n var isNotDisplay = indicator.currentTask !== indicator.tasks.DISPLAY\n // 또는 인디케이터가 FULL 상태이며 이 상태에서 깜박임 옵션이 true일 때\n var isFullState = indicator.currentTask == indicator.tasks.FULL\n if (isLightOn && ((isBtnModeBlink && isNotDisplay) || (indicator.getConf.blink_if_full && isFullState))) {\n indicator.getState('buttonColor') === '#0000'\n ? indicator.setState('buttonColor', String(indicator.colors[indicator.store.color]) || '#0000')\n : indicator.setState('buttonColor', String('#0000'))\n }\n })\n if (this.ledBlinker) this.startBlinkingLed()\n }, this.indicators[0].getConf.btn_intvl * 100)\n }\n\n stopBlinkingLed() {\n clearTimeout(this.ledBlinker)\n }\n\n startBlinkingLedBar() {\n this.ledBarBlinker = setTimeout(() => {\n this.indicators.forEach((indicator, index) => {\n if (indicator.ledLit && indicator.getConf.led_bar_mode === indicator.btnModes.BLINK) {\n if (indicator.ledRect.strokeStyle === '#0000') {\n indicator.ledRect.strokeStyle =\n '#f00' + Math.round((indicator.getConf.led_bar_brtns * 15) / 10).toString(16)\n } else {\n indicator.ledRect.strokeStyle = '#0000'\n }\n }\n })\n if (this.ledBarBlinker) this.startBlinkingLedBar()\n }, this.indicators[0].getConf.led_bar_intvl * 100)\n }\n\n stopBlinkingLedBar() {\n clearTimeout(this.ledBarBlinker)\n }\n\n boot() {\n if (this.state.boot_flag == 'true') return\n var { indicators, publisher } = this\n\n consoleLogger('onclickStart')\n\n // 2.1 indicator ready\n this.indicators.forEach(indicator => {\n var segLen = indicator.displays.length * indicator.displays[0].pattern.length\n // 2.2 indicater ID 점등\n if (indicator.model.id) {\n // id가 있으면 점등\n indicator.displayMessage(indicator.model.id)\n } else {\n // id가 없으면 무작위값 점등\n indicator.displayMessage(\n ('0'.repeat(segLen - 1) + Math.floor(Math.random() * parseInt(1 + '0'.repeat(segLen)))).substr(-segLen)\n )\n }\n })\n\n // 2.3 gateway ready\n this.setState('power_flag', 'true')\n\n // 2.4 boot request to M/W\n if (publisher) {\n publisher.data = {\n properties: this.generateMessageProperties(),\n body: {\n action: 'GW_INIT_REQ',\n id: this.model.id //.split('/')[this.model.id.split('/').length - 1]\n }\n }\n }\n consoleLogger('sent GW_INIT_REQ', publisher.data)\n }\n\n off(name?: string | object, callback?: Function, context?: any): this {\n if (name !== undefined) {\n return super.off(name, callback, context)\n }\n\n if (this.state.power_flag == 'false') return this\n\n this.timerOff()\n this.stopBlinkingLed()\n this.stopBlinkingLedBar()\n\n this.setState('power_flag', String('false'))\n this.setState('boot_flag', String('false'))\n\n this.indicators.forEach((indicator: Indicator) => {\n indicator.setState('boot_flag', String('false'))\n indicator.ledRect.strokeStyle = '#0000'\n indicator.lightOff()\n })\n consoleLogger('turned off ' + this.model.id)\n\n return this\n }\n\n setTimer(timestamp: number) {\n if (!this.timer) return\n var digitalClock =\n ('0' + new Date(timestamp).getHours()).substr(-2) +\n ':' +\n ('0' + new Date(timestamp).getMinutes()).substr(-2) +\n ':' +\n ('0' + new Date(timestamp).getSeconds()).substr(-2)\n this.timer.value = digitalClock\n }\n\n timerOn() {\n // if (this.timer) {\n // consoleLogger(this.model.id, \"timer on\");\n // let hms = this.timer.value.split(':').map(t => {\n // return parseInt(t);\n // });\n // this.timeflow = setInterval(() => {\n // if (!this.root || !this.timer) { this.timerOff(); delete this.timeflow; return; }\n // hms[2]++;\n // if (hms[2] >= 60) {\n // hms[2] = 0;\n // hms[1]++;\n // if (hms[1] >= 60) {\n // hms[1] = 0;\n // hms[0]++;\n // if (hms[0] >= 24) {\n // hms[0] = 0;\n // }\n // }\n // }\n // this.timer.value = (\"0\" + hms[0]).substr(-2) + \":\" + (\"0\" + hms[1]).substr(-2) + \":\" + (\"0\" + hms[2]).substr(-2);\n // }, 990);\n // }\n }\n\n timerOff() {\n consoleLogger(this.model.id, 'timer off')\n\n clearInterval(this.timeflow)\n }\n\n onchangeData(after: Properties, before: Properties) {\n super.onchangeData(after, before)\n\n onmessage(this, after.data)\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 onmousemove(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 old = this._focusedButton\n this._focusedButton = this.buttonContains(x - left - BUTTONS_MARGIN, y - top - BUTTONS_MARGIN)\n if (this._focusedButton !== old) {\n this.invalidate()\n }\n }\n\n get hasTextProperty() {\n return false\n }\n\n get nature() {\n return NATURE\n }\n}\n"]}
|
|
@@ -114,7 +114,7 @@ export function onMouseDownFButton(indicator) {
|
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
else if (
|
|
117
|
+
else if (indicator.state.reply_target === 'MQTT') {
|
|
118
118
|
indicator.gateway.passIndicatorsMessage(_makeMsgBody(indicator, 'IND_ON_RES', indicator.store, 'full'));
|
|
119
119
|
}
|
|
120
120
|
// TODO ack 받으면 소등
|
|
@@ -159,7 +159,7 @@ export function onMouseDownCButton(indicator) {
|
|
|
159
159
|
}
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
|
-
else if (
|
|
162
|
+
else if (indicator.state.reply_target === 'MQTT') {
|
|
163
163
|
indicator.gateway.passIndicatorsMessage(_makeMsgBody(indicator, 'IND_ON_RES', indicator.store, 'cancel', 0, 0));
|
|
164
164
|
}
|
|
165
165
|
indicator.displayMessage('CAnCEL');
|
|
@@ -220,7 +220,7 @@ export function onMouseDownBigButton(indicator) {
|
|
|
220
220
|
}
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
|
-
else if (
|
|
223
|
+
else if (indicator.state.reply_target === 'MQTT') {
|
|
224
224
|
indicator.gateway.passIndicatorsMessage(_makeMsgBody(indicator, 'IND_ON_RES', indicator.store, 'ok', indicator.store.res_box_qty, indicator.store.res_ea_qty));
|
|
225
225
|
}
|
|
226
226
|
// TODO ack 받으면 소등
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indicator-user-action.js","sourceRoot":"","sources":["../src/indicator-user-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAGvD,MAAM,MAAM,GAAG;IACb,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,MAAM;CACmB,CAAA;AAE9B,MAAM,UAAU,kBAAkB,CAAC,SAAoB;IACrD,IACE,SAAS,CAAC,KAAK,CAAC,SAAS,IAAI,MAAM;QACnC,CAAC,SAAS,CAAC,GAAG;QACd,SAAS,CAAC,QAAQ;QAClB,SAAS,CAAC,WAAW,KAAK,SAAS,CAAC,KAAK,CAAC,IAAI;QAC9C,SAAS,CAAC,WAAW,KAAK,SAAS,CAAC,KAAK,CAAC,GAAG;QAC7C,SAAS,CAAC,WAAW,KAAK,SAAS,CAAC,KAAK,CAAC,OAAO;QAEjD,OAAM;IACR,SAAS;IACT,aAAa,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAA;IACvC,IAAI,WAAW,GAAG,EAAS,CAAA;IAC3B,IAAI,SAAS,CAAC,WAAW,IAAI,QAAQ,EAAE,CAAC;QACtC,SAAS,CAAC,WAAW,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,CAAA;QAC5C,SAAS,CAAC,WAAW,GAAG,SAAS,CAAC,KAAK,CAAC,WAAW,CAAA;QACnD,WAAW,CAAC,WAAW,GAAG,SAAS,CAAC,KAAK,CAAC,WAAW,CAAA;QACrD,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,UAAU,CAAA;QACnD,WAAW,CAAC,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK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AAC,UAAU,CAAC,CAAA;YAC9C,MAAM,CAAC,UAAU,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QACrE,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA","sourcesContent":["import { consoleLogger } from './gateway-on-message.js'\nimport Indicator from './indicator.js'\n\nconst colors = {\n R: '#f00',\n G: '#0f0',\n B: '#00f',\n C: '#0ff',\n M: '#f0f',\n Y: '#ff0',\n K: '#0000',\n W: '#fff'\n} as { [key: string]: string }\n\nexport function onMouseDownMButton(indicator: Indicator) {\n if (\n indicator.state.boot_flag != 'true' ||\n !indicator.lit ||\n indicator.readOnly ||\n indicator.currentTask === indicator.tasks.FULL ||\n indicator.currentTask === indicator.tasks.END ||\n indicator.currentTask === indicator.tasks.INSPECT\n )\n return\n // modify\n consoleLogger('onMouseDownButton', 'M')\n var displayData = {} as any\n if (indicator.currentTask == 'modify') {\n indicator.currentTask = indicator.tasks.PICK\n indicator.currentTask = indicator.store.action_type\n displayData.org_box_qty = indicator.store.org_box_qty\n displayData.org_ea_qty = indicator.store.org_ea_qty\n displayData.buttonColor = colors[indicator.store.color]\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n } else {\n indicator.currentTask = indicator.tasks.MODIFY\n displayData.org_ea_qty = indicator.store.org_ea_qty\n displayData.org_box_qty = indicator.store.org_box_qty\n displayData.buttonColor = colors['M']\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n }\n\n // var boxQuan = indicator.store.org_box_qty\n // ? indicator.store.org_box_qty\n // : false;\n // var eaQuan = indicator.store.org_ea_qty ? indicator.store.org_ea_qty : false;\n // var isSame = true;\n // var userAction = \"modify\";\n\n // switch(indicator.currentTask) {\n // case indicator.tasks.PICK: {\n // var isQtyLessThenOne = (!indicator.store.org_box_qty && (indicator.store.org_ea_qty <= 1 || !indicator.store.org_ea_qty));\n\n // if (isQtyLessThenOne) {\n // userAction = 'ok';\n // } else {\n // do {\n // if(boxQuan) boxQuan = Math.round(boxQuan * Math.random());\n // if(eaQuan) eaQuan = Math.round(eaQuan * Math.random());\n\n // isSame = (indicator.store.org_box_qty == boxQuan) && (indicator.store.org_ea_qty == eaQuan);\n // } while(isSame);\n // }\n // } break;\n // case indicator.tasks.STOCK: {\n // if (boxQuan) boxQuan = Math.ceil(boxQuan * Math.random());\n // if (eaQuan) eaQuan = Math.ceil(eaQuan * Math.random());\n // } break;\n // }\n\n // boxQuan = Math.ceil(boxQuan / 2);\n // eaQuan = Math.ceil(eaQuan / 2);\n\n // isSame =\n // boxQuan == indicator.store.org_box_qty &&\n // eaQuan == indicator.store.org_ea_qty;\n\n // isSame ? (userAction = \"ok\") : (userAction = \"modify\");\n\n // indicator.gateway.passIndicatorsMessage(\n // _makeMsgBody(\n // indicator,\n // \"IND_ON_RES\",\n // indicator.store,\n // userAction,\n // boxQuan,\n // eaQuan\n // )\n // );\n // TODO 프로토콜 변경\n}\n\nexport function onMouseDownFButton(indicator: Indicator) {\n if (\n indicator.state.boot_flag != 'true' ||\n !indicator.lit ||\n indicator.readOnly ||\n indicator.currentTask == indicator.tasks.STOCK ||\n indicator.currentTask === indicator.tasks.FULL\n )\n return\n consoleLogger('onMouseDownButton', 'F')\n\n if (indicator.currentTask == 'modify') {\n var displayData = {} as any\n // var orgEaQty = indicator.cookedData.res_ea_qty ? indicator.cookedData.res_ea_qty : 0;\n displayData.org_ea_qty =\n indicator.cookedData.org_ea_qty + 1 <= indicator.store.org_ea_qty ? indicator.cookedData.org_ea_qty + 1 : 0\n displayData.org_box_qty = indicator.store.org_box_qty\n displayData.buttonColor = colors['M']\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n } else {\n // full box\n if (indicator.state.reply_target == 'GraphQl') {\n indicator.gateway.replyGraphQl!.value = {\n pubTopic: indicator.gateway.state.subTopic,\n subTopic: indicator.gateway.state.pubTopic,\n params: {\n actionType: 'pick',\n bizFlag: 'full',\n action: 'IND_ON_RES',\n bizType: 'DPS',\n orgBoxQty: 0,\n orgEaQty: 0,\n id: indicator.store.id\n }\n }\n } else if ((indicator.state.reply_target = 'MQTT')) {\n indicator.gateway.passIndicatorsMessage(_makeMsgBody(indicator, 'IND_ON_RES', indicator.store, 'full'))\n }\n // TODO ack 받으면 소등\n // TODO 프로토콜 변경\n indicator.displayMessage('-FULL-', indicator.store.color)\n indicator.currentTask = indicator.tasks.FULL\n }\n}\n\nexport function onMouseDownCButton(indicator: Indicator) {\n if (\n indicator.state.boot_flag != 'true' ||\n !indicator.lit ||\n indicator.readOnly ||\n indicator.currentTask == indicator.tasks.STOCK ||\n indicator.currentTask === indicator.tasks.FULL ||\n indicator.currentTask === indicator.tasks.END\n )\n return\n consoleLogger('onMouseDownButton', 'C')\n if (indicator.currentTask == 'modify') {\n var displayData = {} as any\n displayData.org_box_qty = indicator.store.org_box_qty\n displayData.org_ea_qty =\n indicator.cookedData.org_ea_qty - 1 >= 0 ? indicator.cookedData.org_ea_qty - 1 : indicator.store.org_ea_qty\n displayData.buttonColor = colors['M']\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n } else {\n // cancel\n if (indicator.state.reply_target == 'GraphQl') {\n indicator.gateway.replyGraphQl!.value = {\n pubTopic: indicator.gateway.state.subTopic,\n subTopic: indicator.gateway.state.pubTopic,\n params: {\n actionType: 'pick',\n bizFlag: 'cancel',\n action: 'IND_ON_RES',\n bizType: 'DPS',\n orgBoxQty: indicator.store.org_box_qty ? indicator.store.org_box_qty : 0,\n orgEaQty: 0,\n resEaQty: 0,\n id: indicator.store.id\n }\n }\n } else if ((indicator.state.reply_target = 'MQTT')) {\n indicator.gateway.passIndicatorsMessage(_makeMsgBody(indicator, 'IND_ON_RES', indicator.store, 'cancel', 0, 0))\n }\n indicator.displayMessage('CAnCEL')\n var displayData = {} as any\n displayData.org_box_qty = indicator.store.org_box_qty ? indicator.store.org_box_qty : 0\n displayData.org_ea_qty = 0\n displayData.buttonColor = ''\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n\n // 일정 시간 후 소등\n // setTimeout(() => {\n // indicator.gateway.passIndicatorsMessage(\n // _makeMsgBody(indicator, \"IND_ON_RES\", indicator.store, \"cancel\", 0, 0)\n // );\n // indicator.lightOff();\n // }, indicator.getConf.cncl_delay * 100);\n }\n}\n\nexport function onMouseDownBigButton(indicator: Indicator) {\n // 작업자 버튼 터치\n if (\n indicator.state.boot_flag != 'true' ||\n !indicator.lit ||\n indicator.readOnly ||\n indicator.currentTask === indicator.tasks.END\n )\n return\n consoleLogger('onMouseDownBigButton')\n if (indicator.currentTask === indicator.tasks.FULL) {\n indicator.jobLightOn(indicator.cookedData)\n indicator.currentTask = indicator.tasks.DISPLAY\n return\n } else if (indicator.currentTask === indicator.tasks.INSPECT) {\n indicator.lightOff()\n return\n } else if (indicator.currentTask == 'modify') {\n indicator.store.res_ea_qty = indicator.cookedData.org_ea_qty\n indicator.store.res_box_qty = indicator.cookedData.org_box_qty\n }\n indicator.currentTask = indicator.tasks.END\n // 3.6 G/W에 정보 전송\n // 3.7 MPS에 전달\n\n if (indicator.state.reply_target == 'GraphQl') {\n indicator.gateway.replyGraphQl!.value = {\n pubTopic: indicator.gateway.state.subTopic,\n subTopic: indicator.gateway.state.pubTopic,\n params: {\n actionType: 'pick',\n bizFlag: 'ok',\n action: 'IND_ON_RES',\n bizType: 'DPS',\n id: indicator.store.id,\n orgRelay: indicator.store.org_relay,\n orgBoxQty: indicator.store.org_box_qty,\n orgEaQty: indicator.store.org_ea_qty,\n resBoxQty: indicator.store.org_box_qty,\n resEaQty: indicator.store.org_ea_qty\n }\n }\n } else if ((indicator.state.reply_target = 'MQTT')) {\n indicator.gateway.passIndicatorsMessage(\n _makeMsgBody(\n indicator,\n 'IND_ON_RES',\n indicator.store,\n 'ok',\n indicator.store.res_box_qty,\n indicator.store.res_ea_qty\n )\n )\n }\n\n // TODO ack 받으면 소등\n\n // 확정 누르면 오른쪽 세그먼트 숫자만 남기고 소등, display 시퀀스를 생략하기 위함\n // TODO 프로토콜 변경\n var displayData = {} as any\n displayData.org_ea_qty = indicator.store.org_ea_qty\n displayData.org_box_qty = indicator.store.org_box_qty\n displayData.buttonColor = ''\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n}\n\nvar _makeMsgBody = function (indicator: Indicator, action: any, store: any, biz: any, resBox?: any, resEa?: any) {\n var { org_box_qty, org_ea_qty } = indicator.state\n\n var result\n result = {\n action: action,\n id: indicator.model.id,\n biz_id: store ? store.biz_id : undefined,\n biz_type: store.biz_type,\n action_type: store.action_type,\n ret_args: store.ret_args,\n biz_flag: biz\n } as any\n if (store) {\n if (store.org_relay || store.org_relay == 0) {\n result.org_relay = parseInt(store.org_relay)\n }\n if (store.org_box_qty || store.org_box_qty == 0) {\n result.org_box_qty = parseInt(store.org_box_qty)\n result.res_box_qty = resBox >= 0 ? resBox : parseInt(store.org_box_qty)\n }\n if (store.org_ea_qty || store.org_ea_qty == 0) {\n result.org_ea_qty = parseInt(store.org_ea_qty)\n result.res_ea_qty = resEa >= 0 ? resEa : parseInt(store.org_ea_qty)\n }\n }\n return result\n}\n"]}
|
|
1
|
+
{"version":3,"file":"indicator-user-action.js","sourceRoot":"","sources":["../src/indicator-user-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAGvD,MAAM,MAAM,GAAG;IACb,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,MAAM;CACmB,CAAA;AAE9B,MAAM,UAAU,kBAAkB,CAAC,SAAoB;IACrD,IACE,SAAS,CAAC,KAAK,CAAC,SAAS,IAAI,MAAM;QACnC,CAAC,SAAS,CAAC,GAAG;QACd,SAAS,CAA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AAQ,EAAE,GAAG;KACP,CAAA;IACR,IAAI,KAAK,EAAE,CAAC;QACV,IAAI,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,IAAI,CAAC,EAAE,CAAC;YAC5C,MAAM,CAAC,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QAC9C,CAAC;QACD,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC;YAChD,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;YAChD,MAAM,CAAC,WAAW,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QACzE,CAAC;QACD,IAAI,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,UAAU,IAAI,CAAC,EAAE,CAAC;YAC9C,MAAM,CAAC,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;YAC9C,MAAM,CAAC,UAAU,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QACrE,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA","sourcesContent":["import { consoleLogger } from './gateway-on-message.js'\nimport Indicator from './indicator.js'\n\nconst colors = {\n R: '#f00',\n G: '#0f0',\n B: '#00f',\n C: '#0ff',\n M: '#f0f',\n Y: '#ff0',\n K: '#0000',\n W: '#fff'\n} as { [key: string]: string }\n\nexport function onMouseDownMButton(indicator: Indicator) {\n if (\n indicator.state.boot_flag != 'true' ||\n !indicator.lit ||\n indicator.readOnly ||\n indicator.currentTask === indicator.tasks.FULL ||\n indicator.currentTask === indicator.tasks.END ||\n indicator.currentTask === indicator.tasks.INSPECT\n )\n return\n // modify\n consoleLogger('onMouseDownButton', 'M')\n var displayData = {} as any\n if (indicator.currentTask == 'modify') {\n indicator.currentTask = indicator.tasks.PICK\n indicator.currentTask = indicator.store.action_type\n displayData.org_box_qty = indicator.store.org_box_qty\n displayData.org_ea_qty = indicator.store.org_ea_qty\n displayData.buttonColor = colors[indicator.store.color]\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n } else {\n indicator.currentTask = indicator.tasks.MODIFY\n displayData.org_ea_qty = indicator.store.org_ea_qty\n displayData.org_box_qty = indicator.store.org_box_qty\n displayData.buttonColor = colors['M']\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n }\n\n // var boxQuan = indicator.store.org_box_qty\n // ? indicator.store.org_box_qty\n // : false;\n // var eaQuan = indicator.store.org_ea_qty ? indicator.store.org_ea_qty : false;\n // var isSame = true;\n // var userAction = \"modify\";\n\n // switch(indicator.currentTask) {\n // case indicator.tasks.PICK: {\n // var isQtyLessThenOne = (!indicator.store.org_box_qty && (indicator.store.org_ea_qty <= 1 || !indicator.store.org_ea_qty));\n\n // if (isQtyLessThenOne) {\n // userAction = 'ok';\n // } else {\n // do {\n // if(boxQuan) boxQuan = Math.round(boxQuan * Math.random());\n // if(eaQuan) eaQuan = Math.round(eaQuan * Math.random());\n\n // isSame = (indicator.store.org_box_qty == boxQuan) && (indicator.store.org_ea_qty == eaQuan);\n // } while(isSame);\n // }\n // } break;\n // case indicator.tasks.STOCK: {\n // if (boxQuan) boxQuan = Math.ceil(boxQuan * Math.random());\n // if (eaQuan) eaQuan = Math.ceil(eaQuan * Math.random());\n // } break;\n // }\n\n // boxQuan = Math.ceil(boxQuan / 2);\n // eaQuan = Math.ceil(eaQuan / 2);\n\n // isSame =\n // boxQuan == indicator.store.org_box_qty &&\n // eaQuan == indicator.store.org_ea_qty;\n\n // isSame ? (userAction = \"ok\") : (userAction = \"modify\");\n\n // indicator.gateway.passIndicatorsMessage(\n // _makeMsgBody(\n // indicator,\n // \"IND_ON_RES\",\n // indicator.store,\n // userAction,\n // boxQuan,\n // eaQuan\n // )\n // );\n // TODO 프로토콜 변경\n}\n\nexport function onMouseDownFButton(indicator: Indicator) {\n if (\n indicator.state.boot_flag != 'true' ||\n !indicator.lit ||\n indicator.readOnly ||\n indicator.currentTask == indicator.tasks.STOCK ||\n indicator.currentTask === indicator.tasks.FULL\n )\n return\n consoleLogger('onMouseDownButton', 'F')\n\n if (indicator.currentTask == 'modify') {\n var displayData = {} as any\n // var orgEaQty = indicator.cookedData.res_ea_qty ? indicator.cookedData.res_ea_qty : 0;\n displayData.org_ea_qty =\n indicator.cookedData.org_ea_qty + 1 <= indicator.store.org_ea_qty ? indicator.cookedData.org_ea_qty + 1 : 0\n displayData.org_box_qty = indicator.store.org_box_qty\n displayData.buttonColor = colors['M']\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n } else {\n // full box\n if (indicator.state.reply_target == 'GraphQl') {\n indicator.gateway.replyGraphQl!.value = {\n pubTopic: indicator.gateway.state.subTopic,\n subTopic: indicator.gateway.state.pubTopic,\n params: {\n actionType: 'pick',\n bizFlag: 'full',\n action: 'IND_ON_RES',\n bizType: 'DPS',\n orgBoxQty: 0,\n orgEaQty: 0,\n id: indicator.store.id\n }\n }\n } else if (indicator.state.reply_target === 'MQTT') {\n indicator.gateway.passIndicatorsMessage(_makeMsgBody(indicator, 'IND_ON_RES', indicator.store, 'full'))\n }\n // TODO ack 받으면 소등\n // TODO 프로토콜 변경\n indicator.displayMessage('-FULL-', indicator.store.color)\n indicator.currentTask = indicator.tasks.FULL\n }\n}\n\nexport function onMouseDownCButton(indicator: Indicator) {\n if (\n indicator.state.boot_flag != 'true' ||\n !indicator.lit ||\n indicator.readOnly ||\n indicator.currentTask == indicator.tasks.STOCK ||\n indicator.currentTask === indicator.tasks.FULL ||\n indicator.currentTask === indicator.tasks.END\n )\n return\n consoleLogger('onMouseDownButton', 'C')\n if (indicator.currentTask == 'modify') {\n var displayData = {} as any\n displayData.org_box_qty = indicator.store.org_box_qty\n displayData.org_ea_qty =\n indicator.cookedData.org_ea_qty - 1 >= 0 ? indicator.cookedData.org_ea_qty - 1 : indicator.store.org_ea_qty\n displayData.buttonColor = colors['M']\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n } else {\n // cancel\n if (indicator.state.reply_target == 'GraphQl') {\n indicator.gateway.replyGraphQl!.value = {\n pubTopic: indicator.gateway.state.subTopic,\n subTopic: indicator.gateway.state.pubTopic,\n params: {\n actionType: 'pick',\n bizFlag: 'cancel',\n action: 'IND_ON_RES',\n bizType: 'DPS',\n orgBoxQty: indicator.store.org_box_qty ? indicator.store.org_box_qty : 0,\n orgEaQty: 0,\n resEaQty: 0,\n id: indicator.store.id\n }\n }\n } else if (indicator.state.reply_target === 'MQTT') {\n indicator.gateway.passIndicatorsMessage(_makeMsgBody(indicator, 'IND_ON_RES', indicator.store, 'cancel', 0, 0))\n }\n indicator.displayMessage('CAnCEL')\n var displayData = {} as any\n displayData.org_box_qty = indicator.store.org_box_qty ? indicator.store.org_box_qty : 0\n displayData.org_ea_qty = 0\n displayData.buttonColor = ''\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n\n // 일정 시간 후 소등\n // setTimeout(() => {\n // indicator.gateway.passIndicatorsMessage(\n // _makeMsgBody(indicator, \"IND_ON_RES\", indicator.store, \"cancel\", 0, 0)\n // );\n // indicator.lightOff();\n // }, indicator.getConf.cncl_delay * 100);\n }\n}\n\nexport function onMouseDownBigButton(indicator: Indicator) {\n // 작업자 버튼 터치\n if (\n indicator.state.boot_flag != 'true' ||\n !indicator.lit ||\n indicator.readOnly ||\n indicator.currentTask === indicator.tasks.END\n )\n return\n consoleLogger('onMouseDownBigButton')\n if (indicator.currentTask === indicator.tasks.FULL) {\n indicator.jobLightOn(indicator.cookedData)\n indicator.currentTask = indicator.tasks.DISPLAY\n return\n } else if (indicator.currentTask === indicator.tasks.INSPECT) {\n indicator.lightOff()\n return\n } else if (indicator.currentTask == 'modify') {\n indicator.store.res_ea_qty = indicator.cookedData.org_ea_qty\n indicator.store.res_box_qty = indicator.cookedData.org_box_qty\n }\n indicator.currentTask = indicator.tasks.END\n // 3.6 G/W에 정보 전송\n // 3.7 MPS에 전달\n\n if (indicator.state.reply_target == 'GraphQl') {\n indicator.gateway.replyGraphQl!.value = {\n pubTopic: indicator.gateway.state.subTopic,\n subTopic: indicator.gateway.state.pubTopic,\n params: {\n actionType: 'pick',\n bizFlag: 'ok',\n action: 'IND_ON_RES',\n bizType: 'DPS',\n id: indicator.store.id,\n orgRelay: indicator.store.org_relay,\n orgBoxQty: indicator.store.org_box_qty,\n orgEaQty: indicator.store.org_ea_qty,\n resBoxQty: indicator.store.org_box_qty,\n resEaQty: indicator.store.org_ea_qty\n }\n }\n } else if (indicator.state.reply_target === 'MQTT') {\n indicator.gateway.passIndicatorsMessage(\n _makeMsgBody(\n indicator,\n 'IND_ON_RES',\n indicator.store,\n 'ok',\n indicator.store.res_box_qty,\n indicator.store.res_ea_qty\n )\n )\n }\n\n // TODO ack 받으면 소등\n\n // 확정 누르면 오른쪽 세그먼트 숫자만 남기고 소등, display 시퀀스를 생략하기 위함\n // TODO 프로토콜 변경\n var displayData = {} as any\n displayData.org_ea_qty = indicator.store.org_ea_qty\n displayData.org_box_qty = indicator.store.org_box_qty\n displayData.buttonColor = ''\n indicator.cookedData = displayData\n indicator.jobLightOn(displayData)\n}\n\nvar _makeMsgBody = function (indicator: Indicator, action: any, store: any, biz: any, resBox?: any, resEa?: any) {\n var { org_box_qty, org_ea_qty } = indicator.state\n\n var result\n result = {\n action: action,\n id: indicator.model.id,\n biz_id: store ? store.biz_id : undefined,\n biz_type: store.biz_type,\n action_type: store.action_type,\n ret_args: store.ret_args,\n biz_flag: biz\n } as any\n if (store) {\n if (store.org_relay || store.org_relay == 0) {\n result.org_relay = parseInt(store.org_relay)\n }\n if (store.org_box_qty || store.org_box_qty == 0) {\n result.org_box_qty = parseInt(store.org_box_qty)\n result.res_box_qty = resBox >= 0 ? resBox : parseInt(store.org_box_qty)\n }\n if (store.org_ea_qty || store.org_ea_qty == 0) {\n result.org_ea_qty = parseInt(store.org_ea_qty)\n result.res_ea_qty = resEa >= 0 ? resEa : parseInt(store.org_ea_qty)\n }\n }\n return result\n}\n"]}
|
package/dist/indicator.d.ts
CHANGED
|
@@ -1,7 +1,243 @@
|
|
|
1
1
|
import { Component, ComponentNature, Shape } from '@hatiolab/things-scene';
|
|
2
2
|
import SegmentDisplay from './segment-display.js';
|
|
3
3
|
import Gateway from './gateway.js';
|
|
4
|
-
declare const Indicator_base:
|
|
4
|
+
declare const Indicator_base: (new (...args: any[]) => {
|
|
5
|
+
contains(x: number, y: number): boolean;
|
|
6
|
+
get path(): {
|
|
7
|
+
x: any;
|
|
8
|
+
y: any;
|
|
9
|
+
}[];
|
|
10
|
+
set path(path: {
|
|
11
|
+
x: any;
|
|
12
|
+
y: any;
|
|
13
|
+
}[]): any;
|
|
14
|
+
get anchors(): {
|
|
15
|
+
name: string;
|
|
16
|
+
position: {
|
|
17
|
+
x: any;
|
|
18
|
+
y: any;
|
|
19
|
+
};
|
|
20
|
+
}[];
|
|
21
|
+
get bounds(): any;
|
|
22
|
+
set bounds(bounds: any): any;
|
|
23
|
+
render(ctx: CanvasRenderingContext2D): void;
|
|
24
|
+
_app: any;
|
|
25
|
+
_model: any;
|
|
26
|
+
_state: any;
|
|
27
|
+
_delta: any;
|
|
28
|
+
_animation: any;
|
|
29
|
+
_animate: any;
|
|
30
|
+
_parent: any;
|
|
31
|
+
_disposed: any;
|
|
32
|
+
_textHidden: any;
|
|
33
|
+
_text_substitutor: any;
|
|
34
|
+
_value_substitutor: any;
|
|
35
|
+
_mappings: any;
|
|
36
|
+
_realObject: import("@hatiolab/things-scene").IRealObject | undefined;
|
|
37
|
+
_cachedState: any;
|
|
38
|
+
updatedAt: any;
|
|
39
|
+
fontSize: any;
|
|
40
|
+
__cache__: any;
|
|
41
|
+
created(): void;
|
|
42
|
+
added(parent: any): void;
|
|
43
|
+
removed(parent: any): void;
|
|
44
|
+
ready(): Promise<void>;
|
|
45
|
+
touch(): void;
|
|
46
|
+
clearCache(...attrs: any[]): void;
|
|
47
|
+
removeSelf(completely: any): void;
|
|
48
|
+
resetAnimation(): void;
|
|
49
|
+
dispose(): void;
|
|
50
|
+
get nature(): import("@hatiolab/things-scene").ComponentNature;
|
|
51
|
+
get disposed(): boolean;
|
|
52
|
+
isLayer(): boolean;
|
|
53
|
+
isGroup(): boolean;
|
|
54
|
+
isContainer(): this is import("@hatiolab/things-scene/dist-types/types/component.js").Container;
|
|
55
|
+
isLine(): boolean;
|
|
56
|
+
isRoot(): boolean;
|
|
57
|
+
isRootModel(): boolean;
|
|
58
|
+
is3dish(): boolean;
|
|
59
|
+
get is3dMode(): boolean;
|
|
60
|
+
isIn3DSpace(): boolean;
|
|
61
|
+
isTemplate(): boolean;
|
|
62
|
+
isHTMLElement(): boolean;
|
|
63
|
+
isConnectable(): boolean;
|
|
64
|
+
isIdentifiable(): boolean;
|
|
65
|
+
isPositionable(): boolean;
|
|
66
|
+
replaceRefids(replaceMap: any): void;
|
|
67
|
+
get(property: any): any;
|
|
68
|
+
set(props: any, propval?: any): any;
|
|
69
|
+
getState(property: any): any;
|
|
70
|
+
setState(props: any, propval?: any): any;
|
|
71
|
+
get model(): any;
|
|
72
|
+
get state(): any;
|
|
73
|
+
get hierarchy(): any;
|
|
74
|
+
get volatile(): never[];
|
|
75
|
+
_applyProps(target: any, props: any, options: any): any;
|
|
76
|
+
move(offset: {
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
}, ...args: boolean[]): void;
|
|
80
|
+
symmetryX(x?: number): void;
|
|
81
|
+
symmetryY(y: number): void;
|
|
82
|
+
adjustResize(bounds: import("@hatiolab/things-scene").BOUNDS, origin_bounds: import("@hatiolab/things-scene").BOUNDS, diagonal: boolean): {
|
|
83
|
+
left: any;
|
|
84
|
+
top: any;
|
|
85
|
+
width: any;
|
|
86
|
+
height: any;
|
|
87
|
+
};
|
|
88
|
+
adjustRotation(rotation: number, step: boolean): number;
|
|
89
|
+
outline(progress: number): any;
|
|
90
|
+
get center(): import("@hatiolab/things-scene").POINT;
|
|
91
|
+
set center(p: import("@hatiolab/things-scene").POINT): any;
|
|
92
|
+
get location(): import("@hatiolab/things-scene").POINT;
|
|
93
|
+
set location(l: import("@hatiolab/things-scene").POINT): any;
|
|
94
|
+
get rotate(): import("@hatiolab/things-scene").POINT;
|
|
95
|
+
set rotate(r: import("@hatiolab/things-scene").POINT): any;
|
|
96
|
+
get dimension(): import("@hatiolab/things-scene").DIMENSION;
|
|
97
|
+
set dimension(d: import("@hatiolab/things-scene").DIMENSION): any;
|
|
98
|
+
get drawPath(): import("@hatiolab/things-scene").POINT[];
|
|
99
|
+
get rotatePoint(): import("@hatiolab/things-scene").POINT;
|
|
100
|
+
get mutable(): boolean;
|
|
101
|
+
get resizable(): boolean;
|
|
102
|
+
get rotatable(): boolean;
|
|
103
|
+
buildRealObject(): import("@hatiolab/things-scene").IRealObject | undefined;
|
|
104
|
+
get realObject(): import("@hatiolab/things-scene").IRealObject | undefined;
|
|
105
|
+
draw(context?: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
106
|
+
prerender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
107
|
+
postrender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
108
|
+
prepare(resolve: (component: Component) => void, reject: (reason: any) => void): void;
|
|
109
|
+
prepareIf(condition: boolean): void;
|
|
110
|
+
drawText(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
111
|
+
drawStroke(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
112
|
+
drawFill(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
113
|
+
get strokeStyle(): any;
|
|
114
|
+
set strokeStyle(v: any): any;
|
|
115
|
+
get fillStyle(): any;
|
|
116
|
+
set fillStyle(v: any): any;
|
|
117
|
+
get fontColor(): string;
|
|
118
|
+
set fontColor(v: string): any;
|
|
119
|
+
get rotation(): number;
|
|
120
|
+
set rotation(v: number): any;
|
|
121
|
+
get decorators(): string[];
|
|
122
|
+
get decotag(): string;
|
|
123
|
+
get hidden(): boolean;
|
|
124
|
+
set hidden(v: boolean): any;
|
|
125
|
+
get tag(): string;
|
|
126
|
+
set tag(v: string): any;
|
|
127
|
+
get appendum(): any;
|
|
128
|
+
set appendum(v: any): any;
|
|
129
|
+
defaultTextSubstitutor(): string;
|
|
130
|
+
textLines(context?: import("@hatiolab/things-scene").SceneRenderContext): any[][];
|
|
131
|
+
get font(): string;
|
|
132
|
+
get lineHeight(): number;
|
|
133
|
+
get textSubstitutor(): () => string;
|
|
134
|
+
get text(): string;
|
|
135
|
+
set text(v: string): any;
|
|
136
|
+
get textBounds(): import("@hatiolab/things-scene").BOUNDS;
|
|
137
|
+
get textRotation(): number;
|
|
138
|
+
get textHidden(): boolean;
|
|
139
|
+
set textHidden(v: boolean): any;
|
|
140
|
+
get hasTextProperty(): boolean;
|
|
141
|
+
animate(opts: import("@hatiolab/things-scene").AnimationConfig): any;
|
|
142
|
+
effect(context: import("@hatiolab/things-scene").SceneRenderContext, model: any): void;
|
|
143
|
+
serialize(...others: any[]): string;
|
|
144
|
+
trim(): void;
|
|
145
|
+
closeScene(data: any): void;
|
|
146
|
+
delta(attr?: string | object, value?: any): any;
|
|
147
|
+
invalidate(): void;
|
|
148
|
+
get value(): any;
|
|
149
|
+
set value(v: any): any;
|
|
150
|
+
get data(): any;
|
|
151
|
+
set data(v: any): any;
|
|
152
|
+
set tap(v: any): any;
|
|
153
|
+
get mappings(): any[];
|
|
154
|
+
get retention(): number;
|
|
155
|
+
get animation(): import("@hatiolab/things-scene").AnimationController | undefined;
|
|
156
|
+
get started(): boolean;
|
|
157
|
+
set started(v: boolean): any;
|
|
158
|
+
get controls(): import("@hatiolab/things-scene").Control[] | undefined;
|
|
159
|
+
findFirst(finder: string | ((c: Component) => boolean), ...others: any[]): Component | undefined;
|
|
160
|
+
findAll(s: string | ((c: Component) => boolean), ...others: any[]): any[] | undefined;
|
|
161
|
+
capture(x: number, y: number, except?: (c: Component) => boolean): any;
|
|
162
|
+
findAnchor(name: string): any;
|
|
163
|
+
isDescendible(container: Component): boolean;
|
|
164
|
+
getContext(component?: unknown): any;
|
|
165
|
+
get root(): Component;
|
|
166
|
+
get rootModel(): Component;
|
|
167
|
+
get parent(): Component;
|
|
168
|
+
set parent(v: Component): any;
|
|
169
|
+
get scalable(): boolean;
|
|
170
|
+
get stuck(): boolean;
|
|
171
|
+
get capturable(): boolean;
|
|
172
|
+
get position(): string;
|
|
173
|
+
get origin(): string;
|
|
174
|
+
get offset(): import("@hatiolab/things-scene").POINT;
|
|
175
|
+
get app(): import("@hatiolab/things-scene").ApplicationContext;
|
|
176
|
+
drawEffect(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
177
|
+
prepareFill(resolve: Function, reject: Function): void;
|
|
178
|
+
prepareFillIf(condition: boolean): void;
|
|
179
|
+
onchangeFill(after: Record<string, any>, before: Record<string, any>): void;
|
|
180
|
+
drawImage(context: import("@hatiolab/things-scene").SceneRenderContext, image: HTMLImageElement, left: number, top: number, width: number, height: number): void;
|
|
181
|
+
mutateBounds(logic: ((bounds: import("@hatiolab/things-scene").BOUNDS) => import("@hatiolab/things-scene").BOUNDS | void) | null, context?: any): void;
|
|
182
|
+
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;
|
|
183
|
+
access(accessor: string): any;
|
|
184
|
+
substitute(template: string, data: any): string | undefined;
|
|
185
|
+
onchangeMappings(after: Record<string, any>, before: Record<string, any>): void;
|
|
186
|
+
onchangeData(after: Record<string, any>, before: Record<string, any>): void;
|
|
187
|
+
buildMappings(): void;
|
|
188
|
+
executeMappings(force?: boolean): void;
|
|
189
|
+
disposeMappings(): void;
|
|
190
|
+
ondropfile(transfered: FileList, files: string[]): void;
|
|
191
|
+
transcoordS2P(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
192
|
+
transcoordP2S(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
193
|
+
transcoordS2T(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
194
|
+
transcoordT2P(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
195
|
+
transcoordT2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
196
|
+
transcoordS2TR(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
197
|
+
transcoordS2O(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
198
|
+
transcoordC2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
199
|
+
transcoordS2C(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
200
|
+
toParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
201
|
+
fromParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
202
|
+
toScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
203
|
+
fromScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
204
|
+
toLocal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
205
|
+
toGlobal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
206
|
+
toOther(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
207
|
+
on(name: string | object, callback: Function, context?: any): any;
|
|
208
|
+
off(name?: string | object, callback?: Function, context?: any): any;
|
|
209
|
+
once(name: string | object, callback: Function, context?: any): any;
|
|
210
|
+
trigger(name: string, ...args: any[]): any;
|
|
211
|
+
delegate_on(delegator: any): any;
|
|
212
|
+
delegate_off(delegator: any): any;
|
|
213
|
+
onchange(after: Record<string, any>, before: Record<string, any>): void;
|
|
214
|
+
calculateBounds?(): void;
|
|
215
|
+
oncreate_element?(element: HTMLElement): void;
|
|
216
|
+
removeComponent(component: Component, ghost?: boolean): void;
|
|
217
|
+
addComponent(component: Component, ghost?: boolean): void;
|
|
218
|
+
insertComponentAt(component: Component, index: number, ghost?: boolean): void;
|
|
219
|
+
getOverlay(component: Component): HTMLElement | undefined;
|
|
220
|
+
findById(id: string): Component | undefined;
|
|
221
|
+
findByRefid(ref: string | number): Component | undefined;
|
|
222
|
+
findAllById(id: string): Component[];
|
|
223
|
+
resize(): void;
|
|
224
|
+
fit(type?: string): void;
|
|
225
|
+
get components(): Component[] | undefined;
|
|
226
|
+
get layout(): any;
|
|
227
|
+
get auxOverlay(): HTMLElement | undefined;
|
|
228
|
+
get isReady(): boolean;
|
|
229
|
+
get unitScale(): number;
|
|
230
|
+
get selected(): Component[];
|
|
231
|
+
set selected(_v: Component[]): any;
|
|
232
|
+
get focused(): Component | null;
|
|
233
|
+
set focused(_v: Component | null): any;
|
|
234
|
+
get hasSameParentForAllSelected(): boolean;
|
|
235
|
+
set hasSameParentForAllSelected(_v: boolean): any;
|
|
236
|
+
get fitMode(): string | undefined;
|
|
237
|
+
set fitMode(_v: string | undefined): any;
|
|
238
|
+
get element(): HTMLElement | null;
|
|
239
|
+
set element(_v: HTMLElement | null): any;
|
|
240
|
+
}) & typeof Shape;
|
|
5
241
|
export default class Indicator extends Indicator_base {
|
|
6
242
|
lit: boolean;
|
|
7
243
|
ledLit: boolean;
|
|
@@ -44,7 +280,9 @@ export default class Indicator extends Indicator_base {
|
|
|
44
280
|
get getConf(): any;
|
|
45
281
|
set setConf(conf: any);
|
|
46
282
|
get gateway(): Gateway;
|
|
47
|
-
get ledRect():
|
|
283
|
+
get ledRect(): {
|
|
284
|
+
strokeStyle?: string;
|
|
285
|
+
};
|
|
48
286
|
dispose(): void;
|
|
49
287
|
/**
|
|
50
288
|
*
|
package/dist/indicator.js
CHANGED
|
@@ -92,30 +92,31 @@ const NATURE = {
|
|
|
92
92
|
const WIDTH = 449;
|
|
93
93
|
const HEIGHT = 53;
|
|
94
94
|
const RECT_BUTTON_EDGE = 3;
|
|
95
|
-
let Indicator =
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
95
|
+
let Indicator = class Indicator extends RectPath(Shape) {
|
|
96
|
+
static { Indicator_1 = this; }
|
|
97
|
+
lit = false;
|
|
98
|
+
ledLit = false;
|
|
99
|
+
store = {};
|
|
100
|
+
conf = {
|
|
101
|
+
seg_role: ['S', 'S'],
|
|
102
|
+
alignment: 'R',
|
|
103
|
+
btn_mode: 'S',
|
|
104
|
+
btn_intvl: 5,
|
|
105
|
+
bf_on_msg: '',
|
|
106
|
+
bf_on_msg_t: 1,
|
|
107
|
+
bf_on_delay: 1,
|
|
108
|
+
cncl_delay: 10,
|
|
109
|
+
blink_if_full: true,
|
|
110
|
+
off_use_res: false,
|
|
111
|
+
led_bar_mode: 'S',
|
|
112
|
+
led_bar_intvl: 5,
|
|
113
|
+
led_bar_brtns: 6
|
|
114
|
+
};
|
|
115
|
+
currentTask = 'ready';
|
|
116
|
+
cookedData = {};
|
|
117
|
+
readOnly;
|
|
118
|
+
version;
|
|
119
|
+
static _image;
|
|
119
120
|
static get image() {
|
|
120
121
|
if (!Indicator_1._image) {
|
|
121
122
|
Indicator_1._image = new Image();
|
|
@@ -191,7 +192,7 @@ let Indicator = Indicator_1 = class Indicator extends RectPath(Shape) {
|
|
|
191
192
|
// return gateway
|
|
192
193
|
}
|
|
193
194
|
get ledRect() {
|
|
194
|
-
return this.parent.findFirst('rect') || {};
|
|
195
|
+
return (this.parent.findFirst('rect') || {});
|
|
195
196
|
}
|
|
196
197
|
dispose() {
|
|
197
198
|
super.dispose();
|