The normal mode of operation starts the program and displays the interface. From the interface the user can access all the features and capabilities of the program using the mouse and keyboard. However, for some uses it may advantageous to start the program, have it carry out certain commands, and then shut down. There is a very limited capability to operate in this mode using scripting control. Additional scripting capabilities may be added in the future.
The first step is to create a control script. It is best if the simulation that will be computed by the script already exists and has been tested in normal operation to make sure it completes successfully. A typical script would contain the following lines in a file:
from hms.model.JythonHms import *
OpenProject("Tenk", "C:\\hmsproj\\
Tenk")
Compute("Run 1")
Exit(1)
Once you have created the script file, it can be used with the program from the command line. The program will start and automatically process the script. The first line is used to setup the scripting environment and make the program data model accessible to the script. The second line opens an existing project and the third line computes an existing simulation run. The final line of the script exits the program.
To use a script on the Microsoft Windows® operating system, begin by opening a command window and changing directories to the installation folder. The installation folder is not standardized and depends on where you chose to install the program. One possibility would look like the following:
C:\Program Files\HEC\HEC-HMS\4.4>
At the command prompt, type the following to launch the program and run the script, where the last argument is the complete path to a script:
hec-hms.cmd –s C:\hmsproj\Tenk\compute.script
To use a script on the Linux operating system, begin by opening a console and changing directories to the installation folder. The installation folder is not standardized and depends on the policies of your system administrator. One possibility would look like the following:
/usr/hec/hechms>
At the console, type the following to launch the program and run the script, where the last argument is the complete path to the script:
hms –s /usr/smith/hmsproj/tenk/compute.script
The program will not be visible while it is running the script. However, the commands in the script will be carried out. Any messages generated while computing the simulation run will be written to the log file. All results will be stored in the output Data Storage System (DSS) file. Inspection of the log file will reveal any errors, warning, or notes and results can be read from the DSS file.