Documentation Home Page RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

Perspectives

A perspective defines the initial set and layout of views in the Workbench window. One or more perspectives can exist in a single Workbench window.

  • Perspectives can be opened in the same (existing) Workbench window.
  • Perspectives define visible action sets, which can be changed to customize a perspective. A perspective that is built in this manner can be saved, creating a custom perspective that can be opened again later.
  • The Workbench window displays one or more perspectives. RT-LAB determines initially what default perspective is displayed, in this example, it is the RT-LAB Edition perspective.
  • A perspective consists of views such as the Project Explorer as well as editors for working with resources. More than one Workbench window can be open at any given time.
  • So far, only the RT-LAB Edition perspective (shown below) has been used in this tutorial. This section explores how to open and work with other perspectives.
  • A perspective provides a set of functionality aimed at accomplishing a specific type of task or working with a specific type of resource.

New Perspectives

There are several ways to open a new perspective within this Workbench window:

  • Using the Open Perspective button on the shortcut bar.
  • Choosing a perspective from the Window > Open Perspective menu.


To open one by using the shortcut bar button:

  • Click the Open Perspective button.

  • A menu appears showing the same choices as shown on the Window > Open Perspective menu.
  • Choose Other from the menu.
  • In the Select Perspective dialog choose another perspective and click OK. The perspective is displayed.

There are several other interesting things to take note of:

  • The title of the window now indicates that the new perspective is in use.
  • The shortcut bar contains several perspectives, the original Edition perspective, the new perspective, and a few others.
  • The new perspective button is pressed in, indicating that it is the current perspective.
  • To display the full name of the perspective right-click the perspective bar and check Show Text.
  • In the shortcut bar, click the Edition perspective button.
  • The Edition perspective is once again the current perspective.
  • Notice that the set of views is different for each of the perspectives.

Saving Perspectives

This tutorial has demonstrated how to add new views to the perspective, rearrange the views and convert views into fast views. The Workbench also allows this layout to be saved for future use.

  • In the shortcut bar click the Edition perspective.
    • The Edition perspective is now active.
  • Drag the Compilation view and stack it with the Project Explorer view.
  • Choose Window > Save Perspective As...
  • The Save Perspective As dialog allows for an existing perspective to be redefined or for a new perspective to be created.
  • Click OK to update the Edition perspective and Yes to the subsequent confirmation dialog.
    • The new perspective layout is used if the perspective is reset or if a new one is opened.
  • In the Edition perspective move the Compilation view so that it is now stacked with the Display view.
  • Choose Window > Reset Perspective. Notice the Compilation view is stacked with the Project Explorer view.
  • When the Workbench was started it was stacked with the Display view, but because the perspective was saved with the Project Explorer view stacked, it now
    considers this its initial layout.

While the Edition perspective has been changed, there is a way to get back the original layout.

To reset the Edition perspective to its original layout:

  • Choose Window > Preferences.
  • Expand RT-LAB and select Capabilities.
  • Select the Advanced capability and click OK

Choose Window > Preferences.

  • Expand General and select Perspectives.
  • Select Edition (default) > Make Default and then click OK.


  • Any changes to the saved state of the perspective have now been undone. To update the current copy of the Resource perspective that is being worked with, also choose Window > Reset Perspective from the Workbench's menu bar.
  • Expand RT-LAB again and select Capabilities.
  • Unselect the Advanced capability and click OK.

Configuring Perspectives

In addition to configuring the layout of a perspective, you can also control several other key aspects of a perspective.

These include:

  • The New menu.
  • The Window > Open Perspective menu.
  • The Window > Show View menu.
  • Action sets that show up on the toolbar.


Try customizing one of these items.

  • In the shortcut bar click the Edition perspective.
  • Select Window > Customize Perspective...
  • Select the Commands tab.
  • Uncheck the Old tools and click OK.
  • Observe that the toolbar now exclude buttons for launching old RT-LAB application.
  • After experimenting with the other options on the Customize Perspective dialog, choose Window

> Reset Perspective to return the perspective to its original state.

Comparing

The Workbench allows for the comparison of multiple resources and for the presentation of the results in a special compare editor.

Setup

Before commencing with compare a few files must be created. This is also a good time to recap some of the basic features that have already been introduced.

  • Start by selecting the file1.txt in the Project Explorer view. Double-click it, to open the text editor.
  • In the editor for file1.txt type the following lines of text and save the file:
    This is line 1.
    This is line 2.
    This is line 3.
    This is line 4.
    This is line 5.


  • In the Project Explorer view select file1.txt and use Ctrl+C to copy the file.
  • Use Ctrl+V (Paste) to create the copy.
  • In the name conflict dialog which appears, rename the file to file2.txt.
  • There are now two identical files, file1.txt and file2.txt.

Simple Compare

In the Project Explorer view select file1.txt and file2.txt choose Compare With > Each Other from the context menu.

A dialog appears indicating that the two files are the same.

Edit file1.txt as follows:

  • delete line 1 "This is line 1."
  • change line 3 to be "This is a much better line 3."
  • insert a line 4a (before line 5) that reads "This is line 4a and it is new"

