javawrapper.Interface Class Reference

Interface between the Java GUI and the C++ application core. More...

List of all members.

Public Member Functions

void Pause () throws ModelException
 Pauses the run by sending a "pause" command to the process.
void Stop () throws ModelException
 Stops the currently executing process.
void Run (final MainWindow oWindow, final String sFileName, final int iNumStepsToRun)
 Runs the model.
String GetMessage ()
 Gets any message waiting in the queue from the model run.
boolean IsDone ()
 Gets whether or not the currently executing model run is finished.
boolean IsPaused ()
 Gets whether or not there is a current run that is paused.
void KillProcess ()
 Hard-kills any currently running model process.
boolean IsOK ()
 Gets whether or not the last executed model run finished without errors.

Private Attributes

Process m_oProcess = null
 Currently running C++ process, or null if none is running.
String m_sMessage
 Messages received from the C++ program are stored here.
boolean m_bIsDone = false
 Whether or not the program is finished running.
boolean m_bIsOK = false
 Whether or not the last completed run went OK.
boolean m_bIsPaused = false
 Whether or not the run is paused.


Detailed Description

Interface between the Java GUI and the C++ application core.

Copyright: Copyright (c) Charles D. Canham 2003

Company: Institute of Ecosystem Studies

Author:
Lora E. Murphy
Version:
1.0

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
November 8, 2004: Put in pause and stop buttons (LEM)
February 20, 2008: Made it so that any existing pause and stop messages were cleaned out at the beginning of a new run (LEM)

Member Function Documentation

void javawrapper.Interface.Pause (  )  throws ModelException

Pauses the run by sending a "pause" command to the process.

Exceptions:
ModelException if the process could not be written to.

void javawrapper.Interface.Stop (  )  throws ModelException

Stops the currently executing process.

If the run is currently paused, the command "quit" will be sent to the process's stdin stream. If the run is currently running, the messages file will be created with a "q" in the first position.

Exceptions:
ModelException if there are problems writing to the file or to the process.

void javawrapper.Interface.Run ( final MainWindow  oWindow,
final String  sFileName,
final int  iNumStepsToRun 
)

Runs the model.

This launches the executable and passes in the user's chosen file. This function will display any errors that occurred.

Parameters:
oWindow MainWindow, for displaying messages.
sFileName String Filename to run.
iNumStepsToRun Number of timesteps to run. Set to 0 if the model is to run to conclusion.

String javawrapper.Interface.GetMessage (  ) 

Gets any message waiting in the queue from the model run.

This will erase the message after sending it to ensure that messages can be uniquely identified.

Returns:
String The last message sent from the C++ program.

boolean javawrapper.Interface.IsDone (  ) 

Gets whether or not the currently executing model run is finished.

Returns:
boolean True if complete, false if still executing.

boolean javawrapper.Interface.IsPaused (  ) 

Gets whether or not there is a current run that is paused.

Returns:
boolean True if there is a paused in-progress run, false otherwise.

void javawrapper.Interface.KillProcess (  ) 

Hard-kills any currently running model process.

boolean javawrapper.Interface.IsOK (  ) 

Gets whether or not the last executed model run finished without errors.

Returns:
boolean True if it finished without errors, false otherwise.


Member Data Documentation

Process javawrapper.Interface.m_oProcess = null [private]

Currently running C++ process, or null if none is running.

Messages received from the C++ program are stored here.

boolean javawrapper.Interface.m_bIsDone = false [private]

Whether or not the program is finished running.

boolean javawrapper.Interface.m_bIsOK = false [private]

Whether or not the last completed run went OK.

boolean javawrapper.Interface.m_bIsPaused = false [private]

Whether or not the run is paused.


The documentation for this class was generated from the following file:

Generated on Tue Apr 19 13:59:41 2011 for SORTIE Java Interface by  doxygen 1.5.6