diff --git a/OpenRobertaServer/staticResources/js/app/simulation/simulationLogic/robot.sensors.js b/OpenRobertaServer/staticResources/js/app/simulation/simulationLogic/robot.sensors.js index 399ba7122d..dd70e96c57 100644 --- a/OpenRobertaServer/staticResources/js/app/simulation/simulationLogic/robot.sensors.js +++ b/OpenRobertaServer/staticResources/js/app/simulation/simulationLogic/robot.sensors.js @@ -1179,7 +1179,13 @@ define(["require", "exports", "robot.base.mobile", "interpreter.constants", "sim myPins.forEach(function (pin) { if (pin.type !== 'TOUCH') { var range = 1023; - $mySensorGenerator.append('' + Blockly.Msg.SENSOR_PIN + ' ' + pin.name + ''); + $mySensorGenerator.append('' + + Blockly.Msg.SENSOR_PIN + + ' ' + + pin.name + + ''); if (pin.type === 'DIGITAL_PIN') { range = 1; } @@ -1401,25 +1407,25 @@ define(["require", "exports", "robot.base.mobile", "interpreter.constants", "sim function GestureSensor() { this.gesture = { up: true }; this.labelPriority = 10; - $('#mbedButtons').append('' + + $('#mbedButtons').append('' + Blockly.Msg.SENSOR_GESTURE + '' + // - '' + + '' + Blockly.Msg.SENSOR_GESTURE_UP + '' + // - '' + + '' + Blockly.Msg.SENSOR_GESTURE_DOWN + '' + // - '' + + '' + Blockly.Msg.SENSOR_GESTURE_FACE_DOWN + '' + // - '' + + '' + Blockly.Msg.SENSOR_GESTURE_FACE_UP + '' + // - '' + + '' + Blockly.Msg.SENSOR_GESTURE_SHAKE + '' + // - '' + + '' + Blockly.Msg.SENSOR_GESTURE_FREEFALL + ''); var gestureSensor = this; @@ -1447,7 +1453,7 @@ define(["require", "exports", "robot.base.mobile", "interpreter.constants", "sim function CompassSensor() { this.degree = 0; this.labelPriority = 11; - $('#mbedButtons').append('' + + $('#mbedButtons').append('' + Blockly.Msg.SENSOR_COMPASS + '' + ''); @@ -1471,7 +1477,7 @@ define(["require", "exports", "robot.base.mobile", "interpreter.constants", "sim this.x = 342; this.y = 546; this.labelPriority = 12; - $('#mbedButtons').append('' + + $('#mbedButtons').append('' + Blockly.Msg.SENSOR_LIGHT + '' + ''); @@ -1505,7 +1511,7 @@ define(["require", "exports", "robot.base.mobile", "interpreter.constants", "sim this.x = 342; this.y = 546; this.labelPriority = 12; - $('#mbedButtons').append('' + + $('#mbedButtons').append('' + Blockly.Msg.SENSOR_INFRARED + '' + ''); @@ -1526,7 +1532,7 @@ define(["require", "exports", "robot.base.mobile", "interpreter.constants", "sim function TemperatureSensor() { this.degree = 20; this.labelPriority = 13; - $('#mbedButtons').append('' + + $('#mbedButtons').append('' + Blockly.Msg.SENSOR_TEMPERATURE + '' + ''); diff --git a/OpenRobertaWeb/src/app/simulation/simulationLogic/robot.sensors.ts b/OpenRobertaWeb/src/app/simulation/simulationLogic/robot.sensors.ts index 02cfbc30b9..a779c28dec 100644 --- a/OpenRobertaWeb/src/app/simulation/simulationLogic/robot.sensors.ts +++ b/OpenRobertaWeb/src/app/simulation/simulationLogic/robot.sensors.ts @@ -1507,7 +1507,13 @@ export class Pins extends TouchKeys implements IDrawable { if (pin.type !== 'TOUCH') { let range = 1023; $mySensorGenerator.append( - '' + Blockly.Msg.SENSOR_PIN + ' ' + pin.name + '' + '' + + Blockly.Msg.SENSOR_PIN + + ' ' + + pin.name + + '' ); if (pin.type === 'DIGITAL_PIN') { range = 1; @@ -1746,25 +1752,25 @@ export class GestureSensor implements ISensor, ILabel { constructor() { $('#mbedButtons').append( - '' + + '' + Blockly.Msg.SENSOR_GESTURE + '' + // - '' + + '' + Blockly.Msg.SENSOR_GESTURE_UP + '' + // - '' + + '' + Blockly.Msg.SENSOR_GESTURE_DOWN + '' + // - '' + + '' + Blockly.Msg.SENSOR_GESTURE_FACE_DOWN + '' + // - '' + + '' + Blockly.Msg.SENSOR_GESTURE_FACE_UP + '' + // - '' + + '' + Blockly.Msg.SENSOR_GESTURE_SHAKE + '' + // - '' + + '' + Blockly.Msg.SENSOR_GESTURE_FREEFALL + '' ); @@ -1807,7 +1813,7 @@ export class CompassSensor implements ISensor, ILabel { constructor() { $('#mbedButtons').append( - '' + + '' + Blockly.Msg.SENSOR_COMPASS + '' + '' @@ -1844,7 +1850,7 @@ export class CalliopeLightSensor implements ISensor, ILabel, IDrawable { constructor() { $('#mbedButtons').append( - '' + + '' + Blockly.Msg.SENSOR_LIGHT + '' + '' @@ -1894,7 +1900,7 @@ export class Rob3rtaInfraredSensor implements ISensor, ILabel { constructor() { $('#mbedButtons').append( - '' + + '' + Blockly.Msg.SENSOR_INFRARED + '' + '' @@ -1928,7 +1934,7 @@ export class TemperatureSensor implements ISensor, ILabel { constructor() { $('#mbedButtons').append( - '' + + '' + Blockly.Msg.SENSOR_TEMPERATURE + '' + '' @@ -2063,6 +2069,7 @@ export class SoundSensorBoolean extends VolumeMeterSensor { override getLabel(): string { return '' + Blockly.Msg['SENSOR_SOUND'] + '' + (this.volume > 25 ? 'true' : 'false') + ''; } + override updateSensor( running: boolean, dt: number,