The file (file1.txt) should now read as follows:


This is line 2.
This is a much better line 3.
This is line 4.
This is line 4a and it is new
This is line 5.

Save the contents of the file by choosing File > Save (or pressing Ctrl+S).

To compare the files, once again select file1.txt and file2.txt and choose Compare With > Each Other in the navigation view context menu.

A special compare editor opens. The next section explains how to use this compare editor.

Understanding the Comparison

Comparing file1.txt and file2.txt resulted in the following compare editor. The left side shows the contents of file1.txt and the right side shows the contents of file2.txt.

The lines connecting the left and right panes indicate the differences between the files. If more room is needed to look at the comparison, the editor tab can be double-clicked to maximize the editor.

The numbered changes on the left side of the difference editor are as follows:

  • Starting with the top line (in the left pane) the difference bar (in the area of the blue circle) indicates something is missing from the very top of the left file.
  • Follow the difference band (see #1) to the right file. It contains "This is line 1" .
  • The next line "This is line 2." is white indicating it matches the right file.
  • Moving onto the next line (colored in the background color), see that the left file and right file have different contents for this line (see #2).
  • The next line (This is line 4) is once again in white, so it can be skipped.
  • The next line exists in the left file but since it is in the background color its difference bar can be followed to the right (see #3) and notice that the right file does not contain the line (see red circle).

Initially, the compare editor might seem a bit daunting but when simply working down the left side and focusing on the items marked as gray, and those items missing from the left side, it turns out not to be as tricky as it first seems.

Working with Comparison

Comparing file1.txt and file2.txt resulted in the following compare editor. This section demonstrates how to use the compare editor to resolve the differences between the two files.

There are two parts to the compare editor's local toolbar. Move to the next or previous change using the right group of local toolbar buttons.

  • Click the Select Next Change button. Observe how it selects the next difference.
  • Click Select Next Change button a second time to go to the next change.
  • Click the Select Previous Change button.

To merge changes from the left file to the right file and vice versa use the left group of local toolbar buttons.

There are four types of merges that can be performed:

  • Copy whole document from left to right.
  • Copy whole document from right to left.
  • Copy current change from left to right.
  • Copy current change from right to left.

Typically the copy whole document actions are used when the entire file on either the left or right can just be replaced by the contents of the other file.

The Copy current change buttons allow a single change to be merged.

  • Ensure that the second difference is selected:
  • Click Copy Current Change from Right to Left . Observe that the selected text from the right file is copied to the left file.
  • Close the compare editor and choose Yes to save the changes. Alternatively, save the changes by choosing File > Save (Ctrl+S).

Local History

Every time an editable file is saved in the Workbench, the Workbench updates the local history of that file and logs the changes that have been made. The local history of a file can then be accessed and a previously saved copy of the file can be reverted to, as long as the desired state is recent enough in the save history.

  • Create a new file named file3.txt.
  • In the editor for file3.txt modify the file by adding the line "change1" and saving the file.
  • Repeat this by entering a new line "change2" and saving it again.
  • Add a third line "change3" and save it again.
  • Right-click the file in a navigation view (e.g. the Project Explorer) and select Team > Show Local History.
  • The History view opens and shows the history for the file.

The top entry in the view represents the current contents of the file. The next represents the previous contents and so on. Right-click the previous entry and select Compare Current with Local to open a Compare editor that displays the differences between the Workbench file and the specific copy of the file selected in the local history.

  • Right-click on the previous entry again and select Get Contents. This replaces the Workbench's copy of sampleFile.txt with the chosen local history item.
  • Observe that the file3.txt editor now contains two lines.

Responsive UI

By default, all RT-LAB operations run in the user interface thread. Employing the Responsive UI, which allows the threading of sequential code, enables you to continue working elsewhere in RT-LAB.

Without Responsive UI support, you would be locked out of performing any other actions when met with a slow operation.

While some operations automatically run in the background (such as build), in many cases a dialog is displayed providing you with the option to run an operation in the background. For example, building a model can sometimes take more than a few minutes, during which time you may wish to continue to use other functions in RT-LAB.

While the model is being built, select Run in Background from the Building Model dialog and the Responsive UI allows you to carry on with other tasks in RT-LAB.

For information on the status of the action and additional operations that are currently running, click Details.

The Details panel displays the status information of the operation at hand as well as any additional operations that may be running simultaneously.

The Progress Information dialog also indicates when one operation is being blocked by another.

Exiting the Workbench

Each time the Workbench is closed, it is automatically saved, including all open perspectives and windows. When the Workbench is reopened, it appears exactly as it was when it was last closed.

To exit the Workbench, select File > Exit from the menu bar or close the workbench with the window close button (x). When the latter option is used, a prompt asks if you really wish to exit the workbench.

If you intend to use an RT-LAB version older than 11.x at a later time, you have to exit the Workbench by selecting File > Exit and reconfigure for 10.x. This procedure is necessary because some properties of older versions are not compatible with this new version and they must be reconfigured so that the operating system can launch an older version of RT-LAB. On the other hand, upgrading from older versions to RT-LAB 11.x is an automatic process that does not require any special procedure.








OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323