Script Assistant

Script Assistant is an application for creating predefined Program shortcuts. A suite of scripts is supplied by Petrostreamz, and available in the toolbar. The scripts will set up the Program Script automatically, by defining sockets and a Graphical User Interface (GUI) for selecting switches and options.

Table of Contents

  1. Overview
  2. Using Scripts
  3. Creating Scripts
  4. Modifying Scripts
  5. Workflow
  6. Detailed Description
  7. Reference Documentation

Overview

Scripts supplied by Petrostreamz or created by the user are available in Pipe-It's Toolbar.

Novice and expert user of Pipe-It will utilize these scripts to quickly use custom Processes for often used programs. The Script Assistant facilitates creation of new scripts and modification of existing scripts through a GUI.

Using Scripts

If you are new to Pipe-It, you might only have Petrostreamz Scripts available in your toolbar. This section will show you how to use one of those scripts in your project.

  1. Select the Strexzel icon and drag the script to the Canvas.

  1. Connect the desired resources to the created script. Socket is automatically available through the script, which ensures that the command line is correctly created.

A stream file resource being connected to a Strexzel Script

Creating Scripts

This section will demonstrate how to create a simple script. We choose to create a script which will launch the software Phazecomp, an equation-of-state program for compositional phase behavior modeling and fluid characterization.

  1. Open Script Assistant and press the 'New' toolbar button.
  2. Name the script PhazeComp, press save, and double click the new script.
  3. PhazeComps command line is expected to look like: "PhazeComp [inputfile] [outputfile]". Start by setting up the executable.

This assumes that the PhazeComp is in your operating systems command path. If this is not the case, refer to your operating systems manual, or add the absolute path your executable file. Adding the complete path would make it harder to share the project with others, as they might not have the executable located in the same directory, adding often used applications to the environment path is recommended.


  1. Click the icon button to add an icon.
  2. Add a new reference by clicking the add reference button.

  1. Double click the new entry in the table, and populate the menu that pops up as follows:

  1. Add another reference named "PhazeComp output file (*.*)", similar as step 6, except you chose output socket instead.
  2. To allow the user of the script to connect resources which does not go to the command line, but established dependencies, add two more sockets - one input and one output both with the "Goes To Command Line" option unchecked. Name them "Other Input Dependencies" and "Other Output Dependencies". Your reference list should now look like this:

Exceptions - Warnings/error. Script Assistant also allows you to add the syntax specifications of the programs warnings and error messages. Doing this will allow Pipe-It to catch errors and warnings, and organize them in the console window.? Exceptions are identified by a Name, Type, Start Tag and End Tag. Phazecomp outputs Errors, Warnings and Fatal Errors which can be caught by the start tag:

^\\#{6}\\s+ERROR\\:

and end tag:

\\#{6}

Add all 6 regular expressions illustrated underneath:

  1. Press "Save Script" and PhazeComp is now available in the toolbar from Pipe-It.

Modifying Scripts

Modification of scripts is initiated from the Script Assistant's main window. This example will demonstrate how to modify the script we created earlier by adding another socket where the user is supposed to connect include files.

  1. Find the script you created in the Global Script List, and double click it.

  1. Add another file reference named "Include Files", which does not go to the command line.

Workflow

Using Script Assistant is an opportunity to personalize Pipe-It, integrate your favorite programs and applications as a part of Pipe-It. An advanced user of Pipe-It will be able to recognize frequently repeated creations of specific Programs and create a script instead. There is several possible workflows, but here is one suggestion on how to go about creating good scripts:

  1. Create the script, give it a file name and a script name.
  2. Find or create an icon. The image should be square, and scale well to 16x16 pixels.
  3. Investigate which command line arguments your program accepts. Asses if they all are useful, if there's too many it might get confusing.
  4. Divide the program's arguments you wish to include into references and options.
  5. Set up the references one by one.
  6. Set up the options one by one. Preview the results to make sure it is intuitive to use.
  7. If the program has a fixed syntax of the error output, set them up in the exception tab.

Detailed Description

Script Assistant GUI

Script Window

The Script Assistants main window is designed for

The menu bar

The menu consist of the File, Edit, and Help Menu

File Menu

Edit Menu

Help Menu

Toolbar

Scripts Tree


The Scripts Tree is used to finding individual scripts to edit, or organizing the structure of all the scripts.

Finding a specific script to edit
All scripts and folders will be somewhere in the list, simply find it, select it and double click to edit. The edit button in the toolbar or the menu can also be used. To search for a script the filter can be used. Simply type the name of the script or folder to only display a subset of the items in the list. If you search for a folder, all children will also match the filter and be displayed.

Creating or modifying the structure
To create a new folder, right click a sibling of where you want to to be located, and press "Add Folder". To move a folder and all children one level up, select it, and right click, and press "Demote". To move a Script or folder from one folder to another, drag and drop can also be used. Click and hold the folder you want to move, move it to the new parent, and release. Please note that only folders can have children.

Script Edit Tab


The Script Assistants edit window is designed for creating and organizing a scripts arguments, warnings and error log output.

Tab

