From d4214c65f2c4b176a1a7a603e55797fee76678ea Mon Sep 17 00:00:00 2001 From: Richard Knoll Date: Wed, 23 Mar 2022 13:23:00 -0700 Subject: [PATCH] Fix block tests by removing arrow, reverting block string (#158) --- libs/core/_locales/core-strings.json | 2 +- libs/core/blocks-test/basic.blocks | 8 +- libs/core/blocks-test/image.blocks | 8 - libs/core/blocks-test/test.blocks | 678 +-------------------------- libs/core/images.cpp | 4 +- libs/core/shims.d.ts | 2 +- 6 files changed, 9 insertions(+), 693 deletions(-) diff --git a/libs/core/_locales/core-strings.json b/libs/core/_locales/core-strings.json index cae59eec..dcd7f944 100644 --- a/libs/core/_locales/core-strings.json +++ b/libs/core/_locales/core-strings.json @@ -120,7 +120,7 @@ "IconNames.SmallHeart|block": "small heart", "IconNames.Surprised|block": "surprised", "IconNames.Yes|block": "yes", - "Image.scrollImage|block": "scroll image %sprite(myImage)|with offset %frameoffset|and interval (ms) %interval", + "Image.scrollImage|block": "scroll image %sprite(myImage)|with offset %frameoffset|and interval (ms) %delay", "Image.showImage|block": "show image %sprite(myImage)|at offset %offset ||and interval (ms) %interval", "JSON|block": "JSON", "LedSpriteProperty.Blink|block": "blink", diff --git a/libs/core/blocks-test/basic.blocks b/libs/core/blocks-test/basic.blocks index 8548c929..3a15fc01 100644 --- a/libs/core/blocks-test/basic.blocks +++ b/libs/core/blocks-test/basic.blocks @@ -30,10 +30,10 @@ - - - - ArrowNames.South + + + + 100 diff --git a/libs/core/blocks-test/image.blocks b/libs/core/blocks-test/image.blocks index a6272f28..a583dc7f 100644 --- a/libs/core/blocks-test/image.blocks +++ b/libs/core/blocks-test/image.blocks @@ -14,17 +14,9 @@ 0 - - ArrowNames.South - - - - ArrowNames.SouthWest - - 1 diff --git a/libs/core/blocks-test/test.blocks b/libs/core/blocks-test/test.blocks index d1e1be1e..f175a9a5 100644 --- a/libs/core/blocks-test/test.blocks +++ b/libs/core/blocks-test/test.blocks @@ -1,677 +1 @@ - - - booltest - myImage - strtest - - - - - - - 123 - - - - - - ` - # . . # . - # . . # . - . # . . . - . # # . . - . . . . . - ` - - - - IconNames.Heart - - - - - 500 - - - - - - - - - ArrowNames.SouthEast - - - - - - - myImage - - - - - 0 - - - - - - - myImage - - - - - 1 - - - - - - 200 - - - - - strtest - - - 0 - - - - - Delimiters.Hash - - - - - - - strtest - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - TouchPin.P2 - - - - - - 1 - - - - - - 2 - - - - - - - 5 - - - - - 45 - - - - - DisplayMode.Greyscale - - - AnalogPin.P4 - - - - 1023 - - - AnalogPin.P13 - - - - - DigitalPin.P10 - - - - 0 - - - DigitalPin.P15 - - - - - AnalogPin.P9 - - - 1234 - - - - - 0 - - - - - - 0 - - - - - - 1023 - - - Rotation.Roll - - - - - 0 - - - Dimension.Y - - - - - 4 - - - - - - - - AnalogPin.P20 - - - - 180 - - - Dimension.Z - - - - - AnalogPin.P14 - - - 1500 - - - - - - - - 220 - - - - - BeatFraction.Sixteenth - - - - - - - 659 - - - - - - - BeatFraction.Double - - - - - MelodyOptions.ForeverInBackground - - - Melodies.Ringtone - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gesture.TiltLeft - - - - - - 1 - - - EventBusValue.MICROBIT_PIN_EVT_PULSE_HI - - - - - - 2 - - - - - - - - - 64 - - - - - - - - - - - - - booltest - - - 0 - - - Button.B - - - - - booltest - - - 0 - - - TouchPin.P2 - - - - - booltest - - - 0 - - - - - - 3 - - - - - - 4 - - - - - - - - - - - - - Button.AB - - - - - - 1 - - - BeatFraction.Sixteenth - - - - - - 2 - - - - - - - - 3 - - - - - - - 5 - - - - - - 255 - - - - - - - - - 255 - - - 440 - - - - - - - - - TRUE - - - - - - - - - - - - - - - - - - - - - - 4 - - - - - - - - EventBusSource.MICROBIT_ID_IO_P0 - - - - - EventBusValue.MES_ALERT_EVT_ALARM1 - - - - - - - - - TouchPin.P2 - - - AcceleratorRange.EightG - - - - - - - Delimiters.Colon - - - - - SerialPin.P12 - SerialPin.P14 - BaudRate.BaudRate19200 - - - - - - - - DigitalPin.P10 - PulseValue.Low - - - NumberFormat.UInt8BE - - - 0 - - - - - 0 - - - - - FALSE - - - - - - - 0 - - - - - 0 - - - - - DigitalPin.P0 - PinEventType.Touch - - - - - 1000000 - - - - - AnalogPin.P2 - - - DigitalPin.P2 - PinPullMode.PullDown - - - - - 8 - - - - - 3 - - - - - DigitalPin.P9 - DigitalPin.P14 - DigitalPin.P16 - - - - - - - - - - - - - - - - - - - - - - MusicEvent.BackgroundMelodyNotePlayed - - - - - 123 - - - - - - - - 12312312 - - - - - - - - - - - - - - - 0 - - - - - - - x - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - EventBusSource.MICROBIT_ID_IO_P1 - - - - - EventBusValue.MES_ALERT_EVT_ALARM2 - - - - \ No newline at end of file +booltestmyImagestrtest123` # . . # . # . . # . . # . . . . # # . . . . . . . `IconNames.Heart500IconNames.HeartmyImage0myImage13strtest0Delimiters.Hashstrtest0TouchPin.P212545DisplayMode.GreyscaleAnalogPin.P21023AnalogPin.P2DigitalPin.P10DigitalPin.P1AnalogPin.P21234001023Rotation.Roll0Dimension.Y4AnalogPin.P2180Dimension.ZAnalogPin.P21500220BeatFraction.Sixteenth659BeatFraction.DoubleMelodyOptions.ForeverInBackgroundMelodies.RingtoneGesture.TiltLeft1EventBusValue.MICROBIT_PIN_EVT_PULSE_HI264booltest0Button.Bbooltest0TouchPin.P2booltest034Button.AB1BeatFraction.Sixteenth235255255440TRUE4EventBusSource.MICROBIT_ID_IO_P0EventBusValue.MES_ALERT_EVT_ALARM1TouchPin.P2AcceleratorRange.EightGDelimiters.ColonSerialPin.P0SerialPin.P1BaudRate.BaudRate19200DigitalPin.P1PulseValue.LowNumberFormat.UInt8BE00FALSE00DigitalPin.P0PinEventType.Touch1000000AnalogPin.P2DigitalPin.P2PinPullMode.PullDown83DigitalPin.P1DigitalPin.P1DigitalPin.P1MusicEvent.BackgroundMelodyNotePlayed123123123120x0EventBusSource.MICROBIT_ID_IO_P1EventBusValue.MES_ALERT_EVT_ALARM2 \ No newline at end of file diff --git a/libs/core/images.cpp b/libs/core/images.cpp index 5e714c77..64319800 100644 --- a/libs/core/images.cpp +++ b/libs/core/images.cpp @@ -64,7 +64,7 @@ Buffer charCodeBuffer(int charCode) { #endif const int offset = (charCode - MICROBIT_FONT_ASCII_START) * 5;; const uint8_t* charBuffer = font.characters + offset; - + return PXT_CREATE_BUFFER(charBuffer, 5); } @@ -111,7 +111,7 @@ void plotFrame(Image i, int xOffset) { */ //% help=images/scroll-image weight=79 async blockNamespace=images //% blockId=device_scroll_image -//% block="scroll image %sprite(myImage)|with offset %frameoffset|and interval (ms) %interval" +//% block="scroll image %sprite(myImage)|with offset %frameoffset|and interval (ms) %delay" //% blockGap=8 parts="ledmatrix" void scrollImage(Image id, int frameOffset, int interval) { MicroBitImage i(id->img); diff --git a/libs/core/shims.d.ts b/libs/core/shims.d.ts index 431e94c9..a7d9b341 100644 --- a/libs/core/shims.d.ts +++ b/libs/core/shims.d.ts @@ -60,7 +60,7 @@ declare interface Image { */ //% help=images/scroll-image weight=79 async blockNamespace=images //% blockId=device_scroll_image - //% block="scroll image %sprite(myImage)|with offset %frameoffset|and interval (ms) %interval" + //% block="scroll image %sprite(myImage)|with offset %frameoffset|and interval (ms) %delay" //% blockGap=8 parts="ledmatrix" shim=ImageMethods::scrollImage scrollImage(frameOffset: int32, interval: int32): void;