From 4bbb36ba50426975770fe6b13ea4aa781866b119 Mon Sep 17 00:00:00 2001 From: Kyumin Sim Date: Thu, 19 May 2016 13:44:09 +0900 Subject: [PATCH] hotfix --- dist/entry.min.js | 66 ++++++++++++++++++------------------ src/workspace/block_entry.js | 10 +++++- 2 files changed, 42 insertions(+), 34 deletions(-) diff --git a/dist/entry.min.js b/dist/entry.min.js index e31254fdc5..cf9e2257c8 100644 --- a/dist/entry.min.js +++ b/dist/entry.min.js @@ -1813,39 +1813,39 @@ this.isContinue=!0;b=this.block.statements[0];if(0!==a.length&&0!==b.getBlocks() Ntry.unitComp=Ntry.entityManager.getComponent(this._unit.id,Ntry.STATIC.UNIT)}},maze_step_jump:{skeleton:"basic",mode:"maze",color:"#FF6E4B",params:[{type:"Image",img:"/img/assets/week/blocks/jump.png",size:24}],syntax:["Scope","jump"],func:function(){if(this.isContinue){if(this.isAction)return Entry.STATIC.BREAK;delete this.isAction;delete this.isContinue}else{this.isAction=this.isContinue=!0;var b=this;Ntry.dispatchEvent("unitAction",Ntry.STATIC.JUMP,function(){b.isAction=!1});return Entry.STATIC.BREAK}}}, maze_step_for:{skeleton:"basic_loop",mode:"maze",color:"#498DEB",syntax:["BasicIteration"],params:[{type:"Dropdown",key:"REPEAT",options:[[1,1],[2,2],[3,3],[4,4],[5,5],[6,6],[7,7],[8,8],[9,9],[10,10]],value:1},{type:"Image",img:"/img/assets/week/blocks/for.png",size:24}],statements:[{accept:"basic"}],func:function(){if(void 0===this.repeatCount)return this.repeatCount=this.block.params[0],Entry.STATIC.BREAK;if(0Entry.hw.getAnalogPortValue(1)?1:0}},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"},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"},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"},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"},nemoino_convert_scale:{parent:"arduino_convert_scale",isNotFor:["nemoino"],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:"nemoino_convert_scale"},"class":"arduino"},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"},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"},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"},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"},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"},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"},CODEino_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["CODEino"],def:{params:[{type:"arduino_get_port_number"}],type:"CODEino_get_digital_value"},"class":"arduino_value"},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"},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"},CODEino_convert_scale:{parent:"arduino_convert_scale",isNotFor:["CODEino"],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:"CODEino_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"]}]}}};(function(){for(var b in Entry.block){var a=Entry.block[b];if(a.parent){var c=function(){};c.prototype=Entry.block[a.parent];var c=new c,d;for(d in a)c[d]=a[d];Entry.block[b]=c}}})();"object"==typeof exports&&(exports.block=Entry.block);Entry.BlockMenu=function(b,a,c,d){Entry.Model(this,!1);this._align=a||"CENTER";this._scroll=void 0!==d?d:!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._generateView(c);this._splitters=[];this.setWidth();this.svg=Entry.SVG(this._svgId);Entry.Utils.addFilters(this.svg, +func:function(){var b=this.block.statements[0];if(0!==b.getBlocks().length)return this.executor.stepInto(b),Entry.STATIC.BREAK}},maze_repeat_until_2:{skeleton:"basic_loop",mode:"maze",color:"#498DEB",syntax:["BasicWhile","true"],params:[{type:"Image",img:"/img/assets/ntry/block_inner/repeat_goal_1.png",size:18},{type:"Image",img:"/img/assets/week/blocks/for.png",size:24}],statements:[{accept:"basic"}],func:function(){var b=this.block.statements[0];if(0!==b.getBlocks().length)return this.executor.stepInto(b), +Entry.STATIC.BREAK}},maze_step_if_1:{skeleton:"basic_loop",mode:"maze",color:"#498DEB",syntax:["BasicIf","front == wall"],params:[{type:"Image",img:"/img/assets/ntry/block_inner/if_target_1.png",size:18},{type:"Image",img:"/img/assets/week/blocks/if.png",size:24}],statements:[{accept:"basic"}],func:function(){if(!this.isContinue){var b=Ntry.entityManager.getEntitiesByComponent(Ntry.STATIC.UNIT),a,c;for(c in b)a=b[c];b=Ntry.entityManager.getComponent(a.id,Ntry.STATIC.UNIT);a=Ntry.entityManager.getComponent(a.id, +Ntry.STATIC.GRID);a={x:a.x,y:a.y};Ntry.addVectorByDirection(a,b.direction,1);c=Ntry.entityManager.find({type:Ntry.STATIC.GRID,x:a.x,y:a.y});b=this.block.statements[0];if(0===c.length)return this.executor.stepInto(b),Entry.STATIC.BREAK;a=Ntry.entityManager.find({type:Ntry.STATIC.GRID,x:a.x,y:a.y},{type:Ntry.STATIC.TILE,tileType:Ntry.STATIC.WALL});this.isContinue=!0;if(0!==a.length&&0!==b.getBlocks().length)return this.executor.stepInto(b),Entry.STATIC.BREAK}}},maze_step_if_2:{skeleton:"basic_loop", +mode:"maze",color:"#498DEB",syntax:["BasicIf","front == bee"],params:[{type:"Image",img:"/img/assets/ntry/bitmap/maze2/obstacle_01.png",size:18},{type:"Image",img:"/img/assets/week/blocks/if.png",size:24}],statements:[{accept:"basic"}],func:function(){if(!this.isContinue){var b=Ntry.entityManager.getEntitiesByComponent(Ntry.STATIC.UNIT),a,c;for(c in b)a=b[c];b=Ntry.entityManager.getComponent(a.id,Ntry.STATIC.UNIT);a=Ntry.entityManager.getComponent(a.id,Ntry.STATIC.GRID);a={x:a.x,y:a.y};Ntry.addVectorByDirection(a, +b.direction,1);a=Ntry.entityManager.find({type:Ntry.STATIC.GRID,x:a.x,y:a.y},{type:Ntry.STATIC.TILE,tileType:Ntry.STATIC.OBSTACLE_BEE});this.isContinue=!0;b=this.block.statements[0];if(0!==a.length&&0!==b.getBlocks().length)return this.executor.stepInto(b),Entry.STATIC.BREAK}}},maze_call_function:{skeleton:"basic",mode:"maze",color:"#B57242",syntax:["Scope","promise"],params:[{type:"Image",img:"/img/assets/week/blocks/function.png",size:24}],func:function(){if(!this.funcExecutor){var b=Ntry.entityManager.getEntitiesByComponent(Ntry.STATIC.CODE), +a;for(a in b)this.funcExecutor=new Entry.Executor(b[a].components[Ntry.STATIC.CODE].code.getEventMap("define")[0])}this.funcExecutor.execute();if(null!==this.funcExecutor.scope.block)return Entry.STATIC.BREAK}},maze_define_function:{skeleton:"basic_define",mode:"maze",color:"#B57242",event:"define",syntax:["BasicFunction"],params:[{type:"Image",img:"/img/assets/week/blocks/function.png",size:24}],statements:[{accept:"basic"}],func:function(b){if(!this.executed&&(b=this.block.statements[0],0!==b.getBlocks().length))return this.executor.stepInto(b), +this.executed=!0,Entry.STATIC.BREAK}},maze_step_if_3:{skeleton:"basic_loop",mode:"maze",color:"#498DEB",syntax:["BasicIf","front == banana"],params:[{type:"Image",img:"/img/assets/ntry/block_inner/if_target_3.png",size:18},{type:"Image",img:"/img/assets/week/blocks/if.png",size:24}],statements:[{accept:"basic"}],func:function(){if(!this.isContinue){var b=Ntry.entityManager.getEntitiesByComponent(Ntry.STATIC.UNIT),a,c;for(c in b)a=b[c];b=Ntry.entityManager.getComponent(a.id,Ntry.STATIC.UNIT);a=Ntry.entityManager.getComponent(a.id, +Ntry.STATIC.GRID);a={x:a.x,y:a.y};Ntry.addVectorByDirection(a,b.direction,1);a=Ntry.entityManager.find({type:Ntry.STATIC.GRID,x:a.x,y:a.y},{type:Ntry.STATIC.TILE,tileType:Ntry.STATIC.OBSTACLE_BANANA});this.isContinue=!0;b=this.block.statements[0];if(0!==a.length&&0!==b.getBlocks().length)return this.executor.stepInto(b),Entry.STATIC.BREAK}}},maze_step_if_4:{skeleton:"basic_loop",mode:"maze",color:"#498DEB",syntax:["BasicIf","front == wall"],params:[{type:"Image",img:"/img/assets/ntry/block_inner/if_target_2.png", +size:18},{type:"Image",img:"/img/assets/week/blocks/if.png",size:24}],statements:[{accept:"basic"}],func:function(){if(!this.isContinue){var b=Ntry.entityManager.getEntitiesByComponent(Ntry.STATIC.UNIT),a,c;for(c in b)a=b[c];b=Ntry.entityManager.getComponent(a.id,Ntry.STATIC.UNIT);a=Ntry.entityManager.getComponent(a.id,Ntry.STATIC.GRID);a={x:a.x,y:a.y};Ntry.addVectorByDirection(a,b.direction,1);a=Ntry.entityManager.find({type:Ntry.STATIC.GRID,x:a.x,y:a.y},{type:Ntry.STATIC.TILE,tileType:Ntry.STATIC.WALL}); +this.isContinue=!0;b=this.block.statements[0];if(0!==a.length&&0!==b.getBlocks().length)return this.executor.stepInto(b),Entry.STATIC.BREAK}}},maze_step_move_step:{skeleton:"basic",mode:"maze",color:"#A751E3",syntax:["Scope","move"],params:[{type:"Image",img:"/img/assets/week/blocks/moveStep.png",size:24}],func:function(){if(this.isContinue){if(this.isAction)return Entry.STATIC.BREAK;delete this.isAction;delete this.isContinue}else{this.isAction=this.isContinue=!0;var b=this;Ntry.dispatchEvent("unitAction", +Ntry.STATIC.WALK,function(){b.isAction=!1});return Entry.STATIC.BREAK}}},maze_step_rotate_left:{skeleton:"basic",mode:"maze",color:"#A751E3",syntax:["Scope","left"],params:[{type:"Image",img:"/img/assets/week/blocks/turnL.png",size:24}],func:function(){if(this.isContinue){if(this.isAction)return Entry.STATIC.BREAK;delete this.isAction;delete this.isContinue}else{this.isAction=this.isContinue=!0;var b=this;Ntry.dispatchEvent("unitAction",Ntry.STATIC.TURN_LEFT,function(){b.isAction=!1});return Entry.STATIC.BREAK}}}, +maze_step_rotate_right:{skeleton:"basic",mode:"maze",color:"#A751E3",syntax:["Scope","right"],params:[{type:"Image",img:"/img/assets/week/blocks/turnR.png",size:24}],func:function(){if(this.isContinue){if(this.isAction)return Entry.STATIC.BREAK;delete this.isAction;delete this.isContinue}else{this.isAction=this.isContinue=!0;var b=this;Ntry.dispatchEvent("unitAction",Ntry.STATIC.TURN_RIGHT,function(){b.isAction=!1});return Entry.STATIC.BREAK}}},test_wrapper:{skeleton:"basic",mode:"maze",color:"#3BBD70", +params:[{type:"Block",accept:"basic_boolean_field",value:[{type:"test",params:[30,50]}]},{type:"Dropdown",options:[[1,1],[2,2],[3,3],[4,4],[5,5],[6,6],[7,7],[8,8],[9,9],[10,10]],value:1}]},basic_button:{skeleton:"basic_button",color:"#eee",params:[{type:"Text",text:"basic button",color:"#333",align:"center"}]},dplay_get_number_sensor_value:{parent:"arduino_get_number_sensor_value",isNotFor:["dplay"],def:{params:[{type:"arduino_get_sensor_number"}],type:"dplay_get_number_sensor_value"},"class":"arduino_value"}, +dplay_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["dplay"],def:{params:[{type:"arduino_get_port_number"}],type:"dplay_get_digital_value"},"class":"arduino_value"},dplay_toggle_led:{parent:"arduino_toggle_led",isNotFor:["dplay"],def:{params:[{type:"arduino_get_port_number"},null,null],type:"dplay_toggle_led"},"class":"arduino_set"},dplay_toggle_pwm:{parent:"arduino_toggle_pwm",isNotFor:["dplay"],def:{params:[{type:"arduino_get_pwm_port_number"},{type:"arduino_text",params:["255"]}, +null],type:"dplay_toggle_pwm"},"class":"arduino_set"},dplay_convert_scale:{parent:"arduino_convert_scale",isNotFor:["dplay"],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:"dplay_convert_scale"},"class":"arduino"},dplay_get_value:{color:"#00979D",fontColor:"#FFF",skeleton:"basic_string_field",statements:[],template:"\uc544\ub0a0\ub85c\uadf8 %1 \ubc88 %2 \uc13c\uc11c\uac12", +params:[{type:"Block",accept:"string"},{type:"Dropdown",options:[["\uac00\ubcc0\uc800\ud56d","ADJU"],["\ube5b\uc13c\uc11c","LIGHT"],["\uc628\ub3c4\uc13c\uc11c","TEMP"],["\uc870\uc774\uc2a4\ud2f1 X","JOYS"],["\uc870\uc774\uc2a4\ud2f1 Y","JOYS"],["\uc801\uc678\uc120","INFR"]],value:"ADJU",fontSize:11}],events:{},def:{params:[{type:"arduino_get_sensor_number",id:"4rx2"},null],type:"dplay_get_value",id:"hh5b"},paramsKeyMap:{VALUE:0,OPERATOR:1},"class":"dplay_set",isNotFor:["dplay"],func:function(b,a){var c= +a.getValue("VALUE",a);return Entry.hw.getAnalogPortValue(c[1])}},dplay_get_tilt:{color:"#00979D",fontColor:"#FFF",skeleton:"basic_boolean_field",statements:[],template:"\uae30\uc6b8\uae30\uc13c\uc11c \uc0c1\ud0dc\uac00 %1 ",params:[{type:"Dropdown",options:[["\uc67c\ucabd","LEFT"],["\uc624\ub978\ucabd","LIGHT"]],value:"LEFT",fontSize:11}],events:{},def:{params:[null],type:"dplay_get_tilt",id:"edht"},paramsKeyMap:{STATUS:0},"class":"dplay_set",isNotFor:["dplay"],func:function(b,a){return"LIGHT"== +a.getField("STATUS",a)?1==Entry.hw.getDigitalPortValue(12)?1:0:0==Entry.hw.getDigitalPortValue(12)?1:0}},dplay_DCmotor:{color:"#00979D",fontColor:"#FFF",skeleton:"basic",statements:[],template:"%1 DC\ubaa8\ud130 \uc0c1\ud0dc\ub97c %2 %3",params:[{type:"Dropdown",options:[["\uc67c\ucabd","3"],["\uc624\ub978\ucabd","6"]],value:"3",fontSize:11},{type:"Dropdown",options:[["\uc815\ubc29\ud5a5","FRONT"],["\uc5ed\ubc29\ud5a5","REAR"],["\uc815\uc9c0","OFF"]],value:"FRONT",fontSize:11},{type:"Indicator", +img:"/lib/entryjs/images/block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,null],type:"dplay_DCmotor",id:"7b8v"},paramsKeyMap:{PORT:0,OPERATOR:1},"class":"dplay",isNotFor:["dplay"],func:function(b,a){var c=a.getField("PORT"),d=0;"3"==c&&(d=5);var e=a.getField("OPERATOR"),f=0,g=0;"FRONT"==e?(f=255,g=0):"REAR"==e?(f=0,g=255):"OFF"==e&&(g=f=0);Entry.hw.setDigitalPortValue(c,f);Entry.hw.setDigitalPortValue(d,g);return a.callReturn()}},dplay_buzzer:{color:"#00979D",fontColor:"#FFF", +skeleton:"basic",statements:[],template:"\ubd80\uc800\ub97c %1 \ub85c %2 \ubc15\uc790\ub85c \uc5f0\uc8fc\ud558\uae30 %3",params:[{type:"Dropdown",options:[["\ub3c4","1"],["\ub808","2"],["\ubbf8","3"]],value:"1",fontSize:11},{type:"Block",accept:"string"},{type:"Indicator",img:"/lib/entryjs/images/block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,{type:"arduino_text",params:["0"],id:"04wh"},null],type:"dplay_buzzer",id:"rl5l"},paramsKeyMap:{PORT:0,VALUE:1},"class":"dplay",isNotFor:["dplay"], +func:function(b,a){var c=a.getField("PORT"),d=2;"1"==c?d=2:"2"==c?d=4:"3"==c&&(d=7);c=a.getNumberValue("VALUE");c=Math.round(c);c=Math.max(c,0);c=Math.min(c,100);Entry.hw.setDigitalPortValue(d,c);return a.callReturn()}},dplay_servo:{color:"#00979D",fontColor:"#FFF",skeleton:"basic",statements:[],template:"\uc11c\ubcf4\ubaa8\ud130 \uac01\ub3c4\ub97c %1 \ub85c \uc774\ub3d9 %2",params:[{type:"Block",accept:"string"},{type:"Indicator",img:"/lib/entryjs/images/block_icon/hardware_03.png",size:12}],events:{}, +def:{params:[{type:"arduino_text",params:["255"],id:"5ld8"},null],type:"dplay_servo",id:"lo2z"},paramsKeyMap:{VALUE:0},"class":"dplay",isNotFor:["dplay"],func:function(b,a){var c=a.getNumberValue("VALUE"),c=Math.round(c),c=Math.max(c,0),c=Math.min(c,180);Entry.hw.setDigitalPortValue(9,c);return a.callReturn()}},dplay_select_led:{color:"#00979D",fontColor:"#FFF",skeleton:"basic",statements:[],template:"\ub514\uc9c0\ud138 %1 LED \uc0c1\ud0dc\ub97c %2 %3",params:[{type:"Dropdown",options:[["7","7"], +["8","8"],["9","9"],["10","10"]],value:"7",fontSize:11},{type:"Dropdown",options:[["\ucf1c\uae30","on"],["\ub044\uae30","off"]],value:"on",fontSize:11},{type:"Indicator",img:"/lib/entryjs/images/block_icon/hardware_03.png",size:12}],events:{},def:{params:[null,null,null],type:"dplay_select_led",id:"9kmq"},paramsKeyMap:{PORT:0,OPERATOR:1},"class":"dplay",isNotFor:["dplay"],func:function(b,a){var c=a.getField("PORT"),d=7;"7"==c?d=7:"8"==c?d=8:"9"==c?d=9:"10"==c&&(d=10);c=a.getField("OPERATOR");Entry.hw.setDigitalPortValue(d, +"on"==c?255:0);return a.callReturn()}},dplay_get_switch_status:{color:"#00979D",fontColor:"#FFF",skeleton:"basic_boolean_field",statements:[],template:"\ub514\uc9c0\ud138 %1 \ubc88 \uc2a4\uc704\uce58\uac00 %2 ",params:[{type:"Dropdown",options:[["2","2"],["4","4"]],value:"2",fontSize:11},{type:"Dropdown",options:[["\ub20c\ub9bc","ON"],["\uc5f4\ub9bc","OFF"]],value:"ON",fontSize:11}],events:{},def:{params:[null,null],type:"dplay_get_switch_status",id:"fik8"},paramsKeyMap:{PORT:0,STATUS:1},"class":"dplay_set", +isNotFor:["dplay"],func:function(b,a){var c=a.getField("PORT"),d=2;"2"==c?d=2:"4"==c&&(d=4);return"OFF"==a.getField("STATUS")?1==Entry.hw.getDigitalPortValue(d)?1:0:0==Entry.hw.getDigitalPortValue(d)?1:0}},dplay_get_light_status:{color:"#00979D",fontColor:"#FFF",skeleton:"basic_boolean_field",statements:[],template:"\ube5b\uc13c\uc11c\uac00 %1 ",params:[{type:"Dropdown",options:[["\ubc1d\uc74c","BRIGHT"],["\uc5b4\ub450\uc6c0","DARK"]],value:"BRIGHT",fontSize:11}],events:{},def:{params:[null],type:"dplay_get_light_status", +id:"do3r"},paramsKeyMap:{STATUS:0},"class":"dplay_set",isNotFor:["dplay"],func:function(b,a){return"DARK"==a.getField("STATUS",a)?800Entry.hw.getAnalogPortValue(1)?1:0}},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"},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"},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"},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"},nemoino_convert_scale:{parent:"arduino_convert_scale", +isNotFor:["nemoino"],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:"nemoino_convert_scale"},"class":"arduino"},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"}, +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"},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"},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"},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"},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"},CODEino_get_digital_value:{parent:"arduino_get_digital_value",isNotFor:["CODEino"],def:{params:[{type:"arduino_get_port_number"}],type:"CODEino_get_digital_value"},"class":"arduino_value"},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"},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"},CODEino_convert_scale:{parent:"arduino_convert_scale",isNotFor:["CODEino"],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:"CODEino_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"]}]}}};(function(){for(var b in Entry.block){var a=Entry.block[b];if(a.parent){var c=function(){};c.prototype=Entry.block[a.parent];var c=new c,d;for(d in a)c[d]=a[d];Entry.block[b]=c}}})();"object"==typeof exports&&(exports.block=Entry.block);Entry.BlockMenu=function(b,a,c,d){Entry.Model(this,!1);this._align=a||"CENTER";this._scroll=void 0!==d?d:!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._generateView(c);this._splitters=[];this.setWidth();this.svg=Entry.SVG(this._svgId);Entry.Utils.addFilters(this.svg, this.suffix);this.patternRect=Entry.Utils.addBlockPattern(this.svg,this.suffix);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);c&&this._generateCategoryCodes(c);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,d=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){d._scroller&& diff --git a/src/workspace/block_entry.js b/src/workspace/block_entry.js index 3b714b675b..1c936c7f2a 100644 --- a/src/workspace/block_entry.js +++ b/src/workspace/block_entry.js @@ -16599,7 +16599,15 @@ Entry.block = { { "accept": "basic" } - ] + ], + func: function() { + var statement = this.block.statements[0]; + if (statement.getBlocks().length === 0) + return; + + this.executor.stepInto(statement); + return Entry.STATIC.BREAK; + } }, "maze_step_if_1": { "skeleton": "basic_loop",