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

Commit ec7be55

Browse files
Merge pull request #361 from microsoft/dev
Dev to staging for April 22 hotfix
2 parents 242acdb + 1b8a7dd commit ec7be55

File tree

15 files changed

+25
-130
lines changed

15 files changed

+25
-130
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ The following dependencies are required to install before launching Device Simul
6161
You will be prompted to install the Python dependencies during the first use.
6262

6363
- _**[Visual Studio Code](https://code.visualstudio.com/)**_
64-
- _**[Node](https://nodejs.org/en/download/)**_
6564
- _**[Python 3.7+](https://www.python.org/downloads/)**_: Make sure you've added Python and pip to your PATH in your environment variables. (1)
6665
- _**[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.
6766

src/base_circuitpython/displayio/group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from PIL import Image
44
import adafruit_display_text
55

6-
from .tile_grid import TileGrid
6+
from displayio.tile_grid import TileGrid
77
from . import constants as CONSTANTS
88

99
import common

src/base_circuitpython/displayio/test/test_group.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
from common import utils
99

10-
from ..tile_grid import TileGrid
11-
from ..group import Group
12-
from ..palette import Palette
13-
from ..bitmap import Bitmap
10+
from displayio.tile_grid import TileGrid
11+
from displayio.group import Group
12+
from displayio.palette import Palette
13+
from displayio.bitmap import Bitmap
1414
from .. import constants as CONSTANTS
1515
from PIL import Image
1616

src/debug_user_code.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
# Insert absolute path to Circuitpython libraries for CLUE into sys.path
3333
sys.path.insert(0, os.path.join(abs_path_to_parent_dir, CONSTANTS.CIRCUITPYTHON))
3434

35-
# get board so we can get terminal handle
36-
import board
37-
3835
# This import must happen after the sys.path is modified
3936
from common import debugger_communication_client
4037

38+
# get board so we can get terminal handle
39+
import board
40+
4141
# get handle to terminal for clue
4242
curr_terminal = board.DISPLAY.terminal
4343

src/debuggerCommunicationServer.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as http from "http";
55
import * as socketio from "socket.io";
66
import { WebviewPanel } from "vscode";
77
import { SERVER_INFO } from "./constants";
8+
import { DeviceSelectionService } from "./service/deviceSelectionService";
89

910
export const DEBUGGER_MESSAGES = {
1011
EMITTER: {
@@ -24,14 +25,14 @@ export class DebuggerCommunicationServer {
2425
private serverHttp: http.Server;
2526
private serverIo: socketio.Server;
2627
private simulatorWebview: WebviewPanel | undefined;
27-
private currentActiveDevice;
28+
private deviceSelectionService: DeviceSelectionService;
2829
private isPendingResponse = false;
2930
private pendingCallbacks: Function[] = [];
3031

3132
constructor(
3233
webviewPanel: WebviewPanel | undefined,
3334
port = SERVER_INFO.DEFAULT_SERVER_PORT,
34-
currentActiveDevice: string
35+
deviceSelectionService: DeviceSelectionService
3536
) {
3637
this.port = port;
3738
this.serverHttp = new http.Server();
@@ -42,7 +43,7 @@ export class DebuggerCommunicationServer {
4243
this.initEventsHandlers();
4344
console.info(`Server running on port ${this.port}`);
4445

45-
this.currentActiveDevice = currentActiveDevice;
46+
this.deviceSelectionService = deviceSelectionService;
4647
}
4748

4849
// send the message to start closing the connection
@@ -119,12 +120,16 @@ export class DebuggerCommunicationServer {
119120
try {
120121
const messageToWebview = JSON.parse(data);
121122
if (messageToWebview.type === "state") {
122-
console.log(`State recieved: ${messageToWebview.data}`);
123-
if (this.simulatorWebview) {
123+
const messageState = JSON.parse(messageToWebview.data);
124+
if (
125+
this.simulatorWebview &&
126+
messageState.device_name ===
127+
this.deviceSelectionService.getCurrentActiveDevice()
128+
) {
124129
this.simulatorWebview.webview.postMessage({
125-
active_device: this.currentActiveDevice,
130+
active_device: this.deviceSelectionService.getCurrentActiveDevice(),
126131
command: "set-state",
127-
state: JSON.parse(messageToWebview.data),
132+
state: messageState,
128133
});
129134
}
130135
}

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ export async function activate(context: vscode.ExtensionContext) {
947947
new DebuggerCommunicationServer(
948948
currentPanel,
949949
utils.getServerPortConfig(),
950-
deviceSelectionService.getCurrentActiveDevice()
950+
deviceSelectionService
951951
)
952952
);
953953

src/latest_release_note.ts

Lines changed: 1 addition & 2 deletions
Large diffs are not rendered by default.

src/view/components/clue/__snapshots__/Clue.spec.tsx.snap

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,9 +1248,6 @@ Array [
12481248
xmlns="http://www.w3.org/2000/svg"
12491249
xmlnsXlink="http://www.w3.org/1999/xlink"
12501250
>
1251-
<title>
1252-
Push Button
1253-
</title>
12541251
<desc>
12551252
Created with Sketch.
12561253
</desc>
@@ -1315,9 +1312,6 @@ Array [
13151312
xmlns="http://www.w3.org/2000/svg"
13161313
xmlnsXlink="http://www.w3.org/1999/xlink"
13171314
>
1318-
<title>
1319-
neon_pixel
1320-
</title>
13211315
<desc>
13221316
Created with Sketch.
13231317
</desc>
@@ -1418,9 +1412,6 @@ Array [
14181412
xmlns="http://www.w3.org/2000/svg"
14191413
xmlnsXlink="http://www.w3.org/1999/xlink"
14201414
>
1421-
<title>
1422-
Temperature Sensor
1423-
</title>
14241415
<g
14251416
fill="none"
14261417
fill-rule="evenodd"
@@ -1486,9 +1477,6 @@ Array [
14861477
xmlns="http://www.w3.org/2000/svg"
14871478
xmlnsXlink="http://www.w3.org/1999/xlink"
14881479
>
1489-
<title>
1490-
Light sensor
1491-
</title>
14921480
<g
14931481
fill="none"
14941482
fill-rule="evenodd"
@@ -2053,9 +2041,6 @@ Array [
20532041
xmlns="http://www.w3.org/2000/svg"
20542042
xmlnsXlink="http://www.w3.org/1999/xlink"
20552043
>
2056-
<title>
2057-
GPIO
2058-
</title>
20592044
<desc>
20602045
Created with Sketch.
20612046
</desc>
@@ -2109,9 +2094,6 @@ Array [
21092094
xmlns="http://www.w3.org/2000/svg"
21102095
xmlnsXlink="http://www.w3.org/1999/xlink"
21112096
>
2112-
<title>
2113-
Sound Sensor
2114-
</title>
21152097
<desc>
21162098
Created with Sketch.
21172099
</desc>
@@ -2185,9 +2167,6 @@ Array [
21852167
xmlns="http://www.w3.org/2000/svg"
21862168
xmlnsXlink="http://www.w3.org/1999/xlink"
21872169
>
2188-
<title>
2189-
Speaker
2190-
</title>
21912170
<desc>
21922171
Created with Sketch.
21932172
</desc>

src/view/components/cpx/__snapshots__/Cpx.spec.tsx.snap

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3968,9 +3968,6 @@ Array [
39683968
xmlns="http://www.w3.org/2000/svg"
39693969
xmlnsXlink="http://www.w3.org/1999/xlink"
39703970
>
3971-
<title>
3972-
Switch
3973-
</title>
39743971
<desc>
39753972
Created with Sketch.
39763973
</desc>
@@ -4035,9 +4032,6 @@ Array [
40354032
xmlns="http://www.w3.org/2000/svg"
40364033
xmlnsXlink="http://www.w3.org/1999/xlink"
40374034
>
4038-
<title>
4039-
Push Button
4040-
</title>
40414035
<desc>
40424036
Created with Sketch.
40434037
</desc>
@@ -4102,9 +4096,6 @@ Array [
41024096
xmlns="http://www.w3.org/2000/svg"
41034097
xmlnsXlink="http://www.w3.org/1999/xlink"
41044098
>
4105-
<title>
4106-
Red LED
4107-
</title>
41084099
<desc>
41094100
Created with Sketch.
41104101
</desc>
@@ -4167,9 +4158,6 @@ Array [
41674158
xmlns="http://www.w3.org/2000/svg"
41684159
xmlnsXlink="http://www.w3.org/1999/xlink"
41694160
>
4170-
<title>
4171-
Sound Sensor
4172-
</title>
41734161
<desc>
41744162
Created with Sketch.
41754163
</desc>
@@ -4243,9 +4231,6 @@ Array [
42434231
xmlns="http://www.w3.org/2000/svg"
42444232
xmlnsXlink="http://www.w3.org/1999/xlink"
42454233
>
4246-
<title>
4247-
Temperature Sensor
4248-
</title>
42494234
<g
42504235
fill="none"
42514236
fill-rule="evenodd"
@@ -4311,9 +4296,6 @@ Array [
43114296
xmlns="http://www.w3.org/2000/svg"
43124297
xmlnsXlink="http://www.w3.org/1999/xlink"
43134298
>
4314-
<title>
4315-
Light sensor
4316-
</title>
43174299
<g
43184300
fill="none"
43194301
fill-rule="evenodd"
@@ -4377,9 +4359,6 @@ Array [
43774359
xmlns="http://www.w3.org/2000/svg"
43784360
xmlnsXlink="http://www.w3.org/1999/xlink"
43794361
>
4380-
<title>
4381-
neon_pixel
4382-
</title>
43834362
<desc>
43844363
Created with Sketch.
43854364
</desc>
@@ -4480,9 +4459,6 @@ Array [
44804459
xmlns="http://www.w3.org/2000/svg"
44814460
xmlnsXlink="http://www.w3.org/1999/xlink"
44824461
>
4483-
<title>
4484-
Speaker
4485-
</title>
44864462
<desc>
44874463
Created with Sketch.
44884464
</desc>
@@ -4602,9 +4578,6 @@ Array [
46024578
xmlns="http://www.w3.org/2000/svg"
46034579
xmlnsXlink="http://www.w3.org/1999/xlink"
46044580
>
4605-
<title>
4606-
IR
4607-
</title>
46084581
<desc>
46094582
Created with Sketch.
46104583
</desc>
@@ -4662,9 +4635,6 @@ Array [
46624635
xmlns="http://www.w3.org/2000/svg"
46634636
xmlnsXlink="http://www.w3.org/1999/xlink"
46644637
>
4665-
<title>
4666-
GPIO
4667-
</title>
46684638
<desc>
46694639
Created with Sketch.
46704640
</desc>

src/view/components/microbit/__snapshots__/Microbit.spec.tsx.snap

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2669,9 +2669,6 @@ Array [
26692669
xmlns="http://www.w3.org/2000/svg"
26702670
xmlnsXlink="http://www.w3.org/1999/xlink"
26712671
>
2672-
<title>
2673-
Push Button
2674-
</title>
26752672
<desc>
26762673
Created with Sketch.
26772674
</desc>
@@ -2736,9 +2733,6 @@ Array [
27362733
xmlns="http://www.w3.org/2000/svg"
27372734
xmlnsXlink="http://www.w3.org/1999/xlink"
27382735
>
2739-
<title>
2740-
Red LED
2741-
</title>
27422736
<desc>
27432737
Created with Sketch.
27442738
</desc>
@@ -2801,9 +2795,6 @@ Array [
28012795
xmlns="http://www.w3.org/2000/svg"
28022796
xmlnsXlink="http://www.w3.org/1999/xlink"
28032797
>
2804-
<title>
2805-
Temperature Sensor
2806-
</title>
28072798
<g
28082799
fill="none"
28092800
fill-rule="evenodd"
@@ -2869,9 +2860,6 @@ Array [
28692860
xmlns="http://www.w3.org/2000/svg"
28702861
xmlnsXlink="http://www.w3.org/1999/xlink"
28712862
>
2872-
<title>
2873-
Light sensor
2874-
</title>
28752863
<g
28762864
fill="none"
28772865
fill-rule="evenodd"
@@ -3065,9 +3053,6 @@ Array [
30653053
xmlns="http://www.w3.org/2000/svg"
30663054
xmlnsXlink="http://www.w3.org/1999/xlink"
30673055
>
3068-
<title>
3069-
GPIO
3070-
</title>
30713056
<desc>
30723057
Created with Sketch.
30733058
</desc>
@@ -3164,9 +3149,6 @@ Array [
31643149
xmlns="http://www.w3.org/2000/svg"
31653150
xmlnsXlink="http://www.w3.org/1999/xlink"
31663151
>
3167-
<title>
3168-
Speaker
3169-
</title>
31703152
<desc>
31713153
Created with Sketch.
31723154
</desc>
@@ -3224,9 +3206,6 @@ Array [
32243206
xmlns="http://www.w3.org/2000/svg"
32253207
xmlnsXlink="http://www.w3.org/1999/xlink"
32263208
>
3227-
<title>
3228-
Bluetooth and Radio
3229-
</title>
32303209
<g
32313210
className="button-icon"
32323211
fill="none"

0 commit comments

Comments
 (0)