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

Creating Preview Mode For CLUE #303

Merged
merged 24 commits into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
845ad8e
first commit
vandyliu Apr 8, 2020
5f62cb5
refactored ispreviewmode function
vandyliu Apr 8, 2020
01a6728
Merge branch 'dev' into users/t-vali/clue-preview-mode
xnkevinnguyen Apr 8, 2020
9e9e52b
Merge branch 'dev' into users/t-vali/clue-preview-mode
vandyliu Apr 8, 2020
4d9ab3e
updated for getting started
vandyliu Apr 8, 2020
b45726e
updated frontend testfor getting started
vandyliu Apr 8, 2020
f6104b2
fixed test
vandyliu Apr 8, 2020
00a869c
Merge branch 'dev' into users/t-vali/clue-preview-mode
vandyliu Apr 8, 2020
5318ed6
fixed test
vandyliu Apr 8, 2020
b95dd02
Merge branch 'users/t-vali/clue-preview-mode' of https://github.com/m…
vandyliu Apr 8, 2020
e26ac7b
Updated keyboard pressing icons
vandyliu Apr 8, 2020
f853f34
Updated to use code for commands
vandyliu Apr 8, 2020
278d1fb
updated images
vandyliu Apr 8, 2020
cc5c1a5
Made SHIFT and CTRL lowercase
vandyliu Apr 8, 2020
699a393
Merge branch 'dev' into users/t-vali/clue-preview-mode
vandyliu Apr 9, 2020
21b8a38
Updated JEST tests
vandyliu Apr 9, 2020
a16b0cd
updated jest tests
vandyliu Apr 9, 2020
9b66345
fixed bug in test
vandyliu Apr 9, 2020
4ca1223
Merge branch 'dev' into users/t-vali/clue-preview-mode
andreamah Apr 9, 2020
7e6479d
Merge branch 'dev' into users/t-vali/clue-preview-mode
andreamah Apr 9, 2020
0c6b804
New way to format CLUE getting started
vandyliu Apr 9, 2020
537df12
Merge branch 'users/t-vali/clue-preview-mode' of https://github.com/m…
vandyliu Apr 9, 2020
d8e99ac
New CLUE photo that fits README better
vandyliu Apr 9, 2020
45ec0e4
Updated tests again
vandyliu Apr 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion locales/en/package.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"deviceSimulatorExpressExtension.configuration.title": "Device Simulator Express configuration",
"deviceSimulatorExpressExtension.configuration.properties.configEnvOnChange": "When you change the Python interpreter, the Device Simulator Express will automatically configure itself for the required dependencies.",
"deviceSimulatorExpressExtension.configuration.properties.debuggerPort": "The port the Server will listen on for communication with the debugger.",
"deviceSimulatorExpressExtension.configuration.properties.dependencyChecker": "Whether or not to ask if we can download dependencies. If unchecked, the extension will default to never download dependencies, except when automatically creating a virtual environment in the extension files."
"deviceSimulatorExpressExtension.configuration.properties.dependencyChecker": "Whether or not to ask if we can download dependencies. If unchecked, the extension will default to never download dependencies, except when automatically creating a virtual environment in the extension files.",
"deviceSimulatorExpressExtension.configuration.properties.previewMode": "Enable this to test out and play with the new Adafruit CLUE simulator!"
}
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@
"default": 5577,
"description": "%deviceSimulatorExpressExtension.configuration.properties.debuggerPort%",
"scope": "resource"
},
"deviceSimulatorExpress.previewMode": {
"type": "boolean",
"default": false,
"description": "%deviceSimulatorExpressExtension.configuration.properties.previewMode%",
"scope": "resource"
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"deviceSimulatorExpressExtension.configuration.title": "Device Simulator Express configuration",
"deviceSimulatorExpressExtension.configuration.properties.configEnvOnChange": "When you change the Python interpreter, the Device Simulator Express will automatically configure itself for the required dependencies.",
"deviceSimulatorExpressExtension.configuration.properties.debuggerPort": "The port the Server will listen on for communication with the debugger.",
"deviceSimulatorExpressExtension.configuration.properties.dependencyChecker": "Whether or not to ask for dependency downloads. If unchecked, the extension will default to never download dependencies, except when automatically creating a virtual environment in the extension files."
"deviceSimulatorExpressExtension.configuration.properties.dependencyChecker": "Whether or not to ask for dependency downloads. If unchecked, the extension will default to never download dependencies, except when automatically creating a virtual environment in the extension files.",
"deviceSimulatorExpressExtension.configuration.properties.previewMode": "Enable this to test out and play with the new Adafruit CLUE simulator!"
}
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const CONFIG = {
PYTHON_PATH: "python.pythonPath",
SHOW_DEPENDENCY_INSTALL: "deviceSimulatorExpress.showDependencyInstall",
SHOW_NEW_FILE_POPUP: "deviceSimulatorExpress.showNewFilePopup",
ENABLE_PREVIEW_MODE: "deviceSimulatorExpress.previewMode",
};

export const CONSTANTS = {
Expand Down
31 changes: 28 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,14 @@ export async function activate(context: vscode.ExtensionContext) {
const openSimulator: vscode.Disposable = vscode.commands.registerCommand(
"deviceSimulatorExpress.common.openSimulator",
async () => {
const isPreviewMode = getIsPreviewMode();

const chosen_device = await vscode.window.showQuickPick(
Object.values(CONSTANTS.DEVICE_NAME_FORMAL)
Object.values(CONSTANTS.DEVICE_NAME_FORMAL).filter(
device =>
isPreviewMode ||
device !== CONSTANTS.DEVICE_NAME_FORMAL.CLUE
)
);

if (!chosen_device) {
Expand Down Expand Up @@ -409,8 +415,14 @@ export async function activate(context: vscode.ExtensionContext) {
const newFile: vscode.Disposable = vscode.commands.registerCommand(
"deviceSimulatorExpress.common.newFile",
async () => {
const isPreviewMode = getIsPreviewMode();

const chosen_device = await vscode.window.showQuickPick(
Object.values(CONSTANTS.DEVICE_NAME_FORMAL)
Object.values(CONSTANTS.DEVICE_NAME_FORMAL).filter(
device =>
isPreviewMode ||
device !== CONSTANTS.DEVICE_NAME_FORMAL.CLUE
)
);

if (!chosen_device) {
Expand Down Expand Up @@ -763,8 +775,14 @@ export async function activate(context: vscode.ExtensionContext) {
const deployToDevice: vscode.Disposable = vscode.commands.registerCommand(
"deviceSimulatorExpress.common.deployToDevice",
async () => {
const isPreviewMode = getIsPreviewMode();

const chosen_device = await vscode.window.showQuickPick(
Object.values(CONSTANTS.DEVICE_NAME_FORMAL)
Object.values(CONSTANTS.DEVICE_NAME_FORMAL).filter(
device =>
isPreviewMode ||
device !== CONSTANTS.DEVICE_NAME_FORMAL.CLUE
)
);

if (!chosen_device) {
Expand Down Expand Up @@ -984,6 +1002,13 @@ export async function activate(context: vscode.ExtensionContext) {
}
);

const getIsPreviewMode = (): boolean => {
vandyliu marked this conversation as resolved.
Show resolved Hide resolved
const isPreviewMode: boolean = vscode.workspace
.getConfiguration()
.get(CONFIG.ENABLE_PREVIEW_MODE);
return isPreviewMode;
};

context.subscriptions.push(
installDependencies,
runSimulator,
Expand Down