TRIK Studio can be integrated with the external VSCode programming environment.
This will allow experienced TRIK Studio users to use all the features of professional text editors and their plugins:
static analyzers,
autoformatter,
color themes.
Read about how to integrate VSCode with TRIK Studio in the next articles:
This article discusses the possibility of simultaneous uploading of programs on a group of robots using an external text editor VSCode. The article is a continuation of the next material
Download the send_files.cmd file for Windows and place it in the folder where TRIK Studio is installed.
The manual was tested on the January 2020 release (version 1.42). You can download VSCode from the official website.
The first time the program is launched, confirmation from the user is required to establish a connection with the robot.
To allow the connection, enter Y
or Yes
at the command line.
1. Open the folder with the files you want to send in VSCode using File → Open Folder
.
2. SelectTerminal → Configure Tasks
.
3. If there were no tasks before, then select Create tasks.json file from template → Others
from the drop-down menu. The tasks.json
file will be opened. If tasks were created earlier, it will be opened right after step 2.
4. Remove everything from this file and paste this code:
Where:
<path to scripts dir>
is the full path to the folder with programs that must be uploaded on robots,
<file with ip addresses>
is the name of the .txt
file that contains the ip-addresses of robots for downloading files. One ip-address per line.
5. In the line corresponding to the "windows": {"command"
field specify the path to the send_files.cmd
file. The file with the IP addresses of the robots must be in the same folder as the programs to be sent. For example:
6. Save the file tasks.json
.
7. Now select Send files
in the dropdown menu Terminal → Run Task
or press the corresponding keyboard shortcut (Ctrl+Shift+B) to upload programs to the robots.
This article discusses setting up and using the VSCode external programming environment to call programs in the TRIK Studio 2D model.
This will allow experienced TRIK Studio users to use all the features of professional text editors and their plugins: static analyzers, auto formatters, color themes.
It also describes how to automatically run the program on several fields, which can be useful for participants in competitions with automated verification systems.
It is assumed that the user is writing a program in an external editor and would like to run this program on one or more fields. Fields can be presented both in .xml
format (for more details, see the article "2D model tuning"), and in .qrs
format.
Download run_2d_model.cmd for Windows or run_2d_model.sh for Linux and place it in the folder where TRIK Studio is installed.
Place the fields on which you want to test the program in a separate folder. If the fields are in .xml
format, create an empty default.qrs
project in this folder.
The manual was tested on the January 2020 release (version 1.42). You can download VSCode from the official website.
1. Create a folder where the source code file will be placed.
2. Open this folder in VSCode with File → Open Folder
.
3. ChooseTerminal → Configure Tasks
.
4. If there were no tasks before, then selectCreate tasks.json file from template → Others
in the drop-down menu . The file tasks.json
will be opened. If tasks were created earlier, it will open right after point 3.
5. Delete everything from this file and paste this code, where <path to field dir>
is the full path to the folder containing fields:
6. Depending on your operating system, edit the filetasks.json
:
For Linux, in the line corresponding to the "command"
field, specify the path to the edited run_2d_model.sh
and specify your source code file as the third argument. This file should be located in the folder that we opened with VSCode. Example: "command": "/home/admin/TRIKStudio/run_2d_model.sh /home/admin/fields/ script.js"
For Windows, in the line corresponding to the
"windows": { "command"
field, specify the path to the edited run_2d_model.sh
and specify your source code file as the third argument. This file should be located in the folder that we opened with VSCode. Example:
"command": "D:\TRIKStudio\run_2d_model.cmd D:\Users\Admin\fields script.js"
7. Save the filetasks.json
.
8. Now select Run TRIK 2D model
in the dropdown menu Terminal → Run Task
or press the corresponding keyboard shortcut (Ctrl+Shift+B) to run your code.
For the proposal to add this functionality, the TRIK project team thanks Alexander Zhuravlev, the participant of the NTI IRS Olympiad 2018-2020.