including a few icons in block names
This commit is contained in:
parent
f27fb4d93c
commit
dab281a9cb
@ -55,14 +55,14 @@
|
|||||||
"motors.Motor.speed|block": "%motor|speed",
|
"motors.Motor.speed|block": "%motor|speed",
|
||||||
"motors.Motor.stop|block": "stop %motor",
|
"motors.Motor.stop|block": "stop %motor",
|
||||||
"motors.Motor.tachoCount|block": "%motor|tacho count",
|
"motors.Motor.tachoCount|block": "%motor|tacho count",
|
||||||
"motors.largeMotorA|block": "large motor A",
|
"motors.largeMotorA|block": "`icons.motorLarge` A",
|
||||||
"motors.largeMotorB|block": "large motor B",
|
"motors.largeMotorB|block": "`icons.motorLarge` B",
|
||||||
"motors.largeMotorC|block": "large motor C",
|
"motors.largeMotorC|block": "`icons.motorLarge` C",
|
||||||
"motors.largeMotorD|block": "large motor D",
|
"motors.largeMotorD|block": "`icons.motorLarge` D",
|
||||||
"motors.mediumMotorA|block": "medium motor A",
|
"motors.mediumMotorA|block": "`icons.motorMedium` A",
|
||||||
"motors.mediumMotorB|block": "medium motor B",
|
"motors.mediumMotorB|block": "`icons.motorMedium` B",
|
||||||
"motors.mediumMotorC|block": "medium motor C",
|
"motors.mediumMotorC|block": "`icons.motorMedium` C",
|
||||||
"motors.mediumMotorD|block": "medium motor D",
|
"motors.mediumMotorD|block": "`icons.motorMedium` D",
|
||||||
"motors.stopAllMotors|block": "stop all motors",
|
"motors.stopAllMotors|block": "stop all motors",
|
||||||
"motors|block": "motors",
|
"motors|block": "motors",
|
||||||
"output|block": "output",
|
"output|block": "output",
|
||||||
@ -93,23 +93,23 @@
|
|||||||
"sensors.gyro2|block": "gyro sensor 2",
|
"sensors.gyro2|block": "gyro sensor 2",
|
||||||
"sensors.gyro3|block": "gyro sensor 3",
|
"sensors.gyro3|block": "gyro sensor 3",
|
||||||
"sensors.gyro4|block": "gyro sensor 4",
|
"sensors.gyro4|block": "gyro sensor 4",
|
||||||
"sensors.infraredSensor1|block": "infrared sensor 1",
|
"sensors.infraredSensor1|block": "`icons.infraredSensor` 1",
|
||||||
"sensors.infraredSensor2|block": "infrared sensor 2",
|
"sensors.infraredSensor2|block": "`icons.infraredSensor` 2",
|
||||||
"sensors.infraredSensor3|block": "infrared sensor 3",
|
"sensors.infraredSensor3|block": "`icons.infraredSensor` 3",
|
||||||
"sensors.infraredSensor4|block": "infrared sensor 4",
|
"sensors.infraredSensor4|block": "`icons.infraredSensor` 4",
|
||||||
"sensors.remoteButtonBottomLeft|block": "remote button bottom-left",
|
"sensors.remoteButtonBottomLeft|block": "remote button bottom-left",
|
||||||
"sensors.remoteButtonBottomRight|block": "remote button bottom-right",
|
"sensors.remoteButtonBottomRight|block": "remote button bottom-right",
|
||||||
"sensors.remoteButtonCenter|block": "remote button center",
|
"sensors.remoteButtonCenter|block": "remote button center",
|
||||||
"sensors.remoteButtonTopLeft|block": "remote button top-left",
|
"sensors.remoteButtonTopLeft|block": "remote button top-left",
|
||||||
"sensors.remoteButtonTopRight|block": "remote button top-right",
|
"sensors.remoteButtonTopRight|block": "remote button top-right",
|
||||||
"sensors.touchSensor1|block": "touch sensor 1",
|
"sensors.touchSensor1|block": "`icons.touchSensor` 1",
|
||||||
"sensors.touchSensor2|block": "touch sensor 2",
|
"sensors.touchSensor2|block": "`icons.touchSensor` 2",
|
||||||
"sensors.touchSensor3|block": "touch sensor 3",
|
"sensors.touchSensor3|block": "`icons.touchSensor` 3",
|
||||||
"sensors.touchSensor4|block": "touch sensor 4",
|
"sensors.touchSensor4|block": "`icons.touchSensor` 4",
|
||||||
"sensors.ultrasonic1|block": "ultrasonic sensor 1",
|
"sensors.ultrasonic1|block": "`icons.ultrasonicSensor` 1",
|
||||||
"sensors.ultrasonic2|block": "ultrasonic sensor 2",
|
"sensors.ultrasonic2|block": "`icons.ultrasonicSensor` 2",
|
||||||
"sensors.ultrasonic3|block": "ultrasonic sensor 3",
|
"sensors.ultrasonic3|block": "`icons.ultrasonicSensor` 3",
|
||||||
"sensors.ultrasonic4|block": "ultrasonic sensor 4",
|
"sensors.ultrasonic4|block": "`icons.ultrasonicSensor` 4",
|
||||||
"sensors|block": "sensors",
|
"sensors|block": "sensors",
|
||||||
"serial|block": "serial",
|
"serial|block": "serial",
|
||||||
"{id:category}Brick": "Brick",
|
"{id:category}Brick": "Brick",
|
||||||
|
21
libs/core/icons.jres
Normal file
21
libs/core/icons.jres
Normal file
File diff suppressed because one or more lines are too long
@ -214,7 +214,7 @@ namespace sensors {
|
|||||||
//% parts="infraredsensor"
|
//% parts="infraredsensor"
|
||||||
//% blockNamespace=sensors
|
//% blockNamespace=sensors
|
||||||
//% weight=99 blockGap=8
|
//% weight=99 blockGap=8
|
||||||
//% group="Ultrasonic Sensor"
|
//% group="Infrared Sensor"
|
||||||
wait(event: InfraredSensorEvent) {
|
wait(event: InfraredSensorEvent) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
@ -258,16 +258,16 @@ namespace sensors {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="infrared sensor 1"
|
//% fixedInstance whenUsed block="`icons.infraredSensor` 1"
|
||||||
export const infraredSensor1: InfraredSensor = new InfraredSensor(1)
|
export const infraredSensor1: InfraredSensor = new InfraredSensor(1)
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="infrared sensor 2"
|
//% fixedInstance whenUsed block="`icons.infraredSensor` 2"
|
||||||
export const infraredSensor2: InfraredSensor = new InfraredSensor(2)
|
export const infraredSensor2: InfraredSensor = new InfraredSensor(2)
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="infrared sensor 3"
|
//% fixedInstance whenUsed block="`icons.infraredSensor` 3"
|
||||||
export const infraredSensor3: InfraredSensor = new InfraredSensor(3)
|
export const infraredSensor3: InfraredSensor = new InfraredSensor(3)
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="infrared sensor 4"
|
//% fixedInstance whenUsed block="`icons.infraredSensor` 4"
|
||||||
export const infraredSensor4: InfraredSensor = new InfraredSensor(4)
|
export const infraredSensor4: InfraredSensor = new InfraredSensor(4)
|
||||||
|
|
||||||
|
|
||||||
|
BIN
libs/core/jres/icons/infraredSensor-icon.png
Normal file
BIN
libs/core/jres/icons/infraredSensor-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
BIN
libs/core/jres/icons/motorLarge-icon.png
Normal file
BIN
libs/core/jres/icons/motorLarge-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
BIN
libs/core/jres/icons/motorMedium-icon.png
Normal file
BIN
libs/core/jres/icons/motorMedium-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.0 KiB |
BIN
libs/core/jres/icons/touchSensor-icon.png
Normal file
BIN
libs/core/jres/icons/touchSensor-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
BIN
libs/core/jres/icons/ultrasonicSensor-icon.png
Normal file
BIN
libs/core/jres/icons/ultrasonicSensor-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
@ -216,28 +216,28 @@ namespace motors {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//% whenUsed fixedInstance block="large motor A"
|
//% whenUsed fixedInstance block="`icons.motorLarge` A"
|
||||||
export const largeMotorA = new Motor(Output.A, true);
|
export const largeMotorA = new Motor(Output.A, true);
|
||||||
|
|
||||||
//% whenUsed fixedInstance block="large motor B"
|
//% whenUsed fixedInstance block="`icons.motorLarge` B"
|
||||||
export const largeMotorB = new Motor(Output.B, true);
|
export const largeMotorB = new Motor(Output.B, true);
|
||||||
|
|
||||||
//% whenUsed fixedInstance block="large motor C"
|
//% whenUsed fixedInstance block="`icons.motorLarge` C"
|
||||||
export const largeMotorC = new Motor(Output.C, true);
|
export const largeMotorC = new Motor(Output.C, true);
|
||||||
|
|
||||||
//% whenUsed fixedInstance block="large motor D"
|
//% whenUsed fixedInstance block="`icons.motorLarge` D"
|
||||||
export const largeMotorD = new Motor(Output.D, true);
|
export const largeMotorD = new Motor(Output.D, true);
|
||||||
|
|
||||||
//% whenUsed fixedInstance block="medium motor A"
|
//% whenUsed fixedInstance block="`icons.motorMedium` A"
|
||||||
export const mediumMotorA = new Motor(Output.A, false);
|
export const mediumMotorA = new Motor(Output.A, false);
|
||||||
|
|
||||||
//% whenUsed fixedInstance block="medium motor B"
|
//% whenUsed fixedInstance block="`icons.motorMedium` B"
|
||||||
export const mediumMotorB = new Motor(Output.B, false);
|
export const mediumMotorB = new Motor(Output.B, false);
|
||||||
|
|
||||||
//% whenUsed fixedInstance block="medium motor C"
|
//% whenUsed fixedInstance block="`icons.motorMedium` C"
|
||||||
export const mediumMotorC = new Motor(Output.C, false);
|
export const mediumMotorC = new Motor(Output.C, false);
|
||||||
|
|
||||||
//% whenUsed fixedInstance block="medium motor D"
|
//% whenUsed fixedInstance block="`icons.motorMedium` D"
|
||||||
export const mediumMotorD = new Motor(Output.D, false);
|
export const mediumMotorD = new Motor(Output.D, false);
|
||||||
|
|
||||||
function reset(out: Output) {
|
function reset(out: Output) {
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
"dal.d.ts",
|
"dal.d.ts",
|
||||||
"images.ts",
|
"images.ts",
|
||||||
"images.jres",
|
"images.jres",
|
||||||
|
"icons.jres",
|
||||||
"ns.ts"
|
"ns.ts"
|
||||||
],
|
],
|
||||||
"testFiles": [
|
"testFiles": [
|
||||||
|
@ -67,12 +67,12 @@ namespace sensors {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//% whenUsed block="touch sensor 1" weight=95 fixedInstance
|
//% whenUsed block="`icons.touchSensor` 1" weight=95 fixedInstance
|
||||||
export const touchSensor1: TouchSensor = new TouchSensor(1)
|
export const touchSensor1: TouchSensor = new TouchSensor(1)
|
||||||
//% whenUsed block="touch sensor 2" weight=95 fixedInstance
|
//% whenUsed block="`icons.touchSensor` 2" weight=95 fixedInstance
|
||||||
export const touchSensor2: TouchSensor = new TouchSensor(2)
|
export const touchSensor2: TouchSensor = new TouchSensor(2)
|
||||||
//% whenUsed block="touch sensor 3" weight=95 fixedInstance
|
//% whenUsed block="`icons.touchSensor` 3" weight=95 fixedInstance
|
||||||
export const touchSensor3: TouchSensor = new TouchSensor(3)
|
export const touchSensor3: TouchSensor = new TouchSensor(3)
|
||||||
//% whenUsed block="touch sensor 4" weight=95 fixedInstance
|
//% whenUsed block="`icons.touchSensor` 4" weight=95 fixedInstance
|
||||||
export const touchSensor4: TouchSensor = new TouchSensor(4)
|
export const touchSensor4: TouchSensor = new TouchSensor(4)
|
||||||
}
|
}
|
||||||
|
@ -85,16 +85,16 @@ namespace sensors {
|
|||||||
return this.getNumber(NumberFormat.UInt16LE, 0) & 0x0fff;
|
return this.getNumber(NumberFormat.UInt16LE, 0) & 0x0fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="ultrasonic sensor 4"
|
|
||||||
export const ultrasonic4: UltraSonicSensor = new UltraSonicSensor(4)
|
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="ultrasonic sensor 1"
|
//% fixedInstance whenUsed block="`icons.ultrasonicSensor` 1"
|
||||||
export const ultrasonic1: UltraSonicSensor = new UltraSonicSensor(1)
|
export const ultrasonic1: UltraSonicSensor = new UltraSonicSensor(1)
|
||||||
|
|
||||||
|
//% fixedInstance whenUsed block="`icons.ultrasonicSensor` 4"
|
||||||
|
export const ultrasonic4: UltraSonicSensor = new UltraSonicSensor(4)
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="ultrasonic sensor 2"
|
//% fixedInstance whenUsed block="`icons.ultrasonicSensor` 2"
|
||||||
export const ultrasonic2: UltraSonicSensor = new UltraSonicSensor(2)
|
export const ultrasonic2: UltraSonicSensor = new UltraSonicSensor(2)
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="ultrasonic sensor 3"
|
//% fixedInstance whenUsed block="`icons.ultrasonicSensor` 3"
|
||||||
export const ultrasonic3: UltraSonicSensor = new UltraSonicSensor(3)
|
export const ultrasonic3: UltraSonicSensor = new UltraSonicSensor(3)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user