Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launch request that downloads specific files and folders to the EV3 on demand #93

Open
WizGeek opened this issue Feb 2, 2020 · 2 comments

Comments

@WizGeek
Copy link

WizGeek commented Feb 2, 2020

Problem: Downloading every file in the include/exclude patterns on every launch is time consuming.
Our robotics club uses a custom platform (22 .py files) that resides in a separate folder called platform/. Pressing F5 loads the platform/ folder every time even though none of those files changes often. This folder can be added to the "ev3devBrowser.download.exclude" configuration
setting, but there's no simple way for students to download this folder when something in it does change.

Solution Idea:
Provide a launch "request": "download" with new settings for "include":"{file-folder-specs}" and "hotkey":"Shift+F6" (or something else) that students can invoke to download the specified files and folders.

Alternative:
Issue #9 offers an alternative that is more flexible, but I'm hoping there's a simpler solution for "download on demand."

@WizGeek
Copy link
Author

WizGeek commented Apr 12, 2020

Possible Solution: If there's a way to temporarily affect the include and exclude configurations, then e.GO Digital's Power Tools can be used to create a "button" in the status bar to download a subset of folders/files to the EV3 brick.

Question 1: Is there a way via Javascript to temporarily--and safely--change the .include and .exclude configurations?
Question 2: Is there a way to pass into ev3devBrowser.action.download et al overrides for .include and .exclude upon which the download mechanism acts?

REFERENCED DOMAIN:

registerCommand('ev3devBrowser.action.download', ...)
 => downloadAll()
   => download(folder, device)
     Uses ev3devBrowser.download.include
	  and ev3devBrowser.download.exclude

POWER TOOLS ENABLEMENT (workspace: settings.json):

{
    "ego.power-tools": {
        "buttons": [
            {
                "text": "[stuff=>brick]",
                "color": "#00ffff",
                "tooltip": "Downloads 'stuff' to the EV3 brick.",
                "action": {
                    "type": "script",
                    "script": "download_stuff.js",
                }
            },
        ]
    }    
}

THEORETICAL POWER TOOLS BUTTON (download_stuff.js):

exports.execute = async (args) => {
    const vscode = args.require('vscode');
    // somehow affect the .include and .exclude configurations?
    await vscode.commands.executeCommand('ev3devBrowser.action.download');
}

@WizGeek WizGeek closed this as completed Apr 12, 2020
@WizGeek
Copy link
Author

WizGeek commented Apr 17, 2020

Reopened because somehow I inadvertently closed this issue. [Doh!]

@WizGeek WizGeek reopened this Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants