Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
blocks:drivers:tools [2022-06-22 19:25] admin Added note on repeating "run build task" |
blocks:drivers:tools [2024-03-14 13:04] (current) mattias [Install the Scripts] |
||
---|---|---|---|
Line 2: | Line 2: | ||
This describes the recommended toolset for development. Other editors and IDEs may work as well (including [[blocks: | This describes the recommended toolset for development. Other editors and IDEs may work as well (including [[blocks: | ||
- | | + | :!: **NOTE**: The instructions below assume you have a working internet connection. |
- | * Install | + | ==== Install |
- | * Download | + | Install |
- | :!: If you already have some of the files or directories matching those obtained from github on your computer, you need to merge the files with the existing ones, replacing | + | ==== Install NodeJS and NPM ==== |
+ | |||
+ | Those programs are required for many script-related operations as well as in some cases to install typescript. | ||
+ | |||
+ | Follow the instructions here to install [[https:// | ||
+ | |||
+ | < | ||
+ | su pixi-admin | ||
+ | sudo apt install nodejs npm | ||
+ | exit | ||
+ | </ | ||
+ | |||
+ | ==== Install Typescript ==== | ||
+ | |||
+ | In a terminal window with administration privileges, now install typescript. On MacOS or Linux, run this command in a terminal window: | ||
+ | |||
+ | < | ||
+ | sudo npm install -g typescript | ||
+ | </ | ||
+ | |||
+ | :!: If you're using our Linux based server, logged in as the pixi-server user (indicated in the terminal window) | ||
+ | |||
+ | < | ||
+ | su pixi-admin | ||
+ | </ | ||
+ | |||
+ | Enter the password for the pixi-admin user. Then install typescript as described above. Finally, type exit to return to the pixi-server user (or just close the terminal window) | ||
+ | |||
+ | ==== Install the Scripts ==== | ||
+ | |||
+ | Download the [[https:// | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Decompress the zip file. | ||
+ | :!: Please make a security copy of the script directory before installing or updating this directory. The //script// directory is located inside PIXILAB-Blocks-root in your home directory. | ||
+ | Normally | ||
Once this is done, your PIXILAB-Blocks-root/ | Once this is done, your PIXILAB-Blocks-root/ | ||
Line 21: | Line 57: | ||
</ | </ | ||
- | The first three items shown above are directories, | + | The first three items shown above are directories, |
- | | + | :!: Please note that files made available to Blocks, which means files copied from the archive i.e drivers-archive to drivers is not updated automatically, |
- | * Open a new terminal in Visual Studio Code using Terminal > New Terminal. Install the TypeScript compiler by typing //npm install -g typescript// | + | |
+ | ==== Running VSCode for the First Time ==== | ||
+ | |||
+ | * Start Visual Studio Code. | ||
+ | | ||
+ | * Open a new terminal in Visual Studio Code using Terminal > New Terminal. | ||
* Install driver development dependencies by typing //npm install// in the terminal, followed by Enter. | * Install driver development dependencies by typing //npm install// in the terminal, followed by Enter. | ||
- | * Select Terminal > Run Build Task > //tsc: watch// to automatically compile TypeScript files as they are saved. **IMPORTANT: | + | * Select Terminal > Run Build Task > //tsc: watch// to automatically compile TypeScript files as they are saved. |
+ | |||
+ | **IMPORTANT: | ||
- | :!: On Windows | + | Under Windows, an error message similar to //" |
Once you have those pieces in place, restart your local Blocks server and open the Blocks Editor using your web browser. You should now find the drivers on the Driver menu of a TCP Device added on the Manage page. If you don't see the drivers listed there, they' | Once you have those pieces in place, restart your local Blocks server and open the Blocks Editor using your web browser. You should now find the drivers on the Driver menu of a TCP Device added on the Manage page. If you don't see the drivers listed there, they' | ||
Proceed with learning about [[blocks: | Proceed with learning about [[blocks: |