Skip to content

Commit

Permalink
bug typing block corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
SebCanet committed Oct 11, 2016
1 parent 605a20c commit f5b2fe5
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 64 deletions.
83 changes: 39 additions & 44 deletions blocks/EsusBoard/EsusBoard.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@

'use strict';

goog.provide('Blockly.Blocks.EsusBoard');

goog.require('Blockly.Blocks');

/**
* Common HSV hue for all blocks in this category.
*/

Blockly.Blocks['EsusBoard_init'] = {
Blockly.Blocks['EsusBoard_init'] = {
init: function() {
this.setColour("#2475FA");
this.setHelpUrl('http://www.macerobotics.com');
Expand All @@ -21,7 +16,7 @@ goog.require('Blockly.Blocks');
}
};

Blockly.Blocks['EsusBoard_motor1'] = {
Blockly.Blocks['EsusBoard_motor1'] = {
init: function() {
this.setColour("#2475FA");
this.setHelpUrl('http://www.macerobotics.com');
Expand All @@ -40,7 +35,7 @@ goog.require('Blockly.Blocks');
}
};

Blockly.Blocks['EsusBoard_motor2'] = {
Blockly.Blocks['EsusBoard_motor2'] = {
init: function() {
this.setColour("#2475FA");
this.setHelpUrl('http://www.macerobotics.com');
Expand Down Expand Up @@ -72,7 +67,7 @@ Blockly.Blocks['EsusBoard_analog'] = {
}
};

Blockly.Blocks['EsusBoard_WifiConfig'] = {
Blockly.Blocks['EsusBoard_WifiConfig'] = {
init: function() {
this.setColour("#2475FA");
this.setHelpUrl('http://www.macerobotics.com');
Expand All @@ -91,7 +86,7 @@ Blockly.Blocks['EsusBoard_analog'] = {
}
};

Blockly.Blocks['EsusBoard_WifiConfigIP'] = {
Blockly.Blocks['EsusBoard_WifiConfigIP'] = {
init: function() {
this.setColour("#2475FA");
this.setHelpUrl('http://www.macerobotics.com');
Expand All @@ -115,13 +110,45 @@ Blockly.Blocks['EsusBoard_analog'] = {
}
};

Blockly.Blocks['EsusBoard_WifiConfigAP'] = {
init: function() {
this.setColour("#2475FA");
this.setHelpUrl('http://www.macerobotics.com');
this.appendValueInput("Text_ssid")
.setCheck('String')
.setAlign(Blockly.ALIGN_RIGHT)
.appendField(Blockly.Msg.ESUS_WIFI_AP);
this.appendValueInput("Text_password")
.setCheck('String')
.setAlign(Blockly.ALIGN_RIGHT)
.appendField(Blockly.Msg.WIFI_PASSWORD);
this.appendValueInput("Text_ip1AP")
.setCheck('Number')
.setAlign(Blockly.ALIGN_RIGHT)
.appendField(Blockly.Msg.ESUS_WIFI_AP_IP);
this.appendValueInput("Text_ip2AP")
.setCheck('Number')
.setAlign(Blockly.ALIGN_RIGHT)
this.appendValueInput("Text_ip3AP")
.setCheck('Number')
.setAlign(Blockly.ALIGN_RIGHT)
this.appendValueInput("Text_ip4AP")
.setCheck('Number')
.setAlign(Blockly.ALIGN_RIGHT)
this.setInputsInline(false);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setTooltip(Blockly.Msg.ESUS_WIFI_CONFIG);
}
};

Blockly.Blocks['EsusBoard_ReadStream'] = {
init: function() {
this.setColour("#2475FA");
this.setHelpUrl('http://www.macerobotics.com');
this.appendDummyInput("")
.appendField(Blockly.Msg.ESUS_WIFI_READ_STREAM);
this.setOutput(true, "Number");
this.setOutput(true, 'String');
this.setTooltip('');
}
};
Expand All @@ -132,7 +159,7 @@ Blockly.Blocks['EsusBoard_dataWifiAvailable'] = {
this.setHelpUrl('http://www.macerobotics.com');
this.appendDummyInput("")
.appendField(Blockly.Msg.ESUS_WIFI_DATA_AVAILABLE);
this.setOutput(true, "Boolean");
this.setOutput(true, 'Boolean');
this.setTooltip('');
}
};
Expand All @@ -155,36 +182,4 @@ Blockly.Blocks['EsusBoard_WifiContain'] = {
});
this.setOutput(true, 'String');
}
};

Blockly.Blocks['EsusBoard_WifiConfigAP'] = {
init: function() {
this.setColour("#2475FA");
this.setHelpUrl('http://www.macerobotics.com');
this.appendValueInput("Text_ssid")
.setCheck('String')
.setAlign(Blockly.ALIGN_RIGHT)
.appendField(Blockly.Msg.ESUS_WIFI_AP);
this.appendValueInput("Text_password")
.setCheck('String')
.setAlign(Blockly.ALIGN_RIGHT)
.appendField(Blockly.Msg.WIFI_PASSWORD);
this.appendValueInput("Text_ip1AP")
.setCheck('Number')
.setAlign(Blockly.ALIGN_RIGHT)
.appendField(Blockly.Msg.ESUS_WIFI_AP_IP);
this.appendValueInput("Text_ip2AP")
.setCheck('Number')
.setAlign(Blockly.ALIGN_RIGHT)
this.appendValueInput("Text_ip3AP")
.setCheck('Number')
.setAlign(Blockly.ALIGN_RIGHT)
this.appendValueInput("Text_ip4AP")
.setCheck('Number')
.setAlign(Blockly.ALIGN_RIGHT)
this.setInputsInline(false);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setTooltip(Blockly.Msg.ESUS_WIFI_CONFIG);
}
};
12 changes: 8 additions & 4 deletions blocks/blocks_typing.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
return Blockly.Types.BOOLEAN;
};
Blockly.Blocks.controls_switch.getVars = function() {
return [this.getFieldValue('SWVAR')];
return [this.getFieldValue('SWVAR')];
};
Blockly.Blocks.controls_switch.getVarType = function() {
return this.inputList[1].connection.targetBlock().getBlockType();
Expand Down Expand Up @@ -985,10 +985,10 @@ Blockly.Blocks.Zumo_play_notes_z.getBlockType = function() {
return Blockly.Types.NUMBER;
};
Blockly.Blocks.Zumo_line_follower.getBlockType = function() {
return Blockly.Types.NUMBER;
return Blockly.Types.NULL;
};
Blockly.Blocks.Zumo_BorderDetect.getBlockType = function() {
return Blockly.Types.NUMBER;
Blockly.Blocks.Zumo_SensorCalibration.getBlockType = function() {
return Blockly.Types.NULL;
};

//---------------------------------EsusBoard.js-------------------------------------
Expand Down Expand Up @@ -1017,6 +1017,10 @@ Blockly.Blocks.EsusBoard_WifiConfigIP.getBlockType = function() {
return Blockly.Types.NULL;
};

Blockly.Blocks.EsusBoard_WifiConfigAP.getBlockType = function() {
return Blockly.Types.NULL;
};

Blockly.Blocks.EsusBoard_ReadStream.getBlockType = function() {
return Blockly.Types.TEXT;
};
Expand Down
2 changes: 1 addition & 1 deletion blocks/technozone51/technozone51.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//www.technozone51fr
//www.technozone51.fr

// define blocks
'use strict';
Expand Down
15 changes: 2 additions & 13 deletions generators/arduino/EsusBoard.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
'use strict';

goog.provide('Blockly.Arduino.EsusBoard');

goog.require('Blockly.Arduino');

goog.provide('Blockly.Blocks.conversion');

goog.require('Blockly.Blocks');


Blockly.Arduino['EsusBoard_init'] = function() {
Blockly.Arduino.includes_['define_esus'] = '#include <esusBoard.h>';
Blockly.Arduino.setups_['esus_init'] = 'initEsusBoard();';
Expand Down Expand Up @@ -70,8 +61,7 @@ Blockly.Arduino['EsusBoard_dataWifiAvailable'] = function() {


Blockly.Arduino['EsusBoard_WifiContain'] = function(block) {
var varName = Blockly.Arduino.variableDB_.getName(
block.getFieldValue('VAR'), Blockly.Variables.NAME_TYPE);
var varName = Blockly.Arduino.variableDB_.getName(block.getFieldValue('VAR'), Blockly.Variables.NAME_TYPE);
var code = '';
if (varName == '') {
code = '""';
Expand All @@ -98,5 +88,4 @@ Blockly.Arduino['EsusBoard_WifiConfigAP'] = function() {
Blockly.Arduino.setups_['wifiAP'] = code;
Blockly.Arduino.setups_['server_begin'] = "initServerWifi();";
return '\n';
};

};
3 changes: 1 addition & 2 deletions lang/blocks/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,7 @@ Blockly.Msg.ROBOTS_MOTORS_ZUMO_FCT_FOLLOWER = "line follower";
Blockly.Msg.ROBOTS_MOTORS_ZUMO_FCT_FOLLOWER_TOOLTIP = "follow a black line";
Blockly.Msg.ROBOTS_MOTORS_ZUMO_FCT_FOLLOWER_HELPURL = "https://www.pololu.com/docs/0J57/7.d";
Blockly.Msg.ROBOTS_MOTORS_ZUMO_FCT_SENSORCALIBRATION = "calibrates the sensor";
Blockly.Msg.ROBOTS_MOTORS_ZUMO_FCT_SENSORCALIBRATION_TOOLTIP = "calibrates the sensor for ten seconds and
turns on the pin 13 LED while calibration is going on";
Blockly.Msg.ROBOTS_MOTORS_ZUMO_FCT_SENSORCALIBRATION_TOOLTIP = "calibrates the sensor for ten seconds and turns on the pin 13 LED while calibration is going on";
Blockly.Msg.ROBOTS_MOTORS_ZUMO_FCT_SENSORCALIBRATION_HELPURL = "https://www.pololu.com/product/1419";
Blockly.Msg.ROBOTS_MOTORS_ARDUMOTOR_TITLE = "Ardumotor";
Blockly.Msg.ROBOTS_MOTORS_ARDUMOTOR_TOOLTIP = "ArduMotor Sparkfun Shield A=left B=right";
Expand Down
Binary file modified sync.ffs_db
Binary file not shown.

0 comments on commit f5b2fe5

Please sign in to comment.