Files
ResInsight/Documentation/UsersGuide/OctaveInterface.md

43 lines
2.3 KiB
Markdown
Raw Normal View History

2013-10-24 17:29:51 +02:00
[ Contents ](UsersGuide.md#contents)
-----
2013-10-24 10:18:31 +02:00
## Octave Interface
2013-10-21 13:37:59 +02:00
2013-10-24 10:18:31 +02:00
ResInsight provides a flexible interface to [Octave](http://www.gnu.org/software/octave/ "Octave").
2013-10-24 16:29:34 +02:00
This includes a set of Octave functions that communicates with a running ResInsight session, features in ResInsight that makes it easy to manage and edit Octave scripts, and their execution using Octave.
2013-10-24 10:18:31 +02:00
2013-10-24 16:29:34 +02:00
The Octave functions are documented in [ Octave Interface Reference](OctaveInterfaceReference.md).
2013-10-21 13:37:59 +02:00
### Script management
2013-10-24 10:18:31 +02:00
Octave scripts are available in the **Scripts** folder in the **Project Tree**.
![](images/OctaveScriptTree.png)
2013-10-24 15:04:04 +02:00
This folder contains an entry for each of the directories you have added as a **Script Folder**. Each of the folder lists available `*.m` files and sub directories. The tree is continuously updated to reflect the file structure on disk.
2013-10-24 10:18:31 +02:00
#### Adding Script Folders
You can add directories by right clicking the **Scripts** item to access the context menu.
Multiple standard script folder locations can also be defined in the field **Shared Script Folder(s)** in the **Preferences Dialog** (**Edit -> Preferences**).
#### Editing scripts
To enable script editing from ResInsight you need to set up the path to a text editor in the **Script Editor** field in the **Preferences Dialog** (**Edit -> Preferences**)
When done, scripts can be edited using the context menu command **Edit** on the script item in the tree.
### Script execution
2013-10-24 16:29:34 +02:00
Octave scripts can be executed with or without a selection of cases as context. The [ Octave Interface Reference](OctaveInterfaceReference.md) highlights in more depth how to design your Octave scripts to utilize these features.
2013-10-24 10:18:31 +02:00
#### Without a case selection
A script can be started by navigating to the script in the **Project Tree**, and selecting **Execute** from the context menu. The currently active case (The one with the active 3D View) will then be set as ResInsight's *Current Case*.
#### With a case selection
One script can be executed on many cases by first selecting a set of cases, and then activating **Execute script** from the context menu for the case selection. The script is then executed once pr selected case. Each time ResInsight's *Current Case* is updated, making it accessible from the Octave script.
![](images/ExecuteOctaveScriptOnSelectedCases.png)
2013-10-24 17:29:51 +02:00
------
[ Contents ](UsersGuide.md#contents)