Resources Branch

 

Introduced in PSCAD V5, the resources branch replaces the prior Additional Source files (*.f, *.for, *.f90, *.c, *.cpp) and the Additional Library (*.lib) and Object (*.obj/*.o) Files project settings fields, as well as the older File Reference component, as a means to attach, link or display files. It provides a single-entry point for adding, deleting and managing all external, dependent files.

 

A resources branch is inherent to every project, both case and library. It may be accessed by expanding any project branch in the workspace:

 

 

In addition to added source and linked binary files, most other file types can be appended to the resources branch. These may include EMTDC Output (*.psout) files, Python (*.py) files, Executable and Batch (*.exe and *.bat) files, Microsoft Office files, picture files, *.pdf files, etc., that are not linked when the project is compiled, but are associated with the project in some way. Note that the resource branch utilises the current operating system settings to associate a file. So for example, to view a Microsoft Word file, you must have Word installed and the corresponding files associated with the application.

NOTE: If you have just imported your v4.6 or prior project into PSCAD V5, all file resources previously specified in the Additional Source files (*.f, *.for, *.f90, *.c, *.cpp) and the Additional Library (*.lib) and Object (*.obj/*.o) Files project settings fields should have automatically been placed in the resources branch. See Importing X4 Projects to V5 for more details.

Resources Branch Context Menu

Right-click directly on the resources branch, to bring up the resources branch context menu. The primary purpose of this menu is for adding resource files:

 

 

The following list describes the functions of this pop-up menu:

Resource Context Menu

Right-click on any resource in the resources branch, to bring up the resource context menu:

 

 

The following list describes the functions of this pop-up menu:

Resource Settings

Right-click on any resource in the resources branch, and select Settings... to bring up the Resource Settings dialog.

 

 


The following describes the parameters available in this dialog:

 

General:

Custom Compile Settings:

Macros and Relative Paths

Macros and relative paths help to keep resource file paths flexible and transferable. These concepts should always be used instead of absolute paths whenever possible.

Macros

There are dozens of defined macros in PSCAD that may be utilised to make resource path designations more dynamic and convenient. A macro may be inserted directly as part of a path, which will be parsed and converted to an absolute path or string dynamically, based on the current state of PSCAD, and/or the computer being used. To see the complete list of available macros, follow these steps:

 

 

Open the Resource Settings Dialog

Click Edit Path

Scroll the List (Present Value of Macros Displayed)


Relative Paths

In PSCAD, all relative file paths are relative to the corresponding project file location. Relative paths, as opposed to absolute paths, are the best way to track files, and should be used whenever possible.

 

Relative path symbol definitions:

 

.\

File location is in the same folder as the project. This symbol is optional. For example, .\my_file.f is equivalent to my_file.f.

..\

File location up one folder level from where the project file is located.

 

For more detailed information on macros, see Complete Macro List.

User Libraries Folder Method

A compiler specific folder convention exists for the purpose of specifying compiler specific object (*.obj or *.o) and static library (*.lib) files.  Object and static library files can be compiled with one or more different Fortran compilers, and then placed in a named sub-folder within the specified User Libraries Folder.  Then, the user may freely switch between compilers without the need to re-specify the files.

 

The user must manually add these sub-folders to the main folder specified by the User Libraries Folder option (in the Dependencies category of the Application Options dialog).  Each sub-folder represents a specific Fortran compiler, and the same library or object file (compiled by the corresponding compiler) may be placed in these sub-folders.  Since there are different types of Fortran compilers that may be used with PSCAD, there can be different sub-folders specified. These must be named as follows:

For example, if a user specifies C:\my_libs as the User Libraries Folder, and intends to use either the GFortran compiler or the Intel Visual Fortran 18 (64-bit) compiler, then two sub-folders should be added to 'my_libs' as shown below:

 

 

Any library or object files required should be created by using the corresponding compiler, and then added to the corresponding sub-folder.

 

When entering a relative path to the file, the user must specify a relative path, using macros, to both the User Libraries Folder, as well as the compiler sub-folder. For example, if a user specifies C:\my_libs as the User Libraries Folder and is using the Intel Visual Fortran 18 (64-bit) compiler, entering "$(LibDir)\$(Compiler)\test.obj" as shown below would point to C:\my_libs\if18\test.obj.

 

Absolute Path Entry

Files may also be referenced by an absolute path specification.  If this method is chosen, then the folder specified in the User Libraries Folder will be overridden.  For example, a file referenced with an absolute path may appear as follows:

 

 

Note that although this type of path is fine to be used temporarily, absolute paths are not recommended due to their static nature. That is, they are not relative to the context of the project, and so if a project file is transferred to another computer, the absolute path may no longer be valid.