vsTASKER 7 Tutorial
×
Menu
Index

Train Doors

 
Open train_doors database in data/db/qt.
 
In this sample, a train of 5 cars is defined. Simulation will only cover the door open/close logic.
Select the car A and visualize the attached logic like below.
 
Open and Close events are triggered from the Qt panel.
Check_Open and Check_Close are logic tasks that will initiate the opening or closing of all car doors.
Malfunctions can occur randomly. Watchs objects (wA, wB...) illuminate accordingly.
 
 
The viewer is defined to be Qt and the directory where Qt-Creator will generate the executable must be specified in the Build Directory field if vsTASKER is used to automatically recompile the Qt executable. This is not mandatory as Qt-Creator (or Visual-Studio) can also be used for this.
 
 
The .pro can be opened using Qt-Creator. It is located in /runtime/Qt/train_doors.
The project includes the vsTASKER generated files. Callbacks are attached to buttons (slots) to trigger the events.
 
From vsTASKER, you can generate the code.
From Qt-Creator, you can recompile and run the simulation.
 
At this point, the Qt simulation is standalone. As the shared-memory is created and used by the simulation engine, vsTASKER GUI will monitor the logic in real-time.
User can then play with the Qt panel to open/close doors or start/stop the train.