TRIK Studio can be integrated with the external Sublime Text programming environment.
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.
Read about how to integrate Sublime with TRIK Studio in the articles:
This article discusses the possibility of simultaneous loading of programs on a group of robots using the external text editor Sublime Text. 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 Sublime Text 3 (Build 3211). You can download Sublime Text from the official website.
Before starting the program for the first time, you should log in to the TRIK controller via WinSCP. Instructions on how to do this are available here. After that WinSCP will remember that it was allowed to establish a connection with this robot and will not require confirmation. This step must be repeated each time a new controller is connected.
1. Start Sublime Text.
2. Choose Tools → Build System → New Build System
3. A window with a text file will open. In it, you need to erase everything and insert the following code instead:
Where:
<path to scripts dir>
— the full path to the folder with the programs to be loaded onto the robots,
<file with ip addresses>
— the name of the.txt
file that contains the IP addresses of the robots to upload the files.
There must be one IP address per line. The file must be in the same folder as the programs to be uploaded.
4. Specify your path to the send_files.cmd
file instead of the one specified in the code.
Exapmple:
5. Save the file in the suggested directory <system directory>\Sublime Text 3\Packages\User
under the nameTRIK_SEND.sublime-build
.
6. ChooseTools → Build System
and then in the list opened chooseTRIK_send
.
7. To start sending programs to robots, just click Tools → Build
or the corresponding key combination Ctrl+B
. In order to return to start the 2D model, select Tools → Build System
and select TRIK
in the list that opens.
This article discusses setting up and using the Sublime Text 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 the .xml
format (more details in the article "2D model tuning"), and in the.qrs
format.
Download run_2d_model.cmd file 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 instruction was tested on Sublime Text 3 (Build 3211). You can download Sublime Text on the official website.
1. Open Sublime Text.
2. ChooseTools → Build System → New Build System
.
3. A window with a text file will open. You need to erase everything in it and paste the following code instead, where <path to field dir>
is the full path to the folder with the fields:
4. Edit this file:
For Linux, substitute your path to the run_2d_model.sh
file instead of the one specified in the code. For example:
"cmd": ["/home/admin/TRIKStudio/run_2d_model.sh", “/home/admin/fields/”, "$file"]
For Windows, substitute your path to the run_2d_model.cmd
file instead of the one specified in the code. For example:
"cmd": ["D:\TRIKStudio\run_2d_model.cmd", "D:\Users\Admin\fields", "$file"]
5. Save this text file in the suggested directory <system folder>\Sublime Text 3\Packages\User
under the name TRIK.sublime-build
.
6. Open your source code in Sublime Text. To launch it, just click Tools → Build
or the corresponding key combination (Ctrl + B).
For the proposal to add this functionality, the TRIK project team thanks Alexander Zhuravlev, the participant of the NTI IRS Olympiad 2018-2020.