improving the spacing & block names (#298)

This commit is contained in:
Abhijith Chatra 2018-02-01 16:21:08 -08:00 committed by Peli de Halleux
parent f594cdefac
commit 9bf50665fc
6 changed files with 16 additions and 16 deletions

View File

@ -115,7 +115,7 @@ namespace sensors {
//% parts="colorsensor" //% parts="colorsensor"
//% blockNamespace=sensors //% blockNamespace=sensors
//% sensor.fieldEditor="ports" //% sensor.fieldEditor="ports"
//% weight=100 blockGap=8 //% weight=100 blockGap=12
//% group="Color Sensor" //% group="Color Sensor"
onColorDetected(color: ColorSensorColor, handler: () => void) { onColorDetected(color: ColorSensorColor, handler: () => void) {
this.setMode(ColorSensorMode.Color) this.setMode(ColorSensorMode.Color)
@ -174,7 +174,7 @@ namespace sensors {
//% parts="colorsensor" //% parts="colorsensor"
//% blockNamespace=sensors //% blockNamespace=sensors
//% sensor.fieldEditor="ports" //% sensor.fieldEditor="ports"
//% weight=89 blockGap=8 //% weight=89 blockGap=12
//% group="Color Sensor" //% group="Color Sensor"
onLightChanged(mode: LightIntensityMode, condition: LightCondition, handler: () => void) { onLightChanged(mode: LightIntensityMode, condition: LightCondition, handler: () => void) {
this.setMode(<ColorSensorMode><number>mode) this.setMode(<ColorSensorMode><number>mode)

View File

@ -116,7 +116,7 @@ namespace brick {
//% blockId=buttonEvent block="on %button|%event" //% blockId=buttonEvent block="on %button|%event"
//% parts="brick" //% parts="brick"
//% blockNamespace=brick //% blockNamespace=brick
//% weight=99 blockGap=8 //% weight=99 blockGap=16
//% group="Buttons" //% group="Buttons"
//% button.fieldEditor="brickbuttons" //% button.fieldEditor="brickbuttons"
onEvent(ev: ButtonEvent, body: () => void) { onEvent(ev: ButtonEvent, body: () => void) {

View File

@ -187,7 +187,7 @@ namespace motors {
*/ */
//% weight=6 blockGap=8 //% weight=6 blockGap=8
//% group="Move" //% group="Move"
//% blockId=motorStop block="%motors|stop" //% blockId=motorStop block="stop %motors|"
stop() { stop() {
this.init(); this.init();
stop(this._port, this._brake); stop(this._port, this._brake);
@ -206,7 +206,7 @@ namespace motors {
*/ */
//% weight=5 //% weight=5
//% group="Move" //% group="Move"
//% blockId=motorReset block="%motors|reset" //% blockId=motorReset block="reset %motors|"
reset() { reset() {
this.init(); this.init();
reset(this._port); reset(this._port);
@ -279,7 +279,7 @@ namespace motors {
* Pauses the execution until the previous command finished. * Pauses the execution until the previous command finished.
* @param timeOut optional maximum pausing time in milliseconds * @param timeOut optional maximum pausing time in milliseconds
*/ */
//% blockId=motorPauseUntilRead block="%motor|pause until ready" //% blockId=motorPauseUntilRead block="pause until %motor|ready"
//% weight=90 //% weight=90
//% group="Move" //% group="Move"
pauseUntilReady(timeOut?: number) { pauseUntilReady(timeOut?: number) {
@ -385,7 +385,7 @@ namespace motors {
/** /**
* Clears the motor count * Clears the motor count
*/ */
//% blockId=motorClearCount block="%motor|clear counts" //% blockId=motorClearCount block="clear %motor|counters"
//% weight=68 //% weight=68
//% blockGap=8 //% blockGap=8
//% group="Counters" //% group="Counters"

View File

@ -1,20 +1,20 @@
//% color="#68C3E2" weight=100 icon="\uf106" //% color="#68C3E2" weight=100 icon="\uf106"
//% groups='["Buttons", "Screen"]' //% groups='["Buttons", "Screen"]'
//% labelLineWidth=0 //% labelLineWidth=60
namespace brick { namespace brick {
} }
//% color="#C8509B" weight=95 icon="\uf10f" //% color="#C8509B" weight=95 icon="\uf10f"
//% labelLineWidth=0 //% labelLineWidth=100
//% groups='["Touch Sensor", "Color Sensor", "Ultrasonic Sensor", "Gyro Sensor", "Infrared Sensor", "Remote Infrared Beacon", "Threshold"]' //% groups='["Touch Sensor", "Color Sensor", "Ultrasonic Sensor", "Gyro Sensor", "Infrared Sensor", "Remote Infrared Beacon", "Threshold"]'
namespace sensors { namespace sensors {
} }
//% color="#A5CA18" weight=90 icon="\uf10d" //% color="#A5CA18" weight=90 icon="\uf10d"
//% groups='["Move", "Counters"]' //% groups='["Move", "Counters"]'
//% labelLineWidth=0 //% labelLineWidth=50
namespace motors { namespace motors {
} }

View File

@ -82,12 +82,12 @@ namespace sensors {
* Forces a calibration of the gyro. Must be called when the sensor is completely still. * Forces a calibration of the gyro. Must be called when the sensor is completely still.
*/ */
//% help=input/gyro/calibrate //% help=input/gyro/calibrate
//% block="%sensor|reset" //% block="reset %sensor|"
//% blockId=gyroReset //% blockId=gyroReset
//% parts="gyroscope" //% parts="gyroscope"
//% blockNamespace=sensors //% blockNamespace=sensors
//% sensor.fieldEditor="ports" //% sensor.fieldEditor="ports"
//% weight=50 blockGap=8 //% weight=50
//% group="Gyro Sensor" //% group="Gyro Sensor"
reset(): void { reset(): void {
if (this.calibrating) return; // already in calibration mode if (this.calibrating) return; // already in calibration mode

View File

@ -34,7 +34,7 @@ namespace sensors {
//% parts="touch" //% parts="touch"
//% blockNamespace=sensors //% blockNamespace=sensors
//% sensor.fieldEditor="ports" //% sensor.fieldEditor="ports"
//% weight=99 blockGap=8 //% weight=99 blockGap=12
//% group="Touch Sensor" //% group="Touch Sensor"
onEvent(ev: ButtonEvent, body: () => void) { onEvent(ev: ButtonEvent, body: () => void) {
this.button.onEvent(ev, body) this.button.onEvent(ev, body)
@ -50,7 +50,7 @@ namespace sensors {
//% parts="touch" //% parts="touch"
//% blockNamespace=sensors //% blockNamespace=sensors
//% sensor.fieldEditor="ports" //% sensor.fieldEditor="ports"
//% weight=98 blockGap=8 //% weight=98 blockGap=12
//% group="Touch Sensor" //% group="Touch Sensor"
pauseUntil(ev: ButtonEvent) { pauseUntil(ev: ButtonEvent) {
this.button.pauseUntil(<ButtonEvent><number>ev); this.button.pauseUntil(<ButtonEvent><number>ev);
@ -66,7 +66,7 @@ namespace sensors {
//% parts="touch" //% parts="touch"
//% blockNamespace=sensors //% blockNamespace=sensors
//% sensor.fieldEditor="ports" //% sensor.fieldEditor="ports"
//% weight=81 //% weight=81 blockGap=8
//% group="Touch Sensor" //% group="Touch Sensor"
isPressed() { isPressed() {
return this.button.isPressed(); return this.button.isPressed();
@ -82,7 +82,7 @@ namespace sensors {
//% parts="touch" //% parts="touch"
//% blockNamespace=sensors //% blockNamespace=sensors
//% sensor.fieldEditor="ports" //% sensor.fieldEditor="ports"
//% weight=81 blockGap=8 //% weight=81
//% group="Touch Sensor" //% group="Touch Sensor"
wasPressed() { wasPressed() {
return this.button.wasPressed(); return this.button.wasPressed();