Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correction of the "BoumBot_son" block #1

Open
wants to merge 14 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions blocks/Boumbot/Boumbot_blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ Blockly.Blocks['Boumbot_vitesse_moteur_gauche'] = {
this.appendDummyInput("")
.appendField(Blockly.Msg.Boumbot_vitesse_moteur_gauche001)
.appendField(new Blockly.FieldImage("blocks/Boumbot/img/vitesseGauche.png", Blockly.Arduino.imageSize, Blockly.Arduino.imageSize));
this.setPreviousStatement(true, null);
this.appendValueInput("vitesse")
.setCheck('Number')
.setAlign(Blockly.ALIGN_RIGHT)
.appendField(Blockly.Msg.Boumbot_vitesse_moteur_gauche002);
this.setInputsInline(false);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setTooltip(Blockly.Msg.Boumbot_vitesse_moteur_gauche002);
}
Expand All @@ -143,7 +148,12 @@ Blockly.Blocks['Boumbot_vitesse_moteur_droit'] = {
this.appendDummyInput("")
.appendField(Blockly.Msg.Boumbot_vitesse_moteur_droit001)
.appendField(new Blockly.FieldImage("blocks/Boumbot/img/vitesseDroite.png", Blockly.Arduino.imageSize, Blockly.Arduino.imageSize));
this.setPreviousStatement(true, null);
this.appendValueInput("vitesse")
.setCheck('Number')
.setAlign(Blockly.ALIGN_RIGHT)
.appendField(Blockly.Msg.Boumbot_vitesse_moteur_droit002);
this.setInputsInline(false);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setTooltip(Blockly.Msg.Boumbot_vitesse_moteur_droit002);
}
Expand Down Expand Up @@ -264,11 +274,11 @@ Blockly.Blocks['Boumbot_melody'] = {
this.appendDummyInput("")
.appendField(Blockly.Msg.Boumbot_melody001)
.appendField(new Blockly.FieldImage("blocks/Boumbot/img/son.png", Blockly.Arduino.imageSize, Blockly.Arduino.imageSize));
this.appendValueInput("NUM")
.setCheck('Number')
this.appendDummyInput("")
.setAlign(Blockly.ALIGN_RIGHT)
.appendField(Blockly.Msg.Boumbot_melody002);
this.setInputsInline(false);
.appendField(Blockly.Msg.Boumbot_melody002)
.appendField(new Blockly.FieldDropdown(["1", "2", "3", "4", "5", "6", "7", "8"]), "melody");
this.setInputsInline(false);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setTooltip(Blockly.Msg.Boumbot_melody003);
Expand Down
4 changes: 2 additions & 2 deletions core_BlocklyArduino/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var BlocklyDuino = {};
Blockly.pathToBlockly = './';
Blockly.pathToMedia = './media/';

BlocklyDuino.selectedToolbox = "toolbox_none";
BlocklyDuino.selectedToolbox = "toolbox_boumbot";
BlocklyDuino.selectedCard = 'kit_boumbot';
BlocklyDuino.selectedTab = 'blocks';
BlocklyDuino.inlineBool = true;
Expand Down Expand Up @@ -814,7 +814,7 @@ BlocklyDuino.init = function() {

BlocklyDuino.testAjax();

BlocklyDuino.firstBlocklyArduino();
//BlocklyDuino.firstBlocklyArduino(); //mis en commentaire pour ne pas avoir le pop-up lors du lancement en atelier.

if ($('#toolbox').length) {
BlocklyDuino.toolboxInIndexHtml = true;
Expand Down
34 changes: 27 additions & 7 deletions css/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ body {
font-family: "OpenDyslexic";
}

.rotate180 {
/*.rotate180 {
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-o-transform: rotate(180deg);
Expand All @@ -37,7 +37,7 @@ body {
-moz-transform: rotate(90deg);
-o-transform: rotate(90deg);
-ms-transform: rotate(90deg);
}
}*/

#header {
background: #00969C;
Expand Down Expand Up @@ -148,38 +148,49 @@ html[dir="RTL"] .menuPanel-ver {
.div_help_button-ver {
width: 200px;
bottom: 10px;
position: absolute;
padding: 5px;
/* position: absolute;*/
text-align: center;
}

.div_tools_button-ver {
width: 200px;
bottom: 50px;
position: absolute;
padding: 5px;
/* position: absolute;*/
text-align: center;
}

#btn_for_menu{

}

#div_about {
width: 200px;
bottom: 130px;
position: absolute;
padding: 5px;
/* position: absolute;*/
text-align: center;
}

.div_help_button-hor {
padding-left: 0px;
bottom: 10px;
position: absolute;
padding: 5px;
/* position: absolute;*/
text-align: center;
}

#div_accessibility_button {
width: 200px;
bottom: 90px;
position: absolute;
padding: 5px;
/* position: absolute;*/
text-align: center;
}



html[dir="RTL"] .navbar-right {
margin-right: -50px;
width: 225px;
Expand Down Expand Up @@ -392,6 +403,15 @@ html[dir="RTL"] #select_all {
border-top: none !important;
}

#div_arduino_btn {
max-height: 10%;
}

.btn-primary{
max-height:8%;
margin: 3px;
}

#debug_arduino {
height: 25%;
border-width: 2px;
Expand Down
22 changes: 17 additions & 5 deletions generators/Boumbot/Boumbot_blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,19 @@ Blockly.Arduino.Boumbot_pas_droite = function() {
};

Blockly.Arduino.Boumbot_vitesse_moteur_gauche = function() {
var code = 'boumbot.vitesseGauche();\n';
return [code, Blockly.Arduino.ORDER_ATOMIC];
var vitG = Blockly.Arduino.valueToCode(this, 'vitesse', Blockly.Arduino.ORDER_ATOMIC);
//var tps = Blockly.Arduino.valueToCode(this. 'TPS', Blockly.Arduino.ORDER_ATOMIC);
var code = "boumbot.vitesseGauche("+vitG+");\n";

return code;
};

Blockly.Arduino.Boumbot_vitesse_moteur_droit = function() {
var code = 'boumbot.vitesseDroite();\n';
return [code, Blockly.Arduino.ORDER_ATOMIC];
var vitD = Blockly.Arduino.valueToCode(this, 'vitesse', Blockly.Arduino.ORDER_ATOMIC);
//var tps = Blockly.Arduino.valueToCode(this. 'TPS', Blockly.Arduino.ORDER_ATOMIC);
var code = "boumbot.vitesseDroite("+vitD+");\n";

return code;
};

Blockly.Arduino.Boumbot_obstacle = function() {
Expand Down Expand Up @@ -94,9 +100,15 @@ Blockly.Arduino.Boumbot_son = function() {
//var tps = Blockly.Arduino.valueToCode(this. 'TPS', Blockly.Arduino.ORDER_ATOMIC);

var code = "boumbot.son("+num+");\n";
return code;
return [code, Blockly.Arduino.ORDER_ATOMIC];
};

Blockly.Arduino.Boumbot_melody = function() {
var melody = this.getFieldValue('melody');

var code = "boumbot.melody("+melody+");\n";
return code;
};

Blockly.Arduino.Boumbot_led = function() {
var red = Blockly.Arduino.valueToCode(this, 'Red', Blockly.Arduino.ORDER_ATOMIC);
Expand Down
4 changes: 4 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@
</a>
</div>
<input type="file" id="load" style="display: none;" />
<div id="btn_for_menu">
<div id="div_about">
<button id="btn_about" type="button" class="btn btn-default btn-sm btn-success" data-toggle="modal" data-target="#aboutModal">
<span id="span_about"> </span>
Expand Down Expand Up @@ -321,6 +322,7 @@
<span class="glyphicon glyphicon-question-sign"></span>
</a>
</div>
</div>
</div>
<!-- Nav tabs -->
<div id="divTabpanel" role="tabpanel">
Expand All @@ -333,6 +335,7 @@
</button>
</div>
<div id="content_arduino" class="tab-pane">
<div id="div_arduino_btn">
<select id="cb_cf_boards"></select>
<select id="cb_cf_ports"></select>
<a id="btn_plugin_codebender" class='btn btn-danger' href="https://codebender.cc/static/plugin" target="_blank" role='button'>
Expand Down Expand Up @@ -372,6 +375,7 @@
<span id="span_pasteIDEArduino"> </span>
</button>
<img id="LocalCodebenderLogo" height="35"/>
</div>
<pre id="pre_arduino"></pre>
<div id="debug_arduino"></div>
<div id="local_debug">
Expand Down
Binary file added media/boumbot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading