uk.ac.ucl.che.esf.base
Class Settings

java.lang.Object
  extended by uk.ac.ucl.che.esf.base.Settings

public class Settings
extends java.lang.Object

Global settings for the ESF package. This object should not be instantiated: all methods and variables are static.


Field Summary
static int debug
          Debug level is used by much of the ESF package to control the verbosity of the diagnostic messages generated.
static java.text.DecimalFormat DEFAULT_FORMAT
          Default format for typical numbers...
static boolean log
          Some parts of the esf package may wish to log events for post-synthesis (e.g.) analysis.
static java.io.PrintWriter output
          All output to the standard output unit can be redirected either to a file or to a window.
static java.text.DecimalFormat Pformat
          Format for output of pressure values
static java.lang.String projectName
          The name of the project
static java.lang.String projectTitle
          The description of the project
static java.text.DecimalFormat Qformat
          Format for output of duty values
static boolean stopOnError
          The main interface to the FiSH system is textual: an input file is prepared and is then processed by the Input object.
static java.text.DecimalFormat Tformat
          Format for output of temperature values
static boolean useThreads
          Some implementations of Java are better than others...
 
Constructor Summary
Settings()
           
 
Method Summary
static uk.ac.ucl.che.esf.ui.Browser getBrowser()
           
static void parse(uk.ac.ucl.che.esf.ui.Parser parser)
          Parse textual input.
protected static boolean parseLine(java.lang.String[] line, uk.ac.ucl.che.esf.ui.Parser parser)
          Text based interface parser.
static void report(java.io.PrintWriter pw)
          Generate an HTML report describing the global settings for the ESF package
static void reset()
          Reset all (static) variables to their defaults
static void setBrowser(uk.ac.ucl.che.esf.ui.Browser browser)
          Specify which browser, for persistent object manipulation, should be used by the ESF system.
static void setOutput(java.io.PrintWriter pw)
          Redirect all standard output to the given PrintWriter argument
static void setOutput(java.lang.String file)
          Redirect all standard output to the file whose name is given as the single argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FORMAT

public static final java.text.DecimalFormat DEFAULT_FORMAT
Default format for typical numbers... whatever that means.


Pformat

public static java.text.DecimalFormat Pformat
Format for output of pressure values


Qformat

public static java.text.DecimalFormat Qformat
Format for output of duty values


Tformat

public static java.text.DecimalFormat Tformat
Format for output of temperature values


debug

public static int debug
Debug level is used by much of the ESF package to control the verbosity of the diagnostic messages generated. The default value of -1 results in very little output: each time a new problem is encountered in the search procedure, a single line description of that problem is written out. A value of 0 should be used for demonstration output. Values greater than 0 should be used for debug purposes with the amount of output actually generated growing with the value of this variable. Values less than the default should result in no output at all.

There is some correlation between the debug level and the type of output for synthesis problems:

  1. Problem level
  2. Implicit enumeration nodes
  3. Unit designs
  4. Heat exchange and solution incorporation
  5. Physical properties


log

public static boolean log
Some parts of the esf package may wish to log events for post-synthesis (e.g.) analysis. This variable indicates whether logging should take place or not.


output

public static java.io.PrintWriter output
All output to the standard output unit can be redirected either to a file or to a window. The default is for the output to appear on the console window (xterm or DOS Box, for instance) which started the java virtual machine. This default can be changed through the output option in the set mode.


projectName

public static java.lang.String projectName
The name of the project


projectTitle

public static java.lang.String projectTitle
The description of the project


stopOnError

public static boolean stopOnError
The main interface to the FiSH system is textual: an input file is prepared and is then processed by the Input object. Errors may occur. Normally, execution continues when an error does occur. Setting this flag to true requests that the procedure stop when an error occurs, useful for large input files or input files that generate large amounts of output.


useThreads

public static boolean useThreads
Some implementations of Java are better than others... despite claims to WORA, threads in particular are handled quite differently on the architectures and operating systems I have looked at. In some cases, threads are not preemptive and this can lead to serious performance hits. This flag allows us to decided whether to use threads or not (when a choice is possible).

Constructor Detail

Settings

public Settings()
Method Detail

getBrowser

public static uk.ac.ucl.che.esf.ui.Browser getBrowser()
Returns:
Current persistent object browser.

parse

public static void parse(uk.ac.ucl.che.esf.ui.Parser parser)
Parse textual input. Each line is read in and sent to the parseLine method which is class specific.


parseLine

protected static boolean parseLine(java.lang.String[] line,
                                   uk.ac.ucl.che.esf.ui.Parser parser)
Text based interface parser. Process command lines given to this object, processing any that are relevant and passing any that are not to the superclass (eventually reaching uk.ac.ucl.che.esf.base.EGO). Commands available for this class are given below.
CommandArgumentsDescription
threads true | false Allow use of threads. Used by compute intensive sections to yield access to cpu periodically for less than well implemented virtual machines [like the original Solaris implementation!].
In the table, O means the name of an object is expected, I an integer value or expression, and R a real number value or expression. Expressions should be quote using double quotes.


report

public static void report(java.io.PrintWriter pw)
Generate an HTML report describing the global settings for the ESF package


reset

public static void reset()
Reset all (static) variables to their defaults


setBrowser

public static void setBrowser(uk.ac.ucl.che.esf.ui.Browser browser)
Specify which browser, for persistent object manipulation, should be used by the ESF system.


setOutput

public static void setOutput(java.lang.String file)
                      throws java.io.IOException
Redirect all standard output to the file whose name is given as the single argument. However, if the file happens to be called "window" then the output is redirected to a window which we create.

Throws:
java.io.IOException

setOutput

public static void setOutput(java.io.PrintWriter pw)
Redirect all standard output to the given PrintWriter argument