diff --git a/libs/color-sensor/color.ts b/libs/color-sensor/color.ts index 34fd3f82..c3f28895 100644 --- a/libs/color-sensor/color.ts +++ b/libs/color-sensor/color.ts @@ -147,7 +147,7 @@ namespace sensors { //% parts="colorsensor" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=100 blockGap=12 + //% weight=100 blockGap=8 //% group="Color Sensor" onColorDetected(color: number, handler: () => void) { this.setMode(ColorSensorMode.Color) @@ -167,7 +167,7 @@ namespace sensors { //% parts="colorsensor" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=99 blockGap=8 + //% weight=98 blockGap=8 //% group="Color Sensor" pauseUntilColorDetected(color: number) { this.setMode(ColorSensorMode.Color); @@ -187,9 +187,8 @@ namespace sensors { //% parts="colorsensor" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=98 + //% weight=97 blockGap=8 //% group="Color Sensor" - //% blockGap=8 color(): ColorSensorColor { this.setMode(ColorSensorMode.Color); this.poke(); @@ -221,9 +220,8 @@ namespace sensors { //% parts="colorsensor" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=1 + //% weight=89 //% group="Color Sensor" - //% blockGap=8 rgbRaw(): number[] { this.setMode(ColorSensorMode.RgbRaw); this.poke(); @@ -241,7 +239,7 @@ namespace sensors { //% parts="colorsensor" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=89 blockGap=12 + //% weight=79 blockGap=8 //% group="Color Sensor" onLightDetected(mode: LightIntensityMode, condition: Light, handler: () => void) { this.setMode(mode) @@ -258,7 +256,7 @@ namespace sensors { //% parts="colorsensor" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=88 blockGap=8 + //% weight=78 blockGap=8 //% group="Color Sensor" pauseUntilLightDetected(mode: LightIntensityMode, condition: Light) { this.setMode(mode) @@ -276,7 +274,7 @@ namespace sensors { //% parts="colorsensor" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=87 blockGap=8 + //% weight=77 //% group="Color Sensor" light(mode: LightIntensityMode) { this.setMode(mode); @@ -318,11 +316,12 @@ namespace sensors { * @param condition the dark or bright light condition * @param value the value threshold, eg: 10 */ + //% help=sensors/color-sensor/set-threshold //% blockId=colorSetThreshold block="set **color sensor** %this|%condition|to %value" - //% group="Calibration" blockGap=8 weight=90 //% value.min=0 value.max=100 //% this.fieldEditor="ports" - //% help=sensors/color-sensor/set-threshold + //% weight=67 blockGap=8 + //% group="Color Sensor" setThreshold(condition: Light, value: number) { // threshold is used in ambient or reflected modes if (this.mode != LightIntensityMode.Ambient && @@ -339,10 +338,11 @@ namespace sensors { * Get a threshold value * @param condition the light condition */ + //% help=sensors/color-sensor/threshold //% blockId=colorGetThreshold block="**color sensor** %this|%condition" - //% group="Calibration" weight=89 //% this.fieldEditor="ports" - //% help=sensors/color-sensor/threshold + //% weight=68 blockGap=8 + //% group="Color Sensor" threshold(condition: Light): number { // threshold is used in ambient or reflected modes if (this.mode != LightIntensityMode.Ambient && @@ -355,10 +355,11 @@ namespace sensors { /** * Collects measurement of the light condition and adjusts the threshold to 10% / 90%. */ + //% help=sensors/color-sensor/calibrate-light //% blockId=colorCalibrateLight block="calibrate **color sensor** %this|for %mode" - //% group="Calibration" weight=91 blockGap=8 //% this.fieldEditor="ports" - //% help=sensors/color-sensor/calibrate-light + //% weight=69 blockGap=8 + //% group="Color Sensor" calibrateLight(mode: LightIntensityMode, deviation: number = 8) { this.calibrating = true; // prevent events @@ -423,10 +424,11 @@ namespace sensors { * @param color the color sensed by the sensor, eg: ColorSensorColor.Red */ //% shim=TD_ID - //% blockId=colorSensorColor block="color %color=colorEnumPicker" - //% group="Color Sensor" - //% weight=97 //% help=sensors/color + //% blockId=colorSensorColor + //% block="color %color=colorEnumPicker" + //% weight=96 + //% group="Color Sensor" export function color(color: number): ColorSensorColor { return color; } diff --git a/libs/ev3/ns.ts b/libs/ev3/ns.ts index e2c6bf10..9235dae5 100644 --- a/libs/ev3/ns.ts +++ b/libs/ev3/ns.ts @@ -6,7 +6,7 @@ namespace brick { //% color="#C8509B" weight=95 icon="\uf10f" //% labelLineWidth=100 -//% groups='["Touch Sensor", "Color Sensor", "Ultrasonic Sensor", "Gyro Sensor", "Infrared Sensor", "Remote Infrared Beacon", "Calibration", "Light Sensor"]' +//% groups='["Touch Sensor", "Color Sensor", "Ultrasonic Sensor", "Gyro Sensor", "Infrared Sensor", "Remote Infrared Beacon", "Light Sensor"]' //% subcategories='["NXT", "HiTechnic"]' namespace sensors { } diff --git a/libs/gyro-sensor/gyro.ts b/libs/gyro-sensor/gyro.ts index 7e73153e..0ee4628b 100644 --- a/libs/gyro-sensor/gyro.ts +++ b/libs/gyro-sensor/gyro.ts @@ -47,7 +47,7 @@ namespace sensors { //% parts="gyroscope" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=64 blockGap=8 + //% weight=100 blockGap=8 //% group="Gyro Sensor" angle(): number { this.poke(); @@ -67,7 +67,7 @@ namespace sensors { //% parts="gyroscope" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=65 blockGap=8 + //% weight=99 blockGap=8 //% group="Gyro Sensor" rate(): number { this.poke(); @@ -86,7 +86,7 @@ namespace sensors { //% parts="gyroscope" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=51 blockGap=8 + //% weight=89 blockGap=8 //% group="Gyro Sensor" calibrate(): void { if (this._calibrating) return; // already in calibration mode @@ -157,7 +157,7 @@ namespace sensors { //% parts="gyroscope" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=50 blockGap=8 + //% weight=88 //% group="Gyro Sensor" reset(): void { if (this._calibrating) return; // already in calibration mode @@ -202,7 +202,7 @@ namespace sensors { //% parts="gyroscope" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=9 blockGap=8 + //% weight=78 blockGap=8 //% group="Gyro Sensor" drift(): number { return this._drift; @@ -217,7 +217,7 @@ namespace sensors { //% parts="gyroscope" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=10 blockGap=8 + //% weight=79 blockGap=8 //% group="Gyro Sensor" computeDrift() { if (this._calibrating) @@ -238,7 +238,7 @@ namespace sensors { //% blockNamespace=sensors //% this.fieldEditor="ports" //% degrees.defl=90 - //% weight=63 + //% weight=98 //% group="Gyro Sensor" pauseUntilRotated(degrees: number, timeOut?: number): void { let a = this.angle(); diff --git a/libs/infrared-sensor/ir.ts b/libs/infrared-sensor/ir.ts index 99763386..d69ce106 100644 --- a/libs/infrared-sensor/ir.ts +++ b/libs/infrared-sensor/ir.ts @@ -231,7 +231,7 @@ namespace sensors { //% blockId=infraredGetProximity //% parts="infrared" //% blockNamespace=sensors - //% weight=98 blockGap=8 + //% weight=98 //% group="Infrared Sensor" //% this.fieldEditor="ports" proximity(): number { @@ -262,7 +262,8 @@ namespace sensors { * @param value the value threshold */ //% blockId=irSetThreshold block="set **infrared** %this|%condition|to %value" - //% group="Calibration" blockGap=8 weight=49 + //% blockGap=8 weight=49 + //% group="Infrared Sensor" //% value.min=0 value.max=100 //% this.fieldEditor="ports" setPromixityThreshold(condition: InfraredSensorEvent, value: number) { @@ -277,7 +278,8 @@ namespace sensors { * @param condition the proximity condition */ //% blockId=irGetThreshold block="**infrared** %this|%condition" - //% group="Calibration" weight=49 + //% weight=48 + //% group="Infrared Sensor" //% this.fieldEditor="ports" proximityThreshold(condition: InfraredSensorEvent): number { return this._proximityThreshold.threshold(condition); diff --git a/libs/touch-sensor/touch.ts b/libs/touch-sensor/touch.ts index be0fd7b5..53958e8f 100644 --- a/libs/touch-sensor/touch.ts +++ b/libs/touch-sensor/touch.ts @@ -38,7 +38,7 @@ namespace sensors { //% parts="touch" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=99 blockGap=12 + //% weight=99 blockGap=8 //% group="Touch Sensor" onEvent(ev: ButtonEvent, body: () => void) { this.button.onEvent(ev, body) @@ -54,7 +54,7 @@ namespace sensors { //% parts="touch" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=98 blockGap=12 + //% weight=98 blockGap=8 //% group="Touch Sensor" pauseUntil(ev: ButtonEvent) { this.button.pauseUntil(ev); @@ -65,8 +65,7 @@ namespace sensors { * @param sensor the port to query the request */ //% help=sensors/touch-sensor/is-pressed - //% block="**touch** %this|is pressed" - //% blockId=touchIsPressed + //% blockId=touchIsPressed block="**touch** %this|is pressed" //% parts="touch" //% blockNamespace=sensors //% this.fieldEditor="ports" @@ -82,13 +81,12 @@ namespace sensors { * @param sensor the port to query the request */ //% help=sensors/touch-sensor/was-pressed - //% block="**touch** %this|was pressed" - //% blockId=touchWasPressed + //% blockId=touchWasPressed block="**touch** %this|was pressed" //% blockHidden=true //% parts="touch" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=81 + //% weight=80 //% group="Touch Sensor" wasPressed() { this.poke(); diff --git a/libs/ultrasonic-sensor/ultrasonic.ts b/libs/ultrasonic-sensor/ultrasonic.ts index a9fe0690..3f683502 100644 --- a/libs/ultrasonic-sensor/ultrasonic.ts +++ b/libs/ultrasonic-sensor/ultrasonic.ts @@ -51,7 +51,7 @@ namespace sensors { //% blockNamespace=sensors //% this.fieldEditor="ports" //% weight=100 blockGap=8 - //% group="Ultrasonic Sensor" + //% group="Ultrasonic Sensor" onEvent(event: UltrasonicSensorEvent, handler: () => void) { control.onEvent(this._id, event, handler); } @@ -81,7 +81,7 @@ namespace sensors { //% parts="ultrasonicsensor" //% blockNamespace=sensors //% this.fieldEditor="ports" - //% weight=65 + //% weight=98 //% group="Ultrasonic Sensor" distance(): number { this.poke(); @@ -97,7 +97,8 @@ namespace sensors { * @param value the value threshold */ //% blockId=ultrasonicSetThreshold block="set **ultrasonic** %this|%condition|to %value" - //% group="Calibration" blockGap=8 weight=80 + //% weight=89 blockGap=8 + //% group="Ultrasonic Sensor" //% value.min=0 value.max=255 //% this.fieldEditor="ports" setThreshold(condition: UltrasonicSensorEvent, value: number) { @@ -112,7 +113,8 @@ namespace sensors { * @param condition the proximity condition */ //% blockId=ultrasonicGetThreshold block="**ultrasonic** %this|%condition" - //% group="Calibration" weight=79 + //% weight=88 + //% group="Ultrasonic Sensor" //% this.fieldEditor="ports" threshold(condition: UltrasonicSensorEvent): number { switch (condition) {