aligning groups with hardware name components
This commit is contained in:
parent
fa6c81cf80
commit
33c8902050
@ -35,11 +35,11 @@
|
||||
"input.TouchSensor.onEvent": "Do something when a touch sensor is touched...",
|
||||
"input.TouchSensor.onEvent|param|body": "code to run when the event is raised",
|
||||
"input.UltraSonicSensor.distance": "Gets the distance from the sonar in millimeters",
|
||||
"input.buttonDown": "Down button.",
|
||||
"input.buttonEnter": "Enter button.",
|
||||
"input.buttonLeft": "Left button.",
|
||||
"input.buttonRight": "Right button.",
|
||||
"input.buttonUp": "Up button.",
|
||||
"input.buttonDown": "Down button on the EV3 Brick.",
|
||||
"input.buttonEnter": "Enter button on the EV3 Brick.",
|
||||
"input.buttonLeft": "Left button on the EV3 Brick.",
|
||||
"input.buttonRight": "Right button on the EV3 Brick.",
|
||||
"input.buttonUp": "Up button on the EV3 Brick.",
|
||||
"input.remoteBottomLeft": "Remote bottom-left button.",
|
||||
"input.remoteBottomRight": "Remote bottom-right button.",
|
||||
"input.remoteCenter": "Remote beacon (center) button.",
|
||||
|
@ -30,11 +30,11 @@
|
||||
"input.TouchSensor.isTouched|block": "%sensor|is touched",
|
||||
"input.TouchSensor.onEvent|block": "on %sensor|%event",
|
||||
"input.UltraSonicSensor.distance|block": "%sensor|distance",
|
||||
"input.buttonDown|block": "button down",
|
||||
"input.buttonEnter|block": "button enter",
|
||||
"input.buttonLeft|block": "button left",
|
||||
"input.buttonRight|block": "button right",
|
||||
"input.buttonUp|block": "button up",
|
||||
"input.buttonDown|block": "brick button down",
|
||||
"input.buttonEnter|block": "brick button enter",
|
||||
"input.buttonLeft|block": "brick button left",
|
||||
"input.buttonRight|block": "brick button right",
|
||||
"input.buttonUp|block": "brick button up",
|
||||
"input.color1|block": "color sensor 1",
|
||||
"input.color2|block": "color sensor 2",
|
||||
"input.color3|block": "color sensor 3",
|
||||
@ -53,9 +53,9 @@
|
||||
"input.touchSensor3|block": "touch sensor 3",
|
||||
"input.touchSensor4|block": "touch sensor 4",
|
||||
"input.ultrasonic1|block": "ultrasonic sensor 1",
|
||||
"input.ultrasonic2|block": "ultrasonic sensor 1",
|
||||
"input.ultrasonic3|block": "ultrasonic sensor 1",
|
||||
"input.ultrasonic4|block": "ultrasonic sensor 1",
|
||||
"input.ultrasonic2|block": "ultrasonic sensor 2",
|
||||
"input.ultrasonic3|block": "ultrasonic sensor 3",
|
||||
"input.ultrasonic4|block": "ultrasonic sensor 4",
|
||||
"input|block": "input",
|
||||
"output.getCurrentSpeed|block": "motor %out|speed",
|
||||
"output.pattern|block": "%pattern",
|
||||
@ -74,13 +74,11 @@
|
||||
"{id:category}Output": "Output",
|
||||
"{id:category}Screen": "Screen",
|
||||
"{id:category}Serial": "Serial",
|
||||
"{id:group}Buttons": "Buttons",
|
||||
"{id:group}Brick": "Brick",
|
||||
"{id:group}Color Sensor": "Color Sensor",
|
||||
"{id:group}Gyro sensor": "Gyro sensor",
|
||||
"{id:group}Infrared sensor": "Infrared sensor",
|
||||
"{id:group}Lights": "Lights",
|
||||
"{id:group}Gyro Sensor": "Gyro Sensor",
|
||||
"{id:group}Infrared Sensor": "Infrared Sensor",
|
||||
"{id:group}Motors": "Motors",
|
||||
"{id:group}Screen": "Screen",
|
||||
"{id:group}Touch sensor": "Touch sensor",
|
||||
"{id:group}Ultrasonic sensor": "Ultrasonic sensor"
|
||||
"{id:group}Touch Sensor": "Touch Sensor",
|
||||
"{id:group}Ultrasonic Sensor": "Ultrasonic Sensor"
|
||||
}
|
@ -89,7 +89,7 @@ namespace input {
|
||||
//% parts="brick"
|
||||
//% blockNamespace=input
|
||||
//% weight=81 blockGap=8
|
||||
//% group="Brick buttons"
|
||||
//% group="Brick"
|
||||
isPressed() {
|
||||
return this._isPressed
|
||||
}
|
||||
@ -104,7 +104,7 @@ namespace input {
|
||||
//% parts="brick"
|
||||
//% blockNamespace=input
|
||||
//% weight=80 blockGap=8
|
||||
//% group="Brick buttons"
|
||||
//% group="Brick"
|
||||
wasPressed() {
|
||||
const r = this._wasPressed
|
||||
this._wasPressed = false
|
||||
@ -122,7 +122,7 @@ namespace input {
|
||||
//% parts="brick"
|
||||
//% blockNamespace=input
|
||||
//% weight=99 blockGap=8
|
||||
//% group="Brick buttons"
|
||||
//% group="Brick"
|
||||
onEvent(ev: ButtonEvent, body: () => void) {
|
||||
control.onEvent(this._id, ev, body)
|
||||
}
|
||||
@ -176,35 +176,36 @@ namespace input {
|
||||
|
||||
initBtns() // always ON as it handles ESCAPE button
|
||||
|
||||
|
||||
/**
|
||||
* Enter button on the EV3 Brick.
|
||||
*/
|
||||
//% whenUsed block="brick button enter" weight=95 fixedInstance
|
||||
export const buttonEnter: Button = new DevButton(DAL.BUTTON_ID_ENTER)
|
||||
|
||||
/**
|
||||
* Left button on the EV3 Brick.
|
||||
*/
|
||||
//% whenUsed block="button left" weight=95 fixedInstance
|
||||
//% whenUsed block="brick button left" weight=95 fixedInstance
|
||||
export const buttonLeft: Button = new DevButton(DAL.BUTTON_ID_LEFT)
|
||||
|
||||
/**
|
||||
* Right button on the EV3 Brick.
|
||||
*/
|
||||
//% whenUsed block="button right" weight=94 fixedInstance
|
||||
//% whenUsed block="brick button right" weight=94 fixedInstance
|
||||
export const buttonRight: Button = new DevButton(DAL.BUTTON_ID_RIGHT)
|
||||
|
||||
/**
|
||||
* Up button on the EV3 Brick.
|
||||
*/
|
||||
//% whenUsed block="button up" weight=95 fixedInstance
|
||||
//% whenUsed block="brick button up" weight=95 fixedInstance
|
||||
export const buttonUp: Button = new DevButton(DAL.BUTTON_ID_UP)
|
||||
|
||||
/**
|
||||
* Down button on the EV3 Brick.
|
||||
*/
|
||||
//% whenUsed block="button down" weight=95 fixedInstance
|
||||
//% whenUsed block="brick button down" weight=95 fixedInstance
|
||||
export const buttonDown: Button = new DevButton(DAL.BUTTON_ID_DOWN)
|
||||
|
||||
/**
|
||||
* Enter button on the EV3 Brick.
|
||||
*/
|
||||
//% whenUsed block="button enter" weight=95 fixedInstance
|
||||
export const buttonEnter: Button = new DevButton(DAL.BUTTON_ID_ENTER)
|
||||
}
|
||||
|
||||
|
||||
@ -233,7 +234,7 @@ namespace output {
|
||||
* @param pattern the lights pattern to use.
|
||||
*/
|
||||
//% blockId=setLights block="set status light %pattern=led_pattern"
|
||||
//% weight=100 group="Lights"
|
||||
//% weight=100 group="Brick"
|
||||
export function setStatusLight(pattern: number): void {
|
||||
if (currPattern === pattern)
|
||||
return
|
||||
|
@ -84,15 +84,15 @@ namespace input {
|
||||
}
|
||||
}
|
||||
|
||||
//% whenUsed block="color sensor 3" weight=95 fixedInstance
|
||||
export const color3: ColorSensor = new ColorSensor(3)
|
||||
|
||||
//% whenUsed block="color sensor 1" weight=95 fixedInstance
|
||||
export const color1: ColorSensor = new ColorSensor(1)
|
||||
|
||||
//% whenUsed block="color sensor 2" weight=95 fixedInstance
|
||||
export const color2: ColorSensor = new ColorSensor(2)
|
||||
|
||||
//% whenUsed block="color sensor 3" weight=95 fixedInstance
|
||||
export const color3: ColorSensor = new ColorSensor(3)
|
||||
|
||||
//% whenUsed block="color sensor 4" weight=95 fixedInstance
|
||||
export const color4: ColorSensor = new ColorSensor(4)
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace input {
|
||||
//% parts="gyroscope"
|
||||
//% blockNamespace=input
|
||||
//% weight=65 blockGap=8
|
||||
//% group="Gyro sensor"
|
||||
//% group="Gyro Sensor"
|
||||
angle() {
|
||||
this.setMode(GyroSensorMode.Angle)
|
||||
return this.getNumber(NumberFormat.Int16LE, 0)
|
||||
@ -45,18 +45,18 @@ namespace input {
|
||||
//% parts="gyroscope"
|
||||
//% blockNamespace=input
|
||||
//% weight=65 blockGap=8
|
||||
//% group="Gyro sensor"
|
||||
//% group="Gyro Sensor"
|
||||
rate() {
|
||||
this.setMode(GyroSensorMode.Rate)
|
||||
return this.getNumber(NumberFormat.Int16LE, 0)
|
||||
}
|
||||
}
|
||||
|
||||
//% fixedInstance whenUsed block="gyro sensor 1"
|
||||
export const gyro1: GyroSensor = new GyroSensor(1)
|
||||
|
||||
//% fixedInstance whenUsed block="gyro sensor 2"
|
||||
export const gyro2: GyroSensor = new GyroSensor(2)
|
||||
|
||||
//% fixedInstance whenUsed block="gyro sensor 1"
|
||||
export const gyro1: GyroSensor = new GyroSensor(1)
|
||||
|
||||
//% fixedInstance whenUsed block="gyro sensor 3"
|
||||
export const gyro3: GyroSensor = new GyroSensor(3)
|
||||
|
@ -119,7 +119,7 @@ namespace input {
|
||||
//% parts="infrared"
|
||||
//% blockNamespace=input
|
||||
//% weight=65 blockGap=8
|
||||
//% group="Infrared sensor"
|
||||
//% group="Infrared Sensor"
|
||||
distance() {
|
||||
this.setMode(IrSensorMode.Proximity)
|
||||
return this.getNumber(NumberFormat.UInt8LE, 0)
|
||||
@ -135,7 +135,7 @@ namespace input {
|
||||
//% parts="infrared"
|
||||
//% blockNamespace=input
|
||||
//% weight=65 blockGap=8
|
||||
//% group="Infrared sensor"
|
||||
//% group="Infrared Sensor"
|
||||
remoteCommand() {
|
||||
this.setMode(IrSensorMode.RemoteControl)
|
||||
return this.getNumber(NumberFormat.UInt8LE, this.channel)
|
||||
|
@ -1,4 +1,5 @@
|
||||
|
||||
//% color="#B4009E" weight=98 icon="\uf192"
|
||||
//% groups='["Touch Sensor", "Gyro Sensor", "Color Sensor", "Ultrasonic Sensor", "Infrared Sensor", "Remote", "Brick"]'
|
||||
namespace input {
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ namespace screen {
|
||||
* @param y the starting position's x coordinate, eg: 0
|
||||
*/
|
||||
//% blockId=screen_print block="print %text| at x: %x| y: %y"
|
||||
//% weight=99 group="Screen" blockNamespace=output inlineInputMode="inline"
|
||||
//% weight=99 group="Brick" blockNamespace=output inlineInputMode="inline"
|
||||
//% x.min=0 x.max=178 y.min=0 y.max=128
|
||||
export function print(text: string, x: number, y: number, mode = Draw.Normal) {
|
||||
x |= 0
|
||||
|
@ -45,7 +45,7 @@ namespace input {
|
||||
//% parts="touch"
|
||||
//% blockNamespace=input
|
||||
//% weight=81 blockGap=8
|
||||
//% group="Touch sensor"
|
||||
//% group="Touch Sensor"
|
||||
isTouched() {
|
||||
return this.button.isPressed();
|
||||
}
|
||||
@ -61,7 +61,7 @@ namespace input {
|
||||
//% parts="touch"
|
||||
//% blockNamespace=input
|
||||
//% weight=99 blockGap=8
|
||||
//% group="Touch sensor"
|
||||
//% group="Touch Sensor"
|
||||
onEvent(ev: TouchSensorEvent, body: () => void) {
|
||||
this.button.onEvent(<ButtonEvent><number>ev, body)
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace input {
|
||||
//% parts="ultrasonic"
|
||||
//% blockNamespace=input
|
||||
//% weight=65 blockGap=8
|
||||
//% group="Ultrasonic sensor"
|
||||
//% group="Ultrasonic Sensor"
|
||||
distance() {
|
||||
// it supposedly also has an inch mode, but we stick to mm
|
||||
this._setMode(0)
|
||||
@ -28,15 +28,15 @@ namespace input {
|
||||
}
|
||||
}
|
||||
|
||||
//% fixedInstance whenUsed block="ultrasonic sensor 4"
|
||||
export const ultrasonic4: UltraSonicSensor = new UltraSonicSensor(4)
|
||||
|
||||
//% fixedInstance whenUsed block="ultrasonic sensor 1"
|
||||
export const ultrasonic1: UltraSonicSensor = new UltraSonicSensor(1)
|
||||
|
||||
//% fixedInstance whenUsed block="ultrasonic sensor 1"
|
||||
//% fixedInstance whenUsed block="ultrasonic sensor 2"
|
||||
export const ultrasonic2: UltraSonicSensor = new UltraSonicSensor(2)
|
||||
|
||||
//% fixedInstance whenUsed block="ultrasonic sensor 1"
|
||||
//% fixedInstance whenUsed block="ultrasonic sensor 3"
|
||||
export const ultrasonic3: UltraSonicSensor = new UltraSonicSensor(3)
|
||||
|
||||
//% fixedInstance whenUsed block="ultrasonic sensor 1"
|
||||
export const ultrasonic4: UltraSonicSensor = new UltraSonicSensor(4)
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ namespace input {
|
||||
}
|
||||
|
||||
//% color="#8AC044" weight=90 icon="\uf185"
|
||||
//% groups='["Lights", "Screen", "Motors"]'
|
||||
//% groups='["Motors", "Brick"]'
|
||||
namespace output {
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user