From 751508ff7f8a625b0c38129e9b93034031abd2a6 Mon Sep 17 00:00:00 2001 From: vivid Date: Tue, 18 Oct 2016 17:25:05 +0900 Subject: [PATCH 1/5] temp commit --- dist/entry.js | 34 +++++++++++++++++++++++++++++++--- src/function.js | 21 ++++++++++++++++++++- src/workspace/block_view.js | 9 ++++++++- 3 files changed, 59 insertions(+), 5 deletions(-) diff --git a/dist/entry.js b/dist/entry.js index b4011bb4e7..37ad38b88e 100644 --- a/dist/entry.js +++ b/dist/entry.js @@ -17153,7 +17153,7 @@ Entry.Model = function(b, a) { Entry.Func = function(b) { this.id = b ? b.id : Entry.generateHash(); this.content = b ? new Entry.Code(b.content) : new Entry.Code([[{type:"function_create", copyable:!1, deletable:!1, x:40, y:40}]]); - this.blockMenuBlock = this.block = null; + this._backupContent = this.blockMenuBlock = this.block = null; this.hashMap = {}; this.paramMap = {}; Entry.generateFunctionSchema(this.id); @@ -17199,6 +17199,9 @@ Entry.Func.edit = function(b) { this.initEditView(b.content); this.bindFuncChangeEvent(); this.updateMenu(); + window.setTimeout(function() { + this.targetFunc.content.board.reDraw(); + }.bind(this), 0); }; Entry.Func.initEditView = function(b) { this.menuCode || this.setupMenuCode(); @@ -17217,9 +17220,11 @@ Entry.Func.endEdit = function(b) { switch(b) { case "save": this.save(); + break; case "cancelEdit": this.cancelEdit(); } + this._backupContent = null; }; Entry.Func.save = function() { this.targetFunc.generateBlock(!0); @@ -17258,7 +17263,28 @@ Entry.Func.syncFuncName = function(b) { Blockly.Xml.domToWorkspace(Blockly.mainWorkspace, a); }; Entry.Func.cancelEdit = function() { - this.targetFunc && (Entry.Func.isEdit = !1, this.targetFunc.block || (this._targetFuncBlock.destroy(), delete Entry.variableContainer.functions_[this.targetFunc.id], delete Entry.variableContainer.selected), delete this.targetFunc, this.updateMenu(), Entry.variableContainer.updateList(), Entry.playground.mainWorkspace.setMode(Entry.Workspace.MODE_BOARD)); + if (this.targetFunc) { + var b = Entry.playground.mainWorkspace; + Entry.Func.isEdit = !1; + if (!this.targetFunc.block) { + this._targetFuncBlock.destroy(), delete Entry.variableContainer.functions_[this.targetFunc.id], delete Entry.variableContainer.selected; + } else { + if (this._backupContent) { + b.overlayBoard.show(); + this.targetFunc.content.load(this._backupContent); + Entry.generateFunctionSchema(this.targetFunc.id); + var a = this.targetFunc.content._blockMap, d; + for (d in a) { + Entry.Func.registerParamBlock(a[d].type); + } + b.overlayBoard.hide(); + } + } + delete this.targetFunc; + this.updateMenu(); + Entry.variableContainer.updateList(); + b.setMode(Entry.Workspace.MODE_BOARD); + } }; Entry.Func.getMenuXml = function() { var b = []; @@ -21311,7 +21337,9 @@ Entry.BlockView.pngMap = {}; if (b) { for (var c = 0;c < b.length;c++) { var e = b[c]; - e instanceof Entry.Block && e.view && e.view.reDraw(); + e instanceof Entry.Block && e.view && (e.view.reDraw(), (e = e.params) && e.forEach(function(a) { + a instanceof Entry.Block && a.view && a.view.reDraw(); + })); } } if (a = a.statements) { diff --git a/src/function.js b/src/function.js index 2bcad221bc..0deb67e811 100644 --- a/src/function.js +++ b/src/function.js @@ -24,6 +24,7 @@ Entry.Func = function(func) { ]); this.block = null; this.blockMenuBlock = null; + this._backupContent = null; this.hashMap = {}; this.paramMap = {}; @@ -89,7 +90,11 @@ Entry.Func.edit = function(func) { this.targetFunc = func; this.initEditView(func.content); this.bindFuncChangeEvent(); + //this._backupContent = func.content.stringify(); this.updateMenu(); + window.setTimeout(function() { + this.targetFunc.content.board.reDraw(); + }.bind(this), 0); }; Entry.Func.initEditView = function(content) { @@ -111,9 +116,12 @@ Entry.Func.endEdit = function(message) { switch(message){ case "save": this.save(); + break; case "cancelEdit": this.cancelEdit(); + break; } + this._backupContent = null; } Entry.Func.save = function() { @@ -169,16 +177,27 @@ Entry.Func.syncFuncName = function(dstFName) { Entry.Func.cancelEdit = function() { if (!this.targetFunc) return; + var workspace = Entry.playground.mainWorkspace; Entry.Func.isEdit = false; if (!this.targetFunc.block) { this._targetFuncBlock.destroy(); delete Entry.variableContainer.functions_[this.targetFunc.id]; delete Entry.variableContainer.selected; + } else { + if (this._backupContent) { + workspace.overlayBoard.show(); + this.targetFunc.content.load(this._backupContent); + Entry.generateFunctionSchema(this.targetFunc.id); + var blockMap = this.targetFunc.content._blockMap; + for (var key in blockMap) { + Entry.Func.registerParamBlock(blockMap[key].type); + } + workspace.overlayBoard.hide(); + } } delete this.targetFunc; this.updateMenu(); Entry.variableContainer.updateList(); - var workspace = Entry.playground.mainWorkspace; workspace.setMode(Entry.Workspace.MODE_BOARD); }; diff --git a/src/workspace/block_view.js b/src/workspace/block_view.js index 86c926f98b..55186f6b40 100644 --- a/src/workspace/block_view.js +++ b/src/workspace/block_view.js @@ -281,7 +281,6 @@ Entry.BlockView.pngMap = {}; var secondLineHeight = 0; for (var i = 0; i < this._contents.length; i++) { var c = this._contents[i]; - if (c instanceof Entry.FieldLineBreak) { this._alignStatement(animate, statementIndex); c.align(statementIndex); @@ -1030,6 +1029,14 @@ Entry.BlockView.pngMap = {}; var param = params[i]; if (param instanceof Entry.Block && param.view) { param.view.reDraw(); + var innerParams = param.params; + if (innerParams) { + innerParams.forEach(function(p) { + if (p instanceof Entry.Block && p.view) { + p.view.reDraw(); + } + }); + } } } } From dc2076bf6bbe4f567f0ebfc48fbe1963b930cf3e Mon Sep 17 00:00:00 2001 From: vivid Date: Thu, 20 Oct 2016 18:31:08 +0900 Subject: [PATCH 2/5] temp commit --- dist/entry.js | 109 +++++++++++++++------------------- src/function.js | 60 ++++++++++++------- src/workspace/block.js | 1 + src/workspace/block_view.js | 28 +++------ src/workspace/field/block.js | 22 +++++-- src/workspace/field/output.js | 17 ++++-- 6 files changed, 122 insertions(+), 115 deletions(-) diff --git a/dist/entry.js b/dist/entry.js index 37ad38b88e..567fd20f8d 100644 --- a/dist/entry.js +++ b/dist/entry.js @@ -17198,10 +17198,8 @@ Entry.Func.edit = function(b) { this.targetFunc = b; this.initEditView(b.content); this.bindFuncChangeEvent(); + this._backupContent = b.content.stringify(); this.updateMenu(); - window.setTimeout(function() { - this.targetFunc.content.board.reDraw(); - }.bind(this), 0); }; Entry.Func.initEditView = function(b) { this.menuCode || this.setupMenuCode(); @@ -17225,6 +17223,9 @@ Entry.Func.endEdit = function(b) { this.cancelEdit(); } this._backupContent = null; + Entry.playground.mainWorkspace.setMode(Entry.Workspace.MODE_BOARD); + delete this.targetFunc; + this.updateMenu(); }; Entry.Func.save = function() { this.targetFunc.generateBlock(!0); @@ -17263,28 +17264,7 @@ Entry.Func.syncFuncName = function(b) { Blockly.Xml.domToWorkspace(Blockly.mainWorkspace, a); }; Entry.Func.cancelEdit = function() { - if (this.targetFunc) { - var b = Entry.playground.mainWorkspace; - Entry.Func.isEdit = !1; - if (!this.targetFunc.block) { - this._targetFuncBlock.destroy(), delete Entry.variableContainer.functions_[this.targetFunc.id], delete Entry.variableContainer.selected; - } else { - if (this._backupContent) { - b.overlayBoard.show(); - this.targetFunc.content.load(this._backupContent); - Entry.generateFunctionSchema(this.targetFunc.id); - var a = this.targetFunc.content._blockMap, d; - for (d in a) { - Entry.Func.registerParamBlock(a[d].type); - } - b.overlayBoard.hide(); - } - } - delete this.targetFunc; - this.updateMenu(); - Entry.variableContainer.updateList(); - b.setMode(Entry.Workspace.MODE_BOARD); - } + this.targetFunc && (this.targetFunc.block ? this._backupContent && this._backupContent !== this.targetFunc.content.stringify() && (this.targetFunc.content.load(this._backupContent), Entry.generateFunctionSchema(this.targetFunc.id), Entry.Func.generateWsBlock(this.targetFunc)) : (this._targetFuncBlock.destroy(), delete Entry.variableContainer.functions_[this.targetFunc.id], delete Entry.variableContainer.selected), Entry.variableContainer.updateList(), Entry.Func.isEdit = !1); }; Entry.Func.getMenuXml = function() { var b = []; @@ -17396,9 +17376,25 @@ Entry.Func.generateWsBlock = function(b) { d++; f += " %" + (d + c); e.push({type:"Indicator", img:"block_icon/function_03.png", size:12}); - Entry.Mutator.mutate("func_" + b.id, {params:e, template:f}); - for (var l in g) { - g[l] ? (a = -1 < l.indexOf("string") ? Lang.Blocks.FUNCTION_character_variable : Lang.Blocks.FUNCTION_logical_variable, Entry.Mutator.mutate(l, {template:a})) : g[l] = !0; + a = "func_" + b.id; + d = Entry.block[a]; + c = !1; + if (d.template !== f) { + c = !0; + } else { + if (d.params.length === e.length) { + for (h = 0;h < d.params.length - 1;h++) { + var k = d.params[h], l = e[h]; + if (k.type !== l.type || k.accept !== l.accept) { + c = !0; + break; + } + } + } + } + c && Entry.Mutator.mutate(a, {params:e, template:f}); + for (var m in g) { + g[m] ? (e = -1 < m.indexOf("string") ? Lang.Blocks.FUNCTION_character_variable : Lang.Blocks.FUNCTION_logical_variable, Entry.Mutator.mutate(m, {template:e})) : g[m] = !0; } this.bindFuncChangeEvent(b); }; @@ -21305,9 +21301,9 @@ Entry.BlockView.pngMap = {}; this._updateContents(); }; b._updateContents = function() { - for (var a = 0;a < this._contents.length;a++) { - this._contents[a].renderStart(); - } + this._contents.forEach(function(a) { + a.renderStart(); + }.bind(this)); this.alignContent(!1); }; b._destroyObservers = function() { @@ -21332,24 +21328,17 @@ Entry.BlockView.pngMap = {}; b.reDraw = function() { if (this.visible) { var a = this.block; - requestAnimFrame(this._updateContents.bind(this)); - var b = a.params; + this._updateContents(); + var b = a.statements; if (b) { - for (var c = 0;c < b.length;c++) { - var e = b[c]; - e instanceof Entry.Block && e.view && (e.view.reDraw(), (e = e.params) && e.forEach(function(a) { - a instanceof Entry.Block && a.view && a.view.reDraw(); - })); + for (a = 0;a < b.length;a++) { + b[a].view.reDraw(); } } - if (a = a.statements) { - for (c = 0;c < a.length;c++) { - a[c].view.reDraw(); - } - } - if (a = this._extensions) { - for (c = 0;c < a.length;c++) { - b = a[c], b.updatePos && b.updatePos(); + if (b = this._extensions) { + for (a = 0;a < b.length;a++) { + var c = b[a]; + c.updatePos && c.updatePos(); } } } @@ -22194,12 +22183,12 @@ Entry.Utils.inherit(Entry.Field, Entry.FieldBlock); (function(b) { b.schema = {magneting:!1}; b.renderStart = function(a, b) { - this.svgGroup = this._blockView.contentSvgGroup.elem("g"); + this.svgGroup || (this.svgGroup = this._blockView.contentSvgGroup.elem("g")); this.view = this; this._nextGroup = this.svgGroup; this.box.set({x:0, y:0, width:0, height:20}); var c = this.getValue(); - c && !c.view && (c.setThread(this), c.createView(a, b), c.getThread().view.setParent(this)); + c && !c.view ? (c.setThread(this), c.createView(a, b), c.getThread().view.setParent(this)) : c && c.view && (c.destroyView(), c.createView(this._blockView.getBoard())); this.updateValueBlock(c); this._blockView.getBoard().constructor !== Entry.Board && this._valueBlock.view.removeControl(); }; @@ -22207,14 +22196,14 @@ Entry.Utils.inherit(Entry.Field, Entry.FieldBlock); var e = this.svgGroup; this._position && (this._position.x && (a = this._position.x), this._position.y && (b = this._position.y)); var f = this._valueBlock; - f && (b = -.5 * f.view.height); + f && f && f.view && (b = -.5 * f.view.height); f = "translate(" + a + "," + b + ")"; void 0 === c || c ? e.animate({transform:f}, 300, mina.easeinout) : e.attr({transform:f}); this.box.set({x:a, y:b}); }; b.calcWH = function() { var a = this._valueBlock; - a ? (a = a.view, this.box.set({width:a.width, height:a.height})) : this.box.set({width:15, height:20}); + a && a && a.view ? (a = a.view, this.box.set({width:a.width, height:a.height})) : this.box.set({width:15, height:20}); }; b.calcHeight = b.calcWH; b.destroy = function() { @@ -22251,14 +22240,7 @@ Entry.Utils.inherit(Entry.Field, Entry.FieldBlock); }; b.updateValueBlock = function(a) { a instanceof Entry.Block || (a = void 0); - this._destroyObservers(); - a = this._setValueBlock(a).view; - a.bindPrev(this); - this._blockView.alignContent(); - this._posObserver = a.observe(this, "updateValueBlock", ["x", "y"], !1); - this._sizeObserver = a.observe(this, "calcWH", ["width", "height"]); - a = this._blockView.getBoard(); - a.constructor === Entry.Board && a.generateCodeMagnetMap(); + a && a === this._valueBlock ? this.calcWH() : (this._destroyObservers(), a = this._setValueBlock(a).view, a.bindPrev(this), this._blockView.alignContent(), this._posObserver = a.observe(this, "updateValueBlock", ["x", "y"], !1), this._sizeObserver = a.observe(this, "calcWH", ["width", "height"]), a = this._blockView.getBoard(), a.constructor === Entry.Board && a.generateCodeMagnetMap()); }; b._destroyObservers = function() { this._sizeObserver && this._sizeObserver.destroy(); @@ -22730,12 +22712,13 @@ Entry.Utils.inherit(Entry.Field, Entry.FieldOutput); (function(b) { b.schema = {magneting:!1}; b.renderStart = function(a, b) { + this.svgGroup && $(this.svgGroup).remove(); this.svgGroup = this._blockView.contentSvgGroup.elem("g"); this.view = this; this._nextGroup = this.svgGroup; this.box.set({x:0, y:0, width:0, height:20}); var c = this.getValue(); - c && !c.view && (c.setThread(this), c.createView(a, b)); + c && !c.view ? (c.setThread(this), c.createView(a, b)) : c && c.view && (c.destroyView(), c.createView(this._blockView.getBoard())); this._updateValueBlock(c); this._blockView.getBoard().constructor == Entry.BlockMenu && this._valueBlock && this._valueBlock.view.removeControl(); }; @@ -22766,10 +22749,11 @@ Entry.Utils.inherit(Entry.Field, Entry.FieldOutput); a instanceof Entry.Block || (a = void 0); this._sizeObserver && this._sizeObserver.destroy(); this._posObserver && this._posObserver.destroy(); - (a = this._setValueBlock(a)) ? (a = a.view, a.bindPrev(), this._posObserver = a.observe(this, "_updateValueBlock", ["x", "y"], !1), this._sizeObserver = a.observe(this, "calcWH", ["width", "height"])) : this.calcWH(); + if (a = this._setValueBlock(a)) { + a = a.view, a.bindPrev(), this._posObserver = a.observe(this, "_updateValueBlock", ["x", "y"], !1), this._sizeObserver = a.observe(this, "calcWH", ["width", "height"]); + } + this.calcWH(); this._blockView.alignContent(); - a = this._blockView.getBoard(); - a.constructor === Entry.Board && a.generateCodeMagnetMap(); }; b.getPrevBlock = function(a) { return this._valueBlock === a ? this : null; @@ -24312,6 +24296,7 @@ Entry.Block.DELETABLE_FALSE_LIGHTEN = 3; this.view || (this.set({view:new Entry.BlockView(this, a, b)}), this._updatePos()); }; b.destroyView = function() { + this.view.destroy(); this.set({view:null}); }; b.clone = function(a) { diff --git a/src/function.js b/src/function.js index 0deb67e811..fc55d30a5e 100644 --- a/src/function.js +++ b/src/function.js @@ -90,11 +90,8 @@ Entry.Func.edit = function(func) { this.targetFunc = func; this.initEditView(func.content); this.bindFuncChangeEvent(); - //this._backupContent = func.content.stringify(); + this._backupContent = func.content.stringify(); this.updateMenu(); - window.setTimeout(function() { - this.targetFunc.content.board.reDraw(); - }.bind(this), 0); }; Entry.Func.initEditView = function(content) { @@ -122,6 +119,9 @@ Entry.Func.endEdit = function(message) { break; } this._backupContent = null; + Entry.playground.mainWorkspace.setMode(Entry.Workspace.MODE_BOARD); + delete this.targetFunc; + this.updateMenu(); } Entry.Func.save = function() { @@ -175,30 +175,22 @@ Entry.Func.syncFuncName = function(dstFName) { }; Entry.Func.cancelEdit = function() { - if (!this.targetFunc) - return; - var workspace = Entry.playground.mainWorkspace; - Entry.Func.isEdit = false; + if (!this.targetFunc) return; + if (!this.targetFunc.block) { this._targetFuncBlock.destroy(); delete Entry.variableContainer.functions_[this.targetFunc.id]; delete Entry.variableContainer.selected; } else { - if (this._backupContent) { - workspace.overlayBoard.show(); + if (this._backupContent && + this._backupContent !== this.targetFunc.content.stringify()) { this.targetFunc.content.load(this._backupContent); Entry.generateFunctionSchema(this.targetFunc.id); - var blockMap = this.targetFunc.content._blockMap; - for (var key in blockMap) { - Entry.Func.registerParamBlock(blockMap[key].type); - } - workspace.overlayBoard.hide(); + Entry.Func.generateWsBlock(this.targetFunc); } } - delete this.targetFunc; - this.updateMenu(); Entry.variableContainer.updateList(); - workspace.setMode(Entry.Workspace.MODE_BOARD); + Entry.Func.isEdit = false; }; Entry.Func.getMenuXml = function() { @@ -444,10 +436,34 @@ Entry.Func.generateWsBlock = function(targetFunc) { "img": "block_icon/function_03.png", "size": 12 }); - Entry.Mutator.mutate( - "func_" + targetFunc.id, - {params: schemaParams, template: schemaTemplate} - ); + + var funcName = "func_" + targetFunc.id; + var origin = Entry.block[funcName]; + + var shouldGenerate = false; + + if (origin.template !== schemaTemplate) + shouldGenerate = true; + else if (origin.params.length === schemaParams.length) { + for (var i=0; i Date: Fri, 21 Oct 2016 11:44:03 +0900 Subject: [PATCH 3/5] reDraw and blockMenu perf --- dist/entry.js | 33 ++++++++++++++++++++------------- src/function.js | 3 ++- src/workspace/block_menu.js | 9 +++++++-- src/workspace/block_view.js | 2 +- src/workspace/field/block.js | 3 +-- src/workspace/field/output.js | 16 ++++++++++------ 6 files changed, 41 insertions(+), 25 deletions(-) diff --git a/dist/entry.js b/dist/entry.js index 567fd20f8d..e9748776dd 100644 --- a/dist/entry.js +++ b/dist/entry.js @@ -17208,8 +17208,9 @@ Entry.Func.initEditView = function(b) { a.changeOverlayBoardCode(b); b.recreateView(); a.changeOverlayBoardCode(b); - b.view.board.alignThreads(); this._workspaceStateEvent = a.changeEvent.attach(this, this.endEdit); + b.view.reDraw(); + b.view.board.alignThreads(); }; Entry.Func.endEdit = function(b) { this.unbindFuncChangeEvent(); @@ -20317,6 +20318,7 @@ Entry.BlockMenu = function(b, a, d, c) { this._bannedClass = []; this._categories = []; this.suffix = "blockMenu"; + this._isSelectMenu = !1; b = "string" === typeof b ? $("#" + b) : $(b); if ("DIV" !== b.prop("tagName")) { return console.error("Dom is not div element"); @@ -20392,7 +20394,7 @@ Entry.BlockMenu = function(b, a, d, c) { var b = this.code; if (b) { this._clearSplitters(); - b.view && !a && b.view.reDraw(); + !b.view || a || this._isSelectMenu || b.view.reDraw(); a = b.getThreads(); for (var b = 10, c = "LEFT" == this._align ? 10 : this.svgDom.width() / 2, e, f = 0, g = a.length;f < g;f++) { var h = a[f].getFirstBlock(), k = h.view, h = Entry.block[h.type]; @@ -20517,6 +20519,7 @@ Entry.BlockMenu = function(b, a, d, c) { b.selectMenu = function(a, b) { var c = this._convertSelector(a); if (c) { + this._isSelectMenu = !0; switch(c) { case "variable": Entry.playground.checkVariables(); @@ -20532,6 +20535,7 @@ Entry.BlockMenu = function(b, a, d, c) { k.removeClass("foldOut"); Entry.windowResized.notify(); }); + this._isSelectMenu = !1; this.visible && (f = this._categoryCodes[c], this._selectedCategoryView = e, e.addClass("entrySelectedCategory"), f.constructor !== Entry.Code && (f = this._categoryCodes[c] = new Entry.Code(f)), this.changeCode(f)); this.lastSelector = c; } else { @@ -21326,7 +21330,7 @@ Entry.BlockView.pngMap = {}; this.svgGroup.removeClass("activated"); }; b.reDraw = function() { - if (this.visible) { + if (this.visible && this.display) { var a = this.block; this._updateContents(); var b = a.statements; @@ -22188,7 +22192,7 @@ Entry.Utils.inherit(Entry.Field, Entry.FieldBlock); this._nextGroup = this.svgGroup; this.box.set({x:0, y:0, width:0, height:20}); var c = this.getValue(); - c && !c.view ? (c.setThread(this), c.createView(a, b), c.getThread().view.setParent(this)) : c && c.view && (c.destroyView(), c.createView(this._blockView.getBoard())); + c && !c.view ? (c.setThread(this), c.createView(a, b), c.getThread().view.setParent(this)) : c && c.view && c.view.reDraw(); this.updateValueBlock(c); this._blockView.getBoard().constructor !== Entry.Board && this._valueBlock.view.removeControl(); }; @@ -22712,13 +22716,12 @@ Entry.Utils.inherit(Entry.Field, Entry.FieldOutput); (function(b) { b.schema = {magneting:!1}; b.renderStart = function(a, b) { - this.svgGroup && $(this.svgGroup).remove(); - this.svgGroup = this._blockView.contentSvgGroup.elem("g"); + this.svgGroup || (this.svgGroup = this._blockView.contentSvgGroup.elem("g")); this.view = this; this._nextGroup = this.svgGroup; this.box.set({x:0, y:0, width:0, height:20}); var c = this.getValue(); - c && !c.view ? (c.setThread(this), c.createView(a, b)) : c && c.view && (c.destroyView(), c.createView(this._blockView.getBoard())); + c && !c.view ? (c.setThread(this), c.createView(a, b)) : c && c.view && c.view.reDraw(); this._updateValueBlock(c); this._blockView.getBoard().constructor == Entry.BlockMenu && this._valueBlock && this._valueBlock.view.removeControl(); }; @@ -22747,13 +22750,17 @@ Entry.Utils.inherit(Entry.Field, Entry.FieldOutput); }; b._updateValueBlock = function(a) { a instanceof Entry.Block || (a = void 0); - this._sizeObserver && this._sizeObserver.destroy(); - this._posObserver && this._posObserver.destroy(); - if (a = this._setValueBlock(a)) { - a = a.view, a.bindPrev(), this._posObserver = a.observe(this, "_updateValueBlock", ["x", "y"], !1), this._sizeObserver = a.observe(this, "calcWH", ["width", "height"]); + if (a && a === this._valueBlock) { + this.calcWH(); + } else { + this._sizeObserver && this._sizeObserver.destroy(); + this._posObserver && this._posObserver.destroy(); + if (a = this._setValueBlock(a)) { + a = a.view, a.bindPrev(), this._posObserver = a.observe(this, "_updateValueBlock", ["x", "y"], !1), this._sizeObserver = a.observe(this, "calcWH", ["width", "height"]); + } + this.calcWH(); + this._blockView.alignContent(); } - this.calcWH(); - this._blockView.alignContent(); }; b.getPrevBlock = function(a) { return this._valueBlock === a ? this : null; diff --git a/src/function.js b/src/function.js index fc55d30a5e..ed6082295b 100644 --- a/src/function.js +++ b/src/function.js @@ -102,8 +102,9 @@ Entry.Func.initEditView = function(content) { workspace.changeOverlayBoardCode(content); content.recreateView(); workspace.changeOverlayBoardCode(content); - content.view.board.alignThreads(); this._workspaceStateEvent = workspace.changeEvent.attach(this, this.endEdit); + content.view.reDraw(); + content.view.board.alignThreads(); }; Entry.Func.endEdit = function(message) { diff --git a/src/workspace/block_menu.js b/src/workspace/block_menu.js index c91e9fd2c2..2ee0e0e0b9 100644 --- a/src/workspace/block_menu.js +++ b/src/workspace/block_menu.js @@ -18,6 +18,7 @@ Entry.BlockMenu = function(dom, align, categoryData, scroll) { this._bannedClass = []; this._categories = []; this.suffix = 'blockMenu'; + this._isSelectMenu = false; if (typeof dom === "string") dom = $('#' + dom); else dom = $(dom); @@ -179,7 +180,7 @@ Entry.BlockMenu = function(dom, align, categoryData, scroll) { if (!code) return; this._clearSplitters(); - if (code.view && !unReDraw) + if (code.view && !unReDraw && !this._isSelectMenu) code.view.reDraw(); var threads = code.getThreads(); @@ -428,6 +429,7 @@ Entry.BlockMenu = function(dom, align, categoryData, scroll) { this.align(); return; } + this._isSelectMenu = true; switch (name) { case 'variable': Entry.playground.checkVariables(); @@ -443,7 +445,8 @@ Entry.BlockMenu = function(dom, align, categoryData, scroll) { var board = this.workspace.board, boardView = board.view; - if (oldView) oldView.removeClass(className); + if (oldView) + oldView.removeClass(className); if (elem == oldView && !doNotFold) { boardView.addClass('folding'); @@ -470,6 +473,8 @@ Entry.BlockMenu = function(dom, align, categoryData, scroll) { }); } + this._isSelectMenu = false; + if (this.visible) { var code = this._categoryCodes[name]; diff --git a/src/workspace/block_view.js b/src/workspace/block_view.js index 495819e51a..2afb2bd58f 100644 --- a/src/workspace/block_view.js +++ b/src/workspace/block_view.js @@ -1021,7 +1021,7 @@ Entry.BlockView.pngMap = {}; }; p.reDraw = function() { - if (!this.visible) + if (!(this.visible && this.display)) return; var block = this.block; diff --git a/src/workspace/field/block.js b/src/workspace/field/block.js index c789e3b090..a918f9dee2 100644 --- a/src/workspace/field/block.js +++ b/src/workspace/field/block.js @@ -63,8 +63,7 @@ Entry.Utils.inherit(Entry.Field, Entry.FieldBlock); block.createView(board, mode); block.getThread().view.setParent(this); } else if (block && block.view) { - block.destroyView(); - block.createView(this._blockView.getBoard()); + block.view.reDraw(); } this.updateValueBlock(block); diff --git a/src/workspace/field/output.js b/src/workspace/field/output.js index 7f00967a4c..e16764581c 100644 --- a/src/workspace/field/output.js +++ b/src/workspace/field/output.js @@ -46,11 +46,10 @@ Entry.Utils.inherit(Entry.Field, Entry.FieldOutput); }; p.renderStart = function(board, mode) { - if (this.svgGroup) - $(this.svgGroup).remove(); + if (!this.svgGroup) + this.svgGroup = + this._blockView.contentSvgGroup.elem("g"); - this.svgGroup = - this._blockView.contentSvgGroup.elem("g"); this.view = this; this._nextGroup = this.svgGroup; this.box.set({ @@ -64,9 +63,9 @@ Entry.Utils.inherit(Entry.Field, Entry.FieldOutput); block.setThread(this); block.createView(board, mode); } else if (block && block.view) { - block.destroyView(); - block.createView(this._blockView.getBoard()); + block.view.reDraw(); } + this._updateValueBlock(block); if (this._blockView.getBoard().constructor == Entry.BlockMenu && @@ -147,6 +146,11 @@ Entry.Utils.inherit(Entry.Field, Entry.FieldOutput); if (!(block instanceof Entry.Block)) block = undefined; + if (block && block === this._valueBlock) { + this.calcWH(); + return; + } + if (this._sizeObserver) this._sizeObserver.destroy(); if (this._posObserver) this._posObserver.destroy(); From df3e09901c01b9ec6ea6cc771c1f3f6e37960c48 Mon Sep 17 00:00:00 2001 From: vivid Date: Fri, 21 Oct 2016 11:55:23 +0900 Subject: [PATCH 4/5] code refac --- dist/entry.js | 61 +- dist/entry.min.js | 1256 +++++++++++++++++------------------ src/function.js | 23 +- src/workspace/block_menu.js | 8 +- 4 files changed, 672 insertions(+), 676 deletions(-) diff --git a/dist/entry.js b/dist/entry.js index 96e934bf18..7ec2275e65 100644 --- a/dist/entry.js +++ b/dist/entry.js @@ -965,8 +965,8 @@ Blockly.Blocks.arduino_toggle_led = {init:function() { this.setNextStatement(!0); }}; Entry.block.arduino_toggle_led = function(b, a) { - var d = a.getNumberValue("VALUE"), c = "on" == a.getField("OPERATOR") ? 255 : 0; - Entry.hw.setDigitalPortValue(d, c); + var d = a.getNumberValue("VALUE"), c = a.getField("OPERATOR"); + Entry.hw.setDigitalPortValue(d, "on" == c ? 255 : 0); return a.callReturn(); }; Blockly.Blocks.arduino_toggle_pwm = {init:function() { @@ -1170,8 +1170,8 @@ Blockly.Blocks.dplay_select_led = {init:function() { Entry.block.dplay_select_led = function(b, a) { var d = a.getField("PORT"), c = 7; "7" == d ? c = 7 : "8" == d ? c = 8 : "9" == d ? c = 9 : "10" == d && (c = 10); - d = "on" == a.getField("OPERATOR") ? 255 : 0; - Entry.hw.setDigitalPortValue(c, d); + d = a.getField("OPERATOR"); + Entry.hw.setDigitalPortValue(c, "on" == d ? 255 : 0); return a.callReturn(); }; Blockly.Blocks.dplay_get_switch_status = {init:function() { @@ -2604,10 +2604,10 @@ Entry.block.wait_second = function(b, a) { } a.isStart = !0; a.timeFlag = 1; - var d = a.getNumberValue("SECOND", a), d = 60 / (Entry.FPS || 60) * d * 1E3; + var d = a.getNumberValue("SECOND", a); setTimeout(function() { a.timeFlag = 0; - }, d); + }, 60 / (Entry.FPS || 60) * d * 1E3); return a; }; Blockly.Blocks.repeat_basic = {init:function() { @@ -5057,8 +5057,8 @@ Blockly.Blocks.roduino_set_digital = {init:function() { this.setNextStatement(!0); }}; Entry.block.roduino_set_digital = function(b, a) { - var d = a.getNumberValue("VALUE"), c = "on" == a.getField("OPERATOR") ? 1 : 0; - Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.DIGITAL_WRITE, d, c]); + var d = a.getNumberValue("VALUE"), c = a.getField("OPERATOR"); + Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.DIGITAL_WRITE, d, "on" == c ? 1 : 0]); return a.callReturn(); }; Blockly.Blocks.roduino_motor = {init:function() { @@ -5134,8 +5134,8 @@ Blockly.Blocks.schoolkit_set_output = {init:function() { this.setNextStatement(!0); }}; Entry.block.schoolkit_set_output = function(b, a) { - var d = a.getNumberValue("VALUE"), c = "on" == a.getField("OPERATOR") ? 1 : 0; - Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.DIGITAL_WRITE, d, c]); + var d = a.getNumberValue("VALUE"), c = a.getField("OPERATOR"); + Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.DIGITAL_WRITE, d, "on" == c ? 1 : 0]); return a.callReturn(); }; Blockly.Blocks.schoolkit_get_in_port_number = {init:function() { @@ -5171,9 +5171,9 @@ Blockly.Blocks.schoolkit_motor = {init:function() { this.setNextStatement(!0); }}; Entry.block.schoolkit_motor = function(b, a) { - var d = 0, c = 0, d = a.getField("MODE"), e = a.getField("OPERATOR"), f = a.getNumberValue("VALUE"), d = "motor1" == d ? 7 : 8; - 255 < f ? f = 255 : 0 > f && (f = 0); - "cw" == e ? Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR, 1, d, f]) : "ccw" == e ? Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR, 2, d, f]) : "stop" == e && Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR, c, d, f]); + var d = 0, d = a.getField("MODE"), c = a.getField("OPERATOR"), e = a.getNumberValue("VALUE"), d = "motor1" == d ? 7 : 8; + 255 < e ? e = 255 : 0 > e && (e = 0); + "cw" == c ? Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR, 1, d, e]) : "ccw" == c ? Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR, 2, d, e]) : "stop" == c && Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR, 0, d, e]); return a.callReturn(); }; Blockly.Blocks.schoolkit_set_servo_value = {init:function() { @@ -12384,10 +12384,7 @@ Entry.TextCodingUtil = function() { return a.join("\n"); }; b.eventBlockSyntaxFilter = function(a) { - if ("entry_event_start" == a || "entry_event_key" == a || "entry_event_mouse_down" == a || "entry_event_mouse_up" == a || "entry_event_object_down" == a || "entry_event_signal" == a || "entry_event_scene_start" == a || "entry_event_clone_create" == a) { - a = "def " + a; - } - return a; + return "entry_event_start" == a || "entry_event_key" == a || "entry_event_mouse_down" == a || "entry_event_mouse_up" == a || "entry_event_object_down" == a || "entry_event_signal" == a || "entry_event_scene_start" == a || "entry_event_clone_create" == a ? "def " + a : a; }; b.isEntryEventFunc = function(a) { return "def entry_event_start" == a || "def entry_event_key" == a || "def entry_event_mouse_down" == a || "def entry_event_mouse_up" == a || "def entry_event_object_down" == a || "def entry_event_signal" == a || "def entry_event_scene_start" == a || "def entry_event_clone_create" == a ? !0 : !1; @@ -13354,7 +13351,7 @@ Entry.PyToBlockParser = function(b) { console.log("ExpressionStatement component", a); var b = {}; a = a.expression; - a.type && (a = this[a.type](a), console.log("ExpressionStatement expressionData", a), a.type && a.params ? (b.type = a.type, b.params = a.params) : a.type ? b.type = a.type : b = a, result = b); + a.type && (a = this[a.type](a), console.log("ExpressionStatement expressionData", a), a.type && a.params ? (b.type = a.type, b.params = a.params, result = b) : a.type ? (b.type = a.type, result = b) : result = a); console.log("ExpressionStatement result", result); return result; }; @@ -13614,14 +13611,13 @@ Entry.PyToBlockParser = function(b) { console.log("Literal value", e); b || (b = {type:"Block"}, c || (c = "number" == typeof e ? {type:"number"} : {type:"text"})); if ("Indicator" == b.type) { - var f; return null; } if ("Text" == b.type) { return ""; } console.log("Literal paramMeta", b, "paramDefMeta", c); - null != a.value ? (b = this["Param" + b.type](e, b, c), console.log("Literal param", f)) : (b = [], f = this[a.left.type](a.left), b.push(f), b.push(a.operator), a = this[a.right.type](a.right), b.push(a)); + null != a.value ? (b = this["Param" + b.type](e, b, c), console.log("Literal param", void 0)) : (b = [], c = this[a.left.type](a.left), b.push(c), b.push(a.operator), a = this[a.right.type](a.right), b.push(a)); a = b; console.log("Literal result", a); return a; @@ -13648,9 +13644,8 @@ Entry.PyToBlockParser = function(b) { f.push(e); b.type = c.type; b.params = f; - a = b; - console.log("ParamBlock result", a); - return a; + console.log("ParamBlock result", b); + return b; }; b.ParamAngle = function(a, b, c) { console.log("ParamAngle value, paramMeta, paramDefMeta", a, b, c); @@ -13954,9 +13949,8 @@ Entry.PyToBlockParser = function(b) { }; b.ForInStatement = function(a) { console.log("ForInStatement component", a); - a = null; - console.log("ForInStatement result", a); - return a; + console.log("ForInStatement result", null); + return null; }; b.BreakStatement = function(a) { console.log("BreakStatement component", a); @@ -14290,8 +14284,7 @@ Entry.PyToBlockParser = function(b) { if (f == blockFuncName) { if (console.log("textFuncName", f), console.log("blockFuncName", blockFuncName), console.log("textFuncParams.length", c.length), console.log("Object.keys(paramMap).length", Object.keys(h).length), c.length == Object.keys(h).length ? (k = !0, console.log("textFuncParams.length", c.length), console.log("Object.keys(paramMap).length", Object.keys(h).length), l = q.content._data[0]._data, g = l.slice(), g.shift(), console.log("blockFuncContents", l), l = Entry.TextCodingUtil.prototype.isFuncContentsMatch(g, a, h)) : l = k = !1, k && l) { - m = "func"; - m = m.concat("_").concat(n); + m = "func".concat("_").concat(n); break; } else { if (k && !l) { @@ -14305,8 +14298,8 @@ Entry.PyToBlockParser = function(b) { console.log("FunctionDeclaration matchFlag", l); if (k && l) { console.log("targetFuncId", m); - var u = c.length, u = f + u; - this._funcMap.put(u, m); + var u = c.length; + this._funcMap.put(f + u, m); console.log("FunctionDeclaration this._funcMap", this._funcMap); b = m; } else { @@ -20327,7 +20320,7 @@ Entry.BlockMenu = function(b, a, d, c) { this._bannedClass = []; this._categories = []; this.suffix = "blockMenu"; - this._isSelectMenu = !1; + this._isSelectingMenu = !1; b = "string" === typeof b ? $("#" + b) : $(b); if ("DIV" !== b.prop("tagName")) { return console.error("Dom is not div element"); @@ -20403,7 +20396,7 @@ Entry.BlockMenu = function(b, a, d, c) { var b = this.code; if (b) { this._clearSplitters(); - !b.view || a || this._isSelectMenu || b.view.reDraw(); + !b.view || a || this._isSelectingMenu || b.view.reDraw(); a = b.getThreads(); for (var b = 10, c = "LEFT" == this._align ? 10 : this.svgDom.width() / 2, e, f = 0, g = a.length;f < g;f++) { var h = a[f].getFirstBlock(), k = h.view, h = Entry.block[h.type]; @@ -20528,7 +20521,7 @@ Entry.BlockMenu = function(b, a, d, c) { b.selectMenu = function(a, b) { var c = this._convertSelector(a); if (c) { - this._isSelectMenu = !0; + this._isSelectingMenu = !0; switch(c) { case "variable": Entry.playground.checkVariables(); @@ -20544,7 +20537,7 @@ Entry.BlockMenu = function(b, a, d, c) { k.removeClass("foldOut"); Entry.windowResized.notify(); }); - this._isSelectMenu = !1; + this._isSelectingMenu = !1; this.visible && (f = this._categoryCodes[c], this._selectedCategoryView = e, e.addClass("entrySelectedCategory"), f.constructor !== Entry.Code && (f = this._categoryCodes[c] = new Entry.Code(f)), this.changeCode(f)); this.lastSelector = c; } else { diff --git a/dist/entry.min.js b/dist/entry.min.js index dcd125b84f..20e900e6c7 100644 --- a/dist/entry.min.js +++ b/dist/entry.min.js @@ -105,7 +105,7 @@ Blockly.Blocks.arduino_get_pwm_port_number={init:function(){this.setColour("#009 Blockly.Blocks.arduino_get_number_sensor_value={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_num_sensor_value_1);this.appendValueInput("VALUE").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_num_sensor_value_2).appendField(" ");this.setInputsInline(!0);this.setOutput(!0,"Number")}};Entry.block.arduino_get_number_sensor_value=function(b,a){var d=a.getValue("VALUE",a);return Entry.hw.getAnalogPortValue(d[1])}; Blockly.Blocks.arduino_get_digital_value={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_get_digital_value_1);this.appendValueInput("VALUE").setCheck("Number");this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_num_sensor_value_2).appendField(" ");this.setInputsInline(!0);this.setOutput(!0,"Boolean")}};Entry.block.arduino_get_digital_value=function(b,a){var d=a.getNumberValue("VALUE",a);return Entry.hw.getDigitalPortValue(d)}; Blockly.Blocks.arduino_toggle_led={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_num_pin_1);this.appendValueInput("VALUE").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_num_pin_2);this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Lang.Blocks.ARDUINO_on,"on"],[Lang.Blocks.ARDUINO_off,"off"]]),"OPERATOR").appendField(new Blockly.FieldIcon(Entry.mediaFilePath+"block_icon/hardware_03.png","*")); -this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.arduino_toggle_led=function(b,a){var d=a.getNumberValue("VALUE"),c="on"==a.getField("OPERATOR")?255:0;Entry.hw.setDigitalPortValue(d,c);return a.callReturn()}; +this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.arduino_toggle_led=function(b,a){var d=a.getNumberValue("VALUE"),c=a.getField("OPERATOR");Entry.hw.setDigitalPortValue(d,"on"==c?255:0);return a.callReturn()}; Blockly.Blocks.arduino_toggle_pwm={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_toggle_pwm_1);this.appendValueInput("PORT").setCheck(["Number","String"]);this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_toggle_pwm_2);this.appendValueInput("VALUE").setCheck(["Number","String"]);this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_toggle_pwm_3);this.appendDummyInput().appendField(new Blockly.FieldIcon(Entry.mediaFilePath+"block_icon/hardware_03.png", "*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.arduino_toggle_pwm=function(b,a){var d=a.getNumberValue("PORT"),c=a.getNumberValue("VALUE"),c=Math.round(c),c=Math.max(c,0),c=Math.min(c,255);Entry.hw.setDigitalPortValue(d,c);return a.callReturn()}; Blockly.Blocks.arduino_convert_scale={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_convert_scale_1);this.appendValueInput("VALUE1").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_convert_scale_2);this.appendValueInput("VALUE2").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_convert_scale_3);this.appendValueInput("VALUE3").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_convert_scale_4); @@ -133,7 +133,7 @@ Entry.block.CODEino_get_accelerometer_direction=function(b,a){var d=a.getField(" Blockly.Blocks.CODEino_get_accelerometer_value={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.CODEino_string_8).appendField(new Blockly.FieldDropdown([[Lang.Blocks.CODEino_accelerometer_X,"3"],[Lang.Blocks.CODEino_accelerometer_Y,"4"],[Lang.Blocks.CODEino_accelerometer_Z,"5"]]),"PORT").appendField(Lang.Blocks.CODEino_string_9);this.setOutput(!0,"Number");this.setInputsInline(!0)}}; Entry.block.CODEino_get_accelerometer_value=function(b,a){var d=265,c=402,e=-90,f=90,g=Entry.hw.getAnalogPortValue(a.getField("PORT",a));if(d>c)var h=d,d=c,c=h;e>f&&(h=e,e=f,f=h);g=(f-e)/(c-d)*(g-d);g+=e;g=Math.min(f,g);g=Math.max(e,g);return Math.round(g)}; Blockly.Blocks.dplay_select_led={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.ARDUINO_num_pin_1);this.appendDummyInput().appendField(new Blockly.FieldDropdown([["7","7"],["8","8"],["9","9"],["10","10"]]),"PORT");this.appendDummyInput().appendField(Lang.Blocks.dplay_num_pin_1);this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Lang.Blocks.ARDUINO_on,"on"],[Lang.Blocks.ARDUINO_off,"off"]]),"OPERATOR").appendField(new Blockly.FieldIcon(Entry.mediaFilePath+ -"block_icon/hardware_03.png","*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.dplay_select_led=function(b,a){var d=a.getField("PORT"),c=7;"7"==d?c=7:"8"==d?c=8:"9"==d?c=9:"10"==d&&(c=10);d="on"==a.getField("OPERATOR")?255:0;Entry.hw.setDigitalPortValue(c,d);return a.callReturn()}; +"block_icon/hardware_03.png","*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.dplay_select_led=function(b,a){var d=a.getField("PORT"),c=7;"7"==d?c=7:"8"==d?c=8:"9"==d?c=9:"10"==d&&(c=10);d=a.getField("OPERATOR");Entry.hw.setDigitalPortValue(c,"on"==d?255:0);return a.callReturn()}; Blockly.Blocks.dplay_get_switch_status={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField("\ub514\uc9c0\ud138 ");this.appendDummyInput().appendField(new Blockly.FieldDropdown([["2","2"],["4","4"]]),"PORT");this.appendDummyInput().appendField(Lang.Blocks.dplay_num_pin_2).appendField(new Blockly.FieldDropdown([[Lang.Blocks.dplay_string_5,"ON"],[Lang.Blocks.dplay_string_6,"OFF"]]),"STATUS").appendField(" ");this.setInputsInline(!0);this.setOutput(!0,"Boolean")}}; Entry.block.dplay_get_switch_status=function(b,a){var d=a.getField("PORT"),c=2;"2"==d?c=2:"4"==d&&(c=4);return"OFF"==a.getField("STATUS")?1==Entry.hw.getDigitalPortValue(c)?1:0:0==Entry.hw.getDigitalPortValue(c)?1:0}; Blockly.Blocks.dplay_get_light_status={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.dplay_light).appendField(new Blockly.FieldDropdown([[Lang.Blocks.dplay_string_3,"BRIGHT"],[Lang.Blocks.dplay_string_4,"DARK"]]),"STATUS").appendField(" ");this.setInputsInline(!0);this.setOutput(!0,"Boolean")}}; @@ -292,7 +292,7 @@ Entry.block.ev3_motor_power_on_time=function(b,a){var d=a.getStringField("PORT", setTimeout(function(){a.timeFlag=0;Entry.EV3.removeTimeout(f)},1E3*c);Entry.EV3.timeouts.push(f);return a}; Blockly.Blocks.ev3_motor_degrees={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField("").appendField(new Blockly.FieldDropdown([["A","A"],["B","B"],["C","C"],["D","D"]]),"PORT").appendField("\uc758 \uac12\uc744").appendField(new Blockly.FieldDropdown([["\uc2dc\uacc4\ubc29\ud5a5","CW"],["\ubc18\uc2dc\uacc4\ubc29\ud5a5","CCW"]]),"DIRECTION").appendField("\uc73c\ub85c ");this.appendValueInput("DEGREE").setCheck(["Number"]);this.appendDummyInput().appendField("\ub3c4 \ub9cc\ud07c \ud68c\uc804"); this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.ev3_motor_degrees=function(b,a){var d=a.getStringField("PORT",a),c=a.getValue("DEGREE",a);0>=c?c=0:720<=c&&(c=720);var e=a.getStringField("DIRECTION",a);Entry.hw.sendQueue[d]={id:Math.floor(1E5*Math.random(),0),type:Entry.EV3.motorMovementTypes.Degrees,degree:c,power:"CW"==e?50:-50};return a.callReturn()};Blockly.Blocks.wait_second={init:function(){this.setColour("#498deb");this.appendDummyInput().appendField(Lang.Blocks.FLOW_wait_second_1);this.appendValueInput("SECOND").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.FLOW_wait_second_2).appendField(new Blockly.FieldIcon(Entry.mediaFilePath+"block_icon/flow_03.png","*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}}; -Entry.block.wait_second=function(b,a){if(a.isStart){if(1==a.timeFlag)return a;delete a.timeFlag;delete a.isStart;Entry.engine.isContinue=!1;return a.callReturn()}a.isStart=!0;a.timeFlag=1;var d=a.getNumberValue("SECOND",a),d=60/(Entry.FPS||60)*d*1E3;setTimeout(function(){a.timeFlag=0},d);return a}; +Entry.block.wait_second=function(b,a){if(a.isStart){if(1==a.timeFlag)return a;delete a.timeFlag;delete a.isStart;Entry.engine.isContinue=!1;return a.callReturn()}a.isStart=!0;a.timeFlag=1;var d=a.getNumberValue("SECOND",a);setTimeout(function(){a.timeFlag=0},60/(Entry.FPS||60)*d*1E3);return a}; Blockly.Blocks.repeat_basic={init:function(){this.setColour("#498deb");this.appendDummyInput().appendField(Lang.Blocks.FLOW_repeat_basic_1);this.appendValueInput("VALUE").setCheck(["Number","String"]);this.appendDummyInput().appendField(Lang.Blocks.FLOW_repeat_basic_2).appendField(new Blockly.FieldIcon(Entry.mediaFilePath+"block_icon/flow_03.png","*"));this.appendStatementInput("DO");this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}}; Entry.block.repeat_basic=function(b,a){var d;if(!a.isLooped){a.isLooped=!0;d=a.getNumberValue("VALUE",a);if(0>d)throw Error(Lang.Blocks.FLOW_repeat_basic_errorMsg);a.iterCount=Math.floor(d)}if(0==a.iterCount||0>a.iterCount)return delete a.isLooped,delete a.iterCount,a.callReturn();a.iterCount--;return a.getStatement("DO",a)}; Blockly.Blocks.repeat_inf={init:function(){this.setColour("#498deb");this.appendDummyInput().appendField(Lang.Blocks.FLOW_repeat_inf).appendField(new Blockly.FieldIcon(Entry.mediaFilePath+"block_icon/flow_03.png","*"));this.appendStatementInput("DO");this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.repeat_inf=function(b,a){a.isLooped=!0;return a.getStatement("DO")}; @@ -551,7 +551,7 @@ Entry.block.roduino_get_digital_value=function(b,a){var d=a.getNumberValue("VALU Blockly.Blocks.roduino_get_color={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.roborobo_color+" ").appendField(new Blockly.FieldDropdown([[Lang.Blocks.roborobo_color_red,"red"],[Lang.Blocks.roborobo_color_green,"green"],[Lang.Blocks.roborobo_color_blue,"blue"],[Lang.Blocks.roborobo_color_yellow,"yellow"]]),"VALUE").appendField(Lang.Blocks.roborobo_color_detected);this.setInputsInline(!0);this.setOutput(!0,"Number")}}; Entry.block.roduino_get_color=function(b,a){var d=0,c=a.getField("VALUE",a),e=[Entry.hw.portData[Entry.Roborobo_Roduino.ColorPin[0]-2],Entry.hw.portData[Entry.Roborobo_Roduino.ColorPin[1]-2],Entry.hw.portData[Entry.Roborobo_Roduino.ColorPin[2]-2]];switch(c){case "red":1==e[0]&&0==e[1]&&0==e[2]&&(d=1);break;case "green":0==e[0]&&1==e[1]&&0==e[2]&&(d=1);break;case "blue":0==e[0]&&0==e[1]&&1==e[2]&&(d=1);break;case "yellow":1==e[0]&&1==e[1]&&1==e[2]&&(d=1)}return d}; Blockly.Blocks.roduino_set_digital={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.roborobo_num_pin_1);this.appendValueInput("VALUE").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.roborobo_num_pin_2);this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Lang.Blocks.roborobo_on,"on"],[Lang.Blocks.roborobo_off,"off"]]),"OPERATOR").appendField(new Blockly.FieldIcon(Entry.mediaFilePath+"block_icon/hardware_03.png", -"*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.roduino_set_digital=function(b,a){var d=a.getNumberValue("VALUE"),c="on"==a.getField("OPERATOR")?1:0;Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.DIGITAL_WRITE,d,c]);return a.callReturn()}; +"*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.roduino_set_digital=function(b,a){var d=a.getNumberValue("VALUE"),c=a.getField("OPERATOR");Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.DIGITAL_WRITE,d,"on"==c?1:0]);return a.callReturn()}; Blockly.Blocks.roduino_motor={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Lang.Blocks.roborobo_motor1,"motor1"],[Lang.Blocks.roborobo_motor2,"motor2"]]),"MODE");this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Lang.Blocks.roborobo_motor_CW,"cw"],[Lang.Blocks.roborobo_motor_CCW,"ccw"],[Lang.Blocks.roborobo_motor_stop,"stop"]]),"OPERATOR").appendField(new Blockly.FieldIcon(Entry.mediaFilePath+"block_icon/hardware_03.png","*")); this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.roduino_motor=function(b,a){var d=pin2=0,c=value2=0,d=a.getField("MODE"),c=a.getField("OPERATOR");"motor1"==d?(d=9,pin2=10):(d=11,pin2=12);"cw"==c?(c=1,value2=0):"ccw"==c?(c=0,value2=1):value2=c=0;Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.MOTOR,d,c,pin2,value2]);return a.callReturn()}; Blockly.Blocks.roduino_set_color_pin={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.roborobo_color+"R : ");this.appendValueInput("RED").setCheck(["Number","String",null]);this.appendDummyInput().appendField(" G : ");this.appendValueInput("GREEN").setCheck(["Number","String",null]);this.appendDummyInput().appendField(" B : ");this.appendValueInput("BLUE").setCheck(["Number","String",null]);this.appendDummyInput().appendField(new Blockly.FieldIcon(Entry.mediaFilePath+ @@ -559,13 +559,13 @@ Blockly.Blocks.roduino_set_color_pin={init:function(){this.setColour("#00979D"); Blockly.Blocks.schoolkit_on_block={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.roborobo_on);this.setOutput(!0,"Number");this.setInputsInline(!0)}};Entry.block.schoolkit_on_block=function(b,a){return"1"};Blockly.Blocks.schoolkit_off_block={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.roborobo_off);this.setOutput(!0,"Number");this.setInputsInline(!0)}};Entry.block.schoolkit_off_block=function(b,a){return"0"}; Blockly.Blocks.schoolkit_get_out_port_number={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(new Blockly.FieldDropdown([["OUT1","2"],["OUT2","3"],["OUT3","4"],["OUT4","5"],["OUT5","6"]]),"PORT");this.appendDummyInput().appendField(" ");this.setOutput(!0,"Number");this.setInputsInline(!0)}};Entry.block.schoolkit_get_out_port_number=function(b,a){return a.getNumberField("PORT")}; Blockly.Blocks.schoolkit_set_output={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.roborobo_num_pin_1);this.appendValueInput("VALUE").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.roborobo_num_pin_2);this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Lang.Blocks.roborobo_on,"on"],[Lang.Blocks.roborobo_off,"off"]]),"OPERATOR").appendField(new Blockly.FieldIcon(Entry.mediaFilePath+"block_icon/hardware_03.png", -"*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.schoolkit_set_output=function(b,a){var d=a.getNumberValue("VALUE"),c="on"==a.getField("OPERATOR")?1:0;Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.DIGITAL_WRITE,d,c]);return a.callReturn()}; +"*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.schoolkit_set_output=function(b,a){var d=a.getNumberValue("VALUE"),c=a.getField("OPERATOR");Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.DIGITAL_WRITE,d,"on"==c?1:0]);return a.callReturn()}; Blockly.Blocks.schoolkit_get_in_port_number={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(new Blockly.FieldDropdown([["IN1","7"],["IN2","8"],["IN3","9"],["IN4","10"],["IN5","11"],["IN6","12"],["IN7","13"]]),"PORT");this.appendDummyInput().appendField(" ");this.setOutput(!0,"Number");this.setInputsInline(!0)}};Entry.block.schoolkit_get_in_port_number=function(b,a){return a.getNumberField("PORT")}; Blockly.Blocks.schoolkit_get_input_value={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.roborobo_get_digital_value_1);this.appendValueInput("VALUE").setCheck("Number");this.appendDummyInput().appendField(Lang.Blocks.roborobo_num_sensor_value_2).appendField(" ");this.setInputsInline(!0);this.setOutput(!0,"Boolean")}}; Entry.block.schoolkit_get_input_value=function(b,a){var d=a.getNumberValue("VALUE");Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.DIGITAL_READ,d]);return Entry.hw.portData[d-7]}; Blockly.Blocks.schoolkit_motor={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Lang.Blocks.roborobo_motor1,"motor1"],[Lang.Blocks.roborobo_motor2,"motor2"]]),"MODE");this.appendValueInput("VALUE").setCheck(["Number","String",null]);this.appendDummyInput().appendField(new Blockly.FieldDropdown([[Lang.Blocks.roborobo_motor_CW,"cw"],[Lang.Blocks.roborobo_motor_CCW,"ccw"],[Lang.Blocks.roborobo_motor_stop,"stop"]]),"OPERATOR").appendField(new Blockly.FieldIcon(Entry.mediaFilePath+ "block_icon/hardware_03.png","*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}}; -Entry.block.schoolkit_motor=function(b,a){var d=0,c=0,d=a.getField("MODE"),e=a.getField("OPERATOR"),f=a.getNumberValue("VALUE"),d="motor1"==d?7:8;255f&&(f=0);"cw"==e?Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,1,d,f]):"ccw"==e?Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,2,d,f]):"stop"==e&&Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,c,d,f]);return a.callReturn()}; +Entry.block.schoolkit_motor=function(b,a){var d=0,d=a.getField("MODE"),c=a.getField("OPERATOR"),e=a.getNumberValue("VALUE"),d="motor1"==d?7:8;255e&&(e=0);"cw"==c?Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,1,d,e]):"ccw"==c?Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,2,d,e]):"stop"==c&&Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,0,d,e]);return a.callReturn()}; Blockly.Blocks.schoolkit_set_servo_value={init:function(){this.setColour("#00979D");this.appendDummyInput().appendField(Lang.Blocks.roborobo_num_pin_1);this.appendValueInput("PIN").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.roborobo_num_pin_2);this.appendDummyInput().appendField(" : ");this.appendValueInput("VALUE").setCheck(["Number","String",null]);this.appendDummyInput().appendField(Lang.Blocks.roborobo_degree);this.appendDummyInput().appendField(new Blockly.FieldIcon(Entry.mediaFilePath+ "block_icon/hardware_03.png","*"));this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0)}};Entry.block.schoolkit_set_servo_value=function(b,a){var d=a.getNumberValue("PIN"),c=a.getNumberValue("VALUE");0>c?c=0:180=d)return this.setRobotisData(a),this.update(),b.callReturn();if(b.isStart){if(1==b.timeFlag)return this.setRobotisData(null),b;delete b.timeFlag;delete b.isStart;Entry.engine.isContinue=!1;this.update();return b.callReturn()}b.isStart=!0;b.timeFlag=1;this.setRobotisData(a);setTimeout(function(){b.timeFlag= @@ -1176,15 +1176,15 @@ width:g.width_,height:g.height_,array:b});g.updateView();Entry.variableContainer "set_variable"==a.data.type||"change_variable"==a.data.type){if(this.isLocalVariable(b))return!0}else if(("value_of_index_from_list"==a.data.type||"add_value_to_list"==a.data.type||"remove_value_from_list"==a.data.type||"insert_value_to_list"==a.data.type||"change_value_list_index"==a.data.type||"length_of_list"==a.data.type||"is_included_in_list"==a.data.type)&&this.isLocalList(b))return!0};b.isEventBlock=function(a){a=a.data.type;return"when_run_button_click"==a||"when_some_key_pressed"==a||"mouse_clicked"== a||"mouse_click_cancled"==a||"when_object_click"==a||"when_object_click_canceled"==a||"when_message_cast"==a||"when_scene_start"==a||"when_clone_start"==a?!0:!1};b.makeDefinition=function(a){var b=/(%.)/mi;a=Entry.block[a.data.type].syntax.py[0].split(b);for(var c="",e=0;e":b="BIGGER";break;case ">=":b="BIGGER_EQUAL";break;case "==":b="EQUAL";break;case "<":b= -"SMALLER";break;case "<=":b="SMALLER_EQUAL"}return b};b.radarVariableConvertor=function(a){return a.split("_")[1].toUpperCase()};b.tTobDropdownValueConvertor=function(a){return"stone"==a?"OBSTACLE":"wall"==a?a.toUpperCase():"item"==a?a.toUpperCase():a}})(Entry.TextCodingUtil.prototype);Entry.BlockToJsParser=function(b){this.syntax=b;this._iterVariableCount=0;this._iterVariableChunk=["i","j","k"]}; +function(a){return"entry_event_start"==a||"entry_event_key"==a||"entry_event_mouse_down"==a||"entry_event_mouse_up"==a||"entry_event_object_down"==a||"entry_event_signal"==a||"entry_event_scene_start"==a||"entry_event_clone_create"==a?"def "+a:a};b.isEntryEventFunc=function(a){return"def entry_event_start"==a||"def entry_event_key"==a||"def entry_event_mouse_down"==a||"def entry_event_mouse_up"==a||"def entry_event_object_down"==a||"def entry_event_signal"==a||"def entry_event_scene_start"==a||"def entry_event_clone_create"== +a?!0:!1};b.searchFuncDefParam=function(a){"function_field_label"==a.data.type&&this._funcNameQ.enqueue(a.data.params[0]);return a&&a.data&&a.data.params&&a.data.params[1]?("function_field_string"!=a.data.type&&"function_field_boolean"!=a.data.type||this._funcParamQ.enqueue(a.data.params[0].data.type),this.searchFuncDefParam(a.data.params[1])):a};b.gatherFuncDefParam=function(a){if(a&&a.data){if(a.data.params[0])if(a.data.params[0].data){var b=a.data.params[0].data.type;"function_field_string"!=a.data.type&& +"function_field_boolean"!=a.data.type||this._funcParamQ.enqueue(b)}else"function_field_label"==a.data.type&&this._funcNameQ.enqueue(a.data.params[0]);if(a.data.params[1]){var c=this.searchFuncDefParam(a.data.params[1]);c.data.params[0].data&&(b=c.data.params[0].data.type,"function_field_string"!=c.data.type&&"function_field_boolean"!=c.data.type||this._funcParamQ.enqueue(b));c.data.params[1]&&c.data.params[1].data.params[0].data&&(b=c.data.params[1].data.params[0].data.type,"function_field_string"!= +c.data.params[1].data.type&&"function_field_boolean"!=c.data.params[1].data.type||this._funcParamQ.enqueue(b))}}return c};b.getLastParam=function(a){a&&a.data&&a.data.params[1]&&(a=this.getLastParam(a.data.params[1]));return a};b.isFuncContentsMatch=function(a,b,c){for(var e=!0,f=0;f":b="BIGGER";break;case ">=":b="BIGGER_EQUAL";break;case "==":b="EQUAL";break;case "<":b="SMALLER"; +break;case "<=":b="SMALLER_EQUAL"}return b};b.radarVariableConvertor=function(a){return a.split("_")[1].toUpperCase()};b.tTobDropdownValueConvertor=function(a){return"stone"==a?"OBSTACLE":"wall"==a?a.toUpperCase():"item"==a?a.toUpperCase():a}})(Entry.TextCodingUtil.prototype);Entry.BlockToJsParser=function(b){this.syntax=b;this._iterVariableCount=0;this._iterVariableChunk=["i","j","k"]}; (function(b){b.Code=function(a,b){this._parseMode=b;if(a instanceof Entry.Block)return this.Block(a);for(var c="",e=a._data,f=0;f|\?/g.test(b)};Entry.Model=function(b,a){var d=Entry.Model;d.generateSchema(b);d.generateSetter(b);d.generateObserve(b);(void 0===a||a)&&Object.seal(b);return b}; (function(b){b.generateSchema=function(a){var b=a.schema;if(void 0!==b){b=JSON.parse(JSON.stringify(b));a.data={};for(var c in b)(function(c){a.data[c]=b[c];Object.defineProperty(a,c,{get:function(){return a.data[c]}})})(c);a._toJSON=this._toJSON}};b.generateSetter=function(a){a.set=this.set};b.set=function(a,b){var c={},e;for(e in this.data)void 0!==a[e]&&(a[e]===this.data[e]?delete a[e]:(c[e]=this.data[e],this.data[e]=a[e]instanceof Array?a[e].concat():a[e]));b||this.notify(Object.keys(a),c)};b.generateObserve= function(a){a.observers=[];a.observe=this.observe;a.unobserve=this.unobserve;a.notify=this.notify};b.observe=function(a,b,c,e){c=new Entry.Observer(this.observers,a,b,c);if(!1!==e)a[b]([]);return c};b.unobserve=function(a){a.destroy()};b.notify=function(a,b){"string"===typeof a&&(a=[a]);var c=this;c.observers.map(function(e){var f=a;void 0!==e.attrs&&(f=Entry.Utils.intersectArray(e.attrs,a));if(f.length)e.object[e.funcName](f.map(function(a){return{name:a,object:c,oldValue:b[a]}}))})};b._toJSON=function(){var a= -{},b;for(b in this.data)a[b]=this.data[b];return a}})(Entry.Model);Entry.Func=function(b){this.id=b?b.id:Entry.generateHash();this.content=b?new Entry.Code(b.content):new Entry.Code([[{type:"function_create",copyable:!1,deletable:!1,x:40,y:40}]]);this.blockMenuBlock=this.block=null;this.hashMap={};this.paramMap={};Entry.generateFunctionSchema(this.id);if(b){b=this.content._blockMap;for(var a in b)Entry.Func.registerParamBlock(b[a].type);Entry.Func.generateWsBlock(this)}Entry.Func.registerFunction(this);Entry.Func.updateMenu()};Entry.Func.threads={}; -Entry.Func.registerFunction=function(b){if(Entry.playground){var a=Entry.playground.mainWorkspace;a&&(this._targetFuncBlock=a.getBlockMenu().getCategoryCodes("func").createThread([{type:"func_"+b.id}]),b.blockMenuBlock=this._targetFuncBlock)}};Entry.Func.executeFunction=function(b){var a=this.threads[b];if(a=Entry.Engine.computeThread(a.entity,a))return this.threads[b]=a,!0;delete this.threads[b];return!1};Entry.Func.clearThreads=function(){this.threads={}}; -Entry.Func.prototype.init=function(b){this.id=b.id;this.content=Blockly.Xml.textToDom(b.content);this.block=Blockly.Xml.textToDom(""+b.block+"").childNodes[0]};Entry.Func.prototype.destroy=function(){this.blockMenuBlock.destroy()};Entry.Func.edit=function(b){this.cancelEdit();this.targetFunc=b;this.initEditView(b.content);this.bindFuncChangeEvent();this.updateMenu()}; -Entry.Func.initEditView=function(b){this.menuCode||this.setupMenuCode();var a=Entry.playground.mainWorkspace;a.setMode(Entry.Workspace.MODE_OVERLAYBOARD);a.changeOverlayBoardCode(b);b.recreateView();a.changeOverlayBoardCode(b);b.view.board.alignThreads();this._workspaceStateEvent=a.changeEvent.attach(this,this.endEdit)};Entry.Func.endEdit=function(b){this.unbindFuncChangeEvent();this._workspaceStateEvent.destroy();delete this._workspaceStateEvent;switch(b){case "save":this.save();case "cancelEdit":this.cancelEdit()}}; -Entry.Func.save=function(){this.targetFunc.generateBlock(!0);Entry.variableContainer.saveFunction(this.targetFunc)}; +{},b;for(b in this.data)a[b]=this.data[b];return a}})(Entry.Model);Entry.Func=function(b){this.id=b?b.id:Entry.generateHash();this.content=b?new Entry.Code(b.content):new Entry.Code([[{type:"function_create",copyable:!1,deletable:!1,x:40,y:40}]]);this._backupContent=this.blockMenuBlock=this.block=null;this.hashMap={};this.paramMap={};Entry.generateFunctionSchema(this.id);if(b){b=this.content._blockMap;for(var a in b)Entry.Func.registerParamBlock(b[a].type);Entry.Func.generateWsBlock(this)}Entry.Func.registerFunction(this);Entry.Func.updateMenu()}; +Entry.Func.threads={};Entry.Func.registerFunction=function(b){if(Entry.playground){var a=Entry.playground.mainWorkspace;a&&(this._targetFuncBlock=a.getBlockMenu().getCategoryCodes("func").createThread([{type:"func_"+b.id}]),b.blockMenuBlock=this._targetFuncBlock)}};Entry.Func.executeFunction=function(b){var a=this.threads[b];if(a=Entry.Engine.computeThread(a.entity,a))return this.threads[b]=a,!0;delete this.threads[b];return!1};Entry.Func.clearThreads=function(){this.threads={}}; +Entry.Func.prototype.init=function(b){this.id=b.id;this.content=Blockly.Xml.textToDom(b.content);this.block=Blockly.Xml.textToDom(""+b.block+"").childNodes[0]};Entry.Func.prototype.destroy=function(){this.blockMenuBlock.destroy()};Entry.Func.edit=function(b){this.cancelEdit();this.targetFunc=b;this.initEditView(b.content);this.bindFuncChangeEvent();this._backupContent=b.content.stringify();this.updateMenu()}; +Entry.Func.initEditView=function(b){this.menuCode||this.setupMenuCode();var a=Entry.playground.mainWorkspace;a.setMode(Entry.Workspace.MODE_OVERLAYBOARD);a.changeOverlayBoardCode(b);b.recreateView();a.changeOverlayBoardCode(b);this._workspaceStateEvent=a.changeEvent.attach(this,this.endEdit);b.view.reDraw();b.view.board.alignThreads()}; +Entry.Func.endEdit=function(b){this.unbindFuncChangeEvent();this._workspaceStateEvent.destroy();delete this._workspaceStateEvent;switch(b){case "save":this.save();break;case "cancelEdit":this.cancelEdit()}this._backupContent=null;Entry.playground.mainWorkspace.setMode(Entry.Workspace.MODE_BOARD);delete this.targetFunc;this.updateMenu()};Entry.Func.save=function(){this.targetFunc.generateBlock(!0);Entry.variableContainer.saveFunction(this.targetFunc)}; Entry.Func.syncFuncName=function(b){var a=0,d=[],d=b.split(" "),c="";b=[];b=Blockly.mainWorkspace.getAllBlocks();for(var e=0;eBlockly.Block.dragMode_&&(b.updateMenu(),b.fieldText=a,b.workspaceLength=d)}}; Entry.Func.setupMenuCode=function(){var b=Entry.playground.mainWorkspace;b&&(b=b.getBlockMenu().getCategoryCodes("func"),this._fieldLabel=b.createThread([{type:"function_field_label"}]).getFirstBlock(),this._fieldString=b.createThread([{type:"function_field_string",params:[{type:this.requestParamBlock("string")}]}]).getFirstBlock(),this._fieldBoolean=b.createThread([{type:"function_field_boolean",params:[{type:this.requestParamBlock("boolean")}]}]).getFirstBlock(),this.menuCode=b)}; @@ -1469,8 +1469,9 @@ Entry.Func.updateMenu=function(){if(Entry.playground&&Entry.playground.mainWorks Entry.Func.generateBlock=function(b){b=Entry.block["func_"+b.id];var a={template:b.template,params:b.params},d=/(%\d)/mi,c=b.template.split(d),e="",f=0,g=0,h;for(h in c){var k=c[h];d.test(k)?(k=Number(k.split("%")[1])-1,k=b.params[k],"Indicator"!==k.type&&("boolean"===k.accept?(e+=Lang.template.function_param_boolean+(f?f:""),f++):(e+=Lang.template.function_param_string+(g?g:""),g++))):e+=k}return{block:a,description:e}}; Entry.Func.prototype.generateBlock=function(b){b=Entry.Func.generateBlock(this);this.block=b.block;this.description=b.description}; Entry.Func.generateWsBlock=function(b){this.unbindFuncChangeEvent();b=b?b:this.targetFunc;for(var a=b.content.getEventMap("funcDef")[0].params[0],d=0,c=0,e=[],f="",g=b.hashMap,h=b.paramMap;a;){var k=a.params[0];switch(a.type){case "function_field_label":f=f+" "+k;break;case "function_field_boolean":Entry.Mutator.mutate(k.type,{template:Lang.Blocks.FUNCTION_logical_variable+" "+(d?d:"")});g[k.type]=!1;h[k.type]=d+c;d++;e.push({type:"Block",accept:"boolean"});f+=" %"+(d+c);break;case "function_field_string":Entry.Mutator.mutate(k.type, -{template:Lang.Blocks.FUNCTION_character_variable+" "+(c?c:"")}),g[k.type]=!1,h[k.type]=d+c,c++,f+=" %"+(d+c),e.push({type:"Block",accept:"string"})}a=a.getOutputBlock()}d++;f+=" %"+(d+c);e.push({type:"Indicator",img:"block_icon/function_03.png",size:12});Entry.Mutator.mutate("func_"+b.id,{params:e,template:f});for(var l in g)g[l]?(a=-1'));this._hwModule=b;var a=this;Entry.addEventListener("windowResized",function(){var b=a._hwModule.monitorTemplate.mode;"both"==b&&(a.resize(),a.resizeList());"list"==b?a.resizeList():a.resize()});Entry.addEventListener("hwModeChange",function(){a.changeMode()});this.changeOffset=0;this.scale=.5;this._listPortViews={}}; +{template:Lang.Blocks.FUNCTION_character_variable+" "+(c?c:"")}),g[k.type]=!1,h[k.type]=d+c,c++,f+=" %"+(d+c),e.push({type:"Block",accept:"string"})}a=a.getOutputBlock()}d++;f+=" %"+(d+c);e.push({type:"Indicator",img:"block_icon/function_03.png",size:12});a="func_"+b.id;d=Entry.block[a];c=!1;if(d.template!==f)c=!0;else if(d.params.length===e.length)for(h=0;h'));this._hwModule=b;var a=this;Entry.addEventListener("windowResized",function(){var b=a._hwModule.monitorTemplate.mode;"both"==b&&(a.resize(),a.resizeList());"list"==b?a.resizeList():a.resize()});Entry.addEventListener("hwModeChange",function(){a.changeMode()});this.changeOffset=0;this.scale=.5;this._listPortViews={}}; (function(b){b.initView=function(){this.svgDom=Entry.Dom($(''))};b.generateView=function(){this.snap=Entry.SVG("hwMonitor");this._svgGroup=this.snap.elem("g");this._portMap={n:[],e:[],s:[],w:[]};var a=this._hwModule.monitorTemplate,b={href:Entry.mediaFilePath+a.imgPath,x:-a.width/2,y:-a.height/2,width:a.width,height:a.height};this._portViews={};this.hwView=this._svgGroup.elem("image");this.hwView= this.hwView.attr(b);this._template=a;a=a.ports;this.pathGroup=null;this.pathGroup=this._svgGroup.elem("g");var b=[],c;for(c in a){var e=this.generatePortView(a[c],"_svgGroup");this._portViews[c]=e;b.push(e)}b.sort(function(a,b){return a.box.x-b.box.x});var f=this._portMap;b.map(function(a){(1>(Math.atan2(-a.box.y,a.box.x)/Math.PI+2)%2?f.n:f.s).push(a)});this.resize()};b.toggleMode=function(a){var b=this._hwModule.monitorTemplate;"list"==a?(b.TempPort=null,this._hwModule.monitorTemplate.ports&&(this._hwModule.monitorTemplate.TempPort= this._hwModule.monitorTemplate.ports,this._hwModule.monitorTemplate.listPorts=this.addPortEle(this._hwModule.monitorTemplate.listPorts,this._hwModule.monitorTemplate.ports)),$(this._svglistGroup).remove(),this._svgGroup&&$(this._svgGroup).remove(),$(this._pathGroup).remove(),this._hwModule.monitorTemplate.mode="list",this.generateListView()):(this._hwModule.monitorTemplate.TempPort&&(this._hwModule.monitorTemplate.ports=this._hwModule.monitorTemplate.TempPort,this._hwModule.monitorTemplate.listPorts= @@ -1763,7 +1764,7 @@ options:[["0","A0"],["1","A1"],["2","A2"],["3","A3"],["4","A4"],["5","A5"]],valu events:{},def:{params:[null]},paramsKeyMap:{PORT:0},func:function(b,a){return a.getStringField("PORT")},syntax:{js:[],py:["%1arduino_get_pwm_port_number#"]}},arduino_get_number_sensor_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"}],events:{},def:{params:[{type:"arduino_get_sensor_number"}],type:"arduino_get_number_sensor_value"},paramsKeyMap:{VALUE:0},"class":"arduino_value",isNotFor:["arduino"],func:function(b,a){var d=a.getValue("VALUE", a);return Entry.hw.getAnalogPortValue(d[1])},syntax:{js:[],py:["Arduino.sensor_value(%1)"]}},arduino_get_digital_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",statements:[],params:[{type:"Block",accept:"string"}],events:{},def:{params:[{type:"arduino_get_port_number"}],type:"arduino_get_digital_value"},paramsKeyMap:{VALUE:0},"class":"arduino_value",isNotFor:["arduino"],func:function(b,a){var d=a.getNumberValue("VALUE",a);return Entry.hw.getDigitalPortValue(d)},syntax:{js:[], py:["Arduino.digital_value(%1)"]}},arduino_toggle_led:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Dropdown",options:[[Lang.Blocks.ARDUINO_on,"on"],[Lang.Blocks.ARDUINO_off,"off"]],value:"on",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"arduino_get_port_number"},null,null],type:"arduino_toggle_led"},paramsKeyMap:{VALUE:0,OPERATOR:1},"class":"arduino_set", -isNotFor:["arduino"],func:function(b,a){var d=a.getNumberValue("VALUE"),c="on"==a.getField("OPERATOR")?255:0;Entry.hw.setDigitalPortValue(d,c);return a.callReturn()},syntax:{js:[],py:["Arduino.toggle_led(%1, %2)"]}},arduino_toggle_pwm:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]}, +isNotFor:["arduino"],func:function(b,a){var d=a.getNumberValue("VALUE"),c=a.getField("OPERATOR");Entry.hw.setDigitalPortValue(d,"on"==c?255:0);return a.callReturn()},syntax:{js:[],py:["Arduino.toggle_led(%1, %2)"]}},arduino_toggle_pwm:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]}, null],type:"arduino_toggle_pwm"},paramsKeyMap:{PORT:0,VALUE:1},"class":"arduino_set",isNotFor:["arduino"],func:function(b,a){var d=a.getNumberValue("PORT"),c=a.getNumberValue("VALUE"),c=Math.round(c),c=Math.max(c,0),c=Math.min(c,255);Entry.hw.setDigitalPortValue(d,c);return a.callReturn()},syntax:{js:[],py:["Arduino.toggle_pwm(%1, %2)"]}},arduino_convert_scale:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"}, {type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"}],events:{},def:{params:[{type:"arduino_get_number_sensor_value",params:[{type:"arduino_get_sensor_number",id:"bl5e"}]},{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"arduino_convert_scale"},paramsKeyMap:{VALUE1:0,VALUE2:1,VALUE3:2,VALUE4:3,VALUE5:4},"class":"arduino",isNotFor:["arduino"],func:function(b,a){var d=a.getNumberValue("VALUE1", a),c=a.getNumberValue("VALUE2",a),e=a.getNumberValue("VALUE3",a),f=a.getNumberValue("VALUE4",a),g=a.getNumberValue("VALUE5",a);if(c>e)var h=c,c=e,e=h;f>g&&(h=f,f=g,g=h);d-=c;d*=(g-f)/(e-c);d+=f;d=Math.min(g,d);d=Math.max(f,d);return Math.round(d)},syntax:{js:[],py:["Arduino.convert_scale(%1, %2, %3, %4, %5)"]}},arduino_ext_get_analog_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[["A0","0"],["A1","1"],["A2","2"],["A3","3"],["A4", @@ -1799,549 +1800,549 @@ e===f.stamp||64g[d-14]?1:0 "LEFT"],[Lang.Blocks.CODEino_string_17,"RIGHT"],[Lang.Blocks.CODEino_string_18,"FRONT"],[Lang.Blocks.CODEino_string_19,"REAR"],[Lang.Blocks.CODEino_string_20,"REVERSE"]],value:"LEFT",fontSize:11}],events:{},def:{params:[null],type:"CODEino_get_accelerometer_direction"},paramsKeyMap:{DIRECTION:0},"class":"CODEino_sensor",isNotFor:["CODEino"],func:function(b,a){var d=a.getField("DIRECTION",a),c=0,e=Entry.ArduinoExt.getSensorTime(Entry.ArduinoExt.sensorTypes.ANALOG),f=Entry.hw.portData.TIME||0,g=a.executor.scope, h=Entry.hw.portData.ANALOG;"LEFT"==d||"RIGHT"==d?c=3:"FRONT"==d||"REAR"==d?c=4:"REVERSE"==d&&(c=5);if(g.isStart)if(f&&f===g.stamp){delete g.isStart;delete g.stamp;c=h[c];c=180/137*(c-265);c+=-90;c=Math.min(90,c);c=Math.max(-90,c);c=Math.round(c);if("LEFT"==d||"REAR"==d)return-30>c?1:0;if("RIGHT"==d||"FRONT"==d)return 30c?1:0}else if(64c?1:0;if("RIGHT"==d||"FRONT"==d)return 30c?1:0}else throw new Entry.Utils.AsyncError;else throw g.isStart=!0,g.stamp=e,Entry.hw.sendQueue.TIME=e,Entry.hw.sendQueue.KEY=Entry.ArduinoExt.getSensorKey(),Entry.hw.sendQueue.GET={type:Entry.ArduinoExt.sensorTypes.ANALOG,port:c},new Entry.Utils.AsyncError;}},CODEino_get_accelerometer_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[["X", -"3"],["Y","4"],["Z","5"]],value:"3",fontSize:11}],events:{},def:{params:[null],type:"CODEino_get_accelerometer_value"},paramsKeyMap:{PORT:0},"class":"CODEino_sensor",isNotFor:["CODEino"],func:function(b,a){var d=a.getNumberField("PORT",a),c=Entry.ArduinoExt.getSensorTime(Entry.ArduinoExt.sensorTypes.ANALOG),e=Entry.hw.portData.TIME||0,f=a.executor.scope,g=Entry.hw.portData.ANALOG,h=0;if(f.isStart){if(e&&e===f.stamp)return delete f.isStart,delete f.stamp,h=g[d],h=Math.min(90,1.46*(h-333)),h=Math.max(-90, -h),Math.round(h);if(64e)var h= -c,c=e,e=h;f>g&&(h=f,f=g,g=h);d-=c;d*=(g-f)/(e-c);d+=f;d=Math.min(g,d);d=Math.max(f,d);return Math.round(d)}},CODEino_set_rgb_value:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[["\ube68\uac15","17"],["\ucd08\ub85d","18"],["\ud30c\ub791","19"]],value:"17",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{type:"CODEino_set_rgb_value"},paramsKeyMap:{PORT:0,VALUE:1},"class":"CODEino_RGBLED_mode", -isNotFor:["CODEino"],func:function(b,a){var d=Entry.hw.sendQueue,c=a.getNumberField("PORT",a),e=a.getNumberValue("VALUE",a),e=Math.min(255,e),e=Math.max(0,e);17==c?CODEINO_RED=e:18==c?CODEINO_GREEN=e:CODEINO_BLUE=e;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:e};return a.callReturn()}},CODEino_set_rgb_add_value:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[["\ube68\uac15","17"],["\ucd08\ub85d", -"18"],["\ud30c\ub791","19"]],value:"17",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{type:"CODEino_set_rgb_add_value"},paramsKeyMap:{PORT:0,VALUE:1},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){var d=Entry.hw.sendQueue,c=a.getNumberField("PORT",a),e=a.getNumberValue("VALUE",a),e=Math.min(255,e),e=Math.max(0,e);17==c&&(CODEINO_RED+=e,CODEINO_RED=Math.min(255,CODEINO_RED),e=CODEINO_RED=Math.max(0,CODEINO_RED)); -18==c&&(CODEINO_GREEN+=e,CODEINO_GREEN=Math.min(255,CODEINO_GREEN),e=CODEINO_GREEN=Math.max(0,CODEINO_GREEN));19==c&&(CODEINO_BLUE+=e,CODEINO_BLUE=Math.min(255,CODEINO_BLUE),e=CODEINO_BLUE=Math.max(0,CODEINO_BLUE));d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:e};return a.callReturn()}},CODEino_rgb_set_color:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Color"},{type:"Indicator",img:"block_icon/brush_03.png", -size:12}],events:{},def:{params:[null],type:"CODEino_rgb_set_color"},paramsKeyMap:{VALUE:0},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){var d=a.getStringField("VALUE");CODEINO_RED=parseInt(d.substr(1,2),16);CODEINO_GREEN=parseInt(d.substr(3,2),16);CODEINO_BLUE=parseInt(d.substr(5,2),16);var d=Entry.hw.sendQueue,c=17;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_RED};d=Entry.hw.sendQueue;c=18; -d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_GREEN};d=Entry.hw.sendQueue;c=19;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_BLUE};return a.callReturn()}},CODEino_set_rgb_off:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"CODEino_set_rgb_off"}, -"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){var d=Entry.hw.sendQueue;CODEINO_GREEN=CODEINO_BLUE=CODEINO_RED=0;var c=17;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:0};d=Entry.hw.sendQueue;c=18;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:0};d=Entry.hw.sendQueue;c=19;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey(); -d.SET||(d.SET={});d.SET[c]={type:4,data:0};return a.callReturn()}},CODEino_set__led_by_rgb:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["255"]},{type:"text",params:["255"]},{type:"text",params:["255"]},null],type:"CODEino_set__led_by_rgb"},paramsKeyMap:{rValue:0,gValue:1,bValue:2},"class":"CODEino_RGBLED_mode", -isNotFor:["CODEino"],func:function(b,a){CODEINO_RED=a.getNumberValue("rValue");CODEINO_GREEN=a.getNumberValue("gValue");CODEINO_BLUE=a.getNumberValue("bValue");var d=Entry.hw.sendQueue,c=17;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_RED};d=Entry.hw.sendQueue;c=18;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_GREEN};d=Entry.hw.sendQueue; -c=19;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_BLUE};return a.callReturn()}},CODEino_led_by_value:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"CODEino_led_by_value"},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){var d=Entry.hw.sendQueue,c=17;CODEINO_BLUE=CODEINO_GREEN=CODEINO_RED=100; -d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:100};d=Entry.hw.sendQueue;c=18;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:100};d=Entry.hw.sendQueue;c=19;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:100};return a.callReturn()}},CODEino_get_number_sensor_value:{parent:"arduino_get_number_sensor_value", -isNotFor:["CODEino"],def:{params:[{type:"arduino_get_sensor_number"}],type:"CODEino_get_number_sensor_value"},"class":"arduino_value",syntax:{js:[],py:["hw.CODEino_get_number_sensor_value(%1)"]}},CODEino_toggle_led:{parent:"arduino_toggle_led",isNotFor:["CODEino"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"CODEino_toggle_led"},"class":"arduino_set",syntax:{js:[],py:["hw.CODEino_toggle_led(%1)"]}},CODEino_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["CODEino"],def:{params:[{type:"arduino_get_pwm_port_number"}, -{type:"arduino_text",params:["255"]},null],type:"CODEino_toggle_pwm"},"class":"arduino_set",syntax:{js:[],py:["hw.CODEino_toggle_pwm(%1, %2)"]}},nemoino_get_named_sensor_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],template:"%1 \uc13c\uc11c\uac12",params:[{type:"Dropdown",options:[["\uc18c\ub9ac","0"],["\ube5b","1"],["\uc2ac\ub77c\uc774\ub354","2"],["\uc800\ud56d-A","3"],["\uc800\ud56d-B","4"],["\uc800\ud56d-C","5"],["\uc800\ud56d-D","6"]],value:"0",fontSize:11}], -events:{},def:{params:[null],type:"nemoino_get_named_sensor_value"},paramsKeyMap:{PORT:0},"class":"nemoino",isNotFor:["nemoino"],func:function(b,a){return Entry.hw.getAnalogPortValue(a.getField("PORT",a))}},nemoino_get_sound_status:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",statements:[],template:"\uc18c\ub9ac\uc13c\uc11c %1",params:[{type:"Dropdown",options:[["\uc18c\ub9ac\ud07c","GREAT"],["\uc18c\ub9ac\uc791\uc74c","SMALL"]],value:"GREAT",fontSize:11}],events:{},def:{params:[null], -type:"nemoino_get_sound_status"},paramsKeyMap:{STATUS:0},"class":"nemoino",isNotFor:["nemoino"],func:function(b,a){return"GREAT"==a.getField("STATUS",a)?600Entry.hw.getAnalogPortValue(0)?1:0}},nemoino_is_button_pressed:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",statements:[],template:"\ubcf4\ub4dc\uc758 %1",params:[{type:"Dropdown",options:[["\ubc84\ud2bc\ub204\ub984","4"],["A\uc5f0\uacb0\ub428","17"],["B\uc5f0\uacb0\ub428","18"],["C\uc5f0\uacb0\ub428", -"19"],["D\uc5f0\uacb0\ub428","20"]],value:"4",fontSize:11}],events:{},def:{params:[null],type:"nemoino_is_button_pressed"},paramsKeyMap:{PORT:0},"class":"nemoino",isNotFor:["nemoino"],func:function(b,a){var d=a.getNumberField("PORT",a);return 14c?1:0;if("RIGHT"==d||"FRONT"==d)return 30c?1:0}},nemoino_get_accelerometer_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],template:"3\ucd95 \uac00\uc18d\ub3c4\uc13c\uc11c %1 \ucd95\uc758 \uc13c\uc11c\uac12",params:[{type:"Dropdown",options:[["X","3"],["Y","4"],["Z","5"]], -value:"3",fontSize:11}],events:{},def:{params:[null],type:"nemoino_get_accelerometer_value"},paramsKeyMap:{PORT:0},"class":"nemoino",isNotFor:["nemoino"],func:function(b,a){var d=265,c=402,e=-90,f=90,g=Entry.hw.getAnalogPortValue(a.getField("PORT",a));if(d>c)var h=d,d=c,c=h;e>f&&(h=e,e=f,f=h);g=(f-e)/(c-d)*(g-d);g+=e;g=Math.min(f,g);g=Math.max(e,g);return Math.round(g)}},bitbrick_sensor_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"DropdownDynamic", -value:null,fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW,menuName:Entry.Bitbrick.sensorList}],events:{},def:{params:[null],type:"bitbrick_sensor_value"},paramsKeyMap:{PORT:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getStringField("PORT");return Entry.hw.portData[d].value},syntax:{js:[],py:["Bitbrick.sensor_value(%1)"]}},bitbrick_is_touch_pressed:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",statements:[],params:[{type:"DropdownDynamic",value:null, -fontSize:11,menuName:Entry.Bitbrick.touchList}],events:{},def:{params:[null],type:"bitbrick_is_touch_pressed"},paramsKeyMap:{PORT:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){return 0===Entry.hw.portData[a.getStringField("PORT")].value},syntax:{js:[],py:["Bitbrick.is_touch_pressed(%1)"]}},bitbrick_turn_off_color_led:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"bitbrick_turn_off_color_led", -id:"i3je"},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){Entry.hw.sendQueue.LEDR=0;Entry.hw.sendQueue.LEDG=0;Entry.hw.sendQueue.LEDB=0;return a.callReturn()},syntax:{js:[],py:["Bitbrick.turn_off_color_led()"]}},bitbrick_turn_on_color_led_by_rgb:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text", -params:["255"]},{type:"text",params:["255"]},{type:"text",params:["255"]},null],type:"bitbrick_turn_on_color_led_by_rgb"},paramsKeyMap:{rValue:0,gValue:1,bValue:2},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getNumberValue("rValue"),c=a.getNumberValue("gValue"),e=a.getNumberValue("bValue"),f=Entry.adjustValueWithMaxMin,g=Entry.hw.sendQueue;g.LEDR=f(d,0,255);g.LEDG=f(c,0,255);g.LEDB=f(e,0,255);return a.callReturn()},syntax:{js:[],py:["Bitbrick.color_led_by_rgb(%1, %2, %3)"]}}, -bitbrick_turn_on_color_led_by_picker:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Color"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"bitbrick_turn_on_color_led_by_picker"},paramsKeyMap:{VALUE:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getStringField("VALUE");Entry.hw.sendQueue.LEDR=parseInt(d.substr(1,2),16);Entry.hw.sendQueue.LEDG=parseInt(d.substr(3,2),16);Entry.hw.sendQueue.LEDB=parseInt(d.substr(5, -2),16);return a.callReturn()},syntax:{js:[],py:["Bitbrick.color_led_by_picker(%1)"]}},bitbrick_turn_on_color_led_by_value:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["0"]},null],type:"bitbrick_turn_on_color_led_by_value"},paramsKeyMap:{VALUE:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getNumberValue("VALUE"),c,e,f,d=d%200;67> -d?(c=200-3*d,e=3*d,f=0):134>d?(d-=67,c=0,e=200-3*d,f=3*d):201>d&&(d-=134,c=3*d,e=0,f=200-3*d);Entry.hw.sendQueue.LEDR=c;Entry.hw.sendQueue.LEDG=e;Entry.hw.sendQueue.LEDB=f;return a.callReturn()},syntax:{js:[],py:["Bitbrick.color_led_by_value(%1)"]}},bitbrick_buzzer:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["60"]},null],type:"bitbrick_buzzer"},paramsKeyMap:{VALUE:0}, -"class":"condition",isNotFor:["bitbrick"],func:function(b,a){if(a.isStart)return Entry.hw.sendQueue.buzzer=0,delete a.isStart,a.callReturn();var d=a.getNumberValue("VALUE");Entry.hw.sendQueue.buzzer=d;a.isStart=!0;return a},syntax:{js:[],py:["Bitbrick.buzzer(%1)"]}},bitbrick_turn_off_all_motors:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"bitbrick_turn_off_all_motors"},"class":"condition",isNotFor:["bitbrick"], -func:function(b,a){var d=Entry.hw.sendQueue,c=Entry.Bitbrick;c.servoList().map(function(a){d[a[1]]=0});c.dcList().map(function(a){d[a[1]]=128});return a.callReturn()},syntax:{js:[],py:["Bitbrick.turn_off_all_motors()"]}},bitbrick_dc_speed:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,menuName:Entry.Bitbrick.dcList},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"text", -params:["60"]},null],type:"bitbrick_dc_speed"},paramsKeyMap:{PORT:0,VALUE:1},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getNumberValue("VALUE"),d=Math.min(d,Entry.Bitbrick.dcMaxValue),d=Math.max(d,Entry.Bitbrick.dcMinValue);Entry.hw.sendQueue[a.getStringField("PORT")]=d+128;return a.callReturn()},syntax:{js:[],py:["Bitbrick.dc_speed(%1, %2)"]}},bitbrick_dc_direction_speed:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11, -menuName:Entry.Bitbrick.dcList},{type:"Dropdown",options:[[Lang.Blocks.BITBRICK_dc_direction_cw,"CW"],[Lang.Blocks.BITBRICK_dc_direction_ccw,"CCW"]],value:"CW",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,{type:"text",params:["100"]},null],type:"bitbrick_dc_direction_speed"},paramsKeyMap:{PORT:0,DIRECTION:1,VALUE:2},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d="CW"===a.getStringField("DIRECTION"), -c=a.getNumberValue("VALUE"),c=Math.min(c,Entry.Bitbrick.dcMaxValue),c=Math.max(c,0);Entry.hw.sendQueue[a.getStringField("PORT")]=d?c+128:128-c;return a.callReturn()},syntax:{js:[],py:["Bitbrick.dc_direction_speed(%1, %2, %3)"]}},bitbrick_servomotor_angle:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,menuName:Entry.Bitbrick.servoList},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null, -{type:"text",params:["100"]},null],type:"bitbrick_servomotor_angle"},paramsKeyMap:{PORT:0,VALUE:1},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=Entry.Bitbrick.servoMaxValue-(a.getNumberValue("VALUE")+1),d=Math.min(d,Entry.Bitbrick.servoMaxValue),d=Math.max(d,Entry.Bitbrick.servoMinValue);Entry.hw.sendQueue[a.getStringField("PORT")]=d;return a.callReturn()},syntax:{js:[],py:["Bitbrick.servomotor_angle(%1, %2)"]}},bitbrick_convert_scale:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field", -statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,menuName:Entry.Bitbrick.sensorList},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"}],events:{},def:{params:[null,{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["-100"]},{type:"number",params:["100"]}],type:"bitbrick_convert_scale"},paramsKeyMap:{PORT:0,VALUE2:1,VALUE3:2,VALUE4:3,VALUE5:4},"class":"condition",isNotFor:["bitbrick"], -func:function(b,a){var d=a.getNumberField("PORT"),c=Entry.hw.portData[d].value,d=a.getNumberValue("VALUE2",a),e=a.getNumberValue("VALUE3",a),f=a.getNumberValue("VALUE4",a),g=a.getNumberValue("VALUE5",a);if(f>g)var h=f,f=g,g=h;c-=d;c*=(g-f)/(e-d);c+=f;c=Math.min(g,c);c=Math.max(f,c);return Math.round(c)},syntax:{js:[],py:["Bitbrick.convert_scale(%1, %2, %3, %4, %5)"]}},cobl_read_ultrason:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"1. \ucd08\uc74c\ud30c\uac70\ub9ac(0~400)", -def:{type:"cobl_read_ultrason"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("ultrason")}},cobl_read_potenmeter:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"2.\uac00\ubcc0\uc800\ud56d(0~1023)",def:{type:"cobl_read_potenmeter"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("potenmeter")}},cobl_read_irread1:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"3.\uc801\uc678\uc120\uc13c\uc11c1(0~1023)", -def:{type:"cobl_read_irread1"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("irread1")}},cobl_read_irread2:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"4.\uc801\uc678\uc120\uc13c\uc11c2(0~1023)",def:{type:"cobl_read_irread2"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("irread2")}},cobl_read_joyx:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"5.\uc870\uc774\uc2a4\ud2f1X\ucd95(1, 0, -1)", -def:{type:"cobl_read_joyx"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("joyx")}},cobl_read_joyy:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"6.\uc870\uc774\uc2a4\ud2f1Y\ucd95(1, 0, -1)",def:{type:"cobl_read_joyy"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("joyy")}},cobl_read_tilt:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"7.\uae30\uc6b8\uae30\uc13c\uc11c(0~4)", -def:{type:"cobl_read_tilt"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("tilt")}},cobl_read_temps:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"8.\uc628\ub3c4\uc13c\uc11c@\ud3ec\ud2b8%1",params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11}],def:{params:["1"],type:"cobl_read_temps"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getValue("VALUE",a);if(1==d)return Entry.hw.getAnalogPortValue("temps1"); -if(2==d)return Entry.hw.getAnalogPortValue("temps2")}},cobl_read_light:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"9.\ube5b\uc13c\uc11c@\ud3ec\ud2b8%1",params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11}],def:{params:["1"],type:"cobl_read_light"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getValue("VALUE",a);if(1==d)return Entry.hw.getAnalogPortValue("light1");if(2==d)return Entry.hw.getAnalogPortValue("light2")}}, -cobl_read_btn:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",template:"10.\ubc84\ud2bc\uc2a4\uc704\uce58@\ud3ec\ud2b8%1",params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11}],def:{params:["1"],type:"cobl_read_btn"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getValue("VALUE",a);if(1==d)return Entry.hw.getDigitalPortValue("btn1");if(2==d)return Entry.hw.getDigitalPortValue("btn2")}},cobl_led_control:{color:"#00979D",fontColor:"#fff", -skeleton:"basic",template:"11.\ubb34\uc9c0\uac1cLED%1%2 %3",params:[{type:"Dropdown",options:[["1","1"],["2","2"],["3","3"]],fontSize:11},{type:"Dropdown",options:[["OFF","OFF"],["\ube68\uac15","Red"],["\uc8fc\ud669","Orange"],["\ub178\ub791","Yellow"],["\ucd08\ub85d","Green"],["\ud30c\ub791","Blue"],["\ub0a8\uc0c9","Dark Blue"],["\ubcf4\ub77c","Purple"],["\ud770\uc0c9","White"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["1","OFF"],type:"cobl_led_control"}, -paramsKeyMap:{PORT:0,OPERATOR:1},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getStringField("PORT"),c=a.getStringField("OPERATOR");Entry.hw.setDigitalPortValue("RainBowLED_"+d,c);Entry.hw.update();delete Entry.hw.sendQueue["RainBowLED_"+d];return a.callReturn()}},cobl_servo_angle_control:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"12.\uac01\ub3c4\ubaa8\ud130 \uac01\ub3c4%1(15~165) %2",params:[{type:"TextInput",value:0},{type:"Indicator",img:"block_icon/hardware_03.png", -size:12}],def:{type:"cobl_servo_angle_control"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getNumberField("VALUE"),d=Math.round(d),d=Math.max(d,15),d=Math.min(d,165);Entry.hw.setDigitalPortValue("Servo1",d);Entry.hw.update();delete Entry.hw.sendQueue.Servo1;return a.callReturn()}},cobl_melody:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"13.\uba5c\ub85c\ub514%1 ,%2",params:[{type:"Dropdown",options:[["((\ub0ae\uc740)\uc194","L_So"],["(\ub0ae\uc740)\uc194#", -"L_So#"],["(\ub0ae\uc740)\ub77c","L_La"],["(\ub0ae\uc740)\ub77c#","L_La#"],["(\ub0ae\uc740)\uc2dc","L_Ti"],["\ub3c4","Do"],["\ub3c4#","Do#"],["\ub808","Re"],["\ub808#","Re#"],["\ubbf8","Mi"],["\ud30c","Fa"],["\ud30c#","Fa#"],["\uc194","So"],["\uc194#","So#"],["\ub77c","La"],["\ub77c#","La#"],["\uc2dc","Ti"],["(\ub192\uc740)\ub3c4","H_Do"],["(\ub192\uc740)\ub3c4#","H_Do#"],["(\ub192\uc740)\ub808","H_Re"],["(\ub192\uc740)\ub808#","H_Re#"],["(\ub192\uc740)\ubbf8#","H_Mi"],["(\ub192\uc740)\ud30c","H_Fa"]], -fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["Do"],type:"cobl_melody"},paramsKeyMap:{MELODY:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getStringField("MELODY");Entry.hw.setDigitalPortValue("Melody",d);Entry.hw.update();delete Entry.hw.sendQueue.Melody;return a.callReturn()}},cobl_dcmotor:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"14.\ud68c\uc804\ubaa8\ud130%1%2\uc18d\ub3c4%3 %4",params:[{type:"Dropdown",options:[["1","1"], -["2","2"]],fontSize:11},{type:"Dropdown",options:[["1.\uc2dc\uacc4\ubc29\ud5a5","1"],["2.\ubc18\uc2dc\uacc4\ubc29\ud5a5","2"],["3.\uc815\uc9c0","3"]],fontSize:11},{type:"Dropdown",options:[["1","1"],["2","2"],["3","3"],["4","4"],["5","5"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["1","1","1"],type:"cobl_dcmotor"},paramsKeyMap:{MOTOR:0,DIRECTION:1,SPEED:2},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getStringField("MOTOR"),c=a.getStringField("DIRECTION"), -e=a.getStringField("SPEED");1==d&&(Entry.hw.setDigitalPortValue("DC1_DIR",c),Entry.hw.setDigitalPortValue("DC1_SPEED",e),Entry.hw.update(),delete Entry.hw.sendQueue.DC1_DIR,delete Entry.hw.sendQueue.DC1_SPEED);2==d&&(Entry.hw.setDigitalPortValue("DC2_DIR",c),Entry.hw.setDigitalPortValue("DC2_SPEED",e),Entry.hw.update(),delete Entry.hw.sendQueue.DC2_DIR,delete Entry.hw.sendQueue.DC2_SPEED);return a.callReturn()}},cobl_extention_port:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"15.USB\ud3ec\ud2b8%1\ub2e8\uacc4%2 %3", -params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["1","0"],type:"cobl_extention_port"},paramsKeyMap:{PORT:0,LEVEL:1},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getStringField("PORT"),c=a.getStringField("LEVEL");1==d&&(Entry.hw.setDigitalPortValue("EXUSB1",c),Entry.hw.update(),delete Entry.hw.sendQueue.EXUSB1); -2==d&&(Entry.hw.setDigitalPortValue("EXUSB2",c),Entry.hw.update(),delete Entry.hw.sendQueue.EXUSB2);return a.callReturn()}},cobl_external_led:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"16.\uc678\ubd80LED%1(1~64)R%2G%3B%4 %5",params:[{type:"TextInput",value:0,fontSize:11},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"]],fontSize:11},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3", -"3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"]],fontSize:11},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["1","1","1","1"],type:"cobl_external_led"},paramsKeyMap:{LED:0,RED:1,GREEN:2,BLUE:3},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getNumberField("LED"),c=a.getStringField("RED"), -e=a.getStringField("GREEN"),f=a.getStringField("BLUE");Entry.hw.setDigitalPortValue("ELED_IDX",d);Entry.hw.setDigitalPortValue("ELED_R",c);Entry.hw.setDigitalPortValue("ELED_G",e);Entry.hw.setDigitalPortValue("ELED_B",f);Entry.hw.update();delete Entry.hw.sendQueue.ELED_IDX;delete Entry.hw.sendQueue.ELED_R;delete Entry.hw.sendQueue.ELED_G;delete Entry.hw.sendQueue.ELED_B;return a.callReturn()}},cobl_7_segment:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"17.\uc22b\uc790\uc804\uad11\ud310%1(0~9999) %2", -params:[{type:"TextInput",value:0},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{type:"cobl_7_segment"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getNumberField("VALUE");Entry.hw.setDigitalPortValue("7SEG",d);Entry.hw.update();delete Entry.hw.sendQueue["7SEG"];return a.callReturn()}},start_drawing:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null], -type:"start_drawing"},"class":"brush_control",isNotFor:["textBox"],func:function(b,a){b.brush?b.brush.stop=!1:Entry.setBasicBrush(b);Entry.stage.sortZorder();b.brush.moveTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.start_drawing()"]}},stop_drawing:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"stop_drawing"},"class":"brush_control",isNotFor:["textBox"],func:function(b, -a){b.brush&&b.shape&&(b.brush.stop=!0);return a.callReturn()},syntax:{js:[],py:["Entry.stop_drawing()"]}},set_color:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Color"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"set_color"},paramsKeyMap:{VALUE:0},"class":"brush_color",isNotFor:["textBox"],func:function(b,a){var d=a.getField("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);b.brush&&(d=Entry.hex2rgb(d),b.brush.rgb=d,b.brush.endStroke(), -b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:["Entry.set_brush_color(%1)"]}},set_random_color:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"set_random_color"},"class":"brush_color",isNotFor:["textBox"],func:function(b,a){b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);if(b.brush){var d= -Entry.generateRgb();b.brush.rgb=d;b.brush.endStroke();b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")");b.brush.moveTo(b.getX(),-1*b.getY())}return a.callReturn()},syntax:{js:[],py:["Entry.set_brush_color_random()"]}},change_thickness:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["1"]},null],type:"change_thickness"},paramsKeyMap:{VALUE:0}, -"class":"brush_thickness",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);b.brush&&(b.brush.thickness+=d,1>b.brush.thickness&&(b.brush.thickness=1),b.brush.setStrokeStyle(b.brush.thickness),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:["Entry.add_brush_size(%1)"]}},set_thickness:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png", -size:12}],events:{},def:{params:[{type:"number",params:["1"]},null],type:"set_thickness"},paramsKeyMap:{VALUE:0},"class":"brush_thickness",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);b.brush&&(b.brush.thickness=d,b.brush.setStrokeStyle(b.brush.thickness),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:["Entry.set_brush_size(%1)"]}},change_opacity:{color:"#FF9E20",skeleton:"basic",statements:[], -params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"change_opacity"},paramsKeyMap:{VALUE:0},"class":"brush_opacity",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);d=Entry.adjustValueWithMaxMin(b.brush.opacity+d,0,100);b.brush&&(b.brush.opacity=d,b.brush.endStroke(),d=b.brush.rgb,b.brush.beginStroke("rgba("+d.r+","+ -d.g+","+d.b+","+b.brush.opacity/100+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:[""]}},set_opacity:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["50"]},null],type:"set_opacity"},paramsKeyMap:{VALUE:0},"class":"brush_opacity",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b), -b.brush.stop=!0);b.brush&&(b.brush.opacity=Entry.adjustValueWithMaxMin(d,0,100),b.brush.endStroke(),d=b.brush.rgb,b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:[""]}},brush_erase_all:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"brush_erase_all"},"class":"brush_clear",isNotFor:["textBox"], -func:function(b,a){var d=b.brush;if(d){var c=d._stroke.style,e=d._strokeStyle.width;d.clear().setStrokeStyle(e).beginStroke(c);d.moveTo(b.getX(),-1*b.getY())}d=b.parent.getStampEntities();d.map(function(a){a.removeClone()});d=null;return a.callReturn()},syntax:{js:[],py:["Entry.clear_drawing()"]}},brush_stamp:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"brush_stamp"},"class":"stamp",isNotFor:["textBox"], -func:function(b,a){b.parent.addStampEntity(b);return a.callReturn()},syntax:{js:[],py:["Entry.stamp()"]}},change_brush_transparency:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"change_brush_transparency"},paramsKeyMap:{VALUE:0},"class":"brush_opacity",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b), -b.brush.stop=!0);d=Entry.adjustValueWithMaxMin(b.brush.opacity-d,0,100);b.brush&&(b.brush.opacity=d,b.brush.endStroke(),d=b.brush.rgb,b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:["Entry.add_brush_transparency(%1)"]}},set_brush_tranparency:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{}, -def:{params:[{type:"number",params:["50"]},null],type:"set_brush_tranparency"},paramsKeyMap:{VALUE:0},"class":"brush_opacity",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);b.brush&&(b.brush.opacity=Entry.adjustValueWithMaxMin(d,0,100),b.brush.endStroke(),d=b.brush.rgb,b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+(1-b.brush.opacity/100)+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[], -py:["Entry.set_brush_transparency(%1)"]}},number:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"TextInput",value:10}],events:{},def:{params:[]},paramsKeyMap:{NUM:0},func:function(b,a){return a.getField("NUM",a)},isPrimitive:!0,syntax:{js:["Scope","%1"],py:["%1number#"]}},angle:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Angle"}],events:{},def:{params:[null],type:"angle"},paramsKeyMap:{ANGLE:0},func:function(b,a){return a.getNumberField("ANGLE")}, -syntax:{js:[],py:["%1angle#"]}},get_x_coordinate:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_x_coordinate,color:"#3D3D3D"}],events:{},def:{params:[null],type:"get_x_coordinate"},"class":"calc",isNotFor:[],func:function(b,a){return b.getX()},syntax:{js:[],py:[""]}},get_y_coordinate:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_y_coordinate,color:"#3D3D3D"}],events:{},def:{params:[null], -type:"get_y_coordinate"},"class":"calc",isNotFor:[],func:function(b,a){return b.getY()},syntax:{js:[],py:[""]}},get_angle:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_angle,color:"#3D3D3D"}],events:{},def:{params:[null]},func:function(b,a){return parseFloat(b.getRotation().toFixed(1))},syntax:{js:[],py:[""]}},get_rotation_direction:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.CALC_rotation_value, -"ROTATION"],[Lang.Blocks.CALC_direction_value,"DIRECTION"]],value:"ROTATION",fontSize:11}],events:{},def:{params:[null],type:"get_rotation_direction"},paramsKeyMap:{OPERATOR:0},"class":"calc",isNotFor:[],func:function(b,a){return"DIRECTION"==a.getField("OPERATOR",a).toUpperCase()?parseFloat(b.getDirection().toFixed(1)):parseFloat(b.getRotation().toFixed(1))},syntax:{js:[],py:[""]}},distance_something:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_distance_something_1, -color:"#3D3D3D"},{type:"DropdownDynamic",value:null,menuName:"spritesWithMouse",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_distance_something_2,color:"#3D3D3D"}],events:{},def:{params:[null,null,null],type:"distance_something"},paramsKeyMap:{VALUE:1},"class":"calc_distance",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a);if("mouse"==d)return d=Entry.stage.mouseCoordinate,Math.sqrt(Math.pow(b.getX()-d.x,2)+Math.pow(b.getY()-d.y,2));d=Entry.container.getEntity(d); -return Math.sqrt(Math.pow(b.getX()-d.getX(),2)+Math.pow(b.getY()-d.getY(),2))},syntax:{js:[],py:["Entry.value_of_distance(%2)"]}},coordinate_mouse:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_coordinate_mouse_1,color:"#3D3D3D"},{type:"Dropdown",options:[["x","x"],["y","y"]],value:"x",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_coordinate_mouse_2,color:"#3D3D3D"}],events:{},def:{params:[null,null, -null],type:"coordinate_mouse"},paramsKeyMap:{VALUE:1},"class":"calc",isNotFor:[],func:function(b,a){return"x"===a.getField("VALUE",a)?Number(Entry.stage.mouseCoordinate.x):Number(Entry.stage.mouseCoordinate.y)},syntax:{js:[],py:["Entry.coordinate_of_mouse(%2)"]}},coordinate_object:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_coordinate_object_1,color:"#3D3D3D"},{type:"DropdownDynamic",value:null,menuName:"spritesWithSelf",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC}, -{type:"Text",text:Lang.Blocks.CALC_coordinate_object_2,color:"#3D3D3D"},{type:"Dropdown",options:[[Lang.Blocks.CALC_coordinate_x_value,"x"],[Lang.Blocks.CALC_coordinate_y_value,"y"],[Lang.Blocks.CALC_coordinate_rotation_value,"rotation"],[Lang.Blocks.CALC_coordinate_direction_value,"direction"],[Lang.Blocks.CALC_coordinate_size_value,"size"],[Lang.Blocks.CALC_picture_index,"picture_index"],[Lang.Blocks.CALC_picture_name,"picture_name"]],value:"x",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC}], -events:{},def:{params:[null,null,null,null],type:"coordinate_object"},paramsKeyMap:{VALUE:1,COORDINATE:3},"class":"calc",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),d="self"==d?b:Entry.container.getEntity(d);switch(a.getField("COORDINATE",a)){case "x":return d.getX();case "y":return d.getY();case "rotation":return d.getRotation();case "direction":return d.getDirection();case "picture_index":var c=d.parent,c=c.pictures;return c.indexOf(d.picture)+1;case "size":return Number(d.getSize().toFixed(1)); -case "picture_name":return c=d.parent,c=c.pictures,c[c.indexOf(d.picture)].name}},syntax:{js:[],py:["Entry.value_of(%2, %4)"]}},calc_basic:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Dropdown",options:[["+","PLUS"],["-","MINUS"],["x","MULTI"],["/","DIVIDE"]],value:"PLUS",fontSize:11,noArrow:!0},{type:"Block",accept:"string"}],events:{},def:{params:[{type:"number",params:["10"]},"PLUS",{type:"number",params:["10"]}],type:"calc_basic"}, -defs:[{params:[{type:"number",params:["10"]},"PLUS",{type:"number",params:["10"]}],type:"calc_basic"},{params:[{type:"number",params:["10"]},"MINUS",{type:"number",params:["10"]}],type:"calc_basic"},{params:[{type:"number",params:["10"]},"MULTI",{type:"number",params:["10"]}],type:"calc_basic"},{params:[{type:"number",params:["10"]},"DIVIDE",{type:"number",params:["10"]}],type:"calc_basic"}],paramsKeyMap:{LEFTHAND:0,OPERATOR:1,RIGHTHAND:2},"class":"calc",isNotFor:[],func:function(b,a){var d=a.getField("OPERATOR", -a),c=a.getNumberValue("LEFTHAND",a),e=a.getNumberValue("RIGHTHAND",a);return"PLUS"==d?c+e:"MINUS"==d?c-e:"MULTI"==d?c*e:c/e},syntax:{js:[],py:["(%1 %2calc_basic# %3)"]}},calc_plus:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"+",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[null]},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND", -a);return d+c},syntax:{js:[],py:[""]}},calc_minus:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"-",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[null]},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d-c},syntax:{js:[],py:[""]}},calc_times:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block", -accept:"string"},{type:"Text",text:"x",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[null]},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d*c},syntax:{js:[],py:[""]}},calc_divide:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"/",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[null]},paramsKeyMap:{LEFTHAND:0, -RIGHTHAND:2},func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d/c},syntax:{js:[],py:[""]}},calc_mod:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"/",color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_calc_mod_3,color:"#3D3D3D"}],events:{},def:{params:[{type:"number",params:["10"]},null,{type:"number",params:["10"]},null],type:"calc_mod"},paramsKeyMap:{LEFTHAND:0, -RIGHTHAND:2},"class":"calc",isNotFor:[],func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d%c},syntax:{js:[],py:["Entry.get_remainder(%1, %3)"]}},calc_share:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"/",color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:"\uc758 \ubaab",color:"#3D3D3D"}],events:{},def:{params:[{type:"number",params:["10"]},null,{type:"number",params:["10"]}, -null],type:"calc_share"},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},"class":"calc",isNotFor:[],func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return Math.floor(d/c)},syntax:{js:[],py:[""]}},calc_operation:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_calc_operation_of_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_calc_operation_of_2,color:"#3D3D3D"},{type:"Dropdown", -options:[[Lang.Blocks.CALC_calc_operation_square,"square"],[Lang.Blocks.CALC_calc_operation_root,"root"],[Lang.Blocks.CALC_calc_operation_sin,"sin"],[Lang.Blocks.CALC_calc_operation_cos,"cos"],[Lang.Blocks.CALC_calc_operation_tan,"tan"],[Lang.Blocks.CALC_calc_operation_asin,"asin_radian"],[Lang.Blocks.CALC_calc_operation_acos,"acos_radian"],[Lang.Blocks.CALC_calc_operation_atan,"atan_radian"],[Lang.Blocks.CALC_calc_operation_log,"log"],[Lang.Blocks.CALC_calc_operation_ln,"ln"],[Lang.Blocks.CALC_calc_operation_unnatural, -"unnatural"],[Lang.Blocks.CALC_calc_operation_floor,"floor"],[Lang.Blocks.CALC_calc_operation_ceil,"ceil"],[Lang.Blocks.CALC_calc_operation_round,"round"],[Lang.Blocks.CALC_calc_operation_factorial,"factorial"],[Lang.Blocks.CALC_calc_operation_abs,"abs"]],value:"square",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC}],events:{},def:{params:[null,{type:"number",params:["10"]},null,null],type:"calc_operation"},paramsKeyMap:{LEFTHAND:1,VALUE:3},"class":"calc",isNotFor:[],func:function(b,a){var d= -a.getNumberValue("LEFTHAND",a),c=a.getField("VALUE",a);if(-1<["asin_radian","acos_radian"].indexOf(c)&&(1d))throw Error("x range exceeded");c.indexOf("_")&&(c=c.split("_")[0]);-1<["sin","cos","tan"].indexOf(c)&&(d=Entry.toRadian(d));var e=0;switch(c){case "square":e=d*d;break;case "factorial":e=Entry.factorial(d);break;case "root":e=Math.sqrt(d);break;case "log":e=Math.log(d)/Math.LN10;break;case "ln":e=Math.log(d);break;case "asin":case "acos":case "atan":e=Entry.toDegrees(Math[c](d));break; -case "unnatural":e=d-Math.floor(d);0>d&&(e=1-e);break;default:e=Math[c](d)}return e},syntax:{js:[],py:["Entry.value_of_math_operation(%2, %4)"]}},calc_rand:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_calc_rand_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_calc_rand_2,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_calc_rand_3,color:"#3D3D3D"}],events:{},def:{params:[null, -{type:"number",params:["0"]},null,{type:"number",params:["10"]},null],type:"calc_rand"},paramsKeyMap:{LEFTHAND:1,RIGHTHAND:3},"class":"calc",isNotFor:[],func:function(b,a){var d=a.getStringValue("LEFTHAND",a),c=a.getStringValue("RIGHTHAND",a),e=Math.min(d,c),f=Math.max(d,c),d=Entry.isFloat(d);return Entry.isFloat(c)||d?(Math.random()*(f-e)+e).toFixed(2):Math.floor(Math.random()*(f-e+1)+e)},syntax:{js:[],py:["random.randint(%2, %4)"]}},get_date:{color:"#FFD974",skeleton:"basic_string_field",statements:[], -params:[{type:"Text",text:Lang.Blocks.CALC_get_date_1,color:"#3D3D3D"},{type:"Dropdown",options:[[Lang.Blocks.CALC_get_date_year,"YEAR"],[Lang.Blocks.CALC_get_date_month,"MONTH"],[Lang.Blocks.CALC_get_date_day,"DAY"],[Lang.Blocks.CALC_get_date_hour,"HOUR"],[Lang.Blocks.CALC_get_date_minute,"MINUTE"],[Lang.Blocks.CALC_get_date_second,"SECOND"]],value:"YEAR",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_get_date_2,color:"#3D3D3D"}],events:{},def:{params:[null, -"YEAR",null],type:"get_date"},paramsKeyMap:{VALUE:1},"class":"calc_date",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c=new Date;return"YEAR"==d?c.getFullYear():"MONTH"==d?c.getMonth()+1:"DAY"==d?c.getDate():"HOUR"==d?c.getHours():"MINUTE"==d?c.getMinutes():c.getSeconds()},syntax:{js:[],py:["Entry.value_of_date_time(%2)"]}},get_sound_duration:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_sound_duration_1,color:"#3D3D3D"}, -{type:"DropdownDynamic",value:null,menuName:"sounds",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_get_sound_duration_2,color:"#3D3D3D"}],events:{},def:{params:[null,null,null],type:"get_sound_duration"},paramsKeyMap:{VALUE:1},"class":"calc_duration",isNotFor:[],func:function(b,a){for(var d=a.getField("VALUE",a),c=b.parent.sounds,e=0;ec||c>d.length-1)throw Error();return d[c]},syntax:{js:[],py:["Entry.string_index_of(%2, %4)"]}},length_of_string:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text", -text:Lang.Blocks.CALC_length_of_string_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_length_of_string_2,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:[Lang.Blocks.entry]},null],type:"length_of_string"},paramsKeyMap:{STRING:1},"class":"calc_string",isNotFor:[],func:function(b,a){return a.getStringValue("STRING",a).length},syntax:{js:[],py:["Entry.string_length(%2)"]}},substring:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text", -text:Lang.Blocks.CALC_substring_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_substring_2,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_substring_3,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_substring_4,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:[Lang.Blocks.hi_entry]},null,{type:"number",params:["2"]},null,{type:"number",params:["5"]},null],type:"substring"}, -paramsKeyMap:{STRING:1,START:3,END:5},"class":"calc_string",isNotFor:[],func:function(b,a){var d=a.getStringValue("STRING",a),c=a.getNumberValue("START",a)-1,e=a.getNumberValue("END",a)-1,f=d.length-1;if(0>c||0>e||c>f||e>f)throw Error();return d.substring(Math.min(c,e),Math.max(c,e)+1)},syntax:{js:[],py:["Entry.string_substring(%2, %4, %6)"]}},replace_string:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_replace_string_1,color:"#3D3D3D"},{type:"Block", -accept:"string"},{type:"Text",text:Lang.Blocks.CALC_replace_string_2,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_replace_string_3,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_replace_string_4,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:[Lang.Blocks.hi_entry]},null,{type:"text",params:[Lang.Blocks.hello]},null,{type:"text",params:[Lang.Blocks.nice]},null],type:"replace_string"},paramsKeyMap:{STRING:1, -OLD_WORD:3,NEW_WORD:5},"class":"calc_string",isNotFor:[],func:function(b,a){return a.getStringValue("STRING",a).replace(new RegExp(a.getStringValue("OLD_WORD",a),"gm"),a.getStringValue("NEW_WORD",a))},syntax:{js:[],py:["Entry.string_replace(%2, %4, %6)"]}},change_string_case:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_change_string_case_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_change_string_case_2, -color:"#3D3D3D"},{type:"Dropdown",options:[[Lang.Blocks.CALC_change_string_case_sub_1,"toUpperCase"],[Lang.Blocks.CALC_change_string_case_sub_2,"toLowerCase"]],value:"toUpperCase",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_change_string_case_3,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:["Hello Entry!"]},null,null,null],type:"change_string_case"},paramsKeyMap:{STRING:1,CASE:3},"class":"calc_string",isNotFor:[],func:function(b,a){return a.getStringValue("STRING", -a)[a.getField("CASE",a)]()},syntax:{js:[],py:["Entry.string_case(%2, %4)"]}},index_of_string:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_index_of_string_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_index_of_string_2,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_index_of_string_3,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:[Lang.Blocks.hi_entry]}, -null,{type:"text",params:[Lang.Blocks.entry]},null],type:"index_of_string"},paramsKeyMap:{LEFTHAND:1,RIGHTHAND:3},"class":"calc_string",isNotFor:[],func:function(b,a){var d=a.getStringValue("LEFTHAND",a),c=a.getStringValue("RIGHTHAND",a),d=d.indexOf(c);return-1d)throw Error(Lang.Blocks.FLOW_repeat_basic_errorMsg);a.iterCount=Math.floor(d)}if(0==a.iterCount||0>a.iterCount)return delete a.isLooped,delete a.iterCount,a.callReturn();a.iterCount--;return a.getStatement("DO", -a)},syntax:{js:[],py:["for i in range(%1):\n$1"]}},repeat_inf:{color:"#498deb",skeleton:"basic_loop",statements:[{accept:"basic"}],params:[{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null],type:"repeat_inf"},statementsKeyMap:{DO:0},"class":"repeat",isNotFor:[],func:function(b,a){a.isLooped=!0;return a.getStatement("DO")},syntax:{js:[],py:["while True:\n$1"]}},stop_repeat:{color:"#498deb",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/flow_03.png", -size:12}],events:{},def:{params:[null],type:"stop_repeat"},"class":"repeat",isNotFor:[],func:function(b,a){return this.executor.breakLoop()},syntax:{js:[],py:["break"]}},wait_until_true:{color:"#498deb",skeleton:"basic",statements:[],params:[{type:"Block",accept:"boolean"},{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[{type:"True"},null],type:"wait_until_true"},paramsKeyMap:{BOOL:0},"class":"wait",isNotFor:[],func:function(b,a){return a.getBooleanValue("BOOL",a)? -a.callReturn():a},syntax:{js:[],py:["Entry.wait_until(%1)"]}},_if:{color:"#498deb",skeleton:"basic_loop",statements:[{accept:"basic"}],params:[{type:"Block",accept:"boolean"},{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[{type:"True"},null],type:"_if"},paramsKeyMap:{BOOL:0},statementsKeyMap:{STACK:0},"class":"condition",isNotFor:[],func:function(b,a){return a.isCondition?(delete a.isCondition,a.callReturn()):a.getBooleanValue("BOOL",a)?(a.isCondition=!0,a.getStatement("STACK", -a)):a.callReturn()},syntax:{js:[],py:["if %1:\n$1"]}},if_else:{color:"#498deb",skeleton:"basic_double_loop",statements:[{accept:"basic"},{accept:"basic"}],params:[{type:"Block",accept:"boolean"},{type:"Indicator",img:"block_icon/flow_03.png",size:12},{type:"LineBreak"}],events:{},def:{params:[{type:"True"},null],type:"if_else"},paramsKeyMap:{BOOL:0},statementsKeyMap:{STACK_IF:0,STACK_ELSE:1},"class":"condition",isNotFor:[],func:function(b,a){if(a.isCondition)return delete a.isCondition,a.callReturn(); -var d=a.getBooleanValue("BOOL",a);a.isCondition=!0;return d?a.getStatement("STACK_IF",a):a.getStatement("STACK_ELSE",a)},syntax:{js:[],py:["if %1:\n$1\nelse:\n$2"]}},create_clone:{color:"#498deb",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"clone",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_FLOW},{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null,null],type:"create_clone"},paramsKeyMap:{VALUE:0},"class":"clone",isNotFor:[], -func:function(b,a){var d=a.getField("VALUE",a),c=a.callReturn();"self"==d?b.parent.addCloneEntity(b.parent,b,null):Entry.container.getObject(d).addCloneEntity(b.parent,null,null);return c},syntax:{js:[],py:["Entry.create_clone(%1)"]}},delete_clone:{color:"#498deb",skeleton:"basic_without_next",statements:[],params:[{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null],type:"delete_clone"},"class":"clone",isNotFor:[],func:function(b,a){if(!b.isClone)return a.callReturn(); -b.removeClone();return this.die()},syntax:{js:[],py:["Entry.remove_clone()"]}},when_clone_start:{color:"#498deb",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_clone.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null],type:"when_clone_start"},"class":"clone",isNotFor:[],func:function(b,a){return a.callReturn()},event:"when_clone_start",syntax:{js:[],py:["def entry_event_clone_create():"]}},stop_run:{color:"#498deb",skeleton:"basic",statements:[], -params:[{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null]},func:function(b,a){return Entry.engine.toggleStop()},syntax:{js:[],py:[""]}},repeat_while_true:{color:"#498deb",skeleton:"basic_loop",statements:[{accept:"basic"}],params:[{type:"Block",accept:"boolean"},{type:"Dropdown",options:[[Lang.Blocks.FLOW_repeat_while_true_until,"until"],[Lang.Blocks.FLOW_repeat_while_true_while,"while"]],value:"until",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_FLOW},{type:"Indicator", -img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[{type:"True"},null,null],type:"repeat_while_true"},paramsKeyMap:{BOOL:0,OPTION:1},statementsKeyMap:{DO:0},"class":"repeat",isNotFor:[],func:function(b,a){var d=a.getBooleanValue("BOOL",a);"until"==a.getField("OPTION",a)&&(d=!d);return(a.isLooped=d)?a.getStatement("DO",a):a.callReturn()},syntax:{js:[],py:["not yet supported in textcoding"]}},stop_object:{color:"#498deb",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.FLOW_stop_object_all, -"all"],[Lang.Blocks.FLOW_stop_object_this_object,"thisOnly"],[Lang.Blocks.FLOW_stop_object_this_thread,"thisThread"],[Lang.Blocks.FLOW_stop_object_other_thread,"otherThread"]],value:"all",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_FLOW},{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null,null],type:"stop_object"},paramsKeyMap:{TARGET:0},"class":"terminate",isNotFor:[],func:function(b,a){var d=a.getField("TARGET",a),c=Entry.container;switch(d){case "all":return c.mapObject(function(a){a.script.clearExecutors()}, -null),this.die();case "thisOnly":return b.parent.script.clearExecutorsByEntity(b),this.die();case "thisObject":return b.parent.script.clearExecutors(),this.die();case "thisThread":return this.die();case "otherThread":for(var d=this.executor,c=b.parent.script,e=c.executors,f=0;fa.count?(50>c.leftFloor&&50>c.rightFloor?a.count++:a.count=0,c=c.leftFloor-c.rightFloor,d.leftWheel=45+.25*c,d.rightWheel=45-.25*c):(a.count=0,a.boardState=2);break;case 2:c=c.leftFloor-c.rightFloor;d.leftWheel=45+.25*c;d.rightWheel=45-.25*c;a.boardState=3;var e= -setTimeout(function(){a.boardState=4;Entry.Hamster.removeTimeout(e)},250);Entry.Hamster.timeouts.push(e);break;case 3:c=c.leftFloor-c.rightFloor;d.leftWheel=45+.25*c;d.rightWheel=45-.25*c;break;case 4:d.leftWheel=0,d.rightWheel=0,a.boardState=0,a.isMoving=!1}return a}delete a.isStart;delete a.isMoving;delete a.count;delete a.boardState;Entry.engine.isContinue=!1;d.leftWheel=0;d.rightWheel=0;return a.callReturn()}a.isStart=!0;a.isMoving=!0;a.count=0;a.boardState=1;d.leftWheel=45;d.rightWheel=45;Entry.Hamster.setLineTracerMode(d, -0);return a},syntax:{js:[],py:["Hamster.move_forward()"]}},hamster_turn_once:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_turn_once_left,"LEFT"],[Lang.Blocks.HAMSTER_turn_right,"RIGHT"]],value:"LEFT",fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null],type:"hamster_turn_once"},paramsKeyMap:{DIRECTION:0},"class":"hamster_board",isNotFor:["hamster"],func:function(b,a){var d=Entry.hw.sendQueue, -c=Entry.hw.portData;if(a.isStart){if(a.isMoving){if(a.isLeft)switch(a.boardState){case 1:2>a.count?50c.leftFloor&&(a.boardState=3);break;case 3:2>a.count?20>c.leftFloor&&a.count++:(a.count=0,a.boardState=4);break;case 4:50a.count? -50c.rightFloor&&(a.boardState=3);break;case 3:2>a.count?20>c.rightFloor&&a.count++:(a.count=0,a.boardState=4);break;case 4:50Entry.Hamster.tempo&&(Entry.Hamster.tempo=1);return a.callReturn()},syntax:{js:[],py:["Hamster.add_tempo(%1)"]}},hamster_set_tempo_to:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}], -events:{},def:{params:[{type:"text",params:["60"]},null],type:"hamster_set_tempo_to"},paramsKeyMap:{VALUE:0},"class":"hamster_buzzer",isNotFor:["hamster"],func:function(b,a){Entry.Hamster.tempo=a.getNumberValue("VALUE");1>Entry.Hamster.tempo&&(Entry.Hamster.tempo=1);return a.callReturn()},syntax:{js:[],py:["Hamster.set_tempo(%1)"]}},hamster_set_port_to:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_port_a,"A"],[Lang.Blocks.HAMSTER_port_b,"B"], -[Lang.Blocks.HAMSTER_port_ab,"AB"]],value:"A",fontSize:11},{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_analog_input,"0"],[Lang.Blocks.HAMSTER_digital_input,"1"],[Lang.Blocks.HAMSTER_servo_output,"8"],[Lang.Blocks.HAMSTER_pwm_output,"9"],[Lang.Blocks.HAMSTER_digital_output,"10"]],value:"0",fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,null],type:"hamster_set_port_to"},paramsKeyMap:{PORT:0,MODE:1},"class":"hamster_port",isNotFor:["hamster"], -func:function(b,a){var d=Entry.hw.sendQueue,c=a.getField("PORT",a),e=Number(a.getField("MODE",a));"A"==c?d.ioModeA=e:("B"!=c&&(d.ioModeA=e),d.ioModeB=e);return a.callReturn()},syntax:{js:[],py:["Hamster.set_port(%1, %2)"]}},hamster_change_output_by:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_port_a,"A"],[Lang.Blocks.HAMSTER_port_b,"B"],[Lang.Blocks.HAMSTER_port_ab,"AB"]],value:"A",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator", -img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"text",params:["10"]},null],type:"hamster_change_output_by"},paramsKeyMap:{PORT:0,VALUE:1},"class":"hamster_port",isNotFor:["hamster"],func:function(b,a){var d=Entry.hw.sendQueue,c=a.getField("PORT"),e=a.getNumberValue("VALUE");"A"==c?d.outputA=void 0!=d.outputA?d.outputA+e:e:("B"!=c&&(d.outputA=void 0!=d.outputA?d.outputA+e:e),d.outputB=void 0!=d.outputB?d.outputB+e:e);return a.callReturn()},syntax:{js:[],py:["Hamster.add_output(%1, %2)"]}}, -hamster_set_output_to:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_port_a,"A"],[Lang.Blocks.HAMSTER_port_b,"B"],[Lang.Blocks.HAMSTER_port_ab,"AB"]],value:"A",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"text",params:["100"]},null],type:"hamster_set_output_to"},paramsKeyMap:{PORT:0,VALUE:1},"class":"hamster_port",isNotFor:["hamster"],func:function(b, -a){var d=Entry.hw.sendQueue,c=a.getField("PORT"),e=a.getNumberValue("VALUE");"A"==c?d.outputA=e:("B"!=c&&(d.outputA=e),d.outputB=e);return a.callReturn()},syntax:{js:[],py:["Hamster.set_output(%1, %2)"]}},is_clicked:{color:"#AEB8FF",skeleton:"basic_boolean_field",statements:[],params:[{type:"Text",text:Lang.Blocks.JUDGEMENT_is_clicked,color:"#3D3D3D"}],events:{},def:{params:[null],type:"is_clicked"},"class":"boolean_input",isNotFor:[],func:function(b,a){return Entry.stage.isClick},syntax:{js:[],py:["Entry.is_mouse_clicked()"]}}, -is_press_some_key:{color:"#AEB8FF",skeleton:"basic_boolean_field",statements:[],params:[{type:"Keyboard",value:81},{type:"Text",text:Lang.Blocks.JUDGEMENT_is_press_some_key_2,color:"#3D3D3D"}],events:{},def:{params:[null,null],type:"is_press_some_key"},paramsKeyMap:{VALUE:0},"class":"boolean_input",isNotFor:[],func:function(b,a){var d=Number(a.getField("VALUE",a));return 0<=Entry.pressedKeys.indexOf(d)},syntax:{js:[],py:["Entry.is_pressed(%1)"]}},reach_something:{color:"#AEB8FF",skeleton:"basic_boolean_field", -statements:[],params:[{type:"Text",text:Lang.Blocks.JUDGEMENT_reach_something_1,color:"#3D3D3D"},{type:"DropdownDynamic",value:null,menuName:"collision",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_JUDGE},{type:"Text",text:Lang.Blocks.JUDGEMENT_reach_something_2,color:"#3D3D3D"}],events:{},def:{params:[null,null,null],type:"reach_something"},paramsKeyMap:{VALUE:1},"class":"boolean_collision",isNotFor:[],func:function(b,a){if(!b.getVisible())return!1;var d=a.getField("VALUE",a),c=b.object,e=/wall/.test(d), -f=ndgmr.checkPixelCollision;if(e)switch(e=Entry.stage.wall,d){case "wall":return!!(f(c,e.up,.2,!0)||f(c,e.down,.2,!0)||f(c,e.left,.2,!0)||f(c,e.right,.2,!0));case "wall_up":return!!f(c,e.up,.2,!0);case "wall_down":return!!f(c,e.down,.2,!0);case "wall_right":return!!f(c,e.right,.2,!0);case "wall_left":return!!f(c,e.left,.2,!0)}else{if("mouse"==d)return f=Entry.stage.canvas,f=c.globalToLocal(f.mouseX,f.mouseY),c.hitTest(f.x,f.y);d=Entry.container.getEntity(d);if("textBox"==d.type||"textBox"==b.type){f= -d.object.getTransformedBounds();c=c.getTransformedBounds();if(Entry.checkCollisionRect(c,f))return!0;for(var d=d.parent.clonedEntities,e=0,g=d.length;e","BIGGER"]],value:"EQUAL",fontSize:11},{type:"Block",accept:"string"}],events:{},def:{params:[null],type:"boolean_comparison"},paramsKeyMap:{LEFTHAND:0,OPERATOR:1,RIGHTHAND:2},func:function(b,a){var d=a.getField("OPERATOR",a),c=a.getNumberValue("LEFTHAND",a),e=a.getNumberValue("RIGHTHAND",a);return"EQUAL"==d?c==e:"BIGGER"==d?c>e:c",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[{type:"number",params:["10"]},null,{type:"number",params:["10"]}],type:"boolean_bigger"},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},"class":"boolean_compare",isNotFor:[],func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d>c},syntax:{js:[],py:[""]}},boolean_smaller:{color:"#AEB8FF", -skeleton:"basic_boolean_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"<",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[{type:"number",params:["10"]},null,{type:"number",params:["10"]}],type:"boolean_smaller"},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},"class":"boolean_compare",isNotFor:[],func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d","GREATER"],["<","LESS"],["\u2265","GREATER_OR_EQUAL"],["\u2264","LESS_OR_EQUAL"]],value:"EQUAL",fontSize:11,noArrow:!0},{type:"Block", -accept:"string"}],events:{},def:{params:[{type:"text",params:["10"]},"EQUAL",{type:"text",params:["10"]}],type:"boolean_basic_operator"},defs:[{params:[{type:"text",params:["10"]},"EQUAL",{type:"text",params:["10"]}],type:"boolean_basic_operator"},{params:[{type:"text",params:["10"]},"GREATER",{type:"text",params:["10"]}],type:"boolean_basic_operator"},{params:[{type:"text",params:["10"]},"LESS",{type:"text",params:["10"]}],type:"boolean_basic_operator"},{params:[{type:"text",params:["10"]},"GREATER_OR_EQUAL", -{type:"text",params:["10"]}],type:"boolean_basic_operator"},{params:[{type:"text",params:["10"]},"LESS_OR_EQUAL",{type:"text",params:["10"]}],type:"boolean_basic_operator"}],paramsKeyMap:{LEFTHAND:0,OPERATOR:1,RIGHTHAND:2},"class":"boolean_compare",isNotFor:[],func:function(b,a){var d=a.getField("OPERATOR",a),c=a.getStringValue("LEFTHAND",a),e=a.getStringValue("RIGHTHAND",a);switch(d){case "EQUAL":return c==e;case "GREATER":return Number(c)>Number(e);case "LESS":return Number(c)= -Number(e);case "LESS_OR_EQUAL":return Number(c)<=Number(e)}},syntax:{js:[],py:["(%1 %2boolean_compare# %3)"]}},show:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"show"},"class":"visibility",isNotFor:[],func:function(b,a){b.setVisible(!0);return a.callReturn()},syntax:{js:[],py:["Entry.show()"]}},hide:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png", -size:12}],events:{},def:{params:[null],type:"hide"},"class":"visibility",isNotFor:[],func:function(b,a){b.setVisible(!1);return a.callReturn()},syntax:{js:[],py:["Entry.hide()"]}},dialog_time:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Dropdown",options:[[Lang.Blocks.speak,"speak"]],value:"speak",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_LOOKS},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{}, -def:{params:[{type:"text",params:[Lang.Blocks.block_hi]},{type:"number",params:["4"]},null,null],type:"dialog_time"},paramsKeyMap:{VALUE:0,SECOND:1,OPTION:2},"class":"say",isNotFor:["textBox"],func:function(b,a){if(!a.isStart){var d=a.getNumberValue("SECOND",a),c=a.getStringValue("VALUE",a),e=a.getField("OPTION",a);a.isStart=!0;a.timeFlag=1;c||"number"==typeof c||(c=" ");c=Entry.convertToRoundedDecimals(c,3);new Entry.Dialog(b,c,e);b.syncDialogVisible(b.getVisible());setTimeout(function(){a.timeFlag= -0},1E3*d)}if(0==a.timeFlag)return delete a.timeFlag,delete a.isStart,b.dialog&&b.dialog.remove(),a.callReturn();b.dialog||(c=a.getStringValue("VALUE",a),e=a.getField("OPTION",a),c||"number"==typeof c||(c=" "),c=Entry.convertToRoundedDecimals(c,3),new Entry.Dialog(b,c,e),b.syncDialogVisible(b.getVisible()));return a},syntax:{js:[],py:["Entry.print_for_seconds(%1, %2, %3)"]}},dialog:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Dropdown",options:[[Lang.Blocks.speak, -"speak"]],value:"speak",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_LOOKS},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"text",params:[Lang.Blocks.block_hi]},null,null],type:"dialog"},paramsKeyMap:{VALUE:0,OPTION:1},"class":"say",isNotFor:["textBox"],func:function(b,a){var d=a.getStringValue("VALUE",a);d||"number"==typeof d||(d=" ");var c=a.getField("OPTION",a),d=Entry.convertToRoundedDecimals(d,3);new Entry.Dialog(b,d,c);b.syncDialogVisible(b.getVisible()); -return a.callReturn()},syntax:{js:[],py:["Entry.print(%1)"]}},remove_dialog:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"remove_dialog"},"class":"say",isNotFor:["textBox"],func:function(b,a){b.dialog&&b.dialog.remove();return a.callReturn()},syntax:{js:[],py:["Entry.print_remove()"]}},change_to_nth_shape:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null, -menuName:"pictures",fontSize:11},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,null],type:"change_to_nth_shape"},paramsKeyMap:{VALUE:0},"class":"shape",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),d=b.parent.getPicture(d);b.setImage(d);return a.callReturn()},syntax:{js:[],py:[""]}},change_to_next_shape:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.LOOKS_change_shape_next,"next"],[Lang.Blocks.LOOKS_change_shape_prev, -"prev"]],value:"next",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_LOOKS},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,null],type:"change_to_next_shape"},paramsKeyMap:{DRIECTION:0},"class":"shape",isNotFor:["textBox"],func:function(b,a){var d;d="prev"!==a.getStringField("DRIECTION")?b.parent.getNextPicture(b.picture.id):b.parent.getPrevPicture(b.picture.id);b.setImage(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_shape_of(%1)"]}},set_effect_volume:{color:"#EC4466", -skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.color,"color"],[Lang.Blocks.brightness,"brightness"],[Lang.Blocks.opacity,"opacity"]],value:"color",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,{type:"number",params:["10"]},null],type:"set_effect_volume"},paramsKeyMap:{EFFECT:0,VALUE:1},"class":"effect",isNotFor:["textBox"],func:function(b,a){var d=a.getField("EFFECT",a),c=a.getNumberValue("VALUE", -a);"color"==d?b.effect.hue=c+b.effect.hue:"lens"!=d&&"swriling"!=d&&"pixel"!=d&&"mosaic"!=d&&("brightness"==d?b.effect.brightness=c+b.effect.brightness:"blur"!=d&&"opacity"==d&&(b.effect.alpha+=c/100));b.applyFilter(!0);return a.callReturn()},syntax:{js:[],py:["Entry.add_effect(%1, %2)"]}},set_effect:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.color,"color"],[Lang.Blocks.brightness,"brightness"],[Lang.Blocks.opacity,"opacity"]],value:"color",fontSize:11}, -{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,{type:"number",params:["100"]},null],type:"set_effect"},paramsKeyMap:{EFFECT:0,VALUE:1},"class":"effect",isNotFor:["textBox"],func:function(b,a){var d=a.getField("EFFECT",a),c=a.getNumberValue("VALUE",a);"color"==d?b.effect.hue=c:"lens"!=d&&"swriling"!=d&&"pixel"!=d&&"mosaic"!=d&&("brightness"==d?b.effect.brightness=c:"blur"!=d&&"opacity"==d&&(b.effect.alpha=c/100));b.applyFilter(!0); -return a.callReturn()},syntax:{js:[],py:["Entry.set_effect(%1, %2)"]}},erase_all_effects:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"erase_all_effects"},"class":"effect",isNotFor:["textBox"],func:function(b,a){b.resetFilter();return a.callReturn()},syntax:{js:[],py:["Entry.clear_effect()"]}},change_scale_percent:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"}, -{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"change_scale_percent"},paramsKeyMap:{VALUE:0},"class":"scale",isNotFor:[],func:function(b,a){var d=(a.getNumberValue("VALUE",a)+100)/100;b.setScaleX(b.getScaleX()*d);b.setScaleY(b.getScaleY()*d);return a.callReturn()},syntax:{js:[],py:[""]}},set_scale_percent:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png", -size:12}],events:{},def:{params:[{type:"number",params:["100"]},null],type:"set_scale_percent"},paramsKeyMap:{VALUE:0},"class":"scale",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a)/100,c=b.snapshot_;b.setScaleX(d*c.scaleX);b.setScaleY(d*c.scaleY);return a.callReturn()},syntax:{js:[],py:[""]}},change_scale_size:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"number", -params:["10"]},null],type:"change_scale_size"},paramsKeyMap:{VALUE:0},"class":"scale",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setSize(b.getSize()+d);return a.callReturn()},syntax:{js:[],py:["Entry.add_size(%1)"]}},set_scale_size:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"number",params:["100"]},null],type:"set_scale_size"},paramsKeyMap:{VALUE:0}, -"class":"scale",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setSize(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_size(%1)"]}},flip_y:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"flip_y"},"class":"flip",isNotFor:[],func:function(b,a){b.setScaleX(-1*b.getScaleX());return a.callReturn()},syntax:{js:[],py:["Entry.flip_vertical()"]}},flip_x:{color:"#EC4466",skeleton:"basic", -statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"flip_x"},"class":"flip",isNotFor:[],func:function(b,a){b.setScaleY(-1*b.getScaleY());return a.callReturn()},syntax:{js:[],py:["Entry.flip_horizontal()"]}},set_object_order:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"objectSequence",fontSize:11},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null, -null],type:"set_object_order"},paramsKeyMap:{VALUE:0},"class":"z-index",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c=Entry.container.getCurrentObjects().indexOf(b.parent);if(-1f)throw Error("object is not available for current scene");switch(c){case "FRONT":d= -0;break;case "FORWARD":d=Math.max(0,f-1);break;case "BACKWARD":d=Math.min(e,f+1);break;case "BACK":d=e}Entry.container.moveElementByBlock(f,d);return a.callReturn()},syntax:{js:[],py:["Entry.set_layer(%1)"]}},move_direction:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"move_direction"},paramsKeyMap:{VALUE:0},"class":"walk",isNotFor:[], -func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setX(b.getX()+d*Math.cos((b.getRotation()+b.getDirection()-90)/180*Math.PI));b.setY(b.getY()-d*Math.sin((b.getRotation()+b.getDirection()-90)/180*Math.PI));b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.move(%1)"]}},move_x:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number", -params:["10"]},null],type:"move_x"},paramsKeyMap:{VALUE:0},"class":"move_relative",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setX(b.getX()+d);b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.set_x(%1)"]}},move_y:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null], -type:"move_y"},paramsKeyMap:{VALUE:0},"class":"move_relative",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setY(b.getY()+d);b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.set_y(%1)"]}},locate_xy_time:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{}, -def:{params:[{type:"number",params:["2"]},{type:"number",params:["10"]},{type:"number",params:["10"]},null],type:"locate_xy_time"},paramsKeyMap:{VALUE1:0,VALUE2:1,VALUE3:2},"class":"move_absolute",isNotFor:[],func:function(b,a){function d(){var d=a.x-b.getX(),c=a.y-b.getY(),d=d/a.frameCount,c=c/a.frameCount;b.setX(b.getX()+d);b.setY(b.getY()+c);a.frameCount--;b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY())}if(!a.isStart){var c;c=a.getNumberValue("VALUE1",a);a.isStart=!0;a.frameCount= -Math.max(Math.floor(c*Entry.FPS),1);a.x=a.getNumberValue("VALUE2",a);a.y=a.getNumberValue("VALUE3",a);1==a.frameCount&&d()}if(0!=a.frameCount)return d(),a;delete a.isStart;delete a.frameCount;return a.callReturn()},syntax:{js:[],py:["Entry.set_xy_for_seconds(%1, %2, %3)"]}},rotate_by_angle:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["90"]},null],type:"rotate_by_angle"}, -paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setRotation(b.getRotation()+d);return a.callReturn()},syntax:{js:[],py:[""]}},rotate_by_angle_dropdown:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[["45","45"],["90","90"],["135","135"],["180","180"]],value:"45",fontSize:11},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:["45",null],type:"rotate_by_angle_dropdown"},paramsKeyMap:{VALUE:0}, -"class":"ebs",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a);b.setRotation(b.getRotation()+Number(d));return a.callReturn()},syntax:{js:[],py:[""]}},see_angle:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["90"]},null],type:"see_angle"},paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setDirection(d); -return a.callReturn()},syntax:{js:[],py:[""]}},see_direction:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"sprites",fontSize:11},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null,null]},paramsKeyMap:{VALUE:0},func:function(b,a){var d=a.getField("VALUE",a),c=Entry.container.getEntity(d),d=c.getX()-b.getX(),c=c.getY()-b.getY();0<=d?b.setRotation(Math.atan(c/d)/Math.PI*180+90):b.setRotation(Math.atan(c/d)/Math.PI* -180+270);return a.callReturn()},syntax:{js:[],py:[""]}},locate_xy:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["0"]},{type:"number",params:["0"]},null],type:"locate_xy"},paramsKeyMap:{VALUE1:0,VALUE2:1},"class":"move_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE1",a),c=a.getNumberValue("VALUE2",a); -b.setX(d);b.setY(c);b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.set_xy(%1, %2)"]}},locate_x:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"locate_x"},paramsKeyMap:{VALUE:0},"class":"move_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setX(d); -b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.move_x(%1)"]}},locate_y:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"locate_y"},paramsKeyMap:{VALUE:0},"class":"move_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setY(d);b.brush&&!b.brush.stop&& -b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.move_y(%1)"]}},locate:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"spritesWithMouse",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_MOVING},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null,null],type:"locate"},paramsKeyMap:{VALUE:0},"class":"move_absolute",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c;"mouse"== -d?(d=Entry.stage.mouseCoordinate.x,c=Entry.stage.mouseCoordinate.y):(c=Entry.container.getEntity(d),d=c.getX(),c=c.getY());b.setX(Number(d));b.setY(Number(c));b.brush&&!b.brush.stop&&b.brush.lineTo(d,-1*c);return a.callReturn()},syntax:{js:[],py:["Entry.set_location(%1)"]}},move_xy_time:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{}, -def:{params:[{type:"number",params:["2"]},{type:"number",params:["10"]},{type:"number",params:["10"]},null],type:"move_xy_time"},paramsKeyMap:{VALUE1:0,VALUE2:1,VALUE3:2},"class":"move_relative",isNotFor:[],func:function(b,a){function d(){b.setX(b.getX()+a.dX);b.setY(b.getY()+a.dY);a.frameCount--;b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY())}if(!a.isStart){var c;c=a.getNumberValue("VALUE1",a);var e=a.getNumberValue("VALUE2",a),f=a.getNumberValue("VALUE3",a);a.isStart=!0;a.frameCount= -Math.max(Math.floor(c*Entry.FPS),1);a.dX=e/a.frameCount;a.dY=f/a.frameCount;1==a.frameCount&&d()}if(0!=a.frameCount)return d(),a;delete a.isStart;delete a.frameCount;return a.callReturn()},syntax:{js:[],py:["Entry.add_xy_for_seconds(%1, %2, %3)"]}},rotate_by_angle_time:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Angle"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["2"]},null,null],type:"rotate_by_angle_time"}, -paramsKeyMap:{VALUE:1},"class":"rotate",isNotFor:[],func:function(b,a){if(!a.isStart){var d;d=a.getNumberValue("VALUE",a);var c=a.getNumberField("VALUE",a);a.isStart=!0;a.frameCount=Math.floor(d*Entry.FPS);a.dAngle=c/a.frameCount}if(0!=a.frameCount)return b.setRotation(b.getRotation()+a.dAngle),a.frameCount--,a;delete a.isStart;delete a.frameCount;return a.callReturn()},syntax:{js:[],py:[""]}},bounce_wall:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/moving_03.png", -size:12}],events:{},def:{params:[null],type:"bounce_wall"},"class":"walk",isNotFor:[],func:function(b,a){var d=b.parent.getRotateMethod(),c="free"==d?(b.getRotation()+b.getDirection()).mod(360):b.getDirection(),e=Entry.Utils.COLLISION.NONE;if(90>c&&0<=c||360>c&&270<=c){var e=b.collision==Entry.Utils.COLLISION.UP,f=ndgmr.checkPixelCollision(Entry.stage.wall.up,b.object,0,!1);!f&&e&&(b.collision=Entry.Utils.COLLISION.NONE);f&&e&&(f=!1);f?("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()+ -180):b.setDirection(-b.getDirection()+180),b.collision=Entry.Utils.COLLISION.UP):(e=b.collision==Entry.Utils.COLLISION.DOWN,f=ndgmr.checkPixelCollision(Entry.stage.wall.down,b.object,0,!1),!f&&e&&(b.collision=Entry.Utils.COLLISION.NONE),f&&e&&(f=!1),f&&("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()+180):b.setDirection(-b.getDirection()+180),b.collision=Entry.Utils.COLLISION.DOWN))}else 270>c&&90<=c&&(e=b.collision==Entry.Utils.COLLISION.DOWN,f=ndgmr.checkPixelCollision(Entry.stage.wall.down, -b.object,0,!1),!f&&e&&(b.collision=Entry.Utils.COLLISION.NONE),f&&e&&(f=!1),f?("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()+180):b.setDirection(-b.getDirection()+180),b.collision=Entry.Utils.COLLISION.DOWN):(e=b.collision==Entry.Utils.COLLISION.UP,f=ndgmr.checkPixelCollision(Entry.stage.wall.up,b.object,0,!1),!f&&e&&(b.collision=Entry.Utils.COLLISION.NONE),f&&e&&(f=!1),f&&("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()+180):b.setDirection(-b.getDirection()+180),b.collision= -Entry.Utils.COLLISION.UP)));360>c&&180<=c?(e=b.collision==Entry.Utils.COLLISION.LEFT,c=ndgmr.checkPixelCollision(Entry.stage.wall.left,b.object,0,!1),!c&&e&&(b.collision=Entry.Utils.COLLISION.NONE),c&&e&&(c=!1),c?("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()):b.setDirection(-b.getDirection()+360),b.collision=Entry.Utils.COLLISION.LEFT):(e=b.collision==Entry.Utils.COLLISION.RIGHT,c=ndgmr.checkPixelCollision(Entry.stage.wall.right,b.object,0,!1),!c&&e&&(b.collision=Entry.Utils.COLLISION.NONE), -c&&e&&(c=!1),c&&("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()):b.setDirection(-b.getDirection()+360),b.collision=Entry.Utils.COLLISION.RIGHT))):180>c&&0<=c&&(e=b.collision==Entry.Utils.COLLISION.RIGHT,c=ndgmr.checkPixelCollision(Entry.stage.wall.right,b.object,0,!1),!c&&e&&(b.collision=Entry.Utils.COLLISION.NONE),c&&e&&(c=!1),c?("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()):b.setDirection(-b.getDirection()+360),b.collision=Entry.Utils.COLLISION.RIGHT):(e=b.collision== -Entry.Utils.COLLISION.LEFT,c=ndgmr.checkPixelCollision(Entry.stage.wall.left,b.object,0,!1),!c&&e&&(b.collision=Entry.Utils.COLLISION.NONE),c&&e&&(c=!1),c&&("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()):b.setDirection(-b.getDirection()+360),b.collision=Entry.Utils.COLLISION.LEFT)));return a.callReturn()},syntax:{js:[],py:["Entry.bounce_wall()"]}},flip_arrow_horizontal:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/moving_03.png",size:12}], -events:{},def:{params:[null]},func:function(b,a){b.setDirection(b.getDirection()+180);return a.callReturn()},syntax:{js:[],py:[""]}},flip_arrow_vertical:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null]},func:function(b,a){b.setDirection(b.getDirection()+180);return a.callReturn()},syntax:{js:[],py:[""]}},see_angle_object:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null, -menuName:"spritesWithMouse",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_MOVING},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null,null],type:"see_angle_object"},paramsKeyMap:{VALUE:0},"class":"rotate_absolute",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c=b.getX(),e=b.getY();if(b.parent.id==d)return a.callReturn();"mouse"==d?(d=Entry.stage.mouseCoordinate.y,c=Entry.stage.mouseCoordinate.x-c,e=d-e):(d=Entry.container.getEntity(d),c=d.getX()-c, -e=d.getY()-e);e=0===c&&0===e?b.getDirection()+b.getRotation():0<=c?-Math.atan(e/c)/Math.PI*180+90:-Math.atan(e/c)/Math.PI*180+270;c=b.getDirection()+b.getRotation();b.setRotation(b.getRotation()+e-c);return a.callReturn()},syntax:{js:[],py:["Entry.look_at_object(%1)"]}},see_angle_direction:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["90"]},null],type:"see_angle_direction"}, -paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a),c=b.getDirection()+b.getRotation();b.setRotation(b.getRotation()+d-c);return a.callReturn()},syntax:{js:[],py:[""]}},rotate_direction:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["90"]},null],type:"rotate_direction"},paramsKeyMap:{VALUE:0},"class":"rotate", -isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setDirection(d+b.getDirection());return a.callReturn()},syntax:{js:[],py:[""]}},locate_object_time:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"DropdownDynamic",value:null,menuName:"spritesWithMouse",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_MOVING},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["2"]},null,null],type:"locate_object_time"}, -paramsKeyMap:{VALUE:0,TARGET:1},"class":"move_absolute",isNotFor:[],func:function(b,a){if(!a.isStart){var d,c,e;c=a.getField("TARGET",a);d=a.getNumberValue("VALUE",a);d=Math.floor(d*Entry.FPS);e=Entry.stage.mouseCoordinate;if(0!=d)"mouse"==c?(c=e.x-b.getX(),e=e.y-b.getY()):(e=Entry.container.getEntity(c),c=e.getX()-b.getX(),e=e.getY()-b.getY()),a.isStart=!0,a.frameCount=d,a.dX=c/a.frameCount,a.dY=e/a.frameCount;else return"mouse"==c?(c=Number(e.x),e=Number(e.y)):(e=Entry.container.getEntity(c),c= -e.getX(),e=e.getY()),b.setX(c),b.setY(e),b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY()),a.callReturn()}if(0!=a.frameCount)return b.setX(b.getX()+a.dX),b.setY(b.getY()+a.dY),a.frameCount--,b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY()),a;delete a.isStart;delete a.frameCount;return a.callReturn()},syntax:{js:[],py:["Entry.set_location_for_seconds(%1, %2)"]}},rotate_absolute:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator", -img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"},null],type:"rotate_absolute"},paramsKeyMap:{VALUE:0},"class":"rotate_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setRotation(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_rotation(%1)"]}},rotate_relative:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"}, -null],type:"rotate_relative"},paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setRotation(d+b.getRotation());return a.callReturn()},syntax:{js:[],py:["Entry.add_rotation(%1)"]}},direction_absolute:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"},null],type:"direction_absolute"},paramsKeyMap:{VALUE:0},"class":"rotate_absolute", -isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setDirection(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_direction(%1)"]}},direction_relative:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"},null],type:"direction_relative"},paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setDirection(d+ -b.getDirection());return a.callReturn()},syntax:{js:[],py:["Entry.add_direction(%1)"]}},move_to_angle:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"},{type:"number",params:["10"]},null],type:"move_to_angle"},paramsKeyMap:{ANGLE:0,VALUE:1},"class":"move_rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a),c=a.getNumberValue("ANGLE", -a);b.setX(b.getX()+d*Math.cos((c-90)/180*Math.PI));b.setY(b.getY()-d*Math.sin((c-90)/180*Math.PI));b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.move_degree(%1, %2)"]}},rotate_by_time:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["2"]},{type:"angle"},null],type:"rotate_by_time"}, -paramsKeyMap:{VALUE:0,ANGLE:1},"class":"rotate",isNotFor:[],func:function(b,a){function d(){b.setRotation(b.getRotation()+a.dAngle);a.frameCount--}if(!a.isStart){var c;c=a.getNumberValue("VALUE",a);var e=a.getNumberValue("ANGLE",a);a.isStart=!0;a.frameCount=Math.max(Math.floor(c*Entry.FPS),1);a.dAngle=e/a.frameCount;1==a.frameCount&&d()}if(0!=a.frameCount)return d(),a;delete a.isStart;delete a.frameCount;return a.callReturn()},syntax:{js:[],py:["Entry.add_rotation_for_seconds(%1, %2)"]}},direction_relative_duration:{color:"#A751E3", -skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"text",params:["2"]},{type:"angle"},null],type:"direction_relative_duration"},paramsKeyMap:{DURATION:0,AMOUNT:1},"class":"rotate",isNotFor:[],func:function(b,a){function d(){b.setDirection(b.getDirection()+a.dDirection);a.frameCount--}if(!a.isStart){var c;c=a.getNumberValue("DURATION",a);var e=a.getNumberValue("AMOUNT", -a);a.isStart=!0;a.frameCount=Math.max(Math.floor(c*Entry.FPS),1);a.dDirection=e/a.frameCount;1==a.frameCount&&d()}if(0!=a.frameCount)return d(),a;delete a.isStart;delete a.frameCount;delete a.dDirection;return a.callReturn()},syntax:{js:[],py:["Entry.add_direction_for_seconds(%1, %2)"]}},neobot_sensor_value:{color:"#00979D",skeleton:"basic_string_field",fontColor:"#fff",statements:[],template:"%1 \uac12",params:[{type:"Dropdown",options:[["1\ubc88 \ud3ec\ud2b8","IN1"],["2\ubc88 \ud3ec\ud2b8","IN2"], -["3\ubc88 \ud3ec\ud2b8","IN3"],["\ub9ac\ubaa8\ucee8","IR"],["\ubc30\ud130\ub9ac","BAT"]],value:"IN1",fontSize:11}],events:{},def:{params:[null],type:"neobot_sensor_value"},paramsKeyMap:{PORT:0},"class":"neobot_value",isNotFor:["neobot"],func:function(b,a){var d=a.getStringField("PORT");return Entry.hw.portData[d]},syntax:{js:[],py:["Neobot.sensor_value(%1)"]}},neobot_sensor_convert_scale:{color:"#00979D",skeleton:"basic_string_field",fontColor:"#fff",statements:[],template:"%1 \uac12\uc758 \ubc94\uc704\ub97c %2 ~ %3 \uc5d0\uc11c %4 ~ %5 (\uc73c)\ub85c \ubcc0\ud658", -params:[{type:"Dropdown",options:[["1\ubc88 \ud3ec\ud2b8","IN1"],["2\ubc88 \ud3ec\ud2b8","IN2"],["3\ubc88 \ud3ec\ud2b8","IN3"],["\ub9ac\ubaa8\ucee8","IR"],["\ubc30\ud130\ub9ac","BAT"]],value:"IN1",fontSize:11},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"}],events:{},def:{params:[null,{type:"number",params:["0"]},{type:"number",params:["255"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"neobot_sensor_convert_scale"}, -paramsKeyMap:{PORT:0,OMIN:1,OMAX:2,MIN:3,MAX:4},"class":"neobot_value",isNotFor:["neobot"],func:function(b,a){var d=a.getStringField("PORT"),d=Entry.hw.portData[d],c=a.getNumberValue("OMIN",a),e=a.getNumberValue("OMAX",a),f=a.getNumberValue("MIN",a),g=a.getNumberValue("MAX",a);if(c>e)var h=c,c=e,e=h;f>g&&(h=f,f=g,g=h);d=(g-f)/(e-c)*(d-c);d+=f;d=Math.min(g,d);d=Math.max(f,d);return Math.round(d)}},neobot_left_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc67c\ucabd \ubaa8\ud130\ub97c %1 %2 \uc758 \uc18d\ub3c4\ub85c \ud68c\uc804 %3", +"3"],["Y","4"],["Z","5"]],value:"3",fontSize:11}],events:{},def:{params:[null],type:"CODEino_get_accelerometer_value"},paramsKeyMap:{PORT:0},"class":"CODEino_sensor",isNotFor:["CODEino"],func:function(b,a){var d=a.getNumberField("PORT",a),c=Entry.ArduinoExt.getSensorTime(Entry.ArduinoExt.sensorTypes.ANALOG),e=Entry.hw.portData.TIME||0,f=a.executor.scope,g=Entry.hw.portData.ANALOG,h=0;if(f.isStart){if(e&&e===f.stamp||64e)var h=c,c=e,e=h;f>g&&(h=f,f=g,g=h);d-=c;d*=(g-f)/(e-c);d+=f;d=Math.min(g,d);d=Math.max(f,d);return Math.round(d)}},CODEino_set_rgb_value:{color:"#00979D", +skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[["\ube68\uac15","17"],["\ucd08\ub85d","18"],["\ud30c\ub791","19"]],value:"17",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{type:"CODEino_set_rgb_value"},paramsKeyMap:{PORT:0,VALUE:1},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){var d=Entry.hw.sendQueue,c=a.getNumberField("PORT",a),e=a.getNumberValue("VALUE",a),e=Math.min(255,e),e=Math.max(0, +e);17==c?CODEINO_RED=e:18==c?CODEINO_GREEN=e:CODEINO_BLUE=e;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:e};return a.callReturn()}},CODEino_set_rgb_add_value:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[["\ube68\uac15","17"],["\ucd08\ub85d","18"],["\ud30c\ub791","19"]],value:"17",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{}, +def:{type:"CODEino_set_rgb_add_value"},paramsKeyMap:{PORT:0,VALUE:1},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){var d=Entry.hw.sendQueue,c=a.getNumberField("PORT",a),e=a.getNumberValue("VALUE",a),e=Math.min(255,e),e=Math.max(0,e);17==c&&(CODEINO_RED+=e,CODEINO_RED=Math.min(255,CODEINO_RED),e=CODEINO_RED=Math.max(0,CODEINO_RED));18==c&&(CODEINO_GREEN+=e,CODEINO_GREEN=Math.min(255,CODEINO_GREEN),e=CODEINO_GREEN=Math.max(0,CODEINO_GREEN));19==c&&(CODEINO_BLUE+=e,CODEINO_BLUE= +Math.min(255,CODEINO_BLUE),e=CODEINO_BLUE=Math.max(0,CODEINO_BLUE));d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:e};return a.callReturn()}},CODEino_rgb_set_color:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Color"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"CODEino_rgb_set_color"},paramsKeyMap:{VALUE:0},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b, +a){var d=a.getStringField("VALUE");CODEINO_RED=parseInt(d.substr(1,2),16);CODEINO_GREEN=parseInt(d.substr(3,2),16);CODEINO_BLUE=parseInt(d.substr(5,2),16);var d=Entry.hw.sendQueue,c=17;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_RED};d=Entry.hw.sendQueue;c=18;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_GREEN};d=Entry.hw.sendQueue;c=19; +d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_BLUE};return a.callReturn()}},CODEino_set_rgb_off:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"CODEino_set_rgb_off"},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){var d=Entry.hw.sendQueue;CODEINO_GREEN=CODEINO_BLUE=CODEINO_RED=0;var c=17;d.TIME= +Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:0};d=Entry.hw.sendQueue;c=18;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:0};d=Entry.hw.sendQueue;c=19;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:0};return a.callReturn()}},CODEino_set__led_by_rgb:{color:"#00979D",skeleton:"basic",statements:[], +params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["255"]},{type:"text",params:["255"]},{type:"text",params:["255"]},null],type:"CODEino_set__led_by_rgb"},paramsKeyMap:{rValue:0,gValue:1,bValue:2},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){CODEINO_RED=a.getNumberValue("rValue");CODEINO_GREEN=a.getNumberValue("gValue"); +CODEINO_BLUE=a.getNumberValue("bValue");var d=Entry.hw.sendQueue,c=17;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_RED};d=Entry.hw.sendQueue;c=18;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:CODEINO_GREEN};d=Entry.hw.sendQueue;c=19;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4, +data:CODEINO_BLUE};return a.callReturn()}},CODEino_led_by_value:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"CODEino_led_by_value"},"class":"CODEino_RGBLED_mode",isNotFor:["CODEino"],func:function(b,a){var d=Entry.hw.sendQueue,c=17;CODEINO_BLUE=CODEINO_GREEN=CODEINO_RED=100;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:100}; +d=Entry.hw.sendQueue;c=18;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:100};d=Entry.hw.sendQueue;c=19;d.TIME=Entry.ArduinoExt.getSensorTime(4);d.KEY=Entry.ArduinoExt.getSensorKey();d.SET||(d.SET={});d.SET[c]={type:4,data:100};return a.callReturn()}},CODEino_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["CODEino"],def:{params:[{type:"arduino_get_sensor_number"}],type:"CODEino_get_number_sensor_value"}, +"class":"arduino_value",syntax:{js:[],py:["hw.CODEino_get_number_sensor_value(%1)"]}},CODEino_toggle_led:{parent:"arduino_toggle_led",isNotFor:["CODEino"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"CODEino_toggle_led"},"class":"arduino_set",syntax:{js:[],py:["hw.CODEino_toggle_led(%1)"]}},CODEino_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["CODEino"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]},null],type:"CODEino_toggle_pwm"},"class":"arduino_set", +syntax:{js:[],py:["hw.CODEino_toggle_pwm(%1, %2)"]}},nemoino_get_named_sensor_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],template:"%1 \uc13c\uc11c\uac12",params:[{type:"Dropdown",options:[["\uc18c\ub9ac","0"],["\ube5b","1"],["\uc2ac\ub77c\uc774\ub354","2"],["\uc800\ud56d-A","3"],["\uc800\ud56d-B","4"],["\uc800\ud56d-C","5"],["\uc800\ud56d-D","6"]],value:"0",fontSize:11}],events:{},def:{params:[null],type:"nemoino_get_named_sensor_value"},paramsKeyMap:{PORT:0}, +"class":"nemoino",isNotFor:["nemoino"],func:function(b,a){return Entry.hw.getAnalogPortValue(a.getField("PORT",a))}},nemoino_get_sound_status:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",statements:[],template:"\uc18c\ub9ac\uc13c\uc11c %1",params:[{type:"Dropdown",options:[["\uc18c\ub9ac\ud07c","GREAT"],["\uc18c\ub9ac\uc791\uc74c","SMALL"]],value:"GREAT",fontSize:11}],events:{},def:{params:[null],type:"nemoino_get_sound_status"},paramsKeyMap:{STATUS:0},"class":"nemoino",isNotFor:["nemoino"], +func:function(b,a){return"GREAT"==a.getField("STATUS",a)?600Entry.hw.getAnalogPortValue(0)?1:0}},nemoino_is_button_pressed:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",statements:[],template:"\ubcf4\ub4dc\uc758 %1",params:[{type:"Dropdown",options:[["\ubc84\ud2bc\ub204\ub984","4"],["A\uc5f0\uacb0\ub428","17"],["B\uc5f0\uacb0\ub428","18"],["C\uc5f0\uacb0\ub428","19"],["D\uc5f0\uacb0\ub428","20"]],value:"4",fontSize:11}],events:{},def:{params:[null], +type:"nemoino_is_button_pressed"},paramsKeyMap:{PORT:0},"class":"nemoino",isNotFor:["nemoino"],func:function(b,a){var d=a.getNumberField("PORT",a);return 14c?1:0;if("RIGHT"==d||"FRONT"==d)return 30c?1:0}},nemoino_get_accelerometer_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],template:"3\ucd95 \uac00\uc18d\ub3c4\uc13c\uc11c %1 \ucd95\uc758 \uc13c\uc11c\uac12",params:[{type:"Dropdown",options:[["X","3"],["Y","4"],["Z","5"]],value:"3",fontSize:11}],events:{},def:{params:[null],type:"nemoino_get_accelerometer_value"}, +paramsKeyMap:{PORT:0},"class":"nemoino",isNotFor:["nemoino"],func:function(b,a){var d=265,c=402,e=-90,f=90,g=Entry.hw.getAnalogPortValue(a.getField("PORT",a));if(d>c)var h=d,d=c,c=h;e>f&&(h=e,e=f,f=h);g=(f-e)/(c-d)*(g-d);g+=e;g=Math.min(f,g);g=Math.max(e,g);return Math.round(g)}},bitbrick_sensor_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW,menuName:Entry.Bitbrick.sensorList}], +events:{},def:{params:[null],type:"bitbrick_sensor_value"},paramsKeyMap:{PORT:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getStringField("PORT");return Entry.hw.portData[d].value},syntax:{js:[],py:["Bitbrick.sensor_value(%1)"]}},bitbrick_is_touch_pressed:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,menuName:Entry.Bitbrick.touchList}],events:{},def:{params:[null],type:"bitbrick_is_touch_pressed"}, +paramsKeyMap:{PORT:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){return 0===Entry.hw.portData[a.getStringField("PORT")].value},syntax:{js:[],py:["Bitbrick.is_touch_pressed(%1)"]}},bitbrick_turn_off_color_led:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"bitbrick_turn_off_color_led",id:"i3je"},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){Entry.hw.sendQueue.LEDR= +0;Entry.hw.sendQueue.LEDG=0;Entry.hw.sendQueue.LEDB=0;return a.callReturn()},syntax:{js:[],py:["Bitbrick.turn_off_color_led()"]}},bitbrick_turn_on_color_led_by_rgb:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["255"]},{type:"text",params:["255"]},{type:"text",params:["255"]},null],type:"bitbrick_turn_on_color_led_by_rgb"}, +paramsKeyMap:{rValue:0,gValue:1,bValue:2},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getNumberValue("rValue"),c=a.getNumberValue("gValue"),e=a.getNumberValue("bValue"),f=Entry.adjustValueWithMaxMin,g=Entry.hw.sendQueue;g.LEDR=f(d,0,255);g.LEDG=f(c,0,255);g.LEDB=f(e,0,255);return a.callReturn()},syntax:{js:[],py:["Bitbrick.color_led_by_rgb(%1, %2, %3)"]}},bitbrick_turn_on_color_led_by_picker:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Color"},{type:"Indicator", +img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"bitbrick_turn_on_color_led_by_picker"},paramsKeyMap:{VALUE:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getStringField("VALUE");Entry.hw.sendQueue.LEDR=parseInt(d.substr(1,2),16);Entry.hw.sendQueue.LEDG=parseInt(d.substr(3,2),16);Entry.hw.sendQueue.LEDB=parseInt(d.substr(5,2),16);return a.callReturn()},syntax:{js:[],py:["Bitbrick.color_led_by_picker(%1)"]}},bitbrick_turn_on_color_led_by_value:{color:"#00979D", +skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["0"]},null],type:"bitbrick_turn_on_color_led_by_value"},paramsKeyMap:{VALUE:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getNumberValue("VALUE"),c,e,f,d=d%200;67>d?(c=200-3*d,e=3*d,f=0):134>d?(d-=67,c=0,e=200-3*d,f=3*d):201>d&&(d-=134,c=3*d,e=0,f=200-3*d);Entry.hw.sendQueue.LEDR=c;Entry.hw.sendQueue.LEDG= +e;Entry.hw.sendQueue.LEDB=f;return a.callReturn()},syntax:{js:[],py:["Bitbrick.color_led_by_value(%1)"]}},bitbrick_buzzer:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["60"]},null],type:"bitbrick_buzzer"},paramsKeyMap:{VALUE:0},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){if(a.isStart)return Entry.hw.sendQueue.buzzer=0,delete a.isStart,a.callReturn(); +var d=a.getNumberValue("VALUE");Entry.hw.sendQueue.buzzer=d;a.isStart=!0;return a},syntax:{js:[],py:["Bitbrick.buzzer(%1)"]}},bitbrick_turn_off_all_motors:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"bitbrick_turn_off_all_motors"},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=Entry.hw.sendQueue,c=Entry.Bitbrick;c.servoList().map(function(a){d[a[1]]=0});c.dcList().map(function(a){d[a[1]]= +128});return a.callReturn()},syntax:{js:[],py:["Bitbrick.turn_off_all_motors()"]}},bitbrick_dc_speed:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,menuName:Entry.Bitbrick.dcList},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"text",params:["60"]},null],type:"bitbrick_dc_speed"},paramsKeyMap:{PORT:0,VALUE:1},"class":"condition",isNotFor:["bitbrick"],func:function(b, +a){var d=a.getNumberValue("VALUE"),d=Math.min(d,Entry.Bitbrick.dcMaxValue),d=Math.max(d,Entry.Bitbrick.dcMinValue);Entry.hw.sendQueue[a.getStringField("PORT")]=d+128;return a.callReturn()},syntax:{js:[],py:["Bitbrick.dc_speed(%1, %2)"]}},bitbrick_dc_direction_speed:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,menuName:Entry.Bitbrick.dcList},{type:"Dropdown",options:[[Lang.Blocks.BITBRICK_dc_direction_cw,"CW"],[Lang.Blocks.BITBRICK_dc_direction_ccw, +"CCW"]],value:"CW",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,{type:"text",params:["100"]},null],type:"bitbrick_dc_direction_speed"},paramsKeyMap:{PORT:0,DIRECTION:1,VALUE:2},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d="CW"===a.getStringField("DIRECTION"),c=a.getNumberValue("VALUE"),c=Math.min(c,Entry.Bitbrick.dcMaxValue),c=Math.max(c,0);Entry.hw.sendQueue[a.getStringField("PORT")]= +d?c+128:128-c;return a.callReturn()},syntax:{js:[],py:["Bitbrick.dc_direction_speed(%1, %2, %3)"]}},bitbrick_servomotor_angle:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,menuName:Entry.Bitbrick.servoList},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"text",params:["100"]},null],type:"bitbrick_servomotor_angle"},paramsKeyMap:{PORT:0,VALUE:1},"class":"condition", +isNotFor:["bitbrick"],func:function(b,a){var d=Entry.Bitbrick.servoMaxValue-(a.getNumberValue("VALUE")+1),d=Math.min(d,Entry.Bitbrick.servoMaxValue),d=Math.max(d,Entry.Bitbrick.servoMinValue);Entry.hw.sendQueue[a.getStringField("PORT")]=d;return a.callReturn()},syntax:{js:[],py:["Bitbrick.servomotor_angle(%1, %2)"]}},bitbrick_convert_scale:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"DropdownDynamic",value:null,fontSize:11,menuName:Entry.Bitbrick.sensorList}, +{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"}],events:{},def:{params:[null,{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["-100"]},{type:"number",params:["100"]}],type:"bitbrick_convert_scale"},paramsKeyMap:{PORT:0,VALUE2:1,VALUE3:2,VALUE4:3,VALUE5:4},"class":"condition",isNotFor:["bitbrick"],func:function(b,a){var d=a.getNumberField("PORT"),c=Entry.hw.portData[d].value,d=a.getNumberValue("VALUE2", +a),e=a.getNumberValue("VALUE3",a),f=a.getNumberValue("VALUE4",a),g=a.getNumberValue("VALUE5",a);if(f>g)var h=f,f=g,g=h;c-=d;c*=(g-f)/(e-d);c+=f;c=Math.min(g,c);c=Math.max(f,c);return Math.round(c)},syntax:{js:[],py:["Bitbrick.convert_scale(%1, %2, %3, %4, %5)"]}},cobl_read_ultrason:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"1. \ucd08\uc74c\ud30c\uac70\ub9ac(0~400)",def:{type:"cobl_read_ultrason"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("ultrason")}}, +cobl_read_potenmeter:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"2.\uac00\ubcc0\uc800\ud56d(0~1023)",def:{type:"cobl_read_potenmeter"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("potenmeter")}},cobl_read_irread1:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"3.\uc801\uc678\uc120\uc13c\uc11c1(0~1023)",def:{type:"cobl_read_irread1"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("irread1")}}, +cobl_read_irread2:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"4.\uc801\uc678\uc120\uc13c\uc11c2(0~1023)",def:{type:"cobl_read_irread2"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("irread2")}},cobl_read_joyx:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"5.\uc870\uc774\uc2a4\ud2f1X\ucd95(1, 0, -1)",def:{type:"cobl_read_joyx"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("joyx")}}, +cobl_read_joyy:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"6.\uc870\uc774\uc2a4\ud2f1Y\ucd95(1, 0, -1)",def:{type:"cobl_read_joyy"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("joyy")}},cobl_read_tilt:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"7.\uae30\uc6b8\uae30\uc13c\uc11c(0~4)",def:{type:"cobl_read_tilt"},class:"cobl",isNotFor:["cobl"],func:function(b,a){return Entry.hw.getAnalogPortValue("tilt")}}, +cobl_read_temps:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",template:"8.\uc628\ub3c4\uc13c\uc11c@\ud3ec\ud2b8%1",params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11}],def:{params:["1"],type:"cobl_read_temps"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getValue("VALUE",a);if(1==d)return Entry.hw.getAnalogPortValue("temps1");if(2==d)return Entry.hw.getAnalogPortValue("temps2")}},cobl_read_light:{color:"#00979D",fontColor:"#fff", +skeleton:"basic_string_field",template:"9.\ube5b\uc13c\uc11c@\ud3ec\ud2b8%1",params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11}],def:{params:["1"],type:"cobl_read_light"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getValue("VALUE",a);if(1==d)return Entry.hw.getAnalogPortValue("light1");if(2==d)return Entry.hw.getAnalogPortValue("light2")}},cobl_read_btn:{color:"#00979D",fontColor:"#fff",skeleton:"basic_boolean_field",template:"10.\ubc84\ud2bc\uc2a4\uc704\uce58@\ud3ec\ud2b8%1", +params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11}],def:{params:["1"],type:"cobl_read_btn"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getValue("VALUE",a);if(1==d)return Entry.hw.getDigitalPortValue("btn1");if(2==d)return Entry.hw.getDigitalPortValue("btn2")}},cobl_led_control:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"11.\ubb34\uc9c0\uac1cLED%1%2 %3",params:[{type:"Dropdown",options:[["1","1"],["2","2"],["3","3"]],fontSize:11}, +{type:"Dropdown",options:[["OFF","OFF"],["\ube68\uac15","Red"],["\uc8fc\ud669","Orange"],["\ub178\ub791","Yellow"],["\ucd08\ub85d","Green"],["\ud30c\ub791","Blue"],["\ub0a8\uc0c9","Dark Blue"],["\ubcf4\ub77c","Purple"],["\ud770\uc0c9","White"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["1","OFF"],type:"cobl_led_control"},paramsKeyMap:{PORT:0,OPERATOR:1},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getStringField("PORT"),c=a.getStringField("OPERATOR"); +Entry.hw.setDigitalPortValue("RainBowLED_"+d,c);Entry.hw.update();delete Entry.hw.sendQueue["RainBowLED_"+d];return a.callReturn()}},cobl_servo_angle_control:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"12.\uac01\ub3c4\ubaa8\ud130 \uac01\ub3c4%1(15~165) %2",params:[{type:"TextInput",value:0},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{type:"cobl_servo_angle_control"},paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getNumberField("VALUE"), +d=Math.round(d),d=Math.max(d,15),d=Math.min(d,165);Entry.hw.setDigitalPortValue("Servo1",d);Entry.hw.update();delete Entry.hw.sendQueue.Servo1;return a.callReturn()}},cobl_melody:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"13.\uba5c\ub85c\ub514%1 ,%2",params:[{type:"Dropdown",options:[["((\ub0ae\uc740)\uc194","L_So"],["(\ub0ae\uc740)\uc194#","L_So#"],["(\ub0ae\uc740)\ub77c","L_La"],["(\ub0ae\uc740)\ub77c#","L_La#"],["(\ub0ae\uc740)\uc2dc","L_Ti"],["\ub3c4","Do"],["\ub3c4#","Do#"], +["\ub808","Re"],["\ub808#","Re#"],["\ubbf8","Mi"],["\ud30c","Fa"],["\ud30c#","Fa#"],["\uc194","So"],["\uc194#","So#"],["\ub77c","La"],["\ub77c#","La#"],["\uc2dc","Ti"],["(\ub192\uc740)\ub3c4","H_Do"],["(\ub192\uc740)\ub3c4#","H_Do#"],["(\ub192\uc740)\ub808","H_Re"],["(\ub192\uc740)\ub808#","H_Re#"],["(\ub192\uc740)\ubbf8#","H_Mi"],["(\ub192\uc740)\ud30c","H_Fa"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["Do"],type:"cobl_melody"},paramsKeyMap:{MELODY:0}, +class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getStringField("MELODY");Entry.hw.setDigitalPortValue("Melody",d);Entry.hw.update();delete Entry.hw.sendQueue.Melody;return a.callReturn()}},cobl_dcmotor:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"14.\ud68c\uc804\ubaa8\ud130%1%2\uc18d\ub3c4%3 %4",params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11},{type:"Dropdown",options:[["1.\uc2dc\uacc4\ubc29\ud5a5","1"],["2.\ubc18\uc2dc\uacc4\ubc29\ud5a5","2"],["3.\uc815\uc9c0", +"3"]],fontSize:11},{type:"Dropdown",options:[["1","1"],["2","2"],["3","3"],["4","4"],["5","5"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["1","1","1"],type:"cobl_dcmotor"},paramsKeyMap:{MOTOR:0,DIRECTION:1,SPEED:2},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getStringField("MOTOR"),c=a.getStringField("DIRECTION"),e=a.getStringField("SPEED");1==d&&(Entry.hw.setDigitalPortValue("DC1_DIR",c),Entry.hw.setDigitalPortValue("DC1_SPEED",e),Entry.hw.update(), +delete Entry.hw.sendQueue.DC1_DIR,delete Entry.hw.sendQueue.DC1_SPEED);2==d&&(Entry.hw.setDigitalPortValue("DC2_DIR",c),Entry.hw.setDigitalPortValue("DC2_SPEED",e),Entry.hw.update(),delete Entry.hw.sendQueue.DC2_DIR,delete Entry.hw.sendQueue.DC2_SPEED);return a.callReturn()}},cobl_extention_port:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"15.USB\ud3ec\ud2b8%1\ub2e8\uacc4%2 %3",params:[{type:"Dropdown",options:[["1","1"],["2","2"]],fontSize:11},{type:"Dropdown",options:[["0","0"], +["1","1"],["2","2"],["3","3"],["4","4"],["5","5"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["1","0"],type:"cobl_extention_port"},paramsKeyMap:{PORT:0,LEVEL:1},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getStringField("PORT"),c=a.getStringField("LEVEL");1==d&&(Entry.hw.setDigitalPortValue("EXUSB1",c),Entry.hw.update(),delete Entry.hw.sendQueue.EXUSB1);2==d&&(Entry.hw.setDigitalPortValue("EXUSB2",c),Entry.hw.update(),delete Entry.hw.sendQueue.EXUSB2); +return a.callReturn()}},cobl_external_led:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"16.\uc678\ubd80LED%1(1~64)R%2G%3B%4 %5",params:[{type:"TextInput",value:0,fontSize:11},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"]],fontSize:11},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"]],fontSize:11},{type:"Dropdown", +options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"]],fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{params:["1","1","1","1"],type:"cobl_external_led"},paramsKeyMap:{LED:0,RED:1,GREEN:2,BLUE:3},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getNumberField("LED"),c=a.getStringField("RED"),e=a.getStringField("GREEN"),f=a.getStringField("BLUE");Entry.hw.setDigitalPortValue("ELED_IDX",d);Entry.hw.setDigitalPortValue("ELED_R", +c);Entry.hw.setDigitalPortValue("ELED_G",e);Entry.hw.setDigitalPortValue("ELED_B",f);Entry.hw.update();delete Entry.hw.sendQueue.ELED_IDX;delete Entry.hw.sendQueue.ELED_R;delete Entry.hw.sendQueue.ELED_G;delete Entry.hw.sendQueue.ELED_B;return a.callReturn()}},cobl_7_segment:{color:"#00979D",fontColor:"#fff",skeleton:"basic",template:"17.\uc22b\uc790\uc804\uad11\ud310%1(0~9999) %2",params:[{type:"TextInput",value:0},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],def:{type:"cobl_7_segment"}, +paramsKeyMap:{VALUE:0},class:"cobl",isNotFor:["cobl"],func:function(b,a){var d=a.getNumberField("VALUE");Entry.hw.setDigitalPortValue("7SEG",d);Entry.hw.update();delete Entry.hw.sendQueue["7SEG"];return a.callReturn()}},start_drawing:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"start_drawing"},"class":"brush_control",isNotFor:["textBox"],func:function(b,a){b.brush?b.brush.stop=!1:Entry.setBasicBrush(b); +Entry.stage.sortZorder();b.brush.moveTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.start_drawing()"]}},stop_drawing:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"stop_drawing"},"class":"brush_control",isNotFor:["textBox"],func:function(b,a){b.brush&&b.shape&&(b.brush.stop=!0);return a.callReturn()},syntax:{js:[],py:["Entry.stop_drawing()"]}},set_color:{color:"#FF9E20", +skeleton:"basic",statements:[],params:[{type:"Color"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"set_color"},paramsKeyMap:{VALUE:0},"class":"brush_color",isNotFor:["textBox"],func:function(b,a){var d=a.getField("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);b.brush&&(d=Entry.hex2rgb(d),b.brush.rgb=d,b.brush.endStroke(),b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()}, +syntax:{js:[],py:["Entry.set_brush_color(%1)"]}},set_random_color:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"set_random_color"},"class":"brush_color",isNotFor:["textBox"],func:function(b,a){b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);if(b.brush){var d=Entry.generateRgb();b.brush.rgb=d;b.brush.endStroke();b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")");b.brush.moveTo(b.getX(), +-1*b.getY())}return a.callReturn()},syntax:{js:[],py:["Entry.set_brush_color_random()"]}},change_thickness:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["1"]},null],type:"change_thickness"},paramsKeyMap:{VALUE:0},"class":"brush_thickness",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop= +!0);b.brush&&(b.brush.thickness+=d,1>b.brush.thickness&&(b.brush.thickness=1),b.brush.setStrokeStyle(b.brush.thickness),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:["Entry.add_brush_size(%1)"]}},set_thickness:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["1"]},null],type:"set_thickness"},paramsKeyMap:{VALUE:0},"class":"brush_thickness", +isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);b.brush&&(b.brush.thickness=d,b.brush.setStrokeStyle(b.brush.thickness),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:["Entry.set_brush_size(%1)"]}},change_opacity:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number", +params:["10"]},null],type:"change_opacity"},paramsKeyMap:{VALUE:0},"class":"brush_opacity",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);d=Entry.adjustValueWithMaxMin(b.brush.opacity+d,0,100);b.brush&&(b.brush.opacity=d,b.brush.endStroke(),d=b.brush.rgb,b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:[""]}},set_opacity:{color:"#FF9E20", +skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["50"]},null],type:"set_opacity"},paramsKeyMap:{VALUE:0},"class":"brush_opacity",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);b.brush&&(b.brush.opacity=Entry.adjustValueWithMaxMin(d,0,100),b.brush.endStroke(),d=b.brush.rgb,b.brush.beginStroke("rgba("+ +d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:[""]}},brush_erase_all:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"brush_erase_all"},"class":"brush_clear",isNotFor:["textBox"],func:function(b,a){var d=b.brush;if(d){var c=d._stroke.style,e=d._strokeStyle.width;d.clear().setStrokeStyle(e).beginStroke(c);d.moveTo(b.getX(), +-1*b.getY())}d=b.parent.getStampEntities();d.map(function(a){a.removeClone()});d=null;return a.callReturn()},syntax:{js:[],py:["Entry.clear_drawing()"]}},brush_stamp:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[null],type:"brush_stamp"},"class":"stamp",isNotFor:["textBox"],func:function(b,a){b.parent.addStampEntity(b);return a.callReturn()},syntax:{js:[],py:["Entry.stamp()"]}},change_brush_transparency:{color:"#FF9E20", +skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"change_brush_transparency"},paramsKeyMap:{VALUE:0},"class":"brush_opacity",isNotFor:["textBox"],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);d=Entry.adjustValueWithMaxMin(b.brush.opacity-d,0,100);b.brush&&(b.brush.opacity=d,b.brush.endStroke(),d=b.brush.rgb, +b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+b.brush.opacity/100+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:["Entry.add_brush_transparency(%1)"]}},set_brush_tranparency:{color:"#FF9E20",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/brush_03.png",size:12}],events:{},def:{params:[{type:"number",params:["50"]},null],type:"set_brush_tranparency"},paramsKeyMap:{VALUE:0},"class":"brush_opacity",isNotFor:["textBox"], +func:function(b,a){var d=a.getNumberValue("VALUE",a);b.brush||(Entry.setBasicBrush(b),b.brush.stop=!0);b.brush&&(b.brush.opacity=Entry.adjustValueWithMaxMin(d,0,100),b.brush.endStroke(),d=b.brush.rgb,b.brush.beginStroke("rgba("+d.r+","+d.g+","+d.b+","+(1-b.brush.opacity/100)+")"),b.brush.moveTo(b.getX(),-1*b.getY()));return a.callReturn()},syntax:{js:[],py:["Entry.set_brush_transparency(%1)"]}},number:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"TextInput",value:10}], +events:{},def:{params:[]},paramsKeyMap:{NUM:0},func:function(b,a){return a.getField("NUM",a)},isPrimitive:!0,syntax:{js:["Scope","%1"],py:["%1number#"]}},angle:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Angle"}],events:{},def:{params:[null],type:"angle"},paramsKeyMap:{ANGLE:0},func:function(b,a){return a.getNumberField("ANGLE")},syntax:{js:[],py:["%1angle#"]}},get_x_coordinate:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_x_coordinate, +color:"#3D3D3D"}],events:{},def:{params:[null],type:"get_x_coordinate"},"class":"calc",isNotFor:[],func:function(b,a){return b.getX()},syntax:{js:[],py:[""]}},get_y_coordinate:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_y_coordinate,color:"#3D3D3D"}],events:{},def:{params:[null],type:"get_y_coordinate"},"class":"calc",isNotFor:[],func:function(b,a){return b.getY()},syntax:{js:[],py:[""]}},get_angle:{color:"#FFD974",skeleton:"basic_string_field", +statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_angle,color:"#3D3D3D"}],events:{},def:{params:[null]},func:function(b,a){return parseFloat(b.getRotation().toFixed(1))},syntax:{js:[],py:[""]}},get_rotation_direction:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.CALC_rotation_value,"ROTATION"],[Lang.Blocks.CALC_direction_value,"DIRECTION"]],value:"ROTATION",fontSize:11}],events:{},def:{params:[null],type:"get_rotation_direction"}, +paramsKeyMap:{OPERATOR:0},"class":"calc",isNotFor:[],func:function(b,a){return"DIRECTION"==a.getField("OPERATOR",a).toUpperCase()?parseFloat(b.getDirection().toFixed(1)):parseFloat(b.getRotation().toFixed(1))},syntax:{js:[],py:[""]}},distance_something:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_distance_something_1,color:"#3D3D3D"},{type:"DropdownDynamic",value:null,menuName:"spritesWithMouse",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC}, +{type:"Text",text:Lang.Blocks.CALC_distance_something_2,color:"#3D3D3D"}],events:{},def:{params:[null,null,null],type:"distance_something"},paramsKeyMap:{VALUE:1},"class":"calc_distance",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a);if("mouse"==d)return d=Entry.stage.mouseCoordinate,Math.sqrt(Math.pow(b.getX()-d.x,2)+Math.pow(b.getY()-d.y,2));d=Entry.container.getEntity(d);return Math.sqrt(Math.pow(b.getX()-d.getX(),2)+Math.pow(b.getY()-d.getY(),2))},syntax:{js:[],py:["Entry.value_of_distance(%2)"]}}, +coordinate_mouse:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_coordinate_mouse_1,color:"#3D3D3D"},{type:"Dropdown",options:[["x","x"],["y","y"]],value:"x",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_coordinate_mouse_2,color:"#3D3D3D"}],events:{},def:{params:[null,null,null],type:"coordinate_mouse"},paramsKeyMap:{VALUE:1},"class":"calc",isNotFor:[],func:function(b,a){return"x"===a.getField("VALUE", +a)?Number(Entry.stage.mouseCoordinate.x):Number(Entry.stage.mouseCoordinate.y)},syntax:{js:[],py:["Entry.coordinate_of_mouse(%2)"]}},coordinate_object:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_coordinate_object_1,color:"#3D3D3D"},{type:"DropdownDynamic",value:null,menuName:"spritesWithSelf",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_coordinate_object_2,color:"#3D3D3D"},{type:"Dropdown",options:[[Lang.Blocks.CALC_coordinate_x_value, +"x"],[Lang.Blocks.CALC_coordinate_y_value,"y"],[Lang.Blocks.CALC_coordinate_rotation_value,"rotation"],[Lang.Blocks.CALC_coordinate_direction_value,"direction"],[Lang.Blocks.CALC_coordinate_size_value,"size"],[Lang.Blocks.CALC_picture_index,"picture_index"],[Lang.Blocks.CALC_picture_name,"picture_name"]],value:"x",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC}],events:{},def:{params:[null,null,null,null],type:"coordinate_object"},paramsKeyMap:{VALUE:1,COORDINATE:3},"class":"calc",isNotFor:[], +func:function(b,a){var d=a.getField("VALUE",a),d="self"==d?b:Entry.container.getEntity(d);switch(a.getField("COORDINATE",a)){case "x":return d.getX();case "y":return d.getY();case "rotation":return d.getRotation();case "direction":return d.getDirection();case "picture_index":var c=d.parent,c=c.pictures;return c.indexOf(d.picture)+1;case "size":return Number(d.getSize().toFixed(1));case "picture_name":return c=d.parent,c=c.pictures,c[c.indexOf(d.picture)].name}},syntax:{js:[],py:["Entry.value_of(%2, %4)"]}}, +calc_basic:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Dropdown",options:[["+","PLUS"],["-","MINUS"],["x","MULTI"],["/","DIVIDE"]],value:"PLUS",fontSize:11,noArrow:!0},{type:"Block",accept:"string"}],events:{},def:{params:[{type:"number",params:["10"]},"PLUS",{type:"number",params:["10"]}],type:"calc_basic"},defs:[{params:[{type:"number",params:["10"]},"PLUS",{type:"number",params:["10"]}],type:"calc_basic"},{params:[{type:"number",params:["10"]}, +"MINUS",{type:"number",params:["10"]}],type:"calc_basic"},{params:[{type:"number",params:["10"]},"MULTI",{type:"number",params:["10"]}],type:"calc_basic"},{params:[{type:"number",params:["10"]},"DIVIDE",{type:"number",params:["10"]}],type:"calc_basic"}],paramsKeyMap:{LEFTHAND:0,OPERATOR:1,RIGHTHAND:2},"class":"calc",isNotFor:[],func:function(b,a){var d=a.getField("OPERATOR",a),c=a.getNumberValue("LEFTHAND",a),e=a.getNumberValue("RIGHTHAND",a);return"PLUS"==d?c+e:"MINUS"==d?c-e:"MULTI"==d?c*e:c/e}, +syntax:{js:[],py:["(%1 %2calc_basic# %3)"]}},calc_plus:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"+",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[null]},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d+c},syntax:{js:[],py:[""]}},calc_minus:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block", +accept:"string"},{type:"Text",text:"-",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[null]},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d-c},syntax:{js:[],py:[""]}},calc_times:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"x",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[null]},paramsKeyMap:{LEFTHAND:0, +RIGHTHAND:2},func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d*c},syntax:{js:[],py:[""]}},calc_divide:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"/",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[null]},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d/c},syntax:{js:[], +py:[""]}},calc_mod:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"/",color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_calc_mod_3,color:"#3D3D3D"}],events:{},def:{params:[{type:"number",params:["10"]},null,{type:"number",params:["10"]},null],type:"calc_mod"},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},"class":"calc",isNotFor:[],func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND", +a);return d%c},syntax:{js:[],py:["Entry.get_remainder(%1, %3)"]}},calc_share:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"/",color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:"\uc758 \ubaab",color:"#3D3D3D"}],events:{},def:{params:[{type:"number",params:["10"]},null,{type:"number",params:["10"]},null],type:"calc_share"},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},"class":"calc",isNotFor:[],func:function(b,a){var d= +a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return Math.floor(d/c)},syntax:{js:[],py:[""]}},calc_operation:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_calc_operation_of_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_calc_operation_of_2,color:"#3D3D3D"},{type:"Dropdown",options:[[Lang.Blocks.CALC_calc_operation_square,"square"],[Lang.Blocks.CALC_calc_operation_root,"root"],[Lang.Blocks.CALC_calc_operation_sin, +"sin"],[Lang.Blocks.CALC_calc_operation_cos,"cos"],[Lang.Blocks.CALC_calc_operation_tan,"tan"],[Lang.Blocks.CALC_calc_operation_asin,"asin_radian"],[Lang.Blocks.CALC_calc_operation_acos,"acos_radian"],[Lang.Blocks.CALC_calc_operation_atan,"atan_radian"],[Lang.Blocks.CALC_calc_operation_log,"log"],[Lang.Blocks.CALC_calc_operation_ln,"ln"],[Lang.Blocks.CALC_calc_operation_unnatural,"unnatural"],[Lang.Blocks.CALC_calc_operation_floor,"floor"],[Lang.Blocks.CALC_calc_operation_ceil,"ceil"],[Lang.Blocks.CALC_calc_operation_round, +"round"],[Lang.Blocks.CALC_calc_operation_factorial,"factorial"],[Lang.Blocks.CALC_calc_operation_abs,"abs"]],value:"square",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC}],events:{},def:{params:[null,{type:"number",params:["10"]},null,null],type:"calc_operation"},paramsKeyMap:{LEFTHAND:1,VALUE:3},"class":"calc",isNotFor:[],func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getField("VALUE",a);if(-1<["asin_radian","acos_radian"].indexOf(c)&&(1d))throw Error("x range exceeded"); +c.indexOf("_")&&(c=c.split("_")[0]);-1<["sin","cos","tan"].indexOf(c)&&(d=Entry.toRadian(d));var e=0;switch(c){case "square":e=d*d;break;case "factorial":e=Entry.factorial(d);break;case "root":e=Math.sqrt(d);break;case "log":e=Math.log(d)/Math.LN10;break;case "ln":e=Math.log(d);break;case "asin":case "acos":case "atan":e=Entry.toDegrees(Math[c](d));break;case "unnatural":e=d-Math.floor(d);0>d&&(e=1-e);break;default:e=Math[c](d)}return e},syntax:{js:[],py:["Entry.value_of_math_operation(%2, %4)"]}}, +calc_rand:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_calc_rand_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_calc_rand_2,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_calc_rand_3,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"number",params:["0"]},null,{type:"number",params:["10"]},null],type:"calc_rand"},paramsKeyMap:{LEFTHAND:1,RIGHTHAND:3},"class":"calc", +isNotFor:[],func:function(b,a){var d=a.getStringValue("LEFTHAND",a),c=a.getStringValue("RIGHTHAND",a),e=Math.min(d,c),f=Math.max(d,c),d=Entry.isFloat(d);return Entry.isFloat(c)||d?(Math.random()*(f-e)+e).toFixed(2):Math.floor(Math.random()*(f-e+1)+e)},syntax:{js:[],py:["random.randint(%2, %4)"]}},get_date:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_date_1,color:"#3D3D3D"},{type:"Dropdown",options:[[Lang.Blocks.CALC_get_date_year,"YEAR"], +[Lang.Blocks.CALC_get_date_month,"MONTH"],[Lang.Blocks.CALC_get_date_day,"DAY"],[Lang.Blocks.CALC_get_date_hour,"HOUR"],[Lang.Blocks.CALC_get_date_minute,"MINUTE"],[Lang.Blocks.CALC_get_date_second,"SECOND"]],value:"YEAR",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_get_date_2,color:"#3D3D3D"}],events:{},def:{params:[null,"YEAR",null],type:"get_date"},paramsKeyMap:{VALUE:1},"class":"calc_date",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c= +new Date;return"YEAR"==d?c.getFullYear():"MONTH"==d?c.getMonth()+1:"DAY"==d?c.getDate():"HOUR"==d?c.getHours():"MINUTE"==d?c.getMinutes():c.getSeconds()},syntax:{js:[],py:["Entry.value_of_date_time(%2)"]}},get_sound_duration:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_get_sound_duration_1,color:"#3D3D3D"},{type:"DropdownDynamic",value:null,menuName:"sounds",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_get_sound_duration_2, +color:"#3D3D3D"}],events:{},def:{params:[null,null,null],type:"get_sound_duration"},paramsKeyMap:{VALUE:1},"class":"calc_duration",isNotFor:[],func:function(b,a){for(var d=a.getField("VALUE",a),c=b.parent.sounds,e=0;ec||c>d.length-1)throw Error();return d[c]},syntax:{js:[],py:["Entry.string_index_of(%2, %4)"]}},length_of_string:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_length_of_string_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_length_of_string_2,color:"#3D3D3D"}],events:{}, +def:{params:[null,{type:"text",params:[Lang.Blocks.entry]},null],type:"length_of_string"},paramsKeyMap:{STRING:1},"class":"calc_string",isNotFor:[],func:function(b,a){return a.getStringValue("STRING",a).length},syntax:{js:[],py:["Entry.string_length(%2)"]}},substring:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_substring_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_substring_2,color:"#3D3D3D"},{type:"Block", +accept:"string"},{type:"Text",text:Lang.Blocks.CALC_substring_3,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_substring_4,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:[Lang.Blocks.hi_entry]},null,{type:"number",params:["2"]},null,{type:"number",params:["5"]},null],type:"substring"},paramsKeyMap:{STRING:1,START:3,END:5},"class":"calc_string",isNotFor:[],func:function(b,a){var d=a.getStringValue("STRING",a),c=a.getNumberValue("START",a)-1,e= +a.getNumberValue("END",a)-1,f=d.length-1;if(0>c||0>e||c>f||e>f)throw Error();return d.substring(Math.min(c,e),Math.max(c,e)+1)},syntax:{js:[],py:["Entry.string_substring(%2, %4, %6)"]}},replace_string:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_replace_string_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_replace_string_2,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_replace_string_3, +color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_replace_string_4,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:[Lang.Blocks.hi_entry]},null,{type:"text",params:[Lang.Blocks.hello]},null,{type:"text",params:[Lang.Blocks.nice]},null],type:"replace_string"},paramsKeyMap:{STRING:1,OLD_WORD:3,NEW_WORD:5},"class":"calc_string",isNotFor:[],func:function(b,a){return a.getStringValue("STRING",a).replace(new RegExp(a.getStringValue("OLD_WORD",a),"gm"), +a.getStringValue("NEW_WORD",a))},syntax:{js:[],py:["Entry.string_replace(%2, %4, %6)"]}},change_string_case:{color:"#FFD974",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.CALC_change_string_case_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_change_string_case_2,color:"#3D3D3D"},{type:"Dropdown",options:[[Lang.Blocks.CALC_change_string_case_sub_1,"toUpperCase"],[Lang.Blocks.CALC_change_string_case_sub_2,"toLowerCase"]],value:"toUpperCase", +fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_CALC},{type:"Text",text:Lang.Blocks.CALC_change_string_case_3,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:["Hello Entry!"]},null,null,null],type:"change_string_case"},paramsKeyMap:{STRING:1,CASE:3},"class":"calc_string",isNotFor:[],func:function(b,a){return a.getStringValue("STRING",a)[a.getField("CASE",a)]()},syntax:{js:[],py:["Entry.string_case(%2, %4)"]}},index_of_string:{color:"#FFD974",skeleton:"basic_string_field",statements:[], +params:[{type:"Text",text:Lang.Blocks.CALC_index_of_string_1,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_index_of_string_2,color:"#3D3D3D"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.CALC_index_of_string_3,color:"#3D3D3D"}],events:{},def:{params:[null,{type:"text",params:[Lang.Blocks.hi_entry]},null,{type:"text",params:[Lang.Blocks.entry]},null],type:"index_of_string"},paramsKeyMap:{LEFTHAND:1,RIGHTHAND:3},"class":"calc_string",isNotFor:[], +func:function(b,a){var d=a.getStringValue("LEFTHAND",a),c=a.getStringValue("RIGHTHAND",a),d=d.indexOf(c);return-1d)throw Error(Lang.Blocks.FLOW_repeat_basic_errorMsg);a.iterCount=Math.floor(d)}if(0==a.iterCount||0>a.iterCount)return delete a.isLooped,delete a.iterCount,a.callReturn();a.iterCount--;return a.getStatement("DO",a)},syntax:{js:[],py:["for i in range(%1):\n$1"]}},repeat_inf:{color:"#498deb",skeleton:"basic_loop",statements:[{accept:"basic"}],params:[{type:"Indicator",img:"block_icon/flow_03.png", +size:12}],events:{},def:{params:[null],type:"repeat_inf"},statementsKeyMap:{DO:0},"class":"repeat",isNotFor:[],func:function(b,a){a.isLooped=!0;return a.getStatement("DO")},syntax:{js:[],py:["while True:\n$1"]}},stop_repeat:{color:"#498deb",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null],type:"stop_repeat"},"class":"repeat",isNotFor:[],func:function(b,a){return this.executor.breakLoop()},syntax:{js:[],py:["break"]}},wait_until_true:{color:"#498deb", +skeleton:"basic",statements:[],params:[{type:"Block",accept:"boolean"},{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[{type:"True"},null],type:"wait_until_true"},paramsKeyMap:{BOOL:0},"class":"wait",isNotFor:[],func:function(b,a){return a.getBooleanValue("BOOL",a)?a.callReturn():a},syntax:{js:[],py:["Entry.wait_until(%1)"]}},_if:{color:"#498deb",skeleton:"basic_loop",statements:[{accept:"basic"}],params:[{type:"Block",accept:"boolean"},{type:"Indicator",img:"block_icon/flow_03.png", +size:12}],events:{},def:{params:[{type:"True"},null],type:"_if"},paramsKeyMap:{BOOL:0},statementsKeyMap:{STACK:0},"class":"condition",isNotFor:[],func:function(b,a){return a.isCondition?(delete a.isCondition,a.callReturn()):a.getBooleanValue("BOOL",a)?(a.isCondition=!0,a.getStatement("STACK",a)):a.callReturn()},syntax:{js:[],py:["if %1:\n$1"]}},if_else:{color:"#498deb",skeleton:"basic_double_loop",statements:[{accept:"basic"},{accept:"basic"}],params:[{type:"Block",accept:"boolean"},{type:"Indicator", +img:"block_icon/flow_03.png",size:12},{type:"LineBreak"}],events:{},def:{params:[{type:"True"},null],type:"if_else"},paramsKeyMap:{BOOL:0},statementsKeyMap:{STACK_IF:0,STACK_ELSE:1},"class":"condition",isNotFor:[],func:function(b,a){if(a.isCondition)return delete a.isCondition,a.callReturn();var d=a.getBooleanValue("BOOL",a);a.isCondition=!0;return d?a.getStatement("STACK_IF",a):a.getStatement("STACK_ELSE",a)},syntax:{js:[],py:["if %1:\n$1\nelse:\n$2"]}},create_clone:{color:"#498deb",skeleton:"basic", +statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"clone",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_FLOW},{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null,null],type:"create_clone"},paramsKeyMap:{VALUE:0},"class":"clone",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c=a.callReturn();"self"==d?b.parent.addCloneEntity(b.parent,b,null):Entry.container.getObject(d).addCloneEntity(b.parent,null,null);return c},syntax:{js:[],py:["Entry.create_clone(%1)"]}}, +delete_clone:{color:"#498deb",skeleton:"basic_without_next",statements:[],params:[{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null],type:"delete_clone"},"class":"clone",isNotFor:[],func:function(b,a){if(!b.isClone)return a.callReturn();b.removeClone();return this.die()},syntax:{js:[],py:["Entry.remove_clone()"]}},when_clone_start:{color:"#498deb",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_clone.png",size:17,position:{x:0, +y:-2}}],events:{},def:{params:[null],type:"when_clone_start"},"class":"clone",isNotFor:[],func:function(b,a){return a.callReturn()},event:"when_clone_start",syntax:{js:[],py:["def entry_event_clone_create():"]}},stop_run:{color:"#498deb",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null]},func:function(b,a){return Entry.engine.toggleStop()},syntax:{js:[],py:[""]}},repeat_while_true:{color:"#498deb",skeleton:"basic_loop",statements:[{accept:"basic"}], +params:[{type:"Block",accept:"boolean"},{type:"Dropdown",options:[[Lang.Blocks.FLOW_repeat_while_true_until,"until"],[Lang.Blocks.FLOW_repeat_while_true_while,"while"]],value:"until",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_FLOW},{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[{type:"True"},null,null],type:"repeat_while_true"},paramsKeyMap:{BOOL:0,OPTION:1},statementsKeyMap:{DO:0},"class":"repeat",isNotFor:[],func:function(b,a){var d=a.getBooleanValue("BOOL", +a);"until"==a.getField("OPTION",a)&&(d=!d);return(a.isLooped=d)?a.getStatement("DO",a):a.callReturn()},syntax:{js:[],py:["not yet supported in textcoding"]}},stop_object:{color:"#498deb",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.FLOW_stop_object_all,"all"],[Lang.Blocks.FLOW_stop_object_this_object,"thisOnly"],[Lang.Blocks.FLOW_stop_object_this_thread,"thisThread"],[Lang.Blocks.FLOW_stop_object_other_thread,"otherThread"]],value:"all",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_FLOW}, +{type:"Indicator",img:"block_icon/flow_03.png",size:12}],events:{},def:{params:[null,null],type:"stop_object"},paramsKeyMap:{TARGET:0},"class":"terminate",isNotFor:[],func:function(b,a){var d=a.getField("TARGET",a),c=Entry.container;switch(d){case "all":return c.mapObject(function(a){a.script.clearExecutors()},null),this.die();case "thisOnly":return b.parent.script.clearExecutorsByEntity(b),this.die();case "thisObject":return b.parent.script.clearExecutors(),this.die();case "thisThread":return this.die(); +case "otherThread":for(var d=this.executor,c=b.parent.script,e=c.executors,f=0;fa.count?(50>c.leftFloor&& +50>c.rightFloor?a.count++:a.count=0,c=c.leftFloor-c.rightFloor,d.leftWheel=45+.25*c,d.rightWheel=45-.25*c):(a.count=0,a.boardState=2);break;case 2:c=c.leftFloor-c.rightFloor;d.leftWheel=45+.25*c;d.rightWheel=45-.25*c;a.boardState=3;var e=setTimeout(function(){a.boardState=4;Entry.Hamster.removeTimeout(e)},250);Entry.Hamster.timeouts.push(e);break;case 3:c=c.leftFloor-c.rightFloor;d.leftWheel=45+.25*c;d.rightWheel=45-.25*c;break;case 4:d.leftWheel=0,d.rightWheel=0,a.boardState=0,a.isMoving=!1}return a}delete a.isStart; +delete a.isMoving;delete a.count;delete a.boardState;Entry.engine.isContinue=!1;d.leftWheel=0;d.rightWheel=0;return a.callReturn()}a.isStart=!0;a.isMoving=!0;a.count=0;a.boardState=1;d.leftWheel=45;d.rightWheel=45;Entry.Hamster.setLineTracerMode(d,0);return a},syntax:{js:[],py:["Hamster.move_forward()"]}},hamster_turn_once:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_turn_once_left,"LEFT"],[Lang.Blocks.HAMSTER_turn_right,"RIGHT"]],value:"LEFT", +fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null],type:"hamster_turn_once"},paramsKeyMap:{DIRECTION:0},"class":"hamster_board",isNotFor:["hamster"],func:function(b,a){var d=Entry.hw.sendQueue,c=Entry.hw.portData;if(a.isStart){if(a.isMoving){if(a.isLeft)switch(a.boardState){case 1:2>a.count?50c.leftFloor&&(a.boardState=3);break;case 3:2>a.count?20>c.leftFloor&&a.count++:(a.count= +0,a.boardState=4);break;case 4:50a.count?50c.rightFloor&&(a.boardState=3);break;case 3:2>a.count?20>c.rightFloor&&a.count++:(a.count=0,a.boardState=4);break;case 4:50Entry.Hamster.tempo&&(Entry.Hamster.tempo=1);return a.callReturn()},syntax:{js:[],py:["Hamster.add_tempo(%1)"]}},hamster_set_tempo_to:{color:"#00979D",skeleton:"basic", +statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["60"]},null],type:"hamster_set_tempo_to"},paramsKeyMap:{VALUE:0},"class":"hamster_buzzer",isNotFor:["hamster"],func:function(b,a){Entry.Hamster.tempo=a.getNumberValue("VALUE");1>Entry.Hamster.tempo&&(Entry.Hamster.tempo=1);return a.callReturn()},syntax:{js:[],py:["Hamster.set_tempo(%1)"]}},hamster_set_port_to:{color:"#00979D",skeleton:"basic", +statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_port_a,"A"],[Lang.Blocks.HAMSTER_port_b,"B"],[Lang.Blocks.HAMSTER_port_ab,"AB"]],value:"A",fontSize:11},{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_analog_input,"0"],[Lang.Blocks.HAMSTER_digital_input,"1"],[Lang.Blocks.HAMSTER_servo_output,"8"],[Lang.Blocks.HAMSTER_pwm_output,"9"],[Lang.Blocks.HAMSTER_digital_output,"10"]],value:"0",fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null, +null,null],type:"hamster_set_port_to"},paramsKeyMap:{PORT:0,MODE:1},"class":"hamster_port",isNotFor:["hamster"],func:function(b,a){var d=Entry.hw.sendQueue,c=a.getField("PORT",a),e=Number(a.getField("MODE",a));"A"==c?d.ioModeA=e:("B"!=c&&(d.ioModeA=e),d.ioModeB=e);return a.callReturn()},syntax:{js:[],py:["Hamster.set_port(%1, %2)"]}},hamster_change_output_by:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_port_a,"A"],[Lang.Blocks.HAMSTER_port_b, +"B"],[Lang.Blocks.HAMSTER_port_ab,"AB"]],value:"A",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"text",params:["10"]},null],type:"hamster_change_output_by"},paramsKeyMap:{PORT:0,VALUE:1},"class":"hamster_port",isNotFor:["hamster"],func:function(b,a){var d=Entry.hw.sendQueue,c=a.getField("PORT"),e=a.getNumberValue("VALUE");"A"==c?d.outputA=void 0!=d.outputA?d.outputA+e:e:("B"!=c&&(d.outputA=void 0!=d.outputA? +d.outputA+e:e),d.outputB=void 0!=d.outputB?d.outputB+e:e);return a.callReturn()},syntax:{js:[],py:["Hamster.add_output(%1, %2)"]}},hamster_set_output_to:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.HAMSTER_port_a,"A"],[Lang.Blocks.HAMSTER_port_b,"B"],[Lang.Blocks.HAMSTER_port_ab,"AB"]],value:"A",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"text",params:["100"]}, +null],type:"hamster_set_output_to"},paramsKeyMap:{PORT:0,VALUE:1},"class":"hamster_port",isNotFor:["hamster"],func:function(b,a){var d=Entry.hw.sendQueue,c=a.getField("PORT"),e=a.getNumberValue("VALUE");"A"==c?d.outputA=e:("B"!=c&&(d.outputA=e),d.outputB=e);return a.callReturn()},syntax:{js:[],py:["Hamster.set_output(%1, %2)"]}},is_clicked:{color:"#AEB8FF",skeleton:"basic_boolean_field",statements:[],params:[{type:"Text",text:Lang.Blocks.JUDGEMENT_is_clicked,color:"#3D3D3D"}],events:{},def:{params:[null], +type:"is_clicked"},"class":"boolean_input",isNotFor:[],func:function(b,a){return Entry.stage.isClick},syntax:{js:[],py:["Entry.is_mouse_clicked()"]}},is_press_some_key:{color:"#AEB8FF",skeleton:"basic_boolean_field",statements:[],params:[{type:"Keyboard",value:81},{type:"Text",text:Lang.Blocks.JUDGEMENT_is_press_some_key_2,color:"#3D3D3D"}],events:{},def:{params:[null,null],type:"is_press_some_key"},paramsKeyMap:{VALUE:0},"class":"boolean_input",isNotFor:[],func:function(b,a){var d=Number(a.getField("VALUE", +a));return 0<=Entry.pressedKeys.indexOf(d)},syntax:{js:[],py:["Entry.is_pressed(%1)"]}},reach_something:{color:"#AEB8FF",skeleton:"basic_boolean_field",statements:[],params:[{type:"Text",text:Lang.Blocks.JUDGEMENT_reach_something_1,color:"#3D3D3D"},{type:"DropdownDynamic",value:null,menuName:"collision",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_JUDGE},{type:"Text",text:Lang.Blocks.JUDGEMENT_reach_something_2,color:"#3D3D3D"}],events:{},def:{params:[null,null,null],type:"reach_something"},paramsKeyMap:{VALUE:1}, +"class":"boolean_collision",isNotFor:[],func:function(b,a){if(!b.getVisible())return!1;var d=a.getField("VALUE",a),c=b.object,e=/wall/.test(d),f=ndgmr.checkPixelCollision;if(e)switch(e=Entry.stage.wall,d){case "wall":return!!(f(c,e.up,.2,!0)||f(c,e.down,.2,!0)||f(c,e.left,.2,!0)||f(c,e.right,.2,!0));case "wall_up":return!!f(c,e.up,.2,!0);case "wall_down":return!!f(c,e.down,.2,!0);case "wall_right":return!!f(c,e.right,.2,!0);case "wall_left":return!!f(c,e.left,.2,!0)}else{if("mouse"==d)return f=Entry.stage.canvas, +f=c.globalToLocal(f.mouseX,f.mouseY),c.hitTest(f.x,f.y);d=Entry.container.getEntity(d);if("textBox"==d.type||"textBox"==b.type){f=d.object.getTransformedBounds();c=c.getTransformedBounds();if(Entry.checkCollisionRect(c,f))return!0;for(var d=d.parent.clonedEntities,e=0,g=d.length;e","BIGGER"]],value:"EQUAL",fontSize:11},{type:"Block",accept:"string"}],events:{},def:{params:[null],type:"boolean_comparison"},paramsKeyMap:{LEFTHAND:0,OPERATOR:1,RIGHTHAND:2},func:function(b,a){var d= +a.getField("OPERATOR",a),c=a.getNumberValue("LEFTHAND",a),e=a.getNumberValue("RIGHTHAND",a);return"EQUAL"==d?c==e:"BIGGER"==d?c>e:c",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[{type:"number",params:["10"]},null,{type:"number",params:["10"]}],type:"boolean_bigger"},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},"class":"boolean_compare", +isNotFor:[],func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d>c},syntax:{js:[],py:[""]}},boolean_smaller:{color:"#AEB8FF",skeleton:"basic_boolean_field",statements:[],params:[{type:"Block",accept:"string"},{type:"Text",text:"<",color:"#3D3D3D"},{type:"Block",accept:"string"}],events:{},def:{params:[{type:"number",params:["10"]},null,{type:"number",params:["10"]}],type:"boolean_smaller"},paramsKeyMap:{LEFTHAND:0,RIGHTHAND:2},"class":"boolean_compare", +isNotFor:[],func:function(b,a){var d=a.getNumberValue("LEFTHAND",a),c=a.getNumberValue("RIGHTHAND",a);return d","GREATER"],["<","LESS"],["\u2265","GREATER_OR_EQUAL"],["\u2264","LESS_OR_EQUAL"]],value:"EQUAL",fontSize:11,noArrow:!0},{type:"Block",accept:"string"}],events:{},def:{params:[{type:"text",params:["10"]},"EQUAL",{type:"text",params:["10"]}],type:"boolean_basic_operator"},defs:[{params:[{type:"text",params:["10"]},"EQUAL",{type:"text",params:["10"]}],type:"boolean_basic_operator"}, +{params:[{type:"text",params:["10"]},"GREATER",{type:"text",params:["10"]}],type:"boolean_basic_operator"},{params:[{type:"text",params:["10"]},"LESS",{type:"text",params:["10"]}],type:"boolean_basic_operator"},{params:[{type:"text",params:["10"]},"GREATER_OR_EQUAL",{type:"text",params:["10"]}],type:"boolean_basic_operator"},{params:[{type:"text",params:["10"]},"LESS_OR_EQUAL",{type:"text",params:["10"]}],type:"boolean_basic_operator"}],paramsKeyMap:{LEFTHAND:0,OPERATOR:1,RIGHTHAND:2},"class":"boolean_compare", +isNotFor:[],func:function(b,a){var d=a.getField("OPERATOR",a),c=a.getStringValue("LEFTHAND",a),e=a.getStringValue("RIGHTHAND",a);switch(d){case "EQUAL":return c==e;case "GREATER":return Number(c)>Number(e);case "LESS":return Number(c)=Number(e);case "LESS_OR_EQUAL":return Number(c)<=Number(e)}},syntax:{js:[],py:["(%1 %2boolean_compare# %3)"]}},show:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png", +size:12}],events:{},def:{params:[null],type:"show"},"class":"visibility",isNotFor:[],func:function(b,a){b.setVisible(!0);return a.callReturn()},syntax:{js:[],py:["Entry.show()"]}},hide:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"hide"},"class":"visibility",isNotFor:[],func:function(b,a){b.setVisible(!1);return a.callReturn()},syntax:{js:[],py:["Entry.hide()"]}},dialog_time:{color:"#EC4466",skeleton:"basic", +statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Dropdown",options:[[Lang.Blocks.speak,"speak"]],value:"speak",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_LOOKS},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"text",params:[Lang.Blocks.block_hi]},{type:"number",params:["4"]},null,null],type:"dialog_time"},paramsKeyMap:{VALUE:0,SECOND:1,OPTION:2},"class":"say",isNotFor:["textBox"],func:function(b,a){if(!a.isStart){var d= +a.getNumberValue("SECOND",a),c=a.getStringValue("VALUE",a),e=a.getField("OPTION",a);a.isStart=!0;a.timeFlag=1;c||"number"==typeof c||(c=" ");c=Entry.convertToRoundedDecimals(c,3);new Entry.Dialog(b,c,e);b.syncDialogVisible(b.getVisible());setTimeout(function(){a.timeFlag=0},1E3*d)}if(0==a.timeFlag)return delete a.timeFlag,delete a.isStart,b.dialog&&b.dialog.remove(),a.callReturn();b.dialog||(c=a.getStringValue("VALUE",a),e=a.getField("OPTION",a),c||"number"==typeof c||(c=" "),c=Entry.convertToRoundedDecimals(c, +3),new Entry.Dialog(b,c,e),b.syncDialogVisible(b.getVisible()));return a},syntax:{js:[],py:["Entry.print_for_seconds(%1, %2, %3)"]}},dialog:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Dropdown",options:[[Lang.Blocks.speak,"speak"]],value:"speak",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_LOOKS},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"text",params:[Lang.Blocks.block_hi]},null,null],type:"dialog"}, +paramsKeyMap:{VALUE:0,OPTION:1},"class":"say",isNotFor:["textBox"],func:function(b,a){var d=a.getStringValue("VALUE",a);d||"number"==typeof d||(d=" ");var c=a.getField("OPTION",a),d=Entry.convertToRoundedDecimals(d,3);new Entry.Dialog(b,d,c);b.syncDialogVisible(b.getVisible());return a.callReturn()},syntax:{js:[],py:["Entry.print(%1)"]}},remove_dialog:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"remove_dialog"}, +"class":"say",isNotFor:["textBox"],func:function(b,a){b.dialog&&b.dialog.remove();return a.callReturn()},syntax:{js:[],py:["Entry.print_remove()"]}},change_to_nth_shape:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"pictures",fontSize:11},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,null],type:"change_to_nth_shape"},paramsKeyMap:{VALUE:0},"class":"shape",isNotFor:[],func:function(b,a){var d=a.getField("VALUE", +a),d=b.parent.getPicture(d);b.setImage(d);return a.callReturn()},syntax:{js:[],py:[""]}},change_to_next_shape:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.LOOKS_change_shape_next,"next"],[Lang.Blocks.LOOKS_change_shape_prev,"prev"]],value:"next",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_LOOKS},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,null],type:"change_to_next_shape"},paramsKeyMap:{DRIECTION:0},"class":"shape", +isNotFor:["textBox"],func:function(b,a){var d;d="prev"!==a.getStringField("DRIECTION")?b.parent.getNextPicture(b.picture.id):b.parent.getPrevPicture(b.picture.id);b.setImage(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_shape_of(%1)"]}},set_effect_volume:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.color,"color"],[Lang.Blocks.brightness,"brightness"],[Lang.Blocks.opacity,"opacity"]],value:"color",fontSize:11},{type:"Block",accept:"string"}, +{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,{type:"number",params:["10"]},null],type:"set_effect_volume"},paramsKeyMap:{EFFECT:0,VALUE:1},"class":"effect",isNotFor:["textBox"],func:function(b,a){var d=a.getField("EFFECT",a),c=a.getNumberValue("VALUE",a);"color"==d?b.effect.hue=c+b.effect.hue:"lens"!=d&&"swriling"!=d&&"pixel"!=d&&"mosaic"!=d&&("brightness"==d?b.effect.brightness=c+b.effect.brightness:"blur"!=d&&"opacity"==d&&(b.effect.alpha+=c/100));b.applyFilter(!0); +return a.callReturn()},syntax:{js:[],py:["Entry.add_effect(%1, %2)"]}},set_effect:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.color,"color"],[Lang.Blocks.brightness,"brightness"],[Lang.Blocks.opacity,"opacity"]],value:"color",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,{type:"number",params:["100"]},null],type:"set_effect"},paramsKeyMap:{EFFECT:0,VALUE:1},"class":"effect", +isNotFor:["textBox"],func:function(b,a){var d=a.getField("EFFECT",a),c=a.getNumberValue("VALUE",a);"color"==d?b.effect.hue=c:"lens"!=d&&"swriling"!=d&&"pixel"!=d&&"mosaic"!=d&&("brightness"==d?b.effect.brightness=c:"blur"!=d&&"opacity"==d&&(b.effect.alpha=c/100));b.applyFilter(!0);return a.callReturn()},syntax:{js:[],py:["Entry.set_effect(%1, %2)"]}},erase_all_effects:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null], +type:"erase_all_effects"},"class":"effect",isNotFor:["textBox"],func:function(b,a){b.resetFilter();return a.callReturn()},syntax:{js:[],py:["Entry.clear_effect()"]}},change_scale_percent:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"change_scale_percent"},paramsKeyMap:{VALUE:0},"class":"scale",isNotFor:[],func:function(b,a){var d=(a.getNumberValue("VALUE", +a)+100)/100;b.setScaleX(b.getScaleX()*d);b.setScaleY(b.getScaleY()*d);return a.callReturn()},syntax:{js:[],py:[""]}},set_scale_percent:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"number",params:["100"]},null],type:"set_scale_percent"},paramsKeyMap:{VALUE:0},"class":"scale",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a)/100,c=b.snapshot_;b.setScaleX(d* +c.scaleX);b.setScaleY(d*c.scaleY);return a.callReturn()},syntax:{js:[],py:[""]}},change_scale_size:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"change_scale_size"},paramsKeyMap:{VALUE:0},"class":"scale",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setSize(b.getSize()+d);return a.callReturn()},syntax:{js:[],py:["Entry.add_size(%1)"]}}, +set_scale_size:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[{type:"number",params:["100"]},null],type:"set_scale_size"},paramsKeyMap:{VALUE:0},"class":"scale",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setSize(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_size(%1)"]}},flip_y:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator", +img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"flip_y"},"class":"flip",isNotFor:[],func:function(b,a){b.setScaleX(-1*b.getScaleX());return a.callReturn()},syntax:{js:[],py:["Entry.flip_vertical()"]}},flip_x:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null],type:"flip_x"},"class":"flip",isNotFor:[],func:function(b,a){b.setScaleY(-1*b.getScaleY());return a.callReturn()},syntax:{js:[], +py:["Entry.flip_horizontal()"]}},set_object_order:{color:"#EC4466",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"objectSequence",fontSize:11},{type:"Indicator",img:"block_icon/looks_03.png",size:12}],events:{},def:{params:[null,null],type:"set_object_order"},paramsKeyMap:{VALUE:0},"class":"z-index",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c=Entry.container.getCurrentObjects().indexOf(b.parent);if(-1f)throw Error("object is not available for current scene");switch(c){case "FRONT":d=0;break;case "FORWARD":d=Math.max(0,f-1);break;case "BACKWARD":d=Math.min(e,f+1);break;case "BACK":d=e}Entry.container.moveElementByBlock(f,d);return a.callReturn()},syntax:{js:[],py:["Entry.set_layer(%1)"]}},move_direction:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator", +img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"move_direction"},paramsKeyMap:{VALUE:0},"class":"walk",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setX(b.getX()+d*Math.cos((b.getRotation()+b.getDirection()-90)/180*Math.PI));b.setY(b.getY()-d*Math.sin((b.getRotation()+b.getDirection()-90)/180*Math.PI));b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.move(%1)"]}}, +move_x:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"move_x"},paramsKeyMap:{VALUE:0},"class":"move_relative",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setX(b.getX()+d);b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.set_x(%1)"]}},move_y:{color:"#A751E3", +skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"move_y"},paramsKeyMap:{VALUE:0},"class":"move_relative",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setY(b.getY()+d);b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.set_y(%1)"]}},locate_xy_time:{color:"#A751E3",skeleton:"basic", +statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["2"]},{type:"number",params:["10"]},{type:"number",params:["10"]},null],type:"locate_xy_time"},paramsKeyMap:{VALUE1:0,VALUE2:1,VALUE3:2},"class":"move_absolute",isNotFor:[],func:function(b,a){function d(){var d=a.x-b.getX(),c=a.y-b.getY(),d=d/a.frameCount,c=c/a.frameCount;b.setX(b.getX()+ +d);b.setY(b.getY()+c);a.frameCount--;b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY())}if(!a.isStart){var c;c=a.getNumberValue("VALUE1",a);a.isStart=!0;a.frameCount=Math.max(Math.floor(c*Entry.FPS),1);a.x=a.getNumberValue("VALUE2",a);a.y=a.getNumberValue("VALUE3",a);1==a.frameCount&&d()}if(0!=a.frameCount)return d(),a;delete a.isStart;delete a.frameCount;return a.callReturn()},syntax:{js:[],py:["Entry.set_xy_for_seconds(%1, %2, %3)"]}},rotate_by_angle:{color:"#A751E3",skeleton:"basic", +statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["90"]},null],type:"rotate_by_angle"},paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setRotation(b.getRotation()+d);return a.callReturn()},syntax:{js:[],py:[""]}},rotate_by_angle_dropdown:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[["45","45"],["90", +"90"],["135","135"],["180","180"]],value:"45",fontSize:11},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:["45",null],type:"rotate_by_angle_dropdown"},paramsKeyMap:{VALUE:0},"class":"ebs",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a);b.setRotation(b.getRotation()+Number(d));return a.callReturn()},syntax:{js:[],py:[""]}},see_angle:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png", +size:12}],events:{},def:{params:[{type:"number",params:["90"]},null],type:"see_angle"},paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setDirection(d);return a.callReturn()},syntax:{js:[],py:[""]}},see_direction:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"sprites",fontSize:11},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null,null]},paramsKeyMap:{VALUE:0}, +func:function(b,a){var d=a.getField("VALUE",a),c=Entry.container.getEntity(d),d=c.getX()-b.getX(),c=c.getY()-b.getY();0<=d?b.setRotation(Math.atan(c/d)/Math.PI*180+90):b.setRotation(Math.atan(c/d)/Math.PI*180+270);return a.callReturn()},syntax:{js:[],py:[""]}},locate_xy:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["0"]},{type:"number", +params:["0"]},null],type:"locate_xy"},paramsKeyMap:{VALUE1:0,VALUE2:1},"class":"move_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE1",a),c=a.getNumberValue("VALUE2",a);b.setX(d);b.setY(c);b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.set_xy(%1, %2)"]}},locate_x:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{}, +def:{params:[{type:"number",params:["10"]},null],type:"locate_x"},paramsKeyMap:{VALUE:0},"class":"move_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setX(d);b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.move_x(%1)"]}},locate_y:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number", +params:["10"]},null],type:"locate_y"},paramsKeyMap:{VALUE:0},"class":"move_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setY(d);b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.move_y(%1)"]}},locate:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"spritesWithMouse",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_MOVING},{type:"Indicator",img:"block_icon/moving_03.png", +size:12}],events:{},def:{params:[null,null],type:"locate"},paramsKeyMap:{VALUE:0},"class":"move_absolute",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c;"mouse"==d?(d=Entry.stage.mouseCoordinate.x,c=Entry.stage.mouseCoordinate.y):(c=Entry.container.getEntity(d),d=c.getX(),c=c.getY());b.setX(Number(d));b.setY(Number(c));b.brush&&!b.brush.stop&&b.brush.lineTo(d,-1*c);return a.callReturn()},syntax:{js:[],py:["Entry.set_location(%1)"]}},move_xy_time:{color:"#A751E3",skeleton:"basic",statements:[], +params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["2"]},{type:"number",params:["10"]},{type:"number",params:["10"]},null],type:"move_xy_time"},paramsKeyMap:{VALUE1:0,VALUE2:1,VALUE3:2},"class":"move_relative",isNotFor:[],func:function(b,a){function d(){b.setX(b.getX()+a.dX);b.setY(b.getY()+a.dY);a.frameCount--;b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(), +-1*b.getY())}if(!a.isStart){var c;c=a.getNumberValue("VALUE1",a);var e=a.getNumberValue("VALUE2",a),f=a.getNumberValue("VALUE3",a);a.isStart=!0;a.frameCount=Math.max(Math.floor(c*Entry.FPS),1);a.dX=e/a.frameCount;a.dY=f/a.frameCount;1==a.frameCount&&d()}if(0!=a.frameCount)return d(),a;delete a.isStart;delete a.frameCount;return a.callReturn()},syntax:{js:[],py:["Entry.add_xy_for_seconds(%1, %2, %3)"]}},rotate_by_angle_time:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"}, +{type:"Angle"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["2"]},null,null],type:"rotate_by_angle_time"},paramsKeyMap:{VALUE:1},"class":"rotate",isNotFor:[],func:function(b,a){if(!a.isStart){var d;d=a.getNumberValue("VALUE",a);var c=a.getNumberField("VALUE",a);a.isStart=!0;a.frameCount=Math.floor(d*Entry.FPS);a.dAngle=c/a.frameCount}if(0!=a.frameCount)return b.setRotation(b.getRotation()+a.dAngle),a.frameCount--,a;delete a.isStart;delete a.frameCount; +return a.callReturn()},syntax:{js:[],py:[""]}},bounce_wall:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null],type:"bounce_wall"},"class":"walk",isNotFor:[],func:function(b,a){var d=b.parent.getRotateMethod(),c="free"==d?(b.getRotation()+b.getDirection()).mod(360):b.getDirection(),e=Entry.Utils.COLLISION.NONE;if(90>c&&0<=c||360>c&&270<=c){var e=b.collision==Entry.Utils.COLLISION.UP,f=ndgmr.checkPixelCollision(Entry.stage.wall.up, +b.object,0,!1);!f&&e&&(b.collision=Entry.Utils.COLLISION.NONE);f&&e&&(f=!1);f?("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()+180):b.setDirection(-b.getDirection()+180),b.collision=Entry.Utils.COLLISION.UP):(e=b.collision==Entry.Utils.COLLISION.DOWN,f=ndgmr.checkPixelCollision(Entry.stage.wall.down,b.object,0,!1),!f&&e&&(b.collision=Entry.Utils.COLLISION.NONE),f&&e&&(f=!1),f&&("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()+180):b.setDirection(-b.getDirection()+180),b.collision= +Entry.Utils.COLLISION.DOWN))}else 270>c&&90<=c&&(e=b.collision==Entry.Utils.COLLISION.DOWN,f=ndgmr.checkPixelCollision(Entry.stage.wall.down,b.object,0,!1),!f&&e&&(b.collision=Entry.Utils.COLLISION.NONE),f&&e&&(f=!1),f?("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()+180):b.setDirection(-b.getDirection()+180),b.collision=Entry.Utils.COLLISION.DOWN):(e=b.collision==Entry.Utils.COLLISION.UP,f=ndgmr.checkPixelCollision(Entry.stage.wall.up,b.object,0,!1),!f&&e&&(b.collision=Entry.Utils.COLLISION.NONE), +f&&e&&(f=!1),f&&("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()+180):b.setDirection(-b.getDirection()+180),b.collision=Entry.Utils.COLLISION.UP)));360>c&&180<=c?(e=b.collision==Entry.Utils.COLLISION.LEFT,c=ndgmr.checkPixelCollision(Entry.stage.wall.left,b.object,0,!1),!c&&e&&(b.collision=Entry.Utils.COLLISION.NONE),c&&e&&(c=!1),c?("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()):b.setDirection(-b.getDirection()+360),b.collision=Entry.Utils.COLLISION.LEFT):(e=b.collision== +Entry.Utils.COLLISION.RIGHT,c=ndgmr.checkPixelCollision(Entry.stage.wall.right,b.object,0,!1),!c&&e&&(b.collision=Entry.Utils.COLLISION.NONE),c&&e&&(c=!1),c&&("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()):b.setDirection(-b.getDirection()+360),b.collision=Entry.Utils.COLLISION.RIGHT))):180>c&&0<=c&&(e=b.collision==Entry.Utils.COLLISION.RIGHT,c=ndgmr.checkPixelCollision(Entry.stage.wall.right,b.object,0,!1),!c&&e&&(b.collision=Entry.Utils.COLLISION.NONE),c&&e&&(c=!1),c?("free"==d?b.setRotation(-b.getRotation()- +2*b.getDirection()):b.setDirection(-b.getDirection()+360),b.collision=Entry.Utils.COLLISION.RIGHT):(e=b.collision==Entry.Utils.COLLISION.LEFT,c=ndgmr.checkPixelCollision(Entry.stage.wall.left,b.object,0,!1),!c&&e&&(b.collision=Entry.Utils.COLLISION.NONE),c&&e&&(c=!1),c&&("free"==d?b.setRotation(-b.getRotation()-2*b.getDirection()):b.setDirection(-b.getDirection()+360),b.collision=Entry.Utils.COLLISION.LEFT)));return a.callReturn()},syntax:{js:[],py:["Entry.bounce_wall()"]}},flip_arrow_horizontal:{color:"#A751E3", +skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null]},func:function(b,a){b.setDirection(b.getDirection()+180);return a.callReturn()},syntax:{js:[],py:[""]}},flip_arrow_vertical:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null]},func:function(b,a){b.setDirection(b.getDirection()+180);return a.callReturn()},syntax:{js:[],py:[""]}},see_angle_object:{color:"#A751E3", +skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"spritesWithMouse",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_MOVING},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[null,null],type:"see_angle_object"},paramsKeyMap:{VALUE:0},"class":"rotate_absolute",isNotFor:[],func:function(b,a){var d=a.getField("VALUE",a),c=b.getX(),e=b.getY();if(b.parent.id==d)return a.callReturn();"mouse"==d?(d=Entry.stage.mouseCoordinate.y,c=Entry.stage.mouseCoordinate.x- +c,e=d-e):(d=Entry.container.getEntity(d),c=d.getX()-c,e=d.getY()-e);e=0===c&&0===e?b.getDirection()+b.getRotation():0<=c?-Math.atan(e/c)/Math.PI*180+90:-Math.atan(e/c)/Math.PI*180+270;c=b.getDirection()+b.getRotation();b.setRotation(b.getRotation()+e-c);return a.callReturn()},syntax:{js:[],py:["Entry.look_at_object(%1)"]}},see_angle_direction:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{}, +def:{params:[{type:"number",params:["90"]},null],type:"see_angle_direction"},paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a),c=b.getDirection()+b.getRotation();b.setRotation(b.getRotation()+d-c);return a.callReturn()},syntax:{js:[],py:[""]}},rotate_direction:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"number",params:["90"]}, +null],type:"rotate_direction"},paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setDirection(d+b.getDirection());return a.callReturn()},syntax:{js:[],py:[""]}},locate_object_time:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"DropdownDynamic",value:null,menuName:"spritesWithMouse",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_MOVING},{type:"Indicator",img:"block_icon/moving_03.png",size:12}], +events:{},def:{params:[{type:"number",params:["2"]},null,null],type:"locate_object_time"},paramsKeyMap:{VALUE:0,TARGET:1},"class":"move_absolute",isNotFor:[],func:function(b,a){if(!a.isStart){var d,c,e;c=a.getField("TARGET",a);d=a.getNumberValue("VALUE",a);d=Math.floor(d*Entry.FPS);e=Entry.stage.mouseCoordinate;if(0!=d)"mouse"==c?(c=e.x-b.getX(),e=e.y-b.getY()):(e=Entry.container.getEntity(c),c=e.getX()-b.getX(),e=e.getY()-b.getY()),a.isStart=!0,a.frameCount=d,a.dX=c/a.frameCount,a.dY=e/a.frameCount; +else return"mouse"==c?(c=Number(e.x),e=Number(e.y)):(e=Entry.container.getEntity(c),c=e.getX(),e=e.getY()),b.setX(c),b.setY(e),b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY()),a.callReturn()}if(0!=a.frameCount)return b.setX(b.getX()+a.dX),b.setY(b.getY()+a.dY),a.frameCount--,b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY()),a;delete a.isStart;delete a.frameCount;return a.callReturn()},syntax:{js:[],py:["Entry.set_location_for_seconds(%1, %2)"]}},rotate_absolute:{color:"#A751E3", +skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"},null],type:"rotate_absolute"},paramsKeyMap:{VALUE:0},"class":"rotate_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setRotation(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_rotation(%1)"]}},rotate_relative:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator", +img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"},null],type:"rotate_relative"},paramsKeyMap:{VALUE:0},"class":"rotate",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setRotation(d+b.getRotation());return a.callReturn()},syntax:{js:[],py:["Entry.add_rotation(%1)"]}},direction_absolute:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"}, +null],type:"direction_absolute"},paramsKeyMap:{VALUE:0},"class":"rotate_absolute",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setDirection(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_direction(%1)"]}},direction_relative:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"},null],type:"direction_relative"},paramsKeyMap:{VALUE:0},"class":"rotate", +isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a);b.setDirection(d+b.getDirection());return a.callReturn()},syntax:{js:[],py:["Entry.add_direction(%1)"]}},move_to_angle:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"angle"},{type:"number",params:["10"]},null],type:"move_to_angle"},paramsKeyMap:{ANGLE:0,VALUE:1},"class":"move_rotate", +isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a),c=a.getNumberValue("ANGLE",a);b.setX(b.getX()+d*Math.cos((c-90)/180*Math.PI));b.setY(b.getY()-d*Math.sin((c-90)/180*Math.PI));b.brush&&!b.brush.stop&&b.brush.lineTo(b.getX(),-1*b.getY());return a.callReturn()},syntax:{js:[],py:["Entry.move_degree(%1, %2)"]}},rotate_by_time:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png", +size:12}],events:{},def:{params:[{type:"number",params:["2"]},{type:"angle"},null],type:"rotate_by_time"},paramsKeyMap:{VALUE:0,ANGLE:1},"class":"rotate",isNotFor:[],func:function(b,a){function d(){b.setRotation(b.getRotation()+a.dAngle);a.frameCount--}if(!a.isStart){var c;c=a.getNumberValue("VALUE",a);var e=a.getNumberValue("ANGLE",a);a.isStart=!0;a.frameCount=Math.max(Math.floor(c*Entry.FPS),1);a.dAngle=e/a.frameCount;1==a.frameCount&&d()}if(0!=a.frameCount)return d(),a;delete a.isStart;delete a.frameCount; +return a.callReturn()},syntax:{js:[],py:["Entry.add_rotation_for_seconds(%1, %2)"]}},direction_relative_duration:{color:"#A751E3",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/moving_03.png",size:12}],events:{},def:{params:[{type:"text",params:["2"]},{type:"angle"},null],type:"direction_relative_duration"},paramsKeyMap:{DURATION:0,AMOUNT:1},"class":"rotate",isNotFor:[],func:function(b,a){function d(){b.setDirection(b.getDirection()+ +a.dDirection);a.frameCount--}if(!a.isStart){var c;c=a.getNumberValue("DURATION",a);var e=a.getNumberValue("AMOUNT",a);a.isStart=!0;a.frameCount=Math.max(Math.floor(c*Entry.FPS),1);a.dDirection=e/a.frameCount;1==a.frameCount&&d()}if(0!=a.frameCount)return d(),a;delete a.isStart;delete a.frameCount;delete a.dDirection;return a.callReturn()},syntax:{js:[],py:["Entry.add_direction_for_seconds(%1, %2)"]}},neobot_sensor_value:{color:"#00979D",skeleton:"basic_string_field",fontColor:"#fff",statements:[], +template:"%1 \uac12",params:[{type:"Dropdown",options:[["1\ubc88 \ud3ec\ud2b8","IN1"],["2\ubc88 \ud3ec\ud2b8","IN2"],["3\ubc88 \ud3ec\ud2b8","IN3"],["\ub9ac\ubaa8\ucee8","IR"],["\ubc30\ud130\ub9ac","BAT"]],value:"IN1",fontSize:11}],events:{},def:{params:[null],type:"neobot_sensor_value"},paramsKeyMap:{PORT:0},"class":"neobot_value",isNotFor:["neobot"],func:function(b,a){var d=a.getStringField("PORT");return Entry.hw.portData[d]},syntax:{js:[],py:["Neobot.sensor_value(%1)"]}},neobot_sensor_convert_scale:{color:"#00979D", +skeleton:"basic_string_field",fontColor:"#fff",statements:[],template:"%1 \uac12\uc758 \ubc94\uc704\ub97c %2 ~ %3 \uc5d0\uc11c %4 ~ %5 (\uc73c)\ub85c \ubcc0\ud658",params:[{type:"Dropdown",options:[["1\ubc88 \ud3ec\ud2b8","IN1"],["2\ubc88 \ud3ec\ud2b8","IN2"],["3\ubc88 \ud3ec\ud2b8","IN3"],["\ub9ac\ubaa8\ucee8","IR"],["\ubc30\ud130\ub9ac","BAT"]],value:"IN1",fontSize:11},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"}],events:{}, +def:{params:[null,{type:"number",params:["0"]},{type:"number",params:["255"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"neobot_sensor_convert_scale"},paramsKeyMap:{PORT:0,OMIN:1,OMAX:2,MIN:3,MAX:4},"class":"neobot_value",isNotFor:["neobot"],func:function(b,a){var d=a.getStringField("PORT"),d=Entry.hw.portData[d],c=a.getNumberValue("OMIN",a),e=a.getNumberValue("OMAX",a),f=a.getNumberValue("MIN",a),g=a.getNumberValue("MAX",a);if(c>e)var h=c,c=e,e=h;f>g&&(h=f,f=g,g=h);d=(g-f)/ +(e-c)*(d-c);d+=f;d=Math.min(g,d);d=Math.max(f,d);return Math.round(d)}},neobot_left_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc67c\ucabd \ubaa8\ud130\ub97c %1 %2 \uc758 \uc18d\ub3c4\ub85c \ud68c\uc804 %3",params:[{type:"Dropdown",options:[["\uc55e\uc73c\ub85c","16"],["\ub4a4\ub85c","32"]],value:"16",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"], +["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],value:"0",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,"15",null],type:"neobot_left_motor"},paramsKeyMap:{DIRECTION:0,SPEED:1},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){var d=a.getNumberField("SPEED"),c=a.getNumberField("DIRECTION");Entry.hw.sendQueue.DCL=d+c;return a.callReturn()},syntax:{js:[],py:["Neobot.turn_left(%1, %2)"]}}, +neobot_stop_left_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc67c\ucabd \ubaa8\ud130\ub97c \uc815\uc9c0 %1",params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"neobot_stop_left_motor"},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){Entry.hw.sendQueue.DCL=0;return a.callReturn()},syntax:{js:[],py:["Neobot.stop_left()"]}},neobot_right_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc624\ub978\ucabd \ubaa8\ud130\ub97c %1 %2 \uc758 \uc18d\ub3c4\ub85c \ud68c\uc804 %3", params:[{type:"Dropdown",options:[["\uc55e\uc73c\ub85c","16"],["\ub4a4\ub85c","32"]],value:"16",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],value:"0",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,"15", -null],type:"neobot_left_motor"},paramsKeyMap:{DIRECTION:0,SPEED:1},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){var d=a.getNumberField("SPEED"),c=a.getNumberField("DIRECTION");Entry.hw.sendQueue.DCL=d+c;return a.callReturn()},syntax:{js:[],py:["Neobot.turn_left(%1, %2)"]}},neobot_stop_left_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc67c\ucabd \ubaa8\ud130\ub97c \uc815\uc9c0 %1",params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null], -type:"neobot_stop_left_motor"},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){Entry.hw.sendQueue.DCL=0;return a.callReturn()},syntax:{js:[],py:["Neobot.stop_left()"]}},neobot_right_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc624\ub978\ucabd \ubaa8\ud130\ub97c %1 %2 \uc758 \uc18d\ub3c4\ub85c \ud68c\uc804 %3",params:[{type:"Dropdown",options:[["\uc55e\uc73c\ub85c","16"],["\ub4a4\ub85c","32"]],value:"16",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Dropdown", -options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],value:"0",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,"15",null],type:"neobot_right_motor"},paramsKeyMap:{DIRECTION:0,SPEED:1},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){var d=a.getNumberField("SPEED"),c= -a.getNumberField("DIRECTION");Entry.hw.sendQueue.DCR=d+c;return a.callReturn()},syntax:{js:[],py:["Neobot.turn_right(%1, %2)"]}},neobot_stop_right_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc624\ub978\ucabd \ubaa8\ud130\ub97c \uc815\uc9c0 %1",params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"neobot_stop_right_motor"},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){Entry.hw.sendQueue.DCR=0;return a.callReturn()}, -syntax:{js:[],py:["Neobot.stop_right()"]}},neobot_all_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc591\ucabd \ubaa8\ud130\ub97c %1 %2\uc758 \uc18d\ub3c4\ub85c %3\ucd08 \ub3d9\uc548 \ud68c\uc804 %4",params:[{type:"Dropdown",options:[["\uc55e\uc73c\ub85c","1"],["\ub4a4\ub85c","2"],["\uc81c\uc790\ub9ac\uc5d0\uc11c \uc67c\ucabd \ub3cc\uae30","3"],["\uc81c\uc790\ub9ac\uc5d0\uc11c \uc624\ub978\ucabd \ub3cc\uae30","4"],["\uc67c\ucabd\uc73c\ub85c \ub3cc\uae30","5"],["\uc624\ub978\ucabd\uc73c\ub85c \ub3cc\uae30", -"6"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:["1","15",{type:"number",params:["0"]}],type:"neobot_all_motor"}, -paramsKeyMap:{DIRECTION:0,SPEED:1,DURATION:2},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){if(a.isStart){if(1==a.timeFlag)return a;delete a.timeFlag;delete a.isStart;Entry.hw.sendQueue.DCL=0;Entry.hw.sendQueue.DCR=0;Entry.engine.isContinue=!1;return a.callReturn()}var d=a.getNumberField("SPEED"),c=a.getNumberField("DIRECTION"),e=a.getNumberValue("DURATION");0>e&&(e=0);switch(c){case 1:Entry.hw.sendQueue.DCL=16+d;Entry.hw.sendQueue.DCR=16+d;break;case 2:Entry.hw.sendQueue.DCL=32+d; -Entry.hw.sendQueue.DCR=32+d;break;case 3:Entry.hw.sendQueue.DCL=32+d;Entry.hw.sendQueue.DCR=16+d;break;case 4:Entry.hw.sendQueue.DCL=16+d;Entry.hw.sendQueue.DCR=32+d;break;case 5:Entry.hw.sendQueue.DCL=0;Entry.hw.sendQueue.DCR=16+d;break;case 6:Entry.hw.sendQueue.DCL=16+d,Entry.hw.sendQueue.DCR=0}if(0===e)return a.callReturn();a.isStart=!0;a.timeFlag=1;setTimeout(function(){a.timeFlag=0},1E3*e);return a}},neobot_stop_all_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc591\ucabd \ubaa8\ud130\ub97c \uc815\uc9c0 %1", -params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"neobot_stop_all_motor"},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){Entry.hw.sendQueue.DCL=0;Entry.hw.sendQueue.DCR=0;return a.callReturn()},syntax:{js:[],py:["Neobot.run_motor(%1, %2, %3, %4)"]}},neobot_set_servo:{color:"#00979D",skeleton:"basic",statements:[],template:"%1 \ud3ec\ud2b8\uc758 \uc11c\ubcf4\ubaa8\ud130\ub97c %2 \ub3c4 \uc774\ub3d9 %3",params:[{type:"Dropdown",options:[["OUT1", -"1"],["OUT2","2"],["OUT3","3"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,null],type:"neobot_set_servo"},paramsKeyMap:{PORT:0,DEGREE:1},"class":"neobot_output",isNotFor:["neobot"],func:function(b,a){var d=a.getNumberField("PORT"),c=a.getNumberValue("DEGREE");0>c?c=0:180c?c=0:255d.count)throw d.count++,new Entry.Utils.AsyncError;d.isStart=!1;c=Entry.hw.portData[d.data_default_address]; -d.data_default_address=void 0;return c},syntax:{js:[],py:["Robotis.opencm70_cm_custom_value(%1, %2)"]}},robotis_openCM70_sensor_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.robotis_cm_sound_detected,"CM_SOUND_DETECTED"],[Lang.Blocks.robotis_cm_sound_detecting,"CM_SOUND_DETECTING"],[Lang.Blocks.robotis_cm_user_button,"CM_USER_BUTTON"]],value:"CM_SOUND_DETECTED",fontSize:11}],events:{},def:{params:[null],type:"robotis_openCM70_sensor_value"}, -paramsKeyMap:{SENSOR:0},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.executor.scope;if(!d.isStart){d.isStart=!0;d.count=0;var c=Entry.Robotis_openCM70.INSTRUCTION.READ,e=0,f=0,g=0,h=0,k=a.getStringField("SENSOR");"CM_SOUND_DETECTED"==k?(g=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[0],h=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[0],f=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[1]): -"CM_SOUND_DETECTING"==k?(g=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[0],h=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[0],f=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[1]):"CM_USER_BUTTON"==k&&(g=Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[0],h=Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[0],f=Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[1]); -g+=0*h;Entry.Robotis_carCont.setRobotisData([[c,e,f,0,h]]);Entry.Robotis_carCont.update();d.data_default_address=g;throw new Entry.Utils.AsyncError;}if(2>d.count)throw d.count++,new Entry.Utils.AsyncError;d.isStart=!1;c=Entry.hw.portData[d.data_default_address];d.data_default_address=void 0;return c},syntax:{js:[],py:["Robotis.opencm70_sensor_value(%1)"]}},robotis_openCM70_aux_sensor_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[["3", -"PORT_3"],["4","PORT_4"],["5","PORT_5"],["6","PORT_6"]],value:"PORT_3",fontSize:11},{type:"Dropdown",options:[[Lang.Blocks.robotis_aux_servo_position,"AUX_SERVO_POSITION"],[Lang.Blocks.robotis_aux_ir,"AUX_IR"],[Lang.Blocks.robotis_aux_touch,"AUX_TOUCH"],[Lang.Blocks.robotis_aux_brightness,"AUX_BRIGHTNESS"],[Lang.Blocks.robotis_aux_hydro_themo_humidity,"AUX_HYDRO_THEMO_HUMIDITY"],[Lang.Blocks.robotis_aux_hydro_themo_temper,"AUX_HYDRO_THEMO_TEMPER"],[Lang.Blocks.robotis_aux_temperature,"AUX_TEMPERATURE"], -[Lang.Blocks.robotis_aux_ultrasonic,"AUX_ULTRASONIC"],[Lang.Blocks.robotis_aux_magnetic,"AUX_MAGNETIC"],[Lang.Blocks.robotis_aux_motion_detection,"AUX_MOTION_DETECTION"],[Lang.Blocks.robotis_aux_color,"AUX_COLOR"],[Lang.Blocks.robotis_aux_custom,"AUX_CUSTOM"]],value:"AUX_SERVO_POSITION",fontSize:11}],events:{},def:{params:[null,null],type:"robotis_openCM70_aux_sensor_value"},paramsKeyMap:{PORT:0,SENSOR:1},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.executor.scope; -if(!d.isStart){d.isStart=!0;d.count=0;var c=Entry.Robotis_openCM70.INSTRUCTION.READ,e=0,f=0,g=0,h=a.getStringField("PORT"),k=a.getStringField("SENSOR"),l=0;"PORT_3"==h?l=2:"PORT_4"==h?l=3:"PORT_5"==h?l=4:"PORT_6"==h&&(l=5);"AUX_SERVO_POSITION"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_POSITION[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_POSITION[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_POSITION[1]):"AUX_IR"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_IR[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_IR[1], -e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_IR[1]):"AUX_TOUCH"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TOUCH[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TOUCH[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TOUCH[1]):"AUX_TEMPERATURE"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TEMPERATURE[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TEMPERATURE[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TEMPERATURE[1]):"AUX_BRIGHTNESS"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_BRIGHTNESS[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_BRIGHTNESS[1], -e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_BRIGHTNESS[1]):"AUX_HYDRO_THEMO_HUMIDITY"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_HUMIDITY[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_HUMIDITY[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_HUMIDITY[1]):"AUX_HYDRO_THEMO_TEMPER"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_TEMPER[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_TEMPER[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_TEMPER[1]): -"AUX_ULTRASONIC"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_ULTRASONIC[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_ULTRASONIC[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_ULTRASONIC[1]):"AUX_MAGNETIC"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MAGNETIC[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MAGNETIC[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MAGNETIC[1]):"AUX_MOTION_DETECTION"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTION_DETECTION[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTION_DETECTION[1], -e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTION_DETECTION[1]):"AUX_COLOR"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_COLOR[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_COLOR[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_COLOR[1]):"AUX_CUSTOM"==k&&(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[1]);f+=l*g;Entry.Robotis_carCont.setRobotisData([[c,f,e,0,g]]);Entry.Robotis_carCont.update(); -d.data_default_address=f;throw new Entry.Utils.AsyncError;}if(2>d.count)throw d.count++,new Entry.Utils.AsyncError;d.isStart=!1;c=Entry.hw.portData[d.data_default_address];d.data_default_address=void 0;return c},syntax:{js:[],py:["Robotis.opencm70_aux_sensor_value(%1, %2)"]}},robotis_openCM70_cm_buzzer_index:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.General.note_a+"(0)","0"],[Lang.General.note_a+"#(1)","1"],[Lang.General.note_b+"(2)","2"],[Lang.General.note_c+ -"(3)","3"],[Lang.General.note_c+"#(4)","4"],[Lang.General.note_d+"(5)","5"],[Lang.General.note_d+"#(6)","6"],[Lang.General.note_e+"(7)","7"],[Lang.General.note_f+"(8)","8"],[Lang.General.note_f+"#(9)","9"],[Lang.General.note_g+"(10)","10"],[Lang.General.note_g+"#(11)","11"],[Lang.General.note_a+"(12)","12"],[Lang.General.note_a+"#(13)","13"],[Lang.General.note_b+"(14)","14"],[Lang.General.note_c+"(15)","15"],[Lang.General.note_c+"#(16)","16"],[Lang.General.note_d+"(17)","17"],[Lang.General.note_d+ -"#(18)","18"],[Lang.General.note_e+"(19)","19"],[Lang.General.note_f+"(20)","20"],[Lang.General.note_f+"#(21)","21"],[Lang.General.note_g+"(22)","22"],[Lang.General.note_g+"#(23)","23"],[Lang.General.note_a+"(24)","24"],[Lang.General.note_a+"#(25)","25"],[Lang.General.note_b+"(26)","26"],[Lang.General.note_c+"(27)","27"],[Lang.General.note_c+"#(28)","28"],[Lang.General.note_d+"(29)","29"],[Lang.General.note_d+"#(30)","30"],[Lang.General.note_e+"(31)","31"],[Lang.General.note_f+"(32)","32"],[Lang.General.note_f+ -"#(33)","33"],[Lang.General.note_g+"(34)","34"],[Lang.General.note_g+"#(35)","35"],[Lang.General.note_a+"(36)","36"],[Lang.General.note_a+"#(37)","37"],[Lang.General.note_b+"(38)","38"],[Lang.General.note_c+"(39)","39"],[Lang.General.note_c+"#(40)","40"],[Lang.General.note_d+"(41)","41"],[Lang.General.note_d+"#(42)","42"],[Lang.General.note_e+"(43)","43"],[Lang.General.note_f+"(44)","44"],[Lang.General.note_f+"#(45)","45"],[Lang.General.note_g+"(46)","46"],[Lang.General.note_g+"#(47)","47"],[Lang.General.note_a+ -"(48)","48"],[Lang.General.note_a+"#(49)","49"],[Lang.General.note_b+"(50)","50"],[Lang.General.note_c+"(51)","51"]],value:"0",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"number",params:["1"]},null],type:"robotis_openCM70_cm_buzzer_index"},paramsKeyMap:{CM_BUZZER_INDEX:0,CM_BUZZER_TIME:1},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.getField("CM_BUZZER_INDEX",a), -c=a.getNumberValue("CM_BUZZER_TIME",a),e=Entry.Robotis_openCM70.INSTRUCTION.WRITE,f=0,g=0,h=0,k=0,l=0,f=Entry.Robotis_openCM70.CONTROL_TABLE.CM_BUZZER_TIME[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.CM_BUZZER_TIME[1],h=parseInt(10*c);50c&&(c=0);return Entry.Robotis_carCont.postCallReturn(a,[[e,f+(d-1)*g,g,c]],Entry.Robotis_openCM70.delay)},syntax:{js:[],py:["Robotis.opencm70_aux_servo_position(%1, %2)"]}},robotis_openCM70_aux_led_module:{color:"#00979D", -skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.robotis_common_port_3,"3"],[Lang.Blocks.robotis_common_port_4,"4"],[Lang.Blocks.robotis_common_port_5,"5"],[Lang.Blocks.robotis_common_port_6,"6"]],value:"3",fontSize:11},{type:"Dropdown",options:[[Lang.Blocks.robotis_cm_led_both+Lang.Blocks.robotis_common_off,"0"],[Lang.Blocks.robotis_cm_led_right+Lang.Blocks.robotis_common_on,"1"],[Lang.Blocks.robotis_cm_led_left+Lang.Blocks.robotis_common_on,"2"],[Lang.Blocks.robotis_cm_led_both+ -Lang.Blocks.robotis_common_on,"3"]],value:"0",fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,null],type:"robotis_openCM70_aux_led_module"},paramsKeyMap:{PORT:0,LED_MODULE:1},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.getField("PORT",a),c=a.getField("LED_MODULE",a),e=Entry.Robotis_openCM70.INSTRUCTION.WRITE,f=0,g=0,f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_LED_MODULE[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_LED_MODULE[1]; -return Entry.Robotis_carCont.postCallReturn(a,[[e,f+(d-1)*g,g,c]],Entry.Robotis_openCM70.delay)},syntax:{js:[],py:["Robotis.opencm70_aux_led_module(%1, %2)"]}},robotis_openCM70_aux_custom:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.robotis_common_port_3,"3"],[Lang.Blocks.robotis_common_port_4,"4"],[Lang.Blocks.robotis_common_port_5,"5"],[Lang.Blocks.robotis_common_port_6,"6"]],value:"3",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator", -img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"number",params:["0"]},null],type:"robotis_openCM70_aux_custom"},paramsKeyMap:{PORT:0,VALUE:1},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.getField("PORT",a),c=a.getNumberValue("VALUE"),e=Entry.Robotis_openCM70.INSTRUCTION.WRITE,f=0,g=0,f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[1];return Entry.Robotis_carCont.postCallReturn(a, -[[e,f+(d-1)*g,g,c]],Entry.Robotis_openCM70.delay)},syntax:{js:[],py:["Robotis.opencm70_aux_custom(%1, %2)"]}},robotis_openCM70_cm_custom:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"number",params:["0"]},{type:"number",params:["0"]},null],type:"robotis_openCM70_cm_custom"},paramsKeyMap:{ADDRESS:0,VALUE:1},"class":"robotis_openCM70_custom", -isNotFor:["robotis_openCM70"],func:function(b,a){var d=Entry.Robotis_openCM70.INSTRUCTION.WRITE,c=0,e=0,c=a.getNumberValue("ADDRESS"),e=a.getNumberValue("VALUE");return Entry.Robotis_carCont.postCallReturn(a,[[d,c,65535d&&(d=0);createjs.Sound.setVolume(d);return a.callReturn()},syntax:{js:[],py:["Entry.add_volume(%1)"]}},sound_volume_set:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"}, -{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"sound_volume_set"},paramsKeyMap:{VALUE:0},"class":"sound_volume",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a)/100;1d&&(d=0);createjs.Sound.setVolume(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_volume(%1)"]}},sound_silent_all:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/sound_03.png",size:12}], -events:{},def:{params:[null],type:"sound_silent_all"},"class":"sound_stop",isNotFor:[],func:function(b,a){createjs.Sound.stop();return a.callReturn()},syntax:{js:[],py:["Entry.stop_sound()"]}},get_sounds:{color:"#A4D01D",skeleton:"basic_string_field",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"sounds",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_SOUNDS}],events:{},def:{params:[null],type:"get_sounds"},paramsKeyMap:{VALUE:0},func:function(b,a){return a.getStringField("VALUE")}, -syntax:{js:[],py:["%1get_sounds#"]}},sound_something_with_block:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},null],type:"sound_something_with_block"},paramsKeyMap:{VALUE:0},"class":"sound_play",isNotFor:[],func:function(b,a){var d=a.getStringValue("VALUE",a);(d=b.parent.getSound(d))&&createjs.Sound.play(d.id);return a.callReturn()},syntax:{js:[],py:["Entry.play_sound(%1)"]}}, -sound_something_second_with_block:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds",id:"95dw"},{type:"number",params:["1"]},null],type:"sound_something_second_with_block"},paramsKeyMap:{VALUE:0,SECOND:1},"class":"sound_play",isNotFor:[],func:function(b,a){var d=a.getStringValue("VALUE",a),c=a.getNumberValue("SECOND",a);(d=b.parent.getSound(d))&& -createjs.Sound.play(d.id,{startTime:0,duration:1E3*c});return a.callReturn()},syntax:{js:[],py:["Entry.play_sound_for_seconds(%1, %2)"]}},sound_something_wait_with_block:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},null],type:"sound_something_wait_with_block"},paramsKeyMap:{VALUE:0},"class":"sound_wait",isNotFor:[],func:function(b,a){if(a.isPlay){if(1==a.playState)return a; -delete a.playState;delete a.isPlay;return a.callReturn()}a.isPlay=!0;a.playState=1;var d=a.getStringValue("VALUE",a);if(d=b.parent.getSound(d))createjs.Sound.play(d.id),setTimeout(function(){a.playState=0},1E3*d.duration);return a},syntax:{js:[],py:["Entry.play_sound_and_wait(%1)"]}},sound_something_second_wait_with_block:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{}, -def:{params:[{type:"get_sounds"},{type:"number",params:["1"]},null],type:"sound_something_second_wait_with_block"},paramsKeyMap:{VALUE:0,SECOND:1},"class":"sound_wait",isNotFor:[],func:function(b,a){if(a.isPlay){if(1==a.playState)return a;delete a.isPlay;delete a.playState;return a.callReturn()}a.isPlay=!0;a.playState=1;var d=a.getStringValue("VALUE",a);if(d=b.parent.getSound(d)){var c=createjs.Sound.play(d.id),d=a.getNumberValue("SECOND",a);setTimeout(function(){c.stop();a.playState=0},1E3*d);c.addEventListener("complete", -function(a){})}return a},syntax:{js:[],py:["Entry.play_sound_for_seconds_and_wait(%1, %2)"]}},sound_from_to:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},{type:"text",params:["1"]},{type:"text",params:["10"]},null],type:"sound_from_to"},paramsKeyMap:{VALUE:0,START:1,END:2},"class":"sound_play",isNotFor:[], -func:function(b,a){var d=a.getStringValue("VALUE",a);if(d=b.parent.getSound(d)){var c=1E3*a.getNumberValue("START",a),e=1E3*a.getNumberValue("END",a);createjs.Sound.play(d.id,{startTime:Math.min(c,e),duration:Math.max(c,e)-Math.min(c,e)})}return a.callReturn()},syntax:{js:[],py:["Entry.play_sound_from_to_seconds(%1, %2, %3)"]}},sound_from_to_and_wait:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"}, -{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},{type:"text",params:["1"]},{type:"text",params:["10"]},null],type:"sound_from_to_and_wait"},paramsKeyMap:{VALUE:0,START:1,END:2},"class":"sound_wait",isNotFor:[],func:function(b,a){if(a.isPlay){if(1==a.playState)return a;delete a.isPlay;delete a.playState;return a.callReturn()}a.isPlay=!0;a.playState=1;var d=a.getStringValue("VALUE",a);if(d=b.parent.getSound(d)){var c=1E3*a.getNumberValue("START", -a),e=1E3*a.getNumberValue("END",a),f=Math.min(c,e),c=Math.max(c,e)-f;createjs.Sound.play(d.id,{startTime:f,duration:c});setTimeout(function(){a.playState=0},c)}return a},syntax:{js:[],py:["Entry.play_sound_from_to_seconds_and_wait(%1, %2, %3)"]}},when_run_button_click:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_play.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null],type:"when_run_button_click"},"class":"event",isNotFor:[], -func:function(b,a){return a.callReturn()},event:"start",syntax:{js:[],py:["def entry_event_start():"]}},press_some_key:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_keyboard.png",size:17,position:{x:0,y:-2}},{type:"Dropdown",options:[["q","81"],["w","87"],["e","69"],["r","82"],["a","65"],["s","83"],["d","68"],["\uc704\ucabd \ud654\uc0b4\ud45c","38"],["\uc544\ub798\ucabd \ud654\uc0b4\ud45c","40"],["\uc67c\ucabd \ud654\uc0b4\ud45c","37"], -["\uc624\ub978\ucabd \ud654\uc0b4\ud45c","39"],["\uc5d4\ud130","13"],["\uc2a4\ud398\uc774\uc2a4","32"]],value:"81",fontSize:11},{type:"Indicator",img:"block_icon/start_03.png",size:12}],events:{},def:{params:[null,null,null]},paramsKeyMap:{VALUE:1},func:function(b,a){return a.callReturn()},syntax:{js:[],py:[""]}},when_some_key_pressed:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_keyboard.png",size:17,position:{x:0,y:-2}},{type:"Keyboard", -value:"81"}],events:{},def:{params:[null,"81"],type:"when_some_key_pressed"},paramsKeyMap:{VALUE:1},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"keyPress",syntax:{js:[],py:["def entry_event_key(%2):"]}},mouse_clicked:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_mouse.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null],type:"mouse_clicked"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()}, -event:"mouse_clicked",syntax:{js:[],py:["def entry_event_mouse_down():"]}},mouse_click_cancled:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_mouse.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null],type:"mouse_click_cancled"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"mouse_click_cancled",syntax:{js:[],py:["def entry_event_mouse_up():"]}},when_object_click:{color:"#3BBD70",skeleton:"basic_event", -statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_mouse.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null],type:"when_object_click"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"when_object_click",syntax:{js:[],py:["def entry_event_object_down():"]}},when_object_click_canceled:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_mouse.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null], -type:"when_object_click_canceled"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"when_object_click_canceled",syntax:{js:[],py:["def entry_event_object_up():"]}},when_some_key_click:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_keyboard.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null]},func:function(b,a){return a.callReturn()},event:"keyPress",syntax:{js:[],py:["Entry.on_key_press_down(%1)"]}}, -when_message_cast:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_signal.png",size:17,position:{x:0,y:-2}},{type:"DropdownDynamic",value:null,menuName:"messages",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_START}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_messageRefs",b)}],viewDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_messageRefs",b)}]},def:{params:[null,null],type:"when_message_cast"}, -paramsKeyMap:{VALUE:1},"class":"message",isNotFor:["message"],func:function(b,a){return a.callReturn()},event:"when_message_cast",syntax:{js:[],py:["def entry_event_signal(%2):"]}},message_cast:{color:"#3BBD70",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"messages",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_START},{type:"Indicator",img:"block_icon/start_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_messageRefs", -b)}],viewDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_messageRefs",b)}]},def:{params:[null,null],type:"message_cast"},paramsKeyMap:{VALUE:0},"class":"message",isNotFor:["message"],func:function(b,a){var d=a.getField("VALUE",a),c=Entry.isExist(d,"id",Entry.variableContainer.messages_);if("null"==d||!c)throw Error("value can not be null or undefined");Entry.engine.raiseMessage(d)},syntax:{js:[],py:["Entry.send_signal(%1)"]}},message_cast_wait:{color:"#3BBD70",skeleton:"basic", -statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"messages",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_START},{type:"Indicator",img:"block_icon/start_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_messageRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_messageRefs",b)}]},def:{params:[null,null],type:"message_cast_wait"},paramsKeyMap:{VALUE:0},"class":"message",isNotFor:["message"],func:function(b,a){if(a.runningScript){for(var d= -a.runningScript,c=d.length,e=0;ed.array_.length)throw Error("can not remove value from array"); -d.array_.splice(c-1,1);d.updateView();return a.callReturn()},syntax:{js:[],py:["%2.pop(%1)"]}},insert_value_to_list:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a= -Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[{type:"text",params:["10"]},null,{type:"text",params:["1"]},null],type:"insert_value_to_list"},paramsKeyMap:{DATA:0,LIST:1,INDEX:2},"class":"list",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a),c=a.getValue("DATA",a),e=a.getValue("INDEX",a),d=Entry.variableContainer.getList(d,b);if(!d.array_||isNaN(e)||0==e||e>d.array_.length+1)throw Error("can not insert value to array");d.array_.splice(e-1, -0,{data:c});d.updateView();return a.callReturn()},syntax:{js:[],py:["%2.insert(%3, %1)"]}},change_value_list_index:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a= -Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,{type:"text",params:["1"]},{type:"text",params:["10"]},null],type:"change_value_list_index"},paramsKeyMap:{LIST:0,INDEX:1,DATA:2},"class":"list",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a),c=a.getValue("DATA",a),e=a.getValue("INDEX",a),d=Entry.variableContainer.getList(d,b);if(!d.array_||isNaN(e)||e>d.array_.length)throw Error("can not insert value to array");d.array_[e-1].data=c;d.updateView(); -return a.callReturn()},syntax:{js:[],py:["%1[%2] = %3"]}},value_of_index_from_list:{color:"#E457DC",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.VARIABLE_value_of_index_from_list_1,color:"white"},{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Text",text:Lang.Blocks.VARIABLE_value_of_index_from_list_2,color:"white"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.VARIABLE_value_of_index_from_list_3, -color:"white"}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null,null,{type:"number",params:["1"]}],type:"value_of_index_from_list"},paramsKeyMap:{LIST:1,INDEX:3},"class":"list_element",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a),c=a.getValue("INDEX",a),d=Entry.variableContainer.getList(d,b),c=Entry.getListRealIndex(c, -d);if(!d.array_||isNaN(c)||c>d.array_.length)throw Error("can not insert value to array");return d.array_[c-1].data},syntax:{js:[],py:["%2[%4]"]}},length_of_list:{color:"#E457DC",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.VARIABLE_length_of_list_1,color:"white"},{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Text",text:Lang.Blocks.VARIABLE_length_of_list_2,color:"white"}],events:{dataAdd:[function(b){var a= -Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null,null],type:"length_of_list"},paramsKeyMap:{LIST:1},"class":"list",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a);return Entry.variableContainer.getList(d,b).array_.length},syntax:{js:[],py:["len(%2)"]}},show_list:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null, -menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null],type:"show_list"},paramsKeyMap:{LIST:0},"class":"list_visibility",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a);Entry.variableContainer.getList(d).setVisible(!0); -return a.callReturn()},syntax:{js:[],py:["Entry.show_list(%1)"]}},hide_list:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null, -null],type:"hide_list"},paramsKeyMap:{LIST:0},"class":"list_visibility",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a);Entry.variableContainer.getList(d).setVisible(!1);return a.callReturn()},syntax:{js:[],py:["Entry.hide_list(%1)"]}},options_for_list:{color:"#E457DC",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[["\uccab\ubc88\uc9f8","FIRST"],["\ub9c8\uc9c0\ub9c9","LAST"],["\ubb34\uc791\uc704","RANDOM"]],value:"FIRST",fontSize:11}], -events:{},def:{params:[null]},paramsKeyMap:{OPERATOR:0},func:function(b,a){return a.getField("OPERATOR",a)},syntax:{js:[],py:[""]}},set_visible_answer:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.CALC_timer_visible_show,"SHOW"],[Lang.Blocks.CALC_timer_visible_hide,"HIDE"]],value:"SHOW",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{viewAdd:[function(b){Entry.container&& -Entry.container.showProjectAnswer()}],viewDestroy:[function(b){Entry.container&&Entry.container.hideProjectAnswer(b)}]},def:{params:["HIDE",null],type:"set_visible_answer"},paramsKeyMap:{BOOL:0},"class":"ask",isNotFor:[],func:function(b,a){"HIDE"==a.getField("BOOL",a)?Entry.container.inputValue.setVisible(!1):Entry.container.inputValue.setVisible(!0);return a.callReturn()},syntax:{js:[],py:["Entry.answer_mode(%1)"]}},is_included_in_list:{color:"#E457DC",skeleton:"basic_boolean_field",statements:[], -params:[{type:"Text",text:Lang.Blocks.VARIABLE_is_included_in_list_1,color:"white"},{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Text",text:Lang.Blocks.VARIABLE_is_included_in_list_2,color:"white"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.VARIABLE_is_included_in_list_3,color:"white"}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer; -a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null,null,{type:"text",params:["10"]},null],type:"is_included_in_list"},paramsKeyMap:{LIST:1,DATA:3},"class":"list",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a),c=a.getStringValue("DATA",a),d=Entry.variableContainer.getList(d,b);if(!d)return!1;for(var d=d.array_,e=0,f=d.length;ek&&(k=Math.round(k-155),g=-k,h=0,Entry.dplay.vel_value=g);if(a.isStart){if(1==a.timeFlag)return Entry.hw.setDigitalPortValue(3,0),Entry.hw.setDigitalPortValue(5,0),Entry.hw.setDigitalPortValue(6,0),Entry.hw.setDigitalPortValue(11,0),a;if(2==a.timeFlag)return Entry.hw.setDigitalPortValue(d,g),Entry.hw.setDigitalPortValue(c,h),Entry.hw.setDigitalPortValue(e,g),Entry.hw.setDigitalPortValue(f, -h),delete a.isStart,delete a.timeFlag,Entry.engine.isContinue=!1,a.callReturn()}else{a.isStart=!0;a.timeFlag=1;var l=setTimeout(function(){a.timeFlag=2;Entry.dplay.removeTimeout(l)},50);Entry.dplay.timeouts.push(l);return a}},syntax:{js:[],py:["Dplay.dc_motor_speed(%1, %2)"]}},dplay_buzzer:{color:"#00979D",fontColor:"#FFF",skeleton:"basic",statements:[],template:"\ub514\uc9c0\ud138 10\ubc88 \ubd80\uc800\ub97c %1 %2 %3 \ubc15\uc790\ub85c \uc5f0\uc8fc\ud558\uae30",params:[{type:"Dropdown",options:[["\ub3c4", -"1"],["\ub3c4#","2"],["\ub808","3"],["\ubbf8b","4"],["\ubbf8","5"],["\ud30c","6"],["\ud30c#","7"],["\uc194","8"],["\uc194#","9"],["\ub77c","10"],["\uc2dcb","11"],["\uc2dc","12"],["\ubb34\uc74c","100"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Dropdown",options:[["1","1"],["2","2"],["3","3"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:["1","1", -{type:"text",params:["0.5"]},null],type:"dplay_buzzer"},paramsKeyMap:{NOTE:0,OCTAVE:1,VALUE:2},"class":"dplay_set",isNotFor:["dplay"],func:function(b,a){if(a.isStart){if(1==a.timeFlag)return a;Entry.hw.setDigitalPortValue(10,100);delete a.isStart;delete a.timeFlag;Entry.engine.isContinue=!1;return a.callReturn()}var d=a.getNumberField("NOTE",a),c=a.getNumberField("OCTAVE",a),e=a.getNumberValue("VALUE"),c=d+12*(c-1),e=6E4*e/60;a.isStart=!0;a.timeFlag=1;100==d?Entry.hw.setDigitalPortValue(10,100):Entry.hw.setDigitalPortValue(10, -c);if(100q?(m=Math.round(q-155),g=-m,h=0,Entry.dplay.Left_value=g):0==q&&(h=g=0,Entry.dplay.Left_value=0));"2"==n&&(e=6,f=11,0q?(m=Math.round(q-155),k=-m,l=0,Entry.dplay.Right_value=k):0==q&&(l=k=0,Entry.dplay.Right_value=k));"3"==n&&(d=3,c=5,e=6,f=11,0q?(m=Math.round(q-155),g=-m,h=0,k=-m,l=0,Entry.dplay.Left_value=g,Entry.dplay.Right_value=k):0==q&&(l=k=h=g=0,Entry.dplay.Left_value=0,Entry.dplay.Right_value=0));if(a.isStart){if(1==a.timeFlag)return Entry.hw.setDigitalPortValue(3,0),Entry.hw.setDigitalPortValue(5,0),Entry.hw.setDigitalPortValue(6, -0),Entry.hw.setDigitalPortValue(11,0),a;if(2==a.timeFlag)return Entry.hw.setDigitalPortValue(d,g),Entry.hw.setDigitalPortValue(c,h),Entry.hw.setDigitalPortValue(e,l),Entry.hw.setDigitalPortValue(f,k),delete a.isStart,delete a.timeFlag,Entry.engine.isContinue=!1,a.callReturn()}else{a.isStart=!0;a.timeFlag=1;var r=setTimeout(function(){a.timeFlag=2;Entry.dplay.removeTimeout(r)},50);Entry.dplay.timeouts.push(r);return a}}},dplay_robot_speed_set:{color:"#00979D",fontColor:"#FFF",skeleton:"basic",statements:[], -template:"\uc624\ub978\ucabd \ubc14\ud034 %1 \uc67c\ucabd \ubc14\ud034 %2(\uc73c)\ub85c \uc815\ud558\uae30 %3",params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["100"]},{type:"text",params:["100"]},null],type:"dplay_robot_speed_set"},paramsKeyMap:{R_VALUE:0,L_VALUE:1},"class":"dplay_robot",isNotFor:["dplay"],func:function(b,a){var d=0,c=0,e=0,f=0,g=0,g=0,g=a.getNumberValue("L_VALUE", -a),g=Math.max(g,-100),g=Math.min(g,100);0g?(g=Math.round(g-155),d=-g,c=0,Entry.dplay.Left_value=d):0==g&&(c=d=0,Entry.dplay.Left_value=0);g=a.getNumberValue("R_VALUE",a);g=Math.max(g,-100);g=Math.min(g,100);0g?(g=Math.round(g-155),e=-g,f=0,Entry.dplay.Right_value=e):0==g&&(f=e=0,Entry.dplay.Right_value=0);if(a.isStart){if(1==a.timeFlag)return Entry.hw.setDigitalPortValue(3,0),Entry.hw.setDigitalPortValue(5, -0),Entry.hw.setDigitalPortValue(6,0),Entry.hw.setDigitalPortValue(11,0),a;if(2==a.timeFlag)return Entry.hw.setDigitalPortValue(3,d),Entry.hw.setDigitalPortValue(5,c),Entry.hw.setDigitalPortValue(6,f),Entry.hw.setDigitalPortValue(11,e),delete a.isStart,delete a.timeFlag,Entry.engine.isContinue=!1,a.callReturn()}else{a.isStart=!0;a.timeFlag=1;var h=setTimeout(function(){a.timeFlag=2;Entry.dplay.removeTimeout(h)},50);Entry.dplay.timeouts.push(h);return a}},syntax:{js:[],py:["Dplay.robot_speed_sel(%1, %2)"]}}, -dplay_robot_stop:{color:"#00979D",fontColor:"#FFF",skeleton:"basic",statements:[],template:"\ub85c\ubd07\uc744 \uc815\uc9c0\ud558\uae30 %1",params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"dplay_robot_stop"},paramsKeyMap:{},"class":"dplay_robot",isNotFor:["dplay"],func:function(b,a){Entry.hw.setDigitalPortValue(3,0);Entry.hw.setDigitalPortValue(5,0);Entry.hw.setDigitalPortValue(11,0);Entry.hw.setDigitalPortValue(6,0);return a.callReturn()},syntax:{js:[], -py:["Dplay.robot_stop()"]}},nemoino_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_sensor_number"}],type:"nemoino_get_number_sensor_value"},"class":"arduino_value",syntax:{js:[],py:["Nemoino.sensor_value(%1)"]}},nemoino_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_port_number"}],type:"nemoino_get_digital_value"},"class":"arduino_value",syntax:{js:[],py:["Nemoino.digital_value(%1)"]}}, -nemoino_toggle_led:{parent:"arduino_toggle_led",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"nemoino_toggle_led"},"class":"arduino_set",syntax:{js:[],py:["Nemoino.toggle_led(%1)"]}},nemoino_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]},null],type:"nemoino_toggle_pwm"},"class":"arduino_set",syntax:{js:[],py:["Nemoino.toggle_pwm(%1, %2)"]}},nemoino_convert_scale:{parent:"arduino_convert_scale", -isNotFor:["nemoino"],def:{params:[{type:"arduino_get_number_sensor_value",params:[{type:"arduino_get_sensor_number"}]},{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"nemoino_convert_scale"},"class":"arduino",syntax:{js:[],py:["Nemoino.convert_scale(%1, %2, %3, %4, %5)"]}},sensorBoard_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_sensor_number"}], -type:"sensorBoard_get_number_sensor_value"},"class":"arduino_value",syntax:{js:[],py:["hw.sensorBoard_get_number_sensor_value(%1)"]}},sensorBoard_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_port_number"}],type:"sensorBoard_get_digital_value"},"class":"arduino_value",syntax:{js:[],py:["hw.sensorBoard_get_digital_value(%1)"]}},sensorBoard_toggle_led:{parent:"arduino_toggle_led",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_port_number"}, -null,null],type:"sensorBoard_toggle_led"},"class":"arduino_set",syntax:{js:[],py:["hw.sensorBoard_toggle_led(%1)"]}},sensorBoard_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]},null],type:"sensorBoard_toggle_pwm"},"class":"arduino_set",syntax:{js:[],py:["hw.sensorBoard_toggle_pwm(%1, %2)"]}},sensorBoard_convert_scale:{parent:"arduino_convert_scale",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_number_sensor_value", -params:[{type:"arduino_get_sensor_number",id:"bl5e"}]},{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"sensorBoard_convert_scale"},"class":"arduino",syntax:{js:[],py:["hw.sensorBoard_convert_scale(%1, %2, %3, %4, %5)"]}},ardublock_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_sensor_number"}],type:"ardublock_get_number_sensor_value"},"class":"arduino_value"}, -ardublock_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_port_number"}],type:"ardublock_get_digital_value"},"class":"arduino_value"},ardublock_toggle_led:{parent:"arduino_toggle_led",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"ardublock_toggle_led"},"class":"arduino_set"},ardublock_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text", -params:["255"]},null],type:"ardublock_toggle_pwm"},"class":"arduino_set"},ardublock_convert_scale:{parent:"arduino_convert_scale",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_number_sensor_value",params:[{type:"arduino_get_sensor_number"}]},{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"ardublock_convert_scale"},"class":"arduino"},joystick_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["joystick"], -def:{params:[{type:"arduino_get_sensor_number"}],type:"joystick_get_number_sensor_value"},"class":"arduino_value"},joystick_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["joystick"],def:{params:[{type:"arduino_get_port_number"}],type:"joystick_get_digital_value"},"class":"arduino_value"},joystick_toggle_led:{parent:"arduino_toggle_led",isNotFor:["joystick"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"joystick_toggle_led"},"class":"arduino_set"},joystick_toggle_pwm:{parent:"arduino_toggle_pwm", -isNotFor:["joystick"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]},null],type:"joystick_toggle_pwm"},"class":"arduino_set"},joystick_convert_scale:{parent:"arduino_convert_scale",isNotFor:["joystick"],def:{params:[{type:"arduino_get_number_sensor_value",params:[{type:"arduino_get_sensor_number"}]},{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"joystick_convert_scale"},"class":"arduino"}, -ebs_if:{parent:"_if",def:{type:"_if",params:[{type:"reach_something",params:[null,"wall"]}]}},ebs_if2:{parent:"_if",def:{type:"_if",params:[{type:"reach_something",params:[null,"cwz5"]}]}},ai_move_right:{skeleton:"basic",mode:"maze",color:"#A751E3",syntax:["Scope","move"],params:[{type:"Image",img:"/img/assets/week/blocks/moveStep.png",size:24}],func:function(b,a){if(a.isStart){if(a.isAction)return Entry.STATIC.BREAK;delete a.isAction;delete a.isStart}else{a.isStart=!0;a.isAction=!0;Ntry.dispatchEvent("gridChange", -function(){a.isAction=!1});Ntry.entityManager.getComponent(b.id,Ntry.STATIC.SPACE_SHIP).direction=Ntry.STATIC.EAST;var d=Ntry.entityManager.getComponent(b.id,Ntry.STATIC.GRID);Ntry.entityManager.addComponent(b.id,{type:Ntry.STATIC.ANIMATE,animateType:Ntry.STATIC.ROTATE_TO,animateValue:0});d.x++;return Entry.STATIC.BREAK}}},ai_move_up:{skeleton:"basic",mode:"maze",color:"#A751E3",syntax:["Scope","up"],params:[{type:"Image",img:"/img/assets/week/blocks/ai_move_up.png",size:24}],func:function(b,a){if(a.isStart){if(a.isAction)return a; -delete a.isAction;delete a.isStart;return a.callReturn()}a.isStart=!0;a.isAction=!0;Ntry.dispatchEvent("gridChange",function(){a.isAction=!1});Ntry.entityManager.getComponent(b.id,Ntry.STATIC.SPACE_SHIP).direction=Ntry.STATIC.NORTH;var d=Ntry.entityManager.getComponent(b.id,Ntry.STATIC.GRID);Ntry.entityManager.addComponent(b.id,{type:Ntry.STATIC.ANIMATE,animateType:Ntry.STATIC.ROTATE_TO,animateValue:-45});d.x++;d.y--;return a}},ai_move_down:{skeleton:"basic",mode:"maze",color:"#A751E3",syntax:["Scope", -"down"],params:[{type:"Image",img:"/img/assets/week/blocks/ai_move_down.png",size:24}],func:function(b,a){if(a.isStart){if(a.isAction)return a;delete a.isAction;delete a.isStart;return a.callReturn()}a.isStart=!0;a.isAction=!0;Ntry.dispatchEvent("gridChange",function(){a.isAction=!1});Ntry.entityManager.getComponent(b.id,Ntry.STATIC.SPACE_SHIP).direction=Ntry.STATIC.SOUTH;var d=Ntry.entityManager.getComponent(b.id,Ntry.STATIC.GRID);Ntry.entityManager.addComponent(b.id,{type:Ntry.STATIC.ANIMATE,animateType:Ntry.STATIC.ROTATE_TO, +null],type:"neobot_right_motor"},paramsKeyMap:{DIRECTION:0,SPEED:1},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){var d=a.getNumberField("SPEED"),c=a.getNumberField("DIRECTION");Entry.hw.sendQueue.DCR=d+c;return a.callReturn()},syntax:{js:[],py:["Neobot.turn_right(%1, %2)"]}},neobot_stop_right_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc624\ub978\ucabd \ubaa8\ud130\ub97c \uc815\uc9c0 %1",params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{}, +def:{params:[null],type:"neobot_stop_right_motor"},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){Entry.hw.sendQueue.DCR=0;return a.callReturn()},syntax:{js:[],py:["Neobot.stop_right()"]}},neobot_all_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc591\ucabd \ubaa8\ud130\ub97c %1 %2\uc758 \uc18d\ub3c4\ub85c %3\ucd08 \ub3d9\uc548 \ud68c\uc804 %4",params:[{type:"Dropdown",options:[["\uc55e\uc73c\ub85c","1"],["\ub4a4\ub85c","2"],["\uc81c\uc790\ub9ac\uc5d0\uc11c \uc67c\ucabd \ub3cc\uae30", +"3"],["\uc81c\uc790\ub9ac\uc5d0\uc11c \uc624\ub978\ucabd \ub3cc\uae30","4"],["\uc67c\ucabd\uc73c\ub85c \ub3cc\uae30","5"],["\uc624\ub978\ucabd\uc73c\ub85c \ub3cc\uae30","6"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Dropdown",options:[["0","0"],["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"],["10","10"],["11","11"],["12","12"],["13","13"],["14","14"],["15","15"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Block", +accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:["1","15",{type:"number",params:["0"]}],type:"neobot_all_motor"},paramsKeyMap:{DIRECTION:0,SPEED:1,DURATION:2},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){if(a.isStart){if(1==a.timeFlag)return a;delete a.timeFlag;delete a.isStart;Entry.hw.sendQueue.DCL=0;Entry.hw.sendQueue.DCR=0;Entry.engine.isContinue=!1;return a.callReturn()}var d=a.getNumberField("SPEED"),c=a.getNumberField("DIRECTION"), +e=a.getNumberValue("DURATION");0>e&&(e=0);switch(c){case 1:Entry.hw.sendQueue.DCL=16+d;Entry.hw.sendQueue.DCR=16+d;break;case 2:Entry.hw.sendQueue.DCL=32+d;Entry.hw.sendQueue.DCR=32+d;break;case 3:Entry.hw.sendQueue.DCL=32+d;Entry.hw.sendQueue.DCR=16+d;break;case 4:Entry.hw.sendQueue.DCL=16+d;Entry.hw.sendQueue.DCR=32+d;break;case 5:Entry.hw.sendQueue.DCL=0;Entry.hw.sendQueue.DCR=16+d;break;case 6:Entry.hw.sendQueue.DCL=16+d,Entry.hw.sendQueue.DCR=0}if(0===e)return a.callReturn();a.isStart=!0;a.timeFlag= +1;setTimeout(function(){a.timeFlag=0},1E3*e);return a}},neobot_stop_all_motor:{color:"#00979D",skeleton:"basic",statements:[],template:"\uc591\ucabd \ubaa8\ud130\ub97c \uc815\uc9c0 %1",params:[{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"neobot_stop_all_motor"},"class":"neobot_motor",isNotFor:["neobot"],func:function(b,a){Entry.hw.sendQueue.DCL=0;Entry.hw.sendQueue.DCR=0;return a.callReturn()},syntax:{js:[],py:["Neobot.run_motor(%1, %2, %3, %4)"]}}, +neobot_set_servo:{color:"#00979D",skeleton:"basic",statements:[],template:"%1 \ud3ec\ud2b8\uc758 \uc11c\ubcf4\ubaa8\ud130\ub97c %2 \ub3c4 \uc774\ub3d9 %3",params:[{type:"Dropdown",options:[["OUT1","1"],["OUT2","2"],["OUT3","3"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,null],type:"neobot_set_servo"},paramsKeyMap:{PORT:0,DEGREE:1},"class":"neobot_output", +isNotFor:["neobot"],func:function(b,a){var d=a.getNumberField("PORT"),c=a.getNumberValue("DEGREE");0>c?c=0:180c?c=0:255d.count)throw d.count++,new Entry.Utils.AsyncError;d.isStart=!1;c=Entry.hw.portData[d.data_default_address];d.data_default_address=void 0;return c},syntax:{js:[],py:["Robotis.opencm70_cm_custom_value(%1, %2)"]}},robotis_openCM70_sensor_value:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.robotis_cm_sound_detected,"CM_SOUND_DETECTED"],[Lang.Blocks.robotis_cm_sound_detecting,"CM_SOUND_DETECTING"],[Lang.Blocks.robotis_cm_user_button, +"CM_USER_BUTTON"]],value:"CM_SOUND_DETECTED",fontSize:11}],events:{},def:{params:[null],type:"robotis_openCM70_sensor_value"},paramsKeyMap:{SENSOR:0},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.executor.scope;if(!d.isStart){d.isStart=!0;d.count=0;var c=Entry.Robotis_openCM70.INSTRUCTION.READ,e=0,f=0,g=0,h=0,k=a.getStringField("SENSOR");"CM_SOUND_DETECTED"==k?(g=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[0],h=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[1], +e=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[0],f=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTED[1]):"CM_SOUND_DETECTING"==k?(g=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[0],h=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[0],f=Entry.Robotis_openCM70.CONTROL_TABLE.CM_SOUND_DETECTING[1]):"CM_USER_BUTTON"==k&&(g=Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[0],h=Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[1], +e=Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[0],f=Entry.Robotis_openCM70.CONTROL_TABLE.CM_USER_BUTTON[1]);g+=0*h;Entry.Robotis_carCont.setRobotisData([[c,e,f,0,h]]);Entry.Robotis_carCont.update();d.data_default_address=g;throw new Entry.Utils.AsyncError;}if(2>d.count)throw d.count++,new Entry.Utils.AsyncError;d.isStart=!1;c=Entry.hw.portData[d.data_default_address];d.data_default_address=void 0;return c},syntax:{js:[],py:["Robotis.opencm70_sensor_value(%1)"]}},robotis_openCM70_aux_sensor_value:{color:"#00979D", +fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[["3","PORT_3"],["4","PORT_4"],["5","PORT_5"],["6","PORT_6"]],value:"PORT_3",fontSize:11},{type:"Dropdown",options:[[Lang.Blocks.robotis_aux_servo_position,"AUX_SERVO_POSITION"],[Lang.Blocks.robotis_aux_ir,"AUX_IR"],[Lang.Blocks.robotis_aux_touch,"AUX_TOUCH"],[Lang.Blocks.robotis_aux_brightness,"AUX_BRIGHTNESS"],[Lang.Blocks.robotis_aux_hydro_themo_humidity,"AUX_HYDRO_THEMO_HUMIDITY"],[Lang.Blocks.robotis_aux_hydro_themo_temper, +"AUX_HYDRO_THEMO_TEMPER"],[Lang.Blocks.robotis_aux_temperature,"AUX_TEMPERATURE"],[Lang.Blocks.robotis_aux_ultrasonic,"AUX_ULTRASONIC"],[Lang.Blocks.robotis_aux_magnetic,"AUX_MAGNETIC"],[Lang.Blocks.robotis_aux_motion_detection,"AUX_MOTION_DETECTION"],[Lang.Blocks.robotis_aux_color,"AUX_COLOR"],[Lang.Blocks.robotis_aux_custom,"AUX_CUSTOM"]],value:"AUX_SERVO_POSITION",fontSize:11}],events:{},def:{params:[null,null],type:"robotis_openCM70_aux_sensor_value"},paramsKeyMap:{PORT:0,SENSOR:1},"class":"robotis_openCM70_cm", +isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.executor.scope;if(!d.isStart){d.isStart=!0;d.count=0;var c=Entry.Robotis_openCM70.INSTRUCTION.READ,e=0,f=0,g=0,h=a.getStringField("PORT"),k=a.getStringField("SENSOR"),l=0;"PORT_3"==h?l=2:"PORT_4"==h?l=3:"PORT_5"==h?l=4:"PORT_6"==h&&(l=5);"AUX_SERVO_POSITION"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_POSITION[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_POSITION[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_SERVO_POSITION[1]): +"AUX_IR"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_IR[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_IR[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_IR[1]):"AUX_TOUCH"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TOUCH[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TOUCH[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TOUCH[1]):"AUX_TEMPERATURE"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TEMPERATURE[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TEMPERATURE[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_TEMPERATURE[1]): +"AUX_BRIGHTNESS"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_BRIGHTNESS[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_BRIGHTNESS[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_BRIGHTNESS[1]):"AUX_HYDRO_THEMO_HUMIDITY"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_HUMIDITY[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_HUMIDITY[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_HUMIDITY[1]):"AUX_HYDRO_THEMO_TEMPER"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_TEMPER[0], +g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_TEMPER[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_HYDRO_THEMO_TEMPER[1]):"AUX_ULTRASONIC"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_ULTRASONIC[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_ULTRASONIC[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_ULTRASONIC[1]):"AUX_MAGNETIC"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MAGNETIC[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MAGNETIC[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MAGNETIC[1]): +"AUX_MOTION_DETECTION"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTION_DETECTION[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTION_DETECTION[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_MOTION_DETECTION[1]):"AUX_COLOR"==k?(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_COLOR[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_COLOR[1],e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_COLOR[1]):"AUX_CUSTOM"==k&&(f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[1], +e=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[1]);f+=l*g;Entry.Robotis_carCont.setRobotisData([[c,f,e,0,g]]);Entry.Robotis_carCont.update();d.data_default_address=f;throw new Entry.Utils.AsyncError;}if(2>d.count)throw d.count++,new Entry.Utils.AsyncError;d.isStart=!1;c=Entry.hw.portData[d.data_default_address];d.data_default_address=void 0;return c},syntax:{js:[],py:["Robotis.opencm70_aux_sensor_value(%1, %2)"]}},robotis_openCM70_cm_buzzer_index:{color:"#00979D",skeleton:"basic",statements:[], +params:[{type:"Dropdown",options:[[Lang.General.note_a+"(0)","0"],[Lang.General.note_a+"#(1)","1"],[Lang.General.note_b+"(2)","2"],[Lang.General.note_c+"(3)","3"],[Lang.General.note_c+"#(4)","4"],[Lang.General.note_d+"(5)","5"],[Lang.General.note_d+"#(6)","6"],[Lang.General.note_e+"(7)","7"],[Lang.General.note_f+"(8)","8"],[Lang.General.note_f+"#(9)","9"],[Lang.General.note_g+"(10)","10"],[Lang.General.note_g+"#(11)","11"],[Lang.General.note_a+"(12)","12"],[Lang.General.note_a+"#(13)","13"],[Lang.General.note_b+ +"(14)","14"],[Lang.General.note_c+"(15)","15"],[Lang.General.note_c+"#(16)","16"],[Lang.General.note_d+"(17)","17"],[Lang.General.note_d+"#(18)","18"],[Lang.General.note_e+"(19)","19"],[Lang.General.note_f+"(20)","20"],[Lang.General.note_f+"#(21)","21"],[Lang.General.note_g+"(22)","22"],[Lang.General.note_g+"#(23)","23"],[Lang.General.note_a+"(24)","24"],[Lang.General.note_a+"#(25)","25"],[Lang.General.note_b+"(26)","26"],[Lang.General.note_c+"(27)","27"],[Lang.General.note_c+"#(28)","28"],[Lang.General.note_d+ +"(29)","29"],[Lang.General.note_d+"#(30)","30"],[Lang.General.note_e+"(31)","31"],[Lang.General.note_f+"(32)","32"],[Lang.General.note_f+"#(33)","33"],[Lang.General.note_g+"(34)","34"],[Lang.General.note_g+"#(35)","35"],[Lang.General.note_a+"(36)","36"],[Lang.General.note_a+"#(37)","37"],[Lang.General.note_b+"(38)","38"],[Lang.General.note_c+"(39)","39"],[Lang.General.note_c+"#(40)","40"],[Lang.General.note_d+"(41)","41"],[Lang.General.note_d+"#(42)","42"],[Lang.General.note_e+"(43)","43"],[Lang.General.note_f+ +"(44)","44"],[Lang.General.note_f+"#(45)","45"],[Lang.General.note_g+"(46)","46"],[Lang.General.note_g+"#(47)","47"],[Lang.General.note_a+"(48)","48"],[Lang.General.note_a+"#(49)","49"],[Lang.General.note_b+"(50)","50"],[Lang.General.note_c+"(51)","51"]],value:"0",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"number",params:["1"]},null],type:"robotis_openCM70_cm_buzzer_index"},paramsKeyMap:{CM_BUZZER_INDEX:0, +CM_BUZZER_TIME:1},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.getField("CM_BUZZER_INDEX",a),c=a.getNumberValue("CM_BUZZER_TIME",a),e=Entry.Robotis_openCM70.INSTRUCTION.WRITE,f=0,g=0,h=0,k=0,l=0,f=Entry.Robotis_openCM70.CONTROL_TABLE.CM_BUZZER_TIME[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.CM_BUZZER_TIME[1],h=parseInt(10*c);50c&&(c=0);return Entry.Robotis_carCont.postCallReturn(a, +[[e,f+(d-1)*g,g,c]],Entry.Robotis_openCM70.delay)},syntax:{js:[],py:["Robotis.opencm70_aux_servo_position(%1, %2)"]}},robotis_openCM70_aux_led_module:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.robotis_common_port_3,"3"],[Lang.Blocks.robotis_common_port_4,"4"],[Lang.Blocks.robotis_common_port_5,"5"],[Lang.Blocks.robotis_common_port_6,"6"]],value:"3",fontSize:11},{type:"Dropdown",options:[[Lang.Blocks.robotis_cm_led_both+Lang.Blocks.robotis_common_off, +"0"],[Lang.Blocks.robotis_cm_led_right+Lang.Blocks.robotis_common_on,"1"],[Lang.Blocks.robotis_cm_led_left+Lang.Blocks.robotis_common_on,"2"],[Lang.Blocks.robotis_cm_led_both+Lang.Blocks.robotis_common_on,"3"]],value:"0",fontSize:11},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,null],type:"robotis_openCM70_aux_led_module"},paramsKeyMap:{PORT:0,LED_MODULE:1},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.getField("PORT", +a),c=a.getField("LED_MODULE",a),e=Entry.Robotis_openCM70.INSTRUCTION.WRITE,f=0,g=0,f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_LED_MODULE[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_LED_MODULE[1];return Entry.Robotis_carCont.postCallReturn(a,[[e,f+(d-1)*g,g,c]],Entry.Robotis_openCM70.delay)},syntax:{js:[],py:["Robotis.opencm70_aux_led_module(%1, %2)"]}},robotis_openCM70_aux_custom:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.robotis_common_port_3, +"3"],[Lang.Blocks.robotis_common_port_4,"4"],[Lang.Blocks.robotis_common_port_5,"5"],[Lang.Blocks.robotis_common_port_6,"6"]],value:"3",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"number",params:["0"]},null],type:"robotis_openCM70_aux_custom"},paramsKeyMap:{PORT:0,VALUE:1},"class":"robotis_openCM70_cm",isNotFor:["robotis_openCM70"],func:function(b,a){var d=a.getField("PORT",a),c=a.getNumberValue("VALUE"), +e=Entry.Robotis_openCM70.INSTRUCTION.WRITE,f=0,g=0,f=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[0],g=Entry.Robotis_openCM70.CONTROL_TABLE.AUX_CUSTOM[1];return Entry.Robotis_carCont.postCallReturn(a,[[e,f+(d-1)*g,g,c]],Entry.Robotis_openCM70.delay)},syntax:{js:[],py:["Robotis.opencm70_aux_custom(%1, %2)"]}},robotis_openCM70_cm_custom:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png", +size:12}],events:{},def:{params:[{type:"number",params:["0"]},{type:"number",params:["0"]},null],type:"robotis_openCM70_cm_custom"},paramsKeyMap:{ADDRESS:0,VALUE:1},"class":"robotis_openCM70_custom",isNotFor:["robotis_openCM70"],func:function(b,a){var d=Entry.Robotis_openCM70.INSTRUCTION.WRITE,c=0,e=0,c=a.getNumberValue("ADDRESS"),e=a.getNumberValue("VALUE");return Entry.Robotis_carCont.postCallReturn(a,[[d,c,65535d&&(d=0);createjs.Sound.setVolume(d);return a.callReturn()}, +syntax:{js:[],py:["Entry.add_volume(%1)"]}},sound_volume_set:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"number",params:["10"]},null],type:"sound_volume_set"},paramsKeyMap:{VALUE:0},"class":"sound_volume",isNotFor:[],func:function(b,a){var d=a.getNumberValue("VALUE",a)/100;1d&&(d=0);createjs.Sound.setVolume(d);return a.callReturn()},syntax:{js:[],py:["Entry.set_volume(%1)"]}}, +sound_silent_all:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[null],type:"sound_silent_all"},"class":"sound_stop",isNotFor:[],func:function(b,a){createjs.Sound.stop();return a.callReturn()},syntax:{js:[],py:["Entry.stop_sound()"]}},get_sounds:{color:"#A4D01D",skeleton:"basic_string_field",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"sounds",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_SOUNDS}], +events:{},def:{params:[null],type:"get_sounds"},paramsKeyMap:{VALUE:0},func:function(b,a){return a.getStringField("VALUE")},syntax:{js:[],py:["%1get_sounds#"]}},sound_something_with_block:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},null],type:"sound_something_with_block"},paramsKeyMap:{VALUE:0},"class":"sound_play",isNotFor:[],func:function(b,a){var d=a.getStringValue("VALUE", +a);(d=b.parent.getSound(d))&&createjs.Sound.play(d.id);return a.callReturn()},syntax:{js:[],py:["Entry.play_sound(%1)"]}},sound_something_second_with_block:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds",id:"95dw"},{type:"number",params:["1"]},null],type:"sound_something_second_with_block"},paramsKeyMap:{VALUE:0,SECOND:1},"class":"sound_play", +isNotFor:[],func:function(b,a){var d=a.getStringValue("VALUE",a),c=a.getNumberValue("SECOND",a);(d=b.parent.getSound(d))&&createjs.Sound.play(d.id,{startTime:0,duration:1E3*c});return a.callReturn()},syntax:{js:[],py:["Entry.play_sound_for_seconds(%1, %2)"]}},sound_something_wait_with_block:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},null],type:"sound_something_wait_with_block"}, +paramsKeyMap:{VALUE:0},"class":"sound_wait",isNotFor:[],func:function(b,a){if(a.isPlay){if(1==a.playState)return a;delete a.playState;delete a.isPlay;return a.callReturn()}a.isPlay=!0;a.playState=1;var d=a.getStringValue("VALUE",a);if(d=b.parent.getSound(d))createjs.Sound.play(d.id),setTimeout(function(){a.playState=0},1E3*d.duration);return a},syntax:{js:[],py:["Entry.play_sound_and_wait(%1)"]}},sound_something_second_wait_with_block:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block", +accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},{type:"number",params:["1"]},null],type:"sound_something_second_wait_with_block"},paramsKeyMap:{VALUE:0,SECOND:1},"class":"sound_wait",isNotFor:[],func:function(b,a){if(a.isPlay){if(1==a.playState)return a;delete a.isPlay;delete a.playState;return a.callReturn()}a.isPlay=!0;a.playState=1;var d=a.getStringValue("VALUE",a);if(d=b.parent.getSound(d)){var c= +createjs.Sound.play(d.id),d=a.getNumberValue("SECOND",a);setTimeout(function(){c.stop();a.playState=0},1E3*d);c.addEventListener("complete",function(a){})}return a},syntax:{js:[],py:["Entry.play_sound_for_seconds_and_wait(%1, %2)"]}},sound_from_to:{color:"#A4D01D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},{type:"text", +params:["1"]},{type:"text",params:["10"]},null],type:"sound_from_to"},paramsKeyMap:{VALUE:0,START:1,END:2},"class":"sound_play",isNotFor:[],func:function(b,a){var d=a.getStringValue("VALUE",a);if(d=b.parent.getSound(d)){var c=1E3*a.getNumberValue("START",a),e=1E3*a.getNumberValue("END",a);createjs.Sound.play(d.id,{startTime:Math.min(c,e),duration:Math.max(c,e)-Math.min(c,e)})}return a.callReturn()},syntax:{js:[],py:["Entry.play_sound_from_to_seconds(%1, %2, %3)"]}},sound_from_to_and_wait:{color:"#A4D01D", +skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/sound_03.png",size:12}],events:{},def:{params:[{type:"get_sounds"},{type:"text",params:["1"]},{type:"text",params:["10"]},null],type:"sound_from_to_and_wait"},paramsKeyMap:{VALUE:0,START:1,END:2},"class":"sound_wait",isNotFor:[],func:function(b,a){if(a.isPlay){if(1==a.playState)return a;delete a.isPlay;delete a.playState;return a.callReturn()}a.isPlay= +!0;a.playState=1;var d=a.getStringValue("VALUE",a);if(d=b.parent.getSound(d)){var c=1E3*a.getNumberValue("START",a),e=1E3*a.getNumberValue("END",a),f=Math.min(c,e),c=Math.max(c,e)-f;createjs.Sound.play(d.id,{startTime:f,duration:c});setTimeout(function(){a.playState=0},c)}return a},syntax:{js:[],py:["Entry.play_sound_from_to_seconds_and_wait(%1, %2, %3)"]}},when_run_button_click:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_play.png",size:17, +position:{x:0,y:-2}}],events:{},def:{params:[null],type:"when_run_button_click"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"start",syntax:{js:[],py:["def entry_event_start():"]}},press_some_key:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_keyboard.png",size:17,position:{x:0,y:-2}},{type:"Dropdown",options:[["q","81"],["w","87"],["e","69"],["r","82"],["a","65"],["s","83"],["d","68"],["\uc704\ucabd \ud654\uc0b4\ud45c", +"38"],["\uc544\ub798\ucabd \ud654\uc0b4\ud45c","40"],["\uc67c\ucabd \ud654\uc0b4\ud45c","37"],["\uc624\ub978\ucabd \ud654\uc0b4\ud45c","39"],["\uc5d4\ud130","13"],["\uc2a4\ud398\uc774\uc2a4","32"]],value:"81",fontSize:11},{type:"Indicator",img:"block_icon/start_03.png",size:12}],events:{},def:{params:[null,null,null]},paramsKeyMap:{VALUE:1},func:function(b,a){return a.callReturn()},syntax:{js:[],py:[""]}},when_some_key_pressed:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator", +img:"block_icon/start_icon_keyboard.png",size:17,position:{x:0,y:-2}},{type:"Keyboard",value:"81"}],events:{},def:{params:[null,"81"],type:"when_some_key_pressed"},paramsKeyMap:{VALUE:1},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"keyPress",syntax:{js:[],py:["def entry_event_key(%2):"]}},mouse_clicked:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_mouse.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null], +type:"mouse_clicked"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"mouse_clicked",syntax:{js:[],py:["def entry_event_mouse_down():"]}},mouse_click_cancled:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_mouse.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null],type:"mouse_click_cancled"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"mouse_click_cancled",syntax:{js:[], +py:["def entry_event_mouse_up():"]}},when_object_click:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_mouse.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null],type:"when_object_click"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"when_object_click",syntax:{js:[],py:["def entry_event_object_down():"]}},when_object_click_canceled:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator", +img:"block_icon/start_icon_mouse.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null],type:"when_object_click_canceled"},"class":"event",isNotFor:[],func:function(b,a){return a.callReturn()},event:"when_object_click_canceled",syntax:{js:[],py:["def entry_event_object_up():"]}},when_some_key_click:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_keyboard.png",size:17,position:{x:0,y:-2}}],events:{},def:{params:[null]},func:function(b, +a){return a.callReturn()},event:"keyPress",syntax:{js:[],py:["Entry.on_key_press_down(%1)"]}},when_message_cast:{color:"#3BBD70",skeleton:"basic_event",statements:[],params:[{type:"Indicator",img:"block_icon/start_icon_signal.png",size:17,position:{x:0,y:-2}},{type:"DropdownDynamic",value:null,menuName:"messages",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_START}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_messageRefs",b)}],viewDestroy:[function(b){var a=Entry.variableContainer; +a&&a.removeRef("_messageRefs",b)}]},def:{params:[null,null],type:"when_message_cast"},paramsKeyMap:{VALUE:1},"class":"message",isNotFor:["message"],func:function(b,a){return a.callReturn()},event:"when_message_cast",syntax:{js:[],py:["def entry_event_signal(%2):"]}},message_cast:{color:"#3BBD70",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"messages",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_START},{type:"Indicator",img:"block_icon/start_03.png",size:12}], +events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_messageRefs",b)}],viewDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_messageRefs",b)}]},def:{params:[null,null],type:"message_cast"},paramsKeyMap:{VALUE:0},"class":"message",isNotFor:["message"],func:function(b,a){var d=a.getField("VALUE",a),c=Entry.isExist(d,"id",Entry.variableContainer.messages_);if("null"==d||!c)throw Error("value can not be null or undefined");Entry.engine.raiseMessage(d)},syntax:{js:[], +py:["Entry.send_signal(%1)"]}},message_cast_wait:{color:"#3BBD70",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"messages",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_START},{type:"Indicator",img:"block_icon/start_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_messageRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_messageRefs",b)}]},def:{params:[null,null],type:"message_cast_wait"}, +paramsKeyMap:{VALUE:0},"class":"message",isNotFor:["message"],func:function(b,a){if(a.runningScript){for(var d=a.runningScript,c=d.length,e=0;ed.array_.length)throw Error("can not remove value from array");d.array_.splice(c-1,1);d.updateView();return a.callReturn()},syntax:{js:[],py:["%2.pop(%1)"]}},insert_value_to_list:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{dataAdd:[function(b){var a= +Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[{type:"text",params:["10"]},null,{type:"text",params:["1"]},null],type:"insert_value_to_list"},paramsKeyMap:{DATA:0,LIST:1,INDEX:2},"class":"list",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a),c=a.getValue("DATA",a),e=a.getValue("INDEX",a),d=Entry.variableContainer.getList(d,b);if(!d.array_||isNaN(e)||0== +e||e>d.array_.length+1)throw Error("can not insert value to array");d.array_.splice(e-1,0,{data:c});d.updateView();return a.callReturn()},syntax:{js:[],py:["%2.insert(%3, %1)"]}},change_value_list_index:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{dataAdd:[function(b){var a= +Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,{type:"text",params:["1"]},{type:"text",params:["10"]},null],type:"change_value_list_index"},paramsKeyMap:{LIST:0,INDEX:1,DATA:2},"class":"list",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a),c=a.getValue("DATA",a),e=a.getValue("INDEX",a),d=Entry.variableContainer.getList(d,b);if(!d.array_||isNaN(e)|| +e>d.array_.length)throw Error("can not insert value to array");d.array_[e-1].data=c;d.updateView();return a.callReturn()},syntax:{js:[],py:["%1[%2] = %3"]}},value_of_index_from_list:{color:"#E457DC",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.VARIABLE_value_of_index_from_list_1,color:"white"},{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Text",text:Lang.Blocks.VARIABLE_value_of_index_from_list_2, +color:"white"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.VARIABLE_value_of_index_from_list_3,color:"white"}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null,null,{type:"number",params:["1"]}],type:"value_of_index_from_list"},paramsKeyMap:{LIST:1,INDEX:3},"class":"list_element",isNotFor:["list","listNotExist"],func:function(b, +a){var d=a.getField("LIST",a),c=a.getValue("INDEX",a),d=Entry.variableContainer.getList(d,b),c=Entry.getListRealIndex(c,d);if(!d.array_||isNaN(c)||c>d.array_.length)throw Error("can not insert value to array");return d.array_[c-1].data},syntax:{js:[],py:["%2[%4]"]}},length_of_list:{color:"#E457DC",skeleton:"basic_string_field",statements:[],params:[{type:"Text",text:Lang.Blocks.VARIABLE_length_of_list_1,color:"white"},{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE}, +{type:"Text",text:Lang.Blocks.VARIABLE_length_of_list_2,color:"white"}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null,null],type:"length_of_list"},paramsKeyMap:{LIST:1},"class":"list",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a);return Entry.variableContainer.getList(d,b).array_.length},syntax:{js:[],py:["len(%2)"]}}, +show_list:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null],type:"show_list"},paramsKeyMap:{LIST:0},"class":"list_visibility", +isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a);Entry.variableContainer.getList(d).setVisible(!0);return a.callReturn()},syntax:{js:[],py:["Entry.show_list(%1)"]}},hide_list:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Indicator",img:"block_icon/variable_03.png",size:12}],events:{dataAdd:[function(b){var a=Entry.variableContainer;a&&a.addRef("_variableRefs", +b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null],type:"hide_list"},paramsKeyMap:{LIST:0},"class":"list_visibility",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a);Entry.variableContainer.getList(d).setVisible(!1);return a.callReturn()},syntax:{js:[],py:["Entry.hide_list(%1)"]}},options_for_list:{color:"#E457DC",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[["\uccab\ubc88\uc9f8", +"FIRST"],["\ub9c8\uc9c0\ub9c9","LAST"],["\ubb34\uc791\uc704","RANDOM"]],value:"FIRST",fontSize:11}],events:{},def:{params:[null]},paramsKeyMap:{OPERATOR:0},func:function(b,a){return a.getField("OPERATOR",a)},syntax:{js:[],py:[""]}},set_visible_answer:{color:"#E457DC",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.CALC_timer_visible_show,"SHOW"],[Lang.Blocks.CALC_timer_visible_hide,"HIDE"]],value:"SHOW",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Indicator", +img:"block_icon/variable_03.png",size:12}],events:{viewAdd:[function(b){Entry.container&&Entry.container.showProjectAnswer()}],viewDestroy:[function(b){Entry.container&&Entry.container.hideProjectAnswer(b)}]},def:{params:["HIDE",null],type:"set_visible_answer"},paramsKeyMap:{BOOL:0},"class":"ask",isNotFor:[],func:function(b,a){"HIDE"==a.getField("BOOL",a)?Entry.container.inputValue.setVisible(!1):Entry.container.inputValue.setVisible(!0);return a.callReturn()},syntax:{js:[],py:["Entry.answer_mode(%1)"]}}, +is_included_in_list:{color:"#E457DC",skeleton:"basic_boolean_field",statements:[],params:[{type:"Text",text:Lang.Blocks.VARIABLE_is_included_in_list_1,color:"white"},{type:"DropdownDynamic",value:null,menuName:"lists",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_VARIABLE},{type:"Text",text:Lang.Blocks.VARIABLE_is_included_in_list_2,color:"white"},{type:"Block",accept:"string"},{type:"Text",text:Lang.Blocks.VARIABLE_is_included_in_list_3,color:"white"}],events:{dataAdd:[function(b){var a=Entry.variableContainer; +a&&a.addRef("_variableRefs",b)}],dataDestroy:[function(b){var a=Entry.variableContainer;a&&a.removeRef("_variableRefs",b)}]},def:{params:[null,null,null,{type:"text",params:["10"]},null],type:"is_included_in_list"},paramsKeyMap:{LIST:1,DATA:3},"class":"list",isNotFor:["list","listNotExist"],func:function(b,a){var d=a.getField("LIST",a),c=a.getStringValue("DATA",a),d=Entry.variableContainer.getList(d,b);if(!d)return!1;for(var d=d.array_,e=0,f=d.length;ek&&(k=Math.round(k-155),g=-k,h=0,Entry.dplay.vel_value=g);if(a.isStart){if(1==a.timeFlag)return Entry.hw.setDigitalPortValue(3,0),Entry.hw.setDigitalPortValue(5, +0),Entry.hw.setDigitalPortValue(6,0),Entry.hw.setDigitalPortValue(11,0),a;if(2==a.timeFlag)return Entry.hw.setDigitalPortValue(d,g),Entry.hw.setDigitalPortValue(c,h),Entry.hw.setDigitalPortValue(e,g),Entry.hw.setDigitalPortValue(f,h),delete a.isStart,delete a.timeFlag,Entry.engine.isContinue=!1,a.callReturn()}else{a.isStart=!0;a.timeFlag=1;var l=setTimeout(function(){a.timeFlag=2;Entry.dplay.removeTimeout(l)},50);Entry.dplay.timeouts.push(l);return a}},syntax:{js:[],py:["Dplay.dc_motor_speed(%1, %2)"]}}, +dplay_buzzer:{color:"#00979D",fontColor:"#FFF",skeleton:"basic",statements:[],template:"\ub514\uc9c0\ud138 10\ubc88 \ubd80\uc800\ub97c %1 %2 %3 \ubc15\uc790\ub85c \uc5f0\uc8fc\ud558\uae30",params:[{type:"Dropdown",options:[["\ub3c4","1"],["\ub3c4#","2"],["\ub808","3"],["\ubbf8b","4"],["\ubbf8","5"],["\ud30c","6"],["\ud30c#","7"],["\uc194","8"],["\uc194#","9"],["\ub77c","10"],["\uc2dcb","11"],["\uc2dc","12"],["\ubb34\uc74c","100"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Dropdown", +options:[["1","1"],["2","2"],["3","3"]],value:"1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:["1","1",{type:"text",params:["0.5"]},null],type:"dplay_buzzer"},paramsKeyMap:{NOTE:0,OCTAVE:1,VALUE:2},"class":"dplay_set",isNotFor:["dplay"],func:function(b,a){if(a.isStart){if(1==a.timeFlag)return a;Entry.hw.setDigitalPortValue(10,100);delete a.isStart;delete a.timeFlag;Entry.engine.isContinue= +!1;return a.callReturn()}var d=a.getNumberField("NOTE",a),c=a.getNumberField("OCTAVE",a),e=a.getNumberValue("VALUE"),c=d+12*(c-1),e=6E4*e/60;a.isStart=!0;a.timeFlag=1;100==d?Entry.hw.setDigitalPortValue(10,100):Entry.hw.setDigitalPortValue(10,c);if(100q?(m=Math.round(q-155),g=-m,h=0,Entry.dplay.Left_value=g):0==q&&(h=g=0,Entry.dplay.Left_value=0));"2"==n&&(e=6,f=11,0q?(m=Math.round(q-155),k=-m,l=0,Entry.dplay.Right_value=k):0==q&&(l=k=0,Entry.dplay.Right_value=k));"3"==n&&(d=3,c=5,e=6,f=11,0q?(m=Math.round(q-155),g=-m,h=0,k=-m,l=0,Entry.dplay.Left_value=g,Entry.dplay.Right_value=k):0==q&&(l=k=h=g=0,Entry.dplay.Left_value=0,Entry.dplay.Right_value=0));if(a.isStart){if(1==a.timeFlag)return Entry.hw.setDigitalPortValue(3,0),Entry.hw.setDigitalPortValue(5,0),Entry.hw.setDigitalPortValue(6,0),Entry.hw.setDigitalPortValue(11,0),a;if(2==a.timeFlag)return Entry.hw.setDigitalPortValue(d,g),Entry.hw.setDigitalPortValue(c,h),Entry.hw.setDigitalPortValue(e,l),Entry.hw.setDigitalPortValue(f, +k),delete a.isStart,delete a.timeFlag,Entry.engine.isContinue=!1,a.callReturn()}else{a.isStart=!0;a.timeFlag=1;var r=setTimeout(function(){a.timeFlag=2;Entry.dplay.removeTimeout(r)},50);Entry.dplay.timeouts.push(r);return a}}},dplay_robot_speed_set:{color:"#00979D",fontColor:"#FFF",skeleton:"basic",statements:[],template:"\uc624\ub978\ucabd \ubc14\ud034 %1 \uc67c\ucabd \ubc14\ud034 %2(\uc73c)\ub85c \uc815\ud558\uae30 %3",params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator", +img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"text",params:["100"]},{type:"text",params:["100"]},null],type:"dplay_robot_speed_set"},paramsKeyMap:{R_VALUE:0,L_VALUE:1},"class":"dplay_robot",isNotFor:["dplay"],func:function(b,a){var d=0,c=0,e=0,f=0,g=0,g=0,g=a.getNumberValue("L_VALUE",a),g=Math.max(g,-100),g=Math.min(g,100);0g?(g=Math.round(g-155),d=-g,c=0,Entry.dplay.Left_value=d):0==g&&(c=d=0,Entry.dplay.Left_value= +0);g=a.getNumberValue("R_VALUE",a);g=Math.max(g,-100);g=Math.min(g,100);0g?(g=Math.round(g-155),e=-g,f=0,Entry.dplay.Right_value=e):0==g&&(f=e=0,Entry.dplay.Right_value=0);if(a.isStart){if(1==a.timeFlag)return Entry.hw.setDigitalPortValue(3,0),Entry.hw.setDigitalPortValue(5,0),Entry.hw.setDigitalPortValue(6,0),Entry.hw.setDigitalPortValue(11,0),a;if(2==a.timeFlag)return Entry.hw.setDigitalPortValue(3,d),Entry.hw.setDigitalPortValue(5,c), +Entry.hw.setDigitalPortValue(6,f),Entry.hw.setDigitalPortValue(11,e),delete a.isStart,delete a.timeFlag,Entry.engine.isContinue=!1,a.callReturn()}else{a.isStart=!0;a.timeFlag=1;var h=setTimeout(function(){a.timeFlag=2;Entry.dplay.removeTimeout(h)},50);Entry.dplay.timeouts.push(h);return a}},syntax:{js:[],py:["Dplay.robot_speed_sel(%1, %2)"]}},dplay_robot_stop:{color:"#00979D",fontColor:"#FFF",skeleton:"basic",statements:[],template:"\ub85c\ubd07\uc744 \uc815\uc9c0\ud558\uae30 %1",params:[{type:"Indicator", +img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null],type:"dplay_robot_stop"},paramsKeyMap:{},"class":"dplay_robot",isNotFor:["dplay"],func:function(b,a){Entry.hw.setDigitalPortValue(3,0);Entry.hw.setDigitalPortValue(5,0);Entry.hw.setDigitalPortValue(11,0);Entry.hw.setDigitalPortValue(6,0);return a.callReturn()},syntax:{js:[],py:["Dplay.robot_stop()"]}},nemoino_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_sensor_number"}], +type:"nemoino_get_number_sensor_value"},"class":"arduino_value",syntax:{js:[],py:["Nemoino.sensor_value(%1)"]}},nemoino_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_port_number"}],type:"nemoino_get_digital_value"},"class":"arduino_value",syntax:{js:[],py:["Nemoino.digital_value(%1)"]}},nemoino_toggle_led:{parent:"arduino_toggle_led",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"nemoino_toggle_led"}, +"class":"arduino_set",syntax:{js:[],py:["Nemoino.toggle_led(%1)"]}},nemoino_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]},null],type:"nemoino_toggle_pwm"},"class":"arduino_set",syntax:{js:[],py:["Nemoino.toggle_pwm(%1, %2)"]}},nemoino_convert_scale:{parent:"arduino_convert_scale",isNotFor:["nemoino"],def:{params:[{type:"arduino_get_number_sensor_value",params:[{type:"arduino_get_sensor_number"}]}, +{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"nemoino_convert_scale"},"class":"arduino",syntax:{js:[],py:["Nemoino.convert_scale(%1, %2, %3, %4, %5)"]}},sensorBoard_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_sensor_number"}],type:"sensorBoard_get_number_sensor_value"},"class":"arduino_value",syntax:{js:[],py:["hw.sensorBoard_get_number_sensor_value(%1)"]}}, +sensorBoard_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_port_number"}],type:"sensorBoard_get_digital_value"},"class":"arduino_value",syntax:{js:[],py:["hw.sensorBoard_get_digital_value(%1)"]}},sensorBoard_toggle_led:{parent:"arduino_toggle_led",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"sensorBoard_toggle_led"},"class":"arduino_set",syntax:{js:[],py:["hw.sensorBoard_toggle_led(%1)"]}},sensorBoard_toggle_pwm:{parent:"arduino_toggle_pwm", +isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]},null],type:"sensorBoard_toggle_pwm"},"class":"arduino_set",syntax:{js:[],py:["hw.sensorBoard_toggle_pwm(%1, %2)"]}},sensorBoard_convert_scale:{parent:"arduino_convert_scale",isNotFor:["sensorBoard"],def:{params:[{type:"arduino_get_number_sensor_value",params:[{type:"arduino_get_sensor_number",id:"bl5e"}]},{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]}, +{type:"number",params:["100"]}],type:"sensorBoard_convert_scale"},"class":"arduino",syntax:{js:[],py:["hw.sensorBoard_convert_scale(%1, %2, %3, %4, %5)"]}},ardublock_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_sensor_number"}],type:"ardublock_get_number_sensor_value"},"class":"arduino_value"},ardublock_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_port_number"}], +type:"ardublock_get_digital_value"},"class":"arduino_value"},ardublock_toggle_led:{parent:"arduino_toggle_led",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"ardublock_toggle_led"},"class":"arduino_set"},ardublock_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["ardublock"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]},null],type:"ardublock_toggle_pwm"},"class":"arduino_set"},ardublock_convert_scale:{parent:"arduino_convert_scale", +isNotFor:["ardublock"],def:{params:[{type:"arduino_get_number_sensor_value",params:[{type:"arduino_get_sensor_number"}]},{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"ardublock_convert_scale"},"class":"arduino"},joystick_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["joystick"],def:{params:[{type:"arduino_get_sensor_number"}],type:"joystick_get_number_sensor_value"},"class":"arduino_value"}, +joystick_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["joystick"],def:{params:[{type:"arduino_get_port_number"}],type:"joystick_get_digital_value"},"class":"arduino_value"},joystick_toggle_led:{parent:"arduino_toggle_led",isNotFor:["joystick"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"joystick_toggle_led"},"class":"arduino_set"},joystick_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["joystick"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text", +params:["255"]},null],type:"joystick_toggle_pwm"},"class":"arduino_set"},joystick_convert_scale:{parent:"arduino_convert_scale",isNotFor:["joystick"],def:{params:[{type:"arduino_get_number_sensor_value",params:[{type:"arduino_get_sensor_number"}]},{type:"number",params:["0"]},{type:"number",params:["1023"]},{type:"number",params:["0"]},{type:"number",params:["100"]}],type:"joystick_convert_scale"},"class":"arduino"},ebs_if:{parent:"_if",def:{type:"_if",params:[{type:"reach_something",params:[null, +"wall"]}]}},ebs_if2:{parent:"_if",def:{type:"_if",params:[{type:"reach_something",params:[null,"cwz5"]}]}},ai_move_right:{skeleton:"basic",mode:"maze",color:"#A751E3",syntax:["Scope","move"],params:[{type:"Image",img:"/img/assets/week/blocks/moveStep.png",size:24}],func:function(b,a){if(a.isStart){if(a.isAction)return Entry.STATIC.BREAK;delete a.isAction;delete a.isStart}else{a.isStart=!0;a.isAction=!0;Ntry.dispatchEvent("gridChange",function(){a.isAction=!1});Ntry.entityManager.getComponent(b.id, +Ntry.STATIC.SPACE_SHIP).direction=Ntry.STATIC.EAST;var d=Ntry.entityManager.getComponent(b.id,Ntry.STATIC.GRID);Ntry.entityManager.addComponent(b.id,{type:Ntry.STATIC.ANIMATE,animateType:Ntry.STATIC.ROTATE_TO,animateValue:0});d.x++;return Entry.STATIC.BREAK}}},ai_move_up:{skeleton:"basic",mode:"maze",color:"#A751E3",syntax:["Scope","up"],params:[{type:"Image",img:"/img/assets/week/blocks/ai_move_up.png",size:24}],func:function(b,a){if(a.isStart){if(a.isAction)return a;delete a.isAction;delete a.isStart; +return a.callReturn()}a.isStart=!0;a.isAction=!0;Ntry.dispatchEvent("gridChange",function(){a.isAction=!1});Ntry.entityManager.getComponent(b.id,Ntry.STATIC.SPACE_SHIP).direction=Ntry.STATIC.NORTH;var d=Ntry.entityManager.getComponent(b.id,Ntry.STATIC.GRID);Ntry.entityManager.addComponent(b.id,{type:Ntry.STATIC.ANIMATE,animateType:Ntry.STATIC.ROTATE_TO,animateValue:-45});d.x++;d.y--;return a}},ai_move_down:{skeleton:"basic",mode:"maze",color:"#A751E3",syntax:["Scope","down"],params:[{type:"Image", +img:"/img/assets/week/blocks/ai_move_down.png",size:24}],func:function(b,a){if(a.isStart){if(a.isAction)return a;delete a.isAction;delete a.isStart;return a.callReturn()}a.isStart=!0;a.isAction=!0;Ntry.dispatchEvent("gridChange",function(){a.isAction=!1});Ntry.entityManager.getComponent(b.id,Ntry.STATIC.SPACE_SHIP).direction=Ntry.STATIC.SOUTH;var d=Ntry.entityManager.getComponent(b.id,Ntry.STATIC.GRID);Ntry.entityManager.addComponent(b.id,{type:Ntry.STATIC.ANIMATE,animateType:Ntry.STATIC.ROTATE_TO, animateValue:45});d.x++;d.y++;return a}},ai_repeat_until_reach:{skeleton:"basic_loop",mode:"maze",color:"#498DEB",syntax:["BasicWhile","true"],statements:[{accept:"basic"}],params:[{type:"Image",img:"/img/assets/week/blocks/for.png",size:24}],func:function(){var b=this.block.statements[0];if(0!==b.getBlocks().length)return this.executor.stepInto(b)}},ai_if_else_1:{skeleton:"basic_double_loop",mode:"maze",color:"#498DEB",syntax:["BasicIf","front == 'stone'"],statements:[{accept:"basic"},{accept:"basic"}], params:[{type:"Image",img:"/img/assets/ntry/bitmap/ai/obstacle_1.png",size:24},{type:"Image",img:"/img/assets/week/blocks/for.png",size:24},{type:"LineBreak"}],func:function(b,a){if(a.isLooped)return delete a.isLooped,a.callReturn();var d=Ntry.entityManager.getComponent(b.id,Ntry.STATIC.RADAR),c=this.block.statements,e=1;a.isLooped=!0;d.center.type==Ntry.STATIC.AI_METEO&&1==d.center.distance&&(e=0);this.executor.stepInto(c[e]);return Entry.STATIC.BREAK}},ai_boolean_distance:{skeleton:"basic_boolean_field", mode:"maze",color:"#2fc9f0",fontColor:"#fff",syntax:["Scope","radar_%1 %2 %3#"],params:[{type:"Dropdown",options:[[Lang.Menus.ai_above,"UP"],[Lang.Menus.ai_front,"RIGHT"],[Lang.Menus.ai_under,"DOWN"]],value:"RIGHT",fontSize:11},{type:"Dropdown",options:[[">","BIGGER"],[">=","BIGGER_EQUAL"],["=","EQUAL"],["<","SMALLER"],["<=","SMALLER_EQUAL"]],value:"BIGGER",fontSize:11},{type:"Block",accept:"string"}],func:function(b,a){var d=Ntry.entityManager.getComponent(b.id,Ntry.STATIC.RADAR),c=this.block.params, @@ -2368,22 +2369,22 @@ paramsKeyMap:{VALUE:0},"class":"roduino_value",isNotFor:["roborobo_roduino"],fun "class":"roduino_value",isNotFor:["roborobo_roduino"],func:function(b,a){var d=a.getNumberValue("VALUE",a);Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.DIGITAL_READ,d]);return Entry.hw.portData[d-2]}},roduino_get_color:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.roborobo_color_red,"red"],[Lang.Blocks.roborobo_color_green,"green"],[Lang.Blocks.roborobo_color_blue,"blue"],[Lang.Blocks.roborobo_color_yellow, "yellow"]],value:"red",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW}],events:{},def:{params:[null],type:"roduino_get_color"},paramsKeyMap:{VALUE:0},"class":"roduino_value",isNotFor:["roborobo_roduino"],func:function(b,a){var d=0,c=a.getField("VALUE",a),e=[Entry.hw.portData[Entry.Roborobo_Roduino.ColorPin[0]-2],Entry.hw.portData[Entry.Roborobo_Roduino.ColorPin[1]-2],Entry.hw.portData[Entry.Roborobo_Roduino.ColorPin[2]-2]];switch(c){case "red":1==e[0]&&0==e[1]&&0==e[2]&&(d=1);break;case "green":0== e[0]&&1==e[1]&&0==e[2]&&(d=1);break;case "blue":0==e[0]&&0==e[1]&&1==e[2]&&(d=1);break;case "yellow":1==e[0]&&1==e[1]&&1==e[2]&&(d=1)}return d}},roduino_set_digital:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Dropdown",options:[[Lang.Blocks.roborobo_on,"on"],[Lang.Blocks.roborobo_off,"off"]],value:"on",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"roduino_get_port_number"}, -null,null],type:"roduino_set_digital"},paramsKeyMap:{VALUE:0,OPERATOR:1},"class":"roduino_set",isNotFor:["roborobo_roduino"],func:function(b,a){var d=a.getNumberValue("VALUE",a),c="on"==a.getField("OPERATOR")?1:0;Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.DIGITAL_WRITE,d,c]);return a.callReturn()}},roduino_motor:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.roborobo_motor1,"motor1"],[Lang.Blocks.roborobo_motor2,"motor2"]], +null,null],type:"roduino_set_digital"},paramsKeyMap:{VALUE:0,OPERATOR:1},"class":"roduino_set",isNotFor:["roborobo_roduino"],func:function(b,a){var d=a.getNumberValue("VALUE",a),c=a.getField("OPERATOR");Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.DIGITAL_WRITE,d,"on"==c?1:0]);return a.callReturn()}},roduino_motor:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.roborobo_motor1,"motor1"],[Lang.Blocks.roborobo_motor2,"motor2"]], value:"motor1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Dropdown",options:[[Lang.Blocks.roborobo_motor_CW,"cw"],[Lang.Blocks.roborobo_motor_CCW,"ccw"],[Lang.Blocks.roborobo_motor_stop,"stop"]],value:"cw",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,null],type:"roduino_motor"},paramsKeyMap:{MODE:0,OPERATOR:1},"class":"roduino_set",isNotFor:["roborobo_roduino"],func:function(b,a){var d= pin2=0,c=value2=0,d=a.getField("MODE"),c=a.getField("OPERATOR");"motor1"==d?(d=9,pin2=10):(d=11,pin2=12);"cw"==c?(c=1,value2=0):"ccw"==c?(c=0,value2=1):value2=c=0;Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.MOTOR,d,c,pin2,value2]);return a.callReturn()}},roduino_set_color_pin:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png", size:12}],events:{},def:{params:[{type:"number",params:["2"]},{type:"number",params:["3"]},{type:"number",params:["4"]},null],type:"roduino_set_color_pin"},paramsKeyMap:{RED:0,GREEN:1,BLUE:2},"class":"roduino_set",isNotFor:["roborobo_roduino"],func:function(b,a){var d=a.getNumberValue("RED",a),c=a.getNumberValue("GREEN",a),e=a.getNumberValue("BLUE",a);Entry.Roborobo_Roduino.ColorPin=[d,c,e];Entry.Roborobo_Roduino.setSendData([Entry.Roborobo_Roduino.INSTRUCTION.COLOR,d,c,e]);return a.callReturn()}}, schoolkit_on_block:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"}],events:{},def:{params:[null],type:"schoolkit_on_block"},paramsKeyMap:{},"class":"schoolkit_value",isNotFor:["roborobo_schoolkit"],func:function(b,a){return"1"}},schoolkit_off_block:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"}],events:{},def:{params:[null],type:"schoolkit_off_block"},paramsKeyMap:{}, "class":"schoolkit_value",isNotFor:["roborobo_schoolkit"],func:function(b,a){return"0"}},schoolkit_get_out_port_number:{color:"#00979D",skeleton:"basic_string_field",statements:[],params:[{type:"Dropdown",options:[["OUT1",2],["OUT2",3],["OUT3",4],["OUT4",5],["OUT5",6]],value:2,fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW}],events:{},def:{params:[null]},paramsKeyMap:{PORT:0},func:function(b,a){return a.getNumberField("PORT")}},schoolkit_get_in_port_number:{color:"#00979D",skeleton:"basic_string_field", statements:[],params:[{type:"Dropdown",options:[["IN1",7],["IN2",8],["IN3",9],["IN4",10],["IN5",11],["IN6",12],["IN7",13]],value:7,fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW}],events:{},def:{params:[null]},paramsKeyMap:{PORT:0},func:function(b,a){return a.getNumberField("PORT")}},schoolkit_set_output:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Dropdown",options:[[Lang.Blocks.roborobo_on,"on"],[Lang.Blocks.roborobo_off,"off"]],value:"on",fontSize:11, -arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"schoolkit_get_out_port_number"},null,null],type:"schoolkit_set_output"},paramsKeyMap:{VALUE:0,OPERATOR:1},"class":"schoolkit_set",isNotFor:["roborobo_schoolkit"],func:function(b,a){var d=a.getNumberValue("VALUE",a),c="on"==a.getField("OPERATOR")?1:0;Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.DIGITAL_WRITE,d,c]);return a.callReturn()}},schoolkit_get_input_value:{color:"#00979D", +arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"schoolkit_get_out_port_number"},null,null],type:"schoolkit_set_output"},paramsKeyMap:{VALUE:0,OPERATOR:1},"class":"schoolkit_set",isNotFor:["roborobo_schoolkit"],func:function(b,a){var d=a.getNumberValue("VALUE",a),c=a.getField("OPERATOR");Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.DIGITAL_WRITE,d,"on"==c?1:0]);return a.callReturn()}},schoolkit_get_input_value:{color:"#00979D", fontColor:"#fff",skeleton:"basic_string_field",statements:[],params:[{type:"Block",accept:"string"}],events:{},def:{params:[{type:"schoolkit_get_in_port_number"}],type:"schoolkit_get_input_value"},paramsKeyMap:{VALUE:0},"class":"schoolkit_value",isNotFor:["roborobo_schoolkit"],func:function(b,a){var d=a.getNumberValue("VALUE",a);Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.DIGITAL_READ,d]);return Entry.hw.portData[d-7]}},schoolkit_motor:{color:"#00979D",skeleton:"basic", statements:[],params:[{type:"Dropdown",options:[[Lang.Blocks.roborobo_motor1,"motor1"],[Lang.Blocks.roborobo_motor2,"motor2"]],value:"motor1",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Block",accept:"string"},{type:"Dropdown",options:[[Lang.Blocks.roborobo_motor_CW,"cw"],[Lang.Blocks.roborobo_motor_CCW,"ccw"],[Lang.Blocks.roborobo_motor_stop,"stop"]],value:"cw",fontSize:11,arrowColor:EntryStatic.ARROW_COLOR_HW},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{}, -def:{params:[null,{type:"number",params:["0"]},null,null],type:"schoolkit_motor"},paramsKeyMap:{MODE:0,VALUE:1,OPERATOR:2},"class":"schoolkit_set",isNotFor:["roborobo_schoolkit"],func:function(b,a){var d=0,c=0,d=a.getField("MODE"),e=a.getField("OPERATOR"),f=a.getNumberValue("VALUE"),d="motor1"==d?7:8;255f&&(f=0);"cw"==e?Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,1,d,f]):"ccw"==e?Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR, -2,d,f]):"stop"==e&&Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,c,d,f]);return a.callReturn()}},schoolkit_set_servo_value:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"schoolkit_get_out_port_number"},{type:"number",params:["0"]},null],type:"schoolkit_set_servo_value"},paramsKeyMap:{PIN:0,VALUE:1},"class":"schoolkit_set", +def:{params:[null,{type:"number",params:["0"]},null,null],type:"schoolkit_motor"},paramsKeyMap:{MODE:0,VALUE:1,OPERATOR:2},"class":"schoolkit_set",isNotFor:["roborobo_schoolkit"],func:function(b,a){var d=0,d=a.getField("MODE"),c=a.getField("OPERATOR"),e=a.getNumberValue("VALUE"),d="motor1"==d?7:8;255e&&(e=0);"cw"==c?Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,1,d,e]):"ccw"==c?Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR, +2,d,e]):"stop"==c&&Entry.Roborobo_SchoolKit.setSendData([Entry.Roborobo_SchoolKit.INSTRUCTION.MOTOR,0,d,e]);return a.callReturn()}},schoolkit_set_servo_value:{color:"#00979D",skeleton:"basic",statements:[],params:[{type:"Block",accept:"string"},{type:"Block",accept:"string"},{type:"Indicator",img:"block_icon/hardware_03.png",size:12}],events:{},def:{params:[{type:"schoolkit_get_out_port_number"},{type:"number",params:["0"]},null],type:"schoolkit_set_servo_value"},paramsKeyMap:{PIN:0,VALUE:1},"class":"schoolkit_set", isNotFor:["roborobo_schoolkit"],func:function(b,a){var d=a.getNumberValue("PIN",a),c=a.getNumberValue("VALUE");0>c?c=0:180d&& @@ -2398,29 +2399,29 @@ fontColor:"#fff",skeleton:"basic_string_field",statements:[],template:"\uc628\ub size:11}],events:{},def:{params:["x",null],type:"codestar_gyroscope"},paramsKeyMap:{AXIS:0},class:"codestar_input_sensor",isNotFor:["codestar"],func:function(b,a){return Entry.hw.getAnalogPortValue("gyro_"+axis)}},codestar_geomagnetic:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],template:"3\ucd95 \uc9c0\uc790\uae30 %1 \ucd95 %2",params:[{type:"Dropdown",options:[["x","x"],["y","y"],["z","z"]]},{type:"Indicator",size:11}],events:{},def:{params:["x",null],type:"codestar_geomagnetic"}, paramsKeyMap:{AXIS:0},class:"codestar_input_sensor",isNotFor:["codestar"],func:function(b,a){var d=a.getField("AXIS");return Entry.hw.getAnalogPortValue("geo_"+d)}},codestar_irR:{color:"#00979D",fontColor:"#fff",skeleton:"basic_string_field",statements:[],template:"IR \ub9ac\ubaa8\ucf58",params:[],events:{},def:{params:[],type:"codestar_irR"},paramsKeyMap:{},class:"codestar_input_sensor",isNotFor:["codestar"],func:function(b,a){return Entry.hw.getDigitalPortValue("4")}},codestar_tilt:{color:"#00979D", fontColor:"#fff",skeleton:"basic_string_field",statements:[],template:"\ud2f8\ud2b8",params:[],events:{},def:{params:[],type:"codestar_tilt"},paramsKeyMap:{},class:"codestar_input_sensor",isNotFor:["codestar"],func:function(b,a){return Entry.hw.getDigitalPortValue("6")}},hidden:{color:"#7C7C7C",skeleton:"basic",template:" ? %1",statements:[],params:[{type:"Indicator",color:"#6B6B6B",size:12}],events:{},def:{params:[null],type:"hidden"},paramsKeyMap:{VALUE:0},"class":"etc",isNotFor:[], -func:function(b,a){}}};(function(){for(var b in Entry.block){var a=Entry.block[b];if(a.parent){var d=function(){};d.prototype=Entry.block[a.parent];var d=new d,c;for(c in a)d[c]=a[c];Entry.block[b]=d}}})();"object"==typeof exports&&(exports.block=Entry.block);Entry.BlockMenu=function(b,a,d,c){Entry.Model(this,!1);this._align=a||"CENTER";this.setAlign(this._align);this._scroll=void 0!==c?c:!1;this._bannedClass=[];this._categories=[];this.suffix="blockMenu";b="string"===typeof b?$("#"+b):$(b);if("DIV"!==b.prop("tagName"))return console.error("Dom is not div element");this.view=b;this.visible=!0;this._svgId="blockMenu"+(new Date).getTime();this._clearCategory();this._categoryData=d;this._generateView(d);this._splitters=[];this.setWidth();this.svg=Entry.SVG(this._svgId); -Entry.Utils.addFilters(this.svg,this.suffix);this.pattern=Entry.Utils.addBlockPattern(this.svg,this.suffix).pattern;this.svgGroup=this.svg.elem("g");this.svgThreadGroup=this.svgGroup.elem("g");this.svgThreadGroup.board=this;this.svgBlockGroup=this.svgGroup.elem("g");this.svgBlockGroup.board=this;this.changeEvent=new Entry.Event(this);d&&this._generateCategoryCodes(d);this.observe(this,"_handleDragBlock",["dragBlock"]);this._scroll&&(this._scroller=new Entry.BlockMenuScroller(this),this._addControl(b)); -Entry.documentMousedown&&Entry.documentMousedown.attach(this,this.setSelectedBlock);this._categoryCodes&&Entry.keyPressed&&Entry.keyPressed.attach(this,this._captureKeyEvent);Entry.windowResized&&(b=_.debounce(this.updateOffset,200),Entry.windowResized.attach(this,b))}; +func:function(b,a){}}};(function(){for(var b in Entry.block){var a=Entry.block[b];if(a.parent){var d=function(){};d.prototype=Entry.block[a.parent];var d=new d,c;for(c in a)d[c]=a[c];Entry.block[b]=d}}})();"object"==typeof exports&&(exports.block=Entry.block);Entry.BlockMenu=function(b,a,d,c){Entry.Model(this,!1);this._align=a||"CENTER";this.setAlign(this._align);this._scroll=void 0!==c?c:!1;this._bannedClass=[];this._categories=[];this.suffix="blockMenu";this._isSelectingMenu=!1;b="string"===typeof b?$("#"+b):$(b);if("DIV"!==b.prop("tagName"))return console.error("Dom is not div element");this.view=b;this.visible=!0;this._svgId="blockMenu"+(new Date).getTime();this._clearCategory();this._categoryData=d;this._generateView(d);this._splitters=[];this.setWidth(); +this.svg=Entry.SVG(this._svgId);Entry.Utils.addFilters(this.svg,this.suffix);this.pattern=Entry.Utils.addBlockPattern(this.svg,this.suffix).pattern;this.svgGroup=this.svg.elem("g");this.svgThreadGroup=this.svgGroup.elem("g");this.svgThreadGroup.board=this;this.svgBlockGroup=this.svgGroup.elem("g");this.svgBlockGroup.board=this;this.changeEvent=new Entry.Event(this);d&&this._generateCategoryCodes(d);this.observe(this,"_handleDragBlock",["dragBlock"]);this._scroll&&(this._scroller=new Entry.BlockMenuScroller(this), +this._addControl(b));Entry.documentMousedown&&Entry.documentMousedown.attach(this,this.setSelectedBlock);this._categoryCodes&&Entry.keyPressed&&Entry.keyPressed.attach(this,this._captureKeyEvent);Entry.windowResized&&(b=_.debounce(this.updateOffset,200),Entry.windowResized.attach(this,b))}; (function(b){b.schema={code:null,dragBlock:null,closeBlock:null,selectedBlockView:null};b._generateView=function(a){var b=this.view,c=this;a&&(this._categoryCol=Entry.Dom("ul",{class:"entryCategoryListWorkspace",parent:b}),this._generateCategoryView(a));this.blockMenuContainer=Entry.Dom("div",{"class":"blockMenuContainer",parent:b});this.svgDom=Entry.Dom($(''),{parent:this.blockMenuContainer});this.svgDom.mouseenter(function(a){c._scroller&& c._scroller.setOpacity(1);a=c.workspace.selectedBlockView;!Entry.playground||Entry.playground.resizing||a&&a.dragMode===Entry.DRAG_MODE_DRAG||(Entry.playground.focusBlockMenu=!0,a=c.svgGroup.getBBox(),a=a.width+a.x+64,a>Entry.interfaceState.menuWidth&&(this.widthBackup=Entry.interfaceState.menuWidth-64,$(this).stop().animate({width:a-62},200)))});this.svgDom.mouseleave(function(a){Entry.playground&&!Entry.playground.resizing&&(c._scroller&&c._scroller.setOpacity(0),(a=this.widthBackup)&&$(this).stop().animate({width:a}, 200),delete this.widthBackup,delete Entry.playground.focusBlockMenu)});$(window).scroll(function(){c.updateOffset()})};b.changeCode=function(a){if(!(a instanceof Entry.Code))return console.error("You must inject code instance");this.codeListener&&this.code.changeEvent.detach(this.codeListener);var b=this;this.set({code:a});this.codeListener=this.code.changeEvent.attach(this,function(){b.changeEvent.notify()});a.createView(this);this.workspace.getMode();this.workspace.getMode()===Entry.Workspace.MODE_VIMBOARD? -a.mode&&"code"!==a.mode||this.renderText():"text"===a.mode&&this.renderBlock();this.align()};b.bindCodeView=function(a){this.svgBlockGroup.remove();this.svgThreadGroup.remove();this.svgBlockGroup=a.svgBlockGroup;this.svgThreadGroup=a.svgThreadGroup;this.svgGroup.appendChild(this.svgThreadGroup);this.svgGroup.appendChild(this.svgBlockGroup);this._scroller&&this.svgGroup.appendChild(this._scroller.svgGroup)};b.align=function(a){var b=this.code;if(b){this._clearSplitters();b.view&&!a&&b.view.reDraw(); -a=b.getThreads();for(var b=10,c="LEFT"==this._align?10:this.svgDom.width()/2,e,f=0,g=a.length;fthis._bannedClass.indexOf(a)&& -this._bannedClass.push(a);this.align(b)};b.unbanClass=function(a,b){var c=this._bannedClass.indexOf(a);-1b&&(a.preventDefault(),this.selectMenu(b-49))};b.enablePattern=function(){this.pattern.removeAttribute("style")};b.disablePattern=function(){this.pattern.attr({style:"display: none"})};b._clearCategory=function(){this._selectedCategoryView=null;this._categories=[];var a=this._categoryElems,b;for(b in a)a[b].remove(); -this._categoryElems={};a=this._categoryCodes;for(b in a){var c=a[b];c.constructor==Entry.Code&&c.clear()}this._categoryCodes=null};b.setCategoryData=function(a){this._clearCategory();this._categoryData=a;this._generateCategoryView(a);this._generateCategoryCodes(a)};b._generateCategoryView=function(a){if(a)for(var b=0;bthis._bannedClass.indexOf(a)&&this._bannedClass.push(a);this.align(b)};b.unbanClass=function(a,b){var c=this._bannedClass.indexOf(a);-1b&&(a.preventDefault(),this.selectMenu(b-49))};b.enablePattern=function(){this.pattern.removeAttribute("style")};b.disablePattern=function(){this.pattern.attr({style:"display: none"})}; +b._clearCategory=function(){this._selectedCategoryView=null;this._categories=[];var a=this._categoryElems,b;for(b in a)a[b].remove();this._categoryElems={};a=this._categoryCodes;for(b in a){var c=a[b];c.constructor==Entry.Code&&c.clear()}this._categoryCodes=null};b.setCategoryData=function(a){this._clearCategory();this._categoryData=a;this._generateCategoryView(a);this._generateCategoryCodes(a)};b._generateCategoryView=function(a){if(a)for(var b=0;b=a?this.setVisible(!1):this.setVisible(!0)};b._reset=function(){this.vY=0;this.vScrollbar.attr({y:this.vY});this.resizeScrollBar()};b.onMouseDown=function(a){function b(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&&a.preventDefault();a=a.originalEvent&&a.originalEvent.touches? @@ -2458,17 +2459,16 @@ this.set({offsetY:a}))}else this._clonedShadow&&(this._clonedShadow.attr({displa b.renderBlock=function(){this._startContentRender(Entry.Workspace.MODE_BOARD)};b._updateOpacity=function(){this.svgGroup.attr({opacity:!1===this.visible?0:1});this.visible&&this._setPosition()};b._updateShadow=function(){this.shadow&&Entry.Utils.colorDarken(this._schema.color,.7)};b._setMovable=function(){this.movable=null!==this.block.isMovable()?this.block.isMovable():void 0!==this._skeleton.movable?this._skeleton.movable:!0};b._setReadOnly=function(){this.readOnly=null!==this.block.isReadOnly()? this.block.isReadOnly():void 0!==this._skeleton.readOnly?this._skeleton.readOnly:!1};b._setCopyable=function(){this.copyable=null!==this.block.isCopyable()?this.block.isCopyable():void 0!==this._skeleton.copyable?this._skeleton.copyable:!0};b.bumpAway=function(a,b){var c=this;a=a||15;b?window.setTimeout(function(){c._moveBy(a,a,!1)},b):c._moveBy(a,a,!1)};b.bindPrev=function(a,b){if(a){this._toLocalCoordinate(a.view._nextGroup);var c=a.getNextBlock();if(c&&c&&c!==this.block){var e=this.block.getLastBlock(); b?c.view._toLocalCoordinate(a.view._nextGroup):e.view.magnet.next?c.view._toLocalCoordinate(e.view._nextGroup):(c.view._toGlobalCoordinate(),c.separate(),c.view.bumpAway(null,100))}}else if(a=this.block.getPrevBlock())this._toLocalCoordinate(a.view._nextGroup),(c=this.block.getNextBlock())&&c.view&&c.view._toLocalCoordinate(this._nextGroup)};b.getAbsoluteCoordinate=function(a){a=void 0!==a?a:this.dragMode;if(a===Entry.DRAG_MODE_DRAG)return{x:this.x,y:this.y};a=this.block.getThread().view.requestAbsoluteCoordinate(this); -a.x+=this.x;a.y+=this.y;return a};b.getBelowHeight=function(){return this.block.getThread().view.requestPartHeight(this)};b._updateDisplay=function(){this.svgGroup.attr({display:!1===this.display?"none":"block"});this.display&&this._setPosition()};b._updateColor=function(){var a=this._schema.color;this.block.deletable===Entry.Block.DELETABLE_FALSE_LIGHTEN&&(a=Entry.Utils.colorLighten(a));this._fillColor=a;this._path.attr({fill:a});this._updateContents()};b._updateContents=function(){for(var a=0;a< -this._contents.length;a++)this._contents[a].renderStart();this.alignContent(!1)};b._destroyObservers=function(){for(var a=this._observers;a.length;)a.pop().destroy()};b._changeFill=function(a){var b=this.getBoard();if(!b.dragBlock){var c=this._fillColor,e=this._path,b=this.getBoard();a?(c="url(#blockHoverPattern_"+this.getBoard().suffix+")",b.enablePattern()):b.disablePattern();e.attr({fill:c})}};b.addActivated=function(){this.svgGroup.addClass("activated")};b.removeActivated=function(){this.svgGroup.removeClass("activated")}; -b.reDraw=function(){if(this.visible){var a=this.block;requestAnimFrame(this._updateContents.bind(this));var b=a.params;if(b)for(var c=0;c\s+/g,">").replace(/\s+(svgGroup)(defs)', -h=this.svgGroup.getBoundingClientRect(),k=a?this.svgGroup:this.svgGroup.cloneNode(!0),l=this._skeleton.box(this),m=b?1:1.5,n=function(){var a=window.platform;return a&&"windows"===a.name.toLowerCase()&&"7"===a.version[0]?!0:!1}()?.9:.95;-1<=+-x/".split(""),v=0;v\s+/g,">").replace(/\s+(svgGroup)(defs)',h=this.svgGroup.getBoundingClientRect(),k=a?this.svgGroup:this.svgGroup.cloneNode(!0), +l=this._skeleton.box(this),m=b?1:1.5,n=function(){var a=window.platform;return a&&"windows"===a.name.toLowerCase()&&"7"===a.version[0]?!0:!1}()?.9:.95;-1<=+-x/".split(""),v=0;ve||c.splice(e,1)}};b.raiseEvent=function(a,b,c){a=this._eventMap[a];var e=[];if(void 0!==a){for(var f=0;fMath.PI?1:0;this._fillPath=this.svgOption ""===a||(a=this.modValue(a),this.setValue(a),this.updateGraph(),this.textElement.textContent=this.getValue(),this.optionGroup&&this.optionGroup.val(a),this.resize())};b.resize=function(){var a=this.getTextWidth();this._header.attr({width:a});this.optionGroup&&this.optionGroup.css({width:a});this.box.set({width:a});this._block.view.alignContent()};b.getTextWidth=function(){return this.textElement?this.textElement.getComputedTextLength()+8:8};b.getText=function(){return this.getValue()+"\u00b0"};b.modValue= function(a){return a%360};b.destroyOption=function(){this.disposeEvent&&(Entry.disposeEvent.detach(this.disposeEvent),delete this.documentDownEvent);this.optionGroup&&(this.optionGroup.remove(),delete this.optionGroup);this.svgOptionGroup&&(this.svgOptionGroup.remove(),delete this.svgOptionGroup);this.textElement.textContent=this.getText();this.command()}})(Entry.FieldAngle.prototype);Entry.FieldBlock=function(b,a,d,c,e){Entry.Model(this,!1);this._blockView=a;this._block=a.block;this._valueBlock=null;this.box=new Entry.BoxModel;this.changeEvent=new Entry.Event(this);this._index=d;this.contentIndex=e;this._content=b;this.acceptType=b.accept;this._restoreCurrent=b.restore;this.view=this;this.svgGroup=null;this._position=b.position;this.box.observe(a,"alignContent",["width","height"]);this.observe(this,"_updateBG",["magneting"],!1);this.renderStart(a.getBoard(),c)}; Entry.Utils.inherit(Entry.Field,Entry.FieldBlock); -(function(b){b.schema={magneting:!1};b.renderStart=function(a,b){this.svgGroup=this._blockView.contentSvgGroup.elem("g");this.view=this;this._nextGroup=this.svgGroup;this.box.set({x:0,y:0,width:0,height:20});var c=this.getValue();c&&!c.view&&(c.setThread(this),c.createView(a,b),c.getThread().view.setParent(this));this.updateValueBlock(c);this._blockView.getBoard().constructor!==Entry.Board&&this._valueBlock.view.removeControl()};b.align=function(a,b,c){var e=this.svgGroup;this._position&&(this._position.x&& -(a=this._position.x),this._position.y&&(b=this._position.y));var f=this._valueBlock;f&&(b=-.5*f.view.height);f="translate("+a+","+b+")";void 0===c||c?e.animate({transform:f},300,mina.easeinout):e.attr({transform:f});this.box.set({x:a,y:b})};b.calcWH=function(){var a=this._valueBlock;a?(a=a.view,this.box.set({width:a.width,height:a.height})):this.box.set({width:15,height:20})};b.calcHeight=b.calcWH;b.destroy=function(){};b.inspectBlock=function(){var a=null;if(this._originBlock)a=this._originBlock.type, -delete this._originBlock;else switch(this.acceptType){case "boolean":a="True";break;case "string":a="text";break;case "param":a="function_field_label"}return this._createBlockByType(a)};b._setValueBlock=function(a){this._restoreCurrent&&(this._originBlock=this._valueBlock);a||(a=this.inspectBlock());this._valueBlock=a;this.setValue(a);a.setThread(this);a.getThread().view.setParent(this);return this._valueBlock};b.getValueBlock=function(){return this._valueBlock};b.updateValueBlock=function(a){a instanceof -Entry.Block||(a=void 0);this._destroyObservers();a=this._setValueBlock(a).view;a.bindPrev(this);this._blockView.alignContent();this._posObserver=a.observe(this,"updateValueBlock",["x","y"],!1);this._sizeObserver=a.observe(this,"calcWH",["width","height"]);a=this._blockView.getBoard();a.constructor===Entry.Board&&a.generateCodeMagnetMap()};b._destroyObservers=function(){this._sizeObserver&&this._sizeObserver.destroy();this._posObserver&&this._posObserver.destroy()};b.getPrevBlock=function(a){return this._valueBlock=== -a?this:null};b.getNextBlock=function(){return null};b.requestAbsoluteCoordinate=function(a){a=this._blockView;var b=a.contentPos;a=a.getAbsoluteCoordinate();a.x+=this.box.x+b.x;a.y+=this.box.y+b.y;return a};b.dominate=function(){this._blockView.dominate()};b.isGlobal=function(){return!1};b.separate=function(a){this.getCode().createThread([a]);this.calcWH();this.changeEvent.notify()};b.getCode=function(){return this._block.thread.getCode()};b.cut=function(a){return this._valueBlock===a?[a]:null};b.replace= -function(a){"string"===typeof a&&(a=this._createBlockByType(a));var b=this._valueBlock;Entry.block[b.type].isPrimitive?(b.doNotSplice=!0,b.destroy()):"param"===this.acceptType?(this._destroyObservers(),b.view._toGlobalCoordinate(),a.getTerminateOutputBlock().view._contents[1].replace(b)):(this._destroyObservers(),b.view._toGlobalCoordinate(),this.separate(b),b.view.bumpAway(30,150));this.updateValueBlock(a);a.view._toLocalCoordinate(this.svgGroup);this.calcWH();this.changeEvent.notify()};b.setParent= -function(a){this._parent=a};b.getParent=function(){return this._parent};b._createBlockByType=function(a){this._block.getThread();var b=this._blockView.getBoard();a=new Entry.Block({type:a},this);var c=b.workspace,e;c&&(e=c.getMode());a.createView(b,e);return a};b.spliceBlock=function(){this.updateValueBlock()};b._updateBG=function(){this.magneting?this._bg=this.svgGroup.elem("path",{d:"m 8,12 l -4,0 -2,-2 0,-3 3,0 1,-1 0,-12 -1,-1 -3,0 0,-3 2,-2 l 4,0 z",fill:"#fff",stroke:"#fff","fill-opacity":.7, -transform:"translate(0,12)"}):this._bg&&(this._bg.remove(),delete this._bg)};b.getThread=function(){return this};b.pointer=function(a){a.unshift(this._index);a.unshift(Entry.PARAM);return this._block.pointer(a)}})(Entry.FieldBlock.prototype);Entry.FieldColor=function(b,a,d){this._block=a.block;this._blockView=a;this.box=new Entry.BoxModel;this.svgGroup=null;this._contents=b;this._index=d;this._position=b.position;this.key=b.key;this.setValue(this.getValue()||"#FF0000");this._CONTENT_HEIGHT=this.getContentHeight();this._CONTENT_WIDTH=this.getContentWidth();this.renderStart(a)};Entry.Utils.inherit(Entry.Field,Entry.FieldColor); +(function(b){b.schema={magneting:!1};b.renderStart=function(a,b){this.svgGroup||(this.svgGroup=this._blockView.contentSvgGroup.elem("g"));this.view=this;this._nextGroup=this.svgGroup;this.box.set({x:0,y:0,width:0,height:20});var c=this.getValue();c&&!c.view?(c.setThread(this),c.createView(a,b),c.getThread().view.setParent(this)):c&&c.view&&c.view.reDraw();this.updateValueBlock(c);this._blockView.getBoard().constructor!==Entry.Board&&this._valueBlock.view.removeControl()};b.align=function(a,b,c){var e= +this.svgGroup;this._position&&(this._position.x&&(a=this._position.x),this._position.y&&(b=this._position.y));var f=this._valueBlock;f&&f&&f.view&&(b=-.5*f.view.height);f="translate("+a+","+b+")";void 0===c||c?e.animate({transform:f},300,mina.easeinout):e.attr({transform:f});this.box.set({x:a,y:b})};b.calcWH=function(){var a=this._valueBlock;a&&a&&a.view?(a=a.view,this.box.set({width:a.width,height:a.height})):this.box.set({width:15,height:20})};b.calcHeight=b.calcWH;b.destroy=function(){};b.inspectBlock= +function(){var a=null;if(this._originBlock)a=this._originBlock.type,delete this._originBlock;else switch(this.acceptType){case "boolean":a="True";break;case "string":a="text";break;case "param":a="function_field_label"}return this._createBlockByType(a)};b._setValueBlock=function(a){this._restoreCurrent&&(this._originBlock=this._valueBlock);a||(a=this.inspectBlock());this._valueBlock=a;this.setValue(a);a.setThread(this);a.getThread().view.setParent(this);return this._valueBlock};b.getValueBlock=function(){return this._valueBlock}; +b.updateValueBlock=function(a){a instanceof Entry.Block||(a=void 0);a&&a===this._valueBlock?this.calcWH():(this._destroyObservers(),a=this._setValueBlock(a).view,a.bindPrev(this),this._blockView.alignContent(),this._posObserver=a.observe(this,"updateValueBlock",["x","y"],!1),this._sizeObserver=a.observe(this,"calcWH",["width","height"]),a=this._blockView.getBoard(),a.constructor===Entry.Board&&a.generateCodeMagnetMap())};b._destroyObservers=function(){this._sizeObserver&&this._sizeObserver.destroy(); +this._posObserver&&this._posObserver.destroy()};b.getPrevBlock=function(a){return this._valueBlock===a?this:null};b.getNextBlock=function(){return null};b.requestAbsoluteCoordinate=function(a){a=this._blockView;var b=a.contentPos;a=a.getAbsoluteCoordinate();a.x+=this.box.x+b.x;a.y+=this.box.y+b.y;return a};b.dominate=function(){this._blockView.dominate()};b.isGlobal=function(){return!1};b.separate=function(a){this.getCode().createThread([a]);this.calcWH();this.changeEvent.notify()};b.getCode=function(){return this._block.thread.getCode()}; +b.cut=function(a){return this._valueBlock===a?[a]:null};b.replace=function(a){"string"===typeof a&&(a=this._createBlockByType(a));var b=this._valueBlock;Entry.block[b.type].isPrimitive?(b.doNotSplice=!0,b.destroy()):"param"===this.acceptType?(this._destroyObservers(),b.view._toGlobalCoordinate(),a.getTerminateOutputBlock().view._contents[1].replace(b)):(this._destroyObservers(),b.view._toGlobalCoordinate(),this.separate(b),b.view.bumpAway(30,150));this.updateValueBlock(a);a.view._toLocalCoordinate(this.svgGroup); +this.calcWH();this.changeEvent.notify()};b.setParent=function(a){this._parent=a};b.getParent=function(){return this._parent};b._createBlockByType=function(a){this._block.getThread();var b=this._blockView.getBoard();a=new Entry.Block({type:a},this);var c=b.workspace,e;c&&(e=c.getMode());a.createView(b,e);return a};b.spliceBlock=function(){this.updateValueBlock()};b._updateBG=function(){this.magneting?this._bg=this.svgGroup.elem("path",{d:"m 8,12 l -4,0 -2,-2 0,-3 3,0 1,-1 0,-12 -1,-1 -3,0 0,-3 2,-2 l 4,0 z", +fill:"#fff",stroke:"#fff","fill-opacity":.7,transform:"translate(0,12)"}):this._bg&&(this._bg.remove(),delete this._bg)};b.getThread=function(){return this};b.pointer=function(a){a.unshift(this._index);a.unshift(Entry.PARAM);return this._block.pointer(a)}})(Entry.FieldBlock.prototype);Entry.FieldColor=function(b,a,d){this._block=a.block;this._blockView=a;this.box=new Entry.BoxModel;this.svgGroup=null;this._contents=b;this._index=d;this._position=b.position;this.key=b.key;this.setValue(this.getValue()||"#FF0000");this._CONTENT_HEIGHT=this.getContentHeight();this._CONTENT_WIDTH=this.getContentWidth();this.renderStart(a)};Entry.Utils.inherit(Entry.Field,Entry.FieldColor); (function(b){b.renderStart=function(){this.svgGroup&&$(this.svgGroup).remove();this.svgGroup=this._blockView.contentSvgGroup.elem("g",{class:"entry-field-color"});var a=this._CONTENT_HEIGHT,b=this._CONTENT_WIDTH,c=this._position,e;c?(e=c.x||0,c=c.y||0):(e=0,c=-a/2);this._header=this.svgGroup.elem("rect",{x:e,y:c,width:b,height:a,fill:this.getValue()});this._bindRenderOptions();this.box.set({x:e,y:c,width:b,height:a})};b.renderOptions=function(){var a=this;this._attachDisposeEvent();var b=Entry.FieldColor.getWidgetColorList(); this.optionGroup=Entry.Dom("table",{class:"entry-widget-color-table",parent:$("body")});for(var c=0;c'),{parent:this._container});this.svg=Entry.SVG("globalSvg");this.top=this.left=0;this._inited=!0}}; b.setView=function(a,b){if(a!=this._view&&!a.block.isReadOnly()&&a.movable)return this._view=a,this._mode=b,b!==Entry.Workspace.MODE_VIMBOARD&&a.set({visible:!1}),this.draw(),this.show(),this.align(),this.position(),!0};b.draw=function(){var a=this._view;this._svg&&this.remove();var b=this._mode==Entry.Workspace.MODE_VIMBOARD;this.svgGroup=Entry.SVG.createElement(a.svgGroup.cloneNode(!0),{opacity:1});this.svg.appendChild(this.svgGroup);b&&(a=$(this.svgGroup),a.find("g").css({filter:"none"}),a.find("path").velocity({opacity:0}, {duration:500}),a.find("text").velocity({fill:"#000000"},{duration:530}))};b.remove=function(){this.svgGroup&&(this.svgGroup.remove(),delete this.svgGroup,delete this._view,delete this._offsetX,delete this._offsetY,delete this._startX,delete this._startY,this.hide())};b.align=function(){var a=this._view.getSkeleton().box(this._view).offsetX||0,b=this._view.getSkeleton().box(this._view).offsetY||0,a=-1*a+1,b=-1*b+1;this._offsetX=a;this._offsetY=b;this.svgGroup.attr({transform:"translate("+a+","+b+ diff --git a/src/function.js b/src/function.js index ed6082295b..4392e54832 100644 --- a/src/function.js +++ b/src/function.js @@ -439,30 +439,33 @@ Entry.Func.generateWsBlock = function(targetFunc) { }); var funcName = "func_" + targetFunc.id; - var origin = Entry.block[funcName]; + var originSchema = Entry.block[funcName]; - var shouldGenerate = false; + var shouldFuncMutate = false; - if (origin.template !== schemaTemplate) - shouldGenerate = true; - else if (origin.params.length === schemaParams.length) { - for (var i=0; i Date: Fri, 21 Oct 2016 11:58:08 +0900 Subject: [PATCH 5/5] remove useless --- dist/entry.js | 12 +----------- dist/entry.min.js | 6 +++--- src/workspace/field/output.js | 1 - 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/dist/entry.js b/dist/entry.js index 7ec2275e65..a913b6cb59 100644 --- a/dist/entry.js +++ b/dist/entry.js @@ -22758,17 +22758,7 @@ Entry.Utils.inherit(Entry.Field, Entry.FieldOutput); }; b._updateValueBlock = function(a) { a instanceof Entry.Block || (a = void 0); - if (a && a === this._valueBlock) { - this.calcWH(); - } else { - this._sizeObserver && this._sizeObserver.destroy(); - this._posObserver && this._posObserver.destroy(); - if (a = this._setValueBlock(a)) { - a = a.view, a.bindPrev(), this._posObserver = a.observe(this, "_updateValueBlock", ["x", "y"], !1), this._sizeObserver = a.observe(this, "calcWH", ["width", "height"]); - } - this.calcWH(); - this._blockView.alignContent(); - } + a && a === this._valueBlock ? this.calcWH() : (this._sizeObserver && this._sizeObserver.destroy(), this._posObserver && this._posObserver.destroy(), (a = this._setValueBlock(a)) ? (a = a.view, a.bindPrev(), this._posObserver = a.observe(this, "_updateValueBlock", ["x", "y"], !1), this._sizeObserver = a.observe(this, "calcWH", ["width", "height"])) : this.calcWH(), this._blockView.alignContent()); }; b.getPrevBlock = function(a) { return this._valueBlock === a ? this : null; diff --git a/dist/entry.min.js b/dist/entry.min.js index 20e900e6c7..122b071dec 100644 --- a/dist/entry.min.js +++ b/dist/entry.min.js @@ -2542,9 +2542,9 @@ parent:$("body")});this.optionGroup.css({left:a.x,top:a.y})};b.destroyOption=fun this.applyValue(b,a)}};b.applyValue=function(a,b){this.setValue(String(b));this.destroyOption();this.textElement.textContent=a;this.resize()};b.resize=function(){var a=this.getTextWidth()+1;this._header.attr({width:a});this.box.set({width:a});this._blockView.alignContent()};b.getTextWidth=function(){return this.textElement.getComputedTextLength()+10};b.destroy=function(){this.destroyOption();Entry.keyPressed&&this.keyPressed&&Entry.keyPressed.detach(this.keyPressed)}})(Entry.FieldKeyboard.prototype);Entry.FieldLineBreak=function(b,a,d){this._block=a.block;this._blockView=a;this._index=d;this.box=new Entry.BoxModel;this.setValue(null);this.renderStart()};Entry.Utils.inherit(Entry.Field,Entry.FieldLineBreak);(function(b){b.renderStart=function(){};b.align=function(a){var b=this._blockView;0!==b._statements.length&&this.box.set({y:(b._statements[a].height||20)+Math.max(b.contentHeight%1E3,30)})}})(Entry.FieldLineBreak.prototype);Entry.FieldOutput=function(b,a,d,c,e){Entry.Model(this,!1);this._blockView=a;this._block=a.block;this._valueBlock=null;this.box=new Entry.BoxModel;this.changeEvent=new Entry.Event(this);this._index=d;this.contentIndex=e;this._content=b;this.acceptType=b.accept;this.view=this;this.svgGroup=null;this._position=b.position;this.box.observe(a,"alignContent",["width","height"]);this.observe(this,"_updateBG",["magneting"],!1);this.renderStart(a.getBoard(),c)};Entry.Utils.inherit(Entry.Field,Entry.FieldOutput); (function(b){b.schema={magneting:!1};b.renderStart=function(a,b){this.svgGroup||(this.svgGroup=this._blockView.contentSvgGroup.elem("g"));this.view=this;this._nextGroup=this.svgGroup;this.box.set({x:0,y:0,width:0,height:20});var c=this.getValue();c&&!c.view?(c.setThread(this),c.createView(a,b)):c&&c.view&&c.view.reDraw();this._updateValueBlock(c);this._blockView.getBoard().constructor==Entry.BlockMenu&&this._valueBlock&&this._valueBlock.view.removeControl()};b.align=function(a,b,c){var e=this.svgGroup; this._position&&(this._position.x&&(a=this._position.x),this._position.y&&(b=this._position.y));var f=this._valueBlock;f&&(b=-.5*f.view.height);f="translate("+a+","+b+")";void 0===c||c?e.animate({transform:f},300,mina.easeinout):e.attr({transform:f});this.box.set({x:a,y:b})};b.calcWH=function(){var a=this._valueBlock;a?(a=a.view,this.box.set({width:a.width,height:a.height})):this.box.set({width:0,height:20})};b.calcHeight=b.calcWH;b.destroy=function(){};b._inspectBlock=function(){};b._setValueBlock= -function(a){if(a!=this._valueBlock||!this._valueBlock)return this._valueBlock=a,this.setValue(a),a&&a.setThread(this),this._valueBlock};b._updateValueBlock=function(a){a instanceof Entry.Block||(a=void 0);if(a&&a===this._valueBlock)this.calcWH();else{this._sizeObserver&&this._sizeObserver.destroy();this._posObserver&&this._posObserver.destroy();if(a=this._setValueBlock(a))a=a.view,a.bindPrev(),this._posObserver=a.observe(this,"_updateValueBlock",["x","y"],!1),this._sizeObserver=a.observe(this,"calcWH", -["width","height"]);this.calcWH();this._blockView.alignContent()}};b.getPrevBlock=function(a){return this._valueBlock===a?this:null};b.getNextBlock=function(){return null};b.requestAbsoluteCoordinate=function(a){a=this._blockView;var b=a.contentPos;a=a.getAbsoluteCoordinate();a.x+=this.box.x+b.x;a.y+=this.box.y+b.y;return a};b.dominate=function(){this._blockView.dominate()};b.isGlobal=function(){return!1};b.separate=function(a){this.getCode().createThread([a]);this.changeEvent.notify()};b.getCode= -function(){return this._block.thread.getCode()};b.cut=function(a){return this._valueBlock===a?(delete this._valueBlock,[a]):null};b._updateBG=function(){this.magneting?this._bg=this.svgGroup.elem("path",{d:"m -4,-12 h 3 l 2,2 0,3 3,0 1,1 0,12 -1,1 -3,0 0,3 -2,2 h -3 ",fill:"#fff",stroke:"#fff","fill-opacity":.7,transform:"translate(0,"+(this._valueBlock?12:0)+")"}):this._bg&&(this._bg.remove(),delete this._bg)};b.replace=function(a){var b=this._valueBlock;b&&(b.view._toGlobalCoordinate(),a.getTerminateOutputBlock().view._contents[1].replace(b)); +function(a){if(a!=this._valueBlock||!this._valueBlock)return this._valueBlock=a,this.setValue(a),a&&a.setThread(this),this._valueBlock};b._updateValueBlock=function(a){a instanceof Entry.Block||(a=void 0);a&&a===this._valueBlock?this.calcWH():(this._sizeObserver&&this._sizeObserver.destroy(),this._posObserver&&this._posObserver.destroy(),(a=this._setValueBlock(a))?(a=a.view,a.bindPrev(),this._posObserver=a.observe(this,"_updateValueBlock",["x","y"],!1),this._sizeObserver=a.observe(this,"calcWH",["width", +"height"])):this.calcWH(),this._blockView.alignContent())};b.getPrevBlock=function(a){return this._valueBlock===a?this:null};b.getNextBlock=function(){return null};b.requestAbsoluteCoordinate=function(a){a=this._blockView;var b=a.contentPos;a=a.getAbsoluteCoordinate();a.x+=this.box.x+b.x;a.y+=this.box.y+b.y;return a};b.dominate=function(){this._blockView.dominate()};b.isGlobal=function(){return!1};b.separate=function(a){this.getCode().createThread([a]);this.changeEvent.notify()};b.getCode=function(){return this._block.thread.getCode()}; +b.cut=function(a){return this._valueBlock===a?(delete this._valueBlock,[a]):null};b._updateBG=function(){this.magneting?this._bg=this.svgGroup.elem("path",{d:"m -4,-12 h 3 l 2,2 0,3 3,0 1,1 0,12 -1,1 -3,0 0,3 -2,2 h -3 ",fill:"#fff",stroke:"#fff","fill-opacity":.7,transform:"translate(0,"+(this._valueBlock?12:0)+")"}):this._bg&&(this._bg.remove(),delete this._bg)};b.replace=function(a){var b=this._valueBlock;b&&(b.view._toGlobalCoordinate(),a.getTerminateOutputBlock().view._contents[1].replace(b)); this._updateValueBlock(a);a.view._toLocalCoordinate(this.svgGroup);this.calcWH()};b.setParent=function(a){this._parent=a};b.getParent=function(){return this._parent};b.getThread=function(){return this};b.getValueBlock=function(){return this._valueBlock};b.pointer=function(a){a.unshift(this._index);a.unshift(Entry.PARAM);return this._block.pointer(a)}})(Entry.FieldOutput.prototype);Entry.FieldStatement=function(b,a,d){Entry.Model(this,!1);this._blockView=a;this.block=a.block;this.view=this;this._index=d;this.acceptType=b.accept;this._thread=this.statementSvgGroup=this.svgGroup=null;this._position=b.position;this._events=[];this.observe(a,"alignContent",["height"],!1);this.observe(this,"_updateBG",["magneting"],!1);this.renderStart(a.getBoard())}; (function(b){b.schema={x:0,y:0,width:100,height:20,magneting:!1};b.magnet={next:{x:0,y:0}};b.renderStart=function(a){this.svgGroup=this._blockView.statementSvgGroup.elem("g");this._nextGroup=this.statementSvgGroup=this.svgGroup.elem("g");this._initThread(a);this._board=a};b._initThread=function(a){var b=this.getValue();this._thread=b;b.createView(a);b.view.setParent(this);if(a=b.getFirstBlock())a.view._toLocalCoordinate(this.statementSvgGroup),this.firstBlock=a;a=b.changeEvent.attach(this,this.calcHeight); var c=b.changeEvent.attach(this,this.checkTopBlock);this._events.push([b.changeEvent,a]);this._events.push([b.changeEvent,c]);this.calcHeight()};b.align=function(a,b,c){c=void 0===c?!0:c;var e=this.svgGroup;this._position&&(this._position.x&&(a=this._position.x),this._position.y&&(b=this._position.y));var f="translate("+a+","+b+")";this.set({x:a,y:b});c?e.animate({transform:f},300,mina.easeinout):e.attr({transform:f})};b.calcHeight=function(){var a=this._thread.view.requestPartHeight(null);this.set({height:a})}; diff --git a/src/workspace/field/output.js b/src/workspace/field/output.js index e16764581c..f84e88075b 100644 --- a/src/workspace/field/output.js +++ b/src/workspace/field/output.js @@ -160,7 +160,6 @@ Entry.Utils.inherit(Entry.Field, Entry.FieldOutput); view.bindPrev(); this._posObserver = view.observe(this, "_updateValueBlock", ["x", "y"], false); this._sizeObserver = view.observe(this, "calcWH", ["width", "height"]); - this.calcWH(); } else { this.calcWH(); }