SORTIE Java Interface
1
|
Interface between the Java GUI and the C++ application core. More...
Public Member Functions | |
void | pause () throws ModelException |
Pauses the run by sending a "pause" command to the process. More... | |
void | stop () throws ModelException |
Stops the currently executing process. More... | |
void | run (final MainWindow oWindow, final String sFileName, final int iNumStepsToRun) |
Runs the model. More... | |
String | getMessage () |
Gets any message waiting in the queue from the model run. More... | |
boolean | isDone () |
Gets whether or not the currently executing model run is finished. More... | |
boolean | isPaused () |
Gets whether or not there is a current run that is paused. More... | |
void | killProcess () |
Hard-kills any currently running model process. More... | |
boolean | isOK () |
Gets whether or not the last executed model run finished without errors. More... | |
Private Attributes | |
Process | m_oProcess = null |
Currently running C++ process, or null if none is running. More... | |
String | m_sMessage |
Messages received from the C++ program are stored here. More... | |
boolean | m_bIsDone = false |
Whether or not the program is finished running. More... | |
boolean | m_bIsOK = false |
Whether or not the last completed run went OK. More... | |
boolean | m_bIsPaused = false |
Whether or not the run is paused. More... | |
Interface between the Java GUI and the C++ application core.
Copyright: Copyright (c) Charles D. Canham 2003
Company: Cary Institute of Ecosystem Studies
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)
String sortie.parfile.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.
boolean sortie.parfile.Interface.isDone | ( | ) |
Gets whether or not the currently executing model run is finished.
boolean sortie.parfile.Interface.isOK | ( | ) |
Gets whether or not the last executed model run finished without errors.
boolean sortie.parfile.Interface.isPaused | ( | ) |
Gets whether or not there is a current run that is paused.
void sortie.parfile.Interface.killProcess | ( | ) |
Hard-kills any currently running model process.
void sortie.parfile.Interface.pause | ( | ) | throws ModelException |
Pauses the run by sending a "pause" command to the process.
ModelException | if the process could not be written to. |
void sortie.parfile.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.
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. |
void sortie.parfile.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.
ModelException | if there are problems writing to the file or to the process. |
|
private |
Whether or not the program is finished running.
|
private |
Whether or not the last completed run went OK.
|
private |
Whether or not the run is paused.
|
private |
Currently running C++ process, or null if none is running.
|
private |
Messages received from the C++ program are stored here.