From aa3c6d5fc0f8ce6554803a945daf895bbd037773 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Mon, 23 Oct 2017 13:41:38 -0700 Subject: [PATCH 1/4] bump pxt-core to 2.3.1, bump pxt-common-packages to 0.10.16, --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 13b9d11c..cc5b11eb 100644 --- a/package.json +++ b/package.json @@ -39,8 +39,8 @@ "semantic-ui-less": "^2.2.4" }, "dependencies": { - "pxt-common-packages": "0.9.6", - "pxt-core": "2.0.49" + "pxt-common-packages": "0.10.16", + "pxt-core": "2.3.1" }, "scripts": { "test": "node node_modules/pxt-core/built/pxt.js travis" From 8fa6cf41ca3a9e778c6fadeedaae589e026b0814 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Mon, 23 Oct 2017 13:43:59 -0700 Subject: [PATCH 2/4] updated build files --- libs/base/_locales/base-jsdoc-strings.json | 21 +++++++++++++++++++ libs/base/_locales/base-strings.json | 5 +++++ libs/base/shims.d.ts | 4 ++-- libs/core/_locales/core-jsdoc-strings.json | 22 ++++++++++++++++---- libs/core/_locales/core-strings.json | 11 ++++++++-- libs/music/_locales/music-jsdoc-strings.json | 8 +++---- sim/dalboard.ts | 10 ++++----- sim/visuals/board.ts | 2 ++ 8 files changed, 66 insertions(+), 17 deletions(-) diff --git a/libs/base/_locales/base-jsdoc-strings.json b/libs/base/_locales/base-jsdoc-strings.json index 2cd24f8c..110fe87e 100644 --- a/libs/base/_locales/base-jsdoc-strings.json +++ b/libs/base/_locales/base-jsdoc-strings.json @@ -31,6 +31,22 @@ "Array.splice|param|deleteCount": "The number of elements to remove. eg: 0", "Array.splice|param|start": "The zero-based location in the array from which to start removing elements. eg: 0", "Array.unshift": "Add one element to the beginning of an array and return the new length of the array.", + "Boolean.toString": "Returns a string representation of an object.", + "Buffer.fill": "Fill (a fragment) of the buffer with given value.", + "Buffer.getNumber": "Read a number in specified format from the buffer.", + "Buffer.length": "Returns the length of a Buffer object.", + "Buffer.rotate": "Rotate buffer left in place.\n\n\n\nstart. eg: -1", + "Buffer.rotate|param|length": "number of elements in buffer. If negative, length is set as the buffer length minus", + "Buffer.rotate|param|offset": "number of bytes to shift; use negative value to shift right", + "Buffer.rotate|param|start": "start offset in buffer. Default is 0.", + "Buffer.setNumber": "Write a number in specified format in the buffer.", + "Buffer.shift": "Shift buffer left in place, with zero padding.\n\n\n\nstart. eg: -1", + "Buffer.shift|param|length": "number of elements in buffer. If negative, length is set as the buffer length minus", + "Buffer.shift|param|offset": "number of bytes to shift; use negative value to shift right", + "Buffer.shift|param|start": "start offset in buffer. Default is 0.", + "Buffer.slice": "Return a copy of a fragment of a buffer.", + "Buffer.toHex": "Convert a buffer to its hexadecimal representation.", + "Buffer.write": "Write contents of `src` at `dstOffset` in current buffer.", "Math": "More complex operations with numbers.", "Math.abs": "Returns the absolute value of a number (the value without regard to whether it is positive or negative).\nFor example, the absolute value of -5 is the same as the absolute value of 5.", "Math.abs|param|x": "A numeric expression for which the absolute value is needed.", @@ -91,6 +107,7 @@ "Math.tan|param|x": "An angle in radians", "Math.trunc": "Returns the number with the decimal part truncated.", "Math.trunc|param|x": "A numeric expression.", + "Number.toString": "Returns a string representation of a number.", "String": "Combine, split, and search text strings.\n\nCombine, split, and search text strings.", "String.charAt": "Return the character at the specified index.", "String.charAt|param|index": "The zero-based index of the desired character.", @@ -107,6 +124,8 @@ "String.substr|param|length": "number of characters to extract", "String.substr|param|start": "first character index; can be negative from counting from the end, eg:0", "control": "Program controls and events.", + "control.AnimationQueue.cancel": "Cancels the current running animation and clears the queue", + "control.AnimationQueue.runUntilDone": "Runs 'render' in a loop until it returns false or the 'stop' function is called", "control.assert": "Display an error code and stop the program when the assertion is `false`.", "control.deviceSerialNumber": "Derive a unique, consistent serial number of this device from internal data.", "control.millis": "Gets the number of milliseconds elapsed since power on.", @@ -119,11 +138,13 @@ "control.waitForEvent": "Blocks the calling thread until the specified event is raised.", "control.waitMicros": "Block the current fiber for the given microseconds", "control.waitMicros|param|micros": "number of micro-seconds to wait. eg: 4", + "hex": "Tagged hex literal converter", "loops.forever": "Repeats the code forever in the background. On each iteration, allows other codes to run.", "loops.pause": "Pause for the specified time in milliseconds", "loops.pause|param|ms": "how long to pause for, eg: 100, 200, 500, 1000, 2000", "loops.timePicker": "Get the time field editor", "loops.timePicker|param|ms": "time duration in milliseconds, eg: 500, 1000", + "parseInt": "Convert a string to an integer.", "serial": "Reading and writing data over a serial connection.", "serial.writeBuffer": "Send a buffer across the serial connection.", "serial.writeLine": "Write a line of text to the serial port.", diff --git a/libs/base/_locales/base-strings.json b/libs/base/_locales/base-strings.json index adc43ab5..8697e476 100644 --- a/libs/base/_locales/base-strings.json +++ b/libs/base/_locales/base-strings.json @@ -33,6 +33,7 @@ "loops.pause|block": "pause %ms=timePicker|ms", "loops.timePicker|block": "%ms", "loops|block": "loops", + "parseInt|block": "parse to integer %text", "serial.writeBuffer|block": "serial|write buffer %buffer", "serial.writeLine|block": "serial|write line %text", "serial.writeNumber|block": "serial|write number %value", @@ -41,9 +42,13 @@ "serial|block": "serial", "{id:category}Array": "Array", "{id:category}Arrays": "Arrays", + "{id:category}Boolean": "Boolean", + "{id:category}Buffer": "Buffer", "{id:category}Control": "Control", + "{id:category}Helpers": "Helpers", "{id:category}Loops": "Loops", "{id:category}Math": "Math", + "{id:category}Number": "Number", "{id:category}Serial": "Serial", "{id:category}String": "String", "{id:category}Text": "Text" diff --git a/libs/base/shims.d.ts b/libs/base/shims.d.ts index bf4a9a0f..1d86fdb2 100644 --- a/libs/base/shims.d.ts +++ b/libs/base/shims.d.ts @@ -70,7 +70,7 @@ declare namespace loops { * Repeats the code forever in the background. On each iteration, allows other codes to run. * @param body code to execute */ - //% help=loops/forever weight=100 + //% help=loops/forever weight=100 afterOnStart=true //% blockId=forever block="forever" blockAllowMultiple=1 shim=loops::forever function forever(a: () => void): void; @@ -120,7 +120,7 @@ declare namespace control { /** * Run other code in the background. */ - //% help=control/run-in-background blockAllowMultiple=1 + //% help=control/run-in-background blockAllowMultiple=1 afterOnStart=true //% blockId="control_run_in_background" block="run in background" blockGap=8 shim=control::runInBackground function runInBackground(a: () => void): void; diff --git a/libs/core/_locales/core-jsdoc-strings.json b/libs/core/_locales/core-jsdoc-strings.json index b3a7ac35..37e6da8a 100644 --- a/libs/core/_locales/core-jsdoc-strings.json +++ b/libs/core/_locales/core-jsdoc-strings.json @@ -1,4 +1,14 @@ { + "ButtonEvent": "User interaction on buttons", + "Draw": "Drawing modes", + "LightsPattern": "Patterns for lights under the buttons.", + "MMap.getNumber": "Read a number in specified format from the buffer.", + "MMap.ioctl": "Perform ioctl(2) on the underlaying file", + "MMap.length": "Returns the length of a Buffer object.", + "MMap.read": "Perform read(2) on the underlaying file", + "MMap.setNumber": "Write a number in specified format in the buffer.", + "MMap.slice": "Read a range of bytes into a buffer.", + "MMap.write": "Perform write(2) on the underlaying file", "control": "Program controls and events.", "control.allocateNotifyEvent": "Allocates the next user notification event", "control.deviceFirmwareVersion": "Determine the version of system software currently running.", @@ -9,6 +19,14 @@ "control.raiseEvent|param|value": "Component specific code indicating the cause of the event.", "input": "Respond to and read data from buttons and sensors.", "input.Button": "Generic button class, for device buttons and sensors.", + "input.Button.isPressed": "Check if button is currently pressed or not.", + "input.Button.onEvent": "Do something when a button or sensor is clicked, double clicked, etc...", + "input.Button.onEvent|param|body": "code to run when the event is raised", + "input.Button.wasPressed": "See if the button was pressed again since the last time you checked.", + "input.ColorSensor.getAmbientLight": "Get current ambient light value from the color sensor.", + "input.ColorSensor.getColor": "Get the current color from the color sensor.", + "input.ColorSensor.getReflectedLight": "Get current reflected light value from the color sensor.", + "input.UltraSonicSensor.getDistance": "Get distance in mm", "input.buttonDown": "Down button.", "input.buttonEnter": "Enter button.", "input.buttonLeft": "Left button.", @@ -33,10 +51,6 @@ "output.setSpeed": "Set motor speed.", "output.setSpeed|param|out": "the output connection that the motor is connected to", "output.setSpeed|param|speed": "the desired speed to use. eg: 100", - "output.start": "Turn motor on.", - "output.start|param|out": "the output connection that the motor is connected to", - "output.stop": "Turn motor off.", - "output.stop|param|out": "the output connection that the motor is connected to", "output.switchMotor": "Switch the motor on or off.", "output.switchMotor|param|on": "1 to turn the motor on, 0 to turn it off", "output.switchMotor|param|out": "the output connection that the motor is connected to", diff --git a/libs/core/_locales/core-strings.json b/libs/core/_locales/core-strings.json index dc64ae9c..14c4dc5f 100644 --- a/libs/core/_locales/core-strings.json +++ b/libs/core/_locales/core-strings.json @@ -15,24 +15,30 @@ "LightsPattern.Red|block": "Red", "control.raiseEvent|block": "raise event|from %src|with value %value", "control|block": "control", + "input.Button.isPressed|block": "%button|is pressed", + "input.Button.onEvent|block": "on %button|%event", + "input.Button.wasPressed|block": "%button|was pressed", + "input.ColorSensor.getAmbientLight|block": "%color| ambient light", + "input.ColorSensor.getColor|block": "%color| color", + "input.ColorSensor.getReflectedLight|block": "%color| reflected light", "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.color|block": "color sensor", "input.remoteBottomLeft|block": "remote bottom-left", "input.remoteBottomRight|block": "remote bottom-right", "input.remoteCenter|block": "remote center", "input.remoteTopLeft|block": "remote top-left", "input.remoteTopRight|block": "remote top-right", + "input.touchSensor|block": "touch sensor", "input|block": "input", "output.getCurrentSpeed|block": "motor %out|speed", "output.getPattern|block": "%pattern", "output.setLights|block": "set status light %pattern=led_pattern", "output.setPower|block": "set motor %out| power to %power", "output.setSpeed|block": "set motor %out| speed to %speed", - "output.start|block": "turn motor %out|on", - "output.stop|block": "turn motor %out|off", "output.switchMotor|block": "turn motor %out|%on", "output.turn|block": "turn motor %out| on for %ms|milliseconds", "output|block": "output", @@ -41,6 +47,7 @@ "serial|block": "serial", "{id:category}Control": "Control", "{id:category}Input": "Input", + "{id:category}MMap": "MMap", "{id:category}Output": "Output", "{id:category}Screen": "Screen", "{id:category}Serial": "Serial", diff --git a/libs/music/_locales/music-jsdoc-strings.json b/libs/music/_locales/music-jsdoc-strings.json index 2ea11296..3dd0fd2f 100644 --- a/libs/music/_locales/music-jsdoc-strings.json +++ b/libs/music/_locales/music-jsdoc-strings.json @@ -8,15 +8,15 @@ "music.noteFrequency|param|name": "the note name, eg: Note.C", "music.playSound": "Start playing a sound and don't wait for it to finish.\nNotes are expressed as a string of characters with this format: NOTE[octave][:duration]", "music.playSoundUntilDone": "Play a sound and wait until the sound is done.\nNotes are expressed as a string of characters with this format: NOTE[octave][:duration]", - "music.playSoundUntilDone|param|sound": "the melody to play, eg: 'g5:1'", - "music.playSound|param|sound": "the melody to play, eg: 'g5:1'", + "music.playSoundUntilDone|param|sound": "the melody to play, eg: music.sounds(Sounds.PowerUp)", + "music.playSound|param|sound": "the melody to play, eg: music.sounds(Sounds.PowerUp)", "music.playTone": "Play a tone through the speaker for some amount of time.", "music.playTone|param|frequency": "pitch of the tone to play in Hertz (Hz)", "music.playTone|param|ms": "tone duration in milliseconds (ms)", "music.rest": "Rest, or play silence, for some time (in milleseconds).", - "music.rest|param|ms": "rest duration in milliseconds (ms)", + "music.rest|param|ms": "rest duration in milliseconds (ms), eg: 100", "music.ringTone": "Play a tone.", - "music.ringTone|param|frequency": "pitch of the tone to play in Hertz (Hz)", + "music.ringTone|param|frequency": "pitch of the tone to play in Hertz (Hz), eg: Note.C", "music.setTempo": "Set the tempo a number of beats per minute (bpm).", "music.setTempo|param|bpm": "The new tempo in beats per minute, eg: 120", "music.setVolume": "Set the output volume of the sound synthesizer.", diff --git a/sim/dalboard.ts b/sim/dalboard.ts index 5913a620..c86d963d 100644 --- a/sim/dalboard.ts +++ b/sim/dalboard.ts @@ -25,7 +25,7 @@ namespace pxsim { export class DalBoard extends CoreBoard implements AccelerometerBoard, CommonBoard, - LightBoard, + // LightBoard, LightSensorBoard, MicrophoneBoard, MusicBoard, @@ -34,7 +34,7 @@ namespace pxsim { InfraredBoard, CapTouchBoard { // state & update logic for component services - neopixelState: CommonNeoPixelState; + // neopixelState: CommonNeoPixelState; buttonState: EV3ButtonState; slideSwitchState: SlideSwitchState; lightSensorState: AnalogSensorState; @@ -175,9 +175,9 @@ namespace pxsim { return svg.toDataUri(new XMLSerializer().serializeToString(this.view)); } - defaultNeopixelPin() { - return this.edgeConnectorState.getPin(CPlayPinName.D8); - } + //defaultNeopixelPin() { + // return this.edgeConnectorState.getPin(CPlayPinName.D8); + //} getDefaultPitchPin() { return this.edgeConnectorState.getPin(CPlayPinName.D6); diff --git a/sim/visuals/board.ts b/sim/visuals/board.ts index 433af92a..c6d1fafb 100644 --- a/sim/visuals/board.ts +++ b/sim/visuals/board.ts @@ -480,6 +480,7 @@ namespace pxsim.visuals { this.screenCanvasCtx.putImageData(this.screenCanvasData, 0, 0); } + /* private updateNeoPixels() { let state = this.board; if (!state || !state.neopixelState) return; @@ -509,6 +510,7 @@ namespace pxsim.visuals { if (p_inner) svg.filter(p_inner, `url(#neopixelglow)`); } } + */ private updateSound() { let state = this.board; From ccda971fd1a4c98d09e11cf87dbcee750d7ec52a Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Tue, 24 Oct 2017 12:50:00 +0100 Subject: [PATCH 3/4] Bump PXT and common packages --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index cc5b11eb..d495971c 100644 --- a/package.json +++ b/package.json @@ -39,8 +39,8 @@ "semantic-ui-less": "^2.2.4" }, "dependencies": { - "pxt-common-packages": "0.10.16", - "pxt-core": "2.3.1" + "pxt-common-packages": "0.11.7", + "pxt-core": "2.3.4" }, "scripts": { "test": "node node_modules/pxt-core/built/pxt.js travis" From 07dc3bdae13a8ae9371d8e8ae42aa4c2c914c6d3 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Tue, 24 Oct 2017 09:55:38 -0700 Subject: [PATCH 4/4] fixing docs compilation --- docs/SUMMARY.md | 6 ------ docs/reference.md | 18 +----------------- pxtarget.json | 3 --- 3 files changed, 1 insertion(+), 26 deletions(-) diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 04e337be..121838c9 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -3,9 +3,3 @@ ## Reference #reference * [Reference](/reference) - * [input](/reference/input) - * [light](/reference/light) - * [music](/reference/music) - * [pins](/reference/pins) - * [control](/reference/control) - * [serial](/reference/serial) diff --git a/docs/reference.md b/docs/reference.md index 0990d1bd..ac34cc75 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -1,19 +1,3 @@ # Reference -```namespaces -input.onGesture(Gesture.Shake, () => {}) -light.showRing('red red red red red red red red red red') -music.playTone(0, 0) -pins.pulseDuration() -control.runInBackground(() => {}) -serial.writeLine(""); -``` - -## See Also - -[blocks](/blocks), [JavaScript](/javascript), [input](/reference/input), [light](/reference/light), [music](/reference/music), -[control](/reference/control), [pins](/reference/pins), [serial](/reference/serial) - -```package -circuit-playground -``` \ No newline at end of file +TODO \ No newline at end of file diff --git a/pxtarget.json b/pxtarget.json index 9f74dd6b..d6c5fea3 100644 --- a/pxtarget.json +++ b/pxtarget.json @@ -110,10 +110,7 @@ "path": "https://www.lego.com/en-us/mindstorms/products/mindstorms-ev3-31313" } ], - "galleries": { - }, "useStartPage": true, - "sideDoc": "tutorials/getting-started", "invertedMenu": false, "invertedMonaco": false, "monacoToolbox": true,