update to pxt 5 and pxt-common-packages 6 (#934)

* bump pxt

* fix build issues

* Auto-gen of projects/summary

* removing feild editors moved to pxt

* various typing fixes

* more typing fixes

* fixing various typing issues

* Start on integration of new pxt

* serial number fixes

* gc-ify MMap object

* Re-build generated files

* fix console listeners

* clear lf() warnings

* More generated files

* also auto-generated

* Compilation fixes

* fix merge

* mostly fixing blocks

* fix sim

* fix field motors

* enable a few features

* moving to tsx

* try to fix edtiro compilation

* more defs

* removing commands

* removing extra $

* fix blockly warning

* hiding images

* enabling more pxt features

* hide images

* setup autorun

* add lock on target_reset

* update deps

* return trylock result

* updated pxt

* rename video section

* add alpha channel

* upgraded pxt

* bump pxt/version

* removed alpha ref

* var ceanup

* don't do major bump
This commit is contained in:
Michał Moskal
2019-10-08 21:57:55 -07:00
committed by Peli de Halleux
parent ba94322d4c
commit c5cec3a6ba
44 changed files with 1147 additions and 1221 deletions

View File

@ -5,6 +5,7 @@
namespace pxsim {
export class EV3Board extends CoreBoard {
viewHost: visuals.BoardHost;
view: SVGSVGElement;
outputState: EV3OutputState;
@ -83,7 +84,8 @@ namespace pxsim {
highContrast: msg.highContrast,
light: msg.light
};
const viewHost = new visuals.BoardHost(pxsim.visuals.mkBoardView({
this.viewHost = new visuals.BoardHost(pxsim.visuals.mkBoardView({
boardDef,
visual: boardDef.visual,
highContrast: msg.highContrast,
light: msg.light
@ -91,7 +93,7 @@ namespace pxsim {
document.body.innerHTML = ""; // clear children
document.body.className = msg.light ? "light" : "";
document.body.appendChild(this.view = viewHost.getView() as SVGSVGElement);
document.body.appendChild(this.view = this.viewHost.getView() as SVGSVGElement);
this.inputNodes = [];
this.outputNodes = [];
@ -102,8 +104,8 @@ namespace pxsim {
return Promise.resolve();
}
screenshot(): string {
return svg.toDataUri(new XMLSerializer().serializeToString(this.view));
screenshotAsync(width?: number): Promise<ImageData> {
return this.viewHost.screenshotAsync(width);
}
getBrickNode() {

View File

@ -1,7 +1,7 @@
namespace pxsim.music {
export function fromWAV(buf: RefBuffer) {
return incr(buf)
return buf
}
export function stopAllSounds() {
@ -13,7 +13,7 @@ namespace pxsim.SoundMethods {
let audio: HTMLAudioElement;
export function buffer(buf: RefBuffer) {
return incr(buf)
return buf
}
export function play(buf: RefBuffer) {

View File

@ -176,7 +176,7 @@ namespace pxsim.visuals {
const dalBoard = board();
dalBoard.updateSubscribers.push(() => this.updateState());
if (props && props.wireframe)
svg.addClass(this.element, "sim-wireframe");
U.addClass(this.element, "sim-wireframe");
if (props && props.theme)
this.updateTheme();

View File

@ -24,7 +24,7 @@ namespace pxsim.visuals {
protected buildDomCore() {
// Setup buttons
this.buttons = this.btnids.map(n => this.content.getElementById(this.normalizeId(n)) as SVGElement);
this.buttons.forEach(b => svg.addClass(b, "sim-button"));
this.buttons.forEach(b => U.addClass(b, "sim-button"));
this.light = this.content.getElementById(this.normalizeId(BrickView.EV3_LIGHT_ID)) as SVGElement;
}