diff --git a/src/components/Blockly/generator/generator.js b/src/components/Blockly/generator/generator.js index 9217522..599f022 100644 --- a/src/components/Blockly/generator/generator.js +++ b/src/components/Blockly/generator/generator.js @@ -148,53 +148,7 @@ Blockly["Arduino"].init = function (workspace) { // Blockly.Names.DEVELOPER_VARIABLE_TYPE)); // } - const doubleVariables = workspace.getVariablesOfType("Number"); - let i = 0; - let variableCode = ""; - for (i = 0; i < doubleVariables.length; i += 1) { - variableCode += - "double " + - Blockly["Arduino"].nameDB_.getName( - doubleVariables[i].getId(), - Blockly.Variables.NAME_TYPE - ) + - " = 0; \n\n"; - } - const stringVariables = workspace.getVariablesOfType("String"); - for (i = 0; i < stringVariables.length; i += 1) { - variableCode += - "String " + - Blockly["Arduino"].nameDB_.getName( - stringVariables[i].getId(), - Blockly.Variables.NAME_TYPE - ) + - ' = ""; \n\n'; - } - - const booleanVariables = workspace.getVariablesOfType("Boolean"); - for (i = 0; i < booleanVariables.length; i += 1) { - variableCode += - "boolean " + - Blockly["Arduino"].nameDB_.getDistinctName( - booleanVariables[i].getId(), - Blockly.Variables.NAME_TYPE - ) + - " = false; \n\n"; - } - - const colourVariables = workspace.getVariablesOfType("Colour"); - for (i = 0; i < colourVariables.length; i += 1) { - variableCode += - "RGB " + - Blockly["Arduino"].nameDB_.getName( - colourVariables[i].getId(), - Blockly.Variables.NAME_TYPE - ) + - " = {0, 0, 0}; \n\n"; - } - - Blockly["Arduino"].variablesInitCode_ = variableCode; }; /** diff --git a/src/components/Blockly/toolbox/Toolbox.js b/src/components/Blockly/toolbox/Toolbox.js index 275af4d..efd97fb 100644 --- a/src/components/Blockly/toolbox/Toolbox.js +++ b/src/components/Blockly/toolbox/Toolbox.js @@ -21,11 +21,8 @@ class Toolbox extends React.Component { [`${Blockly.Msg.variable_LONG}`, "long"], [`${Blockly.Msg.variable_DECIMAL}`, "float"], [`${Blockly.Msg.variables_TEXT}`, "String"], - [`${Blockly.Msg.variables_ARRAY}`, "Array"], [`${Blockly.Msg.variables_CHARACTER}`, "char"], [`${Blockly.Msg.variables_BOOLEAN}`, "boolean"], - [`${Blockly.Msg.variables_NULL}`, "void"], - [`${Blockly.Msg.variables_UNDEF}`, "undefined"], ] ); typedVarModal.init();