Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #361 from microsoft/dev
Browse files Browse the repository at this point in the history
Dev to staging for April 22 hotfix
  • Loading branch information
xnkevinnguyen authored Apr 22, 2020
2 parents 242acdb + 1b8a7dd commit ec7be55
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 130 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ The following dependencies are required to install before launching Device Simul
You will be prompted to install the Python dependencies during the first use.

- _**[Visual Studio Code](https://code.visualstudio.com/)**_
- _**[Node](https://nodejs.org/en/download/)**_
- _**[Python 3.7+](https://www.python.org/downloads/)**_: Make sure you've added Python and pip to your PATH in your environment variables. (1)
- _**[Python VS Code extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)**_: This will be installed automatically from the marketplace when you install Device Simulator Express.

Expand Down
2 changes: 1 addition & 1 deletion src/base_circuitpython/displayio/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from PIL import Image
import adafruit_display_text

from .tile_grid import TileGrid
from displayio.tile_grid import TileGrid
from . import constants as CONSTANTS

import common
Expand Down
8 changes: 4 additions & 4 deletions src/base_circuitpython/displayio/test/test_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

from common import utils

from ..tile_grid import TileGrid
from ..group import Group
from ..palette import Palette
from ..bitmap import Bitmap
from displayio.tile_grid import TileGrid
from displayio.group import Group
from displayio.palette import Palette
from displayio.bitmap import Bitmap
from .. import constants as CONSTANTS
from PIL import Image

Expand Down
6 changes: 3 additions & 3 deletions src/debug_user_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
# Insert absolute path to Circuitpython libraries for CLUE into sys.path
sys.path.insert(0, os.path.join(abs_path_to_parent_dir, CONSTANTS.CIRCUITPYTHON))

# get board so we can get terminal handle
import board

# This import must happen after the sys.path is modified
from common import debugger_communication_client

# get board so we can get terminal handle
import board

# get handle to terminal for clue
curr_terminal = board.DISPLAY.terminal

Expand Down
19 changes: 12 additions & 7 deletions src/debuggerCommunicationServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as http from "http";
import * as socketio from "socket.io";
import { WebviewPanel } from "vscode";
import { SERVER_INFO } from "./constants";
import { DeviceSelectionService } from "./service/deviceSelectionService";

export const DEBUGGER_MESSAGES = {
EMITTER: {
Expand All @@ -24,14 +25,14 @@ export class DebuggerCommunicationServer {
private serverHttp: http.Server;
private serverIo: socketio.Server;
private simulatorWebview: WebviewPanel | undefined;
private currentActiveDevice;
private deviceSelectionService: DeviceSelectionService;
private isPendingResponse = false;
private pendingCallbacks: Function[] = [];

constructor(
webviewPanel: WebviewPanel | undefined,
port = SERVER_INFO.DEFAULT_SERVER_PORT,
currentActiveDevice: string
deviceSelectionService: DeviceSelectionService
) {
this.port = port;
this.serverHttp = new http.Server();
Expand All @@ -42,7 +43,7 @@ export class DebuggerCommunicationServer {
this.initEventsHandlers();
console.info(`Server running on port ${this.port}`);

this.currentActiveDevice = currentActiveDevice;
this.deviceSelectionService = deviceSelectionService;
}

// send the message to start closing the connection
Expand Down Expand Up @@ -119,12 +120,16 @@ export class DebuggerCommunicationServer {
try {
const messageToWebview = JSON.parse(data);
if (messageToWebview.type === "state") {
console.log(`State recieved: ${messageToWebview.data}`);
if (this.simulatorWebview) {
const messageState = JSON.parse(messageToWebview.data);
if (
this.simulatorWebview &&
messageState.device_name ===
this.deviceSelectionService.getCurrentActiveDevice()
) {
this.simulatorWebview.webview.postMessage({
active_device: this.currentActiveDevice,
active_device: this.deviceSelectionService.getCurrentActiveDevice(),
command: "set-state",
state: JSON.parse(messageToWebview.data),
state: messageState,
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ export async function activate(context: vscode.ExtensionContext) {
new DebuggerCommunicationServer(
currentPanel,
utils.getServerPortConfig(),
deviceSelectionService.getCurrentActiveDevice()
deviceSelectionService
)
);

Expand Down
3 changes: 1 addition & 2 deletions src/latest_release_note.ts

Large diffs are not rendered by default.

21 changes: 0 additions & 21 deletions src/view/components/clue/__snapshots__/Clue.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1248,9 +1248,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Push Button
</title>
<desc>
Created with Sketch.
</desc>
Expand Down Expand Up @@ -1315,9 +1312,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
neon_pixel
</title>
<desc>
Created with Sketch.
</desc>
Expand Down Expand Up @@ -1418,9 +1412,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Temperature Sensor
</title>
<g
fill="none"
fill-rule="evenodd"
Expand Down Expand Up @@ -1486,9 +1477,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Light sensor
</title>
<g
fill="none"
fill-rule="evenodd"
Expand Down Expand Up @@ -2053,9 +2041,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
GPIO
</title>
<desc>
Created with Sketch.
</desc>
Expand Down Expand Up @@ -2109,9 +2094,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Sound Sensor
</title>
<desc>
Created with Sketch.
</desc>
Expand Down Expand Up @@ -2185,9 +2167,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Speaker
</title>
<desc>
Created with Sketch.
</desc>
Expand Down
30 changes: 0 additions & 30 deletions src/view/components/cpx/__snapshots__/Cpx.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3968,9 +3968,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Switch
</title>
<desc>
Created with Sketch.
</desc>
Expand Down Expand Up @@ -4035,9 +4032,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Push Button
</title>
<desc>
Created with Sketch.
</desc>
Expand Down Expand Up @@ -4102,9 +4096,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Red LED
</title>
<desc>
Created with Sketch.
</desc>
Expand Down Expand Up @@ -4167,9 +4158,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Sound Sensor
</title>
<desc>
Created with Sketch.
</desc>
Expand Down Expand Up @@ -4243,9 +4231,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Temperature Sensor
</title>
<g
fill="none"
fill-rule="evenodd"
Expand Down Expand Up @@ -4311,9 +4296,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Light sensor
</title>
<g
fill="none"
fill-rule="evenodd"
Expand Down Expand Up @@ -4377,9 +4359,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
neon_pixel
</title>
<desc>
Created with Sketch.
</desc>
Expand Down Expand Up @@ -4480,9 +4459,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Speaker
</title>
<desc>
Created with Sketch.
</desc>
Expand Down Expand Up @@ -4602,9 +4578,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
IR
</title>
<desc>
Created with Sketch.
</desc>
Expand Down Expand Up @@ -4662,9 +4635,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
GPIO
</title>
<desc>
Created with Sketch.
</desc>
Expand Down
21 changes: 0 additions & 21 deletions src/view/components/microbit/__snapshots__/Microbit.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2669,9 +2669,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Push Button
</title>
<desc>
Created with Sketch.
</desc>
Expand Down Expand Up @@ -2736,9 +2733,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Red LED
</title>
<desc>
Created with Sketch.
</desc>
Expand Down Expand Up @@ -2801,9 +2795,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Temperature Sensor
</title>
<g
fill="none"
fill-rule="evenodd"
Expand Down Expand Up @@ -2869,9 +2860,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Light sensor
</title>
<g
fill="none"
fill-rule="evenodd"
Expand Down Expand Up @@ -3065,9 +3053,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
GPIO
</title>
<desc>
Created with Sketch.
</desc>
Expand Down Expand Up @@ -3164,9 +3149,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Speaker
</title>
<desc>
Created with Sketch.
</desc>
Expand Down Expand Up @@ -3224,9 +3206,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Bluetooth and Radio
</title>
<g
className="button-icon"
fill="none"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ exports[`Toolbar component should render correctly 1`] = `
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<title>
Light sensor
</title>
<g
fill="none"
fill-rule="evenodd"
Expand Down
2 changes: 1 addition & 1 deletion src/view/components/toolbar/clue/ClueSensorProperties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const CLUE_SLIDER_B: ISliderProps = {
const CLUE_SLIDER_C: ISliderProps = {
axisLabel: "C",
maxLabel: "Max",
maxValue: 255,
maxValue: 65535,
minLabel: "Min",
minValue: 0,
type: SENSOR_LIST.LIGHT_C,
Expand Down
Loading

0 comments on commit ec7be55

Please sign in to comment.