fix output types
This commit is contained in:
		
							parent
							
								
									34f16ee4cf
								
							
						
					
					
						commit
						da3f909312
					
				| @ -10,248 +10,271 @@ | |||||||
|  * |  * | ||||||
|  * TODO: maybe change this to a "PIN" BlocklyType |  * TODO: maybe change this to a "PIN" BlocklyType | ||||||
|  */ |  */ | ||||||
| import Blockly from 'blockly/core'; | import Blockly from "blockly/core"; | ||||||
| import { selectedBoard } from '../helpers/board' | import { selectedBoard } from "../helpers/board"; | ||||||
| import * as Types from '../helpers/types' | import * as Types from "../helpers/types"; | ||||||
| 
 | 
 | ||||||
| 
 | Blockly.Blocks["io_digitalwrite"] = { | ||||||
| Blockly.Blocks['io_digitalwrite'] = { |   /** | ||||||
|     /** |    * Block for creating a 'set pin' to a state. | ||||||
|      * Block for creating a 'set pin' to a state. |    * @this Blockly.Block | ||||||
|      * @this Blockly.Block |    */ | ||||||
|      */ |   init: function () { | ||||||
|     init: function () { |     this.setHelpUrl("http://arduino.cc/en/Reference/DigitalWrite"); | ||||||
|         this.setHelpUrl('http://arduino.cc/en/Reference/DigitalWrite'); |     this.setColour(250); | ||||||
|         this.setColour(250); |     this.appendValueInput("STATE") | ||||||
|         this.appendValueInput('STATE') |       .appendField(Blockly.Msg.ARD_DIGITALWRITE) | ||||||
|             .appendField(Blockly.Msg.ARD_DIGITALWRITE) |       .appendField( | ||||||
|             .appendField(new Blockly.FieldDropdown( |         new Blockly.FieldDropdown(selectedBoard().digitalPins), | ||||||
|                 selectedBoard().digitalPins), 'PIN') |         "PIN" | ||||||
|             .appendField(Blockly.Msg.ARD_WRITE_TO) |       ) | ||||||
|             .setCheck(Types.BOOLEAN.checkList); |       .appendField(Blockly.Msg.ARD_WRITE_TO) | ||||||
|         this.setInputsInline(false); |       .setCheck(Types.BOOLEAN.checkList); | ||||||
|         this.setPreviousStatement(true, null); |     this.setInputsInline(false); | ||||||
|         this.setNextStatement(true, null); |     this.setPreviousStatement(true, null); | ||||||
|         this.setTooltip(Blockly.Msg.ARD_DIGITALWRITE_TIP); |     this.setNextStatement(true, null); | ||||||
|     }, |     this.setTooltip(Blockly.Msg.ARD_DIGITALWRITE_TIP); | ||||||
|     /** |   }, | ||||||
|      * Updates the content of the the pin related fields. |   /** | ||||||
|      * @this Blockly.Block |    * Updates the content of the the pin related fields. | ||||||
|      */ |    * @this Blockly.Block | ||||||
|     updateFields: function () { |    */ | ||||||
|         Blockly.Arduino.Boards.refreshBlockFieldDropdown( |   updateFields: function () { | ||||||
|             this, 'PIN', 'digitalPins'); |     Blockly.Arduino.Boards.refreshBlockFieldDropdown( | ||||||
|     } |       this, | ||||||
|  |       "PIN", | ||||||
|  |       "digitalPins" | ||||||
|  |     ); | ||||||
|  |   }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| Blockly.Blocks['io_digitalread'] = { | Blockly.Blocks["io_digitalread"] = { | ||||||
|     /** |   /** | ||||||
|      * Block for creating a 'read pin'. |    * Block for creating a 'read pin'. | ||||||
|      * @this Blockly.Block |    * @this Blockly.Block | ||||||
|      */ |    */ | ||||||
|     init: function () { |   init: function () { | ||||||
|         this.setHelpUrl('http://arduino.cc/en/Reference/DigitalRead'); |     this.setHelpUrl("http://arduino.cc/en/Reference/DigitalRead"); | ||||||
|         this.setColour(250); |     this.setColour(250); | ||||||
|         this.appendDummyInput() |     this.appendDummyInput() | ||||||
|             .appendField(Blockly.Msg.ARD_DIGITALREAD) |       .appendField(Blockly.Msg.ARD_DIGITALREAD) | ||||||
|             .appendField(new Blockly.FieldDropdown( |       .appendField( | ||||||
|                 selectedBoard().digitalPins), 'PIN'); |         new Blockly.FieldDropdown(selectedBoard().digitalPins), | ||||||
|         this.setOutput(true, 'boolean'); |         "PIN" | ||||||
|         this.setTooltip(Blockly.Msg.ARD_DIGITALREAD_TIP); |       ); | ||||||
|     }, |     this.setOutput(true, "boolean"); | ||||||
|     /** @return {!string} The type of return value for the block, an integer. */ |     this.setTooltip(Blockly.Msg.ARD_DIGITALREAD_TIP); | ||||||
|     getBlockType: function () { |   }, | ||||||
|         return Types.BOOLEAN; |   /** @return {!string} The type of return value for the block, an integer. */ | ||||||
|     }, |   getBlockType: function () { | ||||||
|     /** |     return Types.BOOLEAN; | ||||||
|      * Updates the content of the the pin related fields. |   }, | ||||||
|      * @this Blockly.Block |   /** | ||||||
|      */ |    * Updates the content of the the pin related fields. | ||||||
|     updateFields: function () { |    * @this Blockly.Block | ||||||
|         Blockly.Arduino.Boards.refreshBlockFieldDropdown( |    */ | ||||||
|             this, 'PIN', 'digitalPins'); |   updateFields: function () { | ||||||
|     } |     Blockly.Arduino.Boards.refreshBlockFieldDropdown( | ||||||
|  |       this, | ||||||
|  |       "PIN", | ||||||
|  |       "digitalPins" | ||||||
|  |     ); | ||||||
|  |   }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| Blockly.Blocks['io_builtin_led'] = { | Blockly.Blocks["io_builtin_led"] = { | ||||||
|     /** |   /** | ||||||
|      * Block for setting built-in LED to a state. |    * Block for setting built-in LED to a state. | ||||||
|      * @this Blockly.Block |    * @this Blockly.Block | ||||||
|      */ |    */ | ||||||
|     init: function () { |   init: function () { | ||||||
|         this.setHelpUrl('http://arduino.cc/en/Reference/DigitalWrite'); |     this.setHelpUrl("http://arduino.cc/en/Reference/DigitalWrite"); | ||||||
|         this.setColour(250); |     this.setColour(250); | ||||||
|         this.appendValueInput('STATE') |     this.appendValueInput("STATE") | ||||||
|             .appendField(Blockly.Msg.ARD_BUILTIN_LED) |       .appendField(Blockly.Msg.ARD_BUILTIN_LED) | ||||||
|             .appendField(new Blockly.FieldDropdown( |       .appendField( | ||||||
|                 selectedBoard().builtinLed), 'BUILT_IN_LED') |         new Blockly.FieldDropdown(selectedBoard().builtinLed), | ||||||
|             .appendField(Blockly.Msg.ARD_WRITE_TO) |         "BUILT_IN_LED" | ||||||
|             .setCheck(Types.BOOLEAN.compatibleTypes); |       ) | ||||||
|         this.setInputsInline(false); |       .appendField(Blockly.Msg.ARD_WRITE_TO) | ||||||
|         this.setPreviousStatement(true, null); |       .setCheck(Types.BOOLEAN.compatibleTypes); | ||||||
|         this.setNextStatement(true, null); |     this.setInputsInline(false); | ||||||
|         this.setTooltip(Blockly.Msg.ARD_BUILTIN_LED_TIP); |     this.setPreviousStatement(true, null); | ||||||
|     }, |     this.setNextStatement(true, null); | ||||||
|     /** |     this.setTooltip(Blockly.Msg.ARD_BUILTIN_LED_TIP); | ||||||
|      * Updates the content of the the pin related fields. |   }, | ||||||
|      * @this Blockly.Block |   /** | ||||||
|      */ |    * Updates the content of the the pin related fields. | ||||||
|     updateFields: function () { |    * @this Blockly.Block | ||||||
|         Blockly.Arduino.Boards.refreshBlockFieldDropdown( |    */ | ||||||
|             this, 'BUILT_IN_LED', 'builtinLed'); |   updateFields: function () { | ||||||
|     }, |     Blockly.Arduino.Boards.refreshBlockFieldDropdown( | ||||||
|     /** @return {!string} The type of input value for the block, an integer. */ |       this, | ||||||
|     getBlockType: function () { |       "BUILT_IN_LED", | ||||||
|         return Types.BOOLEAN; |       "builtinLed" | ||||||
|     }, |     ); | ||||||
|  |   }, | ||||||
|  |   /** @return {!string} The type of input value for the block, an integer. */ | ||||||
|  |   getBlockType: function () { | ||||||
|  |     return Types.BOOLEAN; | ||||||
|  |   }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| Blockly.Blocks['io_analogwrite'] = { | Blockly.Blocks["io_analogwrite"] = { | ||||||
|     /** |   /** | ||||||
|      * Block for creating a 'set pin' to an analogue value. |    * Block for creating a 'set pin' to an analogue value. | ||||||
|      * @this Blockly.Block |    * @this Blockly.Block | ||||||
|      */ |    */ | ||||||
|     init: function () { |   init: function () { | ||||||
|         this.setHelpUrl('http://arduino.cc/en/Reference/AnalogWrite'); |     this.setHelpUrl("http://arduino.cc/en/Reference/AnalogWrite"); | ||||||
|         this.setColour(250); |     this.setColour(250); | ||||||
|         this.appendValueInput('NUM') |     this.appendValueInput("NUM") | ||||||
|             .appendField(Blockly.Msg.ARD_ANALOGWRITE) |       .appendField(Blockly.Msg.ARD_ANALOGWRITE) | ||||||
|             .appendField(new Blockly.FieldDropdown( |       .appendField(new Blockly.FieldDropdown(selectedBoard().pwmPins), "PIN") | ||||||
|                 selectedBoard().pwmPins), 'PIN') |       .appendField(Blockly.Msg.ARD_WRITE_TO) | ||||||
|             .appendField(Blockly.Msg.ARD_WRITE_TO) |       .setCheck(Types.NUMBER.compatibleTypes); | ||||||
|             .setCheck(Types.NUMBER.compatibleTypes); |     this.setInputsInline(false); | ||||||
|         this.setInputsInline(false); |     this.setPreviousStatement(true, null); | ||||||
|         this.setPreviousStatement(true, null); |     this.setNextStatement(true, null); | ||||||
|         this.setNextStatement(true, null); |     this.setTooltip(Blockly.Msg.ARD_ANALOGWRITE_TIP); | ||||||
|         this.setTooltip(Blockly.Msg.ARD_ANALOGWRITE_TIP); |   }, | ||||||
|     }, |   /** | ||||||
|     /** |    * Updates the content of the the pin related fields. | ||||||
|      * Updates the content of the the pin related fields. |    * @this Blockly.Block | ||||||
|      * @this Blockly.Block |    */ | ||||||
|      */ |   updateFields: function () { | ||||||
|     updateFields: function () { |     Blockly.Arduino.Boards.refreshBlockFieldDropdown(this, "PIN", "pwmPins"); | ||||||
|         Blockly.Arduino.Boards.refreshBlockFieldDropdown(this, 'PIN', 'pwmPins'); |   }, | ||||||
|     }, |   /** @return {!string} The type of input value for the block, an integer. */ | ||||||
|     /** @return {!string} The type of input value for the block, an integer. */ |   getBlockType: function () { | ||||||
|     getBlockType: function () { |     return Types.NUMBER; | ||||||
|         return Types.NUMBER; |   }, | ||||||
|     }, |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| Blockly.Blocks['io_analogread'] = { | Blockly.Blocks["io_analogread"] = { | ||||||
|     /** |   /** | ||||||
|      * Block for reading an analogue input. |    * Block for reading an analogue input. | ||||||
|      * @this Blockly.Block |    * @this Blockly.Block | ||||||
|      */ |    */ | ||||||
|     init: function () { |   init: function () { | ||||||
|         this.setHelpUrl('http://arduino.cc/en/Reference/AnalogRead'); |     this.setHelpUrl("http://arduino.cc/en/Reference/AnalogRead"); | ||||||
|         this.setColour(250); |     this.setColour(250); | ||||||
|         this.appendDummyInput() |     this.appendDummyInput() | ||||||
|             .appendField(Blockly.Msg.ARD_ANALOGREAD) |       .appendField(Blockly.Msg.ARD_ANALOGREAD) | ||||||
|             .appendField(new Blockly.FieldDropdown( |       .appendField( | ||||||
|                 selectedBoard().analogPins), 'PIN'); |         new Blockly.FieldDropdown(selectedBoard().analogPins), | ||||||
|         this.setOutput(true, Types.NUMBER.typeId); |         "PIN" | ||||||
|         this.setTooltip(Blockly.Msg.ARD_ANALOGREAD_TIP); |       ); | ||||||
|     }, |     this.setOutput(true, Types.NUMBER.typeName); | ||||||
|     /** @return {!string} The type of return value for the block, an integer. */ |     this.setTooltip(Blockly.Msg.ARD_ANALOGREAD_TIP); | ||||||
|     getBlockType: function () { |   }, | ||||||
|         return Types.NUMBER.typeId; |   /** @return {!string} The type of return value for the block, an integer. */ | ||||||
|     }, |   getBlockType: function () { | ||||||
|     /** |     return Types.NUMBER.typeName; | ||||||
|      * Updates the content of the the pin related fields. |   }, | ||||||
|      * @this Blockly.Block |   /** | ||||||
|      */ |    * Updates the content of the the pin related fields. | ||||||
|     updateFields: function () { |    * @this Blockly.Block | ||||||
|         Blockly.Arduino.Boards.refreshBlockFieldDropdown(this, 'PIN', 'analogPins'); |    */ | ||||||
|     } |   updateFields: function () { | ||||||
|  |     Blockly.Arduino.Boards.refreshBlockFieldDropdown(this, "PIN", "analogPins"); | ||||||
|  |   }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| Blockly.Blocks['io_highlow'] = { | Blockly.Blocks["io_highlow"] = { | ||||||
|     /** |   /** | ||||||
|      * Block for creating a pin state. |    * Block for creating a pin state. | ||||||
|      * @this Blockly.Block |    * @this Blockly.Block | ||||||
|      */ |    */ | ||||||
|     init: function () { |   init: function () { | ||||||
|         this.setHelpUrl('http://arduino.cc/en/Reference/Constants'); |     this.setHelpUrl("http://arduino.cc/en/Reference/Constants"); | ||||||
|         this.setColour(250); |     this.setColour(250); | ||||||
|         this.appendDummyInput() |     this.appendDummyInput().appendField( | ||||||
|             .appendField( |       new Blockly.FieldDropdown([ | ||||||
|                 new Blockly.FieldDropdown([[Blockly.Msg.ARD_HIGH, 'HIGH'], [Blockly.Msg.ARD_LOW, 'LOW']]), |         [Blockly.Msg.ARD_HIGH, "HIGH"], | ||||||
|                 'STATE'); |         [Blockly.Msg.ARD_LOW, "LOW"], | ||||||
|         this.setOutput(true, Types.BOOLEAN.typeId); |       ]), | ||||||
|         this.setTooltip(Blockly.Msg.ARD_HIGHLOW_TIP); |       "STATE" | ||||||
|     }, |     ); | ||||||
|     /** @return {!string} The type of return value for the block, an integer. */ |     this.setOutput(true, Types.BOOLEAN.typeName); | ||||||
|     getBlockType: function () { |     this.setTooltip(Blockly.Msg.ARD_HIGHLOW_TIP); | ||||||
|         return Types.BOOLEAN; |   }, | ||||||
|     } |   /** @return {!string} The type of return value for the block, an integer. */ | ||||||
|  |   getBlockType: function () { | ||||||
|  |     return Types.BOOLEAN; | ||||||
|  |   }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| Blockly.Blocks['io_pulsein'] = { | Blockly.Blocks["io_pulsein"] = { | ||||||
|     /** |   /** | ||||||
|      * Block for measuring the duration of a pulse in an input pin. |    * Block for measuring the duration of a pulse in an input pin. | ||||||
|      * @this Blockly.Block |    * @this Blockly.Block | ||||||
|      */ |    */ | ||||||
|     init: function () { |   init: function () { | ||||||
|         this.jsonInit({ |     this.jsonInit({ | ||||||
|             "type": "math_foo", |       type: "math_foo", | ||||||
|             "message0": Blockly.Msg.ARD_PULSE_READ, |       message0: Blockly.Msg.ARD_PULSE_READ, | ||||||
|             "args0": [{ |       args0: [ | ||||||
|                 "type": "input_value", |         { | ||||||
|                 "name": "PULSETYPE", |           type: "input_value", | ||||||
|                 "check": Types.BOOLEAN.compatibleTypes |           name: "PULSETYPE", | ||||||
|             }, { |           check: Types.BOOLEAN.compatibleTypes, | ||||||
|                 "type": "field_dropdown", |         }, | ||||||
|                 "name": "PULSEPIN", |         { | ||||||
|                 "options": selectedBoard().digitalPins, |           type: "field_dropdown", | ||||||
|             } |           name: "PULSEPIN", | ||||||
|             ], |           options: selectedBoard().digitalPins, | ||||||
|             "output": Types.NUMBER.typeId, |         }, | ||||||
|             "inputsInline": true, |       ], | ||||||
|             "colour": 250, |       output: Types.NUMBER.typeName, | ||||||
|             "tooltip": Blockly.Msg.ARD_PULSE_TIP, |       inputsInline: true, | ||||||
|             "helpUrl": 'https://www.arduino.cc/en/Reference/PulseIn' |       colour: 250, | ||||||
|         }); |       tooltip: Blockly.Msg.ARD_PULSE_TIP, | ||||||
|     }, |       helpUrl: "https://www.arduino.cc/en/Reference/PulseIn", | ||||||
|     /** @return {!string} The type of input value for the block, an integer. */ |     }); | ||||||
|     getBlockType: function () { |   }, | ||||||
|         return Types.NUMBER.typeId; |   /** @return {!string} The type of input value for the block, an integer. */ | ||||||
|     } |   getBlockType: function () { | ||||||
|  |     return Types.NUMBER.typeName; | ||||||
|  |   }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| Blockly.Blocks['io_pulsetimeout'] = { | Blockly.Blocks["io_pulsetimeout"] = { | ||||||
|     /** |   /** | ||||||
|      * Block for measuring (with a time-out) the duration of a pulse in an input |    * Block for measuring (with a time-out) the duration of a pulse in an input | ||||||
|      * pin. |    * pin. | ||||||
|      * @this Blockly.Block |    * @this Blockly.Block | ||||||
|      */ |    */ | ||||||
|     init: function () { |   init: function () { | ||||||
|         this.jsonInit({ |     this.jsonInit({ | ||||||
|             "type": "math_foo", |       type: "math_foo", | ||||||
|             "message0": Blockly.Msg.ARD_PULSE_READ_TIMEOUT, |       message0: Blockly.Msg.ARD_PULSE_READ_TIMEOUT, | ||||||
|             "args0": [{ |       args0: [ | ||||||
|                 "type": "input_value", |         { | ||||||
|                 "name": "PULSETYPE", |           type: "input_value", | ||||||
|                 "check": Types.BOOLEAN.compatibleTypes |           name: "PULSETYPE", | ||||||
|             }, { |           check: Types.BOOLEAN.compatibleTypes, | ||||||
|                 "type": "field_dropdown", |         }, | ||||||
|                 "name": "PULSEPIN", |         { | ||||||
|                 "options": selectedBoard().digitalPins, |           type: "field_dropdown", | ||||||
|             }, { |           name: "PULSEPIN", | ||||||
|                 "type": "input_value", |           options: selectedBoard().digitalPins, | ||||||
|                 "name": "TIMEOUT", |         }, | ||||||
|                 "check": Types.NUMBER.compatibleTypes |         { | ||||||
|             } |           type: "input_value", | ||||||
|             ], |           name: "TIMEOUT", | ||||||
|             "output": Types.NUMBER.typeId, |           check: Types.NUMBER.compatibleTypes, | ||||||
|             "inputsInline": true, |         }, | ||||||
|             "colour": 250, |       ], | ||||||
|             "tooltip": Blockly.Msg.ARD_PULSETIMEOUT_TIP, |       output: Types.NUMBER.typeName, | ||||||
|             "helpUrl": 'https://www.arduino.cc/en/Reference/PulseIn' |       inputsInline: true, | ||||||
|         }); |       colour: 250, | ||||||
|     }, |       tooltip: Blockly.Msg.ARD_PULSETIMEOUT_TIP, | ||||||
|     /** @return {!string} The type of input value for the block, an integer. */ |       helpUrl: "https://www.arduino.cc/en/Reference/PulseIn", | ||||||
|     getBlockType: function () { |     }); | ||||||
|         return Types.NUMBER.typeId; |   }, | ||||||
|     } |   /** @return {!string} The type of input value for the block, an integer. */ | ||||||
|  |   getBlockType: function () { | ||||||
|  |     return Types.NUMBER.typeName; | ||||||
|  |   }, | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -1,59 +1,54 @@ | |||||||
| import Blockly, { FieldDropdown } from 'blockly/core' | import Blockly, { FieldDropdown } from "blockly/core"; | ||||||
| import * as Types from '../helpers/types' | import * as Types from "../helpers/types"; | ||||||
| import { getColour } from '../helpers/colour'; | import { getColour } from "../helpers/colour"; | ||||||
| 
 | 
 | ||||||
| Blockly.Blocks['lists_create_empty'] = { | Blockly.Blocks["lists_create_empty"] = { | ||||||
|     /** |   /** | ||||||
|      * Elapsed time in milliseconds block definition |    * Elapsed time in milliseconds block definition | ||||||
|      * @this Blockly.Block |    * @this Blockly.Block | ||||||
|      */ |    */ | ||||||
|     init: function () { |   init: function () { | ||||||
|         this.setHelpUrl('http://arduino.cc/en/Reference/Millis'); |     this.setHelpUrl("http://arduino.cc/en/Reference/Millis"); | ||||||
|         this.setColour(getColour().arrays); |     this.setColour(getColour().arrays); | ||||||
|         this.appendDummyInput() |     this.appendDummyInput().appendField("create List with"); | ||||||
|             .appendField("create List with") |     this.appendValueInput("NUMBER"); | ||||||
|         this.appendValueInput('NUMBER'); |     this.appendDummyInput() | ||||||
|         this.appendDummyInput() |       .appendField("Items of Type") | ||||||
|             .appendField("Items of Type") |       .appendField(new FieldDropdown(Types.VARIABLE_TYPES), "type"); | ||||||
|             .appendField(new FieldDropdown(Types.VARIABLE_TYPES), 'type'); |     this.setOutput(true, Types.ARRAY.typeName); | ||||||
|         this.setOutput(true, Types.ARRAY.typeId); |     this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP); | ||||||
|         this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP); |   }, | ||||||
|     }, |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| 
 | Blockly.Blocks["array_getIndex"] = { | ||||||
| Blockly.Blocks['array_getIndex'] = { |   /** | ||||||
|     /** |    * Elapsed time in milliseconds block definition | ||||||
|      * Elapsed time in milliseconds block definition |    * @this Blockly.Block | ||||||
|      * @this Blockly.Block |    */ | ||||||
|      */ |   init: function () { | ||||||
|     init: function () { |     this.setHelpUrl("http://arduino.cc/en/Reference/Millis"); | ||||||
|         this.setHelpUrl('http://arduino.cc/en/Reference/Millis'); |     this.setColour(getColour().arrays); | ||||||
|         this.setColour(getColour().arrays); |     this.appendDummyInput().appendField( | ||||||
|         this.appendDummyInput() |       new Blockly.FieldVariable("X", null, ["Array"], "Array"), | ||||||
|             .appendField(new Blockly.FieldVariable( |       "FIELDNAME" | ||||||
|                 'X', |     ); | ||||||
|                 null, |     this.setOutput(true, Types.ARRAY.typeName); | ||||||
|                 ['Array'], |     this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP); | ||||||
|                 'Array' |   }, | ||||||
|             ), 'FIELDNAME'); |  | ||||||
|         this.setOutput(true, Types.ARRAY.typeId); |  | ||||||
|         this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP); |  | ||||||
|     }, |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| Blockly.Blocks['lists_length'] = { | Blockly.Blocks["lists_length"] = { | ||||||
|     /** |   /** | ||||||
|      * Elapsed time in milliseconds block definition |    * Elapsed time in milliseconds block definition | ||||||
|      * @this Blockly.Block |    * @this Blockly.Block | ||||||
|      */ |    */ | ||||||
|     init: function () { |   init: function () { | ||||||
|         this.setHelpUrl('http://arduino.cc/en/Reference/Millis'); |     this.setHelpUrl("http://arduino.cc/en/Reference/Millis"); | ||||||
|         this.setColour(getColour().arrays); |     this.setColour(getColour().arrays); | ||||||
|         this.appendValueInput('ARRAY') |     this.appendValueInput("ARRAY") | ||||||
|             .appendField('length of') |       .appendField("length of") | ||||||
|             .setCheck(Types.ARRAY.compatibleTypes); |       .setCheck(Types.ARRAY.compatibleTypes); | ||||||
|         this.setOutput(true, Types.NUMBER.typeName); |     this.setOutput(true, Types.NUMBER.typeName); | ||||||
|         this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP); |     this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP); | ||||||
|     }, |   }, | ||||||
| }; | }; | ||||||
| @ -11,40 +11,39 @@ | |||||||
|  * TODO: This block can be improved to set the new range properly. |  * TODO: This block can be improved to set the new range properly. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | import * as Blockly from "blockly/core"; | ||||||
|  | import { getColour } from "../helpers/colour"; | ||||||
|  | import * as Types from "../helpers/types"; | ||||||
| 
 | 
 | ||||||
| import * as Blockly from 'blockly/core'; | Blockly.Blocks["base_map"] = { | ||||||
| import { getColour } from '../helpers/colour'; |   /** | ||||||
| import * as Types from '../helpers/types' |    * Block for creating a the map function. | ||||||
| 
 |    * @this Blockly.Block | ||||||
| Blockly.Blocks['base_map'] = { |    */ | ||||||
|     /** |   init: function () { | ||||||
|      * Block for creating a the map function. |     this.setHelpUrl("http://arduino.cc/en/Reference/map"); | ||||||
|      * @this Blockly.Block |     this.setColour(getColour().math); | ||||||
|      */ |     this.appendValueInput("NUM") | ||||||
|     init: function () { |       .appendField(Blockly.Msg.ARD_MAP) | ||||||
|         this.setHelpUrl('http://arduino.cc/en/Reference/map'); |       .setCheck(Types.NUMBER.compatibleTypes); | ||||||
|         this.setColour(getColour().math); |     this.appendValueInput("FMIN") | ||||||
|         this.appendValueInput('NUM') |       .appendField(Blockly.Msg.ARD_MAP_FROMMIN) | ||||||
|             .appendField(Blockly.Msg.ARD_MAP) |       .setCheck(Types.NUMBER.compatibleTypes); | ||||||
|             .setCheck(Types.NUMBER.compatibleTypes); |     this.appendValueInput("FMAX") | ||||||
|         this.appendValueInput('FMIN') |       .appendField(Blockly.Msg.ARD_MAP_FROMMAX) | ||||||
|             .appendField(Blockly.Msg.ARD_MAP_FROMMIN) |       .setCheck(Types.NUMBER.compatibleTypes); | ||||||
|             .setCheck(Types.NUMBER.compatibleTypes); |     this.appendValueInput("DMIN") | ||||||
|         this.appendValueInput('FMAX') |       .appendField(Blockly.Msg.ARD_MAP_TOMIN) | ||||||
|             .appendField(Blockly.Msg.ARD_MAP_FROMMAX) |       .setCheck(Types.NUMBER.compatibleTypes); | ||||||
|             .setCheck(Types.NUMBER.compatibleTypes); |     this.appendValueInput("DMAX") | ||||||
|         this.appendValueInput('DMIN') |       .appendField(Blockly.Msg.ARD_MAP_TOMAX) | ||||||
|             .appendField(Blockly.Msg.ARD_MAP_TOMIN) |       .setCheck(Types.NUMBER.compatibleTypes); | ||||||
|             .setCheck(Types.NUMBER.compatibleTypes); |     this.setOutput(true); | ||||||
|         this.appendValueInput('DMAX') |     this.setInputsInline(false); | ||||||
|             .appendField(Blockly.Msg.ARD_MAP_TOMAX) |     this.setTooltip(Blockly.Msg.ARD_MAP_TIP); | ||||||
|             .setCheck(Types.NUMBER.compatibleTypes); |   }, | ||||||
|         this.setOutput(true); |   /** @return {string} The type of return value for the block, an integer. */ | ||||||
|         this.setInputsInline(false); |   getBlockType: function () { | ||||||
|         this.setTooltip(Blockly.Msg.ARD_MAP_TIP); |     return Types.NUMBER.typeName; | ||||||
|     }, |   }, | ||||||
|     /** @return {string} The type of return value for the block, an integer. */ |  | ||||||
|     getBlockType: function () { |  | ||||||
|         return Types.NUMBER.typeId; |  | ||||||
|     } |  | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -62,7 +62,7 @@ Blockly.Blocks["sensebox_rtc_get"] = { | |||||||
|         ]), |         ]), | ||||||
|         "dropdown" |         "dropdown" | ||||||
|       ); |       ); | ||||||
|     this.setOutput(true, Types.LARGE_NUMBER.typeId); |     this.setOutput(true, Types.LARGE_NUMBER.typeName); | ||||||
|     this.setTooltip(Blockly.Msg.sensebox_rtc_get_tooltip); |     this.setTooltip(Blockly.Msg.sensebox_rtc_get_tooltip); | ||||||
|   }, |   }, | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -59,7 +59,7 @@ Blockly.Blocks["time_millis"] = { | |||||||
|     this.setHelpUrl("http://arduino.cc/en/Reference/Millis"); |     this.setHelpUrl("http://arduino.cc/en/Reference/Millis"); | ||||||
|     this.setColour(getColour().time); |     this.setColour(getColour().time); | ||||||
|     this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_MILLIS); |     this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_MILLIS); | ||||||
|     this.setOutput(true, Types.LARGE_NUMBER.typeId); |     this.setOutput(true, Types.LARGE_NUMBER.typeName); | ||||||
|     this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP); |     this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP); | ||||||
|   }, |   }, | ||||||
|   /** @return {string} The type of return value for the block, an integer. */ |   /** @return {string} The type of return value for the block, an integer. */ | ||||||
| @ -77,7 +77,7 @@ Blockly.Blocks["time_micros"] = { | |||||||
|     this.setHelpUrl("http://arduino.cc/en/Reference/Micros"); |     this.setHelpUrl("http://arduino.cc/en/Reference/Micros"); | ||||||
|     this.setColour(getColour().time); |     this.setColour(getColour().time); | ||||||
|     this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_MICROS); |     this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_MICROS); | ||||||
|     this.setOutput(true, Types.LARGE_NUMBER.typeId); |     this.setOutput(true, Types.LARGE_NUMBER.typeName); | ||||||
|     this.setTooltip(Blockly.Msg.ARD_TIME_MICROS_TIP); |     this.setTooltip(Blockly.Msg.ARD_TIME_MICROS_TIP); | ||||||
|   }, |   }, | ||||||
|   /** |   /** | ||||||
|  | |||||||
| @ -1,108 +1,118 @@ | |||||||
| 
 |  | ||||||
| export const IO = { | export const IO = { | ||||||
| 
 |   ARD_ANALOGREAD: "lese analogen Pin#", | ||||||
|     ARD_ANALOGREAD: "lese analogen Pin#", |   ARD_ANALOGREAD_TIP: "Gibt einen Wert zwischen 0 und 1023 zurück", | ||||||
|     ARD_ANALOGREAD_TIP: "Gibt einen Wert zwischen 0 und 1024 zurüch", |   ARD_ANALOGWRITE: "setzte analogen Pin#", | ||||||
|     ARD_ANALOGWRITE: "setzte analogen Pin#", |   ARD_ANALOGWRITE_TIP: | ||||||
|     ARD_ANALOGWRITE_TIP: "Schreibe analogen Wert zwischen 0 und 255 an einen spezifischen PWM Port", |     "Schreibe analogen Wert zwischen 0 und 255 an einen spezifischen PWM Port", | ||||||
|     ARD_BUILTIN_LED: "eingebaute LED", |   ARD_BUILTIN_LED: "eingebaute LED", | ||||||
|     ARD_BUILTIN_LED_TIP: "Schaltet die interne LED An oder Aus", |   ARD_BUILTIN_LED_TIP: "Schaltet die interne LED An oder Aus", | ||||||
|     ARD_COMPONENT_WARN1: "A %1 configuration block with the same %2 name must be added to use this block!", |   ARD_COMPONENT_WARN1: | ||||||
|     ARD_DEFINE: "Definiere", |     "A %1 configuration block with the same %2 name must be added to use this block!", | ||||||
|     ARD_DIGITALREAD: "lesen digitalen Pin#", |   ARD_DEFINE: "Definiere", | ||||||
|     ARD_DIGITALREAD_TIP: "Lese Wert an digitalen Pin: HIGH(1) oder LOW(0)", |   ARD_DIGITALREAD: "lesen digitalen Pin#", | ||||||
|     ARD_DIGITALWRITE: "setzte digitalen Pin#", |   ARD_DIGITALREAD_TIP: "Lese Wert an digitalen Pin: HIGH(1) oder LOW(0)", | ||||||
|     ARD_DIGITALWRITE_TIP: "Schreibe digitalen Wert HIGH (1) oder LOW(0) an spezifischen Port", |   ARD_DIGITALWRITE: "setzte digitalen Pin#", | ||||||
|     ARD_FUN_RUN_LOOP: "Endlosschleife()", |   ARD_DIGITALWRITE_TIP: | ||||||
|     ARD_FUN_RUN_SETUP: "Setup()", |     "Schreibe digitalen Wert HIGH (1) oder LOW(0) an spezifischen Port", | ||||||
|     ARD_FUN_RUN_TIP: "Definiert die setup() und loop() Funktionen. Die setup()-Funktion wird beim starten **einmal** ausgeführt. Anschließend wir die loop()-Funktion in einer **Endlosschleife** ausgeführt. Füge in die Setup()-Funktion Blöcke ein, um z.B. das Display zu initalisieren, eine Verbindung zum WiFi-Netzwerk herzustellen oder um die LoRa Verbindung zu initialsieren.", |   ARD_FUN_RUN_LOOP: "Endlosschleife()", | ||||||
|     ARD_HIGH: "HIGH", |   ARD_FUN_RUN_SETUP: "Setup()", | ||||||
|     ARD_HIGHLOW_TIP: "Setzt einen Status auf HIGH oder LOWSet a pin state logic High or Low.", |   ARD_FUN_RUN_TIP: | ||||||
|     ARD_LOW: "LOW", |     "Definiert die setup() und loop() Funktionen. Die setup()-Funktion wird beim starten **einmal** ausgeführt. Anschließend wir die loop()-Funktion in einer **Endlosschleife** ausgeführt. Füge in die Setup()-Funktion Blöcke ein, um z.B. das Display zu initalisieren, eine Verbindung zum WiFi-Netzwerk herzustellen oder um die LoRa Verbindung zu initialsieren.", | ||||||
|     ARD_MAP: "Verteile Wert", |   ARD_HIGH: "HIGH", | ||||||
|     ARD_MAP_FROMMIN: "von Minimum", |   ARD_HIGHLOW_TIP: | ||||||
|     ARD_MAP_FROMMAX: "bis maximum", |     "Setzt einen Status auf HIGH oder LOWSet a pin state logic High or Low.", | ||||||
|     ARD_MAP_TOMIN: "auf Minimum", |   ARD_LOW: "LOW", | ||||||
|     ARD_MAP_TOMAX: "bis Maximum", |   ARD_MAP: "Verteile Wert", | ||||||
|     ARD_MAP_TIP: "Verteilt Werte zwischen [0-1024] zu andere.", |   ARD_MAP_FROMMIN: "von Minimum", | ||||||
|     ARD_MAP_VAL: "Wert zu [0-", |   ARD_MAP_FROMMAX: "bis maximum", | ||||||
|     ARD_NOTONE: "Schalte Ton aus an Pin", |   ARD_MAP_TOMIN: "auf Minimum", | ||||||
|     ARD_NOTONE_PIN: "keinen Ton an Pin", |   ARD_MAP_TOMAX: "bis Maximum", | ||||||
|     ARD_NOTONE_PIN_TIP: "Stoppe die Tonerzeugung an Pin", |   ARD_MAP_TIP: "Verteilt Werte zwischen [0-1024] zu andere.", | ||||||
|     ARD_NOTONE_TIP: "Schaltet den Ton am ausgewählten Pin aus", |   ARD_MAP_VAL: "Wert zu [0-", | ||||||
|     ARD_PIN_WARN1: "Pin %1 wird benötigt für  %2 als Pin %3. Bereitsgenutzt als %4.", |   ARD_NOTONE: "Schalte Ton aus an Pin", | ||||||
|     ARD_PULSETIMEOUT_TIP: "Misst die Laufzeit eines Impulses am ausgewählten Pin, wenn die Zeit ist in Microsekunden.", |   ARD_NOTONE_PIN: "keinen Ton an Pin", | ||||||
|     ARD_PULSE_READ: "Misst %1 Impuls an Pin #%2", |   ARD_NOTONE_PIN_TIP: "Stoppe die Tonerzeugung an Pin", | ||||||
|     ARD_PULSE_READ_TIMEOUT: "Misst %1 Impuls an Pin #%2 (Unterbrechung nach %3 μs)", |   ARD_NOTONE_TIP: "Schaltet den Ton am ausgewählten Pin aus", | ||||||
|     ARD_PULSE_TIP: "Misst die Zeit eines Impulses an dem ausgewählten Pin.", |   ARD_PIN_WARN1: | ||||||
|     ARD_SERIAL_BPS: "bps", |     "Pin %1 wird benötigt für  %2 als Pin %3. Bereitsgenutzt als %4.", | ||||||
|     ARD_SERIAL_PRINT: "schreibe", |   ARD_PULSETIMEOUT_TIP: | ||||||
|     ARD_SERIAL_PRINT_NEWLINE: "neue Zeile hinzufügen", |     "Misst die Laufzeit eines Impulses am ausgewählten Pin, wenn die Zeit ist in Microsekunden.", | ||||||
|     ARD_SERIAL_PRINT_TIP: "Prints data to the console/serial port as human-readable ASCII text.",  // untranslated
 |   ARD_PULSE_READ: "Misst %1 Impuls an Pin #%2", | ||||||
|     ARD_SERIAL_PRINT_WARN: "A setup block for %1 must be added to the workspace to use this block!",  // untranslated
 |   ARD_PULSE_READ_TIMEOUT: | ||||||
|     ARD_SERIAL_SETUP: "Setup", |     "Misst %1 Impuls an Pin #%2 (Unterbrechung nach %3 μs)", | ||||||
|     ARD_SERIAL_SETUP_TIP: "Selects the speed for a specific Serial peripheral",  // untranslated
 |   ARD_PULSE_TIP: "Misst die Zeit eines Impulses an dem ausgewählten Pin.", | ||||||
|     ARD_SERIAL_SPEED: ":  Übertragungsgeschwindigkeit zu", |   ARD_SERIAL_BPS: "bps", | ||||||
|     ARD_SERVO_READ: "liest SERVO an PIN#", |   ARD_SERIAL_PRINT: "schreibe", | ||||||
|     ARD_SERVO_READ_TIP: "Liest den Winkel des Servomotors aus", |   ARD_SERIAL_PRINT_NEWLINE: "neue Zeile hinzufügen", | ||||||
|     ARD_SERVO_WRITE: "setzt SERVO an Pin", |   ARD_SERIAL_PRINT_TIP: | ||||||
|     ARD_SERVO_WRITE_DEG_180: "Winkel (0~180)", |     "Prints data to the console/serial port as human-readable ASCII text.", // untranslated
 | ||||||
|     ARD_SERVO_WRITE_TIP: "Set a Servo to an specified angle",  // untranslated
 |   ARD_SERIAL_PRINT_WARN: | ||||||
|     ARD_SERVO_WRITE_TO: "",  // untranslated
 |     "A setup block for %1 must be added to the workspace to use this block!", // untranslated
 | ||||||
|     ARD_SETTONE: "Spiele Ton an Pin",  // untranslated
 |   ARD_SERIAL_SETUP: "Setup", | ||||||
|     ARD_SPI_SETUP: "Setup", |   ARD_SERIAL_SETUP_TIP: "Selects the speed for a specific Serial peripheral", // untranslated
 | ||||||
|     ARD_SPI_SETUP_CONF: "Konfiguration:", |   ARD_SERIAL_SPEED: ":  Übertragungsgeschwindigkeit zu", | ||||||
|     ARD_SPI_SETUP_DIVIDE: "clock divide",  // untranslated
 |   ARD_SERVO_READ: "liest SERVO an PIN#", | ||||||
|     ARD_SPI_SETUP_LSBFIRST: "LSBFIRST",  // untranslated
 |   ARD_SERVO_READ_TIP: "Liest den Winkel des Servomotors aus", | ||||||
|     ARD_SPI_SETUP_MODE: "SPI mode (idle - edge)",  // untranslated
 |   ARD_SERVO_WRITE: "setzt SERVO an Pin", | ||||||
|     ARD_SPI_SETUP_MODE0: "0 (LOW - Fallend)", |   ARD_SERVO_WRITE_DEG_180: "Winkel (0~180)", | ||||||
|     ARD_SPI_SETUP_MODE1: "1 (LOW - Steigend)", |   ARD_SERVO_WRITE_TIP: "Set a Servo to an specified angle", // untranslated
 | ||||||
|     ARD_SPI_SETUP_MODE2: "2 (HIGH - Fallend)", |   ARD_SERVO_WRITE_TO: "", // untranslated
 | ||||||
|     ARD_SPI_SETUP_MODE3: "3 (HIGH - Steigend)", |   ARD_SETTONE: "Spiele Ton an Pin", // untranslated
 | ||||||
|     ARD_SPI_SETUP_MSBFIRST: "MSBFIRST",  // untranslated
 |   ARD_SPI_SETUP: "Setup", | ||||||
|     ARD_SPI_SETUP_SHIFT: "data shift",  // untranslated
 |   ARD_SPI_SETUP_CONF: "Konfiguration:", | ||||||
|     ARD_SPI_SETUP_TIP: "Configures the SPI peripheral.",  // untranslated
 |   ARD_SPI_SETUP_DIVIDE: "clock divide", // untranslated
 | ||||||
|     ARD_SPI_TRANSRETURN_TIP: "Send a SPI message to an specified slave device and get data back.",  // untranslated
 |   ARD_SPI_SETUP_LSBFIRST: "LSBFIRST", // untranslated
 | ||||||
|     ARD_SPI_TRANS_NONE: "none",  // untranslated
 |   ARD_SPI_SETUP_MODE: "SPI mode (idle - edge)", // untranslated
 | ||||||
|     ARD_SPI_TRANS_SLAVE: "to slave pin",  // untranslated
 |   ARD_SPI_SETUP_MODE0: "0 (LOW - Fallend)", | ||||||
|     ARD_SPI_TRANS_TIP: "Send a SPI message to an specified slave device.",  // untranslated
 |   ARD_SPI_SETUP_MODE1: "1 (LOW - Steigend)", | ||||||
|     ARD_SPI_TRANS_VAL: "transfer",  // untranslated
 |   ARD_SPI_SETUP_MODE2: "2 (HIGH - Fallend)", | ||||||
|     ARD_SPI_TRANS_WARN1: "A setup block for %1 must be added to the workspace to use this block!",  // untranslated
 |   ARD_SPI_SETUP_MODE3: "3 (HIGH - Steigend)", | ||||||
|     ARD_SPI_TRANS_WARN2: "Old pin value %1 is no longer available.",  // untranslated
 |   ARD_SPI_SETUP_MSBFIRST: "MSBFIRST", // untranslated
 | ||||||
|     ARD_STEPPER_COMPONENT: "stepper",  // untranslated
 |   ARD_SPI_SETUP_SHIFT: "data shift", // untranslated
 | ||||||
|     ARD_STEPPER_DEFAULT_NAME: "MyStepper",  // untranslated
 |   ARD_SPI_SETUP_TIP: "Configures the SPI peripheral.", // untranslated
 | ||||||
|     ARD_STEPPER_FOUR_PINS: "4",  // untranslated
 |   ARD_SPI_TRANSRETURN_TIP: | ||||||
|     ARD_STEPPER_MOTOR: "stepper motor:",  // untranslated
 |     "Send a SPI message to an specified slave device and get data back.", // untranslated
 | ||||||
|     ARD_STEPPER_NUMBER_OF_PINS: "Number of pins",  // untranslated
 |   ARD_SPI_TRANS_NONE: "none", // untranslated
 | ||||||
|     ARD_STEPPER_PIN1: "pin1#",  // untranslated
 |   ARD_SPI_TRANS_SLAVE: "to slave pin", // untranslated
 | ||||||
|     ARD_STEPPER_PIN2: "pin2#",  // untranslated
 |   ARD_SPI_TRANS_TIP: "Send a SPI message to an specified slave device.", // untranslated
 | ||||||
|     ARD_STEPPER_PIN3: "pin3#",  // untranslated
 |   ARD_SPI_TRANS_VAL: "transfer", // untranslated
 | ||||||
|     ARD_STEPPER_PIN4: "pin4#",  // untranslated
 |   ARD_SPI_TRANS_WARN1: | ||||||
|     ARD_STEPPER_REVOLVS: "how many steps per revolution",  // untranslated
 |     "A setup block for %1 must be added to the workspace to use this block!", // untranslated
 | ||||||
|     ARD_STEPPER_SETUP: "Setup stepper motor",  // untranslated
 |   ARD_SPI_TRANS_WARN2: "Old pin value %1 is no longer available.", // untranslated
 | ||||||
|     ARD_STEPPER_SETUP_TIP: "Configures a stepper motor pinout and other settings.",  // untranslated
 |   ARD_STEPPER_COMPONENT: "stepper", // untranslated
 | ||||||
|     ARD_STEPPER_SPEED: "set speed (rpm) to",  // untranslated
 |   ARD_STEPPER_DEFAULT_NAME: "MyStepper", // untranslated
 | ||||||
|     ARD_STEPPER_STEP: "move stepper",  // untranslated
 |   ARD_STEPPER_FOUR_PINS: "4", // untranslated
 | ||||||
|     ARD_STEPPER_STEPS: "steps",  // untranslated
 |   ARD_STEPPER_MOTOR: "stepper motor:", // untranslated
 | ||||||
|     ARD_STEPPER_STEP_TIP: "Turns the stepper motor a specific number of steps.",  // untranslated
 |   ARD_STEPPER_NUMBER_OF_PINS: "Number of pins", // untranslated
 | ||||||
|     ARD_STEPPER_TWO_PINS: "2",  // untranslated
 |   ARD_STEPPER_PIN1: "pin1#", // untranslated
 | ||||||
|     ARD_TYPE_ARRAY: "Array", |   ARD_STEPPER_PIN2: "pin2#", // untranslated
 | ||||||
|     ARD_TYPE_BOOL: "Boolean", |   ARD_STEPPER_PIN3: "pin3#", // untranslated
 | ||||||
|     ARD_TYPE_CHAR: "Zeichen", |   ARD_STEPPER_PIN4: "pin4#", // untranslated
 | ||||||
|     ARD_TYPE_CHILDBLOCKMISSING: "ChildBlockMissing",  // untranslated
 |   ARD_STEPPER_REVOLVS: "how many steps per revolution", // untranslated
 | ||||||
|     ARD_TYPE_DECIMAL: "Dezimalzahl", |   ARD_STEPPER_SETUP: "Setup stepper motor", // untranslated
 | ||||||
|     ARD_TYPE_LONG: "große Zahl", |   ARD_STEPPER_SETUP_TIP: | ||||||
|     ARD_TYPE_NULL: "Null", |     "Configures a stepper motor pinout and other settings.", // untranslated
 | ||||||
|     ARD_TYPE_NUMBER: "Zahl", |   ARD_STEPPER_SPEED: "set speed (rpm) to", // untranslated
 | ||||||
|     ARD_TYPE_SHORT: "kurze Zahl", |   ARD_STEPPER_STEP: "move stepper", // untranslated
 | ||||||
|     ARD_TYPE_TEXT: "Text", |   ARD_STEPPER_STEPS: "steps", // untranslated
 | ||||||
|     ARD_TYPE_UNDEF: "Undefiniert", |   ARD_STEPPER_STEP_TIP: "Turns the stepper motor a specific number of steps.", // untranslated
 | ||||||
|     ARD_VAR_AS: "als", |   ARD_STEPPER_TWO_PINS: "2", // untranslated
 | ||||||
|     ARD_VAR_AS_TIP: "Wert einem spezififischen Datentyp zuordnen", |   ARD_TYPE_ARRAY: "Array", | ||||||
|     ARD_WRITE_TO: "zu", |   ARD_TYPE_BOOL: "Boolean", | ||||||
|     NEW_INSTANCE: "Neue Instanz...", |   ARD_TYPE_CHAR: "Zeichen", | ||||||
|     NEW_INSTANCE_TITLE: "Neue Instanz mit Name:", |   ARD_TYPE_CHILDBLOCKMISSING: "ChildBlockMissing", // untranslated
 | ||||||
|     RENAME_INSTANCE: "Instanz umbenennen...", |   ARD_TYPE_DECIMAL: "Dezimalzahl", | ||||||
|     RENAME_INSTANCE_TITLE: "Benenne alle '%1' Instanzen zu:", |   ARD_TYPE_LONG: "große Zahl", | ||||||
| 
 |   ARD_TYPE_NULL: "Null", | ||||||
| } |   ARD_TYPE_NUMBER: "Zahl", | ||||||
|  |   ARD_TYPE_SHORT: "kurze Zahl", | ||||||
|  |   ARD_TYPE_TEXT: "Text", | ||||||
|  |   ARD_TYPE_UNDEF: "Undefiniert", | ||||||
|  |   ARD_VAR_AS: "als", | ||||||
|  |   ARD_VAR_AS_TIP: "Wert einem spezififischen Datentyp zuordnen", | ||||||
|  |   ARD_WRITE_TO: "zu", | ||||||
|  |   NEW_INSTANCE: "Neue Instanz...", | ||||||
|  |   NEW_INSTANCE_TITLE: "Neue Instanz mit Name:", | ||||||
|  |   RENAME_INSTANCE: "Instanz umbenennen...", | ||||||
|  |   RENAME_INSTANCE_TITLE: "Benenne alle '%1' Instanzen zu:", | ||||||
|  | }; | ||||||
|  | |||||||
| @ -1,107 +1,113 @@ | |||||||
| export const IO = { | export const IO = { | ||||||
| 
 |   ARD_ANALOGREAD: "read analog pin#", | ||||||
| 
 |   ARD_ANALOGREAD_TIP: "Return value between 0 and 1023", | ||||||
|     ARD_ANALOGREAD: "read analog pin#", |   ARD_ANALOGWRITE: "set analog pin#", | ||||||
|     ARD_ANALOGREAD_TIP: "Return value between 0 and 1024", |   ARD_ANALOGWRITE_TIP: | ||||||
|     ARD_ANALOGWRITE: "set analog pin#", |     "Write analog value between 0 and 255 to a specific PWM Port", | ||||||
|     ARD_ANALOGWRITE_TIP: "Write analog value between 0 and 255 to a specific PWM Port", |   ARD_BUILTIN_LED: "set built-in LED", | ||||||
|     ARD_BUILTIN_LED: "set built-in LED", |   ARD_BUILTIN_LED_TIP: "Light on or off for the built-in LED of the Arduino", | ||||||
|     ARD_BUILTIN_LED_TIP: "Light on or off for the built-in LED of the Arduino", |   ARD_COMPONENT_WARN1: | ||||||
|     ARD_COMPONENT_WARN1: "A %1 configuration block with the same %2 name must be added to use this block!", |     "A %1 configuration block with the same %2 name must be added to use this block!", | ||||||
|     ARD_DEFINE: "Define", |   ARD_DEFINE: "Define", | ||||||
|     ARD_DIGITALREAD: "read digital pin#", |   ARD_DIGITALREAD: "read digital pin#", | ||||||
|     ARD_DIGITALREAD_TIP: "Read digital value on a pin: HIGH or LOW", |   ARD_DIGITALREAD_TIP: "Read digital value on a pin: HIGH or LOW", | ||||||
|     ARD_DIGITALWRITE: "set digitial pin#", |   ARD_DIGITALWRITE: "set digitial pin#", | ||||||
|     ARD_DIGITALWRITE_TIP: "Write digital value HIGH or LOW to a specific Port", |   ARD_DIGITALWRITE_TIP: "Write digital value HIGH or LOW to a specific Port", | ||||||
|     ARD_FUN_RUN_LOOP: "Arduino loop forever:", |   ARD_FUN_RUN_LOOP: "Arduino loop forever:", | ||||||
|     ARD_FUN_RUN_SETUP: "Arduino run first:", |   ARD_FUN_RUN_SETUP: "Arduino run first:", | ||||||
|     ARD_FUN_RUN_TIP: "Defines the Arduino setup() and loop() functions.", |   ARD_FUN_RUN_TIP: "Defines the Arduino setup() and loop() functions.", | ||||||
|     ARD_HIGH: "HIGH", |   ARD_HIGH: "HIGH", | ||||||
|     ARD_HIGHLOW_TIP: "Set a pin state logic High or Low.", |   ARD_HIGHLOW_TIP: "Set a pin state logic High or Low.", | ||||||
|     ARD_LOW: "LOW", |   ARD_LOW: "LOW", | ||||||
|     ARD_MAP: "Map Value", |   ARD_MAP: "Map Value", | ||||||
|     ARD_MAP_FROMMAX: "from Max", |   ARD_MAP_FROMMAX: "from Max", | ||||||
|     ARD_MAP_FROMMIN: "from Min", |   ARD_MAP_FROMMIN: "from Min", | ||||||
|     ARD_MAP_TIP: "Re-maps a number from [0-1024] to another.", |   ARD_MAP_TIP: "Re-maps a number from [0-1024] to another.", | ||||||
|     ARD_MAP_TOMAX: "to Max", |   ARD_MAP_TOMAX: "to Max", | ||||||
|     ARD_MAP_TOMIN: "to Min", |   ARD_MAP_TOMIN: "to Min", | ||||||
|     ARD_MAP_VAL: "value to [0-", |   ARD_MAP_VAL: "value to [0-", | ||||||
|     ARD_NOTONE: "Turn off tone on pin #", |   ARD_NOTONE: "Turn off tone on pin #", | ||||||
|     ARD_NOTONE_PIN: "No tone PIN#", |   ARD_NOTONE_PIN: "No tone PIN#", | ||||||
|     ARD_NOTONE_PIN_TIP: "Stop generating a tone on a pin", |   ARD_NOTONE_PIN_TIP: "Stop generating a tone on a pin", | ||||||
|     ARD_NOTONE_TIP: "Turns the tone off on the selected pin", |   ARD_NOTONE_TIP: "Turns the tone off on the selected pin", | ||||||
|     ARD_PIN_WARN1: "Pin %1 is needed for %2 as pin %3. Already used as %4.", |   ARD_PIN_WARN1: "Pin %1 is needed for %2 as pin %3. Already used as %4.", | ||||||
|     ARD_PULSETIMEOUT_TIP: "Measures the duration of a pulse on the selected pin, if it is within the time-out in microseconds.", |   ARD_PULSETIMEOUT_TIP: | ||||||
|     ARD_PULSE_READ: "measure %1 pulse on pin #%2", |     "Measures the duration of a pulse on the selected pin, if it is within the time-out in microseconds.", | ||||||
|     ARD_PULSE_READ_TIMEOUT: "measure %1 pulse on pin #%2 (timeout after %3 μs)", |   ARD_PULSE_READ: "measure %1 pulse on pin #%2", | ||||||
|     ARD_PULSE_TIP: "Measures the duration of a pulse on the selected pin.", |   ARD_PULSE_READ_TIMEOUT: "measure %1 pulse on pin #%2 (timeout after %3 μs)", | ||||||
|     ARD_SERIAL_BPS: "bps", |   ARD_PULSE_TIP: "Measures the duration of a pulse on the selected pin.", | ||||||
|     ARD_SERIAL_PRINT: "print", |   ARD_SERIAL_BPS: "bps", | ||||||
|     ARD_SERIAL_PRINT_NEWLINE: "add new line", |   ARD_SERIAL_PRINT: "print", | ||||||
|     ARD_SERIAL_PRINT_TIP: "Prints data to the console/serial port as human-readable ASCII text.", |   ARD_SERIAL_PRINT_NEWLINE: "add new line", | ||||||
|     ARD_SERIAL_PRINT_WARN: "A setup block for %1 must be added to the workspace to use this block!", |   ARD_SERIAL_PRINT_TIP: | ||||||
|     ARD_SERIAL_SETUP: "Setup", |     "Prints data to the console/serial port as human-readable ASCII text.", | ||||||
|     ARD_SERIAL_SETUP_TIP: "Selects the speed for a specific Serial peripheral", |   ARD_SERIAL_PRINT_WARN: | ||||||
|     ARD_SERIAL_SPEED: ":  speed to", |     "A setup block for %1 must be added to the workspace to use this block!", | ||||||
|     ARD_SERVO_READ: "read SERVO from PIN#", |   ARD_SERIAL_SETUP: "Setup", | ||||||
|     ARD_SERVO_READ_TIP: "Read a Servo angle", |   ARD_SERIAL_SETUP_TIP: "Selects the speed for a specific Serial peripheral", | ||||||
|     ARD_SERVO_WRITE: "set SERVO from Pin", |   ARD_SERIAL_SPEED: ":  speed to", | ||||||
|     ARD_SERVO_WRITE_DEG_180: "Degrees (0~180)", |   ARD_SERVO_READ: "read SERVO from PIN#", | ||||||
|     ARD_SERVO_WRITE_TIP: "Set a Servo to an specified angle", |   ARD_SERVO_READ_TIP: "Read a Servo angle", | ||||||
|     ARD_SERVO_WRITE_TO: "to", |   ARD_SERVO_WRITE: "set SERVO from Pin", | ||||||
|     ARD_SETTONE: "Set tone on pin #", |   ARD_SERVO_WRITE_DEG_180: "Degrees (0~180)", | ||||||
|     ARD_SPI_SETUP: "Setup", |   ARD_SERVO_WRITE_TIP: "Set a Servo to an specified angle", | ||||||
|     ARD_SPI_SETUP_CONF: "configuration:", |   ARD_SERVO_WRITE_TO: "to", | ||||||
|     ARD_SPI_SETUP_DIVIDE: "clock divide", |   ARD_SETTONE: "Set tone on pin #", | ||||||
|     ARD_SPI_SETUP_LSBFIRST: "LSBFIRST", |   ARD_SPI_SETUP: "Setup", | ||||||
|     ARD_SPI_SETUP_MODE: "SPI mode (idle - edge)", |   ARD_SPI_SETUP_CONF: "configuration:", | ||||||
|     ARD_SPI_SETUP_MODE0: "0 (Low - Falling)", |   ARD_SPI_SETUP_DIVIDE: "clock divide", | ||||||
|     ARD_SPI_SETUP_MODE1: "1 (Low - Rising)", |   ARD_SPI_SETUP_LSBFIRST: "LSBFIRST", | ||||||
|     ARD_SPI_SETUP_MODE2: "2 (High - Falling)", |   ARD_SPI_SETUP_MODE: "SPI mode (idle - edge)", | ||||||
|     ARD_SPI_SETUP_MODE3: "3 (High - Rising)", |   ARD_SPI_SETUP_MODE0: "0 (Low - Falling)", | ||||||
|     ARD_SPI_SETUP_MSBFIRST: "MSBFIRST", |   ARD_SPI_SETUP_MODE1: "1 (Low - Rising)", | ||||||
|     ARD_SPI_SETUP_SHIFT: "data shift", |   ARD_SPI_SETUP_MODE2: "2 (High - Falling)", | ||||||
|     ARD_SPI_SETUP_TIP: "Configures the SPI peripheral.", |   ARD_SPI_SETUP_MODE3: "3 (High - Rising)", | ||||||
|     ARD_SPI_TRANSRETURN_TIP: "Send a SPI message to an specified slave device and get data back.", |   ARD_SPI_SETUP_MSBFIRST: "MSBFIRST", | ||||||
|     ARD_SPI_TRANS_NONE: "none", |   ARD_SPI_SETUP_SHIFT: "data shift", | ||||||
|     ARD_SPI_TRANS_SLAVE: "to slave pin", |   ARD_SPI_SETUP_TIP: "Configures the SPI peripheral.", | ||||||
|     ARD_SPI_TRANS_TIP: "Send a SPI message to an specified slave device.", |   ARD_SPI_TRANSRETURN_TIP: | ||||||
|     ARD_SPI_TRANS_VAL: "transfer", |     "Send a SPI message to an specified slave device and get data back.", | ||||||
|     ARD_SPI_TRANS_WARN1: "A setup block for %1 must be added to the workspace to use this block!", |   ARD_SPI_TRANS_NONE: "none", | ||||||
|     ARD_SPI_TRANS_WARN2: "Old pin value %1 is no longer available.", |   ARD_SPI_TRANS_SLAVE: "to slave pin", | ||||||
|     ARD_STEPPER_COMPONENT: "stepper", |   ARD_SPI_TRANS_TIP: "Send a SPI message to an specified slave device.", | ||||||
|     ARD_STEPPER_DEFAULT_NAME: "MyStepper", |   ARD_SPI_TRANS_VAL: "transfer", | ||||||
|     ARD_STEPPER_FOUR_PINS: "4", |   ARD_SPI_TRANS_WARN1: | ||||||
|     ARD_STEPPER_MOTOR: "stepper motor:", |     "A setup block for %1 must be added to the workspace to use this block!", | ||||||
|     ARD_STEPPER_NUMBER_OF_PINS: "Number of pins", |   ARD_SPI_TRANS_WARN2: "Old pin value %1 is no longer available.", | ||||||
|     ARD_STEPPER_PIN1: "pin1#", |   ARD_STEPPER_COMPONENT: "stepper", | ||||||
|     ARD_STEPPER_PIN2: "pin2#", |   ARD_STEPPER_DEFAULT_NAME: "MyStepper", | ||||||
|     ARD_STEPPER_PIN3: "pin3#", |   ARD_STEPPER_FOUR_PINS: "4", | ||||||
|     ARD_STEPPER_PIN4: "pin4#", |   ARD_STEPPER_MOTOR: "stepper motor:", | ||||||
|     ARD_STEPPER_REVOLVS: "how many steps per revolution", |   ARD_STEPPER_NUMBER_OF_PINS: "Number of pins", | ||||||
|     ARD_STEPPER_SETUP: "Setup stepper motor", |   ARD_STEPPER_PIN1: "pin1#", | ||||||
|     ARD_STEPPER_SETUP_TIP: "Configures a stepper motor pinout and other settings.", |   ARD_STEPPER_PIN2: "pin2#", | ||||||
|     ARD_STEPPER_SPEED: "set speed (rpm) to", |   ARD_STEPPER_PIN3: "pin3#", | ||||||
|     ARD_STEPPER_STEP: "move stepper", |   ARD_STEPPER_PIN4: "pin4#", | ||||||
|     ARD_STEPPER_STEPS: "steps", |   ARD_STEPPER_REVOLVS: "how many steps per revolution", | ||||||
|     ARD_STEPPER_STEP_TIP: "Turns the stepper motor a specific number of steps.", |   ARD_STEPPER_SETUP: "Setup stepper motor", | ||||||
|     ARD_STEPPER_TWO_PINS: "2", |   ARD_STEPPER_SETUP_TIP: | ||||||
|     ARD_TYPE_ARRAY: "Array", |     "Configures a stepper motor pinout and other settings.", | ||||||
|     ARD_TYPE_BOOL: "Boolean", |   ARD_STEPPER_SPEED: "set speed (rpm) to", | ||||||
|     ARD_TYPE_CHAR: "Character", |   ARD_STEPPER_STEP: "move stepper", | ||||||
|     ARD_TYPE_CHILDBLOCKMISSING: "ChildBlockMissing", |   ARD_STEPPER_STEPS: "steps", | ||||||
|     ARD_TYPE_DECIMAL: "Decimal", |   ARD_STEPPER_STEP_TIP: "Turns the stepper motor a specific number of steps.", | ||||||
|     ARD_TYPE_LONG: "Large Number", |   ARD_STEPPER_TWO_PINS: "2", | ||||||
|     ARD_TYPE_NULL: "Null", |   ARD_TYPE_ARRAY: "Array", | ||||||
|     ARD_TYPE_NUMBER: "Number", |   ARD_TYPE_BOOL: "Boolean", | ||||||
|     ARD_TYPE_SHORT: "Short Number", |   ARD_TYPE_CHAR: "Character", | ||||||
|     ARD_TYPE_TEXT: "Text", |   ARD_TYPE_CHILDBLOCKMISSING: "ChildBlockMissing", | ||||||
|     ARD_TYPE_UNDEF: "Undefined", |   ARD_TYPE_DECIMAL: "Decimal", | ||||||
|     ARD_VAR_AS: "as", |   ARD_TYPE_LONG: "Large Number", | ||||||
|     ARD_VAR_AS_TIP: "Sets a value to a specific type", |   ARD_TYPE_NULL: "Null", | ||||||
|     ARD_WRITE_TO: "to", |   ARD_TYPE_NUMBER: "Number", | ||||||
|     NEW_INSTANCE: "New instance...", |   ARD_TYPE_SHORT: "Short Number", | ||||||
|     NEW_INSTANCE_TITLE: "New instance name:", |   ARD_TYPE_TEXT: "Text", | ||||||
|     RENAME_INSTANCE: "Rename instance...", |   ARD_TYPE_UNDEF: "Undefined", | ||||||
|     RENAME_INSTANCE_TITLE: "Rename all '%1' instances to:", |   ARD_VAR_AS: "as", | ||||||
| } |   ARD_VAR_AS_TIP: "Sets a value to a specific type", | ||||||
|  |   ARD_WRITE_TO: "to", | ||||||
|  |   NEW_INSTANCE: "New instance...", | ||||||
|  |   NEW_INSTANCE_TITLE: "New instance name:", | ||||||
|  |   RENAME_INSTANCE: "Rename instance...", | ||||||
|  |   RENAME_INSTANCE_TITLE: "Rename all '%1' instances to:", | ||||||
|  | }; | ||||||
|  | |||||||
| @ -544,7 +544,7 @@ Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT = | |||||||
| 
 | 
 | ||||||
| // Ardublockly strings
 | // Ardublockly strings
 | ||||||
| Blockly.Msg.ARD_ANALOGREAD = "read analog pin#"; | Blockly.Msg.ARD_ANALOGREAD = "read analog pin#"; | ||||||
| Blockly.Msg.ARD_ANALOGREAD_TIP = "Return value between 0 and 1024"; | Blockly.Msg.ARD_ANALOGREAD_TIP = "Return value between 0 and 1023"; | ||||||
| Blockly.Msg.ARD_ANALOGWRITE = "set analog pin#"; | Blockly.Msg.ARD_ANALOGWRITE = "set analog pin#"; | ||||||
| Blockly.Msg.ARD_ANALOGWRITE_TIP = | Blockly.Msg.ARD_ANALOGWRITE_TIP = | ||||||
|   "Write analog value between 0 and 255 to a specific PWM Port"; |   "Write analog value between 0 and 255 to a specific PWM Port"; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user