gui-multi-en
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | gui-multi-en [2018/11/12 08:56] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======Multiple Rocviews====== | ||
+ | |||
+ | {{ rocrail-logo-32.png}} | ||
+ | [[english|Content]] -> [[english# | ||
+ | * [[rocgui-config-en|Configuration]] | [[loc-tab-en|Locomotives Tab]] | [[gui-accel-en|Accelerators]] | [[gui-cs-status-en|Status Lights]] | **Multiple Rocviews** | [[gui-reports-en|Reports]] | ||
+ | // \\ // \\ | ||
+ | //Activate multiple Rocviews for a better overview.// | ||
+ | |||
+ | |||
+ | |||
+ | \\ | ||
+ | |||
+ | =====Windows===== | ||
+ | In Rocrail larger layouts or single modules can be arranged on different layers to gain a better overview. Doing so, however, it is necessary to switch between the layers frequently in order to see what is happening on a particular part of the layout. | ||
+ | Rocrail' | ||
+ | This chapter explains how to set up multiple instances of Rocview step-by-step. | ||
+ | |||
+ | In this example it is shown how the following four freely arrangeable windows are configured: | ||
+ | |||
+ | * Window 1: Locomotive table | ||
+ | * Window 2: Modul 1 (Buchrain) | ||
+ | * Window 3: Modul 2 (Grabtief) | ||
+ | * Window 4: Switch panel (miscellaneous outputs to switch light, etc.) | ||
+ | |||
+ | Only one computer is used in this example but because of Rocrail' | ||
+ | |||
+ | ====Step 1: Creating the ini files==== | ||
+ | Because each window gets a different layout each window requires its own .ini-file. For this reason the existing rocview.ini is copied four times into the working directory of Rocview and renamed accordingly. In the above example the result is: | ||
+ | |||
+ | * rocview_locos.ini | ||
+ | * rocview_buchrain.ini | ||
+ | * rocview_grabtief.ini | ||
+ | * rocview_panel.ini | ||
+ | |||
+ | :!: Make sure the __**[[: | ||
+ | |||
+ | ====Step 2: Setting up the windows==== | ||
+ | In this step the copied .ini-files are customised to the particular demands. To do this a command line window (DOS-Box or terminal) is opened and Rocview is started using the particular ini-file: | ||
+ | < | ||
+ | rocview -i rocview_locos.ini | ||
+ | </ | ||
+ | The opened window is customized by dragging the window elements according to your needs. In the following screen-shot only the locomotive table is shown for example: | ||
+ | |||
+ | {{rocgui_mult_instances_locos.png}} | ||
+ | |||
+ | The window showing the switch pane looks like this: | ||
+ | |||
+ | {{rocgui_mult_instances_panel.png}} | ||
+ | |||
+ | After closing Rocview the window properties are saved in the respective ini-file which can be easily checked by opening the window again using the same command. To display single layers these are in a first step activated manually and the window is arranged in order to show the basic elements of the layer. | ||
+ | |||
+ | ====Step 3: Linking levels and windows==== | ||
+ | After finishing the work of the last step it is noticeable Rocrail always opens the first layer of a track-plan. | ||
+ | However, this behaviour can be influenced by the parameter **//s//** during program start. | ||
+ | < | ||
+ | rocview -s 2 -i rocview_panel.ini | ||
+ | </ | ||
+ | With paramter **//s//** it is possible to choose the layer to be activated in the window. The argument is the index of the layer which can be seen from the order of the displayed layers. In the example of this manual the layers are shown in the following order: | ||
+ | * Buchrain --> Index 0 | ||
+ | * Grabtief --> Index 1 | ||
+ | * Panel --> Index 2 | ||
+ | |||
+ | ====Step 4: Creating a startup script for the big view==== | ||
+ | ===Server is already running=== | ||
+ | The server '' | ||
+ | To avoid further starts of instances in all special '' | ||
+ | > **Note:** For the case, the start of server should be done with the start of the first Rocview instance, see __**[[# | ||
+ | It is possible to create shortcuts for each call of Rocrail, however, a more elegant approach is to use a small script (see following examples for Windows and Linux): | ||
+ | == Windows: == | ||
+ | < | ||
+ | start rocview -i rocview_locos.ini | ||
+ | start rocview -s 2 -i rocview_panel.ini | ||
+ | start rocview -s 0 -i rocview_buchrain.ini | ||
+ | start rocview -s 1 -i rocview_grabtief.ini | ||
+ | </ | ||
+ | If this script is called Rocview is started four times, each window with the corresponding content.\\ | ||
+ | If you get error messages about problems with the " | ||
+ | < | ||
+ | ping -n 2 127.0.0.1 >NUL | ||
+ | </ | ||
+ | between each call. This will add a delay of 1-2 seconds and the Rocview instances will start smoothly. | ||
+ | |||
+ | == Linux: == | ||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | rocview -i rocview_locos.ini & | ||
+ | rocview -s 2 -i rocview_panel.ini & | ||
+ | rocview -s 0 -i rocview_buchrain.ini & | ||
+ | rocview -s 1 -i rocview_grabtief.ini | ||
+ | </ | ||
+ | The notices to insert delays into the Windows start script apply equally well under Linux. | ||
+ | |||
+ | ===Server in workspace=== | ||
+ | For the case, the start of server should be done with start of the first Rocview instance((Start in the defined workspace on the same hardware)), the option **startdefaultworkspace=" | ||
+ | In all other special '' | ||
+ | In the startup script above between the first Rocview instance and the start of all other instances should be inserted a delay, that give the server a time of 5-6 sec to start.\\ | ||
+ | < | ||
+ | ping -n 6 127.0.0.1 >NUL | ||
+ | </ | ||
+ | If this works, shorter time can be tried. \\ | ||
+ | With slowly hardware and / or big layouts the time may have to be extended. | ||
+ | |||
+ | ====Step 5: Fine tuning the windows positions==== | ||
+ | As a last step the arrangement of the windows is remaining. In order to do this the windows are simply dragged to their desired positions. If the windows are closed after the fine tuning their respective positions are saved and the arrangement is restored after the next start: | ||
+ | |||
+ | {{rocgui_mult_instances_all.png}} | ||
+ | |||
+ | |||
+ | \\ | ||
+ | =====Mac OS X===== | ||
+ | The script under Mac OS X could look like this: | ||
+ | < | ||
+ | #!/bin/ah | ||
+ | export DYLD_LIBRARY_PATH=./ | ||
+ | ./ | ||
+ | ./ | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | ====How to realise 2 Rocview windows on Mac OS-X with 1 Rocrail Server==== | ||
+ | Trigger: | ||
+ | |||
+ | - The railplan contains more then one level, or is so big that is doesn’t fit well in one window | ||
+ | - Switching to the modular lay-out concept is not an option | ||
+ | - The usage of 2 computer screens is desirable | ||
+ | |||
+ | === Step 1: Get understanding of the Rocrail architecture === | ||
+ | |||
+ | For this particularly tpoic the architecture looks as follow: | ||
+ | |||
+ | {{Dual Rocview architecture.png}} | ||
+ | |||
+ | Important: | ||
+ | |||
+ | - The two Rocview.ini files need to be in de Rocrail/ | ||
+ | - The railplan is in a separated map (to avoid deletion with an update) | ||
+ | - The shell program Start Rocview.sh is in the Rocrail/ | ||
+ | |||
+ | === Step 2: Create one Railplan in Rocrail first with 2 Tabviews === | ||
+ | {{Dual Rocview Tabview.png}} | ||
+ | |||
+ | Remark: | ||
+ | At the beginning I was on the wrong approach by creating 2 separated rail plans in separated workspaces. This should not be done. Create one railplan in one workspace with 2 tabviews. | ||
+ | |||
+ | Later on both Rocview windows has to communicate to the same rail plan in the Rocrail server. | ||
+ | |||
+ | === Step 3: Create first Rocview.ini === | ||
+ | Create the first Rocview.ini which to initate the first window, in this situation it is called: Rocview_-1.ini | ||
+ | |||
+ | Be sure that it contains the path to the correct rail plan: | ||
+ | |||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | **Remark: | ||
+ | ''/< | ||
+ | |||
+ | === Step 4: Create the second Rocview.ini === | ||
+ | Create the second Rocview.ini which to initate the second window, in this situation it is called: Rocview_0.ini | ||
+ | |||
+ | Be sure that it contains the path to the correct rail plan: | ||
+ | |||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | **Remark: | ||
+ | ''/< | ||
+ | |||
+ | === Step 5: Create the Shell program === | ||
+ | The content of the shell program determines if the script will work, be sure to test the script untill it works! | ||
+ | In this example the script has the following content: | ||
+ | |||
+ | < | ||
+ | |||
+ | #!/bin/sh | ||
+ | export DYLD_LIBRARY_PATH=/ | ||
+ | |||
+ | / | ||
+ | |||
+ | ping -c 2 127.0.0.1 >NUL | ||
+ | |||
+ | / | ||
+ | |||
+ | ping -c 2 127.0.0.1 >NUL | ||
+ | |||
+ | / | ||
+ | |||
+ | </ | ||
+ | |||
+ | **Remark: | ||
+ | with the ping command we give the computer some time to start the Rocrail server and the 2 Rocview screens in a sequential order, this may look slow, but without the timing it doesn’t work well. | ||
+ | |||
+ | Save the Shell program script with a recognisable name like: Start dual Rocview.sh | ||
+ | |||
+ | === Step 6: execute the shell program script === | ||
+ | After double click the script it starts executing. You may get errors due to the fact that the path's in the script are not correct. | ||
+ | |||
+ | This can only be fixed by getting exaclty the correct paths in the script...and some patience... | ||
+ | |||
+ | Then after a few seconds the two Rocview windows will be opened, like: | ||
+ | |||
+ | {{Dual Rocview windows.png? | ||
+ | |||
+ | **Remark:** | ||
+ | |||
+ | It may be the case that you have to select manually (tab view) in the Rocview window which Rail plan you want to see in which window. I wasn’t able to get that automated too. | ||
+ | |||
+ | === Step 7: Create a shortcut form the Shell program to be placed in the Dock === | ||
+ | Create a shortcut of the Shell program which enable you to put that in the Dock. | ||
+ | |||
+ | 1. Start the Automator | ||
+ | |||
+ | 2. Select in the Automator Library: execute Shellscript | ||
+ | |||
+ | {{Automator library.png}} | ||
+ | |||
+ | 3. Drag the Library script to the right panel | ||
+ | |||
+ | 4. Empty the existing content in the script | ||
+ | |||
+ | 5. Open in the Start Rocview.sh script (with Terminal) | ||
+ | |||
+ | 6. Select the content in the script en copy | ||
+ | |||
+ | 7. Past the content in the Automator empthy windown in the right panel | ||
+ | |||
+ | {{Automator script.png}} | ||
+ | |||
+ | 8. Test your Automator script with ‘push’ the execute button in the right uppercorner | ||
+ | |||
+ | 9. If it correct works, save your automator script with a valid name | ||
+ | |||
+ | 10. Drag the Automator script in the Dock | ||
+ | |||
+ | {{Dock.png}} | ||
+ | |||
+ | 11. Click on the Automator icon and Rocrail will start with 2 Rocview windows. | ||
+ | |||
+ | 12. Ready | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
gui-multi-en.txt · Last modified: 2018/11/12 08:56 by 127.0.0.1