Update pxt/common-packages and fix build (#2323)

* fix build off of pxt/ and pxt-common-packages master

* check in generated files
This commit is contained in:
Joey Wunderlich 2019-07-30 09:45:32 -07:00 committed by GitHub
parent 98490b1c69
commit 34fd7e0600
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 24 additions and 14 deletions

View File

@ -76,6 +76,7 @@
* [Discover JavaScript Blocks](https://microbit.org/en/2017-03-07-javascript-block-resources/) * [Discover JavaScript Blocks](https://microbit.org/en/2017-03-07-javascript-block-resources/)
* [Networking with the micro:bit](https://microbit.nominetresearch.uk/networking-book/) * [Networking with the micro:bit](https://microbit.nominetresearch.uk/networking-book/)
* [SparkFun Videos](https://youtu.be/kaNtg1HGXbY?list=PLBcrWxTa5CS0mWJrytvii8aG5KUqMXvSk) * [SparkFun Videos](https://youtu.be/kaNtg1HGXbY?list=PLBcrWxTa5CS0mWJrytvii8aG5KUqMXvSk)
* [Logic Lab](/courses/logic-lab)
* [Blocks to JavaScript](/courses/blocks-to-javascript) * [Blocks to JavaScript](/courses/blocks-to-javascript)
* [SparkFun Inventor's Kit](https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-for-microbit-experiment-guide/introduction-to-the-sparkfun-inventors-kit-for-microbit) * [SparkFun Inventor's Kit](https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-for-microbit-experiment-guide/introduction-to-the-sparkfun-inventors-kit-for-microbit)
* [Kitronik Inventor Kit](https://www.kitronik.co.uk/blog/inventors-kit-experiment-1-help) * [Kitronik Inventor Kit](https://www.kitronik.co.uk/blog/inventors-kit-experiment-1-help)

View File

@ -50,9 +50,11 @@
"Array.unshift": "Add one element to the beginning of an array and return the new length of the array.", "Array.unshift": "Add one element to the beginning of an array and return the new length of the array.",
"Array@type": "Add, remove, and replace items in lists.", "Array@type": "Add, remove, and replace items in lists.",
"Boolean.toString": "Returns a string representation of an object.", "Boolean.toString": "Returns a string representation of an object.",
"Buffer.concat": "Return concatenation of current buffer and the given buffer",
"Buffer.fill": "Fill (a fragment) of the buffer with given value.", "Buffer.fill": "Fill (a fragment) of the buffer with given value.",
"Buffer.getNumber": "Read a number in specified format from the buffer.", "Buffer.getNumber": "Read a number in specified format from the buffer.",
"Buffer.getUint8": "Reads an unsigned byte at a particular location", "Buffer.getUint8": "Reads an unsigned byte at a particular location",
"Buffer.indexOf": "Return position of other buffer in current buffer",
"Buffer.length": "Returns the length of a Buffer object.", "Buffer.length": "Returns the length of a Buffer object.",
"Buffer.rotate": "Rotate buffer left in place.\n\n\n\nstart. eg: -1", "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|length": "number of elements in buffer. If negative, length is set as the buffer length minus",
@ -197,6 +199,7 @@
"String.substr|param|length": "number of characters to extract", "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", "String.substr|param|start": "first character index; can be negative from counting from the end, eg:0",
"String@type": "Combine, split, and search text strings.", "String@type": "Combine, split, and search text strings.",
"StringMap": "A dictionary from string key to string values",
"basic": "Provides access to basic micro:bit functionality.", "basic": "Provides access to basic micro:bit functionality.",
"basic.clearScreen": "Turn off all LEDs", "basic.clearScreen": "Turn off all LEDs",
"basic.forever": "Repeats the code forever in the background. On each iteration, allows other codes to run.", "basic.forever": "Repeats the code forever in the background. On each iteration, allows other codes to run.",
@ -546,6 +549,8 @@
"serial.setRxBufferSize|param|size": "length of the rx buffer in bytes, eg: 32", "serial.setRxBufferSize|param|size": "length of the rx buffer in bytes, eg: 32",
"serial.setTxBufferSize": "Sets the size of the TX buffer in bytes", "serial.setTxBufferSize": "Sets the size of the TX buffer in bytes",
"serial.setTxBufferSize|param|size": "length of the tx buffer in bytes, eg: 32", "serial.setTxBufferSize|param|size": "length of the tx buffer in bytes, eg: 32",
"serial.setWriteLinePadding": "Sets the padding length for lines sent with \"write line\".",
"serial.setWriteLinePadding|param|length": "the number of bytes alignment, eg: 0",
"serial.writeBuffer": "Send a buffer through serial connection", "serial.writeBuffer": "Send a buffer through serial connection",
"serial.writeLine": "Print a line of text to the serial port", "serial.writeLine": "Print a line of text to the serial port",
"serial.writeNumber": "Print a numeric value to the serial port", "serial.writeNumber": "Print a numeric value to the serial port",

View File

@ -232,8 +232,11 @@
"String.charAt|block": "char from %this=text|at %pos", "String.charAt|block": "char from %this=text|at %pos",
"String.compare|block": "compare %this=text| to %that", "String.compare|block": "compare %this=text| to %that",
"String.fromCharCode|block": "text from char code %code", "String.fromCharCode|block": "text from char code %code",
"String.includes|block": "%this=text|includes %searchValue",
"String.indexOf|block": "%this=text|find index of %searchValue",
"String.isEmpty|block": "%this=text| is empty", "String.isEmpty|block": "%this=text| is empty",
"String.length|block": "length of %VALUE", "String.length|block": "length of %VALUE",
"String.split|block": "split %this=text|at %separator",
"String.substr|block": "substring of %this=text|from %start|of length %length", "String.substr|block": "substring of %this=text|from %start|of length %length",
"String|block": "String", "String|block": "String",
"basic.clearScreen|block": "clear screen", "basic.clearScreen|block": "clear screen",
@ -367,6 +370,7 @@
"serial.redirect|block": "serial|redirect to|TX %tx|RX %rx|at baud rate %rate", "serial.redirect|block": "serial|redirect to|TX %tx|RX %rx|at baud rate %rate",
"serial.setRxBufferSize|block": "serial set rx buffer size to $size", "serial.setRxBufferSize|block": "serial set rx buffer size to $size",
"serial.setTxBufferSize|block": "serial set tx buffer size to $size", "serial.setTxBufferSize|block": "serial set tx buffer size to $size",
"serial.setWriteLinePadding|block": "serial set write line padding to $length",
"serial.writeBuffer|block": "serial|write buffer %buffer=serial_readbuffer", "serial.writeBuffer|block": "serial|write buffer %buffer=serial_readbuffer",
"serial.writeLine|block": "serial|write line %text", "serial.writeLine|block": "serial|write line %text",
"serial.writeNumbers|block": "serial|write numbers %values", "serial.writeNumbers|block": "serial|write numbers %values",

View File

@ -1,6 +1,6 @@
#include "pxt.h" #include "pxt.h"
PXT_VTABLE(RefMImage) PXT_VTABLE(RefMImage, ValType::Object)
RefMImage::RefMImage(ImageData *d) : PXT_VTABLE_INIT(RefMImage), img(d) { RefMImage::RefMImage(ImageData *d) : PXT_VTABLE_INIT(RefMImage), img(d) {
img->incr(); img->incr();

View File

@ -45,7 +45,7 @@
"@types/web-bluetooth": "0.0.4" "@types/web-bluetooth": "0.0.4"
}, },
"dependencies": { "dependencies": {
"pxt-common-packages": "6.9.4", "pxt-common-packages": "6.13.7",
"pxt-core": "5.15.12" "pxt-core": "5.18.13"
} }
} }

View File

@ -146,8 +146,9 @@ namespace pxsim.visuals {
let btng = <SVGGElement>svg.elt("g"); let btng = <SVGGElement>svg.elt("g");
let btn = svg.child(btng, "rect", { class: "sim-button-virtual", x: x, y: y, rx: corner, ry: corner, width: w, height: w}); let btn = svg.child(btng, "rect", { class: "sim-button-virtual", x: x, y: y, rx: corner, ry: corner, width: w, height: w});
let btnTxt = mkTxt(cx + txtXOff, cy + txtYOff, txtSize, 0, "A+B"); let btnTxt = mkTxt(cx + txtXOff, cy + txtYOff, txtSize, 0, "A+B");
svg.addClass(btnTxt, "sim-text")
svg.addClass(btnTxt, "sim-text-virtual"); U.addClass(btnTxt, "sim-text")
U.addClass(btnTxt, "sim-text-virtual");
btng.appendChild(btnTxt); btng.appendChild(btnTxt);
return btng; return btng;
@ -157,7 +158,7 @@ namespace pxsim.visuals {
this.abBtn.style.visibility = "hidden"; this.abBtn.style.visibility = "hidden";
let el = svg.elt("g"); let el = svg.elt("g");
svg.addClass(el, "sim-buttonpair") U.addClass(el, "sim-buttonpair")
el.appendChild(this.aBtn); el.appendChild(this.aBtn);
el.appendChild(this.bBtn); el.appendChild(this.bBtn);
el.appendChild(this.abBtn); el.appendChild(this.abBtn);

View File

@ -28,7 +28,7 @@ namespace pxsim {
this.data = data; this.data = data;
} }
public print() { public print() {
console.debug(`Image id:${this.id} refs:${this.refcnt} size:${this.width}x${Image.height}`) console.debug(`Image id:${this.id} size:${this.width}x${Image.height}`)
} }
public get(x: number, y: number): number { public get(x: number, y: number): number {
x = x >> 0; x = x >> 0;
@ -76,7 +76,6 @@ namespace pxsim {
export function createInternalImage(width: number): Image { export function createInternalImage(width: number): Image {
width = width >> 0; width = width >> 0;
let img = createImage(width) let img = createImage(width)
pxsim.runtime.unregisterLiveObject(img, true)
return img return img
} }

View File

@ -308,7 +308,7 @@ path.sim-board {
this.recordPinCoords(); this.recordPinCoords();
this.buildDom(); this.buildDom();
if (props && props.wireframe) if (props && props.wireframe)
svg.addClass(this.element, "sim-wireframe"); U.addClass(this.element, "sim-wireframe");
if (props && props.theme) if (props && props.theme)
this.updateTheme(); this.updateTheme();
@ -412,8 +412,8 @@ path.sim-board {
this.updateButtonAB(); this.updateButtonAB();
this.updateGestures(); this.updateGestures();
if (!runtime || runtime.dead) svg.addClass(this.element, "grayscale"); if (!runtime || runtime.dead) U.addClass(this.element, "grayscale");
else svg.removeClass(this.element, "grayscale"); else U.removeClass(this.element, "grayscale");
} }
private updateGestures() { private updateGestures() {
@ -970,7 +970,7 @@ path.sim-board {
let state = this.board; let state = this.board;
let pin = state.edgeConnectorState.pins[index]; let pin = state.edgeConnectorState.pins[index];
let svgpin = this.pins[index]; let svgpin = this.pins[index];
svg.addClass(svgpin, "touched"); U.addClass(svgpin, "touched");
if (pin.mode & PinFlags.Input) { if (pin.mode & PinFlags.Input) {
let cursor = svg.cursorPoint(pt, this.element, ev); let cursor = svg.cursorPoint(pt, this.element, ev);
let v = (400 - cursor.y) / 40 * 1023 let v = (400 - cursor.y) / 40 * 1023
@ -983,7 +983,7 @@ path.sim-board {
let state = this.board; let state = this.board;
let pin = state.edgeConnectorState.pins[index]; let pin = state.edgeConnectorState.pins[index];
let svgpin = this.pins[index]; let svgpin = this.pins[index];
svg.removeClass(svgpin, "touched"); U.removeClass(svgpin, "touched");
this.updatePin(pin, index); this.updatePin(pin, index);
return false; return false;
}, },

View File

@ -132,7 +132,7 @@ namespace pxsim.visuals {
} }
//show the canvas if it's hidden //show the canvas if it's hidden
svg.removeClass(this.background, "hidden"); U.removeClass(this.background, "hidden");
//resize if necessary //resize if necessary
let [first, last] = [this.pixels[0], this.pixels[this.pixels.length - 1]] let [first, last] = [this.pixels[0], this.pixels[this.pixels.length - 1]]