Browse Source

modified: lang/LARS.json

	modified:   lars_blocks.js
pull/1/head
roboticafacil 1 year ago
parent
commit
d6f4e775b2
2 changed files with 33 additions and 23 deletions
  1. 10
    0
      lang/LARS.json
  2. 23
    23
      lars_blocks.js

+ 10
- 0
lang/LARS.json View File

@@ -5,6 +5,16 @@
5 5
 		{
6 6
 			"keys": 
7 7
 			{
8
+				"LANG_SUBCATEGORY_WALK": "Robot walk",
9
+				"LANG_MOVEMENT_LARS_ROBOT": "Define robot",
10
+				"LANG_MOVEMENT_LARS_FRH": "Hip 1",
11
+				"LANG_MOVEMENT_LARS_BRH": "Hip 2",
12
+				"LANG_MOVEMENT_LARS_BLH": "Hip 3",
13
+				"LANG_MOVEMENT_LARS_FLH": "Hip 4",
14
+				"LANG_MOVEMENT_LARS_FRL": "Leg 1",
15
+				"LANG_MOVEMENT_LARS_BRL": "Leg 2",
16
+				"LANG_MOVEMENT_LARS_BLL": "Leg 3",
17
+				"LANG_MOVEMENT_LARS_FLL": "Leg 4",
8 18
 				"LANG_LARS_INIT_TOOLTIP": "Defines the servo pins for a quadruped robot.",
9 19
 				"LANG_LARS_MOVEMENT": "Move robot",
10 20
 				"LANG_LARS_MOVEMENT_MOVEMENT": "Movement",

+ 23
- 23
lars_blocks.js View File

@@ -2,29 +2,29 @@ Facilino.LANG_COLOUR_MOVEMENT = '#CECE42';
2 2
 Facilino.LANG_COLOUR_MOVEMENT_WALK = '#8D8D25';
3 3
 
4 4
 Blockly.Blocks['LARS_init'] = {
5
-	category: Facilino.locales.getKey('LANG_CATEGORY_MOVEMENT'),
6
-	subcategory: Facilino.locales.getKey('LANG_SUBCATEGORY_WALK'),
7
-	category_colour: Facilino.LANG_COLOUR_MOVEMENT,
8
-	colour: Facilino.LANG_COLOUR_MOVEMENT_WALK,
9
-	helpUrl: Facilino.getHelpUrl('LARS_init'),
10
-	tags: [],
11
-	examples: [],
12
-	init: function () {
13
-		this.appendDummyInput('').appendField(new Blockly.FieldImage('img/blocks/LARS.svg', 32*options.zoom, 32*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_ROBOT'));
14
-		this.appendValueInput('FRH').appendField(new Blockly.FieldImage('img/blocks/LARS_FRH.svg', 24*options.zoom, 24*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_FRH')).appendField(new Blockly.FieldImage('img/blocks/pwm_signal.svg', 24*options.zoom, 24*options.zoom)).setAlign(Blockly.ALIGN_RIGHT);
15
-		this.appendValueInput('FLH').appendField(new Blockly.FieldImage('img/blocks/LARS_FLH.svg', 24*options.zoom, 24*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_FLH')).appendField(new Blockly.FieldImage('img/blocks/pwm_signal.svg', 24*options.zoom, 24*options.zoom)).setAlign(Blockly.ALIGN_RIGHT);
16
-		this.appendValueInput('BRH').appendField(new Blockly.FieldImage('img/blocks/LARS_BRH.svg', 24*options.zoom, 24*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_BRH')).appendField(new Blockly.FieldImage('img/blocks/pwm_signal.svg', 24*options.zoom, 24*options.zoom)).setAlign(Blockly.ALIGN_RIGHT);
17
-		this.appendValueInput('BLH').appendField(new Blockly.FieldImage('img/blocks/LARS_BLH.svg', 24*options.zoom, 24*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_BLH')).appendField(new Blockly.FieldImage('img/blocks/pwm_signal.svg', 24*options.zoom, 24*options.zoom)).setAlign(Blockly.ALIGN_RIGHT);
18
-		this.appendValueInput('FRL').appendField(new Blockly.FieldImage('img/blocks/LARS_FRL.svg', 24*options.zoom, 24*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_FRL')).appendField(new Blockly.FieldImage('img/blocks/pwm_signal.svg', 24*options.zoom, 24*options.zoom)).setAlign(Blockly.ALIGN_RIGHT);
19
-		this.appendValueInput('FLL').appendField(new Blockly.FieldImage('img/blocks/LARS_FLL.svg', 24*options.zoom, 24*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_FLL')).appendField(new Blockly.FieldImage('img/blocks/pwm_signal.svg', 24*options.zoom, 24*options.zoom)).setAlign(Blockly.ALIGN_RIGHT);
20
-		this.appendValueInput('BRL').appendField(new Blockly.FieldImage('img/blocks/LARS_BRL.svg', 24*options.zoom, 24*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_BRL')).appendField(new Blockly.FieldImage('img/blocks/pwm_signal.svg', 24*options.zoom, 24*options.zoom)).setAlign(Blockly.ALIGN_RIGHT);
21
-		this.appendValueInput('BLL').appendField(new Blockly.FieldImage('img/blocks/LARS_BLL.svg', 24*options.zoom, 24*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_BLL')).appendField(new Blockly.FieldImage('img/blocks/pwm_signal.svg', 24*options.zoom, 24*options.zoom)).setAlign(Blockly.ALIGN_RIGHT);
22
-		this.setPreviousStatement(true,'code');
23
-		this.setNextStatement(true,'code');
24
-		this.setColour(Facilino.LANG_COLOUR_MOVEMENT_WALK);
25
-		this.setTooltip(Facilino.locales.getKey('LANG_LARS_INIT_TOOLTIP'));
26
-	}
27
-};
5
+				category: Facilino.locales.getKey('LANG_CATEGORY_MOVEMENT'),
6
+				subcategory: Facilino.locales.getKey('LANG_SUBCATEGORY_WALK'),
7
+				category_colour: Facilino.LANG_COLOUR_MOVEMENT,
8
+				colour: Facilino.LANG_COLOUR_MOVEMENT_WALK,
9
+				helpUrl: Facilino.getHelpUrl('LARS_init'),
10
+				tags: [],
11
+				examples: [],
12
+				init: function () {
13
+					this.appendDummyInput('').appendField(new Blockly.FieldImage('img/blocks/LARS.svg', 32*options.zoom, 32*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_ROBOT'));
14
+					this.appendValueInput('FRH').appendField(new Blockly.FieldImage('img/blocks/LARS_FRH.svg', 24*options.zoom, 24*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_FRH')).appendField(new Blockly.FieldImage('img/blocks/pwm_signal.svg', 24*options.zoom, 24*options.zoom)).setAlign(Blockly.ALIGN_RIGHT);
15
+					this.appendValueInput('BRH').appendField(new Blockly.FieldImage('img/blocks/LARS_BRH.svg', 24*options.zoom, 24*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_BRH')).appendField(new Blockly.FieldImage('img/blocks/pwm_signal.svg', 24*options.zoom, 24*options.zoom)).setAlign(Blockly.ALIGN_RIGHT);
16
+					this.appendValueInput('BLH').appendField(new Blockly.FieldImage('img/blocks/LARS_BLH.svg', 24*options.zoom, 24*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_BLH')).appendField(new Blockly.FieldImage('img/blocks/pwm_signal.svg', 24*options.zoom, 24*options.zoom)).setAlign(Blockly.ALIGN_RIGHT);
17
+					this.appendValueInput('FLH').appendField(new Blockly.FieldImage('img/blocks/LARS_FLH.svg', 24*options.zoom, 24*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_FLH')).appendField(new Blockly.FieldImage('img/blocks/pwm_signal.svg', 24*options.zoom, 24*options.zoom)).setAlign(Blockly.ALIGN_RIGHT);
18
+					this.appendValueInput('FRL').appendField(new Blockly.FieldImage('img/blocks/LARS_FRL.svg', 24*options.zoom, 24*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_FRL')).appendField(new Blockly.FieldImage('img/blocks/pwm_signal.svg', 24*options.zoom, 24*options.zoom)).setAlign(Blockly.ALIGN_RIGHT);
19
+					this.appendValueInput('BRL').appendField(new Blockly.FieldImage('img/blocks/LARS_BRL.svg', 24*options.zoom, 24*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_BRL')).appendField(new Blockly.FieldImage('img/blocks/pwm_signal.svg', 24*options.zoom, 24*options.zoom)).setAlign(Blockly.ALIGN_RIGHT);
20
+					this.appendValueInput('BLL').appendField(new Blockly.FieldImage('img/blocks/LARS_BLL.svg', 24*options.zoom, 24*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_BLL')).appendField(new Blockly.FieldImage('img/blocks/pwm_signal.svg', 24*options.zoom, 24*options.zoom)).setAlign(Blockly.ALIGN_RIGHT);
21
+					this.appendValueInput('FLL').appendField(new Blockly.FieldImage('img/blocks/LARS_FLL.svg', 24*options.zoom, 24*options.zoom)).appendField(Facilino.locales.getKey('LANG_MOVEMENT_LARS_FLL')).appendField(new Blockly.FieldImage('img/blocks/pwm_signal.svg', 24*options.zoom, 24*options.zoom)).setAlign(Blockly.ALIGN_RIGHT);
22
+					this.setPreviousStatement(true,'code');
23
+					this.setNextStatement(true,'code');
24
+					this.setColour(Facilino.LANG_COLOUR_MOVEMENT_WALK);
25
+					this.setTooltip(Facilino.locales.getKey('LANG_LARS_INIT_TOOLTIP'));
26
+				}
27
+			};
28 28
 
29 29
 Blockly.Arduino['LARS_init'] = function(block) {
30 30
 			  var code='';

Loading…
Cancel
Save