diff --git a/package.json b/package.json index 8f60da62..d3aefa13 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@angular/platform-browser-dynamic": "~15.2.9", "@angular/router": "~15.2.9", "@fortawesome/fontawesome-free": "^6.1.1", - "@leaphy-robotics/leaphy-blocks": "1.5.4", + "@leaphy-robotics/leaphy-blocks": "1.6.0", "@ngx-translate/core": "^14.0.0", "@ngx-translate/http-loader": "^7.0.0", "@serialport/parser-readline": "^10.3.0", diff --git a/src/app/domain/robot.type.ts b/src/app/domain/robot.type.ts index 0fb3745f..56f79230 100644 --- a/src/app/domain/robot.type.ts +++ b/src/app/domain/robot.type.ts @@ -9,7 +9,7 @@ export class RobotType { public core: string, public libs: string[], public isWired: boolean = true, - public showLeaphyExtra: boolean = true, + public showLeaphyActuators: boolean = true, public showCodeOnStart: boolean = false ) { } } diff --git a/src/app/effects/backend.wired.effects.ts b/src/app/effects/backend.wired.effects.ts index c3a665a3..e5c357b1 100644 --- a/src/app/effects/backend.wired.effects.ts +++ b/src/app/effects/backend.wired.effects.ts @@ -21,9 +21,9 @@ import * as Blockly from 'blockly/core'; const fileExtensions = [ - ".l_flitz", + ".l_flitz_uno", ".l_flitz_nano", - ".l_original", + ".l_original_uno", ".l_click", ".l_uno", ".l_nano", diff --git a/src/app/effects/blockly-editor.effects.ts b/src/app/effects/blockly-editor.effects.ts index 14156925..6f32d0e2 100644 --- a/src/app/effects/blockly-editor.effects.ts +++ b/src/app/effects/blockly-editor.effects.ts @@ -133,8 +133,8 @@ export class BlocklyEditorEffects { const toolboxElement = toolboxXmlDoc.getElementById('easyBloqsToolbox'); const leaphyCategories = parser.parseFromString(leaphyToolboxXml, 'text/xml'); const leaphyRobotCategory = leaphyCategories.getElementById(robotType.id); - if (robotType.showLeaphyExtra) { - const leaphyExtraCategory = leaphyCategories.getElementById(`${robotType.id}_extra`); + if (robotType.showLeaphyActuators) { + const leaphyExtraCategory = leaphyCategories.getElementById(`${robotType.id}_actuators`); toolboxElement.prepend(leaphyExtraCategory); } toolboxElement.prepend(leaphyRobotCategory); diff --git a/src/app/state/app.state.ts b/src/app/state/app.state.ts index 5778d576..69ab16f1 100644 --- a/src/app/state/app.state.ts +++ b/src/app/state/app.state.ts @@ -18,10 +18,13 @@ export class AppState { private static defaultLibraries = [ 'Leaphy Original Extension', 'Leaphy Extra Extension', 'Servo', 'Adafruit GFX Library', 'Adafruit SSD1306', 'Adafruit LSM9DS1 Library', 'Adafruit Unified Sensor' ] - private static leaphyOriginalRobotType = new RobotType('l_original', 'Leaphy Original', 'orig.svg', 'Arduino UNO', 'arduino:avr:uno', 'hex', 'arduino:avr', + private static leaphyOriginalRobotType = new RobotType('l_original_uno', 'Leaphy Original', 'orig.svg', 'Arduino UNO', 'arduino:avr:uno', 'hex', 'arduino:avr', AppState.defaultLibraries.concat(['QMC5883LCompass', 'Arduino_APDS9960']) ); - private static leaphyFlitzRobotType = new RobotType('l_flitz', 'Leaphy Flitz', 'flitz.svg', 'Arduino UNO', 'arduino:avr:uno', 'hex', 'arduino:avr', + private static leaphyFlitzRobotType = new RobotType('l_flitz_uno', 'Leaphy Flitz', 'flitz.svg', 'Arduino UNO', 'arduino:avr:uno', 'hex', 'arduino:avr', + AppState.defaultLibraries, true, false + ); + private static leaphyFlitzNanoRobotType = new RobotType('l_flitz_nano', 'Flitz Nano', 'flitz_nano.svg', 'Arduino Nano', 'arduino:avr:nano', 'hex', 'arduino:avr', AppState.defaultLibraries, true, false ); private static leaphyClickRobotType = new RobotType('l_click', 'Leaphy Click', 'click.svg', 'Arduino UNO', 'arduino:avr:uno', 'hex', 'arduino:avr', @@ -34,18 +37,15 @@ export class AppState { AppState.defaultLibraries.concat(['Leaphy WiFi Extension']) ); public static genericRobotType = new RobotType('l_code', 'Generic Robot', null, 'Arduino UNO', 'arduino:avr:uno', 'hex', 'arduino:avr', - AppState.defaultLibraries.concat(['QMC5883LCompass', 'Arduino_APDS9960']) - ); - private static leaphyFlitzNanoRobotType = new RobotType('l_flitz_nano', 'Flitz Nano', 'flitz_nano.svg', 'Arduino Nano', 'arduino:avr:nano', 'hex', 'arduino:avr', - AppState.defaultLibraries, true, false + AppState.defaultLibraries.concat(['QMC5883LCompass', 'Arduino_APDS9960']) ); private static arduinoNanoRobotType = new RobotType('l_nano', 'Arduino Nano', 'nano.svg', 'Arduino NANO', 'arduino:avr:nano', 'hex', 'arduino:avr', AppState.defaultLibraries.concat(['QMC5883LCompass', 'Arduino_APDS9960']) ); public static idToRobotType = { - 'l_original': AppState.leaphyOriginalRobotType, - 'l_flitz': AppState.leaphyFlitzRobotType, + 'l_original_uno': AppState.leaphyOriginalRobotType, + 'l_flitz_uno': AppState.leaphyFlitzRobotType, 'l_click': AppState.leaphyClickRobotType, 'l_uno': AppState.arduinoUnoRobotType, 'l_wifi': AppState.leaphyWiFiRobotType, diff --git a/src/assets/blockly/leaphy-toolbox.xml b/src/assets/blockly/leaphy-toolbox.xml index 044f645e..bbe83d65 100644 --- a/src/assets/blockly/leaphy-toolbox.xml +++ b/src/assets/blockly/leaphy-toolbox.xml @@ -1,5 +1,5 @@ - + @@ -25,7 +25,7 @@ - + @@ -77,7 +77,7 @@ - + @@ -136,8 +136,13 @@ + + + + + - + @@ -150,8 +155,18 @@ + + + + + + + + + + - + @@ -178,7 +193,85 @@ - + + + + + 0 + + + + + 0 + + + + + 0 + + + + + + + + + 100 + + + + + + + + + + 100 + + + + + + + + + + 440 + + + + + + + 100 + + + + + + + + + text + + + + + + + + text + + + + + + 0 + + + + + @@ -310,6 +403,8 @@ + + @@ -388,8 +483,28 @@ - - + + + + + + + + 0 + + + + + + + + + + 90 + + + + @@ -499,37 +614,63 @@ - + + + + + + 0 + + + + + 0 + + + + + 0 + + - - 11 - 12 - 13 + + + + + 100 + + + - - + + - 0 + + 100 + - - + + - 90 + + 440 + - - - + - 100 + + 100 + + @@ -545,29 +686,14 @@ - - 0 - - - - - - - - 440 - - - - - 100 + 0 - - + @@ -590,27 +716,6 @@ - - - - - text - - - - - - - - text - - - - - 0 - - - @@ -721,7 +826,7 @@ - + @@ -747,7 +852,7 @@ - + diff --git a/yarn.lock b/yarn.lock index 8a3256b3..6c18d596 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1737,10 +1737,10 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" -"@leaphy-robotics/leaphy-blocks@1.5.4": - version "1.5.4" - resolved "https://registry.yarnpkg.com/@leaphy-robotics/leaphy-blocks/-/leaphy-blocks-1.5.4.tgz#57f925895c5d338f6b7669fea29f64469d2b14a8" - integrity sha512-/l10d90WtuvdrVYTj8GtWpkfiH1yS7k+eV82iZlgwVtSY206PX+iXtYBFgzQxOzA17g36XlcoTKgEB12EOi9sg== +"@leaphy-robotics/leaphy-blocks@1.6.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@leaphy-robotics/leaphy-blocks/-/leaphy-blocks-1.6.0.tgz#49090f352319a477db7a3de0a45361fed9aa475c" + integrity sha512-Rxzt9qwSHJ1ewmqr30afcsYH5KqRh8D/N995lP6gWrBUnTsyMO+kWQafJo8fLZ+1rdUs85SpS1vzr0PnPP9Jmg== dependencies: blockly "^10.1.3" typescript "4.3.2"