Several Scripts or Folders can be opened for editing simultaneously. The opened scripts are organized in a tab format. Switch tabs to edit a different one.

Edit area

Script Name The scripts name, which will be used to identify the Script in Pipe-It and Script Assistant. Icon Button Used to set the Scripts Icon. Executable The name of the executable you wish the script to execute. You can use the browse button to locate it, but be wary of absolute path if you plan to share the project.

Arguments tab An argument can be either an Option or a Reference. The order of options and reference in the list, represents the order in which they will be added to the Scripts command line.

Options are presented to the user via a GUI accessible to the user by double clicking the Process in Pipe-It. Editing of options is done via the Option Dialog. Options can be added, removed, or moved by using the buttons underneath the list. A preview of how the script will appear in Pipe-It can be viewed by pressing the Preview button, which will open the Preview Dialog.

References Each reference represent one socket, and has a name, type, and reference text. The reference text is translated to a file path based on options selected in the reference dialog. The reference dialog is accessed by double clicking a reference.

Exceptions tab

Pipe-It is able to recognize patterns in a Programs output, this can be used to collect a list of errors or warnings after a projects execution. These findings are added to the Exception window of the Run Log. Users can expand the list of recognizable patterns by defining patterns for their Scripts.

Exceptions are defined by:
Name to identify the exception.
Type Warning, Error, or Fatal Error. Warnings a colored yellow, while Errors and Fatal Errors are red.
Multiline Check if the warning can expand multiple lines. Multi-line exceptions are only identified by a Start Tag. The ending is identified with the first empty line.
Start Tag Pattern to recognize the start of an exception. The details of supported Regular Expressions can be found here.
Description Optional descriptive text, only for reference in Script Assistant.

Buttons

Option Dialog

Types:

Expression Output
d the day as number without a leading zero (1 to 31)
dd the day as number with a leading zero (01 to 31)
ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun').
dddd the long localized day name (e.g. 'Monday' to 'Sunday').
M the month as number without a leading zero (1-12).
MM the month as number with a leading zero (01-12).
MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec').
MMMM the long localized month name (e.g. 'January' to 'December').
yy the year as two digit number (00-99)
yyyy the year as four digit number

Reference Dialog

The Script Assistants Reference dialog is designed for editing a scripts file references.

The GUI Reference Name: Edit the reference name.

Goes To Command Line: Check if the file should go to the command line or not. A typical usage for a file reference which does not go to the command line is when the connection is supposed to be used for establishing dependencies.

Allow Multiple Connections: Check if more than the first connector connection to the socket should go to the command line or not.

Socket Type: Specifies whether the socket is an input or output socket.

Minimum Matches for Execution: Sets the minimum required connections to the socket to make the program execute.

Bounding Text: Sets the reference's bounding text. It is often used to add quotes and arguments.

Substitution: Relative File Path or full file path. Example: Use C:\Projects\SPE3\model\model.dat or \model.dat, relative to the current working directory.

Exclude File Extension: Check to exclude file extension. Example: File = model.dat results in model if checked.

Parent Directory Only: Reference the parent directory instead of the file. Example: C:\Projects\SPE3\model\model.dat results in C:\Projects\SPE3\model

Current Reference: Displays the current reference based on the current selections in the dialog.

Preview Dialog

The preview dialog can be used to preview how the Script will look in Pipe-It. The window is divided into two parts. The Option GUI, and the command line preview. The option GUI will let you visualize the the options so far, and toggle the different options to see the effect. The command line preview will preview the command line, as it will be before sent to Pipe-It for reference parsing. The command line is based on the Executable, the Options and the selections made, and the References.

Petrostreamz Scripts

Pipe-Itc

Pipe-Itc is the command line version of Pipe-It and is often used to call external Pipe-It projects.

Streamz

Streamz is a unique program for comprehensive petroleum fluid management. It requires a Streamz driver file as input, and produces a Streamz log file as output.

Strexzel

Strexzel is a Petrostreamz developed program for editing Stream files. The script will usually launch Strexzel in macro mode.

Input Sockets:

Socket Socket Name Description
1 Macro file (*.STM) File Specifies the macro file which will be executed on launch
2 Input StreamFile (*.STR) Input stream file. If this is the only argument, Strexzel will start in GUI mode and open the file

Output Sockets:

Socket Socket Name Description
1 Output StreamFile (*.STR) Output stream file
2 Output SSQ File (*.SSQ) Sum of Squares File
3 Output LOG file (*.LOG) Log File

Options:

Strexzel does not have any options.

Plotz

Plotz can visualize stream files, text files, or excel files.

Convertors translates files with a specific format to a Stream file.

Pre_Ecl

PreEcl prepares an Eclipse data file, before it is run, to output results needed by Pipe-It.

Ecl2Str

Ecl2Str converts Eclipse output to stream file format.

Sen2Str

Sen2Str converts SENSOR output to stream file format.

Sen2Str61

Sen2Str61 converts SENSOR output to stream file format.

txt2Str

txt2Str converts a general tabular text file to stream file format.

Reference Documentation

Examples




Copyright © 2008-2013 Petrostreamz