vscode-ev3dev-browser icon indicating copy to clipboard operation
vscode-ev3dev-browser copied to clipboard

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

Open WizGeek opened this issue 5 years ago • 2 comments
trafficstars

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 avatar Feb 02 '20 21:02 WizGeek

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 avatar Apr 12 '20 22:04 WizGeek

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

WizGeek avatar Apr 17 '20 19:04 WizGeek