Offline Chart Generator
This utility generates and updates charts of each well in the database. It is intended to be scheduled as a regular batch job, in order to maintain a folder of up-to-date chart images.
The program takes a specified well block or chart template created in the charts module. For each well in turn, the template is used to create a temporary chart, using default settings for the depth or age range. The chart is output to a PDF file, named with the well’s code.
Requirements
ChartGen is included in the StrataBugs distribution and does not require any further downloads. StrataBugs must be installed using the bundle download, and not the installer.
You will need to run the Java command; for v3.0 you can use the bundled Java version. For v2.1 you will either need to have Java on the path, or know its location.
Run With User Interface
You can run the chart generator (for example, to test parameters), from the StrataBugs control panel,
.
Run Command
To run from the command line, navigate to the StrataBugs folder and use:
jre/bin/java.exe -Xmx1024m -cp jsbugs-3.0.87.jar jsbugs.ChartGen
You must also add the following additional parameters.
|
The JDBC driver type which reflects the connection settings you would make for your user connection; one of "oracle", "sqlserver", "h2", "postgres". |
|
Data source name or the host name for connection (set to empty if not required) |
|
Database instance name or the database.schema name for connection |
|
Database username |
|
Database password |
|
StrataBugs user abbreviation (e.g. "SYS") |
|
StrataBugs password for user (omit this parameter if the StrataBugs password is the same as the database password). |
Restricted Wells
If you choose a project with restricted wells, you must be careful which StrataBugs login you use to run the generator. If the user is able to see the restricted wells, a chart will be generated for the restricted well. If the user does not have access to the restricted well, it will be ignored.
|
|
The folder in which the generated charts will be stored, e.g. The path can contain code substitutions using "< >" (see below). If you are using substitutions, the generator will attempt to create any non-existent folders. If you are not using substitutions, the destination folder path must already exist. |
|
Name of a StrataBugs project to use. This is useful for testing the process on a subset of wells. Omit this parameter to generate charts for the entire database. Enclose the project name in double quotes if it contains spaces. |
|
The name of the chart template to use, which must be a well block template or a chart with a template block. You can use a project template only in conjunction with the project parameter, otherwise it must be a global template. The template name must not contain any space characters. |
|
A string template for a URL which is inserted into the The URL can contain code substitutions using "< >" (see below). |
|
Set the type of scale to be used in charts (one of MD, TVD, AGE, TWT). Default is MD (measured depth). |
To substitute the well code into the URL or path, use <W>
.
To use only part of the well code, use the first and last character indices you wish to use. E.g. <W1:3>
will use the first 3 characters of the well code. To use the end of the code starting from the 3rd character, use <W3:>
.
Example: use the first two characters for a folder and the remaining for the file name. The path and URL parameters could be
path=D:\server.xyz\<W1:2>\charts\<W3:>.pdf
and url=http://www.xyz/<W1:2>/charts/<W3:>.pdf
. If the well code was 500023234654, this would result in a file in D:\server.xyz\50\charts\0023234654.pdf
and a URL of http://www.xyz/50/charts/0023234654.pdf
. You must ensure that the url maps correctly onto the file generated.
Batch File
When you are satisfied with the parameter setup, you can create the Windows batch file "ChartGen.bat." Example contents:
D: cd "\sbugs\StrataBugs-3_0" "\jre\bin\java.exe" -Xmx1024m -cp jsbugs-3.0.87.jar jsbugs.ChartGen driver=jdbc host=SRVR instance=SBUGS30 instancelogin=DBA password=system sbugslogin=SYS path="D:\sbugs\ChartGen" template=BiostratSummary > ChartGenLog.txt 2&>1
The final part of the file redirects the console output to a log file "ChartGenLog.txt". This file is replaced each time the process runs. It is useful for troubleshooting problems and also notes how many charts were generated or updated.
You can use the batch file to schedule a regular task. After their initial creation, charts will only be updated when relevant data have changed OR if the template has changed; new charts will be added for any new wells.
Hints and Tips
If your template is a well block template, it does not include any "chart properties". Chart properties include the font and colours, the header style and whether to include panels which have no data. ChartGen will assign defaults for all chart properties.
If you want to have control of the chart properties, you can add your well block template to a named chart, without assigning it a well. This gives you a chart with a "template block". The database wells will be assigned to this block by the generator. You can now set and save the chart properties.