Index: trunk/test/tmcsim/simulationmanager/SimulationManagerSmokeTest.java
===================================================================
--- trunk/test/tmcsim/simulationmanager/SimulationManagerSmokeTest.java	(revision 2)
+++ trunk/test/tmcsim/simulationmanager/SimulationManagerSmokeTest.java	(revision 2)
@@ -0,0 +1,104 @@
+package tmcsim.simulationmanager;
+
+import java.io.File;
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.fail;
+import org.uispec4j.*;
+import org.uispec4j.interception.WindowInterceptor;
+import tmcsim.cadsimulator.CADSimulator;
+import tmcsim.common.ScriptException;
+import tmcsim.common.SimulationException;
+
+/**
+ * Smoke Test of system. Start the CAD server, Start the Sim Mgr, see if the Sim
+ * Mgr view shows "No Script".
+ *
+ * @author jdalbey
+ */
+public class SimulationManagerSmokeTest extends UISpecTestCase
+{
+
+    SimulationManager simMgrApp;
+    CADSimulator engine;
+
+    public SimulationManagerSmokeTest(String testName)
+    {
+        super(testName);
+    }
+
+    /**
+     * Call constructors for both classes
+     */
+    public void testBothGUIs() throws ScriptException, SimulationException
+    {
+        System.out.println("Smoke Test Sim Mgr & CADSimulator");
+
+        Window cadwindow = null;
+        System.setProperty("CAD_SIM_PROPERTIES", "config/cad_simulator_config.properties");
+        if (System.getProperty("CAD_SIM_PROPERTIES") != null)
+        {
+            cadwindow = WindowInterceptor.run(new Trigger()
+            {
+                public void run()
+                {
+                    try
+                    {
+                        engine = new CADSimulator(System.getProperty("CAD_SIM_PROPERTIES"));
+                    } catch (Exception e)
+                    {
+                        fail("Couldn't launch CADSimulator");
+                    }
+                }
+            });
+        } else
+        {
+            fail("CAD_SIM_PROPERTIES system property not defined.");
+        }
+
+        // Check CAD Simulator appears with no script and nothing connected
+        assertEquals("CAD Simulator", cadwindow.getTitle());
+        Panel mainPanel = cadwindow.getPanel("contentPane");
+        TextBox txtStatus = mainPanel.getTextBox("simulationStatus");
+        assertEquals("No Script", txtStatus.getText());
+        TextBox terms = mainPanel.getTextBox("termConnectedTF");
+        assertEquals("0", terms.getText().trim());
+        assertEquals("No", mainPanel.getTextBox("managerConnectedTF").getText().trim());
+
+        Window simMgrWindow = null;
+        System.setProperty("SIM_MGR_PROPERTIES", "config/sim_manager_config.properties");
+        if (System.getProperty("SIM_MGR_PROPERTIES") != null)
+        {
+            simMgrWindow = WindowInterceptor.run(new Trigger()
+            {
+                public void run()
+                {
+                    try
+                    {
+                        simMgrApp = new SimulationManager(System.getProperty("SIM_MGR_PROPERTIES"));
+                    } catch (Exception ex)
+                    {
+                        fail("Couldn't launch Simulation Manager");
+                    }
+                }
+            });
+        } else
+        {
+            fail("SIM_MGR_PROPERTIES system property not defined.");
+        }
+
+        // Check that the Sim Mgr GUI appears without a script loaded yet
+        SimulationManagerView view = simMgrApp.theSimManagerView;
+        assertFalse(view.isSimulationStarted());
+        Window win = new Window(view);
+        Panel contentPanel = win.getPanel("contentPane");
+        TextBox txtSimStatus = contentPanel.getTextBox("simulationStatusText");
+        assertEquals("No Script", txtSimStatus.getText());
+
+        assertEquals("Yes", mainPanel.getTextBox("managerConnectedTF").getText().trim());
+
+        // Quit
+        engine = null;
+        simMgrApp = null;
+    }
+}
Index: trunk/IDE_metadata/NetBeans/TMCSim/build.xml
===================================================================
--- trunk/IDE_metadata/NetBeans/TMCSim/build.xml	(revision 2)
+++ trunk/IDE_metadata/NetBeans/TMCSim/build.xml	(revision 2)
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- You may freely edit this file. See commented blocks below for -->
+<!-- some examples of how to customize the build. -->
+<!-- (If you delete it and reopen the project it will be recreated.) -->
+<!-- By default, only the Clean and Build commands use this build script. -->
+<!-- Commands such as Run, Debug, and Test only use this build script if -->
+<!-- the Compile on Save feature is turned off for the project. -->
+<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
+<!-- in the project's Project Properties dialog box.-->
+<project name="TMCSim" default="default" basedir=".">
+    <description>Builds, tests, and runs the project TMCSim.</description>
+    <import file="nbproject/build-impl.xml"/>
+    <property name="workdir" value="../../.."/>    
+    <!--
+                =================
+                LOC counter 
+                =================
+     -->
+<target description="Count Lines of Code in src directory." name="loc">
+        <java classname="textui.LOC"
+	      classpath="${workdir}/lib/JavaLOC.jar">
+               <arg line="-r -d ${workdir}/src"/>
+	</java>    
+</target>    
+<!--
+                =================
+                CHECKSTYLE SECTION
+                =================
+     -->
+<target description="Run checkstyle on src directory." name="checkstyle">
+<taskdef resource="checkstyletask.properties"
+         classpath="${workdir}/lib/customcheckstylechecks.jar;${workdir}/lib/checkstyle-all-4.4.jar"/>
+<checkstyle config="${workdir}/lib/jdstyle.xml" failOnViolation="true">
+            <!-- Specify includes and excludes -->
+            <fileset dir="${workdir}/src/tmcsim" includes="**/*.java"
+            />
+</checkstyle>
+</target>     
+   
+<!--
+                =================
+                PACKAGE JARS SECTION
+                =================
+     -->
+<target name="package-jars" depends="jar">
+
+    <!--         *** Build a jar with everything ***            -->
+    <property name="deploy.jar.name" value="Sim305"/>
+    <property name="deploy.dir" value="deploy"/>
+    <property name="deploy.jar" value="${deploy.dir}/${deploy.jar.name}.jar"/>
+
+    <echo message="Packaging ${application.title} into a single JAR at ${deploy.jar}"/>
+
+    <delete dir="${deploy.dir}"/>
+    <mkdir dir="${deploy.dir}"/>
+
+    <jar destfile="${deploy.dir}/temp_final.jar" filesetmanifest="skip">
+        <zipgroupfileset dir="dist" includes="*.jar"/>
+        <!-- zipgroupfileset dir="dist/lib" includes="*.jar"/ -->
+        <zipgroupfileset dir="dist/lib" includes="xercesImpl.jar"/>
+
+        <manifest>
+            <attribute name="Main-Class" value="${main.class}"/>
+        </manifest>
+    </jar>
+
+    <zip destfile="${deploy.jar}">
+        <zipfileset src="${deploy.dir}/temp_final.jar"
+        excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/>
+    </zip>
+
+    <delete file="${deploy.dir}/temp_final.jar"/>
+
+    <!--                   *** Build CAD Server Only Jar ***         -->
+      <jar destfile="${deploy.dir}/CADserver.jar"
+       basedir="${build.dir}/classes"
+       includes="tmcsim/cadsimulator/**, tmcsim/common/**"
+       excludes="**/Test.class">
+        <manifest>
+            <attribute name="Main-Class" value="tmcsim.cadsimulator.CADSimulator"/>
+        </manifest>
+      </jar>
+
+      <!--                   *** Build Sim Manager Only Jar ***         -->
+      <jar destfile="${deploy.dir}/SimManager.jar"
+       basedir="${build.dir}/classes"
+       includes="tmcsim/simulationmanager/**, tmcsim/common/**"
+       excludes="**/Test.class">
+        <manifest>
+            <attribute name="Main-Class" value="tmcsim.simulationmanager.SimulationManager"/>
+        </manifest>
+      </jar>
+    
+      <!--                   *** Build CAD Client Only Jar ***         -->
+      <jar destfile="${deploy.dir}/CADClient.jar" filesetmanifest="skip"
+       basedir="${build.dir}/classes"
+       includes="tmcsim/client/**, tmcsim/common/**, tmcsim/interfaces/**">
+        <manifest>
+            <attribute name="Main-Class" value="tmcsim.client.CADClient"/>
+        </manifest>
+      </jar>
+</target>
+    <!--
+
+    There exist several targets which are by default empty and which can be 
+    used for execution of your tasks. These targets are usually executed 
+    before and after some main targets. They are: 
+
+      -pre-init:                 called before initialization of project properties
+      -post-init:                called after initialization of project properties
+      -pre-compile:              called before javac compilation
+      -post-compile:             called after javac compilation
+      -pre-compile-single:       called before javac compilation of single file
+      -post-compile-single:      called after javac compilation of single file
+      -pre-compile-test:         called before javac compilation of JUnit tests
+      -post-compile-test:        called after javac compilation of JUnit tests
+      -pre-compile-test-single:  called before javac compilation of single JUnit test
+      -post-compile-test-single: called after javac compilation of single JUunit test
+      -pre-jar:                  called before JAR building
+      -post-jar:                 called after JAR building
+      -post-clean:               called after cleaning build products
+
+    (Targets beginning with '-' are not intended to be called on their own.)
+
+    Example of inserting an obfuscator after compilation could look like this:
+
+        <target name="-post-compile">
+            <obfuscate>
+                <fileset dir="${build.classes.dir}"/>
+            </obfuscate>
+        </target>
+
+    For list of available properties check the imported 
+    nbproject/build-impl.xml file. 
+
+
+    Another way to customize the build is by overriding existing main targets.
+    The targets of interest are: 
+
+      -init-macrodef-javac:     defines macro for javac compilation
+      -init-macrodef-junit:     defines macro for junit execution
+      -init-macrodef-debug:     defines macro for class debugging
+      -init-macrodef-java:      defines macro for class execution
+      -do-jar-with-manifest:    JAR building (if you are using a manifest)
+      -do-jar-without-manifest: JAR building (if you are not using a manifest)
+      run:                      execution of project 
+      -javadoc-build:           Javadoc generation
+      test-report:              JUnit report generation
+
+    An example of overriding the target for project execution could look like this:
+
+        <target name="run" depends="TMCSim-impl.jar">
+            <exec dir="bin" executable="launcher.exe">
+                <arg file="${dist.jar}"/>
+            </exec>
+        </target>
+
+    Notice that the overridden target depends on the jar target and not only on 
+    the compile target as the regular run target does. Again, for a list of available 
+    properties which you can use, check the target you are overriding in the
+    nbproject/build-impl.xml file. 
+
+    -->
+</project>
Index: trunk/IDE_metadata/NetBeans/TMCSim/nbproject/build-impl.xml
===================================================================
--- trunk/IDE_metadata/NetBeans/TMCSim/nbproject/build-impl.xml	(revision 2)
+++ trunk/IDE_metadata/NetBeans/TMCSim/nbproject/build-impl.xml	(revision 2)
@@ -0,0 +1,1411 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT  ***
+***         EDIT ../build.xml INSTEAD         ***
+
+For the purpose of easier reading the script
+is divided into following sections:
+
+  - initialization
+  - compilation
+  - jar
+  - execution
+  - debugging
+  - javadoc
+  - test compilation
+  - test execution
+  - test debugging
+  - applet
+  - cleanup
+
+        -->
+<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="TMCSim-impl">
+    <fail message="Please build using Ant 1.8.0 or higher.">
+        <condition>
+            <not>
+                <antversion atleast="1.8.0"/>
+            </not>
+        </condition>
+    </fail>
+    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
+    <!-- 
+                ======================
+                INITIALIZATION SECTION 
+                ======================
+            -->
+    <target name="-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init" name="-init-private">
+        <property file="nbproject/private/config.properties"/>
+        <property file="nbproject/private/configs/${config}.properties"/>
+        <property file="nbproject/private/private.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private" name="-init-user">
+        <property file="${user.properties.file}"/>
+        <!-- The two properties below are usually overridden -->
+        <!-- by the active platform. Just a fallback. -->
+        <property name="default.javac.source" value="1.4"/>
+        <property name="default.javac.target" value="1.4"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user" name="-init-project">
+        <property file="nbproject/configs/${config}.properties"/>
+        <property file="nbproject/project.properties"/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
+        <available file="${manifest.file}" property="manifest.available"/>
+        <condition property="splashscreen.available">
+            <and>
+                <not>
+                    <equals arg1="${application.splash}" arg2="" trim="true"/>
+                </not>
+                <available file="${application.splash}"/>
+            </and>
+        </condition>
+        <condition property="main.class.available">
+            <and>
+                <isset property="main.class"/>
+                <not>
+                    <equals arg1="${main.class}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="manifest.available+main.class">
+            <and>
+                <isset property="manifest.available"/>
+                <isset property="main.class.available"/>
+            </and>
+        </condition>
+        <condition property="do.archive">
+            <not>
+                <istrue value="${jar.archive.disabled}"/>
+            </not>
+        </condition>
+        <condition property="do.mkdist">
+            <and>
+                <isset property="do.archive"/>
+                <isset property="libs.CopyLibs.classpath"/>
+                <not>
+                    <istrue value="${mkdist.disabled}"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="manifest.available+main.class+mkdist.available">
+            <and>
+                <istrue value="${manifest.available+main.class}"/>
+                <isset property="do.mkdist"/>
+            </and>
+        </condition>
+        <condition property="do.archive+manifest.available">
+            <and>
+                <isset property="manifest.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+main.class.available">
+            <and>
+                <isset property="main.class.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+splashscreen.available">
+            <and>
+                <isset property="splashscreen.available"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="do.archive+manifest.available+main.class">
+            <and>
+                <istrue value="${manifest.available+main.class}"/>
+                <istrue value="${do.archive}"/>
+            </and>
+        </condition>
+        <condition property="manifest.available-mkdist.available">
+            <or>
+                <istrue value="${manifest.available}"/>
+                <isset property="do.mkdist"/>
+            </or>
+        </condition>
+        <condition property="manifest.available+main.class-mkdist.available">
+            <or>
+                <istrue value="${manifest.available+main.class}"/>
+                <isset property="do.mkdist"/>
+            </or>
+        </condition>
+        <condition property="have.tests">
+            <or>
+                <available file="${test.src.dir}"/>
+            </or>
+        </condition>
+        <condition property="have.sources">
+            <or>
+                <available file="${src.dir}"/>
+            </or>
+        </condition>
+        <condition property="netbeans.home+have.tests">
+            <and>
+                <isset property="netbeans.home"/>
+                <isset property="have.tests"/>
+            </and>
+        </condition>
+        <condition property="no.javadoc.preview">
+            <and>
+                <isset property="javadoc.preview"/>
+                <isfalse value="${javadoc.preview}"/>
+            </and>
+        </condition>
+        <property name="run.jvmargs" value=""/>
+        <property name="run.jvmargs.ide" value=""/>
+        <property name="javac.compilerargs" value=""/>
+        <property name="work.dir" value="${basedir}"/>
+        <condition property="no.deps">
+            <and>
+                <istrue value="${no.dependencies}"/>
+            </and>
+        </condition>
+        <property name="javac.debug" value="true"/>
+        <property name="javadoc.preview" value="true"/>
+        <property name="application.args" value=""/>
+        <property name="source.encoding" value="${file.encoding}"/>
+        <property name="runtime.encoding" value="${source.encoding}"/>
+        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
+            <and>
+                <isset property="javadoc.encoding"/>
+                <not>
+                    <equals arg1="${javadoc.encoding}" arg2=""/>
+                </not>
+            </and>
+        </condition>
+        <property name="javadoc.encoding.used" value="${source.encoding}"/>
+        <property name="includes" value="**"/>
+        <property name="excludes" value=""/>
+        <property name="do.depend" value="false"/>
+        <condition property="do.depend.true">
+            <istrue value="${do.depend}"/>
+        </condition>
+        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
+        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
+            <length length="0" string="${endorsed.classpath}" when="greater"/>
+        </condition>
+        <condition else="false" property="jdkBug6558476">
+            <and>
+                <matches pattern="1\.[56]" string="${java.specification.version}"/>
+                <not>
+                    <os family="unix"/>
+                </not>
+            </and>
+        </condition>
+        <property name="javac.fork" value="${jdkBug6558476}"/>
+        <property name="jar.index" value="false"/>
+        <property name="jar.index.metainf" value="${jar.index}"/>
+        <property name="copylibs.rebase" value="true"/>
+        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
+        <condition property="junit.available">
+            <or>
+                <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
+                <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
+            </or>
+        </condition>
+        <condition property="testng.available">
+            <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
+        </condition>
+        <condition property="junit+testng.available">
+            <and>
+                <istrue value="${junit.available}"/>
+                <istrue value="${testng.available}"/>
+            </and>
+        </condition>
+        <condition else="testng" property="testng.mode" value="mixed">
+            <istrue value="${junit+testng.available}"/>
+        </condition>
+        <condition else="" property="testng.debug.mode" value="-mixed">
+            <istrue value="${junit+testng.available}"/>
+        </condition>
+    </target>
+    <target name="-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
+        <fail unless="src.dir">Must set src.dir</fail>
+        <fail unless="test.src.dir">Must set test.src.dir</fail>
+        <fail unless="build.dir">Must set build.dir</fail>
+        <fail unless="dist.dir">Must set dist.dir</fail>
+        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
+        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
+        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
+        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
+        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
+        <fail unless="dist.jar">Must set dist.jar</fail>
+    </target>
+    <target name="-init-macrodef-property">
+        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${@{value}}"/>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="sourcepath"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <mkdir dir="@{apgeneratedsrcdir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <compilerarg value="-processorpath"/>
+                    <compilerarg path="@{processorpath}:${empty.dir}"/>
+                    <compilerarg line="${ap.processors.internal}"/>
+                    <compilerarg line="${annotation.processing.processor.options}"/>
+                    <compilerarg value="-s"/>
+                    <compilerarg path="@{apgeneratedsrcdir}"/>
+                    <compilerarg line="${ap.proc.none.internal}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
+        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <attribute default="${javac.processorpath}" name="processorpath"/>
+            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="${javac.debug}" name="debug"/>
+            <attribute default="${empty.dir}" name="sourcepath"/>
+            <attribute default="${empty.dir}" name="gensrcdir"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.dir}/empty" name="empty.dir"/>
+                <mkdir dir="${empty.dir}"/>
+                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
+                    <src>
+                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
+                            <include name="*"/>
+                        </dirset>
+                    </src>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <compilerarg line="${javac.compilerargs}"/>
+                    <customize/>
+                </javac>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
+        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${src.dir}" name="srcdir"/>
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <attribute default="${javac.classpath}" name="classpath"/>
+            <sequential>
+                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </depend>
+            </sequential>
+        </macrodef>
+        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${build.classes.dir}" name="destdir"/>
+            <sequential>
+                <fail unless="javac.includes">Must set javac.includes</fail>
+                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
+                    <path>
+                        <filelist dir="@{destdir}" files="${javac.includes}"/>
+                    </path>
+                    <globmapper from="*.java" to="*.class"/>
+                </pathconvert>
+                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
+                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
+                <delete>
+                    <files includesfile="${javac.includesfile.binary}"/>
+                </delete>
+                <delete>
+                    <fileset file="${javac.includesfile.binary}"/>
+                </delete>
+            </sequential>
+        </macrodef>
+    </target>
+    <target if="${junit.available}" name="-init-macrodef-junit-init">
+        <condition else="false" property="nb.junit.batch" value="true">
+            <and>
+                <istrue value="${junit.available}"/>
+                <not>
+                    <isset property="test.method"/>
+                </not>
+            </and>
+        </condition>
+        <condition else="false" property="nb.junit.single" value="true">
+            <and>
+                <istrue value="${junit.available}"/>
+                <isset property="test.method"/>
+            </and>
+        </condition>
+    </target>
+    <target name="-init-test-properties">
+        <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
+        <property name="test.binarytestincludes" value=""/>
+        <property name="test.binaryexcludes" value=""/>
+    </target>
+    <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property name="junit.forkmode" value="perTest"/>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg value="-ea"/>
+                    <customize/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
+        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property name="junit.forkmode" value="perTest"/>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                    <batchtest todir="${build.test.results.dir}">
+                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+                            <filename name="@{testincludes}"/>
+                        </fileset>
+                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
+                            <filename name="${test.binarytestincludes}"/>
+                        </fileset>
+                    </batchtest>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg value="-ea"/>
+                    <customize/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
+    <target if="${testng.available}" name="-init-macrodef-testng">
+        <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
+                    <isset property="test.method"/>
+                </condition>
+                <union id="test.set">
+                    <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
+                        <filename name="@{testincludes}"/>
+                    </fileset>
+                </union>
+                <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
+                <testng classfilesetref="test.set" failureProperty="tests.failed" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="TMCSim" testname="TestNG tests" workingDir="${work.dir}">
+                    <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
+                    <propertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </propertyset>
+                    <customize/>
+                </testng>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-test-impl">
+        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <echo>No tests executed.</echo>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
+        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize/>
+                </j2seproject3:junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
+        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize/>
+                </j2seproject3:testng>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
+        <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <sequential>
+                <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize>
+                        <classpath>
+                            <path path="${run.test.classpath}"/>
+                        </classpath>
+                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                        <jvmarg line="${run.jvmargs}"/>
+                        <jvmarg line="${run.jvmargs.ide}"/>
+                    </customize>
+                </j2seproject3:test-impl>
+            </sequential>
+        </macrodef>
+    </target>
+    <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
+        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property name="junit.forkmode" value="perTest"/>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg value="-ea"/>
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+                    <customize/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
+        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property name="junit.forkmode" value="perTest"/>
+                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
+                    <batchtest todir="${build.test.results.dir}">
+                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+                            <filename name="@{testincludes}"/>
+                        </fileset>
+                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
+                            <filename name="${test.binarytestincludes}"/>
+                        </fileset>
+                    </batchtest>
+                    <syspropertyset>
+                        <propertyref prefix="test-sys-prop."/>
+                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <formatter type="brief" usefile="false"/>
+                    <formatter type="xml"/>
+                    <jvmarg value="-ea"/>
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+                    <customize/>
+                </junit>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
+        <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <element implicit="true" name="customize" optional="true"/>
+            <sequential>
+                <j2seproject3:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize/>
+                </j2seproject3:junit-debug>
+            </sequential>
+        </macrodef>
+    </target>
+    <target if="${testng.available}" name="-init-macrodef-testng-debug">
+        <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <element name="customize2" optional="true"/>
+            <sequential>
+                <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
+                    <isset property="test.method"/>
+                </condition>
+                <condition else="-suitename TMCSim -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
+                    <matches pattern=".*\.xml" string="@{testClass}"/>
+                </condition>
+                <delete dir="${build.test.results.dir}" quiet="true"/>
+                <mkdir dir="${build.test.results.dir}"/>
+                <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
+                    <customize>
+                        <customize2/>
+                        <jvmarg value="-ea"/>
+                        <arg line="${testng.debug.mode}"/>
+                        <arg line="-d ${build.test.results.dir}"/>
+                        <arg line="-listener org.testng.reporters.VerboseReporter"/>
+                        <arg line="${testng.cmd.args}"/>
+                    </customize>
+                </j2seproject3:debug>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
+        <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <element implicit="true" name="customize2" optional="true"/>
+            <sequential>
+                <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
+                    <customize2/>
+                </j2seproject3:testng-debug>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
+        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <sequential>
+                <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
+                    <customize>
+                        <classpath>
+                            <path path="${run.test.classpath}"/>
+                        </classpath>
+                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                        <jvmarg line="${run.jvmargs}"/>
+                        <jvmarg line="${run.jvmargs.ide}"/>
+                    </customize>
+                </j2seproject3:test-debug-impl>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
+        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${includes}" name="includes"/>
+            <attribute default="${excludes}" name="excludes"/>
+            <attribute default="**" name="testincludes"/>
+            <attribute default="" name="testmethods"/>
+            <attribute default="${main.class}" name="testClass"/>
+            <attribute default="" name="testMethod"/>
+            <sequential>
+                <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
+                    <customize2>
+                        <syspropertyset>
+                            <propertyref prefix="test-sys-prop."/>
+                            <mapper from="test-sys-prop.*" to="*" type="glob"/>
+                        </syspropertyset>
+                    </customize2>
+                </j2seproject3:testng-debug-impl>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
+    <!--
+                pre NB7.2 profiling section; consider it deprecated
+            -->
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
+    <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
+        <macrodef name="resolve">
+            <attribute name="name"/>
+            <attribute name="value"/>
+            <sequential>
+                <property name="@{name}" value="${env.@{value}}"/>
+            </sequential>
+        </macrodef>
+        <macrodef name="profile">
+            <attribute default="${main.class}" name="classname"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property environment="env"/>
+                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
+                <java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
+                    <jvmarg line="${profiler.info.jvmargs}"/>
+                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+                    <arg line="${application.args}"/>
+                    <classpath>
+                        <path path="${run.classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
+        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
+        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
+    </target>
+    <!--
+                end of pre NB7.2 profiling section
+            -->
+    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
+        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${main.class}" name="name"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <attribute default="" name="stopclassname"/>
+            <sequential>
+                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                </nbjpdastart>
+            </sequential>
+        </macrodef>
+        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${build.classes.dir}" name="dir"/>
+            <sequential>
+                <nbjpdareload>
+                    <fileset dir="@{dir}" includes="${fix.classes}">
+                        <include name="${fix.includes}*.class"/>
+                    </fileset>
+                </nbjpdareload>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-debug-args">
+        <property name="version-output" value="java version &quot;${ant.java.version}"/>
+        <condition property="have-jdk-older-than-1.4">
+            <or>
+                <contains string="${version-output}" substring="java version &quot;1.0"/>
+                <contains string="${version-output}" substring="java version &quot;1.1"/>
+                <contains string="${version-output}" substring="java version &quot;1.2"/>
+                <contains string="${version-output}" substring="java version &quot;1.3"/>
+            </or>
+        </condition>
+        <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
+            <istrue value="${have-jdk-older-than-1.4}"/>
+        </condition>
+        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
+            <os family="windows"/>
+        </condition>
+        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
+            <isset property="debug.transport"/>
+        </condition>
+    </target>
+    <target depends="-init-debug-args" name="-init-macrodef-debug">
+        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${debug.classpath}" name="classpath"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" fork="true">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg line="${debug-args-line}"/>
+                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <jvmarg line="${run.jvmargs.ide}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-java">
+        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <attribute default="${main.class}" name="classname"/>
+            <attribute default="${run.classpath}" name="classpath"/>
+            <attribute default="jvm" name="jvm"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <java classname="@{classname}" dir="${work.dir}" fork="true">
+                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
+                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
+                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
+                    <jvmarg line="${run.jvmargs}"/>
+                    <jvmarg line="${run.jvmargs.ide}"/>
+                    <classpath>
+                        <path path="@{classpath}"/>
+                    </classpath>
+                    <syspropertyset>
+                        <propertyref prefix="run-sys-prop."/>
+                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
+                    </syspropertyset>
+                    <customize/>
+                </java>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-macrodef-copylibs">
+        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
+            <attribute default="${manifest.file}" name="manifest"/>
+            <element name="customize" optional="true"/>
+            <sequential>
+                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+                <pathconvert property="run.classpath.without.build.classes.dir">
+                    <path path="${run.classpath}"/>
+                    <map from="${build.classes.dir.resolved}" to=""/>
+                </pathconvert>
+                <pathconvert pathsep=" " property="jar.classpath">
+                    <path path="${run.classpath.without.build.classes.dir}"/>
+                    <chainedmapper>
+                        <flattenmapper/>
+                        <filtermapper>
+                            <replacestring from=" " to="%20"/>
+                        </filtermapper>
+                        <globmapper from="*" to="lib/*"/>
+                    </chainedmapper>
+                </pathconvert>
+                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
+                <copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+                    <fileset dir="${build.classes.dir}"/>
+                    <manifest>
+                        <attribute name="Class-Path" value="${jar.classpath}"/>
+                        <customize/>
+                    </manifest>
+                </copylibs>
+            </sequential>
+        </macrodef>
+    </target>
+    <target name="-init-presetdef-jar">
+        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
+            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
+                <j2seproject1:fileset dir="${build.classes.dir}"/>
+            </jar>
+        </presetdef>
+    </target>
+    <target name="-init-ap-cmdline-properties">
+        <property name="annotation.processing.enabled" value="true"/>
+        <property name="annotation.processing.processors.list" value=""/>
+        <property name="annotation.processing.processor.options" value=""/>
+        <property name="annotation.processing.run.all.processors" value="true"/>
+        <property name="javac.processorpath" value="${javac.classpath}"/>
+        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
+        <condition property="ap.supported.internal" value="true">
+            <not>
+                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
+            </not>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
+        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
+            <isfalse value="${annotation.processing.run.all.processors}"/>
+        </condition>
+        <condition else="" property="ap.proc.none.internal" value="-proc:none">
+            <isfalse value="${annotation.processing.enabled}"/>
+        </condition>
+    </target>
+    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
+        <property name="ap.cmd.line.internal" value=""/>
+    </target>
+    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
+    <!--
+                ===================
+                COMPILATION SECTION
+                ===================
+            -->
+    <target name="-deps-jar-init" unless="built-jar.properties">
+        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
+        <delete file="${built-jar.properties}" quiet="true"/>
+    </target>
+    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
+        <echo level="warn" message="Cycle detected: TMCSim was already built"/>
+    </target>
+    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
+        <mkdir dir="${build.dir}"/>
+        <touch file="${built-jar.properties}" verbose="false"/>
+        <property file="${built-jar.properties}" prefix="already.built.jar."/>
+        <antcall target="-warn-already-built-jar"/>
+        <propertyfile file="${built-jar.properties}">
+            <entry key="${basedir}" value=""/>
+        </propertyfile>
+    </target>
+    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
+    <target depends="init" name="-check-automatic-build">
+        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
+    </target>
+    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
+        <antcall target="clean"/>
+    </target>
+    <target depends="init,deps-jar" name="-pre-pre-compile">
+        <mkdir dir="${build.classes.dir}"/>
+    </target>
+    <target name="-pre-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="do.depend.true" name="-compile-depend">
+        <pathconvert property="build.generated.subdirs">
+            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="*"/>
+            </dirset>
+        </pathconvert>
+        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
+        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
+        <copy todir="${build.classes.dir}">
+            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target if="has.persistence.xml" name="-copy-persistence-xml">
+        <mkdir dir="${build.classes.dir}/META-INF"/>
+        <copy todir="${build.classes.dir}/META-INF">
+            <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
+        </copy>
+    </target>
+    <target name="-post-compile">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
+    <target name="-pre-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <j2seproject3:force-recompile/>
+        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
+    </target>
+    <target name="-post-compile-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
+    <!--
+                ====================
+                JAR BUILDING SECTION
+                ====================
+            -->
+    <target depends="init" name="-pre-pre-jar">
+        <dirname file="${dist.jar}" property="dist.jar.dir"/>
+        <mkdir dir="${dist.jar.dir}"/>
+    </target>
+    <target name="-pre-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
+        <j2seproject1:jar/>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
+        <j2seproject1:jar manifest="${manifest.file}"/>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
+        <j2seproject1:jar manifest="${manifest.file}">
+            <j2seproject1:manifest>
+                <j2seproject1:attribute name="Main-Class" value="${main.class}"/>
+            </j2seproject1:manifest>
+        </j2seproject1:jar>
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
+        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <pathconvert property="run.classpath.with.dist.jar">
+            <path path="${run.classpath}"/>
+            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
+        </pathconvert>
+        <echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
+    </target>
+    <target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+        <touch file="${tmp.manifest.file}" verbose="false"/>
+    </target>
+    <target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
+        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
+        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
+    </target>
+    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
+        <manifest file="${tmp.manifest.file}" mode="update">
+            <attribute name="Main-Class" value="${main.class}"/>
+        </manifest>
+    </target>
+    <target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
+        <basename file="${application.splash}" property="splashscreen.basename"/>
+        <mkdir dir="${build.classes.dir}/META-INF"/>
+        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
+        <manifest file="${tmp.manifest.file}" mode="update">
+            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
+        </manifest>
+    </target>
+    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
+        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
+        <echo level="info">To run this application from the command line without Ant, try:</echo>
+        <property location="${dist.jar}" name="dist.jar.resolved"/>
+        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
+    </target>
+    <target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
+        <delete>
+            <fileset file="${tmp.manifest.file}"/>
+        </delete>
+    </target>
+    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
+    <target name="-post-jar">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR." name="jar"/>
+    <!--
+                =================
+                EXECUTION SECTION
+                =================
+            -->
+    <target depends="init,compile" description="Run a main class." name="run">
+        <j2seproject1:java>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <target name="-do-not-recompile">
+        <property name="javac.includes.binary" value=""/>
+    </target>
+    <target depends="init,compile-single" name="run-single">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <j2seproject1:java classname="${run.class}"/>
+    </target>
+    <target depends="init,compile-test-single" name="run-test-with-main">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
+    </target>
+    <!--
+                =================
+                DEBUGGING SECTION
+                =================
+            -->
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
+        <j2seproject1:nbjpdastart name="${debug.class}"/>
+    </target>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
+    </target>
+    <target depends="init,compile" name="-debug-start-debuggee">
+        <j2seproject3:debug>
+            <customize>
+                <arg line="${application.args}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
+    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
+        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
+    </target>
+    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <j2seproject3:debug classname="${debug.class}"/>
+    </target>
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
+    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
+        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
+        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
+    </target>
+    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
+    <target depends="init" name="-pre-debug-fix">
+        <fail unless="fix.includes">Must set fix.includes</fail>
+        <property name="javac.includes" value="${fix.includes}.java"/>
+    </target>
+    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
+        <j2seproject1:nbjpdareload/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
+    <!--
+                =================
+                PROFILING SECTION
+                =================
+            -->
+    <!--
+                pre NB7.2 profiler integration
+            -->
+    <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
+        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile/>
+    </target>
+    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
+        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
+        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="${profile.class}"/>
+    </target>
+    <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
+        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <profile classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </profile>
+    </target>
+    <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
+        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
+        <nbprofiledirect>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+        </nbprofiledirect>
+        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
+            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
+            <jvmarg value="${profiler.info.jvmargs.agent}"/>
+            <jvmarg line="${profiler.info.jvmargs}"/>
+            <test name="${profile.class}"/>
+            <classpath>
+                <path path="${run.test.classpath}"/>
+            </classpath>
+            <syspropertyset>
+                <propertyref prefix="test-sys-prop."/>
+                <mapper from="test-sys-prop.*" to="*" type="glob"/>
+            </syspropertyset>
+            <formatter type="brief" usefile="false"/>
+            <formatter type="xml"/>
+        </junit>
+    </target>
+    <!--
+                end of pre NB72 profiling section
+            -->
+    <target if="netbeans.home" name="-profile-check">
+        <condition property="profiler.configured">
+            <or>
+                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
+                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
+            </or>
+        </condition>
+    </target>
+    <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
+        <startprofiler/>
+        <antcall target="run"/>
+    </target>
+    <target depends="-profile-check,-profile-single-pre72" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-single" unless="profiler.info.jvmargs.agent">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <startprofiler/>
+        <antcall target="run-single"/>
+    </target>
+    <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
+    <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
+        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+        <startprofiler/>
+        <antcall target="test-single"/>
+    </target>
+    <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
+        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
+        <startprofiler/>
+        <antcal target="run-test-with-main"/>
+    </target>
+    <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <startprofiler/>
+        <antcall target="run-applet"/>
+    </target>
+    <!--
+                ===============
+                JAVADOC SECTION
+                ===============
+            -->
+    <target depends="init" if="have.sources" name="-javadoc-build">
+        <mkdir dir="${dist.javadoc.dir}"/>
+        <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
+            <and>
+                <isset property="endorsed.classpath.cmd.line.arg"/>
+                <not>
+                    <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
+                </not>
+            </and>
+        </condition>
+        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
+            <classpath>
+                <path path="${javac.classpath}"/>
+            </classpath>
+            <fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/*.java"/>
+                <exclude name="*.java"/>
+            </fileset>
+            <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
+        </javadoc>
+        <copy todir="${dist.javadoc.dir}">
+            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
+                <include name="**/doc-files/**"/>
+            </fileset>
+        </copy>
+    </target>
+    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
+        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
+    </target>
+    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
+    <!--
+                =========================
+                TEST COMPILATION SECTION
+                =========================
+            -->
+    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
+        <mkdir dir="${build.test.classes.dir}"/>
+    </target>
+    <target name="-pre-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target if="do.depend.true" name="-compile-test-depend">
+        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
+    </target>
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
+        <copy todir="${build.test.classes.dir}">
+            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile-test">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
+    <target name="-pre-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
+        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
+        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
+        <copy todir="${build.test.classes.dir}">
+            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+        </copy>
+    </target>
+    <target name="-post-compile-test-single">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
+    <!--
+                =======================
+                TEST EXECUTION SECTION
+                =======================
+            -->
+    <target depends="init" if="have.tests" name="-pre-test-run">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
+        <j2seproject3:test testincludes="**/*Test.java"/>
+    </target>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init" if="have.tests" name="test-report"/>
+    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
+    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
+    <target depends="init" if="have.tests" name="-pre-test-run-single">
+        <mkdir dir="${build.test.results.dir}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
+        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
+        <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
+        <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
+        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
+        <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
+        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
+    <!--
+                =======================
+                TEST DEBUGGING SECTION
+                =======================
+            -->
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
+        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
+    </target>
+    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
+        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
+        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
+        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
+    </target>
+    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
+        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
+    </target>
+    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
+    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
+    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
+        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
+    </target>
+    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
+    <!--
+                =========================
+                APPLET EXECUTION SECTION
+                =========================
+            -->
+    <target depends="init,compile-single" name="run-applet">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <j2seproject1:java classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </j2seproject1:java>
+    </target>
+    <!--
+                =========================
+                APPLET DEBUGGING  SECTION
+                =========================
+            -->
+    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
+        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
+        <j2seproject3:debug classname="sun.applet.AppletViewer">
+            <customize>
+                <arg value="${applet.url}"/>
+            </customize>
+        </j2seproject3:debug>
+    </target>
+    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
+    <!--
+                ===============
+                CLEANUP SECTION
+                ===============
+            -->
+    <target name="-deps-clean-init" unless="built-clean.properties">
+        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
+        <delete file="${built-clean.properties}" quiet="true"/>
+    </target>
+    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
+        <echo level="warn" message="Cycle detected: TMCSim was already built"/>
+    </target>
+    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
+        <mkdir dir="${build.dir}"/>
+        <touch file="${built-clean.properties}" verbose="false"/>
+        <property file="${built-clean.properties}" prefix="already.built.clean."/>
+        <antcall target="-warn-already-built-clean"/>
+        <propertyfile file="${built-clean.properties}">
+            <entry key="${basedir}" value=""/>
+        </propertyfile>
+    </target>
+    <target depends="init" name="-do-clean">
+        <delete dir="${build.dir}"/>
+        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
+    </target>
+    <target name="-post-clean">
+        <!-- Empty placeholder for easier customization. -->
+        <!-- You can override this target in the ../build.xml file. -->
+    </target>
+    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
+    <target name="-check-call-dep">
+        <property file="${call.built.properties}" prefix="already.built."/>
+        <condition property="should.call.dep">
+            <and>
+                <not>
+                    <isset property="already.built.${call.subproject}"/>
+                </not>
+                <available file="${call.script}"/>
+            </and>
+        </condition>
+    </target>
+    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
+        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
+            <propertyset>
+                <propertyref prefix="transfer."/>
+                <mapper from="transfer.*" to="*" type="glob"/>
+            </propertyset>
+        </ant>
+    </target>
+</project>
Index: trunk/IDE_metadata/NetBeans/TMCSim/nbproject/project.properties
===================================================================
--- trunk/IDE_metadata/NetBeans/TMCSim/nbproject/project.properties	(revision 2)
+++ trunk/IDE_metadata/NetBeans/TMCSim/nbproject/project.properties	(revision 2)
@@ -0,0 +1,81 @@
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.processors.list=
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.title=TMCSim
+application.vendor=jdalbey
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+    ${run.classpath}
+debug.test.classpath=\
+    ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/TMCSim.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=
+file.reference.tmc-simulator-src=../../../src
+file.reference.tmc-simulator-test=../../../test
+file.reference.uispec4j-jdk17.jar=../../../lib/uispec4j-jdk17.jar
+file.reference.xercesImpl.jar=../../../src/tmcsim/cadsimulator/CADSimulator_lib/xercesImpl.jar
+includes=**
+jar.compress=false
+javac.classpath=\
+    ${file.reference.xercesImpl.jar}:\
+    ${file.reference.uispec4j-jdk17.jar}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\
+    ${javac.classpath}
+javac.source=1.7
+javac.target=1.7
+javac.test.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}:\
+    ${libs.junit.classpath}
+javac.test.processorpath=\
+    ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+main.class=tmcsim.cadsimulator.CADSimulator
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+mkdist.disabled=false
+platform.active=default_platform
+run.classpath=\
+    ${javac.classpath}:\
+    ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project.
+# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
+# To set system properties for unit tests define test-sys-prop.name=value:
+run.jvmargs=
+run.test.classpath=\
+    ${javac.test.classpath}:\
+    ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=${file.reference.tmc-simulator-src}
+test.src.dir=${file.reference.tmc-simulator-test}
+work.dir=../../..
Index: trunk/IDE_metadata/NetBeans/TMCSim/nbproject/project.xml
===================================================================
--- trunk/IDE_metadata/NetBeans/TMCSim/nbproject/project.xml	(revision 2)
+++ trunk/IDE_metadata/NetBeans/TMCSim/nbproject/project.xml	(revision 2)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.java.j2seproject</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
+            <name>TMCSim</name>
+            <source-roots>
+                <root id="src.dir"/>
+            </source-roots>
+            <test-roots>
+                <root id="test.src.dir"/>
+            </test-roots>
+        </data>
+    </configuration>
+</project>
Index: trunk/IDE_metadata/NetBeans/TMCSim/nbproject/genfiles.properties
===================================================================
--- trunk/IDE_metadata/NetBeans/TMCSim/nbproject/genfiles.properties	(revision 2)
+++ trunk/IDE_metadata/NetBeans/TMCSim/nbproject/genfiles.properties	(revision 2)
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=6c7221c6
+build.xml.script.CRC32=dd7f3b15
+build.xml.stylesheet.CRC32=28e38971@1.56.1.46
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=6c7221c6
+nbproject/build-impl.xml.script.CRC32=b1dd34e8
+nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.1.46
Index: trunk/IDE_metadata/NetBeans/TMCSim/manifest.mf
===================================================================
--- trunk/IDE_metadata/NetBeans/TMCSim/manifest.mf	(revision 2)
+++ trunk/IDE_metadata/NetBeans/TMCSim/manifest.mf	(revision 2)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
Index: trunk/config/cad_client_config.properties
===================================================================
--- trunk/config/cad_client_config.properties	(revision 2)
+++ trunk/config/cad_client_config.properties	(revision 2)
@@ -0,0 +1,11 @@
+#
+#Wed Apr 05 13:48:05 PDT 2006
+CADPosition            = 2
+CADSimulatorHost       = 127.0.0.1
+CADUserID              = A1245
+CADSimulatorSocketPort = 4444
+CADRmiPort             = 4446
+#KeyboardType           = CAD
+#DisplayType            = FRAME
+DisplayType            = FULL_SCREEN
+KeyboardType           = STD
Index: trunk/config/cad_simulator_media_config.properties
===================================================================
--- trunk/config/cad_simulator_media_config.properties	(revision 2)
+++ trunk/config/cad_simulator_media_config.properties	(revision 2)
@@ -0,0 +1,2 @@
+DVDPlayerXML           = config/dvdplayers.xml
+StillImagesXML         = config/stillimages.xml
Index: trunk/config/cad_simulator_config.properties
===================================================================
--- trunk/config/cad_simulator_config.properties	(revision 2)
+++ trunk/config/cad_simulator_config.properties	(revision 2)
@@ -0,0 +1,8 @@
+CADClientPort          = 4444 
+CoordinatorRMIPort     = 4445 
+CADRmiPort             = 4446
+CMSDiversionXML        = config/cmsdiversions.xml
+AudioFileLocation      = audio/
+ParamicsProperties     = config/cad_simulator_paramics_config.properties
+ATMSProperties         = config/cad_simulator_atms_config.properties
+MediaProperties        = config/cad_simulator_media_config.properties
Index: trunk/config/cadUsers.xml
===================================================================
--- trunk/config/cadUsers.xml	(revision 2)
+++ trunk/config/cadUsers.xml	(revision 2)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1"?> 
+<CAD_USERS>
+	<USER>
+		<ID>A12345</ID>
+		<PERMISSION_LEVEL>CHP</PERMISSION_LEVEL>
+	</USER>
+	<USER>
+		<ID>A11111</ID>
+		<PERMISSION_LEVEL>TMC</PERMISSION_LEVEL>
+	</USER>
+	<USER>
+		<ID>A22222</ID>
+		<PERMISSION_LEVEL>TMC</PERMISSION_LEVEL>
+	</USER>
+	<USER>
+		<ID>A33333</ID>
+		<PERMISSION_LEVEL>TMC</PERMISSION_LEVEL>
+	</USER>
+	<USER>
+		<ID>A44444</ID>
+		<PERMISSION_LEVEL>TMC</PERMISSION_LEVEL>
+	</USER>
+	<USER>
+		<ID>A55555</ID>
+		<PERMISSION_LEVEL>TMC</PERMISSION_LEVEL>
+	</USER>
+</CAD_USERS>
Index: trunk/config/dvdplayers.xml
===================================================================
--- trunk/config/dvdplayers.xml	(revision 2)
+++ trunk/config/dvdplayers.xml	(revision 2)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="ISO-8859-1"?> 
+<DVD_PLAYERS>
+     <DVD_PLAYER type="PioneerV5000" host="192.168.251.9" port="3001">
+     	<CCTV id="24" dir="S"/>
+        <INCIDENT log_num="187" title="4"/>
+        <RANGE min_speed="0" max_speed="20" title="3"/>
+        <RANGE min_speed="20" max_speed="35" title="2"/>
+        <RANGE min_speed="35" max_speed="1000" title="1"/>
+     </DVD_PLAYER>
+     <DVD_PLAYER type="PioneerV5000" host="192.168.251.9" port="3002">
+     	<CCTV id="97" dir="N"/>
+        <INCIDENT log_num="188" title="4"/>
+        <RANGE min_speed="0" max_speed="20" title="3"/>
+        <RANGE min_speed="20" max_speed="35" title="2"/>
+        <RANGE min_speed="35" max_speed="1000" title="1"/>
+     </DVD_PLAYER>
+     <DVD_PLAYER type="PioneerV5000" host="192.168.251.9" port="3003">
+     	<CCTV id="28" dir="S"/>
+        <INCIDENT log_num="189" title="4"/>
+        <RANGE min_speed="0" max_speed="20" title="3"/>
+        <RANGE min_speed="20" max_speed="35" title="2"/>
+        <RANGE min_speed="35" max_speed="1000" title="1"/>
+     </DVD_PLAYER>
+     <DVD_PLAYER type="PioneerV5000" host="192.168.251.9" port="3004">
+     	<CCTV id="16" dir="S"/>
+        <INCIDENT log_num="190" title="4"/>
+        <RANGE min_speed="0" max_speed="20" title="3"/>
+        <RANGE min_speed="20" max_speed="35" title="2"/>
+        <RANGE min_speed="35" max_speed="1000" title="1"/>
+     </DVD_PLAYER>
+     <DVD_PLAYER type="PioneerV5000" host="192.168.251.9" port="3005">
+     	<CCTV id="171" dir="S"/>
+        <INCIDENT log_num="191" title="4"/>
+        <RANGE min_speed="0" max_speed="20" title="3"/>
+        <RANGE min_speed="20" max_speed="35" title="2"/>
+        <RANGE min_speed="35" max_speed="1000" title="1"/>
+     </DVD_PLAYER>
+</DVD_PLAYERS>
Index: trunk/config/stillimages.xml
===================================================================
--- trunk/config/stillimages.xml	(revision 2)
+++ trunk/config/stillimages.xml	(revision 2)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="ISO-8859-1"?> 
+<STILL_IMAGES>
+	<CCTV id="24" atms_id="1200079" dir="S">
+		<RANGE min_speed="0" max_speed="20" filename="CAM24_STOPPED"/>
+		<RANGE min_speed="20" max_speed="35" filename="CAM24_SLOW"/>
+		<RANGE min_speed="35" max_speed="1000" filename="CAM24_FREEFLOW"/>
+		<INCIDENT log_num="187" filename="CAM24_INCIDENT_187"/>
+	</CCTV>
+	<CCTV id="97" atms_id="1213015" dir="N">
+		<RANGE min_speed="0" max_speed="20" filename="CAM97_STOPPED"/>
+		<RANGE min_speed="20" max_speed="35" filename="CAM97_SLOW"/>
+		<RANGE min_speed="35" max_speed="1000" filename="CAM97_FREEFLOW"/>
+		<INCIDENT log_num="188" filename="CAM97_INCIDENT_188"/>
+	</CCTV>
+	<CCTV id="28" atms_id="1200083" dir="N">
+		<RANGE min_speed="0" max_speed="20" filename="CAM28_STOPPED"/>
+		<RANGE min_speed="20" max_speed="35" filename="CAM28_SLOW"/>
+		<RANGE min_speed="35" max_speed="1000" filename="CAM28_FREEFLOW"/>
+		<INCIDENT log_num="189" filename="CAM28_INCIDENT_189"/>
+	</CCTV>
+	<CCTV id="16" atms_id="1200061" dir="S">
+		<RANGE min_speed="0" max_speed="20" filename="CAM16_STOPPED"/>
+		<RANGE min_speed="20" max_speed="35" filename="CAM16_SLOW"/>
+		<RANGE min_speed="35" max_speed="1000" filename="CAM16_FREEFLOW"/>
+		<INCIDENT log_num="190" filename="CAM16_INCIDENT_190"/>
+	</CCTV>
+	<CCTV id="166" atms_id="1213007" dir="S">
+		<RANGE min_speed="0" max_speed="20" filename="CAM166_STOPPED"/>
+		<RANGE min_speed="20" max_speed="35" filename="CAM166_SLOW"/>
+		<RANGE min_speed="35" max_speed="1000" filename="CAM166_FREEFLOW"/>
+		<INCIDENT log_num="191" filename="CAM166_INCIDENT_191"/>
+	</CCTV>
+</STILL_IMAGES>
Index: trunk/config/paramics_simulator_config.properties
===================================================================
--- trunk/config/paramics_simulator_config.properties	(revision 2)
+++ trunk/config/paramics_simulator_config.properties	(revision 2)
@@ -0,0 +1,4 @@
+WorkingDirectory    = C:/paramics/
+IncidentUpdateFile  = exchange.xml
+ParamicsStatusFile  = paramics_status.xml
+CameraStatusFile    = camera_status.xml
Index: trunk/config/paramics_communicator_logging.properties
===================================================================
--- trunk/config/paramics_communicator_logging.properties	(revision 2)
+++ trunk/config/paramics_communicator_logging.properties	(revision 2)
@@ -0,0 +1,15 @@
+handlers = java.util.logging.FileHandler, java.util.logging.ConsoleHandler
+    
+# Set the default logging level for the root logger
+tmcsim.level = ALL
+    
+# Set the default logging level for new FileHandler instances
+java.util.logging.FileHandler.level = ALL
+java.util.logging.FileHandler.pattern = logs/paramics_communicator.log
+java.util.logging.FileHandler.limit = 500000
+java.util.logging.FileHandler.count = 5
+java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
+
+    
+# Set the default formatter for new ConsoleHandler instances
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
Index: trunk/config/sim_manager_logging.properties
===================================================================
--- trunk/config/sim_manager_logging.properties	(revision 2)
+++ trunk/config/sim_manager_logging.properties	(revision 2)
@@ -0,0 +1,15 @@
+handlers = java.util.logging.FileHandler, java.util.logging.ConsoleHandler
+    
+# Set the default logging level for the root logger
+tmcsim.level = ALL
+    
+# Set the default logging level for new FileHandler instances
+java.util.logging.FileHandler.level = ALL
+java.util.logging.FileHandler.pattern = logs/sim_manager.log
+java.util.logging.FileHandler.limit = 500000
+java.util.logging.FileHandler.count = 5
+java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
+
+    
+# Set the default formatter for new ConsoleHandler instances
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
Index: trunk/config/cad_simulator_paramics_config.properties
===================================================================
--- trunk/config/cad_simulator_paramics_config.properties	(revision 2)
+++ trunk/config/cad_simulator_paramics_config.properties	(revision 2)
@@ -0,0 +1,8 @@
+ParamicsCommHost       = 192.168.251.45
+ParamicsCommPort       = 4450
+IncidentUpdateInterval = 30
+IncidentUpdateFile     = exchange.xml
+ParamicsStatusInterval = 15
+ParamicsStatusFile     = paramics_status.xml
+CameraStatusInterval   = 30
+CameraStatusFile       = camera_status.xml
Index: trunk/config/cad_client_logging.properties
===================================================================
--- trunk/config/cad_client_logging.properties	(revision 2)
+++ trunk/config/cad_client_logging.properties	(revision 2)
@@ -0,0 +1,15 @@
+handlers = java.util.logging.FileHandler, java.util.logging.ConsoleHandler
+    
+# Set the default logging level for the root logger
+tmcsim.level = ALL
+    
+# Set the default logging level for new FileHandler instances
+java.util.logging.FileHandler.level = ALL
+java.util.logging.FileHandler.pattern = logs/cad_client.log
+java.util.logging.FileHandler.limit = 500000
+java.util.logging.FileHandler.count = 5
+java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
+
+    
+# Set the default formatter for new ConsoleHandler instances
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
Index: trunk/config/cad_simulator_logging.properties
===================================================================
--- trunk/config/cad_simulator_logging.properties	(revision 2)
+++ trunk/config/cad_simulator_logging.properties	(revision 2)
@@ -0,0 +1,15 @@
+handlers = java.util.logging.FileHandler, java.util.logging.ConsoleHandler
+    
+# Set the default logging level for the root logger
+tmcsim.level = ALL
+    
+# Set the default logging level for new FileHandler instances
+java.util.logging.FileHandler.level = ALL
+java.util.logging.FileHandler.pattern = logs/cad_simulator.log
+java.util.logging.FileHandler.limit = 500000
+java.util.logging.FileHandler.count = 5
+java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
+
+    
+# Set the default formatter for new ConsoleHandler instances
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
Index: trunk/config/cmsdiversions.xml
===================================================================
--- trunk/config/cmsdiversions.xml	(revision 2)
+++ trunk/config/cmsdiversions.xml	(revision 2)
@@ -0,0 +1,499 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<DIVERSION_LIST>
+
+	<CMS>
+		<ID>95 - NB 5 @ El Toro</ID>
+		<POSTMILE>19.0</POSTMILE>
+		<INIT_ROUTE>NB 5</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>NB 5</ORIG_PATH>
+			<NEW_PATH>NB 405</NEW_PATH>
+			<DIV_PATH>N5_N5_N405</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>NB 405</ORIG_PATH>
+			<NEW_PATH>NB 5</NEW_PATH>
+			<DIV_PATH>N5_N405_N5</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+	
+	<CMS>
+		<ID>04 - NB 5 JSO Alton</ID>
+		<POSTMILE>22.0</POSTMILE>
+		<INIT_ROUTE>NB 5</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>NB 55</ORIG_PATH>
+			<NEW_PATH>NB 5</NEW_PATH>
+			<DIV_PATH>N5_N55_N5</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>	
+			<ORIG_PATH>NB 5</ORIG_PATH>
+			<NEW_PATH>NB 55</NEW_PATH>
+			<DIV_PATH>N5_N5_N55</DIV_PATH>
+			<MAX_DIVERSION>5</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>	
+			<ORIG_PATH>NB 133</ORIG_PATH>
+			<NEW_PATH>NB 5</NEW_PATH>
+			<DIV_PATH>N5_N133_N5</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>	
+			<ORIG_PATH>NB 5</ORIG_PATH>
+			<NEW_PATH>NB 133</NEW_PATH>
+			<DIV_PATH>N5_N5_N133</DIV_PATH>
+			<MAX_DIVERSION>5</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+	
+	<CMS>
+		<ID>75 - SB 5 @ Jeffery</ID>
+		<POSTMILE>24.99</POSTMILE>
+		<INIT_ROUTE>SB 5</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>SB 5</ORIG_PATH>
+			<NEW_PATH>SB 133</NEW_PATH>
+			<DIV_PATH>S5_S5_S133</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 5</ORIG_PATH>
+			<NEW_PATH>NB 133</NEW_PATH>
+			<DIV_PATH>S5_S5_N133</DIV_PATH>
+			<MAX_DIVERSION>10</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>NB 133</ORIG_PATH>
+			<NEW_PATH>SB 5</NEW_PATH>
+			<DIV_PATH>S5_N133_S5</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+
+	<CMS>
+		<ID>65 - SB 55 @ Santa Clara</ID>
+		<POSTMILE>12.3</POSTMILE>
+		<INIT_ROUTE>SB 55</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>SB 405</ORIG_PATH>
+			<NEW_PATH>SB 55</NEW_PATH>
+			<DIV_PATH>S55_S405_S55</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 5</ORIG_PATH>
+			<NEW_PATH>SB 55</NEW_PATH>
+			<DIV_PATH>S55_S5_S55</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 55</ORIG_PATH>
+			<NEW_PATH>SB 405</NEW_PATH>
+			<DIV_PATH>S55_S55_S405</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 55</ORIG_PATH>
+			<NEW_PATH>SB 5</NEW_PATH>
+			<DIV_PATH>S55_S55_S5</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+
+	<CMS>
+		<ID>92 - SB 5 @ 17th</ID>
+		<POSTMILE>32.4</POSTMILE>
+		<INIT_ROUTE>SB 5</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>SB 5</ORIG_PATH>
+			<NEW_PATH>SB 55</NEW_PATH>
+			<DIV_PATH>S5_S5_S55</DIV_PATH>
+			<MAX_DIVERSION>30</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 55</ORIG_PATH>
+			<NEW_PATH>SB 5</NEW_PATH>
+			<DIV_PATH>S5_S55_S5</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+	
+	<CMS>
+		<ID>72 - SB 55 @ Warner</ID>
+		<POSTMILE>8.6</POSTMILE>
+		<INIT_ROUTE>SB 55</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>SB 405</ORIG_PATH>
+			<NEW_PATH>SB 55</NEW_PATH>
+			<DIV_PATH>S55_S405_S55</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>NB 405</ORIG_PATH>
+			<NEW_PATH>SB 55</NEW_PATH>
+			<DIV_PATH>S55_N405_S55</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 55</ORIG_PATH>
+			<NEW_PATH>SB 405</NEW_PATH>
+			<DIV_PATH>S55_S55_S405</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 55</ORIG_PATH>
+			<NEW_PATH>NB 405</NEW_PATH>
+			<DIV_PATH>S55_S55_N405</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+	
+	<CMS>
+		<ID>94 - NB 55 @ Dyer</ID>
+		<POSTMILE>8.51</POSTMILE>
+		<INIT_ROUTE>NB 55</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>SB 5</ORIG_PATH>
+			<NEW_PATH>NB 55</NEW_PATH>
+			<DIV_PATH>N55_S5_N55</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>NB 5</ORIG_PATH>
+			<NEW_PATH>NB 55</NEW_PATH>
+			<DIV_PATH>N55_N5_N55</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>NB 55</ORIG_PATH>
+			<NEW_PATH>SB 5</NEW_PATH>
+			<DIV_PATH>N55_N55_S5</DIV_PATH>
+			<MAX_DIVERSION>30</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>NB 55</ORIG_PATH>
+			<NEW_PATH>NB 5</NEW_PATH>
+			<DIV_PATH>N55_N55_N5</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+
+	<CMS>			
+		<ID>01 - SB 405 @ Harbor</ID>
+		<POSTMILE>11.92</POSTMILE>
+		<INIT_ROUTE>SB 405</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>SB 55</ORIG_PATH>
+			<NEW_PATH>SB 405</NEW_PATH>
+			<DIV_PATH>S405_S55_S405</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>NB 55</ORIG_PATH>
+			<NEW_PATH>SB 405</NEW_PATH>
+			<DIV_PATH>S405_N55_S405</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 73</ORIG_PATH>
+			<NEW_PATH>SB 405</NEW_PATH>
+			<DIV_PATH>S405_S73_S405</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 405</ORIG_PATH>
+			<NEW_PATH>SB 73</NEW_PATH>
+			<DIV_PATH>S405_S405_S73</DIV_PATH>
+			<MAX_DIVERSION>20</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 405</ORIG_PATH>
+			<NEW_PATH>SB 55</NEW_PATH>
+			<DIV_PATH>S405_S405_S55</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 405</ORIG_PATH>
+			<NEW_PATH>NB 55</NEW_PATH>
+			<DIV_PATH>S405_S405_N55</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+	
+	
+	<CMS>
+		<ID>89 - SB 405 @ Von Karmen</ID>
+		<POSTMILE>7.4</POSTMILE>
+		<INIT_ROUTE>SB 405</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>SB 133</ORIG_PATH>
+			<NEW_PATH>SB 405</NEW_PATH>
+			<DIV_PATH>S405_S133_S405</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>    
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>NB 133</ORIG_PATH>
+			<NEW_PATH>SB 405</NEW_PATH>
+			<DIV_PATH>S405_N133_S405</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>   
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 405</ORIG_PATH>
+			<NEW_PATH>SB 133</NEW_PATH>
+			<DIV_PATH>S405_S405_S133</DIV_PATH>
+			<MAX_DIVERSION>10</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 405</ORIG_PATH>
+			<NEW_PATH>NB 133</NEW_PATH>
+			<DIV_PATH>S405_S405_N133</DIV_PATH>
+			<MAX_DIVERSION>10</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+
+	<CMS>
+		<ID>76 - SB 405 @ Jeffery</ID>
+		<POSTMILE>4.0</POSTMILE>
+		<INIT_ROUTE>SB 405</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>SB 405</ORIG_PATH>
+			<NEW_PATH>NB 133</NEW_PATH>
+			<DIV_PATH>S405_S405_N133</DIV_PATH>
+			<MAX_DIVERSION>20</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 405</ORIG_PATH>
+			<NEW_PATH>SB 133</NEW_PATH>
+			<DIV_PATH>S405_S405_S133</DIV_PATH>
+			<MAX_DIVERSION>20</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>NB 133</ORIG_PATH>
+			<NEW_PATH>SB 405</NEW_PATH>
+			<DIV_PATH>S405_N133_S405</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 133</ORIG_PATH>
+			<NEW_PATH>SB 405</NEW_PATH>
+			<DIV_PATH>S405_S133_S405</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+	
+	<CMS>
+		<ID>87 - NB 405 @ Harvard</ID>
+		<POSTMILE>7.3</POSTMILE>
+		<INIT_ROUTE>NB 405</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>SB 55</ORIG_PATH>
+			<NEW_PATH>NB 405</NEW_PATH>
+			<DIV_PATH>N405_S55_N405</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>NB 55</ORIG_PATH>
+			<NEW_PATH>NB 405</NEW_PATH>
+			<DIV_PATH>N405_N55_N405</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>NB 405</ORIG_PATH>
+			<NEW_PATH>SB 55</NEW_PATH>
+			<DIV_PATH>N405_N405_S55</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>NB 405</ORIG_PATH>
+			<NEW_PATH>NB 55</NEW_PATH>
+			<DIV_PATH>N405_N405_N55</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+
+
+	<CMS>
+		<ID>93 - NB 5 S/O Redhill</ID>
+		<POSTMILE>28.6</POSTMILE>
+		<INIT_ROUTE>NB 5</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>NB 5</ORIG_PATH>
+			<NEW_PATH>NB 55</NEW_PATH>
+			<DIV_PATH>N5_N5_N55</DIV_PATH>
+			<MAX_DIVERSION>30</MAX_DIVERSION>
+		</DIVERSION>	
+		<DIVERSION>
+			<ORIG_PATH>NB 5</ORIG_PATH>
+			<NEW_PATH>SB 55</NEW_PATH>
+			<DIV_PATH>N5_N5_S55</DIV_PATH>
+			<MAX_DIVERSION>20</MAX_DIVERSION>
+		</DIVERSION>	
+		<DIVERSION>
+			<ORIG_PATH>NB 55</ORIG_PATH>
+			<NEW_PATH>NB 5</NEW_PATH>
+			<DIV_PATH>N5_N55_N5</DIV_PATH>
+			<MAX_DIVERSION>20</MAX_DIVERSION>
+		</DIVERSION>	
+		<DIVERSION>
+			<ORIG_PATH>SB 5</ORIG_PATH>
+			<NEW_PATH>NB 5</NEW_PATH>
+			<DIV_PATH>N5_S55_N5</DIV_PATH>
+			<MAX_DIVERSION>20</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+
+	<CMS>
+		<ID>88 - NB 405 @ Irvine Center Drive</ID>
+		<POSTMILE>0.85</POSTMILE>
+		<INIT_ROUTE>NB 405</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>NB 405</ORIG_PATH>
+			<NEW_PATH>SB 133</NEW_PATH>
+			<DIV_PATH>N405_N405_S133</DIV_PATH>
+			<MAX_DIVERSION>20</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 133</ORIG_PATH>
+			<NEW_PATH>NB 405</NEW_PATH>
+			<DIV_PATH>N405_S133_N405</DIV_PATH>
+			<MAX_DIVERSION>50</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>NB 405</ORIG_PATH>
+			<NEW_PATH>NB 55</NEW_PATH>
+			<DIV_PATH>N405_N405_N55</DIV_PATH>
+			<MAX_DIVERSION>20</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>NB 55</ORIG_PATH>
+			<NEW_PATH>NB 405</NEW_PATH>
+			<DIV_PATH>N405_N55_N405</DIV_PATH>
+			<MAX_DIVERSION>20</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+	
+	
+	<CMS>
+		<ID>86 - SB 405 @ New Hampshire</ID>
+		<POSTMILE>11.92</POSTMILE>
+		<INIT_ROUTE>SB 405</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>SB 405</ORIG_PATH>
+			<NEW_PATH>SB 55</NEW_PATH>
+			<DIV_PATH>S405_S405_S55</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 55</ORIG_PATH>
+			<NEW_PATH>SB 405</NEW_PATH>
+			<DIV_PATH>S405_S55_S405</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 405</ORIG_PATH>
+			<NEW_PATH>SB 73</NEW_PATH>
+			<DIV_PATH>S405_S405_S73</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+	
+	<CMS>
+		<ID>97 - SB 55 @ Katella</ID>
+		<POSTMILE>14.73</POSTMILE>
+		<INIT_ROUTE>SB 55</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>SB 55</ORIG_PATH>
+			<NEW_PATH>SB 5</NEW_PATH>
+			<DIV_PATH>S55_S55_S5</DIV_PATH>
+			<MAX_DIVERSION>25</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 55</ORIG_PATH>
+			<NEW_PATH>NB 5</NEW_PATH>
+			<DIV_PATH>S55_S55_N5</DIV_PATH>
+			<MAX_DIVERSION>5</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 5</ORIG_PATH>
+			<NEW_PATH>SB 55</NEW_PATH>
+			<DIV_PATH>S55_S5_S55</DIV_PATH>
+			<MAX_DIVERSION>25</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+	
+	<CMS>
+		<ID>90 - SB 5 @ Broadway</ID>
+		<POSTMILE>38.68</POSTMILE>
+		<INIT_ROUTE>SB 5</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>SB 5</ORIG_PATH>
+			<NEW_PATH>SB 55</NEW_PATH>
+			<DIV_PATH>S5_S5_S55</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 55</ORIG_PATH>
+			<NEW_PATH>SB 5</NEW_PATH>
+			<DIV_PATH>S5_S55_S5</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+	
+	<CMS>
+		<ID>44 - SB 5 @ Anaheim</ID>
+		<POSTMILE>35.6</POSTMILE>
+		<INIT_ROUTE>SB 5</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>SB 5</ORIG_PATH>
+			<NEW_PATH>SB 55</NEW_PATH>
+			<DIV_PATH>S5_S5_S55</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>SB 55</ORIG_PATH>
+			<NEW_PATH>SB 5</NEW_PATH>
+			<DIV_PATH>S5_S55_S5</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+	
+	<CMS>
+		<ID>31 - NB 5 @ Aeropuerto</ID>
+		<POSTMILE>7.84</POSTMILE>
+		<INIT_ROUTE>NB 5</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>NB 5</ORIG_PATH>
+			<NEW_PATH>NB 405</NEW_PATH>
+			<DIV_PATH>N5_N5_N405</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>NB 405</ORIG_PATH>
+			<NEW_PATH>NB 5</NEW_PATH>
+			<DIV_PATH>N5_N405_N5</DIV_PATH>
+			<MAX_DIVERSION>40</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+	
+	<CMS>
+		<ID>74 - NB 5 @ Vista Hermosa</ID>
+		<POSTMILE>7.84</POSTMILE>
+		<INIT_ROUTE>NB 5</INIT_ROUTE>
+		<DIVERSION>
+			<ORIG_PATH>NB 5</ORIG_PATH>
+			<NEW_PATH>NB 405</NEW_PATH>
+			<DIV_PATH>N5_N5_N405</DIV_PATH>
+			<MAX_DIVERSION>20</MAX_DIVERSION>
+		</DIVERSION>
+		<DIVERSION>
+			<ORIG_PATH>NB 405</ORIG_PATH>
+			<NEW_PATH>NB 5</NEW_PATH>
+			<DIV_PATH>N5_N405_N5</DIV_PATH>
+			<MAX_DIVERSION>20</MAX_DIVERSION>
+		</DIVERSION>
+	</CMS>
+	
+</DIVERSION_LIST>
Index: trunk/config/cad_simulator_atms_config.properties
===================================================================
--- trunk/config/cad_simulator_atms_config.properties	(revision 2)
+++ trunk/config/cad_simulator_atms_config.properties	(revision 2)
@@ -0,0 +1,4 @@
+ATMSHost = 192.168.251.27
+Username = atms_mgr
+Password = atms_d12uci1
+ImageDir = /opt/d12uci/user_config/cctv
Index: trunk/config/paramics_communicator_config.properties
===================================================================
--- trunk/config/paramics_communicator_config.properties	(revision 2)
+++ trunk/config/paramics_communicator_config.properties	(revision 2)
@@ -0,0 +1,4 @@
+#
+#Wed Jun 14 15:40:00 PDT 2006
+WorkingDirectory=c\:\\
+SocketPort=4450
Index: trunk/config/sim_manager_config.properties
===================================================================
--- trunk/config/sim_manager_config.properties	(revision 2)
+++ trunk/config/sim_manager_config.properties	(revision 2)
@@ -0,0 +1,5 @@
+CADSimulatorHost       = 127.0.0.1
+CADSimulatorRMIPort    = 4445
+#ScriptDir              = c:\\program files
+ScriptDir              = scripts
+FakeParamicsConnection = true
Index: trunk/lib/jdstyle.xml
===================================================================
--- trunk/lib/jdstyle.xml	(revision 2)
+++ trunk/lib/jdstyle.xml	(revision 2)
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+<!--
+
+  Checkstyle configuration for CSc 301 at Cal Poly.
+
+  A relaxed version of these standards:
+      http://www.csc.calpoly.edu/%7Ejdalbey/SWE/code_std.html
+
+  To completely disable a check, just comment it out or delete it from the file.
+
+  Finally, it is worth reading the documentation:
+      http://checkstyle.sourceforge.net/
+
+  DOCUMENT HISTORY
+  1/5/2016 Relaxed even more.
+  5/3/2010 Relaxed some standards for CSc 301
+  9/24/09 Branched from CSc 309 and simplified for CSc 103.
+  4/9/06 Added Severity = Warning to several checks.
+  4/14/06 Removed check: EqualsHashCode
+          Don't require Javadoc on PRIVATE methods.
+          Changed LineLength to 89: The length of a line in Eclipse at 800x600 resolution.
+  4/19/06 Changed VisibilityModifier to protectedAllowed.
+          Allow types to have underscore characters in the name.
+  5/3/06  Made method length check a warning and instead
+          made JavaNCSS count an error.
+  5/22/06 Added custom check for one letter variable names.
+          Added custom check for logic structure comments.
+
+-->
+<module name="Checker">
+
+    <module name="TreeWalker">
+        <!-- Custom checks written for Dalbey's coding standard -->
+        <!-- Single character variable names not allowed.       -->
+        <module name="VariableNameLength"/>
+        <!-- Logic structures must be preceded by a comment.    -->
+        <module name="LogicComment"/>
+        <property name="tabWidth" value="4"/>
+
+        <!-- Checks for Naming Conventions.                  -->
+        <!-- See http://checkstyle.sf.net/config_naming.html -->
+        <module name="LocalFinalVariableName"/>
+        <module name="LocalVariableName"/>
+
+        <module name="MemberName"/>
+        <module name="MethodName"/>
+        <module name="PackageName"/>
+        <module name="ParameterName"/>
+        <module name="StaticVariableName"/>
+        <module name="TypeName">
+            <property name="format" value="^[A-Z][_a-zA-Z0-9]*$"/>
+        </module>
+
+        <!-- Checks for Size Violations.                    -->
+        <!-- See http://checkstyle.sf.net/config_sizes.html -->
+        <module name="LineLength">
+            <property name="max" value="89"/>
+        </module>
+        <module name="MethodLength">
+            <property name="max" value="60"/>
+            <property name="countEmpty" value="false"/>
+            <property name="severity" value="warning"/>
+        </module>
+        <module name="ParameterNumber"/>
+
+
+        <!-- Checks for whitespace                               -->
+        <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+        <module name="Indentation">
+            <property name="basicOffset" value="4"/>
+            <property name="braceAdjustment" value="0"/>
+            <property name="caseIndent" value="4"/>
+        </module>
+
+        <module name="EmptyBlock">
+		    <property name="option" value="stmt"/>
+		    <property name="tokens" value="LITERAL_CATCH"/>
+		</module>
+        <module name="TabCharacter"/>
+        <!-- left brace must be on a new line -->
+        <module name="LeftCurly">
+            <property name="option" value="nl"/>
+        </module>
+        <module name="NeedBraces"/>
+        <module name="RightCurly">
+            <property name="option" value="alone"/>
+        </module>
+
+
+        <!-- Checks for common coding problems               -->
+        <!-- See http://checkstyle.sf.net/config_coding.html -->
+        <module name="AvoidInlineConditionals"/>
+        <module name="EmptyStatement"/>
+        <module name="HiddenField">
+            <property name="ignoreConstructorParameter" value="true"/>
+            <property name="ignoreSetter" value="true"/>
+        </module>
+
+	
+        <module name="IllegalInstantiation"/>
+        <module name="InnerAssignment">
+            <property name="severity" value="warning"/>
+        </module>
+        <module name="SimplifyBooleanExpression"/>
+        <module name="SimplifyBooleanReturn"/>
+
+        <!-- Checks for class design                         -->
+        <!-- See http://checkstyle.sf.net/config_design.html -->
+        <module name="FinalClass"/>
+        <module name="InterfaceIsType"/>
+
+
+        <!-- Metrics checks.                   -->
+        <module name="ClassFanOutComplexity"/>
+
+        <module name="CyclomaticComplexity">
+            <property name="max" value="15"/>
+            <property name="severity" value="warning"/>
+        </module>
+
+        <!-- Miscellaneous other checks.                   -->
+        <!-- See http://checkstyle.sf.net/config_misc.html -->
+        <module name="ArrayTypeStyle"/>
+
+        <module name="StringLiteralEquality"/>
+        <module name="InnerAssignment"/>
+        <module name="FallThrough"/>
+        <module name="TodoComment"/>
+        <module name="UpperEll"/>
+        <!-- checkstyle 5.5 needed for these checks 
+        <module name="GenericWhitespace"/>   
+        -->
+    
+ </module> <!-- end TreeWalker -->
+    
+
+    <!-- checkstyle 5.5 needed for these checks
+    <module name="FileTabCharacter"/>
+    -->
+
+</module>
+
+
Index: trunk/scripts/full_script_2016.xml
===================================================================
--- trunk/scripts/full_script_2016.xml	(revision 2)
+++ trunk/scripts/full_script_2016.xml	(revision 2)
@@ -0,0 +1,4847 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE TMC_SCRIPT SYSTEM "script.dtd">
+
+<TMC_SCRIPT title="Full Simulation">
+
+	<SCRIPT_DATA>
+		<NEW_UNIT UnitNum = "14-14">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>55 at Dyer Rd</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>14-Santa Maria</AREA>
+			<BADGE_NUM>011234</BADGE_NUM>
+			<OFFICER>John Carrie</OFFICER>
+			<OFFICE>Santa Maria Area</OFFICE>
+			<TIMER>9796</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>14-14</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "14-17">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>405 MacArthur Boulevard</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>14-Santa Maria</AREA>
+			<BADGE_NUM>011304</BADGE_NUM>
+			<OFFICER>James Hill</OFFICER>
+			<OFFICE>Santa Maria Area</OFFICE>
+			<TIMER>15053</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>14-17</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "14-9">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>55 Edinger Avenue</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>14-Santa Maria</AREA>
+			<BADGE_NUM>012454</BADGE_NUM>
+			<OFFICER>Bobby Hey</OFFICER>
+			<OFFICE>Santa Maria Area</OFFICE>
+			<TIMER>6394</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>14-9</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "9-9">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>I405 IRVINE CTR</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>9-Templeton</AREA>
+			<BADGE_NUM>011596</BADGE_NUM>
+			<OFFICER>Harry Jackson</OFFICER>
+			<OFFICE>Templeton Area</OFFICE>
+			<TIMER>10606</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>9-9</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "14-S3">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>73 Bear Street</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>14-Santa Maria</AREA>
+			<BADGE_NUM>011250</BADGE_NUM>
+			<OFFICER>James Tuchman</OFFICER>
+			<OFFICE>Santa Maria Area</OFFICE>
+			<TIMER>19005</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>14-S3</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "9-15">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>55 4th street</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>9-Templeton</AREA>
+			<BADGE_NUM>013282</BADGE_NUM>
+			<OFFICER>Sam Spellicy</OFFICER>
+			<OFFICE>Templeton Area</OFFICE>
+			<TIMER>23786</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>9-15</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "9-19">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>405 Culver</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>9-Templeton</AREA>
+			<BADGE_NUM>012495</BADGE_NUM>
+			<OFFICER>Michael Bay</OFFICER>
+			<OFFICE>Templeton Area</OFFICE>
+			<TIMER>15760</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>9-19</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "28-24">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>I-405 IRVINE CNTR</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>28-San Luis Obispo</AREA>
+			<BADGE_NUM>011194</BADGE_NUM>
+			<OFFICER>Greg Johnson</OFFICER>
+			<OFFICE>San Luis Obispo Area</OFFICE>
+			<TIMER>16987</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>28-24</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "28-19">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>I-5 / Sand Canyon</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>28-San Luis Obispo</AREA>
+			<BADGE_NUM>013181</BADGE_NUM>
+			<OFFICER>Andre Muller</OFFICER>
+			<OFFICE>San Luis Obispo Area</OFFICE>
+			<TIMER>18685</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>28-19</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "28-13">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>I-5 / 133</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>28-San Luis Obispo</AREA>
+			<BADGE_NUM>015283</BADGE_NUM>
+			<OFFICER>Craig O'Neil</OFFICER>
+			<OFFICE>San Luis Obispo Area</OFFICE>
+			<TIMER>14069</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>28-13</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "28-11">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>SR55 AT DYER</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>28-San Luis Obispo</AREA>
+			<BADGE_NUM>012555</BADGE_NUM>
+			<OFFICER>Alex Carlton</OFFICER>
+			<OFFICE>San Luis Obispo Area</OFFICE>
+			<TIMER>15860</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>28-11</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "28-07">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>I405 / CULVER OFFR</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>28-San Luis Obispo</AREA>
+			<BADGE_NUM>013606</BADGE_NUM>
+			<OFFICER>Gary Schmidt</OFFICER>
+			<OFFICE>San Luis Obispo Area</OFFICE>
+			<TIMER>14999</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>28-7</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "28-S4">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC></CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>28-San Luis Obispo</AREA>
+			<BADGE_NUM>013565</BADGE_NUM>
+			<OFFICER>Daniel Pierce</OFFICER>
+			<OFFICE>San Luis Obispo Area</OFFICE>
+			<TIMER>10606</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>28-S4</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "9-22">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>57 / Chapman</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>9-Templeton</AREA>
+			<BADGE_NUM>012345</BADGE_NUM>
+			<OFFICER>Victor Percival</OFFICER>
+			<OFFICE>Templeton Area</OFFICE>
+			<TIMER>24203</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>9-22</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "9-23">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>22 / Euclid Avenue</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>9-Templeton</AREA>
+			<BADGE_NUM>011860</BADGE_NUM>
+			<OFFICER>Michael Rocker</OFFICER>
+			<OFFICE>Templeton Area</OFFICE>
+			<TIMER>20184</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>9-23</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "9-26">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>57 / 91</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>9-Templeton Area</AREA>
+			<BADGE_NUM>011480</BADGE_NUM>
+			<OFFICER>Patrick King</OFFICER>
+			<OFFICE>Templeton Area</OFFICE>
+			<TIMER>14023</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>9-26</ALIAS>
+		</NEW_UNIT>
+		<!-- 17 isn't a valid CHP office? -->
+		<NEW_UNIT UnitNum = "17-14">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>405 / Euclid</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>14-Santa Maria</AREA>
+			<BADGE_NUM>017935</BADGE_NUM>
+			<OFFICER>William Bond</OFFICER>
+			<OFFICE>Santa Maria Area</OFFICE>
+			<TIMER>29877</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>17-14</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "17-16">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>S-405 / Euclid</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>14-Santa Maria</AREA>
+			<BADGE_NUM>015839</BADGE_NUM>
+			<OFFICER>Matthew McCarmick</OFFICER>
+			<OFFICE>Santa Maria Area</OFFICE>
+			<TIMER>23998</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>17-16</ALIAS>
+		</NEW_UNIT>
+	</SCRIPT_DATA>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:00:00</TIME_INDEX>
+		<INCIDENT LogNum="100">Media Log</INCIDENT>		
+		
+		<CAD_DATA>
+			<HEADER_INFO>
+				<Type>Media</Type>
+				<Beat>
+				</Beat>
+				<TruncLoc>
+				</TruncLoc>
+				<FullLoc>
+				</FullLoc>
+			</HEADER_INFO>			
+			
+			<CAD_INCIDENT_EVENT>	
+			</CAD_INCIDENT_EVENT>		
+			
+		</CAD_DATA>				
+		
+	</SCRIPT_EVENT>	
+
+	
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:00:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<MASTER_INC_NUM>145086SLO003</MASTER_INC_NUM>
+			<P>1</P>
+			<ADDITIONAL_INFO>
+				<TYPE_CODE>1179 Accident - Ambulance Responding</TYPE_CODE>
+				<TYPE>1179</TYPE>
+			</ADDITIONAL_INFO>
+			<LOCATION>
+				<BEAT>14-14</BEAT>
+				<ADDRESS>SB55 AT 405 </ADDRESS>
+				<LOC>SB55 AT 405</LOC>
+				<CITY>Costa Mesa</CITY>
+				<AREA>14-Santa Maria</AREA>
+				<FIRE>Costa Mesa</FIRE>
+				<LAW>Costa Mesa</LAW>
+				<EMS>Costa Mesa</EMS>
+			</LOCATION>
+			<GENERAL>
+				<AGY>CHP</AGY>
+			</GENERAL>
+		
+			<HEADER_INFO>
+				<Type>1179</Type>
+				<Beat>14-14</Beat>
+				<TruncLoc>SB55 AT 405</TruncLoc>
+				<FullLoc>SB55 AT 405</FullLoc>
+			</HEADER_INFO>
+			
+			<LOCATION_INFO ID="187_N_405_ML">
+				<Route>405</Route>
+				<Direction>NB</Direction>
+				<Postmile>8.4</Postmile>
+				<Location_type>ML</Location_type>					
+			</LOCATION_INFO>
+			
+			<LOCATION_INFO ID="187_N_405_HV">
+				<Route>405</Route>
+				<Direction>NB</Direction>
+				<Postmile>8.4</Postmile>
+				<Location_type>HV</Location_type>					
+			</LOCATION_INFO>	
+			
+			<LOCATION_INFO ID="187_S_55_ML">
+				<Route>55</Route>
+				<Direction>SB</Direction>
+				<Postmile>6.5</Postmile>
+				<Location_type>ML</Location_type>					
+			</LOCATION_INFO>
+			
+		</CAD_DATA>	
+		
+		<GENERAL_INFO> 			
+			<TITLE>Incident Description</TITLE>
+			<TEXT>This is a stalled DOT truck on SB 55 overpass at 405. The truck is 
+			  hit by a vehicle, the vehicle is vaulted over the railing, and a 6 
+			  vehicle collision occurs below in the NB 405 lanes. The #2 and 3 lanes 
+			  are blocked on SB 55 and the #1, 2, and 3 lanes are blocked on NB 405. 
+			  The driver of the truck is uninjured, although there are 4 fatals, 2 
+			  major injured, and 4 minor injured in the collision below. MAIT is 
+			  called to the scene to investigate the collision and a Sig Alert is 
+			  declared. 
+			</TEXT>
+		</GENERAL_INFO>	
+		
+		<TELEPHONE>	
+			<STUDENT>Places a call to CHP Dispatch to notify of stalled DOT vehicle.</STUDENT>
+		</TELEPHONE>				
+		
+		<MAINTENANCE_RADIO>Dispatch, this is xxx. I'm on south 55 at the 405.  
+		 		My truck is out of service here, stuck in the lane.  I need CHP assistance ASAP!" 
+		</MAINTENANCE_RADIO>	
+		
+	</SCRIPT_EVENT>	
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:01:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>	
+
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>	
+				<DETAIL>STALLED DOT SB SR-55 AT I-405</DETAIL>	
+				
+				<PARAMICS LocationID="187_S_55_ML">
+					<Status>NEW</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>3</Lane_number>
+				</PARAMICS>		
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:02:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>	
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<UNIT UnitNum="14-14" Status="ENRT" Primary="true" Active="true"/>
+				<AUDIO Length = "25" Path = "187/18701.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		        
+		
+		<CHP_RADIO RadioFile="18701.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">14-14 Santa Lucia</LINE>				
+				<LINE Role="Field">Santa Lucia 14-14 go ahead</LINE>				
+				<LINE Role="Dispatch">14-14 Santa Lucia 11-25 stalled DOT truck southbound 55 overpass at 405.</LINE>
+				<LINE Role="Field">Santa Lucia 14-14 10-4. Enroute from 55 at Dyer Rd.</LINE>				
+				<LINE Role="Dispatch">14-14 Santa Lucia copies enroute from 55 at Dyer Rd.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<CAD_EVALUATION>
+			<EXPECTED_ACTION>Operator should be verifying incident 187 on CAD</EXPECTED_ACTION>
+		</CAD_EVALUATION>
+		<ATMS_EVALUATION>
+			<EXPECTED_ACTION>Operator viewing cameras in incident area.</EXPECTED_ACTION>
+		</ATMS_EVALUATION>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:03:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>		
+				<DETAIL>CELLULAR 911 RPT DOT HT, 2ND VEH OVER THE SIDE, UNVERIFIED</DETAIL>
+				<AUDIO Length = "26" Path = "187/18702.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18702.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">14-14 Santa Lucia</LINE>				
+				<LINE Role="Field">Santa Lucia 14-14 go ahead</LINE>				
+				<LINE Role="Dispatch">14-14 Santa Lucia. Cellular 911 caller reports stalled vehicle on the 55/405 overpass was hit and a vehicle was pushed over the side.  Can you verify?</LINE>				
+				<LINE Role="Field">Santa Lucia, negative, I'm one minute away.</LINE>				
+				<LINE Role="Dispatch">14-14 Santa Lucia 10-4. One minute away.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:03:30</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>		
+				<DETAIL>DUPLICATE CALL</DETAIL>
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:04:30</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>		
+				<DETAIL>DUPLICATE CALL</DETAIL>
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:05:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>DOT HIT BY VEH, VEH OVER SIDE.</DETAIL>
+				<DETAIL>2ND VEH LANDED NB 405 BELOW, LG COLLISION OCCUR. REQ 2 1141 CODE 2 UNITS ASSIST</DETAIL>
+				<UNIT UnitNum="14-14" Status="1097" Primary="true" Active="true"/>
+				<AUDIO Length = "42" Path = "187/18703.wav" />
+				
+				<PARAMICS LocationID="187_N_405_ML">
+					<Status>NEW</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>1</Lane_number>
+					<Lane_number>2</Lane_number>
+					<Lane_number>3</Lane_number>
+				</PARAMICS>					
+				
+				<PARAMICS LocationID="187_N_405_HV">
+					<Status>NEW</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>1</Lane_number>
+				</PARAMICS>					
+				
+				<PARAMICS LocationID="187_S_55_ML">
+					<Status>CHANGED</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>2</Lane_number>
+					<Lane_number>3</Lane_number>
+				</PARAMICS>			
+			</CAD_INCIDENT_EVENT>			
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18703.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-14</LINE>				
+				<LINE Role="Dispatch">	14-14 Santa Lucia go ahead.</LINE>
+				<LINE Role="Field">Santa Lucia 14-14 10-97 11-83 11-25.  It appears the DOT truck was hit by a vehicle and over the side landed in the northbound 405 lanes below.  A major collision occurred below.  Request 11-41 Code 2 and a couple units to assist.</LINE>				
+				<LINE Role="Dispatch">	14-14 Santa Lucia 10-4 10-97 11-83 11-25.  DOT truck was hit by vehicle and the vehicle over the side landed in the northbound 405 lanes below.  A large collision occurred below.  Request 11-41 Code 2 and a couple units to assist.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<CMS_EVALUATION cmsID="72" type="new"> 
+			<LOCATION>SB 55 @ WARNER AVE</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT AHEAD</CMS_LINE>
+				<CMS_LINE>AT 405 OVERPASS</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>
+		<FACILITATOR_EVALUATION>
+			<EXPECTED_ACTION>Should be responding to incident 187</EXPECTED_ACTION>
+			<EXPECTED_ACTION>Should be monitoring ATMS operator</EXPECTED_ACTION>
+		</FACILITATOR_EVALUATION>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:05:30</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>		
+				<DETAIL>DUPLICATE CALL</DETAIL>
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:06:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>14-17 14-9 ENRT ASSIST 1183 1125</DETAIL>
+				<UNIT UnitNum="14-17" Status="ENRT" Primary="false" Active="true"/>
+				<UNIT UnitNum="14-9" Status="ENRT" Primary="false" Active="true"/>
+				<AUDIO Length = "40" Path = "187/18704.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+
+		<CHP_RADIO RadioFile="18704.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">14-17, 14-9 Santa Lucia</LINE>
+				<LINE Role="Field_1">Santa Lucia 14-17 go ahead.</LINE>	
+				<LINE Role="Field_2">Santa Lucia 14-9 go ahead.</LINE>
+				<LINE Role="Dispatch">	14-17, 14-9 assist 14-14 11-83 11-25 northbound 405 at the 55 interchange.</LINE>				
+				<LINE Role="Field_1">Santa Lucia 14-17 copies.  Enroute from 405 just south of Macarthur Boulevard.</LINE>
+				<LINE Role="Field_2">14-9 10-4, enroute from 55 at Edinger Avenue.</LINE>
+				<LINE Role="Dispatch">Santa Lucia copies 14-17 enroute from 405 just south of Macarthur and 14-9 enroute from 55 at Edinger.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:06:30</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>		
+				<DETAIL>DUPLICATE CALL</DETAIL>
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:07:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>DOT DRIVER UNINJURED, #2,3 LNS BLCKD SB 55.</DETAIL>
+				<DETAIL>14-14 MVNG TO 405 ASSESS DMG</DETAIL>
+				<AUDIO Length = "29" Path = "187/18705.wav" />
+			</CAD_INCIDENT_EVENT>
+			
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18705.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-14</LINE>				
+				<LINE Role="Dispatch">14-14 Santa Lucia go ahead.</LINE>
+				<LINE Role="Field">	Santa Lucia, the driver of the DOT truck is uninjured but the #2 and #3 lanes are now blocked on southbound 55.  I'm moving down to the 405 lanes to assess the damage.</LINE>				
+				<LINE Role="Dispatch">	14-14 Santa-Lucia 10-4. Driver of the DOT truck is uninjured.  The #2 and #3 lanes are now blocked on southbound 55. Moving down to the 405 lanes to assess the damage.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<CMS_EVALUATION cmsID="72" type="update"> 
+			<LOCATION>SB 55 @ WARNER AVE</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT AHEAD</CMS_LINE>
+				<CMS_LINE>AT 405 OVERPASS</CMS_LINE>
+				<CMS_LINE>2 RT LANES BLKD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>	
+		
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should be updating the incident board.</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:08:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="TV Reporter #1">Hello, this is Cameron Stevens at KCLY TV channel 2.</INSTRUCTOR>
+			<INSTRUCTOR Role="TV Reporter #1">I was told that a car flew off an 
+										 overpass causing a large pile-up on the freeway below.
+			</INSTRUCTOR>
+			<STUDENT>Incident should be confirmed</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #1">I want to confirm the location so we 
+										 can send a helicopter to check it out.
+			</INSTRUCTOR>
+			<STUDENT>55/405 interchange</STUDENT>
+		</TELEPHONE>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:08:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<MASTER_INC_NUM>145086SLO004</MASTER_INC_NUM>
+			<P>2</P>
+			<ADDITIONAL_INFO>
+				<TYPE_CODE>1179 Accident - Ambulance Responding</TYPE_CODE>
+				<TYPE>1179</TYPE>
+			</ADDITIONAL_INFO>
+			<LOCATION>
+				<BEAT>9-9</BEAT>
+				<ADDRESS>NB5 JNO Lake Forest Dr</ADDRESS>
+				<LOC>NB5 JNO Lake Forest Dr</LOC>
+				<CITY>Templeton</CITY>
+				<AREA>9-Templeton</AREA>
+				<FIRE>Templeton</FIRE>
+				<LAW>Templeton</LAW>
+				<EMS>Templeton</EMS>
+			</LOCATION>
+			<GENERAL>
+				<AGY>CHP</AGY>
+			</GENERAL>
+		
+			<HEADER_INFO>
+				<Type>1179</Type>
+				<Beat>9-9</Beat>
+				<TruncLoc>NB5 JNO Lake Forest Dr</TruncLoc>
+				<FullLoc>NB5 JNO Lake Forest Dr</FullLoc>
+			</HEADER_INFO>
+			
+			<LOCATION_INFO ID="188_N_5_ML">
+				<Route>5</Route>
+				<Direction>NB</Direction>
+				<Postmile>20</Postmile>
+				<Location_type>ML</Location_type>					
+			</LOCATION_INFO>	
+			
+			<CAD_INCIDENT_EVENT>			
+				<PARAMICS LocationID="188_N_5_ML">
+					<Status>NEW</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>3</Lane_number>
+					<Lane_number>4</Lane_number>
+					<Lane_number>5</Lane_number>
+				</PARAMICS>					
+			</CAD_INCIDENT_EVENT>					
+		</CAD_DATA>		
+		
+		<GENERAL_INFO>
+			<TITLE>Incident Description</TITLE>
+			<TEXT>This is a two vehicle collision between a tomato truck and a car. The 
+	  	  truck spills tomatoes across lanes #3,4,5 right lanes plus 
+	  	  shoulder of NB 5 just north of Lake Forest Drive. There is one 11-44 
+	  	  and 2 major injured. Ambulance, fire, paramedics, additional units, 
+	  	  Maintenance/coroner, and TMT are requested on this incident.
+			</TEXT>
+		</GENERAL_INFO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:10:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>			
+				<DETAIL>9-9 ENRT FRM I405 @ IRVINE CTR</DETAIL>
+				<UNIT UnitNum="9-9" Status="ENRT" Primary="true" Active="true"/>
+				<AUDIO Length = "25" Path = "188/18801.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="18801.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">9-9 Santa Lucia</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9 go ahead.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia 11-79 northbound 5 just north of Lake Forest Drive.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9 copied enroute from 405 at Irvine Center.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia 10-4. Enroute from 405 at Irvine Center.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<CAD_EVALUATION>
+			<EXPECTED_ACTION>Operator should be monitoring the CAD</EXPECTED_ACTION>
+		</CAD_EVALUATION>
+		<ATMS_EVALUATION>
+			<EXPECTED_ACTION>Operator should try to confirm the incident with a CCTV camera.</EXPECTED_ACTION>
+		</ATMS_EVALUATION>
+		<FACILITATOR_EVALUATION>
+			<EXPECTED_ACTION>Should verify location and respond to incident 188</EXPECTED_ACTION>
+		</FACILITATOR_EVALUATION>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:11:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #1">Hello, this is Dakota Crew at 
+											KCOW radio.
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #1">I just heard over the scanner that 
+											you have a major accident on I405 at 55.
+			</INSTRUCTOR>
+			<STUDENT>Should confirm incident.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #1">Can you give me a run down on what 
+										 	happened?
+			</INSTRUCTOR>
+			<STUDENT>A collision occurred on NB 55 at 405.  A vehicle went over rail 
+					     onto NB 405 causing a 6 car collision.
+			</STUDENT>
+		</TELEPHONE>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:12:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>14-14 1097, MULTIPLE 1144 NB 405 AT 55 OVERPASS, 6 VEH TC</DETAIL>
+				<DETAIL>BLOCKING 3 INSIDE LNS NB 405. DRVR AND PSSNGR IN VEH 1144, 2 OTHER FATALS, MULT INJR, REQ CRNR AND SIGALERT</DETAIL>
+				<AUDIO Length = "46" Path = "187/18706.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+		
+		<CHP_RADIO RadioFile="18706.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-14</LINE>				
+				<LINE Role="Dispatch">	14-14 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">	Santa Lucia 14-14 10-97. Multiple 1144 northbound 405 at 55 
+					overpass. Six vehicle collision blocking the three inside 
+					lanes. The driver and passenger of the car that went over 
+					the railing are both 11-44. I've got two other fatals and 
+					multiple injured down here. Request coroner and issue Sig 
+					Alert.
+				</LINE>
+				
+				<LINE Role="Dispatch">	14-14 Santa Lucia 10-4 10-97 11-80 11-25 northbound 405 
+						at 55 overpass. Multiple 1144. Six vehicle collision blocking the three 
+						inside lanes. The driver and passenger of the car that 
+						went over the railing are 11-44, 2 other 11-44.  
+						Multiple injuries, request coroner and send Sig Alert.
+				</LINE>
+			</DIALOG>
+		</CHP_RADIO>					
+		
+		<CMS_EVALUATION cmsID="87" type="new"> 
+			<LOCATION>NB 405 @ HARVARD</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT AT HWY-55</CMS_LINE>
+				<CMS_LINE>3 LEFT LNS BLKD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>
+		<CMS_EVALUATION cmsID="88" type="new"> 
+			<LOCATION>NB 405 @ ICD</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT AT HWY-55</CMS_LINE>
+				<CMS_LINE>3 LEFT LNS BLKD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>		
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should fax and page sig alert information</EXPECTED_ACTION>	
+		</ACTIVITY_LOG_EVALUATION>
+		
+	</SCRIPT_EVENT>
+	
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:12:30</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>1039 CRNR</DETAIL>
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>	
+		
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should insert info for enroute coroner</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+		
+	</SCRIPT_EVENT>
+	
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:13:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>14-17 1097, PARAMEDICS 1097. 1184 SB 55 FOR DOT 1125</DETAIL>
+				<UNIT UnitNum="14-17" Status="1097" Primary="true" Active="true"/>
+				<AUDIO Length = "46" Path = "187/18707.wav" />	
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+		
+		<CHP_RADIO RadioFile="18707.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-17</LINE>				
+				<LINE Role="Dispatch">14-17 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 14-17 10-97. 1144 northbound 405 at 55. 	
+			Paramedics are 10-97. We've gotta secure the scene southbound 55 for the DOT 
+			hazard. Has Caltrans been notified that their truck has been 
+			involved in a collision?</LINE>				
+				<LINE Role="Dispatch">14-17 Santa Lucia 10-4 10-97 11-44 northbound 405 
+						at 55. Paramedics 10-97. Will be doing 11-84 on southbound 55 for 
+						DOT collision. Caltrans will be notified.			
+				</LINE>	
+				<LINE Role="Field">Santa Lucia 14-17 10-4</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:14:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>9-9, FD, PARAMEDICS 1097.  TC SEMI W/TOMATOES AND VEH ON NB-5 #3,4,5 LNS</DETAIL>
+				<DETAIL>TRCK ON FIRE, REQ CT CLNUP, UNITS 1184</DETAIL>
+				<UNIT UnitNum="9-9" Status="1097" Primary="true" Active="true"/>
+				<AUDIO Length = "39" Path = "188/18802.wav" />
+			</CAD_INCIDENT_EVENT>
+		</CAD_DATA>		
+
+		<CHP_RADIO RadioFile="18802.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-9</LINE>
+				<LINE Role="Dispatch">9-9 go ahead Santa Lucia</LINE>
+				<LINE Role="Field">Santa Lucia 9-9 10-97 11-79. Fire department and 
+					parmedics 10-97.  Collision between semi truck carrying 
+					tomatoes and vehicle in 2 right lanes.  Truck on fire and 
+					tomatoes spilled over three right lanes. Request Caltrans to 
+					clean up the tomatoes and units for 11-84.</LINE>
+				<LINE Role="Dispatch">Santa Lucia 10-4, 9-9 10-97 11-79. Fire and 
+						paramedics 10-97. Collision involves tomato truck and 
+						car in two right lanes. Truck on fire and tomatoes over 
+						three right lanes.  Request Caltrans.</LINE>
+			</DIALOG>
+		</CHP_RADIO>		
+		
+		<CMS_EVALUATION cmsID="31" type="new"> 
+			<LOCATION>??</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>UR TIRES R RND</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should fax and page information</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+		<RADIO_EVALUATION>
+			<EXPECTED_ACTION>Operator should have ensured that a maintenance team was dispatched</EXPECTED_ACTION>
+		</RADIO_EVALUATION>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:14:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>REQ MAIT, REQ 14-S UNIT, REQ TMT</DETAIL>
+				<UNIT UnitNum="14-S3" Status="ENRT" Primary="false" Active="true"/>
+				<AUDIO Length = "34" Path = "187/18708.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="18708.wav">
+			<DIALOG>
+				<LINE Role="Field">	Santa Lucia 14-14</LINE>				
+				<LINE Role="Dispatch">	14-14 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">	Santa Lucia, request MAIT, they'll have to investigate this 
+					one.  Also, request 14-S unit and TMT.</LINE>				
+				<LINE Role="Dispatch">	14-14 Santa Lucia copied request MAIT, 14-S unit, and TMT.</LINE>				
+				<LINE Role="Dispatch">	14-S3 unit copy.</LINE>				
+				<LINE Role="Field">	Santa Lucia 14-S3, 10-4 enroute from 73 at Bear Street.</LINE>				
+				<LINE Role="Dispatch">	14-S3 Santa Lucia copies enroute from 73 at Bear Street.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<FACILITATOR_EVALUATION>
+			<EXPECTED_ACTION>Should be alert and advising radio on TMT.</EXPECTED_ACTION>
+		</FACILITATOR_EVALUATION>
+		<RADIO_EVALUATION>
+			<EXPECTED_ACTION>Operator should notify the TMT leader of incident 187</EXPECTED_ACTION>
+		</RADIO_EVALUATION>	
+		
+		<TMT_RADIO>TMT leader espond to student action.  Dispatch appropriate units???</TMT_RADIO>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:15:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #2">Hello, this is Monica Stevens at KCLY radio.
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #2">I called earlier about the accident 
+											on I405. Have any more details come 
+											in on that incident?
+			</INSTRUCTOR>
+			<STUDENT>Vehicles blocking 3 NB 405 lanes, 4 dead and 7 injured.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #2">Do you have an alternate route I can recommend?
+			</INSTRUCTOR>
+			<STUDENT>Yes (TBD)</STUDENT>	
+		</TELEPHONE>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:16:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+
+		<MAINTENANCE_RADIO>If Maintenance unit was sent out, radio the supervisor 
+			with a 10-97.  Say that you're going to await MAIT investigation and 
+			transport other Maintenance worker.			
+		</MAINTENANCE_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:17:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>14-9 1097, ASSIST 1184</DETAIL>
+				<UNIT UnitNum="14-9" Status="1097" Primary="false" Active="true"/>
+				<AUDIO Length = "22" Path = "187/18709.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18709.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-9.</LINE>				
+				<LINE Role="Dispatch">14-9 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 14-9 10-97. Will assist 14-14 with 11-84.</LINE>				
+				<LINE Role="Dispatch">14-9 Santa Lucia 10-4 10-97 northbound 405 at 55. 
+						Will assist 14-14 with 11-84.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:18:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>TRAFFIC BACKING SB 55 REQ TMT MEDIUM DUTY 1185</DETAIL>
+				<AUDIO Length = "24" Path = "187/18710.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>
+		
+		<CHP_RADIO RadioFile="18710.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-17.</LINE>
+				<LINE Role="Dispatch">14-17 Santa Lucia go ahead.</LINE>			
+				<LINE Role="Field">Santa Lucia 14-17. Traffic is backing up on southbound 55. 
+					Request TMT and medium duty 11-85 for the DOT truck.	</LINE>			
+				<LINE Role="Dispatch">14-17 Santa Lucia 10-4. Traffic backing up on southbound 
+						55.  Requesting TMT and medium duty 11-85.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:19:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>		
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>4 1144'S, 2 1180'S, 4 1181'S</DETAIL>
+				<AUDIO Length = "20" Path = "187/18711.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+		
+		<CHP_RADIO RadioFile="18711.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-14</LINE>		
+				<LINE Role="Dispatch">14-14 Santa Lucia go ahead.</LINE>
+				<LINE Role="Field">Santa Lucia 14-14. 4 11-44's, 2 11-80's, and 4 11-81's.</LINE>		
+				<LINE Role="Dispatch">14-14 Santa Lucia copies 4 11-44's,2 11-80's, and 4 11-81's.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="TV Reporter #2">Hello, this is Fred Roppel at KNOW TV."</INSTRUCTOR>
+			<INSTRUCTOR Role="TV Reporter #2">Have any more details come in on the pileup at 55/405?</INSTRUCTOR>
+			<STUDENT>Vehicles blocking 3 NB 405 lanes, 4 dead and 7 injured, ??? mile backup</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #2">Do you have an alternate route I can recommend?</INSTRUCTOR>
+			<STUDENT>(pause for answer: Yes)</STUDENT>
+			<STUDENT>3 car collision, vehicles blocking #2,3,4 lanes.  Moderate injuries.</STUDENT>
+		</TELEPHONE>
+		
+		<CMS_EVALUATION cmsID="95" type="new"> 
+			<LOCATION>NB 5 @ EL TORO</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT AT HWY-55</CMS_LINE>
+				<CMS_LINE>3 RT LANES BLKD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:20:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>9-15,9-19 ENRT FOR 1184</DETAIL>
+				<UNIT UnitNum="9-15" Status="ENRT" Primary="false" Active="true"/>
+				<UNIT UnitNum="9-19" Status="ENRT" Primary="false" Active="true"/>
+				<AUDIO Length = "38" Path = "188/18803.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18803.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">9-15, 9-19 Santa Lucia</LINE>				
+				<LINE Role="Field_1">Santa Lucia 9-15 go ahead.</LINE>				
+				<LINE Role="Field_2">Santa Lucia go ahead to 9-19.</LINE>				
+				<LINE Role="Dispatch">9-15 and 9-19 Santa Lucia 11-84 for 11-79 
+						northbound 5 just north of Lake Forest Drive.</LINE>				
+				<LINE Role="Field_1">	Santa Lucia 9-15 10-4. Enroute from 55 at 4th Street.</LINE>				
+				<LINE Role="Field_2">Santa Lucia 9-19 copied enroute from 405 at Culver.</LINE>				
+				<LINE Role="Dispatch">Santa Lucia copies 9-15 enroute from 55 at 4th and 9-19 
+		  				enroute from 405 at Culver.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #3">Hello, this is Bill Bradley at KCTR radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #3">I heard here was a large collision on the 5.</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #3">What details do you have on that?</INSTRUCTOR>
+			<STUDENT>Semi and 2 cars, tomatoes over three right lanes.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #3">Were there any injured?</INSTRUCTOR>
+			<STUDENT>Don't know yet.</STUDENT>
+		</TELEPHONE>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:21:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>1039 SABLAN TOWING</DETAIL>
+				<TOW Company="SABLAN TOWING" ConfNum="(949)555-2468" PubNum="(949)555-8899" Beat=""/>
+				<AUDIO Length = "18" Path = "187/18712.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18712.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">	14-17 Santa Lucia information.</LINE>				
+				<LINE Role="Field">	Santa Lucia 14-17 go ahead.</LINE>				
+				<LINE Role="Dispatch">	14-17 Santa Lucia 10-39 Sablan's Towing.</LINE>				
+				<LINE Role="Field">	14-17 copied 10-39 Sablan's Towing.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:22:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>14-S3 1097 NB 405 @ 55</DETAIL>
+				<DETAIL>MAIT ETA 15</DETAIL>
+				<UNIT UnitNum="14-S3" Status="1097" Primary="false" Active="true"/>
+				<AUDIO Length = "26" Path = "187/18713.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>			
+
+		<CHP_RADIO RadioFile="18713.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-S3</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 10-97 northbound 405 at 55.  Do you 
+					have an ETA for MAIT?</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia 10-4 10-97 northbound 405 
+						at 55. MAIT ETA 15 minutes.</LINE>				
+				<LINE Role="Field">Santa Lucia 14-S3 copies MAIT ETA 15.</LINE>
+			</DIALOG>		
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:24:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>1141 1097, TRCK STLL FIRE, 2 1180 IN VEH, UNK IN TRCK</DETAIL>
+				<AUDIO Length = "32" Path = "188/18804.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18804.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-9.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9. 11-41 10-97. Truck still engulfed in 
+					flames.  Two 11-80's in the vehicle. Unknown passengers in 
+					the truck. Request TMT, traffic backing up quickly.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia 10-4. 11-41 10-97. Truck still engulfed.  
+						Two 11-80's in vehicle and unknown passengers in truck.  
+						Request TMT, traffic backing up.</LINE>
+			</DIALOG>
+		</CHP_RADIO>		
+		
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #4">Hello, this is Alex Harmon at KJOK radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #4">How many vehicles were involved in the 
+								 			collision on northbound 5?
+			</INSTRUCTOR>
+			<STUDENT>1 semi, two cars.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #4">How many lanes were blocked?</INSTRUCTOR>
+			<STUDENT>Three right lanes blocked.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #4">Do you have an alternate route established?</INSTRUCTOR>
+			<STUDENT>What's it to you!?</STUDENT>
+		</TELEPHONE>
+		
+		<FACILITATOR_EVALUATION>
+			<EXPECTED_ACTION>Should be assisting radio operator</EXPECTED_ACTION>
+		</FACILITATOR_EVALUATION>
+		<RADIO_EVALUATION>
+			<EXPECTED_ACTION>Operator should dispatch TMT</EXPECTED_ACTION>
+		</RADIO_EVALUATION>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:25:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>REQUEST 1185 BIG RIG AND 1185 ROT, ISSUE SIG ALERT</DETAIL>
+				<AUDIO Length = "23" Path = "188/18805.wav" />
+			</CAD_INCIDENT_EVENT>
+		</CAD_DATA>			
+		
+
+		<CHP_RADIO RadioFile="18805.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-9.</LINE>
+				<LINE Role="Dispatch">9-9 Santa Lucia go ahead.</LINE>
+				<LINE Role="Field">Santa Lucia 9-9. Roll 11-85 big rig and a rotational 
+					11-85.  Issue a Sig Alert, this could take a while.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia copied roll 11-85 big rig and 11-85 
+						rotational. Issue a Sig Alert until further notice.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #5">Hello, this is Tim Rogers at KLNW radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #5">What details do you have on the 
+											collision Northbound 5 at Lake Forest Drive?
+			</INSTRUCTOR>
+			<STUDENT>Semi vs. two cars, tomatoes over lanes 3,4,5, two major 
+						 injured, unknown passenger in truc.</STUDENT>
+		</TELEPHONE>		
+		
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should fax and page information</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+		<FACILITATOR_EVALUATION>
+			<EXPECTED_ACTION>Should be ensuring a Sig Alert is issued</EXPECTED_ACTION>
+		</FACILITATOR_EVALUATION>
+		
+		<MAINTENANCE_RADIO>
+			If Maintenance has not been requested by this time, 
+			have someone call as CHP Dispatch and make a request for them.
+		</MAINTENANCE_RADIO>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:27:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>CRNR 1097, INJURED TRANSPORTED</DETAIL>
+				<AUDIO Length = "17" Path = "187/18714.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18714.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-S3.</LINE>
+				<LINE Role="Dispatch">14-S3 go ahead to Santa Lucia.</LINE>
+				<LINE Role="Field">Santa Lucia, coroner 10-97. The injured have been transported.</LINE>
+				<LINE Role="Dispatch">14-S3 Santa Lucia 10-4 coroner 10-97. Injured transported.</LINE>
+			</DIALOG>
+		</CHP_RADIO>	
+		
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should enter info for 10-97 coroner</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:30:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>9-15 1097, ADVS PD TO DIRECT TRAFFIC OFF AT LAKE FOREST </DETAIL>
+				<UNIT UnitNum="9-15" Status="1097" Primary="false" Active="true"/>
+				<AUDIO Length = "26" Path = "188/18806.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+		
+		<CHP_RADIO RadioFile="18806.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-15.</LINE>				
+				<LINE Role="Dispatch">9-15 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-15 10-97 11-80. Advise local PD that 
+					we are going to direct traffic off at Lake Forest off ramp and 
+					are closing the Lake Forest on ramp.</LINE>				
+				<LINE Role="Dispatch">Santa Lucia copies 9-15 10-97 11-80. Advise PD 
+						we're directing traffic off Lake Forest offramp and closing 
+						Lake Forest onramp.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<TELEPHONE>
+			<STUDENT>Student places call to Police Department</STUDENT>
+			<STUDENT>Student correctly notifies PD of incident location and details</STUDENT>
+		</TELEPHONE>
+
+		<TMT_RADIO>
+			If no sign truck/s have been requested yet, a phone call needs to be 
+			made from CHP Dispatch requesting them.			
+		</TMT_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:30:30</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #6">Hello, this is John Sinclair at KRST radio.
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #6">Is there an alternate route 
+											established for the northbound 5 
+											lanes due to the collision at Lake Forest Drive?
+			</INSTRUCTOR>
+			<STUDENT>Lake Forest East to Muirlands or Lake Forest West to Irvine Ctr.  
+				Re-enter I5 at numerous locations</STUDENT>
+		</TELEPHONE>		  
+	</SCRIPT_EVENT>
+	
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:31:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>1039 COLLEGE OAK BIG RIG, CYCLE TOW FOR ROT</DETAIL>
+				<TOW Company="College Oak" ConfNum="(949)555-2990" PubNum="(949)555-5758" Beat=""/>
+				<TOW Company="Cycle" ConfNum="(949)555-2281" PubNum="(949)555-7162" Beat=""/>
+				<AUDIO Length = "20" Path = "188/18807.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18807.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">9-9 Santa Lucia information</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9 go ahead.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia 10-39 College Oak for big rig 11-85 and 
+						Cycle Tow for 11-85 rotational.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9 copied 10-39 College Oak and Cycle Tow.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>	  
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:32:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>9-19 1097 ASSISTNG 1184</DETAIL>
+				<UNIT UnitNum="9-19" Status="1097" Primary="false" Active="true"/>
+				<AUDIO Length = "20" Path = "188/18808.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18808.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-19</LINE>
+				<LINE Role="Dispatch">9-19 go ahead to Santa Lucia</LINE>				
+				<LINE Role="Field">Santa Lucia 9-19 10-97 11-80. Assisting with 11-84.</LINE>				
+				<LINE Role="Dispatch">9-19 Santa Lucia copied 10-97 11-80. Assisting with 11-84.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:35:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>MAIT 1097 STARTING INVESTIGATION SB SR55</DETAIL>
+				<AUDIO Length = "22" Path = "187/18715.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+		
+		<CHP_RADIO RadioFile="187/18715.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-S3.</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 14-S3, MAIT is 10-97. They're starting their 
+					investigation on the 55 overpass.</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia 10-4 MAIT 10-97. Starting 
+						investigation on 55 overpass.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should enter info for 10-97 MAIT</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:36:00</TIME_INDEX> 
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="CHP Dispatch">Hello, CHP Dispatch.  Do you have traffic control enroute for NB 405 at 55</INSTRUCTOR>
+			<STUDENT>Do you mean sign truck crews or cones on the road?</STUDENT>
+			<INSTRUCTOR Role="CHP Dispatch">Cones</INSTRUCTOR>
+		</TELEPHONE>
+		
+		<FACILITATOR_EVALUATION>
+			<EXPECTED_ACTION>Should interact with the dispatch operator regarding cone crews</EXPECTED_ACTION>
+		</FACILITATOR_EVALUATION>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:37:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>	
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>MED DUTY 1185 1097, AWAIT FINISH MAIT BEFORE TOW VEH</DETAIL>
+				<AUDIO Length = "25" Path = "187/18716.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18716.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-17.</LINE>				
+				<LINE Role="Dispatch">14-17 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia, medium duty 11-85 10-97. Will await the finish of 
+					MAIT investigation before towing vehicle.</LINE>				
+				<LINE Role="Dispatch">14-17 Santa Lucia 10-4 medium rig 11-85 10-97. Will await 
+						the finish of MAIT investigation before towing vehicle.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:38:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>1039 PD, SENDING 2 UNITS ASST 1184</DETAIL>
+				<AUDIO Length = "17" Path = "188/18809.wav" />
+			</CAD_INCIDENT_EVENT>
+		</CAD_DATA>
+		
+		<CHP_RADIO RadioFile="18809.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">9-9 Santa Lucia information.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9 go ahead.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia 10-39 police department. Sending two 
+						units to assist with 11-84.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9 copied</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="TV Reporter #3">"Hello, this is Terry Webb at KTSV TV 11."</INSTRUCTOR>
+			<INSTRUCTOR Role="TV Reporter #3">My CAD is down, do you have any 
+										 incidents going on right now?
+			</INSTRUCTOR>
+			<STUDENT>Notify reporter of all current incidents.</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #3">Give me the details on those.</INSTRUCTOR> 
+			<STUDENT>Notify reporter of all current incident details.</STUDENT>
+		</TELEPHONE>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:40:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>CRNR CONFIRMED FOUR FATAL, PREP TO TRANSPORT</DETAIL>
+				<AUDIO Length = "19" Path = "187/18717.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+		
+		<CHP_RADIO RadioFile="18717.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-S3.</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 14-S3. The coroner has confirmed four fatals and 
+					is preparing them to be transported.</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia copied coroner confirmed four fatals 
+						and preparing for transport</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:42:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>1180S TRANSPORTED</DETAIL>
+				<AUDIO Length = "14" Path = "188/18810.wav" />
+			</CAD_INCIDENT_EVENT>
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18810.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-9.</LINE>
+				<LINE Role="Dispatch">9-9 Santa Lucia go ahead.</LINE>
+				<LINE Role="Field">Santa Lucia 9-9. 11-80's transported.</LINE>
+				<LINE Role="Dispatch">9-9 Santa Lucia copied 11-80's transported.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:43:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>9-9 FIRE OUT</DETAIL>
+				<AUDIO Length = "14" Path = "188/18811.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+		
+		<CHP_RADIO RadioFile="18811.wav">
+			<DIALOG>
+				<LINE Role="Field">	Santa Lucia 9-9.</LINE>				
+				<LINE Role="Dispatch">	9-9 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">	Santa Lucia 9-9. The fire is out.</LINE>				
+				<LINE Role="Dispatch">	9-9 Santa Lucia 10-4. Fire is out.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should note that the fire has been put out</EXPECTED_ACTION>
+			<EXPECTED_ACTION>Should fax and page information</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+		<FACILITATOR_EVALUATION>
+			<EXPECTED_ACTION>should be active and responding to situation</EXPECTED_ACTION>
+		</FACILITATOR_EVALUATION>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:44:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>LAKE FOREST ONRAMP CLOSED, DIRECTING TRAFFIC OFF LAKE FOREST OFFRAMP</DETAIL>
+				<AUDIO Length = "23" Path = "188/18812.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18812.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-15.</LINE>				
+				<LINE Role="Dispatch">9-15 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-15. Lake Forest onramp closed. Directing 405 traffic 
+					off Lake Forest offramp.</LINE>				
+				<LINE Role="Dispatch">9-15 Santa Lucia 10-4. Lake Forest onramp closed.  
+					Directing 405 traffic off at Lake Forest offramp.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #7">Hello, this is Tom Webb at KSON radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #7">Do you have an alternate established 
+											for the norhtbound 5 lanes near Lake 
+											Forest Drive?
+			</INSTRUCTOR>
+			<STUDENT>Same as before..</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #7">When are the lanes supposed to be open?	</INSTRUCTOR>
+			<STUDENT>No specific time, approx. 1 hour.</STUDENT>
+		</TELEPHONE>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:47:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>MAIT FINISHED W/ INVESTIGATION SB SR-55 AT I-405, PREP DOT TRCK FOR TOW</DETAIL>
+				<AUDIO Length = "24" Path = "187/18718.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+
+		<CHP_RADIO RadioFile="18718.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-17.</LINE>				
+				<LINE Role="Dispatch">14-17 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia, MAIT is finished with their investigation on 
+					the 55 overpass.  Preparing DOT truck for tow.</LINE>				
+				<LINE Role="Dispatch">14-17 Santa Lucia 10-4. MAIT is finished with their 
+						investigation on the 55 overpass. Preparing DOT truck 
+						for tow.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:48:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>1 1144 IN TRCK, REQ CRNR</DETAIL>
+				<AUDIO Length = "18" Path = "188/18813.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+		
+		<CHP_RADIO RadioFile="18813.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-9.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9. There is one 11-44 in the truck. Request coroner.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia copied one 11-44 in truck. Request coroner.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should enter info for coroner request</EXPECTED_ACTION>
+			<EXPECTED_ACTION>Should fax and page information</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+		
+		<TMT_RADIO>Sign truck/s are 97 at the end of the current queue.</TMT_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:49:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #8">Hello, this is Jordan Bradley at KTCR radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #8">Do you have any incidents going on right now?</INSTRUCTOR>
+			<STUDENT>Notify reporter of current incidents.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #8">What details do you have on those?</INSTRUCTOR>
+			<STUDENT>Notify reporter of current incident details.</STUDENT>
+		</TELEPHONE>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:50:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>9-9 1039 CRNR, ETA 15</DETAIL>
+				<AUDIO Length = "16" Path = "188/18814.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>		
+
+		<CHP_RADIO RadioFile="18814.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">	9-9 Santa Lucia</LINE>				
+				<LINE Role="Field">	Santa Lucia 9-9 go ahead.</LINE>				
+				<LINE Role="Dispatch">	9-9 Santa Lucia 10-39 coroner, ETA is 15 minutes.</LINE>				
+				<LINE Role="Field">	Santa Lucia 9-9 10-4.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should enter info for 10-39 CORONER</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>		
+		
+		<MAINTENANCE_RADIO>
+			Radio traffic between maintenance workers on site and maintenance dispatcher. 
+			Dispatched crews are 10-97 and beginning the cleanup.
+		</MAINTENANCE_RADIO>
+
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:51:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>CT 1097, STRTNG CLNUP OF TOMATOES</DETAIL>
+				<AUDIO Length = "18" Path = "188/18815.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18815.wav">
+			<DIALOG>
+				<LINE Role="Field">	Santa Lucia 9-9.</LINE>				
+				<LINE Role="Dispatch">	9-9 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">	Santa Lucia 9-9. Caltrans is 10-97. Starting cleanup of tomatoes.</LINE>				
+				<LINE Role="Dispatch">	9-9 Santa Lucia 10-4. Caltrans 10-97. Starting cleanup of tomatoes.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="TV Reporter #4">Hello, this is Art Philco at KTTQ news 2.</INSTRUCTOR>
+			<INSTRUCTOR Role="TV Reporter #4">I'm away from my CAD. What's going on 
+										 with the accident on northbound 5 
+										 involving the tomato truck spill?
+			</INSTRUCTOR>
+			<STUDENT>Fire out on truck, 11-44, will start cleanup.</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #4">Was anybody killed in the collision.</INSTRUCTOR>
+			<STUDENT>One 11-44</STUDENT>
+		</TELEPHONE>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:52:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+
+		<TMT_RADIO>Radio traffic between TMT crew and TMT leader regarding current queue status</TMT_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:53:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>1185 ROT 1097</DETAIL>
+				<AUDIO Length = "15" Path = "188/18816.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18816.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-9.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9. 11-85 rotation 10-97.</LINE>				
+				<LINE Role="Dispatch">	9-9 Santa Lucia copied 11-85 rotation 10-97.</LINE>
+			</DIALOG>
+		</CHP_RADIO>	
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #9">Hello, this is Jim Sanso at KTAK radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #9">What details do you have on the northbound 5 collision?</INSTRUCTOR>
+			<STUDENT>(pause for answer)</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #9">Is there an alternate route established?</INSTRUCTOR> 
+			<STUDENT>(pause for answer)</STUDENT>			
+		</TELEPHONE>		
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:54:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>MAIT STARTING INVESTIGATION NB 405 TO TAKE 30 MIN</DETAIL>
+				<AUDIO Length = "23" Path = "187/18719.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18719.wav">
+			<DIALOG>
+				<LINE Role="Field">	Santa Lucia 14-S3.</LINE>				
+				<LINE Role="Dispatch">	14-S3 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">	Santa Lucia 14-S3. MAIT is starting investigation on 
+					northbound 405. The investigation should take 30 minutes.</LINE>				
+				<LINE Role="Dispatch">	14-S3 Santa Lucia copied MAIT starting investigation on 
+						northbound 405. The investigation should take 30 minutes.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:55:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>CLNUP NRLY FNSHD DOT RDY TO BE TWD, SB SR-55 LNS OPN IN 5</DETAIL>
+				<AUDIO Length = "25" Path = "187/18720.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18720.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-17.</LINE>				
+				<LINE Role="Dispatch">14-17 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia, nearly finished with cleanup and the DOT truck 
+					is ready to be towed. Southbound 55 lanes open in 5 minutes.</LINE>				
+				<LINE Role="Dispatch">14-17 Santa Lucia 10-4. Nearly finished with cleanup and 
+						DOT truck is ready to be towed. Southbound 55 lanes open in 5.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:56:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>WTNSSES, JOHN/BETTY JONES SAW TOMATO TRUCK LOSE CONTROL, FLIP OVER, VEH HIT, TRCK IMM CAUGHT FIRE</DETAIL>
+				<WITNESS Name="John/Betty Jones" Address="101 Lowland Dr." PhoneNum="(949)555-8375"/>
+				<AUDIO Length = "27" Path = "188/18817.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18817.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-9.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9. Witnesses John and Betty Jones saw the 
+					tomato truck lose control, flip over, and the vehicle hit 
+					it. The truck then caught fire.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia 10-4. Witnesses John and Betty Jones saw 
+						tomato truck lose control, flip over, and vehicle hit 
+						it. Truck then immediately caught fire.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Public">Hello, is George there?</INSTRUCTOR>
+			<STUDENT>No, wrong number.</STUDENT>
+			<INSTRUCTOR Role="Public">Sorry, good bye.</INSTRUCTOR> 
+		</TELEPHONE>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:59:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>BIG RIG 1185 1097</DETAIL>
+				<AUDIO Length = "16" Path = "188/18818.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18818.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-9.</LINE>				
+				<LINE Role="Dispatch">9-9 go ahead to Santa Lucia</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9, big rig 11-85 10-97.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia copies, big rig 11-85 10-97.</LINE>
+			</DIALOG>
+		</CHP_RADIO>	
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #10">"Hello, this is Bill Rasmussen at KTRC radio."</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #10">"Do you have any updated info on the 
+											northbound 5 collision involving the 
+											tomato truck?"
+			</INSTRUCTOR>
+			<STUDENT>Pause for answer.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #10">When is it expected to be cleared.</INSTRUCTOR>
+			<STUDENT>Cleaning up now, no definite answer, approx. 30 minutes.</STUDENT>
+		</TELEPHONE>
+		
+		<FACILITATOR_EVALUATION>
+			<EXPECTED_ACTION>Should call CHP to inquire for incident duration.  (Approx 30 minutes)</EXPECTED_ACTION>
+		</FACILITATOR_EVALUATION>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:02:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>14-17 1097 DOT TRCK TWD, SB SR-55 OPN</DETAIL>
+				<AUDIO Length = "21" Path = "187/18721.wav" />
+				
+				<PARAMICS LocationID="187_S_55_ML">
+					<Status>CLEARED</Status>
+				</PARAMICS>				
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18721.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-17.</LINE>				
+				<LINE Role="Dispatch">14-17 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 10-98, the DOT truck has been towed and the 
+					southbound 55 lanes are open.</LINE>				
+				<LINE Role="Dispatch">Santa Lucia copied 14-17 10-98. DOT truck towed and 
+						southbound 55 lanes open.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<CMS_EVALUATION cmsID="72" type="remove">
+			<LOCATION>SB 55 @ WARNER AVE</LOCATION>
+		</CMS_EVALUATION>			
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should fax and page information</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+
+		<MAINTENANCE_RADIO>
+			Maintenance workers are 10-98.  Truck has been towed and 
+			taking maintenance worker, whose truck got hit, to the shop.
+		</MAINTENANCE_RADIO>		
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:03:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>MAIT PARTIAL CMPLT, PICS TKN, NEED MSRMNTS, INTERVIEWS</DETAIL>
+				<AUDIO Length = "25" Path = "187/18722.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+		
+		<CHP_RADIO RadioFile="18722.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-S3.</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 14-S3. MAIT has partially completed its 
+					investigation. Pictures have been taken, but still need to 
+					take measurements and conduct interviews.</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia 10-4. MAIT has partially completed its 
+		  				investigation.  Pictures have been taken, but still need 
+		  				to take measurements and conduct interviews.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:05:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>CT #3 LN ALMOST CLEARED OF TOMATOES</DETAIL>
+				<AUDIO Length = "17" Path = "188/18819.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18819.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-9.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9. Caltrans has the #3 lane almost cleared of the tomatoes.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia 10-4. Caltrans has #3 almost cleared.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #11">"Hello, this is Chris Rasmuessan at KWIT radio."</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #11">"Do you have an ETA for the opening of the lanes on Eastbound 91?"
+			</INSTRUCTOR>
+			<STUDENT>No to full opening, approx. 30 minutes, #3 lane nearly cleared.</STUDENT>
+		</TELEPHONE>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:07:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>	
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>CRNR 1097</DETAIL>
+				<AUDIO Length = "14" Path = "188/18820.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+		
+		<CHP_RADIO RadioFile="31520.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-9.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9, coroner 10-97.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia copies coroner 10-97.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should enter info for 10-97 coroner</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+
+	</SCRIPT_EVENT>
+	
+	
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:08:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #1">"Hello, this Dakota Crew at KTAK radio."</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #1">"Do you have any new incidents 
+											within the last 20 minutes?"
+			</INSTRUCTOR>
+			<STUDENT>No.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #1">Give me the details on that.</INSTRUCTOR>
+		</TELEPHONE>		
+		
+		<MAINTENANCE_RADIO>
+			Maintenance crew notifies dispatch that lane #3 is clear.  The #4,5
+			lanes should be clear in another 20-30 minutes.
+		</MAINTENANCE_RADIO>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:08:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>REQ 6 ROT 1185</DETAIL>
+				<AUDIO Length = "17" Path = "187/18723.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18723.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-S3.</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 14-S3. Request 6 rotational 11-85's.</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia copied requesting 6 rotational 11-85's.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:09:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>VEH TOWED, #3 LN CLEARED, OPENING</DETAIL>
+				<AUDIO Length = "18" Path = "188/18821.wav" />
+				
+				<PARAMICS LocationID="188_N_5_ML">
+					<Status>CHANGED</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>4</Lane_number>
+					<Lane_number>5</Lane_number>
+				</PARAMICS>	
+				
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>
+		
+		<CHP_RADIO RadioFile="18821.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-9.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9. Vehicle towed. #3 lane cleared of 
+					tomatoes and opening lane now.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia 10-4. Vehicle towed, #3 lane cleared 
+						and opening lane now.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:10:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>MAIT NEARLY COMPLETE, FINISHING INTERVIEWS, TOW ETA 10</DETAIL>
+				<AUDIO Length = "29" Path = "187/18724.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18724.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-S3.</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 14-S3. MAIT has nearly completed their 
+					investigation, they are finishing up the interviews. ETA 
+					tows?</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia. MAIT has nearly completed their 
+						investigation, they are finishing up the interviews. 
+						Tow ETA 10 minutes.</LINE>				
+				<LINE Role="Field">Santa Lucia 14-S3 10-4 ETA 10.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<TMT_RADIO>Have SB 55 TMT units go 10-98.</TMT_RADIO>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:12:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>1144 CNFRMD, #3 LN OPN, FULL OPNNG 20 MIN</DETAIL>
+				<AUDIO Length = "21" Path = "188/18822.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18822.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-9.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9. Coroner has confirmed 11-44. #3 lane is 
+					open. Full opening in 20 minutes.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia 10-4. 11-44 confirmed. #3 lane open, 
+						full opening in 20.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should enter info for confirmed 1144</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:13:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="TV Reporter #1">"Hello, this is Cameron Stevens at KCLY TV 2."</INSTRUCTOR>
+			<INSTRUCTOR Role="TV Reporter #1">"My CAD is down. Were there any 
+										 confirmed fatalities at the collision 
+										 northbound 5?"
+			</INSTRUCTOR>
+			<STUDENT>1 dead.</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #1">"When are the lanes supposed to be open?"</INSTRUCTOR>
+			<STUDENT>#3 lane open, full opening in 20.</STUDENT>
+		</TELEPHONE>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:15:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>CT NRLY FNSHD CLNUP, TRCK BEING PRPRD FOR 1185</DETAIL>
+				<AUDIO Length = "18" Path = "188/18823.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18823.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-9.</LINE>				
+				<LINE Role="Dispatch">9-9 go ahead to Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9. Caltrans is nearly finished with cleanup. 	
+					Truck being prepared for 11-85.</LINE>				
+				<LINE Role="Dispatch">	9-9 Santa Lucia 10-4. Caltrans nearly finished. Truck 
+						being prepared for 11-85.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:16:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #2">"Hello, this is Monica Stevens at KCLY radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #2">When is the roadway supposed to be cleared on the 5?
+			</INSTRUCTOR>
+			<STUDENT>#3 lane open, full opening in approx. 15.</STUDENT>
+		</TELEPHONE>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:16:30</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>MAIT FINISHED INVESTIGATION 1098, START CLEANUP WHEN 1185S ARRIVE</DETAIL>
+				<AUDIO Length = "23" Path = "187/18725.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18725.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-S3.</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 14-S3. MAIT is finished with their investigation 
+					and 10-98. Will start cleanup when the 11-85's arrive.</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia copied MAIT finished with 
+						investigation and 10-98. Start cleanup when 11-85's 
+						arrive.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:18:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+
+		<MAINTENANCE_RADIO>Confirm completion of tomato cleanup.  Going 10-98</MAINTENANCE_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:19:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>	
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>1185 1097 PARTIAL OPENING IN 15</DETAIL>
+				<AUDIO Length = "21" Path = "187/18726.wav" />
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>		
+
+		<CHP_RADIO RadioFile="18726.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-S3</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 14-S3 11-85's 10-97. Partial opening in 15 minutes.</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia 10-4 11-85's 10-97. Partial opening in 15 minutes.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:20:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>CT 98 TOMATOES, LNS OPN IN 10</DETAIL>
+				<AUDIO Length = "17" Path = "188/18824.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18824.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-9.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9. Caltrans done cleaning up the tomatoes. 
+					Lanes open in 10.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia 10-4. Caltrans 98 with 
+						tomatoes, lanes open in 10.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:21:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #3">"Hello, this is Bill Bradley at KCTR radio."</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #3">"What kind of backup is there on 
+											northbound 5 due to the tomato truck spill and collision?"
+			</INSTRUCTOR>
+			<STUDENT>Current queue from ATMS.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #3">Are the lanes open soon?</INSTRUCTOR>
+			<STUDENT>10 minutes.</STUDENT>
+		</TELEPHONE>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:23:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+		
+		<CAD_DATA>
+			<MASTER_INC_NUM>145086SLO005</MASTER_INC_NUM>
+			<P>3</P>
+			<ADDITIONAL_INFO>
+				<TYPE_CODE>1031 - Crime in progress</TYPE_CODE>
+				<TYPE>1031</TYPE>
+			</ADDITIONAL_INFO>
+			<LOCATION>
+				<BEAT>28-24</BEAT>
+				<ADDRESS>NB/SB 405 at Jeffrey</ADDRESS>
+				<LOC>NB/SB 405 at Jeffrey</LOC>
+				<CITY>San Luis Obispo</CITY>
+				<AREA>28-San Luis Obispo</AREA>
+				<FIRE>San Luis Obispo</FIRE>
+				<LAW>San Luis Obispo</LAW>
+				<EMS>San Luis Obispo</EMS>
+			</LOCATION>
+			<GENERAL>
+				<AGY>CHP</AGY>
+			</GENERAL>
+		
+			<HEADER_INFO>
+				<Type>1031</Type>
+				<Beat>28-24</Beat>
+				<TruncLoc>NB/SB 405 at Jeffrey</TruncLoc>
+				<FullLoc>NB/SB 405 at Jeffrey</FullLoc>
+			</HEADER_INFO>
+			
+			<LOCATION_INFO ID="189_N_405_ML">
+				<Route>405</Route>
+				<Direction>NB</Direction>
+				<Postmile>3.04</Postmile>
+				<Location_type>ML</Location_type>					
+			</LOCATION_INFO>
+			
+			<LOCATION_INFO ID="189_N_405_HV">
+				<Route>405</Route>
+				<Direction>NB</Direction>
+				<Postmile>3.04</Postmile>
+				<Location_type>HV</Location_type>					
+			</LOCATION_INFO>
+
+			<LOCATION_INFO ID="189_S_405_ML">
+				<Route>405</Route>
+				<Direction>SB</Direction>
+				<Postmile>5.55</Postmile>
+				<Location_type>ML</Location_type>					
+			</LOCATION_INFO>
+			
+			<LOCATION_INFO ID="189_S_405_HV">
+				<Route>405</Route>
+				<Direction>SB</Direction>
+				<Postmile>5.55</Postmile>
+				<Location_type>HV</Location_type>					
+			</LOCATION_INFO>
+			
+
+			<CAD_INCIDENT_EVENT>			
+				<DETAIL>CELLULAR 911 RPT SUICIDE BMBR AT I-405 @ JEFFREY, UNVERIFIED</DETAIL>
+				<DETAIL>1039 IRV PD, PD ENRT, 28-24 ENRT FROM I-405 @ IRVINE CNTR.</DETAIL>
+				<UNIT UnitNum="28-24" Status="ENRT" Primary="true" Active="true"/>
+				<AUDIO Length = "23" Path = "189/18901.wav" />
+			</CAD_INCIDENT_EVENT>		
+			
+		</CAD_DATA>	
+
+		<GENERAL_INFO> 
+			<TITLE>Incident Description</TITLE>
+			<TEXT>This is a suicide attempt and a bomb threat. A man with a bomb 
+		  strapped to him is threatening to blow up the interchange at I-405 and
+		  Jeffrey Road. The freeway interchange is shut down completely, causing 
+		  major backup in both directions on I-405. The man is eventually 
+		  apprehended after attempting to explode the bomb. The PD, additional 
+		  units, sign trucks, negotiator, and the bomb squad are sent to the 
+		  scene to assist.
+			</TEXT>
+		</GENERAL_INFO>
+
+		<CHP_RADIO RadioFile="18901.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">28-24 Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-24 go ahead.</LINE>				
+				<LINE Role="Dispatch">	28-24 Santa Lucia suicide attempt 405 on the Jeffrey 
+						overpass. The police department has been notified 
+						and is enroute.</LINE>				
+				<LINE Role="Field">	Santa Lucia 28-24 10-4. Enroute from 405 at Irvine Center.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<ATMS_EVALUATION>
+			<EXPECTED_ACTION>Operator should be viewing CCTV cameras in vicinity of incident</EXPECTED_ACTION>
+		</ATMS_EVALUATION>
+
+		<MAINTENANCE_RADIO>No Maintenance needed on scene for this incident.</MAINTENANCE_RADIO>
+
+	</SCRIPT_EVENT>
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:24:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>TRCK TWD, FD SPRYNG LNS, LNS OPN IN 5</DETAIL>
+				<AUDIO Length = "21" Path = "188/18825.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18825.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-9.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-9. Truck towed. Fire department spraying lanes 
+					clean. Lanes open in 5.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia 10-4. Truck towed. Fire department 
+						spraying lane clean, lanes open in 5.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:25:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #4">Hello, this is Alex Harmon at KJOK radio.</INSTRUCTOR> 
+			<INSTRUCTOR Role="Radio Reporter #4">Are the lanes open yet on 
+											northbound 5 just north of Lake 
+											Forest Drive.
+			</INSTRUCTOR>
+			<STUDENT>#3 open, all lanes open in 5.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #4">Are there any other new incidents 
+											going on right now?
+			</INSTRUCTOR>
+			<STUDENT>Notify reporter of new incidents.</STUDENT>
+		</TELEPHONE>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:25:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>28-24 1097, PD 1097</DETAIL>
+				<UNIT UnitNum="28-24" Status="1097" Primary="true" Active="true"/>
+				<AUDIO Length = "18" Path = "189/18902.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+
+		<CHP_RADIO RadioFile="18902.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-24.</LINE>				
+				<LINE Role="Dispatch">28-24 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-24 10-97 405 at Jeffrey. 
+				                   Irvine PD is 10-97.
+				</LINE>			
+				<LINE Role="Dispatch">10-4, Copy you  are 97 with Irvine PD.
+				</LINE>
+			</DIALOG>
+		</CHP_RADIO>		
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:29:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>28-19 ENRT FROM I-5 AT SND CYN, 28-13 ENRT FROM I-5 AT 133</DETAIL>
+				<DETAIL>SHUT DWN NB I-405 AT SND CYN OFFR</DETAIL>
+				<UNIT UnitNum="28-19" Status="ENRT" Primary="false" Active="true"/>
+				<UNIT UnitNum="28-13" Status="ENRT" Primary="false" Active="true"/>
+				<AUDIO Length = "44" Path = "189/18903.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+
+		<CHP_RADIO RadioFile="18903.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">28-19 Santa Lucia.</LINE>				
+				<LINE Role="Field_1">Santa Lucia 28-19 go ahead.</LINE>				
+				<LINE Role="Dispatch">28-19 Santa Lucia 10-23.</LINE>					
+				<LINE Role="Dispatch">(pause)</LINE>				
+				<LINE Role="Dispatch">28-13 Santa Lucia.</LINE>				
+				<LINE Role="Field_2">Santa Luica 28-13 go ahead.</LINE>				
+				<LINE Role="Dispatch">28-19 and 28-13 Santa Lucia, proceed to northbound 405 
+						to shut down the northbound lanes at the Sand Canyon off 
+						ramp. A man has threatened to blow up the 405 at 
+						Jeffrey interchange.</LINE>
+				
+				<LINE Role="Field_1">Santa Lucia 28-19 10-4. Enroute from I-5 at Sand Canyon.</LINE>				
+				<LINE Role="Field_2">Santa Lucia 28-13 copied, enroute from I-5 at 133.</LINE>
+			</DIALOG>
+		</CHP_RADIO>			
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:30:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>OPN #2,3 LNS, FULL OPN IN 5</DETAIL>
+				<AUDIO Length = "20" Path = "187/18727.wav" />				
+				
+				<PARAMICS LocationID="187_N_405_ML">
+					<Status>CHANGED</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>1</Lane_number>
+				</PARAMICS>						
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+
+		<CHP_RADIO RadioFile="18727.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-S3.</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia go ahead</LINE>				
+				<LINE Role="Field">Santa Lucia 14-S3. We have opened the #2 and #3 lanes. Full 
+					opening in 5 minutes.</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia 10-4. #2 and #3 lanes open, full opening in 5.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<CMS_EVALUATION cmsID="87" type="update">
+			<LOCATION>NB 405 @ HARVARD</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT AT HWY-55</CMS_LINE>
+				<CMS_LINE>RT LANE BLKD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>
+		<CMS_EVALUATION cmsID="88" type="update">
+			<LOCATION>NB 405 @ ICD</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT AT HWY-55</CMS_LINE>
+				<CMS_LINE>RT LANE BLKD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>
+		<CMS_EVALUATION cmsID="95" type="update">
+			<LOCATION>NB 5 @ EL TORO</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT AT HWY-55</CMS_LINE>
+				<CMS_LINE>RT LANE BLKD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should fax and page information</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>		
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:31:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>ALL LNS CLR, 9-15 OPENING LAKE FOREST ONRAMP</DETAIL>
+				<DETAIL>9-9,9-15,9-19 1098</DETAIL>
+				<UNIT UnitNum="9-9" Status="1098" Primary="true" Active="false"/>
+				<UNIT UnitNum="9-15" Status="1098" Primary="false" Active="false"/>
+				<UNIT UnitNum="9-19" Status="1098" Primary="false" Active="false"/>
+				<AUDIO Length = "25" Path = "188/18827.wav" />
+				
+				<PARAMICS LocationID="188_N_5_ML">
+					<Status>CLEARED</Status>
+				</PARAMICS>		
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>	
+		
+		<CHP_RADIO RadioFile="18827.wav">
+			<DIALOG> 
+				<LINE Role="Field">Santa Lucia 9-9</LINE>
+				<LINE Role="Dispatch">9-9 go ahead to Santa Lucia.</LINE>
+				<LINE Role="Field">Santa Lucia 9-9. All lanes are clear.  9-15 is opening Lake Forest Onramp.  All units are 10-98.</LINE>				
+				<LINE Role="Dispatch">9-9 Santa Lucia 10-4. All lanes open.  9-15 opening Lake Forest Onramp.
+						9-9. 9-15, 9-19 are 1098.</LINE>	
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should cancel Sig Alert</EXPECTED_ACTION>
+			<EXPECTED_ACTION>Should fax and page information</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+		<FACILITATOR_EVALUATION>
+			<EXPECTED_ACTION>Should be handling situation well</EXPECTED_ACTION>
+		</FACILITATOR_EVALUATION>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:31:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>28-11 ENRT FROM I405 AT BRISTOL, 28-07 ENRT FROM SR55 AT DYER</DETAIL>
+				<DETAIL>28-11 28-07 TO SHT DWN SB I405 AT CULVER OFFR</DETAIL>
+				<UNIT UnitNum="28-11" Status="ENRT" Primary="false" Active="true"/>
+				<UNIT UnitNum="28-07" Status="ENRT" Primary="false" Active="true"/>
+				<AUDIO Length = "45" Path = "189/18904.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+
+		<CHP_RADIO RadioFile="18904.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">	28-11 Santa Lucia.</LINE>
+				<LINE Role="Field_1">	Santa Lucia 28-11 go ahead.</LINE>
+				<LINE Role="Dispatch">	28-11 Santa Lucia 10-23.</LINE>
+				<LINE Role="Dispatch">	28-07 Santa Lucia.</LINE>
+				<LINE Role="Field_2">	Santa Lucia 28-07 go ahead.</LINE>
+				<LINE Role="Dispatch">	28-11 and 28-07 Santa Lucia, proceed to southbound I405 
+							to shut down the southbound lanes at the Culver Dr off 
+							ramp. A man has threatened to blow up the 405 at 
+							Jeffrey interchange.</LINE>
+				<LINE Role="Field_1">	Santa Lucia, 28-11 10-4 enroute from 405 at Bristol Sreet.</LINE>
+				<LINE Role="Field_2">	Santa Lucia, 28-07 10-4. Enroute from 55 at Dyer.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="TV Reporter #2">Hello, this is Fred Roppel at KNOW TV channel 11.
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="TV Reporter #2">I just heard about a suicide attempt on I405.
+			</INSTRUCTOR>
+			<STUDENT>Confirm report.</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #2">"Where exactly is it located, I would 
+											 like to send a camera out there?"
+			</INSTRUCTOR>
+			<STUDENT>I405 at Jeffrey Dr.</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #2">"Are you closing down any of the lanes?"</INSTRUCTOR>
+			<STUDENT>Closing down the whole interchange.</STUDENT>
+		</TELEPHONE>
+
+		<ATMS_EVALUATION>
+			<EXPECTED_ACTION>HAR should note incident. Should note interchange closed 
+							 when all lanes have been closed. HAR's #3 and #4 might 
+							 also note interchange closed.
+			</EXPECTED_ACTION>
+		</ATMS_EVALUATION>
+
+	</SCRIPT_EVENT>
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:32:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>PD CLOSING JEFFREY AND UNIV DR, SENDING NEGOTIATOR, REQ SIGALERT</DETAIL>
+				<AUDIO Length = "30" Path = "189/18905.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+		
+		<CHP_RADIO RadioFile="18905.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-24.</LINE>				
+				<LINE Role="Dispatch">28-24 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-24. The police department is taking care of 
+					the Jeffrey Road and University Drive closures. They have 
+					sent for a negotiator to talk the man down. Issue a Sig 
+					Alert on this one, we'll be here a while.</LINE>				
+				<LINE Role="Dispatch">28-24 Santa Lucia 10-4. PD closing Jeffrey Road and 
+						University Drive and sending negotiator to talk man 
+						down. 	Requesting Sig Alert until further notice.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #5">Hello, this is Tim Rogers at KLNW radio.
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #5">I was told that both the northbound 
+											and southbound I405 lanes are going 
+											to be closed due to a suicide 
+											attempt. What details do you have on 
+											that?
+			</INSTRUCTOR>
+			<STUDENT>Gives details of closure.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #5">Is a detour being set up?</INSTRUCTOR>
+			<STUDENT>Don't know as of yet.</STUDENT>
+		</TELEPHONE>
+		
+		<FACILITATOR_EVALUATION>
+			<EXPECTED_ACTION>Should ensure HQ Comm is notified</EXPECTED_ACTION>
+			<EXPECTED_ACTION>Should notify District Duty Officer</EXPECTED_ACTION>
+		</FACILITATOR_EVALUATION>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:35:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>VEH TWD, LNS OPN, 14-S, 14-9, 14-14 1098</DETAIL>
+				<UNIT UnitNum="14-14" Status="1098" Primary="true" Active="false"/>
+				<UNIT UnitNum="14-17" Status="1098" Primary="false" Active="false"/>
+				<UNIT UnitNum="14-9" Status="1098" Primary="false" Active="false"/>
+				<UNIT UnitNum="14-S3" Status="1098" Primary="false" Active="false"/>
+				<AUDIO Length = "23" Path = "187/18728.wav" />
+				
+				<PARAMICS LocationID="187_N_405_ML">
+					<Status>CLEARED</Status>
+				</PARAMICS>							
+				
+				<PARAMICS LocationID="187_N_405_HV">
+					<Status>CLEARED</Status>
+				</PARAMICS>			
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>
+		
+		<CHP_RADIO RadioFile="18728.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-S3.</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 14-S3. Vehicles have been towed and lanes open. 
+					All units are 10-98.</LINE>				
+				<LINE Role="Dispatch">14-S3 Santa Lucia 10-4. Vehicles towed and lanes open.  
+						14-S3,14-9, and 14-14 are 10-98.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="TV Reporter #3">Hello, this is Terry Webb at KTSV TV channel 11.
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="TV Reporter #3">Are the lanes clear NB 405 at 55?
+			</INSTRUCTOR>
+			<STUDENT>Lanes were just cleared.</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #3">How many were injured in that accident?
+			</INSTRUCTOR>
+			<STUDENT>There were 3 dead and 7 injured.</STUDENT>
+		</TELEPHONE>
+		
+		<CMS_EVALUATION cmsID="87" type="remove">
+			<LOCATION>NB 405 @ HARVARD</LOCATION>
+		</CMS_EVALUATION>
+		<CMS_EVALUATION cmsID="88" type="remove">
+			<LOCATION>NB 405 @ ICD</LOCATION>
+		</CMS_EVALUATION>
+		<CMS_EVALUATION cmsID="95" type="remove">
+			<LOCATION>NB 5 @ EL TORO</LOCATION>
+		</CMS_EVALUATION>
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should fax and page information</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>		
+		<FACILITATOR_EVALUATION>
+			<EXPECTED_ACTION>Should be alert to the situation</EXPECTED_ACTION>
+		</FACILITATOR_EVALUATION>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:36:00</TIME_INDEX>
+		<INCIDENT LogNum="188">Tomato Truck Spill/Fire</INCIDENT>
+
+		<TMT_RADIO>TMT units go 10-98.  Traffic is back to normal</TMT_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:36:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>28-13 1097, 10-23 28-19 B4 CLOSING NB LNS, 1039 DOT FOR SIGN TRUCKS</DETAIL>
+				<UNIT UnitNum="28-13" Status="1097" Primary="false" Active="true"/>
+				<AUDIO Length = "33" Path = "189/18906.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="18906.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-13.</LINE>				
+				<LINE Role="Dispatch">28-13 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-13 10-97 northbound 405 at Sand Canyon.  Will 
+					10-23 28-19 and then proceed to close down northbound lanes. 
+					Do we have any sign trucks enroute yet to assist with the 
+					closure?</LINE>				
+				<LINE Role="Dispatch">Santa Lucia copied 28-13 10-97 northbound 405 at Sand 
+						Canyon. 10-23 28-19 before closing northbound lanes. Checking on TMT.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<ATMS_EVALUATION>
+			<EXPECTED_ACTION>
+			</EXPECTED_ACTION>
+		</ATMS_EVALUATION>
+		
+		<MAINTENANCE_RADIO>Get TMT rolling.</MAINTENANCE_RADIO>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:37:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>28-11 1097, CLSNG DWN SB LNS AT CULVER DR OFFR</DETAIL>
+				<UNIT UnitNum="28-11" Status="1097" Primary="false" Active="true"/>
+				<AUDIO Length = "21" Path = "189/18907.wav" />
+				
+				<PARAMICS LocationID="189_S_405_ML">
+					<Status>NEW</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>1</Lane_number>
+					<Lane_number>2</Lane_number>
+					<Lane_number>3</Lane_number>
+					<Lane_number>4</Lane_number>				
+				</PARAMICS>	
+
+				<PARAMICS LocationID="189_S_405_HV">
+					<Status>NEW</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>1</Lane_number>		
+				</PARAMICS>				
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+
+		<CHP_RADIO RadioFile="18907.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-11.</LINE>				
+				<LINE Role="Dispatch">28-11 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-11 10-97 405 at Culver offramp.  
+					Proceeding to close down the southbound lanes.</LINE>				
+				<LINE Role="Dispatch">Santa Lucia copied 28-11 10-97 405 at Culver offramp. 
+					Closing southbound lanes.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="CHP Dispatch">Hello, this is CHP Dispatch.</INSTRUCTOR>
+			<STUDENT>Have sign trucks been sent to the bomb threat at the 
+						 I405 and Jeffrey Road overpass?</STUDENT>
+			<STUDENT>Responds correctly to question.</STUDENT>
+			<STUDENT>Notifies maintenace station to dispatch sign trucks.</STUDENT>
+		</TELEPHONE>
+		
+		<CMS_EVALUATION cmsID="89" type="new"> 
+			<LOCATION>SB 405 @ Von Karmen</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>FWY CLOSED AT CULVER DR</CMS_LINE> 
+				<CMS_LINE>USE OTHER ROUTES</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>
+		
+		<CMS_EVALUATION cmsID="86" type="new"> 
+			<LOCATION>TBD</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>FWY CLOSED AT CULVER DR</CMS_LINE> 
+				<CMS_LINE>USE OTHER ROUTES</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>
+		
+		<CMS_EVALUATION cmsID="72" type="new"> 
+			<LOCATION>SB 55 @ Warner</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>S-405 CLOSED AT CULVER DR</CMS_LINE> 
+				<CMS_LINE>USE OTHER ROUTES</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:38:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>28-13, 28-19 SHUTTING DWN NB 405 LNS AT SAND CYN ST OFFR</DETAIL>
+				<UNIT UnitNum="28-19" Status="1097" Primary="false" Active="true"/>
+				<AUDIO Length = "30" Path = "189/18908.wav" />
+				
+				<PARAMICS LocationID="189_N_405_ML">
+					<Status>NEW</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>1</Lane_number>
+					<Lane_number>2</Lane_number>
+					<Lane_number>3</Lane_number>
+					<Lane_number>4</Lane_number>	
+					<Lane_number>5</Lane_number>				
+				</PARAMICS>	
+				
+				<PARAMICS LocationID="189_N_405_HV">
+					<Status>NEW</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>1</Lane_number>				
+				</PARAMICS>	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+
+		<CHP_RADIO RadioFile="18908.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-19.</LINE>				
+				<LINE Role="Dispatch">28-19 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-19 10-97 northbound 405 at Sand Canyon.  
+					28-13 and I are proceeding to shut down the northbound 405 lanes 
+					at the Sand Canyon offramp.</LINE>				
+				<LINE Role="Dispatch">Santa Lucia copied 28-19 10-97 northbound 405 at Sand 
+						Canyon. 28-13, 28-19 shutting down northbound 405 lanes at 
+						Sand Canyon off ramp.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="TV Reporter #4">Hello, this is Art Philco at KTTQ TV.
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="TV Reporter #4">I heard over the scanner that there is 
+										 a bomb threat on the 5.
+			</INSTRUCTOR>
+			<STUDENT>Correct location is I405.</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #4">I would like to send a helicopter out 
+										 there, what are the details on the 
+										 threat?
+			</INSTRUCTOR>
+		</TELEPHONE>	
+		
+		<CMS_EVALUATION cmsID="88" type="new"> 
+			<LOCATION>TBD</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>FWY CLOSED AT SAND CYN AVE</CMS_LINE> 
+				<CMS_LINE>USE HWY-133</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>		
+		
+		<CMS_EVALUATION cmsID="95" type="new"> 
+			<LOCATION>NB 5 @ El Toro</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>N-405 CLOSED AT SAND CYN AVE</CMS_LINE> 
+				<CMS_LINE>USE OTHER ROUTES</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:39:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="TV Reporter #1">Hello, this is Cameron Stevens at KNOW TV 2.</INSTRUCTOR>
+			<INSTRUCTOR Role="TV Reporter #1">I heard about a suicide on the 405, 
+										 what details do you have on that?
+			</INSTRUCTOR>
+			<STUDENT>Located I405 and Jeffrey overpass, man has bomb 
+						 strapped to himself, closing down I405 in both directions.
+			</STUDENT>
+		</TELEPHONE>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:40:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>28-07 1097 ASSTNG 28-11 CLSNG SB LNS AT CULVER OFFR</DETAIL>
+				<UNIT UnitNum="28-07" Status="1097" Primary="false" Active="true"/>
+				<AUDIO Length = "23" Path = "189/18909.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+
+		<CHP_RADIO RadioFile="18909.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-07.</LINE>				
+				<LINE Role="Dispatch">28-07 go ahead to Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-07 10-97 southbound 405 at Culver Dr. 
+					Assisting 28-11 with the closure.</LINE>				
+				<LINE Role="Dispatch">Santa Lucia copied 28-07 10-97 southbound 405 at Culver 
+						Drive. Assisting 28-11 with closure.</LINE>
+			</DIALOG>
+		</CHP_RADIO>		
+		
+		<TMT_RADIO>If no sign trucks have been requested yet, another 
+						 phone call needs to be made from CHP Dispatch 
+						 requesting them.
+		</TMT_RADIO>		
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:41:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>28-S4 1097 I5 JEFFREY AVE ASSIST</DETAIL>
+				<UNIT UnitNum="28-S4" Status="1097" Primary="false" Active="true"/>
+				<AUDIO Length = "19" Path = "189/18910.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+
+		<CHP_RADIO RadioFile="18910.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-S4.</LINE>				
+				<LINE Role="Dispatch">28-S4 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-S4 10-97 I-405 at Jeffrey overpass.</LINE>				
+				<LINE Role="Dispatch">Santa Lucia copied 28-S4 10-97 I-405 at Jeffrey Road.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #6">Hello, this is John Sinclair at KNIN radio.
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #6">Is the surrounding residential area 
+											around the bomb threat being evacuated?
+			</INSTRUCTOR>
+			<STUDENT>They don't know, although the correct answer will be no.</STUDENT>
+		</TELEPHONE>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:43:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>PD STTNG DETOURS, SB TRFFC OFF AT CULVER AVE, NB TRFFC OFF AT SAND CYN</DETAIL>
+				<AUDIO Length = "22" Path = "189/18911.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="18911.wav">
+			<DIALOG>
+				<LINE Role="Field">	Santa Lucia 28-S4.</LINE>				
+				<LINE Role="Dispatch">	28-S4 go ahead to Santa Lucia.</LINE>				
+				<LINE Role="Field">	Santa Lucia 28-S4. Irvine PD is setting up 
+					detours through the city for the northbound and southbound 
+					405 traffic.
+				</LINE>				
+				<LINE Role="Dispatch">	28-S4 Santa Lucia 10-4. Police department setting up 
+						detours through the city for all traffic.
+				</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Public">Hello, I just saw on TV that there is bomb 
+								   on the I405 near University Drive.
+			</INSTRUCTOR>
+			<STUDENT>Confirm report.</STUDENT>
+			<INSTRUCTOR Role="Public">"I live nearby, Is that area evacuated?</INSTRUCTOR>
+			<STUDENT>No, not to the best of my knowledge.	</STUDENT>
+		</TELEPHONE>
+
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should have posted a Sig Alert by this time</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:44:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>NEGOTIATOR 1097</DETAIL>
+				<AUDIO Length = "20" Path = "189/18912.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+
+		<CHP_RADIO RadioFile="18912.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-S4.</LINE>				
+				<LINE Role="Dispatch">28-S4 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-S4. Negotiator is 10-97 and attempting to 
+					talk the man down.</LINE>				
+				<LINE Role="Dispatch">Santa Lucia 28-S4 10-4. Negotiator is 10-97 and 
+						attempting to talk man down.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should fax and page information</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>	
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:45:00</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+		
+		<TMT_RADIO>Have NB 405 TMT units go 10-98.</TMT_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:45:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>NB LNS SHUT DOWN</DETAIL>
+				<AUDIO Length = "16" Path = "189/18913.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+
+		<CHP_RADIO RadioFile="18913.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-19.</LINE>				
+				<LINE Role="Dispatch">28-19 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-19. The northbound lanes are shut down.</LINE>				
+				<LINE Role="Dispatch">28-19 Santa Lucia 10-4. Northbound lanes are shut down.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:46:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>SUSP WON'T ALLOW NEGOTIATOR NEAR HIM</DETAIL>
+				<AUDIO Length = "22" Path = "189/18914.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+
+		<CHP_RADIO RadioFile="18914.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-S4.</LINE>				
+				<LINE Role="Dispatch">28-S4 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-S4. This is going to take a while. The man 
+					won't let the negotiator get close to him.</LINE>				
+				<LINE Role="Dispatch">28-S4 Santa Lucia 10-4. Negotiations will take a while, 
+						man won't let the negotiator get close to him.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should fax and page information</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:47:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>28-07 SB LNS SHUT DOWN</DETAIL>
+				<AUDIO Length = "19" Path = "189/18915.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="18915.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-07.</LINE>				
+				<LINE Role="Dispatch">28-07 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-07. The southbound lanes have been shut down. 
+					Traffic is building up quickly.</LINE>				
+				<LINE Role="Dispatch">28-07 Santa Lucia 10-4. Southbound lanes shut down.  
+						Traffic building up quickly.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:50:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>SUSP IS CALMING DOWN.  BOMB SQD 1097</DETAIL>
+				<AUDIO Length = "18" Path = "189/18916.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="18916.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-S4.</LINE>
+				<LINE Role="Dispatch">28-S4 go ahead to Santa Lucia.</LINE>
+				<LINE Role="Field">Santa Lucia 28-S4. The man is calming down. The bomb squad is 10-97.</LINE>
+				<LINE Role="Dispatch">	28-S4 Santa Lucia 10-4. Man calming down. Bomb squad 10-97.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should enter info for 10-97 Bomb Squad</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+
+
+		<TMT_RADIO>>Call saying the sign trucks are 10-97.  Queue update.</TMT_RADIO>
+		
+	</SCRIPT_EVENT>
+	
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:51:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<CAD_DATA>
+			<MASTER_INC_NUM>145086SLO006</MASTER_INC_NUM>
+			<P>5</P>
+			<ADDITIONAL_INFO>
+				<TYPE_CODE>1179 Accident - Ambulance Responding</TYPE_CODE>
+				<TYPE>1179</TYPE>
+			</ADDITIONAL_INFO>
+			<LOCATION>
+				<BEAT>9-22</BEAT>
+				<ADDRESS>NB5 JNO Main Street</ADDRESS>
+				<LOC>NB5 JNO Main Street</LOC>
+				<CITY>Templeton</CITY>
+				<AREA>9-Templeton</AREA>
+				<FIRE>Templeton</FIRE>
+				<LAW>Templeton</LAW>
+				<EMS>Templeton</EMS>
+			</LOCATION>
+			<GENERAL>
+				<AGY>CHP</AGY>
+			</GENERAL>
+		
+			<HEADER_INFO>
+				<Type>1179</Type>
+				<Beat>9-22</Beat>
+				<TruncLoc>NB5 JNO Main St</TruncLoc>
+				<FullLoc>NB5 JNO Main St</FullLoc>
+			</HEADER_INFO>
+			
+			<LOCATION_INFO ID="190_N_5_ML">
+				<Route>5</Route>
+				<Direction>NB</Direction>
+				<Postmile>33.2</Postmile>
+				<Location_type>ML</Location_type>					
+			</LOCATION_INFO>
+			
+			<CAD_INCIDENT_EVENT>
+				<PARAMICS LocationID="190_N_5_ML">
+					<Status>NEW</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>3</Lane_number>
+					<Lane_number>4</Lane_number>				
+				</PARAMICS>		
+			</CAD_INCIDENT_EVENT>
+			
+		</CAD_DATA>		
+		
+		<GENERAL_INFO> 
+			<TITLE>Incident Description</TITLE>
+			<TEXT>Incident Description - This is a collision involving a tanker truck 
+		  and a car that block the #3 and 4 lanes on NB I-5 just north of 
+		  Main Street. There are 2 minor injured and 1 major injured. 
+		  Liquid is leaking out of the tanker truck which is identified as milk. 
+		  The leak is plugged and the fire department sprays the milk down the 
+		  drain. The fire department, ambulance, additional units, TMT, a big 
+		  rig tow, and a rotational tow are sent to the scene.</TEXT>
+		</GENERAL_INFO>
+
+		<MAINTENANCE_RADIO>No Maintenance needed on scene for this incident.</MAINTENANCE_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:53:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>			
+				<DETAIL>9-22 ENRT FROM 57 @ CHAPMAN</DETAIL>
+				<UNIT UnitNum="9-22" Status="ENRT" Primary="true" Active="true"/>
+				<AUDIO Length = "24" Path = "190/19001.wav" />
+				
+			</CAD_INCIDENT_EVENT>					
+		</CAD_DATA>		
+
+		<CHP_RADIO RadioFile="19001.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">9-22 Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-22 go ahead.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia 11-79 northbound 5 just north of Main Street.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-22 copies, enroute from 57 at Chapman Ave.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia 10-4. Enroute from 57 at Chapman Ave.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<CAD_EVALUATION>
+			<EXPECTED_ACTION>Should shold be verifying incident 190 on the CAD.</EXPECTED_ACTION>
+		</CAD_EVALUATION>	
+		<ATMS_EVALUATION>
+			<EXPECTED_ACTION>Should try to confirm the incident with a CCTV cameras.</EXPECTED_ACTION>
+		</ATMS_EVALUATION>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:54:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Mayor">"Hello, this is Mayor Krom of Irvine."
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="Mayor">I just heard that a bomb went off on I405. Was 
+								 anyone injured or killed?
+			</INSTRUCTOR>
+			<STUDENT>Not true - no bomb was not detonated.</STUDENT>
+		</TELEPHONE>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:56:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>		
+
+		<TMT_RADIO>Queue update</TMT_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:58:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>			
+				<DETAIL>9-22 1097 2 VEH TC, VEH VS TANKER TRK, BLKNG #3,4</DETAIL>
+				<DETAIL>UNID LIQUID LEAKING FROM TNKR, NEED TO CLOSE NB LANES, REQ UNITS</DETAIL>
+				<UNIT UnitNum="9-22" Status="1097" Primary="true" Active="true"/>
+				<AUDIO Length = "37" Path = "190/19002.wav" />		
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>	
+
+		<CHP_RADIO RadioFile="19002.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-22.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-22 1097 JNO Main St. 2 vehicle collision 
+					between tanker truck and vehicle blocking #3, 4 lanes.  
+					Unidentified liquid leaking out of the tanker. Request 
+					additional units, we're going to have to shut down the 
+					northbound lanes until we identify the susbstance.</LINE>				
+				<LINE Role="Dispatch">Santa Lucia copied. 9-22 10-97.  2 vehicle 
+						collision, tanker truck and vehicle, blocking #3, 4. 
+						Unidentified liquid leaking out of tanker. Request 
+						units to shut down NB lanes.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<CMS_EVALUATION cmsID="93" type="new"> 
+			<LOCATION>NB-5 S/O Redhill</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT</CMS_LINE>
+				<CMS_LINE>AT MAIN ST</CMS_LINE>
+				<CMS_LINE>2 RT LANES BLKD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>				
+		
+		<CMS_EVALUATION cmsID="94" type="new"> 
+			<LOCATION>TBD</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT N-5</CMS_LINE>
+				<CMS_LINE>AT MAIN ST</CMS_LINE>
+				<CMS_LINE>2 RT LANES BLKD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>		
+
+		<MAINTENANCE_RADIO>TMT Earliest possible request for sign trucks. Send trucks if requested.
+		</MAINTENANCE_RADIO>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>01:59:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>			
+				<DETAIL>9-23, 9-26 ENRT TO ASSIST 9-22</DETAIL>
+				<UNIT UnitNum="9-23" Status="ENRT" Primary="false" Active="true"/>
+				<UNIT UnitNum="9-26" Status="ENRT" Primary="false" Active="true"/>
+				<AUDIO Length = "41" Path = "190/19003.wav" />		
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>		
+
+		<CHP_RADIO RadioFile="19003.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">9-23, 9-26 Santa Lucia.</LINE>				
+				<LINE Role="Field_1">Santa Lucia 9-23 go ahead.</LINE>				
+				<LINE Role="Field_2">Santa Lucia 9-26 go ahead.</LINE>				
+				<LINE Role="Dispatch">9-23 and 9-26 Santa Lucia, 1179 northbound 5 
+						just north of Main St blocking #3,4 .  22 request assistance closing freeway.</LINE>				
+				<LINE Role="Field_1">Santa Lucia 9-23 10-4. Enroute from 22 just south of 
+						Euclid Avenue.</LINE>				
+				<LINE Role="Field_2">Santa Lucia 10-4. 9-26 enroute from 57 at 91.</LINE>				
+				<LINE Role="Dispatch">Santa Lucia copied 9-23, 9-26 enroute.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:00:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>			
+				<DETAIL>1141, FD 1097, TRCK DRVR 1180 UNCONCIOUS, 2 1181S, LIQUID LEAKING INTO #2 LN. #2,3,4 BLKD AT THIS TIME</DETAIL>
+				<AUDIO Length = "35" Path = "190/19004.wav" />		
+				
+				<PARAMICS LocationID="190_N_5_ML">
+					<Status>CHANGED</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>2</Lane_number>
+					<Lane_number>3</Lane_number>
+					<Lane_number>4</Lane_number>				
+				</PARAMICS>					
+				
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>	
+
+		<CHP_RADIO RadioFile="19004.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-22.</LINE>				
+				<LINE Role="Dispatch">9-22 go ahead to Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-22. 1141 is 1097. The 
+					driver of the truck is 1180 and unconscious. There are 2 
+					1181s in the other vehicle. The liquid is leaking out into 
+					the #2 lane. #2,3,4 lanes blocked at this time.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia copies. 1141 1097. 1 
+						1180 and 2 1181's.  Liquid leaking into #2 lane.  #2,3,4 lanes are blocked.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #7">Hello, this is Kim Williamson at KRST radio.
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #7">I just caught on the scanner that 
+											there was some type of spill on 57.
+			</INSTRUCTOR>
+			<STUDENT>Confirm incident.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #7">What kind of details do you have 
+											on the collision?
+			</INSTRUCTOR>
+			<STUDENT>Truck vs car, #3 and 4 lanes blocked, liquid spill in lanes.</STUDENT>
+		</TELEPHONE>
+		
+		<CMS_EVALUATION cmsID="93" type="update"> 
+			<LOCATION>TBD</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT</CMS_LINE>
+				<CMS_LINE>AT MAIN ST</CMS_LINE>
+				<CMS_LINE>3 RT LANES BLKD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>				
+		
+		<CMS_EVALUATION cmsID="94" type="update"> 
+			<LOCATION>TBD</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT N-5</CMS_LINE>
+				<CMS_LINE>AT MAIN ST</CMS_LINE>
+				<CMS_LINE>3 RT LANES BLKD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>			
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:01:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>NEGOTIATOR MAKING PROGRESS, SUSP MAY SURRENDER</DETAIL>
+				<AUDIO Length = "21" Path = "189/18919.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="18919.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-S4.</LINE>				
+				<LINE Role="Dispatch">28-S4 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-S4. The negotiator has made some 
+					progress. Looks like the man is about to give himself up.</LINE>				
+				<LINE Role="Dispatch">28-S4 Santa Lucia 10-4. Negotiator has made progress and 
+						looks like the man is about to give himself up.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:01:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>DONT HAVE TO SHUT THE FWY, LIQUID ID'D AS MILK.  #1 LN WILL REMAIN OPEN.</DETAIL>
+				<DETAIL>ATTEMPTING TO CONTROL THE LEAK. REQ BIG RIG AND ROT 1185</DETAIL>
+				<AUDIO Length = "27" Path = "190/19005.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+
+		<CHP_RADIO RadioFile="19005.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-22.</LINE>
+				<LINE Role="Dispatch">9-22 Santa Lucia go ahead.</LINE>
+				<LINE Role="Field">Santa Lucia 9-22. We don't have to shut down all the lanes, 
+					the liquid is milk. Attempting to control the leak.  Request big 
+					rig 11-85 and 11-85 rotational.</LINE>
+				<LINE Role="Dispatch">9-22 Santa Lucia copied don't have to close all lanes, 
+						liquid is milk. Attempting to control the leak. Requesting big 
+						rig and rotational 11-85's.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #8">Hello, this is Tom Webb at KSON radio.
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #8">I just heard the northbound lanes 
+											on 57 are being closed.
+			</INSTRUCTOR>
+			<STUDENT>Confirmation.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #8">Why are they closing the lanes.
+			</INSTRUCTOR>
+			<STUDENT>Liquid spill, collision.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #8">How long are they expected to be 
+											closed.
+			</INSTRUCTOR>
+			<STUDENT>Until cleanup - no definitive answer.</STUDENT>
+		</TELEPHONE>
+		
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should fax and page information</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+		
+	</SCRIPT_EVENT>
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:02:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="TV Reporter #2">"Hello, this is Fred Roppel at KNOW TV 
+										 Channel 3."
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="TV Reporter #2">"Has a bomb been found yet at the 405 
+										 and Jeffrey interchange?"
+			</INSTRUCTOR>
+			<STUDENT>No bomb has been found.</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #2">"When will they be done with their search?"
+			</INSTRUCTOR>
+			<STUDENT>Unknown, but about 10 minutes.</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #2">"Are there any other incidents going on 
+										 right now?"
+			</INSTRUCTOR>
+			<STUDENT>Notify reporter of incidents.</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #2">"What are their details?"</INSTRUCTOR>
+			<STUDENT>Notify reporter of incident details.</STUDENT>
+		</TELEPHONE>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:03:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #9">Hello, this is Jordan Bradley at KTCR radio.
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #9">How many lanes are blocked by the 
+											collision on 57 at Katella?
+			</INSTRUCTOR>
+			<STUDENT>#3 and 4 lanes blocked, milk in #2 lane.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #9">How many Injured are there?</INSTRUCTOR>
+			<STUDENT>3 injured.</STUDENT>
+		</TELEPHONE>
+		
+		<ATMS_EVALUATION>
+			<EXPECTED_ACTION>HAR should note incident.</EXPECTED_ACTION>
+		</ATMS_EVALUATION>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:04:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>9-23 1097, REQ TMT, TRAFFIC BACKING</DETAIL>
+				<UNIT UnitNum="9-23" Status="1097" Primary="true" Active="true"/>
+				<AUDIO Length = "21" Path = "190/19006.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+
+		<CHP_RADIO RadioFile="19006.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-23.</LINE>				
+				<LINE Role="Dispatch">9-23 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-23 10-97 11-80. Request TMT, traffic is backing up.</LINE>				
+				<LINE Role="Dispatch">Santa Lucia copies 9-23 10-97 11-80. Request TMT, traffic is backing up.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		
+		<TMT_RADIO>
+			Time of request by CHP officers in the field for sign 
+						 trucks. Send sign trucks to scene when requested.
+						 ***CONTROL ROOM ACTION*** - Call TMC, ask for TMT
+		</TMT_RADIO>
+		
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:05:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+
+		<TMT_RADIO>Queue Update</TMT_RADIO>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:06:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>MAN TRIED TO DETONATE THE DEVICE, BOMB DIDNT ACTIVATE, PD APPRHNDNG</DETAIL>
+				<AUDIO Length = "23" Path = "189/18921.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>			
+		
+		<CHP_RADIO RadioFile="18921.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-S4.</LINE>				
+				<LINE Role="Dispatch">28-S4 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-S4. The man just tried to blow himself up, 
+					but the bomb didn't go off! The police department is 
+					apprehending him now.</LINE>				
+				<LINE Role="Dispatch">28-S4 Santa Lucia 10-4. Man attempted to blow up the 
+						interchange and is being apprehended by the PD.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:08:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>SUSP IN CUSTODY, BOMB SQD INSPECTING BOMB</DETAIL>
+				<AUDIO Length = "20" Path = "189/18922.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+
+		<CHP_RADIO RadioFile="18922.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-S4.</LINE>				
+				<LINE Role="Dispatch">28-S4 go ahead to Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-S4. The man is in custody, and the bomb squad 
+					is attempting to diffuse the bomb.</LINE>				
+				<LINE Role="Dispatch">28-S4 Santa Lucia 10-4. Man in custody, and bomb squad 
+						diffusing the bomb.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:09:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<TMT_RADIO>Queue update</TMT_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:11:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>PREPARING TO TRANSPORT VICTIMS, #1 LN OPN</DETAIL>
+				<AUDIO Length = "15" Path = "190/19007.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+
+		<CHP_RADIO RadioFile="19007.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-22.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-22. The victims are being prepared for 
+					transport.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia 10-4. Victims being prepared for 
+						transport.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:11:30</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #10">Hello, this is Jim Sanso at KTAK 
+											 radio.
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #10">I just heard about a large 
+											 collision and spill on the 55.
+			</INSTRUCTOR>
+			<STUDENT>Correct location is on northbound 57.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #10">Give me the details on that.
+			</INSTRUCTOR>
+			<STUDENT>Gives details regarding incident.</STUDENT>
+		</TELEPHONE>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:12:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<RADIO_EVALUATION>
+			<EXPECTED_ACTION>Operator should have requested sign truck(s)</EXPECTED_ACTION>
+		</RADIO_EVALUATION>
+
+	</SCRIPT_EVENT>
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:13:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>9-26 1097 VICTIMS TRANSPORTED</DETAIL>
+				<UNIT UnitNum="9-26" Status="1097" Primary="false" Active="true"/>
+				<AUDIO Length = "15" Path = "190/19008.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="19008.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-26.</LINE>				
+				<LINE Role="Dispatch">9-26 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia I'm 1097.  The victims have been transported.</LINE>				
+				<LINE Role="Dispatch">	Santa Lucia copies 9-26 10-97. Victims transported.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #11">Hello, this is Bill Rasmussen at KTRC radio.
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #11">What details do you have on the collision on 57.
+			</INSTRUCTOR>
+			<STUDENT>Tanker vs. car, milk spill, 3 lanes blocked, 3 injured.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #11">Is there an alternate route 
+											established, that I could tell my listeners?
+			</INSTRUCTOR>
+			<STUDENT>Alternate route??</STUDENT>
+		</TELEPHONE>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:14:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>CODE A, BOMB DEFUSED, LNS BEING OPENED</DETAIL>
+				<AUDIO Length = "19" Path = "189/18923.wav" />
+				
+				<PARAMICS LocationID="189_N_405_ML">
+					<Status>CLEARED</Status>
+				</PARAMICS>	
+				
+				<PARAMICS LocationID="189_N_405_HV">
+					<Status>CLEARED</Status>
+				</PARAMICS>		
+				
+				<PARAMICS LocationID="189_S_405_ML">
+					<Status>CLEARED</Status>
+				</PARAMICS>	
+				
+				<PARAMICS LocationID="189_S_405_HV">
+					<Status>CLEARED</Status>
+				</PARAMICS>		
+				
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+		
+		<CHP_RADIO RadioFile="18923.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-S4.</LINE>				
+				<LINE Role="Dispatch">28-S4 go ahead to Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-S4. The bomb has been diffused. We're opening 
+					the lanes now.</LINE>				
+				<LINE Role="Dispatch">28-S4 Santa Lucia 10-4. The bomb has been diffused and 
+						lanes are being opened.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<RADIO_EVALUATION>
+			<EXPECTED_ACTION>Operator should update TMT units</EXPECTED_ACTION>
+		</RADIO_EVALUATION>
+		
+		<TMT_RADIO>Queue update</TMT_RADIO>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:14:30</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #12">"Hello, this is Fred Masterson at KTRC radio."
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #12">"My CAD is down and I was wondering 
+											 if you had any new incidents?"
+			</INSTRUCTOR>
+			<STUDENT>Yes, tanker vs. car, spill.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #12">"What do you have on that?"
+			</INSTRUCTOR>
+			<STUDENT>Gives details.</STUDENT>
+		</TELEPHONE>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:15:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>HOLE IN TANKER PLUGGED, FD WASHING DOWN RDWY</DETAIL>
+				<AUDIO Length = "20" Path = "190/19009.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+
+		<CHP_RADIO RadioFile="19009.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-22.</LINE>				
+				<LINE Role="Dispatch">9-22 go ahead to Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-22. The hole in the tanker has been plugged. 
+					Not too much spilled on the roadway here.  The fire department is going 
+					to wash it down.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia 10-4. Hole plugged. Fire department 
+						spraying down roadway.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:16:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>SB LNS OPN 28-11 28-07 1098</DETAIL>
+				<UNIT UnitNum="28-11" Status="1098" Primary="false" Active="false"/>
+				<UNIT UnitNum="28-07" Status="1098" Primary="false" Active="false"/>
+				<AUDIO Length = "21" Path = "189/18924.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+
+		<CHP_RADIO RadioFile="18924.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-07.</LINE>				
+				<LINE Role="Dispatch">28-07 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-07. Southbound lanes are open. 28-11 and I are 10-98.</LINE>				
+				<LINE Role="Dispatch">28-07 Santa Lucia 10-4. Southbound lanes open. 28-11, 28-07 10-98.</LINE>
+			</DIALOG>
+		</CHP_RADIO>		
+		
+		<CMS_EVALUATION cmsID="72" type="remove"> 
+			<LOCATION>SB 55 @ Warner</LOCATION>
+		</CMS_EVALUATION>		
+		
+		<CMS_EVALUATION cmsID="86" type="update"> 
+			<LOCATION>TBD</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT CLEARED</CMS_LINE> 
+				<CMS_LINE>AT JEFFREY RD</CMS_LINE>
+				<CMS_LINE>HEAVY TRAFFIC</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>		
+		
+		<CMS_EVALUATION cmsID="89" type="update"> 
+			<LOCATION>SB 405 @ Von Karmen</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT CLEARED</CMS_LINE> 
+				<CMS_LINE>AT JEFFREY RD</CMS_LINE>
+				<CMS_LINE>HEAVY TRAFFIC</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:16:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #13">Hello, this is Chris Rasmuessan at KWIT radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #13">What's going on with the tanker 
+											spill on 5 north of Main St?
+			</INSTRUCTOR>
+			<STUDENT>(tanker plugged, injured transported, diluting milk with water, #1 lane only open.</STUDENT>
+		</TELEPHONE>
+	</SCRIPT_EVENT>
+	
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:17:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<MASTER_INC_NUM>145086SLO007</MASTER_INC_NUM>
+			<P>4</P>
+			<ADDITIONAL_INFO>
+				<TYPE_CODE>1179 Accident - Ambulance Responding</TYPE_CODE>
+				<TYPE>1179</TYPE>
+			</ADDITIONAL_INFO>
+			<LOCATION>
+				<BEAT>17-14</BEAT>
+				<ADDRESS>SB73 JNO Baker St.</ADDRESS>
+				<LOC>SB73 JNO Baker St.</LOC>
+				<CITY>Templeton</CITY>
+				<AREA>17</AREA>
+				<FIRE>Templeton</FIRE>
+				<LAW>Templeton</LAW>
+				<EMS>Templeton</EMS>
+			</LOCATION>
+			<GENERAL>
+				<AGY>CHP</AGY>
+			</GENERAL>
+		
+			<HEADER_INFO>
+				<Type>1179</Type>
+				<Beat>17-14</Beat>
+				<TruncLoc>SB73 JNO Baker St.</TruncLoc>
+				<FullLoc>SB73 JNO Baker St.</FullLoc>
+			</HEADER_INFO>
+			
+			<LOCATION_INFO ID="191_S_73_ML">
+				<Route>73</Route>
+				<Direction>SB</Direction>
+				<Postmile>26.7</Postmile>
+				<Location_type>ML</Location_type>					
+			</LOCATION_INFO>
+			
+			<CAD_INCIDENT_EVENT>			
+				<DETAIL>911 CELLULAR CALL, RV FIRE SB-73 AT BEAR St, UNVERIFIED</DETAIL>
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>		
+		
+		<GENERAL_INFO> 
+			<TITLE>Incident Description</TITLE>
+			<TEXT> This is an RV fire on the shoulder southbound 73 just north of 
+		   Bear/Baker Street. There are two injured victims who were pulled from 
+		   the RV by passers-by. The #3 is closed to fight the fire. 
+		   The fire department, paramedics, an extra unit, sign truck/s, and 
+		   ambulance are sent to the scene.
+			</TEXT>
+		</GENERAL_INFO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:17:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>NB LNS OPN 28-13 28-19 1098</DETAIL>
+				<UNIT UnitNum="28-13" Status="1098" Primary="false" Active="false"/>
+				<UNIT UnitNum="28-19" Status="1098" Primary="false" Active="false"/>
+				<AUDIO Length = "22" Path = "189/18925.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+
+		<CHP_RADIO RadioFile="18925.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-19.</LINE>
+				<LINE Role="Dispatch">28-19 go ahead to Santa Lucia.</LINE>
+				<LINE Role="Field">Santa Lucia 28-19. Northbound lanes are open. 28-13 and I are 10-98.</LINE>				
+				<LINE Role="Dispatch">28-19 Santa Lucia copies northbound lanes open. 28-13, 28-19 10-98.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<CMS_EVALUATION cmsID="88" type="update"> 
+			<LOCATION>TBD</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT CLEARED</CMS_LINE> 
+				<CMS_LINE>AT JEFFREY RD</CMS_LINE>
+				<CMS_LINE>HEAVY TRAFFIC</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>		
+		
+		<CMS_EVALUATION cmsID="95" type="update"> 
+			<LOCATION>NB 5 @ El Toro</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT CLEARED</CMS_LINE> 
+				<CMS_LINE>N-405 AT JEFFREY RD</CMS_LINE>
+				<CMS_LINE>HEAVY TRAFFIC</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>		
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:18:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>28-24, 28-S4 1098 PD OPNNG OVRPASS</DETAIL>
+				<UNIT UnitNum="28-24" Status="1098" Primary="true" Active="false"/>
+				<UNIT UnitNum="28-S4" Status="1098" Primary="false" Active="false"/>
+				<AUDIO Length = "24" Path = "189/18926.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+		
+		<CHP_RADIO RadioFile="18926.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 28-S4.</LINE>				
+				<LINE Role="Dispatch">28-S4 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 28-S4. 28-24 and I are 10-98. The police 
+					department is opening the overpass.</LINE>				
+				<LINE Role="Dispatch">28-S4 Santa Lucia 10-4. 28-S4, 28-24 10-98. Police 
+						department opening overpass.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<TMT_RADIO>Queue update</TMT_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:19:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>			
+				<DETAIL>17-14 ENRT FROM 405 AT EUCLID</DETAIL>
+				<UNIT UnitNum="17-14" Status="ENRT" Primary="true" Active="true"/>
+				<AUDIO Length = "24" Path = "191/19101.wav" />
+				
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="19101.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">17-14 Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 17-14 go ahead.</LINE>				
+				<LINE Role="Dispatch">17-14 Santa Lucia, RV fire southbound 73 just north of Baker Street. </LINE>				
+				<LINE Role="Field">Santa Lucia 17-14 10-4. Enroute from 405 @ Euclid.</LINE>				
+				<LINE Role="Dispatch">10-4 Santa Lucia copies, 17-14 enroute from 405 @ Euclid.</LINE>
+			</DIALOG>
+		</CHP_RADIO>	
+		
+		<CAD_EVALUATION>
+			<EXPECTED_ACTION>Operator should be verifying incident 191 on the CAD</EXPECTED_ACTION>
+		</CAD_EVALUATION>
+		<ATMS_EVALUATION>
+			<EXPECTED_ACTION>Attempt to verify incident on ATMS</EXPECTED_ACTION>
+		</ATMS_EVALUATION>
+		
+		<MAINTENANCE_RADIO>No Maintenance needed on scene for this incident.</MAINTENANCE_RADIO>
+
+	</SCRIPT_EVENT>
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:20:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>1185 ROT 1097</DETAIL>
+				<TOW Company="Martins" ConfNum="(949)555-2031" PubNum="(949)555-9067" Beat=""/>
+				<AUDIO Length = "16" Path = "190/19010.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+
+		<CHP_RADIO RadioFile="19010.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-22.</LINE>				
+				<LINE Role="Dispatch">9-22 go ahead to Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-22. The 11-85 rotation 10-97.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia copies 11-85 rotation 10-97.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:21:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>BIG RIG 1185 1097, ONCE FD IS DONE, WILL START CLEANUP</DETAIL>
+				<TOW Company="Imperial" ConfNum="(949)555-1128" PubNum="(949)555-1520" Beat=""/>
+				<AUDIO Length = "22" Path = "190/19011.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+
+		<CHP_RADIO RadioFile="19011.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-22.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">	Santa Lucia 9-22 big rig 11-85 10-97. Once the 
+				  fire department is done, we will start clearing vehicles.</LINE>				
+				<LINE Role="Dispatch">	9-22 Santa Lucia 10-4. Big rig 11-85 10-97. Start 
+						cleanup when fire department done.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #1">Hello, this is Dakota Crew at KCOW radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #1">Do you have an alternate route I 
+										    could tell my listeners about for collision on I-5?
+			</INSTRUCTOR>
+			<STUDENT>Should have one established.</STUDENT>
+		</TELEPHONE>		
+
+		<TMT_RADIO>
+			Sign trucks should be 1097.
+		</TMT_RADIO>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:22:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #2">Hello, this is Monica Stevens at KCLY radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #2">Do you have any update info on the 
+											collision on 57.
+			</INSTRUCTOR>
+			<STUDENT>Clearing the milk, about to move vehicles, injured transported, etc.</STUDENT>
+		</TELEPHONE>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:23:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+		
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="TV Reporter #1">Hello, this is Cameron Stevens at KCLY Channel 11.</INSTRUCTOR>
+			<INSTRUCTOR Role="TV Reporter #1">Is the bomb squad done with their 
+										 search yet at the 405 and Jeffrey 
+										 interchange?
+			</INSTRUCTOR>
+			<STUDENT>Yes</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #1">When will the lanes be open?</INSTRUCTOR>
+			<STUDENT>They were already opened about 10 minutes ago.</STUDENT>
+		</TELEPHONE>
+
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should fax and page information</EXPECTED_ACTION>
+			<EXPECTED_ACTION>Should issue a Sig Alert</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+
+		<MAINTENANCE_RADIO>TMT The traffic is near normal. I'm (we're) 1098.</MAINTENANCE_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:23:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>FD DONE, OPENING #2, STARTING CLEANUP</DETAIL>
+				<AUDIO Length = "19" Path = "190/19012.wav" />
+				
+				<PARAMICS LocationID="190_N_5_ML">
+					<Status>CHANGED</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>3</Lane_number>
+					<Lane_number>4</Lane_number>				
+				</PARAMICS>			
+			</CAD_INCIDENT_EVENT>		
+			
+		</CAD_DATA>	
+		
+		<CHP_RADIO RadioFile="19012.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-22.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-22. Fire department is done.
+					Opening the #2 lane and starting cleanup.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia 10-4. Fire department is done, opening 
+						#2 lane, and starting cleanup.</LINE>
+			</DIALOG>
+		</CHP_RADIO>	
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:24:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>RV ON FIRE ON RS, 2 1181S, PARAMEDICS 1097, REQ UNIT TO ASSIST</DETAIL>
+				<UNIT UnitNum="17-14" Status="1097" Primary="true" Active="true"/>
+				<AUDIO Length = "42" Path = "191/19102.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+		
+		<CHP_RADIO RadioFile="19102.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 17-14.</LINE>				
+				<LINE Role="Dispatch">17-14 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 17-14 10-97 RV fire southbound 73 just north of
+					Baker Street.  RV on the right hand shoulder. Citizens 
+					pulled 2 11-81's from vehicle, paramedics 10-97.</LINE>				
+				<LINE Role="Dispatch">Santa Lucia copies 17-14 10-97 RV fire southbound 73 
+						just north of Baker Street. RV on right hand shoulder. 2 
+						11-81's pulled from RV, paramedics 10-97.</LINE>				
+				<LINE Role="Field">Santa Lucia 17-14 10-4. Send a unit to assist.</LINE>				
+				<LINE Role="Dispatch">17-14 Santa Lucia copies.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		
+		<CMS_EVALUATION cmsID="86" type="new"> 
+			<LOCATION>TBD</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT S-73</CMS_LINE> 
+				<CMS_LINE>AT BAKER ST</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:25:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>17-16 ENRT FROM S-405 @ EUCLID TO ASSIST 17-14</DETAIL>
+				<UNIT UnitNum="17-16" Status="ENRT" Primary="false" Active="true"/>
+				<AUDIO Length = "20" Path = "191/19103.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		
+		<CHP_RADIO RadioFile="19103.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">17-16 Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 17-16 go ahead.</LINE>				
+				<LINE Role="Dispatch">17-16 Santa Lucia, 17-14 requesting assistance RV fire 
+						southbound 73 just north of Baker Street.</LINE>				
+				<LINE Role="Field">Santa Lucia 17-1610-4. Enroute from S-405 @ Euclid.</LINE>
+			</DIALOG>
+		</CHP_RADIO>	
+		
+
+		<TELEPHONE>
+			<INSTRUCTOR Role="TV Reporter #2">Hello, this is Fred Roppel at KNOW TV channel 3.</INSTRUCTOR>
+			<INSTRUCTOR Role="TV Reporter #2">I just heard about a RV fire over the scanner.</INSTRUCTOR>
+			<STUDENT>Confirm RV fire.</STUDENT>								 
+			<INSTRUCTOR Role="TV Reporter #2">Where was that located, I'd like to 
+										 send a camera out there?</INSTRUCTOR>
+			<STUDENT>Southbound 73 just North of Baker Street.</STUDENT>												 
+		</TELEPHONE>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:26:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>FD 1097, CLOSING RT LN, REQ TMT, TRAFFIC ADVISORY</DETAIL>
+				<AUDIO Length = "24" Path = "191/19104.wav" />
+				
+				<PARAMICS LocationID="191_S_73_ML">
+					<Status>NEW</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>3</Lane_number>		
+				</PARAMICS>		
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+		
+		<CHP_RADIO RadioFile="19104.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 17-14.</LINE>				
+				<LINE Role="Dispatch">17-14 go ahead to Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 17-14, fire department 10-97.   Closing the right lane 
+					for the fire engines. Request sign truck, traffic advisory.</LINE>				
+				<LINE Role="Dispatch">17-14 Santa Lucia copies fire departement 10-97. Closing 
+						the right lane. Request sign truck, traffic advisory.</LINE>
+			</DIALOG>
+		</CHP_RADIO>			
+		
+		<CMS_EVALUATION cmsID="86" type="new"> 
+			<LOCATION>TBD</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT S-73</CMS_LINE> 
+				<CMS_LINE>AT BAKER ST</CMS_LINE>
+				<CMS_LINE>RT LANE BLKD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>			
+		
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should issue traffic advisory</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+		
+		<RADIO_EVALUATION>
+			<EXPECTED_ACTION>Operator should send TMT units</EXPECTED_ACTION>
+		</RADIO_EVALUATION>
+		
+		<TMT_RADIO>
+		Time of request by CHP officers in the field for sign trucks. Send sign 
+		trucks to scene when requested.
+		</TMT_RADIO>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:27:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>#2 LN OPN, FULL CLNUP IN 20</DETAIL>
+				<AUDIO Length = "18" Path = "190/19013.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="19013.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-22.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-22. The #2 lane is open. Full cleanup in 20 minutes.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia copied #2 open, full cleanup in 20.</LINE>
+			</DIALOG>
+		</CHP_RADIO>			
+		
+		<CMS_EVALUATION cmsID="93" type="update"> 
+			<LOCATION>NB 5 S/O Redhill</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT</CMS_LINE>
+				<CMS_LINE>AT MAIN ST</CMS_LINE>
+				<CMS_LINE>RT LANE BLKD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>				
+		
+		<CMS_EVALUATION cmsID="94" type="update"> 
+			<LOCATION>NB 55 @ Dyer</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT N-5</CMS_LINE>
+				<CMS_LINE>AT MAIN ST</CMS_LINE>
+				<CMS_LINE>RT LANE BLKD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>				 
+		
+		<TMT_RADIO>Queue update. Possibly reposition.</TMT_RADIO>	
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:28:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="TV Reporter #3">Hello, this is Terry Webb at KTSV radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="TV Reporter #3">I heard that there was an RV fire on 
+										  southbound 73.
+			</INSTRUCTOR>
+			<STUDENT>Confirm RV fire</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #3">What details do you have on it, are 
+										  any lanes blocked?
+			</INSTRUCTOR>
+			<STUDENT>RV fire on shoulder, two injured pulled from vehicle, 
+						 fire on shoulder, no lanes blocked.
+			</STUDENT>
+		</TELEPHONE>	
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:28:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="TV Reporter #4">Hello, this is Art Philco at KTTQ news.
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="TV Reporter #4">Our computers are down, what 
+										  incidents do you have going on?
+			</INSTRUCTOR>
+			<STUDENT>Notify reporter of current incidents.</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #4">Give me all the details on those.</INSTRUCTOR>
+			<STUDENT>Notify reporter of current incident details.</STUDENT>
+		</TELEPHONE>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:29:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>17-14 1097</DETAIL>
+				<UNIT UnitNum="17-16" Status="1097" Primary="false" Active="true"/>
+				<AUDIO Length = "24" Path = "191/19105.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="19105.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 17-16</LINE>				
+				<LINE Role="Dispatch">17-16 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 17-16 10-97 RV fire southbound 73 just north of
+					Baker Street.</LINE>
+				<LINE Role="Dispatch">10-4 Santa Lucia copied 17-16, 10-97 RV fire 
+						southbound 73 just north of Baker Street.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		
+		<ATMS_EVALUATION>
+			<EXPECTED_ACTION>HAR should note incident.</EXPECTED_ACTION>
+		</ATMS_EVALUATION>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:32:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>VEH READY TO BE TOWED, TRCK AND TNKR BEING UPRIGHTED</DETAIL>
+				<AUDIO Length = "19" Path = "190/19014.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+
+		<CHP_RADIO RadioFile="19014.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-22.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-22. The car is ready to be towed. The truck 
+					and tanker are being uprighted.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia 10-4. Car ready for tow, truck and 
+						tanker being uprighted.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:33:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>VICTIMS TRANSPORTED, PASSERS BY RESCUED VICTIMS</DETAIL>
+				<AUDIO Length = "24" Path = "191/19106.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="19106.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 17-14.</LINE>				
+				<LINE Role="Dispatch">17-14 go ahead to Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 17-14. The two victims transported. Passers-by 
+					saw the RV on fire and assisted in pulling the two victims 
+					out of the vehicle before it was completely engulfed.</LINE>
+				<LINE Role="Dispatch">17-14 Santa Lucia 10-4. Victims transported. Passers-by 
+						pulled victims out of RV.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>	
+	
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:34:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #4">Hello, this is Alex Harmon at KJOK radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #4">Have any of the lanes been open on 5 
+										 north of Main St.</INSTRUCTOR>
+			<STUDENT>#2 lane open.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #4">When is there a full opening?</INSTRUCTOR>
+			<STUDENT>Around 15 to 20 minutes.</STUDENT>
+		</TELEPHONE>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:34:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #5">Hello, this is Tim Rogers at KLNW radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #5">How long is it going to take to clear 
+										  up the RV fire on southbound 73?
+			</INSTRUCTOR>
+			<STUDENT>No estimated time as of yet.</STUDENT>
+		</TELEPHONE>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:35:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>FIRE IS OUT, FD INVESTIGATING CAUSE OF FIRE</DETAIL>
+				<AUDIO Length = "19" Path = "191/19107.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="19107.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 17-14.</LINE>				
+				<LINE Role="Dispatch">17-14 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 17-14. The fire is out, and the fire department 
+					is investigating the cause of the fire.</LINE>
+				<LINE Role="Dispatch">	17-14 Santa Lucia copied, fire out and fire department 
+						investigating cause of fire.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:37:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>VEH TOWED, TNKR UPRGHT, FULL OPENING IN 10</DETAIL>
+				<AUDIO Length = "20" Path = "190/19015.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="19015.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-22.</LINE>				
+				<LINE Role="Dispatch">9-22 go ahead to Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-22. The car has been towed. The tanker truck 
+					is upright. Full opening in 10 minutes.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia copied car towed. Tanker truck upright. 
+						Full opening in 10.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:38:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #6">Hello, this is John Sinclair at KNIN radio.
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #6">Is there an estimated time for lane 
+										 opening for the collision on I-5?
+			</INSTRUCTOR>
+			<STUDENT>10 minutes.</STUDENT>
+		</TELEPHONE>
+		
+		<TMT_RADIO>Queue update</TMT_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:39:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>REQ FLAT BED 1185, FD 98 IN 15</DETAIL>
+				<AUDIO Length = "22" Path = "191/19108.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="19108.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 17-14.</LINE>				
+				<LINE Role="Dispatch">17-14 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 17-14 request flat bed 11-85 for the RV. Fire 
+					department done within 15 minutes.</LINE>
+				<LINE Role="Dispatch">	17-14 Santa Lucia 10-4. Request flat bed 11-85, fire 
+						 department 98 in 15.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+	
+	
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:40:00</TIME_INDEX>
+		<INCIDENT LogNum="189">Suicide Attempt/Bomb Threat</INCIDENT>
+		
+		<CMS_EVALUATION cmsID="86" type="remove"> 
+			<LOCATION>TBD</LOCATION>
+		</CMS_EVALUATION>		
+		
+		<CMS_EVALUATION cmsID="89" type="remove"> 
+			<LOCATION>SB 405 @ Von Karmen</LOCATION>
+		</CMS_EVALUATION>
+		
+		<CMS_EVALUATION cmsID="88" type="remove"> 
+			<LOCATION>TBD</LOCATION>
+		</CMS_EVALUATION>		
+		
+		<CMS_EVALUATION cmsID="95" type="remove"> 
+			<LOCATION>NB 5 @ El Toro</LOCATION>
+		</CMS_EVALUATION>			
+
+	</SCRIPT_EVENT>
+	
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:41:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>1039 1185 ENRT, ETA 10</DETAIL>
+				<AUDIO Length = "18" Path = "191/19109.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="19109.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">17-14 Santa Lucia information.</LINE>				
+				<LINE Role="Field">Santa Lucia 17-14 go ahead.</LINE>				
+				<LINE Role="Dispatch">17-14 Santa Lucia. 11-85 enroute, ETA 10.</LINE>				
+				<LINE Role="Field">Santa Lucia 17-14 copied 1 1-85 enroute with ETA of 10.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #7">Hello, this is Kim Williamson at KRST radio.
+			</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #7">I was just told about a RV fire on 
+										  73 , what details do you have on that?
+			</INSTRUCTOR>
+			<STUDENT>Gives incident details.</STUDENT>
+		</TELEPHONE>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:42:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>TANKER READY FOR TOW, FINISHING CLEANUP</DETAIL>
+				<AUDIO Length = "18" Path = "190/19016.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="19016.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-22.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-22. The tanker truck is ready to be towed. 
+					Finishing cleanup.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia 10-4. Tanker truck ready to be towed, 
+						finishing cleanup.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:43:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<TMT_RADIO>Queue update</TMT_RADIO>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:46:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>TANKER TOWED, RDWY CLR, OPENING LANES</DETAIL>
+				<AUDIO Length = "20" Path = "190/19017.wav" />
+				
+				<PARAMICS LocationID="190_N_5_ML">
+					<Status>CLEARED</Status>				
+				</PARAMICS>				
+			</CAD_INCIDENT_EVENT>					
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="19017.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-22.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-22. The tanker truck has been towed, roadway 
+					is clear. We're opening all lanes.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia 10-4. Tanker truck towed, roadway 
+						clear. Opening lanes.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<CMS_EVALUATION cmsID="93" type="update"> 
+			<LOCATION>NB 5 S/O Redhill</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT CLEARED</CMS_LINE>
+				<CMS_LINE>AT MAIN ST</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>					
+		<CMS_EVALUATION cmsID="94" type="update"> 
+			<LOCATION>NB 55 @ Dyer</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT CLEARED</CMS_LINE>
+				<CMS_LINE>N-5 AT MAIN ST</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>			
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should fax and page information</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:46:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #8">Hello, this is Tom Webb at KSON radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #8">Do you have any incidents going on right now?</INSTRUCTOR>
+			<STUDENT>Notifies reporter of current incidents.</STUDENT>
+		</TELEPHONE>
+	</SCRIPT_EVENT>
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:48:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>1185 1097, INVESTIGATION NEARLY COMPLETE</DETAIL>
+				<TOW Company="Martins" ConfNum="(949)555-2031" PubNum="(949)555-9067" Beat=""/>
+				<AUDIO Length = "21" Path = "191/19111.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="19111.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 17-14.</LINE>				
+				<LINE Role="Dispatch">17-14 go ahead to Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 17-14 11-85 10-97. Fire department is nearly 
+					completed with their investigation.</LINE>				
+				<LINE Role="Dispatch">17-14 Santa Lucia 10-4. 11-85 10-97, investigation 
+						nearly completed.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:49:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>	
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>LNS OPN, 9-22, 9-23, 9-26 10-98</DETAIL>
+				<UNIT UnitNum="9-22" Status="1098" Primary="true" Active="false"/>
+				<UNIT UnitNum="9-23" Status="1098" Primary="false" Active="false"/>
+				<UNIT UnitNum="9-26" Status="1098" Primary="false" Active="false"/>
+				<AUDIO Length = "21" Path = "190/19018.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+		
+		<CHP_RADIO RadioFile="19018.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 9-22.</LINE>				
+				<LINE Role="Dispatch">9-22 go ahead to Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 9-22. The lanes are open, all units 10-98.</LINE>				
+				<LINE Role="Dispatch">9-22 Santa Lucia copied lanes open, 9-22, 9-23, 9-26 10-98.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:51:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>FD INVESTIGATION COMPLETE, SPRAYING RS, FIRE CAUSED BY KITCHEN FIRE</DETAIL>
+				<AUDIO Length = "20" Path = "191/19112.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="19112.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 17-14.</LINE>				
+				<LINE Role="Dispatch">17-14 go ahead to Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 17-14. The fire department investigation 
+					complete.  Fire caused by a kitchen fire.</LINE>
+				<LINE Role="Dispatch">17-14 Santa Lucia copied fire department is 98.
+				  Fire caused by kitchen fire.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #9">Hello, this is Jordan Bradley at KTCR radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #9">What is the traffic like on 73 around the RV fire?</INSTRUCTOR>
+			<STUDENT>Notifies reporter with current queue from ATMS.  One lane is closed.</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #9">When will the incident be cleared?</INSTRUCTOR>
+			<STUDENT>Inknown, a good answer around 15 minutes.</STUDENT>
+		</TELEPHONE>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:53:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>		
+		
+		<TMT_RADIO>Queue update</TMT_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:53:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>
+		
+		<ATMS_EVALUATION>
+			<EXPECTED_ACTION>HAR should have been cleared</EXPECTED_ACTION>
+		</ATMS_EVALUATION>		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:54:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>	
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>RV READY FOR 1185, LN OPN IN 10</DETAIL>
+				<AUDIO Length = "21" Path = "191/19113.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>	
+		<CHP_RADIO RadioFile="19113.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 17-14.</LINE>				
+				<LINE Role="Dispatch">17-14 go ahead to Santa Lucia.</LINE>				
+				<LINE Role="Field">Santa Lucia 17-14. RV ready for 11-85. The lane will be open in 10.</LINE>				
+				<LINE Role="Dispatch">17-14 Santa Lucia 10-4. RV ready for 11-85, lane open in 10.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Public">Hello, is Helen there?</INSTRUCTOR>
+			<STUDENT>Wrong number.</STUDENT>
+			<INSTRUCTOR Role="Public">Sorry. </INSTRUCTOR>
+		</TELEPHONE>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:55:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>		
+		
+		<TMT_RADIO>Queue update 10-98</TMT_RADIO>
+
+	</SCRIPT_EVENT>
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:58:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>RV TOWED, LANES OPEN IN 5</DETAIL>
+				<AUDIO Length = "17" Path = "191/19114.wav" />
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="19114.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 17-14.</LINE>				
+				<LINE Role="Dispatch">17-14 Santa Lucia go ahead.</LINE>				
+				<LINE Role="Field">Santa Lucia 17-14. RV towed, lane open in 5.</LINE>				
+				<LINE Role="Dispatch">17-14 Santa Lucia copied, RV towed, lane open in 5.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>02:59:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="TV Reporter #10">Hello, this is Jim Sanso at KTAK radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="TV Reporter #10">Has the RV been cleaned up yet at the fire on 73?</INSTRUCTOR>
+			<STUDENT>The RV was just towed, the lane will be open in 5 minutes.</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #10">Do you have any other incidents going on right now?</INSTRUCTOR>
+			<STUDENT>Notifies reporter of current incidents.</STUDENT>
+		</TELEPHONE>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>03:00:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>		
+		
+		<TMT_RADIO>Queue update</TMT_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>03:01:00</TIME_INDEX>
+		<INCIDENT LogNum="191">RV Fire</INCIDENT>
+		
+		<CAD_DATA>
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>17-14, 17-16 1098. LN OPN</DETAIL>
+				<UNIT UnitNum="17-14" Status="1098" Primary="true" Active="false"/>
+				<UNIT UnitNum="17-16" Status="1098" Primary="false" Active="false"/>
+				<AUDIO Length = "19" Path = "191/19115.wav" />
+				
+				<PARAMICS LocationID="191_S_73_ML">
+					<Status>CLEARED</Status>			
+				</PARAMICS>					
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="19115.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 17-16.</LINE>
+				<LINE Role="Dispatch">17-16 go ahead to Santa Lucia.</LINE>
+				<LINE Role="Field">Santa Lucia 17-16. #1 Lane is open. All units are 10-98.</LINE>				
+				<LINE Role="Dispatch">17-16 Santa Lucia 10-4. #1 lane open.  
+						17-14, 17-16 are 1098.</LINE>	
+			</DIALOG>			
+		</CHP_RADIO>
+		
+		<CMS_EVALUATION cmsID="86" type="remove"> 
+			<LOCATION>TBD</LOCATION>
+		</CMS_EVALUATION>			
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should fax and page information</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>
+
+	</SCRIPT_EVENT>
+	
+	<SCRIPT_EVENT>
+		<TIME_INDEX>03:00:00</TIME_INDEX>
+		<INCIDENT LogNum="190">Tanker Truck vs. Car/Spill</INCIDENT>		
+		
+		<CMS_EVALUATION cmsID="93" type="remove"> 
+			<LOCATION>NB 5 S/O Redhill</LOCATION>
+		</CMS_EVALUATION>				
+		
+		<CMS_EVALUATION cmsID="94" type="remove"> 
+			<LOCATION>NB 55 @ Dyer</LOCATION>
+		</CMS_EVALUATION>		
+		
+	</SCRIPT_EVENT>
+	
+</TMC_SCRIPT>
+
Index: trunk/scripts/audio_systest.xml
===================================================================
--- trunk/scripts/audio_systest.xml	(revision 2)
+++ trunk/scripts/audio_systest.xml	(revision 2)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE TMC_SCRIPT SYSTEM "script.dtd">
+
+<TMC_SCRIPT title="System test for Audio - single event">
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:00:10</TIME_INDEX>
+		<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>	
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<UNIT UnitNum="14-14" Status="ENRT" Primary="true" Active="true"/>
+				<AUDIO Length = "25" Path = "187/18701.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+
+		<CHP_RADIO RadioFile="18701.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">14-14 Santa Lucia</LINE>				
+				<LINE Role="Field">Santa Lucia 14-14 go ahead</LINE>				
+				<LINE Role="Dispatch">14-14 Santa Lucia 11-25 stalled DOT truck southbound 55 overpass at 405.</LINE>
+				<LINE Role="Field">Santa Lucia 14-14 10-4. Enroute from 55 at Dyer Rd.</LINE>				
+				<LINE Role="Dispatch">14-14 Santa Lucia copies enroute from 55 at Dyer Rd.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+
+	</SCRIPT_EVENT>
+
+</TMC_SCRIPT>
+
Index: trunk/scripts/testScript.xml
===================================================================
--- trunk/scripts/testScript.xml	(revision 2)
+++ trunk/scripts/testScript.xml	(revision 2)
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE TMC_SCRIPT SYSTEM "script.dtd">
+
+<TMC_SCRIPT title="Full Simulation">
+	<SCRIPT_DATA>
+		<UNIT UnitNum = "14-S2">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>Santa Maria Area</CURR_LOC>
+			<DESTINATION>Santa Maria Area</DESTINATION>
+			<AREA>14-Santa Maria</AREA>
+			<BADGE_NUM>015238</BADGE_NUM>
+			<OFFICER>John Carrie</OFFICER>
+			<OFFICE>Santa Maria</OFFICE>
+			<TIMER>3600</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>us</ALIAS>
+			<UNIT_STATUS>Assignable</UNIT_STATUS>
+		</UNIT>
+		<UNIT UnitNum = "14-S2">
+			<AGY>AGY</AGY>
+			<OFFICE>Duplicate = replace</OFFICE>
+		</UNIT>
+		<UNIT UnitNum = "A9-001">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>Us101 N / Us101 N Willow Rd</CURR_LOC>
+			<AREA>28-San Luis Obispo</AREA>
+			<BADGE_NUM>065982</BADGE_NUM>
+			<OFFICER>James Hill</OFFICER>
+			<OFFICE>San Luis Obispo</OFFICE>
+			<TIMER>36000</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>3</ALIAS>
+		</UNIT>
+		<UNIT UnitNum = "3-MZQ1>">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>San Luis Obispo Area-SLCC</CURR_LOC>
+			<DESTINATION>San Luis Obispo Area-SLCC</DESTINATION>
+			<AREA>28-San Luis Obispo</AREA>
+			<BADGE_NUM>015978</BADGE_NUM>
+			<OFFICER>Bobby Hey</OFFICER>
+			<OFFICE>San Luis Obispo</OFFICE>
+			<TIMER>2500</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>8</ALIAS>
+		</UNIT>
+		<UNIT UnitNum = "A25-101>">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>San Luis Obispo Area-SLCC</CURR_LOC>
+			<DESTINATION>San Luis Obispo Area-SLCC</DESTINATION>
+			<AREA>28-San Luis Obispo</AREA>
+			<BADGE_NUM>015538</BADGE_NUM>
+			<OFFICER>Katie Lee</OFFICER>
+			<OFFICE>San Luis Obispo</OFFICE>
+			<TIMER>1500</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>4</ALIAS>
+		</UNIT>
+	</SCRIPT_DATA>
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:00:00</TIME_INDEX>
+		<INCIDENT LogNum="100">Media Log</INCIDENT>
+		<CAD_DATA>
+			<MASTER_INC_NUM>HI</MASTER_INC_NUM>
+		</CAD_DATA>
+		<LOCATION_INFO>
+			<ADDRESS>1 Grand Avenue</ADDRESS>
+		</LOCATION_INFO>
+	</SCRIPT_EVENT>
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:00:00</TIME_INDEX>
+		<INCIDENT LogNum="200">Media Log</INCIDENT>
+		<LOCATION_INFO>
+			<ADDRESS>500 Foothill Boulevard</ADDRESS>
+		</LOCATION_INFO>
+	</SCRIPT_EVENT>
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:00:00</TIME_INDEX>
+		<INCIDENT LogNum="300">Media Log</INCIDENT>
+		<LOCATION_INFO>
+			<ADDRESS>200 Santa Rosa</ADDRESS>
+		</LOCATION_INFO>
+	</SCRIPT_EVENT>
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:00:00</TIME_INDEX>
+		<INCIDENT LogNum="400">Media Log</INCIDENT>
+		<LOCATION_INFO>
+			<ADDRESS>600 Madonna Road</ADDRESS>
+		</LOCATION_INFO>
+	</SCRIPT_EVENT>
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:00:00</TIME_INDEX>
+		<INCIDENT LogNum="500">Media Log</INCIDENT>
+		<LOCATION_INFO>
+			<ADDRESS>500 Osos</ADDRESS>
+		</LOCATION_INFO>
+	</SCRIPT_EVENT>
+</TMC_SCRIPT>
Index: trunk/scripts/practice_script_2016.xml
===================================================================
--- trunk/scripts/practice_script_2016.xml	(revision 2)
+++ trunk/scripts/practice_script_2016.xml	(revision 2)
@@ -0,0 +1,797 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE TMC_SCRIPT SYSTEM "script.dtd">
+
+<TMC_SCRIPT title="Practice Simulation">
+
+	<SCRIPT_DATA>
+		<NEW_UNIT UnitNum = "14-7">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>SB 405 AT BROOKHURST</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>14-Santa Maria</AREA>
+			<BADGE_NUM>015238</BADGE_NUM>
+			<OFFICER>John Carrie</OFFICER>
+			<OFFICE>Santa Maria</OFFICE>
+			<TIMER>9796</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>5</ALIAS>
+			<UNIT_STATUS>Assignable</UNIT_STATUS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "14-21">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>55 AT MACARTHUR</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>14-Santa Maria</AREA>
+			<BADGE_NUM>065982</BADGE_NUM>
+			<OFFICER>James Hill</OFFICER>
+			<OFFICE>Santa Maria</OFFICE>
+			<TIMER>15053</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>3</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "14-13">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>NB 405 AT JEFFREY</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>14-Santa Maria</AREA>
+			<BADGE_NUM>015978</BADGE_NUM>
+			<OFFICER>Bobby Hey</OFFICER>
+			<OFFICE>Santa Maria</OFFICE>
+			<TIMER>6394</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>8</ALIAS>
+		</NEW_UNIT>
+		<NEW_UNIT UnitNum = "A25-101>">
+			<STATUS>10-8</STATUS>
+			<CURR_LOC>San Luis Obispo Area-SLCC</CURR_LOC>
+			<DESTINATION></DESTINATION>
+			<AREA>14-Santa Maria</AREA>
+			<BADGE_NUM>015538</BADGE_NUM>
+			<OFFICER>Katie Lee</OFFICER>
+			<OFFICE>Santa Maria</OFFICE>
+			<TIMER>10606</TIMER>
+			<AGY>CHP</AGY>
+			<ALIAS>4</ALIAS>
+		</NEW_UNIT>
+	</SCRIPT_DATA>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:00:00</TIME_INDEX>
+		<INCIDENT LogNum="100">Media Log</INCIDENT>		
+		
+		<CAD_DATA>
+		
+			<HEADER_INFO>
+				<Type>Media</Type>
+				<Beat>
+				</Beat>
+				<TruncLoc>
+				</TruncLoc>
+				<FullLoc>
+				</FullLoc>
+			</HEADER_INFO>			
+			
+			<CAD_INCIDENT_EVENT>	
+			</CAD_INCIDENT_EVENT>		
+			
+		</CAD_DATA>				
+		
+	</SCRIPT_EVENT>	
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:00:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<CAD_DATA>
+			<MASTER_INC_NUM>A349BD39</MASTER_INC_NUM>
+			<P>1</P>
+			<ADDITIONAL_INFO>
+				<TYPE_CODE>1179 Accident - Ambulance Responding</TYPE_CODE>
+				<TYPE>1179</TYPE>
+			</ADDITIONAL_INFO>
+			<LOCATION>
+				<BEAT>14-13</BEAT>
+				<ADDRESS> NB405 AT MACARTHUR </ADDRESS>
+				<LOC>NB405 Santa Lucia</LOC>
+				<CITY>SANTA MARIA</CITY>
+				<AREA>SANTA MARIA</AREA>
+			</LOCATION>
+			<GENERAL>
+				<AGY>CHP</AGY>
+			</GENERAL>-
+		
+			<HEADER_INFO>
+				<Type>1179</Type>
+				<Beat>14-13</Beat>
+				<TruncLoc>NB405 AT MACARTHUR</TruncLoc>
+				<FullLoc>NB405 AT MACARTHUR</FullLoc>
+			</HEADER_INFO>
+			
+			<LOCATION_INFO ID="181_N_405_ML">
+				<Route>405</Route>
+				<Direction>NB</Direction>
+				<Postmile>7.8</Postmile>
+				<Location_type>ML</Location_type>					
+			</LOCATION_INFO>
+			
+			<CAD_INCIDENT_EVENT>
+				<PARAMICS LocationID="181_N_405_ML">
+					<Status>NEW</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>1</Lane_number>
+					<Lane_number>2</Lane_number>
+					<Lane_number>3</Lane_number>
+				</PARAMICS>				
+			</CAD_INCIDENT_EVENT>	
+		</CAD_DATA>		
+		
+		<GENERAL_INFO>
+			<TITLE>Incident Description</TITLE>
+			<TEXT>This is a three-vehicle collision involving a hay truck and two 
+			  cars blocking the #1, 2, and 3 lanes on NB 405 just south of 
+			  MacArthur Boulevard. The truck spills hay over the #2 and 3 lanes. 
+			  There is one 11-44 and two minor injured. Ambulance, fire, 
+			  paramedics, additional units, Maintenance, and coroner are 
+			  requested on this incident.</TEXT>
+		</GENERAL_INFO>
+		
+		<ATMS_EVALUATION>
+			<EXPECTED_ACTION>
+		Should be attempting to verify via CCTV.
+			</EXPECTED_ACTION>
+		</ATMS_EVALUATION>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:00:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>ENRT FROM NB 405 AT JEFFREY</DETAIL>	
+				<UNIT UnitNum="14-13" Status="ENRT" Primary="true" Active="true"/>
+				<AUDIO Length = "29" Path = "181/18101.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		 	
+		
+		<CHP_RADIO RadioFile="18101.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">14-13 Santa Lucia</LINE>
+				<LINE Role="Field">Santa Lucia 14-13 go ahead</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia 11-79 NB 405 JSO MacArthur Blvd.</LINE>				
+				<LINE Role="Field">14-13 Santa Lucia 10-4, enroute from NB 405 at Jeffrey Road.</LINE>			
+				<LINE Role="Dispatch">14-13 Santa Lucia 10-4, enroute from NB 405 at Jeffrey Road.</LINE>
+			</DIALOG>
+		</CHP_RADIO>		
+		
+		<MAINTENANCE_RADIO>Size of Cleanup: 50 bales of hay.</MAINTENANCE_RADIO>
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:03:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>14-13 10-97 1125, EMS 10-97, HAY TRK VS 2 VEH, #1,2,3 LNS BLCKD REQ ADDL UNITS</DETAIL>	
+				<UNIT UnitNum="14-13" Status="1097" Primary="true" Active="true"/>
+				<AUDIO Length = "41" Path = "181/18102.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>			
+		
+		<CHP_RADIO RadioFile="18102.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-13</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia go ahead</LINE>
+				<LINE Role="Field">Santa Lucia 14-13 10-97 11-79 11-25. Paramedics 
+							   and fire 10-97. Collision between a hay truck and 
+							   two vehicles blocking the left three lanes. The 
+							   hay truck is on its side, will be out checking. 
+							   Request a couple units to assist.</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia copies 10-97 11-79 11-25. 
+								  Fire and paramedics 10-97. Collision involves 
+								  hay truck and two vehicles in three lanes. Hay 
+								  truck on its side, will be out checking. 
+								  Requesting units.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<CAD_EVALUATION>
+			<EXPECTED_ACTION>
+		    Should try to verify incident using CAD.
+			</EXPECTED_ACTION>
+		</CAD_EVALUATION>	  
+		<ACTIVITY_LOG_EVALUATION>
+			<EXPECTED_ACTION>Should fax and page information</EXPECTED_ACTION>
+		</ACTIVITY_LOG_EVALUATION>	
+		
+		<TMT_RADIO>>Earliest expected time for request of sign trucks. Send truck/s if 
+			  requested. Have units arrive 10 minutes after time of request.
+		</TMT_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:04:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>14-7 ENRT FROM SB 405 AT BROOKHURST </DETAIL>
+				<DETAIL>14-21 ENRT FROM 55 AT MACARTHUR</DETAIL>	
+				<UNIT UnitNum="14-7" Status="ENRT" Primary="false" Active="true"/>
+				<UNIT UnitNum="14-21" Status="ENRT" Primary="false" Active="true"/>
+				<AUDIO Length = "40" Path = "181/18103.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>			
+		
+		<CHP_RADIO RadioFile="18103.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">14-7, 14-21 Santa Lucia</LINE>
+				<LINE Role="Field">Santa Lucia 14-7 go ahead</LINE>
+				<LINE Role="Field">14-21, go ahead</LINE>
+				<LINE Role="Dispatch">14-7 and 14-21 assist 14-13 with 11-79 11-25 
+								  northbound 405 just south of MacArthur</LINE>
+				<LINE Role="Field">Santa Lucia 14-7 10-4, enroute from southbound 
+							   405 at Brookhurst Street.</LINE>
+				<LINE Role="Field">Santa Lucia 14-21 copied enroute from 55 at 
+							   Macarthur</LINE>
+				<LINE Role="Dispatch">Santa Lucia copies 14-7 enroute from 405 at 
+								  Brookhurst and 14-21 enroute from 55 at 
+								  Macarthur.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #1">Hello, this is Bill Bradley at KTCR 
+											radio.</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #1">We just heard over the scanner that 
+											there was an accident and a spill on NB 405.</INSTRUCTOR>
+			<STUDENT>(pause for confirmation)</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #1">Our computers are down. Do you have 
+											any details on that?</INSTRUCTOR>
+			
+		</TELEPHONE>
+		
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:05:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>1144 IN HAY TRK, 2 1181S, REQ CORONER</DETAIL>	
+				<DETAIL>REQ DOT TO REMOVE HAY SPILLED IN SB LANES</DETAIL>					
+				<AUDIO Length = "29" Path = "181/18104.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>				
+		
+		<CHP_RADIO RadioFile="18104.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-13</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia go ahead</LINE>
+				<LINE Role="Field">Santa Lucia, 11-44 in hay truck and two 11-81's 
+							   from other vehicles. Request coroner. Also 
+							   request Caltrans, there's hay bales spilled over 
+							   the two right lanes.</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia copied 11-44 in hay truck 
+								  and two 11-81's. Requesting coroner and 
+								  Caltrans to clean up spilled hay bales.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<FACILITATOR_EVALUATION>
+			<EXPECTED_ACTION>Should be alert to the situation</EXPECTED_ACTION>
+		</FACILITATOR_EVALUATION>
+		<RADIO_EVALUATION>
+			<EXPECTED_ACTION>
+			Earliest expected call from TMC for Maintenance.
+			</EXPECTED_ACTION>
+		</RADIO_EVALUATION>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:07:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>14-7 REQ 1185 BIG RIG AND 2 ROT 1185</DETAIL>		
+				<UNIT UnitNum="14-7" Status="1097" Primary="false" Active="true"/>			
+				<AUDIO Length = "25" Path = "181/18105.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>					
+		
+		<CHP_RADIO RadioFile="18105.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-7</LINE>
+				<LINE Role="Dispatch">14-7 go ahead to Santa Lucia</LINE>
+				<LINE Role="Field">Santa Lucia 14-7 10-97 11-80 11-25. Roll a 11-85 
+							   big rig and two rotational 11-85's.</LINE>
+				<LINE Role="Dispatch">14-7 Santa Lucia copied 10-97 11-80 11-25. 
+								  Roll 11-85 big rig and two 11-85's 
+								  rotational</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #2">"Hello, this is John Sinclair at 
+											KNIN radio."</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #2">"I heard that there was a big 
+											accident on NB 405 at Macarthur."
+			</INSTRUCTOR>
+			<STUDENT>(pause for confirmation)</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #2">"What is going on there?"
+			</INSTRUCTOR>
+		</TELEPHONE>
+		
+		
+		
+		<ATMS_EVALUATION>
+			<EXPECTED_ACTION>HAR should note incident.</EXPECTED_ACTION>
+		</ATMS_EVALUATION>
+		<CMS_EVALUATION cmsID="87" type="new"> 
+			<LOCATION>NB 405 @ HARVARD</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT AHEAD</CMS_LINE>
+				<CMS_LINE>AT MACARTHUR BLVD</CMS_LINE>
+				<CMS_LINE>3 LT LANES BLKD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>	
+		
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:08:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #1">"Hello, this is Bill Bradley at KTCR 
+											radio."</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #1">"We heard over the scanner that 
+											there was an accident and a spill on 
+											NB 405."</INSTRUCTOR>
+			<STUDENT>(pause for confirmation)</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #1">"Our computers are down. Do you have 
+											any details on that?"</INSTRUCTOR>
+		</TELEPHONE>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:09:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>10-39 COLLEGE OAK FOR BIG RIG AND CYCLE FOR ROT</DETAIL>		
+				<AUDIO Length = "24" Path = "181/18106.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>		
+		
+		<CHP_RADIO RadioFile="18106.wav">
+			<DIALOG>
+				<LINE Role="Dispatch">14-13 Santa Lucia information</LINE>
+				<LINE Role="Field">Santa Lucia 14-13 go ahead</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia 10-39 College Oak for big 
+								  rig 11-85 and Cycle Tow for 11-85 rotational.
+				</LINE>
+				<LINE Role="Field">Santa Lucia 9-9 copied 10-39 College Oak and 
+							   Cycle Tow.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<MAINTENANCE_RADIO>If Maintenance has not by requested by this time, have someone 
+			  call as CHP Dispatch and make a request for them.
+		</MAINTENANCE_RADIO>
+	</SCRIPT_EVENT>
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:11:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>14-21 1097 PROV 1184 TRF BACKING QUICKLY</DETAIL>		
+				<UNIT UnitNum="14-21" Status="1097" Primary="false" Active="true"/>			
+				<AUDIO Length = "26" Path = "181/18107.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>			
+		
+		<CHP_RADIO RadioFile="18107.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-21</LINE>
+				<LINE Role="Dispatch">14-21 Santa Lucia go ahead</LINE>
+				<LINE Role="Field">Santa Lucia 14-21 10-97 11-80 11-25. Assisting in 
+							   11-84, traffic is backing quickly.</LINE>
+				<LINE Role="Dispatch">14-21 Santa Lucia copies 10-97 11-80 11-25 and 
+								  assisting in 11-84, traffic is backing 
+								  quickly.</LINE>
+			</DIALOG>
+		</CHP_RADIO>		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:12:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>VEH KNOCKED HAY BALES ONTO VON KARMAN AVENUE ADV CITY</DETAIL>			
+				<AUDIO Length = "21" Path = "181/18108.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>			
+		
+		<CHP_RADIO RadioFile="18108.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-13</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia go ahead</LINE>
+				<LINE Role="Field">Santa Lucia, one of the vehicles knocked a couple 
+							   of hay bales onto Airport Loop Drive below. 
+							   Notify the city about the bales.</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia 10-4. Hay bales knocked onto 
+								  Airport Loop Drive. City will be notified.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:15:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>		
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>1181 TRANSPORTED REQ ETA FOR CORONER</DETAIL>	
+				<DETAIL>ETA FOR CORONER 10</DETAIL>		
+				<AUDIO Length = "19" Path = "181/18109.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>			
+		
+		<CHP_RADIO RadioFile="18109.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-13</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia go ahead</LINE>
+				<LINE Role="Field">Santa Lucia, 11-81's transported. What's the 
+							   coroner's ETA?</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia 10-4. 11-81's transported, 
+								  coroner's ETA 10 minutes.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<TMT_RADIO>Queue update</TMT_RADIO>
+		
+	</SCRIPT_EVENT>
+
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:17:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="CHP Dispatch">"Hello, this is CHP Dispatch."</INSTRUCTOR>
+			<INSTRUCTOR Role="CHP Dispatch">"Has the city has been notified of the 
+										hay spilled onto one of their streets?"
+			</INSTRUCTOR>
+			<STUDENT>(If they haven't been notified, say the following)
+			</STUDENT>
+			<INSTRUCTOR Role="CHP Dispatch">"Could you notify the city of the spill 
+										onto Airport Loop Drive?"</INSTRUCTOR>
+		</TELEPHONE>
+	</SCRIPT_EVENT>
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:18:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>14-13 1185 1097, #3 LN WILL OPEN 5-10</DETAIL>	
+				<TOW Company="College Oak" ConfNum="(949)555-2990" PubNum="(949)555-5758" Beat=""/>
+				<TOW Company="Cycle" ConfNum="(949)555-2281" PubNum="(949)555-7162" Beat=""/>
+				<AUDIO Length = "25" Path = "181/18110.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>			
+		
+		<CHP_RADIO RadioFile="18110.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-13</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia go ahead</LINE>
+				<LINE Role="Field">Santa Lucia, 11-85's 10-97. Clearing the #3 lane 
+							   and opening it in 5 to 10 minutes.</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia 10-4,11-85's 10-97. Clearing 
+								  the #3 lane and opening it in 5 to 10 minutes.
+				</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:19:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="TV Reporter #1">"Hi, My name is Jay Stevens with KCLY 
+										 news 2, and I was wondering if you had 
+										 the latest info on the incident on the 
+										 405."</INSTRUCTOR>
+			<STUDENT>(note information given)</STUDENT>
+			<INSTRUCTOR Role="TV Reporter #1">"OK, thanks!"</INSTRUCTOR>
+		</TELEPHONE>		
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:20:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>DOT 1097 TO REMOVE BALES</DETAIL>	
+				<AUDIO Length = "19" Path = "181/18111.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>			
+		
+		<CHP_RADIO RadioFile="18111.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-13</LINE>
+				<LINE Role="Dispatch">14-13 go ahead to Santa Lucia</LINE>
+				<LINE Role="Field">Santa Lucia, Caltrans is 10-97 and beginning 
+							   cleanup of the bales. </LINE>
+				<LINE Role="Dispatch">Santa Lucia copies Caltrans 10-97 and 
+								  beginning cleanup.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:22:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<TELEPHONE>
+			<INSTRUCTOR Role="Radio Reporter #3">"Hello, this is Jack Crew at KCOW 
+											radio"</INSTRUCTOR>
+			<INSTRUCTOR Role="Radio Reporter #3">"We just heard over the scanner that 
+											there was a mud slide on the PCH."
+			</INSTRUCTOR>
+			<STUDENT>(pause for confirmation)</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #3">"Do you have any details on the mud 
+											slide?"</INSTRUCTOR>
+			<STUDENT>(pause for answer)</STUDENT>
+			<INSTRUCTOR Role="Radio Reporter #3">"Has anyone been killed?"</INSTRUCTOR>
+			<STUDENT>(pause for answer)</STUDENT>
+		</TELEPHONE>
+		
+	</SCRIPT_EVENT>
+	
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:23:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>CORONER 1097</DETAIL>	
+				<AUDIO Length = "16" Path = "181/18112.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>			
+		
+		<CHP_RADIO RadioFile="18112.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-13</LINE>
+				<LINE Role="Dispatch">14-13 go ahead to Santa Lucia</LINE>
+				<LINE Role="Field">Coroner 10-97.</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia 10-4 Coroner 10-97.</LINE>
+			</DIALOG>
+		</CHP_RADIO>	
+		
+	</SCRIPT_EVENT>	
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:25:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>#3 LN CLEARED OPENING NOW</DETAIL>	
+				<AUDIO Length = "17" Path = "181/18113.wav" />	
+				
+				<PARAMICS LocationID="181_N_405_ML">
+					<Status>CHANGED</Status>
+					<Incident_type>LANE_BREAKDOWN</Incident_type>
+					<Lane_number>1</Lane_number>
+					<Lane_number>2</Lane_number>
+				</PARAMICS>						
+				
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>			
+		
+		<CHP_RADIO RadioFile="18113.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-13</LINE>
+				<LINE Role="Dispatch">14-13 go ahead to Santa Lucia</LINE>
+				<LINE Role="Field">Santa Lucia, the #3 lane has been cleared and 
+							   were opening it now.</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia 10-4. #3 lane cleared and 
+								  opening it.</LINE>	
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<CMS_EVALUATION cmsID="87" type="update"> 
+			<LOCATION>NB 405 @ HARVARD</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT AHEAD</CMS_LINE>
+				<CMS_LINE>AT MACARTHUR BLVD</CMS_LINE>
+				<CMS_LINE>2 LT LANES BLKD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>	
+		
+		<MAINTENANCE_RADIO>TMC, M31. Were halfway done with the bale cleanup. We should be finished in 
+			 5 to 10 minutes.
+		</MAINTENANCE_RADIO>
+	</SCRIPT_EVENT>
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:28:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>CORONER CONFIRMED 1144, VEHS READY FOR TOW, HAY NEARLY CLEARED, ALL LANES OPEN IN 15</DETAIL>	
+				<AUDIO Length = "30" Path = "181/18114.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>			
+		
+		<CHP_RADIO RadioFile="18114.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-13</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia go ahead</LINE>
+				<LINE Role="Field">Santa Lucia, the coroner has confirmed the 11-44. 
+							   The two vehicles are ready to be towed and the 
+							   hay bales are nearly cleared. We should have all 
+							   lanes open in 15 minutes.</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia copies 11-44 confirmed. The 
+								  two vehicles are ready for tow and hay bales 
+								  nearly cleared. Lanes open in 15 minutes.</LINE>
+				
+			</DIALOG>
+		</CHP_RADIO>		
+
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:30:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>WTNSSES, JOHN/BETTY JONES SAW HAY TRUCK LOSE CONTROL, FLIP OVER, 2 VEH HIT</DETAIL>
+				<AUDIO Length = "30" Path = "181/18115.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>				
+		
+		<CHP_RADIO RadioFile="18115.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-13</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia go ahead</LINE>
+				<LINE Role="Field">Santa Lucia, witnesses John and Betty Rogers saw 
+							   the hay truck lose control, flip over, and the 
+							   two vehicles hit it.</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia 10-4. Witnesses John and 
+								  Betty Rogers saw hay truck lose control, flip 
+								  over, and the two vehicles hit it.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		<MAINTENANCE_RADIO>Done cleaning up the hay.  10-98 units</MAINTENANCE_RADIO>
+
+	</SCRIPT_EVENT>
+
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:32:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>HAY TRK READY FOR TOW, 2 VEHS TOWED, DOT CLEARED HAY BALES, LANES OPEN IN 10</DETAIL>	
+				<AUDIO Length = "28" Path = "181/18116.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>			
+		
+		<CHP_RADIO RadioFile="18116.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-13</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia go ahead</LINE>
+				<LINE Role="Field">Santa Lucia, the truck is being prepared for tow 
+							   and the two vehicles have been towed. Caltrans 
+							   has finished cleaning up the bales of hay. Lanes 
+							   open in 10.</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia copies truck being prepared 
+								  for tow and two vehicles have been towed. 
+								  Caltrans finished cleaning up the bales of 
+								  hay. Lanes open in 10.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:36:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>		
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>LANES OPEN IN 5</DETAIL>	
+				<AUDIO Length = "20" Path = "181/18117.wav" />	
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>
+		
+		<CHP_RADIO RadioFile="18117.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-13</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia go ahead</LINE>
+				<LINE Role="Field">Santa Lucia, we're nearly finished with cleanup. 
+							   Lanes open in 5 minutes.</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia copied nearly finished with 
+								  cleanup. Lanes open in 5.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:41:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<CAD_DATA>	
+			<CAD_INCIDENT_EVENT>
+				<DETAIL>14-13 14-7 14-21 1098, TRK TOWED, ALL LNS CLR</DETAIL>	
+				<UNIT UnitNum="14-13" Status="1098" Primary="true" Active="false"/>		
+				<UNIT UnitNum="14-7" Status="1098" Primary="false" Active="false"/>		
+				<UNIT UnitNum="14-21" Status="1098" Primary="false" Active="false"/>		
+				<AUDIO Length = "19" Path = "181/18118.wav" />	
+				
+				<PARAMICS LocationID="181_N_405_ML">
+					<Status>CLEARED</Status>
+				</PARAMICS>						
+			</CAD_INCIDENT_EVENT>		
+		</CAD_DATA>
+		
+		<CHP_RADIO RadioFile="18118.wav">
+			<DIALOG>
+				<LINE Role="Field">Santa Lucia 14-13</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia go ahead</LINE>
+				<LINE Role="Field">Santa Lucia, the truck as been towed and the 
+							   lanes are clear. All units are 10-98</LINE>
+				<LINE Role="Dispatch">14-13 Santa Lucia 10-4. 14-13, 14-7, and 14-21 
+								  10-98.</LINE>
+			</DIALOG>
+		</CHP_RADIO>
+		
+		
+		<CMS_EVALUATION cmsID="87" type="update"> 
+			<LOCATION>NB 405 @ HARVARD</LOCATION>
+			<SAMPLE_MESSAGE>
+				<CMS_LINE>ACCIDENT CLEARED</CMS_LINE>
+				<CMS_LINE>AT MACARTHUR BLVD</CMS_LINE>
+			</SAMPLE_MESSAGE>
+		</CMS_EVALUATION>		
+	</SCRIPT_EVENT>
+
+	<SCRIPT_EVENT>
+		<TIME_INDEX>00:50:00</TIME_INDEX>
+		<INCIDENT LogNum="181">Overturned Hay Truck</INCIDENT>
+		
+		<TMT_RADIO>Queue Update.  TMT 10-98</TMT_RADIO>
+	</SCRIPT_EVENT>
+
+</TMC_SCRIPT>
Index: trunk/scripts/Cardfile.xml
===================================================================
--- trunk/scripts/Cardfile.xml	(revision 2)
+++ trunk/scripts/Cardfile.xml	(revision 2)
@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Please do not modify titles. Note that these titles are not
+sent into the actual screen. If titles are to be modified,
+they need to be changed in CardfileHandler.java  -->
+
+
+
+<CARDFILE> 
+	<TAB title = "Coastal Division Units">
+		<CARDFILE_OBJ name = "Name" >
+			<ADDRESS>Address</ADDRESS>
+			<CITY>City</CITY>
+			<STATE>State</STATE>
+			<ZIP>Zip</ZIP>
+			<PHONE1>Phone1</PHONE1>
+			<PHONE2>Phone2</PHONE2>
+			<FAX>Fax</FAX>
+		</CARDFILE_OBJ>
+		
+		<CARDFILE_OBJ  name = "Name2" >
+			<ADDRESS>Address2</ADDRESS>
+			<CITY>City2</CITY>
+			<STATE>State2</STATE>
+			<ZIP>Zip2</ZIP>
+			<PHONE1>Phone12</PHONE1>
+			<PHONE2>Phone22</PHONE2>
+			<FAX>Fax2</FAX>
+		</CARDFILE_OBJ>
+		
+	</TAB>
+	
+	<TAB title = "Police/Sheriff/Coroner">
+	
+		<CARDFILE_OBJ  name = "Name" >
+			<ADDRESS>Address</ADDRESS>
+			<CITY>City</CITY>
+			<STATE>State</STATE>
+			<ZIP>Zip</ZIP>
+			<PHONE1>Phone1</PHONE1>
+			<PHONE2>Phone2</PHONE2>
+			<FAX>Fax</FAX>
+		</CARDFILE_OBJ>
+		
+	</TAB>
+	
+	<TAB title = "Courts">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Public Transportation">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "GG Other">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "MY Misc">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "SL Misc">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "VT Misc">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "CHP Offices">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "State Agencies/Facilities">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Government Officials">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Federal Agencies">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Fire/EMS">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Jails">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Hospitals/Med Centers">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Tow Companies">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "CalTrans">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "County Roads">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Utilities">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Animal Control">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Airports">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Credit Cards">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "GG Crisis Shelters">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Ranges">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Hotlines">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Hwy Patrols OOS">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Parks/Recreation">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Shelters">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "SL County Services">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "SL Resources">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Truck/Tire Repair">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "MCC Employees">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "Gate Access Codes">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "VT Call Signs">
+		
+		
+		
+	</TAB>
+	
+	<TAB title = "SLCC Employees">
+		
+		
+		
+	</TAB>
+
+</CARDFILE>
Index: trunk/src/tmcsim/cadsimulator/SoundPlayer.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/SoundPlayer.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/SoundPlayer.java	(revision 2)
@@ -0,0 +1,235 @@
+package tmcsim.cadsimulator;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import sun.audio.AudioPlayer;
+import sun.audio.AudioStream;
+import tmcsim.client.cadclientgui.data.IncidentEvent;
+
+/**
+ * SoundPlayer is used to play audio files associated with IncidentEvents that 
+ * occur during a simulation.  When the SoundPlayer has been enabled audio 
+ * clips are enqueued by calling the enqueueClip() method.  The audio files 
+ * are played in order of receipt and when finished, the IncidentEvent is 
+ * notified.  Audio playing may be disabled or enabled through the 
+ * setAudioEnabled() method.  Disabling audio will cause a currently
+ * playing audio clip to stop and be requeued at the front of the queue.  
+ * Re-enabling the audio will then continue playing all queued clips.  The
+ * deQueueAll() method is used to clear the list of audio clips that have 
+ * been queued.
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/06 20:46:41 $ $Revision: 1.3 $
+ */
+public class SoundPlayer extends Thread {
+    
+    /** Error Logger. */
+    private Logger soundLogger = Logger.getLogger("tmcsim.cadsimulator");
+                                
+    /** The base location that wav files are referenced from */             
+    private String baseAudioDir = "";
+                                
+    /** The private vector of audioClips used during a simulation */
+    private Vector<AudioClipInfo> enqueuedClips = null;
+    
+    /** The audio clip that is currently being played by the AudioPlayer. */
+    private AudioClipInfo currentClip = null;
+    
+    /** Audio stream for playing audio files. */
+    private AudioStream audioStream = null;
+    
+    /**
+     * Flag to designate when an audio file is playing. This prevents 
+     * multiple audio files from being played simultaneously. 
+     * Flag is initialized to false.
+     */
+    private boolean audioPlaying = false;   
+    
+    /** Flag to designate whether audio playing is enabled.  If audio is disabled,
+     *  then enquque events will be ignored.  Flag is initialized to false.
+     */
+    private boolean audioEnabled = false;
+    
+    /** Timer used to pause audio player during an audio file. */
+    private Timer timer = null;
+    
+    /** Inner class used to contain the audio file's name and duration. */
+    private class AudioClipInfo {
+        String fileName;
+        int duration;
+        IncidentEvent theEvent;
+        
+        AudioClipInfo(IncidentEvent ie) {
+            fileName = ie.waveFile;
+            duration = ie.waveLength;   
+            theEvent = ie;
+        }       
+                
+        AudioClipInfo(String name, int dur) {
+            fileName = name;
+            duration = dur; 
+            theEvent = null;
+        }   
+        
+        public void wavePlayed() {
+            if(theEvent != null)
+                theEvent.wavePlayed();
+        }   
+    }
+ 
+    /**
+     * Constructor.  Establish the base file path for wav file referencing.
+     *
+     * @param wavFilePath Pathname for where the simulation wav files will be referenced.
+     */
+    public SoundPlayer(String baseFilePath) {
+        
+        baseAudioDir  = baseFilePath;
+        audioPlaying  = true;
+        audioEnabled  = true;
+        timer         = new Timer();                        
+        enqueuedClips = new Vector<AudioClipInfo>();
+    }
+
+    /**
+     * Add a audioClipInfo object to the audioClips Vector.  The enqueued audio file will play
+     * when all previously enqueued audio files have been played.  If audio is not enabled, the
+     * clip will not be queued, and the incident event will be notified that the audio clip 
+     * has finished playing to allow the simulation to continue.
+     *
+     * @param ie The Incident Event to enqueue to the current list of events.
+     */
+    public void enqueueClip (IncidentEvent ie) {
+
+        if(audioEnabled) {
+            synchronized(enqueuedClips)  {
+                enqueuedClips.add(new AudioClipInfo(ie));
+            }
+        }
+        else {
+            ie.wavePlayed();
+        }
+    } 
+    
+    /**
+     * Method called when user presses reset in simulation.  All queued events need
+     * to be deQueued.
+     */
+    public void deQueueAll() {
+        synchronized(enqueuedClips) {
+            enqueuedClips.clear();
+        }       
+    }  
+    
+    /** 
+     * Get the current audio enabled status.
+     *
+     * @return True if enabled, false if disabled.
+     */
+    public boolean getAudioEnabled() {
+        return audioEnabled;
+    }   
+    
+    /**
+     * Set the current audio enabled status.  A false value will cause all
+     * enqueue events to be ignored.  A currently playing audio file will be 
+     * stopped and requeued.  All other queued events will remain in the queue.
+     *
+     * @param enable True if enabling, false if disabling.
+     */
+    public void setAudioEnabled(boolean enable) {
+        
+        if(!enable) {           
+            timer.cancel();
+            AudioPlayer.player.stop(audioStream);
+            
+            if(currentClip != null) {
+                enqueuedClips.add(0, currentClip);
+            }           
+            
+            audioPlaying = false;
+        }
+        
+        audioEnabled = enable;
+    }
+    
+        
+    /**
+     * Method declaration for the Thread.run() method.  While this thread is not 
+     * interrupted, check if there are enqueued audio files.  If so, remove the 
+     * first one(FIFO) create an AudioClip object, and play the audio file.
+     * A timer tis then started for the duration of the audio file.  When the
+     * timer expires the audioPlaying flag is reset to false and the corresponding
+     * incident event is notified of the audio file's completion.
+     */
+    public void run() {
+        AudioClipInfo theClip = null;
+        
+        while(!isInterrupted()) {
+            
+            synchronized(enqueuedClips) {
+                if(enqueuedClips.size() > 0 && !audioPlaying && audioEnabled)
+                    theClip = enqueuedClips.remove(0);                  
+            }
+                
+            //if nothing to play, wait a second
+            if(theClip == null) {
+                try { Thread.sleep(1000);} catch (Exception e) {}
+            }
+            else {
+                        
+                try{
+                    
+                    if(theClip.duration > 0) {              
+                        
+                        File audioFile = new File(baseAudioDir + theClip.fileName);
+                        
+                        if(audioFile.exists()) {
+                            audioStream = new AudioStream (new FileInputStream(audioFile));      
+                            AudioPlayer.player.start(audioStream);  
+                        }
+                        else {
+                            throw new Exception();
+                        } 
+                    }
+                    
+                    currentClip  = theClip;                                             
+                    audioPlaying = true;
+                    
+                    timer = new Timer();
+                    timer.schedule(new TimerTask () {
+                        public void run() {
+                            clipPlayed();
+                            audioPlaying = false;                       
+                        }
+                    }, theClip.duration * 1000);
+                    
+                    theClip = null;                     
+                } 
+                catch (Exception e) {
+                    soundLogger.logp(Level.WARNING, "SoundPlayer", "run", 
+                            "Unable to play audio file: " + baseAudioDir + theClip.fileName, e);
+    
+                    theClip.theEvent.wavePlayed();
+                    theClip = null;
+                    timer.cancel();
+                }   
+            }                               
+        }                       
+    }
+    
+        
+    /**
+     * Called when audio file finishes playing.  Notifies the corresponding 
+     * Incident Event that its audio file has finished playing.
+     */
+    private void clipPlayed() {
+        currentClip.wavePlayed();
+    }  
+}
Index: trunk/src/tmcsim/cadsimulator/db/CCTVInfo.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/db/CCTVInfo.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/db/CCTVInfo.java	(revision 2)
@@ -0,0 +1,40 @@
+package tmcsim.cadsimulator.db;
+
+import tmcsim.common.CCTVDirections;
+
+/**
+ * CCTVInfo is a container class to hold a CCTV camera's id and direction.
+ */
+public class CCTVInfo implements Comparable<CCTVInfo> {
+    
+    /** CCTV Camera ID */
+    public int id;
+    
+    /** CCTV Camera Direction */
+    public CCTVDirections dir;
+    
+    public CCTVInfo(int newID, CCTVDirections newDir) {
+        id  = newID;
+        dir = newDir;
+    }
+
+    /**
+     * Determines equality by comparing id and direction.
+     */     
+    public boolean equals(Object o) {
+        return id == ((CCTVInfo)o).id &&
+               dir == ((CCTVInfo)o).dir;
+    }       
+
+    /** 
+     * If id is equal, compare according to direction, else compare id's.
+     */     
+    public int compareTo(CCTVInfo o ) {
+        if(id == o.id) {
+            return dir.compareTo(o.dir);
+        }
+        else {
+            return new Integer(id).compareTo(o.id);
+        }
+    }           
+}   
Index: trunk/src/tmcsim/cadsimulator/db/CMSDiversionDB.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/db/CMSDiversionDB.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/db/CMSDiversionDB.java	(revision 2)
@@ -0,0 +1,188 @@
+package tmcsim.cadsimulator.db;
+
+import java.util.TreeMap;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import tmcsim.cadmodels.CMSInfo;
+
+/**
+ * CMSDiversionDB is a singleton object that acts as a database containing 
+ * the CMS Diversion information.  The initial data is read in from an XML 
+ * file.  This object is accessed to get current CMS diversion information
+ * and to be updated with new diversions as they are set by the user.  
+ * Diversions may be reset to their original values (0) through the
+ * resetDiversions() method. 
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/14 00:12:38 $ $Revision: 1.4 $
+ */
+public class CMSDiversionDB {
+
+    /**
+     * Enumeration containing XML tag names used to parse the XML
+     * document containing information about CMS diversion control.
+     * @author Matthew Cechini
+     */
+    private static enum CMS_DB_TAGS {   
+        /** This is the top level tag. */
+        CMS           ("CMS"),
+        /** Individual diversion data. */
+        DIVERSION     ("DIVERSION"),
+        /** CMS ID. */
+        ID            ("ID"),
+        /** CMS Postmile. */
+        POSTMILE      ("POSTMILE"),
+        /** Diversion initial route. */
+        INIT_ROUTE    ("INIT_ROUTE"),
+        /** Diversion original path. */
+        ORIG_PATH     ("ORIG_PATH"),
+        /** Diversion new path. */
+        NEW_PATH      ("NEW_PATH"),
+        /** Diversion path. */
+        DIV_PATH      ("DIV_PATH"), 
+        /** Max diversion percentage. */
+        MAX_DIVERSION ("MAX_DIVERSION");
+        
+        /** XML Tag name. */
+        public String tag;
+        
+        private CMS_DB_TAGS(String t) {
+            tag = t;
+        }
+    }
+    
+    /** The CMSDiversionDB Singleton. */
+    private static CMSDiversionDB theDB;
+    
+    /**
+     * The map of all CMSInfo Objects (value), referenced by a 
+     * CMS ID String(key).
+     */
+    private TreeMap<String, CMSInfo> diversionMap = null;
+    
+    
+    /** Constructor.  Initialize the diversion map. */
+    private CMSDiversionDB() {
+        diversionMap = new TreeMap<String, CMSInfo>();  
+    }
+    
+    /**
+     * Get the current instance of the CMS Diversion DB.  Construct the
+     * singleton if it has not yete been constructed.
+     */
+    public synchronized static CMSDiversionDB getInstance() {
+        
+        if(theDB == null)
+            theDB = new CMSDiversionDB();
+            
+        return theDB;
+    }
+    
+    /**
+     * Load the CMS Diversion map from an xml document, adhering to the 
+     * following schema: <br/>
+     * <CMS><br/>
+     *      <ID/><br/>
+     *      <POSTMILE/><br/>
+     *      <INIT_ROUTE/><br/>
+     *      <DIVERSION><br/>
+     *           <ORIG_PATH/><br/>
+     *           <NEW_PATH/><br/>
+     *           <DIV_PATH/><br/>
+     *           <MAX_DIVERSION/><br/>
+     *      </DIVERSION><br/>
+     *      
+     *      <DIVERSION/>...<br/>
+     * </CMS>
+     */
+    public void loadFromXML(Document newDoc) {
+        
+        Element rootElement      = newDoc.getDocumentElement();
+        Element cmsElement       = null;
+        Element diversionElement = null;
+        NodeList diversions      = null;
+        
+        CMSInfo cmsInfo = null;
+        String  cmsID   = null;
+        
+        
+        NodeList cms_signs  = rootElement.getElementsByTagName(CMS_DB_TAGS.CMS.tag);
+        
+        for(int i = 0; i < cms_signs.getLength(); i++) {
+            
+            cmsElement = (Element)cms_signs.item(i);
+            
+            cmsID = cmsElement.getElementsByTagName(CMS_DB_TAGS.ID.tag).item(0)
+                    .getTextContent();
+            
+            cmsInfo = diversionMap.get(cmsID);
+            
+            if (cmsInfo == null) {
+                cmsInfo = new CMSInfo(cmsID, new Float(cmsElement
+                        .getElementsByTagName(CMS_DB_TAGS.POSTMILE.tag).item(0)
+                        .getTextContent()), cmsElement.getElementsByTagName(
+                        CMS_DB_TAGS.INIT_ROUTE.tag).item(0).getTextContent());
+            }                   
+            
+            //parse diversions for CMS
+            diversions = cmsElement.getElementsByTagName(CMS_DB_TAGS.DIVERSION.tag);
+
+            for(int j = 0; j < diversions.getLength(); j++) {
+
+                diversionElement = (Element)diversions.item(j);
+                
+                cmsInfo.addNewDiversion(
+                        diversionElement.getElementsByTagName(CMS_DB_TAGS.ORIG_PATH.tag).item(0).getTextContent(),
+                        diversionElement.getElementsByTagName(CMS_DB_TAGS.NEW_PATH.tag).item(0).getTextContent(),
+                        diversionElement.getElementsByTagName(CMS_DB_TAGS.DIV_PATH.tag).item(0).getTextContent(),
+                        new Integer(diversionElement.getElementsByTagName(CMS_DB_TAGS.MAX_DIVERSION.tag).item(0).getTextContent()));
+                    
+            }
+            
+            diversionMap.put(cmsInfo.cmsID, cmsInfo);
+            
+        }               
+    }
+    
+    /**
+     * Get the current diversion information for the Diversion ID
+     *
+     * @param ID CMS ID key to get the corresponding CMSInfo object.
+     * @returns A CMSInfo object containing diversion info.  Returns null if the
+     * parameter ID does not exist.
+     */
+    public CMSInfo getDiversion(String ID) {
+        return diversionMap.get(ID);
+    }       
+    
+    /**
+     * Update the current diversions with the new CMSInfo object 
+     * by putting the parameter CMSInfo object into the local map.
+     * 
+     * @param theDiversion CMSInfo object containing updated diversions.
+     */
+    public void updateDiversions(CMSInfo theDiversion) {
+        diversionMap.put(theDiversion.cmsID, theDiversion);
+    }
+
+    /**
+     * Reset all CMSInfo objects.
+     */
+    public void resetDiversions() {
+        for(CMSInfo cms : diversionMap.values()) {
+            cms.reset();
+        }
+    }
+    
+    /**
+     * Get the CMS Diversion map.
+     *
+     * @returns The CMSInfo map.
+     */
+    public TreeMap<String, CMSInfo> getAllDiversions() {
+        return diversionMap;
+    }           
+}
Index: trunk/src/tmcsim/cadsimulator/db/CADUserDB.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/db/CADUserDB.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/db/CADUserDB.java	(revision 2)
@@ -0,0 +1,116 @@
+package tmcsim.cadsimulator.db;
+
+import java.util.TreeMap;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import tmcsim.common.ScriptException;
+
+/**
+ * (Not used)
+ * @author Matthew Cechini
+ * @version
+ */
+public class CADUserDB {
+
+    public static enum PERMISSION_LEVEL { 
+        TMC     ("TMC"), 
+        CHP     ("CHP"),
+        UNKNOWN ("");
+    
+        private String level;
+    
+        private PERMISSION_LEVEL(String l) {
+            level = l;
+        }
+        
+        public static PERMISSION_LEVEL fromString(String l) {
+            for(PERMISSION_LEVEL pLevel : values()) {
+                if(pLevel.level.equals(l))
+                    return pLevel;
+            }
+            
+            return UNKNOWN;
+        }
+        
+    };
+    
+    private static enum DVD_TAGS {
+        
+        /** Top level tag. */
+        CAD_USERS  ("CAD_USERS"),
+        /** CAD User info. */   
+        USER       ("USER"),
+        /** User ID. */ 
+        ID         ("ID"),
+        /** DVD player address. */
+        PERMISSION ("PERMISSION_LEVEL");
+        
+        public String tag;
+        
+        private DVD_TAGS(String t) {
+            tag = t;
+        }
+    }
+
+    /** Error Logger. */
+    //private Logger userLogger = Logger.getLogger("tmcsim.cadsimulator.db");
+    
+    private TreeMap<String, PERMISSION_LEVEL> userPermissionsMap;
+    
+    public CADUserDB() {
+        userPermissionsMap = new TreeMap<String, PERMISSION_LEVEL>();
+    }
+    
+    public PERMISSION_LEVEL getUserPermissionLevel(String userID) {
+        //exists??
+        
+        return userPermissionsMap.get(userID);
+    }
+    /**
+     * Load the DVD Player map from an xml document, adhering to the 
+     * following schema: <br>
+     * <DVD_PLAYERS> <br>
+     *   <DVD_PLAYER type="" host="" port="">
+     *      <CCTV id="" dir=""/>
+     *      <INCIDENT log_num="" title="" duration=""/>
+     *      <RANGE min_speed="" max_speed="" title="" duration=""/>
+     (   </DVD_PLAYER>
+     *</DVD_PLAYERS> <br>
+     *
+     * @param newDoc The XML document containing the DVD player 
+     *               registration information.
+     * @throws ScriptException if there is an error in parsing the node.
+     */
+    public void loadFromXML(Document newDoc) throws ScriptException {
+        
+        //temporary variables
+        Element rootElement       = newDoc.getDocumentElement();                
+        Element userElement       = null;
+        Element idElement         = null;
+        Element permissionElement = null;
+        
+        String userID             = null;
+        PERMISSION_LEVEL pLevel   = null;
+        
+        NodeList users = rootElement.getElementsByTagName(DVD_TAGS.USER.tag);
+    
+        for(int i = 0; i < users.getLength(); i++) {
+        
+            userElement = (Element)users.item(i);
+                                
+            idElement = (Element)userElement.getFirstChild();
+            userID    = idElement.getTextContent();
+            
+            permissionElement = (Element)idElement.getNextSibling();
+            pLevel            = PERMISSION_LEVEL.fromString(permissionElement.getTextContent());
+
+            if(pLevel != PERMISSION_LEVEL.UNKNOWN)
+                userPermissionsMap.put(userID, pLevel);
+            
+        }               
+        
+    }
+}
Index: trunk/src/tmcsim/cadsimulator/db/DVDPlayerDB.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/db/DVDPlayerDB.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/db/DVDPlayerDB.java	(revision 2)
@@ -0,0 +1,234 @@
+package tmcsim.cadsimulator.db;
+
+
+import java.io.IOException;
+import java.util.Observable;
+import java.util.Observer;
+import java.util.TreeMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import tmcsim.cadsimulator.videocontrol.DVDController;
+import tmcsim.cadsimulator.videocontrol.DVDIncident;
+import tmcsim.cadsimulator.videocontrol.DVDRange;
+import tmcsim.common.CCTVDirections;
+import tmcsim.common.ScriptException;
+
+/**
+ * DVDPlayerDB acts as a database containing the information 
+ * for each dvd player and the cameras whose playback is found on that 
+ * player.  The "Database" of dvd players and information is created by
+ * calling the loadFromXML() method with a valid XML document.  DVD players
+ * are "queried" according to the corresponding CCTV camera ID and direction
+ * whose video is represented on that DVD.  
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/06 22:33:20 $ $Revision: 1.4 $
+ */
+public class DVDPlayerDB extends Observable implements Observer {   
+
+    /** Error Logger. */
+    private static Logger dvdLogger = Logger.getLogger("tmcsim.cadsimulator.db");
+    
+    /**
+     * Enumeration containing XML tag names used to parse the XML
+     * document containing information about DVD Title control.
+     * @author Matthew Cechini
+     */
+    private static enum DVD_TAGS {      
+        /** Top level tag. */
+        DVD_PLAYERS ("DVD_PLAYERS"),
+        /** DVD player info. */ 
+        DVD_PLAYER ("DVD_PLAYER"),
+        /** DVD player type. */ 
+        TYPE         ("type"),
+        /** DVD player address. */
+        HOST         ("host"),
+        /** DVD player port. */
+        PORT         ("port"),
+        /** CCTV camera info. */
+        CCTV         ("CCTV"),
+        /** CCTV camera id. */
+        ID           ("id"),
+        /** CCTV camera direction. */
+        DIRECTION    ("dir"),
+        /** Incident title info. */
+        INCIDENT     ("INCIDENT"),
+        /** Log number of an incident title. */
+        LOG_NUM      ("log_num"),       
+        /** Speed range mapping to a title number. */
+        RANGE        ("RANGE"),
+        /** Minimum speed in a range. */
+        MIN_SPEED    ("min_speed"),
+        /** Maximum speed in a range. */
+        MAX_SPEED    ("max_speed"),
+        /** Title name. */
+        TITLE        ("title");
+        
+        /** XML Tag Name */
+        public String tag;
+        
+        private DVD_TAGS(String t) {
+            tag = t;
+        }
+    }
+    
+
+    /**
+     * The map containing all current CCTV Camera IDs(key) and the corresponding 
+     * DVD Controller(value) that have been registered with the system.
+     */
+    private TreeMap<CCTVInfo, DVDController> dvdPlayerMap = null;
+    
+    /**
+     * Constructor.  Initialize the DVD Controller map.
+     */
+    public DVDPlayerDB() {
+        dvdPlayerMap = new TreeMap<CCTVInfo, DVDController>();  
+    }
+
+    /**
+     * Implementation of the Observer update() method.  All received update
+     * objects are sent to Observers of this DB.
+     */
+    public void update(Observable o, Object arg) {
+        setChanged();
+        notifyObservers(arg);
+    }
+    
+    /**
+     * Load the DVD map from an xml document, adhering to the 
+     * following schema.  When parsing has finished, the map of 
+     * DVDController and CCTVInfo objects will contain objects 
+     * representing all control objects specified in the XML.  
+     * A connection to each DVD controller will be automatically
+     * started after parsing has completed.<br>
+     * 
+     * <DVD_PLAYERS> <br>
+     *   <DVD_PLAYER type="" host="" port="">
+     *      <CCTV id="" dir=""/>
+     *      <INCIDENT log_num="" title="" duration=""/>
+     *      <RANGE min_speed="" max_speed="" title="" duration=""/>
+     (   </DVD_PLAYER>
+     *</DVD_PLAYERS> <br>
+     *
+     * @param newDoc The XML document containing the DVD player 
+     *               registration information.
+     * @throws ScriptException if there is an error in parsing the node.
+     */
+    public void loadFromXML(Document newDoc) throws ScriptException {
+        
+        //temporary variables
+        Element rootElement     = newDoc.getDocumentElement();              
+        Element playerElement   = null;
+        Element cctvElement     = null;
+        Element rangeElement    = null;
+        Element incidentElement = null;
+        
+        Integer cctvID                = null;
+        CCTVDirections  cctvDirection = null;
+        DVDController theController   = null;
+        
+        NodeList players   = rootElement.getElementsByTagName(DVD_TAGS.DVD_PLAYER.tag);
+        NodeList ranges    = null;
+        NodeList incidents = null;
+        
+    
+        for(int i = 0; i < players.getLength(); i++) {
+        
+            playerElement = (Element)players.item(i);
+            
+            try {
+                theController = (DVDController)Class.forName(
+                    "tmcsim.cadsimulator.videocontrol." + playerElement.getAttribute(
+                            DVD_TAGS.TYPE.tag)).newInstance();
+                theController.addObserver(this);
+            }
+            catch (Exception e) {
+                dvdLogger.logp(Level.SEVERE, "DVDPlayerDB", "loadFromXML", 
+                        "Error in instantiating DVD Controller", e);
+                continue;
+            }
+            
+            theController.setConnectionInfo(playerElement.getAttribute(
+                    DVD_TAGS.HOST.tag),
+                    Integer.parseInt(playerElement.getAttribute(
+                            DVD_TAGS.PORT.tag)));
+                    
+            cctvElement   = (Element)playerElement.getElementsByTagName(
+                    DVD_TAGS.CCTV.tag).item(0);
+            cctvID        = Integer.parseInt(cctvElement.getAttribute(
+                    DVD_TAGS.ID.tag));
+            cctvDirection = CCTVDirections.fromChar(cctvElement.getAttribute(
+                    DVD_TAGS.DIRECTION.tag).charAt(0));
+            
+            ranges    = playerElement.getElementsByTagName(DVD_TAGS.RANGE.tag);     
+            incidents = playerElement.getElementsByTagName(DVD_TAGS.INCIDENT.tag);
+                        
+            for(int j = 0; j < ranges.getLength(); j++) {
+                rangeElement = (Element)ranges.item(j);
+                
+                theController.addRange(new DVDRange(
+                        Float.parseFloat(rangeElement.getAttribute(
+                                DVD_TAGS.MIN_SPEED.tag)),
+                        Float.parseFloat(rangeElement.getAttribute(
+                                DVD_TAGS.MAX_SPEED.tag)),
+                        Integer.parseInt(rangeElement.getAttribute(
+                                DVD_TAGS.TITLE.tag))));
+            }
+            
+            for(int j = 0; j < incidents.getLength(); j++) {
+                incidentElement = (Element)incidents.item(j);
+                
+                theController.addIncident(new DVDIncident(
+                        Integer.parseInt(incidentElement.getAttribute(
+                                DVD_TAGS.LOG_NUM.tag)),
+                        Integer.parseInt(incidentElement.getAttribute(
+                                DVD_TAGS.TITLE.tag))));
+            }
+            
+            dvdPlayerMap.put(new CCTVInfo(cctvID, cctvDirection), theController);
+            
+        }               
+        
+        //Thread the connection of DVD controllers so that initialization does not hang.
+        Runnable connect = new Runnable() {
+
+            public void run() {
+                for(DVDController controller : dvdPlayerMap.values()) {
+                    try {
+                        controller.connect();
+                    }
+                    catch (IOException ioe) {
+                        dvdLogger.logp(Level.SEVERE, "DVDPlayerDB", "loadFromXML:runnable", 
+                                "IOException in connecting DVD " + 
+                                controller.getConnectionInfo(), ioe);
+                    }   
+                }           
+            }                       
+        };
+        
+        Thread connectThread = new Thread(connect);
+        connectThread.start();
+    }
+
+    /**
+     * Gets the DVDController for a registered camera.  DVDControllers
+     * are referenced by the Camera ID and direction.
+     *
+     * @param cctv_id CCTV camera id
+     * @param dir CCTV camera direction
+     * 
+     * @return Returns the DVDController object corresponding with the parameter 
+     * camera values.  Returns null if no corresponding DVD Controller is found.
+     */ 
+    public DVDController getController(Integer cctv_id, CCTVDirections dir) {
+        return dvdPlayerMap.get(new CCTVInfo(cctv_id, dir));
+    }
+    
+        
+}
Index: trunk/src/tmcsim/cadsimulator/db/StillImagesDB.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/db/StillImagesDB.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/db/StillImagesDB.java	(revision 2)
@@ -0,0 +1,184 @@
+package tmcsim.cadsimulator.db;
+
+import java.util.Observable;
+import java.util.Observer;
+import java.util.TreeMap;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import tmcsim.cadsimulator.managers.ATMSManager;
+import tmcsim.cadsimulator.stillimagecontrol.ImageController;
+import tmcsim.cadsimulator.stillimagecontrol.ImageIncident;
+import tmcsim.cadsimulator.stillimagecontrol.ImageRange;
+import tmcsim.common.CCTVDirections;
+import tmcsim.common.ScriptException;
+
+/**
+ * StilImagesDB acts as a repository for all StillImage data read during 
+ * initialization.  An xml file read at startup details which CCTV cameras 
+ * will be monitored during the simulator.  An ImageController object is 
+ * created for each camera, uniquely identified by an ID and direction.
+ * Each camera is also registered with a list of speed ranges and/or incidents 
+ * for which the ImageController will perform needed action to swap images on 
+ * the ATMS server.
+ * 
+ * TODO Observer/Observable 
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public class StillImagesDB extends Observable implements Observer {
+
+    /**
+     * Enumeration containing XML tag names used to parse the XML
+     * document containing information about Still Image control.
+     * @author Matthew Cechini
+     */
+    private static enum IMAGE_DB_TAGS { 
+        /** This is the top level tag. */
+        STILL_IMAGES ("STILL_IMAGES"),
+        /** CCTV camera. */
+        CCTV         ("CCTV"),
+        /** CCTV camera unique id number. */
+        CCTV_ID      ("id"),
+        /** CCTV camera unique id string on ATMS server. */ 
+        ATMS_CCTV_ID ("atms_id"),
+        /** CCTV camera direction value. */ 
+        DIRECTION    ("dir"),
+        /** Speed range for associated image. */
+        RANGE        ("RANGE"),
+        /** Minimum value of speed range. */
+        MIN_SPEED    ("min_speed"),
+        /** Maximum value of speed range. */
+        MAX_SPEED    ("max_speed"), 
+        /** Incident associated image. */
+        INCIDENT     ("INCIDENT"),  
+        /** Log number for incident. */
+        LOG_NUM      ("log_num"),
+        /** Image filename. */
+        FILENAME     ("filename");
+
+        /** XML Tag name. */
+        public String tag;
+        
+        private IMAGE_DB_TAGS(String t) {
+            tag = t;
+        }
+    }
+    
+    
+    /**
+     * The map containing all current CCTV Camera IDs(key) and the corresponding 
+     * Still Image Controller(value) that have been registered with the system.
+     */
+    private TreeMap<CCTVInfo, ImageController> stillImageMap = null;
+    
+    /**
+     * Constructor.  Initialize the map of ImageControllers.
+     */
+    public StillImagesDB() {
+        stillImageMap = new TreeMap<CCTVInfo, ImageController>();   
+    }
+    
+    /**
+     * Implementation of the Observer update() method.  All received update
+     * objects are sent to Observers of this DB.
+     */
+    public void update(Observable o, Object arg) {
+        setChanged();
+        notifyObservers(arg);
+    }
+    
+    /**
+     * Load the Still Images map from an xml document, adhering to the 
+     * following schema.  When parsing has finished, the map of 
+     * ImageController and CCTVInfo objects will contain objects 
+     * representing all control objects specified in the XML<br>
+     *
+     * <STILL_IMAGES> <br>
+     *   <IMAGE_PLAYER type="" username="" pwd="" host="" basedir ="">
+     *     <CCTV id="" atms_id="" dir="">
+     *       <RANGE min_speed="" max_speed="" filename=""/>
+     *       <INCIDENT log_num="" filename=""/>
+     *     </CCTV>
+     *   </IMAGE_PLAYER>
+     *</STILL_IMAGES> <br>
+     *
+     * @throws ScriptException if there is an error in parsing the Node.
+     */
+    public void loadFromXML(Document newDoc, ATMSManager theATMSManager) 
+        throws ScriptException 
+    {
+        
+        Element rootElement     = newDoc.getDocumentElement();
+        Element cameraElement   = null;
+        Element rangeElement    = null;
+        Element incidentElement = null;
+
+        NodeList cameras   = rootElement.getElementsByTagName(
+                IMAGE_DB_TAGS.CCTV.tag);
+        NodeList ranges    = null;
+        NodeList incidents = null;
+        
+        Integer cctvID                = null;
+        Integer ATMS_cctvID           = null;
+        CCTVDirections  cctvDirection = null;
+        ImageController theController = null;
+        
+        //for all CCTV camera elements, parse out data
+        for(int j = 0; j < cameras.getLength(); j++) {      
+            cameraElement = (Element)cameras.item(j);
+            
+            cctvID        = Integer.parseInt(cameraElement.getAttribute(
+                    IMAGE_DB_TAGS.CCTV_ID.tag));
+            ATMS_cctvID   = Integer.parseInt(cameraElement.getAttribute(
+                    IMAGE_DB_TAGS.ATMS_CCTV_ID.tag));
+            cctvDirection = CCTVDirections.fromChar(cameraElement.getAttribute(
+                    IMAGE_DB_TAGS.DIRECTION.tag).charAt(0));
+                                    
+            ranges    = cameraElement.getElementsByTagName(
+                    IMAGE_DB_TAGS.RANGE.tag);
+            incidents = cameraElement.getElementsByTagName(
+                    IMAGE_DB_TAGS.INCIDENT.tag);
+            
+            theController = new ImageController(ATMS_cctvID, theATMSManager);
+                        
+            for(int k = 0; k < ranges.getLength(); k++) {
+                rangeElement = (Element)ranges.item(k);
+                
+                theController.addRange(new ImageRange(
+                        Float.parseFloat(rangeElement.getAttribute(
+                                IMAGE_DB_TAGS.MIN_SPEED.tag)), 
+                        Float.parseFloat(rangeElement.getAttribute(
+                                IMAGE_DB_TAGS.MAX_SPEED.tag)), 
+                        rangeElement.getAttribute(
+                                IMAGE_DB_TAGS.FILENAME.tag)));
+            }
+            
+            for(int k = 0; k < incidents.getLength(); k++) {
+                incidentElement = (Element)incidents.item(k);
+                
+                theController.addIncident(new ImageIncident( 
+                        Integer.parseInt(incidentElement.getAttribute(
+                                IMAGE_DB_TAGS.LOG_NUM.tag)), 
+                        incidentElement.getAttribute(
+                                IMAGE_DB_TAGS.FILENAME.tag)));
+            }           
+            
+            stillImageMap.put(new CCTVInfo(cctvID, cctvDirection), theController);
+        }           
+    }   
+    
+    /**
+     * Gets the ImageController associated with the parameter CCTV_ID number and direction.
+     * 
+     * @param cctv_id Integer value of the CCTV camera.
+     * @param dir Direction value of the CCTV camera.
+     * @return ImageController object for CCTV_ID and direction, or null if no object is found.
+     */
+    public ImageController getController(Integer cctv_id, CCTVDirections dir) {
+        return stillImageMap.get(new CCTVInfo(cctv_id, dir));
+    }
+}
Index: trunk/src/tmcsim/cadsimulator/CADSimulatorClient.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/CADSimulatorClient.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/CADSimulatorClient.java	(revision 2)
@@ -0,0 +1,448 @@
+package tmcsim.cadsimulator;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.net.Socket;
+import java.util.Observable;
+import java.util.Observer;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import tmcsim.common.CADProtocol;
+import tmcsim.common.ObserverMessage;
+import tmcsim.common.CADEnums.CAD_KEYS;
+import tmcsim.common.CADProtocol.CAD_CLIENT_CMD;
+import tmcsim.common.CADProtocol.CAD_COMMANDS;
+import tmcsim.common.CADProtocol.CAD_SIMULATOR_CMD;
+
+
+/**
+ * CADSimulatorClient handles communication between the CAD Simulator and 
+ * remote CAD Clients.  Each instance of this class communicates with 
+ * a CAD Client through a socket.  The run() method continuously checks to see 
+ * if data has been received from the client.  If there is data, it is parsed,
+ * and the resulting action is performed by the CADScreenManager.  See the
+ * receiveObject() method description for more information.  The 
+ * CADSimulatorClient is set up as an Observer of the CADScreenManager to listen 
+ * for ObserverMessage objects.  For each object received, the appropriate
+ * action is taken, resulting in data being transmitted to the CAD Client.
+ * See the update() method description for more information.  The 
+ * CADScreenManager is set up as an observer of the Coordinator to listen
+ * for simulation data updates.
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/14 00:12:38 $ $Revision: 1.5 $
+ */
+public class CADSimulatorClient extends Thread implements Observer {
+    
+    /** Error Logger. */
+    private static Logger cadLogger = Logger.getLogger("tmcsim.cadsimulator");
+    
+    /** CADScreenManager object containing the data for managing the CAD Client's view information. */
+    private CADScreenManager screenManager;
+    
+    /** Socket used for communication with the CAD Client. */
+    private Socket theSocket;
+    
+    /** ObjectOutputStream for writing objects to the socket. */
+    private ObjectOutputStream out;
+    
+    /** ObjectInputStream for reading objects from the socket. */
+    private ObjectInputStream in;
+    
+    /**
+     * Constructor.  A CADScreenManager is instantiated to manage the output
+     * transmitted to the remote CAD Client.  This object is set up as an
+     * observer to that manager to listen for data that will be transmitted
+     * across the socket.  The CADScreenManager is set up as an observer
+     * of the Coordinator.  At construction, streams are created to handle
+     * reading and writing to the Socket.  When complete, the sendScreenRefresh()
+     * method is called to initialize the client.
+     * 
+     *
+     * @param newSocket The socket to use for data transmission
+     * @throws IOException if there is an error in getting the output or input streams
+     * from the socket.
+     */
+    CADSimulatorClient(Socket newSocket) throws IOException{
+        
+        screenManager = new CADScreenManager(CADSimulator.theCoordinator);      
+        CADSimulator.theCoordinator.addObserver(screenManager);
+        screenManager.addObserver(this);
+        
+        
+        theSocket = newSocket;        
+        out       = new ObjectOutputStream(theSocket.getOutputStream());
+        in        = new ObjectInputStream(theSocket.getInputStream());   
+   
+        //initialize the CAD client
+        sendScreenRefresh();
+    }
+    
+    /**
+     * Method declaration for the Thread.run() method.  While the thread is not 
+     * interrupted, read Objects from the socket and call the receiveObject()
+     * method to parse the data.  If there is an IOException in communicating
+     * with the client, interrupt this thread and close the streams and Socket.
+     */
+    public void run() {
+        
+        try { 
+        
+            while(!isInterrupted()) {
+                receiveObject(in.readObject());         
+            }
+        } 
+        catch (ClassCastException cce) {
+            cce.printStackTrace();
+        }
+        catch (ClassNotFoundException cnfe) {
+            cnfe.printStackTrace();
+        }
+        catch (IOException ioe) {                   
+            cadLogger.logp(Level.SEVERE, "CADSimulatorClient", "run", 
+                    "Error in reading from Client socket: " + 
+                    theSocket.getInetAddress() + ", dropping connection.", ioe);
+            
+            //disconnectClient();
+        }
+    }
+    
+    /**
+     * This method is called to disconnect from the remote CAD Client.
+     * This object's thread is interrupted and the streams and socket
+     * are closed.  This object is removed as an observer of the 
+     * CADScreenManager and the CADScreenManager is removed as an 
+     * observer of the Coordinator.  The viewer is then notified
+     * of a disconnecting client.
+     */
+    protected void disconnectClient() {
+        this.interrupt();
+        
+        try { out.close(); } catch (Exception e) {}
+        try { in.close(); } catch (Exception e) {}
+        try { theSocket.close(); } catch (Exception e) {}
+
+        screenManager.deleteObserver(this);
+        CADSimulator.theCoordinator.removeObserver(screenManager);
+        //CADSimulator.theViewer.disconnectClient();
+    }
+    
+    
+
+    /**
+     * Observer method.  The update argument is cast to an ObserverMessage 
+     * object and the message type is used to define the action taken by the
+     * CADSimulatorClient.  Command messages are created in the form of XML
+     * Document. The root Element name is value from the CAD_SIMULATOR_CMD 
+     * enumeration.  The root text content is the value Object from the
+     * received Observer argument. 
+     * 
+     * The following table describes the messages sent for the ObserverMessage 
+     * types.<br>
+     * 
+     *<table cellpadding="2" cellspacing="2" border="1"
+    * style="text-align: left; width: 250px;">
+    *  <tbody>
+    *    <tr>
+    *      <th>Observer Message Type<br></th>
+    *      <th>Command Message Type<br></th>
+    *      <th>Data Content<br></th>
+    *    </tr>
+    *    <tr>
+    *      <td>SCREEN_UPDATE<br></td>
+    *      <td>UPDATE_STATUS</td>
+    *      <td>Screen update map String.</td>
+    *    </tr>
+    *    <tr>
+    *      <td>TIME_UPDATE<br></td>
+    *      <td>UPDATE_TIME</td>
+    *      <td>CAD time String.  (HHMM)</td>
+    *    </tr>
+    *    <tr>
+    *      <td>ROUTED_MESSAGE<br></td>
+    *      <td>UPDATE_MSG_COUNT</td>
+    *      <td>Number of messages.</td>
+    *    </tr>
+    *    <tr>
+    *      <td><br></td>
+    *      <td>UPDATE_MSG_UNREAD</td>
+    *      <td>Boolean flag to designate unread messages.</td>
+    *    </tr>
+    *    <tr>
+    *      <td>CAD_INFO_MESSAGE<br></td>
+    *      <td>CAD_INFO</td>
+    *      <td></td>
+    *    </tr>
+    *    <tr>
+    *      <td>REFRESH_VIEW<br></td>
+    *      <td>UPDATE_SCREEN</td>
+    *      <td>Current CAD model XML data.</td>
+    *    </tr>    
+    *  </tbody>
+    *</table>
+     *
+     * @see ObserverMessage
+     * @see CAD_SIMULATOR_CMD
+     */ 
+    public void update(Observable o, Object arg) {
+        
+        ObserverMessage oMessage = (ObserverMessage)arg;
+        CAD_SIMULATOR_CMD simCmd = null;
+        
+        switch(oMessage.type) {
+            case SCREEN_UPDATE:
+                simCmd = CAD_SIMULATOR_CMD.UPDATE_STATUS;
+                break;
+                        
+            case TIME_UPDATE:
+                simCmd = CAD_SIMULATOR_CMD.UPDATE_TIME;
+                break;
+                
+            case ROUTED_MESSAGE:
+                sendRoutedMessageUpdate();
+                break;
+                
+            case CAD_INFO_MESSAGE:
+                simCmd = CAD_SIMULATOR_CMD.CAD_INFO;
+                break;      
+                
+            case REFRESH_VIEW:
+                sendScreenRefresh();
+                break;
+        }
+        
+
+        if(simCmd != null) {
+            try {
+                
+                Document cmdDoc = DocumentBuilderFactory.newInstance()
+                        .newDocumentBuilder().newDocument();
+                cmdDoc.appendChild(cmdDoc.createElement(
+                        simCmd.type));
+                cmdDoc.getDocumentElement().appendChild(
+                        cmdDoc.createTextNode(oMessage.value.toString()));
+                transmitCommand(cmdDoc);
+    
+            } catch (Exception e) {
+                cadLogger.logp(Level.SEVERE, "CADSimulatorClient", "update", 
+                        "Error in transmitting a command to client.", e);
+            }           
+        }
+        
+    }
+    
+    /**
+     * This method acts as a helper method to create a XML Document
+     * update messages with the number of routed messages and 
+     * whether there are unread messages for this client.  These
+     * two messages are sent separately due to the defined
+     * command protocol.
+     */
+    private void sendRoutedMessageUpdate() {
+
+        try {           
+            Document cmdDoc = DocumentBuilderFactory.newInstance()
+                .newDocumentBuilder().newDocument();
+            Element docElem = cmdDoc.createElement(
+                    CAD_SIMULATOR_CMD.UPDATE_MSG_COUNT.type);
+            docElem.appendChild(cmdDoc
+                    .createTextNode(String.valueOf(screenManager
+                            .getCurrentCADModel().numberRoutedMessages)));
+            cmdDoc.appendChild(docElem);
+            transmitCommand(cmdDoc);
+            
+
+            cmdDoc = DocumentBuilderFactory.newInstance()
+                .newDocumentBuilder().newDocument();
+            docElem = cmdDoc.createElement(
+                    CAD_SIMULATOR_CMD.UPDATE_MSG_UNREAD.type);
+            docElem.appendChild(cmdDoc
+                    .createTextNode(String.valueOf(screenManager
+                            .getCurrentCADModel().unreadMessages)));
+            cmdDoc.appendChild(docElem);
+            transmitCommand(cmdDoc);            
+
+        } catch (Exception e) {
+            cadLogger.logp(Level.SEVERE, "CADSimulatorClient", 
+                    "sendRoutedMessageUpdate", 
+                    "Error in transmitting a command to client.", e);
+        }   
+    }
+    
+    /**
+     * This method acts as a helper method to create an XML Document
+     * update message with the current CAD Model's XML information.
+     */
+    private void sendScreenRefresh() {
+        
+        try {           
+            Document cmdDoc = DocumentBuilderFactory.newInstance()
+                    .newDocumentBuilder().newDocument();
+            Element docElem = cmdDoc.createElement(
+                    CAD_SIMULATOR_CMD.UPDATE_SCREEN.type);
+            
+            screenManager.getCurrentCADModel().toXML(docElem);
+            
+            cmdDoc.appendChild(docElem);
+            transmitCommand(cmdDoc);
+
+        } catch (Exception e) {
+            cadLogger.logp(Level.SEVERE, "CADSimulatorClient", 
+                    "sendScreenRefresh", 
+                    "Error in transmitting a command to client.", e);
+        }               
+    }
+    
+    /**
+     * This method parses the data that has been received on the socket.  The
+     * Data is cast to an XML Document and the root element determines the
+     * data content.  The possible root elements and the corresponding action
+     * are explained below. <br>
+     * <code>
+     * -----------<br>
+     * TERMINAL_REGISTER<br>
+     * 
+     * The CAD position and user ID are parsed from the Element and these 
+     * values are sent to the CADScreenManager for use.<br>
+     * -----------<br>
+     * SAVE_COMMAND_LINE<br>
+     * 
+     * The current command line text is parsed from the Element and sent
+     * to the CADScreenManager for user.
+     * <br>
+     * -----------<br>
+     * TERMINAL_CMD_LINE<br>
+     * The CAD command is parsed from the Element and converted to a 
+     * CAD_CLIENT_CMD enumeration that is used to call the correct
+     * method in the CADScreenManager to perform the command.
+     * <br>
+     * -----------<br>
+     * TERMINAL_FUNCTION<br>
+     * 
+     * The key value is parsed from the Element and converted to a CAD_KEYS
+     * enumeration that is sent to the CADScreenManager to perform the
+     * associated action.
+     * <br>
+     * -----------<br>
+     * TERMINATE<br>
+     * 
+     * <br>
+     * -----------<br>
+     * </code>
+     * @param receivedData String of data received on the socket.
+     *
+     * @see CADProtocol
+     */
+    private void receiveObject(Object rxData) throws IOException {
+        
+        try {   
+            
+            Element root  = ((Document)rxData).getDocumentElement();
+        
+            switch(CAD_CLIENT_CMD.fromString(root.getNodeName())) {
+            
+                case TERMINAL_REGISTER:
+                    Node positionNode = root.getChildNodes().item(0);
+                    screenManager.setCADPosition(Integer.parseInt(positionNode.getTextContent()));
+                    
+                    Node userIDNode   = root.getChildNodes().item(1);
+                    screenManager.setCADUserID(userIDNode.getTextContent());                            
+                    break;          
+                 
+                case SAVE_COMMAND_LINE:
+                    screenManager.receiveCommandLine(root.getTextContent());
+                    break;
+                case TERMINAL_CMD_LINE:
+                    
+                    Node commandNode = root.getChildNodes().item(0);
+
+                    switch(CAD_COMMANDS.fromFullName(commandNode.getNodeName())) {
+                        case INCIDENT_BOARD:
+                            screenManager.incidentBoardRequest((Element)commandNode);
+                            break;
+                        case INCIDENT_UPDATE:       
+                            screenManager.incidentUpdateRequest((Element)commandNode);
+                            break;
+                        case INCIDENT_INQUIRY:                  
+                            screenManager.incidentInquiryRequest((Element)commandNode);
+                            break;
+                        case INCIDENT_SUMMARY:              
+                            screenManager.incidentSummaryRequest((Element)commandNode);
+                            break;
+                        case ROUTED_MESSAGE:            
+                            screenManager.routedMessageRequest((Element)commandNode);
+                            break;
+                        case ENTER_INCIDENT:            
+                            screenManager.enterIncidentRequest((Element)commandNode);
+                            break;
+                        case TERMINAL_OFF:              
+                            screenManager.terminalOffRequest();
+                            break;
+                        case APP_CLOSE:             
+                            
+                            try {
+                                Document cmdDoc = DocumentBuilderFactory.newInstance()
+                                        .newDocumentBuilder().newDocument();
+                                cmdDoc.appendChild(cmdDoc.createElement(CAD_SIMULATOR_CMD.
+                                        APP_CLOSE.type));                               transmitCommand(cmdDoc);
+                    
+                            } catch (Exception e) {
+                                cadLogger.logp(Level.SEVERE, "CADSimulatorClient", "update", 
+                                        "Error in transmitting a command to client.", e);
+                            }   
+
+                            //disconnectClient();
+                            break;
+                        case UNKNOWN:
+                            //TODO
+                            break;
+                    }
+                    break;
+            
+                case TERMINAL_FUNCTION:             
+                    screenManager.receiveCommand(CAD_KEYS.fromValue(
+                            root.getTextContent().substring(
+                                    0, root.getTextContent().indexOf(":")),                         
+                            new Integer(root.getTextContent().substring(
+                                    root.getTextContent().indexOf(":") + 1))));
+                    break;
+            }     
+        }
+        catch (ClassCastException cce) {
+            cadLogger.logp(Level.SEVERE, "CADSimulatorClient", 
+                    "receiveObject", 
+                    "Incorrect object received from client.", cce);
+        }
+    }   
+    
+    /**
+     * This method transmits the Document command message to the remote 
+     * CAD Client.  If an exception occurs in writing to the socket, an 
+     * Exception is thrown and socket communication is closed.
+     *
+     * @param data The data being transmitted
+     * @throws IOException if there is an exception in writing to the socket.
+     */
+    private void transmitCommand(Document data) throws IOException {
+  
+        try {
+            out.writeObject(data);
+            out.flush();
+        } catch (IOException ioe) {
+            cadLogger.logp(Level.SEVERE, "CADSimulatorClient", 
+                    "transmitCommand",  "Error writing to Client socket: " + 
+                    theSocket.getInetAddress() + ", dropping connection.", ioe);
+
+            //disconnectClient();
+        }
+            
+    }
+}  
Index: trunk/src/tmcsim/cadsimulator/CADSimulator.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/CADSimulator.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/CADSimulator.java	(revision 2)
@@ -0,0 +1,357 @@
+package tmcsim.cadsimulator;
+
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import java.io.File;
+import java.io.FileInputStream;
+import java.rmi.Naming;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.util.Calendar;
+import java.util.Properties;
+import java.util.logging.FileHandler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.JOptionPane;
+import javax.swing.JWindow;
+import javax.swing.UIManager;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import tmcsim.cadsimulator.db.CMSDiversionDB;
+import tmcsim.cadsimulator.managers.ATMSManager;
+import tmcsim.cadsimulator.managers.IncidentManager;
+import tmcsim.cadsimulator.managers.MediaManager;
+import tmcsim.cadsimulator.managers.ParamicsSimulationManager;
+import tmcsim.cadsimulator.managers.SimulationControlManager;
+import tmcsim.cadsimulator.viewer.CADSimulatorViewer;
+import tmcsim.client.cadclientgui.data.CADData;
+import tmcsim.common.SimulationException;
+import tmcsim.simulationmanager.SimulationManager;
+
+
+/**
+ * CADSimulator is main class for the CAD Simulator application.  At 
+ * construction the Coordinator, CoordinatorViewer, and all CAD Simulator 
+ * Managers are initialized and data relationships are established.  
+ * Simulation control is managed through the Coordinator and Managers.
+ * The CADSimulator contains the instances of all Manager Objects that are used
+ * to control the Simulation flow of data.<br>
+ * <br>
+ * 
+ * The CADSimulator is initialized with a properties file containing the 
+ * following data items:<br>
+ * <code>
+ * -----------------------------------------------------------------------------<br>
+ * CADClientPort          The port number to use for remote CAD Client connections.<br>
+ * CoordinatorRMIPort     The port number to use for binding the Coordinator.<br>
+ * CMSDiversionXML        The filepath for the xml file containing initialization data for the Diversion "database."
+ * AudioFileLocation      The root directory path where audio files are referenced from.<br>
+ * ParamicsProperties     The filepath for the properties file to initialize the ParamicsControlManager.<br>
+ * ATMSProperties         The filepath for the properties file to initialize the ATMSManager.<br>
+ * MediaProperties        The filepath for the properties file to initialize the MediaManager.<br>
+ * ErrorFile              The filename of the error file used for logging errors.<br>
+ * ----------------------------------------------------------------------------<br>
+ * Example File:<br>
+ * CADClientPort          = 4444<br>
+ * CoordinatorRMIPort     = 4445<br>
+ * CMSDiversionXML        = ../data/cmsdiversions.xml<br>
+ * AudioFileLocation      = ../audio/<br>
+ * ParamicsProperties     = ../config/paramics.properties<br>
+ * ATMSProperties         = ../config/atms.properties<br>
+ * MediaProperties        = ../config/media.properties<br>
+ * ErrorFile              = cad_sim_error.xml<br>
+ * </code>
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2009/04/17 16:27:46 $ $Revision: 1.5 $
+ */
+public class CADSimulator {
+    
+    /** Error logger. */
+    private static Logger cadSimLogger = Logger.getLogger("tmcsim.simulationmanager");
+
+    /**
+     * Enumeration containing properties name values.  See CADSimulator class 
+     * description for more information.
+     * @author Matthew
+     * @see CADSimulator
+     */
+    private static enum CAD_PROPERTIES {
+        /** RMI port to accept CAD Client connections. */
+        CLIENT_PORT        ("CADClientPort"),       
+        /** RMI port to bind the Coordinator to for RMI communication. */
+        COOR_RMI_PORT      ("CoordinatorRMIPort"),  
+        
+        CAD_RMI_PORT       ("CADRmiPort"),
+        /** Filepath for xml file containing diversion data. */     
+        CMS_XML_FILE       ("CMSDiversionXML"), 
+        /** Filepath for xml file containing dvd control data. */
+        DVD_XML_FILE       ("DVDPlayerXML"),    
+        /** Filepath for xml file containing still image control data. */
+        IMAGE_XML_FILE     ("StillImagesXML"),
+        /** Root directory path where audio files are referenced from. */
+        AUDIO_LOCATION     ("AudioFileLocation"),
+        /** Filepath for the properties file to initialize the media manager. */
+        MEDIA_PROP_FILE    ("MediaProperties"),
+        /** Filepath for the properties file to initialize the paramics control manager. */
+        PARAMICS_PROP_FILE ("ParamicsProperties"),
+        /** Filepath for the properties file to initialize the atms manager. */
+        ATMS_PROP_FILE     ("ATMSProperties");
+        
+        public String name;
+        
+        private CAD_PROPERTIES(String n) {
+            name = n;
+        }
+    };
+        
+            
+    /** CADSimulatorViewer instance. */
+    protected static CADSimulatorViewer theViewer;
+
+    /** Coordinator instance. */
+    protected static  Coordinator theCoordinator;
+    
+    /** SoundPlayer instance. */
+    protected static  SoundPlayer theSoundPlayer = null;
+    
+    /** SimulationControlManager instance. */
+    protected static  SimulationControlManager theSimulationCntrlMgr = null;
+    
+    /**  ParamicsSimulationManager instance. */
+    protected static  ParamicsSimulationManager theParamicsSimMgr = null;
+    
+    /** IncidentManager instance. */
+    protected static  IncidentManager theIncidentMgr = null;
+    
+    /** MediaManager instance. */   
+    protected static  MediaManager theMediaMgr = null;
+    
+    /** ATMSManager instance. */
+    protected static  ATMSManager theATMSMgr = null; 
+
+    /** Properties file for the CADSimulator. */
+    private Properties cadSimulatorProperties;  
+    
+
+    /**
+     * Constructor.  Load the Properties file and initialize all CAD Simulator
+     * Managers and establish Manager data relationships.  A 
+     * CADSimulatorSocketHandler is instantiated and started to being 
+     * listening for remote CAD connections.  The CMSDiversionDB is initialized
+     * with the XML data(incomplete design).
+     * 
+     * @param propertiesFile Filename of CAD Simulator properties file.
+     * @throws SimulationException if there is an error in initializing the CAD Simulator.
+     */
+    public CADSimulator(String propertiesFile) throws SimulationException {
+        
+        try {
+            cadSimulatorProperties = new Properties();
+            cadSimulatorProperties.load(new FileInputStream(propertiesFile));
+        }
+        catch (Exception e) {           
+            cadSimLogger.logp(Level.SEVERE, "CADSimulator", "Constructor", 
+                    "Exception in reading properties file.", e);
+            
+            throw new SimulationException(SimulationException.INITIALIZE_ERROR, e); 
+        }
+    
+        //Create the Coordinator and register it for RMI communicator.  Start the
+        //CAD Simulator Socket Handler to begin to accept connections from CAD Clients.
+        try {         
+            theViewer             = new CADSimulatorViewer();
+            theCoordinator        = new Coordinator();
+            startRegistry(Integer.parseInt(
+                    cadSimulatorProperties.getProperty(
+                            CAD_PROPERTIES.COOR_RMI_PORT.name).trim()));
+            startRegistry(Integer.parseInt(
+                    cadSimulatorProperties.getProperty(
+                            CAD_PROPERTIES.CAD_RMI_PORT.name).trim()));
+
+            theSimulationCntrlMgr = new SimulationControlManager(theCoordinator);   
+            
+            theATMSMgr            = new ATMSManager(
+                    cadSimulatorProperties.getProperty(
+                            CAD_PROPERTIES.ATMS_PROP_FILE.name));
+            
+            theMediaMgr           = new MediaManager(
+                    cadSimulatorProperties.getProperty(
+                            CAD_PROPERTIES.MEDIA_PROP_FILE.name),
+                            theATMSMgr, theViewer);
+            
+            theParamicsSimMgr     = new ParamicsSimulationManager(
+                    cadSimulatorProperties.getProperty(
+                            CAD_PROPERTIES.PARAMICS_PROP_FILE.name),
+                            theCoordinator, theMediaMgr);   
+            
+            theSoundPlayer        = new SoundPlayer(
+                    cadSimulatorProperties.getProperty(
+                            CAD_PROPERTIES.AUDIO_LOCATION.name));
+            theSoundPlayer.start();
+            
+            theIncidentMgr        = new IncidentManager(theCoordinator, theSoundPlayer);    
+            
+
+            //Begin accepting Client connections
+            CADSimulatorSocketHandler tmsh = new CADSimulatorSocketHandler(
+                    Integer.parseInt(cadSimulatorProperties.getProperty(
+                            CAD_PROPERTIES.CLIENT_PORT.name).trim()));
+            tmsh.start();   
+        }       
+        catch (RemoteException e) {
+            cadSimLogger.logp(Level.SEVERE, "CADSimulator", "Constructor", 
+                    "Exception in starting Coordinator.", e);
+            
+            throw new SimulationException(SimulationException.BINDING, e);
+        }       
+        
+        //Load CMS Diversion Information from the XML file
+        try {       
+            if(cadSimulatorProperties.getProperty(
+                    CAD_PROPERTIES.CMS_XML_FILE.name) != null) {
+                    CMSDiversionDB.getInstance().loadFromXML(
+                        DocumentBuilderFactory.newInstance().newDocumentBuilder()
+                            .parse(new File(cadSimulatorProperties.getProperty(
+                                    CAD_PROPERTIES.CMS_XML_FILE.name))));
+            }           
+        }
+        catch (Exception e) 
+        {
+            cadSimLogger.logp(Level.SEVERE, "CADSimulator", "Constructor", 
+                    "Exception in parsing CMSDiversion xml file.", e);
+            
+            JOptionPane.showMessageDialog(new JWindow(), "Unable to open " + 
+                    cadSimulatorProperties.getProperty(CAD_PROPERTIES.CMS_XML_FILE.name), 
+                "Initialization Error", JOptionPane.WARNING_MESSAGE);   
+        }
+             
+        theViewer.addWindowListener(new WindowListener() {
+            public void windowClosed(WindowEvent e)  {}
+            public void windowOpened(WindowEvent e)  {}            
+            public void windowIconified(WindowEvent e)  {}         
+            public void windowDeiconified(WindowEvent e)  {}    
+            public void windowActivated(WindowEvent e)  {}                             
+            public void windowDeactivated(WindowEvent e)  {}         
+            public void windowClosing(WindowEvent e)  {   
+                System.exit(0);
+            }           
+        });
+        
+        theViewer.setVisible(true);
+
+    } 
+    
+    /**
+     * Binds the Coordinator to an RMI port so that the SimulationManager
+     * can communicate with it, and so that the Coordinator can perform RMI
+     * callback method calls.  The port numbers and RMI designators are parsed from
+     * the properties file file.
+     *
+     * @param theCoor A reference to the Coordinator object.
+     * @throws SimulationException if there are errors in binding the RMI to 
+     * a port and name.
+     */
+    private void startRegistry(Integer regPort) throws SimulationException {
+        
+        try{
+            LocateRegistry.createRegistry(regPort);                             
+            
+            String registryURL = "rmi://localhost:" + regPort + "/coordinator";
+            Naming.rebind(registryURL, theCoordinator);
+        }
+        catch (Exception e) {           
+            throw new SimulationException(SimulationException.BINDING, e);
+        }
+    }
+
+    /**
+     * Method returns a String represetnation of the current time.  String format
+     * is HHMM 
+     *
+     * @return String representation of the current time.
+     */
+    public static String getCADTime() {
+        String time = new String();     
+
+        Calendar rightNow = Calendar.getInstance();
+        
+        if(rightNow.get(Calendar.HOUR_OF_DAY) < 10)
+            time += "0";
+        
+        time += (String.valueOf(rightNow.get(Calendar.HOUR_OF_DAY)));
+        
+        if(rightNow.get(Calendar.MINUTE) < 10)
+            time += "0";
+        
+        time += (String.valueOf(rightNow.get(Calendar.MINUTE)));        
+                            
+        return time;        
+    }           
+    
+    /**
+     * Returns a string representation of the current date.  String format is:
+     * MMDDYY
+     *
+     * @return String format of the date.
+     */
+    public static String getCADDate() {
+        String date = new String();
+        
+        Calendar rightNow = Calendar.getInstance();
+        
+        //Months are zero referenced
+        if(rightNow.get(Calendar.MONTH) + 1 < 10)
+            date += "0";
+        
+        date += (String.valueOf(rightNow.get(Calendar.MONTH)+ 1));
+        
+        if(rightNow.get(Calendar.DAY_OF_MONTH) < 10)
+            date += "0";
+        
+        date += (String.valueOf(rightNow.get(Calendar.DAY_OF_MONTH)));      
+                            
+        if(rightNow.get(Calendar.YEAR) % 1000 < 10)
+            date += "0";
+        
+        date += (String.valueOf(rightNow.get(Calendar.YEAR) % 1000));                               
+                            
+        return date;    
+        
+    }
+        
+    /**
+     * Main class.  Instantiate a CAD Simulator with the properties file 
+     * specified on the command line or the default properties file
+     * 
+     * @param args Command line arguments.
+     */
+    public static void main(String[] args) {
+        System.setProperty("CAD_SIM_PROPERTIES",  "config/cad_simulator_config.properties");
+        
+        try 
+        {
+            if(System.getProperty("CAD_SIM_PROPERTIES") != null)
+            {
+                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+                
+                new CADSimulator(System.getProperty("CAD_SIM_PROPERTIES"));
+            }
+            else
+            {
+                throw new Exception ("CAD_SIM_PROPERTIES system property not defined.");
+            }
+        }
+        catch (Exception e) {
+            cadSimLogger.logp(Level.SEVERE, "CADSimulator", "Main", 
+                    "Error initializing application.", e);
+            
+            JOptionPane.showMessageDialog(new JWindow(), e.getMessage(), 
+                    "Error - Program Exiting", JOptionPane.ERROR_MESSAGE);  
+            
+            System.exit(-1);
+        }
+        
+    }
+} 
Index: trunk/src/tmcsim/cadsimulator/videocontrol/DVDStatusUpdate.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/videocontrol/DVDStatusUpdate.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/videocontrol/DVDStatusUpdate.java	(revision 2)
@@ -0,0 +1,56 @@
+package tmcsim.cadsimulator.videocontrol;
+
+/**
+ * DVDStatusUpdate is a container class used to notify observers of a DVD
+ * Controller when a status update occurs.  The DVD's connection is used to 
+ * uniquely identify a DVD player.  So this connection information String should
+ * always be the same for all updates.  The Abstract DVDController defines a 
+ * getConnectionInfo() method that may be used for this purpise.  The isConnected 
+ * should also always be set.  However, the Throwable object may be unused (null)
+ * if the DVDStatusUpdate is not reporting an exception.  Otherwise, the Throwable 
+ * will be the cause of the status update.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public class DVDStatusUpdate {
+
+    /** DVD player connection info. */
+    public String connectionInfo = null;
+    
+    /** Boolean flag to designate whether the DVD Controller is connected. */
+    public boolean isConnected = false;
+    
+    /** An Exception that has been thrown from the DVD controller. (Optional) */
+    public Throwable exception = null;
+
+    /**
+     * Constructor.
+     * 
+     * @param connInfo DVD connection info.
+     * @param connected Boolean connected flag.
+     * @param e Exception caught in DVD Controller.
+     */
+    public DVDStatusUpdate(String connInfo, boolean connected, Throwable e)
+    {
+        connectionInfo    = connInfo;
+        isConnected       = connected;
+        exception         = e;
+        
+    }
+
+    /**
+     * Constructor.
+     * 
+     * @param connInfo DVD connection info.
+     * @param connected Boolean connected flag.
+     */
+    public DVDStatusUpdate(String connInfo, boolean connected)
+    {
+        connectionInfo    = connInfo;
+        isConnected       = connected;
+        exception         = null;
+        
+    }
+    
+}
Index: trunk/src/tmcsim/cadsimulator/videocontrol/DVDRange.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/videocontrol/DVDRange.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/videocontrol/DVDRange.java	(revision 2)
@@ -0,0 +1,54 @@
+package tmcsim.cadsimulator.videocontrol;
+
+
+/**
+ * DVDRange is a container class used within video control.  It contains a 
+ * minimum and maximum speed range, an associated title number and duration for
+ * that title.  The DVDController uses the DVDRange to determine
+ * which DVD title is to be played according to current traffic speed.
+ *
+ * @author Matthew Cechini
+ * @version
+ */
+public class DVDRange {
+
+    /** Minimum speed for this range. */
+    public float minSpeed;
+
+    /** Maximum speed for this range. */
+    public float maxSpeed;
+
+    /** DVD title to play for this range. */
+    public int   dvdTitle;
+
+    /**  
+     * Constructor.  Initialize member data with parameter values.
+     *
+     * @param min Minimum speed in range.
+     * @param max Maximum speed in range.
+     * @param title Title to play for range.
+     * @param duration Length (in seconds) of range title.
+     */
+    public DVDRange(float min, float max, int title) {
+        minSpeed      = min;
+        maxSpeed      = max;
+        dvdTitle      = title;
+    }
+
+    /** 
+     * Tests if the parameter speed is >= the minimum speed and 
+     * < the maximum speed for this range.
+     *
+     * @param speed Speed value to test for inclusion in range.
+     * @return True if the parameter is within the range, false if not.
+     */ 
+    public boolean isWithin(float speed) {
+        return speed >= minSpeed && speed < maxSpeed;
+    }               
+
+    public boolean equals(DVDRange range) {
+        return dvdTitle == range.dvdTitle &&
+               minSpeed == range.minSpeed &&
+               maxSpeed == range.maxSpeed;
+    }
+}
Index: trunk/src/tmcsim/cadsimulator/videocontrol/DVDIncident.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/videocontrol/DVDIncident.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/videocontrol/DVDIncident.java	(revision 2)
@@ -0,0 +1,30 @@
+package tmcsim.cadsimulator.videocontrol;
+
+/**
+ * DVDIncident is a container class used within video control.  This class is 
+ * used by the DVDController to determine which DVD title is to be played
+ * when an incident is toggled.
+ *
+ * @author Matthew Cechini
+ * @version
+ */
+public class DVDIncident {
+
+    /** The incident log number. */
+    public int   incidentNumber;
+
+    /** The DVD title to play for this incident. */
+    public int   dvdTitle;
+
+    /**  
+     * Construct.  Initialize member data with parameter values.
+     *
+     * @param incident Incident number.
+     * @param title DVD title number. 
+     */
+    public DVDIncident(int incident, int title) {
+        incidentNumber = incident;
+        dvdTitle       = title;
+    }
+    
+}
Index: trunk/src/tmcsim/cadsimulator/videocontrol/PioneerV5000.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/videocontrol/PioneerV5000.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/videocontrol/PioneerV5000.java	(revision 2)
@@ -0,0 +1,450 @@
+package tmcsim.cadsimulator.videocontrol;
+
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+
+
+/**
+ * DVDController extends from the Abstraact DVDController class to provide
+ * funtionality for controlling the Pioneer V5000 DVD Controller.
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/15 19:08:15 $ $Revision: 1.5 $
+ */
+public class PioneerV5000 extends DVDController  {
+    
+    /**
+     * Enumeration of command strings used for DVD control.
+     * @author Matthew Cechini
+     */
+    protected static enum COMMAND_CHARS {
+        OPEN          ("OP"),
+        CLOSE         ("CO"),
+        START         ("SA"),
+        SEARCH        ("SE"),
+        PLAY          ("PL"),
+        SEARCH_PLAY   ("SL"),
+        PAUSE         ("PA"),
+        STILL         ("ST"),
+        REJECT        ("RJ"),
+        SCAN_FWD      ("NF"),
+        SCAN_RVS      ("NR"),
+        SCAN_STOP     ("NS"),
+        TITLE         ("TI"),
+        CHAPTER       ("CH"),
+        GROUP         ("GP"),
+        CMD_STACK_PL  ("BS"),
+        UPLOAD_DATA   ("BD"),  //Data from computer to player.
+        DOWNLOAD_DATA ("BU"),  //Data from player to computer.
+        SETUP         ("MS");   
+        
+        public String cmd;
+        
+        private COMMAND_CHARS(String c) {
+            cmd = c;
+        }
+    }
+    
+    /** Maximum number of command retries =5. */
+    protected final int  MAX_RETRIES      = 5;
+    
+    /** Maximum command length = 32. */
+    protected final int  MAX_COMMAND_LEN  = 32;
+    
+    /** Maximum response length = 32. */
+    protected final int  MAX_RESPONSE_LEN = 32;
+    
+    /** Carriage return character. */
+    protected final char CR = 0x0d;
+        
+    /** Buffer for creating command string. */
+    protected StringBuffer commandString;
+    
+    /** Buffer to receive repsonse string. */
+    protected StringBuffer responseString;
+    
+    /** DVD Player host. */
+    protected String dvdHost = null;
+    
+    /** DVD Player port. */
+    protected int    dvdPort = 0;
+    
+    /** Socket used for communication with DVD player. */
+    protected Socket serialInterfaceSocket = null;
+    
+    /** IOStream for writing out commands. */
+    //protected ObjectOutputStream out       = null;
+    protected OutputStream out = null;
+    
+    /** IOStream for reading dvd player responses. */
+    protected BufferedReader     in        = null;
+    
+
+    /**
+     * Constructor. 
+     */
+    public PioneerV5000() {     
+        commandString  = new StringBuffer(MAX_COMMAND_LEN);     
+        responseString = new StringBuffer(MAX_RESPONSE_LEN);        
+    }
+    
+    /** 
+     * Sets the host and port connection information for this dvd player.
+     *
+     * @param host DVD player host string.
+     * @param port DVD player port value.
+     */
+    public void setConnectionInfo(String host, int port) {
+        dvdHost = host;
+        dvdPort = port;
+    }
+    
+    /**
+     * Get the current connection information for this dvd player.  The
+     * returned string is as follows: HOST:PORT
+     *
+     * @return DVD connection host:port
+     */
+    public String getConnectionInfo() {
+        return dvdHost + ":" + dvdPort;
+    }
+    
+    public boolean isConnected() {
+        return isConnected;
+    }
+    
+    /**
+     * Establish a connection with the dvd player through socket communication.  
+     * If the port is successfully opened, input and ouput streams are opened
+     * on the socket.  The isConnected boolean flag is set to true if this is 
+     * successful.  Observers are notified with a DVDStatusUpdate to show the
+     * new connection.
+     *
+     * @throws IOException if communication with the dvd player fails.
+     */
+    public void connect() throws IOException {
+        
+        serialInterfaceSocket = new Socket();
+        serialInterfaceSocket.connect(new InetSocketAddress(dvdHost, dvdPort), 5000);
+        serialInterfaceSocket.setSoTimeout(5000);
+        
+        //out = new ObjectOutputStream(serialInterfaceSocket.getOutputStream());
+        out = serialInterfaceSocket.getOutputStream();
+        in  = new BufferedReader(new InputStreamReader(serialInterfaceSocket.getInputStream()));        
+        
+        isConnected = true;
+        
+        setChanged();
+        notifyObservers(new DVDStatusUpdate(getConnectionInfo(), 
+                isConnected()));
+    }
+    
+    
+    /**
+     * Disconnect from the dvd player.  Close all IOStreams and socket, then set
+     * the isConnected flag to false.  Observers are notified with a 
+     * DVDStatusUpdate to show the loss of the connection.
+     */
+    public void disconnect() {
+        
+        try {
+            in.close();
+        }
+        catch (Exception e) {}
+        
+        try {
+            out.close();
+        }
+        catch (Exception e) {}
+        
+        try {
+            serialInterfaceSocket.close();
+        }
+        catch (Exception e) {}
+        
+
+        isConnected = false;
+        
+        setChanged();
+        notifyObservers(new DVDStatusUpdate(getConnectionInfo(), 
+                isConnected()));
+        
+    }
+    
+    /*
+     * If the command is sent while the player is in the Park mode, the dvd
+     * ejects and the player enters the Open mode. After the tray is ejected, 
+     * player returns a completed status message. 
+     *
+     * If the player is in any mode other than Open or Park, the disc stops, the 
+     * player enters Open mode and the door opens.
+     *
+     * If the player is already in Open mode, an error message is returned.
+     */
+    public void open() throws IOException {
+        commandString.append(COMMAND_CHARS.OPEN.cmd);
+        transmit();
+    }
+    
+    
+    /*
+     * If the command is sent while the player door is open, the door 
+     * closes then the player enters the Park mode. After the door closes, the 
+     * player returns the completed status message.
+     *
+     * If the player is in any mode other than Open or if the player door is already 
+     * closed, an error message is returned.
+     */
+    public void close() throws IOException {        
+        commandString.append(COMMAND_CHARS.CLOSE.cmd);
+        transmit();
+    }
+    
+    /*
+     * If the command is sent while the player is in Open, Park or Reject 
+     * mode, the player immediately enters Setup and the disc begins spinning up.
+     * The player is ready for playback when the device reaches the beginning of
+     * the program (DVD, CD or VCD disc pauses or stills at the first Track). The 
+     * player returns the completed status when the disc pauses or stills. 
+     *
+     * If the player receives the command while playing a menu, the player returns 
+     * an error message. However, if the disc program does not allow new 
+     * commands once playback begins, the player ignores the command.
+     */
+    public void start() throws IOException {
+        commandString.append(COMMAND_CHARS.START.cmd);
+        transmit();
+    }
+    
+    public void play() throws IOException {
+        commandString.append(COMMAND_CHARS.PLAY.cmd);
+        transmit();
+    }   
+    
+    public void playChapter(int chapter) throws IOException {   
+        commandString.append(COMMAND_CHARS.CHAPTER.cmd + chapter);
+        commandString.append(COMMAND_CHARS.SEARCH_PLAY.cmd);
+        transmit();
+    }   
+
+    public void playTitle(int title) throws IOException {   
+        commandString.append(COMMAND_CHARS.TITLE.cmd + title);
+        commandString.append(COMMAND_CHARS.SEARCH_PLAY.cmd);
+        transmit();
+                
+    }
+
+    public void repeatTitle(int title) throws IOException { 
+        commandString.append(title + COMMAND_CHARS.GROUP.cmd);
+        commandString.append("1" + COMMAND_CHARS.CMD_STACK_PL.cmd);
+        
+        transmit();
+    }
+        
+    
+    /*
+     * If the command is sent while the player is in Random Access 
+     * mode, the pause occurs at the current disc location. The player returns the
+     * completed status message immediately.
+     *
+     * In Pause mode, Still and Video Squelch are ACTIVE. However, if the disc
+     * program does not allow a pause, the player ignores the command and
+     * returns an error message (E04).
+     */
+    public void pause() throws IOException {
+        commandString.append(COMMAND_CHARS.PAUSE.cmd);
+        transmit();
+    }
+    
+    /*
+     * If the command is sent while the player is in Random Access 
+     * mode, playback stops at the current disc position and the player enters Still 
+     * mode. The player returns the completed status message immediately. 
+     *
+     * However, if the disc program does not allow a pause, the player ignores the 
+     * command and returns an error message (E04).
+     *
+     */
+    public void still() throws IOException {
+        commandString.append(COMMAND_CHARS.STILL.cmd);
+        transmit();
+    }   
+    
+    public void stepForward() throws IOException {}
+    public void stepReverse() throws IOException {}
+    
+    /*
+     * If the command is sent while the player is in Random Access 
+     * mode, the screen proceeds forward (NF) or in reverse (NR) quickly. When 
+     * scanning is finished, the player resumes the Random Access mode and 
+     * returns the completed status message.
+     *
+     * If the SCAN command is sent while the player is in Fast Forward or Reverse 
+     * Playback, the player enters Scan mode.
+     *
+     * Once the NS command is sent, the player resets to the normal 
+     *Playback mode and returns the completed status message.
+     */
+    public void scanForward() throws IOException {
+        commandString.append(COMMAND_CHARS.SCAN_FWD.cmd);
+        transmit();
+    }
+    
+    
+    public void scanReverse() throws IOException {
+        commandString.append(COMMAND_CHARS.SCAN_RVS.cmd);
+        transmit();
+    }
+    
+    
+    public void scanStop() throws IOException {
+        commandString.append(COMMAND_CHARS.SCAN_STOP.cmd);
+        transmit();
+    }
+    
+    public void upload(String cmdStack) throws IOException {
+        //park mode
+        //out.write((COMMAND_CHARS.REJECT.cmd + CR).toString().getBytes());
+        
+        //try { Thread.sleep(500); } catch (Exception e) {}
+            
+        out.write((COMMAND_CHARS.UPLOAD_DATA.cmd + CR).toString().getBytes());
+        out.flush();
+        
+        try { Thread.sleep(500); } catch (Exception e) {}
+        
+        out.write((cmdStack + CR).toString().getBytes());
+        out.flush();
+        
+        
+    }
+    
+    public String download() throws Exception {
+        //park mode
+        commandString.append(COMMAND_CHARS.REJECT.cmd + CR);
+        transmit();
+        
+        commandString.append(COMMAND_CHARS.DOWNLOAD_DATA.cmd + CR);
+        
+        //send carriage return to refresh the connection
+        //out.writeChar(CR);
+        out.write(CR);
+        out.flush();                
+        
+        //clear response buffer
+        while(in.ready()) 
+            responseString.append(in.readLine());
+        responseString.setLength(0);
+        
+        //send the command
+        //out.writeBytes(commandString.toString());
+        out.write(commandString.toString().getBytes());
+        out.flush();                    
+        
+        //read in response
+        while(in.ready()) 
+            responseString.append(in.readLine());   
+        
+        
+        if(responseString.indexOf("E") == 0) {
+            throw new Exception("Error in downloading from player.");
+        }
+        else {
+            return responseString.toString();
+        }
+
+    }
+    
+    /**  
+     * This method spawns a thread to transmit the current command found in the 
+     * commandString buffer to the DVD player.  If the output stream is null,
+     * observers are notified with a DVDStatusUpdate containing the exception.
+     * The following steps are taken to transmit the command: <br>
+     * 
+     * <nl>
+     * <li>A Carriage Return (CR) character is sent to refresh the connection.</li> 
+     * <li>All response characters on the buffer are cleared.</li>
+     * <li>The command is transmitted with a CR to signify the end of the command.</li>
+     * <li>If the DVD response contains an 'E', then the command was not successful, 
+     *     repeat steps 1 - 3.  Otherwise, the command was successful, the thread ends.</li>
+     * <li>If the retry command transmit fails, notify observers with a DVDStatusUpdate
+     *     containing the exception.</li>
+     * <nl>
+     */
+    protected synchronized void transmit() {
+
+        Runnable transmitRun = new Runnable() {
+            public void run() {
+                
+                int retries = MAX_RETRIES;
+                
+                try {
+                    if(out == null) {
+                        throw new Exception("Cannot transmit to DVD " + 
+                                dvdHost + ":" + dvdPort + ". Reconnect to DVD.");
+                    }
+                    
+                    while(retries > 0) {
+                        System.out.println("sending [" + commandString.toString() + 
+                                "] to " + getConnectionInfo());
+
+                        //send carriage return to refresh the connection
+                        out.write(CR);                      
+                        out.flush();
+                        
+                        //Wait for DVD to respond
+                        Thread.sleep(500);
+                        
+                        //clear response buffer
+                        while(in.ready()) 
+                            responseString.append(in.readLine());
+                        responseString.setLength(0);
+
+                        //send the command
+                        out.write(commandString.toString().getBytes());
+                        out.write(CR);
+                        out.flush();
+                        
+                        //Wait for DVD to respond
+                        Thread.sleep(500);
+
+                        //read in response
+                        while(in.ready()) 
+                            responseString.append(in.readLine());   
+
+                        //if an error occured, retry
+                        if((responseString.indexOf("E") > -1)) {
+                            System.out.println("response: " + responseString.toString());
+                            retries--;
+                        }
+                        else {
+                            retries = 0;
+                            System.out.println("response: " + responseString.toString());
+                        }
+                    }                                           
+                }
+                catch (Exception e) {
+                    setChanged();
+                    notifyObservers(new DVDStatusUpdate(getConnectionInfo(), 
+                            isConnected(), e));
+                }
+                finally {
+                    commandString.setLength(0);
+                    responseString.setLength(0);
+                }
+            }
+        };
+        
+        Thread transmitThread = new Thread(transmitRun);
+        transmitThread.start();     
+
+    }
+    
+    
+    
+}
Index: trunk/src/tmcsim/cadsimulator/videocontrol/PioneerV5000TestController.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/videocontrol/PioneerV5000TestController.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/videocontrol/PioneerV5000TestController.java	(revision 2)
@@ -0,0 +1,280 @@
+package tmcsim.cadsimulator.videocontrol;
+
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import javax.rmi.CORBA.Tie;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JButton;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JTextField;
+
+
+@SuppressWarnings("serial")
+public class PioneerV5000TestController extends JFrame implements ActionListener{
+                
+    PioneerV5000 cntrl = null;  
+        
+    public static void main(String[] args) {
+        new PioneerV5000TestController();       
+    }
+    
+    public PioneerV5000TestController() {
+        super("SUPER AWESOME DVD CONTROLLER");
+
+        try {
+            cntrl = new PioneerV5000();
+            cntrl.setConnectionInfo("192.168.251.9", 3002);
+            cntrl.connect();
+        }
+        catch (IOException ioe) {
+            ioe.printStackTrace();
+        }
+
+        
+        initialize();
+        
+        addWindowListener(new WindowListener() {
+            public void windowClosed(WindowEvent e)  {}
+            public void windowOpened(WindowEvent e)  {}            
+            public void windowIconified(WindowEvent e)  {}         
+            public void windowDeiconified(WindowEvent e)  {}    
+            public void windowActivated(WindowEvent e)  {}                             
+            public void windowDeactivated(WindowEvent e)  {}         
+            public void windowClosing(WindowEvent e)  {                 
+                cntrl.disconnect();                
+                System.exit(0);
+            }                   
+            
+        });
+    }
+    
+    public void actionPerformed(ActionEvent evt) {
+    
+        try {
+            if(evt.getSource().equals(addDVDButton)) {
+                
+            }
+            else if(evt.getSource().equals(delDVDButton)) { 
+                
+            }
+            else if(evt.getSource().equals(openButton)) { 
+                cntrl.open();
+            }
+            else if(evt.getSource().equals(closeButton)) { 
+                cntrl.close();          
+            }
+            else if(evt.getSource().equals(rewButton)) { 
+                cntrl.scanReverse();
+            }
+            else if(evt.getSource().equals(ffButton)) { 
+                cntrl.scanForward();
+            }
+            else if(evt.getSource().equals(playButton)) { 
+                cntrl.play();
+            }
+            else if(evt.getSource().equals(pauseButton)) { 
+                cntrl.pause();
+            }
+            else if(evt.getSource().equals(stopButton)) {
+                
+            }
+            else if(evt.getSource().equals(cmdStackButton)) {
+                cntrl.repeatTitle(Integer.parseInt(titleTF.getText()));
+            }
+            else if(evt.getSource().equals(uploadButton)) {
+                /*
+                //file chooser
+                JFileChooser fc = new JFileChooser();
+                
+                if(fc.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
+                    
+                    StringBuffer cmdStack = new StringBuffer();
+                    
+                    try {
+                        FileInputStream fis = new FileInputStream(
+                                fc.getSelectedFile());
+                        
+                        while(fis.available() > 0) {
+                            cmdStack.append(fis.read());
+                        }
+                        fis.close();
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    
+                    cntrl.upload(cmdStack.toString());
+                }
+                */
+                cntrl.upload("24680200000000100020003000400050006000700080009000A000B000C000D000E000F0010001100120013001400150016001700180019001A001B001C0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF001D0009FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000001D0A4A0A1A0A0A0A0A0A1A9A9A9A9A9A9A0A4A9AAA3000000000000000000000000FF000000000000000000000000000000A4A0A2A0A0A0A0A0A1A9A9A9A9A9A9A1A4A9AAA3000000000000000000000000FF000000000000000000000000000000A4A0A3A0A0A0A0A0A1A9A9A9A9A9A9A2A4A9AAA3000000000000000000000000FF000000000000000000000000000000A4A0A4A0A0A0A0A0A1A9A9A9A9A9A9A3A4A9AAA3000000000000000000000000FF000000000000000000000000000000A4A0A5A0A0A0A0A0A1A9A9A9A9A9A9A4A4A9AAA3000000000000000000000000FF000000000000000000000000000000A4A0A6A0A0A0A0A0A1A9A9A9A9A9A9A5A4A9AAA3000000000000000000000000FF000000000000000000000000000000A4A0A7A0A0A0A0A0A1A9A9A9A9A9A9A6A4A9AAA3000000000000000000000000FF000000000000000000000000000000A4A0A8A0A0A0A0A0A1A9A9A9A9A9A9A7A4A9AAA3000000000000000000000000FF000000000000000000000000000000A4A0A9A0A0A0A0A0A1A9A9A9A9A9A9A8A4A9AAA3000000000000000000000000FF000000000000000000000000000000A4A1A0A0A0A0A0A0A1A9A9A9A9A9A9A0A4A9AAA30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050917");
+                
+            }
+            else if(evt.getSource().equals(downloadButton)) {
+                JFileChooser fc = new JFileChooser();
+                
+                if(fc.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
+
+                    String cmdStack = cntrl.download();
+                    
+                    System.out.println(cmdStack);
+                    
+                    try {
+                        FileOutputStream fos = new FileOutputStream(
+                                fc.getSelectedFile());
+                        
+                        fos.write(cmdStack.getBytes());                     
+                        fos.close();
+                        
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }                   
+                }
+                
+            }
+        }
+        catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+    
+    protected void initialize() {
+        
+        addDVDButton = new JButton("ADD DVD");
+        addDVDButton.addActionListener(this);
+        
+        delDVDButton = new JButton("DEL DVD");
+        delDVDButton.addActionListener(this);
+        
+        playerMgmtBox = new Box(BoxLayout.X_AXIS);
+        playerMgmtBox.add(Box.createHorizontalGlue());
+        playerMgmtBox.add(addDVDButton);
+        playerMgmtBox.add(Box.createHorizontalGlue());
+        playerMgmtBox.add(delDVDButton);
+        playerMgmtBox.add(Box.createHorizontalGlue());  
+                
+        
+        openButton  = new JButton("OPEN");
+        openButton.addActionListener(this);
+        
+        closeButton = new JButton("CLOSE");
+        closeButton.addActionListener(this);
+        
+        doorCntrlBox = new Box(BoxLayout.X_AXIS);
+        doorCntrlBox.add(Box.createHorizontalGlue());
+        doorCntrlBox.add(openButton);
+        doorCntrlBox.add(Box.createHorizontalGlue());
+        doorCntrlBox.add(closeButton);
+        doorCntrlBox.add(Box.createHorizontalGlue());
+        
+        rewButton  = new JButton("REW");
+        rewButton.addActionListener(this);
+        
+        playButton = new JButton("PLAY");
+        playButton.addActionListener(this);
+        
+        ffButton   = new JButton("FF");     
+        ffButton.addActionListener(this);
+        
+        buttonRowBox1 = new Box(BoxLayout.X_AXIS);
+        buttonRowBox1.add(Box.createHorizontalGlue());
+        buttonRowBox1.add(rewButton);
+        buttonRowBox1.add(Box.createHorizontalGlue());
+        buttonRowBox1.add(playButton);
+        buttonRowBox1.add(Box.createHorizontalGlue());
+        buttonRowBox1.add(ffButton);
+        buttonRowBox1.add(Box.createHorizontalGlue());
+                
+        
+        pauseButton  = new JButton("PAUSE");
+        pauseButton.addActionListener(this);
+        
+        stopButton   = new JButton("STOP");
+        stopButton.addActionListener(this);
+        
+        buttonRowBox2 = new Box(BoxLayout.X_AXIS);
+        buttonRowBox2.add(Box.createHorizontalGlue());
+        buttonRowBox2.add(pauseButton);
+        buttonRowBox2.add(Box.createHorizontalGlue());
+        buttonRowBox2.add(stopButton);
+        buttonRowBox2.add(Box.createHorizontalGlue());
+        
+
+        titleTF = new JTextField();
+        
+        cmdStackButton = new JButton("REPEAT");
+        cmdStackButton.addActionListener(this);
+
+        buttonRowBox3 = new Box(BoxLayout.X_AXIS);
+        buttonRowBox3.add(Box.createHorizontalGlue());
+        buttonRowBox3.add(titleTF);
+        buttonRowBox3.add(Box.createHorizontalGlue());
+        buttonRowBox3.add(cmdStackButton);
+        buttonRowBox3.add(Box.createHorizontalGlue());
+                        
+        uploadButton  = new JButton("UPLOAD");
+        uploadButton.addActionListener(this);
+        
+        downloadButton   = new JButton("DOWNLOAD");
+        downloadButton.addActionListener(this);
+        
+        buttonRowBox4 = new Box(BoxLayout.X_AXIS);
+        buttonRowBox4.add(Box.createHorizontalGlue());
+        buttonRowBox4.add(uploadButton);
+        buttonRowBox4.add(Box.createHorizontalGlue());
+        buttonRowBox4.add(downloadButton);
+        buttonRowBox4.add(Box.createHorizontalGlue());
+        
+                        
+        controllerBox = new Box(BoxLayout.Y_AXIS);
+        controllerBox.add(Box.createVerticalStrut(15));
+        controllerBox.add(playerMgmtBox);
+        controllerBox.add(Box.createVerticalStrut(15));
+        controllerBox.add(doorCntrlBox);
+        controllerBox.add(Box.createVerticalStrut(15));
+        controllerBox.add(buttonRowBox1);
+        controllerBox.add(Box.createVerticalStrut(15));
+        controllerBox.add(buttonRowBox2);
+        controllerBox.add(Box.createVerticalStrut(15));
+        controllerBox.add(buttonRowBox3);
+        controllerBox.add(Box.createVerticalStrut(15));
+        controllerBox.add(buttonRowBox4);
+        controllerBox.add(Box.createVerticalStrut(15));
+        
+        
+        add(controllerBox);
+        
+        pack();
+        setVisible(true);
+    }
+    
+    protected JButton addDVDButton;
+    protected JButton delDVDButton;
+    protected JButton openButton;
+    protected JButton closeButton;
+    protected JButton rewButton;
+    protected JButton playButton;
+    protected JButton ffButton;
+    protected JButton pauseButton;
+    protected JButton stopButton;
+    protected JButton cmdStackButton;
+    protected JButton uploadButton;
+    protected JButton downloadButton;
+    
+    protected JTextField titleTF;
+    
+    protected Box controllerBox;
+    protected Box playerMgmtBox;
+    protected Box doorCntrlBox;
+    protected Box buttonRowBox1;
+    protected Box buttonRowBox2;
+    protected Box buttonRowBox3;
+    protected Box buttonRowBox4;
+    
+}
Index: trunk/src/tmcsim/cadsimulator/videocontrol/DVDController.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/videocontrol/DVDController.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/videocontrol/DVDController.java	(revision 2)
@@ -0,0 +1,244 @@
+package tmcsim.cadsimulator.videocontrol;
+
+import java.io.IOException;
+import java.util.Observable;
+import java.util.Vector;
+
+/**
+ * DVDController is an abstract class used for controlling a remote DVD player.
+ * All player specific control methods must be overloaded according to the 
+ * requirements of that device.  This base class handles starting and repeating 
+ * range or incident titles according to current speed updates or incident toggles. 
+ *
+ * The addRange() and addIncident() methods are used to register more titles with
+ * the DVDController class.  The updatePlayer() and toggleIncident() methods are
+ * used to control which titles are being played.  A title will continuously
+ * repeat until a new title is chosen through one of these methods.
+ *
+ * @author Matthew Cechini
+ * @version
+ */
+public abstract class DVDController extends Observable {
+    
+    /** Number of consecutive requests for change until the title will change. */
+    private static final int CHANGE_TOLERANCE = 2;
+    
+    /** 
+     *  Boolean flag to designate whether a connection has been established with
+     *  the DVD player.
+     */
+    protected boolean isConnected = false;
+    
+    /** Vector of all DVDRanges in the current simulation.  */
+    protected Vector<DVDRange> ranges = null;
+    
+    /**  Vector of all DVDIncidents in the current simulation. */
+    protected Vector<DVDIncident> incidents = null;
+    
+    /** Current range being played.  Null if none have played. */
+    protected DVDRange currentRange = null;
+    
+    /** Current incident being played. */
+    protected DVDIncident currentIncident = null;
+    
+    /** Boolean flag to designate whether an incident is currently playing. */
+    protected boolean isPlayingIncident = false;
+    
+    /** 
+     * DVDRange object to cache the last "new range" that the controller
+     * has chosen as a result of a speed update.  This allows for a tolerance
+     * value to be used to control frequent title changes.  
+     */
+    protected DVDRange changeRange;
+    
+    /** 
+     * Count value to count the number of consecutive updates that
+     * result in the same DVDRange. 
+     */
+    protected int changeRangeCounter;
+    
+    /**
+     * Constructor.  Initialize lists and title repeat timer.
+     */
+    public DVDController() {
+        ranges    = new Vector<DVDRange>();
+        incidents = new Vector<DVDIncident>();
+        
+        changeRange        = null;
+        changeRangeCounter = 0;
+    }
+    
+    /**  
+     * Add a new DVDRange to the local list.
+     * 
+     * @param newRange DVDRange to add.
+     */
+    public void addRange(DVDRange newRange) {
+        ranges.add(newRange);
+    }
+    
+    /**  
+     * Add a new DVDIncident to the local list.
+     * 
+     * @param newRange DVDIncident to add.
+     */ 
+    public void addIncident(DVDIncident newIncident) {
+        incidents.add(newIncident);
+    }
+    
+    /**
+     * Toggle the dvd player to start or stop playing an incident track.  The
+     * boolean parameter is used to designate whether the incident is being
+     * toggled to start(true) or stop (false).  If the toggle flag is true,
+     * then the DVDIncident with log number equal to the parameter log_num
+     * will be played.  The currentIncident and isPlayeingIncident member data
+     * objects are updated.  
+     *
+     * If the toggle flag is false, and the incident being toggled is playing,
+     * then it is stopped.
+     *
+     * @param log_num Incident log number to toggle.
+     * @param toggle Boolean flag.  True = start incident, false = stop incident.
+     * @throws Exception if the method is unable to toggle the incident.
+     */
+    public void toggleIncident(int log_num, boolean toggle) throws Exception {
+        if(toggle) {
+            for(DVDIncident incident : incidents) {
+                if(incident.incidentNumber == log_num) {
+                    currentIncident   = incident;                   
+                    isPlayingIncident = true;
+                    
+                    playCurrentTitle();
+                }
+            }
+        }
+        else if(currentIncident != null && currentIncident.incidentNumber == log_num) {
+            isPlayingIncident = false;          
+            
+            playCurrentTitle();
+        }
+        else {
+            throw new Exception("DVDController: Unable to toggle incident #" + log_num);
+        }
+    }
+    
+    /**
+     * Update this DVD player with a new traffic speed after the tolerance of
+     * range changes has been met.  If the parameter speed falls within a 
+     * different DVDRange than is being played, remember the new range.  If this 
+     * new range was not detected during the last update, reset the change 
+     * counter to 0.  If this range was detected during the last update, 
+     * increment the change counter.  If the change counter is greater than
+     * the tolerance value specified, set the current range to the new range, 
+     * reset the change counter, and set the updated flag to true.  If the range
+     * has been updated, and an incident is not being shown, return true.  Else
+     * return false.
+     *
+     * @param newSpeed New traffic speed for this DVD's camera location.
+     * @return True if a new DVDRange is to be played, false if not.
+     */
+    public boolean updatePlayer(float newSpeed) {
+        
+        boolean updated   = false;
+        DVDRange newRange = null;
+        
+        for(DVDRange range : ranges) {
+            if(range.isWithin(newSpeed)) {
+                if(currentRange == null || !currentRange.equals(range)) {
+                    newRange = range;
+                    break;
+                }
+            }
+        }
+        
+        if(newRange == null) {
+            //do nothing
+        }
+        else if(changeRange == null || !changeRange.equals(newRange)) {
+            changeRange = newRange;
+            changeRangeCounter = 0;
+        }
+        else {
+            changeRangeCounter++;
+        }
+        
+        if(currentRange == null ||
+           changeRangeCounter >= CHANGE_TOLERANCE) 
+        {
+            changeRangeCounter = 0;
+            currentRange       = changeRange;
+            updated            = true;
+        }
+        
+        
+        //even if the currentRange is updated, an incident trumps this
+        return updated & !isPlayingIncident;
+    }
+    
+    /**
+     * This method starts a new title.  If the DVD Controller is playing an incident,
+     * then the incident title will be started.  Else, if a DVD range has been found, 
+     * then it's title will be started in repeat mode.  
+     *
+     * @throws Exception if the method is not able to play the current title.
+     */
+    public void playCurrentTitle() throws Exception {
+        
+        if(!isConnected) {
+            throw new Exception("Cannot play title, connection has not been established to DVD Controller");
+        }
+        else if(isPlayingIncident) {
+            repeatTitle(currentIncident.dvdTitle);
+
+            setChanged();
+            notifyObservers(new DVDTitleUpdate(
+                    getConnectionInfo(), currentRange, 
+                    currentIncident, isPlayingIncident, false));            
+        }       
+        else if(currentRange != null) {
+            repeatTitle(currentRange.dvdTitle);
+
+            setChanged();
+            notifyObservers(new DVDTitleUpdate(
+                    getConnectionInfo(), currentRange, 
+                    currentIncident, isPlayingIncident, false));        
+        }
+
+    }
+    
+    public abstract void setConnectionInfo(String host, int port);
+    public abstract String getConnectionInfo();
+    public abstract boolean isConnected();
+    public abstract void connect() throws IOException; 
+    public abstract void disconnect();  
+
+    
+    public abstract void open() throws IOException;
+    public abstract void close() throws IOException;
+    
+    public abstract void start() throws IOException;
+    public abstract void play() throws IOException;
+    public abstract void playChapter(int chapter) throws IOException;
+    public abstract void playTitle(int title) throws IOException;
+    public abstract void repeatTitle(int title) throws IOException;
+    public abstract void pause() throws IOException;
+    public abstract void still() throws IOException;
+        
+    public abstract void stepForward() throws IOException;
+    public abstract void stepReverse() throws IOException;
+    public abstract void scanForward() throws IOException;
+    public abstract void scanReverse() throws IOException;
+    public abstract void scanStop() throws IOException;
+    
+    //multi-speed forward/reverse
+    
+    //speed
+    //search
+    //search&play
+    
+    //frame
+    
+    //time
+    //track
+    
+}
Index: trunk/src/tmcsim/cadsimulator/videocontrol/DVDTitleUpdate.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/videocontrol/DVDTitleUpdate.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/videocontrol/DVDTitleUpdate.java	(revision 2)
@@ -0,0 +1,54 @@
+package tmcsim.cadsimulator.videocontrol;
+
+/**
+ * DVDTitleUpdate is a container class used to notify observers of a DVD
+ * Controller when a title update occurs.  The DVD's connection is used to 
+ * uniquely identify a DVD player.  So this connection information String should
+ * always be the same for all updates.  The Abstract DVDController defines a 
+ * getConnectionInfo() method that may be used for this purpise.  The data members
+ * of this object are used to hold the current state of the DVD player when the
+ * update occurs.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public class DVDTitleUpdate {
+
+    /** DVD player's connection info. */
+    public String connectionInfo = null;
+    
+    /** Current range being played.  Null if none have played. */
+    public DVDRange currentRange = null;
+    
+    /** Current incident being played. */
+    public DVDIncident currentIncident = null;
+    
+    /** Boolean flag to designate whether an incident is currently playing. */
+    public boolean isPlayingIncident = false;
+    
+    /** 
+     *  Boolean flag to designate whether the title is being repeated(true) or 
+     *  played for the first time(false). 
+     */ 
+    public boolean isRepeat = false;
+    
+    /**
+     * Constructor.
+     * 
+     * @param connInfo  DVD player connection info.
+     * @param range Current range being played. (may be null)
+     * @param incident Current Incident being played. (may be null)
+     * @param playingInc Playing incident flag.
+     * @param repeat Title repeated flag.
+     */
+    public DVDTitleUpdate(String connInfo, DVDRange range, 
+            DVDIncident incident, boolean playingInc, boolean repeat)
+    {
+        connectionInfo    = connInfo;
+        currentRange      = range;
+        currentIncident   = incident;
+        isPlayingIncident = playingInc;
+        isRepeat          = repeat;
+        
+    }
+}
Index: trunk/src/tmcsim/cadsimulator/stillimagecontrol/ImageRange.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/stillimagecontrol/ImageRange.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/stillimagecontrol/ImageRange.java	(revision 2)
@@ -0,0 +1,48 @@
+package tmcsim.cadsimulator.stillimagecontrol;
+
+/**
+ * ImageRange is a container class used within the CAD still image control.  
+ * It contains a minimum and maximum speed range and an associated image 
+ * file name to be shown.  The ImageController class uses the ImageRange 
+ * to determine which image is to be shown on the ATMS according to 
+ * current traffic speed.
+ *
+ * @author Matthew Cechini
+ * @version
+ */
+public class ImageRange {
+
+    /** Minimum speed for this range. */
+    public float minSpeed;
+
+    /** Maximum speed for this range. */
+    public float maxSpeed;
+    
+    /** Filename of the image to be shown for this range. */
+    public String fileName;
+
+    /**  
+     * Constructor.  Initialize member data with parameter values.
+     *
+     * @param min Minimum speed in range.
+     * @param max Maximum speed in range.
+     * @param file Filename if associated image file.
+     */
+    public ImageRange(float min, float max, String file) {
+        minSpeed = min;
+        maxSpeed = max;
+        fileName = file;
+    }
+    
+    /** 
+     * Tests if the parameter speed is >= the minimum speed and 
+     * < the maximum speed for this range.
+     *
+     * @param speed Speed value to test for inclusion in range.
+     * @return True if the parameter is within the range, false if not.
+     */     
+    public boolean isWithin(float speed) {
+        return speed >= minSpeed && speed < maxSpeed;
+    }       
+    
+}
Index: trunk/src/tmcsim/cadsimulator/stillimagecontrol/ImageIncident.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/stillimagecontrol/ImageIncident.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/stillimagecontrol/ImageIncident.java	(revision 2)
@@ -0,0 +1,31 @@
+package tmcsim.cadsimulator.stillimagecontrol;
+
+
+/**
+ * ImageIncident is a container class used within still image control.  This 
+ * class is used by the ImageController to determine which DVD title is to be 
+ * played when an incident is toggled.
+ *
+ * @author Matthew Cechini
+ * @version
+ */
+public class ImageIncident {
+
+    /** The incident log number. */
+    public int   incidentNumber;
+
+    /** Filename of the image to be shown for this range. */
+    public String fileName;
+    
+    /**  
+     * Construct.  Initialize member data with parameter values.
+     *
+     * @param incident Incident number.
+     * @param file Filename if associated image file.
+     */ 
+    public ImageIncident(int incident, String file) {
+        incidentNumber = incident;
+        fileName       = file;
+    }
+        
+}
Index: trunk/src/tmcsim/cadsimulator/stillimagecontrol/ATMSCommunicator.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/stillimagecontrol/ATMSCommunicator.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/stillimagecontrol/ATMSCommunicator.java	(revision 2)
@@ -0,0 +1,123 @@
+package tmcsim.cadsimulator.stillimagecontrol;
+
+import java.rmi.RemoteException;
+import java.text.DateFormat;
+import java.util.Calendar;
+import java.util.StringTokenizer;
+
+/**
+ * ATMSCommunicator handles communication between the CAD Simulator and the 
+ * ATMS Server.  The funcationality provided includes querying the current time 
+ * on the ATMS server and replacing images on the ATMS to model 
+ * traffic flow changes.  The ATMSCommunicator uses the plink.exe external 
+ * application to establish an SSH communication with the ATMS server, which is
+ * used to execute commands remotely.  
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public class ATMSCommunicator {
+    
+    /** Connection user name. */
+    protected String username;
+    
+    /** Connection password. */
+    protected String password;
+    
+    /** ATMS Server Host name. */
+    protected String viewerHost;
+    
+    /** Absolute directory path for images. */
+    protected String image_dir;
+    
+    /** Base plink command string. */
+    protected String plinkBaseCMD;
+    
+    /** Constructor. */
+    public ATMSCommunicator(String host, String user, String pwd, String dir) {
+        viewerHost = host;
+        username   = user;
+        password   = pwd;
+        image_dir  = dir;
+        
+        plinkBaseCMD = "plink -l " + username + " -pw " + password + " " + viewerHost + " ";        
+    }
+    
+    /**
+     * Get the current ATMS server time as the number of seconds since Jan 1, 1970.
+     * 
+     * @return Current time in seconds.
+     * @throws RemoteException If there is an exception in RMI communication.
+     */ 
+    public long getCurrentTime() throws Exception {
+        
+        Calendar currentCal = Calendar.getInstance();
+
+        Process timeProc = Runtime.getRuntime().exec(plinkBaseCMD + " \"date\"");
+        timeProc.waitFor();
+        
+        if(timeProc.exitValue() == 0) {
+            String tempToken = null;
+            byte[] dateBytes = new byte[timeProc.getInputStream().available()];
+            timeProc.getInputStream().read(dateBytes);
+            
+            StringTokenizer spaceTok = new StringTokenizer(new String(dateBytes), " ");
+            while(spaceTok.hasMoreTokens()) {
+                tempToken = spaceTok.nextToken();
+                
+                if(tempToken.indexOf(":") != -1) {
+                    StringTokenizer colonTok = new StringTokenizer(new String(tempToken), ":");
+                    
+                    currentCal.set(Calendar.HOUR, Integer.parseInt(colonTok.nextToken()));
+                    currentCal.set(Calendar.MINUTE, Integer.parseInt(colonTok.nextToken()));
+                    currentCal.set(Calendar.SECOND, Integer.parseInt(colonTok.nextToken()));
+                    
+                    System.out.println("Time retreieved from ATRMS server: " + 
+                            DateFormat.getDateTimeInstance().format(currentCal.getTime()));                                 
+                    
+                }
+            }
+        }       
+        
+        return currentCal.getTimeInMillis();        
+
+    }
+
+    /**
+     * Show a new image for an ATMS camera.  The ATMS camera files are named
+     * <ATMS_Camera_ID>.xpm.  If a camera file exists, delete it.  Then copy
+     * the parameter file name to <ATMS_Camera_ID>.xpm.  If the camera ID or 
+     * new file does not exist, throw an exception.     
+     * 
+     * @param ATMS_cameraID ATMS indexed camera ID.
+     * @param fileName Filename to show.
+     * @throws RemoteException If there is an exception in RMI communication.
+     */ 
+    public void showImage(Integer ATMS_cameraID, String fileName) throws RemoteException {
+        
+        System.out.println("Showing CameraID " + ATMS_cameraID + ", with filename: " + fileName);
+        /*
+        Process imageProc = Runtime.getRuntime().exec(plinkBaseCMD + "\"ls " + image_dir + "/cctvImage" + ATMS_cameraID + ".xpm\"");
+        imageProc.waitFor();
+        
+        if(imageProc.exitValue() != 0) {
+            throw new Exception(image_dir + "/cctvImage" + ATMS_cameraID + ".xpm does not exist");
+        }
+            
+        imageProc = Runtime.getRuntime().exec(plinkBaseCMD + "\"ls " + image_dir + "/" + fileName + ".xpm\"");
+        imageProc.waitFor();
+
+        if(imageProc.exitValue() != 0) {
+            throw new Exception(image_dir + "/" + fileName + ".xpm does not exist");
+        }
+    
+        imageProc = Runtime.getRuntime().exec(plinkBaseCMD + "\"rm " + image_dir + "/cctvImage" + ATMS_cameraID + ".xpm\"");
+        imageProc.waitFor();
+        
+        imageProc = Runtime.getRuntime().exec(plinkBaseCMD + "\"cp " + image_dir + "/" + fileName + ".xpm" + 
+                                  "   " + image_dir + "/" + "cctvImage" + ATMS_cameraID + ".xpm\"");        
+        imageProc.waitFor();
+        */
+        
+    }   
+}
Index: trunk/src/tmcsim/cadsimulator/stillimagecontrol/ImageController.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/stillimagecontrol/ImageController.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/stillimagecontrol/ImageController.java	(revision 2)
@@ -0,0 +1,199 @@
+package tmcsim.cadsimulator.stillimagecontrol;
+
+import java.util.Observable;
+import java.util.Vector;
+
+import tmcsim.cadsimulator.managers.ATMSManager;
+
+/**
+ * ImageController is used for controlling which images are shown on the ATMS 
+ * Server.  Communication with the ATMS server is performed through the
+ * ATMSManager.  
+ *
+ * The addRange() and addIncident() methods are used to register more images with
+ * the ImageController class.  The updateImage() and toggleIncident() methods are
+ * used to control which images are being shown.  An image will remain showing 
+ * until a new image is chosen through one of these methods. 
+ *
+ * @author Matthew Cechini
+ * @version
+ */
+public class ImageController extends Observable  {
+    
+    /** Number of consecutive requests for change until the image will change. */
+    private static final int CHANGE_TOLERANCE = 2;
+    
+    /** ATMS CCTV unique ID. */
+    protected Integer atms_cctv_id      = null;
+
+    /** Vector of ImageRange objects handled by this controller. */
+    protected Vector<ImageRange> ranges = null;
+
+    /** Vector of ImageIncident objects handled by this controller. */
+    protected Vector<ImageIncident> incidents = null;
+    
+    /** Current range being shown.  Null if none have been shown. */
+    protected ImageRange currentRange = null;
+
+    /** Current incident iamge being shown.  Null if none have been shown. */
+    protected ImageIncident currentIncident = null;
+    
+    /** Boolean flag determining whether an incident is currently being shown. */
+    protected boolean isShowingIncident = false;
+    
+    /** 
+     * ImageRange object to cache the last "new range" that the controller
+     * has chosen as a result of a speed update.  This allows for a tolerance
+     * value to be used to control frequent title changes.  
+     */
+    protected ImageRange changeRange;
+    
+    /** 
+     * Count value to count the number of consecutive updates that
+     * result in the same ImageRange. 
+     */
+    protected int changeRangeCounter;   
+    
+    /** Manager used to handle communication with the ATMS. */
+    protected ATMSManager theATMSManager;
+    
+    /**
+     * Constructor.
+     * 
+     * @param cctv_id ATMS CCTV ID.
+     */
+    public ImageController(Integer cctv_id, ATMSManager atmsManager) {
+        theATMSManager = atmsManager;
+        
+        ranges       = new Vector<ImageRange>();
+        incidents    = new Vector<ImageIncident>();
+        atms_cctv_id = cctv_id;
+        
+        changeRange        = null;
+        changeRangeCounter = 0;
+    }
+    
+    /**  
+     * Add a new ImageRange to the local list.
+     * 
+     * @param newRange ImageRange to add.
+     */
+    public void addRange(ImageRange newRange) {
+        ranges.add(newRange);
+    }
+    
+    /**  
+     * Add a new ImageIncident to the local list.
+     * 
+     * @param newRange ImageIncident to add.
+     */ 
+    public void addIncident(ImageIncident newIncident) {
+        incidents.add(newIncident);
+    }
+    
+    /**
+     * Toggle the image controller to begin or stop showing the image associated
+     * with an incident.  The boolean parameter is used to designate whether the 
+     * incident is being toggled to start(true) or stop (false).  
+     * If the toggle flag is true, then the ImageIncident with log number equal 
+     * to the parameter log_num will be shown.  The currentIncident and 
+     * isShowingIncident member data objects are updated.  
+     *
+     * If the toggle flag is false, and the incident being toggled is shown,
+     * then it is stopped.
+     *
+     * @param log_num Incident log number to toggle.
+     * @param toggle Boolean flag.  True = start incident, false = stop incident.
+     * @throws Exception if the method is unable to toggle the incident.
+     */
+    public void toggleIncident(int log_num, boolean toggle) throws Exception {
+        if(toggle) {
+            for(ImageIncident incident : incidents) {
+                if(incident.incidentNumber == log_num) {
+                    currentIncident   = incident;                   
+                    isShowingIncident = true;
+                    
+                    showCurrentImage();
+                }
+            }
+        }
+        else if(currentIncident != null && currentIncident.incidentNumber == log_num) {
+            isShowingIncident = false;
+
+            showCurrentImage();
+        }
+        else {
+            throw new Exception("ImageController: Unable to toggle incident #" + log_num);
+        }
+    }   
+    
+    /**
+     * Update the image with a new traffic speed after the tolerance of
+     * range changes has been met.  If the parameter speed falls within a 
+     * different ImageRange than is being shown, remember the new range.  If this 
+     * new range was not detected during the last update, reset the change 
+     * counter to 0.  If this range was detected during the last update, 
+     * increment the change counter.  If the change counter is greater than
+     * the tolerance value specified, set the current range to the new range, 
+     * reset the change counter, and set the updated flag to true.  If the range
+     * has been updated, and an incident is not being shown, return true.  Else
+     * return false.
+     *
+     * @param newSpeed New traffic speed for this Image's camera location.
+     * @return True if a new ImageRange is to be shown, false if not.
+     */
+    public boolean updateImage(float newSpeed) {
+        
+        boolean updated    = false;
+        ImageRange newRange = null;
+        
+        for(ImageRange range : ranges) {
+            if(range.isWithin(newSpeed)) {
+                if(currentRange == null || !currentRange.equals(range)) {
+                    newRange = range;
+                    break;
+                }
+            }
+        }
+        
+        if(newRange == null) {
+            //do nothing
+        }
+        else if(changeRange == null || !changeRange.equals(newRange)) {
+            changeRange = newRange;
+            changeRangeCounter = 0;
+        }
+        else {
+            changeRangeCounter++;
+        }
+        
+        if(changeRangeCounter >= CHANGE_TOLERANCE) {
+            changeRangeCounter = 0;
+            currentRange       = changeRange;
+            updated            = true;
+        }
+        
+        
+        //even if the currentRange is updated, an incident trumps this
+        return updated & !isShowingIncident;
+    }
+    
+    /**
+     * This method shows a new image.  If the Image Controller is showing an incident,
+     * then the incident image will be shown.  Else, if an Image range has been found, 
+     * then it's image will be shown.  Image control is done through the ATMSCommunicator
+     * singleton instance.
+     *
+     * @throws Exception if the method is not able to play the current title.
+     */
+    public void showCurrentImage() throws Exception {
+        //TODO  THIS IS HACK??!!
+        if (isShowingIncident) {
+            theATMSManager.showImage(atms_cctv_id, currentIncident.fileName);
+        } else if (currentRange != null) {
+            theATMSManager.showImage(atms_cctv_id, currentRange.fileName);
+        }
+    }
+
+
+}
Index: trunk/src/tmcsim/cadsimulator/managers/SimulationControlManager.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/managers/SimulationControlManager.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/managers/SimulationControlManager.java	(revision 2)
@@ -0,0 +1,90 @@
+package tmcsim.cadsimulator.managers;
+
+import java.rmi.RemoteException;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import tmcsim.cadsimulator.Coordinator;
+import tmcsim.common.CADEnums.SCRIPT_STATUS;
+
+public class SimulationControlManager  {
+
+    /** 
+     * 
+     */
+    private class ClockTask extends TimerTask {     
+        public void run() {
+            currentSimTime++;
+            theCoordinator.tick();
+        }
+    }
+    
+    /** The SimulationTimer used to keep track of simulation time. */
+    private Timer simTimer = null;
+    
+    /**  */
+    private Coordinator theCoordinator;
+    
+        /**
+     * Boolean flag to designate whether the simulation has been started or not.
+     */    
+    private boolean simulationStarted;
+    
+    /**
+     * Object used to count the number of seconds that the simulation has run.
+     * The value is initialized to 0, and is reset to 0 every time a new simulation
+     * is loaded, or the current simulation is stopped and reset.
+     */
+    private long currentSimTime;    
+    
+    
+    public SimulationControlManager(Coordinator coor) {
+        
+        theCoordinator    = coor;       
+        simulationStarted = false;
+        currentSimTime    = 0;    
+    }
+    
+    public boolean simulationStarted() {
+        return simulationStarted;
+    }
+    
+    public long getCurrentSimTime() {
+        return currentSimTime;
+    }
+    
+    public void gotoSimulationTime(long newSimTime) {
+        currentSimTime = newSimTime;
+    }
+    
+    public void startSimulation() {
+            
+        simTimer = new Timer();     
+        simTimer.scheduleAtFixedRate(new ClockTask(), 0, 1000);
+        
+        simulationStarted = true;   
+        
+        theCoordinator.setScriptStatus(SCRIPT_STATUS.SCRIPT_RUNNING);
+    }
+    
+    public void pauseSimulation() {  
+        
+        if(simTimer != null)
+            simTimer.cancel();          
+            
+        simulationStarted = false;              
+        
+        theCoordinator.setScriptStatus(SCRIPT_STATUS.SCRIPT_PAUSED_STARTED);
+    }
+    
+    public void resetSimulation() throws RemoteException {      
+        
+        if(simTimer != null)
+            simTimer.cancel(); 
+         
+        currentSimTime = 0;              
+        
+        theCoordinator.setScriptStatus(SCRIPT_STATUS.SCRIPT_STOPPED_NOT_STARTED);
+    }
+    
+}
Index: trunk/src/tmcsim/cadsimulator/managers/IncidentManager.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/managers/IncidentManager.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/managers/IncidentManager.java	(revision 2)
@@ -0,0 +1,409 @@
+package tmcsim.cadsimulator.managers;
+
+import java.util.TreeMap;
+import java.util.Vector;
+
+import tmcsim.cadmodels.IncidentBoardModel_obj;
+import tmcsim.cadmodels.IncidentInquiryModel_obj;
+import tmcsim.cadmodels.IncidentSummaryModel_obj;
+import tmcsim.cadsimulator.CADSimulator;
+import tmcsim.cadsimulator.Coordinator;
+import tmcsim.cadsimulator.SoundPlayer;
+import tmcsim.client.cadclientgui.data.Incident;
+import tmcsim.client.cadclientgui.data.IncidentEvent;
+import tmcsim.common.ScriptException;
+
+/**
+ * IncidentManager is a CAD Simulator Manager containing the Incident data 
+ * that has been loaded and occured during the simulation.  The IncidentManager
+ * is used to load, remove, trigger, and reschedule Incidents in the simulation.  
+ * Methods are provided to clear all Incident data from the simulation and to reset
+ * the Incidents to begin a new simulation.  The IncidentBoard, IncidentInquiry, 
+ * IncidentSummary, and IncidentEvent object lists are viewable through accessor methods.
+ * The tick() method is called when the simulation time changes.  This method will then
+ * update all loaded Incidents. Any events that occur will be enqueued on the SoundPlayer.
+ * Any events that have completed are updated into the simulation data.  The Coordinator
+ * is notified when an Incident starts or is updated.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public class IncidentManager {
+    
+    /** Reference to the Coordinator Object. */
+    private Coordinator theCoordinator;
+
+    /** Reference to the SoundPlayer Object. */
+    private SoundPlayer theSoundPlayer;
+    
+    /**
+     * Synchronization lock object used to avoid race conditions in accessing the
+     * incidentList Vector.
+     */
+    private Object lock = new Object();    
+    
+    /**
+     * Map containing a vector of IncidentEvent objects(values) that have 
+     * completed for each Incident log number(key).
+     */
+    private TreeMap<Integer, Vector<IncidentEvent>> completedEvents;       
+    
+    /**
+     * Vector of Incident objects that exist in the simulation.
+     */     
+    private Vector<Incident> incidentList;    
+    
+    /**
+     * Vector of IncidentBoardModel_obj objects containing the data for
+     * incident board messages.
+     */
+    private Vector<IncidentBoardModel_obj> IncidentBoardModelObjects;
+
+    /**
+     * Vector of IncidentInquiryModel_obj objects containing the data
+     * for incident inquiry requests.
+     */    
+    private Vector<IncidentInquiryModel_obj> IncidentInquiryModelObjects;
+
+    /**
+     * Vector of IncidentSummaryModel_obj objects containing the data 
+     * for incident summary requests.
+     */    
+    private Vector<IncidentSummaryModel_obj> IncidentSummaryModelObjects;
+    
+    /** Boolean flag to designate whether incidents are loaded. */
+    private boolean incidentsLoaded;
+    
+    
+    /**
+     * Constructor. Initialize data members.
+     * 
+     * @param coor Coordinator Object.
+     * @param soundPlayer SoundPlayer Object.
+     */
+    public IncidentManager(Coordinator coor, SoundPlayer soundPlayer) {
+        theCoordinator = coor;
+        theSoundPlayer = soundPlayer;
+        
+        incidentList                = new Vector<Incident>();
+        completedEvents             = new TreeMap<Integer, Vector<IncidentEvent>>();    
+        IncidentBoardModelObjects   = new Vector<IncidentBoardModel_obj>();
+        IncidentInquiryModelObjects = new Vector<IncidentInquiryModel_obj>();
+        IncidentSummaryModelObjects = new Vector<IncidentSummaryModel_obj>();
+        
+        incidentsLoaded = false;
+    }
+    
+    /**
+     * Returns whether Incidents have been loaded into the simulation.
+     * @return true if incidents are loaded, false if not.
+     */
+    public boolean areIncidentsLoaded() {
+        return incidentsLoaded;
+    }
+    
+    /**
+     * Clears IncidentBoard, IncidentInquiry, and IncidentSummary
+     * lists.  The IncidentEvent list is also cleared.  All
+     * Incidents are removed from the simulation and the 
+     * incidentsLoaded flag is reset to false.
+     */
+    public void clearIncidents() {
+        IncidentBoardModelObjects.clear();
+        IncidentInquiryModelObjects.clear();
+        IncidentSummaryModelObjects.clear();    
+        
+        incidentList.clear();
+            
+        completedEvents.clear();   
+
+        incidentsLoaded = false;
+    }
+    
+    /**
+     * Clears IncidentBoard, IncidentInquiry, and IncidentSummary
+     * lists.  The IncidentEvent list is also cleared.  All
+     * Incidents are reset, but not removed from the simulation.  The 
+     * incidentsLoaded flag is not changed.
+     */
+    public void resetIncidents() {
+        IncidentBoardModelObjects.clear();
+        IncidentInquiryModelObjects.clear();
+        IncidentSummaryModelObjects.clear();    
+        
+        for(Incident inc : incidentList) {
+            inc.resetSimulation();
+        }
+        
+        completedEvents.clear();        
+    }
+    
+    /**
+     * This method removes an Incident from the list of Incidents that
+     * have been loaded into the simulation.  The incidentsLoaded flag
+     * is updated accordingly to whether there are Incidents remaining.
+     * 
+     * @param incidentNumber Log number of Incident to remove.
+     * @throws ScriptException if the Incident has already occured.
+     */
+    public void deleteIncident(Integer incidentNumber) throws ScriptException {
+
+        synchronized (lock) {
+            Vector<Incident> incToRemove = new Vector<Incident>();
+
+            for (Incident inc : incidentList) {
+
+                if (inc.getLogNumber().compareTo(incidentNumber) == 0) {
+                    if (inc.hasOccured())
+                        throw new ScriptException(
+                                ScriptException.INCIDENT_ALREADY_STARTED);
+
+                    incToRemove.add(inc);
+                }
+            }
+
+            for (Incident inc : incToRemove)
+                incidentList.remove(inc);
+        }
+
+        incidentsLoaded = incidentList.size() > 0;
+    }
+
+    /**
+     * This method reschedules a loaded Incident to occur at a new simulation 
+     * time.
+     * 
+     * @param incidentNumber Log number of Incident to remove.
+     * @param newTime New simulation time for Incident to occur.
+     * @throws ScriptException if the Incident has already occured.
+     */
+    public void rescheduleIncident(Integer incidentNumber, long newTime)
+            throws ScriptException {
+
+        synchronized (lock) {
+
+            for (Incident inc : incidentList) {
+
+                if (inc.getLogNumber().equals(incidentNumber)) {
+                    if (inc.hasOccured()) {
+                        throw new ScriptException(
+                                ScriptException.INCIDENT_ALREADY_STARTED);
+                    }
+                    inc.setSecondsToStart(newTime);
+                }
+            }
+        }
+    }
+
+    /**
+     * This method adds a new Incident to the simulation.  The incidentsLoaded
+     * flag is set to true.
+     * 
+     * @param newIncident New Incident.
+     */
+    public void addIncident(Incident newIncident) {
+
+        synchronized (lock) {
+            incidentList.add(newIncident);
+            incidentsLoaded = true;
+        }
+    }
+
+    /**
+     * This method adds a list of new Incidents to the simulation.  The 
+     * incidentsLoaded flag is set to true.
+     * 
+     * @param newIncident New Incident.
+     */
+    public void addIncidents(Vector<Incident> vector) {
+
+        synchronized (lock) {
+            incidentList.addAll(vector);
+            incidentsLoaded = true;
+        }
+    }
+    
+    /**
+     * This method calls the tick() method on all loaded Incidents.  If the 
+     * clock tick causes IncidentEvents to be triggered, the events are 
+     * enqueued in the SoundPlayer.  If any IncidentEvents have completed,
+     * they are finalized with the current simulation and CAD time.  The local
+     * IncidentInquiry and IncidentSummary lists are updated with the completed
+     * IncidentEvent Objects and then the Coordinator is notified with the
+     * IncidentEvent.  
+     * 
+     * @param currentSimTime Current simulation time (in seconds).
+     */
+    public void tick(long currentSimTime) {
+        
+        for(Incident inc : incidentList) {
+
+            inc.tick(currentSimTime);
+            
+            //For all events that occur with this tick, enqueue them in the sound player.
+            for(IncidentEvent event : inc.getTriggeredEvents(currentSimTime)) {
+                theSoundPlayer.enqueueClip(event);   
+            }                   
+                
+            for(IncidentEvent event : inc.getCompletedEvents()) {
+                event.finalizeEvent(currentSimTime, CADSimulator.getCADTime());
+                updateIncident(inc.getLogNumber(), event);
+                theCoordinator.updateIncidentInGUI(inc.getLogNumber(), event);
+            }                       
+        }       
+    }
+    
+    /**
+     * This method forces an Incident to trigger.  If the Incident corresponding
+     * to the parameter log number has not occured it is manually triggered.
+     * 
+     * @param incidentNumber Log number of Incident to trigger.
+     * @param currentSimTime Current simulation time (in seconds).
+     */
+    public void triggerIncident(Integer incidentNumber, Long currentSimTime) {
+
+        for(Incident inc : incidentList) {
+            
+            if(inc.getLogNumber().equals(incidentNumber) 
+                && !inc.hasOccured()) {                                         
+
+                inc.manualTrigger(currentSimTime);
+            }   
+        }
+
+    }
+
+    /**
+     * This method updates the completed events, IncidentInquiry, and 
+     * IncidentSummary lists with the completed IncidentEvent Object.
+     * If the IncidentEvent is the first event in an Incident,
+     * notify the Coordinator that the Incident has started.
+     * Regardles of whether the IncidentEvent is first or not,
+     * notify the Coordinator that the Incident has been updated.
+     * 
+     * @param incidentNumber Log number of Incident to trigger.
+     * @param triggeredEvent Completed IncidentEvent.
+     */
+    public void updateIncident(Integer incidentNumber, IncidentEvent completedEvent) {
+
+        IncidentInquiryModel_obj targetIncident = null;
+        
+        if(completedEvents.containsKey(incidentNumber)) {
+            completedEvents.get(incidentNumber).add(completedEvent);
+        }
+        else {
+            Vector<IncidentEvent> temp = new Vector<IncidentEvent>();
+            temp.add(completedEvent);
+            
+            completedEvents.put(incidentNumber, temp);
+        }
+        
+        for(IncidentInquiryModel_obj iimo : IncidentInquiryModelObjects) {
+
+            if(iimo.getLogNumber().compareTo(incidentNumber) == 0) {
+                targetIncident = iimo;
+                
+                targetIncident.update(completedEvent.eventInfo);                
+                break;
+            }
+        }
+        
+        if(targetIncident == null) {
+            completedEvent.eventInfo.getHeader().logStatus    = "A";             
+            completedEvent.eventInfo.getHeader().incidentDate = CADSimulator.getCADDate().substring(0,4);  
+            completedEvent.eventInfo.getHeader().incidentTime = CADSimulator.getCADTime();
+            
+            targetIncident = new IncidentInquiryModel_obj(completedEvent.eventInfo);
+            IncidentInquiryModelObjects.add(targetIncident);    
+            IncidentSummaryModelObjects.add(new IncidentSummaryModel_obj(completedEvent.eventInfo.getHeader()));    
+            
+            theCoordinator.incidentStarted(completedEvent);     
+        }           
+            
+        theCoordinator.incidentUpdated(completedEvent);         
+    }
+    
+    /**
+     * Returns whether an Incident exists in the simulation with a log number
+     * that matches the parameter value.
+     * 
+     * @param incidentNumber Log number of Incident to trigger.
+     * @return true if Incident exists, false if not.
+     */
+    public boolean incidentExists(Integer incidentNumber) {
+        boolean found = false;
+        
+        for(IncidentInquiryModel_obj iimo : IncidentInquiryModelObjects) {
+            if(iimo.getLogNumber().compareTo(incidentNumber) == 0) {
+                found = true;
+                break;
+            }           
+        }
+
+        return found;
+    }
+    
+    /**
+     * Returns the Vector of Incidents loaded into the simulation.
+     * @return Vector of loaded Incidents.
+     */
+    public Vector<Incident> getIncidentList() {
+        return incidentList;
+    }
+    
+    /**
+     * Returns the map of triggered IncidentEvents referenced by eac
+     * Incident log number.
+     * 
+     * @return Map of triggered IncidentEvents for all Incidents.
+     */
+    public TreeMap<Integer, Vector<IncidentEvent>> getTriggeredEvents() {
+        return completedEvents;
+    }   
+    
+    /**
+     * Returns the list of all IncidentBoardModel_obj objects. 
+     *
+     * @returns A Vector of all IncidentBoardModel_obj objects.
+     */
+    public Vector<IncidentBoardModel_obj> getIncidentBoardModelObjects() {
+        return IncidentBoardModelObjects;               
+    }       
+    
+    /**
+     * Returns a list of all IncidentInquiryModel_obj objects that match the parameter
+     * Incident log number.
+     *
+     * @param logNumber The log number to get all incident inquiry data for.
+     * @returns A Vector of IncidentInquiryModel_obj objects.
+     */    
+    public Vector<IncidentInquiryModel_obj> getIncidentInquiryModelObjects(Integer logNumber) {
+        Vector<IncidentInquiryModel_obj> modelObjs = new Vector<IncidentInquiryModel_obj>();
+
+        synchronized(lock) {
+            
+            for(IncidentInquiryModel_obj iimo : IncidentInquiryModelObjects) {
+                
+                //Find the model object in the private vector of incidents that matches
+                //the incident in the parameter's model.
+                
+                if(iimo.getLogNumber().compareTo(logNumber) == 0) {
+                    modelObjs.add(iimo);
+                }
+            }    
+        }
+        
+
+        return modelObjs;
+    }    
+    
+    /**
+     * Returns the list of all IncidentSummaryModel_obj objects. 
+     *
+     * @returns A Vector of all IncidentSummaryModel_obj objects.
+     */
+    public Vector<IncidentSummaryModel_obj> getIncidentSummaryModelObjects() {
+        return IncidentSummaryModelObjects;
+    }      
+    
+}
Index: trunk/src/tmcsim/cadsimulator/managers/MediaManager.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/managers/MediaManager.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/managers/MediaManager.java	(revision 2)
@@ -0,0 +1,293 @@
+package tmcsim.cadsimulator.managers;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Observable;
+import java.util.Observer;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.JOptionPane;
+import javax.swing.JWindow;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import tmcsim.cadsimulator.db.DVDPlayerDB;
+import tmcsim.cadsimulator.db.StillImagesDB;
+import tmcsim.cadsimulator.stillimagecontrol.ImageController;
+import tmcsim.cadsimulator.videocontrol.DVDController;
+import tmcsim.cadsimulator.videocontrol.DVDStatusUpdate;
+import tmcsim.cadsimulator.videocontrol.DVDTitleUpdate;
+import tmcsim.cadsimulator.viewer.CADSimulatorViewer;
+import tmcsim.common.CCTVDirections;
+import tmcsim.common.CCTVInfo;
+
+/**
+ * MediaManager manages the control of media associated with the speed 
+ * information received from the ParamicsCommunicator.  The MediaManager
+ * instantiates the DVDPlayerDB and StillImageDB objects, which are initialized
+ * from XML data files to hold the information regarding which DVD titles and 
+ * Still Images are available for display.  Each title or image is associated
+ * with a specific speed range or Incident log number.  The triggerIncident()
+ * method is called to notify the MediaManager that incident media is to be 
+ * displayed.  The updateCameraInfo() method is called when speed information
+ * is received for a specific camera.  In both methods, a Controller object
+ * is found for the unique camera ID number.  This Controller is updated with
+ * the new speed data.  If the update causes a change in media to be displayed,
+ * the change is made.<br>
+ * <br>
+ * The MediaManager implements the Observer interface and observes the 
+ * DVDPlayerDB and StillImageDB for updates.  These updates are received, action
+ * is taken, and then the update is passed to the CADSimulatorViewer for display.
+ * 
+ * @see tmcsim.cadsimulator.viewer.CADSimulatorViewer
+ * @author Matthew Cechini
+ * @version
+ */
+public class MediaManager implements Observer {
+
+    /**  Error Logger. */
+    private static Logger mediaLogger = Logger.getLogger("tmcsim.simulator");
+    
+    /**
+     * Enumeration of property names.
+     * @author Matthew Cechini
+     */ 
+    private static enum MEDIA_PROPERTIES {
+        /** Filepath for xml file containing dvd control data. */
+        DVD_XML_FILE   ("DVDPlayerXML"),    
+        /** Filepath for xml file containing still image control data. */
+        IMAGE_XML_FILE ("StillImagesXML");
+        
+        public String name;
+        
+        private MEDIA_PROPERTIES(String n) {
+            name = n;
+        }
+    };  
+    
+    /** Instance of the DVD Player Database. */
+    private DVDPlayerDB theDVD_DB     = null;
+
+    /** Instance of the Still Image Database. */
+    private StillImagesDB theImage_DB = null;
+    
+    /** Reference to the CADSimulatorViewer. */
+    private CADSimulatorViewer theViewer;
+
+    /** Properties object for the Media portion of the CAD. */
+    private Properties mediaProperties;
+    
+    
+    /**
+     * Constructor. The target properties file is loaded and the DVD and Still
+     * Image DB objects are initialized with the XML data files containing 
+     * the respective data.
+     * 
+     * @param propertiesFile File path for target properties file. 
+     * @param theATMSManager ATMSManager object.
+     * @param viewer CADSimulatorViewer object.
+     */
+    public MediaManager(String propertiesFile, ATMSManager theATMSManager, 
+            CADSimulatorViewer viewer) {
+        theDVD_DB   = new DVDPlayerDB();        
+        theImage_DB = new StillImagesDB();
+        
+        theViewer = viewer;
+
+        try {
+            mediaProperties = new Properties();
+            mediaProperties.load(new FileInputStream(new File(propertiesFile)));
+        }
+        catch (Exception e) {
+            mediaLogger.logp(Level.SEVERE, "MediaManager", "Constructor",
+                    "Exception in loading properties file.", e);
+        }
+        
+        // Load DVD Player Information from the XML file
+        try {
+            if (mediaProperties.getProperty(MEDIA_PROPERTIES.DVD_XML_FILE.name) != null) {
+                theDVD_DB.addObserver(this);
+                theDVD_DB.loadFromXML(DocumentBuilderFactory
+                                .newInstance().newDocumentBuilder()
+                                .parse(new File(mediaProperties.getProperty(
+                                        MEDIA_PROPERTIES.DVD_XML_FILE.name))));
+
+            }
+        } catch (Exception e) {
+            mediaLogger.logp(Level.SEVERE, "MediaManager", "Constructor",
+                    "Exception in parsing DVDPlayer xml file.", e);
+            
+             JOptionPane.showMessageDialog(new JWindow(), "An error occured " +
+                    "opening and parsing the DVD xml data file: " +
+                    mediaProperties.getProperty(MEDIA_PROPERTIES.DVD_XML_FILE.name),
+                    "Initialization Error", JOptionPane.WARNING_MESSAGE);
+        }
+
+        // Load Still Image Information from the XML file
+        try {
+            if (mediaProperties
+                    .getProperty(MEDIA_PROPERTIES.IMAGE_XML_FILE.name) != null) {
+                theImage_DB.addObserver(this);
+                theImage_DB.loadFromXML(DocumentBuilderFactory
+                                .newInstance().newDocumentBuilder()
+                                .parse(new File(mediaProperties.getProperty(
+                                        MEDIA_PROPERTIES.IMAGE_XML_FILE.name))),
+                                        theATMSManager);
+            }
+        } catch (Exception e) {
+            mediaLogger.logp(Level.SEVERE, "MediaManager", "Constructor",
+                    "Exception in parsing StillImages xml file.", e);
+            
+             JOptionPane.showMessageDialog(new JWindow(), "An error occured " +
+                    "opening and parsing the Image xml data file: " +
+                    mediaProperties.getProperty(MEDIA_PROPERTIES.IMAGE_XML_FILE.name),
+                    "Initialization Error", JOptionPane.WARNING_MESSAGE);
+        }           
+    }
+    
+    /**
+     * Observer method.  The update objects accepted and their associated 
+     * actions are shown below.<br>
+     * <br>
+     * <ul>
+     * <li>DVDStatusUpdate - If the update contains an exception, log the 
+     *     exception to the local logger.  The update object is then sent
+     *     to the CADSimulatorViewer for display.</li>
+     * <li>DVDTitleUpdate - The update object is sent
+     *     to the CADSimulatorViewer for display.</li>
+     * </ul>
+     */
+    public void update(Observable o, Object arg) {
+        if(arg instanceof DVDStatusUpdate) {
+            if(((DVDStatusUpdate)arg).exception != null) {
+                mediaLogger.logp(Level.SEVERE, "MediaManager", "update",
+                        "Exception from DVD Controller.", 
+                        ((DVDStatusUpdate)arg).exception);
+            }
+            theViewer.updateDVDStatus((DVDStatusUpdate)arg);
+        }
+        else if(arg instanceof DVDTitleUpdate) {
+            theViewer.updateDVDTitle((DVDTitleUpdate)arg);
+        }
+    }
+
+    /**
+     * This method triggers the DVD and Image Controllers for a specific camera
+     * to display an Incident title or image for the parameter Incident log
+     * number.
+     * 
+     * @param info Information of the CCTV Camera to display incident images.
+     * @param logNumber Log number of the Incident being triggered.
+     */
+    public void triggerIncident(CCTVInfo info, Integer logNumber) {
+        try {
+            DVDController dvdCntrl = theDVD_DB.getController(info.cctv_id, 
+                    info.direction);
+            
+            if(dvdCntrl != null) {  
+                dvdCntrl.toggleIncident(logNumber, info.toggle);
+            }
+        } catch (Exception e) {
+            mediaLogger.logp(Level.SEVERE, "MediaManager", "triggerIncident",
+                    "Exception in toggling an incident on the DVD controller.", e);
+        }
+        
+        try {
+            ImageController imageCntrl = theImage_DB.getController(info.cctv_id, info.direction);
+            
+            if(imageCntrl != null) { 
+                imageCntrl.toggleIncident(logNumber, info.toggle);
+            }
+        } catch (Exception e) {
+            mediaLogger.logp(Level.SEVERE, "MediaManager", "triggerIncident",
+                    "Exception in toggling an incident on the Image controller.", e);
+        }
+        
+    }
+    
+    /**
+     * This method receives updated speed information for a specific controller
+     * and updates the DVD Title and Still Image being currently displayed for 
+     * that camera.
+     * 
+     * @param cameraID CCTV camera ID
+     * @param avgSpeed_NE Average speed of traffic flowing N or E
+     * @param avgSpeed_SW Average speed of traffic flowing S or W
+     */
+    public void updateCameraInfo(Integer cameraID, float avgSpeed_NE, float avgSpeed_SW) {
+        updateDVD(cameraID, avgSpeed_NE, avgSpeed_SW);
+        updateStillImage(cameraID, avgSpeed_NE, avgSpeed_SW);
+    }
+    
+    /**
+     * This method accepts updated speed information for a specific DVD 
+     * player. The DVDController object corresponding to the parameter camera 
+     * ID is found and updated with the new speed.  If this update causes the 
+     * dvd controller to change titles, the new title is played.
+     *
+     * @param cameraID CCTV camera ID
+     * @param avgSpeed_NE Average speed of traffic flowing N or E
+     * @param avgSpeed_SW Average speed of traffic flowing S or W
+     */
+    protected void updateDVD(Integer cameraID, float avgSpeed_NE, float avgSpeed_SW) {
+            
+        for(CCTVDirections dir : CCTVDirections.values()) {
+            DVDController dvdCntrl = theDVD_DB.getController(cameraID, dir);
+            
+            //if Controller exists, update.
+            if(dvdCntrl != null) {                          
+                
+                if( ((dir == CCTVDirections.NORTH || dir == CCTVDirections.EAST) && 
+                     (dvdCntrl.updatePlayer(avgSpeed_NE)))  ||
+                    ((dir == CCTVDirections.SOUTH || dir == CCTVDirections.WEST) && 
+                     (dvdCntrl.updatePlayer(avgSpeed_SW)))) {
+                    
+                    try {
+                        dvdCntrl.playCurrentTitle();
+                    }
+                    catch (Exception e) {
+                        mediaLogger.logp(Level.SEVERE, "ParamicsCameraStatusReader", "updateDVD",
+                                "Exception in updating DVD player with new speed.", e);
+                    }
+                }           
+            }
+        }   
+    }
+
+    /** 
+     * This method accepts updated speed information for a specific CCTV camera.
+     * The ImageController object corresponding to the parameter camera ID
+     * is found and updated with the new speed.  If this update causes the image
+     * controller to change images, the new image is shown.
+     * 
+     * @param cameraID Unique CCTV camera ID
+     * @param avgSpeed_NE Average speed of traffic flowing N or E
+     * @param avgSpeed_SW Average speed of traffic flowing S or W
+     */
+    protected void updateStillImage(Integer cameraID, float avgSpeed_NE, float avgSpeed_SW) {
+        
+        for(CCTVDirections dir : CCTVDirections.values()) {
+            ImageController imageCntrl = theImage_DB.getController(cameraID, dir);
+            
+            //if Controller exists, update.
+            if(imageCntrl != null) {
+            
+                if( ((dir == CCTVDirections.NORTH || dir == CCTVDirections.EAST) && 
+                     (imageCntrl.updateImage(avgSpeed_NE)))  ||
+                    ((dir == CCTVDirections.SOUTH || dir == CCTVDirections.WEST) && 
+                     (imageCntrl.updateImage(avgSpeed_SW)))) {
+                    
+                    try {
+                        imageCntrl.showCurrentImage();
+                    }
+                    catch (Exception e) {
+                        mediaLogger.logp(Level.SEVERE, "ParamicsCameraStatusReader", "updateStillImage",
+                                "Exception in updating image controller with new speed.", e);
+                    }
+                }
+            }           
+        }       
+    }
+    
+}
Index: trunk/src/tmcsim/cadsimulator/managers/ATMSManager.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/managers/ATMSManager.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/managers/ATMSManager.java	(revision 2)
@@ -0,0 +1,107 @@
+package tmcsim.cadsimulator.managers;
+
+import java.io.FileInputStream;
+import java.rmi.RemoteException;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import tmcsim.cadsimulator.stillimagecontrol.ATMSCommunicator;
+
+/**
+ * ATMSManager is a CAD Simulator Manager used to handle all
+ * communication between the CAD Simulator and the ATMS server.
+ * Upon construction, the ATMSCommunicator is initialized with 
+ * information from the properties file.  This Object is used 
+ * to perform the specific communication functions to send and 
+ * receive data to/from the ATMS server.  Methods in this 
+ * Manager allow for the current ATMS server time to be queried
+ * and still images to be updated for display to ATMS clients.  
+ * 
+ * @author Matthew Cechini
+ * @version 
+ */
+public class ATMSManager {
+
+    /** Error Logger. */
+    private static Logger atmsLogger = Logger.getLogger("tmcsim.cadsimulator.managers"); 
+    
+    /**
+     * Enumeration containing property names for Properties parsing.
+     * @author Matthew Cechini
+     */
+    private static enum ATMS_PROPERTIES {
+        /**  */
+        ATMS_HOST ("ATMSHost"), 
+        /**  */
+        USERNAME  ("Username"), 
+        /**  */
+        PASSWORD  ("Password"), 
+        /**  */
+        IMAGE_DIR ("ImageDir");
+
+        public String name;
+        
+        private ATMS_PROPERTIES(String n) {
+            name = n;
+        }
+    };  
+    
+    /** ATMSCommunicator Object used for communication to the ATMS server. */
+    private ATMSCommunicator theATMSCommunicator;
+    
+    /** Properties Object. */
+    private Properties atmsProperties = null;
+    
+    
+    /**
+     * Constructor.  Loads the Properties file and initializes the 
+     * ATMSCommunicator with the parsed data.
+     * 
+     * @param propertiesFile Target file path of properties file.
+     */
+    public ATMSManager(String propertiesFile) {
+        
+        try {
+            atmsProperties = new Properties();
+            atmsProperties.load(new FileInputStream(propertiesFile));
+            
+            theATMSCommunicator = new ATMSCommunicator(
+                    atmsProperties.getProperty(ATMS_PROPERTIES.ATMS_HOST.name),
+                    atmsProperties.getProperty(ATMS_PROPERTIES.USERNAME.name),
+                    atmsProperties.getProperty(ATMS_PROPERTIES.PASSWORD.name),
+                    atmsProperties.getProperty(ATMS_PROPERTIES.IMAGE_DIR.name));
+            
+        }
+        catch (Exception e) {
+            atmsLogger.logp(Level.SEVERE, "ATMSManager", "Constructor",
+                    "Exception in parsing properties file.", e);
+        } 
+    }
+    
+
+    /**
+     * Returns the current ATMS server time as the number of seconds since Jan 1, 1970.
+     * 
+     * @return Current time in seconds.
+     * @throws Exception if an exception occurs communicating to the ATMS server.
+     */
+    public long getCurrentTime() throws Exception {
+        return theATMSCommunicator.getCurrentTime();
+    }
+
+    /**
+     * Show a new image for an ATMS camera.  The ATMS camera files are named
+     * <ATMS_Camera_ID>.xpm.  If a camera file exists, delete it.  Then copy
+     * the parameter file name to <ATMS_Camera_ID>.xpm.  If the camera ID or 
+     * new file does not exist, throw an exception.     
+     * 
+     * @param ATMS_cameraID ATMS indexed camera ID.
+     * @param fileName Filename to show.
+     * @throws RemoteException if an exception occurs communicating to the ATMS server.
+     */
+    public void showImage(Integer ATMS_cameraID, String fileName) throws RemoteException {
+        theATMSCommunicator.showImage(ATMS_cameraID, fileName);
+    }
+    
+}
Index: trunk/src/tmcsim/cadsimulator/managers/ParamicsSimulationManager.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/managers/ParamicsSimulationManager.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/managers/ParamicsSimulationManager.java	(revision 2)
@@ -0,0 +1,294 @@
+package tmcsim.cadsimulator.managers;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import tmcsim.cadmodels.CMSInfo;
+import tmcsim.cadsimulator.Coordinator;
+import tmcsim.cadsimulator.paramicscontrol.ParamicsCameraStatusReader;
+import tmcsim.cadsimulator.paramicscontrol.ParamicsCommunicator;
+import tmcsim.cadsimulator.paramicscontrol.ParamicsIncidentWriter;
+import tmcsim.cadsimulator.paramicscontrol.ParamicsStatusReader;
+import tmcsim.common.SimulationException;
+import tmcsim.common.XMLIncident;
+import tmcsim.common.CADEnums.PARAMICS_STATUS;
+
+/**
+ * ParamicsSimulationManager is a CAD Simulator Manager used to handle all
+ * communication between the CAD Simulator and the remote ParamicsCommunicator.
+ * Upon construction all ParamicsReaders and ParamicsWriters are initialized
+ * with data parsed from the Properties file. When a connection is established
+ * the ParamicsStatusReader is registered to read Paramics Status updates.  
+ * These updates are received through the updateParamicsStatus() method, which 
+ * notifies the Coordinator of the new status.  The loadParamicsNetwork() must 
+ * be called to register the ParamicsIncidentWriter which will write the
+ * information to cause Paramics to begin loading a traffic network.  When the
+ * status becomes LOADED, the ParamicsCameraStatusReader is registered and
+ * begins reading.  All camera speed updates are received through the
+ * updateCameraInfo() method.  The startSimulation(), resetSimulation(), and 
+ * sendIncidentUpdate() methods are used to control the flow of Incident 
+ * update information to Paramics.  The updateIncident() and updateDiversion() 
+ * methods are used to update the information that is sent to Paramics.
+ *  
+ *      
+ * @see PARAMICS_STATUS
+ * @author Matthew Cechini
+ * @version
+ */
+public class ParamicsSimulationManager {
+
+    /**  Error logger.  */
+    private static Logger paramLogger = Logger.getLogger("tmcsim.cadsimulator.paramicscontrol");
+    
+    /**
+     * Enumeration containing property names for Properties parsing.
+     * @author Matthew Cechini
+     */
+    private static enum PROPERTIES {
+        PARAMICS_HOST        ("ParamicsCommHost"),
+        PARAMICS_PORT        ("ParamicsCommPort"),
+        INCIDENT_UPDATE_INT  ("IncidentUpdateInterval"),
+        INCIDENT_UPDATE_FILE ("IncidentUpdateFile"),
+        PARAMICS_STATUS_INT  ("ParamicsStatusInterval"),
+        PARAMICS_STATUS_FILE ("ParamicsStatusFile"),
+        CAMERA_STATUS_INT    ("CameraStatusInterval"),
+        CAMERA_STATUS_FILE   ("CameraStatusFile");
+        
+        String name;
+        
+        private PROPERTIES(String n) {
+            name = n;
+        }
+    };
+    
+    /** ParamicsCommunicator Object used for communication. */
+    private ParamicsCommunicator theCommunicator;
+
+    /** Reference to the Coordinator Object. */
+    private Coordinator theCoordinator;
+
+    /** Reference to the MediaManager Object. */
+    private MediaManager theMediaMgr;
+    
+    /** ParamicsIncidentWriter used to send incident updates to Paramics. */
+    private ParamicsIncidentWriter paramicsIncidentWriter;    
+    
+    /** ParamicsStatusReader used to read status information from Paramics. */
+    private ParamicsStatusReader paramicsStatusReader;
+    
+    /** ParamicsCameraStatusReader used to read speed information from Paramics. */
+    private ParamicsCameraStatusReader paramicsCameraStatusReader;
+
+    /** Properties file. */
+    private Properties paramicsProperties;
+    
+    
+    /**
+     * Constructor.  Loads the Properties file and initializes all Paramics
+     * Writers and Readers with the parsed data.
+     * 
+     * @param propertiesFile Target file path of properties file.
+     * @param coor Coordinator Object.
+     * @param mediaMgr MediaManager Object.
+     */
+    public ParamicsSimulationManager(String propertiesFile, Coordinator coor, MediaManager mediaMgr) {
+        
+        try {
+            paramicsProperties = new Properties();
+            paramicsProperties.load(new FileInputStream(propertiesFile));
+            
+            theCoordinator = coor;
+            theMediaMgr    = mediaMgr;
+                  
+            theCommunicator = new ParamicsCommunicator(this, 
+                    paramicsProperties.getProperty(PROPERTIES.PARAMICS_HOST.name),
+                    Integer.parseInt(paramicsProperties.getProperty(
+                            PROPERTIES.PARAMICS_PORT.name).trim()));
+                    
+            paramicsIncidentWriter = new ParamicsIncidentWriter(Integer.parseInt(
+                    paramicsProperties.getProperty(PROPERTIES.INCIDENT_UPDATE_INT.name).trim()));  
+            paramicsIncidentWriter.writerID   = theCommunicator.nextID();
+            paramicsIncidentWriter.targetFile = paramicsProperties.getProperty(
+                    PROPERTIES.INCIDENT_UPDATE_FILE.name);      
+            
+            paramicsStatusReader = new ParamicsStatusReader(this);
+            paramicsStatusReader.readerID   = theCommunicator.nextID();
+            paramicsStatusReader.interval   = paramicsProperties.getProperty(
+                    PROPERTIES.PARAMICS_STATUS_INT.name).trim();
+            paramicsStatusReader.targetFile = paramicsProperties.getProperty(
+                    PROPERTIES.PARAMICS_STATUS_FILE.name);
+            
+            paramicsCameraStatusReader = new ParamicsCameraStatusReader(this);
+            paramicsCameraStatusReader.readerID   = theCommunicator.nextID();
+            paramicsCameraStatusReader.interval   = paramicsProperties.getProperty(
+                    PROPERTIES.CAMERA_STATUS_INT.name).trim();
+            paramicsCameraStatusReader.targetFile = paramicsProperties.getProperty(
+                    PROPERTIES.CAMERA_STATUS_FILE.name);    
+        }
+        catch (Exception e) {
+            paramLogger.logp(Level.SEVERE, "ParamicsSimulationManager", 
+                    "Constructor", "Exception in parsing properties file.", e);
+        }
+        
+    }
+   
+    /**
+     * Returns whether a connection exists to the remote ParamicsCommunicator.
+     * @return true if a connection exists, false if not.
+     */
+    public boolean isConnected() {
+        return theCommunicator.isConnected();
+    }
+    
+    /**
+     * Returns the integer Network ID that has been loaded into Paramics.
+     * @return Network ID.
+     */
+    public int getParamicsNetworkLoaded() {
+        return paramicsStatusReader.getNetworkID();
+    }
+    
+    /**
+     * Returns the current status of the Paramics traffic modeler.
+     * @return Current PARAMICS_STATUS 
+     */
+    public PARAMICS_STATUS getParamicsStatus() {
+        return paramicsStatusReader.getStatus();
+    }
+    
+    /**
+     * Updates the ParamicsIncidentWriter with new Incident information.
+     * @param xmlInc Updated Incident information.
+     */
+    public void updateIncident(XMLIncident xmlInc) {
+        paramicsIncidentWriter.updateIncident(xmlInc);
+    }
+    
+    /**
+     * Updates the ParamicsIncidentWriter with the new Diversion information.
+     * @param theDiversion Updated diversion information.
+     */
+    public void updateDiversion(CMSInfo theDiversion) {
+        paramicsIncidentWriter.updateDiversion(theDiversion);
+    }
+    
+    /**
+     * Notifies the ParamicsIncidentWriter to start the simulation.
+     */
+    public void startSimulation() {
+        paramicsIncidentWriter.startSimulation();
+    }
+    
+    /**
+     * Notifies the ParamicsIncidentWriter to reset the simulation.
+     */
+    public void resetSimulation() {
+        paramicsIncidentWriter.resetSimulation();
+    }
+
+    /**
+     * Notifies the ParamicsIncidentWriter to send an Incident update.
+     * @param currentSimTime Current simulation time (in seconds).
+     */
+    public void sendIncidentUpdate(long currentSimTime) {
+        paramicsIncidentWriter.sendUpdate(currentSimTime);
+    }
+    
+    /**
+     * Establish a connection to the remote ParamicsCommunicator.  Register
+     * the ParamicsStatusReader and update the current status to CONNECTED.
+     * If an exception occurs in connecting to the ParamicsCommunicator,
+     * update the current status to UNREACHABLE.
+     */
+    public void connectToParamics() {
+        try {           
+            theCommunicator.connect();          
+            theCommunicator.registerReader(paramicsStatusReader);
+            
+            updateParamicsStatus(PARAMICS_STATUS.CONNECTED);
+        }
+        catch (IOException ioe) {
+            paramLogger.logp(Level.SEVERE, "Coordinator", "connectToParamics", 
+                    "Communication error in connecting to Paramics.", ioe);
+
+            updateParamicsStatus(PARAMICS_STATUS.UNREACHABLE);
+        }       
+    }
+
+    /**
+     * Close the connection to the remote ParamicsCommunicator.  Unregister
+     * all Readers and Wrtiers from the ParamicsCommunicator.  Reset the status
+     * information in the ParamicsStatusReader.  Update the current status to 
+     * DISCONNECTED.
+     */
+    public void disconnectFromParamics() { 
+        
+        theCommunicator.disconnect();
+        theCommunicator.unregisterReader(paramicsStatusReader);
+        theCommunicator.unregisterWriter(paramicsIncidentWriter);   
+        theCommunicator.unregisterReader(paramicsCameraStatusReader);
+                    
+        paramicsStatusReader.resetStatusInfo();
+
+        updateParamicsStatus(PARAMICS_STATUS.DISCONNECTED);
+    }
+    
+    /**
+     * Updates the current paramics status.  If the new status is LOADED,
+     * then notify the ParamicsIncidentWriter that the network has been loaded
+     * and register the ParamicsCameraStatusReader with the ParamicsCommunicator.
+     * Notify the Coordinator of all Paramics status updates.
+     *
+     * @param  newStatus New Paramics status.
+     */ 
+    public void updateParamicsStatus(PARAMICS_STATUS newStatus) {
+                        
+        //the network has finished loading
+        if(newStatus == PARAMICS_STATUS.LOADED) {
+        
+            paramicsIncidentWriter.networkLoaded();
+        
+            theCommunicator.registerReader(paramicsCameraStatusReader);                     
+        }
+        else if(newStatus == PARAMICS_STATUS.DROPPED) {
+            paramLogger.logp(Level.WARNING, "Coordinator", "updateParamicsStatus", 
+                    "Connection to Paramics has been dropped.");
+        }
+        
+        theCoordinator.setParamicsStatus(newStatus);        
+
+    } 
+    
+    /**
+     * If a connection has been made, register the ParamicsIncidentWriter
+     * and use it to notify Paramics of the Network ID to load.
+     * 
+     * @param networkID Network ID to load.
+     * @throws SimulationException if a connection has not been made to the 
+     *         remote ParamicsCommunicator.
+     */
+    public void loadParamicsNetwork(int networkID) throws SimulationException {
+            
+        if(theCommunicator.isConnected()) {
+            theCommunicator.registerWriter(paramicsIncidentWriter);
+            paramicsIncidentWriter.loadNetwork(networkID);
+        }
+        else 
+            throw new SimulationException(SimulationException.PARAMICS_NOT_CONNECTED);
+    }
+    
+    /**
+     * Receive updated camera speed information. Notify the MediaManager with 
+     * the updated data. 
+     * 
+     * @param cameraID CCTV camera ID
+     * @param avgSpeed_NE Average speed of traffic flowing N or E
+     * @param avgSpeed_SW Average speed of traffic flowing S or W
+     */
+    public void updateCameraInfo(Integer cameraID, float avgSpeed_NE, float avgSpeed_SW) {
+        theMediaMgr.updateCameraInfo(cameraID, avgSpeed_NE, avgSpeed_SW);
+    }
+}
Index: trunk/src/tmcsim/cadsimulator/CADSimulatorSocketHandler.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/CADSimulatorSocketHandler.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/CADSimulatorSocketHandler.java	(revision 2)
@@ -0,0 +1,87 @@
+package tmcsim.cadsimulator;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.SocketTimeoutException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import tmcsim.common.SimulationException;
+
+
+/**
+ * CADSimulatorSocketHandler is used to accept socket connections from multiple
+ * CAD Clients.  At initialization, this class binds a ServerSocket to a specific
+ * port, passed in as a parameter.  This class is threaded, and when it is 'run',
+ * it begins accepting connections.  When a connection is made, a Socket is created
+ * for data communication with that client and a CADSimulatorClient thread
+ * is spun with connection to that socket.  This thread will continue to accept
+ * clients indefinitely.
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/06 20:46:41 $ $Revision: 1.3 $
+ */
+public class CADSimulatorSocketHandler extends Thread {
+    
+    /** Error logger. */
+    private Logger socketLogger = Logger.getLogger("tmcsim.cadsimulator");
+
+    /** ServerSocket used to accept connections from clients. */
+    private ServerSocket serverSocket;    
+    
+    /**
+     * Constructor.  A ServerSocket is bound to the parameter port number.
+     *
+     * @param port Port number for ServerSocket binding.
+     * @throws SimulationException if an error occurs binding the ServerSocket.
+     */
+    public CADSimulatorSocketHandler(Integer port) throws SimulationException {
+    
+        try {   
+            serverSocket = new ServerSocket(port);
+            serverSocket.setSoTimeout(5000);  //delay for accept timeout(milliseconds)
+        } catch (IOException ioe) { 
+            throw new SimulationException(SimulationException.BINDING, ioe);
+        }
+    }   
+
+    /**
+     * While this thread is not interrupted, connection requests are continuously
+     * accepted from CAD Clients.  When a connection is accepted, a Socket is created,
+     * passed into the CADSimulatorClient's constructor, and then that new 
+     * Client thread is spun off, and the ServerSocket returns to accepting 
+     * more clients.  The CADSimulatorViewer is notified of a successful client
+     * conection after the Socket creating completes.  If there is an error in 
+     * establishing connection to a client, the ServerSocket will continue to 
+     * accept connections.
+     */
+    public void run() { 
+        
+        Socket clientSocket;
+        
+        while (!isInterrupted()) {
+            try 
+            {
+                clientSocket = serverSocket.accept();
+
+                CADSimulatorClient theTMClient = new CADSimulatorClient(clientSocket);
+                theTMClient.start();
+                //CADSimulator.theViewer.connectClient();
+            }     
+            catch(SocketTimeoutException ste) {}
+            catch(Exception e) {
+                socketLogger.logp(Level.SEVERE, "CADSimulatorSocketHandler", "run", 
+                        "Exception in creating a connection to a remote CAD Client.", e);
+            }
+        }
+        
+        try {
+            serverSocket.close();
+        }
+        catch (IOException ioe) {
+            socketLogger.logp(Level.SEVERE, "CADSimulatorSocketHandler", "run", 
+                    "Exception in closing socket.", ioe);
+        }
+    }   
+}
Index: trunk/src/tmcsim/cadsimulator/package.html
===================================================================
--- trunk/src/tmcsim/cadsimulator/package.html	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/package.html	(revision 2)
@@ -0,0 +1,5 @@
+<html>
+  <body>
+  	This package contains the classes for the CAD Simulator
+  </body>
+</html>
Index: trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsWriter.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsWriter.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsWriter.java	(revision 2)
@@ -0,0 +1,69 @@
+package tmcsim.cadsimulator.paramicscontrol;
+
+import java.util.Observable;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import tmcsim.common.CADProtocol.PARAMICS_ACTIONS;
+import tmcsim.common.CADProtocol.PARAMICS_COMM_TAGS;
+
+/**
+ * ParamicsWriter is an abstract class to define objects that may
+ * write data to the Paramics Communicator.  Each ParamicsWriter
+ * is identified by a unique id and has a target file that will be 
+ * written to.  This file may be a file name or relative path, which
+ * will become relative to the target location of the remote Paramics
+ * Communicator.  All implementing Writers call the writeXML() method
+ * to transmit messages to the ParamicsCommunicator.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public abstract class ParamicsWriter extends Observable {
+
+    /** Error Logger. */
+    private static Logger paramLogger = Logger.getLogger("tmcsim.cadsimulator.paramicscontrol");
+    
+    /** Unique identifier for writer. */
+    public String writerID   = null;
+    
+    /** Target file writer will write to. */
+    public String targetFile = null;
+        
+    /**
+     * This method adopts the parameter message data Document into 
+     * a new document that has tags for the writer's id, the action 
+     * (WRITE_FILE) being performed.  This new Document is then sent 
+     * to the observing ParamicsCommunicator for transmission.
+     * 
+     * @param xmlDoc Output Document containing message data.
+     */
+    public void writeXML(Document xmlDoc) {
+        
+        try {
+            Document writerDoc = DocumentBuilderFactory.newInstance()
+                .newDocumentBuilder().newDocument();
+            
+            Element writerElem = writerDoc.createElement(PARAMICS_COMM_TAGS.WRITER.tag);
+            writerElem.setAttribute(PARAMICS_COMM_TAGS.ID.tag, writerID.toString());
+            writerElem.setAttribute(PARAMICS_COMM_TAGS.ACTION.tag,
+                    PARAMICS_ACTIONS.WRITE_FILE.action);
+            
+            writerElem.appendChild(writerDoc.adoptNode(xmlDoc.getDocumentElement()));
+        
+            writerDoc.appendChild(writerElem);      
+                    
+            setChanged();
+            notifyObservers(writerDoc);
+        } catch(Exception e) {
+            paramLogger.logp(Level.SEVERE, "ParamicsWriter", "writeXML", 
+                    "Exception in writing XML for writer " + writerID, e);
+        }
+            
+    };
+}
Index: trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsCameraStatusReader.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsCameraStatusReader.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsCameraStatusReader.java	(revision 2)
@@ -0,0 +1,140 @@
+package tmcsim.cadsimulator.paramicscontrol;
+
+import java.io.ByteArrayInputStream;
+import java.util.logging.Level;
+
+import javax.xml.parsers.SAXParserFactory;
+
+import org.w3c.dom.Node;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import tmcsim.cadsimulator.managers.ParamicsSimulationManager;
+
+
+/**
+ * ParamicsCameraStatusReader extends from the Abstract ParamicsReader to 
+ * provide the methods necessary to read the Paramics Camrea Status file.
+ * The receive() method is overloaded to parse the XML node for camrea status 
+ * information.  The ParamicsSimulationManager is notified after each 
+ * successful parse of a camera status update. 
+ * 
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/06 20:46:40 $ $Revision: 1.4 $
+ */
+public class ParamicsCameraStatusReader extends ParamicsReader {
+    
+    /** 
+     * Reference to the ParamicsSimulationManager used to send notifications 
+     * of camera status changes.
+     */
+    private ParamicsSimulationManager paramicsSimMgr;
+    
+    /** A SAX Handler that is used to parse received Camera Status Node. */
+    protected CameraStatusHandler csh = null;
+    
+    /**
+     * Constructor.
+     * 
+     * @param theParamSimMgr The ParamicsSimulationManager object.
+     */
+    public ParamicsCameraStatusReader(ParamicsSimulationManager theParamSimMgr) {
+        paramicsSimMgr = theParamSimMgr;        
+        csh            = new CameraStatusHandler();
+    }
+    
+    /**
+     * This method parses the received XML node with the local CameraStatusHandler.
+     * All updated camera information is sent to the ParamicsSimulationManager.
+     */
+    public void receive(Node rxMessage) {
+        
+        try {           
+            if(rxMessage.getTextContent().length() > 0) {
+                SAXParserFactory.newInstance().newSAXParser().parse(
+                        new ByteArrayInputStream(rxMessage.getTextContent().getBytes()), csh);
+            }
+        }
+        catch (Exception e) {
+            paramLogger.logp(Level.SEVERE, "ParamicsCameraStatusReader", "receive",
+                    "Exception in parsing received ParamicsCommMessage.", e);
+            paramLogger.logp(Level.INFO, "ParamicsCameraStatusReader", "receive",
+                    "Invalid received bytes", rxMessage.getTextContent().getBytes());
+        }
+    }
+    
+
+    /**
+     * Internal SAX Handler used to parse the Camera Status Document read by
+     * the remote Status Reader.  The schema for this document is: <br/>
+     *
+     * <Camera_Status>  <br>
+     *     <Camera>  <br>
+     *        <Identifier/> <br>
+     *        <Route/> <br>
+     *        <Direction/> <br>
+     *        <Postmile/> <br>
+     *        <Ave_Speed_NE/> <br>
+     *        <Ave_Speed_SW/> <br>
+     *     </Camera>  <br>
+     * </Camera_Status> <br>
+     */ 
+    protected class CameraStatusHandler extends DefaultHandler {    
+
+        private final String CAMERA       = "Camera";
+        private final String CAMERA_ID    = "Identifier";
+        private final String ROUTE        = "Route";
+        private final String DIRECTION    = "Direction";        
+        private final String POSTMILE     = "Postmile";
+        private final String AVG_SPEED_NE = "Ave_Speed_NE";
+        private final String AVG_SPEED_SW = "Ave_Speed_SW";
+
+        private StringBuffer parsedValue  = new StringBuffer();
+        
+        Integer cameraID  = new Integer(-1);
+        String route      = "";
+        String direction  = "";
+        float postmile    = 0.0f;
+        float avgSpeed_NE = 0.0f;
+        float avgSpeed_SW = 0.0f;
+        
+        
+        public void startDocument() {   
+        }   
+        
+        public void characters(char[] ch, int start, int length) {
+            parsedValue.append(new String(ch, start, length).trim());   
+        }
+        
+        public void endElement(String uri, String localName, String qName)  {
+            
+            if(qName.equals(CAMERA_ID)) { cameraID = Integer.parseInt(parsedValue.toString()); }
+            else if(qName.equals(ROUTE)) { route = parsedValue.toString(); }
+            else if(qName.equals(DIRECTION)) { direction = parsedValue.toString(); }
+            else if(qName.equals(POSTMILE)) { postmile = Float.parseFloat(parsedValue.toString()); }
+            else if(qName.equals(AVG_SPEED_NE)) { avgSpeed_NE = Float.parseFloat(parsedValue.toString()); }
+            else if(qName.equals(AVG_SPEED_SW)) { avgSpeed_SW = Float.parseFloat(parsedValue.toString()); }
+            else if(qName.equals(CAMERA)) { 
+                paramicsSimMgr.updateCameraInfo(cameraID, avgSpeed_NE, avgSpeed_SW);
+            }
+            
+            parsedValue.setLength(0);
+        }   
+        
+        public void error(SAXParseException e) {
+            paramLogger.logp(Level.SEVERE, "ParamicsCameraStatusReader:CameraStatusHandler", 
+                    "error", "Error in parsing received ParamicsCommMessage.", e);
+        }
+        
+        public void fatalError(SAXParseException e) {
+            paramLogger.logp(Level.SEVERE, "ParamicsCameraStatusReader:CameraStatusHandler", 
+                    "error", "Fatal error in parsing received ParamicsCommMessage.", e);
+        }
+        
+        public void warning(SAXParseException e) {
+            paramLogger.logp(Level.WARNING, "ParamicsCameraStatusReader:CameraStatusHandler", 
+                    "error", "Warning in parsing received ParamicsCommMessage.", e);
+        }       
+    }   
+    
+}
Index: trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsCommunicator.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsCommunicator.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsCommunicator.java	(revision 2)
@@ -0,0 +1,415 @@
+package tmcsim.cadsimulator.paramicscontrol;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.net.SocketTimeoutException;
+import java.util.Observable;
+import java.util.Observer;
+import java.util.TreeMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import tmcsim.cadsimulator.managers.ParamicsSimulationManager;
+import tmcsim.common.CADEnums.PARAMICS_STATUS;
+import tmcsim.common.CADProtocol.PARAMICS_ACTIONS;
+import tmcsim.common.CADProtocol.PARAMICS_COMM_TAGS;
+
+/**
+ * The ParamicsCommunicator is a singleton object used to handle communication
+ * between the CADSimulator and the remote ParamicsCommunicator.  A socket 
+ * connection is established to the ParamicsCommunicator, and all data is read 
+ * and written through the socket.  ParamicsWriters and ParamicsReaders are 
+ * registered with this object to read and write specific data to and from files
+ * on the remote ParamicsCommunicator machine.  The remote ParamicsCommunicator
+ * is notified of this registeration (and unregistration) process so there is a
+ * direct correlation between registered objects in both Communicators.  After a
+ * ParamicsReader is registered, any messages received from the remotely
+ * created reader are sent to the local ParamicsReader object.  After a writer is 
+ * registered, this object is set as an Observer.  When message are to be sent,
+ * they are received through the update() method and transmitted to the remote
+ * ParamicsCommunicator.    
+ * 
+ * @author 
+ * @version
+ */
+public class ParamicsCommunicator extends Thread implements Observer {
+    
+    /** Error Logger. */
+    private Logger paramLogger = Logger.getLogger("tmcsim.cadsimulator.paramicscontrol");
+    
+    /** Remote Paramics Communicator host name. */
+    private static String paramicsHost   = null;
+    
+    /** Remote Paramics Communicator port. */
+    private static Integer paramicsPort  = null;
+
+    /** Instance of the Coordinator to update with Paramics status */
+    private ParamicsSimulationManager theController = null;
+    
+    /** private used for communication with the remote Paramics Communicator. */
+    private Socket paramicsSocket = null;
+    
+    /** Input stream for reading from socket. */
+    private ObjectInputStream in     = null;
+    
+    /** Output stream for writing to the socket. */
+    private ObjectOutputStream out = null;
+    
+    /** Map of all registered paramics readers, indexed by a unique  id. */
+    private TreeMap<String, ParamicsReader> paramicsReaders = null;
+
+    /** Map of all registered paramics writers, indexed by a unique  id. */
+    private TreeMap<String, ParamicsWriter> paramicsWriters = null; 
+    
+    /** 
+     * Boolean flag to designate whether a connection to the remote
+     * Paramics Communicator is established.
+     */ 
+    private boolean connected = false;
+    
+    /** Counter for assigning unique ids. */
+    private int nextIdentifier = 0;     
+    
+
+    /**
+     * Constructor.  Initialize member data.
+     */
+    public ParamicsCommunicator(ParamicsSimulationManager cntrl, 
+            String newHost, Integer newPort) {
+
+        theController  = cntrl;
+        paramicsHost   = newHost;
+        paramicsPort   = newPort;   
+        
+        paramicsReaders = new TreeMap<String, ParamicsReader>();
+        paramicsWriters = new TreeMap<String, ParamicsWriter>();
+            
+    }
+    
+    /**
+     * Returns the next unique identifier that may be used for a ParamicsWriter or
+     * ParamicsReader.
+     * @return int Next unique identifier value
+     */
+    public String nextID() {
+        return String.valueOf(nextIdentifier++);
+    }
+    
+    
+    /**
+     * Method connects to host and port where the remote paramics communicator 
+     * has connected.  Input and Output streams are created on the new Socket
+     * connection.  A RESET message is sent transmitted on the socket and this
+     * thread is started.  
+     */
+    public void connect() throws IOException {
+        
+        try {
+            paramicsSocket = new Socket();
+            paramicsSocket.setSoTimeout(5000);
+            paramicsSocket.connect(new InetSocketAddress(paramicsHost, paramicsPort));
+
+            //** out must be performed before in to unlock for connected socket **//
+            out = new ObjectOutputStream(paramicsSocket.getOutputStream());
+            in  = new ObjectInputStream(paramicsSocket.getInputStream());
+        }
+        catch (IOException e) {
+            paramicsSocket.close();
+            
+            paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", "connect()", 
+                    "Exception in creating input and output streams on socket.", e);
+            
+            throw new IOException("IOException in connecting to Paramics Socket");
+        }
+
+        connected = true;
+        
+        reset();
+        
+        if(getState() == State.NEW)
+            start();
+        
+    }
+    
+    /**
+     * This thread is interrupted and if a conenction has been made, 
+     * it is closed after transmitting a RESET message.
+     */
+    public void disconnect() {
+        interrupt();
+        
+        if(!connected)
+            return;     
+        
+        reset();
+        
+        cleanup();      
+                        
+    }
+
+    
+    /**
+     * Returns status of connection to remote Paramics Communicator.
+     * @return True if a connection is established, false if not.
+     */
+    public boolean isConnected() { 
+        return connected; 
+    }
+    
+    /**
+     * While a connection is established to the remote paramics communicator,
+     * read messages from the input stream.  Get the ParamicsReader from the
+     * local list whose unique ID matches that of the message sender, and call
+     * the receive() method on that reader.
+     */
+    public void run() {
+        
+        while(connected) {
+            try {               
+                Document rxMessage = (Document)in.readObject();
+                Element docElement = rxMessage.getDocumentElement();
+
+                String readerID         = docElement.getAttribute(PARAMICS_COMM_TAGS.ID.tag);               
+                ParamicsReader rxReader = paramicsReaders.get(readerID);
+                
+                if(rxReader != null) {
+                    rxReader.receive(docElement.getChildNodes().item(0));
+                }
+            }   
+            catch(SocketTimeoutException ste) {
+                //just try again
+            }       
+            catch (Exception e) {
+                paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", "run()", 
+                        "Exception in reading from the socket.", e);
+                cleanup();
+                
+                theController.updateParamicsStatus(PARAMICS_STATUS.DROPPED);
+            }
+        }       
+    }
+    
+    /**
+     * Observer/Observable update method.  The Paramics Communicator observers
+     * registered ParamicsWriters.  When messages are to be sent, they are sent
+     * through this method.  All messages are ParamicsCommMessage objects.  Send 
+     * these messages to the write() method for transmission on the socket.
+     */
+    public void update(Observable o, Object arg) {      
+        write((Document)arg);               
+    }
+    
+    
+    /**
+     * If a connection has been established, transmit a message to
+     * register the reader, and add it to the local list of
+     * ParamicsReaders.
+     * 
+     * @param reader The new registering ParamicsReader.
+     */
+    public void registerReader(ParamicsReader reader) {
+        if(connected && !paramicsReaders.containsKey(reader.readerID)) {
+            
+            try {
+                Document readerDoc = DocumentBuilderFactory.newInstance()
+                    .newDocumentBuilder().newDocument();
+        
+                Element readerElem = readerDoc.createElement(PARAMICS_COMM_TAGS.READER.tag);
+                readerElem.setAttribute(PARAMICS_COMM_TAGS.ID.tag, reader.readerID);
+                readerElem.setAttribute(PARAMICS_COMM_TAGS.ACTION.tag, 
+                        PARAMICS_ACTIONS.REGISTER.action);
+                
+                Element intElem = readerDoc.createElement(PARAMICS_COMM_TAGS.INTERVAL.tag);
+                intElem.appendChild(readerDoc.createTextNode(reader.interval));
+                readerElem.appendChild(intElem);    
+                
+                Element fileElem = readerDoc.createElement(PARAMICS_COMM_TAGS.TARGET_FILE.tag);
+                fileElem.appendChild(readerDoc.createTextNode(reader.targetFile));
+                readerElem.appendChild(fileElem);
+        
+                readerDoc.appendChild(readerElem);          
+                    
+                write(readerDoc);
+
+                paramicsReaders.put(reader.readerID, reader);
+            }
+            catch (Exception e) {
+                paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", 
+                        "registerReader", "Exception in registering reader.", e);
+            }       
+        }
+    }
+    
+    /**
+     * If a connection has been established, transmit a message to
+     * unregister the reader, and remove it from the local list of
+     * ParamicsReaders.
+     * 
+     * @param reader The unregistering ParamicsReader.
+     */
+    public void unregisterReader(ParamicsReader reader) {
+        if(connected && paramicsReaders.containsKey(reader.readerID)) {
+            
+            try {
+                Document readerDoc = DocumentBuilderFactory.newInstance()
+                    .newDocumentBuilder().newDocument();
+        
+                Element readerElem = readerDoc.createElement(PARAMICS_COMM_TAGS.READER.tag);
+                readerElem.setAttribute(PARAMICS_COMM_TAGS.ID.tag, reader.readerID);
+                readerElem.setAttribute(PARAMICS_COMM_TAGS.ACTION.tag, 
+                        PARAMICS_ACTIONS.UNREGISTER.action);
+        
+                readerDoc.appendChild(readerElem);          
+                    
+                write(readerDoc);
+
+                paramicsReaders.remove(reader.readerID);
+            }
+            catch (Exception e) {
+                paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", 
+                        "unregisterReader", "Exception in unregistering reader.", e);
+            }           
+        }
+    }
+    
+    /**
+     * If a connection has been established, transmit a message to
+     * register the writer, and add it to the local list of
+     * ParamicsWriters.  This object is set as an observer to the
+     * registering writer.
+     * 
+     * @param writer The new registering ParamicsWriter.
+     */
+    public void registerWriter(ParamicsWriter writer) {
+        
+        if(connected && !paramicsWriters.containsKey(writer.writerID)) {
+            try {
+                Document writerDoc = DocumentBuilderFactory.newInstance()
+                    .newDocumentBuilder().newDocument();
+        
+                Element writerElem = writerDoc.createElement(PARAMICS_COMM_TAGS.WRITER.tag);
+                writerElem.setAttribute(PARAMICS_COMM_TAGS.ID.tag, writer.writerID);
+                writerElem.setAttribute(PARAMICS_COMM_TAGS.ACTION.tag,
+                        PARAMICS_ACTIONS.REGISTER.action);
+                
+                Element fileElem = writerDoc.createElement(PARAMICS_COMM_TAGS.TARGET_FILE.tag);
+                fileElem.appendChild(writerDoc.createTextNode(writer.targetFile));
+                writerElem.appendChild(fileElem);
+        
+                writerDoc.appendChild(writerElem);          
+                    
+                write(writerDoc);
+
+                
+                paramicsWriters.put(writer.writerID, writer);
+                
+                writer.addObserver(this);
+            }
+            catch (Exception e) {
+                paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", 
+                        "registerWriter", "Exception in registering writer.", e);
+            }           
+        }   
+    }
+    
+    /**
+     * If a connection has been established, transmit a message to
+     * unregister the writer, and remove it from the local list of
+     * ParamicsWriters.  This object is removed as an Observer
+     * from the unregistering writer.
+     * 
+     * @param writer The unregistering ParamicsWriter.
+     */
+    public void unregisterWriter(ParamicsWriter writer) {
+        if(connected && paramicsWriters.containsKey(writer.writerID)) {
+            
+            try {
+                Document writerDoc = DocumentBuilderFactory.newInstance()
+                    .newDocumentBuilder().newDocument();
+        
+                Element writerElem = writerDoc.createElement(PARAMICS_COMM_TAGS.WRITER.tag);
+                writerElem.setAttribute(PARAMICS_COMM_TAGS.ID.tag, writer.writerID);
+                writerElem.setAttribute(PARAMICS_COMM_TAGS.ACTION.tag, 
+                        PARAMICS_ACTIONS.UNREGISTER.action);
+        
+                writerDoc.appendChild(writerElem);          
+                    
+                write(writerDoc);
+                    
+                paramicsWriters.remove(writer.writerID);
+                
+                writer.deleteObserver(this);
+            }
+            catch (Exception e) {
+                paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", 
+                        "unregisterWriter", "Exception in unregistering writer.", e);
+            }
+        }   
+    }   
+    
+    protected void reset() {
+        
+        try {
+            Document resetDoc = DocumentBuilderFactory.newInstance()
+                .newDocumentBuilder().newDocument();
+        
+            Element resetElem = resetDoc.createElement(PARAMICS_COMM_TAGS.RESET.tag);
+        
+            resetDoc.appendChild(resetElem);        
+                
+            write(resetDoc);
+        }
+        catch (Exception e) {
+            paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", 
+                    "reset", "Exception in reseting.", e);
+        }
+
+    }
+    
+    /**
+     * Close the input and output streams and the socket.  Clear the lists
+     * of readers and writers, and set the connection flag to false.
+     */
+    protected void cleanup() {
+        
+        try {out.close();} catch (Exception e) {}
+        try {in.close();} catch (Exception e) {}
+        try {paramicsSocket.close();} catch (Exception e) {}
+        
+        paramicsReaders.clear();
+        paramicsWriters.clear();
+        connected = false;  
+    }   
+    
+    /**
+     * Write the parameter ParamicsCommMessage to the output stream.  Flush 
+     * the stream to be sure all data is transmitted.
+     * 
+     * @param message The message to transmit.
+     */
+    protected synchronized void write(Document output) {
+        
+        try {
+            out.writeObject(output);
+            out.flush();        
+        }
+        catch (Exception e) {
+            paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", "write", 
+                    "Exception in writing to the socket.", e);
+            cleanup();          
+            
+            theController.updateParamicsStatus(PARAMICS_STATUS.DROPPED);
+        }
+        
+    }
+
+        
+}
Index: trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsReader.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsReader.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsReader.java	(revision 2)
@@ -0,0 +1,34 @@
+package tmcsim.cadsimulator.paramicscontrol;
+
+import java.util.logging.Logger;
+
+import org.w3c.dom.Node;
+
+/**
+ * ParamicsReader is an abstract class to define objects that may
+ * read data from the Paramics Communicator.  Each ParamicsWriter
+ * is identified by a unique id.  The reader is assigned a target file 
+ * that will be read from and the duration (in seconds) between reads.
+ * All implementing Readers must implement the receive() method to 
+ * parse the XML data that is received from the ParamicsCommunicator.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public abstract class ParamicsReader {
+    
+    /** Error Logger */
+    protected static Logger paramLogger = Logger.getLogger("tmcsim.cadsimulator.paramicscontrol");
+    
+    /** Unique identifier for the reader. */
+    public String readerID   = null;
+
+    /** Interval (in seconds) between reads. */
+    public String interval   = null;
+    
+    /** Target file being read by the ParamicsCommunicator. */
+    public String targetFile = null;
+    
+    /** Abstract method to receive a XML Node object containing message data.*/
+    public abstract void receive(Node rxMessage);
+}
Index: trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsStatusReader.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsStatusReader.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsStatusReader.java	(revision 2)
@@ -0,0 +1,155 @@
+package tmcsim.cadsimulator.paramicscontrol;
+
+import java.io.ByteArrayInputStream;
+import java.util.logging.Level;
+
+import javax.xml.parsers.SAXParserFactory;
+
+import org.w3c.dom.Node;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import tmcsim.cadsimulator.managers.ParamicsSimulationManager;
+import tmcsim.common.CADEnums.PARAMICS_STATUS;
+
+/**
+ * ParamicsStatusReader extends from the Abstrct ParamicsReader to provide
+ * the methods necessary to read the Paramics Status file.  The receive()
+ * method is overloaded to parse the XML node for status information.
+ * The ParamicsSimulationManager is notified after each successful parse
+ * of a Paramics Status Node. 
+ *
+ * @author Matthew Cechini
+ * @version
+ */
+public class ParamicsStatusReader extends ParamicsReader {
+    
+    /** Current Paramics Status. */
+    protected PARAMICS_STATUS currentStatus;
+    
+    /** Current Network ID that has been loaded. */
+    protected int currentNetwork;
+    
+    /** 
+     * Reference to the ParamicsSimulationManager used to send notifications 
+     * of Paramics status changes.
+     */
+    protected ParamicsSimulationManager paramicsSimMgr = null;  
+
+    /** SAX Handler that is used to parse the recieved Paramics Status Node. */
+    protected ParamicsStatusHandler psh = null; 
+    
+    
+    /**
+     * Constructor. Initialize Paramics Status to UNKNOWN and network loaded to -1.
+     *
+     * @param theParamSimMgr The ParamicsSimulationManager object.
+     */
+    public ParamicsStatusReader(ParamicsSimulationManager theParamSimMgr) {
+        paramicsSimMgr = theParamSimMgr;
+        
+        psh = new ParamicsStatusHandler();
+        
+        currentStatus  = PARAMICS_STATUS.UNKNOWN;
+        currentNetwork = -1;
+    }
+    
+    /** Get the current paramics status */
+    public PARAMICS_STATUS getStatus() { return currentStatus; }
+    
+    /**  Get the ID of the current paramics network. (Default: -1) */
+    public int getNetworkID() { return currentNetwork; }
+    
+    /**
+     * Reset the Paramics Status info.  The currentStatus will be set to UNKNOWN
+     * and the currentNetwork set to -1.
+     */
+    public void resetStatusInfo() {
+        currentStatus  = PARAMICS_STATUS.UNKNOWN;
+        currentNetwork = -1;
+    }
+    
+    /**
+     * This method parses the received XML Node with the local 
+     * ParamicsStatusHandler.  The parsed Paramics Status is sent to the 
+     * ParamicsSimulationManager.
+     */
+    public void receive(Node rxMessage) {
+        
+        try {           
+            if(rxMessage.getTextContent().length() > 0)
+                SAXParserFactory.newInstance().newSAXParser().parse(
+                        new ByteArrayInputStream(rxMessage.getTextContent().getBytes()), psh);  
+        }
+        catch (Exception e) {
+            paramLogger.logp(Level.SEVERE, "ParamicsStatusReader", "receive",
+                    "Exception in parsing received ParamicsCommMessage.", e);
+            paramLogger.logp(Level.INFO, "ParamicsStatusReader", "receive",
+                    "Invalid received bytes", rxMessage.getTextContent().getBytes());           
+        }
+                
+        paramicsSimMgr.updateParamicsStatus(currentStatus);
+    }
+    
+    /**
+     * Internal SAX Handler used to parse the Camera Status Document read by
+     * the remote Status Reader.  The schema for this document is: <br/>
+     *
+     * <Paramics>
+     *    <Network_Status/>    ("LOADING", "WARMING", or "LOADED")
+     *    <Network_ID/>         (integer network ID)
+     * </Paramics>
+     */ 
+    protected class ParamicsStatusHandler extends DefaultHandler {  
+    
+
+        /** String XML creation.  Tag contains information for the paramics status. */
+        private final String NETWORK_STATUS = "Network_Status";
+        
+        /** String XML creation.  Tag contains information for the loaded paramics network id. */
+        private final String NETWORK_ID     = "Network_ID";
+        
+        private StringBuffer parsedValue = new StringBuffer();
+        
+        public void startDocument() {               
+
+        }   
+        
+        public void characters(char[] ch, int start, int length) {
+            parsedValue.append(new String(ch, start, length).trim());       
+        }
+        
+        public void endElement(String uri, String localName, String qName)  {
+            
+            if(qName.equals(NETWORK_STATUS)) { 
+            
+                currentStatus = PARAMICS_STATUS.UNKNOWN;
+                for(PARAMICS_STATUS val : PARAMICS_STATUS.values()) {
+                    if(val.toString().equals(parsedValue.toString())) 
+                        currentStatus = val;
+                }
+            }
+            else if(qName.equals(NETWORK_ID)) { 
+                currentNetwork = Integer.parseInt(parsedValue.toString()); 
+            }
+            
+            parsedValue.setLength(0);
+
+        }   
+        
+        public void error(SAXParseException e) {
+            paramLogger.logp(Level.SEVERE, "ParamicsStatusReader:ParamicsStatusHandler", 
+                    "error", "Error in parsing received ParamicsCommMessage.", e);
+        }
+        
+        public void fatalError(SAXParseException e) {
+            paramLogger.logp(Level.SEVERE, "ParamicsStatusReader:ParamicsStatusHandler", 
+                    "error", "Fatal error in parsing received ParamicsCommMessage.", e);
+        }
+        
+        public void warning(SAXParseException e) {
+            paramLogger.logp(Level.WARNING, "ParamicsStatusReader:ParamicsStatusHandler", 
+                    "error", "Warning in parsing received ParamicsCommMessage.", e);
+        }       
+    }
+}
Index: trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsIncidentWriter.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsIncidentWriter.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/paramicscontrol/ParamicsIncidentWriter.java	(revision 2)
@@ -0,0 +1,527 @@
+package tmcsim.cadsimulator.paramicscontrol;
+
+import java.util.Iterator;
+import java.util.TreeMap;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import tmcsim.cadmodels.CMSInfo;
+import tmcsim.common.XMLIncident;
+
+/**
+ * ParamicsIncidentWriter extends from ParamicsWriter to manage the current 
+ * simulation data and transmit update XML Document messages to the 
+ * ParamicsCommunicator for simulation control.  The updateIncident() and 
+ * updateDiversion() methods are used to notify this class of changes in current 
+ * incidents and diversions.  This data is converted to an XML Document and 
+ * transmitted to the ParamicsCommunicator everytime the sendUpdate() method is 
+ * called.  This method will not transmit simulation updates until a network is 
+ * loaded.  To load a network, call the loadNetwork() method to transmit the 
+ * registration information to paramics, and when paramics has finished warming up, 
+ * call the networkLoaded() method to begin update transmission.
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/06 20:46:40 $ $Revision: 1.4 $
+ */
+public class ParamicsIncidentWriter extends ParamicsWriter {
+
+    /**
+     * Enumeration with XML tag names.
+     * @author Matthew Cechini
+     */
+    private static enum XML_TAGS {
+        /** CAD incident update. */
+        CAD_DATA      ("CAD_DATA"),
+        /** Basic update information. */
+        BASIC         ("Basic"),
+        /** Current simulation incidents. */
+        CAD_INCIDENTS ("CAD_Incidents"),
+        /** Current simulation data. */
+        SIMULATION_DATA ("Simulation_Data"),
+        /** Current CMS diversions. */
+        MANAGEMENT    ("Management"),
+        /** Current communications interval. */
+        COMM_INTERVAL ("Comm_Interval"),
+        /** Current loaded paramics network. */
+        NETWORK_ID    ("Network_ID"),
+        /** Boolean value of whether the simulation has started. */
+        SIMULATION    ("Simulation"),
+        /** Boolean value of whether an incident is current active. */
+        INCIDENT      ("Incident"),
+        /** Current CAD simulation time. */
+        CAD_CLOCK     ("CAD_clock"),
+        /** Current simulation speed. */
+        SIM_SPEED       ("Simulation_speed"),
+        /** Current CAD clock hours value. */
+        HOUR            ("hour"),
+        /** Current CAD clock minutes value. */
+        MINUTE          ("minute"),
+        /** Current CAD clock seconds value. */
+        SECOND          ("second");
+        
+        /** Tag name */
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }
+
+    }
+        
+    
+    /** Flag to designate whether a network has been loaded */
+    private boolean networkLoaded = false;
+    
+    /** Flag to designate whether the simulation is running. */
+    private boolean simulation   = false;
+    
+    /** Flag to designate whether incidents have occured in the simulation. */
+    private boolean incident     = false;
+    
+    /** Flag to designate whether CMS diversions have been set. */
+    private boolean management   = false;
+    
+    /** Loaded Paramics network ID. */
+    private int     networkID    = 1;
+        
+    /** Communications interval for paramics to read incident status files. (in seconds) */
+    private int     commInterval = 0;
+    
+    /** Current simulation speed */
+    private int     speed        = 0;
+    
+    /** Current simulation time. */
+    private long    simTime      = 0;
+
+    /**
+     * A map containing XMLIncident objects for each incident that is being updated.
+     */
+    private TreeMap<String, XMLIncident> incidentsMap;
+    
+    /**
+     * A map containing the current active CMS diversions.
+     */
+    private TreeMap<String, CMSInfo> diversionsMap;         
+    
+    /**
+     * A Map containing queued Incident Events.  It is possible to queue one incident event
+     * per incident. This happens if an incident update is received, but the previous has not
+     * been transmitted yet.  The new updated is queued until the current is transmitted.  There
+     * is a possibility that more than one incident event can be received and added to the map, and 
+     * the first would be lost.  This would be inidcative of other problems, or bad script creation.
+     * Either increase the interval frequencyl, or make more time in script between events.
+     */
+    private TreeMap<String, XMLIncident> queuedIncidentEvents;
+    
+
+    /**
+     * Constructor.  Initializes private members.
+     * 
+     * @param interval Number of seconds beetween transmission of XML update.
+     */ 
+    public ParamicsIncidentWriter(Integer interval) {
+        super();
+        
+        commInterval = interval;
+
+        incidentsMap         = new TreeMap<String, XMLIncident>();
+        diversionsMap        = new TreeMap<String, CMSInfo>();      
+        queuedIncidentEvents = new TreeMap<String, XMLIncident>();  
+    
+    }
+    
+    /**
+     * This method sets the local network ID to the parameter value and sends
+     * an updated XML message to load the network.
+     * 
+     * @param newID Paramics network id.
+     */
+    public void loadNetwork(int newID) {
+        networkID = newID;
+
+        transmitXMLUpdate();
+    }
+    
+    /**
+     * Updates the networkLoaded flag to true.
+     */
+    public void networkLoaded() {
+        networkLoaded = true;
+    }
+    
+    /**
+     * Set the simulation started flag to true.  If a network has been
+     * loaded, send an update to the ParamicsCommunicator.
+     */
+    public void startSimulation() {
+        
+        simulation = true;
+
+        if(networkLoaded) {
+            sendUpdate(0);      
+        }
+    }
+    
+    /**
+     * This method resets current simulation data.  All maps of incident data
+     * are cleared.  The incident, simulation, and management flags are set to 
+     * false.  If a network has been previously loaded, send an update to the 
+     * ParamicsCommunicator.
+     */
+    public void resetSimulation() {
+        
+        incidentsMap.clear();
+        diversionsMap.clear();      
+        queuedIncidentEvents.clear();
+
+        simulation = false;
+        incident   = false;
+        management = false;     
+        
+        if(networkLoaded) {
+            sendUpdate(0);
+        }
+    }   
+    
+    /**
+     * This method is transmits an XML update object to the ParamicsCommunicator
+     * if a network has ben loaded.  After the update object has been formed and 
+     * sent, the incident list is updated to remove all cleared Incidents.
+     * Any queued IncidentEvents are placed into the map of incidents that will 
+     * be used for update creation.  The incident flag is set to true if there
+     * are still ongoing incidents, false if not.
+     */ 
+    public void sendUpdate(long simulationTime) {
+        simTime = simulationTime;       
+
+        if(!networkLoaded) return;      
+                
+        transmitXMLUpdate();
+    
+        updateIncidentList();
+        
+        for(String key : queuedIncidentEvents.keySet()) {
+            incidentsMap.put(key, queuedIncidentEvents.remove(key));
+        }
+        
+        incident = incidentsMap.size() != 0;
+        
+    }
+    
+    /**
+     * This method updates the map of XMLIncident objects that are used for 
+     * updating the Paramics modeler.  If the parameter XMLIncident is not 
+     * currently in the local map of incidents, add it.  If it is in the 
+     * map of incidents, queue the new XMLIncident to be processed later.  
+     * Set the incident flag to true to signify that an incident exists in the 
+     * system.
+     * 
+     * @param newXML The XMLIncident object that will be used to update
+     *               an existing incident.
+     */
+    public void updateIncident(XMLIncident newXML) {
+        
+        if(incidentsMap.get(newXML.getIdentifier()) == null ) {  
+            incidentsMap.put(newXML.getIdentifier(), newXML);               
+        }
+        else {
+             queuedIncidentEvents.put(newXML.getIdentifier(), newXML);
+        }       
+
+        incident = true;                
+    }
+    
+    /**
+     * This method updates the map of CMSInfo diversion objects that are used
+     * for updating the Paramics modeler.  If the diversion is being cleared, 
+     * remove it from the map of diversions.  If it is not being cleared, 
+     * update the map with the new CMSInfo object. Set the management flag to be 
+     * true if there are diversions remaining, false if not.
+     * 
+     * @param theDiversion A new CMSDiversion object containing new diversion info.
+     */
+    public void updateDiversion(CMSInfo theDiversion) {
+                
+        if(theDiversion.isCleared())
+            diversionsMap.remove(theDiversion.cmsID);
+        else
+            diversionsMap.put(theDiversion.cmsID, theDiversion);
+            
+        management = diversionsMap.size() > 0;  
+    
+    }   
+    
+    /**
+     * Update the current map of incidents. If an incident
+     * has been cleared, remove it from the list.  Otherwise,
+     * call its update() method to set its status to ON_GOING.
+     *
+     * Set the incident flag to true if there are incidents still
+     * in the incident map, false if not.
+     */
+    private void updateIncidentList() {
+        
+        Iterator<XMLIncident> incIter = incidentsMap.values().iterator();
+        
+        while(incIter.hasNext()) {
+            XMLIncident inc = incIter.next();
+            
+            if(inc.isCleared()) 
+                incIter.remove();
+            else
+                inc.update();
+        }
+        
+        incident = incidentsMap.size() != 0;
+    }
+    
+    
+    /**
+     * Creates an XML Document containing all Paramics update information.  
+     * This XML object will then be written to the parent class' writeXML method
+     * for transmission to the Paramics Communicator.  Helper methods are used 
+     * to create each individual section.  The simulation, incident, and 
+     * diversion secions will only appear if they are currently active in the 
+     * simulation.  The format of the resulting XML object is as follows:<br>
+     * <br>
+     * <CAD_DATA><br>
+     *    <Basic><br>
+     *       <Comm_Interval/><br/>
+     *       <Network_ID/><br/>
+     *       <Simulation/><br/>
+     *       <Incident/><br/>
+     *    </Basic>
+     *
+     *    <Simulation_Data>
+     *       <Simulation_speed/><br/>
+     *       <CAD_clock><br/>
+     *          <hour/><br/>
+     *          <minute/><br/>
+     *          <second/><br/>
+     *          <Location><br/>
+     *       </CAD_clock><br/>
+     *    </Simulation_Data>
+     *    
+     *    <CAD_Incidents>
+     *       <Incident><br/>
+     *          <Identifier/><br/>
+     *          <Status/><br/>
+     *          <Location><br/>
+     *              <Route/><br/>
+     *              <Direction/><br/>
+     *              <Location_type/><br/>
+     *              <Postmile/><br/>
+     *          </Location><br/>
+     *          <Incident_type/><br/>
+     *          <Lanes><br/>
+     *             <Lane_number/><br/>
+     *             ...
+     *          </Lanes><br/>
+     *       </Incident><br/>
+     *       ...
+     *    </CAD_Incidents>   
+     *    
+     *    <Management>
+     *       <Diversion>
+     *          <Diversion_path>
+     *             <Identifier/>
+     *             <Percentage/>
+     *          <Diversion_path>
+     *          ...
+     *       </Diversion>
+     *       ...
+     *    </Management>
+     *  
+     * </CAD_DATA>
+     * 
+     */
+    private void transmitXMLUpdate() {
+
+        try {
+            
+            Document theDoc = DocumentBuilderFactory.newInstance()
+                .newDocumentBuilder().newDocument();
+            
+            Element cadDataElement = theDoc.createElement(XML_TAGS.CAD_DATA.tag);
+            theDoc.appendChild(cadDataElement);
+            
+            //***** BASIC *****//
+            writeBasicXML(cadDataElement);      
+            
+            //***** SIMULATION *****//
+            if(simulation)
+                writeSimulationXML(cadDataElement);
+            
+            
+            //***** INCIDENTS *****//
+            if(incident)
+                writeIncidents(cadDataElement);             
+            
+            
+            //***** MANAGEMENT *****//
+            if(management)
+                writeManagement(cadDataElement);
+            
+            writeXML(theDoc);
+            
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+    
+    /**
+     * Appends the <Basic> XML Element to the parameter Element root.
+     * The format for this section is as follows:<br>
+     * 
+     * <Basic>
+     *    <Comm_Interval/><br/>
+     *    <Network_ID/><br/>
+     *    <Simulation/><br/>
+     *    <Incident/><br/>
+     * </Basic>
+     * 
+     * @param currElem XML Element to use as a root.
+     */
+    private void writeBasicXML(Element currElem) {      
+                    
+        Document theDoc = currElem.getOwnerDocument();
+        
+        Element basicElem = theDoc.createElement(XML_TAGS.BASIC.tag);
+        currElem.appendChild(basicElem);
+
+        Element intervalElement = theDoc.createElement(XML_TAGS.COMM_INTERVAL.tag);
+        intervalElement.appendChild(theDoc.createTextNode( String.valueOf(commInterval)));
+        basicElem.appendChild(intervalElement);
+
+        Element networkElement = theDoc.createElement(XML_TAGS.NETWORK_ID.tag);
+        networkElement.appendChild(theDoc.createTextNode(String.valueOf(networkID)));
+        basicElem.appendChild(networkElement);
+
+        Element simElement = theDoc.createElement(XML_TAGS.SIMULATION.tag);
+        simElement.appendChild(theDoc.createTextNode(String.valueOf(simulation).toUpperCase()));
+        basicElem.appendChild(simElement);
+
+        Element incidentElement = theDoc.createElement(XML_TAGS.INCIDENT.tag);
+        incidentElement.appendChild(theDoc.createTextNode(String.valueOf(incident).toUpperCase()));
+        basicElem.appendChild(incidentElement);
+
+    }
+    
+    /**
+     * Appends the <Simulation_Data> XML Element to the parameter Element root.
+     * The format for this section is as follows:<br>
+     * 
+     * <Simulation_Data>
+     *    <Simulation_speed/><br/>
+     *    <CAD_clock><br/>
+     *       <hour/><br/>
+     *       <minute/><br/>
+     *       <second/><br/>
+     *       <Location><br/>
+     *    </CAD_clock><br/>
+     * </Simulation_Data>
+     * 
+     * @param currElem XML Element to use as a root.
+     */
+    private void writeSimulationXML(Element currElem) {
+
+        Document theDoc = currElem.getOwnerDocument();
+        
+        Element simDataElem = theDoc.createElement(XML_TAGS.SIMULATION_DATA.tag);
+        currElem.appendChild(simDataElem);
+
+        Element speedElement = theDoc.createElement(XML_TAGS.SIM_SPEED.tag);
+        speedElement.appendChild(theDoc.createTextNode(String.valueOf(speed)));
+        simDataElem.appendChild(speedElement);    
+
+        Element clockElement = theDoc.createElement(XML_TAGS.CAD_CLOCK.tag);
+        simDataElem.appendChild(clockElement); 
+
+        Element hourElement = theDoc.createElement(XML_TAGS.HOUR.tag);
+        hourElement.appendChild(theDoc.createTextNode(String.valueOf(6 + (long)simTime/3600)));
+        clockElement.appendChild(hourElement); 
+
+        Element minuteElement = theDoc.createElement(XML_TAGS.MINUTE.tag);
+        minuteElement.appendChild(theDoc.createTextNode(String.valueOf((long)((simTime%3600)/60))));
+        clockElement.appendChild(minuteElement); 
+
+        Element secondElement = theDoc.createElement(XML_TAGS.SECOND.tag);
+        secondElement.appendChild(theDoc.createTextNode(String.valueOf((long)(simTime%60))));
+        clockElement.appendChild(secondElement);    
+
+    }
+    
+    /**
+     * Appends the <Simulation_Data> XML Element to the parameter Element root.
+     * This is done by converting all current XMLIncident objects
+     * to their XML output.  The format for this section is as follows:<br>
+     * 
+     * <CAD_Incidents>
+     *    <Incident><br/>
+     *       <Identifier/><br/>
+     *       <Status/><br/>
+     *       <Location><br/>
+     *           <Route/><br/>
+     *           <Direction/><br/>
+     *           <Location_type/><br/>
+     *           <Postmile/><br/>
+     *       </Location><br/>
+     *       <Incident_type/><br/>
+     *       <Lanes><br/>
+     *          <Lane_number/><br/>
+     *          ...
+     *       </Lanes><br/>
+     *    </Incident><br/>
+     *    ...
+     * </CAD_Incidents>
+     * 
+     * @param currElem XML Element to use as a root.
+     */
+    private void writeIncidents(Element currElem) {
+
+        Document theDoc = currElem.getOwnerDocument();
+        
+        Element incidentElem = theDoc.createElement(XML_TAGS.CAD_INCIDENTS.tag);
+        currElem.appendChild(incidentElem);
+
+        for(XMLIncident incident : incidentsMap.values()) {
+            incident.toXML(incidentElem);
+        }
+
+    }
+
+    /**
+     * Appends the <Simulation_Data> XML Element to the parameter Element root.
+     * This is done by converting all current CMS Diversion objects
+     * to their XML output.  The format for this section is as follows:<br>
+     * 
+     * <Management>
+     *    <Diversion>
+     *       <Diversion_path>
+     *          <Identifier/>
+     *          <Percentage/>
+     *       <Diversion_path>
+     *       ...
+     *    </Diversion>
+     *    ...
+     * </Management>
+     * 
+     * @param currElem XML Element to use as a root.
+     */
+    private void writeManagement(Element currElem) {
+
+        Document theDoc = currElem.getOwnerDocument();
+        
+        Element mgmtElem = theDoc.createElement(XML_TAGS.MANAGEMENT.tag);
+        currElem.appendChild(mgmtElem);
+
+        for(CMSInfo div : diversionsMap.values()) {
+            div.toXML(mgmtElem);
+        }                       
+    }
+        
+}
+
Index: trunk/src/tmcsim/cadsimulator/viewer/actions/ExitAction.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/viewer/actions/ExitAction.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/viewer/actions/ExitAction.java	(revision 2)
@@ -0,0 +1,32 @@
+package tmcsim.cadsimulator.viewer.actions;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+
+import tmcsim.cadsimulator.viewer.CADSimulatorViewer;
+
+/**
+ * Abstract action to exit the CADSimulator. When the action is performed
+ * the CADSimulatorView.closeViewer() method is called.
+ *  
+ * @author Matthew Cechini
+ * @version 
+ */
+@SuppressWarnings("serial")
+public class ExitAction extends AbstractAction {
+
+    /** Reference to the CADSimulatorViewer. */
+    private CADSimulatorViewer theViewer;
+
+    public ExitAction(CADSimulatorViewer viewer) {
+        super("Exit");
+        
+        theViewer = viewer;
+    }
+    
+    public void actionPerformed(ActionEvent arg0) {     
+        theViewer.closeViewer();
+    }
+
+}
Index: trunk/src/tmcsim/cadsimulator/viewer/model/DVDTitleTableModel.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/viewer/model/DVDTitleTableModel.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/viewer/model/DVDTitleTableModel.java	(revision 2)
@@ -0,0 +1,248 @@
+package tmcsim.cadsimulator.viewer.model;
+
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.swing.event.TableModelEvent;
+import javax.swing.table.DefaultTableModel;
+
+import tmcsim.cadsimulator.videocontrol.DVDTitleUpdate;
+
+/**
+ * DVDStatusTableModel extends from DefaultTableModel to display 
+ * DVDStatusUpdates that are received from a DVDController.  The
+ * addStatusUpdate() method is used to add new update objects.
+ * The table may be cleared through the clearModelData() method.
+ * 
+ * @author Matthew
+ * @version
+ */
+@SuppressWarnings("serial")
+public class DVDTitleTableModel extends DefaultTableModel {
+    
+    
+    /**
+     * Enumeration containing column information for all columns shown in the 
+     * DVDTitle table.
+     * @author Matthew Cechini
+     */ 
+    public static enum TITLE_COLUMNS {
+        TIME_COL           ("Time", 0, 60, 100, 80),
+        UPDATE_INFO_COL    ("Title Info", 1, 140, 400, 420);
+        
+        public String colName;
+        public int colNum;
+        public int colMinWidth;
+        public int colMaxWidth;
+        public int colPrefWidth;
+        
+        private TITLE_COLUMNS (String name, int num, int min, int max, int pref) {
+            colName      = name;
+            colNum       = num;
+            colMinWidth  = min;
+            colMaxWidth  = max;
+            colPrefWidth = pref;
+        }
+        
+        public static int colCount() {
+            return values().length;
+        }
+        
+        public static String columnName(int num) {
+            
+            for(TITLE_COLUMNS column : TITLE_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colName;
+            }
+            
+            return "";
+        }
+        
+        public static int columnMinWidth(int num) {
+            
+            for(TITLE_COLUMNS column : TITLE_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colMinWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static int columnMaxWidth(int num) {
+            
+            for(TITLE_COLUMNS column : TITLE_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colMaxWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static int columnPrefWidth(int num) {
+            
+            for(TITLE_COLUMNS column : TITLE_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colPrefWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static TITLE_COLUMNS fromColNum(int column) {
+            for(TITLE_COLUMNS c : TITLE_COLUMNS.values()) {
+                if(c.colNum == column)
+                    return c;
+            }
+            
+            return TIME_COL;
+        }
+    }  
+
+    /** 
+     * Container class to hold information displayed in the table.
+     * @author Matthew Cechini
+     */     
+    private class TitleUpdateInfo {
+
+        /** Formatted time text of when the title update was received. */
+        public String time;
+
+        /** Text for title update. */
+        public String titleUpdate;
+        
+        public TitleUpdateInfo(String t, String u) {
+            time        = t;
+            titleUpdate = u;
+        }
+    }
+
+    /** List of data displayed in the table. */
+    private List<TitleUpdateInfo> title_update_list;
+
+    /** DateFormat object used to format time formatted text for display. */
+    private DateFormat timeFormatter;
+
+    
+    /** Constructor.  Intialize the DateFormat object. */
+    public DVDTitleTableModel() {
+        title_update_list = new ArrayList<TitleUpdateInfo>();
+        timeFormatter     = DateFormat.getTimeInstance(DateFormat.SHORT);
+    }
+
+    public int getRowCount() {
+        if(title_update_list == null) {
+            return 0;
+        }
+        else
+            return title_update_list.size();
+    }
+
+    public int getColumnCount() {
+        return TITLE_COLUMNS.colCount();
+    }
+    
+    public int getColumnMinWidth(int c){
+        return TITLE_COLUMNS.columnMinWidth(c);
+    }
+
+
+    public int getColumnMaxWidth(int c){
+        return TITLE_COLUMNS.columnMaxWidth(c);
+    }
+
+
+    public int getColumnPrefWidth(int c){
+        return TITLE_COLUMNS.columnPrefWidth(c);
+    }
+    
+    
+    public Object getValueAt(int row, int col) {
+        switch (TITLE_COLUMNS.fromColNum(col)) {
+            case TIME_COL:
+                return title_update_list.get(row).time;
+            case UPDATE_INFO_COL:
+                return title_update_list.get(row).titleUpdate; 
+            default:
+                return "";
+        }        
+    }
+    
+    @SuppressWarnings("unchecked")
+    public void setValueAt(Object value, int row, int col) {
+        switch (TITLE_COLUMNS.fromColNum(col)) {
+        /*
+            case NAME_COL:
+                reader_list.get(row).readerName;
+            case ADDRESS_COL:
+                reader_list.get(row).readerAddress;
+            case READER_TYPE_COL:
+                reader_list.get(row).readerFullType;
+            case CONN_TYPE_COL:
+                reader_list.get(row).connType;
+            default:
+                return "";
+        */
+        }        
+    }    
+
+    public String getColumnName(int col) {
+        return TITLE_COLUMNS.columnName(col);
+    }
+
+    public Class<?> getColumnClass(int c) {
+        return getValueAt(0, c).getClass();
+    }
+    
+    public boolean isCellEditable(int row, int col) {
+        return false;
+    }
+    
+    /**
+     * This method adds a new title update to the table.  If the title has
+     * been repeated, the text will be "Repeating title #<Number> <Addl Info>".
+     * If the title is being played for the first time, the text will be 
+     * "Playing title #<Number> <Addl Info>".  If the title is being played 
+     * for an incident, the <Addl Info> will be "for Incident #<Number>".
+     * Else, the title is being played for a speed range and the <Addl Info>
+     * will be "for Range <Min Speed> - <Max Speed> mph (<duration> secs)".
+     * 
+     * @param update New update object.
+     */    
+    public void addTitleUpdate(DVDTitleUpdate update) {
+       
+        StringBuffer updateBuf = new StringBuffer();
+        
+        if(update.isRepeat)
+            updateBuf.append("Repeating title #");
+        else
+            updateBuf.append("Playing title #");        
+        
+        if(update.isPlayingIncident) {
+            updateBuf.append(update.currentIncident.dvdTitle + " for Incident #");
+            updateBuf.append(update.currentIncident.incidentNumber);
+        }
+        else {
+            updateBuf.append(update.currentRange.dvdTitle + " for Range ");
+            updateBuf.append(update.currentRange.minSpeed + " - ");
+            updateBuf.append(update.currentRange.maxSpeed + " mph");
+        }
+        
+        title_update_list.add(new TitleUpdateInfo(
+                timeFormatter.format(new Date()), 
+                updateBuf.toString()));
+        
+        fireTableChanged(new TableModelEvent(this));
+    }
+    
+    /** 
+     * Remove all Status Updates from the table's data.
+     */     
+    public void clearModelData() {
+        title_update_list.clear();
+        fireTableChanged(new TableModelEvent(this));
+    }   
+
+    
+}
Index: trunk/src/tmcsim/cadsimulator/viewer/model/DVDStatusTableModel.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/viewer/model/DVDStatusTableModel.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/viewer/model/DVDStatusTableModel.java	(revision 2)
@@ -0,0 +1,241 @@
+package tmcsim.cadsimulator.viewer.model;
+
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.swing.event.TableModelEvent;
+import javax.swing.table.DefaultTableModel;
+
+import tmcsim.cadsimulator.videocontrol.DVDStatusUpdate;
+
+
+/**
+ * DVDStatusTableModel extends from DefaultTableModel to display 
+ * DVDStatusUpdates that are received from a DVDController.  The
+ * addStatusUpdate() method is used to add new update objects.
+ * The table may be cleared through the clearModelData() method.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+@SuppressWarnings("serial")
+public class DVDStatusTableModel extends DefaultTableModel {
+
+    /**
+     * Enumeration containing column information for all columns shown in the 
+     * DVDStatus table.
+     * @author Matthew Cechini
+     */
+    public static enum STATUS_COLUMNS {
+        TIME_COL           ("Time", 0, 60, 100, 80),
+        UPDATE_INFO_COL    ("Status Info", 1, 140, 400, 420);
+        
+        public String colName;
+        public int colNum;
+        public int colMinWidth;
+        public int colMaxWidth;
+        public int colPrefWidth;
+        
+        private STATUS_COLUMNS (String name, int num, int min, int max, int pref) {
+            colName      = name;
+            colNum       = num;
+            colMinWidth  = min;
+            colMaxWidth  = max;
+            colPrefWidth = pref;
+        }
+        
+        public static int colCount() {
+            return values().length;
+        }
+        
+        public static String columnName(int num) {
+            
+            for(STATUS_COLUMNS column : STATUS_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colName;
+            }
+            
+            return "";
+        }
+        
+        public static int columnMinWidth(int num) {
+            
+            for(STATUS_COLUMNS column : STATUS_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colMinWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static int columnMaxWidth(int num) {
+            
+            for(STATUS_COLUMNS column : STATUS_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colMaxWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static int columnPrefWidth(int num) {
+            
+            for(STATUS_COLUMNS column : STATUS_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colPrefWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static STATUS_COLUMNS fromColNum(int column) {
+            for(STATUS_COLUMNS c : STATUS_COLUMNS.values()) {
+                if(c.colNum == column)
+                    return c;
+            }
+            
+            return TIME_COL;
+        }
+    }  
+    
+    
+    /** 
+     * Container class to hold information displayed in the table.
+     * @author Matthew Cechini
+     */ 
+    private class StatusUpdateInfo {
+        
+        /** Formatted time text of when the status update was received. */
+        public String time;
+
+        /** Text of status update. */
+        public String statusText;
+        
+        public StatusUpdateInfo(String t, String s) {
+            time       = t;
+            statusText = s;
+        }
+    }
+    
+
+    /** List of data displayed in the table. */
+    private List<StatusUpdateInfo> status_update_list;
+
+    /** DateFormat object used to format time formatted text for display. */
+    private DateFormat timeFormatter;
+
+    
+    /** Constructor.  Intialize the DateFormat object. */
+    public DVDStatusTableModel() {
+        status_update_list = new ArrayList<StatusUpdateInfo>();
+        timeFormatter      = DateFormat.getTimeInstance(DateFormat.SHORT);
+    }
+
+    public int getRowCount() {
+        if(status_update_list == null) {
+            return 0;
+        }
+        else
+            return status_update_list.size();
+    }
+
+    public int getColumnCount() {
+        return STATUS_COLUMNS.colCount();
+    }
+    
+    public int getColumnMinWidth(int c){
+        return STATUS_COLUMNS.columnMinWidth(c);
+    }
+
+
+    public int getColumnMaxWidth(int c){
+        return STATUS_COLUMNS.columnMaxWidth(c);
+    }
+
+
+    public int getColumnPrefWidth(int c){
+        return STATUS_COLUMNS.columnPrefWidth(c);
+    }
+    
+    public Object getValueAt(int row, int col) {
+        switch (STATUS_COLUMNS.fromColNum(col)) {
+            case TIME_COL:
+                return status_update_list.get(row).time;
+            case UPDATE_INFO_COL:
+                return status_update_list.get(row).statusText; 
+            default:
+                return "";
+        }        
+    }
+    
+    @SuppressWarnings("unchecked")
+    public void setValueAt(Object value, int row, int col) {
+        switch (STATUS_COLUMNS.fromColNum(col)) {
+        /*
+            case NAME_COL:
+                reader_list.get(row).readerName;
+            case ADDRESS_COL:
+                reader_list.get(row).readerAddress;
+            case READER_TYPE_COL:
+                reader_list.get(row).readerFullType;
+            case CONN_TYPE_COL:
+                reader_list.get(row).connType;
+            default:
+                return "";
+        */
+        }        
+    }    
+
+    public String getColumnName(int col) {
+        return STATUS_COLUMNS.columnName(col);
+    }
+
+    public Class<?> getColumnClass(int c) {
+        return getValueAt(0, c).getClass();
+    }
+
+    public boolean isCellEditable(int row, int col) {
+        return false;
+    }
+    
+    /**
+     * This method adds a new status update to the table.  If the parameter
+     * update contains an exception, the status text will be "Exception: 
+     * <Message>".  The status text will be "Connected" or "Disconnected" 
+     * depending on the value of the isConnected data member.  The current
+     * time is used to time stamp the received update.
+     * 
+     * @param update New update object.
+     */
+    public void addStatusUpdate(DVDStatusUpdate update) {
+       
+        StringBuffer updateBuf = new StringBuffer();
+        
+        if(update.exception != null) {
+            updateBuf.append("Exception: " + update.exception.getMessage());
+        }
+        else if(update.isConnected) {
+            updateBuf.append("Connected");
+        }
+        else {
+            updateBuf.append("Disconnected");
+        }
+        
+        status_update_list.add(new StatusUpdateInfo(
+                timeFormatter.format(new Date()), 
+                updateBuf.toString()));
+        
+        fireTableChanged(new TableModelEvent(this));
+    }
+    
+    /** 
+     * Remove all Status Updates from the table's data.
+     */       
+    public void clearModelData() {
+        status_update_list.clear();
+        fireTableChanged(new TableModelEvent(this));
+    }   
+    
+}
Index: trunk/src/tmcsim/cadsimulator/viewer/MediaStatusPanel.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/viewer/MediaStatusPanel.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/viewer/MediaStatusPanel.java	(revision 2)
@@ -0,0 +1,90 @@
+package tmcsim.cadsimulator.viewer;
+
+import java.util.TreeMap;
+
+import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
+
+import tmcsim.cadsimulator.videocontrol.DVDStatusUpdate;
+import tmcsim.cadsimulator.videocontrol.DVDTitleUpdate;
+
+/**
+ * MediaStatusPanel is a GUI object used for displaying information
+ * for DVD connections created by the CAD Simulator.  Tabs for each
+ * DVD are created and information is displayed on a DVDInfoPanel.
+ * All status and title updates are sent to the corresponding
+ * DVDInfoPanel.  The DVDs are referenced by connection info, which
+ * is unique to each DVD player.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+@SuppressWarnings("serial")
+public class MediaStatusPanel extends JPanel {
+    
+    /** Map of DVDInfoPanels(values) referenced by a DVD's connection info(key). */
+    private TreeMap<String, DVDInfoPanel> dvdPanels = null;
+
+    /**
+     * Constructor.  Initialize data and GUI components.
+     */
+    public MediaStatusPanel() {
+
+        dvdPanels   = new TreeMap<String, DVDInfoPanel>();
+        
+        initComponents();
+    }
+    
+    /**
+     * Updates the current DVDInfoPanel with the status update.
+     * If a panel does not current exist, create one and add
+     * a new tab.
+     * 
+     * @param update DVD status update.
+     */
+    public void updateDVDStatus(DVDStatusUpdate update) {
+        if(dvdPanels.get(update.connectionInfo) == null) {
+            dvdPanels.put(update.connectionInfo, new DVDInfoPanel(
+                    update.connectionInfo));
+
+            mediaTabs.addTab(
+                    "DVD " + (Integer.parseInt(update.connectionInfo
+                                    .substring(update.connectionInfo
+                                            .indexOf(":")+1)) % 3000), 
+                    dvdPanels.get(update.connectionInfo));
+        }
+        
+        
+        dvdPanels.get(update.connectionInfo).updateDVDStatus(update);
+    }
+    
+    /**
+     * Updates the current DVDInfoPanel with the title update.
+     * If a panel does not current exist, create one and add
+     * a new tab.
+     * 
+     * @param update DVD title update.
+     */
+    public void updateDVDTitle(DVDTitleUpdate update) {
+        if(dvdPanels.get(update.connectionInfo) == null) {
+            dvdPanels.put(update.connectionInfo, new DVDInfoPanel(update.connectionInfo));
+            
+            mediaTabs.addTab("DVD " + dvdPanels.size(), 
+                    dvdPanels.get(update.connectionInfo));
+        }
+        
+        dvdPanels.get(update.connectionInfo).updateDVDTitle(update);
+    }
+    
+    /**
+     * Initialize GUI components.
+     */
+    private void initComponents() {
+        mediaTabs = new JTabbedPane();
+        
+        add(mediaTabs);
+    }
+    
+    private JTabbedPane mediaTabs;
+    
+}
Index: trunk/src/tmcsim/cadsimulator/viewer/SimulationStatusPanel.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/viewer/SimulationStatusPanel.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/viewer/SimulationStatusPanel.java	(revision 2)
@@ -0,0 +1,446 @@
+package tmcsim.cadsimulator.viewer;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.util.logging.Handler;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import java.util.logging.Logger;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.border.EtchedBorder;
+import javax.swing.border.TitledBorder;
+
+import tmcsim.common.CADEnums.PARAMICS_STATUS;
+import tmcsim.common.CADEnums.SCRIPT_STATUS;
+
+/**
+ * SimulationStatusPanel is a GUI object used for displaying information
+ * for the current simulation.  This information includes:
+ * 
+ * <ul>
+ * <li>Current simulation time.</li>
+ * <li>Current simulation status.</li>
+ * <li>Number of remote CAD Clients connected.</li>
+ * <li>Status of Simulation Manager connection.</li>
+ * <li>Status of Paramics connection.</li>
+ * <li>Paramics Network Loaded</li>
+ * <li>Information log messages.</li>
+ * <li>Error log messages</li>
+ * </ul>
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+@SuppressWarnings("serial")
+public class SimulationStatusPanel extends JPanel {
+
+    /**
+     * Logging Handler to listen for Information and Error
+     * messages logged for the CAD Simulator.  Received LogRecords
+     * are displayed in the info or error message Text Area.
+     * 
+     * @author Matthew Cechini
+     */
+    private class SimulatorErrorHandler extends Handler {
+        public void close() throws SecurityException { } 
+        public void flush() { }
+        public void publish(LogRecord rec) {
+            StringBuffer msgBuffer = new StringBuffer();
+
+            msgBuffer.append(rec.getSourceClassName() + "." + 
+                rec.getSourceMethodName() + " = " + 
+                rec.getMessage());
+            
+            if(rec.getLevel() == Level.INFO)
+                infoMessagesTA.setText(infoMessagesTA.getText() + 
+                    msgBuffer.toString() + "\n");
+            else 
+                errorMessagesTA.setText(errorMessagesTA.getText() + 
+                        msgBuffer.toString() + "\n");
+        }
+    }
+    
+    /** Count of how many CAD clients have connected. */
+    private int numClientsConnected = 0;
+    
+    /** Logging ErrorHandler. */
+    private SimulatorErrorHandler errorHandler;
+    
+    /**
+     * Constructor.  Initialize GUI Objects.  Register the logging handler
+     * to listen for log records from all loggers that exist in the
+     * "tmcsim.cadsimulator" package structure.
+     */ 
+    public SimulationStatusPanel() {
+        
+        initTimeAndStatus();
+        initAdditionalInfo();   
+        initMessagesPanes();
+        
+        errorHandler = new SimulatorErrorHandler();     
+        Logger.getLogger("tmcsim.cadsimulator").addHandler(errorHandler);       
+        
+        CADSimulatorViewerBox = Box.createVerticalBox();
+        CADSimulatorViewerBox.add(simulationTimeAndStatusBox);
+        CADSimulatorViewerBox.add(additionalInfoBox);
+        CADSimulatorViewerBox.add(infoMessagesPane);
+        CADSimulatorViewerBox.add(errorMessagesPane);
+        
+        add(CADSimulatorViewerBox); 
+    }   
+
+    /** 
+     * Method is called when a CAD Client disconnects from the CAD Simulator.  
+     * The displayed number of connected clients is incremented by one.
+     */
+    public void connectClient() {
+        
+        numClientsConnected++;
+                    
+        termConnectedTF.setText(String.valueOf(numClientsConnected));       
+    }
+    
+    /** 
+     * Method is called when a CAD Client disconnects from the CAD Simulator.  
+     * The displayed number of connected clients is decremented by one.
+     */
+    public void disconnectClient() {
+        
+        if(numClientsConnected > 0)
+            numClientsConnected--;
+                    
+        termConnectedTF.setText(String.valueOf(numClientsConnected));
+    }
+    
+    /**
+     * Method is called when Simulation Manager connects or disconnects.
+     *
+     * @param connection True if simulation manager is connected, false if not.
+     */
+    public void setSimManagerStatus(boolean connection) {
+        
+        if(connection) 
+            managerConnectedTF.setText("Yes");      
+        else
+            managerConnectedTF.setText("No");
+        
+    }
+    
+    /**
+     * Method called to convert current simulation time (parameter long value) to
+     * a string of format H:MM:SS. Time is then updated on GUI.
+     *
+     * @param seconds Long value of current time
+     */
+    public void setTime(long seconds) {     
+        String time = new String();     
+        long timeSegment;   
+        
+        timeSegment = seconds / 3600;
+        time += String.valueOf(timeSegment) + ":";      
+        
+        seconds = seconds % 3600;
+        
+        timeSegment = seconds / 60;
+        if(timeSegment < 10)
+            time += "0";
+        
+        time += String.valueOf(timeSegment) + ":";      
+        seconds = seconds % 60; 
+        
+        timeSegment = seconds;
+        if(timeSegment < 10)
+            time += "0";
+        
+        time += String.valueOf(timeSegment);
+        
+        simulationClockLabel.setText(time);     
+        
+    }
+    
+    /**
+     * This method is called within the CADSimulator whenever an error occurs.  The message
+     * is then displayed to the user in the "Error Messages" portion of the CAD Simulator Viewer.
+     * Invoke method with null parameter to clear messages.
+     *
+     * @param errorMessage String message that will be displayed
+     */
+    protected void displayError(String errorMessage) {
+        if(errorMessage == null)
+            errorMessagesTA.setText("");
+        else 
+            errorMessagesTA.append(errorMessage + "\n");    
+    }
+    
+    /**
+     * Method is called to display the current status of the simulation.
+     *
+     * @param newStatus Current status of simulation.  The following table describes
+     * each possible status and what is displayed.  Each status code is found
+     * as a public static int in the Coordinator Class.
+     *
+     *<table cellpadding="2" cellspacing="2" border="1"
+     * style="text-align: left; width: 250px;">
+     *  <tbody>
+     *    <tr>
+     *      <th>Status<br></th>
+     *      <th>Actions Taken<br></th>
+     *    </tr>
+     *    <tr>
+     *      <td>NO_SCRIPT<br></td>
+     *      <td>Set the simulation status text to a black "No Script".  <br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>SCRIPT_STOPPED_NOT_STARTED<br></td>
+     *      <td>Set the simulation status text to a red "Ready".  <br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>SCRIPT_PAUSED_STARTED<br></td>
+     *      <td>Set the simulation status text to a red "Paused".  <br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>SCRIPT_RUNNING<br></td>
+     *      <td>Set the simulation status text to a green "Running".  <br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>ATMS_SYNCHRONIZATION<br></td>
+     *      <td>Set the simulation status text to an orange "Synchronizing".  <br></td>
+     *    </tr>
+     *  </tbody>
+     *</table>     */
+    public void setScriptStatus(SCRIPT_STATUS newStatus) {
+        
+        switch(newStatus) {     
+            case NO_SCRIPT:
+                simulationStatusText.setText("No Script");
+                simulationStatusText.setForeground(Color.BLACK);                                            
+                break;          
+                
+            case SCRIPT_STOPPED_NOT_STARTED:
+                simulationStatusText.setText("Ready");
+                simulationStatusText.setForeground(Color.RED);          
+                break;          
+                
+            case SCRIPT_PAUSED_STARTED:
+                simulationStatusText.setText("Paused");
+                simulationStatusText.setForeground(Color.RED);
+                break;
+                
+            case SCRIPT_RUNNING:
+                simulationStatusText.setText("Running");
+                simulationStatusText.setForeground(Color.GREEN);
+                break;
+            case ATMS_SYNCHRONIZATION:
+                simulationStatusText.setText("Synchronizing");
+                simulationStatusText.setForeground(Color.ORANGE);
+                break;
+            
+        }   
+    }
+    
+    /**
+     * Method is called when a connection to paramics is made or dropped.
+     *
+     * @param newStatus The status denoting whether a connection has been
+     * made or dropped.
+     */
+    public void setParamicsStatus(PARAMICS_STATUS newStatus) {
+        
+        switch(newStatus) {
+            case CONNECTED:
+                paramicsConnectedTF.setText("Yes");
+                break;
+            case DISCONNECTED:
+                paramicsConnectedTF.setText("No");          
+                break;
+        }
+    }
+    
+    /**
+     * Method is called when a paramics network is loaded.
+     *
+     * @param networkID Unique ID for Paramics network that has been loaded.
+     */
+    public void setParamicsNetworkLoaded(String networkID) {
+        networkLoadedTF.setText(networkID);
+    }    
+    
+        
+    /** Initialize Time and Status GUI Components */
+    private void initTimeAndStatus() {
+        
+        simulationTime        = new JPanel();
+        simulationClock      = new JPanel();
+        simulationStatus     = new JLabel("Simulation Status");
+        simulationStatusText = new JLabel("No Script");
+        
+        simulationTime.setLayout(new BorderLayout());       
+        simulationClock.setPreferredSize(new Dimension(100, 60));
+        simulationTimeAndStatusBox = new Box(BoxLayout.X_AXIS);
+        simulationStatusBox = new Box(BoxLayout.Y_AXIS);        
+        simulationTimeBox   = new Box(BoxLayout.Y_AXIS);
+        simulationClockBox  = new Box(BoxLayout.X_AXIS);
+        
+        simulationStatus.setAlignmentX(Box.CENTER_ALIGNMENT);
+        simulationStatusText.setAlignmentX(Box.CENTER_ALIGNMENT);
+        simulationStatusText.setName("simulationStatusText");
+        
+        TitledBorder title = BorderFactory.createTitledBorder(
+                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Status");
+        title.setTitleJustification(TitledBorder.LEFT);
+        simulationStatusBox.setBorder(title);
+        
+        simulationStatusBox.setMaximumSize(new Dimension(140, 60));
+        simulationStatusBox.setAlignmentX(Box.CENTER_ALIGNMENT);                    
+        
+        simulationStatusBox.add(Box.createHorizontalStrut(120));
+        simulationStatusBox.add(Box.createVerticalGlue());
+        simulationStatusBox.add(simulationStatusText);
+        simulationStatusBox.add(Box.createVerticalGlue());
+        
+        simulationClockLabel = new JLabel("0:00:00");
+        simulationClockLabel.setFont(new Font("Geneva", Font.BOLD, 70));
+        simulationClockLabel.setForeground(Color.BLACK);
+        simulationClockLabel.setBackground(Color.BLACK);
+        simulationClockBox.setForeground(Color.BLACK);
+        simulationClockBox.setBackground(Color.BLACK);
+        simulationClockBox.add(simulationClockLabel);
+        simulationClockBox.setAlignmentX(Box.CENTER_ALIGNMENT); 
+        simulationTimeBox.add(simulationClockBox);
+                
+        simulationTimeAndStatusBox.add(Box.createHorizontalStrut(20));              
+        simulationTimeAndStatusBox.add(simulationTimeBox);
+        simulationTimeAndStatusBox.add(Box.createHorizontalStrut(20));
+        simulationTimeAndStatusBox.add(simulationStatusBox);        
+        simulationTimeAndStatusBox.add(Box.createHorizontalStrut(20));          
+    }
+    
+    
+    /** Initialize Additional Info Label GUI Components */
+    private void initAdditionalInfo() {
+        
+        terminalsConnectedLabel = new JLabel("Connected CAD Terminals: ");
+        termConnectedTF  = new JTextField("   " + String.valueOf(numClientsConnected));
+        termConnectedTF.setEditable(false);
+        termConnectedTF.setName("termConnectedTF");
+        
+        termConnectedBox = new Box(BoxLayout.X_AXIS);
+        termConnectedBox.add(terminalsConnectedLabel);
+        termConnectedBox.add(Box.createHorizontalGlue());
+        termConnectedBox.add(termConnectedTF);
+        
+        
+        managerConnectedLabel     = new JLabel("Simulation Manager Connected: ");
+        managerConnectedTF = new JTextField("  No");
+        managerConnectedTF.setEditable(false);
+        managerConnectedTF.setName("managerConnectedTF");
+                
+        managerConnectedBox = new Box(BoxLayout.X_AXIS);
+        managerConnectedBox.add(managerConnectedLabel);
+        managerConnectedBox.add(Box.createHorizontalGlue());
+        managerConnectedBox.add(managerConnectedTF);
+        
+        
+        paramicsConnectedLabel     = new JLabel("Connected to Paramics: ");
+        paramicsConnectedTF = new JTextField("  No");
+        paramicsConnectedTF.setEditable(false);
+                
+        paramicsConnectedBox = new Box(BoxLayout.X_AXIS);
+        paramicsConnectedBox.add(paramicsConnectedLabel);
+        paramicsConnectedBox.add(Box.createHorizontalGlue());
+        paramicsConnectedBox.add(paramicsConnectedTF);
+        
+        
+        networkLoadedLabel     = new JLabel("Network Loaded: ");
+        networkLoadedTF = new JTextField("None");       
+        networkLoadedTF.setEditable(false);
+                
+        networkLoadedBox = new Box(BoxLayout.X_AXIS);
+        networkLoadedBox.add(networkLoadedLabel);
+        networkLoadedBox.add(Box.createHorizontalGlue());
+        networkLoadedBox.add(networkLoadedTF);
+        
+
+        additionalInfoBox = new Box(BoxLayout.Y_AXIS);
+        additionalInfoBox.setMinimumSize(new Dimension(300, 150));      
+        
+        additionalInfoBox.add(Box.createVerticalStrut(10));
+        additionalInfoBox.add(termConnectedBox);    
+        additionalInfoBox.add(Box.createVerticalStrut(10));
+        additionalInfoBox.add(managerConnectedBox); 
+        additionalInfoBox.add(Box.createVerticalStrut(10));
+        additionalInfoBox.add(paramicsConnectedBox);    
+        additionalInfoBox.add(Box.createVerticalStrut(10));
+        additionalInfoBox.add(networkLoadedBox);    
+        additionalInfoBox.add(Box.createVerticalStrut(20)); 
+        
+            
+    }
+    
+    /**  Initialize Info & Error Messages GUI Components */
+    private void initMessagesPanes() {
+
+        infoMessagesTA = new JTextArea(6, 30);
+        infoMessagesTA.setEditable(false);
+        infoMessagesPane = new JScrollPane(errorMessagesTA);
+        infoMessagesPane.setPreferredSize(new Dimension(300, 100));
+        
+        infoMessagesPane.setBorder(BorderFactory.createTitledBorder(
+                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Info Messages"));  
+
+        
+        errorMessagesTA = new JTextArea(6, 30);
+        errorMessagesTA.setForeground(Color.RED);
+        errorMessagesTA.setEditable(false);
+        errorMessagesPane = new JScrollPane(errorMessagesTA);
+        errorMessagesPane.setPreferredSize(new Dimension(300, 150));
+        
+        errorMessagesPane.setBorder(BorderFactory.createTitledBorder(
+                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Error Messages")); 
+    
+    }
+    
+        
+    private Box additionalInfoBox;
+    private Box termConnectedBox;   
+    private Box managerConnectedBox;    
+    private Box paramicsConnectedBox;
+    private Box networkLoadedBox;   
+    private Box CADSimulatorViewerBox;
+    private Box simulationTimeAndStatusBox;
+    private Box simulationStatusBox;        
+    private Box simulationTimeBox;
+    private Box simulationClockBox;
+    
+    private JLabel managerConnectedLabel;
+    private JLabel paramicsConnectedLabel;  
+    private JLabel simulationStatus;
+    private JLabel simulationClockLabel;
+    private JLabel simulationStatusText;
+    private JLabel terminalsConnectedLabel; 
+    private JLabel networkLoadedLabel;
+    
+    private JPanel simulationTime;
+    private JPanel simulationClock;     
+        
+    private JTextField managerConnectedTF;
+    private JTextField paramicsConnectedTF;
+    private JTextField termConnectedTF;
+    private JTextField networkLoadedTF;
+        
+    private JScrollPane infoMessagesPane;
+    private JScrollPane errorMessagesPane;
+
+    private JTextArea infoMessagesTA;
+    private JTextArea errorMessagesTA;
+}
Index: trunk/src/tmcsim/cadsimulator/viewer/CADSimulatorViewer.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/viewer/CADSimulatorViewer.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/viewer/CADSimulatorViewer.java	(revision 2)
@@ -0,0 +1,173 @@
+package tmcsim.cadsimulator.viewer;
+
+import java.awt.AWTEvent;
+import java.awt.Dimension;
+import java.awt.event.WindowEvent;
+
+import javax.swing.JFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JTabbedPane;
+
+import tmcsim.cadsimulator.videocontrol.DVDStatusUpdate;
+import tmcsim.cadsimulator.videocontrol.DVDTitleUpdate;
+import tmcsim.cadsimulator.viewer.actions.ExitAction;
+import tmcsim.common.CADEnums.PARAMICS_STATUS;
+import tmcsim.common.CADEnums.SCRIPT_STATUS;
+
+/**
+ * This class provides a GUI to view current status information for the
+ * CAD Simulator.
+ *
+ * @see SimulationStatusPanel
+ * @see MediaStatusPanel
+ * @author Matthew Cechini 
+ * @version $Revision: 1.3 $ $Date: 2006/06/06 20:46:41 $
+ */
+@SuppressWarnings("serial")
+public class CADSimulatorViewer extends JFrame {
+
+    /** Panel to display simulation information. */
+    private SimulationStatusPanel simulationPanel;
+    
+    /** Panel to display media control information. */
+    private MediaStatusPanel mediaPanel;
+    
+    /** Constructor. */
+    public CADSimulatorViewer() {
+        super("CAD Simulator");
+        
+        initComponents();
+    }    
+    
+    /** 
+     * @see SimulationStatusPanel
+     */
+    public void connectClient() {
+        simulationPanel.connectClient();
+    }
+    
+    /** 
+     * @see SimulationStatusPanel
+     */
+    public void disconnectClient() {
+        simulationPanel.disconnectClient();
+    }
+    
+    /** 
+     * @see SimulationStatusPanel
+     */
+    public void setSimManagerStatus(boolean connection) {
+        simulationPanel.setSimManagerStatus(connection);        
+    }
+    
+    /** 
+     * @see SimulationStatusPanel
+     */
+    public void setTime(long seconds) {
+        simulationPanel.setTime(seconds);
+    }
+
+    /** 
+     * @see SimulationStatusPanel
+     */
+    public void setScriptStatus(SCRIPT_STATUS newStatus) {
+        simulationPanel.setScriptStatus(newStatus);         
+    }
+    
+    /** 
+     * @see SimulationStatusPanel
+     */
+    public void setParamicsStatus(PARAMICS_STATUS newStatus) {
+        simulationPanel.setParamicsStatus(newStatus);       
+    }
+    
+    /** 
+     * @see SimulationStatusPanel
+     */
+    public void setParamicsNetworkLoaded(String networkID) {
+        simulationPanel.setParamicsNetworkLoaded(networkID);        
+    }
+
+    /** 
+     * @see MediaStatusPanel
+     */
+    public void updateDVDStatus(DVDStatusUpdate update) {
+        mediaPanel.updateDVDStatus(update);
+    }
+
+    /** 
+     * @see MediaStatusPanel
+     */
+    public void updateDVDTitle(DVDTitleUpdate update) {
+        mediaPanel.updateDVDTitle(update);
+    }
+    
+    /**
+     * Method calls the processEvent() method with a WINDOW_CLOSING
+     * WindowEvent to start the application closing process.
+     */
+    public void closeViewer() {
+        processEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
+    }
+
+    /**
+     * Overloads the processEvent method.  If the AWTEvent is a 
+     * WINDOW_CLOSING event, prompt the user to confirm the action.
+     * If confirmed, close the application.
+     */
+    protected void processEvent(AWTEvent evt) {
+        
+        if(evt.getID() == WindowEvent.WINDOW_CLOSING) {
+            int option = JOptionPane.showConfirmDialog(null,
+                    "Closing the CAD Simulator will stop the current " +
+                    "simulation.  Do you wish to continue exiting?",
+                    "Confirm Exit",
+                    JOptionPane.YES_NO_OPTION);
+            
+            if(option != JOptionPane.NO_OPTION) {
+                System.exit(0);
+            }       
+        }
+     }
+    
+    /** Initialize GUI Components */
+    private void initComponents() {
+
+        
+        simulationPanel = new SimulationStatusPanel();
+        mediaPanel      = new MediaStatusPanel();
+        
+        cadSimTabbedPane = new JTabbedPane();
+        cadSimTabbedPane.addTab("Status", simulationPanel);
+        cadSimTabbedPane.addTab("Media", mediaPanel);
+        
+        add(cadSimTabbedPane);      
+
+        menubar = new JMenuBar();
+        
+        fileMenu = new JMenu("File");
+        menubar.add(fileMenu);
+        
+        exitMenuItem = new JMenuItem(new ExitAction(this));
+        fileMenu.add(exitMenuItem);
+        
+        setJMenuBar(menubar);
+        
+        setPreferredSize(new Dimension(500, 575));  
+        pack();
+        setResizable(false);
+    }
+    
+    
+    private JTabbedPane cadSimTabbedPane;
+    
+    private JMenuBar menubar;
+    
+    private JMenu fileMenu;
+    
+    private JMenuItem exitMenuItem;
+    
+}
Index: trunk/src/tmcsim/cadsimulator/viewer/DVDInfoPanel.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/viewer/DVDInfoPanel.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/viewer/DVDInfoPanel.java	(revision 2)
@@ -0,0 +1,152 @@
+package tmcsim.cadsimulator.viewer;
+
+import java.awt.Dimension;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+
+import tmcsim.cadsimulator.videocontrol.DVDStatusUpdate;
+import tmcsim.cadsimulator.videocontrol.DVDTitleUpdate;
+import tmcsim.cadsimulator.viewer.model.DVDStatusTableModel;
+import tmcsim.cadsimulator.viewer.model.DVDTitleTableModel;
+
+/**
+ * DVDInfoPanel is a GUI component used in the CADSimulatorViewer.  The panel
+ * displays information regarding the DVD player's connection information.
+ * One table on the panel shows all DVD title that have been played or 
+ * repeated.  A second table shows all DVD status updates that have been
+ * received from the controller. 
+ * 
+ * @author Matthew Cechini
+ * @version 
+ */
+@SuppressWarnings("serial")
+public class DVDInfoPanel extends JPanel {
+
+    /** DVD player connection info. */
+    private String connInfo = null;
+    
+    /** Table model for the title table. */
+    private DVDTitleTableModel titleTableModel;
+
+    /** Table to display DVD title plays and repeats. */
+    private JTable titleTable;
+    
+    /** Table model for the Status table. */
+    private DVDStatusTableModel statusTableModel;
+    
+    /** Table to display DVD status updates. */
+    private JTable statusTable;
+    
+    
+    /**
+     * Constructor.  Initialize the panel GUI components.
+     * 
+     * @param connectionInfo DVD player connection info.
+     */
+    public DVDInfoPanel(String connectionInfo) {
+        connInfo = connectionInfo;
+        
+        initComponents();
+    }   
+    
+    /**
+     * This method updates the DVD status table with the new update object.
+     * @param update Update DVD Status update.
+     */
+    public void updateDVDStatus(DVDStatusUpdate update) {
+        statusTableModel.addStatusUpdate(update);
+    }
+
+    /**
+     * This method updates the DVD title table with the new update object.
+     * @param update Update DVD Status update.
+     */
+    public void updateDVDTitle(DVDTitleUpdate update) {
+        titleTableModel.addTitleUpdate(update);
+    }
+    
+    /**
+     * Initialize the GUI components.
+     */
+    private void initComponents() {
+
+        connInfoLbl = new JLabel("Connection Info:");
+        connInfoLbl.setAlignmentX(Box.LEFT_ALIGNMENT);
+        connInfoTF  = new JTextField(connInfo);
+        connInfoTF.setColumns(30);
+        connInfoTF.setAlignmentX(Box.LEFT_ALIGNMENT);
+        connInfoTF.setEditable(false);
+        
+        Box connInfoBox = Box.createVerticalBox();
+        connInfoBox.add(connInfoLbl);
+        connInfoBox.add(connInfoTF);
+        connInfoBox.setAlignmentX(Box.CENTER_ALIGNMENT);
+        
+        titleTableModel = new DVDTitleTableModel();
+        titleTable      = new JTable(titleTableModel);
+        titleTable.getTableHeader().setReorderingAllowed(false);  
+        
+        for(int c = 0; c < titleTable.getColumnCount(); c++) {
+            titleTable.getColumnModel().getColumn(c).setMinWidth(
+                    titleTableModel.getColumnMinWidth(c));
+            titleTable.getColumnModel().getColumn(c).setMaxWidth(
+                    titleTableModel.getColumnMaxWidth(c));
+            titleTable.getColumnModel().getColumn(c).setPreferredWidth(
+                    titleTableModel.getColumnPrefWidth(c));
+            titleTable.getColumnModel().getColumn(c).setResizable(true);
+        }
+        
+        titlePane       = new JScrollPane();
+        titlePane.setAlignmentX(Box.CENTER_ALIGNMENT);
+        //titlePane.setMinimumSize(new Dimension(,));
+        titlePane.setPreferredSize(new Dimension(425, 225));        
+        titlePane.setViewportView(titleTable);
+        titlePane.setBorder(BorderFactory.createTitledBorder(
+                    BorderFactory.createRaisedBevelBorder(), "Title Updates"));
+
+        statusTableModel = new DVDStatusTableModel();
+        statusTable      = new JTable(statusTableModel);
+        statusTable.getTableHeader().setReorderingAllowed(false);  
+        
+        for(int c = 0; c < statusTable.getColumnCount(); c++) {
+            statusTable.getColumnModel().getColumn(c).setMinWidth(
+                    statusTableModel.getColumnMinWidth(c));
+            statusTable.getColumnModel().getColumn(c).setMaxWidth(
+                    statusTableModel.getColumnMaxWidth(c));
+            statusTable.getColumnModel().getColumn(c).setPreferredWidth(
+                    statusTableModel.getColumnPrefWidth(c));
+            statusTable.getColumnModel().getColumn(c).setResizable(true);
+        }
+        
+        statusPane       = new JScrollPane();
+        statusPane.setAlignmentX(Box.CENTER_ALIGNMENT);
+        //statusPane.setMinimumSize(new Dimension(,));
+        statusPane.setPreferredSize(new Dimension(425, 150));       
+        statusPane.setViewportView(statusTable);
+        statusPane.setBorder(BorderFactory.createTitledBorder(
+                BorderFactory.createRaisedBevelBorder(), "Status Updates"));
+        
+        Box panelBox = Box.createVerticalBox();
+        panelBox.add(connInfoBox);
+        panelBox.add(Box.createVerticalStrut(10));
+        panelBox.add(titlePane);
+        panelBox.add(Box.createVerticalStrut(10));
+        panelBox.add(statusPane);
+        panelBox.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
+        
+        add(panelBox);
+    }
+    
+    private JScrollPane titlePane;
+    private JScrollPane statusPane;
+    
+    private JLabel connInfoLbl;
+    
+    private JTextField connInfoTF;
+}
Index: trunk/src/tmcsim/cadsimulator/CADScreenManager.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/CADScreenManager.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/CADScreenManager.java	(revision 2)
@@ -0,0 +1,985 @@
+
+package tmcsim.cadsimulator;
+
+
+import java.rmi.RemoteException;
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.Observable;
+import java.util.Observer;
+import java.util.StringTokenizer;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.TreeMap;
+import java.util.Vector;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import tmcsim.cadmodels.BlankScreenModel;
+import tmcsim.cadmodels.CADRoutedMessage;
+import tmcsim.cadmodels.CADScreenModel;
+import tmcsim.cadmodels.IncidentBoardModel;
+import tmcsim.cadmodels.IncidentBoardModel_obj;
+import tmcsim.cadmodels.IncidentInquiryDetails;
+import tmcsim.cadmodels.IncidentInquiryModel;
+import tmcsim.cadmodels.IncidentInquiryModel_obj;
+import tmcsim.cadmodels.IncidentSummaryModel;
+import tmcsim.cadmodels.IncidentSummaryModel_obj;
+import tmcsim.cadmodels.RoutedMessageModel;
+import tmcsim.client.cadclientgui.data.Incident;
+import tmcsim.client.cadclientgui.data.IncidentEvent;
+import tmcsim.common.ObserverMessage;
+import tmcsim.common.CADEnums.CADScreenNum;
+import tmcsim.common.CADEnums.CADScreenType;
+import tmcsim.common.CADEnums.CAD_ERROR;
+import tmcsim.common.CADEnums.CAD_KEYS;
+import tmcsim.common.CADProtocol.CAD_FIELD_CODES;
+import tmcsim.common.CADProtocol.DATA_TAGS;
+
+
+/**
+ * CADScreenManager is used to contain the current information for all four 
+ * CAD screens that are available on a CAD Client.  The CADScreenManager
+ * uniquely identifies a CAD Client with a unique CAD Position number and User 
+ * ID.  The CADScreenManager object keeps track of the number of routed 
+ * messages received and the screen update map.<br>
+ * <br>
+ * The CADScreenManager object observers the Coordinator for any updates to 
+ * the simulation data. Whenever there is an event in the simulation, the 
+ * CADScreenManager object determines if the update is relevant for this CAD 
+ * position and the currently displayed CAD screens.<br>
+ * <br> 
+ * CADScreenManager handles all CAD commands, either through the receiveCommand() 
+ * method or series of screen request methods.
+ * 
+ * A timer is instantiated to update the remote CAD client with the current 
+ * time at each minute.
+ * 
+ * @author Matthew Cechini 
+ * @version $Revision: 1.5 $ $Date: 2006/06/06 20:46:41 $
+ */
+public class CADScreenManager extends Observable implements Observer {
+
+    
+    /**
+     * The CADScreenTimer is a timer task that calls the updateTime()
+     * method everytime it expires.  This timer is used to keep the
+     * CAD time current on the CAD screen.
+     */
+    private class CADScreenTimer extends TimerTask {
+        public void run() {
+            updateTime();
+        }
+    }       
+        
+    /** Reference to the Coordinator object. */
+    private Coordinator theCoordinator;
+    
+    /** The current value of the CAD terminal's position. */
+    private int CADPosition;    
+
+    /** Unique CAD User ID for this set of CAD Screens. */
+    private String CADUserID;
+    
+    /** The current CAD Screen number. */    
+    private CADScreenNum currentCADScreenNum; 
+        
+    /**
+     * Map of the CAD Screens.  The map's values are the CADScreenNum enumeration values,
+     * which reference the current CADScreenModel object values.
+     */
+    private TreeMap<CADScreenNum, CADScreenModel> CADScreensMap;
+    
+    /** 
+     * Map of CAD Screen updates.  The map's values are a boolean signifying whether there
+     * is an update available for each CAD screen, keyed by the CADScreenNum objects. 
+     */
+    private TreeMap<CADScreenNum, Boolean> CADScreenUpdates;
+        
+    /** Map of CADRoutedMessages that have been received to this CAD terminal, and whether
+     *  the message has been read. */
+    private TreeMap<CADRoutedMessage, Boolean> messageMap = null;
+    
+    /**
+     * Constructor.  Initialize CADScreen windows.  All screens are initialized 
+     * to a blank screen.  The CADScreenUpdates map is also initialized with each
+     * cad screen number being set to having a false update value.
+     * The CADScreenTimer is created and scheduled to call the updateTime() 
+     * method every minute to increment the current CAD time.
+     */  
+    public CADScreenManager(Coordinator coor) {
+        
+        theCoordinator = coor;
+        
+        CADPosition = 0;
+        CADUserID   = "A00000";
+        currentCADScreenNum = CADScreenNum.ONE;
+    
+        CADScreensMap    = new TreeMap<CADScreenNum, CADScreenModel>();
+        CADScreenUpdates = new TreeMap<CADScreenNum, Boolean>();
+
+        CADScreenNum screenNum = CADScreenNum.ONE;
+
+        CADScreensMap.put(screenNum, new BlankScreenModel(screenNum));
+        CADScreenUpdates.put(screenNum, false);
+        screenNum = screenNum.next();
+        
+        CADScreensMap.put(screenNum, new BlankScreenModel(screenNum)); 
+        CADScreenUpdates.put(screenNum, false);
+        screenNum = screenNum.next();
+        
+        CADScreensMap.put(screenNum, new BlankScreenModel(screenNum)); 
+        CADScreenUpdates.put(screenNum, false);
+        screenNum = screenNum.next();
+        
+        CADScreensMap.put(screenNum, new BlankScreenModel(screenNum)); 
+        CADScreenUpdates.put(screenNum, false);
+        screenNum = screenNum.next();       
+
+        CADScreenModel.theCADTime = CADSimulator.getCADTime();
+        CADScreenModel.theCADDate = CADSimulator.getCADDate();  
+            
+        messageMap = new TreeMap<CADRoutedMessage, Boolean>();     
+
+        Date d = new Date();
+        long delay = (60 - ((d.getTime() / 1000) % 60)) * 1000;
+
+        Timer timer             = new Timer();  
+        CADScreenTimer cadTimer = new CADScreenTimer();   
+        timer.scheduleAtFixedRate(cadTimer, new Date(d.getTime() + delay), (long)1000 * 60);        
+        
+    }
+
+    /**
+     * Called by the timer at the beginning of every minute.  When this method 
+     * is called, notify observers with the new time.
+     */  
+    protected void updateTime() {
+        CADScreenModel.theCADTime = CADSimulator.getCADTime();
+        
+        setChanged();
+        notifyObservers(new ObserverMessage(ObserverMessage.messageType.TIME_UPDATE, 
+                CADSimulator.getCADTime()));
+    }   
+ 
+    /**
+     * Returns the current CAD model after updating it with any new screen 
+     * updates and messages.
+     * 
+     * @return The current CAD model object.
+     */
+    public CADScreenModel getCurrentCADModel() {
+
+        updateCADModel();
+        
+        return currentCADModel();   
+    }
+    
+    /**
+     * Set the CAD position for this terminal.  
+     * @param position The new CAD position.
+     */  
+    public void setCADPosition(int position) {  
+        CADPosition = position; 
+    }
+    
+    /**
+     * Set the CAD user id for this terminal.
+     * @param userID The new CAD user id.
+     */
+    public void setCADUserID(String userID) {
+        CADUserID = userID;
+    }
+    
+    /**
+     * Updates the current CAD model with the number of routed messages
+     * that have been received by this terminal, and the current 
+     * update map.
+     */
+    private void updateCADModel() {
+        currentCADModel().numberRoutedMessages = messageMap.size();
+        currentCADModel().unreadMessages = messageMap.values().contains(new Boolean(false));
+        currentCADModel().screenUpdateMap.putAll(CADScreenUpdates);
+    }
+    
+    /**
+     * A helper method to reduce code.  The CADScreenModel object for the
+     * current CAD screen is returned from the CADScreensMap.
+     * @return The current CADScreenModel object.
+     */
+    private CADScreenModel currentCADModel() {
+        
+        return CADScreensMap.get(currentCADScreenNum);
+    }
+    
+    /**
+     * Returns the log info for this terminal in the following format: XXXYYYYY.
+     * XXX is the cad position, left zero padded. YYYYYY is the CAD user id.   
+     * @return Log info string.
+     */
+    private String getLogInfo() {
+        StringBuffer logInfoBuf = new StringBuffer();
+        
+        while(Integer.toString(CADPosition).length() + logInfoBuf.length() < 3) 
+            logInfoBuf.append("0");
+        
+        logInfoBuf.append(CADPosition);
+        logInfoBuf.append(CADUserID);
+        
+        return logInfoBuf.toString();
+    }
+    
+    /**
+     * This method receives ObserverMessage updates.  The message types that
+     * are responded to are:
+     * 
+     * INCIDENT_SUMMARY - Update all CADScreenManager that are showing the 
+     *                    SA_INCIDENT_SUMMARY screen.  Add the parameter
+     *                    object to the screen's model object, update the 
+     *                    CADScreenUpdates map, update the current model,
+     *                    and notify observers that there is a screen update.
+     * 
+     * INCIDENT_INQUIRY - Update all CADScreenManager that are showing the 
+     *                    II_INCIDENT_INQUIRY screen with the same log number
+     *                    as the parameter model object.  Add the parameter
+     *                    object to the screen's model object, update the 
+     *                    CADScreenUpdates map, update the current model,
+     *                    and notify observers that there is a screen update.
+     * 
+     * INCIDENT_BOARD - Update all CADScreenManager that are showing the 
+     *                    IB_INCIDENT_BOARD screen.  Add the parameter
+     *                    object to the screen's model object, update the 
+     *                    CADScreenUpdates map, update the current model,
+     *                    and notify observers that there is a screen update.
+     * 
+     * ROUTED_MESSAGE - Only respond to this update if the routed message
+     *                  has been routed to this CAD terminal posision.
+     *                  Update all CADScreenManager that are showing the 
+     *                  TO_ROUTED_MESSAGE screen.  Add the parameter
+     *                  object to the screen's model object, update the current model,
+     *                  and notify observers that there is a new routed message.
+     * 
+     * RESET_SIMULATION - Reset the CADScreensMap to contain the BlankScreenModel
+     *                    for all CADScreenManager, reset all screen updates to false, 
+     *                    and notify observers to refresh the view.  Update the
+     *                    current CAD model and notify observers of the screen
+     *                    update.  Finally, reset the current screen to screen ONE,
+     *                    and notify observers to refresh.
+     */
+    public void update(Observable o, Object arg) {
+        
+        ObserverMessage oMessage = (ObserverMessage)arg;
+        boolean updatedModel = false;
+        
+        switch(oMessage.type) {
+            case INCIDENT_SUMMARY:
+                
+                for(CADScreenModel model : CADScreensMap.values()) {
+                    if(model.getType() == CADScreenType.SA_INCIDENT_SUMMARY) {                          
+
+                        model.addModelObject(oMessage.value);
+                        updatedModel = true;
+                        
+                        CADScreenUpdates.put(model.getScreenNum(), true);
+                    }
+                }
+        
+                if(updatedModel) {      
+                    updateCADModel();
+                    
+                    setChanged();
+                    notifyObservers(new ObserverMessage(ObserverMessage.messageType.SCREEN_UPDATE, 
+                            CADScreenModel.updateMapToString(currentCADModel().screenUpdateMap))); 
+                }
+            
+                break;
+                                                
+            case INCIDENT_INQUIRY:
+
+                for(CADScreenModel model : CADScreensMap.values()) {
+                    if(model.getType() == CADScreenType.II_INCIDENT_INQUIRY) {                          
+
+                        if(((IncidentInquiryModel)model).logNumMatches(((IncidentInquiryModel_obj)oMessage.value))) {
+                            model.addModelObject(oMessage.value);
+                            updatedModel = true;
+
+                            CADScreenUpdates.put(model.getScreenNum(), true);
+                        }
+                    }
+                }
+                
+                if(updatedModel) {
+                    updateCADModel();
+                    
+                    setChanged();
+                    notifyObservers(new ObserverMessage(ObserverMessage.messageType.SCREEN_UPDATE, 
+                            CADScreenModel.updateMapToString(currentCADModel().screenUpdateMap))); 
+                    
+                    
+                }
+                break;
+                
+            case INCIDENT_BOARD:
+            
+                for(CADScreenModel model : CADScreensMap.values()) {
+                    if(model.getType() == CADScreenType.IB_INCIDENT_BOARD) {                        
+
+                        model.addModelObject(oMessage.value);           
+                        updatedModel = true;
+                    }
+                }
+            
+                if(updatedModel) {
+                    updateCADModel();
+                    
+                    setChanged();
+                    notifyObservers(new ObserverMessage(ObserverMessage.messageType.SCREEN_UPDATE, 
+                            CADScreenModel.updateMapToString(currentCADModel().screenUpdateMap))); 
+                }
+                
+                break;              
+
+            case ROUTED_MESSAGE:
+            
+                if(((CADRoutedMessage)oMessage.value).toPosition == CADPosition) { 
+                    messageMap.put((CADRoutedMessage)oMessage.value, false); 
+                    
+                    for(CADScreenNum screen : CADScreensMap.keySet()) {
+                        if(CADScreensMap.get(screen).getType() == CADScreenType.TO_ROUTED_MESSAGE) {
+                            ((RoutedMessageModel)CADScreensMap.get(screen)).addModelObject(oMessage.value);                                     
+                        }
+                    }
+                    
+                    updateCADModel();
+
+                    setChanged();
+                    notifyObservers(new ObserverMessage(ObserverMessage.messageType.ROUTED_MESSAGE, null));
+
+                }
+                
+                break;
+
+            case RESET_SIMULATION:
+                
+                for(CADScreenNum num : CADScreensMap.keySet()) {
+                    CADScreensMap.put(num, new BlankScreenModel(num));  
+
+                    currentCADScreenNum = num;
+                    CADScreenUpdates.put(num, false);
+                    
+                    setChanged();
+                    notifyObservers(new ObserverMessage(ObserverMessage.messageType.REFRESH_VIEW, null));
+                }
+
+                updateCADModel();               
+                setChanged();
+                notifyObservers(new ObserverMessage(ObserverMessage.messageType.SCREEN_UPDATE, 
+                        CADScreenModel.updateMapToString(currentCADModel().screenUpdateMap))); 
+
+                //reset back to screen one
+                currentCADScreenNum = CADScreenNum.ONE;
+                setChanged();
+                notifyObservers(new ObserverMessage(ObserverMessage.messageType.REFRESH_VIEW, null));
+                break;
+        }
+    }
+    
+
+    /**
+     * Set the command line in the current CAD model.
+     * 
+     * @param cmdLine New command line text.
+     */
+    public void receiveCommandLine(String cmdLine) {
+        getCurrentCADModel().commandLine = cmdLine;
+    }
+  
+   /**
+    * Receive a command from the CAD Client.  This method determines which 
+    * command was pushed, and then takes the correct action, determining 
+    * if the current CAD Screen needs update.  Each command that is pressed 
+    * is referenced by the keycode for the associated key.  These key codes 
+    * are defined in the CADProtocol class.  The following table shows the
+    * CAD Command and action.
+    *
+    *<table cellpadding="2" cellspacing="2" border="1"
+    * style="text-align: left; width: 250px;">
+    *  <tbody>
+    *    <tr>
+    *      <th>CAD Protocol Command<br></th>
+    *      <th>Action Taken<br></th>
+    *    </tr>
+    *    <tr>
+    *      <td>CYCLE</td>
+    *      <td>Set the currentCADScreenNum to the next screen number, set the screen update
+    *          value to false, update the current model, and notify observers to refresh the view.
+    *      </td>
+    *    </tr>
+    *    <tr>
+    *      <td>REFRESH</td>
+    *      <td>Set the screen update value to false, update the current model, 
+    *          and notify observers to refresh the view.</td>
+    *    </tr>
+    *    <tr>
+    *      <td>NEXT_QUEUE</td>
+    *      <td>If this terminal has not received any messages, do nothing.  If 
+    *          messages have been received, and the current CADScreen is 
+    *          showing the TO_ROUTED_MESSAGE screen, then call the model's 
+    *          nextQueue() method and notify observers to refresh their view.  
+    *          If messages have been received, but the current screen is not 
+    *          showing a routed message, then set the current cad screen model 
+    *          to the RoutedMessageModel with the received list of messages and 
+    *          notify observers.  Update the message map to show that the 
+    *          message has been viewd.  Update the unreadMessages flag to 
+    *          designate whether unread messages still exist for this CAD 
+    *          position.  Notify observers with the updated routed message info.</td>
+    *    </tr>
+    *    <tr>
+    *      <td>DELETE_QUEUE<br></td>
+    *      <td>If this terminal has not received any messages, do nothing.  
+    *          If the current CADScreen is showing a routed message, get the 
+    *          current message.  Remove this message from the current message map.
+    *          Also remove the message from all RoutedMessageModels that are 
+    *          being shown in a CAD Screen by calling the deleteQueue() method. 
+    *          Notify observers to refresh their view. 
+    *      </td>
+    *    </tr>
+    *    <tr>
+    *      <td>PREV_QUEUE<br></td>
+    *      <td>If this terminal has not received any messages, do nothing.  
+    *          If messages have been received, and the current CADScreen is 
+    *          showing the TO_ROUTED_MESSAGE screen, then call the model's 
+    *          prevQueue() method and notify observers to refresh their view.  
+    *          If messages have been received, but the current screen is not 
+    *          showing a routed message, then set the current cad screen model 
+    *          to the RoutedMessageModel with the received list of messages and 
+    *          notify observers.  Update the message map to show that the 
+    *          message has been viewd.  Update the unreadMessages flag to 
+    *          designate whether unread messages still exist for this CAD 
+    *          position.  Notify observers with the updated routed message info.
+    *      </td>
+    *    </tr>
+    *    <tr>
+    *      <td>SCREEN_CLEAR<br></td>
+    *      <td>Set the current model to the BlankScreenModel and notify observers
+    *          to refresh the view.</td>
+    *   </tr>
+    *  </tbody>
+    *</table>
+    *
+    *
+    * @param receivedCommand Integer value of the key that was pressed by client.
+    * @return true if the current CAD Screen needs updating.
+    */
+   public void receiveCommand(CAD_KEYS key) {
+      
+      switch (key) {
+       
+        case CYCLE: 
+           
+            currentCADScreenNum = currentCADScreenNum.next();   
+
+            CADScreenUpdates.put(currentCADScreenNum, false);
+                        
+            updateCADModel();
+            
+            setChanged();
+            notifyObservers(new ObserverMessage(ObserverMessage.messageType.REFRESH_VIEW, null));
+            break;
+            
+        case REFRESH:           
+
+            CADScreenUpdates.put(currentCADScreenNum, false);
+            
+            updateCADModel();
+            
+            setChanged();
+            notifyObservers(new ObserverMessage(ObserverMessage.messageType.REFRESH_VIEW, null));
+            break;
+
+        case  NEXT_QUEUE:
+
+            if(messageMap.size() > 0) {
+                if(currentCADModel().getType() == CADScreenType.TO_ROUTED_MESSAGE) {
+                    ((RoutedMessageModel)currentCADModel()).nextQueue();
+                }
+                else {
+                    LinkedList<CADRoutedMessage> messages = new LinkedList<CADRoutedMessage>();
+                    messages.addAll(messageMap.keySet());
+                    
+                    CADScreensMap.put(currentCADScreenNum, new RoutedMessageModel(
+                            currentCADScreenNum, messages));                    
+                }
+                
+                setChanged();
+                notifyObservers(new ObserverMessage(ObserverMessage.messageType.REFRESH_VIEW, null));
+
+                
+                messageMap.put(((RoutedMessageModel)currentCADModel()).getCurrentMessage(), true);
+                currentCADModel().unreadMessages = messageMap.values().contains(new Boolean(false));
+
+                setChanged();
+                notifyObservers(new ObserverMessage(ObserverMessage.messageType.ROUTED_MESSAGE, null));
+            }
+
+            break;
+
+        case  DELETE_QUEUE:  
+
+            if(messageMap.size() > 0) {
+
+                if(currentCADModel().getType() == CADScreenType.TO_ROUTED_MESSAGE) {
+                    
+                    CADRoutedMessage delMsg = ((RoutedMessageModel)currentCADModel()).getCurrentMessage();
+                    
+                    messageMap.remove(delMsg);
+                    
+                    for(CADScreenNum screen : CADScreensMap.keySet()) {
+                        if(CADScreensMap.get(screen).getType() == CADScreenType.TO_ROUTED_MESSAGE) {
+                            ((RoutedMessageModel)CADScreensMap.get(screen)).deleteQueue(delMsg);
+                        }
+                    }                       
+
+                    setChanged();
+                    notifyObservers(new ObserverMessage(ObserverMessage.messageType.REFRESH_VIEW, null)); 
+                }
+            }
+            break;
+
+ 
+        case  PREV_QUEUE:                         
+            if(messageMap.size() > 0) {
+                if(currentCADModel().getType() == CADScreenType.TO_ROUTED_MESSAGE) {
+                    ((RoutedMessageModel)currentCADModel()).prevQueue();
+                }
+                else {
+                    LinkedList<CADRoutedMessage> messages = new LinkedList<CADRoutedMessage>();
+                    messages.addAll(messageMap.keySet());
+                    
+                    CADScreensMap.put(currentCADScreenNum, new RoutedMessageModel(
+                            currentCADScreenNum, messages));        
+
+                }
+                
+                setChanged();
+                notifyObservers(new ObserverMessage(ObserverMessage.messageType.REFRESH_VIEW, null));
+
+
+                messageMap.put(((RoutedMessageModel)currentCADModel()).getCurrentMessage(), true);
+                currentCADModel().unreadMessages = messageMap.values().contains(new Boolean(false));
+                
+                setChanged();
+                notifyObservers(new ObserverMessage(ObserverMessage.messageType.ROUTED_MESSAGE, null));
+            }
+            break;
+
+        case  SCREEN_CLEAR: 
+            CADScreensMap.put(currentCADScreenNum, new BlankScreenModel(currentCADScreenNum));   
+            
+            setChanged();
+            notifyObservers(new ObserverMessage(ObserverMessage.messageType.REFRESH_VIEW, null));
+            break;
+        }
+
+    }   
+    
+    /**
+     * Handles a request for the current screen to show the IB_INCIDENT_BOARD screen.  
+     * Create a new IncidentBoardModel object and set its data with the Incident Board
+     * model data from the Coordinator.  Put the new model object into the CADScreensMap
+     * and notify observers to refresh the view.
+     * 
+     * There are no additional tokens that are read from the parameter node 
+     * when this command is received.
+     * 
+     * @param root (Not used)
+     */
+    public void incidentBoardRequest(Element root) {
+
+        IncidentBoardModel tempIB = new IncidentBoardModel(currentCADScreenNum);                        
+                    
+        //update with new information                   
+        for(IncidentBoardModel_obj ibmo : theCoordinator.getIncidentBoardModelObjects()) {
+            tempIB.addModelObject(ibmo);
+        }
+            
+        CADScreensMap.put(currentCADScreenNum, tempIB); 
+        CADScreenUpdates.put(currentCADScreenNum, false);
+            
+        setChanged();
+        notifyObservers(new ObserverMessage(ObserverMessage.messageType.REFRESH_VIEW, null));
+
+    }
+    
+    /**
+     * Handles a request to update an existing incident.  The parameter XML node is parsed
+     * for the incident update data.  The following is an example of the received XML element.
+     * 
+     * <UPDATE_INCIDENT LOG_NUM="">
+     *    <DETAILS/> 
+     * </UPDATE_INCIDENT>
+     * 
+     * If the LOG_NUM attribute contains a value, then the user is attempting to update
+     * an incident that may or may not be currently viewed.  If this value does not
+     * match any current incidents, notify the observers with an INVALID_LOG error message.<br>
+     *
+     * If the LOG_NUM attribute is empty, then the user is attempting to modify the incident
+     * on the current screen.  If the current screen is not an II_INCIDENT_INQUIRY, then
+     * notify the observers with A NO_LOG_NUMBER error message. 
+     * 
+     * If the UPDATE_INCIDENT node contains <DETAILS> elements, parse the text content for
+     * each of these detail elements, creating IncidentInquiryDetails objects and adding
+     * them to a IncidentInquiryModel_obj, which is then sent to the Coordinator to update
+     * the incident.
+     * 
+     * If the ROOT node does not contain any <DETAILS> elements, then notify observers
+     * with an UNAUTH_CMD error message.
+     * 
+     * @param root XML document element containing incident update request data.
+     */ 
+    public void incidentUpdateRequest(Element root) {
+
+        /* UI.  or UI.###
+         * If it's a UI. check if we're in an II screen, if not error
+         * If UI.### add it to the log... can we check against what current log we're looking at???
+         * if so, we need to update it....
+         */              
+                
+        //ascertain if the next token is a number, if so, we're updating a specific log, else 
+        //updating the current log(assuming we're looking at one)
+        
+        IncidentInquiryModel_obj newIIobj = new IncidentInquiryModel_obj(CADPosition);
+            
+        String  parsedLogNumber = null;
+        Integer logNumber       = null;
+
+        NodeList detailList  = null;        
+        
+        parsedLogNumber = root.getAttribute(DATA_TAGS.LOG_NUM.tag);     
+        
+        if(parsedLogNumber.length() > 0) { //UI.### Format
+        
+            logNumber = Integer.parseInt(parsedLogNumber);
+            
+            //if doesn't exist, send INVALID_LOG error
+            if(!theCoordinator.incidentExists(logNumber)) {
+                setChanged();
+                notifyObservers(new ObserverMessage(ObserverMessage.messageType.CAD_INFO_MESSAGE,
+                                                    CAD_ERROR.INVALID_LOG.message));    
+                                                    
+                return;     
+                                                    
+            }
+
+        }
+        else {  //UI. format
+            
+            //not looking at II, error
+            if(currentCADModel().getType() != CADScreenType.II_INCIDENT_INQUIRY) {                  
+                setChanged();
+                notifyObservers(new ObserverMessage(ObserverMessage.messageType.CAD_INFO_MESSAGE,
+                                                        CAD_ERROR.NO_LOG_NUM.message));
+                return;
+            }
+            //looking at II, continue to update
+            else { 
+                logNumber = ((IncidentInquiryModel)currentCADModel()).getLogNumber();                               
+            }                       
+        }
+        
+        //TODO more than just details...
+        
+        detailList = root.getElementsByTagName(CAD_FIELD_CODES.DETAILS.fullName);       
+        if(detailList.getLength() > 0) {
+            for(int i = 0; i < detailList.getLength(); i++) {
+                Node detailNode = detailList.item(i);           
+                newIIobj.getDetails().add(new IncidentInquiryDetails(
+                        getLogInfo(), detailNode.getTextContent(), 
+                        Boolean.parseBoolean(detailNode.getAttributes().getNamedItem(
+                                DATA_TAGS.SENSITIVE.tag).getNodeValue())));
+            }
+            
+            newIIobj.setLogNumber(logNumber);           
+            
+            theCoordinator.commandLineUpdate(newIIobj);
+        }   
+        else {
+            setChanged();
+            notifyObservers(new ObserverMessage(ObserverMessage.messageType.CAD_INFO_MESSAGE,
+                                                CAD_ERROR.UNAUTH_CMD.message)); 
+            return;
+        }
+        
+    }
+    
+    /**
+     * Handles a request for the current screen to show the II_INCIDENT_INQUIRY screen.  
+     * The parameter XML node is parsed for the incident inquiry data.  The following 
+     * is an example of the received XML element.  <br>
+     * 
+     * <INCIDENT_INQUIRY>###</INCIDENT_INQUIRY> <br>
+     * 
+     * Parse the text content of the INCIDENT_INQUIRY node for the incident number that 
+     * is being inquired for.  If this incident does not exist, notify observers with an
+     * INVALID_LOG error message.  If the incident does exist, create a new 
+     * IncidentInquiryModel object and set its data with the Incident Inquiry 
+     * model data from the Coordinator.  Put the new model object into the CADScreensMap
+     * and notify observers to refresh the view.
+     * 
+     * @param root XML document element containing incident inquiry request data.
+     */ 
+    public void incidentInquiryRequest(Element root) {
+
+        Integer incidentNum = Integer.parseInt(root.getTextContent());
+                        
+        if(theCoordinator.incidentExists(incidentNum)) {
+                
+            IncidentInquiryModel tempII = new IncidentInquiryModel(currentCADScreenNum, incidentNum);
+            
+            for(IncidentInquiryModel_obj iimo : 
+                theCoordinator.getIncidentInquiryModelObjects(incidentNum))  {                          
+                tempII.addModelObject(iimo);
+            }
+                            
+            CADScreensMap.put(currentCADScreenNum, tempII);   
+            CADScreenUpdates.put(currentCADScreenNum, false);
+                
+            setChanged();
+            notifyObservers(new ObserverMessage(ObserverMessage.messageType.REFRESH_VIEW, null));             
+
+        }
+        else {
+            setChanged();
+            notifyObservers(new ObserverMessage(ObserverMessage.messageType.CAD_INFO_MESSAGE,
+                                                CAD_ERROR.INVALID_LOG.message));
+        }
+    }
+    
+    /**
+     * Handles a request for the current screen to show the SA_SUMMARY_BOARD screen. 
+     * Create a new IncidentSummaryModel object and set its data with the Incident Summary
+     * model data from the Coordinator.  Put the new model object into the CADScreensMap
+     * and notify observers to refresh the view.
+     * 
+     * @param root (not used)
+     */ 
+    public void incidentSummaryRequest(Element root) {
+        
+        IncidentSummaryModel tempSA = new IncidentSummaryModel(currentCADScreenNum);
+                
+        for(IncidentSummaryModel_obj ismo : 
+            theCoordinator.getIncidentSummaryModelObjects()) 
+                tempSA.addModelObject(ismo);    
+                
+        CADScreensMap.put(currentCADScreenNum, tempSA);  
+        CADScreenUpdates.put(currentCADScreenNum, false);
+        
+        setChanged();
+        notifyObservers(new ObserverMessage(ObserverMessage.messageType.REFRESH_VIEW, null));                   
+
+    }
+    
+    /**
+     * (EI) - Enter Incident<br>
+     * 
+     * TODO  work on this.
+     */
+    public void enterIncidentRequest(Element root) {        
+
+        try {
+            Incident newIncident   = null;
+            IncidentEvent newEvent = null;;
+            
+            Long currentSimTime     = 0L;
+            Integer logNumber       = new Integer(0);
+            
+            NodeList detailList  = null;                    
+    
+            newEvent = new IncidentEvent(0);        
+    
+            detailList = root.getElementsByTagName(CAD_FIELD_CODES.DETAILS.fullName);       
+            if(detailList.getLength() > 0) {
+                for(int i = 0; i < detailList.getLength(); i++) {
+                    Node detailNode = detailList.item(i);           
+                    newEvent.eventInfo.getDetails().add(new IncidentInquiryDetails(getLogInfo(), 
+                            detailNode.getTextContent(),
+                            Boolean.parseBoolean(detailNode.getAttributes().getNamedItem(
+                                    DATA_TAGS.SENSITIVE.tag).getNodeValue())));
+                }               
+            }   
+            else {
+                setChanged();
+                notifyObservers(new ObserverMessage(ObserverMessage.messageType.CAD_INFO_MESSAGE,
+                                                    CAD_ERROR.UNAUTH_CMD.message)); 
+                return;
+            }           
+            
+            for(Incident incident : theCoordinator.getIncidentList()) {
+                if(incident.getLogNumber() > logNumber)
+                    logNumber = incident.getLogNumber(); 
+            }
+            logNumber++;
+
+            currentSimTime = theCoordinator.getCurrentSimulationTime();
+    
+            newIncident = new Incident(logNumber, "", currentSimTime);
+            newIncident.addEvent(newEvent);
+            
+            //theCoordinator.addIncident(newIncident);      
+            
+        }
+        catch (RemoteException re) { /*we're not remote*/ }
+
+                    
+        setChanged();
+        notifyObservers(new ObserverMessage(ObserverMessage.messageType.REFRESH_VIEW, null));
+
+    }
+
+    /**
+     * Handles a request to send a routed message.  The parameter XML node is 
+     * parsed for the routed message data. The following is an example of 
+     * the received XML element.
+     * 
+     * <ROUTED_MESSAGE>
+     *    <DESTINATION/> 
+     *    <MESSAGE/>
+     * </ROUTED_MESSAGE>
+     * 
+     * Parse the DESTINATION element for the CAD Position to receive the message.
+     * If a DESTINATION element does not exist, then notify observers with an UNAUTH_CMD 
+     * error message.
+     * 
+     * Parse the MESSAGE element for the message text.  If the MESSAGE element
+     * does not exist, then notify observers with an UNAUTH_CMD error message.
+     * 
+     * The parsed destination may be a comma-delimited string of CAD positions.
+     * Tokenize through the parsed string for all destinations and route a message
+     * to each of them with a new RoutedMessage object sent to the Coordinator.
+     * 
+     * Notify observers to refresh their current view.  If the current screen is an
+     * II_INCIDENT_INQUIRY, then a detail is to be added to the log.  Create
+     * an IncidentInquiryModel_obj and send it to the Coordinator as a command
+     * line update.
+     * 
+     * @param root XML document element containing incident update request data.
+     */ 
+    public void routedMessageRequest(Element root) { 
+
+        
+        String parsed_dest = "";
+        String message     = "";
+        
+        StringTokenizer destTok = null;
+        Vector<Integer> destinations = new Vector<Integer>();
+        boolean messageSent = false;
+        
+                
+        NodeList destList = root.getElementsByTagName(DATA_TAGS.DESTINATION.tag);
+        
+        if(destList.getLength() > 0) {
+            Node destNode = destList.item(0);               
+            parsed_dest   = destNode.getTextContent();
+        }   
+        else {
+            setChanged();
+            notifyObservers(new ObserverMessage(ObserverMessage.messageType.CAD_INFO_MESSAGE,
+                                                CAD_ERROR.UNAUTH_CMD.message));
+            return;
+        }           
+        
+
+        NodeList messageList = root.getElementsByTagName(DATA_TAGS.MESSAGE.tag);
+        
+        if(messageList.getLength() > 0) {
+            Node messageNode = messageList.item(0);             
+            message = messageNode.getTextContent();         
+        }   
+        else {
+            setChanged();
+            notifyObservers(new ObserverMessage(ObserverMessage.messageType.CAD_INFO_MESSAGE,
+                                                CAD_ERROR.UNAUTH_CMD.message));
+            return;
+        }                   
+        
+        destTok = new StringTokenizer(parsed_dest, ",");
+        
+        while(destTok.hasMoreTokens()) {
+            
+            try {
+                destinations.add(Integer.parseInt(destTok.nextToken()));
+            }
+            catch (NumberFormatException nfe) {
+                setChanged();
+                notifyObservers(new ObserverMessage(ObserverMessage.messageType.CAD_INFO_MESSAGE,
+                            CAD_ERROR.UNAUTH_CMD.message)); 
+                return;
+            }
+        }
+        
+        for(int dest : destinations) {
+            
+            if(CADPosition != dest) {
+
+                CADRoutedMessage newMessage = new CADRoutedMessage(CADPosition,
+                           dest, 
+                           message, 
+                           false);
+                
+                theCoordinator.routeMessage(newMessage);        
+                
+                messageSent = true;
+
+            }
+        }
+        setChanged();
+        notifyObservers(new ObserverMessage(ObserverMessage.messageType.REFRESH_VIEW, null));
+        
+
+        setChanged();
+        notifyObservers(new ObserverMessage(ObserverMessage.messageType.CAD_INFO_MESSAGE,
+                "0146: Routed message to " + parsed_dest + "."));
+        
+        
+        //If we sent a message and are looking at a CAD log, add a DETAIL as well
+        if(messageSent && getCurrentCADModel().getType() == CADScreenType.II_INCIDENT_INQUIRY) {
+            IncidentInquiryModel_obj newIIobj = new IncidentInquiryModel_obj(CADPosition);
+                        
+            newIIobj.getDetails().add(new IncidentInquiryDetails(getLogInfo(), message, true));             
+            newIIobj.setLogNumber(((IncidentInquiryModel)getCurrentCADModel()).getLogNumber());
+                
+            theCoordinator.commandLineUpdate(newIIobj);         
+        }
+
+    }
+    
+    /**
+     * Handles a request to log off the terminal.  All screens are reset with 
+     * a BlankScreenModel.  The current screen number is set to ONE.  All 
+     * screen updates and messages are cleared.  The model is then updated
+     * and Observers are notified ot refresh the view.
+     * 
+     * @param root (not used)
+     */
+    public void terminalOffRequest() {
+
+        for(CADScreenNum num : CADScreensMap.keySet()) {
+            CADScreensMap.put(num, new BlankScreenModel(num));
+        }
+            
+        currentCADScreenNum = CADScreenNum.ONE;
+        
+        CADScreenUpdates.clear();
+        
+        messageMap.clear();
+        
+        updateCADModel();
+        
+        setChanged();
+        notifyObservers(new ObserverMessage(ObserverMessage.messageType.REFRESH_VIEW, null));
+        
+    }
+    
+}
Index: trunk/src/tmcsim/cadsimulator/Coordinator.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/Coordinator.java	(revision 2)
+++ trunk/src/tmcsim/cadsimulator/Coordinator.java	(revision 2)
@@ -0,0 +1,1901 @@
+
+package tmcsim.cadsimulator;
+
+import java.awt.List;
+import java.io.File;
+import java.rmi.RemoteException;
+import java.rmi.server.UnicastRemoteObject;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.Observer;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.JList;
+import javax.swing.Timer;
+import javax.swing.table.DefaultTableModel;
+import javax.xml.parsers.SAXParserFactory;
+
+import tmcsim.cadmodels.CADRoutedMessage;
+import tmcsim.cadmodels.CMSInfo;
+import tmcsim.cadmodels.IncidentBoardModel_obj;
+import tmcsim.cadmodels.IncidentInquiryModel_obj;
+import tmcsim.cadmodels.IncidentInquiryUnitsAssigned;
+import tmcsim.cadmodels.IncidentSummaryModel_obj;
+import tmcsim.cadsimulator.db.CMSDiversionDB;
+import tmcsim.cadsimulator.managers.ATMSManager;
+import tmcsim.cadsimulator.managers.IncidentManager;
+import tmcsim.cadsimulator.managers.MediaManager;
+import tmcsim.cadsimulator.managers.ParamicsSimulationManager;
+import tmcsim.cadsimulator.managers.SimulationControlManager;
+import tmcsim.client.cadclientgui.CardfileReader;
+import tmcsim.client.cadclientgui.ScriptHandler;
+import tmcsim.client.cadclientgui.data.CADData;
+import tmcsim.client.cadclientgui.data.CardfileData;
+import tmcsim.client.cadclientgui.data.CardfileDataObject;
+import tmcsim.client.cadclientgui.data.CardfileList;
+import tmcsim.client.cadclientgui.data.ChangeLog;
+import tmcsim.client.cadclientgui.data.Incident;
+import tmcsim.client.cadclientgui.data.IncidentEvent;
+import tmcsim.client.cadclientgui.enums.CADDataEnums.*;
+import tmcsim.client.cadclientgui.enums.CADScriptTags.UNIT_TAGS;
+import tmcsim.client.cadclientgui.enums.IncidentEnums;
+import tmcsim.client.cadclientgui.enums.UnitStatusEnums;
+import tmcsim.client.cadclientgui.screens.ScreenManager;
+import tmcsim.common.CCTVInfo;
+import tmcsim.common.ObserverMessage;
+import tmcsim.common.ScriptException;
+import tmcsim.common.SimulationException;
+import tmcsim.common.XMLIncident;
+import tmcsim.common.CADEnums.PARAMICS_STATUS;
+import tmcsim.common.CADEnums.SCRIPT_STATUS;
+import tmcsim.interfaces.CADClientInterface;
+import tmcsim.interfaces.CoordinatorInterface;
+import tmcsim.interfaces.SimulationManagerInterface;
+
+/**
+ * Coordinator is used to control and manage interactions between all CAD 
+ * Simulator Managers.  The Coordinator is also registered as an RMI Object
+ * to allow remote control and access to simulation data.   A 
+ * SimulationManagerInterface Object is used to provide communication to a
+ * remotely connected SimulationManager.  Observers may register with the
+ * Coordinator to listen for simulation data updates.
+ *
+ * @see ATMSManager
+ * @see IncidentManager
+ * @see MediaManager
+ * @see ParamicsSimulationManager
+ * @see SimulationControlManager
+ * @author Matthew Cechini
+ * @version 
+ */
+@SuppressWarnings("serial")
+public class Coordinator extends UnicastRemoteObject
+    implements CoordinatorInterface {
+
+    /** Error logger. */
+    private Logger coorLogger = Logger.getLogger("tmcsim.cadsimulator");
+    
+    /**
+     * List of all Observers that have been registered with the Coordinator.  Due
+     * to being a remote object, Coordinator cannot extend the Observable class. 
+     * Therefore, the list is managed manually.
+     */
+    private Vector<Observer> observerList = null;
+    
+    /**
+     * Interface object for RMI communication with the Simulation Manager.  Only one Simulation Manager
+     * may be connected at a time.  When there is no connected Manager, this object is set to null.
+     */
+    private static SimulationManagerInterface managerInt = null;
+    
+    private static LinkedList<CADClientInterface> clientList;
+            
+    private static CADData cadData;
+    
+    private static CardfileData cardfileData;
+    
+    /**
+     * Constructor.  Call UnicastRemoteObject constructor and call 
+     * initializeSimulation.
+     *
+     * @throws RemoteException
+     */
+    public Coordinator() throws RemoteException {           
+        super();
+        clientList = new LinkedList<CADClientInterface>();
+        cadData = new CADData();
+      cardfileData = new CardfileData();
+        try {
+            CardfileReader cfr = new CardfileReader("scripts/Cardfile.xml", cardfileData);
+        } catch (Exception e) {
+            System.out.println("Could not load cardfile script");
+        }
+        
+        observerList = new Vector<Observer>();
+    }
+    
+    public void registerForCallback(CADClientInterface client) throws RemoteException{
+        clientList.add(client);
+        CADSimulator.theViewer.connectClient();
+    }   
+    
+    public void unregisterForCallback(CADClientInterface client) throws RemoteException{
+        clientList.remove(client);
+        CADSimulator.theViewer.disconnectClient();
+    }
+    
+    public void registerForCallback(SimulationManagerInterface simManInt) throws RemoteException{
+        managerInt = simManInt;
+        CADSimulator.theViewer.setSimManagerStatus(true);
+    }   
+    
+    public void unregisterForCallback(SimulationManagerInterface simManInt) throws RemoteException {
+        managerInt = null;
+        CADSimulator.theViewer.setSimManagerStatus(false);
+    }     
+    
+    public void startSimulation() throws RemoteException, ScriptException {
+
+        if(!CADSimulator.theIncidentMgr.areIncidentsLoaded())
+            throw new ScriptException(ScriptException.NO_SCRIPT_LOADED);
+        else if(CADSimulator.theParamicsSimMgr.isConnected()) {
+            Runnable startRun = new Runnable() {
+                public void run() {
+                    try {
+                        setScriptStatus(SCRIPT_STATUS.ATMS_SYNCHRONIZATION);
+                        
+                        long currentATMSTime = CADSimulator.theATMSMgr.getCurrentTime();
+                        long sleepTime       = ((60 * 1000) - (currentATMSTime % (60 * 1000))) % (30 * 1000);               
+
+                        coorLogger.logp(Level.INFO, "Coordinator", "StartSimulation", 
+                                "Sleeping for " + sleepTime/1000 + " seconds.");
+                        Thread.sleep(sleepTime);
+    
+                        //currentATMSTime += sleepTime;                 
+                        //ParamicsCommunicator.getInstance().serverTime.setTimeInMillis(currentATMSTime);                                       
+                    }
+                    catch (Exception e) {
+                        setScriptStatus(SCRIPT_STATUS.SCRIPT_RUNNING);
+                        
+                        coorLogger.logp(Level.SEVERE, "Coordinator", "StartSimulation:run", 
+                                "Unable to connect to ATMS server.", e);
+                    }
+                    finally {
+                        CADSimulator.theSimulationCntrlMgr.startSimulation();
+                        CADSimulator.theParamicsSimMgr.startSimulation();
+                        CADSimulator.theSoundPlayer.setAudioEnabled(true);      
+                    }
+                }
+            };
+        
+            Thread startThread = new Thread(startRun);
+            startThread.start();
+        }
+        else {
+            CADSimulator.theSimulationCntrlMgr.startSimulation();
+            CADSimulator.theSoundPlayer.setAudioEnabled(true);
+        }
+    }
+    
+    
+    public void pauseSimulation() throws RemoteException {      
+        CADSimulator.theSimulationCntrlMgr.pauseSimulation();
+        CADSimulator.theSoundPlayer.setAudioEnabled(false);
+    }
+    
+
+    public void resetSimulation() throws RemoteException {      
+        
+        CADSimulator.theIncidentMgr.resetIncidents();
+        cadData.resetSimulation();
+        
+        CADSimulator.theSoundPlayer.setAudioEnabled(false);
+        CADSimulator.theSoundPlayer.deQueueAll();
+        
+        CADSimulator.theViewer.setTime(0);
+        
+        setScriptStatus(SCRIPT_STATUS.SCRIPT_STOPPED_NOT_STARTED);
+        
+        CMSDiversionDB.getInstance().resetDiversions();
+        
+        CADSimulator.theSimulationCntrlMgr.resetSimulation();
+        CADSimulator.theParamicsSimMgr.resetSimulation();
+        
+        notifyObservers(new ObserverMessage(ObserverMessage.messageType.RESET_SIMULATION, null));      
+
+    }
+
+        
+    public void gotoSimulationTime(final long newSimTime) throws RemoteException {
+                
+        boolean audioWasEnabled = CADSimulator.theSoundPlayer.getAudioEnabled();
+        
+        CADSimulator.theSoundPlayer.setAudioEnabled(false);
+        
+        long tempTime = 0;      
+        while(tempTime < newSimTime) {
+            tempTime++;
+
+            CADSimulator.theIncidentMgr.tick(tempTime);
+        }       
+        CADSimulator.theSoundPlayer.setAudioEnabled(audioWasEnabled);
+        
+
+        CADSimulator.theSimulationCntrlMgr.gotoSimulationTime(newSimTime);
+        
+        Runnable gotoRun = new Runnable() {
+        
+            public void run() {
+                CADSimulator.theViewer.setTime(newSimTime);
+                
+                if(managerInt != null) {
+                    try {
+                        managerInt.tick(newSimTime);
+                    }
+                    catch (RemoteException re) {
+                        //Simulation Manager has disappeared
+                        managerInt = null;
+                        CADSimulator.theViewer.setSimManagerStatus(false);
+                        
+                        coorLogger.logp(Level.SEVERE, "Coordinator", "gotoSimulationTime:run", 
+                                "Connection to Simulation Manager has been dropped.", re);
+                    }
+                }
+            }           
+        };
+        
+        Thread gotoThread = new Thread(gotoRun);
+        gotoThread.start();     
+        
+    }
+    
+
+    /**
+     * Sets the current script status.  A thread is started to notify
+     * the CADSimulatorViewer and SimulationManager with the new status.
+     */
+    public void setScriptStatus(final SCRIPT_STATUS status) {
+        
+        Runnable updateRun = new Runnable() {
+        
+            public void run() {
+
+                CADSimulator.theViewer.setScriptStatus(status);
+        
+                if(managerInt != null) {
+                    try {                           
+                        managerInt.setScriptStatus(status);
+                    }
+                    catch (RemoteException re) {
+                        //Simulation Manager has disappeared
+                        managerInt = null;
+                        CADSimulator.theViewer.setSimManagerStatus(false);
+
+                        coorLogger.logp(Level.SEVERE, "Coordinator", "setScriptStatus:run", 
+                                "Connection to Simulation Manager has been dropped.", re);
+                    }                   
+                }
+            }
+        };
+        
+        Thread updateThread = new Thread(updateRun);
+        updateThread.start();
+    }   
+    
+    /**
+     * Sets the current paramics status.  A thread is started to notify
+     * the CADSimulatorViewer and SimulationManager with the new status.
+     */
+    public void setParamicsStatus(final PARAMICS_STATUS status) {
+
+        Runnable updateRun = new Runnable(){
+        
+            public void run() {
+                CADSimulator.theViewer.setParamicsStatus(status);
+                
+                if(managerInt != null) {
+                    try {                           
+                        managerInt.setParamicsStatus(status);
+                    }
+                    catch (RemoteException re) {
+                        //Simulation Manager has disappeared
+                        managerInt = null;
+                        CADSimulator.theViewer.setSimManagerStatus(false);
+
+                        coorLogger.logp(Level.SEVERE, "Coordinator", "setParamicsStatus:run", 
+                                "Connection to Simulation Manager has been dropped.", re);
+                    }                   
+                }   
+            }       
+        };
+        
+        Thread updateThread = new Thread(updateRun);
+        updateThread.start();       
+    
+    }
+    
+    public void connectToParamics() throws RemoteException {
+        CADSimulator.theParamicsSimMgr.connectToParamics();
+    }
+    public void disconnectFromParamics() throws RemoteException {
+        CADSimulator.theParamicsSimMgr.disconnectFromParamics();
+    }
+    
+    public void loadParamicsNetwork(int networkID) throws RemoteException, SimulationException {
+        CADSimulator.theParamicsSimMgr.loadParamicsNetwork(networkID);
+    }   
+    
+    public PARAMICS_STATUS getParamicsStatus() throws RemoteException {
+        return CADSimulator.theParamicsSimMgr.getParamicsStatus();
+    }
+    
+    public int getParamicsNetworkLoaded() throws RemoteException {
+        return CADSimulator.theParamicsSimMgr.getParamicsNetworkLoaded();
+    }
+
+    public long getCurrentSimulationTime() throws RemoteException {
+        return CADSimulator.theSimulationCntrlMgr.getCurrentSimTime();  
+    }   
+        
+    public void triggerIncident(Integer incidentNumber) throws RemoteException, ScriptException {
+        
+        if(!CADSimulator.theSimulationCntrlMgr.simulationStarted())
+            throw new ScriptException(ScriptException.SIM_NOT_STARTED);
+        else if(!CADSimulator.theIncidentMgr.areIncidentsLoaded())
+            throw new ScriptException(ScriptException.NO_SCRIPT_LOADED);
+
+        CADSimulator.theIncidentMgr.triggerIncident(incidentNumber, 
+                CADSimulator.theSimulationCntrlMgr.getCurrentSimTime());
+    }
+    
+    public void deleteIncident(Integer incidentNumber) throws RemoteException, ScriptException {
+        CADSimulator.theIncidentMgr.deleteIncident(incidentNumber);
+        
+        if(CADSimulator.theIncidentMgr.getIncidentList().size() == 0) {
+            setScriptStatus(SCRIPT_STATUS.NO_SCRIPT);
+        }
+        
+        if(managerInt != null) {
+            try {                           
+                managerInt.incidentRemoved(incidentNumber);
+            }
+            catch (RemoteException re) {
+                //Simulation Manager has disappeared
+                managerInt = null;
+                CADSimulator.theViewer.setSimManagerStatus(false);
+
+                coorLogger.logp(Level.SEVERE, "Coordinator", "deleteIncident", 
+                        "Connection to Simulation Manager has been dropped.", re);
+            }                   
+        }   
+    }
+    
+    public void rescheduleIncident(Integer incidentNumber, long newTime) 
+        throws RemoteException, ScriptException {
+        
+        if (newTime < CADSimulator.theSimulationCntrlMgr.getCurrentSimTime()) {
+            throw new ScriptException(ScriptException.TIME_PASSED);
+        }
+        
+        CADSimulator.theIncidentMgr.rescheduleIncident(incidentNumber, newTime);
+    }
+    
+    public void addIncident(Incident newIncident) throws RemoteException {
+
+        CADSimulator.theIncidentMgr.addIncident(newIncident);
+        
+        if(managerInt != null) {
+            try {                           
+                managerInt.incidentAdded(newIncident);
+            }
+            catch (RemoteException re) {
+                //Simulation Manager has disappeared
+                managerInt = null;
+                CADSimulator.theViewer.setSimManagerStatus(false);
+
+                coorLogger.logp(Level.SEVERE, "Coordinator", "addIncident", 
+                        "Connection to Simulation Manager has been dropped.", re);
+            }                   
+        }       
+    }
+    
+
+    public void loadScriptFile(File scriptFile) throws RemoteException, ScriptException {       
+        
+        
+        try {
+            CADSimulator.theIncidentMgr.clearIncidents();
+            cadData.clearData();
+            
+            ScriptHandler sh = new ScriptHandler();
+            
+            SAXParserFactory.newInstance().newSAXParser().parse(scriptFile, sh);
+            
+            cadData.setIncidentsFromXML(sh.getIncidents());
+            cadData.setUnitsFromXML(sh.getUnits());
+            refreshClients();
+            CADSimulator.theIncidentMgr.addIncidents(sh.getIncidents());
+            
+            resetSimulation();     
+        }
+        catch (Exception e) {e.printStackTrace();}
+
+    }   
+
+    public Vector<Incident> getIncidentList() throws RemoteException {
+        return CADSimulator.theIncidentMgr.getIncidentList();
+    }
+    
+    public TreeMap<Integer, Vector<IncidentEvent>> getTriggeredEvents() throws RemoteException {
+        return CADSimulator.theIncidentMgr.getTriggeredEvents();
+    }
+
+    public SCRIPT_STATUS getScriptStatus() throws RemoteException {
+        if(CADSimulator.theIncidentMgr.areIncidentsLoaded()) {
+            if(CADSimulator.theSimulationCntrlMgr.simulationStarted()) 
+                return SCRIPT_STATUS.SCRIPT_RUNNING;
+            else {
+                for(Incident inc : CADSimulator.theIncidentMgr.getIncidentList()) {
+                    if(inc.hasOccured() == true) 
+                        return SCRIPT_STATUS.SCRIPT_PAUSED_STARTED;
+                }
+                return SCRIPT_STATUS.SCRIPT_STOPPED_NOT_STARTED;
+            }
+        }
+        return SCRIPT_STATUS.NO_SCRIPT;
+    }
+    
+    /**
+     * Route a message to a CAD terminal.  If the new message is
+     * an incident update, the current message text will be the
+     * requested incident's log number.  Set the message's text 
+     * to the XML representation of the requested IncidentInquiry 
+     * object.  Notify observers with the new message.
+     *
+     * @param newMessage Routed message received from CAD Client.
+     */
+    public void routeMessage(CADRoutedMessage newMessage) {
+        
+        //if this is an incidentUpdate
+        /*
+         * TODO  Is this a priority??
+        if(newMessage.incidentUpdate) {
+            IncidentInquiryModel tempII = new IncidentInquiryModel(
+                    newMessage.fromPosition,
+                    CADScreenNum.ONE, 
+                    Integer.parseInt(newMessage.message));
+            
+            for(IncidentInquiryModel_obj iimo : getIncidentInquiryModelObjects(
+                    Integer.parseInt(newMessage.message))) {
+                tempII.addModelObject(iimo);
+            }
+            
+            XMLWriter tempWriter = new XMLWriter();
+            tempII.toXML(tempWriter);
+            newMessage.message = tempWriter.getString();
+        }
+        */
+            
+        notifyObservers(new ObserverMessage(ObserverMessage.messageType.ROUTED_MESSAGE,
+                newMessage));
+
+    }   
+   
+ 
+    public TreeSet<String> getCMSIDs() throws RemoteException {     
+        return new TreeSet<String>(CMSDiversionDB.getInstance().getAllDiversions().keySet());
+    }
+    
+    public CMSInfo getCMSDiversionInfo(String theCMSID) throws RemoteException {        
+        return CMSDiversionDB.getInstance().getDiversion(theCMSID);
+    }    
+    
+    public void applyDiversions(CMSInfo theDiversion) throws RemoteException {
+        CMSDiversionDB.getInstance().updateDiversions(theDiversion);
+        CADSimulator.theParamicsSimMgr.updateDiversion(theDiversion);
+    }    
+   
+    /**
+     * Method updates the simulation with the new Incident information.
+     * The parameter IncidentInquiryModel_obj Object is used to create 
+     * a new IncidentEvent Object which is finalized and sent to the
+     * IncidentManager for simulation updating. 
+     * 
+     * @param update IncidentInquiryModel_obj containing CAD line update
+     * @see IncidentManager
+     */
+    public void commandLineUpdate(IncidentInquiryModel_obj modelInfo) {
+                
+        long currentSimTime = CADSimulator.theSimulationCntrlMgr.getCurrentSimTime();
+        
+        IncidentEvent triggeredEvent = new IncidentEvent(currentSimTime);
+        triggeredEvent.eventInfo     = modelInfo;
+        
+        triggeredEvent.finalizeEvent(currentSimTime, CADSimulator.getCADTime());
+
+        CADSimulator.theIncidentMgr.updateIncident(modelInfo.getLogNumber(), triggeredEvent); 
+        
+        updateIncidentInGUI(modelInfo.getLogNumber(), triggeredEvent);
+        
+    }
+    
+    
+    /**
+     * If the Simulation has started, spawn a thread to update the 
+     * CADSimulatorViewer, SimulationManager, and IncidentManager with the new 
+     * simulation time. If the current time is a 30 second interval, notify the 
+     * ParamicsControlManager to send an IncidentUpdate.
+     * 
+     * @see SimulationControlManager
+     * @see ParamicsControlManager
+     * @see IncidentManager
+     */
+    public void tick() {
+        if(CADSimulator.theSimulationCntrlMgr.simulationStarted()) {
+            
+            final long currentSimTime = CADSimulator.theSimulationCntrlMgr.getCurrentSimTime();
+            
+            Runnable timeRun = new Runnable() {
+            
+                public void run() {
+                    CADSimulator.theViewer.setTime(currentSimTime);
+                    
+                    //send an update every 30 seconds
+                    if(currentSimTime % 30 == 0)
+                        CADSimulator.theParamicsSimMgr.sendIncidentUpdate(currentSimTime);
+                    
+                    if(managerInt != null) {
+                        try {
+                            managerInt.tick(currentSimTime);
+                        }
+                        catch (RemoteException re) {
+                            //Simulation Manager has disappeared
+                            managerInt = null;
+                            CADSimulator.theViewer.setSimManagerStatus(false);
+
+                            coorLogger.logp(Level.SEVERE, "Coordinator", "tick:run", 
+                                    "Connection to Simulation Manager has been dropped.", re);
+                        }
+                    }
+                    
+                    CADSimulator.theIncidentMgr.tick(currentSimTime);
+                }           
+            };
+            
+            Thread timeThread = new Thread(timeRun);
+            timeThread.start();                     
+        }
+    }   
+    
+
+    /**
+     * Method notifies observers with an IncidentSummaryModel_obj to signify
+     * that a new Incident has started.  Then spawn a thread to notify the
+     * SimulationManager with the Incident's log number has started.
+     * 
+     * @param completedEvent Completed IncidentEvent.
+     */
+    public void incidentStarted(final IncidentEvent completedEvent) {
+        notifyObservers(new ObserverMessage(ObserverMessage.messageType.INCIDENT_SUMMARY,
+                new IncidentSummaryModel_obj(completedEvent.eventInfo.getHeader())));    
+        
+        incidentStartedInGUI(completedEvent.eventInfo.getLogNumber());
+        
+        Runnable startRun = new Runnable() {                            
+            public void run() {
+                if(managerInt != null) {
+                    try {                           
+                        managerInt.incidentStarted(completedEvent.eventInfo.getLogNumber());
+                    }
+                    catch (RemoteException re) {
+                        //Simulation Manager has disappeared
+                        managerInt = null;
+                        CADSimulator.theViewer.setSimManagerStatus(false);
+
+                        coorLogger.logp(Level.SEVERE, "Coordinator", "updateIncidents", 
+                                "Connection to Simulation Manager has been dropped.", re);
+                    }                       
+                }                   
+            }                   
+        };      
+        
+        Thread startThread = new Thread(startRun);
+        startThread.start();
+    }      
+
+    /**
+     * Method notifies observers with the IncidentEvent Object to signify
+     * that a new IncidentEvent has completed.  All XMLIncident Objects
+     * in the completed IncidentEvent is sent to the ParamicsControlManager
+     * for transmission to Paramics.  All CCTVInfo Objects are sent to the
+     * MediaManager for media control.  A thread is then spawned to notify the
+     * SimulationManager with the completed IncidentEvent.
+     * 
+     * @param completedEvent Completed IncidentEvent.
+     * @see ParamicsControlManager
+     * @see MediaManager
+     */
+    public void incidentUpdated(final IncidentEvent completedEvent) {
+        notifyObservers(new ObserverMessage(ObserverMessage.messageType.INCIDENT_INQUIRY,
+                completedEvent.eventInfo));     
+        
+        for(XMLIncident xmlInc : completedEvent.XMLIncidents)
+            CADSimulator.theParamicsSimMgr.updateIncident(xmlInc);
+
+        
+        /*for(CCTVInfo info : completedEvent.cctvInfos) {
+            CADSimulator.theMediaMgr.triggerIncident(info, 
+                    completedEvent.eventInfo.getLogNumber());
+        }*/
+        
+        Runnable displayRun = new Runnable() {                  
+            public void run() {
+                if(managerInt != null) {
+                    try {
+                        managerInt.eventOccured(
+                                completedEvent.eventInfo.getLogNumber(), 
+                                completedEvent);
+                    }
+                    catch (RemoteException re) {
+                        //Simulation Manager has disappeared
+                        managerInt = null;
+                        CADSimulator.theViewer.setSimManagerStatus(false);
+
+                        coorLogger.logp(Level.SEVERE, "Coordinator", "updateIncidents:run", 
+                                "Connection to Simulation Manager has been dropped.", re);
+                    }                   
+                }
+            }
+        };
+
+        Thread displayThread = new Thread(displayRun);
+        displayThread.start();        
+    }      
+    
+    /**
+     * @see IncidentManager
+     */
+    public boolean incidentExists(Integer logNumber) {
+        return CADSimulator.theIncidentMgr.incidentExists(logNumber);
+    }
+
+    /**
+     * @see IncidentManager
+     */
+    public Vector<IncidentBoardModel_obj> getIncidentBoardModelObjects() {
+        return CADSimulator.theIncidentMgr.getIncidentBoardModelObjects();
+    }       
+
+    /**
+     * @see IncidentManager
+     */
+    public Vector<IncidentInquiryModel_obj> getIncidentInquiryModelObjects(Integer logNumber) {
+        return CADSimulator.theIncidentMgr.getIncidentInquiryModelObjects(logNumber);
+    }    
+
+    /**
+     * @see IncidentManager
+     */
+    public Vector<IncidentSummaryModel_obj> getIncidentSummaryModelObjects() {
+        return CADSimulator.theIncidentMgr.getIncidentSummaryModelObjects();
+    }     
+    
+  
+    /**
+     * Adds an observer to the list of observers.
+     *
+     * @param o New observer object.
+     */
+    public void addObserver(Observer o) {
+        observerList.add(o);    
+    }
+    
+    /** 
+     * Removes an observer from the list of observers.  If the observer
+     * is not found, this method returns false, else true is returned for
+     * a successful removal. 
+     *
+     * @param o Observer to be removed.
+     * @returns True if remove was successful, false if not.
+     */     
+    public boolean removeObserver(Observer o) {
+        return observerList.remove(o);
+    }
+    
+    /**
+     * Notify all registered observers with the parameter ObserverMessage object.
+     *
+     * @param newMsg The ObserverMessage to be sent.
+     */
+    private void notifyObservers(ObserverMessage newMsg) {
+        for(Observer o : observerList) 
+            o.update(null, newMsg); 
+    }
+    
+    public void refreshClients() throws RemoteException{
+        for(int i = 0; i < clientList.size(); i++){
+            clientList.get(i).refresh();
+        }
+    }
+    
+    /**
+     * Checks the CADData for an existing incident with id
+     * @param id the incident id
+     * @return true if CADData contains such an incident, otherwise false.
+     * @throws RemoteException
+     */
+     public boolean checkForValidIncidentID(int id) throws RemoteException{
+        return cadData.checkForValidId(id);
+     }
+    
+     
+     /**
+     * Uses an Incident's masterInc to lookup its ID.
+     * @param masterInc the Incident to look up
+     * @return the same Incident's ID, -1 if invalid masterInc
+     * @throws RemoteException
+     */
+     public int getIncidentId(String masterInc) throws RemoteException{
+         return cadData.getIncidentId(masterInc);
+     }
+    
+    /**
+     * Returns a table model out of CADData based on tag.
+     * @param tag a CADDataEnums tag
+     * @throws RemoteException
+     */
+    public DefaultTableModel getCadDataTable(TABLE tag) throws RemoteException{
+        if(tag.equals(TABLE.ASSIGNED_INCIDENTS)){
+            return cadData.tableForAssignedIncidents();
+        }
+        else if(tag.equals(TABLE.UNIT_STATUS)){
+            return cadData.tableForUnitStatus();
+        }
+        else if(tag.equals(TABLE.PENDING_INCIDENTS)){
+            return cadData.tableForPendingIncidents();
+        }
+        else if(tag.equals(TABLE.INCIDENT_EDITOR)){
+            return cadData.tableForIncidentEditor();
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataTable");
+        }
+    }
+    
+    /**
+     * Returns the specified incident's table based on the tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @return
+     * @throws RemoteException
+     */
+    public DefaultTableModel getCadDataIncidentTable(INC_TABLE tag, int incidentId) throws RemoteException{
+     if(tag.equals(INC_TABLE.COMMENTS_NOTES)){
+         return cadData.getIncident(incidentId).getCommentsNotesTable();
+     }
+     return null;
+    }
+    
+    /**
+     * Adds a row of data to a specified incident's table based on the tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @fields the row of fields to add to the specified table
+     * @throws RemoteException
+     */
+    public void addCadDataIncidentTable(INC_TABLE tag, int incidentId, String[] fields) throws RemoteException{
+     if(tag.equals(INC_TABLE.COMMENTS_NOTES)){
+         cadData.getIncident(incidentId).addToCommentsNotesTable(fields);
+     }
+    }
+    
+    /**
+     * Adds a row to the specified data table based on the incoming fields.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+     public void addCadDataTableRow(TABLE tag, String field1, String field2, String field3, String field4) throws RemoteException{
+         
+     }
+    
+     
+     
+    /**
+     * Returns an object out of Incident based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public Object getCadDataIncVal(INC_VAL tag, int incidentId) throws RemoteException{
+    if(tag.equals(INC_VAL.LOG_NUM)){
+            return cadData.getIncident(incidentId).getLogNum();
+        }
+        else if(tag.equals(INC_VAL.MASTER_INC)){
+            return cadData.getIncident(incidentId).getMasterInc();
+        }
+        else if(tag.equals(INC_VAL.OAU)){
+            return cadData.getIncident(incidentId).getOau();
+        }
+        else if(tag.equals(INC_VAL.P)){
+            return cadData.getIncident(incidentId).getP();
+        }
+        else if(tag.equals(INC_VAL.DESCRIPTION)){
+            return cadData.getIncident(incidentId).getDescription();
+        }
+        else if(tag.equals(INC_VAL.RP)){
+            return cadData.getIncident(incidentId).getRp();
+        }
+        else if(tag.equals(INC_VAL.RP_TYPE)){
+            return cadData.getIncident(incidentId).getRpType();
+        }
+        else if(tag.equals(INC_VAL.ALI)){
+            return cadData.getIncident(incidentId).getAli();
+        }
+        else if(tag.equals(INC_VAL.MEDIA)){
+            return cadData.getIncident(incidentId).getMedia();
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncVal");
+        }
+    }
+    
+    /**
+     * Set incidentId's field based on tag to value.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public void setCadDataIncVal(INC_VAL tag, int incidentId, String value) throws RemoteException{
+        if(tag.equals(INC_VAL.OAU)){
+            cadData.getIncident(incidentId).setOau(value);
+        }
+        else if(tag.equals(INC_VAL.P)){
+            cadData.getIncident(incidentId).setP(value);
+        }
+        else if(tag.equals(INC_VAL.DESCRIPTION)){
+            cadData.getIncident(incidentId).setDescription(value);
+        }
+        else if(tag.equals(INC_VAL.RP)){
+            cadData.getIncident(incidentId).setRp(value);
+        }
+        else if(tag.equals(INC_VAL.RP_TYPE)){
+            cadData.getIncident(incidentId).setRpType(value);
+        }
+        else if(tag.equals(INC_VAL.ALI)){
+            cadData.getIncident(incidentId).setAli(value);
+        }
+        else if(tag.equals(INC_VAL.MEDIA)){
+            cadData.getIncident(incidentId).setMedia(value);
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncVal");
+        }
+    }
+    
+
+    /**
+     * Returns a string out of IncidentLocation based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncLoc(INC_LOC tag, int incidentId) throws RemoteException {
+        if(tag.equals(INC_LOC.ADDRESS)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getAddress();
+        }
+        else if(tag.equals(INC_LOC.LOC)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getLoc();
+        }
+        else if(tag.equals(INC_LOC.CITY)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getCity();
+        }
+        else if(tag.equals(INC_LOC.COUNTY)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getCounty();
+        }
+        else if(tag.equals(INC_LOC.STATE)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getState();
+        }
+        else if(tag.equals(INC_LOC.ZIP)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getZip();
+        }
+        else if(tag.equals(INC_LOC.BEAT)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getBeat();
+        }
+        else if(tag.equals(INC_LOC.AREA)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getArea();
+        }
+        else if(tag.equals(INC_LOC.SECTOR)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getSector();
+        }
+        else if(tag.equals(INC_LOC.SECTOR_CODE)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getSectorCode();
+        }
+        else if(tag.equals(INC_LOC.DIVISION)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getDivision();
+        }
+        else if(tag.equals(INC_LOC.APT)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getApt();
+        }
+        else if(tag.equals(INC_LOC.BUILDING)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getBuilding();
+        }
+        else if(tag.equals(INC_LOC.CROSS_ST)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getCrossSt();
+        }
+        else if(tag.equals(INC_LOC.LAW)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getLaw();
+        }
+        else if(tag.equals(INC_LOC.FIRE)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getFire();
+        }
+        else if(tag.equals(INC_LOC.EMS)){
+            return cadData.getIncident(incidentId).getIncidentLocation().getEms();
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncLoc");
+        }
+    }
+
+    /**
+     * Set incidentId's field based on tag to value.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public void setCadDataIncLoc(INC_LOC tag, int incidentId, String value) throws RemoteException{
+        if(tag.equals(INC_LOC.ADDRESS)){
+            cadData.getIncident(incidentId).getIncidentLocation().setAddress(value);
+        }
+        else if(tag.equals(INC_LOC.LOC)){
+            cadData.getIncident(incidentId).getIncidentLocation().setLoc(value);
+        }
+        else if(tag.equals(INC_LOC.CITY)){
+            cadData.getIncident(incidentId).getIncidentLocation().setCity(value);
+        }
+        else if(tag.equals(INC_LOC.COUNTY)){
+            cadData.getIncident(incidentId).getIncidentLocation().setCounty(value);
+        }
+        else if(tag.equals(INC_LOC.STATE)){
+            cadData.getIncident(incidentId).getIncidentLocation().setState(value);
+        }
+        else if(tag.equals(INC_LOC.ZIP)){
+            cadData.getIncident(incidentId).getIncidentLocation().setZip(value);
+        }
+        else if(tag.equals(INC_LOC.BEAT)){
+            cadData.getIncident(incidentId).getIncidentLocation().setBeat(value);
+        }
+        else if(tag.equals(INC_LOC.AREA)){
+            cadData.getIncident(incidentId).getIncidentLocation().setArea(value);
+        }
+        else if(tag.equals(INC_LOC.SECTOR)){
+            cadData.getIncident(incidentId).getIncidentLocation().setSector(value);
+        }
+        else if(tag.equals(INC_LOC.SECTOR_CODE)){
+            cadData.getIncident(incidentId).getIncidentLocation().setSectorCode(value);
+        }
+        else if(tag.equals(INC_LOC.DIVISION)){
+            cadData.getIncident(incidentId).getIncidentLocation().setDivision(value);
+        }
+        else if(tag.equals(INC_LOC.APT)){
+            cadData.getIncident(incidentId).getIncidentLocation().setApt(value);
+        }
+        else if(tag.equals(INC_LOC.BUILDING)){
+            cadData.getIncident(incidentId).getIncidentLocation().setBuilding(value);
+        }
+        else if(tag.equals(INC_LOC.CROSS_ST)){
+            cadData.getIncident(incidentId).getIncidentLocation().setCrossSt(value);
+        }
+        else if(tag.equals(INC_LOC.LAW)){
+            cadData.getIncident(incidentId).getIncidentLocation().setLaw(value);
+        }
+        else if(tag.equals(INC_LOC.FIRE)){
+            cadData.getIncident(incidentId).getIncidentLocation().setFire(value);
+        }
+        else if(tag.equals(INC_LOC.EMS)){
+            cadData.getIncident(incidentId).getIncidentLocation().setEms(value);
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncLoc");
+        }
+    }
+    
+    /**
+     * Returns a string out of IncidentCaller based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncCaller(INC_CALLER tag, int incidentId) throws RemoteException {
+        if(tag.equals(INC_CALLER.TYPE)){
+            return cadData.getIncident(incidentId).getIncidentCaller().getCallerType();
+        }
+        else if(tag.equals(INC_CALLER.NAME)){
+            return cadData.getIncident(incidentId).getIncidentCaller().getCallerName();
+        }
+        else if(tag.equals(INC_CALLER.PHONE)){
+            return cadData.getIncident(incidentId).getIncidentCaller().getPhone();
+        }
+        else if(tag.equals(INC_CALLER.EXT)){
+            return cadData.getIncident(incidentId).getIncidentCaller().getExt();
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncCaller");
+        }
+    }
+
+    /**
+     * Set incidentId's field based on tag to value.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public void setCadDataIncCaller(INC_CALLER tag, int incidentId, String value) throws RemoteException{
+        if(tag.equals(INC_CALLER.TYPE)){
+            cadData.getIncident(incidentId).getIncidentCaller().setCallerType(value);
+        }
+        else if(tag.equals(INC_CALLER.NAME)){
+            cadData.getIncident(incidentId).getIncidentCaller().setCallerName(value);
+        }
+        else if(tag.equals(INC_CALLER.PHONE)){
+            cadData.getIncident(incidentId).getIncidentCaller().setPhone(value);
+        }
+        else if(tag.equals(INC_CALLER.EXT)){
+            cadData.getIncident(incidentId).getIncidentCaller().setExt(value);
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncCaller");
+        }
+    }
+    
+    /**
+     * Returns a string out of IncidentProblem based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncProblem(INC_PROBLEM tag, int incidentId) throws RemoteException {
+        if(tag.equals(INC_PROBLEM.PROBLEM)){
+            return cadData.getIncident(incidentId).getProblem().getProblem();
+        }
+        else if(tag.equals(INC_PROBLEM.CODE)){
+            return cadData.getIncident(incidentId).getProblem().getProblemCode();
+        }
+        else if(tag.equals(INC_PROBLEM.PRIORITY)){
+            return cadData.getIncident(incidentId).getProblem().getPriority();
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncProblem");
+        }
+    }
+    
+    /**
+     * Set incidentId's field based on tag to value.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public void setCadDataIncProblem(INC_PROBLEM tag, int incidentId, String value) throws RemoteException{
+        if(tag.equals(INC_PROBLEM.PROBLEM)){
+            cadData.getIncident(incidentId).getProblem().setProblem(value);
+        }
+        else if(tag.equals(INC_PROBLEM.CODE)){
+            cadData.getIncident(incidentId).getProblem().setProblemCode(value);
+        }
+        else if(tag.equals(INC_PROBLEM.PRIORITY)){
+            cadData.getIncident(incidentId).getProblem().setPriority(value);
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncProblem");
+        }
+    }
+
+    /**
+     * Returns a string out of IncidentGeneralInfo based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncGenInfo(INC_GEN_INFO tag, int incidentId) throws RemoteException {
+        if(tag.equals(INC_GEN_INFO.JURISDICTION)){
+            return cadData.getIncident(incidentId).getGenInfo().getJurisdiction();
+        }
+        else if(tag.equals(INC_GEN_INFO.ALARM)){
+            return cadData.getIncident(incidentId).getGenInfo().getAlarm();
+        }
+        else if(tag.equals(INC_GEN_INFO.AGY)){
+            return cadData.getIncident(incidentId).getGenInfo().getAgy();
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncGenInfo");
+        }
+    }
+
+    /**
+     * Set incidentId's field based on tag to value.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public void setCadDataIncGenInfo(INC_GEN_INFO tag, int incidentId, String value) throws RemoteException{
+        if(tag.equals(INC_GEN_INFO.JURISDICTION)){
+            cadData.getIncident(incidentId).getGenInfo().setJurisdiction(value);
+        }
+        else if(tag.equals(INC_GEN_INFO.ALARM)){
+            cadData.getIncident(incidentId).getGenInfo().setAlarm(value);
+        }
+        else if(tag.equals(INC_GEN_INFO.AGY)){
+            cadData.getIncident(incidentId).getGenInfo().setAgy(value);
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncGenInfo");
+        }
+    }
+    
+    /**
+     * Returns a string out of IncidentResponse based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncResp(INC_RESP tag, int incidentId) throws RemoteException {
+        if(tag.equals(INC_RESP.PLAN)){
+            return cadData.getIncident(incidentId).getResponse().getPlan();
+        }
+        else if(tag.equals(INC_RESP.AREA)){
+            return cadData.getIncident(incidentId).getResponse().getArea();
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncResp");
+        }
+    }
+    
+    /**
+     * Set incidentId's field based on tag to value.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public void setCadDataIncResp(INC_RESP tag, int incidentId, String value) throws RemoteException{
+        if(tag.equals(INC_RESP.PLAN)){
+            cadData.getIncident(incidentId).getResponse().setPlan(value);
+        }
+        else if(tag.equals(INC_RESP.AREA)){
+            cadData.getIncident(incidentId).getResponse().setArea(value);
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncResp");
+        }
+    }
+
+    /**
+     * Returns a string out of IncidentAdditionalInfo based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncAddInfo(INC_ADD_INFO tag, int incidentId) throws RemoteException {
+        if(tag.equals(INC_ADD_INFO.TYPE)){
+            return cadData.getIncident(incidentId).getAdditionalInfo().getType();
+        }
+        else if(tag.equals(INC_ADD_INFO.TYPE_CODE)){
+            return cadData.getIncident(incidentId).getAdditionalInfo().getTypeCode();
+        }
+        else if(tag.equals(INC_ADD_INFO.MACHINE)){
+            return cadData.getIncident(incidentId).getAdditionalInfo().getMachine();
+        }
+        else if(tag.equals(INC_ADD_INFO.CALL_STATUS)){
+            return cadData.getIncident(incidentId).getAdditionalInfo().getCallStatus();
+        }
+        else if(tag.equals(INC_ADD_INFO.CALL_TAKER_EXT)){
+            return cadData.getIncident(incidentId).getAdditionalInfo().getCallTakerExt();
+        }
+        else if(tag.equals(INC_ADD_INFO.ALARM_LEVEL)){
+            return cadData.getIncident(incidentId).getAdditionalInfo().getAlarmLevel();
+        }
+        else if(tag.equals(INC_ADD_INFO.ROTATION_PROVIDER_AREA)){
+            return cadData.getIncident(incidentId).getAdditionalInfo().getRotationProviderArea();
+        }
+        else if(tag.equals(INC_ADD_INFO.COMMENT)){
+            return cadData.getIncident(incidentId).getAdditionalInfo().getComment();
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncAddInfo");
+        }
+    }
+
+    /**
+     * Set incidentId's field based on tag to value.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public void setCadDataIncAddInfo(INC_ADD_INFO tag, int incidentId, String value) throws RemoteException{
+        if(tag.equals(INC_ADD_INFO.TYPE)){
+            cadData.getIncident(incidentId).getAdditionalInfo().setType(value);
+        }
+        else if(tag.equals(INC_ADD_INFO.TYPE_CODE)){
+            cadData.getIncident(incidentId).getAdditionalInfo().setTypeCode(value);
+        }
+        else if(tag.equals(INC_ADD_INFO.MACHINE)){
+            cadData.getIncident(incidentId).getAdditionalInfo().setMachine(value);
+        }
+        else if(tag.equals(INC_ADD_INFO.CALL_STATUS)){
+            cadData.getIncident(incidentId).getAdditionalInfo().setCallStatus(value);
+        }
+        else if(tag.equals(INC_ADD_INFO.CALL_TAKER_EXT)){
+            cadData.getIncident(incidentId).getAdditionalInfo().setCallTakerExt(value);
+        }
+        else if(tag.equals(INC_ADD_INFO.ALARM_LEVEL)){
+            cadData.getIncident(incidentId).getAdditionalInfo().setAlarmLevel(value);
+        }
+        else if(tag.equals(INC_ADD_INFO.ROTATION_PROVIDER_AREA)){
+            cadData.getIncident(incidentId).getAdditionalInfo().setRotationProviderArea(value);
+        }
+        else if(tag.equals(INC_ADD_INFO.COMMENT)){
+            cadData.getIncident(incidentId).getAdditionalInfo().setComment(value);
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncAddInfo");
+        }
+    }
+    
+    /**
+     * Returns a string out of IncidentActivities based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncActivities(INC_ACTIVITIES tag, int incidentId) throws RemoteException {
+        if(tag.equals(INC_ACTIVITIES.VEHICLE)){
+            return cadData.getIncident(incidentId).getActivities().getVehicle();
+        }
+        else if(tag.equals(INC_ACTIVITIES.ACTIVITY)){
+            return cadData.getIncident(incidentId).getActivities().getActivity();
+        }
+        else if(tag.equals(INC_ACTIVITIES.LOCATION)){
+            return cadData.getIncident(incidentId).getActivities().getLocation();
+        }
+        else if(tag.equals(INC_ACTIVITIES.COMMENT)){
+            return cadData.getIncident(incidentId).getActivities().getComment();
+        }
+        else if(tag.equals(INC_ACTIVITIES.DISP)){
+            return cadData.getIncident(incidentId).getActivities().getDisp();
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncActivities");
+        }
+    }
+
+    /**
+     * Set incidentId's field based on tag to value.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public void setCadDataIncActivities(INC_ACTIVITIES tag, int incidentId, String value) throws RemoteException{
+        if(tag.equals(INC_ACTIVITIES.VEHICLE)){
+            cadData.getIncident(incidentId).getActivities().setVehicle(value);
+        }
+        else if(tag.equals(INC_ACTIVITIES.ACTIVITY)){
+            cadData.getIncident(incidentId).getActivities().setActivity(value);
+        }
+        else if(tag.equals(INC_ACTIVITIES.LOCATION)){
+            cadData.getIncident(incidentId).getActivities().setLocation(value);
+        }
+        else if(tag.equals(INC_ACTIVITIES.COMMENT)){
+            cadData.getIncident(incidentId).getActivities().setComment(value);
+        }
+        else if(tag.equals(INC_ACTIVITIES.DISP)){
+            cadData.getIncident(incidentId).getActivities().setDisp(value);
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataIncActivities");
+        }
+    }
+    
+    /**
+     * Returns a string out of IncidentCallback based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncCallBack(INC_CALLBACK tag, int incidentId) throws RemoteException {
+        if(tag.equals(INC_CALLBACK.INITIAL)){
+            return cadData.getIncident(incidentId).getCallBacks().getInitial();
+        }
+        else if(tag.equals(INC_CALLBACK.COMMENT)){
+            return cadData.getIncident(incidentId).getCallBacks().getComment();
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncCallBack");
+        }
+    }
+
+    /**
+     * Returns a string out of IncidentEditLog based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncEditLog(INC_EDIT_LOG tag, int incidentId) throws RemoteException {
+        if(tag.equals(INC_EDIT_LOG.EDIT)){
+            return cadData.getIncident(incidentId).getEditLog().getEdit();
+        }
+        else if(tag.equals(INC_EDIT_LOG.REASON)){
+            return cadData.getIncident(incidentId).getEditLog().getReason();
+        }
+        else if(tag.equals(INC_EDIT_LOG.CHANGE_BY)){
+            return cadData.getIncident(incidentId).getEditLog().getChangeBy();
+        }
+        else if(tag.equals(INC_EDIT_LOG.TERMINAL)){
+            return cadData.getIncident(incidentId).getEditLog().getTerminal();
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncEditLog");
+        }
+    }
+
+    /**
+     * Returns a string out of IncidentInfo based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncInfo(INC_INFO tag, int incidentId) throws RemoteException {
+        if(tag.equals(INC_INFO.CALL_INITIATED)){
+            return cadData.getIncident(incidentId).getInfo().getCallInit();
+        }
+        else if(tag.equals(INC_INFO.CALL_TAKEN)){
+            return cadData.getIncident(incidentId).getInfo().getCallTaken();
+        }
+        else if(tag.equals(INC_INFO.TIME_IN_Q)){
+            return cadData.getIncident(incidentId).getInfo().getTimeInQ();
+        }
+        else if(tag.equals(INC_INFO.LAST_UPDATED)){
+            return cadData.getIncident(incidentId).getInfo().getLastUpdated();
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataIncInfo");
+        }
+    }
+
+    /**
+     * Returns a string out of IncidentTimes based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncTimes(INC_TIMES tag, int incidentId) throws RemoteException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+    
+    /**
+     * Returns a CardfileList matching the tag.
+     */
+    public CardfileList getCardfileList(CARDFILE tag) throws RemoteException{
+        if(tag.equals(CARDFILE.COASTAL_DIVISION_UNITS)){
+            return cardfileData.getCoastalDivisionUnitList();
+        }
+        else if(tag.equals(CARDFILE.POLICE_SHERIFF_CORONER)){
+            return cardfileData.getPoliceSheriffCoronerList();
+        }
+        else if(tag.equals(CARDFILE.COURTS)){
+            return cardfileData.getCourtsList();
+        }
+        else if(tag.equals(CARDFILE.PUBLIC_TRANSPORTATION)){
+            return cardfileData.getPublicTransportationList();
+        }
+        else if(tag.equals(CARDFILE.GG_OTHER)){
+            return cardfileData.getGgOtherList();
+        }
+        else if(tag.equals(CARDFILE.MY_MISC)){
+            return cardfileData.getMyMiscList();
+        }
+        else if(tag.equals(CARDFILE.SL_MISC)){
+            return cardfileData.getSlMiscList();
+        }
+        else if(tag.equals(CARDFILE.VT_MISC)){
+            return cardfileData.getVlMiscList();
+        }
+        else if(tag.equals(CARDFILE.CHP_OFFICES)){
+            return cardfileData.getChpOfficesList();
+        }
+        else if(tag.equals(CARDFILE.STATE_AGENCIES_FACILITIES)){
+            return cardfileData.getStateAgenciesFacilitiesList();
+        }
+        else if(tag.equals(CARDFILE.GOVERNMENT_OFFICIALS)){
+            return cardfileData.getGovernmentOfficialsList();
+        }
+        else if(tag.equals(CARDFILE.FEDERAL_AGENCIES)){
+            return cardfileData.getFederalAgenciesList();
+        }
+        else if(tag.equals(CARDFILE.RANCHES_LIVESTOCK)){
+            return cardfileData.getRanchesLivestockList();
+        }
+        else if(tag.equals(CARDFILE.FIRE_EMS)){
+            return cardfileData.getFireEmsList();
+        }
+        else if(tag.equals(CARDFILE.JAILS)){
+            return cardfileData.getJailsList();
+        }
+        else if(tag.equals(CARDFILE.HOSPITALS_MED_CENTERS)){
+            return cardfileData.getHospitalsMedCentersList();
+        }
+        else if(tag.equals(CARDFILE.TOW_COMPANIES)){
+            return cardfileData.getTowCompaniesList();
+        }
+        else if(tag.equals(CARDFILE.CALTRANS)){
+            return cardfileData.getCalTransList();
+        }
+        else if(tag.equals(CARDFILE.COUNTY_ROADS)){
+            return cardfileData.getCountyRoadsList();
+        }
+        else if(tag.equals(CARDFILE.UTILITIES)){
+            return cardfileData.getUtilitiesList();
+        }
+        else if(tag.equals(CARDFILE.ANIMAL_CONTROL)){
+            return cardfileData.getAnimalControlList();
+        }
+        else if(tag.equals(CARDFILE.AIRPORTS)){
+            return cardfileData.getAirportsList();
+        }
+        else if(tag.equals(CARDFILE.CREDIT_CARDS)){
+            return cardfileData.getCreditCardsList();
+        }
+        else if(tag.equals(CARDFILE.GG_CRISIS_SHELTERS)){
+            return cardfileData.getGgCrisisSheltersList();
+        }
+        else if(tag.equals(CARDFILE.RANGES)){
+            return cardfileData.getRangesList();
+        }
+        else if(tag.equals(CARDFILE.HOTLINES)){
+            return cardfileData.getHotlinesList();
+        }
+        else if(tag.equals(CARDFILE.HWY_PATROLS_OOS)){
+            return cardfileData.getHwyPatrolsOosList();
+        }
+        else if(tag.equals(CARDFILE.PARKS_RECREATION)){
+            return cardfileData.getParksRecreationList();
+        }
+        else if(tag.equals(CARDFILE.SHELTERS)){
+            return cardfileData.getSheltersList();
+        }
+        else if(tag.equals(CARDFILE.SL_COUNTY_SERVICES)){
+            return cardfileData.getSlCountyServicesList();
+        }
+        else if(tag.equals(CARDFILE.SL_RESOURCES)){
+            return cardfileData.getSlResourcesList();
+        }
+        else if(tag.equals(CARDFILE.TRUCK_TIRE_REPAIR)){
+            return cardfileData.getTruckTireRepairList();
+        }
+        else if(tag.equals(CARDFILE.MCC_EMPLOYEES)){
+            return cardfileData.getMccEmployeesList();
+        }
+        else if(tag.equals(CARDFILE.GATE_ACCESS_CODES)){
+            return cardfileData.getGateAccessCodesList();
+        }
+        else if(tag.equals(CARDFILE.VT_CALL_SIGNS)){
+            return cardfileData.getVtCallSignsList();
+        }
+        else if(tag.equals(CARDFILE.SLCC_EMPLOYEES)){
+            return cardfileData.getSlccEmployeesList();
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.getCardfileList");
+        }
+    }
+    
+    /**
+     * Receives the fields of the ChangeLog in Cardfile.java and uses those fields
+     * to make changes to its own copy of the Cardfiledata.
+     */
+    public void editCardfile(ChangeLog log) throws RemoteException{
+        
+        CardfileList selectedList;
+        
+        if(log.listTitle.equals(CARDFILE.COASTAL_DIVISION_UNITS.tag)){
+            selectedList = cardfileData.getCoastalDivisionUnitList();
+        }
+        else if(log.listTitle.equals(CARDFILE.POLICE_SHERIFF_CORONER.tag)){
+            selectedList = cardfileData.getPoliceSheriffCoronerList();
+        }
+        else if(log.listTitle.equals(CARDFILE.COURTS.tag)){
+            selectedList = cardfileData.getCourtsList();
+        }
+        else if(log.listTitle.equals(CARDFILE.PUBLIC_TRANSPORTATION.tag)){
+            selectedList = cardfileData.getPublicTransportationList();
+        }
+        else if(log.listTitle.equals(CARDFILE.GG_OTHER.tag)){
+            selectedList = cardfileData.getGgOtherList();
+        }
+        else if(log.listTitle.equals(CARDFILE.MY_MISC.tag)){
+            selectedList = cardfileData.getMyMiscList();
+        }
+        else if(log.listTitle.equals(CARDFILE.SL_MISC.tag)){
+            selectedList = cardfileData.getSlMiscList();
+        }
+        else if(log.listTitle.equals(CARDFILE.VT_MISC.tag)){
+            selectedList = cardfileData.getVlMiscList();
+        }
+        else if(log.listTitle.equals(CARDFILE.CHP_OFFICES.tag)){
+            selectedList = cardfileData.getChpOfficesList();
+        }
+        else if(log.listTitle.equals(CARDFILE.STATE_AGENCIES_FACILITIES.tag)){
+            selectedList = cardfileData.getStateAgenciesFacilitiesList();
+        }
+        else if(log.listTitle.equals(CARDFILE.GOVERNMENT_OFFICIALS.tag)){
+            selectedList = cardfileData.getGovernmentOfficialsList();
+        }
+        else if(log.listTitle.equals(CARDFILE.FEDERAL_AGENCIES.tag)){
+            selectedList = cardfileData.getFederalAgenciesList();
+        }
+        else if(log.listTitle.equals(CARDFILE.RANCHES_LIVESTOCK.tag)){
+            selectedList = cardfileData.getRanchesLivestockList();
+        }
+        else if(log.listTitle.equals(CARDFILE.FIRE_EMS.tag)){
+            selectedList = cardfileData.getFireEmsList();
+        }
+        else if(log.listTitle.equals(CARDFILE.JAILS.tag)){
+            selectedList = cardfileData.getJailsList();
+        }
+        else if(log.listTitle.equals(CARDFILE.HOSPITALS_MED_CENTERS.tag)){
+            selectedList = cardfileData.getHospitalsMedCentersList();
+        }
+        else if(log.listTitle.equals(CARDFILE.TOW_COMPANIES.tag)){
+            selectedList = cardfileData.getTowCompaniesList();
+        }
+        else if(log.listTitle.equals(CARDFILE.CALTRANS.tag)){
+            selectedList = cardfileData.getCalTransList();
+        }
+        else if(log.listTitle.equals(CARDFILE.COUNTY_ROADS.tag)){
+            selectedList = cardfileData.getCountyRoadsList();
+        }
+        else if(log.listTitle.equals(CARDFILE.UTILITIES.tag)){
+            selectedList = cardfileData.getUtilitiesList();
+        }
+        else if(log.listTitle.equals(CARDFILE.ANIMAL_CONTROL.tag)){
+            selectedList = cardfileData.getAnimalControlList();
+        }
+        else if(log.listTitle.equals(CARDFILE.AIRPORTS.tag)){
+            selectedList = cardfileData.getAirportsList();
+        }
+        else if(log.listTitle.equals(CARDFILE.CREDIT_CARDS.tag)){
+            selectedList = cardfileData.getCreditCardsList();
+        }
+        else if(log.listTitle.equals(CARDFILE.GG_CRISIS_SHELTERS.tag)){
+            selectedList = cardfileData.getGgCrisisSheltersList();
+        }
+        else if(log.listTitle.equals(CARDFILE.RANGES.tag)){
+            selectedList = cardfileData.getRangesList();
+        }
+        else if(log.listTitle.equals(CARDFILE.HOTLINES.tag)){
+            selectedList = cardfileData.getHotlinesList();
+        }
+        else if(log.listTitle.equals(CARDFILE.HWY_PATROLS_OOS.tag)){
+            selectedList = cardfileData.getHwyPatrolsOosList();
+        }
+        else if(log.listTitle.equals(CARDFILE.PARKS_RECREATION.tag)){
+            selectedList = cardfileData.getParksRecreationList();
+        }
+        else if(log.listTitle.equals(CARDFILE.SHELTERS.tag)){
+            selectedList = cardfileData.getSheltersList();
+        }
+        else if(log.listTitle.equals(CARDFILE.SL_COUNTY_SERVICES.tag)){
+            selectedList = cardfileData.getSlCountyServicesList();
+        }
+        else if(log.listTitle.equals(CARDFILE.SL_RESOURCES.tag)){
+            selectedList = cardfileData.getSlResourcesList();
+        }
+        else if(log.listTitle.equals(CARDFILE.TRUCK_TIRE_REPAIR.tag)){
+            selectedList = cardfileData.getTruckTireRepairList();
+        }
+        else if(log.listTitle.equals(CARDFILE.MCC_EMPLOYEES.tag)){
+            selectedList = cardfileData.getMccEmployeesList();
+        }
+        else if(log.listTitle.equals(CARDFILE.GATE_ACCESS_CODES.tag)){
+            selectedList = cardfileData.getGateAccessCodesList();
+        }
+        else if(log.listTitle.equals(CARDFILE.VT_CALL_SIGNS.tag)){
+            selectedList = cardfileData.getVtCallSignsList();
+        }
+        else if(log.listTitle.equals(CARDFILE.SLCC_EMPLOYEES.tag)){
+            selectedList = cardfileData.getSlccEmployeesList();
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.editCardfileDataObject");
+        }
+        
+        CardfileDataObject cfdo = cardfileData.getCardfileDataObject(selectedList, log.id);
+        if(cfdo != null && log.command.equals(EditCommand.NAME)){
+            cfdo.setName(log.newValue);
+            selectedList.resort(cardfileData.getCardfileDataIndex(selectedList,log.id));
+        }
+        else if(cfdo != null && log.command.equals(EditCommand.ADDRESS)){
+            cfdo.setAddress(log.newValue);
+        }
+        else if(cfdo != null && log.command.equals(EditCommand.CITY)){
+            cfdo.setCity(log.newValue);
+        }
+        else if(cfdo != null && log.command.equals(EditCommand.STATE)){
+            cfdo.setState(log.newValue);
+        }
+        else if(cfdo != null && log.command.equals(EditCommand.ZIP)){
+            cfdo.setZip(log.newValue);
+        }
+        else if(cfdo != null && log.command.equals(EditCommand.PHONE1)){
+            cfdo.setPhone1(log.newValue);
+        }
+        else if(cfdo != null && log.command.equals(EditCommand.PHONE2)){
+            cfdo.setPhone2(log.newValue);
+        }
+        else if(cfdo != null && log.command.equals(EditCommand.FAX)){
+            cfdo.setFax(log.newValue);
+        }
+        else if(log.command.equals(EditCommand.OBJECT_DELETE)){
+            selectedList.removeDataObject(cardfileData.getCardfileDataIndex(selectedList,log.id));
+        }
+        else if(log.command.equals(EditCommand.OBJECT_ADD)){
+            selectedList.addDataObject(log.newCardfileObject);
+        }
+        else if(log.command.equals(EditCommand.TABLE_ADD)){
+            if(cfdo != null){
+               cfdo.addComment(log.tableFields);
+            }
+        }
+        else if(log.command.equals(EditCommand.TABLE_DELETE)){
+            if(cfdo != null){
+                cfdo.removeComment(log.timeStamp);
+            }
+        }
+        else{
+            
+        }
+        
+        
+    }
+    
+    /**
+     * Obtain a new unique ID for a cardfileDataObject.
+     */
+    public int obtainNewUniqueId() throws RemoteException{
+        return cardfileData.obtainNewUniqueId();
+    }
+    
+    /**
+     * Returns a value from Unit based on tag.
+     * @param unitNum the unitNum to look up
+     * @throws RemoteException 
+     */
+    public UnitStatusEnums getCadDataUnitStatus(String unitNum) throws RemoteException{
+        return cadData.getUnit(unitNum).getUnitStatus();
+    }
+    
+    /**
+     * Returns a string field from Unit based on tag.
+     * @param tag a CADScriptTags tag
+     * @param unitNum the unitNum to look up
+     * @return a string value
+     * @throws RemoteException
+     */
+    public String getCadDataUnitValue(String unitNum, UNIT_TAGS tag) throws RemoteException{
+        if(tag.equals(UNIT_TAGS.MASTER_INC_NUM)){
+            return cadData.getUnit(unitNum).getMasterInc();
+        }
+        else if(tag.equals(UNIT_TAGS.STATUS)){
+            return cadData.getUnit(unitNum).getStatus();
+        }
+        else if(tag.equals(UNIT_TAGS.OOS)){
+            return cadData.getUnit(unitNum).getOos();
+        }
+        else if(tag.equals(UNIT_TAGS.TYPE)){
+            return cadData.getUnit(unitNum).getType();
+        }
+        else if(tag.equals(UNIT_TAGS.CURR_LOC)){
+            return cadData.getUnit(unitNum).getCurrentLocation();
+        }
+        else if(tag.equals(UNIT_TAGS.DESTINATION)){
+            return cadData.getUnit(unitNum).getDestination();
+        }
+        else if(tag.equals(UNIT_TAGS.MISC_INFO)){
+            return cadData.getUnit(unitNum).getMisc();
+        }
+        else if(tag.equals(UNIT_TAGS.STACK)){
+            return cadData.getUnit(unitNum).getStack();
+        }
+        else if(tag.equals(UNIT_TAGS.AREA)){
+            return cadData.getUnit(unitNum).getArea();
+        }
+        else if(tag.equals(UNIT_TAGS.OFFICER)){
+            return cadData.getUnit(unitNum).getOfficer();
+        }
+        else if(tag.equals(UNIT_TAGS.BADGE_NUM)){
+            return cadData.getUnit(unitNum).getBadge();
+        }
+        else if(tag.equals(UNIT_TAGS.TIMER)){
+            return cadData.getUnit(unitNum).getTimerInString();
+        }
+        else if(tag.equals(UNIT_TAGS.OFFICE)){
+            return cadData.getUnit(unitNum).getOffice();
+        }
+        else if(tag.equals(UNIT_TAGS.P)){
+            return cadData.getUnit(unitNum).getP();
+        }
+        else if(tag.equals(UNIT_TAGS.AGY)){
+            return cadData.getUnit(unitNum).getAgy();
+        }
+        else if(tag.equals(UNIT_TAGS.ALIAS)){
+            return cadData.getUnit(unitNum).getAlias();
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.getCadDataUnitValue");
+        }
+    }
+
+    /**
+     * Sets a field from Unit based on tag.
+     * @param tag a CADScriptTags tag
+     * @param unitNum the unitNum to look up
+     * @param value the new value to be set
+     * @throws RemoteException
+     */
+    public void setCadDataUnitValue(String unitNum, UNIT_TAGS tag, Object value) throws RemoteException{
+        if(tag.equals(UNIT_TAGS.MASTER_INC_NUM)){
+            cadData.getUnit(unitNum).setMasterInc((String)value);
+        }
+        else if(tag.equals(UNIT_TAGS.STATUS)){
+            cadData.getUnit(unitNum).setStatus((String)value);
+        }
+        else if(tag.equals(UNIT_TAGS.OOS)){
+            cadData.getUnit(unitNum).setOos((String)value);
+        }
+        else if(tag.equals(UNIT_TAGS.TYPE)){
+            cadData.getUnit(unitNum).setType((String)value);
+        }
+        else if(tag.equals(UNIT_TAGS.CURR_LOC)){
+            cadData.getUnit(unitNum).setCurrentLocation((String)value);
+        }
+        else if(tag.equals(UNIT_TAGS.DESTINATION)){
+            cadData.getUnit(unitNum).setDestination((String)value);
+        }
+        else if(tag.equals(UNIT_TAGS.MISC_INFO)){
+            cadData.getUnit(unitNum).setMisc((String)value);
+        }
+        else if(tag.equals(UNIT_TAGS.STACK)){
+            cadData.getUnit(unitNum).setStack((String)value);
+        }
+        else if(tag.equals(UNIT_TAGS.AREA)){
+            cadData.getUnit(unitNum).setArea((String)value);
+        }
+        else if(tag.equals(UNIT_TAGS.OFFICER)){
+            cadData.getUnit(unitNum).setOfficer((String)value);
+        }
+        else if(tag.equals(UNIT_TAGS.BADGE_NUM)){
+            cadData.getUnit(unitNum).setBadge((String)value);
+        }
+        else if(tag.equals(UNIT_TAGS.UNIT_STATUS)){
+            cadData.getUnit(unitNum).setUnitStatus((UnitStatusEnums)value);
+        }
+        else if(tag.equals(UNIT_TAGS.OFFICE)){
+            cadData.getUnit(unitNum).setOffice((String)value);
+        }
+        else if(tag.equals(UNIT_TAGS.P)){
+            cadData.getUnit(unitNum).setP((String)value);
+        }
+        else if(tag.equals(UNIT_TAGS.AGY)){
+            cadData.getUnit(unitNum).setAgy((String)value);
+        }
+        else if(tag.equals(UNIT_TAGS.ALIAS)){
+            cadData.getUnit(unitNum).setAlias((String)value);
+        }
+        else{
+            throw new RemoteException("Wrong Enum sent into Coordinator.setCadDataUnitValue");
+        }
+    }
+    
+    /**
+     * Assigns a unit to the specified incident.
+     * @param unitNum the unitNum to look up
+     * @param id the incident id that this unit is assigned to.
+     * @throws RemoteException
+     */
+    public void setCadDataUnitAssignedId(String unitNum, int id) throws RemoteException{
+        cadData.getUnit(unitNum).setAssignedIncidentId(id);
+    }
+    
+    /**
+     * Adds a unit to the incident's list of assigned units.
+     * @param incidentId the incident
+     * @param assignedUnitNum the unit that's been assigned to the incident
+     * @throws RemoteException
+     */
+    public void addCadDataIncidentAssignedUnitNum(int incidentId, String assignedUnitNum) throws RemoteException{
+        cadData.getIncident(incidentId).addAssignedUnitNum(assignedUnitNum);
+    }
+    
+    /**
+     * Sets the specified incident to the specified status.
+     * @param incidentId the incident
+     * @param status the status of the incident
+     * @throws RemoteException
+     */
+    public void setCadDataIncidentStatus(int incidentId, IncidentEnums status) throws RemoteException{
+        cadData.getIncident(incidentId).setIncidentStatus(status);
+    }
+    
+    /** 
+     * Returns a LinkedList containing entries that match the search string.
+     * @param search the string entry to be searched
+     * @return linked list of CardfileDataObjects matching search
+     */
+    public LinkedList<CardfileDataObject> getSearchList(String search) throws RemoteException{
+        return cardfileData.getSearchList(search);
+    }
+    
+    /** 
+     * Updates the server database so clients can view additional informations as events complete
+     * @param incidentNumber the incident in which the event occurred
+     * @return completedEvent IncidentEvent with information to be added to server database
+     */
+    public void updateIncidentInGUI(Integer incidentNumber, IncidentEvent completedEvent) {
+        updateDetailsInGUI(incidentNumber, completedEvent);
+        updateUnitsInGUI(incidentNumber, completedEvent);
+    }
+    
+    /** 
+     * Updates the server database so clients can view details as events complete
+     * @param incidentNumber the incident in which the event occurred
+     * @return completedEvent IncidentEvent with details to be added to server database
+     */
+    public void updateDetailsInGUI(Integer incidentNumber, IncidentEvent completedEvent) {
+        DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
+        DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
+        for(int i = 0; i < completedEvent.eventInfo.getDetails().size(); i++){
+            String[] fields = {dateFormat.format(new Date()),
+                       timeFormat.format(new Date()),
+                       "","",completedEvent.eventInfo.getDetails().elementAt(i).details};
+    
+            try{
+                addCadDataIncidentTable(INC_TABLE.COMMENTS_NOTES, incidentNumber, fields);
+            }catch(RemoteException e){
+                e.printStackTrace();
+            }   
+        }
+    }
+    
+    /** 
+     * Updates the server database so clients can view unit updates as events complete
+     * @param incidentNumber the incident in which the event occurred
+     * @return completedEvent IncidentEvent with unit updates to be added to server database
+     */
+    public void updateUnitsInGUI(Integer incidentNumber, IncidentEvent completedEvent) {
+        for(int i = 0; i < completedEvent.eventInfo.getUnits().size(); i++){
+            IncidentInquiryUnitsAssigned unit = completedEvent.eventInfo.getUnits().get(i);
+            if(unit.statusType.equals("ENRT")){
+                cadData.unitAssignedToIncident(unit.beat, incidentNumber, unit.isPrimary);
+            }else if(unit.statusType.equals("1097")){
+                cadData.unitArrivedAtIncidentScene(unit.beat, incidentNumber, unit.isPrimary);
+            }else if(unit.statusType.equals("1098")){
+                cadData.unitAvailable(unit.beat);
+            }
+        }
+    }
+    
+    /**
+     * Sets the specified incidentNumber to viewable in the GUI.
+     * @param incidentNumber the number of the Incident started
+     */
+    public void incidentStartedInGUI(Integer incidentNumber){
+        Date date = new Date();
+        DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
+        cadData.getIncident(incidentNumber).setLogTime(dateFormat.format(date));
+    }
+}
Index: trunk/src/tmcsim/common/ParamicsLocation.java
===================================================================
--- trunk/src/tmcsim/common/ParamicsLocation.java	(revision 2)
+++ trunk/src/tmcsim/common/ParamicsLocation.java	(revision 2)
@@ -0,0 +1,84 @@
+package tmcsim.common;
+
+import java.io.Serializable;
+
+/**
+ * IncidentLocation contains information regarding incident 
+ * locations.  These locations are referenced within the 
+ * Paramics control portion of the CAD Simulator.  The data 
+ * within these objects is read in from a simulation script, 
+ * and must correspond to valid locations within the loaded 
+ * paramics network.
+ * 
+ * @author
+ * @version
+ */
+@SuppressWarnings("serial")
+public class ParamicsLocation implements Serializable {
+
+    /**
+     * Enumeration with XML tag names.
+     * @author Matthew Cechini
+     */
+    public static enum XML_TAGS {
+        /** Route. */
+        ROUTE      ("Route"),
+        /** Route direction. */
+        DIRECTION  ("Direction"),
+        /** Location type. */
+        LOC_TYPE   ("Location_type"),
+        /** Location postmile. */
+        POSTMILE   ("Postmile");
+
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }
+    }
+    
+    /** Unique ID for this IncidentLocation. */
+    public String locationID        = null;
+    
+    /** Route name of incident location. */
+    public String incidentRoute     = null;
+    
+    /** Route direction of incident location. */
+    public String incidentDirection = null;
+    
+    /** Route postmile of incident location. */
+    public String incidentPostmile  = null;
+    
+    /** Type of incident location. */
+    public String incidentLocType   = null;
+
+    
+    /**
+     * Constructor.
+     * 
+     * @param id Unique ID.
+     */
+    public ParamicsLocation(String id) {
+        locationID = id;
+    }
+
+    /**
+     * Receive the tag name and value data from a parsed XML node.  
+     * Set the corresponding data member with the new value.
+     * 
+     * @param tag_value XML tag name.
+     * @param value XML tag value.
+     */
+    public void readXMLNode(String tag_name, String value) {
+        
+        if(tag_name.equals(XML_TAGS.ROUTE.tag))
+            incidentRoute = value;      
+        else if(tag_name.equals(XML_TAGS.DIRECTION.tag))
+            incidentDirection = value;  
+        else if(tag_name.equals(XML_TAGS.POSTMILE.tag))
+            incidentPostmile = value;       
+        else if(tag_name.equals(XML_TAGS.LOC_TYPE.tag))
+            incidentLocType = value;
+                
+    }   
+}
Index: trunk/src/tmcsim/common/CADProtocol.java
===================================================================
--- trunk/src/tmcsim/common/CADProtocol.java	(revision 2)
+++ trunk/src/tmcsim/common/CADProtocol.java	(revision 2)
@@ -0,0 +1,303 @@
+package tmcsim.common;
+
+import java.io.Serializable;
+
+
+/**
+ * CADProtocol contains enumerations used to create the communications protocol
+ * between the CAD Client, CAD Simulator, and ParamicsCommunicator.
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/06 20:46:41 $ $Revision: 1.4 $
+ */
+public class CADProtocol {
+
+    /**
+     * Enumeration of commands that are performed by the CAD client and
+     * transmitted to the CAD Simulator.
+     * @author Matthew Cechini
+     */
+    public static enum CAD_CLIENT_CMD implements Serializable {
+        TERMINAL_REGISTER ("TERMINAL_REGISTER"),
+        TERMINAL_FUNCTION ("TERMINAL_FUNCTION"),
+        TERMINAL_CMD_LINE ("TERMINAL_CMD_LINE"),
+        SAVE_COMMAND_LINE ("SAVE_COMMAND_LINE"),
+        UNKNOWN           ("");
+        
+        public String type;
+        
+        private CAD_CLIENT_CMD(String t) {
+            type = t;           
+        }
+         
+        /**
+         * Returns the CAD_CLIENT_CMD enumeration value which has a command
+         * value that matches the parameter value.
+         * @param t Command type
+         * @throws ScriptException if the parameter value is invalid.
+         * @return CAD_CLIENT_CMD for the parameter value.
+         */     
+        public static CAD_CLIENT_CMD fromString(String t) {
+            for(CAD_CLIENT_CMD cmdType : values()) {
+                if(cmdType.type.equals(t))
+                    return cmdType;
+            }
+            
+            return UNKNOWN;
+        }
+    };
+    
+    /**
+     * Enumeration of commands that are performed by the CAD simulator 
+     * and transmitted to the CAD Client.
+     * @author Matthew Cechini
+     */    
+    public static enum CAD_SIMULATOR_CMD implements Serializable {
+        UPDATE_SCREEN     ("UPDATE_SCREEN"),
+        UPDATE_STATUS     ("UPDATE_STATUS"),
+        UPDATE_TIME       ("UPDATE_TIME"),
+        UPDATE_MSG_COUNT  ("UPDATE_MSG_COUNT"),
+        UPDATE_MSG_UNREAD ("UPDATE_MSG_UNREAD"),
+        CAD_INFO          ("CAD_INFO"),
+        APP_CLOSE         ("APP_CLOSE"),
+        UNKNOWN           ("");
+        
+        public String type;
+        
+        private CAD_SIMULATOR_CMD(String t) {
+            type = t;           
+        }
+                
+        /**
+         * Returns the CAD_SIMULATOR_CMD enumeration value which has a command
+         * value that matches the parameter value.
+         * @param t Command type
+         * @throws ScriptException if the parameter value is invalid.
+         * @return CAD_SIMULATOR_CMD for the parameter value.
+         */         
+        public static CAD_SIMULATOR_CMD fromString(String t) {
+            for(CAD_SIMULATOR_CMD cmdType : values()) {
+                if(cmdType.type.equals(t))
+                    return cmdType;
+            }
+            
+            return UNKNOWN;
+        }
+    };    
+        
+    /**
+     * Enumeration of commands that are parsed from the CAD command line.
+     * @author Matthew Cechini
+     */        
+    public static enum CAD_COMMANDS implements Serializable {
+        
+        BLANK_SCREEN     ("",   "BLANK_SCREEN"),
+        INCIDENT_BOARD   ("IB", "INCIDENT_BOARD"),
+        INCIDENT_UPDATE  ("UI", "INCIDENT_UPDATE"),
+        INCIDENT_INQUIRY ("II", "INCIDENT_INQUIRY"),
+        INCIDENT_SUMMARY ("SA", "INCIDENT_SUMMARY"),
+        ROUTED_MESSAGE   ("TO", "ROUTED_MESSAGE"),
+        ENTER_INCIDENT   ("EI", "ENTER_INCIDENT"),
+        TERMINAL_OFF     ("OF", "TERMINAL_OFF"),
+        APP_CLOSE        ("KILL", "APP_CLOSE"),
+        UNKNOWN          ("", "");
+        
+        /** Mnemonic used on command line. */
+        public String mnemonic = "";
+        /** Full text name of command used for XML document creation. */
+        public String fullName = "";
+        
+        private CAD_COMMANDS(String new_mnemonic, String new_name) {
+            mnemonic = new_mnemonic;
+            fullName = new_name;
+        }
+        
+        /**
+         * Returns the CAD_COMMANDS enumeration value which has a full name
+         * value that matches the parameter value.
+         * @param fName Full name
+         * @throws ScriptException if the parameter value is invalid.
+         * @return CAD_COMMANDS for the parameter value.
+         */         
+        public static CAD_COMMANDS fromFullName(String fName) {
+            for(CAD_COMMANDS cmd : values()) {
+                if(cmd.fullName.equals(fName))
+                    return cmd;
+            }
+            
+            return UNKNOWN;
+        }
+    }
+    
+    /**
+     * Enumeration of field codes that are parsed from the CAD command line.
+     * @author Matthew Cechini
+     */     
+    public static enum CAD_FIELD_CODES implements Serializable {
+        
+        WITNESS_ADDRESS  ("A/", "WITNESS_ADDRESS"),
+        BEAT             ("B/", "BEAT"),
+        CALLBOX          ("C/", "CALLBOX"),
+        DETAILS          ("D/", "DETAILS"),
+        HANDLING_UNIT    ("H/", "HANDLING_UNIT"),
+        INCIDENT_NUMBER  ("I/", "INCIDENT_NUMBER"),
+        LOCATION         ("L/", "LOCATION"),
+        PRIORITY         ("P/", "PRIORITY"),
+        WITNESS_PHONE    ("N/", "WITNESS_PHONE"),
+        TYPE             ("T/", "TYPE"),
+        TOW              ("V/", "TOW"),
+        WITNESS          ("W/", "WITNESS"),
+        MESSAGE          ("M/", "MESSAGE"),
+        ROUTE            ("R/", "ROUTE"),
+        UNKNOWN          ("", "");
+        
+
+        /** Mnemonic used on command line. */
+        public String mnemonic = "";
+        /** Full text name of command used for XML document creation. */
+        public String fullName = "";
+        
+        private CAD_FIELD_CODES(String new_mnemonic, String new_name) {
+            mnemonic = new_mnemonic;
+            fullName = new_name;
+        }
+        
+        /**
+         * Returns the CAD_FIELD_CODES enumeration value which has a full name
+         * value that matches the parameter value.
+         * @param fName Full name
+         * @throws ScriptException if the parameter value is invalid.
+         * @return CAD_FIELD_CODES for the parameter value.
+         */  
+        public static CAD_FIELD_CODES fromFullName(String fName) {
+            for(CAD_FIELD_CODES cmd : values()) {
+                if(cmd.fullName.equals(fName))
+                    return cmd;
+            }
+            
+            return UNKNOWN;
+        }
+    }   
+            
+    /**
+     * Enumeration of XML tag and attribute names that are used for XML 
+     * document creation.
+     * @author Matthew Cechini
+     */     
+    public static enum DATA_TAGS implements Serializable {
+        
+        POSITION_NUM      ("POSITION_NUM"),
+        USER_ID           ("USER_ID"),
+        LOG_NUM           ("LOG_NUM"),
+        //ORIGINAL_CAD_LINE = "ORIGINAL_CAD_LINE"),
+        SENSITIVE         ("SENSITIVE"),
+        FULL_LOCATION     ("FULL_LOCATION"),
+        TRUNC_LOCATION    ("TRUNC_LOCATION"),               
+        ORIGIN            ("ORIGIN"),
+        DESTINATION       ("DESTINATION"),
+        MESSAGE           ("MESSAGE"),      
+        WITNESS_NAME      ("WITNESS_NAME"),
+        WITNESS_PHONE     ("WITNESS_PHONE"),
+        WITNESS_ADDR      ("WITNESS_ADDR"),
+        UNKNOWN           ("");
+        
+        public String tag;
+        
+        private DATA_TAGS(String t) {
+            tag = t;
+        }
+        
+        /**
+         * Returns the DATA_TAGS enumeration value which has a name
+         * value that matches the parameter value.
+         * @param t Tag name
+         * @throws ScriptException if the parameter value is invalid.
+         * @return DATA_TAGS for the parameter value.
+         */         
+        public static DATA_TAGS fromString(String t) {
+            for(DATA_TAGS data : values()) {
+                if(data.tag.equals(t))
+                    return data;
+            }
+            
+            return UNKNOWN;
+        }       
+    }
+    
+    /**
+     * Enumeration of XML tag names that are used for document creation.
+     * @author Matthew Cechini
+     */     
+    public static enum PARAMICS_COMM_TAGS implements Serializable {
+        
+        ID          ("ID"),
+        ACTION      ("ACTION"),
+        TARGET_FILE ("TARGET_FILE"),
+        INTERVAL    ("INTERVAL"),
+        MESSAGE     ("MESSAGE"),
+        WRITER      ("WRITER"),
+        READER      ("READER"),
+        RESET       ("RESET"),
+        UNKNOWN     ("");
+        
+        public String tag;
+        
+        private PARAMICS_COMM_TAGS(String t) {
+            tag = t;
+        }
+        
+        /**
+         * Returns the PARAMICS_COMM_TAGS enumeration value which has a name
+         * value that matches the parameter value.
+         * @param t Tag name.
+         * @throws ScriptException if the parameter value is invalid.
+         * @return PARAMICS_COMM_TAGS for the parameter value.
+         */         
+        public static PARAMICS_COMM_TAGS fromString(String t) {
+            for(PARAMICS_COMM_TAGS comm : values()) {
+                if(comm.tag.equals(t))
+                    return comm;
+            }
+            
+            return UNKNOWN;
+        }
+    }
+    
+    /**
+     * Enumeration of XML tag name that are used for XML document creation
+     * to perform specific actions in the ParamicsCommunicator.
+     * @author Matthew Cechini
+     */     
+    public static enum PARAMICS_ACTIONS implements Serializable {
+        
+        REGISTER   ("REGISTER"),
+        UNREGISTER ("UNREGISTER"),
+        READ_FILE  ("READ_FILE"),
+        WRITE_FILE ("WRITE_FILE"),
+        UNKNOWN    ("");
+        
+        public String action;
+        
+        private PARAMICS_ACTIONS(String a){
+            action = a;
+        }
+        
+        /**
+         * Returns the PARAMICS_ACTIONS enumeration value which has an action
+         * value that matches the parameter value.
+         * @param a Paramics action.
+         * @throws ScriptException if the parameter value is invalid.
+         * @return PARAMICS_ACTIONS for the parameter value.
+         */ 
+        public static PARAMICS_ACTIONS fromString(String a) {
+            for(PARAMICS_ACTIONS act : values()) {
+                if(act.action.equals(a))
+                    return act;
+            }
+            
+            return UNKNOWN;
+        }       
+    }
+    
+}
+
Index: trunk/src/tmcsim/common/CADScriptTags.java
===================================================================
--- trunk/src/tmcsim/common/CADScriptTags.java	(revision 2)
+++ trunk/src/tmcsim/common/CADScriptTags.java	(revision 2)
@@ -0,0 +1,239 @@
+package tmcsim.common;
+
+
+/**
+ * CADScriptTags contains enumerations grouping tag and attribute names
+ * used in parsing and creating a simulation script. 
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public class CADScriptTags {
+
+    /**
+     * Enumeration representing the tag names corresponding to major XML 
+     * document elements in a CAD Script. 
+     * @author Matthew Cechini
+     */
+    public static enum SCRIPT_LEVEL_TAGS {
+        TMC_SCRIPT          ("TMC_SCRIPT"),
+        SCRIPT_EVENT        ("SCRIPT_EVENT"),
+        CAD_DATA            ("CAD_DATA"),
+        HEADER_INFO         ("HEADER_INFO"),
+        LOCATION_INFO       ("LOCATION_INFO"),
+        CAD_INCIDENT_EVENT  ("CAD_INCIDENT_EVENT"), 
+        PARAMICS            ("PARAMICS");
+        
+        public String tag;
+        
+        private SCRIPT_LEVEL_TAGS(String t) {
+            tag = t;
+        }
+    }
+
+    /**
+     * Enumeration representing the tag names corresponding to XML 
+     * document tag and attribute names within the SCRIPT_EVENT
+     * element in a CAD Script.
+     * @author Matthew Cechini
+     */
+    public static enum SCRIPT_EVENT_TAGS {
+        TIME_INDEX     ("TIME_INDEX"),
+        INCIDENT       ("INCIDENT"),
+        LOG_NUMBER     ("LogNum");
+        
+        public String tag;
+        
+        private SCRIPT_EVENT_TAGS(String t) {
+            tag = t;
+        }
+    }
+
+    /**
+     * Enumeration representing the tag names corresponding to XML 
+     * document tag and attribute names within the LOCATION_INFO
+     * element in a CAD Script.
+     * @author Matthew Cechini
+     */
+    public static enum LOCATION_INFO_TAGS {
+        ID             ("ID");
+        
+        public String tag;
+        
+        private LOCATION_INFO_TAGS(String t) {
+            tag = t;
+        }
+    }
+
+    /**
+     * Enumeration representing the tag names corresponding to XML 
+     * document tag and attribute names within the CAD_DATA
+     * element in a CAD Script.
+     * @author Matthew Cechini
+     */
+    public static enum CAD_INCIDENT_DATA_TAGS {
+        AUDIO             ("AUDIO"),    
+        CCTV_INFO         ("CCTV_INFO"),
+        DETAIL            ("DETAIL"),
+        UNIT              ("UNIT"),
+        WITNESS           ("WITNESS"),
+        TOW               ("TOW"),
+        SERVICE           ("SERVICE");
+        
+        public String tag;
+        
+        private CAD_INCIDENT_DATA_TAGS(String t) {
+            tag = t;
+        }
+    }
+
+    /**
+     * Enumeration representing the tag names corresponding to XML 
+     * document tag and attribute names within the HEADER_INFO
+     * element in a CAD Script.
+     * @author Matthew Cechini
+     */
+    public static enum INCIDENT_HEADER_TAGS {
+        LOG_NUMBER     ("LogNum"),
+        LOG_STATUS     ("LogStatus"),
+        DESCRIPTION    ("Desc"),
+        PRIORITY       ("Priority"),
+        TYPE           ("Type"),
+        FULL_LOCATION  ("FullLoc"),
+        TRUNC_LOCATION ("TruncLoc"),
+        BEAT           ("Beat"),
+        CALLBOX        ("Callbox");
+        
+        public String tag;
+        
+        private INCIDENT_HEADER_TAGS(String t) {
+            tag = t;
+        }
+    }
+
+    /**
+     * Enumeration representing the tag names corresponding to XML 
+     * document tag and attribute names within the UNIT
+     * element in a CAD Script.
+     * @author Matthew Cechini
+     */
+    public static enum UNIT_TAGS {
+        UNIT_NUMBER      ("UnitNum"),
+        UNIT_STATUS      ("Status"),
+        UNIT_PRIMARY     ("Primary"),
+        UNIT_ACTIVE      ("Active");
+        
+        public String tag;
+        
+        private UNIT_TAGS (String t) {
+            tag = t;
+        }       
+    }
+
+    /**
+     * Enumeration representing the tag names corresponding to XML 
+     * document tag and attribute names within the TOW
+     * element in a CAD Script.
+     * @author Matthew Cechini
+     */
+    public static enum TOW_TAGS {
+        TOW_COMPANY_NAME ("Company"),
+        CONF_PHONE_NUM   ("ConfNum"),
+        PUBLIC_PHONE_NUM ("PubNum"),
+        BEAT             ("Beat");
+        
+        public String tag;
+        
+        private TOW_TAGS(String t) {
+            tag = t;
+        }       
+    }
+
+    /**
+     * Enumeration representing the tag names corresponding to XML 
+     * document tag and attribute names within the WITNESS
+     * element in a CAD Script.
+     * @author Matthew Cechini
+     */
+    public static enum WITNESS_TAGS {
+        WITNESS_NAME     ("Name"),
+        WITNESS_ADDRESS  ("Address"),
+        WITNESS_PHONE    ("PhoneNum");
+        
+        public String tag;
+        
+        private WITNESS_TAGS(String t) {
+            tag = t;
+        }       
+    }
+
+    /**
+     * Enumeration representing the tag names corresponding to XML 
+     * document tag and attribute names within the SERVICE
+     * element in a CAD Script.
+     * @author Matthew Cechini
+     */
+    public static enum SERVICE_TAGS {   
+        SERVICE_NAME     ("Name"),
+        CONF_PHONE_NUM   ("ConfNum"),
+        PUBLIC_PHONE_NUM ("PubNum");
+        
+        public String tag;
+        
+        private SERVICE_TAGS(String t) {
+            tag = t;
+        }
+    }
+
+    /**
+     * Enumeration representing the tag names corresponding to XML 
+     * document tag and attribute names within the AUDIO
+     * element in a CAD Script.
+     * @author Matthew Cechini
+     */
+    public static enum AUDIO_TAGS {
+        FILE_PATH    ("Path"),
+        FILE_LENGTH  ("Length");
+        
+        public String tag;
+        
+        private AUDIO_TAGS(String t) {
+            tag = t;
+        }
+    }
+
+    /**
+     * Enumeration representing the tag names corresponding to XML 
+     * document tag and attribute names within the PARAMICS
+     * element in a CAD Script.
+     * @author Matthew Cechini
+     */
+    public static enum PARAMICS_TAGS {
+        LOCATION_ID      ("LocationID");    
+        
+        public String tag;
+        
+        private PARAMICS_TAGS(String t) {
+            tag = t;
+        }
+    }
+
+    /**
+     * Enumeration representing the tag names corresponding to XML 
+     * document tag and attribute names within the CCTV
+     * element in a CAD Script.
+     * @author Matthew Cechini
+     */
+    public static enum CCTV_TAGS {
+        CCTV_ID          ("ID"),
+        CCTV_DIR         ("Dir"),
+        CCTV_TOGGLE      ("Toggle");    
+        
+        public String tag;
+        
+        private CCTV_TAGS(String t) {
+            tag = t;
+        }
+    }
+
+}
Index: trunk/src/tmcsim/common/CCTVInfo.java
===================================================================
--- trunk/src/tmcsim/common/CCTVInfo.java	(revision 2)
+++ trunk/src/tmcsim/common/CCTVInfo.java	(revision 2)
@@ -0,0 +1,35 @@
+package tmcsim.common;
+
+import java.io.Serializable;
+
+/**
+ * The CCTVInfo object holds information that is used during a simulation to 
+ * toggle a CCTV camera (referenced by the ID and direction) to begin or 
+ * stop showing incident data.
+ * 
+ * @author
+ * @version 
+ */
+@SuppressWarnings("serial")
+public class CCTVInfo implements Serializable {
+
+    /** Paramics CCTV unique id. */
+    public int cctv_id;
+
+    /** Direction of CCTV. */
+    public CCTVDirections direction;
+
+    /** Flag to designate whether the CCTV is being toggled on(true) or off(false). */
+    public boolean toggle;
+    
+
+    /**
+     * Constructor.
+     */
+    public CCTVInfo() {
+        cctv_id   = 0;
+        direction = CCTVDirections.NORTH;
+        toggle    = false;
+    }
+    
+}
Index: trunk/src/tmcsim/common/ObserverMessage.java
===================================================================
--- trunk/src/tmcsim/common/ObserverMessage.java	(revision 2)
+++ trunk/src/tmcsim/common/ObserverMessage.java	(revision 2)
@@ -0,0 +1,53 @@
+package tmcsim.common;
+
+
+/**
+ * The ObserverMessage acts as a message object to pass information between 
+ * components within the CADClient and CAD Simulator.  The ObserverMessage
+ * contains a enumerated message type and data object that may be used
+ * by observers.
+ * 
+ * @author Matthew Cechini
+ * @version 
+ */
+public class ObserverMessage {
+    
+    /**
+     * Enumeration of all possible message types.
+     * 
+     * INCIDENT_INQUIRY      - Notify observers with a new IncidentInquiry model object.
+     * INCIDENT_SUMMARY      - Notify observers with a new IncidentSummry model object.
+     * INCIDENT_BOARD        - Notify observers with a new IncidentBoard model object.
+     * ROUTED_MESSAGE        - Notify observers with a new RouteMessage model object.
+     * BLANK_SCREEN          - Notify observers with a new BlankScreen model object.
+     * SCREEN_UPDATE         - Notify observers with a new ScreenUpdate string.
+     * TIME_UPDATE           - Notify observers with a new CAD Time value.
+     * ROUTED_MESSAGE_COUNT_UPDATE  - Notify observers with a new count of routed messages.
+     * ROUTED_MESSAGE_UNREAD_UPDATE - Notify observers with the unread message status boolean.
+     * CAD_INFO_MESSAGE      - Notify observers with a new CAD info message.
+     * REFRESH_VIEW          - Notify observers with to refresh the current view.
+     * RESET_SIMULATION      - Notify observers that the simulation is being reset.
+     */
+    public static enum messageType { INCIDENT_INQUIRY, INCIDENT_SUMMARY, INCIDENT_BOARD, 
+                                     ROUTED_MESSAGE, BLANK_SCREEN, SCREEN_UPDATE, 
+                                     TIME_UPDATE, ROUTED_MESSAGE_COUNT_UPDATE,
+                                     ROUTED_MESSAGE_UNREAD_UPDATE, CAD_INFO_MESSAGE, 
+                                     REFRESH_VIEW, RESET_SIMULATION };
+    
+    /** Type of message. */
+    public messageType type  = null;
+    
+    /** Data being sent to observers. */
+    public Object      value = null;    
+    
+    /**
+     * 
+     * @param newType Type of message.
+     * @param o Data object.
+     */
+    public ObserverMessage(messageType newType, Object o) {
+        type  = newType;
+        value = o;
+    }   
+    
+}
Index: trunk/src/tmcsim/common/XMLIncident.java
===================================================================
--- trunk/src/tmcsim/common/XMLIncident.java	(revision 2)
+++ trunk/src/tmcsim/common/XMLIncident.java	(revision 2)
@@ -0,0 +1,298 @@
+package tmcsim.common;
+
+import java.io.Serializable;
+import java.util.Vector;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * XMLIncident contains incident information used to create the XML file that 
+ * is transmitted to paramics.  It's methods construct an XML element with the
+ * incident data.  
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/06 20:46:41 $ $Revision: 1.4 $
+ */
+@SuppressWarnings("serial")
+public class XMLIncident implements Serializable {      
+
+    /**
+     * Enumeration with XML tag names.
+     * @author Matthew Cechini
+     */
+    private static enum XML_TAGS {      
+        /** Current Incident info. */
+        INCIDENT   ("Incident"),
+        /** Incident's ID. */
+        ID         ("Identifier"),
+        /** Incident's status. */
+        STATUS     ("Status"),
+        /** Incident Location. */
+        LOCATION   ("Location"),
+        /** Incident's route location. */
+        ROUTE      ("Route"),
+        /** Incident's route direction. */
+        DIRECTION  ("Direction"),
+        /** Incident's route location type. */
+        LOC_TYPE   ("Location_type"),
+        /** Incident's route postmile. */
+        POSTMILE   ("Postmile"),
+        /** Incident's type. */
+        INC_TYPE   ("Incident_type"),
+        /** Incident lanes. */
+        LANES      ("Lanes"),
+        /** Lane number. */
+        LANE_NUM   ("Lane_number");
+        
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }
+    }
+    
+    /**
+     * Enumeration containing possible incident status values.
+     */
+    public static enum INCIDENT_STATUS { 
+        NEW      ("NEW"), 
+        CHANGED  ("CHANGED"), 
+        ON_GOING ("ON_GOING"), 
+        CLEARED  ("CLEARED");  
+    
+        public String status;
+        
+        private INCIDENT_STATUS(String s) {
+            status = s;
+        }
+        
+        /**
+         * Returns the INCIDENT_STATUS enumeration value which has a status
+         * value that matches the parameter value.
+         * @param val Incident status.
+         * @throws ScriptException if the parameter value is invalid.
+         * @return INCIDENT_STATUS for the parameter value.
+         */
+        public static INCIDENT_STATUS fromValue(String val) throws ScriptException {
+            
+            for(INCIDENT_STATUS incStatus : values()) {
+                if(incStatus.status.equals(val))
+                    return incStatus;
+            }
+            throw new ScriptException(ScriptException.INVALID_ENUM, val);
+        }       
+    
+    };
+    
+    /**
+     * Enumeration containing possible incident type values.
+     */
+    public static enum INCIDENT_TYPE { 
+        LANE_BREAKDOWN ("LANE_BREAKDOWN"); 
+    
+        public String type;
+        
+        private INCIDENT_TYPE(String s) {
+            type = s;
+        }
+            
+        /**
+         * Returns the INCIDENT_STATUS enumeration value which has a status
+         * value that matches the parameter value.
+         * @param val Incident status.
+         * @throws ScriptException if the parameter value is invalid.
+         * @return INCIDENT_STATUS for the parameter value.
+         */
+        public static INCIDENT_TYPE fromValue(String val) throws ScriptException {
+            
+            for(INCIDENT_TYPE incType : values()) {
+                if(incType.type.equals(val))
+                    return incType;
+            }
+            throw new ScriptException(ScriptException.INVALID_ENUM, val);
+        }     
+    };  
+
+    /** Incident unique ID. */
+    private String incidentID    = null;
+    
+    /** Incident status. */
+    private INCIDENT_STATUS incidentStatus = null;
+    
+    /** Incident type. */ 
+    private INCIDENT_TYPE incidentType  = null;
+    
+    /** Lane numbers affected incident. */
+    private Vector<String> lanes = null;
+    
+    /** Incident location object. */
+    private ParamicsLocation theLocation = null;
+    
+    
+    /**
+     * Constructor.  Initialize data members.
+     * 
+     * @param id Incident ID.
+     * @param newLocation Incident location.
+     */  
+    public XMLIncident(String id, ParamicsLocation newLocation) {
+        
+        incidentID     = id;
+        theLocation    = newLocation;
+        incidentStatus = INCIDENT_STATUS.CLEARED; 
+        incidentType   = INCIDENT_TYPE.LANE_BREAKDOWN;  
+        lanes          = new Vector<String>();
+    }
+        
+    /**
+     * Get the incident ID.
+     * @return Incident ID.
+     */
+    public String getIdentifier() {
+        return incidentID;  
+    }
+    
+    
+    /**
+     * Receive the tag name and data from XML parsing.
+     * @param name XML Tag name.
+     * @param value XML Tag value.
+     * @throws ScriptException if there is an error in parsing the node data.
+     */
+    public void readXMLNode(String name, String value) throws ScriptException {
+        
+        if(name.equals(XML_TAGS.STATUS.tag))
+            incidentStatus = INCIDENT_STATUS.fromValue(value);      
+        else if(name.equals(XML_TAGS.INC_TYPE.tag))
+            incidentType = INCIDENT_TYPE.fromValue(value);
+        else if(name.equals(XML_TAGS.LANE_NUM.tag))
+            lanes.add(value);       
+                
+    }   
+    
+    /**
+     * Adds XML tags to the parameter Element for this Incident with the 
+     * following schema: <br/>
+     * <Incident><br/>
+     *      <Identifier/><br/>
+     *      <Status/><br/>
+     *      <Location><br/>
+     *           <Route/><br/>
+     *           <Direction/><br/>
+     *           <Location_type/><br/>
+     *           <Postmile/><br/>
+     *      </Location><br/>
+     *      <Incident_type/><br/>
+     *      <Lanes><br/>
+     *          <Lane_number/><br/>
+     *      </Lanes><br/>
+     * </Incident><br/>
+     *
+     * @param currElem XML Element used as a root for XML tag appending.
+     */
+    public void toXML(Element currElem) {
+                        
+        Document theDoc = currElem.getOwnerDocument();
+                
+        Element incidentElem = theDoc.createElement(XML_TAGS.INCIDENT.tag);
+        currElem.appendChild(incidentElem);
+        
+        Element idElement = theDoc.createElement(XML_TAGS.ID.tag);
+        idElement.appendChild(theDoc.createTextNode(incidentID));
+        incidentElem.appendChild(idElement);
+
+        Element statusElement = theDoc.createElement(XML_TAGS.STATUS.tag);
+        statusElement.appendChild(theDoc.createTextNode(incidentStatus.status));
+        incidentElem.appendChild(statusElement);
+        
+        writeLocationXML(incidentElem);
+            
+        Element typeElement = theDoc.createElement(XML_TAGS.INC_TYPE.tag);
+        typeElement.appendChild(theDoc.createTextNode(incidentType.type));
+        incidentElem.appendChild(typeElement);
+            
+        writeLanesXML(incidentElem);
+        
+    }
+    
+    /**
+     *
+     * Write the location information for the incident with the following
+     * XML Schema: <br>
+     * <Location><br>
+     *      <Route/><br>
+     *      <Direction/><br>
+     *      <Location_type/><br>
+     *      <Postmile/><br>
+     * </Location><br>
+     */
+    protected void writeLocationXML(Element currElem) {
+
+        Document theDoc = currElem.getOwnerDocument();
+        
+        Element locationElement = theDoc.createElement(XML_TAGS.LOCATION.tag);
+        currElem.appendChild(locationElement);
+
+        Element routeElement = theDoc.createElement(XML_TAGS.ROUTE.tag);
+        routeElement.appendChild(theDoc.createTextNode(theLocation.incidentRoute));
+        locationElement.appendChild(routeElement);
+
+        Element directionElement = theDoc.createElement(XML_TAGS.DIRECTION.tag);
+        directionElement.appendChild(theDoc.createTextNode(theLocation.incidentDirection));
+        locationElement.appendChild(directionElement);
+
+        Element typeElement = theDoc.createElement(XML_TAGS.LOC_TYPE.tag);
+        typeElement.appendChild(theDoc.createTextNode(theLocation.incidentLocType));
+        locationElement.appendChild(typeElement);
+
+        Element postmileElement = theDoc.createElement(XML_TAGS.POSTMILE.tag);
+        postmileElement.appendChild(theDoc.createTextNode(theLocation.incidentPostmile));
+        locationElement.appendChild(postmileElement);
+    }
+    
+    /**
+     * Write the lanes for the incident with the following XML Schema.<br/>
+     * <Lanes><br>
+     *     <Lane_number/><br>
+     *     <Lane_number/><br>
+     * </Lanes><br>
+     */
+    protected void writeLanesXML(Element currElem) {
+        
+        Document theDoc = currElem.getOwnerDocument();
+        
+        Element lanesElement = theDoc.createElement(XML_TAGS.LANES.tag);
+        currElem.appendChild(lanesElement);
+
+        Element laneElement = null;     
+
+        for(String l : lanes) {
+            laneElement = theDoc.createElement(XML_TAGS.LANE_NUM.tag);
+            laneElement.appendChild(theDoc.createTextNode(l));
+            lanesElement.appendChild(laneElement);      
+        }
+    }
+    
+    /** 
+     * This method is used to set the status of this incident object to
+     * "ON_GOING" if the incident has not been cleard.
+     */
+    public void update() {
+        
+        if(!isCleared())
+            incidentStatus = INCIDENT_STATUS.ON_GOING;
+        
+    }
+    
+    /**
+     * Method is called to determine if this incident update object is clearing 
+     * an incident.  This is determined by checking if the status string is "CLEARED".
+     *
+     * @return true if object is clearing an incident, false if not.
+     */
+    public boolean isCleared() {
+        return (incidentStatus == INCIDENT_STATUS.CLEARED); 
+    }
+    
+}         
Index: trunk/src/tmcsim/common/package.html
===================================================================
--- trunk/src/tmcsim/common/package.html	(revision 2)
+++ trunk/src/tmcsim/common/package.html	(revision 2)
@@ -0,0 +1,5 @@
+<html>
+  <body>
+  	This package contains classes for common objects within the CAD software.
+  </body>
+</html>
Index: trunk/src/tmcsim/common/CADEnums.java
===================================================================
--- trunk/src/tmcsim/common/CADEnums.java	(revision 2)
+++ trunk/src/tmcsim/common/CADEnums.java	(revision 2)
@@ -0,0 +1,304 @@
+package tmcsim.common;
+
+import java.io.Serializable;
+import java.util.Vector;
+
+
+/**
+ * CADEnums contains enumerations used to encapsulate specific lists of data.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public class CADEnums {
+    
+    /**
+     * Enumeration representing the possible page numbers in the
+     * CAD screen.  The next() method will cycle through the pages in the following
+     * order: ONE - TWO - THREE - FOUR - (repeat).  Each enumeration has an integer
+     * value equal to that name of the object.
+     * @author Matthew Cechini
+     */
+    public static enum CADScreenNum 
+    { 
+        ONE(1), 
+        TWO(2), 
+        THREE(3), 
+        FOUR(4);
+   
+        /** Numerical value of the CADScreen number. */
+        public int intNum;
+        
+        /**
+         * Constructor.
+         * @param i Screen number value.
+         */
+        CADScreenNum(int i) {
+            intNum = i;
+        }
+        
+        /**
+         * Returns the CADScreenNum enumeration value which follows the current value.
+         * @return Next CADScreen number.
+         */
+        public CADScreenNum next() {
+            switch(this) {
+                case ONE:
+                    return TWO;
+                case TWO:
+                    return THREE;
+                case THREE:
+                    return FOUR;
+                case FOUR:
+                default:
+                    return ONE;
+                
+            }
+        }               
+     
+        /**
+         * Returns the CADScreenNum enumeration value which has a integer
+         * value that matches the parameter value.
+         * @param val Page number.
+         * @throws ScriptException if the parameter value is invalid.
+         * @return CADScreen for page number.
+         */
+        public static CADScreenNum fromValue(int val) {
+            
+            for(CADScreenNum screen : values()) {
+                if(screen.intNum == val)
+                    return screen;
+            }
+            
+            return ONE;
+        }       
+        
+        /**
+         * Return an ordered list of CADScreenNum objects.  The list is ordered from
+         * ONE through FOUR.
+         * 
+         * @return Ordered list of CADScreenNum objects.
+         */
+        public static Vector<CADScreenNum> orderedList() {
+            Vector<CADScreenNum> orderedList = new Vector<CADScreenNum>();
+            
+            orderedList.add(ONE);
+            orderedList.add(TWO);
+            orderedList.add(THREE);
+            orderedList.add(FOUR);
+            
+            return orderedList;
+        }
+    }
+
+    /**
+     * Enumeration representing the possible CAD Screens that are viewable
+     * in the CAD.  
+     * @author Matthew Cechini
+     */
+    public static enum CADScreenType { 
+        BLANKSCREEN, 
+        II_INCIDENT_INQUIRY, 
+        ON_LOGIN_SCREEN,
+        SA_INCIDENT_SUMMARY, 
+        IB_INCIDENT_BOARD, 
+        TO_ROUTED_MESSAGE 
+    };
+
+    /**
+     * Enumeration containing the key code values for the keyboard keys that 
+     * are mapped to CAD functions. 
+     * @author Matthew Cechini
+     */
+    public static enum CAD_KEYS implements Serializable {
+        COMMAND_LINE_TX    (112),  
+        PGUP               (36),
+        LEFT_ARROW         (37),
+        UP_ARROW           (38),
+        RIGHT_ARROW        (39),
+        DOWN_ARROW         (40),
+        PGDN               (35),
+        REFRESH            (34),
+        CYCLE              (33),
+        BACKSPACE          (8),
+        PREV_QUEUE         (121), 
+        DELETE_QUEUE       (120),
+        NEXT_QUEUE         (119),
+        SCREEN_CLEAR       (123),    
+        COMMAND_LINE_CLEAR (122),    
+        SHIFT_KEY          (16),
+        ENTER              (10),
+        UNKNOWN            (-1);
+        
+        public int value;
+        
+        //{CAD, STD}
+        public static String keyboard_type = "STD";   
+        
+        private CAD_KEYS(int v) {
+            value         = v;          
+        }
+        
+        /**
+         * Returns the CAD_KEYS enumeration value which has a key
+         * value that matches the parameter value.
+         * @param v Key value.
+         * @throws ScriptException if the parameter value is invalid.
+         * @return CAD_KEYS for the parameter value.
+         */ 
+        public static CAD_KEYS fromValue(String kbd_type, int v) {
+            
+            String prevType = null;
+            
+            try {
+                //Preserve previous keyboard type, if not same as parameter.
+                if(!kbd_type.equals(keyboard_type)) {
+                    prevType = keyboard_type;
+                    
+                    if(kbd_type.equals("CAD")) {
+                        setupCADKeyboard();
+                    }
+                    else {
+                        setupStandardKeyboard();
+                    }
+                }
+                
+                //Find matching key.
+                for(CAD_KEYS key : values()) {
+                    if(key.value == v)
+                        return key;
+                }               
+                
+                return UNKNOWN;
+            } 
+            finally {
+                //Restore previous keyboard type, if saved.
+                if(prevType != null) {
+                    if(prevType.equals("CAD")) {
+                        setupCADKeyboard();
+                    }
+                    else {
+                        setupStandardKeyboard();
+                    }
+                }
+            }
+        }
+        
+        public static void setupCADKeyboard() {
+            SCREEN_CLEAR.value       = 61451;
+            COMMAND_LINE_CLEAR.value = 61450;
+            COMMAND_LINE_TX.value    = 61447;
+
+            keyboard_type = "CAD";
+        }
+        
+        public static void setupStandardKeyboard() {
+            SCREEN_CLEAR.value       = 123;
+            COMMAND_LINE_CLEAR.value = 122;
+            COMMAND_LINE_TX.value    = 112;
+            
+            keyboard_type = "STD";
+        }
+        
+    };
+                                       
+    /**
+     * Enumeration representing the possible directional arrows that may be pressed.  
+     * @author Matthew Cechini
+     */               
+    public static enum ARROW { 
+        LEFT, 
+        RIGHT, 
+        UP, 
+        DOWN };
+
+    /**
+     * Enumeration representing possible errors that may occur as a result of CAD
+     * command line parsing.  Each object has an associated text message for display. 
+     * @author Matthew Cechini
+     */
+    public static enum CAD_ERROR { 
+        UNAUTH_CMD  ("0002: Unauthorized Command"), 
+        NO_LOG_NUM  ("0744: Must provide log # when no log is on display"),
+        KYBD_LOCK   ("0796: KYBD Successfuly Locked"),
+        INVALID_LOG ("0753: Invalid Log Number");
+        
+        /** Error message. */
+        public String message;
+        
+        /**
+         * Constructor.
+         * @param m Error message.
+         */
+        CAD_ERROR(String m) {
+            message = m;    
+        }
+            
+    }
+
+    /**
+     * Enumeration representing possible text styles that will be used in CAD screen
+     * document creation.
+     * @author Matthew Cechini
+     */
+    public static enum TEXT_STYLES { 
+        BLUE          ("blue"),
+        BLACK         ("black"),
+        AQUA          ("aqua"),
+        RED           ("red"),
+        GRAY          ("gray"),
+        CYAN          ("cyan"),
+        YELLOW        ("yellow"),
+        WHITE         ("white"),
+        GREEN         ("green"),
+        ORANGE        ("orange"),
+        REVERSE_GREEN ("rev_green"),
+        REVERSE_CYAN  ("rev_cyan"),
+        GREEN_HIGHLIGHT ("green_highlight"),
+        
+        REGULAR ("regular"),
+        ITALIC  ("italic"),
+        BOLD    ("bold"),
+        
+        COURIER ("Courier");    
+            
+        /** Style string. */
+        public String style;
+        
+        /**
+         * Constructor.
+         * @param s Style string.
+         */
+        TEXT_STYLES(String s) {
+            style = s;  
+        }
+    }
+
+    /**
+     * Enumeration representing all possible states that the script may be in.
+     * @author Matthew Cechini
+     */
+    public static enum SCRIPT_STATUS { 
+        NO_SCRIPT, 
+        SCRIPT_STOPPED_NOT_STARTED, 
+        SCRIPT_PAUSED_STARTED, 
+        SCRIPT_RUNNING,
+        ATMS_SYNCHRONIZATION};
+
+    /**
+     * Enumeration representing all possible states of the paramics connection.
+     * @author Matthew Cechini
+     */
+    public static enum PARAMICS_STATUS { 
+        UNKNOWN, 
+        CONNECTING, 
+        CONNECTED, 
+        DISCONNECTED, 
+        SENDING_NETWORK_ID, 
+        LOADING, 
+        WARMING, 
+        LOADED, 
+        DROPPED, 
+        UNREACHABLE };
+
+}
Index: trunk/src/tmcsim/common/ScriptHandler.java
===================================================================
--- trunk/src/tmcsim/common/ScriptHandler.java	(revision 2)
+++ trunk/src/tmcsim/common/ScriptHandler.java	(revision 2)
@@ -0,0 +1,350 @@
+package tmcsim.common;
+
+import java.util.TreeMap;
+import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import tmcsim.client.cadclientgui.data.Incident;
+import tmcsim.client.cadclientgui.data.IncidentEvent;
+import tmcsim.cadmodels.IncidentInquiryDetails;
+import tmcsim.cadmodels.IncidentInquiryHeader;
+import tmcsim.cadmodels.IncidentInquiryModel_obj;
+import tmcsim.cadmodels.IncidentInquiryServices;
+import tmcsim.cadmodels.IncidentInquiryTows;
+import tmcsim.cadmodels.IncidentInquiryUnitsAssigned;
+import tmcsim.cadmodels.IncidentInquiryWitnesses;
+import tmcsim.common.CADScriptTags.AUDIO_TAGS;
+import tmcsim.common.CADScriptTags.CAD_INCIDENT_DATA_TAGS;
+import tmcsim.common.CADScriptTags.CCTV_TAGS;
+import tmcsim.common.CADScriptTags.INCIDENT_HEADER_TAGS;
+import tmcsim.common.CADScriptTags.LOCATION_INFO_TAGS;
+import tmcsim.common.CADScriptTags.PARAMICS_TAGS;
+import tmcsim.common.CADScriptTags.SCRIPT_EVENT_TAGS;
+import tmcsim.common.CADScriptTags.SCRIPT_LEVEL_TAGS;
+import tmcsim.common.CADScriptTags.SERVICE_TAGS;
+import tmcsim.common.CADScriptTags.TOW_TAGS;
+import tmcsim.common.CADScriptTags.UNIT_TAGS;
+import tmcsim.common.CADScriptTags.WITNESS_TAGS;
+
+/**
+ * SAX Handler that parses a script file and creates a list of Incident objects 
+ * containing all script information that will be used by the CAD.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public class ScriptHandler extends DefaultHandler { 
+
+    /** Error Logger. */
+    private Logger scriptLogger = Logger.getLogger("tmcsim.common");
+    
+    /** 
+     * Enumeration used to keep track of the current tab level that the
+     * parser is reading data in.
+     */
+    private static enum LEVEL { NONE, TMC_SCRIPT, SCRIPT_EVENT, CAD_DATA,
+        HEADER_INFO, LOCATION_INFO, CAD_INCIDENT_EVENT, PARAMICS };
+        
+    /** 
+     *  Map containing all parsed Incidents. Keys = Incident Log Number.  
+     *  Values = Incident object.
+     */
+    private TreeMap<Integer, Incident> incidentMap;
+    
+    /** Buffer used to hold parsed tag content */
+    private StringBuffer parsedValue = new StringBuffer();
+    
+    /** Current Tag level within the script that is being parsed */
+    private LEVEL currentLevel       = LEVEL.NONE;
+    
+    /** Log number for the current ScriptEvent being parsed */
+    private Integer currentLogNumber     = 0;
+    
+    /** Incident description for the current ScriptEvent being parsed */
+    private String  currentIncidentDesc  = "";
+    
+    /** Time index value (in seconds) for the current ScriptEvent being parsed */
+    private long    currentEventTime     = 0;
+    
+    /** ParamicsLocation object for current script event */
+    private ParamicsLocation currLoc      = null;
+    
+    /** IncidentInquiryHeader object for current script event */
+    private IncidentInquiryHeader currIIH = null;
+    
+    /** IncidentEvent object for current script event */
+    private IncidentEvent currEvent       = null;
+    
+    /** XMLIncident object for current script event */
+    private XMLIncident currXMLInc        = null;
+    
+    
+    
+    /** Constructor.  Initializes incident map. */
+    public ScriptHandler() {
+        incidentMap = new TreeMap<Integer, Incident>();
+    }
+    
+    /**  
+     * Get the list of incidents that have been parsed from the script file.
+     * 
+     * @returns Vector of Incident objects.
+     */
+    public Vector<Incident> getIncidents() {
+        return new Vector<Incident>(incidentMap.values());
+    }       
+    
+    /** SAX Handler method.  Clear incident map and reset the error flag. */
+    public void startDocument() {       
+        incidentMap.clear();        
+    }   
+    
+    /** SAX Handler method.   */
+    public void startElement(String uri, String localName, String qName, Attributes attributes)  {
+        
+        try {
+            if(qName.equals(SCRIPT_LEVEL_TAGS.TMC_SCRIPT.tag)) {
+                currentLevel = LEVEL.TMC_SCRIPT;
+            }       
+            else if(qName.equals(SCRIPT_LEVEL_TAGS.SCRIPT_EVENT.tag)) {
+                currentLevel = LEVEL.SCRIPT_EVENT;
+            }
+            else if(qName.equals(SCRIPT_LEVEL_TAGS.CAD_DATA.tag)) {
+                currentLevel = LEVEL.CAD_DATA;              
+            }
+            else if(qName.equals(SCRIPT_LEVEL_TAGS.HEADER_INFO.tag)) {
+                currIIH           = new IncidentInquiryHeader();
+                currIIH.logNumber = currentLogNumber;
+                
+                currentLevel = LEVEL.HEADER_INFO;               
+            }
+            else if(qName.equals(SCRIPT_LEVEL_TAGS.LOCATION_INFO.tag)) {
+                currLoc      = new ParamicsLocation(attributes.getValue(
+                        LOCATION_INFO_TAGS.ID.tag));
+                currentLevel = LEVEL.LOCATION_INFO;             
+            }
+            else if(qName.equals(SCRIPT_LEVEL_TAGS.CAD_INCIDENT_EVENT.tag)) {
+                currEvent    = new IncidentEvent(currentEventTime - incidentMap.get(
+                        currentLogNumber).getSecondsToStart());         
+                currentLevel = LEVEL.CAD_INCIDENT_EVENT;
+            }
+            else if(qName.equals(SCRIPT_LEVEL_TAGS.PARAMICS.tag)) {
+                String locationID = attributes.getValue(
+                        PARAMICS_TAGS.LOCATION_ID.tag);
+                
+                currXMLInc = new XMLIncident(locationID, incidentMap.get(
+                        currentLogNumber).locationMap.get(locationID));
+                currentLevel = LEVEL.PARAMICS;
+            }
+            else if(qName.equals(SCRIPT_EVENT_TAGS.INCIDENT.tag)) {
+                try {
+                    currentLogNumber = Integer.parseInt(attributes.getValue(
+                            SCRIPT_EVENT_TAGS.LOG_NUMBER.tag));
+                }
+                catch (Exception e)  { 
+                    scriptLogger.logp(Level.SEVERE, "ScriptHandler", "startElement", 
+                            "Invalid LogNumber " + attributes.getValue(
+                                    SCRIPT_EVENT_TAGS.LOG_NUMBER.tag), e);
+                    currentLogNumber = 0;
+                }               
+            }
+            else if(qName.equals(CAD_INCIDENT_DATA_TAGS.UNIT.tag)) {
+                IncidentInquiryUnitsAssigned iiu = new IncidentInquiryUnitsAssigned(IncidentInquiryModel_obj.SCRIPT_POS_INFO);
+                
+                iiu.beat = attributes.getValue(UNIT_TAGS.UNIT_NUMBER.tag);
+                iiu.statusType = attributes.getValue(UNIT_TAGS.UNIT_STATUS.tag);
+                iiu.isPrimary  = new Boolean(attributes.getValue(UNIT_TAGS.UNIT_PRIMARY.tag)).booleanValue();
+                iiu.isActive   = new Boolean(attributes.getValue(UNIT_TAGS.UNIT_ACTIVE.tag)).booleanValue();
+                
+                currEvent.eventInfo.addUnit(iiu);
+            }
+            else if(qName.equals(CAD_INCIDENT_DATA_TAGS.WITNESS.tag)) {
+                IncidentInquiryWitnesses iiw = new IncidentInquiryWitnesses(IncidentInquiryModel_obj.SCRIPT_POS_INFO);
+    
+                iiw.reportingParty = attributes.getValue(WITNESS_TAGS.WITNESS_NAME.tag);
+                iiw.telephoneNum   = attributes.getValue(WITNESS_TAGS.WITNESS_PHONE.tag);
+                iiw.address        = attributes.getValue(WITNESS_TAGS.WITNESS_ADDRESS.tag);
+                                
+                currEvent.eventInfo.addWitness(iiw);
+            }
+            else if(qName.equals(CAD_INCIDENT_DATA_TAGS.TOW.tag)) {
+                IncidentInquiryTows iit = new IncidentInquiryTows(IncidentInquiryModel_obj.SCRIPT_POS_INFO);
+                
+                iit.towCompany     = attributes.getValue(TOW_TAGS.TOW_COMPANY_NAME.tag);
+                iit.confPhoneNum   = attributes.getValue(TOW_TAGS.CONF_PHONE_NUM.tag);
+                iit.publicPhoneNum = attributes.getValue(TOW_TAGS.PUBLIC_PHONE_NUM.tag);
+                iit.beat           = attributes.getValue(TOW_TAGS.BEAT.tag);
+                
+                currEvent.eventInfo.addTow(iit);                
+            }
+            else if(qName.equals(CAD_INCIDENT_DATA_TAGS.SERVICE.tag)) {
+                IncidentInquiryServices iis = new IncidentInquiryServices(IncidentInquiryModel_obj.SCRIPT_POS_INFO);
+                
+                iis.serviceName    = attributes.getValue(SERVICE_TAGS.SERVICE_NAME.tag);
+                iis.confPhoneNum   = attributes.getValue(SERVICE_TAGS.CONF_PHONE_NUM.tag);
+                iis.publicPhoneNum = attributes.getValue(SERVICE_TAGS.PUBLIC_PHONE_NUM.tag);
+                
+                currEvent.eventInfo.addService(iis);        
+            }       
+            else if(qName.equals(CAD_INCIDENT_DATA_TAGS.AUDIO.tag)) {
+                currEvent.waveFile   = attributes.getValue(AUDIO_TAGS.FILE_PATH.tag);
+                currEvent.waveLength = new Integer(attributes.getValue(AUDIO_TAGS.FILE_LENGTH.tag)).intValue();
+            }
+            else if(qName.equals(CAD_INCIDENT_DATA_TAGS.CCTV_INFO.tag)) {
+                CCTVInfo newInfo = new CCTVInfo();
+                
+                try {
+                    newInfo.cctv_id   = Integer.parseInt(attributes.getValue(CCTV_TAGS.CCTV_ID.tag));
+                    newInfo.direction = CCTVDirections.fromChar(attributes.getValue(CCTV_TAGS.CCTV_DIR.tag).charAt(0));
+                    newInfo.toggle    = Boolean.parseBoolean(attributes.getValue(CCTV_TAGS.CCTV_TOGGLE.tag));
+                
+                    currEvent.cctvInfos.add(newInfo);
+                } 
+                catch (Exception e) {
+                    scriptLogger.logp(Level.SEVERE, "ScriptHandler", "startElement", 
+                            "Exception in parsing CCTV_INFO node.", e);
+                }
+                            
+            }       
+
+        } catch (Exception e) {
+            scriptLogger.logp(Level.SEVERE, "ScriptHandler", "startElement", 
+                    "Exception in starting element <" + qName + ">.", e);
+        }
+    }
+
+    /** SAX Handler method.  Append read characters to local buffer. */
+    public void characters(char[] ch, int start, int length) {      
+        parsedValue.append(new String(ch, start, length).trim());               
+    }
+
+    /** SAX Handler method. */
+    public void endElement(String uri, String localName, String qName)  {
+
+        try {
+            if(qName.equals(SCRIPT_LEVEL_TAGS.SCRIPT_EVENT.tag)) {
+                currentLevel = LEVEL.TMC_SCRIPT;
+            }
+            else if(qName.equals(SCRIPT_LEVEL_TAGS.CAD_DATA.tag)) {
+                currentLevel = LEVEL.SCRIPT_EVENT;
+            }
+            else if(qName.equals(SCRIPT_LEVEL_TAGS.HEADER_INFO.tag)) {
+                incidentMap.get(currentLogNumber).header = currIIH;
+                currentLevel = LEVEL.CAD_DATA;
+            }
+            else if(qName.equals(SCRIPT_LEVEL_TAGS.LOCATION_INFO.tag)) {
+                incidentMap.get(currentLogNumber).locationMap.put(currLoc.locationID, currLoc);
+                currentLevel = LEVEL.CAD_DATA;
+            }
+            else if(qName.equals(SCRIPT_LEVEL_TAGS.CAD_INCIDENT_EVENT.tag)) {
+                incidentMap.get(currentLogNumber).addEvent(currEvent);
+                currentLevel = LEVEL.CAD_DATA;
+            }
+            else if(qName.equals(SCRIPT_LEVEL_TAGS.PARAMICS.tag)) {     
+                currEvent.XMLIncidents.add(currXMLInc);
+                currentLevel = LEVEL.CAD_INCIDENT_EVENT;
+            }
+            else if(qName.equals(SCRIPT_EVENT_TAGS.INCIDENT.tag)) {
+                currentIncidentDesc = parsedValue.toString();
+                
+                if(incidentMap.get(currentLogNumber) == null) {             
+                
+                    incidentMap.put(currentLogNumber, 
+                            new Incident(currentLogNumber, 
+                                         currentIncidentDesc, 
+                                         currentEventTime));
+                }
+            }
+            else if(qName.equals(SCRIPT_EVENT_TAGS.TIME_INDEX.tag)) {
+                currentEventTime = timeBytesToSeconds(parsedValue.toString().trim());
+            }
+            else if(qName.equals(INCIDENT_HEADER_TAGS.TYPE.tag)){
+                currIIH.type = parsedValue.toString();
+            }
+            else if(qName.equals(INCIDENT_HEADER_TAGS.BEAT.tag)){
+                currIIH.beat = parsedValue.toString();
+            }
+            else if(qName.equals(INCIDENT_HEADER_TAGS.FULL_LOCATION.tag)){
+                currIIH.fullLocation = parsedValue.toString();
+            }
+            else if(qName.equals(INCIDENT_HEADER_TAGS.TRUNC_LOCATION.tag)){
+                currIIH.truncLocation = parsedValue.toString();
+            }
+            else if(qName.equals(INCIDENT_HEADER_TAGS.LOG_NUMBER.tag)){
+                currIIH.logNumber = Integer.parseInt(parsedValue.toString());
+            }
+            else if(qName.equals(CAD_INCIDENT_DATA_TAGS.DETAIL.tag)) {
+                currEvent.eventInfo.addDetail(new IncidentInquiryDetails(
+                        IncidentInquiryModel_obj.SCRIPT_POS_INFO, 
+                        parsedValue.toString(), false));
+            }   
+            else if(currentLevel == LEVEL.PARAMICS) {
+                try {
+                    currXMLInc.readXMLNode(qName, parsedValue.toString());
+                }
+                catch (Exception e) {
+                    scriptLogger.logp(Level.SEVERE, "ScriptHandler", "endElement", 
+                            "Exception in parsing PARAMICS node.", e);
+                }
+            }
+            else if(currentLevel == LEVEL.LOCATION_INFO) {
+                currLoc.readXMLNode(qName, parsedValue.toString());
+            }
+    
+            parsedValue.setLength(0);
+        } catch (Exception e) {
+            scriptLogger.logp(Level.SEVERE, "ScriptHandler", "endElement", 
+                    "Exception in ending element <" + qName + ">.", e);
+        }
+    }   
+    
+    public void endDocument() {
+    }
+    
+    public void error(SAXParseException e) {
+        scriptLogger.logp(Level.SEVERE, "ScriptHandler", "error", 
+                "SAX Parsing error.", e);
+    }
+    
+    public void fatalError(SAXParseException e) {
+        scriptLogger.logp(Level.SEVERE, "ScriptHandler", "fatalError", 
+                "SAX Parsing fatal error.", e);
+    }
+    
+    public void warning(SAXParseException e) {
+        scriptLogger.logp(Level.SEVERE, "ScriptHandler", "warning", 
+                "SAX Parsing warning.", e);
+    }
+    
+
+    /**
+     * Private method to convert a time object from format HH:MM:SS to a long value of the
+     * corresponding number of seconds.
+     *
+     * @param time String time representation of format HH:MM:SS
+     * @return long Number of seconds
+     * @throws StringIndexOutOfBoundsException if the input parameter is not valid
+     */
+    private long timeBytesToSeconds(String time) 
+        throws StringIndexOutOfBoundsException
+    {
+        long seconds = 0;
+
+        seconds =  ((long) Character.digit(time.charAt(0), 10) * 36000 +
+                        Character.digit(time.charAt(1), 10) * 3600 +
+                        Character.digit(time.charAt(3), 10) * 600 + 
+                        Character.digit(time.charAt(4), 10) * 60 + 
+                        Character.digit(time.charAt(6), 10) * 10 +
+                        Character.digit(time.charAt(7), 10));
+
+              
+        return seconds;
+    }       
+    
+    
+}
Index: trunk/src/tmcsim/common/CCTVDirections.java
===================================================================
--- trunk/src/tmcsim/common/CCTVDirections.java	(revision 2)
+++ trunk/src/tmcsim/common/CCTVDirections.java	(revision 2)
@@ -0,0 +1,39 @@
+package tmcsim.common;
+
+
+/**
+ * Enumberation containing possible CCTV camera directions.
+ *
+ * @author
+ * @version
+ */
+public enum CCTVDirections {
+    
+    NORTH, SOUTH, EAST, WEST; 
+
+    /**
+     * Returns the CCTVDirections enumeration value which has a direction
+     * value that matches the parameter value.
+     * @param dir 
+     * @return CCTVDirections for the parameter value.
+     * @throws ScriptException if the parameter value is invalid.
+     */
+    public static CCTVDirections fromChar(char dir) throws ScriptException {
+        switch(dir){
+            case 'S':
+            case 's':
+                return SOUTH;
+            case 'N':
+            case 'n': 
+                return NORTH;
+            case 'E':
+            case 'e':
+                return EAST;
+            case 'W':
+            case 'w':
+                return WEST;
+            default:
+                throw new ScriptException(ScriptException.INVALID_ENUM, dir);
+        }
+    }
+}
Index: trunk/src/tmcsim/common/ScriptException.java
===================================================================
--- trunk/src/tmcsim/common/ScriptException.java	(revision 2)
+++ trunk/src/tmcsim/common/ScriptException.java	(revision 2)
@@ -0,0 +1,97 @@
+package tmcsim.common;
+
+/**
+ * Exception class used to handle exceptions thrown within 
+ * the CAD Simulation software relating to errors caused by simulation 
+ * script actions.  Each error is defined by this class' public static 
+ * final Strings.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+@SuppressWarnings("serial")
+public class ScriptException extends Exception {
+            
+    /**
+     * Exception error when user attempts to perform an action but cannot
+     * because a script file has not yet been loaded.<br>
+     * Error Message: "Simulation must have at least one incident loaded."
+     */
+    public static final String NO_SCRIPT_LOADED = "Simulation must have at least one incident loaded.";
+        
+    /**
+     * Exception error when user attempts to perform an action but cannot
+     * because the simulation has not started.<br>
+     * Error Message: "Simulation Not Started"
+     */
+    public static final String SIM_NOT_STARTED = "Simulation must be started.";
+    
+    /**
+     * Exception error when user attempts to delete an incident that has 
+     * already occured.<br>
+     * Error Message: "Incident Already Occured"
+     */
+    public static final String INCIDENT_ALREADY_STARTED = "Incident has already occured.";
+    
+    /**
+     * Exception error when user attempts to reschedule an incident to a time that has 
+     * already passed.<br>
+     * Error Message: "Time has already passed."
+     */
+    public static final String TIME_PASSED = "Simulation time has already passed.";
+
+    /**
+     * Exception error when user attempts to add an incident that is already in the simualtion. <br>
+     * Error Message: "Duplicate incident number."
+     */
+    public static final String DUPLICATE_INCIDENT = "Duplicate incident number.";
+
+    /**
+     * Exception error during script parsing when an invalid enumeration value parsed.<br>
+     * Error Message: "Invalid enumeration value."
+     */
+    public static final String INVALID_ENUM = "Invalid enumeration value.";
+
+    
+    /**
+     * Constructor accepting a String message.
+     *
+     * @param newMessage Exception message
+     */ 
+    public ScriptException(String newMessage) {
+        super(newMessage);
+    }   
+    
+    /**
+     * Constructor accepting a String message.
+     *
+     * @param newMessage Exception message
+     */ 
+    public ScriptException(String newMessage, Object addlInfo) {
+        super(newMessage + " <" + addlInfo.toString() + ">");
+    }       
+        
+    /**
+     * Constructor accepting a String message and Throwable cause.
+     *
+     * @param newMessage Exception message 
+     * @param e Cause of the exception.
+     */ 
+    public ScriptException(String newMessage, Throwable e) {
+        super(newMessage, e);
+    }       
+
+    /**
+     * Constructor accepting a String message, additional info object, and Throwable cause.
+     *
+     * @param newMessage Exception message
+     * @param addlInfo Additional info
+     * @param e Cause of the exception.
+     */ 
+    public ScriptException(String newMessage, Object addlInfo, Throwable e) {
+        super(newMessage + " <" + addlInfo.toString() + ">", e);
+    }       
+    
+        
+}
+    
Index: trunk/src/tmcsim/common/SimulationException.java
===================================================================
--- trunk/src/tmcsim/common/SimulationException.java	(revision 2)
+++ trunk/src/tmcsim/common/SimulationException.java	(revision 2)
@@ -0,0 +1,104 @@
+package tmcsim.common;
+
+
+
+/**
+ * Exception class used to handle exceptions thrown within the CAD Simulation 
+ * software relating to connection and initialization errors.  Each error is 
+ * defined by this class' public static final Strings.
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/06 20:46:41 $ $Revision: 1.7 
+ */
+@SuppressWarnings("serial")
+public class SimulationException extends Exception {
+    
+
+    /** 
+     * Exception error when a socket or RMI connection to the CAD Simulator fails.<br>
+     * Error Message: "Unable to connect to the CAD Simulator."
+     */
+    public static final String CAD_SIM_CONNECT = "Unable to connect to the CAD Simulator.";
+    
+    /** 
+     * Exception error when a socket or RMI communication to the CAD Simulator fails.<br>
+     * Error Message: "Unable to communicate with the CAD Simulator."
+     */
+    public static final String CAD_SIM_COMM = "Unable to communicate with the CAD Simulator.";
+    
+    /** 
+     * An error has occured in binding to a socket or rmi port.<br>
+     * Error Message: "An error has occured in establishing communications."
+     */
+    public static final String BINDING     = "An error has occured in establishing communications.";
+
+    /** 
+     * Exception error when initialization of an object from a properties file fails.<br>
+     * Error Message: "Unable to complete initialization, program exiting."
+     */
+    public static final String INITIALIZE_ERROR = "Unable to complete initialization, program exiting.";
+
+    /** 
+     * Exception error when registering the CAD Client with the CAD Simulator fails.<br>
+     * Error Message: "Unable to complete CAD Client registration, program exiting."
+     */
+    public static final String REGISTER_ERROR = "Unable to complete CAD Client registration, program exiting.";
+
+    /** 
+     * Exception error if the SimulationManagerModel is initialized without 
+     * the view componenta socket or RMI connection to the CAD Simulator fails.<br>
+     * Error Message: "Unable to connect to the CAD Simulator."
+     */
+    public static final String NULL_VIEW = "Unable to connect to the CAD Simulator.";
+        
+    /**
+     * Exception error when a connection to the ATMS server cannot be established.<br>
+     * Error Message: "A connection to the ATMS server could not be established"
+     */    
+    public static final String ATMS_UNREACHABLE = "A connection to the ATMS server could not be established";
+    
+    /**
+     * Exception error to notify the user that a connection to Paramics has 
+     * not been established.<br>
+     * Error Message: "A connection to Paramics has not been established."
+     */
+    public static final String PARAMICS_NOT_CONNECTED = "A connection to Paramics has not been established.";    
+    
+    /**
+     * Exception error when there is an error parsing the script file.<br>
+     * Error Message: "Unable to parse the script file."
+     */
+    public static final String INVALID_SCRIPT_FILE = "Unable to parse the script file.";    
+        
+    /**
+     * Constructor accepting a String message.
+     *
+     * @param newMessage Exception message
+     */ 
+    public SimulationException(String newMessage) {
+        super(newMessage);
+    }    
+    
+    /**
+     * Constructor accepting a String message and Throwable cause.
+     *
+     * @param newMessage Exception message 
+     * @param e Cause of the exception.
+     */ 
+    public SimulationException(String newMessage, Throwable e) {
+        super(newMessage, e);
+    }       
+
+    /**
+     * Constructor accepting a String message, additional info object, and Throwable cause.
+     *
+     * @param newMessage Exception message
+     * @param addlInfo Additional info
+     * @param e Cause of the exception.
+     */ 
+    public SimulationException(String newMessage, Object addlInfo, Throwable e) {
+        super(newMessage + " <" + addlInfo.toString() + ">", e);
+    }       
+    
+        
+}
Index: trunk/src/tmcsim/cadmodels/IncidentInquiryWitnesses.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentInquiryWitnesses.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentInquiryWitnesses.java	(revision 2)
@@ -0,0 +1,141 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * IncidentInquiryWitnesses extends from IncidentInquiryLogEntry
+ * to provide a model object containing information used to display a Witness 
+ * entry on the IncidentInquiry CAD screen. Data for a witness includes the 
+ * reporting party's name, phone number, and address.<br/>
+ * <br/>
+ * This element parses and creates the following XML schema in its toXML() and
+ * fromXML() methods.  The ROOT element is the parameter for those methods.<br/>
+ * <ROOT><br/>
+ *    <REPORT_PARTY/><br/>
+ *    <PHONE_NUM>/<br/>
+ *    <ADDRESS/><br/>
+ *    <POSITION_INFO/><br/>
+ *    <TIMESTAMP/><br/>
+ * </ROOT><br/>
+ * 
+ * @author Matthew Cechini
+ * @version 
+ */
+@SuppressWarnings("serial")
+public class IncidentInquiryWitnesses extends IncidentInquiryLogEntry 
+    implements Serializable {
+    
+    /**
+     * Enumeration with XML tag names.
+     * @author Matthew Cechini
+     */
+    private static enum XML_TAGS {
+        /** Witness' name. */
+        REPORT_PARTY  ("REPORT_PARTY"),     
+        /** Witness' phone number. */
+        PHONE_NUM     ("PHONE_NUM"),    
+        /** Witness' address. */
+        ADDRESS       ("ADDRESS");
+        
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }       
+    }
+    
+    /** Witness' name. */
+    public String reportingParty;
+    
+    /** Witness' phone number. */
+    public String telephoneNum;
+    
+    /** Witness' address. */
+    public String address;      
+
+
+    /** 
+     * Constructor.  Initialize all Witness data to empty strings.
+     * 
+     *  @param newPosInfo String containing position info for this log entry
+     */
+    public IncidentInquiryWitnesses(String newPosInfo) {
+        super(newPosInfo, "0000");
+
+        reportingParty = "";
+        telephoneNum   = "";
+        address        = "";    
+    }
+    
+
+    /**
+     * Constructor.  Set local data and base data from parameters. 
+     * 
+     * @param newPositionInfo Position info for this log entry.
+     * @param name            Witness' name
+     * @param num             Witness' phone number
+     * @param add             Witness' address
+     * @param timestamp       Timestamp for this log entry
+     */
+    public IncidentInquiryWitnesses(String newPositionInfo, String name, 
+            String num, String add, String timeStamp) {
+        super(newPositionInfo, timeStamp);
+
+        reportingParty = name;
+        telephoneNum   = num;
+        address        = add;   
+    }       
+    
+    /**
+     * Constructor.  Parse parameter node for Witness log entry data.
+     * 
+     * @param theNode Node containing data for this Witness log entry
+     */
+    public IncidentInquiryWitnesses(Node theNode) { 
+        fromXML(theNode);   
+    }
+    
+
+    public void toXML(Element currElem) {
+        
+        Document theDoc    = currElem.getOwnerDocument();
+        Element  tempElem  = null;
+        
+        tempElem = theDoc.createElement(XML_TAGS.REPORT_PARTY.tag);
+        tempElem.appendChild(theDoc.createTextNode(reportingParty));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.PHONE_NUM.tag);
+        tempElem.appendChild(theDoc.createTextNode(telephoneNum));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.ADDRESS.tag);
+        tempElem.appendChild(theDoc.createTextNode(address));
+        currElem.appendChild(tempElem);
+
+        super.toXML(currElem);
+    }    
+    
+    public void fromXML(Node modelNode) {   
+        
+        Node childNode = null;
+        
+        childNode = modelNode.getFirstChild();
+        reportingParty = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        telephoneNum = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        address = childNode.getTextContent();
+
+        childNode = childNode.getNextSibling();
+        super.fromXML(childNode);
+        
+    }
+    
+}
Index: trunk/src/tmcsim/cadmodels/IncidentInquiryDetails.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentInquiryDetails.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentInquiryDetails.java	(revision 2)
@@ -0,0 +1,149 @@
+package tmcsim.cadmodels;
+
+
+import java.io.Serializable;
+import java.util.Vector;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * IncidentInquiryDetails extends from IncidentInquiryLogEntry to provide a 
+ * model object containing information used to display a detail log entry.
+ * Data for a detail includes a String of text.<br/>
+ * <br/>
+ * This element parses and creates the following XML schema in its toXML() and
+ * fromXML() methods.  The ROOT element is the parameter for those methods.<br/>
+ * <ROOT><br/>
+ *    <TEXT/><br/>
+ *    <POSITION_INFO/><br/>
+ *    <TIMESTAMP/><br/>
+ * </ROOT><br/>
+ * 
+ * @author Matthew Cechini
+ * @version 
+ */
+@SuppressWarnings("serial")
+public class IncidentInquiryDetails extends IncidentInquiryLogEntry 
+    implements Serializable {
+        
+    /**
+     * Enumeration with XML tag names.
+     * @author Matthew Cechini
+     */
+    private static enum XML_TAGS {
+        /** Detail Text. */
+        TEXT  ("TEXT");
+        
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }       
+    }
+    
+    
+    /** Detail text. */
+    public String details;
+    
+    /**  */
+    public Boolean sensitive;
+    
+    //public boolean highlighted;
+    
+    /** 
+     * Constructor.  Initialize all detail data to empty strings or false.
+     * 
+     *  @param newPosInfo String containing position info for this log entry
+     */    
+    public IncidentInquiryDetails(String newPosInfo, Boolean sens) {
+        super(newPosInfo, "0000");
+
+        details   = "";
+        sensitive = sens;
+    }
+    
+    /** 
+     * Constructor.  Initialize all detail data to the parameter.
+     * 
+     *  @param newPosInfo String containing position info for this log entry.
+     *  @param newDetails String containing detail text for this log entry.
+     */        
+    public IncidentInquiryDetails(String newPosInfo, String newDetails, Boolean sens) {     
+        super(newPosInfo, "0000");
+        
+        details   = newDetails;
+        sensitive = sens;
+    }
+    
+    /**
+     * Constructor.  Parse parameter node for Detail log entry data.
+     * 
+     * @param theNode Node containing data for this Detail log entry
+     */    
+    public IncidentInquiryDetails(Node theNode) {   
+        fromXML(theNode);
+    }
+    
+    public void toXML(Element currElem) {       
+        Document theDoc    = currElem.getOwnerDocument();
+        Element  tempElem  = null;
+        
+        tempElem = theDoc.createElement(XML_TAGS.TEXT.tag);
+        tempElem.appendChild(theDoc.createTextNode(details));
+        currElem.appendChild(tempElem);
+
+        super.toXML(currElem);
+    }
+    
+    public void fromXML(Node modelNode) {   
+        
+        Node childNode = null;
+        
+        childNode = modelNode.getFirstChild();
+        details = childNode.getTextContent();
+
+        childNode = childNode.getNextSibling();
+        super.fromXML(childNode);
+        
+    }
+ 
+    /** 
+     * Parse the details text into a list of endline terminated strings which are
+     * no longer than the parameter width.  Words which would be split by an endline
+     * are moved in whole to the next line.  Words longer than a line width are split 
+     * accordingly.
+     * 
+     * @param width Line width used for parsing details
+     * @return A vector of endline terminated detail strings.
+     */
+    public Vector<String> parseDetails(int width) {
+        Vector<String> parsedDetails = new Vector<String>();
+        
+        int currPos  = 0;
+        int spaceIdx = 0;
+        
+        while((details.length() - currPos) > width) {
+            
+            spaceIdx = details.substring(currPos, currPos + width).lastIndexOf(" ");
+            
+            if(spaceIdx > 0) {
+                parsedDetails.add(details.substring(currPos, currPos + spaceIdx).trim() + "\n");
+                currPos += spaceIdx;
+            }
+            else {
+                parsedDetails.add(details.substring(currPos, currPos + width).trim() + "\n");   
+                currPos += width;
+            }                               
+        }       
+        
+        //remainder
+        parsedDetails.add(details.substring(currPos).trim() + "\n");        
+        
+        return parsedDetails;
+    }    
+    
+    
+    
+}
Index: trunk/src/tmcsim/cadmodels/IncidentBoardModel.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentBoardModel.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentBoardModel.java	(revision 2)
@@ -0,0 +1,143 @@
+package tmcsim.cadmodels;
+
+import java.util.Vector;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import tmcsim.common.ScriptException;
+import tmcsim.common.CADEnums.CADScreenNum;
+import tmcsim.common.CADEnums.CADScreenType;
+import tmcsim.common.CADProtocol.CAD_COMMANDS;
+
+
+/**
+ * IncidentBoardModel is a CADScreenModel object containing data that is 
+ * displayed in the IncidentBoard CAD Screen.  The addModelObject() method 
+ * is used to update the model data with new information.<br/>
+ * <br/>
+ * This element parses and creates the following XML schema in its toXML() and
+ * fromXML() methods.  The ROOT element is the parameter for those methods.  
+ * See the class description for the CADScreenModel and 
+ * IncidentBoardModel_obj Objects for their XML schema.<br/>
+ * <ROOT>
+ *    <INCIDENT_BOARD>
+ *       <BASE_MODEL_INFO/>
+ *       <MESSAGE/>
+ *       ...
+ *       <MESSAGE/>
+ *    </INCIDENT_BOARD>
+ * </ROOT>
+ * 
+ * @see IncidentBoardModel_obj
+ * @see CADScreenModel
+ * @author Matthew Cechini
+ * @version
+ */
+public class IncidentBoardModel extends CADScreenModel {
+    
+    /**
+     * Enumeration with XML tag names.
+     * @author Matthew Cechini
+     */
+    private static enum XML_TAGS {
+        MESSAGE ("MESSAGE");
+        
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }
+    }
+    
+    /** Model data. List of IncidentBoardModel_obj objects. */
+    private Vector<IncidentBoardModel_obj> messageList = null;
+    
+    /**
+     * Constructor.
+     *
+     * @param num CADScreenNum for this model.
+     */
+    public IncidentBoardModel(CADScreenNum num) {
+        super(CADScreenType.IB_INCIDENT_BOARD, num);
+        
+        messageList  = new Vector<IncidentBoardModel_obj>();
+    }
+    
+    /**
+     * Constructor.  Create model data from parsed parameter XML node.
+     *
+     * @param newNode XML node containing model data.
+     * @throws ScriptException if there is an error in parsing the Node.
+     */
+    public IncidentBoardModel(Node newNode) throws ScriptException {
+        super(CADScreenType.IB_INCIDENT_BOARD, CADScreenNum.ONE);
+        
+        messageList  = new Vector<IncidentBoardModel_obj>();
+                
+        fromXML(newNode);   
+    }
+        
+    /**
+     * Add a new model object to the list of messages.
+     *
+     * @param ismo IncidentBoardModel_obj
+     * @throws ClassCastException if the parameter is not an 
+     *         IncidentBoardModel_obj object.
+     */
+    public void addModelObject(Object ibmo) throws ClassCastException {
+        
+        if(ibmo instanceof IncidentBoardModel_obj)  
+            messageList.add((IncidentBoardModel_obj)ibmo);  
+        else 
+            throw new ClassCastException();
+    } 
+    
+    /**
+     * Get the list of messages in this model.
+     *
+     * @return Vector of IncidentBoardModel_obj objects.
+     */
+    public Vector<IncidentBoardModel_obj> getModelObjects() {
+        return messageList; 
+    }   
+    
+    public void toXML(Element currElem) {
+        
+        Document theDoc = currElem.getOwnerDocument();
+                
+        Element modelElem = theDoc.createElement(CAD_COMMANDS.INCIDENT_BOARD.fullName);
+        
+        baseToXML(modelElem);               
+        
+        Element ibmoElem             = null;
+        for(IncidentBoardModel_obj ibmo : messageList) {
+            ibmoElem = theDoc.createElement(XML_TAGS.MESSAGE.tag);
+
+            ibmo.toXML(ibmoElem);
+            
+            modelElem.appendChild(ibmoElem);
+        }
+        
+        currElem.appendChild(modelElem);
+
+    }
+
+    public void fromXML(Node modelNode) throws ScriptException {    
+        
+        messageList.clear();
+        
+        modelNode = modelNode.getFirstChild();
+        
+        baseFromXML(modelNode);
+        
+        NodeList messageNodes = ((Element)modelNode).getElementsByTagName(XML_TAGS.MESSAGE.tag);
+        
+        for(int i = 0; i < messageNodes.getLength(); i++)
+            messageList.add(new IncidentBoardModel_obj(messageNodes.item(i)));
+        
+        
+    }  
+}
Index: trunk/src/tmcsim/cadmodels/RoutedMessageModel.java
===================================================================
--- trunk/src/tmcsim/cadmodels/RoutedMessageModel.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/RoutedMessageModel.java	(revision 2)
@@ -0,0 +1,283 @@
+package tmcsim.cadmodels; 
+
+import java.util.LinkedList;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import tmcsim.common.ScriptException;
+import tmcsim.common.CADEnums.CADScreenNum;
+import tmcsim.common.CADEnums.CADScreenType;
+import tmcsim.common.CADProtocol.CAD_COMMANDS;
+import tmcsim.common.CADProtocol.DATA_TAGS;
+
+
+/**
+ * RoutedMessageModel is a CADScreenModel object containing data that is 
+ * displayed in the RoutedMessage CAD Screen.  Data included in this
+ * object includes a list of CADRoutedMessages, the index of the current
+ * message item, and a boolean flag to designate whether the current message 
+ * has been deleted.  The addModelObject() method is used to update the model 
+ * data with new information.  The nextQueue(), deleteQueue(), and prevQueue() 
+ * methods are used to control which message is the "current" message. <br/>
+ * <br/>
+ * This element parses and creates the following XML schema in its toXML() and
+ * fromXML() methods.  The ROOT element is the parameter for those methods.  
+ * See the class description for the CADScreenModel XML schema.<br/>
+ * <ROOT>
+ *    <ROUTED_MESSAGE>
+ *       <BASE_MODEL_INFO/>
+ *       <ORIGIN/>
+ *       <DESTINATION/>
+ *       <MESSAGE/>
+ *    </ROUTED_MESSAGE>
+ * </ROOT>
+ * 
+ * @see CADScreenModel
+ * @author Matthew Cechini
+ * @version
+ */
+public class RoutedMessageModel extends CADScreenModel {
+    
+    /** LinkedList containing received routed messages. */
+    private LinkedList<CADRoutedMessage> messageList = null;
+    
+    /**
+     * A manually incremented and decremented iterating count.  Initial value
+     * is 0 to point to the first element in the messageList.  As the list is 
+     * traversed, added to, and removed from, this count always contains the value
+     * of the current message that is being displayed.
+     */
+    private int currentListItem = 0;
+    
+    /**
+     * Flag to designate whether the current message has been deleted by the
+     * user.  The currentListItem counter is not updated when a queue is
+     * deleted until nextQueue() or prevQueue() is called.  This allows a
+     * message to remain on the screen after it has been deleted.
+     */
+    private boolean messageDeleted = false;
+    
+    /**
+     * Constructor.
+     * 
+     * @param num CADScreenNum for this model.
+     * @param messages New list of messags.
+     */
+    public RoutedMessageModel(CADScreenNum num, LinkedList<CADRoutedMessage> messages) {
+        super(CADScreenType.TO_ROUTED_MESSAGE, num);
+        
+        messageList = new LinkedList<CADRoutedMessage>();
+        messageList.addAll(messages);
+    }
+    
+    /**
+     * Constructor.  Parse the model data from the parameter node.
+     * 
+     * @param newNode XML node containing model data.
+     * @throws ScriptException if there is an error in parsing the node.
+     */
+    public RoutedMessageModel(Node newNode) throws ScriptException {
+        super(CADScreenType.TO_ROUTED_MESSAGE, CADScreenNum.ONE);
+
+        messageList = new LinkedList<CADRoutedMessage>();
+        
+        fromXML(newNode);   
+    }
+
+    /**
+     * Returns the number of routed messages received to this CAD Client model.
+     *
+     * @return int number of messages that have been sent to this terminal and
+     * retreived from the coordinator.
+     */
+    public int getMessageCount() {      
+        return messageList.size();  
+    }
+    
+    /**
+     * Append a new message to the local linked list of CADRoutedMessages.
+     *
+     * @param updateMessages Vector of CADRoutedMessage objects that have been
+     * sent to this CAD terminal.
+     */
+    public void addModelObject(Object o) {              
+        messageList.add((CADRoutedMessage)o);
+    } 
+
+    /**
+     * Method returns the routed message that was last viewed, or if this is the first
+     * time a method is being viewed, then the first message will be returned.
+     * This message may only be called if the numberOfMessages() returns a value
+     * greater than 0.  If there are no messages, this method will throw an 
+     * IndexOutOfBoundsException.
+     *
+     * @return CADRoutedMessage
+     */ 
+    public CADRoutedMessage getCurrentMessage() throws IndexOutOfBoundsException {      
+        
+        return messageList.get(currentListItem);    
+    }
+        
+    /**
+     * Method is called to advance to the next queued message object.  Update the 
+     * message list and current message counter if a message has been deleted.  If the
+     * currentListItem count is at the end of the message list, then start over
+     * at the beginning, otherwise increase the count by one.
+     * This method is only to be called if numberOfMessages() returns a value
+     * greater than 0.
+     */
+    public boolean nextQueue() {
+
+        //update the counter if a the previous queue message was deleted
+        if(messageDeleted) {
+            messageList.remove(currentListItem);
+            currentListItem--;
+            
+            if(currentListItem > messageList.size() - 1 ||
+               currentListItem < 0) {
+                currentListItem = 0;
+            }
+            
+            messageDeleted = false;
+        }
+        
+        if(messageList.size() > 0) {
+            if(currentListItem == messageList.size() - 1) 
+                currentListItem = 0;
+            else 
+                currentListItem++;
+                
+            return true;
+        }
+        else
+            return false;
+    }
+    
+    /**
+     * If the message being deleted is currently being viewed, set the messageDeleted
+     * flag to true so that the queued message will be deleted when nextQueue()
+     * or prevQueue() is called next.  Else, if the message being deleted
+     * does exist in this model's list of messages, remove that message.  Update
+     * the currentListItem counter if the message deleted is at a position
+     * prior to the current message.
+     * 
+     * @param delMsg Queue message being deleted
+     */
+    public void deleteQueue(CADRoutedMessage delMsg) {
+        
+        int msgIndex = messageList.indexOf(delMsg);
+        
+        if(msgIndex == currentListItem) {
+            messageDeleted = true;
+        }
+        else if(msgIndex != -1) {           
+            messageList.remove(delMsg);
+
+            if(currentListItem > msgIndex)
+                currentListItem--;
+        }
+        //else msgIndex == -1  Msg already removed
+    }
+    
+    /**
+     * Method is called to back up to the previous queued message object.  
+     * Update the message list and current message counter if a message
+     * has been deleted.  If the currentListItem count is at the beginning 
+     * of the message list, then move to the end, otherwise decrease the 
+     * count by one. This method is only to be called if numberOfMessages() 
+     * returns a value greater than 0.
+     */
+    public boolean prevQueue() {
+        
+        //update the counter if a the previous queue message was deleted
+        if(messageDeleted) {
+            messageList.remove(currentListItem);
+            currentListItem--;
+            
+            if(currentListItem > messageList.size() - 1 ||
+               currentListItem < 0){
+                currentListItem = 0;
+            }
+            
+            messageDeleted = false;
+        }
+        
+        if(messageList.size() > 0) {
+            if(currentListItem == 0) 
+                currentListItem = messageList.size() - 1;
+            else 
+                currentListItem--;
+                    
+            return true;
+        }
+        else
+            return false;           
+    }
+    
+    /**
+     * Determine if this routed message is a forwarded incident update.
+     * @return True if this message is an incident update, false if not.
+     */
+    public boolean isIncidentUpdate() {
+        return messageList.get(currentListItem).incidentUpdate;
+    }
+    
+    public void toXML(Element currElem) {
+        
+        //if this is an update, then the xmloutput is contained within
+        //the message text
+        if(getCurrentMessage().incidentUpdate) {
+
+        }
+        //else send the current message only
+        else {          
+            
+            Document theDoc = currElem.getOwnerDocument();
+                    
+            Element modelElem = theDoc.createElement(CAD_COMMANDS.ROUTED_MESSAGE.fullName);
+            
+            baseToXML(modelElem);
+            
+            Element originElem = theDoc.createElement(DATA_TAGS.ORIGIN.tag);
+            originElem.appendChild(theDoc.createTextNode(String.valueOf(getCurrentMessage().fromPosition)));
+            modelElem.appendChild(originElem);
+
+            Element destElem = theDoc.createElement(DATA_TAGS.DESTINATION.tag);
+            destElem.appendChild(theDoc.createTextNode(String.valueOf(getCurrentMessage().toPosition)));
+            modelElem.appendChild(destElem);
+
+            Element msgElem = theDoc.createElement(DATA_TAGS.ORIGIN.tag);
+            msgElem.appendChild(theDoc.createTextNode(getCurrentMessage().message));
+            modelElem.appendChild(msgElem);
+            
+            currElem.appendChild(modelElem);
+        }
+    }
+    
+    public void fromXML(Node modelNode) throws ScriptException {
+        messageList.clear();
+        currentListItem = 0;
+        
+        CADRoutedMessage newMessage = new CADRoutedMessage(0, 0, "", false);
+        
+        modelNode = modelNode.getFirstChild();
+        
+        baseFromXML(modelNode);
+        
+        modelNode = modelNode.getNextSibling();
+        newMessage.fromPosition = Integer.parseInt(modelNode.getTextContent());
+
+        modelNode = modelNode.getNextSibling();
+        newMessage.toPosition = Integer.parseInt(modelNode.getTextContent());
+
+        modelNode = modelNode.getNextSibling();
+        newMessage.message = modelNode.getTextContent();
+
+        
+        messageList.add(newMessage);
+        
+    }
+
+}
Index: trunk/src/tmcsim/cadmodels/IncidentInquiryModel_obj.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentInquiryModel_obj.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentInquiryModel_obj.java	(revision 2)
@@ -0,0 +1,399 @@
+package tmcsim.cadmodels;
+
+
+import java.io.Serializable;
+import java.util.Vector;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+/**
+ * IncidentInquiryModel_obj is the model object containing all model 
+ * information for an IncidentInquiry CAD Screen.  The model data includes
+ * a single IncidentInquiryHeader, and lists of IncidentInquiryDetails, 
+ * IncidentInquiryAssignedUnits, IncidentInquiryTows, IncidentInquiryWitnesses,
+ * and IncidentInquiryServices.  The add???() methods append a new 
+ * IncidentInquiry model object to the associated internal list.<br/>
+ * <br/>
+ * This element parses and creates the following XML schema in its toXML() and
+ * fromXML() methods.  The ROOT element is the parameter for those methods.  The
+ * specific XML schema for each IncidentInquiry model can be found in its
+ * class header.<br/>
+ * <ROOT>
+ *    <HEADER>
+ *    <DETAIL/>
+ *    ...
+ *    <DETAIL/>
+ *    <UNIT/>
+ *    ...
+ *    <UNIT/>
+ *    <WITNESS/>
+ *    ...
+ *    <WITNESS/>
+ *    <TOW/>
+ *    ...
+ *    <TOW/>
+ *    <SERVICE/>
+ *    ...
+ *    <SERVICE/>
+ * </ROOT>
+ * 
+ * @see IncidentInquiryHeader
+ * @see IncidentInquiryDetails
+ * @see IncidentInquiryAssignedUnits
+ * @see IncidentInquiryTows
+ * @see IncidentInquiryWitnesses
+ * @see IncidentInquiryServices
+ * @author Matthew Cechini
+ * @version 
+ */
+@SuppressWarnings("serial")
+public class IncidentInquiryModel_obj implements Serializable {
+    
+    /** Log position info for a log entry.  */
+    public static final String SCRIPT_POS_INFO   = "000A17661";     
+    
+    /**
+     * Enumeration with XML tag names.
+     * @author Matthew Cechini
+     */
+    private static enum XML_TAGS {
+        /** Header information. */
+        HEADER  ("HEADER"),
+        /** Detail log entry. */
+        DETAIL  ("DETAIL"),
+        /** Unit log entry. */
+        UNIT    ("UNIT"),
+        /** Witness log entry. */
+        WITNESS ("WITNESS"),
+        /** Tow log entry. */
+        TOW     ("TOW"),
+        /** Service log entry. */
+        SERVICE ("SERVICE"),
+        /** Updated entries. */
+        UPDATES  ("UPDATES");
+    
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }       
+    }
+    
+    /**  Header data. */
+    private IncidentInquiryHeader                header    = null;
+    
+    /** List of Detail objects. */
+    private Vector<IncidentInquiryDetails>       details   = null;
+    
+    /** List of UnitsAssigned objects. */
+    private Vector<IncidentInquiryUnitsAssigned> units     = null;
+    
+    /** List of Detail objects. */
+    private Vector<IncidentInquiryWitnesses>     witnesses = null;
+    
+    /** List of Tow objects. */
+    private Vector<IncidentInquiryTows>          tows      = null;
+    
+    /** List of Service objects. */
+    private Vector<IncidentInquiryServices>      services  = null;  
+    
+    /*
+    private boolean detailsUpdated   = false;
+    private boolean unitsUpdated     = false;
+    private boolean towsUpdated      = false;
+    private boolean witnessesUpdated = false;
+    private boolean servicesUpdated  = false;
+    */
+    
+    /** 
+     * Origin of this object's data.  Options include "Script" or "CAD #", 
+     * where # is a CAD position 
+     */
+    private String source = "";            
+    
+    /** 
+     * Construtor.  Initialize all local lists of IncidentInquiry objects.  
+     * Set source to "Script". 
+     */
+    public IncidentInquiryModel_obj() {
+        source        = "Script";
+
+        header        = new IncidentInquiryHeader();
+        details       = new Vector<IncidentInquiryDetails>();
+        units         = new Vector<IncidentInquiryUnitsAssigned>();
+        witnesses     = new Vector<IncidentInquiryWitnesses>();
+        tows          = new Vector<IncidentInquiryTows>();
+        services      = new Vector<IncidentInquiryServices>(); 
+                      
+    }
+    
+    /**  
+     * Constructor.  Initialie all local lists of IncidentInquiry objects.
+     * Set srouce to "CAD #".
+     * 
+     * @param CADPosition Integer value for the originating CAD position of this object's data.
+     */
+    public IncidentInquiryModel_obj(int CADPosition) {
+        source        = "CAD " + CADPosition;
+
+        header        = new IncidentInquiryHeader();
+        details       = new Vector<IncidentInquiryDetails>();
+        units         = new Vector<IncidentInquiryUnitsAssigned>();
+        witnesses     = new Vector<IncidentInquiryWitnesses>();
+        tows          = new Vector<IncidentInquiryTows>();
+        services      = new Vector<IncidentInquiryServices>(); 
+                      
+    }    
+
+    /**  
+     * Copy Constructor.
+     * 
+     * @param newIIMO Object containing data to be copied into constructed object.
+     */
+    public IncidentInquiryModel_obj(IncidentInquiryModel_obj newIIMO) {
+        source        = newIIMO.source;
+        
+        header        = new IncidentInquiryHeader(newIIMO.header);
+        details       = new Vector<IncidentInquiryDetails>(newIIMO.details);
+        units         = new Vector<IncidentInquiryUnitsAssigned>(newIIMO.units);
+        witnesses     = new Vector<IncidentInquiryWitnesses>(newIIMO.witnesses);
+        tows          = new Vector<IncidentInquiryTows>(newIIMO.tows);
+        services      = new Vector<IncidentInquiryServices>(newIIMO.services); 
+    }
+
+    /**
+     * This method updates the private lists of IncidentInquiry data with `
+     * data contained in the parameter object.  
+     * 
+     * @param newObject Object containing IncidentInquiry data that will
+     *                  be used to update local IncidentInquiry lists.
+     */
+    public void update(IncidentInquiryModel_obj newObject) {
+                        
+        header.update(newObject.header);        
+        details.addAll(newObject.getDetails());
+        
+        //Do not want duplicate units in the vector
+        for(IncidentInquiryUnitsAssigned unit : newObject.getUnits()) {
+            if(units.contains(unit)) {
+                IncidentInquiryUnitsAssigned oldUnit = units.get(units.indexOf(unit));
+                /*
+                if(oldUnit.isActive != unit.isActive ||
+                   oldUnit.isPrimary != unit.isPrimary ||
+                   oldUnit.statusType != unit.statusType) 
+                {
+                    unitsUpdated |= true;
+                }    
+                */
+                units.remove(oldUnit);
+            }           
+            units.add(unit);            
+        }
+        
+        witnesses.addAll(newObject.getWitnesses());
+        tows.addAll(newObject.getTows());
+        services.addAll(newObject.getServices());        
+
+        /*
+        detailsUpdated   |= newObject.getDetails().size() > 0;
+        witnessesUpdated |= newObject.getWitnesses().size() > 0;
+        towsUpdated      |= newObject.getTows().size() > 0;
+        servicesUpdated  |= newObject.getServices().size() > 0;
+        */
+        
+    }
+    
+    public void toXML(Element currElem) {
+        
+        Document theDoc = currElem.getOwnerDocument();
+        /*
+        Element updatesElem = theDoc.createElement(UPDATES);
+        currElem.appendChild(updatesElem);
+        
+        Element updateElem  = theDoc.createElement(DETAIL);
+        updateElem.appendChild(theDoc.createTextNode(String.valueOf(detailsUpdated)));
+        updatesElem.appendChild(updateElem);
+        
+        updateElem  = theDoc.createElement(UNIT);
+        updateElem.appendChild(theDoc.createTextNode(String.valueOf(unitsUpdated)));
+        updatesElem.appendChild(updateElem);
+        
+        updateElem  = theDoc.createElement(WITNESS);
+        updateElem.appendChild(theDoc.createTextNode(String.valueOf(witnessesUpdated)));
+        updatesElem.appendChild(updateElem);
+        
+        updateElem  = theDoc.createElement(TOW);
+        updateElem.appendChild(theDoc.createTextNode(String.valueOf(towsUpdated)));
+        updatesElem.appendChild(updateElem);
+        
+        updateElem  = theDoc.createElement(SERVICE);
+        updateElem.appendChild(theDoc.createTextNode(String.valueOf(servicesUpdated)));
+        updatesElem.appendChild(updateElem);
+        */
+                
+        Element headerElem = theDoc.createElement(XML_TAGS.HEADER.tag);
+        header.toXML(headerElem);
+        currElem.appendChild(headerElem);
+        
+        Element detailElem = null;
+        for(IncidentInquiryDetails detail : details) {
+            detailElem = theDoc.createElement(XML_TAGS.DETAIL.tag);
+            detail.toXML(detailElem);
+            currElem.appendChild(detailElem);
+        }
+        
+        Element unitElem = null;        
+        for(IncidentInquiryUnitsAssigned unit : units) {
+            unitElem = theDoc.createElement(XML_TAGS.UNIT.tag);         
+            unit.toXML(unitElem);
+            currElem.appendChild(unitElem);
+        }
+        
+        Element witnessElem = null;     
+        for(IncidentInquiryWitnesses witness : witnesses) {
+            witnessElem = theDoc.createElement(XML_TAGS.WITNESS.tag);
+            witness.toXML(witnessElem);
+            currElem.appendChild(witnessElem);
+        }
+        
+        Element towElem = null;     
+        for(IncidentInquiryTows tow : tows) {
+            towElem = theDoc.createElement(XML_TAGS.TOW.tag);           
+            tow.toXML(towElem);
+            currElem.appendChild(towElem);          
+        }
+        
+        Element serviceElem = null;     
+        for(IncidentInquiryServices service : services) {
+            serviceElem = theDoc.createElement(XML_TAGS.SERVICE.tag);               
+            service.toXML(serviceElem);
+            currElem.appendChild(serviceElem);
+        }  
+        
+    }
+    
+    public void fromXML(Node modelNode) {
+
+        Node     currentNode = modelNode;
+        //Node     updateNode  = null;
+        String   nodeName    = null;
+        
+        details.clear();
+        units.clear();
+        witnesses.clear();
+        tows.clear();
+        services.clear();
+        
+        /*
+        updateNode = currentNode.getFirstChild();
+        detailsUpdated = Boolean.parseBoolean(updateNode.getTextContent());
+        updateNode = updateNode.getNextSibling();
+        unitsUpdated = Boolean.parseBoolean(updateNode.getTextContent());
+        updateNode = updateNode.getNextSibling();
+        witnessesUpdated = Boolean.parseBoolean(updateNode.getTextContent());
+        updateNode = updateNode.getNextSibling();
+        towsUpdated = Boolean.parseBoolean(updateNode.getTextContent());
+        updateNode = updateNode.getNextSibling();
+        servicesUpdated = Boolean.parseBoolean(updateNode.getTextContent());
+        */
+        
+        header = new IncidentInquiryHeader(currentNode);
+        
+        while((currentNode = currentNode.getNextSibling()) != null) {
+            nodeName    = currentNode.getNodeName();    
+            
+            if(nodeName.equals(XML_TAGS.DETAIL.tag)) { 
+                details.add(new IncidentInquiryDetails(currentNode));
+            }
+            else if(nodeName.equals(XML_TAGS.UNIT.tag)) { 
+                units.add(new IncidentInquiryUnitsAssigned(currentNode));
+            }
+            else if(nodeName.equals(XML_TAGS.WITNESS.tag)) { 
+                witnesses.add(new IncidentInquiryWitnesses(currentNode));
+            }
+            else if(nodeName.equals(XML_TAGS.TOW.tag)) { 
+                tows.add(new IncidentInquiryTows(currentNode));
+            }
+            else if(nodeName.equals(XML_TAGS.SERVICE.tag)) { 
+                services.add(new IncidentInquiryServices(currentNode));
+            }
+       }        
+    }
+    
+    /**
+     * Applies the parameter timestamp to all IncidentInquiry objects.
+     * 
+     * @param timeStamp String containing timestamp
+     */
+    public void timeStamp(String timeStamp) {
+        for(IncidentInquiryDetails detail : details)
+            detail.timeStamp(timeStamp);
+        
+        for(IncidentInquiryUnitsAssigned unit : units) {            
+            unit.timeStamp(timeStamp);
+        }
+        
+        for(IncidentInquiryWitnesses witness : witnesses) {
+            witness.timeStamp(timeStamp);
+        }       
+        for(IncidentInquiryTows tow : tows) {           
+            tow.timeStamp(timeStamp);           
+        }
+        for(IncidentInquiryServices service : services) {               
+            service.timeStamp(timeStamp);
+        }
+    }
+
+    /** 
+     * Gets the log number value for this IncidentInquiry object.
+     * 
+     * @return Integer Log number value
+     */
+    public Integer getLogNumber() {
+        return header.logNumber;
+    }
+    
+    /**
+     * Sets this objects log number to a new value.
+     * 
+     * @param logNum New log number.
+     */
+    public void setLogNumber(Integer logNum) {
+        header.logNumber = logNum;
+    }
+        
+    public IncidentInquiryHeader                getHeader()    {return header;}
+    public Vector<IncidentInquiryDetails>       getDetails()   {return details;}
+    public Vector<IncidentInquiryUnitsAssigned> getUnits()     {return units;}  
+    public Vector<IncidentInquiryWitnesses>     getWitnesses() {return witnesses;}
+    public Vector<IncidentInquiryTows>          getTows()      {return tows;}
+    public Vector<IncidentInquiryServices>      getServices()  {return services;}   
+    
+    public void setHeader(IncidentInquiryHeader newHeader)      {header = newHeader;}
+    public void addDetail(IncidentInquiryDetails newDetail)     {details.add(newDetail);}
+    public void addUnit(IncidentInquiryUnitsAssigned newUnit)   {
+        if(units.contains(newUnit)) {
+            units.remove(newUnit);
+        }
+        
+        units.add(newUnit); 
+    }  
+    public void addWitness(IncidentInquiryWitnesses newWitness) {witnesses.add(newWitness);}
+    public void addTow(IncidentInquiryTows newTow)              {tows.add(newTow);}
+    public void addService(IncidentInquiryServices newService)  {services.add(newService);}
+    
+    /*
+    public boolean getDetailsUpdated()   { return detailsUpdated; }
+    public boolean getUnitsUpdated()     { return unitsUpdated; }
+    public boolean getTowsUpdated()      { return towsUpdated; }
+    public boolean getWitnessesUpdated() { return witnessesUpdated; }
+    public boolean getServicesUpdated()  { return servicesUpdated; }
+    */  
+    
+    public String getSource() {
+        return source;
+    }   
+}
Index: trunk/src/tmcsim/cadmodels/IncidentCallBacks.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentCallBacks.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentCallBacks.java	(revision 2)
@@ -0,0 +1,66 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+/**
+ * This class is a further subdivision of Incident to hold data.
+ * @author Vincent
+ *
+ */
+public class IncidentCallBacks implements Serializable
+{
+    private String initial;
+    private String comment;
+    
+    private static enum CALL_BACKS_ENUMS
+    {
+        INITIAL     ("INITIAL"),
+        COMMENT   ("COMMENT");
+        
+        public String tag;
+        
+        private CALL_BACKS_ENUMS(String t)
+        {
+            tag = t;
+        }
+    }
+    
+    /*
+     * Constructor. Initializes all objects to avoid null pointers.
+     */
+    public IncidentCallBacks(){
+        initial = "";
+        comment = "";
+    }
+    
+    public String getInitial() {
+        return initial;
+    }
+    
+    public void setInitial(String initial) {
+        this.initial = initial;
+    }
+
+    public String getComment() {
+        return comment;
+    }
+
+    public void setComment(String comment) {
+        this.comment = comment;
+    }
+    
+    /*
+     * Called from the tmc.simulator.cadclient.data.Incident.java. Handles storing data based on script tag.
+     */
+    public void readXMLNode(String tag_name, String value) {
+        if(tag_name.equals(CALL_BACKS_ENUMS.INITIAL.tag))
+        {
+            setInitial(value);
+        }
+        else if(tag_name.equals(CALL_BACKS_ENUMS.COMMENT.tag))
+        {
+            setComment(value);
+        }
+    }
+    
+}
Index: trunk/src/tmcsim/cadmodels/IncidentTimes.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentTimes.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentTimes.java	(revision 2)
@@ -0,0 +1,274 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+/**
+ * This class is a further subdivision of Incident to hold data.
+ * @author Vincent
+ *
+ */
+public class IncidentTimes implements Serializable
+{
+    private String unit;
+    private String alarm;
+    private String assigned;
+    private String enroute;
+    private String staged;
+    private String arrival;
+    private String access;
+    private String depart;
+    private String atDest;
+    private String status5;
+    private String available;
+    private String respNum;
+    
+    private String ring;
+    private String inQueue;
+    private String allAvailable;
+    private String callClosed;
+    
+    private static enum TIMES_ENUMS
+    {
+        UNIT     ("UNIT"),
+        ALARM  ("ALARM"),
+        ASSIGNED   ("ASSIGNED"), 
+        ENROUTE   ("ENROUTE"),
+        STAGED     ("STAGED"),
+        ARRIVAL     ("ARRIVAL"),
+        ACCESS  ("ACCESS"),
+        DEPART   ("DEPART"), 
+        AT_DEST   ("AT_DEST"),
+        STATUS_5     ("STATUS_5"),
+        AVAILABLE     ("AVAILABLE"),
+        RESP_NUM    ("RESP_NUM"),
+        
+        RING    ("RING"),
+        IN_QUEUE    ("IN_QUEUE"),
+        ALL_AVAILABLE   ("ALL_AVAILABLE"),
+        CALL_CLOSED ("CALL_CLOSED");
+        
+        public String tag;
+        
+        private TIMES_ENUMS(String t)
+        {
+            tag = t;
+        }
+    }
+    
+    /*
+     * Constructor. Initializes all objects to avoid null pointers.
+     */
+    public IncidentTimes(){
+        unit = "";
+        alarm = "";
+        assigned = "";
+        enroute = "";
+        staged = "";
+        arrival = "";
+        access = "";
+        depart = "";
+        atDest = "";
+        status5 = "";
+        available = "";
+        respNum = "";
+    }
+    
+    public String getUnit() {
+        return unit;
+    }
+    
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public String getAlarm() {
+        return alarm;
+    }
+
+    public void setAlarm(String alarm) {
+        this.alarm = alarm;
+    }
+
+    public String getAssigned() {
+        return assigned;
+    }
+
+    public void setAssigned(String assigned) {
+        this.assigned = assigned;
+    }
+
+    public String getEnroute() {
+        return enroute;
+    }
+
+    public void setEnroute(String enroute) {
+        this.enroute = enroute;
+    }
+
+    public String getStaged() {
+        return staged;
+    }
+
+    public void setStaged(String staged) {
+        this.staged = staged;
+    }
+
+    public String getArrival() {
+        return arrival;
+    }
+
+    public void setArrival(String arrival) {
+        this.arrival = arrival;
+    }
+
+    public String getAccess() {
+        return access;
+    }
+
+    public void setAccess(String access) {
+        this.access = access;
+    }
+
+    public String getDepart() {
+        return depart;
+    }
+
+    public void setDepart(String depart) {
+        this.depart = depart;
+    }
+
+    public String getAtDest() {
+        return atDest;
+    }
+
+    public void setAtDest(String atDest) {
+        this.atDest = atDest;
+    }
+
+    public String getStatus5() {
+        return status5;
+    }
+
+    public void setStatus5(String status5) {
+        this.status5 = status5;
+    }
+
+    public String getAvailable() {
+        return available;
+    }
+
+    public void setAvailable(String available) {
+        this.available = available;
+    }
+
+    public String getRespNum() {
+        return respNum;
+    }
+
+    public void setRespNum(String respNum) {
+        this.respNum = respNum;
+    }
+    
+    public String getRing() {
+        return ring;
+    }
+
+    public void setRing(String ring) {
+        this.ring = ring;
+    }
+    
+    public String getInQueue() {
+        return inQueue;
+    }
+
+    public void setInQueue(String inQueue) {
+        this.inQueue = inQueue;
+    }
+    
+    public String getAllAvailable() {
+        return allAvailable;
+    }
+
+    public void setAllAvailable(String allAvailable) {
+        this.allAvailable = allAvailable;
+    }
+    
+    public String getCallClosed() {
+        return callClosed;
+    }
+
+    public void setCallClosed(String callClosed) {
+        this.callClosed = callClosed;
+    }
+    
+    
+    /*
+     * Called from the tmc.simulator.cadclient.data.Incident.java. Handles storing data based on script tag.
+     */
+    public void readXMLNode(String tag_name, String value) {
+        if(tag_name.equals(TIMES_ENUMS.UNIT.tag))
+        {
+            setUnit(value);
+        }
+        else if(tag_name.equals(TIMES_ENUMS.ALARM.tag))
+        {
+            setAlarm(value);
+        }
+        else if(tag_name.equals(TIMES_ENUMS.ASSIGNED.tag))
+        {
+            setAssigned(value);
+        }
+        else if(tag_name.equals(TIMES_ENUMS.ENROUTE.tag))
+        {
+            setEnroute(value);
+        }
+        else if(tag_name.equals(TIMES_ENUMS.STAGED.tag))
+        {
+            setStaged(value);
+        }
+        else if(tag_name.equals(TIMES_ENUMS.ARRIVAL.tag))
+        {
+            setArrival(value);
+        }
+        else if(tag_name.equals(TIMES_ENUMS.ACCESS.tag))
+        {
+            setAccess(value);
+        }
+        else if(tag_name.equals(TIMES_ENUMS.DEPART.tag))
+        {
+            setDepart(value);
+        }
+        else if(tag_name.equals(TIMES_ENUMS.AT_DEST.tag))
+        {
+            setAtDest(value);
+        }
+        else if(tag_name.equals(TIMES_ENUMS.STATUS_5.tag))
+        {
+            setStatus5(value);
+        }
+        else if(tag_name.equals(TIMES_ENUMS.AVAILABLE.tag))
+        {
+            setAvailable(value);
+        }
+        else if(tag_name.equals(TIMES_ENUMS.RESP_NUM.tag))
+        {
+            setRespNum(value);
+        }
+        else if(tag_name.equals(TIMES_ENUMS.RING.tag))
+        {
+            setRing(value);
+        }
+        else if(tag_name.equals(TIMES_ENUMS.IN_QUEUE.tag))
+        {
+            setInQueue(value);
+        }
+        else if(tag_name.equals(TIMES_ENUMS.ALL_AVAILABLE.tag))
+        {
+            setAllAvailable(value);
+        }
+        else if(tag_name.equals(TIMES_ENUMS.CALL_CLOSED.tag))
+        {
+            setCallClosed(value);
+        }
+    }
+}
Index: trunk/src/tmcsim/cadmodels/IncidentInquiryModel.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentInquiryModel.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentInquiryModel.java	(revision 2)
@@ -0,0 +1,159 @@
+package tmcsim.cadmodels;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import tmcsim.common.ScriptException;
+import tmcsim.common.CADEnums.CADScreenNum;
+import tmcsim.common.CADEnums.CADScreenType;
+import tmcsim.common.CADProtocol.CAD_COMMANDS;
+
+
+/**
+ * IncidentInquiryModel is a CADScreenModel object containing data that is 
+ * displayed in the IncidentInquiry CAD Screen.  The addModelObject() method 
+ * is used to update the model data with new information.<br/>
+ * <br/>
+ * This element parses and creates the following XML schema in its toXML() and
+ * fromXML() methods.  The ROOT element is the parameter for those methods.  
+ * See the class description for the CADScreenModel and 
+ * IncidentInquiryModel_obj Objects for their XML schema.<br/>
+ * <ROOT>
+ *    <INCIDENT_INQUIRY>
+ *       <BASE_MODEL_INFO/>
+ *       ... IncidentInquiryModel_obj ...
+ *    </INCIDENT_INQUIRY>
+ * </ROOT>
+ * 
+ * @see IncidentInquiryModel_obj
+ * @see CADScreenModel
+ * @author Matthew Cechini
+ * @version
+ */
+public class IncidentInquiryModel extends CADScreenModel {
+
+    /** Object containing model data. */
+    private IncidentInquiryModel_obj theModelObj = null;    
+    
+    /**
+     * Constructor. Initialize the model data and set the log number.
+     * This constructor is used when creating an IncidentInquiry
+     * model object where the source is the script.
+     * 
+     * @param num CADScreen number for this model object.
+     * @param logNum Unique log number for this model object.
+     */
+    public IncidentInquiryModel(CADScreenNum num, Integer logNum) {
+        super(CADScreenType.II_INCIDENT_INQUIRY, num);
+        
+        theModelObj = new IncidentInquiryModel_obj();
+        theModelObj.setLogNumber(logNum);
+    }
+    
+    /**
+     * Constructor. Initialize the model data and set the log number.
+     * This constructor is used when creating an IncidentInquiry
+     * model object where the source is a CAD position.
+     * 
+     * @param CADPostion CAD Position number for where data originated.
+     * @param num CADScreen number for this model object.
+     * @param logNum Unique log number for this model object.
+     */    
+    public IncidentInquiryModel(int CADPosition, CADScreenNum num, Integer logNum) {
+        super(CADScreenType.II_INCIDENT_INQUIRY, num);
+        
+        theModelObj = new IncidentInquiryModel_obj(CADPosition);
+        theModelObj.setLogNumber(logNum);
+    }    
+    
+    /**
+     * Constructor. Initialize the model data from the parameter Node.
+     * 
+     * @param newNode Node containing model data.
+     * @throws ScriptException if there is an error in parsing the Node.
+     */    
+    public IncidentInquiryModel(Node newNode) throws ScriptException {
+        super(CADScreenType.II_INCIDENT_INQUIRY, CADScreenNum.ONE);
+        
+        fromXML(newNode);   
+    }
+    
+    /**
+     * Updates the private IncidentInquiryModel_obj object with the parameter.
+     * 
+     * @param iimo An IncidentInquiryModel_obj object to be added
+     */
+    public void addModelObject(Object iimo) {                       
+        theModelObj.update((IncidentInquiryModel_obj)iimo);      
+    }                   
+    
+    /** 
+     * Returns the private IncidentInquiryModel object.
+     * 
+     * @return The model's data object.
+     */
+    public IncidentInquiryModel_obj getModelObject() {        
+        return theModelObj; 
+    } 
+    
+    /**
+     * Sets the model object's log number.
+     * 
+     * @param newLogNumber The new log number.
+     */
+    public void setLogNumber(Integer newlogNumber) {
+        theModelObj.setLogNumber(newlogNumber);
+    }    
+    
+    /**
+     * Gets the unique log number for this model's data.
+     * 
+     * @return Integer log number.
+     */
+    public Integer getLogNumber() {
+        return theModelObj.getLogNumber();
+    }    
+    
+    /**
+     * Compares a parameter IncidentInquiry model object's log number against
+     * this object's log number.
+     * 
+     * @param iimo Model object whose log number will be compared with
+     *             this object's log number.
+     * @return true if log numbers match, false if not.
+     */
+    public boolean logNumMatches(IncidentInquiryModel_obj iimo) {
+        return iimo.getHeader().logNumber.equals(getLogNumber());
+    }
+        
+    public void toXML(Element currElem) {
+        
+        Document theDoc = currElem.getOwnerDocument();
+        
+        Element modelElem = theDoc.createElement(CAD_COMMANDS.INCIDENT_INQUIRY.fullName);
+        
+        baseToXML(modelElem);
+        
+        theModelObj.toXML(modelElem);
+                
+        currElem.appendChild(modelElem);
+    
+    }    
+    
+    public void fromXML(Node modelNode) throws ScriptException {    
+        
+        theModelObj = new IncidentInquiryModel_obj();
+        
+        modelNode = modelNode.getFirstChild();
+        
+        baseFromXML(modelNode);     
+        
+        modelNode = modelNode.getNextSibling();
+        
+        theModelObj.fromXML(modelNode);
+        
+    }    
+    
+
+}
Index: trunk/src/tmcsim/cadmodels/IncidentEvent.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentEvent.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentEvent.java	(revision 2)
@@ -0,0 +1,240 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+import java.util.Vector;
+
+import tmcsim.common.CCTVInfo;
+import tmcsim.common.XMLIncident;
+
+/**
+ * IncidentEvent class contains data for an event that occurs during a 
+ * simulation.  Incident event information includes the following:<br/>
+ * <ul>
+ * <li>Second after Incident begins Event is schedule to occur.</li>
+ * <li>Simulation time Event occurs.</li>
+ * <li>IncidentInquiry model data.</li>
+ * <li>Audio file name and duration.</li>
+ * <li>XMLIncident Objects</li>
+ * <li>CCTVInfo Objects</li>
+ * <li>Current Event status.</li>
+ * </ul>
+ * <br/>
+ * <br/>
+ * The EVENT_STATUS is used to keep track of what state this event is in.  An 
+ * event is WAITING until its time to occur is reached in the simulation.  The 
+ * event will then enter the TRIGGERED state if it has a wave file length 
+ * greater than 0, otherwise it will enter the COMPLETED state.  When an 
+ * audio file is completed, the wavePlayed() method is called, and the Event 
+ * enters the COMPLETED state.  The finalizeEvent method finalizes the Event by
+ * timestamping the model data and setting the number of seconds the event 
+ * occured in the simulation.  The EVENT_STATUS is then set to FINALIZED.
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/06 20:46:40 $ $Revision: 1.4 $
+ */
+@SuppressWarnings("serial")
+public class IncidentEvent implements Comparable<IncidentEvent>, Serializable {
+    
+    /**
+     * Enumeration
+     * @author Matthew Cechini
+     */
+    public static enum EVENT_STATUS {
+        /** Waiting to be triggered. */
+        WAITING,
+        /** Event has been triggered. */
+        TRIGGERED,  
+        /** Completed audio playing, if necessary. */
+        COMPLETED,   
+        /** 
+         * Incident has been triggered, audio file has been played, 
+         * and model data timestamped. 
+         */
+        FINALIZED
+    };
+
+    /** Number of seconds after the incident begins that this event will trigger. */    
+    public long secondsToOccurInIncident;
+    
+    /** Number of seconds after the simulation started that this event occured. */  
+    public long secondsOccuredInSimulation;
+    
+    /** Model object containing the data that will be added to the incident when this event occurs. */  
+    public IncidentInquiryModel_obj eventInfo = null;
+    
+    /** Audio wav file associated with this event. */   
+    public String waveFile;
+    
+    /** Duration(in seconds) of the waveFile. */    
+    public int waveLength;
+            
+    /** Vector of XMLIncident objects which are associated with this incident event. */
+    public Vector<XMLIncident> XMLIncidents;
+    
+    /** Vector of CCTV objects which are associated with this incident event. */
+    public Vector<CCTVInfo> cctvInfos;
+    
+    /** Current Incident Event status. */
+    public EVENT_STATUS eventStatus;
+    
+
+    /**  
+     * Constructor.
+     *
+     * @param timeToOccur Time (in seconds) in simulation for this incident event to occur.
+     */
+    public IncidentEvent(long timeToOccur) {
+            
+        eventInfo       = new IncidentInquiryModel_obj();   
+        waveFile        = "";
+        waveLength      = 0;
+        eventStatus     = EVENT_STATUS.WAITING;
+        XMLIncidents    = new Vector<XMLIncident>();
+        cctvInfos       = new Vector<CCTVInfo>();
+
+        secondsToOccurInIncident   = timeToOccur;
+        secondsOccuredInSimulation = 0;   
+            
+    }    
+     
+   /**
+    * Constructor.
+    *
+    * @param timeToOccur      Time (in seconds) in simulation for this incident event to occur.
+    * @param info             IncidentInquiry model data.
+    * @param newWaveFile      Filename of audio wav file to be played with this event.
+    * @param newWaveLength    Duration (in seconds) of audio wav file
+    * @param newXMLIncidents  List of XMLIncidents for this event.
+    * @param newCCTVInfos     List of CCTVInfos for this event.
+    */
+    public IncidentEvent(long timeToOccur, 
+                         IncidentInquiryModel_obj info, 
+                         String newWaveFile, 
+                         int newWaveLength,
+                         Vector<XMLIncident> newXMLIncidents,
+                         Vector<CCTVInfo> newCCTVInfos){
+        
+        eventInfo       = info;
+        eventStatus     = EVENT_STATUS.WAITING;
+        waveFile        = newWaveFile;
+        waveLength      = newWaveLength;
+
+        XMLIncidents    = new Vector<XMLIncident>();
+        XMLIncidents.addAll(newXMLIncidents);
+        
+        cctvInfos       = new Vector<CCTVInfo>();
+        cctvInfos.addAll(newCCTVInfos);     
+        
+        secondsToOccurInIncident   = timeToOccur;
+        secondsOccuredInSimulation = 0;     
+    }
+    
+    /**
+     * Copy Constructor.
+     *
+     * @param timeToOccur      Time (in seconds) in simulation for this incident event to occur.
+     * @param info             IncidentInquiry model data.
+     * @param newWaveFile      Filename of audio wav file to be played with this event.
+     * @param newWaveLength    Duration (in seconds) of audio wav file
+     * @param newXMLIncidents  List of XMLIncidents for this event.
+     * @param newCCTVInfos     List of CCTVInfos for this event.
+     */
+     public IncidentEvent(final IncidentEvent copyEvent){
+        
+        eventInfo       = copyEvent.eventInfo;
+        eventStatus     = copyEvent.eventStatus;
+        waveFile        = copyEvent.waveFile;
+        waveLength      = copyEvent.waveLength;
+
+        XMLIncidents    = new Vector<XMLIncident>();
+        XMLIncidents.addAll(copyEvent.XMLIncidents);
+        
+        cctvInfos       = new Vector<CCTVInfo>();
+        cctvInfos.addAll(copyEvent.cctvInfos);      
+        
+        secondsToOccurInIncident   = copyEvent.secondsToOccurInIncident;
+        secondsOccuredInSimulation = copyEvent.secondsOccuredInSimulation;      
+     }    
+    
+    /** Compare objects according o comparison of secondsToOccurInIncident member data. */
+    public int compareTo(IncidentEvent o) {
+        if(secondsToOccurInIncident < o.secondsToOccurInIncident)
+            return -1;
+            
+        else if(secondsToOccurInIncident > o.secondsToOccurInIncident)
+            return 1;
+        
+        else 
+            return 0;
+    }
+    
+    /**
+     * Method determines if the Event is ready to be triggered.  This is 
+     * determined by assessing the current Event status and simulation
+     * time.  The Event will be triggered if the Event is WAITING and the
+     * Event's time to start has been reached.  The Event's relative start 
+     * time is added to the Incident start time parameter and compared
+     * against the current simulation time parameter.  If the audio file 
+     * duration is greater than  zero seconds, then the Event status is set to 
+     * TRIGGERED, and true is returned.  If the audio file is zero, the status 
+     * is set to COMPLETED and false is returned.
+     *
+     * @param incidentStartTime Simulation time that Event's Incident began (in seconds).
+     * @param simulationTime Current simulation time (in seconds).
+     * @return true if incident enters the TRIGGERED state, false if it is not 
+     * ready to be triggered or has entered the COMPLETED state.
+     */
+    public boolean triggerEvent(long incidentStartTime, long simulationTime) {
+        boolean retVal = false;
+        
+        if(eventStatus == EVENT_STATUS.WAITING &&
+           simulationTime > (incidentStartTime + secondsToOccurInIncident) )
+        {               
+            if(waveLength == 0) {
+                eventStatus = EVENT_STATUS.COMPLETED;
+            }
+            else {
+                retVal = true;
+                eventStatus = EVENT_STATUS.TRIGGERED;
+            }
+        }
+        
+        return retVal;
+    }        
+    
+  
+    /**
+     * Method is called when the Event's audio file completes.  The Event 
+     * status is set to COMPLETED.
+     */
+    public void wavePlayed() {
+        eventStatus = EVENT_STATUS.COMPLETED;
+    }
+    
+    /**
+     * Method is called to finalize and Event.  The Event info
+     * is timestamped with the parameter and the  secondsInSimulationOccured
+     * member is set to the current time in the simulation.  The Event
+     * status is set to FINALIZED.
+     *
+     * @param occured Current simulation time (in seconds). 
+     * @param timestamp CAD time stamp for model data. 
+     */
+    public void finalizeEvent(long occured, String timestamp) {
+        //set time stamp
+        eventInfo.timeStamp(timestamp);     
+        secondsOccuredInSimulation = occured;
+        
+        eventStatus = EVENT_STATUS.FINALIZED;
+    }
+    
+    /**
+     * Called to reset the simulation.  The Event status is set to WAITING and
+     * the secondsOccuredinSimulation is reset to 0.
+     */
+    public void resetSimulation() {
+        eventStatus = EVENT_STATUS.WAITING;
+        secondsOccuredInSimulation = 0;
+    }
+
+} 
Index: trunk/src/tmcsim/cadmodels/IncidentInquiryLogEntry.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentInquiryLogEntry.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentInquiryLogEntry.java	(revision 2)
@@ -0,0 +1,121 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * IncidentInquiryLogEntry is the base model object used for IncidentInquiry
+ * log entries.  Every log entry has an associated position and timestamp for 
+ * where the data originated. <br/>
+ * <br/>
+ * This element parses and creates the following XML schema in its toXML() and
+ * fromXML() methods.  The ROOT element is the parameter for those methods.<br/>
+ * <ROOT><br/>
+ *    <POSITION_INFO/><br/>
+ *    <TIMESTAMP/><br/>
+ * </ROOT><br/>
+ * 
+ * @author Matthew Cechini
+ * @version 
+ */
+@SuppressWarnings("serial")
+public class IncidentInquiryLogEntry implements Serializable {
+    
+    /**
+     * Enumeration with XML tag names.
+     * @author Matthew Cechini
+     */
+    private static enum XML_TAGS {      
+        /** Log entry position info. */
+        POSITION_INFO ("POSITION_INFO"),
+        /** Log entry timestamp. */
+        TIMESTAMP     ("TIMESTAMP");
+
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }
+    }
+    
+    /** Position information for this log entry. */
+    protected String positionInfo;
+
+    /** Time stamp value for this log entry. */
+    protected String timeStamp; 
+        
+    /** Default Constructor.  Initialize local data. */
+    public IncidentInquiryLogEntry() {
+        positionInfo   = "";
+        timeStamp      = "0000";
+    }
+    
+    /** 
+     * Constructor.  Set position info and time stamp. 
+     * 
+     * @param newPosInfo   Position info for this log entry
+     * @param newTimeStamp Time stamp for this log entry
+     */
+    public IncidentInquiryLogEntry(String newPosInfo, String newTimeStamp) {
+        positionInfo   = newPosInfo;
+        timeStamp      = newTimeStamp;    
+    }
+    
+    /**
+     * Creates XML tags with the model data and adds them to the parameter 
+     * Element.  See clss description for XML schema.
+     *
+     * @param currElem XML Element used as a root for XML tag appending.
+     */
+    public void toXML(Element currElem) {
+        Document theDoc    = currElem.getOwnerDocument();
+        Element  tempElem  = null;
+                
+        tempElem = theDoc.createElement(XML_TAGS.POSITION_INFO.tag);
+        tempElem.appendChild(theDoc.createTextNode(positionInfo));
+        currElem.appendChild(tempElem);
+                
+        tempElem = theDoc.createElement(XML_TAGS.TIMESTAMP.tag);
+        tempElem.appendChild(theDoc.createTextNode(timeStamp));
+        currElem.appendChild(tempElem);         
+    }
+    
+    /**
+     * Parses model data from the parameter Node.  See clss description for
+     * XML schema.
+     * 
+     * @param modelNode XML Node containing model information.
+     */
+    public void fromXML(Node modelNode) {   
+        Node childNode = null;
+        
+        //childNode = modelNode.getFirstChild();
+        positionInfo = modelNode.getTextContent();
+        
+        childNode = modelNode.getNextSibling();
+        timeStamp = childNode.getTextContent();     
+    }
+    
+    
+    /** 
+     * Sets the time stamp for this log entry. 
+     * 
+     * @param newStamp The timestamp value.
+     */
+    public void timeStamp(String newStamp) {
+        timeStamp = newStamp;       
+    }       
+    
+    /** 
+     * Returns the log information for this log entry.  The log information 
+     * is the concatenation of the entering position info and timestamp.
+     * 
+     * @return Log entry's log information 
+     */
+    public String getLogInfo() {
+        return positionInfo += timeStamp;
+    }
+}
Index: trunk/src/tmcsim/cadmodels/IncidentAdditionalInfo.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentAdditionalInfo.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentAdditionalInfo.java	(revision 2)
@@ -0,0 +1,173 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+/**
+ * This class is a further subdivision of Incident to hold data.
+ * @author Vincent
+ *
+ */
+public class IncidentAdditionalInfo implements Serializable
+{
+    private int incidentNumber;
+    private String type;
+    private String machine;
+    private String callTaken;
+    private String callStatus;
+    private String callTakerExt;
+    private String alarmLevel;
+    private String rotationProviderArea;
+    private String comment;
+    
+    private static enum ADDITIONAL_INFO_ENUMS
+    {
+        INCIDENT_NUM    ("INCIDENT_NUM"),
+        TYPE            ("TYPE"),
+        MACHINE   ("MACHINE"), 
+        CALL_TAKEN   ("CALL_TAKEN"),
+        CALL_STATUS   ("CALL_STATUS"),
+        CALL_TAKER_EXT  ("CALL_TAKER_EXT"),
+        ALARM_LEVEL ("ALARM_LEVEL"),
+        ROTATION_PROVIDER_AREA  ("ROTATION_PROVIDER_AREA"),
+        COMMENT ("COMMENT");
+        
+        public String tag;
+        
+        private ADDITIONAL_INFO_ENUMS(String t)
+        {
+            tag = t;
+        }
+    }
+    
+    /*
+     * Constructor. Initializes all objects to avoid null pointers.
+     */
+    public IncidentAdditionalInfo(){
+        type = "";
+        machine = "";
+        callTaken = "";
+        callStatus = "";
+        callTakerExt = "";
+        alarmLevel = "";
+        rotationProviderArea = "";
+        comment = "";
+    }
+    
+    public String getMachine() {
+        return machine;
+    }
+
+    public void setMachine(String machine) {
+        this.machine = machine;
+    }
+
+    public String getCallTaken() {
+        return callTaken;
+    }
+
+    public void setCallTaken(String callTaken) {
+        this.callTaken = callTaken;
+    }
+
+    public String getCallStatus() {
+        return callStatus;
+    }
+
+    public void setCallStatus(String callStatus) {
+        this.callStatus = callStatus;
+    }
+
+    public String getCallTakerExt() {
+        return callTakerExt;
+    }
+
+    public void setCallTakerExt(String callTakerExt) {
+        this.callTakerExt = callTakerExt;
+    }
+
+    
+    
+    public int getIncidentNumber() {
+        return incidentNumber;
+    }
+    
+    public void setIncidentNumber(int incidentNumber) {
+        this.incidentNumber = incidentNumber;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+    
+    public String getAlarmLevel() {
+        return alarmLevel;
+    }
+
+    public void setAlarmLevel(String alarmLevel) {
+        this.alarmLevel = alarmLevel;
+    }
+    
+    public String getRotationProviderArea() {
+        return rotationProviderArea;
+    }
+
+    public void setRotationProviderArea(String rotationProviderArea) {
+        this.rotationProviderArea = rotationProviderArea;
+    }
+    
+    public String getComment() {
+        return comment;
+    }
+
+    public void setComment(String comment) {
+        this.comment = comment;
+    }
+    
+    /*
+     * Called from the tmc.simulator.cadclient.data.Incident.java. Handles storing data based on script tag.
+     */
+    public void readXMLNode(String tag_name, String value) {
+        if(tag_name.equals(ADDITIONAL_INFO_ENUMS.INCIDENT_NUM.tag))
+        {
+            setIncidentNumber(Integer.parseInt(value));
+        }
+        else if(tag_name.equals(ADDITIONAL_INFO_ENUMS.TYPE.tag))
+        {
+            setType(value);
+        }
+        else if(tag_name.equals(ADDITIONAL_INFO_ENUMS.MACHINE.tag))
+        {
+            setMachine(value);
+        }
+        else if(tag_name.equals(ADDITIONAL_INFO_ENUMS.CALL_TAKEN.tag))
+        {
+            setCallTaken(value);
+        }
+        else if(tag_name.equals(ADDITIONAL_INFO_ENUMS.CALL_STATUS.tag))
+        {
+            setCallStatus(value);
+        }
+        else if(tag_name.equals(ADDITIONAL_INFO_ENUMS.CALL_TAKER_EXT.tag))
+        {
+            setCallTakerExt(value);
+        }
+        else if(tag_name.equals(ADDITIONAL_INFO_ENUMS.ALARM_LEVEL.tag))
+        {
+            setAlarmLevel(value);
+        }
+        else if(tag_name.equals(ADDITIONAL_INFO_ENUMS.ROTATION_PROVIDER_AREA.tag))
+        {
+            setRotationProviderArea(value);
+        }
+        else if(tag_name.equals(ADDITIONAL_INFO_ENUMS.COMMENT.tag))
+        {
+            setComment(value);
+        }
+    }
+    
+    
+}
Index: trunk/src/tmcsim/cadmodels/CMSDiversion.java
===================================================================
--- trunk/src/tmcsim/cadmodels/CMSDiversion.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/CMSDiversion.java	(revision 2)
@@ -0,0 +1,163 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * CMSDiversion is a container class used to hold information for a single 
+ * diversion that may be applied at a changeable message sign.  This 
+ * information includes the original path, new diversion path, paramics 
+ * diversion string, maximum diversion percentage, applied diversion 
+ * percentage, and simulation time the diversion was applied.  The updated
+ * and cleared flags are used to specify whether the diversion has been
+ * recently changed or is cleared.
+ * 
+ * @author  Matthew Cechini
+ * @version 
+ */
+@SuppressWarnings("serial")
+public class CMSDiversion implements Serializable {
+
+    /**
+     * Enumeration with XML tag names.
+     * @author Matthew Cechini
+     */
+    private static enum XML_TAGS {
+        /** Diversion path. */
+        DIVERSION_PATH ("Diversion_path"),
+        /** Diversion percentage. */
+        PERCENTAGE     ("Percentage"),
+        /** Diversion identifier. */
+        IDENTIFIER     ("Identifier");
+        
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }
+    }
+    
+    /** Boolean flag to designate whether the diversion percentage has changed.*/
+    private boolean updated;
+    
+    /** Boolean flag to designate whether the diversion percentage is 0.  */
+    private boolean cleared;   
+    
+    /** Original path of traffic. */
+    public String  originalPath;
+
+    /** New path traffic will be diverted to. */
+    public String  newPath;
+
+    /** Paramics diversion path. */
+    public String  diversionPath;
+
+    /** Maximum diversion percentage. */
+    public Integer maxDiversionPercent;
+
+    /** Current diversion percentage. */
+    private Integer currDiversionPercent;
+
+    /** Time the current diversion percentage was applied. */
+    public Long timeApplied;
+
+    
+    /**
+     * Constructor.
+     * 
+     * @param oPath Original path traffic would take.
+     * @param nPath New path traffic will take.
+     * @param dPath Paramics diversion path.
+     * @param maxPerc Maximum diversion percentage.
+     */
+    public CMSDiversion(String oPath, String nPath, String dPath, Integer maxPerc) {
+
+        originalPath         = oPath;
+        newPath              = nPath;
+        diversionPath        = dPath;
+        maxDiversionPercent  = maxPerc;
+        currDiversionPercent = new Integer(0);
+        timeApplied          = new Long(0);
+        
+        updated = false;
+        cleared = (currDiversionPercent == 0);              
+    }
+    
+    /**
+     * Get the current diversion percentage.
+     * 
+     * @return Integer value of current diversion percentage.
+     */
+    public int getCurrDiv() { 
+        return currDiversionPercent.intValue();
+    }
+    
+    /**
+     * Set the cleared flag to true if the new diversion is zero, false
+     * if not.  Set the updated flag if the new diversion percentage is
+     * differenct than the previous applied diversion, false if not.  
+     * Set the current diversion percentage to the parameter value.
+     * 
+     * @param newDiv New applied diversion percentage.
+     */
+    public void setCurrDiv(int newDiv) {
+        
+        cleared = (newDiv == 0);
+        updated = (newDiv != currDiversionPercent);
+            
+        currDiversionPercent = newDiv;          
+    }
+    
+    /**
+     * Determine whether this diversion has been updated in its last use.
+     * 
+     * @return True if diversion has been updated, false if not.
+     */
+    public boolean isUpdated() { return updated;}
+    
+    /**
+     * Determine if the current diversion has been cleared.
+     * 
+     * @return True if diversion is zero, false if not.
+     */
+    public boolean isCleared() { return cleared;}       
+    
+    /**
+     * Reset this diversion by ...
+     */
+    public void reset() {
+        currDiversionPercent = 0;
+        
+        updated = false;
+        cleared = (currDiversionPercent == 0);      
+    }
+    
+    /**
+     * Write the XML output for the diversion information 
+     * represented in this object.  THe format is as follows:
+     * <Diversion_path>
+     *    <Identifier/>
+     *    <Percentage/>
+     * <Diversion_path>
+     * 
+     * @param xmlOut XMLWriter used for XML creation.
+     */
+    public void toXML(Element currElem) {
+        
+        Document theDoc = currElem.getOwnerDocument();
+        
+        Element divPathElem = theDoc.createElement(XML_TAGS.DIVERSION_PATH.tag);
+        currElem.appendChild(divPathElem);
+        
+        Element idElem = theDoc.createElement(XML_TAGS.IDENTIFIER.tag);
+        idElem.appendChild(theDoc.createTextNode(diversionPath));
+        divPathElem.appendChild(idElem);
+
+        Element pctElem = theDoc.createElement(XML_TAGS.PERCENTAGE.tag);
+        pctElem.appendChild(theDoc.createTextNode(String.valueOf(currDiversionPercent)));
+        divPathElem.appendChild(pctElem);
+        
+    }
+}   
Index: trunk/src/tmcsim/cadmodels/IncidentEditLog.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentEditLog.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentEditLog.java	(revision 2)
@@ -0,0 +1,95 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+/**
+ * This class is a further subdivision of Incident to hold data.
+ * @author Vincent
+ *
+ */
+public class IncidentEditLog implements Serializable
+{
+    private String edit;
+    private String reason;
+    private String changeBy;
+    private String terminal;
+    
+    private static enum EDIT_LOG_ENUMS
+    {
+        EDIT     ("EDIT"),
+        REASON  ("REASON"),
+        CHANGE_BY   ("CHANGE_BY"), 
+        TERMINAL   ("TERMINAL");
+        
+        public String tag;
+        
+        private EDIT_LOG_ENUMS(String t)
+        {
+            tag = t;
+        }
+    }
+    
+    /*
+     * Constructor. Initializes all objects to avoid null pointers.
+     */
+    public IncidentEditLog(){
+        edit = "";
+        reason = "";
+        changeBy = "";
+        terminal = "";
+    }
+    
+    public String getEdit() {
+        return edit;
+    }
+    
+    public void setEdit(String edit) {
+        this.edit = edit;
+    }
+
+    public String getReason() {
+        return reason;
+    }
+
+    public void setReason(String reason) {
+        this.reason = reason;
+    }
+
+    public String getChangeBy() {
+        return changeBy;
+    }
+
+    public void setChangeBy(String changeBy) {
+        this.changeBy = changeBy;
+    }
+
+    public String getTerminal() {
+        return terminal;
+    }
+
+    public void setTerminal(String terminal) {
+        this.terminal = terminal;
+    }
+    
+    /*
+     * Called from the tmc.simulator.cadclient.data.Incident.java. Handles storing data based on script tag.
+     */
+    public void readXMLNode(String tag_name, String value) {
+        if(tag_name.equals(EDIT_LOG_ENUMS.EDIT.tag))
+        {
+            setEdit(value);
+        }
+        else if(tag_name.equals(EDIT_LOG_ENUMS.REASON.tag))
+        {
+            setReason(value);
+        }
+        else if(tag_name.equals(EDIT_LOG_ENUMS.CHANGE_BY.tag))
+        {
+            setChangeBy(value);
+        }
+        else if(tag_name.equals(EDIT_LOG_ENUMS.TERMINAL.tag))
+        {
+            setTerminal(value);
+        }
+    }
+}
Index: trunk/src/tmcsim/cadmodels/IncidentGeneralInfo.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentGeneralInfo.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentGeneralInfo.java	(revision 2)
@@ -0,0 +1,104 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+/**
+ * This class is a further subdivision of Incident to hold data.
+ * @author Vincent
+ *
+ */
+public class IncidentGeneralInfo implements Serializable
+{
+    private String id;
+    private String masterIncNum;
+    private String jurisdiction;
+    private String alarm;
+    private String agy;
+    
+    private static enum GENERAL_ENUMS
+    {
+        ID     ("ID"),
+        JURISDICTION   ("JURISDICTION"), 
+        ALARM   ("ALARM"),
+        AGY     ("AGY");
+        
+        public String tag;
+        
+        private GENERAL_ENUMS(String t)
+        {
+            tag = t;
+        }
+    }
+    
+    /*
+     * Constructor. Initializes all objects to avoid null pointers.
+     */
+    public IncidentGeneralInfo(){
+        jurisdiction = "";
+        alarm = "";
+        agy = "";
+    }
+    
+    public String getJurisdiction() {
+        return jurisdiction;
+    }
+    
+    public void setJurisdiction(String jurisdiction) {
+        this.jurisdiction = jurisdiction;
+    }
+
+    public String getAlarm() {
+        return alarm;
+    }
+
+    public void setAlarm(String alarm) {
+        this.alarm = alarm;
+    }
+
+    public String getAgy() {
+        return agy;
+    }
+
+    public void setAgy(String agy) {
+        this.agy = agy;
+    }
+
+    public String getMasterIncNum() {
+        return masterIncNum;
+    }
+
+    public void setMasterIncNum(String masterIncNum) {
+        this.masterIncNum = masterIncNum;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+    
+    /*
+     * Called from the tmc.simulator.cadclient.data.Incident.java. Handles storing data based on script tag.
+     */
+    public void readXMLNode(String tag_name, String value) {
+        if(tag_name.equals(GENERAL_ENUMS.ID.tag))
+        {
+            setId(value);
+        }
+        else if(tag_name.equals(GENERAL_ENUMS.JURISDICTION.tag))
+        {
+            setJurisdiction(value);
+        }
+        else if(tag_name.equals(GENERAL_ENUMS.ALARM.tag))
+        {
+            setAlarm(value);
+        }
+        else if(tag_name.equals(GENERAL_ENUMS.AGY.tag))
+        {
+            setAgy(value);
+        }
+    }
+    
+}
Index: trunk/src/tmcsim/cadmodels/CADScreenModel.java
===================================================================
--- trunk/src/tmcsim/cadmodels/CADScreenModel.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/CADScreenModel.java	(revision 2)
@@ -0,0 +1,341 @@
+package tmcsim.cadmodels;
+
+
+import java.util.Observable;
+import java.util.StringTokenizer;
+import java.util.TreeMap;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import tmcsim.common.ScriptException;
+import tmcsim.common.CADEnums.CADScreenNum;
+import tmcsim.common.CADEnums.CADScreenType;
+
+/**
+ * CADScreenModel is the base model object for all CAD Screen models.  The 
+ * information contained within this base class includes the CAD time and date,
+ * number of routed messages, whether any messages are unread, CAD screen 
+ * number, and the screen update status values.  This data is used for every 
+ * CAD Screen during display.<br/>
+ * <br/>
+ * This element parses and creates the following XML schema in its toXML() and
+ * fromXML() methods.  The ROOT element is the parameter for those methods.<br/>
+ * <ROOT>
+ *    <BASE_MODEL_INFO>
+ *       <COMMAND_LINE/>
+ *       <FOOTER>
+ *          <CAD_TIME/>
+ *          <CAD_DATE/>
+ *          <ROUTED_MESSAGES/>
+ *          <UNREAD_MESSAGES/>
+ *          <SCREEN_NUM/>
+ *          <SCREEN_UPDATES>
+ *             <HAS_UPDATE Screen_Num=""/>
+ *             <HAS_UPDATE Screen_Num=""/>
+ *             <HAS_UPDATE Screen_Num=""/>
+ *             <HAS_UPDATE Screen_Num=""/>
+ *          </SCREEN_UPDATES>
+ *       </FOOTER>
+ *    </BASE_MODEL_INFO>
+ * </ROOT>
+ * 
+ * @author Matthew Cechini
+ * @version 
+ */
+public abstract class CADScreenModel extends Observable {   
+
+    /**
+     * Enumeration with XML tag names.
+     * @author Matthew Cechini
+     */
+    private static enum XML_TAGS {
+        /** CAD screen mnodel. */
+        CAD_SCREEN_MODEL  ("CAD_SCREEN_MODEL"),
+        /** CAD model update. */
+        CAD_MODEL_UPDATE  ("CAD_MODEL_UPDATE"),
+        /** CAD model type. */
+        MODEL_TYPE        ("MODEL_TYPE"),
+        /** Base model information. */
+        BASE_MODEL_INFO   ("BASE_MODEL_INFO"),
+        /** Current command line. */
+        COMMAND_LINE      ("COMMAND_LINE"),
+        /** CAD screen footer. */
+        FOOTER            ("FOOTER"),
+        /** Current CAD time. */
+        CAD_TIME          ("CAD_TIME"),
+        /** Current CAD date. */
+        CAD_DATE          ("CAD_DATE"),
+        /** Screen number. */
+        SCREEN_NUM        ("SCREEN_NUM"),
+        /** Number of routed messages. */
+        ROUTED_MESSAGES   ("ROUTED_MESSAGES"),
+        /** Boolean to designate if unread messages are in the queue. */
+        UNREAD_MESSAGES   ("UNREAD_MESSAGES"),
+        /** Screen update stati. */
+        SCREEN_UPDATES    ("SCREEN_UPDATES"),
+        /** Page number attribute. */
+        UPDATE_SCREEN_NUM ("Screen_Number"),
+        /** Screen update's stats.. */
+        HAS_UPDATE        ("HAS_UPDATE");
+
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }
+        
+    }   
+    
+    /** Current command line. */
+    public String commandLine;    
+    
+    /** Screen type for this model. */
+    public CADScreenType screenType;
+    
+    /** Screen number for this model. */    
+    public CADScreenNum  screenNum;
+    
+    /** Number of routed messages for this CAD terminal. */
+    public int numberRoutedMessages;
+    
+    /** Boolean flag to designate whether there are unread routed messages. */
+    public boolean unreadMessages;
+    
+    /** Current update status for all CAD screens. */
+    public TreeMap<CADScreenNum, Boolean> screenUpdateMap;
+    
+    /** Current CAD Date value. MMYY*/
+    static public String theCADDate = "";
+    
+    /** Current CAD Time value. HHMM*/   
+    static public String theCADTime = "";   
+    
+
+    /**
+     * Constructor.  Initiailze data.  Set screenUpdateMap to be
+     * false for all screens.
+     * 
+     * @param type CADScreenType for this model.
+     * @param num CADScreenNum for this model.
+     */
+    public CADScreenModel(CADScreenType type, CADScreenNum num) { 
+        
+        screenNum   = num;
+        screenType  = type;
+        commandLine = "";    
+        numberRoutedMessages = 0;
+        unreadMessages       = false;
+                    
+        screenUpdateMap = new TreeMap<CADScreenNum, Boolean>();
+
+        for(CADScreenNum screen : CADScreenNum.orderedList()) {
+            screenUpdateMap.put(screen, false);
+        }
+    }        
+    
+    public abstract void addModelObject(Object o);
+    
+    /**
+     * Creates XML tags with the model data and adds them to the parameter 
+     * Element.  The baseToXML() method is called to add the base
+     * XML tags for CAD model data.  See clss description for XML schema.
+     *
+     * @param currElem XML Element used as a root for XML tag appending.
+     */
+    public abstract void toXML(Element currElem);
+    
+    /**
+     * Parses model data from the parameter Node.  The fromToXML() method is 
+     * called to parse the base XML tags for CAD model data.  See clss 
+     * description for XML schema.
+     * 
+     * @param modelNode XML Node containing model information.
+     * @throws ScriptException if there is an error in parsing the Node.
+     */
+    public abstract void fromXML(Node modelNode) throws ScriptException;
+
+    /**
+     * Writes the base model data to the XMLWriter.  See the class
+     * description for the base model XML schema.
+     * 
+     * @param currElem XML Element used as a root for XML tag appending.
+     */
+    public void baseToXML(Element currElem) {
+
+        Document theDoc = currElem.getOwnerDocument();
+        
+        Element baseModelElem = theDoc.createElement(XML_TAGS.BASE_MODEL_INFO.tag);
+        
+        Element cmdLineElem = theDoc.createElement(XML_TAGS.COMMAND_LINE.tag);
+        cmdLineElem.appendChild(theDoc.createTextNode(commandLine));
+        baseModelElem.appendChild(cmdLineElem);
+        
+        Element footerElem = theDoc.createElement(XML_TAGS.FOOTER.tag);
+        baseModelElem.appendChild(footerElem);
+                
+        Element timeElem   = theDoc.createElement(XML_TAGS.CAD_TIME.tag);
+        timeElem.appendChild(theDoc.createTextNode(theCADTime));
+        footerElem.appendChild(timeElem);
+
+        Element dateElem   = theDoc.createElement(XML_TAGS.CAD_DATE.tag);
+        dateElem.appendChild(theDoc.createTextNode(theCADDate));
+        footerElem.appendChild(dateElem);
+
+        Element routedMsgsElem = theDoc.createElement(XML_TAGS.ROUTED_MESSAGES.tag);
+        routedMsgsElem.appendChild(theDoc.createTextNode(String.valueOf(numberRoutedMessages)));
+        footerElem.appendChild(routedMsgsElem);
+
+        Element unreadMsgsElem = theDoc.createElement(XML_TAGS.UNREAD_MESSAGES.tag);
+        unreadMsgsElem.appendChild(theDoc.createTextNode(String.valueOf(unreadMessages)));
+        footerElem.appendChild(unreadMsgsElem);
+
+        Element screenNumElem   = theDoc.createElement(XML_TAGS.SCREEN_NUM.tag);
+        screenNumElem.appendChild(theDoc.createTextNode(String.valueOf(screenNum.intNum)));
+        footerElem.appendChild(screenNumElem);
+        
+        Element screenUpdatesElem = theDoc.createElement(XML_TAGS.SCREEN_UPDATES.tag);
+        footerElem.appendChild(screenUpdatesElem);
+
+        Element updateElem = null;
+        for(CADScreenNum screen : CADScreenNum.orderedList()) {
+            updateElem = theDoc.createElement(XML_TAGS.HAS_UPDATE.tag);         
+            updateElem.appendChild(theDoc.createTextNode(String.valueOf(screenUpdateMap.get(screen))));
+            updateElem.setAttribute(XML_TAGS.UPDATE_SCREEN_NUM.tag, String.valueOf(screen.intNum));
+
+            screenUpdatesElem.appendChild(updateElem);
+        }
+        
+        currElem.appendChild(baseModelElem);
+        
+    }   
+    
+    /**
+     * Read in the base model data from the XML node. See the class
+     * description for the base model XML schema.
+     * 
+     * @param modelNode XML Node containing model information.
+     * @throws ScriptException if there is an error in parsing the node.
+     */
+    public void baseFromXML(Node modelNode) throws ScriptException {
+        //COMMAND_LINE node
+        Node node = modelNode.getFirstChild();
+        commandLine = node.getTextContent();
+        
+        //FOOTER node
+        node = node.getNextSibling();       
+
+        //CAD_TIME node
+        node = node.getFirstChild();
+        theCADTime = node.getTextContent();
+
+        //CAD_DATE node
+        node = node.getNextSibling();
+        theCADDate = node.getTextContent();
+        
+        //ROUTED_MESSAGES node
+        node = node.getNextSibling();
+        numberRoutedMessages = Integer.valueOf(node.getTextContent()).intValue();
+        
+        //UNREAD_MESSAGES node
+        node = node.getNextSibling();
+        unreadMessages = Boolean.valueOf(node.getTextContent()).booleanValue();
+        
+        //SCREEN_NUM node
+        node = node.getNextSibling();
+        screenNum = CADScreenNum.fromValue(Integer.valueOf(node.getTextContent()).intValue());      
+        
+        //SCREEN_UPDATES node
+        node = node.getNextSibling();
+        NodeList updates = node.getChildNodes();
+        
+        screenUpdateMap.clear();
+        Integer pageNumber   = null;
+        Boolean updateStatus = null;
+        for(int i = 0; i < updates.getLength(); i++) {
+            
+            pageNumber   = Integer.valueOf(updates.item(i).getAttributes().
+                    getNamedItem(XML_TAGS.UPDATE_SCREEN_NUM.tag).getTextContent());
+            updateStatus = Boolean.valueOf(updates.item(i).getTextContent());
+            
+            screenUpdateMap.put(CADScreenNum.fromValue(pageNumber), updateStatus);
+        }
+    }
+
+    /**
+     * Get the CAD screen type for this model.
+     * @return Current CADScreenType object.
+     */
+    public CADScreenType getType() {
+        return screenType;
+    }
+    
+    /**
+     * Get the CAD screen number for this model.
+     * @return Current CADScreenNum object.
+     */
+    public CADScreenNum getScreenNum() {
+        return screenNum;
+    }
+    
+    /**
+     * This static method converts the parameter CAD screen status update
+     * map into a String representation.  The resulting String is in the
+     * following format:  "<#>=true,<#>=false,<#>=true,<#>=false" where <#>
+     * is the CAD screen number.  
+     * 
+     * @param updateMap Map containing screen update flags.
+     * @return A String concatenation of screen update information.
+     */
+    public static String updateMapToString(TreeMap<CADScreenNum, Boolean> updateMap) {
+        
+        StringBuffer mapBuf = new StringBuffer();
+        
+        for(CADScreenNum screen : updateMap.keySet()) {
+            mapBuf.append(screen.intNum);
+            mapBuf.append("=");
+            mapBuf.append(updateMap.get(screen).toString());
+            mapBuf.append(",");
+        }       
+        
+        mapBuf.setLength(mapBuf.length()-1);
+        
+        return mapBuf.toString();
+    }
+    
+    /**
+     * This static method converts the parameter CAD screen status update
+     * String into an update Map. The parameter String must have the 
+     * following format:  "<#>=true,<#>=false,<#>=true,<#>=false" where <#>
+     * is the CAD screen number.  
+     * 
+     * @param updateString String containing CAD screen status update info. 
+     * @return Map containing CAD Screen update info.
+     */
+    public static TreeMap<CADScreenNum, Boolean> updateStringToMap(String updateString) {
+        
+        TreeMap<CADScreenNum, Boolean> updateMap = new TreeMap<CADScreenNum, Boolean>();
+        
+        StringTokenizer strTok = new StringTokenizer(updateString, ",");
+        String token = null;
+        
+        CADScreenNum screen  = null;
+        Boolean screenUpdate = null;
+        
+        while(strTok.hasMoreTokens()) {
+            token = strTok.nextToken();
+            
+            screen = CADScreenNum.fromValue(Integer.parseInt(
+                        token.substring(0, token.indexOf("="))));
+            screenUpdate = Boolean.parseBoolean(token.substring(
+                    token.indexOf("=")+1, token.length()));
+            
+            updateMap.put(screen, screenUpdate);
+        }
+        
+        return updateMap;
+    }   
+
+}
Index: trunk/src/tmcsim/cadmodels/BlankScreenModel.java
===================================================================
--- trunk/src/tmcsim/cadmodels/BlankScreenModel.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/BlankScreenModel.java	(revision 2)
@@ -0,0 +1,76 @@
+package tmcsim.cadmodels;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import tmcsim.common.ScriptException;
+import tmcsim.common.CADEnums.CADScreenNum;
+import tmcsim.common.CADEnums.CADScreenType;
+import tmcsim.common.CADProtocol.CAD_COMMANDS;
+
+
+/**
+ * BlankScreenModel is a CADScreenModel object used to display a blank CAD Screen.  
+ * <br/>
+ * This element parses and creates the following XML schema in its toXML() and
+ * fromXML() methods.  The ROOT element is the parameter for those methods.  
+ * See the class description for the CADScreenModel XML schema.<br/>
+ * <ROOT>
+ *    <BLANK_SCREEN>
+ *       <BASE_MODEL_INFO/>
+ *    </BLANK_SCREEN>
+ * </ROOT>
+ * 
+ * @see CADScreenModel
+ * @author Matthew Cechini
+ * @version
+ */
+public class BlankScreenModel extends CADScreenModel {
+    
+    
+    /**
+     * Constructor.  Initialize base class with screen model type and
+     * current cad screen number.
+     * 
+     * @param num Current CADScreen number.
+     */
+    public BlankScreenModel(CADScreenNum num) {
+        super(CADScreenType.BLANKSCREEN, num);
+        
+    }
+    
+    /**
+     * Constructor.  Initialize base class with screen model type and
+     * current cad screen number.
+     * 
+     * @param newNode Node containing XML data for this model object.
+     * @throws ScriptException if there is an error in parsing the Node.
+     */    
+    public BlankScreenModel(Node newNode) throws ScriptException {
+        super(CADScreenType.BLANKSCREEN, CADScreenNum.ONE);
+        
+        fromXML(newNode);   
+    }
+        
+    public void addModelObject(Object o) {}
+  
+    public void toXML(Element currElem) {
+        
+        Document theDoc = currElem.getOwnerDocument();
+
+        Element modelElem = theDoc.createElement(CAD_COMMANDS.BLANK_SCREEN.fullName);
+        
+        baseToXML(modelElem);   
+
+        currElem.appendChild(modelElem);
+    }
+    
+    public void fromXML(Node modelNode) throws ScriptException {    
+        
+        modelNode = modelNode.getFirstChild();
+        baseFromXML(modelNode);
+        
+    }  
+    
+}
Index: trunk/src/tmcsim/cadmodels/IncidentProblem.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentProblem.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentProblem.java	(revision 2)
@@ -0,0 +1,74 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+/**
+ * This class is a further subdivision of Incident to hold data.
+ * @author Vincent
+ *
+ */
+public class IncidentProblem implements Serializable
+{
+   private String problemCode;
+   private String priority;
+   
+   private static enum PROBLEM_ENUMS
+    {
+        CODE       ("CODE"), 
+        PRIORITY   ("PRIORITY");
+        
+        public String tag;
+        
+        private PROBLEM_ENUMS(String t)
+        {
+            tag = t;
+        }
+    }
+   
+   /*
+     * Constructor. Initializes all objects to avoid null pointers.
+     */
+   public IncidentProblem(String code, String prio)
+   {
+       setProblemCode(code);
+       setPriority(prio);
+   }
+
+   public IncidentProblem() 
+   {
+       problemCode = "";
+       priority = "";
+   }
+
+   public String getProblemCode() {
+       return problemCode;
+   }
+
+   public void setProblemCode(String problemCode) {
+       this.problemCode = problemCode;
+   }
+
+   public String getPriority() {
+       return priority;
+   }
+
+   public void setPriority(String priority) {
+       this.priority = priority;
+   }
+   
+   /*
+     * Called from the tmc.simulator.cadclient.data.Incident.java. Handles storing data based on script tag.
+     */
+   public void readXMLNode(String tag_name, String value) {
+        if(tag_name.equals(PROBLEM_ENUMS.CODE.tag))
+        {
+            setProblemCode(value);
+        }
+        else if(tag_name.equals(PROBLEM_ENUMS.PRIORITY.tag))
+        {
+            setPriority(value);
+        }
+    }
+   
+   
+}
Index: trunk/src/tmcsim/cadmodels/CADRoutedMessage.java
===================================================================
--- trunk/src/tmcsim/cadmodels/CADRoutedMessage.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/CADRoutedMessage.java	(revision 2)
@@ -0,0 +1,110 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+import java.util.Calendar;
+
+/**
+ * CADRoutedMessage is used to contain information for a routed message
+ * between CAD positions.  Message information includes origin and destination
+ * CAD positions, message date and time, message text, and a flag to specify
+ * that this message is a incident update.
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/06 20:46:40 $ $Revision: 1.4 $
+ */
+@SuppressWarnings("serial")
+public class CADRoutedMessage implements Comparable<CADRoutedMessage>, Serializable {
+
+    /** CAD Position that sent this routed message. */
+    public int fromPosition;
+
+    /** CAD Position tha tthis routed message is being sent to. */
+    public int toPosition;
+
+    /** String representation of the current data in format DDMMYYYY. */
+    public String date;
+
+    /** String representation of the current time in format HH:MM:SS */
+    public String time;
+
+    /** Routed message text. */
+    public String message; 
+    
+    /** Flag to designate whether this is a routed IncidentInquiry page */
+    public boolean incidentUpdate;
+    
+    /**
+     * Constructor.  Initializes source, destination, and message from 
+     * method parameters.  Initializes date and time to current values.
+     *
+     * @param from CAD position message has been sent from.
+     * @param to CAD Position to route the message to
+     * @param newMessage Routed message that has been entered
+     */
+    public CADRoutedMessage(int from, int to, String newMessage, boolean isIncidentUpdate) {
+        fromPosition = from;
+        toPosition   = to;
+        date         = "";
+        time         = "";
+            
+            
+        Calendar rightNow = Calendar.getInstance();
+        
+        /*** BUILD TIME ***/
+        
+        //String currentTime = "";
+        if(rightNow.get(Calendar.HOUR_OF_DAY) < 10)
+            time += "0";
+        
+        time += (String.valueOf(rightNow.get(Calendar.HOUR_OF_DAY))) + ":";
+        
+        if(rightNow.get(Calendar.MINUTE) < 10)
+            time += "0";
+        
+        time += (String.valueOf(rightNow.get(Calendar.MINUTE))) + ":";      
+        
+        
+        if(rightNow.get(Calendar.SECOND) < 10)
+            time += "0";
+        
+        time += (String.valueOf(rightNow.get(Calendar.SECOND)));
+        
+        
+        /*** BUILD DATE ***/
+        
+        if(rightNow.get(Calendar.MONTH) < 10)
+            date += "0";
+        date += String.valueOf(rightNow.get(Calendar.MONTH));
+        
+        if(rightNow.get(Calendar.DAY_OF_MONTH) < 10)
+            date += "0";
+        date += String.valueOf(rightNow.get(Calendar.DAY_OF_MONTH));
+        
+        date += String.valueOf(rightNow.get(Calendar.YEAR));
+        
+        message        = newMessage;
+        incidentUpdate = isIncidentUpdate;
+    }
+
+    
+
+    /**
+     * Overloaded Comparable.compareTo() method to allow this object to be 
+     * added to an order collection.
+     */
+    public int compareTo(CADRoutedMessage o) {
+        return time.compareTo(o.time);
+    }
+    
+    /**
+     * Overloaded equals method, determining equality by checking all data members.
+     */
+    public boolean equals(Object o) {
+        return ((CADRoutedMessage)o).toPosition == toPosition &&
+               ((CADRoutedMessage)o).fromPosition == fromPosition &&
+               ((CADRoutedMessage)o).date.equals(date) &&
+               ((CADRoutedMessage)o).message.equals(message);
+         
+    }
+    
+}
Index: trunk/src/tmcsim/cadmodels/IncidentInquiryUnitsAssigned.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentInquiryUnitsAssigned.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentInquiryUnitsAssigned.java	(revision 2)
@@ -0,0 +1,138 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * IncidentInquiryUnitsAssigned extends from IncidentInquiryLogEntry
+ * to provide a model object containing information used to display an assigned
+ * unit.  Data for an assigned unit includes a flag designating whether
+ * the unit is primary, the beat number, the unit's status, and a flag 
+ * designating whether the unit is active or not.<br/>
+ * <br/>
+ * This element parses and creates the following XML schema in its toXML() and
+ * fromXML() methods.  The ROOT element is the parameter for those methods.<br/>
+ * <ROOT><br/>
+ *    <IS_PRIMARY/><br/>
+ *    <BEAT>/<br/>
+ *    <STATUS_TYPE/><br/>
+ *    <IS_ACTIVE/><br/>
+ *    <POSITION_INFO/><br/>
+ *    <TIMESTAMP/><br/>
+ * </ROOT><br/>
+ * 
+ * @author Matthew Cechini
+ * @version 
+ */
+@SuppressWarnings("serial")
+public class IncidentInquiryUnitsAssigned extends IncidentInquiryLogEntry 
+    implements Serializable {
+    
+    private static enum XML_TAGS {
+        /** Unit's primary flag. */
+        IS_PRIMARY  ("IS_PRIMARY"),     
+        /** Unit's beat. */
+        BEAT        ("BEAT"),
+        /** Unit's status type. */
+        STATUS_TYPE ("STATUS_TYPE"),
+        /** Unit's active flag. */
+        IS_ACTIVE   ("IS_ACTIVE");
+        
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }
+        
+    }
+
+    /** Unit is primary flag. */
+    public boolean isPrimary;   
+
+    /** Unit's beat. */
+    public String  beat;    
+ 
+    /** Unit's current status. */
+    public String  statusType;  
+
+    /** Unit's current active flag. */
+    public boolean isActive;
+    
+    
+    /** 
+     * Constructor.  Initialize all unit data to empty strings or false.
+     * 
+     *  @param newPosInfo String containing position info for this log entry
+     */
+    public IncidentInquiryUnitsAssigned(String newPosInfo) {
+        super(newPosInfo, "0000");
+        
+        isPrimary  = false;
+        beat       = "";
+        statusType = "";
+        isActive   = false;     
+    }
+  
+    /**
+     * Constructor.  Parse parameter node for Unit log entry data.
+     * 
+     * @param theNode Node containing data for this Unit log entry
+     */
+    public IncidentInquiryUnitsAssigned(Node theNode) { 
+        fromXML(theNode);
+    }   
+
+    public void toXML(Element currElem) {
+        
+        Document theDoc    = currElem.getOwnerDocument();
+        Element  tempElem  = null;
+        
+        tempElem = theDoc.createElement(XML_TAGS.IS_PRIMARY.tag);
+        tempElem.appendChild(theDoc.createTextNode(String.valueOf(isPrimary)));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.BEAT.tag);
+        tempElem.appendChild(theDoc.createTextNode(beat));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.STATUS_TYPE.tag);
+        tempElem.appendChild(theDoc.createTextNode(statusType));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.IS_ACTIVE.tag);
+        tempElem.appendChild(theDoc.createTextNode(String.valueOf(isActive)));
+        currElem.appendChild(tempElem);
+
+        super.toXML(currElem);
+    }    
+    
+    public void fromXML(Node modelNode) {   
+        
+        Node childNode = null;
+        
+        childNode = modelNode.getFirstChild();
+        isPrimary = Boolean.parseBoolean(childNode.getTextContent());
+        
+        childNode = childNode.getNextSibling();
+        beat = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        statusType = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        isActive = Boolean.parseBoolean(childNode.getTextContent());
+
+        childNode = childNode.getNextSibling();
+        super.fromXML(childNode);
+        
+    }     
+    
+    
+    /** Determines equality based on beat */
+    public boolean equals(Object o) {
+        return beat.equals(((IncidentInquiryUnitsAssigned)o).beat);
+    }
+}
Index: trunk/src/tmcsim/cadmodels/IncidentCaller.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentCaller.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentCaller.java	(revision 2)
@@ -0,0 +1,100 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+/**
+ * This class is a further subdivision of Incident to hold data.
+ * @author Vincent
+ *
+ */
+public class IncidentCaller implements Serializable
+{
+    private String callerType;
+    private String callerName;
+    private String phone;
+    private String ext;
+    
+    private static enum CALLER_ENUMS
+    {
+        TYPE   ("TYPE"), 
+        NAME   ("NAME"),
+        PHONE  ("PHONE"),
+        EXT    ("EXT");
+        
+        public String tag;
+        
+        private CALLER_ENUMS(String t)
+        {
+            tag = t;
+        }
+    }
+    
+    /*
+     * Constructor. Initializes all objects to avoid null pointers.
+     */
+    public IncidentCaller(String type, String name)
+    {
+        setCallerType(type);
+        setCallerName(name);
+    }
+    
+    public IncidentCaller()
+    {
+        callerType = "";
+        callerName = "";
+    }
+
+    public String getCallerType() {
+        return callerType;
+    }
+
+    public void setCallerType(String callerType) {
+        this.callerType = callerType;
+    }
+
+    public String getCallerName() {
+        return callerName;
+    }
+
+    public void setCallerName(String callerName) {
+        this.callerName = callerName;
+    }
+    
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+    
+    public String getExt() {
+        return ext;
+    }
+
+    public void setExt(String ext) {
+        this.ext = ext;
+    }
+    
+    /*
+     * Called from the tmc.simulator.cadclient.data.Incident.java. Handles storing data based on script tag.
+     */
+    public void readXMLNode(String tag_name, String value) {
+        if(tag_name.equals(CALLER_ENUMS.TYPE.tag))
+        {
+            setCallerType(value);
+        }
+        else if(tag_name.equals(CALLER_ENUMS.NAME.tag))
+        {
+            setCallerName(value);
+        }
+        else if(tag_name.equals(CALLER_ENUMS.PHONE.tag))
+        {
+            setCallerName(value);
+        }
+        else if(tag_name.equals(CALLER_ENUMS.EXT.tag))
+        {
+            setCallerName(value);
+        }
+    }
+}
Index: trunk/src/tmcsim/cadmodels/IncidentActivities.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentActivities.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentActivities.java	(revision 2)
@@ -0,0 +1,111 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+/**
+ * This class is a further subdivision of Incident to hold data.
+ * @author Vincent
+ *
+ */
+public class IncidentActivities implements Serializable
+{
+    private String vehicle;
+    private String activity;
+    private String location;
+    private String comment;
+    private String disp;
+    
+    private static enum ACTIVITIES_ENUMS
+    {
+        VEHICLE     ("VEHICLE"),
+        ACTIVITY   ("ACTIVITY"),
+        LOCATION   ("LOCATION"), 
+        COMMENT   ("COMMENT"),
+        DISP      ("DISP");
+        
+        public String tag;
+        
+        private ACTIVITIES_ENUMS(String t)
+        {
+            tag = t;
+        }
+    }
+    
+    /*
+     * Constructor. Initializes all objects to avoid null pointers.
+     */
+    public IncidentActivities(){
+        vehicle = "";
+        activity = "";
+        location = "";
+        comment = "";
+        disp = "";
+    }
+    
+    public String getVehicle() {
+        return vehicle;
+    }
+    
+    public void setVehicle(String vehicle) {
+        this.vehicle = vehicle;
+    }
+
+    public String getActivity() {
+        return activity;
+    }
+
+    public void setActivity(String activity) {
+        this.activity = activity;
+    }
+
+    public String getLocation() {
+        return location;
+    }
+
+    public void setLocation(String location) {
+        this.location = location;
+    }
+
+    public String getComment() {
+        return comment;
+    }
+
+    public void setComment(String comment) {
+        this.comment = comment;
+    }
+
+    public String getDisp() {
+        return disp;
+    }
+
+    public void setDisp(String disp) {
+        this.disp = disp;
+    }
+    
+    /*
+     * Called from the tmc.simulator.cadclient.data.Incident.java. Handles storing data based on script tag.
+     */
+    public void readXMLNode(String tag_name, String value) {
+        if(tag_name.equals(ACTIVITIES_ENUMS.VEHICLE.tag))
+        {
+            setVehicle(value);
+        }
+        else if(tag_name.equals(ACTIVITIES_ENUMS.ACTIVITY.tag))
+        {
+            setActivity(value);
+        }
+        else if(tag_name.equals(ACTIVITIES_ENUMS.LOCATION.tag))
+        {
+            setLocation(value);
+        }
+        else if(tag_name.equals(ACTIVITIES_ENUMS.COMMENT.tag))
+        {
+            setComment(value);
+        }
+        else if(tag_name.equals(ACTIVITIES_ENUMS.DISP.tag))
+        {
+            setDisp(value);
+        }
+    }
+    
+}
Index: trunk/src/tmcsim/cadmodels/IncidentInquiryServices.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentInquiryServices.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentInquiryServices.java	(revision 2)
@@ -0,0 +1,119 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+/**
+ * IncidentInquiryServices extends from IncidentInquiryLogEntry
+ * to provide a model object containing information used to display a service
+ * unit assigned.  Data for a service includes the service's name and 
+ * the confidential and public phone numbers.<br/>
+ * <br/>
+ * This element parses and creates the following XML schema in its toXML() and
+ * fromXML() methods.  The ROOT element is the parameter for those methods.<br/>
+ * <ROOT><br/>
+ *    <SERVICE/><br/>
+ *    <CONF_PHONE_NUM/>/<br/>
+ *    <PUB_PHONE_NUM/><br/>
+ *    <POSITION_INFO/><br/>
+ *    <TIMESTAMP/><br/>
+ * </ROOT><br/>
+ * 
+ * @author Matthew Cechini
+ * @version 
+ */
+@SuppressWarnings("serial")
+public class IncidentInquiryServices extends IncidentInquiryLogEntry 
+    implements Serializable {
+    
+    /**
+     * Enumeration with XML tag names.
+     * @author Matthew Cechini
+     */
+    private static enum XML_TAGS {
+        /** Service's name. */
+        SERVICE        ("SERVICE"),
+        /** Service's confidential phone number. */
+        CONF_PHONE_NUM ("CONF_PHONE_NUM"),
+        /** Service's public phone number. */
+        PUB_PHONE_NUM  ("PUB_PHONE_NUM");
+        
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }
+    }
+
+    /** Service's name. */
+    public String serviceName;  
+    
+    /** Service's confidential phone number. */
+    public String confPhoneNum; 
+    
+    /** Service's public phone number. */
+    public String publicPhoneNum;   
+    
+    /** 
+     * Constructor.  Initialize all Service data to empty strings.
+     * 
+     *  @param newPosInfo String containing position info for this log entry
+     */
+    public IncidentInquiryServices(String newPosInfo) {
+        super(newPosInfo, "0000");
+
+        serviceName    = "";
+        confPhoneNum   = "";
+        publicPhoneNum = "";    
+    }
+    
+    /**
+     * Constructor.  Parse parameter node for Service log entry data.
+     * 
+     * @param theNode Node containing data for this Service log entry
+     */
+    public IncidentInquiryServices(Node theNode) {  
+        fromXML(theNode);
+    }
+    
+    public void toXML(Element currElem) {
+        
+        Document theDoc    = currElem.getOwnerDocument();
+        Element  tempElem  = null;
+        
+        tempElem = theDoc.createElement(XML_TAGS.SERVICE.tag);
+        tempElem.appendChild(theDoc.createTextNode(serviceName));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.CONF_PHONE_NUM.tag);
+        tempElem.appendChild(theDoc.createTextNode(confPhoneNum));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.PUB_PHONE_NUM.tag);
+        tempElem.appendChild(theDoc.createTextNode(publicPhoneNum));
+        currElem.appendChild(tempElem);
+
+        super.toXML(currElem);
+    }    
+    
+    public void fromXML(Node modelNode) {   
+        
+        Node childNode = null;
+        
+        childNode = modelNode.getFirstChild();
+        serviceName = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        confPhoneNum = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        publicPhoneNum = childNode.getTextContent();
+
+        childNode = childNode.getNextSibling();
+        super.fromXML(childNode);
+    }    
+}
Index: trunk/src/tmcsim/cadmodels/IncidentSummaryModel_obj.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentSummaryModel_obj.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentSummaryModel_obj.java	(revision 2)
@@ -0,0 +1,223 @@
+package tmcsim.cadmodels;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import tmcsim.common.ScriptException;
+
+/*
+ * The model object containing data for an entry in the IncidentSummary CAD Screen.
+ * 
+ * @author
+ * @version
+ */
+public class IncidentSummaryModel_obj {
+            
+    private static enum XML_TAGS {
+        /** Log number. */
+        LOG_NUMBER    ("LOG_NUMBER"),
+        /** Log status. */
+        LOG_STATUS    ("LOG_STATUS"),
+        /** Log creation date. */
+        DATE          ("DATE"),
+        /** Log creation time. */
+        TIME          ("TIME"),
+        /** Log priority. */
+        PRIORITY      ("PRIORITY"),
+        /** Log type. */
+        TYPE          ("TYPE"),
+        /** Log beat area. */
+        BEAT_AREA     ("BEAT_AREA"),
+        /** Log location. */
+        LOCATION      ("LOCATION"),
+        /** Log beat assigned. */
+        BEAT_ASSIGNED ("BEAT_ASSIGNED");
+
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }       
+    }
+    
+    /** Unique log number */
+    public Integer logNumber; 
+    
+    /** Log status */
+    public String logStatus;       
+    
+    /** Log creation date */
+    public String date;
+    
+    /** Log creation time */
+    public String time;
+    
+    /** Log priority */
+    public String priority;
+    
+    /** Log type */
+    public String callType;
+    
+    /** Log beat area */
+    public String beatArea;
+    
+    /** Log location */
+    public String location;
+    
+    /** log beat assigned */
+    public String beatAssigned;
+    
+        
+    /**
+     * Constructor.  Initialize all model data to empty strings.
+     */
+    public IncidentSummaryModel_obj() {
+        logNumber    = new Integer(0);
+        logStatus    = "";
+        date         = "";
+        time         = "";
+        priority     = "";  
+        callType     = "";
+        beatArea     = "";
+        location     = "";
+        beatAssigned = "";
+    }
+    
+    /**
+     * Constructor.  Initialize all model data to parameter data.
+     * 
+     * @param newLogNumber     Incident log number
+     * @param newLogStatus     Incident log status
+     * @param newDate          Incident creation date
+     * @param newTime          Incident create time
+     * @param newPriority      Incident priority
+     * @param newCallType      Incident type
+     * @param newBeatArea      Incident beat area
+     * @param newLocation      Incident location
+     * @param newBeatAssigned  Incident beat assigned
+     */    
+    public IncidentSummaryModel_obj(Integer newLogNumber,
+                                    String newLogStatus,
+                                    String newDate,
+                                    String newTime,
+                                    String newPriority,
+                                    String newCallType,
+                                    String newBeatArea,
+                                    String newLocation,
+                                    String newBeatAssigned) {
+        logNumber    = newLogNumber;
+        logStatus    = newLogStatus;
+        date         = newDate;
+        time         = newTime;
+        priority     = newPriority; 
+        callType     = newCallType;
+        beatArea     = newBeatArea;
+        location     = newLocation;
+        beatAssigned = newBeatAssigned;
+    }
+    
+    /**
+     * Constructor.  Initialize all model data with IncidentInquiryHeader.
+     * 
+     * @param newIncident IncidentInquiryHeader object containing data for
+     *                    IncidentSummery model.
+     */
+    public IncidentSummaryModel_obj(IncidentInquiryHeader newIncident) {
+        logNumber    = newIncident.logNumber;  
+        logStatus    = newIncident.logStatus;   
+        date         = newIncident.incidentDate;
+        time         = newIncident.incidentTime;
+        priority     = newIncident.priority;
+        callType     = newIncident.type;
+        beatArea     = newIncident.beat;
+        location     = newIncident.fullLocation;
+        beatAssigned = newIncident.beat; 
+    }
+    
+    /**
+     * Constructor.  Initialize all model data to data in parameter Node.
+     * 
+     * @param theNode Node containing data for IncidentSummary model.
+     */
+    public IncidentSummaryModel_obj(Node theNode) throws ScriptException {  
+        
+        fromXML(theNode);           
+        
+    }
+    
+    public void toXML(Element currElem) {
+        
+        Document theDoc    = currElem.getOwnerDocument();
+        Element  tempElem  = null;
+        
+        currElem.setAttribute(XML_TAGS.LOG_NUMBER.tag, logNumber.toString());
+        
+        tempElem = theDoc.createElement(XML_TAGS.LOG_STATUS.tag);
+        tempElem.appendChild(theDoc.createTextNode(logStatus));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.DATE.tag);
+        tempElem.appendChild(theDoc.createTextNode(date));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.TIME.tag);
+        tempElem.appendChild(theDoc.createTextNode(time));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.PRIORITY.tag);
+        tempElem.appendChild(theDoc.createTextNode(priority));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.TYPE.tag);
+        tempElem.appendChild(theDoc.createTextNode(callType));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.BEAT_AREA.tag);
+        tempElem.appendChild(theDoc.createTextNode(beatArea));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.LOCATION.tag);
+        tempElem.appendChild(theDoc.createTextNode(location));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.BEAT_ASSIGNED.tag);
+        tempElem.appendChild(theDoc.createTextNode(beatAssigned));
+        currElem.appendChild(tempElem);
+    
+    }
+    
+
+    public void fromXML(Node modelNode) throws ScriptException {   
+
+        Node childNode = null;
+        
+        logNumber = Integer.parseInt(modelNode.getAttributes().getNamedItem(
+                XML_TAGS.LOG_NUMBER.tag).getNodeValue());
+        
+        childNode = modelNode.getFirstChild();
+        logStatus = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        date = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        time = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        priority = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        callType = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        beatArea = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        location = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        beatAssigned = childNode.getTextContent();      
+        
+    }
+}
Index: trunk/src/tmcsim/cadmodels/IncidentTransportInfo.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentTransportInfo.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentTransportInfo.java	(revision 2)
@@ -0,0 +1,95 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+/**
+ * This class is a further subdivision of Incident to hold data.
+ * @author Vincent
+ *
+ */
+public class IncidentTransportInfo implements Serializable
+{
+    private String name;
+    private String toCity;
+    private String toLocation;
+    private String toState;
+    
+    private static enum TRANSPORT_INFO_ENUMS
+    {
+        NAME     ("NAME"),
+        TO_CITY   ("TO_CITY"),
+        TO_LOCATION   ("TO_LOCATION"), 
+        TO_STATE     ("TO_STATE");
+        
+        public String tag;
+        
+        private TRANSPORT_INFO_ENUMS(String t)
+        {
+            tag = t;
+        }
+    }
+    
+    /*
+     * Constructor. Initializes all objects to avoid null pointers.
+     */
+    public IncidentTransportInfo(){
+        name = "";
+        toCity = "";
+        toLocation = "";
+        toState = "";
+    }
+    
+    public String getName() {
+        return name;
+    }
+    
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getToCity() {
+        return toCity;
+    }
+
+    public void setToCity(String toCity) {
+        this.toCity = toCity;
+    }
+
+    public String getToLocation() {
+        return toLocation;
+    }
+
+    public void setToLocation(String toLocation) {
+        this.toLocation = toLocation;
+    }
+
+    public String getToState() {
+        return toState;
+    }
+
+    public void setToState(String toState) {
+        this.toState = toState;
+    }
+    
+    /*
+     * Called from the tmc.simulator.cadclient.data.Incident.java. Handles storing data based on script tag.
+     */
+    public void readXMLNode(String tag_name, String value) {
+        if(tag_name.equals(TRANSPORT_INFO_ENUMS.NAME.tag))
+        {
+            setName(value);
+        }
+        else if(tag_name.equals(TRANSPORT_INFO_ENUMS.TO_CITY.tag))
+        {
+            setToCity(value);
+        }
+        else if(tag_name.equals(TRANSPORT_INFO_ENUMS.TO_LOCATION.tag))
+        {
+            setToLocation(value);
+        }
+        else if(tag_name.equals(TRANSPORT_INFO_ENUMS.TO_STATE.tag))
+        {
+            setToState(value);
+        }
+    }
+}
Index: trunk/src/tmcsim/cadmodels/IncidentInquiryHeader.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentInquiryHeader.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentInquiryHeader.java	(revision 2)
@@ -0,0 +1,309 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+/**
+ * IncidentInquiryHeader contains model data containing information used to 
+ * display the CAD log Header inofrmation.  Data for the header includes the
+ * following Incident data:
+ * <ul>
+ * <li>Log number</li>
+ * <li>Log status</li>
+ * <li>Priority</li>
+ * <li>Type</li>
+ * <li>Callbox Number</li>
+ * <li>Beat</li>
+ * <li>Full Location</li>
+ * <li>Truncated Location</li>
+ * <li>Origin</li>
+ * <li>Date</li>
+ * <li>Time</li>
+ * <li>Dispatcher</li>
+ * <ul>
+ * <br/>
+ * This element parses and creates the following XML schema in its toXML() and
+ * fromXML() methods.  The ROOT element is the parameter for those methods.  
+ * See the class description for the CADScreenModel and 
+ * IncidentSummaryModel_obj Objects for their XML schema.<br/>
+ * <ROOT>
+ *    <LOG_NUMBER/>
+ *    <LOG_STATUS/>
+ *    <PRIORITY/>
+ *    <TYPE/>
+ *    <CALLBOX_NUM/>
+ *    <BEAT/>
+ *    <FULL_LOC/>
+ *    <TRUNC_LOC/>
+ *    <ORIGIN/>
+ *    <INCIDENT_DATE/>
+ *    <INCIDENT_TIME/>
+ *    <DISPATCHER/>
+ * </ROOT>
+ * 
+ * @see IncidentSummaryModel_obj
+ * @see CADScreenModel
+ * @author Matthew Cechini
+ * @version
+ */
+@SuppressWarnings("serial")
+public class IncidentInquiryHeader implements Serializable {
+    
+    /**
+     * Enumeration with XML tag names.
+     * @author Matthew Cechini
+     */
+    private static enum XML_TAGS {
+        /** Incident log number. */ 
+        LOG_NUMBER    ("LOG_NUMBER"),
+        /** Incident log status. */ 
+        LOG_STATUS    ("LOG_STATUS"),
+        /** Incident priority. */   
+        PRIORITY      ("PRIORITY"),
+        /** Incident type. */   
+        TYPE          ("TYPE"),
+        /** Call box number. */ 
+        CALLBOX_NUM   ("CALLBOX_NUM"),
+        /** Incident beat. */   
+        BEAT          ("BEAT"),
+        /** Incident full location. */  
+        FULL_LOC      ("FULL_LOC"),
+        /** Incident truncated location. */ 
+        TRUNC_LOC     ("TRUNC_LOC"),
+        /** Log origin. */  
+        ORIGIN        ("ORIGIN"),
+        /** Incident date. */   
+        INCIDENT_DATE ("INCIDENT_DATE"),
+        /** Incident time. */   
+        INCIDENT_TIME ("INCIDENT_TIME"),
+        /** Assigned dispatcher. */ 
+        DISPATCHER    ("DISPATCHER");
+        
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }       
+    }
+
+    /** Incident log number.  */
+    public Integer logNumber;
+    
+    /** Incident log status.  */
+    public String logStatus;
+    
+    /** Incident log priority.  */
+    public String priority;
+    
+    /** Incident log type.  */
+    public String type;
+    
+    /** Call Box number. */
+    public String callBoxNumber;
+    
+    /** Incident beat. */
+    public String beat;
+    
+    /** Incident full location. */
+    public String fullLocation;
+    
+    /** Incident truncated location.  */
+    public String truncLocation;
+    
+    /** 
+     *  Incident log origin. Format: XXAYYYYY.  
+     *  XX = log position.  YYYYY = CAD user id.
+     */
+    public String origin;
+    
+    /** Incident log creation date. Format: MMDD */
+    public String incidentDate;
+    
+    /** Incident log create time. Format: HHMM */
+    public String incidentTime;
+    
+    /** 
+     *Incident log dispatcher.  Format: XXAYYYYY.  
+     *  XX = log position.  YYYYY = CAD user id.
+     */
+    public String dispatcher;
+    
+    /** Constructor.  Initialize all class variables to 0 or empty string. */
+    public IncidentInquiryHeader() {
+        logNumber     = new Integer(0);
+        logStatus     = "";
+        priority      = "";
+        type          = "";
+        callBoxNumber = "";
+        beat          = "";
+        fullLocation  = "";
+        truncLocation = "";
+        origin        = "";
+        incidentDate  = "";
+        incidentTime  = "";        
+        dispatcher    = "";     
+        
+    }    
+    
+    /**
+     * Copy constructor.
+     *
+     * @param newIIH Object containing header information used to initialize
+     *               the new instance.
+     */
+    public IncidentInquiryHeader(IncidentInquiryHeader newIIH) {
+        logNumber     = new Integer(newIIH.logNumber);
+        logStatus     = new String(newIIH.logStatus);
+        priority      = new String(newIIH.priority);
+        type          = new String(newIIH.type);
+        callBoxNumber = new String(newIIH.callBoxNumber);
+        beat          = new String(newIIH.beat);
+        fullLocation  = new String(newIIH.fullLocation);
+        truncLocation = new String(newIIH.truncLocation);
+        origin        = new String(newIIH.origin);
+        incidentDate  = new String(newIIH.incidentDate);
+        incidentTime  = new String(newIIH.incidentTime);
+        dispatcher    = new String(newIIH.dispatcher);
+    }    
+    
+    /**
+     * Parse the paramater node ad assign all member data values.
+     *
+     * @param theNode Node containing XML data to parse header information from.
+     */
+    public IncidentInquiryHeader(Node theNode) {    
+        fromXML(theNode);
+    }
+    
+    
+    /**
+     * Updates the local member data with any member data in the parameter
+     * Header object that is not 0 or an empty string.
+     *
+     * TODO look at his method
+     * @param newHeader Object containing header information for update.
+     */
+    public void update(IncidentInquiryHeader newHeader) {
+        
+        if(newHeader.logNumber != 0) 
+            logNumber     = new Integer(newHeader.logNumber);
+        if(newHeader.logStatus.trim().length() > 0) 
+            logStatus     = new String(newHeader.logStatus);
+        if(newHeader.priority.trim().length() > 0) 
+            priority      = new String(newHeader.priority);     
+        if(newHeader.type.trim().length() > 0) 
+            type          = new String(newHeader.type);
+        if(newHeader.beat.trim().length() > 0) 
+            beat          = new String(newHeader.beat);
+        if(newHeader.fullLocation.trim().length() > 0) 
+            fullLocation  = new String(newHeader.fullLocation);
+        if(newHeader.truncLocation.trim().length() > 0) 
+            truncLocation = new String(newHeader.truncLocation);
+        if(newHeader.incidentDate.trim().length() > 0) 
+            incidentDate  = new String(newHeader.incidentDate);             
+        if(newHeader.incidentTime.trim().length() > 0) 
+            incidentTime  = new String(newHeader.incidentTime);         
+    
+    }    
+    
+    
+    public void toXML(Element currElem) {
+        
+        Document theDoc    = currElem.getOwnerDocument();
+        Element  tempElem  = null;
+        
+        tempElem = theDoc.createElement(XML_TAGS.LOG_NUMBER.tag);
+        tempElem.appendChild(theDoc.createTextNode(logNumber.toString()));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.LOG_STATUS.tag);
+        tempElem.appendChild(theDoc.createTextNode(logStatus));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.PRIORITY.tag);
+        tempElem.appendChild(theDoc.createTextNode(priority));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.TYPE.tag);
+        tempElem.appendChild(theDoc.createTextNode(type));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.CALLBOX_NUM.tag);
+        tempElem.appendChild(theDoc.createTextNode(callBoxNumber));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.BEAT.tag);
+        tempElem.appendChild(theDoc.createTextNode(beat));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.FULL_LOC.tag);
+        tempElem.appendChild(theDoc.createTextNode(fullLocation));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.TRUNC_LOC.tag);
+        tempElem.appendChild(theDoc.createTextNode(truncLocation));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.ORIGIN.tag);
+        tempElem.appendChild(theDoc.createTextNode(origin));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.INCIDENT_DATE.tag);
+        tempElem.appendChild(theDoc.createTextNode(incidentDate));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.INCIDENT_TIME.tag);
+        tempElem.appendChild(theDoc.createTextNode(incidentTime));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.DISPATCHER.tag);
+        tempElem.appendChild(theDoc.createTextNode(dispatcher));
+        currElem.appendChild(tempElem);
+    }    
+    
+    public void fromXML(Node modelNode) {   
+        
+        Node childNode = null;
+        
+        childNode = modelNode.getFirstChild();
+        logNumber = Integer.parseInt(childNode.getTextContent());
+        
+        childNode = childNode.getNextSibling();
+        logStatus = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        priority = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        type = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        callBoxNumber = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        beat = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        fullLocation = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        truncLocation = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        origin = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        incidentDate = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        incidentTime = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        dispatcher = childNode.getTextContent();
+            
+    }      
+}
Index: trunk/src/tmcsim/cadmodels/IncidentInquiryTows.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentInquiryTows.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentInquiryTows.java	(revision 2)
@@ -0,0 +1,147 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * IncidentInquiryTows extends from IncidentInquiryLogEntry to provide a model 
+ * object containing information used to display an assigned tow unit.
+ * Data for a tow includes the Tow Company's name, the confidential and public 
+ * phone numbers, assigned beat, and current status.<br/>
+ * <br/>
+ * This element parses and creates the following XML schema in its toXML() and
+ * fromXML() methods.  The ROOT element is the parameter for those methods.<br/>
+ * <ROOT><br/>
+ *    <COMPANY/><br/>
+ *    <CONF_PHONE_NUM/>/<br/>
+ *    <PUB_PHONE_NUM/><br/>
+ *    <BEAT/><br/>
+ *    <STATUS/><br/>
+ *    <POSITION_INFO/><br/>
+ *    <TIMESTAMP/><br/>
+ * </ROOT><br/>
+ * 
+ * @author Matthew Cechini
+ * @version 
+ */
+@SuppressWarnings("serial")
+public class IncidentInquiryTows extends IncidentInquiryLogEntry 
+    implements Serializable {
+    
+    /**
+     * Enumeration with XML tag names.
+     * @author Matthew Cechini
+     */
+    private static enum XML_TAGS {  
+        /** Tow company's name. */
+        COMPANY        ("COMPANY"),
+        /** Tow company's confidential phone number. */
+        CONF_PHONE_NUM ("CONF_PHONE_NUM"),      
+        /** Tow company's public phone number. */
+        PUB_PHONE_NUM  ("PUB_PHONE_NUM"),       
+        /** Tow vehicle's assigned beat. */
+        BEAT           ("BEAT"),    
+        /** Tow vehicle's status. */
+        STATUS         ("STATUS");
+        
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }
+    }
+    
+    /** Tow's company name */
+    public String towCompany;
+    
+    /** Tow's confidential phone number */
+    public String confPhoneNum;
+    
+    /** Tow's public phone number */
+    public String publicPhoneNum;
+    
+    /** Tow's assigned beat */
+    public String beat;
+    
+    /** Tow's status */
+    public String statusInfo;
+        
+    /** 
+     * Constructor.  Initialize all Tow data to empty strings.
+     * 
+     *  @param newPosInfo String containing position info for this log entry
+     */
+    public IncidentInquiryTows(String newPosInfo) {
+        super(newPosInfo, "0000");
+        
+        towCompany     = "";
+        confPhoneNum   = "";
+        publicPhoneNum = "";
+        beat           = "";
+        statusInfo     = "";        
+    }
+    
+    /**
+     * Constructor.  Parse parameter node for Tow log entry data.
+     * 
+     * @param theNode Node containing data for this Tow log entry
+     */
+    public IncidentInquiryTows(Node theNode) {  
+        fromXML(theNode);
+    }
+    
+    public void toXML(Element currElem) {
+        
+        Document theDoc    = currElem.getOwnerDocument();
+        Element  tempElem  = null;
+        
+        tempElem = theDoc.createElement(XML_TAGS.COMPANY.tag);
+        tempElem.appendChild(theDoc.createTextNode(towCompany));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.CONF_PHONE_NUM.tag);
+        tempElem.appendChild(theDoc.createTextNode(confPhoneNum));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.PUB_PHONE_NUM.tag);
+        tempElem.appendChild(theDoc.createTextNode(publicPhoneNum));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.BEAT.tag);
+        tempElem.appendChild(theDoc.createTextNode(beat));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.STATUS.tag);
+        tempElem.appendChild(theDoc.createTextNode(statusInfo));
+        currElem.appendChild(tempElem);
+
+        super.toXML(currElem);
+    }    
+    
+    public void fromXML(Node modelNode) {   
+        
+        Node childNode = null;
+        
+        childNode = modelNode.getFirstChild();
+        towCompany      = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        confPhoneNum = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        publicPhoneNum = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        beat = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        statusInfo = childNode.getTextContent();
+
+        childNode = childNode.getNextSibling();
+        super.fromXML(childNode);
+        
+    }  
+}
Index: trunk/src/tmcsim/cadmodels/IncidentSummaryModel.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentSummaryModel.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentSummaryModel.java	(revision 2)
@@ -0,0 +1,150 @@
+package tmcsim.cadmodels;
+
+import java.util.Vector;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import tmcsim.common.ScriptException;
+import tmcsim.common.CADEnums.CADScreenNum;
+import tmcsim.common.CADEnums.CADScreenType;
+import tmcsim.common.CADProtocol.CAD_COMMANDS;
+
+/**
+ * IncidentSummaryModel is a CADScreenModel object containing data that is 
+ * displayed in the IncidentSummary CAD Screen.  The addModelObject() method 
+ * is used to update the model data with new information.<br/>
+ * <br/>
+ * This element parses and creates the following XML schema in its toXML() and
+ * fromXML() methods.  The ROOT element is the parameter for those methods.  
+ * See the class description for the CADScreenModel and 
+ * IncidentSummaryModel_obj Objects for their XML schema.<br/>
+ * <ROOT>
+ *    <INCIDENT_SUMMARY>
+ *       <BASE_MODEL_INFO/>
+ *       <INCIDENT/>
+ *       ...
+ *       <INCIDENT/>
+ *    </INCIDENT_SUMMARY>
+ * </ROOT>
+ * 
+ * @see IncidentSummaryModel_obj
+ * @see CADScreenModel
+ * @author Matthew Cechini
+ * @version
+ */
+public class IncidentSummaryModel extends CADScreenModel {
+    
+    /**
+     * Enumeration with XML tag names.
+     * @author Matthew Cechini
+     */
+    private static enum XML_TAGS {  
+        /** Incident information. */
+        INCIDENT  ("INCIDENT");
+
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }
+    }
+    
+    /** String containing an string of areas, used in the CAD Client IncidentSummary screen. */
+    public static final String areas            = "3  5  9  14  18  29  51 "; //do we read this in?    
+    
+    /** Model data. List of IncidentsSummaryModel_obj objects. */
+    private Vector<IncidentSummaryModel_obj> incidentsList;    
+    
+    /**
+     * Constructor.
+     *
+     * @param num CADScreenNum for this model.
+     */
+    public IncidentSummaryModel(CADScreenNum num) {
+        super(CADScreenType.SA_INCIDENT_SUMMARY, num);
+
+        incidentsList = new Vector<IncidentSummaryModel_obj>(); 
+    }
+        
+    /**
+     * Constructor.  Create model data from parsed parameter XML node.
+     *
+     * @param newNode XML node containing model data.
+     * @throws ScriptException if there is an error in parsing the Node.
+     */
+    public IncidentSummaryModel(Node newNode) throws ScriptException {
+        super(CADScreenType.SA_INCIDENT_SUMMARY, CADScreenNum.ONE);
+        
+        incidentsList = new Vector<IncidentSummaryModel_obj>(); 
+        
+        fromXML(newNode);   
+    }
+
+
+
+    /**
+     * Add a new model object to the list of incidents.
+     *
+     * @param ismo IncidentSummaryModel_obj
+     * @throws ClassCastException if the parameter is not an 
+     *         IncidentSummaryModel_obj object.
+     */
+    public void addModelObject(Object ismo) throws ClassCastException {
+        
+        if(ismo instanceof IncidentSummaryModel_obj) {
+            incidentsList.add((IncidentSummaryModel_obj)ismo);
+        }
+        else {
+            throw new ClassCastException();
+        }       
+    } 
+    
+    /**
+     * Get the list of incidents in this model.
+     *
+     * @return Vector of IncidentSummaryModel_obj objects.
+     */
+    public Vector<IncidentSummaryModel_obj> getModelObjects() {
+        return incidentsList;   
+    }
+    
+    public void toXML(Element currElem) {
+                        
+        Document theDoc = currElem.getOwnerDocument();
+                
+        Element modelElem = theDoc.createElement(CAD_COMMANDS.INCIDENT_SUMMARY.fullName);
+        
+        baseToXML(modelElem);       
+                
+        Element ismoElem             = null;
+        for(IncidentSummaryModel_obj ismo : incidentsList) {
+            ismoElem = theDoc.createElement(XML_TAGS.INCIDENT.tag);
+
+            ismo.toXML(ismoElem);
+            
+            modelElem.appendChild(ismoElem);
+        }
+        
+        currElem.appendChild(modelElem);        
+    }
+   
+    public void fromXML(Node modelNode) throws ScriptException {    
+        
+        incidentsList.clear();
+        
+        modelNode = modelNode.getFirstChild();
+        
+        baseFromXML(modelNode);
+        
+        modelNode = modelNode.getNextSibling();
+        
+        while(modelNode != null) {      
+            incidentsList.add(new IncidentSummaryModel_obj(modelNode));
+            
+            modelNode = modelNode.getNextSibling();
+        }
+    }
+
+}
Index: trunk/src/tmcsim/cadmodels/Incident.java
===================================================================
--- trunk/src/tmcsim/cadmodels/Incident.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/Incident.java	(revision 2)
@@ -0,0 +1,231 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+import java.util.TreeMap;
+import java.util.Vector;
+
+import tmcsim.cadmodels.IncidentEvent.EVENT_STATUS;
+import tmcsim.common.ParamicsLocation;
+
+/**
+ * Incident is the container class used to information relating to a 
+ * simulation incident.  An incident is identified by a unique integer log 
+ * number. Additional descriptive information includes a short description, 
+ * an IncidentInquiryHeader containing CAD related data, and a Map of
+ * IncidentLocations used for XMLIncident location referencing.  This object holds 
+ * counters to keep track of the simulation time when the incident is scheduled 
+ * to occur and to retain the time when it is does occur.  The Incident object 
+ * has a list of IncidentEvents that will occur during the simulation.  
+ * 
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/06 20:46:40 $ $Revision: 1.4 $
+ */
+@SuppressWarnings("serial")
+public class Incident implements Serializable {
+    
+    /** A brief description of the incident that is displayed in the Simulation Manager GUI. */
+    public String description;
+    
+    /** The CHP Incident Log Number assigned to this incident */
+    public Integer logNumber;
+
+    /**  Object containing the IncidentInquiry header information. */
+    public IncidentInquiryHeader header;
+
+    /**  
+     * TreeMap mapping IncidentLocation objects(values) to a String identifier(keys) 
+     * read as during script parsing. 
+     */
+    public TreeMap<String, ParamicsLocation> locationMap;   
+    
+    /** 
+     * The time, in seconds, in a simulation that the incident 'begins.'  
+     * This does not necessarily correspond to first event. 
+     */
+    private long startTime;
+    
+    /**
+     * Holds the time (number of seconds) that this incident occured. This may
+     * be different than the scriptIncidentStartTime if the user manually triggers
+     * the incident.
+     */     
+    private long secondsIncidentStarted = 0;
+ 
+    /** Boolean flag to designate whether the incident has occured or not. */    
+    private boolean incidentOccured = false;
+    
+    /** The incidents list of IncidentEvents that will occur in successive order. */
+    private Vector<IncidentEvent> eventList = null; 
+    
+        
+    /**
+     * Constructor.  Initialize local lists and Incident identifying data.
+     * 
+     * @param log   Unique log number for this incident.
+     * @param desc  Short description of this incident.
+     * @param start Simulation time (in seconds) for this incident to start.
+     */
+    public Incident(/*NetworkID*/ Integer log, String desc, long start)
+    {
+        logNumber   = log;
+        description = desc;
+        startTime   = start;
+        header      = new IncidentInquiryHeader();      
+        locationMap = new TreeMap<String, ParamicsLocation>();
+        
+        eventList    = new Vector<IncidentEvent>();
+        
+    }
+    
+    /**
+     * Method checks if the Incident can be triggered.  If the simulation
+     * time is equal to or greater than this Incident's start time, and the 
+     * Incident has not previously been triggered, then trigger the incident.
+     * The start time is recorded and true returned.  Else the Incident is
+     * already started or not ready, return false.
+     *
+     * @param scriptSeconds Current value of simulation time, in seconds.
+     * @return boolean Return true when this incident is first triggered, else return false.
+     */
+    public boolean tick(long scriptSeconds) {
+        
+        if(scriptSeconds >= startTime && !incidentOccured) {            
+            incidentOccured        = true;
+            secondsIncidentStarted = scriptSeconds;
+            
+            return true;
+        }
+        else
+            return false;
+    }   
+    
+    /**
+     * Method iterates through the list of events associated with this incident and returns 
+     * a list of those that are ready to be triggered.  
+     *
+     * @param simTime Current simulation time, in seconds.
+     * @return Vector of IncidentEvents that have triggered as a result of this tick().
+     */
+    public Vector<IncidentEvent> getTriggeredEvents(long simTime) {
+        
+        Vector<IncidentEvent> triggered = new Vector<IncidentEvent>();
+        
+        if(incidentOccured) {       
+            for(IncidentEvent evt : eventList) {
+                if(evt.triggerEvent(secondsIncidentStarted, simTime)) {
+                    triggered.add(evt);
+                }   
+            }                               
+        }
+        
+        return triggered;
+    }
+    
+    
+    /**
+     * This method returns a Vector of IncidentEvents which had previously been
+     * triggered and queued while it's associated audio file was being played.
+     * When the audio file has completed, this method will remove that event from
+     * the queuedEvents Vector. 
+     * 
+     * @return Vector of IncidentEvents which can be inserted into the simulation.
+     */
+    public Vector<IncidentEvent> getCompletedEvents() {
+        
+        Vector<IncidentEvent> completed = new Vector<IncidentEvent>();
+        
+        for(IncidentEvent evt : eventList) {
+            if(evt.eventStatus == EVENT_STATUS.COMPLETED) {             
+                completed.add(evt);
+            }       
+        }
+        
+        return completed;
+    }
+    
+    /**
+     * Get the script log number associated with this incident.
+     *
+     * @return String The script log number.
+     */
+    public Integer getLogNumber() {
+        return logNumber;   
+    }
+    
+
+    /**
+     * Manually trigger this incident.  Sets the variable that keeps track of
+     * when the incident occured to the parameter value, and sets the 
+     * incidentOccurred variable to true.  
+     *
+     * @param newtime The time in the script when the incident is being triggered.
+     */
+    public void manualTrigger(long newtime) {
+        secondsIncidentStarted = newtime;   
+        incidentOccured        = true; 
+    }
+    
+    /**
+     * Gets the time (in seconds) that the incident will occur.
+     *
+     * @return long Time(in seconds) that the incident will occur.
+     */
+    public long getSecondsToStart() {
+        return startTime;   
+    }
+    
+    /**
+     * Sets the time( in seconds) that the incident will occur.
+     *
+     * @param  newStartTime Time(in seconds) that the incident will occur.
+     */
+    public void setSecondsToStart(long newStartTime) {
+        startTime = newStartTime;   
+    }   
+    
+    
+    /**
+     * Called to calculate the length of this incident.  The length is the first
+     * event's time subtracted from the last event's time.  
+     *
+     * @return Length of the simulation incident (in seconds).
+     */
+    public Long getIncidentLength() {       
+        return eventList.lastElement().secondsToOccurInIncident -
+            eventList.firstElement().secondsToOccurInIncident;                  
+    }
+    
+    /**
+     * Check to see if incident has occured.
+     * @return true if incident has occured, false if not.
+     */
+    public boolean hasOccured() {
+        return incidentOccured; 
+    }
+
+    /**
+     * Reset the simulation time counters and incidentOccured flag.  Iterate
+     * through the event list and reset each event as well.
+     */
+    public void resetSimulation() {
+        secondsIncidentStarted    = 0;
+        incidentOccured           = false;
+            
+        for(IncidentEvent ie : eventList) 
+            ie.resetSimulation();
+                                
+    }
+    
+    /**
+     * Add an Incident Event to the Incident's list of events.  The new 
+     * event will also receive the current header data associated with this 
+     * incident.
+     * 
+     * @param newEvent The IncidentEvent to be added.
+     */
+    public void addEvent(IncidentEvent newEvent) {
+        newEvent.eventInfo.setHeader(header);
+        eventList.add(newEvent);    
+    }   
+
+}
Index: trunk/src/tmcsim/cadmodels/CMSInfo.java
===================================================================
--- trunk/src/tmcsim/cadmodels/CMSInfo.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/CMSInfo.java	(revision 2)
@@ -0,0 +1,171 @@
+package tmcsim.cadmodels;
+
+
+import java.io.Serializable;
+import java.util.Vector;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * CMSInfo is a container class to contain the id, postmile, initial route, 
+ * and diversion information for a single changeable message sign.  The 
+ * isCleared() method is used to determine if all diversions for this sign are 
+ * cleared.  The isUpdated() methods determines if any of the diversions for 
+ * this sign have been updated from user input. 
+ *
+ * @author Matthew Cechini
+ * @version
+ */
+@SuppressWarnings("serial")
+public class CMSInfo implements Serializable {
+    
+    /**
+     * Enumeration with XML tag names.
+     * @author Matthew Cechini
+     */
+    private static enum XML_TAGS {
+        /** Diversion info. */
+        DIVERSION ("DIVERSION");
+
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }
+    }
+
+    /** The unique ID for this CMS. */
+    public String  cmsID;
+
+    /** The postmile for this CMS. */
+    public Float   postmile;
+
+    /** The initial route where this CMS is located. */
+    public String  initialRoute;
+
+    /** Vector of all possible diversions for this CMS. */
+    public Vector<CMSDiversion>  possibleDiversions;
+
+    /**
+     * Constructor.  
+     */
+    public CMSInfo() {
+        cmsID              = new String();
+        postmile           = new Float(0);
+        initialRoute       = new String();
+        possibleDiversions = new Vector<CMSDiversion>();    
+    }
+    
+    /**
+     * Constructor.
+     * 
+     * @param newID CMS ID
+     * @param newPM CMS postmile
+     * @param newInitRt CMS initial route
+     */
+    public CMSInfo(String newID, Float newPM, String newInitRt) {       
+        cmsID              = newID;
+        postmile           = newPM;
+        initialRoute       = newInitRt;
+        possibleDiversions = new Vector<CMSDiversion>();    
+    }
+    
+    /**
+     * Add a new CMS diversion option.  A new diversion includes information
+     * regarding the old and new paths that traffic will be diverted from and to.
+     * The diversion also includes the Paramics diversion string and the maximum
+     * percentage of traffic that can be diverted.
+     * 
+     * @param oPath Old path.
+     * @param nPath New path.
+     * @param dPath Paramics diversion path.
+     * @param perc Maximum diversion percentage.
+     */
+    public void addNewDiversion(String oPath, String nPath, String dPath, Integer perc) {
+        possibleDiversions.add(new CMSDiversion(oPath, nPath, dPath, perc));    
+    }
+
+    /**
+     * Determines if all possible diversions for this CMS sign are clear.  If
+     * so, true is returned, else false is returned.
+     * 
+     * @return True if all diversions are clear, false if not.
+     */
+    public boolean isCleared() {
+        
+        for(CMSDiversion theDiv : possibleDiversions) {                     
+            if(!theDiv.isCleared()) 
+                return false;           
+        }
+        return true;        
+    }
+    
+    /**
+     * Determines if any possible diversions for this CMS sign have 
+     * been upted.  If so, true is returned, else false is returned.
+     * 
+     * @return True if a diversions has been updated, false if not.
+     */    
+    public boolean isUpdated() {
+        
+        for(CMSDiversion div : possibleDiversions) {
+            if(div.isUpdated()) 
+                return true;            
+        }
+        return false;       
+    }
+    
+    /**
+     * Reset all possible diversions.
+     */
+    public void reset() {
+        for(CMSDiversion div : possibleDiversions) {
+            div.reset();
+        }
+    }
+    
+    /**
+     * Write the XML output for all the diversions represented
+     * in this object.  The format is as follows:
+     * 
+
+     * 
+     * @param xmlOut XMLWriter used for XML creation.
+
+    /**
+     * Creates XML tags with the diversion data represented in this object.
+     * The XML is creaetd with the following format.  The ROOT element is the 
+     * parameter for this method.<br/>
+     * <ROOT>
+     *    <DIVERSION>
+     *       <Diversion_path>
+     *          <Identifier/>
+     *          <Percentage/>
+     *       </Diversion_path>
+     *       ...
+     *       <Diversion_path/>
+     *    </DIVERSION>
+     * </ROOT>
+     *
+     * @param currElem XML Element used as a root for XML tag appending.
+     */    
+    public void toXML(Element currElem) {           
+        
+        Document theDoc = currElem.getOwnerDocument();
+        
+        Element divElem = null;
+        
+        for(CMSDiversion theDiv : possibleDiversions) {
+                        
+            if(!theDiv.isCleared() && theDiv.isUpdated()) {
+
+                divElem = theDoc.createElement(XML_TAGS.DIVERSION.tag);
+                currElem.appendChild(divElem);
+
+                theDiv.toXML(divElem);              
+                
+            }
+        }                 
+    }
+}
Index: trunk/src/tmcsim/cadmodels/IncidentResponse.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentResponse.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentResponse.java	(revision 2)
@@ -0,0 +1,68 @@
+package tmcsim.cadmodels;
+
+import java.io.Serializable;
+
+/**
+ * This class is a further subdivision of Incident to hold data.
+ * @author Vincent
+ *
+ */
+public class IncidentResponse implements Serializable
+{
+    private String plan;
+    private String area;
+    
+    private static enum RESPONSE_ENUMS
+    {
+        PLAN     ("PLAN"),
+        AREA     ("AREA");
+        
+        public String tag;
+        
+        private RESPONSE_ENUMS(String t)
+        {
+            tag = t;
+        }
+    }
+    
+    /*
+     * Constructor. Initializes all objects to avoid null pointers.
+     */
+    public IncidentResponse(){
+        plan = "";
+        area = "";
+    }
+    
+    public String getPlan() {
+        return plan;
+    }
+    
+    public void setPlan(String plan) {
+        this.plan = plan;
+    }
+
+    public String getArea() {
+        return area;
+    }
+
+    public void setArea(String area) {
+        this.area = area;
+    }
+    
+    /*
+     * Called from the tmc.simulator.cadclient.data.Incident.java. Handles storing data based on script tag.
+     */
+    public void readXMLNode(String tag_name, String value) {
+        if(tag_name.equals(RESPONSE_ENUMS.PLAN.tag))
+        {
+            setPlan(value);
+        }
+        else if(tag_name.equals(RESPONSE_ENUMS.AREA.tag))
+        {
+            setArea(value);
+        }
+        
+    }
+    
+    
+}
Index: trunk/src/tmcsim/cadmodels/package.html
===================================================================
--- trunk/src/tmcsim/cadmodels/package.html	(revision 2)
+++ trunk/src/tmcsim/cadmodels/package.html	(revision 2)
@@ -0,0 +1,5 @@
+<html>
+  <body>
+  	This package contains the model classes for the CAD Simulator.
+  </body>
+</html>
Index: trunk/src/tmcsim/cadmodels/IncidentBoardModel_obj.java
===================================================================
--- trunk/src/tmcsim/cadmodels/IncidentBoardModel_obj.java	(revision 2)
+++ trunk/src/tmcsim/cadmodels/IncidentBoardModel_obj.java	(revision 2)
@@ -0,0 +1,137 @@
+package tmcsim.cadmodels;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+
+/**
+ * IncidentBoardModel_obj is the model object containing all model 
+ * information for an IncidentBoard CAD Screen.  The model data includes
+ * a unique number, creation date and time, and message text.<br/>
+ * <br/>
+ * This element parses and creates the following XML schema in its toXML() and
+ * fromXML() methods.  The ROOT element is the parameter for those methods.  The
+ * specific XML schema for each IncidentInquiry model can be found in its
+ * class header.<br/>
+ * <ROOT>
+ *    <NUM/>
+ *    <DATE/>
+ *    <TIME/>
+ *    <MESSAGE/>
+ * </ROOT>
+ * 
+ * @author Matthew Cechini
+ * @version 
+ */
+public class IncidentBoardModel_obj {
+    
+    /**
+     * Enumeration with XML tag names.
+     * @author Matthew Cechini
+     */
+    private static enum XML_TAGS {      
+        /** Bulletin's number. */
+        BULLETIN_NUM ("NUM"),
+        /** Bulletin's create date. */
+        DATE         ("DATE"),
+        /** Bulletin's creation time. */
+        TIME         ("TIME"),
+        /** Bulletin's message text. */
+        MESSAGE      ("MESSAGE");
+        
+        public String tag;
+        
+        private XML_TAGS(String t) {
+            tag = t;
+        }
+        
+    }
+    
+    /** Bulletin number. */
+    public int bulletinNum;
+    
+    /** Bulletin creation date. */
+    public String date;
+    
+    /** Bulletin creation time. */
+    public String time;
+    
+    /** Bulletin message text. */   
+    public String message;
+    
+    
+    /**
+     * Constructor.
+     */
+    public IncidentBoardModel_obj() {
+        bulletinNum = 0;
+        date        = null;
+        time        = null;
+        message     = null;     
+    }   
+    
+    /**
+     * Constructor.
+     * 
+     * @param newBulletinNum Bulletin number.
+     * @param newDate Bulletin creation date.
+     * @param newTime Bulletin create time.
+     * @param newMessage Bulletin message text.
+     */
+    public IncidentBoardModel_obj(int newBulletinNum, 
+                                  String newDate, 
+                                  String newTime,
+                                  String newMessage) {
+        bulletinNum = newBulletinNum;
+        date        = newDate;
+        time        = newTime;
+        message     = newMessage;       
+        
+    }
+    
+    public IncidentBoardModel_obj(Node modelNode) {
+        fromXML(modelNode);
+    }
+    
+    public void toXML(Element currElem) {
+        
+        Document theDoc    = currElem.getOwnerDocument();
+        Element  tempElem  = null;
+        
+        tempElem = theDoc.createElement(XML_TAGS.BULLETIN_NUM.tag);
+        tempElem.appendChild(theDoc.createTextNode(String.valueOf(bulletinNum)));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.DATE.tag);
+        tempElem.appendChild(theDoc.createTextNode(date));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.TIME.tag);
+        tempElem.appendChild(theDoc.createTextNode(time));
+        currElem.appendChild(tempElem);
+        
+        tempElem = theDoc.createElement(XML_TAGS.MESSAGE.tag);
+        tempElem.appendChild(theDoc.createTextNode(message));
+        currElem.appendChild(tempElem);
+    }    
+    
+    public void fromXML(Node modelNode) {   
+        
+        Node childNode = null;
+        
+        childNode = modelNode.getFirstChild();
+        bulletinNum = Integer.parseInt(childNode.getTextContent());
+        
+        childNode = childNode.getNextSibling();
+        date = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        time = childNode.getTextContent();
+        
+        childNode = childNode.getNextSibling();
+        message = childNode.getTextContent();
+            
+    }  
+    
+}
Index: trunk/src/tmcsim/client/CADCaret.java
===================================================================
--- trunk/src/tmcsim/client/CADCaret.java	(revision 2)
+++ trunk/src/tmcsim/client/CADCaret.java	(revision 2)
@@ -0,0 +1,161 @@
+package tmcsim.client;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.FocusEvent;
+import java.awt.event.MouseEvent;
+
+import javax.swing.text.BadLocationException;
+import javax.swing.text.DefaultCaret;
+import javax.swing.text.JTextComponent;
+
+/**
+ * CADCaret extends from DefaultCaret to provide a blinking Caret.  The Caret's
+ * blink rate is 500ms and appears as a solid underline that is the width of one 
+ * character.  All superclass methods that position the Caret are overloaded
+ * to control the position of the Caret manually.
+ * 
+ * @author Matthew
+ * @version
+ */
+@SuppressWarnings("serial")
+public class CADCaret extends DefaultCaret {
+
+    /** Caret's current position.  (>= 0) */
+    private int currentCaretPos = 0;
+
+    /** 
+     * Constructor.
+     */
+    public CADCaret() {
+        setBlinkRate(500); // half a second
+        setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
+    }
+    
+    /**
+     * Overloaded method.  The Caret's position is set with the internal
+     * position count. 
+     */
+    public void setMagicCaretPosition(Point arg0) {
+        super.setDot(currentCaretPos);
+    }
+    
+
+    /**
+     * The internal Caret position is incremented by the parameter offset
+     * value.  After position adjustment, the Caret is repositioned.
+     * 
+     * @param offset Number of characters to increment the Caret's position by. 
+     */
+    public void moveCaretForward(int offset) {
+        currentCaretPos += offset;
+        super.setDot(currentCaretPos);
+    }
+    
+    /**
+     * The internal Caret position is decremented by the parameter offset
+     * value.  If this resulting position is negative, the position is 
+     * set to 0.  After position adjustment, the Caret is repositioned.
+     * 
+     * @param offset Number of characters to decrement the Caret's position by. 
+     */
+    public void moveCaretBackward(int offset) {
+        currentCaretPos -= offset;      
+        
+        if(currentCaretPos < 0)
+            currentCaretPos = 0;
+        
+        super.setDot(currentCaretPos);
+    }
+    
+    /**
+     * The internal Caret position is reset to 0 and the Caret is repositioned.
+     */
+    public void resetCaretPosition() {
+        currentCaretPos = 0;
+        super.setDot(currentCaretPos);      
+    }
+
+    @Override
+    public void setVisible(boolean visible) 
+    {
+        if(visible)
+        {
+            getComponent().setCaretColor(Color.black);
+        }
+        else
+        {
+            getComponent().setCaretColor(Color.yellow);
+        }
+    }
+    
+    public void mouseClicked(MouseEvent arg0)     { }
+    public void mouseDragged(MouseEvent arg0)     { }
+    public void mouseEntered(MouseEvent arg0)     { }
+    public void mouseExited(MouseEvent arg0)      { }
+    public void mouseMoved(MouseEvent arg0)       { }
+    public void mousePressed(MouseEvent arg0)     { }   
+    public void mouseReleased(MouseEvent arg0)    { }
+    protected void moveCaret(MouseEvent arg0)     { }
+    public void moveDot(int arg0)                 { }
+    public void setDot(int arg0)                  { }    
+    protected void positionCaret(MouseEvent arg0) { }   
+    public void focusLost(FocusEvent arg0)        { }
+    
+    protected synchronized void damage(Rectangle r) 
+    {
+        if (r == null)
+            return;
+        // give values to x,y,width,height (inherited from
+        // java.awt.Rectangle)
+        x = r.x;
+        y = r.y + (r.height * 4 / 5 - 3);
+        width  = 10;
+        height = 5;
+        repaint(); // calls getComponent().repaint(x, y, width, height)
+    }
+
+    public void paint(Graphics g) {
+        JTextComponent comp = getComponent();
+        if (comp == null)
+            return;
+
+        int dot = getDot();
+        Rectangle r = null;
+        try {
+            r = comp.modelToView(dot);
+        } catch (BadLocationException e) {
+            return;
+        }
+        if (r == null)
+            return;
+
+        // will be distance from r.y to top
+        int dist = r.height * 4 / 5 - 3; 
+
+        if ((x != r.x) || (y != r.y + dist)) {
+            // paint() has been called directly, without a previous call to
+            // damage(), so do some cleanup. (This happens, for example,
+            // when
+            // the
+            // text component is resized.)
+            repaint(); // erase previous location of caret
+            x = r.x; // set new values for x,y,width,height
+            y = r.y + dist;
+            width  = 10;
+            height = 5;
+        }
+
+        if (isVisible()) {
+            g.setColor(comp.getCaretColor());
+            // 5 vertical pixels
+            //g.drawLine(r.x, r.y + dist, r.x, r.y + dist + 4);
+            
+            // 5 horizontal pixels
+            g.drawLine(r.x, r.y + dist + 4, r.x + 8, r.y + dist + 4); 
+        }
+    }
+    
+}
Index: trunk/src/tmcsim/client/CADClient.java
===================================================================
--- trunk/src/tmcsim/client/CADClient.java	(revision 2)
+++ trunk/src/tmcsim/client/CADClient.java	(revision 2)
@@ -0,0 +1,516 @@
+package tmcsim.client;
+
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.rmi.Naming;
+import java.rmi.RemoteException;
+import java.rmi.server.UnicastRemoteObject;
+import java.util.Properties;
+import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+import javax.swing.JWindow;
+import javax.swing.UIManager;
+
+import tmcsim.client.cadclientgui.CADClientGUI;
+import tmcsim.client.cadclientgui.CardfileReader;
+import tmcsim.client.cadclientgui.GUIScriptReader;
+import tmcsim.client.cadclientgui.data.CADData;
+import tmcsim.client.cadclientgui.screens.Login;
+import tmcsim.client.cadclientgui.screens.ScreenManager;
+import tmcsim.common.CADEnums;
+import tmcsim.common.SimulationException;
+import tmcsim.interfaces.CADClientInterface;
+import tmcsim.interfaces.CoordinatorInterface;
+
+/**
+ * CADClient is the main class for the CAD Client application. The main method
+ * instantiates an instance of the CADClient object with the default properties
+ * file "..\config\CADClient.properties" or the first argument fom the command
+ * line invocation. Properties data values are used to bind socket communication
+ * between the CAD Client and the CAD Simulator. The CADClientModel object is
+ * instantiated and the CAD Client registers itself with the CAD Simulator.
+ * Finally, the CADClientView is initialized, the model-view and observer
+ * relationships are established, and the view is shown.<br>
+ * <br>
+ * The properties file contains the following data: <br>
+ * <code>
+ * -----------------------------------------------------------------------------<br>
+ * Host Name     The host name where the CAD Simulator is located.<br>
+ * Port Number   The port number that the CAD Simulator is bound on.<br>
+ * CAD Position  The integer (>= 0) position for this CAD Client.<br>
+ * CAD User ID   The unique user id for this CAD Client.<br>
+ * Error File    Filename of error logging file.<br>
+ * -----------------------------------------------------------------------------<br>
+ * Example File: <br>
+ * CADSimulatorHost       = localhost<br>
+ * CADSimulatorSocketPort = 4444<br>
+ * CADPosition = 1 <br>
+ * CADUserID   = A12345<br>
+ * ErrorFile   = cad_client_err.txt<br>
+ * </code>
+ * 
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2009/04/17 16:27:47 $ $Revision: 1.8 $
+ */
+/*Hai :3  yeeeee*/
+public class CADClient extends UnicastRemoteObject implements
+        CADClientInterface {
+
+    /** Error logger. */
+    private static Logger cadClientLogger = Logger.getLogger("tmcsim.client");
+
+    /**
+     * Enumeration containing properties name values. See CADClient class
+     * description for more information.
+     * 
+     * @author Matthew Cechini
+     * @see CADClient
+     */
+    private static enum PROPERTIES {
+        CAD_SIM_HOST("CADSimulatorHost"), CAD_SIM_PORT("CADSimulatorSocketPort"), CAD_RMI_PORT(
+                "CADRmiPort"), CLIENT_CAD_POS("CADPosition"), CLIENT_USER_ID(
+                "CADUserID"), KEYBOARD_TYPE("KeyboardType"), DISPLAY_TYPE(
+                "DisplayType");
+
+        public String name;
+
+        private PROPERTIES(String n) {
+            name = n;
+        }
+    }
+
+    /**
+     * CADClientSocket Object to handle socket communication between the Client
+     * and CAD Simulator.
+     */
+    private CADClientSocket theClientSocket;
+
+    /** Instance of the CADClientModel. */
+    private CADClientModel theClientScreenModel;
+
+    /** Instance of the CADClientView. */
+    private CADClientView theClientScreenView;
+
+    /**
+     * Instance of the CADCLientGUI Replaces CADClientView
+     */
+    private CADClientGUI theClientGUI;
+
+    /** Properties object for the CADClient class. */
+    private Properties cadClientProp;
+
+    /** RMI interface for communication with the remote Coordinator. */
+    private static CoordinatorInterface theCoorInt;
+
+    /** reference to itself to be used for disconnecting from CADSimulator */
+    private CADClientInterface client = this;
+
+    /**
+     * Constructor. Initialize data from parsed properties file. Create a socket
+     * connection to the CADSimulator. The ClientScreenModel is initialized with
+     * the input and output I/O streams for socket communication. The
+     * ClientScreenModel registers with the CAD Simulator, using CAD position
+     * and userID read in from the properties file. The ClientScreenView is then
+     * created and initialized and set as an observer of the model.
+     * 
+     * A thread is created with the runnable ClientScreenModel and is started.
+     * When this thread is no longer alive, or the ClientScrenView and
+     * CADClientSocket are closed. The program then exits.
+     * 
+     * @param propertiesFile
+     *            File path (absolute or relative) to the properties file
+     *            containing configuration data.
+     */
+    public CADClient(String propertiesFile) throws SimulationException,
+            RemoteException {
+        if (!verifyProperties(propertiesFile))
+            System.exit(0);
+
+        connect(cadClientProp.getProperty(PROPERTIES.CAD_SIM_HOST.name).trim(),
+                cadClientProp.getProperty(PROPERTIES.CAD_RMI_PORT.name).trim());
+
+        // Instantiate the Socket and Model Objects.
+        theClientSocket = new CADClientSocket(cadClientProp.getProperty(
+                PROPERTIES.CAD_SIM_HOST.name).trim(),
+                Integer.parseInt(cadClientProp.getProperty(
+                        PROPERTIES.CAD_SIM_PORT.name).trim()));
+        theClientScreenModel = new CADClientModel();
+        theClientScreenModel.initializeScreen(theClientSocket.getInputStream(),
+                theClientSocket.getOutputStream());
+
+        // Register this CAD Client with the Simulation Manager
+        theClientScreenModel.register(Integer.parseInt(cadClientProp
+                .getProperty(PROPERTIES.CLIENT_CAD_POS.name)), cadClientProp
+                .getProperty(PROPERTIES.CLIENT_USER_ID.name));
+
+        // Instantiate the CADScreenView and set up the model-view observer
+        // relationship.
+        theClientScreenView = new CADClientView(theClientScreenModel);
+        theClientScreenView.setVisible(false);
+
+        // TODO: set up model-view relationship similar to ClientView and
+        // ScreenView
+        // Can repurpose the old model, but may be better to copy over and
+        // modify in parallel
+        // This is required to perform powerline commands on the data
+        theClientGUI = new CADClientGUI();
+
+        // Each screen of the UI should have a reference to either it's parent
+        // object or the main client
+        // This ensures they all have access to each other and the data model
+        theClientGUI.screen = new ScreenManager(theCoorInt);
+        theClientGUI.login = new Login();
+        theClientGUI.client = this;
+
+        // setup keyboard settings for CAD Client
+        if (cadClientProp.getProperty(PROPERTIES.KEYBOARD_TYPE.name).trim()
+                .equals("CAD")) {
+            CADEnums.CAD_KEYS.setupCADKeyboard();
+        }
+        // STD
+        else {
+            CADEnums.CAD_KEYS.setupStandardKeyboard();
+        }
+
+        theClientScreenModel.addObserver(theClientScreenView);
+
+        // Initialize the display
+        if (cadClientProp.getProperty(PROPERTIES.DISPLAY_TYPE.name).equals(
+                "FULL_SCREEN")) {
+
+            theClientScreenView.addWindowListener(new WindowListener() {
+                public void windowClosed(WindowEvent e) {
+                }
+
+                public void windowOpened(WindowEvent e) {
+                }
+
+                public void windowIconified(WindowEvent e) {
+                }
+
+                public void windowDeiconified(WindowEvent e) {
+                }
+
+                public void windowActivated(WindowEvent e) {
+                }
+
+                public void windowDeactivated(WindowEvent e) {
+                }
+
+                public void windowClosing(WindowEvent e) {
+
+                    try {
+                        theClientSocket.closeSocket();
+                    } catch (SimulationException se) {
+                    }
+
+                    System.exit(0);
+                }
+            });
+
+            theClientScreenView.initWindow();
+            theClientScreenView.setVisible(false);
+        } else {
+            JFrame cadFrame = new JFrame("CAD Client");
+            cadFrame.add(theClientScreenView.initBox());
+            cadFrame.setSize(800, 600);
+
+            cadFrame.addWindowListener(new WindowListener() {
+                public void windowClosed(WindowEvent e) {
+                }
+
+                public void windowOpened(WindowEvent e) {
+                }
+
+                public void windowIconified(WindowEvent e) {
+                }
+
+                public void windowDeiconified(WindowEvent e) {
+                }
+
+                public void windowActivated(WindowEvent e) {
+                }
+
+                public void windowDeactivated(WindowEvent e) {
+                }
+
+                public void windowClosing(WindowEvent e) {
+
+                    try {
+                        theClientSocket.closeSocket();
+                    } catch (SimulationException se) {
+                    }
+
+                    System.exit(0);
+                }
+            });
+
+            cadFrame.setVisible(true);
+        }
+
+        // Create the CAD Client thread to run the CADClientModel Object.
+        Thread clientThread = new Thread(theClientScreenModel);
+        clientThread.start();
+
+        ensureProperShutdown();
+    }
+
+    /**
+     * Connect to the Coordinator's RMI object, and register this object for
+     * callback with the Coordinator.
+     * 
+     * @param hostname
+     *            Host name of the CAD Simulator.
+     * @param portNumber
+     *            Port number of the CAD Simulator RMI communication.
+     * @throws SimulationException
+     *             if there is an error creating the RMI connection.
+     */
+    protected void connect(String hostname, String portNumber)
+            throws SimulationException {
+
+        String coorIntURL = "";
+
+        try {
+            coorIntURL = "rmi://" + hostname + ":" + portNumber
+                    + "/coordinator";
+            theCoorInt = (CoordinatorInterface) Naming.lookup(coorIntURL);
+            theCoorInt.registerForCallback(this);
+        } catch (Exception e) {
+            throw new SimulationException(SimulationException.CAD_SIM_CONNECT,
+                    e);
+        }
+    }
+
+    /**
+     * This method verifies that the CAD Simulator Host and Port values are not
+     * null. Also, if a CAD Position or User ID do not exist in the properties
+     * file, the user is prompted to enter values. These values are written to
+     * the properties file. If the user cancels the process of entering these
+     * values, the verification fails.
+     * 
+     * @param propertiesFile
+     *            File path (absolute or relative) to the properties file
+     *            containing configuration data.
+     * @return True if the properties file is valid, false if not.
+     * @throws SimulationException
+     *             if there is an exception in verifying the properties file, or
+     *             if the user cancels input.
+     */
+    private boolean verifyProperties(String propertiesFile)
+            throws SimulationException {
+
+        // Load the properties file.
+        try {
+            cadClientProp = new Properties();
+            cadClientProp.load(new FileInputStream(propertiesFile));
+        } catch (Exception e) {
+            cadClientLogger.logp(Level.SEVERE, "SimulationManager",
+                    "Constructor", "Exception in reading properties file.", e);
+
+            throw new SimulationException(SimulationException.INITIALIZE_ERROR,
+                    e);
+        }
+
+        // Ensure that the properties file does not have null values for the
+        // CAD Simulator's connection information.
+        if (cadClientProp.getProperty(PROPERTIES.CAD_SIM_HOST.name) == null
+                || cadClientProp.getProperty(PROPERTIES.CAD_SIM_PORT.name) == null) {
+            cadClientLogger.logp(Level.SEVERE, "SimulationManager",
+                    "Constructor", "Null value in properties file.");
+            throw new SimulationException(SimulationException.INITIALIZE_ERROR);
+        }
+
+        try {
+            // If the properties file does not specify a CAD position, prompt
+            // the
+            // user to select one. If the user selects a position, write the
+            // new properties values to the file. If the user cancels, else
+            // throw an exception.
+            if (cadClientProp.getProperty(PROPERTIES.CLIENT_CAD_POS.name) == null) {
+                if (getCADPosition())
+                    cadClientProp.store(new FileOutputStream(propertiesFile),
+                            "");
+                else
+                    throw new SimulationException(
+                            SimulationException.INITIALIZE_ERROR);
+            }
+
+            // If the properties file does not specifiy a CAD User ID, prompt
+            // the
+            // user to enter a value. If the user enters a valid ID, write the
+            // new properties values to the file. If the user cancels, else
+            // throw an exception.
+            if (cadClientProp.getProperty(PROPERTIES.CLIENT_USER_ID.name) == null) {
+                if (getUserID())
+                    cadClientProp.store(new FileOutputStream(propertiesFile),
+                            "");
+                else
+                    throw new SimulationException(
+                            SimulationException.INITIALIZE_ERROR);
+            }
+        } catch (IOException ioe) {
+            cadClientLogger.logp(Level.SEVERE, "SimulationManager",
+                    "Constructor",
+                    "Exception in writing to the properties file.");
+            throw new SimulationException(SimulationException.INITIALIZE_ERROR);
+        }
+
+        // Ensure that the properties file has a valid display type
+        if (cadClientProp.getProperty(PROPERTIES.DISPLAY_TYPE.name) == null
+                || (!cadClientProp.getProperty(PROPERTIES.DISPLAY_TYPE.name)
+                        .equals("FULL_SCREEN") && !cadClientProp.getProperty(
+                        PROPERTIES.DISPLAY_TYPE.name).equals("FRAME"))) {
+            cadClientLogger.logp(Level.SEVERE, "SimulationManager",
+                    "Constructor", "Invalid display type.");
+            throw new SimulationException(SimulationException.INITIALIZE_ERROR);
+        }
+
+        return true;
+    }
+
+    /**
+     * This method prompts the user to select a value for the CAD position. If
+     * the user cancels the method returns false, else the Properties object is
+     * updated and true is returned.
+     * 
+     * @return True if the user successfully selected a CAD position, false if
+     *         not.
+     */
+    private boolean getCADPosition() {
+
+        Vector<Integer> positions = new Vector<Integer>();
+        for (int i = 0; i < 10; i++)
+            positions.add(i);
+
+        Object cadPos = null;
+
+        while (true) {
+            cadPos = JOptionPane.showInputDialog(null,
+                    "Please assign this workstation a CAD position number.",
+                    "CAD Position Asignment", JOptionPane.QUESTION_MESSAGE,
+                    null, positions.toArray(), positions.get(0));
+
+            // If the user pressed cancel, confirm the exit and return false.
+            if (cadPos == null) {
+                if (JOptionPane
+                        .showConfirmDialog(
+                                null,
+                                "CAD Client cannot load until a valid CAD "
+                                        + "position has been selected.  Do you wish to "
+                                        + "cancel loading the CAD Client?",
+                                "Confirm Exit", JOptionPane.YES_NO_OPTION,
+                                JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION)
+                    return false;
+            }
+            // Else the user selected a CAD position, exit the loop.
+            else {
+                break;
+            }
+        }
+
+        cadClientProp.setProperty(PROPERTIES.CLIENT_CAD_POS.name,
+                cadPos.toString());
+        return true;
+    }
+
+    /**
+     * This method prompts the user to enter a 5-character User ID. If the user
+     * cancels the method returns false, else the Properties object is updated
+     * and true is returned.
+     * 
+     * @return True if the user successfully selected a CAD position, false if
+     *         not.
+     */
+    private boolean getUserID() {
+        String cadUID = null;
+
+        while (true) {
+            cadUID = JOptionPane.showInputDialog(null,
+                    "Please assign this workstation a 6-character CAD "
+                            + "User ID.", "CAD User ID Asignment",
+                    JOptionPane.QUESTION_MESSAGE);
+
+            // /If the user pressed cancel, confirm the exit and return false.
+            if (cadUID == null) {
+                if (JOptionPane.showConfirmDialog(null,
+                        "CAD Client cannot load until a valid User ID "
+                                + "has been entered.  Do you wish to "
+                                + "cancel loading the CAD Client?",
+                        "Confirm Exit", JOptionPane.YES_NO_OPTION,
+                        JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION)
+                    return false;
+            }
+            // If the user does not enter a valid User ID, notify and reprompt.
+            else if (cadUID.length() != 6) {
+                JOptionPane.showMessageDialog(null,
+                        "The User ID must be 6 characters.", "Invalid User ID",
+                        JOptionPane.WARNING_MESSAGE);
+            }
+            // Else the user entered a valid value, exit the loop.
+            else {
+                break;
+            }
+        }
+
+        cadClientProp.setProperty(PROPERTIES.CLIENT_USER_ID.name, cadUID);
+        return true;
+    }
+
+    /**
+     * Construct the CADClient with the properties file path, either from the
+     * command line arguments or default.
+     * 
+     * @param args
+     *            Command line arguments.
+     */
+    public static void main(String[] args) {
+        System.setProperty("CAD_CLIENT_PROPERTIES",
+                "config/cad_client_config.properties");
+
+        try {
+            if (System.getProperty("CAD_CLIENT_PROPERTIES") != null) {
+                UIManager.setLookAndFeel(UIManager
+                        .getSystemLookAndFeelClassName());
+
+                new CADClient(System.getProperty("CAD_CLIENT_PROPERTIES"));
+            } else {
+                throw new Exception(
+                        "CAD_CLIENT_PROPERTIES system property not defined.");
+            }
+        } catch (Exception e) {
+            cadClientLogger.logp(Level.SEVERE, "SimulationManager", "Main",
+                    "Error initializing application.");
+
+            JOptionPane.showMessageDialog(new JWindow(), e.getMessage(),
+                    "Error - Program Exiting", JOptionPane.ERROR_MESSAGE);
+
+            System.exit(-1);
+        }
+
+    }
+
+    public void refresh() {
+        theClientGUI.screen.refreshScreens();
+    }
+
+    public void ensureProperShutdown() {
+        Runtime.getRuntime().addShutdownHook(new Thread() {
+            public void run() {
+                try {
+                    theCoorInt.unregisterForCallback(client);
+                } catch (RemoteException e) {
+                    e.printStackTrace();
+                }
+            }
+        });
+    }
+
+}
Index: trunk/src/tmcsim/client/CADClientModel.java
===================================================================
--- trunk/src/tmcsim/client/CADClientModel.java	(revision 2)
+++ trunk/src/tmcsim/client/CADClientModel.java	(revision 2)
@@ -0,0 +1,336 @@
+package tmcsim.client;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.util.Observable;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import tmcsim.cadmodels.BlankScreenModel;
+import tmcsim.cadmodels.CADScreenModel;
+import tmcsim.cadmodels.IncidentBoardModel;
+import tmcsim.cadmodels.IncidentInquiryModel;
+import tmcsim.cadmodels.IncidentSummaryModel;
+import tmcsim.cadmodels.RoutedMessageModel;
+import tmcsim.common.ObserverMessage;
+import tmcsim.common.SimulationException;
+import tmcsim.common.CADProtocol.CAD_CLIENT_CMD;
+import tmcsim.common.CADProtocol.CAD_COMMANDS;
+import tmcsim.common.CADProtocol.CAD_SIMULATOR_CMD;
+import tmcsim.common.CADProtocol.DATA_TAGS;
+
+
+/**
+ * CADClientModel handles data transmission between the CAD Client and CAD
+ * Simulator.  Data is read from the input stream and parsed for message updates
+ * from the CAD Simulator.  These updates are described in the receiveObject()
+ * method description.  The transmit() method is called to send Document objects
+ * to the CAD Simulator.
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2009/04/20 17:58:27 $ $Revision: 1.5 $
+ */
+public class CADClientModel extends Observable implements Runnable {
+
+    /** Error Logger. */
+    private Logger clientLogger = Logger.getLogger("tmcsim.client");
+    
+    /** Output stream for writing data to the CAD Simulator. */    
+    private ObjectOutputStream out = null;
+
+    /** Input Stream for reading data to the CAD Simulator. */
+    private ObjectInputStream in = null;    
+   
+    /** Boolean flag to designate if Runnable object is running. */
+    private boolean running = true;
+
+
+    /**
+     * Constructor.
+     */
+    public CADClientModel() {  }
+    
+    /**
+     * This method sets the streams that are used for communication
+     * to and from the CAD Simulator.
+     *
+     * @param theIS The input stream to read packets from.
+     * @param theOS The output stream to write packets to.
+     * @throws SimulationException if there is an exception in 
+     * creating the Object(Input/Output)Streams.
+     */
+    public void initializeScreen(InputStream theIS,
+                                 OutputStream theOS) throws SimulationException {
+        
+        try  {
+            out = new ObjectOutputStream(theOS);
+            in  = new ObjectInputStream(theIS);
+        }
+        catch (Exception e) {
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, e);
+        }
+    
+    }
+    
+    /**
+     * This method register this CAD Client with the CAD Simulator.  The client 
+     * is registered with its CAD position number and user ID.  
+     * 
+     * @param CADPosition CAD Position number.
+     * @param userID User ID.
+     * @throws SimulationException if there is an exception in registering the client.
+     */
+    public void register(int CADPosition, String userID) throws SimulationException {
+        try {
+            Document cmdDoc = DocumentBuilderFactory.newInstance()
+                    .newDocumentBuilder().newDocument();
+            Element cmdElem = cmdDoc.createElement(CAD_CLIENT_CMD.TERMINAL_REGISTER.type);  
+            
+            Element posElem = cmdDoc.createElement(DATA_TAGS.POSITION_NUM.tag);
+            posElem.appendChild(cmdDoc.createTextNode(String.valueOf(CADPosition)));
+            cmdElem.appendChild(posElem);
+            
+            Element userIDElem = cmdDoc.createElement(DATA_TAGS.USER_ID.tag);
+            userIDElem.appendChild(cmdDoc.createTextNode(userID));
+            cmdElem.appendChild(userIDElem);
+
+            cmdDoc.appendChild(cmdElem);
+
+            transmitCommand(cmdDoc);
+
+        } catch (Exception e) {
+            clientLogger.logp(Level.SEVERE, "CADClientModel", "register()", 
+                    "Exception in registering client.", e);
+            throw new SimulationException(SimulationException.REGISTER_ERROR, e);
+        }
+    }
+    
+    /**
+     * Run method that must be defined in Runnable interface.  
+     * This method continuously calls the receiveObject() method 
+     * to check the input stream for data.  If an exception occurs
+     * reading from the input stream, the streams are closed and 
+     * observers are notified with a null object that the model has
+     * disconnected.
+     */
+    public void run() {
+        
+        while(running)  {
+            
+            try {               
+                Thread.sleep(250);
+                receiveObject(in.readObject());                 
+            }
+            catch (EOFException eofe) {
+                clientLogger.logp(Level.SEVERE, "CADClientModel", "run()", 
+                        "Exception in reading object from input stream.", eofe);
+            }
+            catch (Exception e) {
+                clientLogger.logp(Level.SEVERE, "CADClientModel", "run()", 
+                        "Exception in reading object from input stream. " +
+                        "Shutting down client.", e);
+                
+                running = false;
+                
+                closeStreams();
+                
+                setChanged();
+                notifyObservers();
+            }
+        }
+    }
+
+    
+    /**
+     * This method writes the parameter Document object to the 
+     * ObjectOutputStream which is transmitted eo the CAD Simulator.
+     * If there is an Exception in writing to the Socket, the streams
+     * are closed and observers are notified with a null object to
+     * signify that the connect has been lost.
+     * 
+     * @param command The Document being transmitted.
+     */
+    public void transmitCommand(Document command) {     
+        
+        try {
+            out.writeObject(command);
+            out.flush();
+        }
+        catch (IOException ioe) {
+            clientLogger.logp(Level.SEVERE, "CADClientModel", "transmitObject()", 
+                    "Exception in writing object to the input stream. " +
+                    "Shutting down client.", ioe);
+            
+            running = false;
+            
+            closeStreams();
+            
+            setChanged();
+            notifyObservers();
+        }
+    }
+    
+    /**
+     *<table cellpadding="2" cellspacing="2" border="1"
+     * style="text-align: left; width: 250px;">
+     *  <tbody>
+     *    <tr>
+     *      <th>CAD Protocol Command<br></th>
+     *      <th>Action Taken<br></th>
+     *    </tr>
+     *    <tr>
+     *      <td>UPDATE_SCREEN<br></td>
+     *      <td>A completely new window has been received.  Parse the received 
+     *          data into an XML Document.  The root node is used to determine
+     *          which type of CAD Screen is being shown.  Construct the new
+     *          CADScreenModel for that CAD Screem amd notify the view observer with the new
+     *          screen type and model.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>UPDATE_STATUS</td>
+     *      <td>Notify the view observer with the new screen update status value.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>UPDATE_TIME</td>
+     *      <td>Notify the view observer with the new CAD Time value.<br> </td>
+     *    </tr>
+     *    <tr>
+     *      <td>UPDATE_MSG_COUNT</td>
+     *      <td>Notify the view observer with the new queued message count value.<br> </td>
+     *    </tr>
+     *    <tr>
+     *      <td>UPDATE_MSG_UNREAD</td>
+     *      <td>Notify the view observer with the new boolean unread messages value.<br> </td>
+     *    </tr>
+     *    <tr>
+     *      <td>CAD_INFO</td>
+     *      <td>Notify the view observer with the received informational message value.<br> </td>
+     *    </tr>
+     *  </tbody>
+     *</table>
+     *
+     */
+    private void receiveObject(Object rxData) throws IOException {
+        
+        try {
+            
+            CADScreenModel theCADScreenModel = null;
+            
+            Element root  = ((Document)rxData).getDocumentElement();
+        
+            switch(CAD_SIMULATOR_CMD.fromString(root.getNodeName())) {
+        
+                case UPDATE_SCREEN:
+                                            
+                    Node screenNode = root.getChildNodes().item(0);
+
+                    if(screenNode.getNodeName().equals(CAD_COMMANDS.INCIDENT_INQUIRY.fullName)) {
+                        theCADScreenModel = new IncidentInquiryModel(screenNode);               
+                        
+                        setChanged();
+                        notifyObservers(new ObserverMessage(ObserverMessage.messageType.INCIDENT_INQUIRY, theCADScreenModel));  
+                    }
+                    else if(screenNode.getNodeName().equals(CAD_COMMANDS.INCIDENT_SUMMARY.fullName)) {                  
+                        theCADScreenModel = new IncidentSummaryModel(screenNode);
+                        
+                        setChanged();
+                        notifyObservers(new ObserverMessage(ObserverMessage.messageType.INCIDENT_SUMMARY, theCADScreenModel)); 
+            
+                    }
+                    else if(screenNode.getNodeName().equals(CAD_COMMANDS.INCIDENT_BOARD.fullName)) {
+                        theCADScreenModel = new IncidentBoardModel(screenNode);
+                        
+                        setChanged();
+                        notifyObservers(new ObserverMessage(ObserverMessage.messageType.INCIDENT_BOARD, theCADScreenModel)); 
+                    }   
+                    else if(screenNode.getNodeName().equals(CAD_COMMANDS.ROUTED_MESSAGE.fullName)) {
+                        theCADScreenModel = new RoutedMessageModel(screenNode);
+                        
+                        setChanged();
+                        notifyObservers(new ObserverMessage(ObserverMessage.messageType.ROUTED_MESSAGE, theCADScreenModel)); 
+                    }                       
+                    else if(screenNode.getNodeName().equals(CAD_COMMANDS.BLANK_SCREEN.fullName)) {
+                        theCADScreenModel = new BlankScreenModel(screenNode);
+                    
+                        setChanged();
+                        notifyObservers(new ObserverMessage(ObserverMessage.messageType.BLANK_SCREEN, theCADScreenModel)); 
+                    }
+                    break;   
+    
+                case UPDATE_STATUS:
+                    setChanged();
+                    notifyObservers(new ObserverMessage(ObserverMessage.messageType.SCREEN_UPDATE, 
+                            root.getTextContent()));
+                    break;
+                
+                case UPDATE_TIME:
+                    setChanged();
+                    notifyObservers(new ObserverMessage(ObserverMessage.messageType.TIME_UPDATE, 
+                            root.getTextContent()));
+                    break;
+                
+                case UPDATE_MSG_COUNT:
+                    setChanged();
+                    notifyObservers(new ObserverMessage(ObserverMessage.messageType.ROUTED_MESSAGE_COUNT_UPDATE,  
+                            Integer.parseInt(root.getTextContent())));
+                    break;
+                
+                case UPDATE_MSG_UNREAD:
+                    setChanged();
+                    notifyObservers(new ObserverMessage(ObserverMessage.messageType.ROUTED_MESSAGE_UNREAD_UPDATE,  
+                            Boolean.parseBoolean(root.getTextContent())));
+                    break;
+               
+                case CAD_INFO:
+                    setChanged();
+                    notifyObservers(new ObserverMessage(ObserverMessage.messageType.CAD_INFO_MESSAGE,  
+                            root.getTextContent()));
+                    break;
+                    
+                case APP_CLOSE:
+                    closeStreams();
+                    System.exit(0);
+                    break;
+            }           
+        } 
+        catch (Exception e) 
+        {
+            clientLogger.logp(Level.SEVERE, "CADClientModel", "receiveObject()", 
+                    "Exception in parsing xml object.", e);
+        }
+    }
+    
+    /**
+     * Close the ouput and input streams.
+     */
+    private void closeStreams() {
+        
+        
+        try {
+            out.close();
+        }
+        catch (Exception e) {
+            clientLogger.logp(Level.SEVERE, "CADClientModel", "closeStreams()", 
+                    "Exception in closing output stream.", e);
+        }
+        
+        try {
+            in.close();
+        }
+        catch (Exception e) {
+            clientLogger.logp(Level.SEVERE, "CADClientModel", "closeStreams()", 
+                    "Exception in closing input stream.", e);
+        }
+        
+    }
+}    
Index: trunk/src/tmcsim/client/KeyboardTester.java
===================================================================
--- trunk/src/tmcsim/client/KeyboardTester.java	(revision 2)
+++ trunk/src/tmcsim/client/KeyboardTester.java	(revision 2)
@@ -0,0 +1,42 @@
+package tmcsim.client;
+
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+
+import javax.swing.JFrame;
+import javax.swing.JTextArea;
+
+@SuppressWarnings("serial")
+public class KeyboardTester extends JFrame implements KeyListener {
+
+    public KeyboardTester() {
+        JTextArea ta = new JTextArea();
+        ta.addKeyListener(this);
+        
+        add(ta);
+        
+        pack();
+        setSize(200,00);
+        setVisible(true);
+    }
+    
+    public void keyTyped(KeyEvent evt) {
+        System.out.println(evt.getKeyCode() + " typed");
+    }
+
+    public void keyPressed(KeyEvent evt) {
+        System.out.println(evt.getKeyCode() + " pressed");
+    }
+
+    public void keyReleased(KeyEvent evt) {
+        System.out.println(evt.getKeyCode() + " released");
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        new KeyboardTester();
+    }
+
+}
Index: trunk/src/tmcsim/client/cadscreens/SA_IncidentSummary.java
===================================================================
--- trunk/src/tmcsim/client/cadscreens/SA_IncidentSummary.java	(revision 2)
+++ trunk/src/tmcsim/client/cadscreens/SA_IncidentSummary.java	(revision 2)
@@ -0,0 +1,79 @@
+package tmcsim.client.cadscreens;
+
+
+import javax.swing.text.Document;
+
+import tmcsim.cadmodels.IncidentSummaryModel;
+import tmcsim.cadmodels.IncidentSummaryModel_obj;
+import tmcsim.client.cadscreens.view.CADMainView;
+import tmcsim.common.CADEnums.TEXT_STYLES;
+
+
+/**
+ * SA_IncidentSummary is the view component to the IncidentSummaryModel
+ * model object.  The screen is shown when the user requests a "Summary
+ * of Incidents by Area."  When the class is instantiated with reference
+ * to the model data and document, string and style pairs are added to the 
+ * view document.  This class extends from the CADMainView object, which
+ * contains the common methods and data needed for display and user
+ * interaction.  
+ *
+ * @see IncidentSummaryModel
+ * @author Matthew Cechini 
+ * @version $Revision: 1.4 $ $Date: 2009/04/17 16:27:45 $
+ */
+public class SA_IncidentSummary extends CADMainView {
+    
+    /**
+     * Reference to the Model class for the Incident Summary data.
+     */
+    private IncidentSummaryModel theModel;
+    
+    
+    /**
+     * Constructor. Initializes the screen with the appropriate formatted text.
+     *
+     * @param newModel The model data object.
+     * @param viewdoc  The Document object used for displaying the model data.
+     */
+    public SA_IncidentSummary(IncidentSummaryModel newModel, Document viewDoc) {
+        super(viewDoc);                    
+                    
+        theModel = newModel;
+        
+        initialize();
+    }   
+    
+    
+    /**
+     * This method initializes the screen's Document object with 
+     * text and style pairs to create the correct screen format.
+     */
+    private void initialize() {     
+    
+        addDocElement("AREA(S)   ", TEXT_STYLES.CYAN);
+        
+        addDocElement(IncidentSummaryModel.areas, TEXT_STYLES.RED);
+        
+        addDocElement("- INCIDENT SUMMARY ------------ STATE: ", TEXT_STYLES.CYAN);
+        
+        addDocElement("I P A ", TEXT_STYLES.RED);
+        
+        addDocElement("F\n", TEXT_STYLES.CYAN);
+        
+                                        
+        for(IncidentSummaryModel_obj ismo : theModel.getModelObjects()) {       
+                
+            addDocElement(lPad(rPad(ismo.logNumber.toString(), 4), 6) 
+                               + rPad(ismo.date, 4) + "-"
+                               + rPad(ismo.time, 4) 
+                               + rPad(ismo.priority, 3) 
+                               + rPad(ismo.callType, 5) 
+                               + rPad(ismo.beatArea, 6) 
+                               + rPad(ismo.location, 35) 
+                               + rPad(ismo.beatAssigned, 5) + "\n",
+                               TEXT_STYLES.YELLOW);
+        }
+            
+    }   
+}
Index: trunk/src/tmcsim/client/cadscreens/IB_IncidentBoard.java
===================================================================
--- trunk/src/tmcsim/client/cadscreens/IB_IncidentBoard.java	(revision 2)
+++ trunk/src/tmcsim/client/cadscreens/IB_IncidentBoard.java	(revision 2)
@@ -0,0 +1,65 @@
+package tmcsim.client.cadscreens;
+
+
+import javax.swing.text.Document;
+
+import tmcsim.cadmodels.IncidentBoardModel;
+import tmcsim.cadmodels.IncidentBoardModel_obj;
+import tmcsim.client.cadscreens.view.CADMainView;
+import tmcsim.common.CADEnums.TEXT_STYLES;
+
+/**
+ * IB_IncidentBoard is the view component to the IncidentBoardModel
+ * model object.  The screen is shown when the user requests to view the
+ * Incident Board. When the class is instantiated with reference
+ * to the model data and document, string and style pairs are added to the 
+ * view document.  This class extends from the CADMainView object, which
+ * contains the common methods and data needed for display and user
+ *
+ * @see IncidentBoardModel
+ * @author Matthew Cechini 
+ * @version $Revision: 1.4 $ $Date: 2009/04/17 16:27:45 $
+ */
+public class IB_IncidentBoard extends CADMainView {
+
+    /**
+     * Reference to the Model class for the Incident Board data.
+     */
+    private IncidentBoardModel theModel;
+    
+    /**
+     * Constructor.  Initializes the screen with the appropriate formatted text.
+     *
+     * @param newModel The model data object.
+     * @param viewdoc  The Document object used for displaying the model data.
+     */
+    public IB_IncidentBoard(IncidentBoardModel newModel, Document viewDoc) {
+        super(viewDoc);
+        
+        theModel         = newModel;
+            
+        initialize();
+    }   
+    
+    
+    /**
+     * This method initializes the screen's Document object with 
+     * text and style pairs to create the correct screen format.
+     */
+    private void initialize() {
+                        
+        for(IncidentBoardModel_obj ibmo : theModel.getModelObjects()) {
+
+            addDocElement("------------------ BULLETIN " 
+                    + String.valueOf(ibmo.bulletinNum) 
+                    + " "  + ibmo.date 
+                    + "  " + ibmo.time
+                    + "           ---------------------\n", 
+                    TEXT_STYLES.CYAN);
+                
+            addDocElement(ibmo.message + "\n", 
+                    TEXT_STYLES.CYAN);
+        }
+
+    }   
+}
Index: trunk/src/tmcsim/client/cadscreens/II_IncidentInquiry.java
===================================================================
--- trunk/src/tmcsim/client/cadscreens/II_IncidentInquiry.java	(revision 2)
+++ trunk/src/tmcsim/client/cadscreens/II_IncidentInquiry.java	(revision 2)
@@ -0,0 +1,313 @@
+package tmcsim.client.cadscreens;
+
+import javax.swing.text.Document;
+
+import tmcsim.cadmodels.IncidentInquiryDetails;
+import tmcsim.cadmodels.IncidentInquiryModel;
+import tmcsim.cadmodels.IncidentInquiryModel_obj;
+import tmcsim.cadmodels.IncidentInquiryServices;
+import tmcsim.cadmodels.IncidentInquiryTows;
+import tmcsim.cadmodels.IncidentInquiryUnitsAssigned;
+import tmcsim.cadmodels.IncidentInquiryWitnesses;
+import tmcsim.client.cadscreens.view.CADMainView;
+import tmcsim.common.CADEnums.TEXT_STYLES;
+
+/**
+ * II_IncidentInquiry is the view component to the IncidentInquiryModel
+ * model object.  The screen is shown when the user requests a "Incident
+ * Inquiry."  When the class is instantiated with reference
+ * to the model data and document, string and style pairs are added to the 
+ * view document.  This class extends from the CADMainView object, which
+ * contains the common methods and data needed for display and user
+ * interaction.  
+ *
+ * @see IncidentInquiryModel
+ * @author Matthew Cechini 
+ * @version $Revision: 1.4 $ $Date: 2009/04/17 16:27:45 $
+ */
+public class II_IncidentInquiry extends CADMainView {
+
+
+    /** Reference to the Model class for the Incident Inquiry data. */
+    private IncidentInquiryModel theModel;
+    
+    /**
+     * Constructor.  Initializes the screen with the appropriate formatted text.
+     *
+     * @param newModel The model data object.
+     * @param viewdoc  The Document object used for displaying the model data.
+     */
+    public II_IncidentInquiry(IncidentInquiryModel newModel, Document viewDoc) {
+        super(viewDoc);
+        
+        theModel         = newModel;
+                
+        initialize();
+    }   
+    
+    /**
+     * This method initializes the screen's Document object with 
+     * text and style pairs to create the correct screen format.
+     * 
+     * The IncidentInquiry model data strings are created in the following
+     * order:
+     *
+     * <li>Header Info</li>
+     * <li>Details</li>
+     * <li>Units Assigned</li>
+     * <li>Tows</li>
+     * <li>Services</li>
+     * <li>Witnesses</li>
+     *
+     * The resulting text/style strings are set into the base CADMainView class for display.
+     */
+    private void initialize() {
+        
+        int counter = 1;
+        
+        IncidentInquiryModel_obj tempModelObj = theModel.getModelObject();      
+        
+        addDocElement("LOG: ", TEXT_STYLES.CYAN);
+          
+        addDocElement(rPad(tempModelObj.getHeader().logNumber.toString(), 3) + 
+                           rPad(tempModelObj.getHeader().logStatus, 5),
+                           TEXT_STYLES.YELLOW);
+        
+        addDocElement("PRI: ", TEXT_STYLES.CYAN);
+        
+        addDocElement(rPad(tempModelObj.getHeader().priority, 3),
+                TEXT_STYLES.YELLOW);            
+        
+        addDocElement("TYPE: ", TEXT_STYLES.CYAN);
+        
+        addDocElement(rPad(tempModelObj.getHeader().type, 7), 
+                TEXT_STYLES.YELLOW);    
+        
+        addDocElement("CB: ", TEXT_STYLES.CYAN);
+        
+        addDocElement(rPad(tempModelObj.getHeader().callBoxNumber, 18),
+                TEXT_STYLES.YELLOW);   
+        
+        addDocElement("BEAT: ", TEXT_STYLES.CYAN);
+        
+        addDocElement(rPad(tempModelObj.getHeader().beat, 7) + "\n",
+                TEXT_STYLES.YELLOW);     
+        
+        addDocElement("LOC: ", TEXT_STYLES.CYAN);
+        
+        addDocElement(rPad(tempModelObj.getHeader().fullLocation, 45),
+                TEXT_STYLES.YELLOW);                                        
+        
+        addDocElement("CS: " + "\n", TEXT_STYLES.CYAN);
+        
+        addDocElement(lPad("(" + tempModelObj.getHeader().truncLocation + ")", 23)  + "\n",
+                TEXT_STYLES.YELLOW); 
+        
+        addDocElement("ORI: ", TEXT_STYLES.CYAN);
+                    
+        addDocElement(rPad(tempModelObj.getHeader().origin, 8) 
+                           + rPad(tempModelObj.getHeader().incidentDate, 5)
+                           + rPad(tempModelObj.getHeader().incidentTime, 5),
+                           TEXT_STYLES.YELLOW);            
+        
+        addDocElement("DISP: ", TEXT_STYLES.CYAN);
+        
+        addDocElement(rPad(tempModelObj.getHeader().dispatcher, 9),
+                TEXT_STYLES.YELLOW);    
+        
+        addDocElement(rPad("FILED:", 18),
+                TEXT_STYLES.CYAN);
+    
+        addDocElement("X: \n", TEXT_STYLES.CYAN);
+        
+        addDocElement(rPad("ORI ACTION:", 34), TEXT_STYLES.CYAN);
+        
+        addDocElement(rPad("R/S:", 15), TEXT_STYLES.CYAN);             
+        
+        addDocElement(rPad("DUP:",14), TEXT_STYLES.CYAN);
+        
+        addDocElement(rPad("CBT:", 14), TEXT_STYLES.CYAN);
+        
+        addDocElement("Z:", TEXT_STYLES.CYAN);
+        
+        addDocElement("Y\n", TEXT_STYLES.YELLOW);             
+                      
+        
+        if(tempModelObj.getDetails().size() > 0){ 
+            addDocElement("-------------------------------------",  
+                    TEXT_STYLES.CYAN);
+            
+            //if(tempModelObj.getDetailsUpdated())
+            //  addDocElement(" DETAIL ", TEXT_STYLES.REVERSE_CYAN);
+            //else
+                addDocElement(" DETAIL ", TEXT_STYLES.CYAN);
+
+            addDocElement("-----------------------------------\n", 
+                    TEXT_STYLES.CYAN);
+                                
+        
+            boolean firstLine = true;
+            counter = 1;            
+            for(IncidentInquiryDetails detail : tempModelObj.getDetails()) {
+
+                for(String detail_string : detail.parseDetails(63)) {
+                    if(firstLine) {
+                        addDocElement(rPad(detail.getLogInfo(), 14),
+                                TEXT_STYLES.AQUA);    
+                        
+                        addDocElement(rPad(String.valueOf(counter++), 3),
+                                TEXT_STYLES.CYAN);
+
+                        firstLine = false;
+                    }
+                    else {
+                        addDocElement(rPad("", 17),
+                                TEXT_STYLES.GRAY);    
+                    }               
+                    addDocElement(detail_string,
+                            TEXT_STYLES.YELLOW);
+                }
+                firstLine = true;
+            }
+        }                     
+            
+        if(tempModelObj.getUnits().size() > 0) {
+            addDocElement("--------------------------------", 
+                    TEXT_STYLES.CYAN);
+            
+            //if(tempModelObj.getUnitsUpdated())
+            //  addDocElement(" UNITS ASSIGNED ", TEXT_STYLES.REVERSE_CYAN);
+            //else
+                addDocElement(" UNITS ASSIGNED ", TEXT_STYLES.CYAN);
+
+            addDocElement("--------------------------------\n", 
+                    TEXT_STYLES.CYAN);        
+      
+          
+            for(IncidentInquiryUnitsAssigned unit : tempModelObj.getUnits()) {
+            
+                addDocElement(rPad(unit.getLogInfo(), 14),
+                        TEXT_STYLES.AQUA);    
+            
+                if(unit.isPrimary) 
+                    addDocElement(rPad("<", 3), TEXT_STYLES.CYAN);
+                else 
+                    addDocElement(rPad("-", 3), TEXT_STYLES.CYAN);
+            
+                addDocElement(rPad(unit.beat, 6), TEXT_STYLES.YELLOW);    
+            
+                if(unit.isActive) 
+                    addDocElement(unit.statusType + "\n", TEXT_STYLES.RED);                            
+                else 
+                    addDocElement(unit.statusType + "\n", TEXT_STYLES.GREEN); 
+            
+            }       
+        }
+
+                      
+        if(tempModelObj.getTows().size() > 0){
+            addDocElement("-------------------------------------", 
+                    TEXT_STYLES.CYAN);
+            
+            //if(tempModelObj.getTowsUpdated())
+            //  addDocElement(" TOWS ", TEXT_STYLES.REVERSE_CYAN);
+            //else
+                addDocElement(" TOWS ", TEXT_STYLES.CYAN);
+
+            addDocElement("-------------------------------------\n", 
+                    TEXT_STYLES.CYAN);              
+        
+            counter = 1;
+            for(IncidentInquiryTows tow : tempModelObj.getTows()) {
+                    
+                addDocElement(rPad(tow.getLogInfo(), 14),
+                        TEXT_STYLES.AQUA);    
+            
+                addDocElement(rPad(String.valueOf(counter++), 3),
+                        TEXT_STYLES.CYAN);                 
+                                        
+                addDocElement(rPad(tow.towCompany, 40),
+                        TEXT_STYLES.YELLOW);  
+  
+                addDocElement("BEAT: ", TEXT_STYLES.CYAN);      
+            
+                addDocElement(tow.beat + "\n", TEXT_STYLES.YELLOW);                 
+            
+                addDocElement(lPad("CONF: ", 23), TEXT_STYLES.CYAN);
+            
+                addDocElement(rPad(tow.confPhoneNum, 22), TEXT_STYLES.YELLOW); 
+            
+                addDocElement("PUB: ", TEXT_STYLES.CYAN); 
+            
+                addDocElement(rPad(tow.publicPhoneNum, 14), TEXT_STYLES.YELLOW); 
+            
+                addDocElement(tow.statusInfo + "\n", TEXT_STYLES.YELLOW);                 
+            }            
+        }    
+            
+        if(tempModelObj.getServices().size() > 0){
+            addDocElement("-----------------------------------", 
+                    TEXT_STYLES.CYAN);
+            
+            //if(tempModelObj.getServicesUpdated())
+            //  addDocElement(" SERVICES ", TEXT_STYLES.REVERSE_CYAN);
+            //else
+                addDocElement(" SERVICES ", TEXT_STYLES.CYAN);
+
+            addDocElement("-----------------------------------\n", 
+                    TEXT_STYLES.CYAN);              
+            
+            counter = 1;
+            for(IncidentInquiryServices service : tempModelObj.getServices()) {
+            
+                addDocElement(rPad(service.getLogInfo(), 14), TEXT_STYLES.AQUA);    
+            
+                addDocElement(rPad(String.valueOf(counter++), 3), TEXT_STYLES.CYAN);                 
+                                        
+                addDocElement(service.serviceName + "\n", TEXT_STYLES.YELLOW);  
+            
+                addDocElement(lPad("CONF: ", 23), TEXT_STYLES.CYAN);
+            
+                addDocElement(rPad(service.confPhoneNum, 25), TEXT_STYLES.YELLOW); 
+            
+                addDocElement("PUB: ", TEXT_STYLES.CYAN); 
+            
+                addDocElement(service.publicPhoneNum + "\n", TEXT_STYLES.YELLOW); 
+            }
+        }
+                     
+        if(tempModelObj.getWitnesses().size() > 0){
+            addDocElement("-----------------------------------", 
+                    TEXT_STYLES.CYAN);
+            
+            //if(tempModelObj.getWitnessesUpdated())
+            //  addDocElement(" WITNESSES ", TEXT_STYLES.REVERSE_CYAN);
+            //else
+                addDocElement(" WITNESSES ", TEXT_STYLES.CYAN);
+
+            addDocElement("----------------------------------\n", 
+                    TEXT_STYLES.CYAN);          
+        
+            counter = 1;
+            for(IncidentInquiryWitnesses witness : tempModelObj.getWitnesses()) {
+            
+                addDocElement(rPad(witness.getLogInfo(), 14), TEXT_STYLES.AQUA);    
+            
+                addDocElement(rPad(String.valueOf(counter++), 3), TEXT_STYLES.CYAN);                 
+                                        
+                addDocElement(rPad(witness.reportingParty, 20), TEXT_STYLES.YELLOW);  
+            
+                addDocElement("TEL: ", TEXT_STYLES.CYAN); 
+                
+                addDocElement(witness.telephoneNum + "\n", TEXT_STYLES.YELLOW);                 
+            
+                addDocElement(lPad("ADDR: ", 23), TEXT_STYLES.CYAN);
+            
+                addDocElement(witness.address + "\n", TEXT_STYLES.YELLOW);               
+
+            }           
+        }
+        
+    }   
+     
+}
Index: trunk/src/tmcsim/client/cadscreens/ON_LoginScreen.java
===================================================================
--- trunk/src/tmcsim/client/cadscreens/ON_LoginScreen.java	(revision 2)
+++ trunk/src/tmcsim/client/cadscreens/ON_LoginScreen.java	(revision 2)
@@ -0,0 +1,247 @@
+package tmcsim.client.cadscreens;
+
+import javax.swing.text.Document;
+
+import tmcsim.client.cadscreens.view.CADMainView;
+
+
+
+/**
+ * The View component to the ON_LoginScreen CAD Screen. There is no model data associated
+ * with this view.  All keyboard input is placed in corresponding input areas on the screen
+ * for user name, personal password, and function password.  Some of the CADScreenStyleSheet
+ * methods are overloaded in this class to provide for this functionality.  The inherited
+ * CADScreenStyleSheet is used to contain the updated view items and create the necessary
+ * objects for display.  <OUT OF DATE>
+ *
+ * @author Matthew Cechini 
+ * @version $Revision: 1.4 $ $Date: 2009/04/17 16:27:45 $
+ */
+public class ON_LoginScreen extends CADMainView {
+
+    /**
+     * Count of how many characters have been written to the user identity area.
+     */
+    private int  userIdentityLength     = 0;
+
+    /**
+     * Count of how many characters have been written to the personal password area.
+     */
+    private int  personalPasswordLength = 0;
+
+    /**
+     * Count of how many characters have been written to the function password area.
+     */
+    private int  functionPasswordLength = 0;
+    
+
+    /**
+     * Static final int value to designate the cursor's position on the user identity line.
+     */
+    static final int USER_IDENTITY     = 1;
+
+    /**
+     * Static final int value to designate the cursor's position on the function password line.
+     */
+    static final int FUNCTION_PASSWORD = 2;
+
+    /**
+     * Static final int value to designate the cursor's position on the personal password line.
+     */
+    static final int PERSONAL_PASSWORD = 3;
+
+    /**
+     * Keeps track of which line the cursor is currently on.  Initialize to the user identity line.
+     */
+    private int currentEntryLine = USER_IDENTITY;
+    
+
+    /**
+     * Array of character positions to begin outputting the text strings.
+     */
+    private int documentStartingPosition[] = {0, 125, 140, 165};
+
+    /**
+     * Array of vector positions to offeset the new characters that have been input.  
+     */
+    private int formatVectorStartingPosition[] = {0, 2, 8, 14};
+    
+    public ON_LoginScreen(Document viewDoc) {
+        super(viewDoc);                   
+                    
+    }   
+    
+    /**
+     * Constructor.  Initializes the view with the login screen info.
+     *
+     * @param newCADScreenNumber The ScreenNumber (1-4) for the instance of this view class.
+     * @param newCADScreenType The ScreenType for the instance of this view class.
+     
+    public ON_LoginScreen(int newCADScreenNumber, int newCADScreenType) {
+        String[] initString = {"   SIGN ON\n",
+                               "              USER IDENTITY:     ", "_", "_", 
+                               "_", "_", "_" , "_", "\n",
+                               "              PERSONAL PASSWORD: ", "_", "_", 
+                               "_", "_", "_" , "_", "\n",
+                               "              FUNCTION PASSWORD: ", "_", "_", 
+                               "_", "_", "_" , "_", "\n"};
+
+        String[] initStyles = {"cyan", "cyan", "yellow", "yellow", "yellow", 
+                               "yellow", "yellow", "yellow", "yellow", 
+                               "cyan", "red", "red", "red", "red", "red", "red", 
+                               "red", "cyan", "red", "red", "red", "red", "red", 
+                               "red", "red"};
+        
+        currentCADScreenNumber = newCADScreenNumber;
+        CADScreenType = newCADScreenType;
+        
+        addCADScreenStyleItems(initString, initStyles); 
+    }   
+    
+    
+    /**
+     * Overloading the CADScreenStyleSheet receiveArrow() method.  Up and down arrows move between input lines.
+     *
+     * @param direction The public static final int value of the arrow's direction. Defined in CADScreenStyleSheet.
+     * @return commandline caret position
+     
+    public int receiveArrow(int direction) {
+        switch(direction) {
+            
+            case LEFT:
+                break;
+                    
+            case UP:
+                break;
+                
+            case RIGHT:
+                break;
+                
+            case DOWN:
+                break;
+            
+        }   
+        return 0;
+    }   
+    
+   /**
+    * Overloading the CADSCerenStyleSheet recieveKeyPress() method.  The input character is added to the current input line.
+    * If the input line is full, the new character replaces the last character in that line
+    *
+    * @param newChar The character pressed by the user.
+    * @return boolean true always returned.
+    
+    public boolean receiveKeyPress(char newChar) {
+        
+        switch (currentEntryLine) {
+        
+           case USER_IDENTITY:
+              if(userIdentityLength < 6) {
+                 textAreaUpdateObject.formatVectorPosition = (formatVectorStartingPosition[USER_IDENTITY] + userIdentityLength);
+                 textAreaUpdateObject.documentPosition = (documentStartingPosition[USER_IDENTITY] + userIdentityLength);
+                 userIdentityLength++;
+              }
+           
+              break;
+              
+           case PERSONAL_PASSWORD:
+              if(personalPasswordLength < 8) {
+                 textAreaUpdateObject.formatVectorPosition = (formatVectorStartingPosition[PERSONAL_PASSWORD] + personalPasswordLength);
+                 textAreaUpdateObject.documentPosition = (documentStartingPosition[PERSONAL_PASSWORD] + personalPasswordLength);
+                 personalPasswordLength++;
+              }
+           
+              break;
+              
+           case FUNCTION_PASSWORD:
+              if(functionPasswordLength < 8) {
+                 textAreaUpdateObject.formatVectorPosition = (formatVectorStartingPosition[FUNCTION_PASSWORD] + functionPasswordLength);
+                 textAreaUpdateObject.documentPosition = (documentStartingPosition[FUNCTION_PASSWORD] + functionPasswordLength);
+                 functionPasswordLength++;
+              }
+            
+              break;    
+            
+        }
+        
+        formatStrings.setElementAt(String.valueOf(newChar), textAreaUpdateObject.formatVectorPosition);
+        formatStyleTypes.setElementAt("yellow", textAreaUpdateObject.formatVectorPosition);     
+        
+        textAreaUpdateObject.formatString = String.valueOf(newChar);
+        textAreaUpdateObject.formatStyleType = "yellow";
+        
+        
+        return true;
+    }
+    
+    /**
+     * Overloading the CADScreenStyleSheet backspace() method.  This method determines if the backspace command 
+     * can be executed.  If it can, the last character is removed and true is returned.  If not, the input line 
+     * is unchanged and false is returned.  
+     *
+     * @return boolean true if backspace was successful, false if not.
+     
+    public boolean backspace() {
+        boolean retVal = false;
+        switch (currentEntryLine) {
+        
+           case USER_IDENTITY:
+              if(userIdentityLength > 0) {
+                 userIdentityLength--;
+                 textAreaUpdateObject.formatVectorPosition = (formatVectorStartingPosition[USER_IDENTITY] + userIdentityLength);
+                 textAreaUpdateObject.documentPosition = (documentStartingPosition[USER_IDENTITY] + userIdentityLength);                 
+                 retVal = true;
+              }        
+              break;
+              
+           case PERSONAL_PASSWORD:
+              if(personalPasswordLength > 0) {
+                 personalPasswordLength--;
+                 textAreaUpdateObject.formatVectorPosition = (formatVectorStartingPosition[PERSONAL_PASSWORD] + personalPasswordLength);
+                 textAreaUpdateObject.documentPosition = (documentStartingPosition[PERSONAL_PASSWORD] + personalPasswordLength);                 
+                 retVal = true;
+              }        
+              break;
+              
+           case FUNCTION_PASSWORD:
+              if(functionPasswordLength > 0) {
+                 functionPasswordLength--;
+                 textAreaUpdateObject.formatVectorPosition = (formatVectorStartingPosition[FUNCTION_PASSWORD] + functionPasswordLength);
+                 textAreaUpdateObject.documentPosition = (documentStartingPosition[FUNCTION_PASSWORD] + functionPasswordLength);                 
+                 retVal = true;
+              }         
+              break;            
+        }
+        
+        if(retVal = true) {
+           formatStrings.setElementAt("_", textAreaUpdateObject.formatVectorPosition);
+           formatStyleTypes.setElementAt("yellow", textAreaUpdateObject.formatVectorPosition);      
+        
+           textAreaUpdateObject.formatString = "_";
+           textAreaUpdateObject.formatStyleType = "yellow";
+        }       
+        
+        return retVal;
+    }   
+    
+    /**
+     * Overloads the CADScreenStyleSheet cycle() method.  If the ON_Login Screen is being displayed, cycling should be
+     * disabled until the user logs in.
+     *
+     * @return boolean always returns false
+     
+    public boolean cycle () {
+       return true;  //should be false  
+    }
+
+    /**
+     * Overloads CADScreenStyleSheet isCommandLineActive() method.  Command line input is not used in the LoginScreen,
+     * so return the command line is not active, return false.
+     *
+     * @return boolean always returns true
+       
+    public boolean isCommandLineActive() {
+       return false;    
+    }    
+   */
+}
Index: trunk/src/tmcsim/client/cadscreens/TO_RoutedMessage.java
===================================================================
--- trunk/src/tmcsim/client/cadscreens/TO_RoutedMessage.java	(revision 2)
+++ trunk/src/tmcsim/client/cadscreens/TO_RoutedMessage.java	(revision 2)
@@ -0,0 +1,61 @@
+package tmcsim.client.cadscreens;
+
+
+import javax.swing.text.Document;
+
+import tmcsim.cadmodels.CADRoutedMessage;
+import tmcsim.cadmodels.RoutedMessageModel;
+import tmcsim.client.cadscreens.view.CADMainView;
+import tmcsim.common.CADEnums.TEXT_STYLES;
+
+/**
+ * TO_RoutedMessage is the view component to the RoutedMessageModel
+ * model object.  The screen is shown when the user views a queued message.
+ * When the class is instantiated with reference to the model data and 
+ * document, string and style pairs are added to the view document.  
+ * This class extends from the CADMainView object, which
+ * contains the common methods and data needed for display and user
+ * interaction.  
+ *
+ * @see RoutedMessageModel
+ * @author Matthew Cechini 
+ * @version $Revision: 1.4 $ $Date: 2009/04/17 16:27:45 $
+ */
+public class TO_RoutedMessage extends CADMainView {
+
+    /** Instance of the model, containing the message data for this view class. */
+    private RoutedMessageModel theModel;
+    
+    /**
+     * Constructor. Initializes the screen with the appropriate formatted text.
+     *
+     * @param newModel The model data object.
+     * @param viewdoc  The Document object used for displaying the model data.
+     */
+    public TO_RoutedMessage(RoutedMessageModel newModel, Document viewDoc) {
+        super(viewDoc);
+        
+        theModel    = newModel;     
+        
+        initialize();
+    }   
+    
+    
+    /**
+     * This method initializes the screen's Document object with 
+     * text and style pairs to create the correct screen format.
+     */
+    private void initialize() { 
+        
+        CADRoutedMessage displayMessage = theModel.getCurrentMessage();
+        
+        addDocElement("FROM POS " +  displayMessage.fromPosition
+                + "     MESSAGE      " + "TO POS " 
+                + displayMessage.toPosition + "\n", TEXT_STYLES.CYAN);
+                        
+
+        addDocElement(displayMessage.message + "\n",
+                TEXT_STYLES.CYAN);
+        
+    }
+}
Index: trunk/src/tmcsim/client/cadscreens/view/CADDocElement.java
===================================================================
--- trunk/src/tmcsim/client/cadscreens/view/CADDocElement.java	(revision 2)
+++ trunk/src/tmcsim/client/cadscreens/view/CADDocElement.java	(revision 2)
@@ -0,0 +1,34 @@
+package tmcsim.client.cadscreens.view;
+
+import tmcsim.common.CADEnums.TEXT_STYLES;
+
+/**
+ * CADDocElement is a container class used in creation of document elements 
+ * for display in CADMainView Screens.  The CADDocElement contains a text 
+ * and style pair.  The style TEXT_STYLES enumeration value is used to 
+ * reference a specific style that has been initialized in the StylePane 
+ * that will be used for displaying the text.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public class CADDocElement {
+
+    /** Document element text. */
+    public String text;
+
+    /** Document element style. */
+    public TEXT_STYLES style;
+    
+    /**
+     * Constructor. 
+     * 
+     * @param t New text String.
+     * @param s New style.
+     */
+    public CADDocElement(String t, TEXT_STYLES s) {
+        text  = t;
+        style = s;
+    }
+    
+}
Index: trunk/src/tmcsim/client/cadscreens/view/CADMainView.java
===================================================================
--- trunk/src/tmcsim/client/cadscreens/view/CADMainView.java	(revision 2)
+++ trunk/src/tmcsim/client/cadscreens/view/CADMainView.java	(revision 2)
@@ -0,0 +1,403 @@
+package tmcsim.client.cadscreens.view;
+
+import java.awt.Color;
+import java.util.Observable;
+import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.JTextPane;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.Style;
+import javax.swing.text.StyleConstants;
+import javax.swing.text.StyleContext;
+
+import tmcsim.common.CADEnums.TEXT_STYLES;
+
+
+/**
+ * The CADMainView is the base view class for all CAD Screens.  The 
+ * Vector of CADDocElement objects contains all text/style pairs
+ * that will be used in creating a document for display.  Within the list of 
+ * CADDocElements are separate "pages."  CADDocElements that contain an endline 
+ * character signify the end of a line.  Each CADMainView "page" is a collection 
+ * of these lines.  The static MAIN_CAD_SCREEN_LINES defines how many lines are 
+ * displayed on each page.  When the refreshView() method is called, the 
+ * text/style pairs for the current page are added to the local Document object.
+ * The CADMainView keeps track of the current page, total number of pages, current
+ * number lines on the page displayed, and the total number of lines.  
+ * 
+ * @author
+ * @version
+ */
+public class CADMainView extends Observable {
+    
+    /** Error Logger.  */
+    private static Logger viewLogger = Logger.getLogger("tmcsim.client.cadscreens");
+    
+    /** Number of viewable lines on a CAD Screen page.  */
+    protected final static int MAIN_CAD_SCREEN_LINES = 20;
+    
+    /** Font size for text displayed on CAD Screen */
+    private final static int FONT_SIZE = 15;   
+    
+    /** Vector of Document elements used to create the display. */
+    private Vector<CADDocElement> theDocElements;
+    
+    /** Document displaying CAD Screen text. */
+    private Document  theDoc    = null;
+
+    /** JTextPane displaying CAD Screen text. */
+    private JTextPane stylePane = null;
+           
+    /** Current page number being viewed in this screen. (# => 1)*/
+    private int currentPage;
+    
+    /** Total number of pages for this screen. (# => 1)*/
+    private int totalPages; 
+    
+    /** Total number of lines on all pages for this screen. (# => 0)*/
+    private int totalLines;
+    
+    /** The number of lines displayed on the last page for this screen. (# => 0) */
+    private int lastPageLineCount;
+    
+
+    /**
+     * Constructor.  Initialize data objects and styles.
+     * 
+     * @param viewDoc Target Document for text display.
+     */
+    public CADMainView(Document viewDoc) {
+        
+        theDocElements    = new Vector<CADDocElement>(); 
+        
+        currentPage       = 1;
+        totalPages        = 1;      
+        totalLines        = 0;
+        lastPageLineCount = 0;      
+        
+        theDoc = viewDoc;
+        initStyles();
+        
+    }
+    
+    /**
+     * Method pads the parameter string with spaces to the right
+     * of the string until the string length is equal to the parameter
+     * length.  If the parameter width is less than the length of the
+     * parameter String, no action is taken.
+     * 
+     * @param str String to pad.
+     * @param width Desired string length.
+     * @return Padded string.
+     */
+    protected String rPad(String str, int width) 
+    {
+        StringBuffer buf = new StringBuffer(str);
+        while(buf.length() < width)
+            buf.append(" ");
+        
+        return buf.toString();      
+    }
+    
+    /**
+     * Method pads the parameter string with spaces to the left
+     * of the string until the string length is equal to the parameter
+     * length.  If the parameter width is less than the length of the
+     * parameter String, no action is taken.
+     * 
+     * @param str String to pad.
+     * @param width Desired string length.
+     * @return Padded string.
+     */    
+    protected String lPad(String str, int width) 
+    {
+        StringBuffer buf = new StringBuffer(str);
+        while(buf.length() < width)
+            buf.insert(0, " ");
+        
+        return buf.toString();      
+    }
+        
+    
+    /**
+     * Adds a new string to the list of format strings.  The parameter string 
+     * is tokenized by '\n' characters.  Each token is considered a new 
+     * "line" of text.  Strings without an endline character will be treated 
+     * as a text chunk.  Each new line or text chunk is added to the document 
+     * with the associated parameter text style.  For every new "line" 
+     * being added, the lastPageLineCount is incremented. While the 
+     * lastPageLineCount is < the maximum number of MAIN_CAD_SCREEN_LINES, 
+     * increment it.  When this becomes false, reset the lastPageLineCount 
+     * to 1 and increment the totalPages count.
+     *
+     * @param text Text string to add to the screen document
+     * @param style Text style to associate with the text being added.
+     */
+    protected void addDocElement(String text, TEXT_STYLES style) {
+        
+        int beginPos = 0;
+        int endlPos  = text.indexOf('\n', 0);
+        
+        while(endlPos != -1) {
+            
+            //if current lines less than max per page, add line, else add new page
+            if(lastPageLineCount < MAIN_CAD_SCREEN_LINES) 
+                lastPageLineCount++;
+            else {
+                lastPageLineCount = 1;
+                totalPages++;
+            }           
+            
+            totalLines++; //keep track of how many total lines have been added
+            endlPos++;    //include the endline character
+            theDocElements.add(new CADDocElement(text.substring(beginPos, endlPos), style));
+            
+            beginPos = endlPos; 
+            endlPos  = text.indexOf('\n', endlPos);
+        }
+        
+        if(beginPos != text.length()) {
+            theDocElements.add(new CADDocElement(text.substring(beginPos, text.length()), style));
+        }
+    }
+    
+    /**
+     * This method is used to move the screen's displayed information up one 
+     * page.  If the current page is greater than one, decrement the 
+     * currentPage variable and refresh the view.
+     */
+    public void pageUp() {
+        if(currentPage > 1) {
+            currentPage--;
+            
+            try {
+                refreshView(currentPage);
+            } catch (Exception e) {
+                // due to conditional statement, parameter will never be
+                // invalid.
+            }
+        }
+    }   
+
+    /**
+     * This method is used to move the screen's displayed information down one 
+     * page. If the current page is less than the total number of pages, 
+     * increment the currentPage variable and refresh the view.
+     */
+    public void pageDown() {
+        if (currentPage < totalPages) {
+            currentPage++;
+
+            try {
+                refreshView(currentPage);
+            } catch (Exception e) {
+                // due to conditional statement, parameter will never be
+                // invalid.
+            }
+        }
+    }    
+    
+    /**
+     * Get the current page number.
+     * 
+     * @return Current page number. (# >= 1)
+     */
+    public int getCurrentPage() {
+        return currentPage;
+    }
+    
+    /**
+     * This method refreshes the screen to a specific page, passed in as a 
+     * parameter.  The current document is cleared and the page scrolling
+     * text is updated according the new page position on the screen. 
+     * The document element index for the first line of the new page is found.
+     * All text and style pairs in the document elements for the new page are 
+     * added to the Document object.  Each pair that is added is checked 
+     * for endline character, signifying a new line.  This process ends when 
+     * enough pairs have been added to display the maximum number of lines on 
+     * the screen, or there are no more document elements.
+     * 
+     * @param gotoPage Page number to display.  (# >= 1)
+     */
+   public void refreshView(int gotoPage) {
+            
+       if(gotoPage > totalPages) {
+           currentPage = totalPages;
+       }
+       else {
+           currentPage = gotoPage;
+       }
+            
+        int currIndex = 0;
+        int lineCount = 0;
+        
+        try {
+            theDoc.remove(0, theDoc.getLength());
+
+            notifyPageScrolling();
+                        
+            //If the page being viewed is not the first page, search through
+            //the formatStrings vector until the first string of the current
+            //page is found.
+            if(currentPage != 1) {
+                while(currIndex < theDocElements.size() && 
+                      lineCount < ((currentPage - 1)*MAIN_CAD_SCREEN_LINES)) {
+                            
+                    lineCount += countEndLines(theDocElements.get(currIndex).text); 
+                    
+                    currIndex++;
+                }       
+            }               
+            //else this is the first page   
+            lineCount = 0;
+       
+            //always output the header bar
+            theDoc.insertString(theDoc.getLength(), 
+                                "==================================================" +
+                                "==============================" + "\n", 
+                                stylePane.getStyle(TEXT_STYLES.AQUA.style));
+                                 
+            //start outputting strings from the formatStrings vector, counting
+            //how many lines have been output                   
+            while(currIndex < theDocElements.size() && 
+                  lineCount < MAIN_CAD_SCREEN_LINES) {
+                    
+               theDoc.insertString(theDoc.getLength(), 
+                                   theDocElements.get(currIndex).text,
+                                   stylePane.getStyle(theDocElements.get(currIndex).style.style));              
+               
+               lineCount += countEndLines(theDocElements.get(currIndex).text);         
+               
+               currIndex++;                  
+            }
+        } 
+        catch (BadLocationException ble) {
+            viewLogger.logp(Level.SEVERE, "CADMainView", "refreshView()", 
+                    "Exception in updating view document.", ble);
+        }
+        
+    }
+   
+   /**
+    * This method counts the number of endline terminated strings contained 
+    * within the parameter string.
+    * 
+    * @param text A text string.
+    * @return The number of lines contained in the parameter text string.
+    */
+   private int countEndLines(String text) {
+       
+       int lastPos   = 0;
+       int endlCount = 0;
+       
+       while(text.indexOf("\n", lastPos) != -1) {
+           lastPos = text.indexOf("\n", lastPos) + 1;
+           endlCount++;
+       }
+       
+       return endlCount;
+   }
+   
+   /**
+    * This method determines whether the current CAD Screen can be paged up 
+    * or down, then notifies observers with the associated scrolling string.  
+    * <br>
+    * The following are the possible outcomes:
+    * 
+    * - Only page up          - "PGUP"
+    * - Only page down        - "PGDN"
+    * - Page up and page down - "UPDN"
+    * - No scrolling          - "    "
+    */
+   private void notifyPageScrolling() {
+       
+        String pageScrolling = "     ";    
+
+        if(totalLines < MAIN_CAD_SCREEN_LINES) {
+            //smile, only one page
+        }
+        else if((currentPage)*MAIN_CAD_SCREEN_LINES < totalLines &&
+                currentPage == 1) {
+            //pgdn
+            pageScrolling = "PG DN";
+        }
+        else if((currentPage)*MAIN_CAD_SCREEN_LINES < totalLines &&
+                currentPage > 1) {
+            //page up and down
+            pageScrolling = "UP DN";
+        }
+        else if(currentPage > 1) {
+            pageScrolling = "PG UP";
+        }
+        
+        setChanged();
+        notifyObservers(pageScrolling);
+               
+   }
+    
+   /** 
+    * This method intializes the stylePane with the styles found in the 
+    * TEXT_STYLES enumeration that are needed for main screen display. 
+    * The value of the static FONT_SIZE is used for text sizing, along
+    * with the COURIER font style.
+    */
+    private void initStyles() {
+        
+        stylePane = new JTextPane();
+        
+        Style def = StyleContext.getDefaultStyleContext().
+                                    getStyle(StyleContext.DEFAULT_STYLE);
+
+        Style regular = stylePane.addStyle(TEXT_STYLES.REGULAR.style, def);
+        StyleConstants.setFontFamily(def, TEXT_STYLES.COURIER.style);
+
+        Style s = stylePane.addStyle(TEXT_STYLES.ITALIC.style, regular);
+        StyleConstants.setItalic(s, true);
+
+        s = stylePane.addStyle(TEXT_STYLES.BOLD.style, regular);
+        StyleConstants.setBold(s, true);
+        
+        s = stylePane.addStyle(TEXT_STYLES.BLUE.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.blue);
+        StyleConstants.setFontSize(s, FONT_SIZE);
+        
+        s = stylePane.addStyle(TEXT_STYLES.AQUA.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, new Color(0,128,128));
+        StyleConstants.setFontSize(s, FONT_SIZE);                
+        
+        s = stylePane.addStyle(TEXT_STYLES.RED.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.red);           
+        StyleConstants.setFontSize(s, FONT_SIZE);
+        
+        s = stylePane.addStyle(TEXT_STYLES.GRAY.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.gray);           
+        StyleConstants.setFontSize(s, FONT_SIZE);
+        
+        s = stylePane.addStyle(TEXT_STYLES.CYAN.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.cyan);           
+        StyleConstants.setFontSize(s, FONT_SIZE);                
+
+        s = stylePane.addStyle(TEXT_STYLES.YELLOW.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.yellow);           
+        StyleConstants.setFontSize(s, FONT_SIZE);  
+
+        s = stylePane.addStyle(TEXT_STYLES.GREEN.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.green);           
+        StyleConstants.setFontSize(s, FONT_SIZE); 
+
+        s = stylePane.addStyle(TEXT_STYLES.ORANGE.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.orange);           
+        StyleConstants.setFontSize(s, FONT_SIZE);
+
+        s = stylePane.addStyle(TEXT_STYLES.REVERSE_CYAN.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.black);   
+        StyleConstants.ColorConstants.setBackground(s, Color.cyan);           
+        StyleConstants.setFontSize(s, FONT_SIZE);
+        
+    }           
+        
+    
+}
Index: trunk/src/tmcsim/client/cadscreens/view/CADCommandLineView.java
===================================================================
--- trunk/src/tmcsim/client/cadscreens/view/CADCommandLineView.java	(revision 2)
+++ trunk/src/tmcsim/client/cadscreens/view/CADCommandLineView.java	(revision 2)
@@ -0,0 +1,380 @@
+package tmcsim.client.cadscreens.view;
+
+import java.awt.Color;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.JTextPane;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.Style;
+import javax.swing.text.StyleConstants;
+import javax.swing.text.StyleContext;
+
+import tmcsim.client.CADCaret;
+import tmcsim.common.CADEnums.ARROW;
+import tmcsim.common.CADEnums.TEXT_STYLES;
+
+
+/**
+ * CADCommandLineView is the view class used in the CAD Client to
+ * display the current command line and process key presses.
+ * As characters are added and removed from the command line, the current
+ * text is contained within the commandLineText StringBuffer object.  The
+ * Document object is used to display the current command line text to the user.
+ * A position counter for the Caret is used to keep track of where input
+ * is to be received and characters are to be removed.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+@SuppressWarnings("serial")
+public class CADCommandLineView {
+    
+    /** Error Logger. */
+    private static Logger viewLogger = Logger.getLogger("tmcsim.client.cadscreens");
+
+    /** Font size for text displayed on CAD Screen */
+    private static int FONT_SIZE = 15;
+    
+    /** Document displaying CAD Screen text. */
+    private Document  theDoc    = null;
+
+    /** JTextPane displaying CAD Screen text. */
+    private JTextPane stylePane = null;
+    
+    /** Current position for text input. */
+    private int currentPosition;
+    
+    /** Current command line text. */
+    private StringBuffer commandLineText;    
+    
+    /** Caret used visually to track the current position of command line input. */
+    private CADCaret theCADCaret = null;
+    
+
+    /**
+     * Constructor.  Initialize data objects and styles.  Create the 
+     * CADCaret and add it to the parameter JTextPane.
+     * 
+     * @param textPane Target JTextPane whose Document object
+     * will be written to for command line display.
+     */
+    public CADCommandLineView(JTextPane textPane) {
+            
+        currentPosition = 0;
+        commandLineText = new StringBuffer(160);
+        
+        theCADCaret = new CADCaret();
+        
+        textPane.setCaret(theCADCaret);
+        textPane.setCaretColor(Color.yellow);
+        
+        theDoc = textPane.getDocument();    
+        initStyles();   
+        
+        clearCommandLine();
+        theCADCaret.setVisible(true);
+    }
+
+  
+    /**
+     * Sets the current command line with a new string.  Clear
+     * the current command line and then call the receiveKeyPress()
+     * method with each character in the new string.  The Caret
+     * is hidden during these operations to reduce erratic scroling.
+     * 
+     * @param cmdLine New command line text.
+     */
+    public void setCommandLine(String cmdLine) 
+    {
+        try
+        {
+            clearCommandLine();    
+    
+            theCADCaret.setVisible(false);
+            for(int i = 0; i < cmdLine.length(); i++) 
+                receiveKeyPress(cmdLine.charAt(i)); 
+            theCADCaret.setVisible(true);
+        }
+        catch (Exception e)
+        {
+            viewLogger.log(Level.SEVERE, "Exception occured while setting command line.", e);
+        }
+    } 
+    
+    /**
+     * Replaces the character at the curent command line position with an 
+     * empty space if the command line contains text. Decrement the position
+     * counter and move the caret back one space.
+     */
+    public void backspace() {
+            
+        try{
+            if(commandLineText.length() > 0 && currentPosition > 0) {
+                commandLineText.deleteCharAt(currentPosition-1);
+                
+                theDoc.remove(currentPosition-1, 1);
+                
+                if(currentPosition-1 == commandLineText.length()) {
+                    theDoc.insertString(currentPosition-1,
+                            " ",
+                            stylePane.getStyle(TEXT_STYLES.YELLOW.style));
+                }
+                else {
+                    theDoc.insertString(commandLineText.length(),
+                            " ",
+                            stylePane.getStyle(TEXT_STYLES.YELLOW.style));
+                }
+
+                currentPosition--;
+                theCADCaret.moveCaretBackward(1);
+            }
+            
+        } catch (BadLocationException ble) {
+            viewLogger.log(Level.SEVERE, "Exception in updating view document.", ble);
+        }       
+    }
+    
+
+    /**
+     * Receive a new key press from user.  If the current position is at least 
+     * one character before the end of the current commmand line text, replace 
+     * the current character with the new character and move the caret forward
+     * one space.  If not, the current position is at the end of the command 
+     * line.  If the command line is not full, add the new character at the 
+     * end of the command line and move the caret forward one space.  Else the
+     * command line is full, replace the last character with the new character 
+     * and do not move the caret. 
+     *
+     * @param inputChar Character being added to command line     
+     */
+    public void receiveKeyPress(char inputChar) {
+        
+        try {
+            //doesn't matter where we are, replace
+            if(currentPosition <= commandLineText.length() - 1 &&
+               commandLineText.length() != 0) 
+            {
+                
+                commandLineText.setCharAt(currentPosition, inputChar);              
+                theDoc.remove(currentPosition, 1);
+                theDoc.insertString(currentPosition,
+                                           String.valueOf(inputChar),
+                                           stylePane.getStyle(TEXT_STYLES.YELLOW.style));
+                currentPosition++;
+                theCADCaret.moveCaretForward(1);
+                
+            }
+            //else we are appending, be sure that the StringBuffer isn't full
+            else if(commandLineText.length() < 160) 
+            {
+                commandLineText.append(inputChar);
+                
+                theDoc.remove(currentPosition, 1);
+                theDoc.insertString(currentPosition,
+                                    String.valueOf(inputChar),
+                                    stylePane.getStyle(TEXT_STYLES.YELLOW.style));              
+                currentPosition = commandLineText.length();  
+                theCADCaret.moveCaretForward(1);                                
+                
+            }
+            else if(commandLineText.length() == 160) 
+            {
+                commandLineText.setCharAt(currentPosition-1, inputChar);    
+                theDoc.remove(currentPosition-1, 1);
+                theDoc.insertString(currentPosition-1,
+                                    String.valueOf(inputChar),
+                                    stylePane.getStyle(TEXT_STYLES.YELLOW.style));
+            }
+            
+        } catch (BadLocationException ble) {
+            viewLogger.log(Level.SEVERE, "Exception in updating view document.", ble);
+        }       
+    }
+    
+    /**
+     * Receive an arrow press by the user. The following actions are taken 
+     * for each direction:<br><br> 
+     * <br>
+     *<table cellpadding="2" cellspacing="2" border="1"
+     * style="text-align: left; width: 250px;">
+     *  <tbody>
+     *    <tr>
+     *      <th>Direction<br></th>
+     *      <th>Action Taken<br></th>
+     *    </tr>
+     *    <tr>
+     *      <td>LEFT<br></td>
+     *      <td>If command line position is not at the beginning of the command 
+     *          line, decrement the position and move the Caret back one space.</td>
+     *    </tr>
+     *    <tr>
+     *      <td>UP<br></td>
+     *      <td>If the command line position is at the end of a full(160 character) 
+     *          command, move back 81 characters to the end of the previous line.  
+     *          If the command line is not full, but the position is on the second 
+     *          line, move back 80 characters.  Move the Caret back the same
+     *          number of spaces.  (The descrepancy in moving 81 or 
+     *          80 charactes has to do with the value of the position counter 
+     *          when it is at the end of a full command line)</td>
+     *    </tr>
+     *    <tr>
+     *      <td>RIGHT</td>
+     *      <td>If command line position is not at the end of the command line,
+     *          increment the position and move the Caret foward one space.</td>
+     *    </tr>
+     *    <tr>
+     *      <td>DOWN</td>
+     *      <td>If the command line position is on the first line of the command 
+     *          line, and is directly above or to the left of the last character
+     *          on the second line, move forward 80 characters.  Else if the 
+     *          position is on the first line and there is a second line, move the 
+     *          position to the end of the command line.  Move the Caret forward
+     *          the same number of spaces.</td>
+     *    </tr>
+     *  </tbody>
+     *</table>
+     *
+     * @param direction Arrow direction.  
+     */
+    public void receiveArrow(ARROW direction) {
+
+        switch(direction) {
+            
+            case LEFT:
+                if(currentPosition > 0) { 
+                    currentPosition--;
+                    theCADCaret.moveCaretBackward(1);   
+                }
+                break;
+                    
+            case UP:
+                if(currentPosition == 160) {
+                    currentPosition -= 81;
+                    theCADCaret.moveCaretBackward(81);   
+                }
+                else if(currentPosition > 80) {
+                    currentPosition -= 80;
+                    theCADCaret.moveCaretBackward(80);   
+                }
+                break;
+                
+            case RIGHT:
+                if(currentPosition < commandLineText.length() - 1) {
+                    currentPosition++;
+                    theCADCaret.moveCaretForward(1);
+                }
+                break;
+                
+            case DOWN:
+                if(currentPosition < (commandLineText.length() - 80)) {
+                    currentPosition += 80;
+                    theCADCaret.moveCaretForward(80);
+                }
+                else if (currentPosition <= 80 && 
+                         commandLineText.length() <= currentPosition + 80) {
+
+                    theCADCaret.moveCaretForward(commandLineText.length() - 
+                            currentPosition);
+                    currentPosition = commandLineText.length();
+                }
+                break;
+            
+        }      
+    }
+
+
+    /**
+     * Refresh the command line by saving the text, clearing the current
+     * command line, and then calling the receiveKeyPress() method for all
+     * characters in the saved text.  The Caret is hidden during these 
+     * operations to eliminate erratic scrolling.
+     */
+    public void refreshView() {
+            
+        String savedCmdLine = commandLineText.toString();
+        
+        clearCommandLine();
+
+        theCADCaret.setVisible(false);
+
+        for(int pos = 0; pos < savedCmdLine.length(); pos++) {
+            receiveKeyPress(savedCmdLine.charAt(pos));
+        }
+        theCADCaret.setVisible(true);
+    }
+
+    /**
+     * Get the current command line string.
+     * @return Command line string.
+     */
+    public String getCommandLine() {
+        return commandLineText.toString();  
+    }  
+    
+    
+    /**
+     * Clears the command line by clearing the command line StringBuffer, 
+     * clearing the command line document, resetting the position count, and
+     * resetting the Caret. The Caret is hidden during these operations to 
+     * eliminate erratic scrolling.
+     */
+    public void clearCommandLine() 
+    {
+    
+        try 
+        {
+            theCADCaret.setVisible(false);
+            currentPosition = 0;
+            commandLineText.setLength(0);
+            
+            while(theDoc.getLength() > 0) 
+            {
+                theDoc.remove(0, 1);
+            }       
+            
+            for(int i = 0; i < 160; i++) 
+            {
+                theDoc.insertString(i,
+                        " ",
+                        stylePane.getStyle(TEXT_STYLES.YELLOW.style));
+            }
+
+            theCADCaret.resetCaretPosition();
+            theCADCaret.setVisible(true);
+        } 
+        catch (Exception e) 
+        {
+            viewLogger.log(Level.SEVERE, "Exception in updating view document.", e);
+        }           
+        
+    }   
+    
+
+    /** 
+     * This method intializes the stylePane with the styles found in the 
+     * TEXT_STYLES enumeration that are needed for command line display. 
+     * The value of the static FONT_SIZE is used for text sizing, along
+     * with the COURIER font style.
+     */
+    private void initStyles() {
+        
+        stylePane = new JTextPane();
+        
+        Style def = StyleContext.getDefaultStyleContext().
+                                        getStyle(StyleContext.DEFAULT_STYLE);
+                                        
+        Style regular = stylePane.addStyle(TEXT_STYLES.REGULAR.style, def);
+        StyleConstants.setFontFamily(def, TEXT_STYLES.COURIER.style);       
+        
+        Style s = stylePane.addStyle(TEXT_STYLES.YELLOW.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.yellow);           
+        StyleConstants.setFontSize(s, FONT_SIZE);  
+
+        s = stylePane.addStyle(TEXT_STYLES.GREEN.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.green);           
+        StyleConstants.setFontSize(s, FONT_SIZE);           
+    }
+    
+}
Index: trunk/src/tmcsim/client/cadscreens/view/CADFooterView.java
===================================================================
--- trunk/src/tmcsim/client/cadscreens/view/CADFooterView.java	(revision 2)
+++ trunk/src/tmcsim/client/cadscreens/view/CADFooterView.java	(revision 2)
@@ -0,0 +1,565 @@
+package tmcsim.client.cadscreens.view;
+
+
+import java.awt.Color;
+import java.util.Observable;
+import java.util.Observer;
+import java.util.TreeMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.JTextPane;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.Style;
+import javax.swing.text.StyleConstants;
+import javax.swing.text.StyleContext;
+
+import tmcsim.common.CADEnums.CADScreenNum;
+import tmcsim.common.CADEnums.TEXT_STYLES;
+
+
+/**
+ * CADFooterView is the base view class for the footer information displayed on
+ * all CAD Screens.  The footer is used to display the following information to
+ * the user:
+ * <br>
+ * <ul>
+ * <li>Information Messages</li>
+ * <li>CAD Date</li>
+ * <li>CAD Time</li>
+ * <li>Screen Updates</li>
+ * <li>Page Scrolling</li>
+ * <li>Queued Message Count/Update</li>
+ * <li>Current CAD Screen Number</li>
+ * </ul> 
+ * <br>
+ * The refreshView() method is used to add text/style pairs for the footer to the 
+ * local Document object.  Update methods are provided to modify values from the  
+ * previous list.  These updates only modify the portion of the footer that has
+ * changed.  This reduces redraw of the entire footer everytime a single value
+ * changes.
+ * 
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public class CADFooterView implements Observer {
+    
+    /** Error Logger.  */
+    private static Logger viewLogger = Logger.getLogger("tmcsim.client.cadscreens");
+
+    /** Font size for text displayed on CAD Screen */
+    private static final int FONT_SIZE = 15;
+    
+    /** Maximum information message length */
+    private static final int MAX_INFO_MESSAGE_LENGTH   = 50;    
+    
+    /**
+     * Enumeration containing document position values for specific text items.
+     * @author Matthew Cechini
+     */
+    private static enum DOCUMENT_POSITIONS {
+        /** Document position of the screen update status. */
+        UPDATE_STATUS_DOC_POS    (260),
+        /** Document position of the CAD date. */
+        CAD_DATE_DOC_POS         (245),
+        /** Document position of the CAD time. */
+        CAD_TIME_DOC_POS         (250),
+        /** Document position of the routed messages count. */
+        ROUTED_MESSAGE_DOC_POS   (297),
+        /** Document position of the page scrolling text. */
+        PAGE_SCROLLING_DOC_POS   (272),
+        /** Document position of the information message text. */
+        INFO_MESSAGE_DOC_POS     (81);
+        
+        public int pos;
+        
+        private DOCUMENT_POSITIONS(int p) {
+            pos = p;
+        }
+        
+    }
+
+    /** Document displaying CAD Screen text. */
+    private Document  theDoc    = null;
+
+    /** JTextPane displaying CAD Screen text. */
+    private JTextPane stylePane = null;
+    
+    /** Current page scrolling text. */
+    private String pageScrolling  = null; 
+    
+    /** Current CAD Date text. */ 
+    private String theCADDate     = null;
+    
+    /** Current CAD Time text. */
+    private String theCADTime     = null;
+    
+    /** Current number of routed messages. */
+    private int numberRoutedMessages;
+
+    /** Current flag of whether there are unread routed messages. */
+    private boolean unreadRoutedMessages;
+    
+    /** Current CAD Screen number. */
+    private CADScreenNum currentCADScreenNum;
+
+    /** Current update status for all CAD screens. */
+    private TreeMap<CADScreenNum, Boolean> screenUpdateMap;
+    
+    /**
+     * Constructor.  Initialize data elements and styles.
+     * 
+     * @param viewDoc Target Document for text display.
+     */
+    public CADFooterView(Document viewDoc) {
+        
+        numberRoutedMessages = 0;
+        currentCADScreenNum  = CADScreenNum.ONE;
+        unreadRoutedMessages = false;
+        screenUpdateMap      = new TreeMap<CADScreenNum, Boolean>();
+        
+        for(CADScreenNum screen : CADScreenNum.orderedList()) {
+            screenUpdateMap.put(screen, false);
+        }
+        
+        theDoc = viewDoc;        
+        initStyles();   
+            
+    }
+
+    /**
+     * This method implements the Observer interface method.  The footer
+     * is set up to observe the main cad screen and listen for page
+     * scrolling text updates.  The update Object argument is cast
+     * to a string and the page scrolling text is replaced in the 
+     * footer's display Document.
+     */
+    public void update(Observable o, Object arg) {
+        
+        pageScrolling = (String)arg;
+        
+        try {
+            if(theDoc.getLength() > 0) {
+                theDoc.remove(
+                        DOCUMENT_POSITIONS.PAGE_SCROLLING_DOC_POS.pos, 
+                        pageScrolling.length());
+                
+                theDoc.insertString(
+                        DOCUMENT_POSITIONS.PAGE_SCROLLING_DOC_POS.pos, 
+                        pageScrolling,
+                        stylePane.getStyle(TEXT_STYLES.YELLOW.style));
+            }
+        }
+        catch( BadLocationException ble) {
+            viewLogger.log(Level.SEVERE, "Exception in updating view document.", ble);
+        }
+    }
+    
+    /**
+     * Sets the footer's current CADScreen number.
+     * 
+     * @param screenNum New CADScreen number.
+     */
+    public void setCADScreenNum(CADScreenNum screenNum) {
+        currentCADScreenNum = screenNum;
+    }
+
+    /**
+     * This method updates the CAD Screen update portion of the footer.
+     * The screenUpdateMap is updated with the new update boolean 
+     * values from the parameter map.  The footer text is then
+     * updated with the new updates.  Screens with an update appear
+     * in yellow text, those without in green.    
+     *
+     * @param newStatus Map of CADScreenNum objects and their boolean update 
+     * values. Map entries for all CADScreenNum values are not needed.
+     */
+    public void updateStatus(TreeMap<CADScreenNum, Boolean> newUpdates) {       
+
+        for(CADScreenNum screen : CADScreenNum.orderedList()) {
+            if(newUpdates.get(screen) != null) { 
+                screenUpdateMap.put(screen, newUpdates.get(screen));
+            }
+        }
+
+        try {
+            if(theDoc.getLength() > 0) {        
+                for(CADScreenNum screen : CADScreenNum.orderedList()) {
+                    if(newUpdates.get(screen) != null && newUpdates.get(screen)) {
+                        theDoc.remove(
+                                DOCUMENT_POSITIONS.UPDATE_STATUS_DOC_POS.pos + 
+                                ((screen.intNum-1)*3), 1);
+                        theDoc.insertString(
+                                DOCUMENT_POSITIONS.UPDATE_STATUS_DOC_POS.pos + 
+                                ((screen.intNum-1)*3), 
+                                String.valueOf(screen.intNum),
+                                stylePane.getStyle(TEXT_STYLES.YELLOW.style));
+                    }
+                }
+            }
+        }
+        catch (BadLocationException ble) {
+            viewLogger.log(Level.SEVERE, "Exception in updating view document.", ble);
+        }
+    }
+    
+    /**
+     * This method updates the date portion of the footer.  Only
+     * those digits in the date that have changed are changed.
+     *
+     * @param newDate The new date with format: MMYY
+     */
+    public void updateDate(String newDate) {
+        
+        try {
+            if(theDoc.getLength() > 0) {
+                for(int i = 0; i < 4; i++) {             
+                    if(theCADDate.charAt(i) != newDate.charAt(i)) {
+                        theDoc.remove(
+                                DOCUMENT_POSITIONS.CAD_DATE_DOC_POS.pos+(i), 1);
+                        theDoc.insertString(
+                                DOCUMENT_POSITIONS.CAD_DATE_DOC_POS.pos + (i), 
+                                String.valueOf(newDate.charAt(i)),
+                                stylePane.getStyle(TEXT_STYLES.GREEN.style));
+                    }
+                }
+            }
+        }
+        catch (BadLocationException ble) {
+            viewLogger.log(Level.SEVERE, "Exception in updating view document.", ble);
+        }   
+        finally {
+            theCADDate = newDate;
+        }
+        
+    }
+    
+    /**
+     * This method updates the time portion of the footer.  Only
+     * those digits in the time that have changed are changed.
+     *
+     * @param newTime The new time with format: HHMM
+     */
+    public void updateTime(String newTime) {
+        
+        try {
+            if(theDoc.getLength() > 0) {
+                for(int i = 0; i < 4; i++) {
+             
+                    if(theCADTime.charAt(i) != newTime.charAt(i)) {
+                        theDoc.remove(
+                                DOCUMENT_POSITIONS.CAD_TIME_DOC_POS.pos +(i), 1);
+                        theDoc.insertString(
+                                DOCUMENT_POSITIONS.CAD_TIME_DOC_POS.pos + (i), 
+                                String.valueOf(newTime.charAt(i)),
+                                stylePane.getStyle(TEXT_STYLES.GREEN.style));
+                    }
+                }
+            }
+        }
+        catch (BadLocationException ble) {
+            viewLogger.log(Level.SEVERE, "Exception in updating view document.", ble);
+        }       
+        finally {
+            theCADTime = newTime;
+        }
+    }   
+    
+    /**
+     * This method updates the queued messages portion of the footer.  The
+     * parameter boolean value specifies whether there are unread messages
+     * or not.  If unread messages exist, the number of messages is highlighted
+     * with green and the text is displayed yellow.  If there are no unread
+     * messages, the text is displayed unhighlighted and with green text.
+     * 
+     * @param unread Boolean flag to toggle unread message highlighting.  true
+     * if unread messages exist, false if not.
+     */
+    public void updateUnreadMessages(Boolean unread) {
+        unreadRoutedMessages = unread;
+        
+        try {
+            if(theDoc.getLength() > 0) {
+            
+                theDoc.remove(
+                        DOCUMENT_POSITIONS.ROUTED_MESSAGE_DOC_POS.pos, 
+                        String.valueOf(numberRoutedMessages).length());
+                
+                if(unreadRoutedMessages) { 
+                    theDoc.insertString(
+                            DOCUMENT_POSITIONS.ROUTED_MESSAGE_DOC_POS.pos, 
+                            String.valueOf(numberRoutedMessages), 
+                            stylePane.getStyle(TEXT_STYLES.GREEN_HIGHLIGHT.style));
+                }
+                else {
+                    theDoc.insertString(
+                            DOCUMENT_POSITIONS.ROUTED_MESSAGE_DOC_POS.pos, 
+                            String.valueOf(numberRoutedMessages), 
+                            stylePane.getStyle(TEXT_STYLES.GREEN.style));
+                }
+            }
+        }
+        catch (BadLocationException ble) {
+            viewLogger.log(Level.SEVERE, "Exception in updating view document.", ble);
+        }
+        
+    }
+    
+    /**
+     * This method updates the queued messages portion of the footer.  The 
+     * parameter value is used to update the number of received routed 
+     * messages to this CAD position.  The current number of messages is 
+     * removed from the document and replaced with the new number.  If the 
+     * number of messages is 0, the text is written in yellow, else the text
+     * is written in green.
+     *
+     * @param newMessageCount Number of routed messages.
+     */
+    public void updateRoutedMessageCount(Integer newMessageCount) {
+        
+        numberRoutedMessages = newMessageCount;
+        
+        try {
+            if(theDoc.getLength() > 0) {
+            
+                theDoc.remove(
+                        DOCUMENT_POSITIONS.ROUTED_MESSAGE_DOC_POS.pos, 
+                        newMessageCount.toString().length());
+                if(numberRoutedMessages > 0) { 
+                    theDoc.insertString(
+                            DOCUMENT_POSITIONS.ROUTED_MESSAGE_DOC_POS.pos, 
+                            String.valueOf(numberRoutedMessages), 
+                            stylePane.getStyle(TEXT_STYLES.YELLOW.style));
+                }
+                else {
+                    theDoc.insertString(
+                            DOCUMENT_POSITIONS.ROUTED_MESSAGE_DOC_POS.pos, 
+                            String.valueOf(numberRoutedMessages), 
+                            stylePane.getStyle(TEXT_STYLES.GREEN.style));
+                }
+            }
+        }
+        catch (BadLocationException ble) {
+            viewLogger.log(Level.SEVERE, "Exception in updating view document.", ble);
+        }
+    }       
+    
+    
+    /**
+     * This method displays an informational message on the info line of the 
+     * footer.  The message to be displayed will be truncated to the maximum
+     * length which specified by the final static MAX_INFO_MESSAGE_LENGTH.
+     * Text output is written in white.
+     *
+     * @param message Message to display.
+     */
+    public void displayInfoMessage(String message) {
+        try {
+            
+            theDoc.remove(
+                    DOCUMENT_POSITIONS.INFO_MESSAGE_DOC_POS.pos, 
+                    MAX_INFO_MESSAGE_LENGTH);
+            
+            //TODO test truncation
+            if(message.length() > MAX_INFO_MESSAGE_LENGTH)
+                message = message.substring(0, MAX_INFO_MESSAGE_LENGTH);
+            
+            while(message.length() < MAX_INFO_MESSAGE_LENGTH)
+                message += " ";
+            
+            theDoc.insertString(
+                    DOCUMENT_POSITIONS.INFO_MESSAGE_DOC_POS.pos, 
+                    message,
+                    stylePane.getStyle(TEXT_STYLES.WHITE.style));
+        }
+        catch (BadLocationException ble) {
+            viewLogger.log(Level.SEVERE, "Exception in updating view document.", ble);
+        }
+    }
+    
+    
+    /**
+     * This method clears the display Document object and then adds text/style
+     * pairs to create the footer display document. A leading line of 80 '=' 
+     * characters in aqua is added for CAD Screen formatting, followed by a 
+     * blank line used to display info messages. The footer items then added in
+     * the following order:
+     * 
+     * <ul>
+     * <li>CAD Date</li>
+     * <li>CAD Time</li>
+     * <li>Screen Updates</li>
+     * <li>Page Scrolling</li>
+     * <li>Queued Message Count/Update</li>
+     * <li>Current CAD Screen Number</li>
+     * </ul>
+     */ 
+    public void refreshView() { 
+        try {
+                    
+            theDoc.remove(0, theDoc.getLength());
+         
+            //Load the text pane with styled text.
+            
+            theDoc.insertString(theDoc.getLength(), "==========================" +
+                    "======================================================\n", 
+                    stylePane.getStyle(TEXT_STYLES.AQUA.style));
+            theDoc.insertString(theDoc.getLength(), rPad("", 80) + "\n", 
+                    stylePane.getStyle(TEXT_STYLES.BLACK.style));       
+            theDoc.insertString(theDoc.getLength(), rPad("", 80) + "\n", 
+                    stylePane.getStyle(TEXT_STYLES.AQUA.style));    
+            theDoc.insertString(theDoc.getLength(), theCADDate +"/",
+                    stylePane.getStyle(TEXT_STYLES.GREEN.style));   
+            theDoc.insertString(theDoc.getLength(), rPad(theCADTime, 5),
+                    stylePane.getStyle(TEXT_STYLES.GREEN.style));                                
+                                                             
+            theDoc.insertString(theDoc.getLength(), "REF: ",
+                    stylePane.getStyle(TEXT_STYLES.GREEN.style));   
+
+            for(CADScreenNum screen : CADScreenNum.orderedList()) {
+                if(screenUpdateMap.get(screen)) {
+                      theDoc.insertString(theDoc.getLength(), String.valueOf(screen.intNum), 
+                              stylePane.getStyle(TEXT_STYLES.YELLOW.style));        
+                }
+                else {
+                      theDoc.insertString(theDoc.getLength(), String.valueOf(screen.intNum), 
+                              stylePane.getStyle(TEXT_STYLES.GREEN.style)); 
+                }
+                theDoc.insertString(theDoc.getLength(), "  ",
+                        stylePane.getStyle(TEXT_STYLES.GREEN.style));   
+            }
+                                                                          
+            theDoc.insertString(theDoc.getLength(), pageScrolling,
+                                stylePane.getStyle(TEXT_STYLES.YELLOW.style));                                                               
+    
+            theDoc.insertString(theDoc.getLength(), rPad(lPad("CAD: 0  0  0", 18), 20), 
+                    stylePane.getStyle(TEXT_STYLES.GREEN.style));                   
+            
+            if(unreadRoutedMessages)                 
+                theDoc.insertString(theDoc.getLength(), String.valueOf(numberRoutedMessages),
+                        stylePane.getStyle(TEXT_STYLES.GREEN_HIGHLIGHT.style));                 
+            else 
+                theDoc.insertString(theDoc.getLength(), String.valueOf(numberRoutedMessages),
+                        stylePane.getStyle(TEXT_STYLES.GREEN.style));
+            
+            theDoc.insertString(theDoc.getLength(), lPad("CLETS: 0 0", 13), 
+                                       stylePane.getStyle(TEXT_STYLES.GREEN.style));
+            theDoc.insertString(theDoc.getLength(), rPad(lPad("MIS: 0", 8), 10), 
+                       stylePane.getStyle(TEXT_STYLES.GREEN.style));
+                             
+            theDoc.insertString(theDoc.getLength(), String.valueOf(currentCADScreenNum.intNum), 
+                                       stylePane.getStyle("red"));                               
+                      
+        } 
+        catch (BadLocationException ble) {
+            viewLogger.log(Level.SEVERE, "Exception in updating view document.", ble);
+        }
+        
+    }   
+        
+    /**
+     * Method pads the parameter string with spaces to the right
+     * of the string until the string length is equal to the parameter
+     * length.  If the parameter width is less than the length of the
+     * parameter String, no action is taken.
+     * 
+     * @param str String to pad.
+     * @param width Desired string length.
+     * @return Padded string.
+     */
+    protected String rPad(String str, int width) 
+    {
+        StringBuffer buf = new StringBuffer(str);
+        while(buf.length() < width)
+            buf.append(" ");
+        
+        return buf.toString();      
+    }
+    
+    /**
+     * Method pads the parameter string with spaces to the left
+     * of the string until the string length is equal to the parameter
+     * length.  If the parameter width is less than the length of the
+     * parameter String, no action is taken.
+     * 
+     * @param str String to pad.
+     * @param width Desired string length.
+     * @return Padded string.
+     */    
+    protected String lPad(String str, int width) 
+    {
+        StringBuffer buf = new StringBuffer(str);
+        while(buf.length() < width)
+            buf.insert(0, " ");
+        
+        return buf.toString();      
+    }
+    
+    /** 
+     * This method intializes the stylePane with the styles found in the 
+     * TEXT_STYLES enumeration that are needed for footer display. 
+     * The value of the static FONT_SIZE is used for text sizing, along
+     * with the COURIER font style.
+     */
+    private void initStyles() {
+              
+        stylePane = new JTextPane();
+              
+        Style def = StyleContext.getDefaultStyleContext().
+                                        getStyle(StyleContext.DEFAULT_STYLE);
+                                        
+        Style regular = stylePane.addStyle(TEXT_STYLES.REGULAR.style, def);
+        StyleConstants.setFontFamily(def, TEXT_STYLES.COURIER.style);                                        
+                                        
+        Style s = stylePane.addStyle(TEXT_STYLES.ITALIC.style, regular);
+        StyleConstants.setItalic(s, true);
+
+        s = stylePane.addStyle(TEXT_STYLES.BOLD.style, regular);
+        StyleConstants.setBold(s, true);
+        
+        s = stylePane.addStyle(TEXT_STYLES.BLUE.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.blue);
+        StyleConstants.setFontSize(s, FONT_SIZE);
+        
+        s = stylePane.addStyle(TEXT_STYLES.AQUA.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, new Color(0,128,128));
+        StyleConstants.setFontSize(s, FONT_SIZE);  
+        
+        s = stylePane.addStyle(TEXT_STYLES.RED.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.red);           
+        StyleConstants.setFontSize(s, FONT_SIZE);
+        
+        s = stylePane.addStyle(TEXT_STYLES.GRAY.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.gray);           
+        StyleConstants.setFontSize(s, FONT_SIZE);
+        
+        s = stylePane.addStyle(TEXT_STYLES.CYAN.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.cyan);           
+        StyleConstants.setFontSize(s, FONT_SIZE);                
+
+        s = stylePane.addStyle(TEXT_STYLES.YELLOW.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.yellow);           
+        StyleConstants.setFontSize(s, FONT_SIZE);  
+
+        s = stylePane.addStyle(TEXT_STYLES.WHITE.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.white);           
+        StyleConstants.setFontSize(s, FONT_SIZE); 
+
+        s = stylePane.addStyle(TEXT_STYLES.GREEN.style, regular);
+        StyleConstants.ColorConstants.setForeground(s, Color.green);           
+        StyleConstants.setFontSize(s, FONT_SIZE); 
+        
+        s = stylePane.addStyle(TEXT_STYLES.REVERSE_GREEN.style, regular);         
+        StyleConstants.ColorConstants.setBackground(s, Color.green);           
+        StyleConstants.ColorConstants.setForeground(s, Color.black);  
+        StyleConstants.setFontSize(s, FONT_SIZE);    
+
+        s = stylePane.addStyle(TEXT_STYLES.GREEN_HIGHLIGHT.style, regular);         
+        StyleConstants.ColorConstants.setBackground(s, Color.green);           
+        StyleConstants.ColorConstants.setForeground(s, Color.yellow);  
+        StyleConstants.setFontSize(s, FONT_SIZE);        
+        
+    }
+}
Index: trunk/src/tmcsim/client/package.html
===================================================================
--- trunk/src/tmcsim/client/package.html	(revision 2)
+++ trunk/src/tmcsim/client/package.html	(revision 2)
@@ -0,0 +1,5 @@
+<html>
+  <body>
+  	This package contains the classes for the CAD Client.
+  </body>
+</html>
Index: trunk/src/tmcsim/client/CADClientSocket.java
===================================================================
--- trunk/src/tmcsim/client/CADClientSocket.java	(revision 2)
+++ trunk/src/tmcsim/client/CADClientSocket.java	(revision 2)
@@ -0,0 +1,88 @@
+package tmcsim.client;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+
+import tmcsim.common.SimulationException;
+
+
+/**
+ * CADClientSocket contains the Socket used to communication between the CAD 
+ * Client and the CAD Simulator. This class uses the host and port parameter 
+ * values to connect to the CAD Simulator's ServerSocket. I/O streams are 
+ * created from this connection to transfer all data between applications.
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/06 20:46:41 $ $Revision: 1.3 $
+ */
+class CADClientSocket { 
+    
+    /** Socket used to communicate to the CAD Simulator. */
+    private Socket clientSocket;
+          
+    /**
+     * Constructor accepting the hostname and port for the CAD Simulator's socket.
+     *
+     * @param newhost Target host name for CAD Simulator.
+     * @param newport Target port for CAD Simulator.
+     * @throws SimulationException if there is an exception in connecting to the CAD Simulator.
+     */    
+    CADClientSocket(String newhost, int newport) throws SimulationException {
+       
+        try {
+            clientSocket = new Socket();
+            clientSocket.connect(new InetSocketAddress(newhost, newport), 5000); 
+        } 
+        catch (IOException ioe) {
+            throw new SimulationException(SimulationException.CAD_SIM_CONNECT, ioe);
+        }
+        
+    }   
+   
+    /**
+     * Returns a reference to the input stream associated with this socket.
+     *
+     * @return InputStream Input Stream for socket.
+     * @throws SimulationException if there is an exception in opening the input stream.
+     */     
+    public InputStream getInputStream() throws SimulationException {
+        try {
+            return clientSocket.getInputStream();
+        } 
+        catch (IOException ioe) {
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, ioe);
+        }
+    }
+    
+    /**
+     * Returns a reference to the output stream associated with this socket.
+     *
+     * @return OutputStream Output Stream for socket.
+     * @throws SimulationException if there is an exception in opening the output stream.
+     */     
+    public OutputStream getOutputStream() throws SimulationException {
+        try {
+            return clientSocket.getOutputStream();
+        } 
+        catch (IOException ioe) {
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, ioe);
+        }
+    }           
+      
+    /**
+     * Closes the Socket.
+     * 
+     * @throws SimulationException if there is an exception in closing the socket.
+     */
+    public void closeSocket() throws SimulationException {
+        try {
+            clientSocket.close(); 
+        } 
+        catch (IOException ioe) {
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, ioe);
+        }
+    }
+}
Index: trunk/src/tmcsim/client/CADClientView.java
===================================================================
--- trunk/src/tmcsim/client/CADClientView.java	(revision 2)
+++ trunk/src/tmcsim/client/CADClientView.java	(revision 2)
@@ -0,0 +1,776 @@
+package tmcsim.client;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.util.Observable;
+import java.util.Observer;
+import java.util.TreeMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTextPane;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import tmcsim.cadmodels.BlankScreenModel;
+import tmcsim.cadmodels.CADScreenModel;
+import tmcsim.cadmodels.IncidentBoardModel;
+import tmcsim.cadmodels.IncidentInquiryModel;
+import tmcsim.cadmodels.IncidentSummaryModel;
+import tmcsim.cadmodels.RoutedMessageModel;
+import tmcsim.client.cadscreens.IB_IncidentBoard;
+import tmcsim.client.cadscreens.II_IncidentInquiry;
+import tmcsim.client.cadscreens.SA_IncidentSummary;
+import tmcsim.client.cadscreens.TO_RoutedMessage;
+import tmcsim.client.cadscreens.view.CADCommandLineView;
+import tmcsim.client.cadscreens.view.CADFooterView;
+import tmcsim.client.cadscreens.view.CADMainView;
+import tmcsim.common.ObserverMessage;
+import tmcsim.common.CADEnums.ARROW;
+import tmcsim.common.CADEnums.CADScreenNum;
+import tmcsim.common.CADEnums.CAD_ERROR;
+import tmcsim.common.CADEnums.CAD_KEYS;
+import tmcsim.common.CADProtocol.CAD_CLIENT_CMD;
+
+/**
+ * The CADClientView class is the view component to the CAD Client application.
+ * The CADSCreen is displayed with three separate view components: Command Line,
+ * Main Text Area, and Footer.  User input is handled by the Command Line Pane.
+ * Any commands are sent to the model which are then transmitted to the
+ * CAD Simulator.  The view keeps track of current CAD Screen Number and the
+ * current page being displayed on each screen.  This allows for the screen
+ * refresh and cycle commands to return the screen to its previous page. 
+ * 
+ * This view class observers the CADClientModel, listening for updates
+ * from the CAD Simulator.  Updates include new CADScreenModel objects notifying 
+ * that a new screen is to be displayed.  Other update data includes the current 
+ * CAD time, number of routed messages, screen update map, and information messages.  
+ * These are all displayed in the CAD Footer.
+ * 
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2009/04/20 17:58:27 $ $Revision: 1.7 $
+ */
+@SuppressWarnings("serial")
+public class CADClientView extends JFrame implements KeyListener, Observer {
+    
+    /** Error Logger. */
+    private static Logger cadLogger = Logger.getLogger("tmcsim.client");
+    
+    /** Reference to the CADClient model object. */
+    private CADClientModel theModel = null;
+      
+    /** View pane for the CAD Screen command line area. */
+    private CADCommandLineView CADCommandLinePane = null;
+      
+    /** View pane for the CAD Screen main area. */
+    private CADMainView        CADMainPane        = null;
+      
+    /** View pane for the CAD Screen footer area. */
+    private CADFooterView      CADFooterPane      = null;    
+    
+    /** CAD Command Line Parser.  */
+    private CADCommandParser cmdParser;
+
+    /** Boolean flag to designate whether the shift key is being pressed. */
+    private boolean shiftKeyPressed = false;
+          
+    /** Current CAD Screen number. */
+    private CADScreenNum currentScreenNum = null;
+    
+    /** Map of CADScreen numbers and the current page displayed on that screen. */
+    private TreeMap<CADScreenNum, Integer> pageLocationMap = null;
+    
+    /** Flag designating whether the screen's page location has been saved. */
+    private boolean pageLocationSaved = false;
+
+    /**
+     * Constructor. Build panes, add key listeners, and set up observer
+     * relationship between the footer and main panes.
+     * 
+     * @param position
+     *            The CAD position for this client terminal.
+     */
+    public CADClientView(CADClientModel mod) {
+        super("CAD Client");
+        theModel = mod;
+        
+        
+        cmdParser = new CADCommandParser();
+        
+        //Build and initialize all initial screens to the first page.
+        pageLocationMap = new TreeMap<CADScreenNum, Integer>();
+        for(CADScreenNum screen : CADScreenNum.values()) 
+        {
+            pageLocationMap.put(screen, 1);
+        }
+        
+        currentScreenNum = CADScreenNum.orderedList().get(0);
+        
+        buildPanes();       
+        buildPanels();
+
+        cmdLineTextPane.addKeyListener(this);
+        mainTextPane.addKeyListener(this);
+        footerTextPane.addKeyListener(this);
+    
+
+        CADMainPane.addObserver(CADFooterPane);
+        
+    }
+    
+    /**
+     * Build the command line, main, and footer text panes.
+     */
+    private void buildPanes() {
+
+        cmdLineTextPane    = new JTextPane();
+        cmdLineTextPane.setSize(new Dimension(730, 50)); 
+        cmdLineTextPane.setMinimumSize(new Dimension(730, 50));
+        cmdLineTextPane.setMaximumSize(new Dimension(730, 50));
+        cmdLineTextPane.setBorder(BorderFactory.createLineBorder(Color.black));
+
+        cmdLineTextPane.setBackground(Color.black);
+        cmdLineTextPane.setEditable(false);
+        CADCommandLinePane = new CADCommandLineView(cmdLineTextPane);
+        
+        mainTextPane = new JTextPane();
+        mainTextPane.setSize(new Dimension(730, 455));
+        mainTextPane.setMaximumSize(new Dimension(730, 455));
+        mainTextPane.setMinimumSize(new Dimension(730, 455));
+        mainTextPane.setBorder(BorderFactory.createLineBorder(Color.black));   
+        mainTextPane.setBackground(Color.black);
+        mainTextPane.setEditable(false);  
+        CADMainPane  = new CADMainView(mainTextPane.getDocument());      
+
+        footerTextPane = new JTextPane();
+        footerTextPane.setSize(new Dimension(730, 95)); 
+        footerTextPane.setMaximumSize(new Dimension(730, 95));
+        footerTextPane.setMinimumSize(new Dimension(730, 95));
+        footerTextPane.setBorder(BorderFactory.createLineBorder(Color.black));    
+        footerTextPane.setBackground(Color.black);
+        footerTextPane.setEditable(false);
+        CADFooterPane  = new CADFooterView(footerTextPane.getDocument());
+    }
+    
+    
+    /**
+     * Build the command line, main, and footer panels.
+     */
+    private void buildPanels() {
+        
+        cmdLinePanel = new JPanel();
+        cmdLinePanel.setSize(new Dimension(800, 50)); 
+        cmdLinePanel.setMinimumSize(new Dimension(800, 50));
+        cmdLinePanel.setMaximumSize(new Dimension(800, 50));
+        cmdLinePanel.setBackground(Color.black);
+        
+        Box cmdLineBox = new Box(BoxLayout.Y_AXIS);
+        cmdLineBox.add(Box.createHorizontalStrut(35));
+        cmdLineBox.add(cmdLineTextPane);
+        cmdLineBox.add(Box.createHorizontalStrut(35));
+        
+        cmdLinePanel.add(cmdLineBox);
+        
+        //***************************************************//
+        
+        mainPanel    = new JPanel();
+        mainPanel.setSize(new Dimension(800, 455)); 
+        mainPanel.setMaximumSize(new Dimension(800, 455));
+        mainPanel.setMinimumSize(new Dimension(800, 455));
+        mainPanel.setBackground(Color.black);
+       
+        
+        Box mainBox = new Box(BoxLayout.Y_AXIS);
+        mainBox.add(Box.createHorizontalStrut(35));
+        mainBox.add(mainTextPane);
+        mainBox.add(Box.createHorizontalStrut(35));
+        
+        mainPanel.add(mainBox);
+
+        //***************************************************//
+        
+        footerPanel  = new JPanel();        
+        footerPanel.setSize(new Dimension(800, 95)); 
+        footerPanel.setMaximumSize(new Dimension(800, 95));
+        footerPanel.setMinimumSize(new Dimension(800, 95));
+        footerPanel.setBackground(Color.black);
+        
+        Box footerBox = new Box(BoxLayout.Y_AXIS);
+        footerBox.add(Box.createHorizontalStrut(35));
+        footerBox.add(footerTextPane);
+        footerBox.add(Box.createHorizontalStrut(35));
+        
+        footerPanel.add(footerBox);
+        
+    }
+        
+    
+    /**
+     * Method adds the three CAD Screen components (CommandLine, MainTextArea, 
+     * Footer) to this view class.  The background is set to black, resized
+     * to 800x600, and shown to the screen.
+     */
+    public void initWindow() {
+        add(initBox());
+
+        addKeyListener(this);
+        setBackground(Color.black);     
+        setSize(new Dimension(800, 600));
+        setUndecorated(true);       
+        setVisible(true);       
+                
+    }
+    
+    /**
+     * Method contructs a box out of the three CAD Screen components:
+     * CommandLine, MainTextArea, Footer.  The Command Line panel is placed
+     * above the main text area panel, which is above the footer panel.
+     *
+     * @return Box Box containing all three panels.
+     */
+    public Box initBox() {
+        Box theBox = new Box(BoxLayout.Y_AXIS);
+        theBox.add(cmdLinePanel);
+        theBox.add(mainPanel);
+        theBox.add(footerPanel);    
+        theBox.setBackground(Color.black);
+        
+        return theBox;
+    }
+
+    /**  
+     * This method is called by the implemented KeyListener whenever a key is pressed.  The following
+     * keystrokes are listened for in this method.  Each keystroke pressed is referenced by the keycode 
+     * for the associated key.  These key codes are defined in the CADProtocol class.
+     *
+     * 
+     *<table cellpadding="2" cellspacing="2" border="1"
+     * style="text-align: left; width: 250px;">
+     *  <tbody>
+     *    <tr>
+     *      <th>CAD Protocol Command<br></th>
+     *      <th>Action Taken<br></th>
+     *    </tr>
+     *    <tr>
+     *      <td>SHIFT_KEY<br></td>
+     *      <td>Set shiftKeyPressed flag to true.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>COMMAND_LINE_CLEAR<br></td>
+     *      <td>If the shift key is pressed, clear the current CAD Screen's command line.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>SCREEN_CLEAR<br></td>
+     *      <td>If the shift key is pressed, transmit the SCREEN_CLEAR
+     *          command as a TERMINAL_FUNCTION to the CAD Simulator<br></td>
+     *   </tr>
+     *  </tbody>
+     *</table>
+     *
+     * @param e KeyEvent
+     */
+    public void keyPressed(KeyEvent evt) { 
+       //System.out.println("keyPressed" + evt.getKeyCode());   
+       
+        switch(CAD_KEYS.fromValue(CAD_KEYS.keyboard_type, evt.getKeyCode())) {  
+            case  SHIFT_KEY: 
+                shiftKeyPressed = true;
+                break; 
+                
+            case COMMAND_LINE_CLEAR:        
+                if(shiftKeyPressed)  {
+                    CADCommandLinePane.clearCommandLine();
+                }
+                break;
+    
+            case SCREEN_CLEAR:     
+                if(shiftKeyPressed) {          
+                    try {
+                        Document cmdDoc = DocumentBuilderFactory.newInstance()
+                            .newDocumentBuilder().newDocument();
+                        Element cmdElem = cmdDoc.createElement(
+                                CAD_CLIENT_CMD.TERMINAL_FUNCTION.type);                 
+                        cmdElem.appendChild(cmdDoc.createTextNode(
+                                CAD_KEYS.keyboard_type + ":" + 
+                                String.valueOf(evt.getKeyCode())));                 
+                        cmdDoc.appendChild(cmdElem);            
+                        theModel.transmitCommand(cmdDoc);                           
+                    } catch (Exception e) {
+                        cadLogger.logp(Level.SEVERE, "CADClientView", "keyPressed()",
+                                "Exception in sending screen clear command.", e);
+                    }
+                }
+                break;      
+        }
+    }
+        
+    /**
+     * This method is called by the implemented KeyListener whenever a key is released.  The following
+     * keystrokes are listened for in this method.  Each keystroke released is referenced by the keycode 
+     * for the associated key.  These key codes are defined in the CADProtocol class.
+     *
+     *<table cellpadding="2" cellspacing="2" border="1"
+     * style="text-align: left; width: 250px;">
+     *  <tbody>
+     *    <tr>
+     *      <th>CAD Protocol Command<br></th>
+     *      <th>Action Taken<br></th>
+     *    </tr>
+     *    <tr>
+     *      <td>SHIFT_KEY<br></td>
+     *      <td>Set the shiftKeyPressed flag to false.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>CYCLE<br></td>
+     *      <td>Preserve the current page number to return the screen to the same location after 
+     *          the cycle.  Transmit the current command line to the CAD Simulator with a 
+     *          SAVE_COMMAND_LINE message type.  Transmit the CYCLE command as a 
+     *          TERMINAL_FUNCTION to the CAD Simulator.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>REFRESH<br></td>
+     *      <td>Preserve the current page number to return the screen to the same location after 
+     *          the refresh.  Transmit the current command line to the CAD Simulator with a 
+     *          SAVE_COMMAND_LINE message type.  Transmit the CYCLE command as a 
+     *          TERMINAL_FUNCTION to the CAD Simulator.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>PGDN</td>
+     *      <td>Notify the main pane object of the received page down command.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>PGUP</td>
+     *      <td>Notify the main pane object of the received page up command.<br> </td>
+     *    </tr>
+     *    <tr>
+     *      <td>LEFT_ARROW</td>
+     *      <td>Notify the command line pane object of the received left arrow.<br> </td>
+     *    </tr>
+     *    <tr>
+     *      <td>UP_ARROW</td>
+     *      <td>Notify the command line pane object of the received up arrow.<br> </td>
+     *    </tr>
+     *    <tr>
+     *      <td>RIGHT_ARROW</td>
+     *      <td>Notify the command line pane object of the received right arrow.<br> </td>
+     *    </tr>
+     *    <tr>
+     *      <td>DOWN_ARROW</td>
+     *      <td>Notify the command line pane object of the received down arrow.<br> </td>
+     *    </tr>
+     *    <tr>
+     *      <td>COMMAND_LINE_TX<br> </td>
+     *      <td>Parse the current command line and create an XMLWriter with the 
+     *          converted XML representation of the command line data.
+     *          Transmit the command line as a TERMINAL_CMD_LINE message to 
+     *          the CAD Simulator.  Clear the current CAD screen's command line.
+     *          If there is an error in parsing, show the corresponding error
+     *          message and clear the command line.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>NEXT_QUEUE<br></td>
+     *      <td>Transmit the NEXT_QUEUE command as a TERMINAL_FUNCTION to the CAD Simulator.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>DELETE_QUEUE<br></td>
+     *      <td>Transmit the DELETE_QUEUE command as a TERMINAL_FUNCTION to the CAD Simulator.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>PREV_QUEUE<br></td>
+     *      <td>Transmit the PREV_QUEUE command as a TERMINAL_FUNCTION to the CAD Simulator.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>BACKSPACE<br></td>
+     *      <td>Notify the command line pane of the received backspace command.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>ENTER<br></td>
+     *      <td>Currently, do nothing<br></td>
+     *    </tr>
+     *  </tbody>
+     *</table>
+     *
+     * @param e KeyEvent
+     */        
+    public void keyReleased(KeyEvent evt) {
+       //System.out.println("keyReleased" + evt.getKeyCode());       
+        
+        switch(CAD_KEYS.fromValue(CAD_KEYS.keyboard_type, evt.getKeyCode())) {  
+            
+            case  SHIFT_KEY: 
+                shiftKeyPressed = false;
+                break; 
+
+            case REFRESH:
+            case CYCLE: 
+
+                pageLocationSaved = true;
+                pageLocationMap.put(currentScreenNum, CADMainPane.getCurrentPage());
+
+                try {
+                    Document cmdDoc = DocumentBuilderFactory.newInstance()
+                            .newDocumentBuilder().newDocument();
+                    Element cmdElem = cmdDoc.createElement(
+                            CAD_CLIENT_CMD.SAVE_COMMAND_LINE.type);                 
+                    cmdElem.appendChild(cmdDoc.createTextNode(
+                            CADCommandLinePane.getCommandLine()));
+                    cmdDoc.appendChild(cmdElem);                                    
+                    theModel.transmitCommand(cmdDoc);
+                                        
+                    cmdDoc = DocumentBuilderFactory.newInstance()
+                            .newDocumentBuilder().newDocument();
+                    cmdElem = cmdDoc.createElement(
+                            CAD_CLIENT_CMD.TERMINAL_FUNCTION.type);                 
+                    cmdElem.appendChild(cmdDoc.createTextNode(
+                            CAD_KEYS.keyboard_type + ":" + 
+                            String.valueOf(evt.getKeyCode())));                 
+                    cmdDoc.appendChild(cmdElem);            
+                    theModel.transmitCommand(cmdDoc);           
+                    
+                } catch (Exception e) {
+                    cadLogger.logp(Level.SEVERE, "CADClientView", 
+                            "keyReleased()",
+                            "Exception in sending cycle command.", e);
+                }
+                break;                  
+            
+            case PGDN:
+               
+               CADMainPane.pageDown();
+               break;
+            
+            case PGUP: 
+            
+               CADMainPane.pageUp();
+               break;  
+               
+            case LEFT_ARROW: 
+            
+               CADCommandLinePane.receiveArrow(ARROW.LEFT);
+               break;  
+               
+            case UP_ARROW: 
+            
+               CADCommandLinePane.receiveArrow(ARROW.UP);
+               break;  
+    
+            case RIGHT_ARROW: 
+            
+               CADCommandLinePane.receiveArrow(ARROW.RIGHT);
+               break;  
+    
+            case DOWN_ARROW: 
+            
+               CADCommandLinePane.receiveArrow(ARROW.DOWN);
+               break;                                                  
+    
+            case COMMAND_LINE_TX:
+                   
+                try {
+                    Document cmdDoc = DocumentBuilderFactory.newInstance()
+                        .newDocumentBuilder().newDocument();
+                    Element cmdElem = cmdDoc.createElement(CAD_CLIENT_CMD.TERMINAL_CMD_LINE.type);
+                    
+                    cmdParser.parseCommand(cmdElem, CADCommandLinePane.getCommandLine());
+                    cmdDoc.appendChild(cmdElem);
+                
+                    theModel.transmitCommand(cmdDoc);
+            
+                    CADCommandLinePane.clearCommandLine();
+
+                    pageLocationSaved = false;
+                }
+                catch (Exception ex) {
+                    CADFooterPane.displayInfoMessage(CAD_ERROR.UNAUTH_CMD.message);
+                    CADCommandLinePane.clearCommandLine();
+                }
+                break;  
+    
+            case PREV_QUEUE:
+            case DELETE_QUEUE:
+            case NEXT_QUEUE:
+                try {
+                    Document cmdDoc = DocumentBuilderFactory.newInstance()
+                            .newDocumentBuilder().newDocument();
+                    Element cmdElem = cmdDoc.createElement(
+                            CAD_CLIENT_CMD.TERMINAL_FUNCTION.type);
+                                        
+                    cmdElem.appendChild(cmdDoc.createTextNode(
+                            CAD_KEYS.keyboard_type + ":" + 
+                            String.valueOf(evt.getKeyCode())));
+                    cmdDoc.appendChild(cmdElem);                    
+                    theModel.transmitCommand(cmdDoc);
+    
+                } catch (Exception e) {
+                    cadLogger.logp(Level.SEVERE, "CADClientView", "keyReleased()",
+                            "Exception in sending queue command.", e);
+                }
+                break;
+
+            case BACKSPACE:
+               CADCommandLinePane.backspace();
+               break;       
+            case ENTER:                   
+                break;
+            default:  
+        }
+                
+    }
+
+    /**
+     * This method implements the necessary KeyListener functionality, and is 
+     * called whenever a key is typed.  Only letters, numbers, and standard 
+     * keyboard symbols, whose ascii value is between 32(inclusive) and 
+     * 127(exclusive).  Lower case character are in the range between 97 and 
+     * 122, inclusive.  These characters are made uppercase by substracting 
+     * 32 from their ascii value.  The ascii value for an upper case character 
+     * is 32 less than its lower case representation.  The valid character 
+     * is then sent to the CADCommandLinePane.
+     *
+     * @param e KeyEvent received.
+     */
+    public void keyTyped(KeyEvent e) {
+        //System.out.println("keyTyped" + e.getKeyCode());
+        
+        char key = e.getKeyChar();
+        //if valid character
+        if(key >= 32 && key < 127) {
+            //lower case letter
+            if(key >= 97 && key <= 122)
+                key -= 32; //make uppercase
+            
+            CADCommandLinePane.receiveKeyPress(key);                
+            
+        }
+    }
+
+    /**
+     * Observable update method.  The CADClientView class is an observer of the 
+     * CADClientModel.  If the model sends a null object, it is signifying that
+     * it has shut down.  In this case, an error message should be shown to prompt
+     * the user to restart the CAD Client.  If the update object is an
+     * ObserverMessage object, the following actions are to be taken:
+     * 
+     *<table cellpadding="2" cellspacing="2" border="1"
+     * style="text-align: left; width: 250px;">
+     *  <tbody>
+     *    <tr>
+     *      <th>Message Type</th>
+     *      <th>Message Data</th>
+     *      <th>Action Taken</th>
+     *    </tr>
+     *    <tr>
+     *      <td>INCIDENT_INQUIRY<br></td>
+     *      <td>IncidentInquiryModel<br></td>
+     *      <td>Construct a new II_IncidentInquiry view pane from the model data.
+     *          Reset the observer relationship between the footer and main pane.
+     *          Update the page location map and update the views with the model data.
+     *      </td>
+     *    </tr>
+     *    <tr>
+     *      <td>INCIDENT_SUMMARY<br></td>
+     *      <td>IncidentSummaryModel<br></td>
+     *      <td>Construct a new SA_IncidentSummary view pane from the model data.
+     *          Reset the observer relationship between the footer and main pane.
+     *          Update the page location map and update the views with the model data.
+     *      </td>
+     *    </tr>
+     *    <tr>
+     *      <td>INCIDENT_BOARD<br></td>
+     *      <td>IncidentBoardModel<br></td>
+     *      <td>Construct a new IB_IncidentBoard view pane from the model data.
+     *          Reset the observer relationship between the footer and main pane.
+     *          Update the page location map and update the views with the model data.
+     *      </td>
+     *    </tr>
+     *    <tr>
+     *      <td>ROUTED_MESSAGE<br></td>
+     *      <td>RoutedMessageModel<br></td>
+     *      <td>Construct a new TO_RoutedMessage view pane from the model data.
+     *          Reset the observer relationship between the footer and main pane.
+     *          Update the page location map and update the views with the model data.
+     *      </td>
+     *    </tr>
+     *    <tr>
+     *      <td>BLANK_SCREEN<br></td>
+     *      <td>BlankScreenModel<br></td>
+     *      <td>Construct a new empty view pane.
+     *          Reset the observer relationship between the footer and main pane.
+     *          Update the page location map and update the views with the model data.
+     *      </td>
+     *    </tr>
+     *    <tr>
+     *      <td>SCREEN_UPDATE<br></td>
+     *      <td>TreeMap<CADScreenNum, Boolean><br></td>
+     *      <td>Update the footer pane with the new screen updates map.</td>
+     *    </tr>
+     *    <tr>
+     *      <td>TIME_UPDATE<br></td>
+     *      <td>Time String<br></td>
+     *      <td>Update the footer pane with the new time.</td>
+     *    </tr>
+     *    <tr>
+     *      <td>ROUTED_MESSAGE_COUNT_UPDATE<br></td>
+     *      <td># Routed Messages<br></td>
+     *      <td>Update the footer pane with the new number of routed messages.</td>
+     *    </tr>
+     *    <tr>
+     *      <td>ROUTED_MESSAGE_UNREAD_UPDATE<br></td>
+     *      <td>Unread Routed Messages Boolean<br></td>
+     *      <td>Update the footer pane with the unread messages boolean.</td>
+     *    </tr>
+     *    <tr>
+     *      <td>CAD_INFO_MESSAGE<br></td>
+     *      <td>Information message<br></td>
+     *      <td>Update the footer pane with the new info message.</td>
+     *    </tr>
+     *  </tbody>
+     *</table>
+     */
+    public void update(Observable o, Object arg) {
+        
+        
+        if(arg == null) 
+        {
+            JOptionPane.showMessageDialog(this, 
+                    "Connection to the CAD Simulator has been lost.  " +
+                    "Restart the CAD Client.", "Connection Error", 
+                    JOptionPane.ERROR_MESSAGE); 
+            return;
+        }
+        
+        ObserverMessage oMessage = (ObserverMessage)arg;
+    
+        switch(oMessage.type) {
+            case INCIDENT_INQUIRY:
+                IncidentInquiryModel iiModel = (IncidentInquiryModel)oMessage.value;
+                
+                CADMainPane   = new II_IncidentInquiry(iiModel, mainTextPane.getDocument());
+                CADMainPane.addObserver(CADFooterPane);
+                
+                if(!pageLocationSaved)
+                    pageLocationMap.put(currentScreenNum, CADMainPane.getCurrentPage());
+                
+                updateViews(iiModel);               
+                
+                break;
+                
+            case INCIDENT_SUMMARY:
+                IncidentSummaryModel isModel = (IncidentSummaryModel)oMessage.value;
+                
+                CADMainPane   = new SA_IncidentSummary(isModel, mainTextPane.getDocument());
+                CADMainPane.addObserver(CADFooterPane);
+                
+                if(!pageLocationSaved)
+                    pageLocationMap.put(currentScreenNum, CADMainPane.getCurrentPage());
+                
+                updateViews(isModel);
+                break;
+                
+            case INCIDENT_BOARD:
+                IncidentBoardModel ibModel = (IncidentBoardModel)oMessage.value;
+            
+                CADMainPane   = new IB_IncidentBoard(ibModel, mainTextPane.getDocument());
+                CADMainPane.addObserver(CADFooterPane);     
+                
+                if(!pageLocationSaved)
+                    pageLocationMap.put(currentScreenNum, CADMainPane.getCurrentPage());
+                
+                updateViews(ibModel);
+                break;
+                
+            case ROUTED_MESSAGE:
+                RoutedMessageModel rmModel = (RoutedMessageModel)oMessage.value;
+            
+                CADMainPane = new TO_RoutedMessage(rmModel, mainTextPane.getDocument());
+                CADMainPane.addObserver(CADFooterPane);
+                
+                if(!pageLocationSaved)
+                    pageLocationMap.put(currentScreenNum, CADMainPane.getCurrentPage());
+                
+                updateViews(rmModel);
+                break;
+                
+            case BLANK_SCREEN:
+                BlankScreenModel bsModel = (BlankScreenModel)oMessage.value;
+                
+                CADMainPane = new CADMainView(mainTextPane.getDocument());
+                CADMainPane.addObserver(CADFooterPane); 
+
+                if(!pageLocationSaved)
+                    pageLocationMap.put(currentScreenNum, CADMainPane.getCurrentPage());
+                
+                updateViews(bsModel);
+                break;              
+                
+            case SCREEN_UPDATE:
+                CADFooterPane.updateStatus(CADScreenModel.updateStringToMap(
+                        (String)oMessage.value));
+                break;
+                
+            case TIME_UPDATE:
+                CADFooterPane.updateTime((String)oMessage.value);           
+                break;
+                
+            case ROUTED_MESSAGE_COUNT_UPDATE:
+                CADFooterPane.updateRoutedMessageCount((Integer)oMessage.value);
+                break;
+                
+            case ROUTED_MESSAGE_UNREAD_UPDATE:
+                CADFooterPane.updateUnreadMessages((Boolean)oMessage.value);
+                break;
+                
+            case CAD_INFO_MESSAGE:
+                CADFooterPane.displayInfoMessage((String)oMessage.value);
+                break;
+        }           
+    }
+    
+   
+    /**
+     * Update the command line and footer pane with model
+     * data.  Then refresh all of the views to repaint the screen.
+     * 
+     * @param model CADScreenModel shown in main Pane.
+     */
+    private void updateViews(CADScreenModel model) {
+                
+        currentScreenNum = model.getScreenNum();
+        
+        CADCommandLinePane.setCommandLine(model.commandLine);
+
+        CADFooterPane.setCADScreenNum(model.getScreenNum());        
+        CADFooterPane.updateTime(CADScreenModel.theCADTime);
+        CADFooterPane.updateDate(CADScreenModel.theCADDate);        
+        CADFooterPane.updateStatus(model.screenUpdateMap);
+        CADFooterPane.updateRoutedMessageCount(model.numberRoutedMessages); 
+        CADFooterPane.updateUnreadMessages(model.unreadMessages);       
+        
+        CADCommandLinePane.refreshView();
+        CADMainPane.refreshView(pageLocationMap.get(currentScreenNum));
+        CADFooterPane.refreshView();
+        
+    }
+    
+    /* SWING OBJECTS */       
+    
+    private JTextPane cmdLineTextPane = null;
+    private JTextPane mainTextPane    = null;
+    private JTextPane footerTextPane  = null;
+    
+    private JPanel cmdLinePanel = null;
+    private JPanel mainPanel    = null;
+    private JPanel footerPanel  = null;
+    
+    
+}    
Index: trunk/src/tmcsim/client/CADCommandParser.java
===================================================================
--- trunk/src/tmcsim/client/CADCommandParser.java	(revision 2)
+++ trunk/src/tmcsim/client/CADCommandParser.java	(revision 2)
@@ -0,0 +1,388 @@
+package tmcsim.client;
+
+import java.util.NoSuchElementException;
+import java.util.StringTokenizer;
+import java.util.Vector;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import tmcsim.common.CADProtocol.CAD_COMMANDS;
+import tmcsim.common.CADProtocol.CAD_FIELD_CODES;
+import tmcsim.common.CADProtocol.DATA_TAGS;
+
+
+/**
+ * CADCommandParser is used to parse user input from the CAD command line.
+ * The text is parsed for specific CAD command tokens and Field Codes
+ * as specified by the offical CAD syntax.  The parseCommand() method
+ * is used to parse a command line into the XML command Element that
+ * will be sent to the CAD Simulator.  
+ * TODO Where is this specified??? 
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public class CADCommandParser {
+    
+    /**
+     * Inner class used in parsing CAD Command Lines.
+     * @author Matthew
+     */
+    private class CommandItem {
+        
+        /** Field Code Mnemonic. */
+        public String mnemonic;
+
+        /** Associated data. */
+        public String value;        
+        
+        public CommandItem(String m, String v) {
+            mnemonic = m;
+            value    = v;
+        }
+    }
+   
+    /**
+     * This method parses the parameter command line for CAD commands.  The
+     * command text is tokenized by the '.' character, which is a delimiter
+     * for CAD commands.  The first parsed token specifies which CAD
+     * command is being performed.  If the token matches a valid CAD command,
+     * the remaining command line is parsed for other '.' delimeted information 
+     * that accompanies that command.  <br>  
+     * As the command line is parsed, XML Elements are added to the root
+     * parameter Element to create a command message that will be sent to 
+     * the CAD Simulator.  The individual XML schemas are viewable ????
+     * If the command line is not properly formed, an Exception is thrown. 
+     * CAD Command syntax is viewable ????
+     * TODO Where are they available???  
+     * 
+     * 
+     * The following table specifies the valid CAD command tokens, their 
+     * associated CAD Command, the additional information, and error states.
+     * 
+     *<table cellpadding="2" cellspacing="2" border="1"
+     * style="text-align: left; width: 250px;">
+     *  <tbody>
+     *    <tr>
+     *      <th>CAD Command Token</th>
+     *      <th>CAD Command</th>
+     *      <th>Additional Information</th>
+     *      <th>Possible Errors</th>
+     *    </tr>
+     *    <tr>
+     *      <td>IB</td>
+     *      <td>Incident Board</td>
+     *      <td>None</td>
+     *      <td>None</td>
+     *    </tr>
+     *    <tr>
+     *      <td>II</td>
+     *      <td>Incident Inquiry</td>
+     *      <td>Numerical log number</td>
+     *      <td>Log number contains invalid characters.</td>
+     *    </tr>
+     *    <tr>
+     *      <td>SA</td>
+     *      <td>Incident Summary By Area</td>
+     *      <td>None</td>
+     *      <td>None</td>
+     *    </tr>
+     *    <tr>
+     *      <td>UI</td>
+     *      <td>Incident Update</td>
+     *      <td>1) Numerical log number (optional)<br>
+     *          2) CAD Field Codes with associated data </td>
+     *      <td>Missing Field Codes.</td>
+     *    </tr>
+     *    <tr>
+     *      <td>TO</td>
+     *      <td>Routed Mssage</td>
+     *      <td>1) Recipient CAD Position Numbers or Mnemonics<br>
+     *          2) Message text </td>
+     *      <td>1) Missing Recipients <br>
+     *          2) Missing Message Field Code</td>
+     *    </tr>
+     *    <tr>
+     *      <td>OF</td>
+     *      <td>Log Terminal Off</td>
+     *      <td>None</td>
+     *      <td>None</td>
+     *    </tr>
+     *  </tbody>
+     *</table>
+     * 
+     * 
+     * @param currElem Document Element to add command tags to.
+     * @param commandText Command line text to parse.
+     * @throws Exception 
+     */
+    public void parseCommand(Element currElem, String commandText) throws Exception {
+                        
+        StringTokenizer tokenizer = new StringTokenizer(commandText, ".");   
+        String          token;
+        
+        Document theDoc  = currElem.getOwnerDocument();
+        Element  cmdElem = null;
+                      
+        if(tokenizer.countTokens() >= 1 && commandText.indexOf(".") != -1) {
+            token = tokenizer.nextToken(); 
+                  
+            //INCIDENT_BOARD Request
+            if(token.equals(CAD_COMMANDS.INCIDENT_BOARD.mnemonic)) {
+                cmdElem = theDoc.createElement(CAD_COMMANDS.INCIDENT_BOARD.fullName);       
+                currElem.appendChild(cmdElem);
+            }
+            //INCIDENT_INQUIRY Request
+            else if(token.equals(CAD_COMMANDS.INCIDENT_INQUIRY.mnemonic)) {  
+                try {
+                    Integer logNumber = Integer.valueOf(tokenizer.nextToken().trim());
+                    
+                    cmdElem = theDoc.createElement(CAD_COMMANDS.INCIDENT_INQUIRY.fullName);
+                    cmdElem.appendChild(theDoc.createTextNode(logNumber.toString()));       
+                    currElem.appendChild(cmdElem);
+                } catch (Exception e) {
+                    //catch NumberFormatException
+                    throw new Exception();
+                }
+            }
+            //INCIDENT_SUMMARY Request
+            else if(token.equals(CAD_COMMANDS.INCIDENT_SUMMARY.mnemonic)) {   
+                cmdElem = theDoc.createElement(CAD_COMMANDS.INCIDENT_SUMMARY.fullName);           
+                currElem.appendChild(cmdElem);                  
+            }                 
+            //INCIDENT_UPDATE Request      
+            else if(token.equals(CAD_COMMANDS.INCIDENT_UPDATE.mnemonic)) {      
+                                     
+                Vector<CommandItem> commands = new Vector<CommandItem>();
+                
+                //ascertain if the next token is a number, if so, we're updating a 
+                //specific log, else updating the current log(assuming we're looking at one)
+
+                cmdElem = theDoc.createElement(CAD_COMMANDS.INCIDENT_UPDATE.fullName);           
+                currElem.appendChild(cmdElem);                  
+                
+                try {
+                    token = tokenizer.nextToken().trim();
+                    Integer logNumber = new Integer(token);
+                    cmdElem.setAttribute(DATA_TAGS.LOG_NUM.tag, logNumber.toString());
+                }                   
+                //"UI." missing information
+                catch (NoSuchElementException nsee) {throw new Exception();}  
+                //UI.xxx where xxx not a number, assume UI.D/ format
+                catch (NumberFormatException nfe) {
+                    commands.add(new CommandItem(token.substring(0,2), token.substring(2,token.length())));
+                }                       
+                
+                while(tokenizer.hasMoreTokens()) {
+                    token = tokenizer.nextToken().trim();       
+                    commands.add(new CommandItem(token.substring(0,2), token.substring(2,token.length()))); 
+                }
+                
+                parseIncidentUpdate(cmdElem, commands);                     
+       
+            }
+            //ROUTED_MESSAGE Request
+            else if(token.equals(CAD_COMMANDS.ROUTED_MESSAGE.mnemonic)) {
+                String  message       = "";
+                String  destPositions = "";
+
+                //comma delimited
+                destPositions = tokenizer.nextToken();
+                                
+                //in case there is a . in the following text
+                while(tokenizer.hasMoreTokens())
+                    message += tokenizer.nextToken();
+                    
+                    
+                if(message.substring(0,2).equalsIgnoreCase(CAD_FIELD_CODES.MESSAGE.mnemonic)) {
+                    cmdElem = theDoc.createElement(CAD_COMMANDS.ROUTED_MESSAGE.fullName);           
+                    currElem.appendChild(cmdElem);                  
+
+                    Element destElem = theDoc.createElement(DATA_TAGS.DESTINATION.tag);
+                    destElem.appendChild(theDoc.createTextNode(destPositions));
+                    cmdElem.appendChild(destElem);                  
+
+                    Element msgElem = theDoc.createElement(DATA_TAGS.MESSAGE.tag);
+                    msgElem.appendChild(theDoc.createTextNode(message.substring(2, message.length())));
+                    cmdElem.appendChild(msgElem);
+                }
+                else throw new Exception();                     
+            } 
+            //ENTER_INCIDENT Request
+            else if(token.equals(CAD_COMMANDS.ENTER_INCIDENT.mnemonic)) {
+                //TODO EI Implementation??
+                /*
+                Vector<CommandItem> commands = new Vector<CommandItem>();
+                
+                cmdElem = theDoc.createElement(CAD_COMMANDS.ENTER_INCIDENT.fullName);           
+                currElem.appendChild(cmdElem);                      
+                
+                while(tokenizer.hasMoreTokens()) {
+                    token = tokenizer.nextToken().trim();       
+                    commands.add(new CommandItem(token.substring(0,2), token.substring(2,token.length()))); 
+                }
+                
+                parseIncidentUpdate(cmdElem, commands);
+                */
+                
+            }
+            //TERMINAL_OFF Request
+            else if(token.equals(CAD_COMMANDS.TERMINAL_OFF.mnemonic)) {
+                cmdElem = theDoc.createElement(CAD_COMMANDS.TERMINAL_OFF.fullName);       
+                currElem.appendChild(cmdElem);  
+            }
+            //APP_CLOSE Request
+            else if(token.equals(CAD_COMMANDS.APP_CLOSE.mnemonic)) {
+                cmdElem = theDoc.createElement(CAD_COMMANDS.APP_CLOSE.fullName);       
+                currElem.appendChild(cmdElem);  
+            }
+            else throw new Exception();
+        }
+        else {
+            
+            try {
+                Integer cadLog = Integer.parseInt(commandText.trim());
+                
+                cmdElem = theDoc.createElement(CAD_COMMANDS.INCIDENT_INQUIRY.fullName);
+                cmdElem.appendChild(theDoc.createTextNode(cadLog.toString()));       
+                currElem.appendChild(cmdElem);
+                
+            } catch (Exception e) {
+                throw new Exception();
+            }
+        }       
+    }   
+
+
+    /**
+     * This method iterates through the parameter Vector of CommandItem objects.
+     * For each object, the appropriate Incident information is extracted 
+     * and added as a tag to the parameter XML Element.
+     * 
+     * @param currElem XML Element to append Incident information tags to.
+     * @param commands Vector of CommandItems to parse for Incident information.
+     */
+    public void parseIncidentUpdate(Element currElem, Vector<CommandItem> commands) {
+        
+        String witnessName  = null;
+        String witnessAddr  = null;
+        String witnessPhone = null;
+        
+        Document theDoc = currElem.getOwnerDocument();
+        
+        for(CommandItem item : commands) {
+                                            
+            //Address of Witness
+            if(item.mnemonic.equals(CAD_FIELD_CODES.WITNESS_ADDRESS.mnemonic)) {
+                //System.out.print("A");        
+                witnessAddr = item.value;               
+            }               
+            //Beat
+            else if(item.mnemonic.equals(CAD_FIELD_CODES.BEAT.mnemonic)) {              
+                //System.out.print("B");            
+                Element beatElem = theDoc.createElement(CAD_FIELD_CODES.BEAT.fullName);
+                beatElem.appendChild(theDoc.createTextNode(item.value));
+                currElem.appendChild(beatElem);
+            }
+            //Callbox
+            else if(item.mnemonic.equals(CAD_FIELD_CODES.CALLBOX.mnemonic)) {
+                //System.out.print("C");    
+                //xmlOut.writeTag(CALLBOX, commandMap.get(key));
+            }
+            //Details
+            else if(item.mnemonic.equals(CAD_FIELD_CODES.DETAILS.mnemonic)) {
+                //System.out.print("D");
+                Element detailElem = theDoc.createElement(CAD_FIELD_CODES.DETAILS.fullName);
+                
+                //if the details contains a '|' character, the text is sensitive.  Remove
+                //the pipe and mark the detail as sensitive.
+                if(item.value.contains("|")) {
+                    StringBuffer detailBuf = new StringBuffer();
+                    detailBuf.append(item.value.substring(0, item.value.indexOf("|")));
+                    detailBuf.append(item.value.substring(item.value.indexOf("|") + 1, 
+                            item.value.length()));
+                    
+                    detailElem.setAttribute(DATA_TAGS.SENSITIVE.tag, 
+                            new Boolean(true).toString());
+                    detailElem.appendChild(theDoc.createTextNode(detailBuf.toString()));
+                }
+                else {
+                    detailElem.setAttribute(DATA_TAGS.SENSITIVE.tag, 
+                            new Boolean(false).toString());
+                    detailElem.appendChild(theDoc.createTextNode(item.value));
+                }
+                                
+                currElem.appendChild(detailElem);       
+            }
+            //Handling Unit
+            else if(item.mnemonic.equals(CAD_FIELD_CODES.HANDLING_UNIT.mnemonic)) {
+                //System.out.print("H");    
+                Element unitElem = theDoc.createElement(CAD_FIELD_CODES.HANDLING_UNIT.fullName);
+                unitElem.appendChild(theDoc.createTextNode(item.value));
+                currElem.appendChild(unitElem);
+            }               
+            //IncidentNumber
+            else if(item.mnemonic.equals(CAD_FIELD_CODES.INCIDENT_NUMBER.mnemonic)) {
+                //System.out.print("I");
+                currElem.setAttribute(CAD_FIELD_CODES.INCIDENT_NUMBER.fullName, item.value);
+            }
+            //Location
+            else if(item.mnemonic.equals(CAD_FIELD_CODES.LOCATION.mnemonic)) {
+                //System.out.print("L");
+                currElem.setAttribute(DATA_TAGS.FULL_LOCATION.tag, item.value);
+                currElem.setAttribute(DATA_TAGS.TRUNC_LOCATION.tag, item.value);
+            }
+            //Priority
+            else if(item.mnemonic.equals(CAD_FIELD_CODES.PRIORITY.mnemonic)) {
+                //System.out.print("P");                    
+                currElem.setAttribute(CAD_FIELD_CODES.PRIORITY.fullName, item.value);               
+            }                       
+            //Routing mnemonic
+            else if(item.mnemonic.equals(CAD_FIELD_CODES.ROUTE.mnemonic)) {
+                //System.out.print("R");
+                Element unitElem = theDoc.createElement(CAD_FIELD_CODES.ROUTE.fullName);
+                unitElem.appendChild(theDoc.createTextNode(item.value));
+                currElem.appendChild(unitElem);
+            }   
+            //Witness Phone Number
+            else if(item.mnemonic.equals(CAD_FIELD_CODES.WITNESS_PHONE.mnemonic)) {
+                //System.out.print("N");    
+                witnessPhone = item.value;
+            }
+            //Type
+            else if(item.mnemonic.equals(CAD_FIELD_CODES.TYPE.mnemonic)) {
+                //System.out.print("T");
+                currElem.setAttribute(CAD_FIELD_CODES.TYPE.fullName, item.value);
+            }
+            //Tow
+            else if(item.mnemonic.equals(CAD_FIELD_CODES.TOW.mnemonic)) {
+                //System.out.print("V");
+                Element towElem = theDoc.createElement(CAD_FIELD_CODES.TOW.fullName);
+                towElem.appendChild(theDoc.createTextNode("name=\"" + item.value + "\""));
+                currElem.appendChild(towElem);
+            }               
+            //Witness
+            else if(item.mnemonic.equals(CAD_FIELD_CODES.WITNESS.mnemonic)) {
+                //System.out.print("W");    
+                witnessName = item.value;
+            }                       
+        }   
+        
+        if(witnessName != null)
+        {
+
+            Element witnessElem = theDoc.createElement(CAD_FIELD_CODES.WITNESS.fullName);
+            currElem.appendChild(witnessElem);
+            
+            witnessElem.setAttribute(DATA_TAGS.WITNESS_NAME.tag, witnessName);
+        
+            if(witnessAddr != null)
+                witnessElem.setAttribute(DATA_TAGS.WITNESS_ADDR.tag, witnessAddr);  
+                
+            if(witnessPhone != null)
+                witnessElem.setAttribute(DATA_TAGS.WITNESS_PHONE.tag, witnessPhone);
+                
+        }
+    }
+}
Index: trunk/src/tmcsim/simulationmanager/IncidentHistoryPanel.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/IncidentHistoryPanel.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/IncidentHistoryPanel.java	(revision 2)
@@ -0,0 +1,146 @@
+package tmcsim.simulationmanager;
+
+import java.awt.Dimension;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.border.EtchedBorder;
+
+import tmcsim.client.cadclientgui.data.IncidentEvent;
+import tmcsim.simulationmanager.model.IncidentHistoryTableModel;
+import tmcsim.simulationmanager.model.IncidentTimeCellRenderer;
+import tmcsim.simulationmanager.model.LogEntryCellRenderer;
+import tmcsim.simulationmanager.model.IncidentHistoryTableModel.EVENT_HIST_COLUMNS;
+
+/**
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+@SuppressWarnings("serial")
+public class IncidentHistoryPanel extends JPanel {
+
+    /**  */
+    private JTable eventHistoryTable = null;
+    
+    /**  */
+    private IncidentHistoryTableModel eventHistoryTableModel;
+    
+    
+    public IncidentHistoryPanel() {
+        
+        setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
+        setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
+    
+        incTypeLbl = new JLabel("Type:");
+        incTypeLbl.setAlignmentX(Box.LEFT_ALIGNMENT);
+        
+        incTypeTF = new JTextField();
+        incTypeTF.setAlignmentX(Box.LEFT_ALIGNMENT);
+        //incTypeBox.setMinimumSize(new Dimension(50, 20));
+        //incTypeBox.setPreferredSize(new Dimension(100, 20));
+        incTypeTF.setMaximumSize(new Dimension(200, 20));
+        incTypeTF.setEditable(false);
+        
+        Box incTypeBox = Box.createVerticalBox();
+        incTypeBox.setAlignmentY(Box.CENTER_ALIGNMENT);
+        incTypeBox.add(incTypeLbl);
+        incTypeBox.add(incTypeTF);
+        incTypeBox.setBorder(BorderFactory.createEmptyBorder(10,0,10,0));
+
+        
+        incLocLbl = new JLabel("Location:");
+        incLocLbl.setAlignmentX(Box.LEFT_ALIGNMENT);
+        
+        incLocTF = new JTextField();
+        incLocTF.setAlignmentX(Box.LEFT_ALIGNMENT);
+        incLocTF.setMaximumSize(new Dimension(800, 20));
+        incLocTF.setEditable(false);
+        
+        Box incLocBox = Box.createVerticalBox();
+        incLocBox.setAlignmentY(Box.CENTER_ALIGNMENT);
+        incLocBox.add(incLocLbl);
+        incLocBox.add(incLocTF);
+                
+        Box incidentInfoBox = Box.createHorizontalBox();
+        incidentInfoBox.setAlignmentX(Box.CENTER_ALIGNMENT);
+        incidentInfoBox.setMaximumSize(new Dimension(1000, 75));
+        incidentInfoBox.add(Box.createHorizontalStrut(10));
+        incidentInfoBox.add(incTypeBox);
+        incidentInfoBox.add(Box.createHorizontalStrut(10));
+        incidentInfoBox.add(incLocBox);
+        incidentInfoBox.add(Box.createHorizontalStrut(10));
+        incidentInfoBox.setBorder(BorderFactory.createTitledBorder(
+                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), 
+                "Incident Information"));
+        
+        
+
+        eventHistoryTableModel = new IncidentHistoryTableModel();
+        eventHistoryTable = new JTable(eventHistoryTableModel);  
+        eventHistoryTable.getTableHeader().setReorderingAllowed(false);  
+        
+        for(int c = 0; c < eventHistoryTable.getColumnCount(); c++) {
+            eventHistoryTable.getColumnModel().getColumn(c).setMinWidth(
+                    eventHistoryTableModel.getColumnMinWidth(c));
+            eventHistoryTable.getColumnModel().getColumn(c).setMaxWidth(
+                    eventHistoryTableModel.getColumnMaxWidth(c));
+            eventHistoryTable.getColumnModel().getColumn(c).setPreferredWidth(
+                    eventHistoryTableModel.getColumnPrefWidth(c));
+            eventHistoryTable.getColumnModel().getColumn(c).setResizable(true);
+            
+            if(c == EVENT_HIST_COLUMNS.TIME_COL.colNum)
+                eventHistoryTable.getColumnModel().getColumn(c).setCellRenderer(
+                        new IncidentTimeCellRenderer());
+            else if (c == EVENT_HIST_COLUMNS.EVENT_DESC_COL.colNum)
+                eventHistoryTable.getColumnModel().getColumn(c).setCellRenderer(
+                        new LogEntryCellRenderer());            
+                
+        }       
+        
+        logScrollPane     = new JScrollPane(new JLabel(""), 
+                javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
+                javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+        logScrollPane.setAlignmentX(Box.CENTER_ALIGNMENT);      
+        logScrollPane.setViewportView(eventHistoryTable);
+        logScrollPane.setBorder(BorderFactory.createTitledBorder(
+                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Log Entries"));
+        
+    
+        add(incidentInfoBox);
+        add(Box.createVerticalStrut(10));
+        add(logScrollPane);
+    }
+    
+    public void updateIncidentHistory(IncidentEvent event) {
+        
+        if(event.eventInfo.getHeader().type.trim().length() > 0 &&
+            !incTypeTF.getText().trim().equals(event.eventInfo.getHeader().type.trim())) 
+        {
+            incTypeTF.setText(event.eventInfo.getHeader().type.trim());         
+        }
+
+        if(event.eventInfo.getHeader().fullLocation.trim().length() > 0&&
+            !incLocTF.getText().trim().equals(event.eventInfo.getHeader().fullLocation.trim()))
+        {
+            incLocTF.setText(event.eventInfo.getHeader().fullLocation.trim());
+        }
+
+        eventHistoryTableModel.addEvent(event);
+    }
+        
+    private JLabel incTypeLbl;
+    private JLabel incLocLbl;
+    
+    private JTextField incTypeTF;
+    private JTextField incLocTF;
+    
+    private JScrollPane logScrollPane;
+
+}
Index: trunk/src/tmcsim/simulationmanager/SimulationManager.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/SimulationManager.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/SimulationManager.java	(revision 2)
@@ -0,0 +1,198 @@
+package tmcsim.simulationmanager;
+
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import java.io.File;
+import java.io.FileInputStream;
+import java.rmi.RemoteException;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.JOptionPane;
+import javax.swing.UIManager;
+
+import tmcsim.common.SimulationException;
+import tmcsim.common.CADEnums.PARAMICS_STATUS;
+
+/**
+ * Simulation Manager is the main class for this module.  The Simulation Manager
+ * is used to control the view and control the simulation.  Simulation incidents
+ * are loaded, removed, reschedule, and added from the Simulation Manager.  The
+ * Simulation Manager provides functionality for connecting to the paramics
+ * communicator and applying diversions.  A history of all events is shown as well.<br> 
+ * The SimulationManager may be started at any point before, during, or after 
+ * a simulation has begun. The SimulationManager connects to the CADSimulator 
+ * and communicates through Java RMI methods.  If two SimulationManagers are started,
+ * the second one started, chronologically, will receive communication from the 
+ * CADSimulator. <br><br>  
+ * The properties file for the SimulationManager class contains the following data.<br>
+ * <code>
+ * -----------------------------------------------------------------------------<br>
+ * Host Name              The host name where the CADSimulator is located.<br>
+ * Error File             The target file to use for error logging.<br>
+ * -----------------------------------------------------------------------------<br>
+ * Example File: <br>
+ * CADSimulatorHost    = localhost <br>
+ * ErrorFile           = sim_mgr_error.xml <br>
+ * -----------------------------------------------------------------------------<br>
+ * </code>
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2009/04/17 16:27:47 $ $Revision: 1.7 
+ */
+public class SimulationManager {
+        
+    /** Error logger. */
+    private static Logger simManLogger = Logger.getLogger("tmcsim.simulationmanager");
+    
+    /**
+     * Enumeration containing property names.
+     * @author Matthew Cechini
+     */
+    private static enum PROPERTIES {
+        CAD_SIM_HOST  ("CADSimulatorHost"),
+        CAD_SIM_PORT  ("CADSimulatorRMIPort"),
+        SCRIPT_DIR    ("ScriptDir"),
+        FAKE_PARAMICS ("FakeParamicsConnection");
+        
+        public String name;
+        
+        private PROPERTIES(String n) {
+            name = n;
+        }
+        
+    }
+        
+    /**
+     * Instance of the SimulationManagerModel which communicates with the 
+     * CAD Simulator to display the current simulation information.  This
+     * model class contains the data that is displayed by the SimulationManagerView
+     * class.  The View purely provides a GUI interface for the data contained within
+     * the model.
+     */
+    private SimulationManagerModel  theSimManagerModel;
+    
+    /**
+     * Instance of the SimulationManagerView class which provides a GUI for the user
+     * to view the current simulation information and to manage the simulation.  The 
+     * view communicates to the SimulationManagerModel class to get and set data.
+     */
+    SimulationManagerView   theSimManagerView;
+    
+    /** The Properties object for the Simulation Manager. */
+    private Properties simManagerProperties;
+    
+    /**
+     * Constructor.  Set communication data members from properties file.  Instantiate
+     * the SimulationManager Model and View objects, and set visibility to true.
+     * 
+     * @param propertiesFile Properties file containing info for Simulation Manager.
+     */
+    public SimulationManager(String propertiesFile) throws SimulationException {    
+
+        try {
+            simManagerProperties = new Properties();
+            simManagerProperties.load(new FileInputStream(new File(propertiesFile)));
+            
+            SimulationManagerView.SCRIPT_DIR = 
+                simManagerProperties.getProperty(PROPERTIES.SCRIPT_DIR.name).trim();
+
+            //make sure properties aren't null
+            if(simManagerProperties.getProperty(PROPERTIES.CAD_SIM_HOST.name) == null)
+                throw new Exception("CAD Simulator host property is null.");  
+                
+            if(simManagerProperties.getProperty(PROPERTIES.CAD_SIM_PORT.name) == null)
+                throw new Exception("CAD Simulator port property is null.");
+            
+        }
+        catch (Exception e)
+        {     
+            simManLogger.logp(Level.SEVERE, "SimulationManager", "Constructor", 
+                    "Exception in reading properties file.", e);
+            
+            throw new SimulationException(SimulationException.INITIALIZE_ERROR, e);
+        }
+
+        //Construct the SimulationManagerModel
+        try 
+        {                
+            theSimManagerModel = new SimulationManagerModel(
+                    simManagerProperties.getProperty(PROPERTIES.CAD_SIM_HOST.name).trim(), 
+                    simManagerProperties.getProperty(PROPERTIES.CAD_SIM_PORT.name).trim());
+
+            //Construct the SimulationManagerView and set up the Model-View references.
+            theSimManagerView = new SimulationManagerView(theSimManagerModel);
+            theSimManagerModel.setView(theSimManagerView);                           
+        }
+        catch (RemoteException re) 
+        {
+            simManLogger.logp(Level.SEVERE, "SimulationManager", "Constructor", 
+                    "Unable to establish RMI ", re);
+
+            throw new SimulationException(SimulationException.CAD_SIM_CONNECT, re); 
+        }
+
+        theSimManagerView.addWindowListener(new WindowListener() {
+            public void windowClosed(WindowEvent e)  {}
+            public void windowOpened(WindowEvent e)  {}            
+            public void windowIconified(WindowEvent e)  {}         
+            public void windowDeiconified(WindowEvent e)  {}    
+            public void windowActivated(WindowEvent e)  {}                             
+            public void windowDeactivated(WindowEvent e)  {}         
+            public void windowClosing(WindowEvent e)  {     
+                theSimManagerModel.disconnect();
+                System.exit(0);
+            }           
+        });
+
+        if(Boolean.parseBoolean(simManagerProperties.getProperty(
+                PROPERTIES.FAKE_PARAMICS.name).trim()))
+        {
+            theSimManagerView.setParamicsStatus(PARAMICS_STATUS.CONNECTED);
+        }
+
+        //Show the SimulationManager
+        theSimManagerView.setVisible(true);        
+    }
+    
+    /**
+     * Main class.  
+     * 
+     * @param args Command line arguments.
+     */
+    static public void main(String[] args) {
+        System.setProperty("SIM_MGR_PROPERTIES", "config/sim_manager_config.properties");
+
+        try {
+            if(System.getProperty("SIM_MGR_PROPERTIES") != null)
+            {
+                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+                
+                new SimulationManager(System.getProperty("SIM_MGR_PROPERTIES"));
+            }
+            else
+            {
+                throw new Exception ("SIM_MGR_PROPERTIES system property not defined.");
+            }
+        } 
+        catch (Exception e) 
+        {
+            simManLogger.logp(Level.SEVERE, "SimulationManager", "Main", 
+                    "Error occured initializing application", e);
+            
+            JOptionPane.showMessageDialog(null, e.getMessage(), 
+                "Error - Program Exiting", JOptionPane.ERROR_MESSAGE);  
+            
+            System.exit(-1);
+        }   
+        
+    }
+}
+
+
+
+
+
+
+
Index: trunk/src/tmcsim/simulationmanager/SimulationManagerModel.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/SimulationManagerModel.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/SimulationManagerModel.java	(revision 2)
@@ -0,0 +1,633 @@
+package tmcsim.simulationmanager;
+
+import java.io.File;
+import java.rmi.Naming;
+import java.rmi.RemoteException;
+import java.rmi.server.UnicastRemoteObject;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import tmcsim.cadmodels.CMSDiversion;
+import tmcsim.cadmodels.CMSInfo;
+import tmcsim.client.cadclientgui.data.Incident;
+import tmcsim.client.cadclientgui.data.IncidentEvent;
+import tmcsim.common.ScriptException;
+import tmcsim.common.SimulationException;
+import tmcsim.common.CADEnums.PARAMICS_STATUS;
+import tmcsim.common.CADEnums.SCRIPT_STATUS;
+import tmcsim.interfaces.CoordinatorInterface;
+import tmcsim.interfaces.SimulationManagerInterface;
+
+
+/**
+ * SimulationManagerModel is the model class for the Simulation Manager.  All communication
+ * between the Coordinator and the Simulation Manager passes through this object.  The view
+ * passes requests through local methods, and the Coordinator calls remote functions in this
+ * object to update the viewed simulation data.
+ * <br/> 
+ * At construction, the SimulationManagerModel registers itself with the coordinator.  
+ * Administrative commands for the simulation are received from the SimlationManagerView 
+ * class, and then the appropriate Coordinator remote method is executed.  During a 
+ * simulation, the Coordinator calls remote methods contained in the SimulationManagerInterface.  
+ * For a description of those methods, see the interface's documentation.  After construction, 
+ * this model class must have its setView() method called to set the reference to its view class.
+ * 
+ * @see SimulationManagerView
+ * @see SimulationManagerInterface
+ * @author Matthew Cechini 
+ * @version $Revision: 1.3 $ $Date: 2006/06/06 20:46:41 $
+ */
+@SuppressWarnings("serial")
+public class SimulationManagerModel extends UnicastRemoteObject 
+    implements SimulationManagerInterface {
+    
+    /** Error Logger. */
+    private Logger simManagerLogger = Logger.getLogger("tmcsim.simulationmanager");
+    
+    /** RMI interface for communication with the remote Coordinator. */ 
+    private static CoordinatorInterface theCoorInt;
+    
+    /** The SimulationManagerView object. */
+    private SimulationManagerView theSimManagerView;    
+    
+
+    /**
+     * Constructor.  Establishes the RMI communication with the Coordinator.
+     *
+     * @param hostname Host name of the CAD Simulator.    
+     * @param portNumber Port number of the CAD Simulator RMI communication. 
+     * @throws RemoteException if error in RMI communication
+     * @throws SimulationException if there is an error in registering RMI methods.
+     */
+    public SimulationManagerModel(String hostname, String portNumber) 
+            throws RemoteException, SimulationException {
+        super();                                
+                                        
+        connect(hostname, portNumber);
+    }       
+    
+    /**
+     * Connect to the Coordinator's RMI object, and register this object for
+     * callback with the Coordinator.
+     * @param hostname Host name of the CAD Simulator.    
+     * @param portNumber Port number of the CAD Simulator RMI communication. 
+     * @throws SimulationException if there is an error creating the RMI connection.
+     */ 
+    protected void connect(String hostname, String portNumber) 
+        throws SimulationException {
+        
+        String coorIntURL = "";
+        
+        try {  
+            coorIntURL = "rmi://" + hostname + ":" + portNumber + "/coordinator"; 
+            
+            theCoorInt = (CoordinatorInterface)Naming.lookup(coorIntURL);
+            theCoorInt.registerForCallback(this);           
+            
+        }
+        catch (Exception e) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "establishRMIConnection", "Unable to establish RMI " +
+                    "communication with the CAD Simulator.  URL <" + coorIntURL + ">", e);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_CONNECT, e);
+        }   
+    }
+    
+    /**
+     * This method unregisters this SimulationManager from the Coordinator and closes
+     * the RMI communication.
+     */
+    public void disconnect() {
+        try {
+            theCoorInt.unregisterForCallback(this);
+            theCoorInt = null;
+        }
+        catch (Exception e) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "closeSimManager", "Exception in unregistering Simulation" +
+                    "Manager from the CAD Simulator.", e);
+        }
+    }
+    
+    /**
+     * Set the local reference to the SimulationManagerView object.  The view
+     * is updated with the current simulation time, script status, and Paramics
+     * connection status. 
+     *
+     * @param newView The instance of the SimulationManagerView class.
+     * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+     */
+    public void setView(SimulationManagerView newView) throws SimulationException {
+        try {
+            theSimManagerView = newView;
+            
+            theSimManagerView.tick(theCoorInt.getCurrentSimulationTime());  
+            theSimManagerView.setScriptStatus(theCoorInt.getScriptStatus());
+            theSimManagerView.setParamicsStatus(theCoorInt.getParamicsStatus());
+            
+            initialize();
+        }
+        catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "startSimulation", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }   
+        
+    }   
+    
+    /**
+     * This method initializes the SimulationManager with all current simulation
+     * data from the Coordinator.  If the simulation is running when the Simulation
+     * Manager is initialized, all previously occured incidents, events, and current
+     * diversion must be displayed.  This method first loads the list of current
+     * incidents from the coordinator, then the triggered events, followed by 
+     * all CMSInfo objects.  The SimulationManagerView is notified of any current
+     * diversions within the CMSInfo objects.  
+     * 
+     * @throws SimulationException if there is an error in RMI communication or if the 
+     *         SimulationManagerView reference has not been set.
+     */
+    protected void initialize() throws SimulationException {
+        
+        try {
+        
+            //Load all incidents from Coordinator
+            loadIncidents(); 
+            
+            //Load all triggered incidents from Coordinator
+            TreeMap<Integer, Vector<IncidentEvent>> tempEvents = theCoorInt.getTriggeredEvents();
+            for(Integer key : tempEvents.keySet())  {           
+                for(IncidentEvent ie : tempEvents.get(key)) 
+                    eventOccured(key, ie);           
+            }           
+                  
+            //Load all current diversions from the Coordinator
+            TreeSet<String> cmsIDs = theCoorInt.getCMSIDs();
+            CMSInfo cmsinfo  = null;
+            for(String cms_id : cmsIDs) {
+                cmsinfo = theCoorInt.getCMSDiversionInfo(cms_id);
+                
+                for(CMSDiversion div : cmsinfo.possibleDiversions) {
+                    if(div.getCurrDiv() != 0) {                     
+                        theSimManagerView.addDiversion(cmsinfo, div);
+                    }       
+                }
+            }   
+            
+            //Send the list of CMS IDs to the View.
+            theSimManagerView.setCMS_IDList(cmsIDs.toArray());
+        }
+        catch (Exception e) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "initialize", "Unable to initialize the SimulationManager.", e);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, e);
+        }   
+    }
+
+    public void tick(long theTime) throws RemoteException {
+        if(theSimManagerView != null)
+            theSimManagerView.tick(theTime);    
+    }
+    
+    public void incidentAdded(Incident newIncident) throws RemoteException {
+        if(theSimManagerView != null) {
+            Integer logNum = new Integer(newIncident.getLogNumber());
+            
+            theSimManagerView.addIncident(newIncident);         
+            theSimManagerView.addIncidentTab(logNum);
+        }
+    }
+
+    public void incidentStarted(Integer logNumber) throws RemoteException {
+        if(theSimManagerView != null) {
+            theSimManagerView.startIncident(logNumber);
+        }
+    }
+
+    public void incidentRemoved(Integer logNumber) throws RemoteException {
+        if(theSimManagerView != null) {
+            theSimManagerView.removeIncident(logNumber);
+            theSimManagerView.removeIncidentTab(logNumber);
+        }
+    }
+    
+    public void eventOccured(Integer logNumber, IncidentEvent theEvent) throws RemoteException {
+        if(theSimManagerView != null) {
+            theSimManagerView.addIncidentEvent(logNumber, theEvent);
+        }
+    }
+    
+    public void setScriptStatus(SCRIPT_STATUS newStatus) throws RemoteException {
+        if(theSimManagerView != null)
+            theSimManagerView.setScriptStatus(newStatus);       
+    }
+
+    public void setParamicsStatus(PARAMICS_STATUS newStatus) throws RemoteException {
+        if(theSimManagerView != null)
+            theSimManagerView.setParamicsStatus(newStatus);     
+        
+    }
+    
+    /**
+     * This method passes the view's request to start the simulation 
+     * on to the remote coordinator.
+     *
+     * @throws ScriptException if an error occurs in started the simulation.
+     * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+     */  
+    public void startSimulation() throws ScriptException, SimulationException {
+
+        try {
+            theCoorInt.startSimulation();
+        }
+        catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "startSimulation", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }   
+
+    }
+    
+    /**
+     * This method passes the view's request to reset the simulation 
+     * on to the remote coordinator.  The View's simulation time is reset to 0.
+     * The view's incident tabs are cleared and incident list reset and initialized
+     * with the current list of incidents.  The list of diversions is also reset.
+     * 
+     * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+     */
+    public void resetSimulation() throws SimulationException {      
+
+        try {
+            theCoorInt.resetSimulation();
+            
+            tick(0);
+            theSimManagerView.resetIncidentTabs();
+            theSimManagerView.resetIncidents();
+            theSimManagerView.resetDiversions();
+
+            loadIncidents(); 
+        }
+        catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "resetSimulation", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }   
+
+    }
+    
+    /**
+     * This method passes the view's request to pause the simulation 
+     * on to the remote coordinator.
+     *      
+     * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+     */
+    public void pauseSimulation() throws SimulationException {
+
+        try {
+            theCoorInt.pauseSimulation();
+         }
+        catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "pauseSimulation", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }   
+
+    }
+    
+    /**
+     * This method passes the view's request to goto a new simulation 
+     * time on to the remote coordinator.
+     * 
+     * @param time Simulation time 
+     * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+     */
+    public void gotoSimulationTime(long time) throws SimulationException {
+        
+        try {
+            theCoorInt.gotoSimulationTime(time);
+        }
+        catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "gotoSimulationTime", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }   
+    }
+    
+    /**
+     * This method passes the view's request to load a script file on to the 
+     * remote Coordinator.  If this is successful, the View's incident tabs 
+     * are cleared and incident list reset and initialized with the current 
+     * list of incidents.  If the load is not successful, the View's incident tabs
+     * and incident list are cleared.  The list of diversions is also reset.
+     *
+     * @param scriptFile the File chosen by the user in the open file dialog.
+     * @throws ScriptException if an error occurs in reading the script file.
+     * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+     */
+    public void loadScript(File scriptFile) throws ScriptException, SimulationException{    
+        
+        try {
+            theCoorInt.loadScriptFile(scriptFile);
+            
+            tick(0);
+            theSimManagerView.resetIncidentTabs();
+            theSimManagerView.resetIncidents();
+            theSimManagerView.resetDiversions();
+            
+            loadIncidents();
+         } 
+         catch(ScriptException se) {
+            theSimManagerView.resetIncidentTabs();
+            theSimManagerView.resetIncidents();
+            theSimManagerView.resetDiversions();
+            throw se;
+         }
+        catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "loadScript", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }           
+    }
+    
+     /**
+      * This method passes the view's request to create a connection between
+      * the CADSimulator and the Paramics Communicator on to the remote Coordinator. 
+      *
+      * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+      */
+     public void connectToParamics() throws SimulationException {
+
+        try {
+            theCoorInt.connectToParamics();
+        } 
+        catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "connectToParamics", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }
+     }
+     
+     /** 
+      * This method passes the view's request to drop the connection between
+      * the CADSimulator and the Paramics Communicator on to the
+      * remote Coordinator. 
+      *
+      * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+      */
+     public void disconnectFromParamics() throws SimulationException { 
+
+        try {
+            theCoorInt.disconnectFromParamics();
+        } 
+        catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "disconnectFromParamics", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }
+     }
+     
+     /**
+      * This method passes the view's request to load a paramics
+      * network on to the remote Coordinator. 
+      *
+      * @param networkID The unique network ID that is being loaded
+      *
+      * @throws ScriptException if there is an error in loading the network
+      * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+      */
+     public void loadParamicsNetwork(int networkID) throws ScriptException, SimulationException {
+        try {
+             theCoorInt.loadParamicsNetwork(networkID);         
+        } catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "loadParamicsNetwork", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }
+     }
+         
+     /**
+      * This method passes the view's request to get the value of the
+      * currently loaded paramics network on to the remote Coordinator.
+      * 
+      * @return Value of the loaded paramics network.  
+      * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+      */
+     public int getParamicsNetworkLoaded() throws SimulationException {
+         try {
+            return theCoorInt.getParamicsNetworkLoaded();           
+        } catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "getParamicsNetworkLoaded", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }
+     }
+    
+    /**
+     * This method passes the view's request to trigger an incident 
+     * on to the remote Coordinator.
+     *
+     * @throws ScriptException if an error occurs in triggering an event.
+     * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+     */
+    public void triggerIncident(int logNumber) throws ScriptException, SimulationException {
+        try {
+            theCoorInt.triggerIncident(logNumber);
+            
+        } catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "startIncident", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }
+    }
+
+     /**
+      * This method passes the view's request to add an incident into the 
+      * simulation on to the remote Coordinator.
+      *
+      * @param newIncident Incident to add to the simulation
+      * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+      */
+     public void addIncident(final Incident newIncident) throws SimulationException {       
+
+        try {
+            theCoorInt.addIncident(newIncident);
+    
+        } catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "addIncident", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }       
+
+    }
+    
+    /**
+     * This method passes the view's request to delete an incident from the 
+     * simulation on to the remote Coordinator.
+     *
+     * @throws ScriptException if an error occurs in deleting an event.
+     * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+     */
+    public void deleteIncident(int logNumber) throws ScriptException, SimulationException {
+
+        try {
+            theCoorInt.deleteIncident(logNumber);   
+    
+        } catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "deleteIncident", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }       
+    }   
+    
+    
+    /**
+     * This method passes the view's request to reschedule an incident on to 
+     * the remote Coordinator.
+     *
+     * @param newTime New simulation time (in seconds).
+     * @throws ScriptException if the Incident has already started or the time for 
+     *         recheduling has already passed.
+     * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+     */
+     public void rescheduleIncident(long newTime, int logNumber) throws ScriptException, SimulationException {
+            
+        try {
+            theCoorInt.rescheduleIncident(logNumber, newTime);
+        } catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "rescheduleIncident", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }               
+     }
+     
+    /**
+     * This method passes the view's request to get the current list of 
+     * Incidents loaded into the simulation on to the remote Coordinator.
+     *
+     * @return Vector The Vector of currently loaded incidents.
+     * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+     */
+    public Vector<Incident> getIncidentList() throws SimulationException {
+
+        try {
+            return theCoorInt.getIncidentList();
+            
+        } catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "getIncidentList", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }
+    }    
+             
+    /**
+     * This method passes the view's request to get the CMSInfo object 
+     * that corresponds to a unique CMS ID String on to the remote Coordinator.
+     * 
+     * @param cms_id Unique CMS ID String.
+     * @return CMSInfo object corresponding to the parameter CMS id.
+     * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+     */
+    public CMSInfo getCMSDiversionInfo(String cms_id) throws SimulationException {
+        
+        try {
+            return theCoorInt.getCMSDiversionInfo(cms_id);
+        } catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "getCMSDiversionInfo", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }
+    }
+     
+    /**
+     * This method passes the view's request to update diversions for a
+     * CMS on to the remote Coordinator.
+     * 
+     * @param diversion CMS diversions information to apply.
+     * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+     */
+    public void applyDiversions(CMSInfo diversion) throws SimulationException {
+        
+        try {
+            theCoorInt.applyDiversions(diversion);
+
+        } catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "applyDiversions", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }
+    }
+    
+    /**
+     * This method loads the current list of incidents from the Coordinator into the
+     * SimulationManager.  For each incident in the simulation, notify the view to
+     * add a new incident tab.  If the Incident has begun in the simulation, 
+     * call the incidentStarted() method to update the view accordingly.
+     * 
+     * @throws SimulationException if there is an error in RMI communication to the CAD Simulator.
+     */ 
+    private void loadIncidents() throws SimulationException {       
+        
+        try {           
+            for(Incident inc : theCoorInt.getIncidentList()) {
+    
+                Integer logNum = new Integer(inc.getLogNumber());
+                
+                theSimManagerView.addIncidentTab(logNum);
+                theSimManagerView.addIncident(inc);
+            
+                if(inc.getSecondsToStart() < theCoorInt.getCurrentSimulationTime()) {
+                    incidentStarted(logNum);
+                }
+            }
+        } catch (RemoteException re) {
+            simManagerLogger.logp(Level.SEVERE, "SimulationManagerModel", 
+                    "loadIncidentListTable", "Unable to communicate with the " +
+                    "CAD Simulator.", re);
+            
+            throw new SimulationException(SimulationException.CAD_SIM_COMM, re);
+        }
+        
+    }
+    
+
+}
Index: trunk/src/tmcsim/simulationmanager/actions/ConnectToParamicsAction.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/actions/ConnectToParamicsAction.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/actions/ConnectToParamicsAction.java	(revision 2)
@@ -0,0 +1,73 @@
+package tmcsim.simulationmanager.actions;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JOptionPane;
+
+import tmcsim.common.SimulationException;
+import tmcsim.common.CADEnums.PARAMICS_STATUS;
+import tmcsim.simulationmanager.SimulationManagerView;
+
+/**
+ * ConnectToParamicsAction is an AbstractAction that is used for connecting
+ * and disconnecting to/from the Paramics traffic modeler.  When the action 
+ * is performed, the action determines whether a connection currently exists.
+ * If no connection has been made, the paramics status is set to CONNECTING and
+ * the SimulationManagerModel is called to connect to the Paramics communicator.
+ * If a connection has been made, the action prompts the user to confirm the
+ * disconnection and then calls the SimulationManagerModel to disconnect from
+ * Paramics.
+ * @author Matthew Cechini
+ */
+@SuppressWarnings("serial")
+public class ConnectToParamicsAction extends AbstractAction {
+
+    /** Reference to the SimulationManagerView object. */
+    private SimulationManagerView theSimManagerView = null;
+    
+    /** 
+     * Constructor.
+     * @param view View class object for the Simulation Manager.
+     */     
+    public ConnectToParamicsAction(SimulationManagerView view) {
+        super("Connect to Paramics");
+        
+        theSimManagerView = view;
+    }
+    
+    public void actionPerformed(ActionEvent evt) {
+        Runnable connectRunnable = new Runnable(){      
+            public void run() { 
+                if(!theSimManagerView.isConnectedToParamics()) {
+                    try{ 
+                        theSimManagerView.setParamicsStatus(PARAMICS_STATUS.CONNECTING);
+                        
+                        theSimManagerView.getModel().connectToParamics();               
+                    }
+                    catch (SimulationException se) {
+                        theSimManagerView.SimulationExceptionHandler(se);   
+                    }
+                }
+                else {   
+                    if(JOptionPane.showConfirmDialog(null, 
+                            "Disconnecting from paramics will require \n" +
+                            "  restarting the Paramics Communicator.  \n" +
+                            "           Do you wish to continue?") == JOptionPane.YES_OPTION) {
+                        
+                        try { 
+                            theSimManagerView.getModel().disconnectFromParamics();                  
+                        }
+                        catch (SimulationException se) {
+                            theSimManagerView.SimulationExceptionHandler(se);   
+                        }                   
+                    }
+                }           
+            }
+        };
+
+        Thread theThread = new Thread(connectRunnable);
+        theThread.start();
+    }
+
+}
Index: trunk/src/tmcsim/simulationmanager/actions/GotoTimeIndexAction.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/actions/GotoTimeIndexAction.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/actions/GotoTimeIndexAction.java	(revision 2)
@@ -0,0 +1,73 @@
+package tmcsim.simulationmanager.actions;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JOptionPane;
+
+import tmcsim.common.SimulationException;
+import tmcsim.simulationmanager.SimulationManagerView;
+import tmcsim.simulationmanager.dialogs.GotoTimeIndexDialog;
+
+/**
+ * GotoTimeIndexAction is an AbstractAction that is used for moving the 
+ * simulation to a new time mark.  When the action is performed, the action 
+ * shows the GotoTimeIndexDialog to prompt the user for a new time mark.
+ * If the user chooses a new time, the action asks the user to confirm 
+ * the Goto action and then calls the SimulationManagerModel to pause,
+ * reset, and then goto the new simulation time.  This is is done
+ * to ensure the current simulation is paused, to clear all current
+ * incident info from the view, and then to reset the simulation time.
+ * @author Matthew Cechini
+ */
+@SuppressWarnings("serial")
+public class GotoTimeIndexAction extends AbstractAction {
+    
+    /** Reference to the SimulationManagerView object. */
+    private SimulationManagerView theSimManagerView = null;
+    
+    /** 
+     * Constructor.
+     * @param view View class object for the Simulation Manager.
+     */
+    public GotoTimeIndexAction(SimulationManagerView view) {
+        super("Goto");
+        
+        theSimManagerView = view;       
+    }
+    
+    public void actionPerformed(ActionEvent evt) {
+        Runnable gotoRunnable = new Runnable() {
+            public void run() {
+
+                try {                   
+                    GotoTimeIndexDialog gotoDialog = 
+                        new GotoTimeIndexDialog(null, theSimManagerView.getCurrentSimTime());
+                    
+                    if(gotoDialog.gotoApplied) {
+                        
+                        String gotoValue = gotoDialog.getGotoTime();
+                        
+                        if(JOptionPane.showConfirmDialog(null, 
+                                "Do you wish to reposition the simulation time to " + gotoValue,
+                                "Confirm Goto",
+                                JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) 
+                        {       
+                            theSimManagerView.getModel().pauseSimulation();
+                            theSimManagerView.getModel().resetSimulation();                 
+                            theSimManagerView.getModel().gotoSimulationTime(
+                                    SimulationManagerView.stringTimeToLong(gotoValue));
+                        }
+                    }
+                }
+                catch (SimulationException se) {
+                    theSimManagerView.SimulationExceptionHandler(se);
+                }
+            }
+        };
+        
+        Thread theThread = new Thread(gotoRunnable);
+        theThread.start();
+    }
+
+}
Index: trunk/src/tmcsim/simulationmanager/actions/DeleteIncidentAction.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/actions/DeleteIncidentAction.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/actions/DeleteIncidentAction.java	(revision 2)
@@ -0,0 +1,89 @@
+package tmcsim.simulationmanager.actions;
+
+import java.awt.event.ActionEvent;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.AbstractAction;
+import javax.swing.JTable;
+
+import tmcsim.common.ScriptException;
+import tmcsim.common.SimulationException;
+import tmcsim.simulationmanager.SimulationManagerView;
+import tmcsim.simulationmanager.model.IncidentListTableModel.INCIDENT_LIST_COLUMNS;
+
+
+/**
+ * DeleteIncidentAction is an AbstractAction that is used for removing 
+ * an incident from the simulation that has not been started.  When the action 
+ * is performed, the incident selected in the incident list table on the 
+ * SimulationManagerView is chosen for triggering.  If the user has not 
+ * selected an incident to trigger, an information window is shown to prompt
+ * the user to select an incident.  If an incident has been selected, the 
+ * action calls the SimulationManagerModel with the Incident Log Number to remove 
+ * the incident.
+ * <br/>
+ * <br/>
+ * The NETWORK_ID_SPINNER key should be assigned the IncidentListTable object
+ * from the SimulationManagerView object.
+ */     
+@SuppressWarnings("serial")
+public class DeleteIncidentAction extends AbstractAction {
+
+    /** 
+     * This key string is used to reference the IncidentListTable object
+     * from the SimulationManagerView object.
+     */
+    public static final String INCIDENT_LIST_TABLE = "INCIDENT_LIST_TABLE";
+    
+    /** Reference to the SimulationManagerView object. */
+    private SimulationManagerView theSimManagerView = null;
+        
+    /** 
+     * Constructor.
+     * @param view View class object for the Simulation Manager.
+     */     
+    public DeleteIncidentAction(SimulationManagerView view) {
+        super("Delete");
+        
+        theSimManagerView = view;
+    }
+    
+    
+    public void actionPerformed(ActionEvent evt) {
+        if(getValue(INCIDENT_LIST_TABLE) == null) {
+            Logger.getLogger("tmcsim.simulationmanager.actions").logp(
+                    Level.WARNING, "LoadParamicsNetworkAction", 
+                    "actionPerformed", 
+                    "Object for INCIDENT_LIST_TABLE is null.");
+            return;
+        }
+        
+        Runnable deleteRunnable = new Runnable(){       
+            public void run() { 
+                try {                   
+                    if(((JTable)getValue(INCIDENT_LIST_TABLE)).getSelectedRowCount() == 0)  {
+                        throw new ScriptException("Please select the incident you wish to delete.");
+                    }
+                        
+                    int selectedRow        = ((JTable)getValue(INCIDENT_LIST_TABLE)).getSelectedRow(); 
+                    Integer incidentLogNum = (Integer)((JTable)getValue(INCIDENT_LIST_TABLE)).getValueAt(
+                            selectedRow, INCIDENT_LIST_COLUMNS.LOG_NUM_COL.colNum);
+                    
+                    theSimManagerView.getModel().deleteIncident(incidentLogNum);                        
+                                        
+                }
+                catch (ScriptException se) {
+                    theSimManagerView.ScriptExceptionHandler(se);           
+                }
+                catch (SimulationException se) {
+                    theSimManagerView.SimulationExceptionHandler(se);   
+                }   
+            }
+        };
+
+        Thread theThread = new Thread(deleteRunnable);
+        theThread.start();
+    }
+
+}
Index: trunk/src/tmcsim/simulationmanager/actions/RescheduleIncidentAction.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/actions/RescheduleIncidentAction.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/actions/RescheduleIncidentAction.java	(revision 2)
@@ -0,0 +1,118 @@
+package tmcsim.simulationmanager.actions;
+
+import java.awt.event.ActionEvent;
+import java.util.StringTokenizer;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.AbstractAction;
+import javax.swing.JTable;
+
+import tmcsim.common.ScriptException;
+import tmcsim.common.SimulationException;
+import tmcsim.simulationmanager.SimulationManagerView;
+import tmcsim.simulationmanager.model.IncidentTimeSpinnerModel;
+import tmcsim.simulationmanager.model.IncidentListTableModel.INCIDENT_LIST_COLUMNS;
+
+
+/**
+ * RescheduleIncidentAction is an AbstractAction that is used for rescheduling
+ * an incident that has been loaded into the simulation, but not started. 
+ * When the action is performed, the incident selected in the incident list 
+ * table on the SimulationManagerView is chosen for triggering.  If the user has
+ * not selected an incident to trigger, an information window is shown to prompt
+ * the user to select an incident.  If an incident has been selected, the
+ * action calls the SimulationManagerModel with the Incident Log Number and
+ * the time parsed from the IncidentTimeModel object.
+ * <br/>
+ * <br/>
+ * The INCIDENT_LIST_TABLE key should be assigned the IncidentListTable object
+ * from the SimulationManagerView object.
+ * <br/>
+ * <br/>
+ * The INCIDENT_TIME_MODEL key should be assigned the IncidentTimeModel object
+ * from the SimulationManagerView object.
+ * @author Matthew Cechini
+ */     
+@SuppressWarnings("serial")
+public class RescheduleIncidentAction extends AbstractAction {
+    
+    /** 
+     * This key string is used to reference the IncidentListTable object
+     * from the SimulationManagerView object.
+     */
+    public static final String INCIDENT_LIST_TABLE = "INCIDENT_LIST_TABLE";
+    
+    /** 
+     * This key string is used to reference the IncidentTimeModel object
+     * from the SimulationManagerView object.
+     */
+    public static final String INCIDENT_TIME_MODEL = "INCIDENT_TIME_MODEL";
+    
+    /** Reference to the SimulationManagerView object. */
+    private SimulationManagerView theSimManagerView = null;
+    
+    /**
+     * Constructor.
+     * @param view View class object for the Simulation Manager.
+     */
+    public RescheduleIncidentAction(SimulationManagerView view) {
+        super("Reschedule");
+        
+        theSimManagerView = view;
+    }
+    
+    public void actionPerformed(ActionEvent evt) {
+        if(getValue(INCIDENT_LIST_TABLE) == null) {
+            Logger.getLogger("tmcsim.simulationmanager.actions").logp(
+                    Level.WARNING, "RescheduleIncidentAction", 
+                    "actionPerformed", 
+                    "Object for INCIDENT_LIST_TABLE is null.");
+            return;
+        }
+        if(getValue(INCIDENT_TIME_MODEL) == null) {
+            Logger.getLogger("tmcsim.simulationmanager.actions").logp(
+                    Level.WARNING, "RescheduleIncidentAction", 
+                    "actionPerformed", 
+                    "Object for INCIDENT_TIME_MODEL is null.");
+            return;
+        }
+        
+        Runnable reschedRunnable = new Runnable(){      
+            public void run() { 
+                try {
+                    if(((JTable)getValue(INCIDENT_LIST_TABLE)).getSelectedRowCount() == 0) 
+                        throw new ScriptException("Please select the incident you wish to reschedule.");        
+
+                    int selectedRow        = ((JTable)getValue(INCIDENT_LIST_TABLE)).getSelectedRow();
+                    Integer incidentLogNum = (Integer)((JTable)getValue(INCIDENT_LIST_TABLE)).getValueAt(
+                            selectedRow, INCIDENT_LIST_COLUMNS.LOG_NUM_COL.colNum);
+                    
+
+                    StringTokenizer strTok = new StringTokenizer(
+                            (String)((IncidentTimeSpinnerModel)getValue(INCIDENT_TIME_MODEL)).getValue(), ":");
+                    
+                    Long newTime = Long.parseLong(strTok.nextToken()) * 3600  +
+                                   Long.parseLong(strTok.nextToken()) * 60  +
+                                   Long.parseLong(strTok.nextToken());
+                    
+                    theSimManagerView.getModel().rescheduleIncident(newTime, incidentLogNum);
+                    
+                    ((JTable)getValue(INCIDENT_LIST_TABLE)).setValueAt(newTime, selectedRow, 
+                            INCIDENT_LIST_COLUMNS.SCHEDULED_COL.colNum);
+                    
+                }
+                catch (ScriptException se) {
+                    theSimManagerView.ScriptExceptionHandler(se);           
+                }
+                catch (SimulationException se) {
+                    theSimManagerView.SimulationExceptionHandler(se);   
+                }
+            }
+        };
+
+        Thread theThread = new Thread(reschedRunnable);
+        theThread.start();
+    }
+
+}
Index: trunk/src/tmcsim/simulationmanager/actions/TriggerIncidentAction.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/actions/TriggerIncidentAction.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/actions/TriggerIncidentAction.java	(revision 2)
@@ -0,0 +1,79 @@
+package tmcsim.simulationmanager.actions;
+
+import java.awt.event.ActionEvent;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.AbstractAction;
+import javax.swing.JTable;
+
+import tmcsim.common.ScriptException;
+import tmcsim.common.SimulationException;
+import tmcsim.simulationmanager.SimulationManagerView;
+
+/**
+ * TriggerIncidentAction is an AbstractAction that is used for triggering
+ * a simulation incident.  When the action is performed, the incident selected
+ * in the incident list table on the Simulation Manager is chosen for triggering.
+ * This is done by sending the incident's log number to the Simulation Manager
+ * model.  If an incident is not selected in the table, a notification
+ * window is shown to the user prompting for an incident to be selected.
+ * <br/>
+ * <br/>
+ * The INCIDENT_LIST_TABLE key must be assigned the IncidentListTable object
+ * from the SimulationManagerView object.
+ */     
+@SuppressWarnings("serial")
+public class TriggerIncidentAction extends AbstractAction {
+
+    /** 
+     * This key string is used to reference the IncidentListTable object
+     * from the SimulationManagerView object.
+     */
+    public static final String INCIDENT_LIST_TABLE = "INCIDENT_LIST_TABLE";
+    
+    /** Reference to the SimulationManagerView object. */
+    private SimulationManagerView theSimManagerView = null;
+    
+    /** 
+     * Constructor.
+     * @param view View class object for the Simulation Manager.
+     */
+    public TriggerIncidentAction(SimulationManagerView view) {
+        super("Trigger");
+        
+        theSimManagerView = view;
+    }
+    
+    public void actionPerformed(ActionEvent evt) {
+        if(getValue(INCIDENT_LIST_TABLE) == null) {
+            Logger.getLogger("tmcsim.simulationmanager.actions").logp(
+                    Level.WARNING, "TriggerIncidentAction", "actionPerformed", 
+                    "Object for INCIDENT_LIST_TABLE is null.");
+            return;
+        }
+        
+        Runnable triggerRunnable = new Runnable(){      
+            public void run() { 
+                try {
+                    if(((JTable)getValue(INCIDENT_LIST_TABLE)).getSelectedRowCount() == 0) 
+                        throw new ScriptException("Please select the incident you wish to trigger.");           
+                        
+                    theSimManagerView.getModel().triggerIncident(
+                            (Integer)((JTable)getValue(INCIDENT_LIST_TABLE)).getValueAt(
+                                    ((JTable)getValue(INCIDENT_LIST_TABLE)).getSelectedRow(), 0));
+                }
+                catch (ScriptException se) {
+                    theSimManagerView.ScriptExceptionHandler(se);           
+                }
+                catch (SimulationException se) {
+                    theSimManagerView.SimulationExceptionHandler(se);   
+                }
+            }
+        };
+
+        Thread theThread = new Thread(triggerRunnable);
+        theThread.start();
+    }
+
+}
Index: trunk/src/tmcsim/simulationmanager/actions/PauseSimulationAction.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/actions/PauseSimulationAction.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/actions/PauseSimulationAction.java	(revision 2)
@@ -0,0 +1,47 @@
+package tmcsim.simulationmanager.actions;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+
+import tmcsim.common.SimulationException;
+import tmcsim.simulationmanager.SimulationManagerView;
+
+/**
+ * PauseSimulationAction is an AbstractAction that is used for pausing
+ * the simulation. When the action is performed, the action
+ * calls the SimulationManagerModel to pause the simulation.
+ */
+@SuppressWarnings("serial")
+public class PauseSimulationAction extends AbstractAction {
+    
+    /** Reference to the SimulationManagerView object. */
+    private SimulationManagerView theSimManagerView = null;
+
+    /** 
+     * Constructor.
+     * @param view View class object for the Simulation Manager.
+     */
+    public PauseSimulationAction(SimulationManagerView view) {
+        super("Pause");
+        
+        theSimManagerView = view;
+    }
+
+    public void actionPerformed(ActionEvent evt) {
+        Runnable pauseRunnable = new Runnable(){        
+            public void run() { 
+                try {
+                    theSimManagerView.getModel().pauseSimulation();
+                }
+                catch(SimulationException se) {
+                    theSimManagerView.SimulationExceptionHandler(se);
+                }
+            }
+        };
+
+        Thread theThread = new Thread(pauseRunnable);
+        theThread.start();
+    }
+
+}
Index: trunk/src/tmcsim/simulationmanager/actions/StartSimulationAction.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/actions/StartSimulationAction.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/actions/StartSimulationAction.java	(revision 2)
@@ -0,0 +1,67 @@
+package tmcsim.simulationmanager.actions;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JOptionPane;
+
+import tmcsim.common.ScriptException;
+import tmcsim.common.SimulationException;
+import tmcsim.simulationmanager.SimulationManagerView;
+
+/**
+ * StartSimulationAction is an AbstractAction that is used for starting
+ * the simulation. When the action is performed, the action checks
+ * whether the a connection has been made to Paramics.  If not, the user
+ * is prompted whether they want to continue without a connection to Paramics.
+ * If not, the action returns.  If there is a connection, or the user wishes to
+ * continue without, the action calls the SimulationManagerModel to start the 
+ * simulation.
+ * @author Matthew Cechini
+ */
+@SuppressWarnings("serial")
+public class StartSimulationAction extends AbstractAction {
+    
+    /** Reference to the SimulationManagerView object. */
+    private SimulationManagerView theSimManagerView = null;
+    
+    /**
+     * Constructor.
+     * @param View class object for the Simulation Manager.
+     */
+    public StartSimulationAction(SimulationManagerView view) {
+        super("Start");
+        
+        theSimManagerView = view;
+    }
+    
+    public void actionPerformed(ActionEvent evt) {
+        Runnable startRunnable = new Runnable(){        
+            public void run() {             
+                if(!theSimManagerView.isConnectedToParamics()) {
+                    if (JOptionPane.showConfirmDialog(null, "Connection has not been " +
+                            "made to the Paramics Traffic Modeler.  Do you wish " +
+                            "to continue?", "Paramics Connection", 
+                            JOptionPane.YES_NO_OPTION, 
+                            JOptionPane.QUESTION_MESSAGE) == JOptionPane.NO_OPTION) {
+                                return;
+                            }
+                }
+                
+                try { 
+                    theSimManagerView.getModel().startSimulation();
+                }
+                catch (ScriptException se) {
+                    theSimManagerView.ScriptExceptionHandler(se);
+                }
+                catch (SimulationException se) {
+                    theSimManagerView.SimulationExceptionHandler(se);
+                }
+            }       
+        };      
+
+        Thread theThread = new Thread(startRunnable);
+        theThread.start();
+    }
+
+}
Index: trunk/src/tmcsim/simulationmanager/actions/LoadScriptAction.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/actions/LoadScriptAction.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/actions/LoadScriptAction.java	(revision 2)
@@ -0,0 +1,68 @@
+package tmcsim.simulationmanager.actions;
+
+import java.awt.event.ActionEvent;
+import java.io.File;
+
+import javax.swing.AbstractAction;
+import javax.swing.JFileChooser;
+import javax.swing.SwingUtilities;
+
+import tmcsim.common.ScriptException;
+import tmcsim.common.SimulationException;
+import tmcsim.simulationmanager.SimulationManagerView;
+import tmcsim.simulationmanager.model.XmlFilter;
+
+/**
+ * LoadScriptAction is an AbstractAction that is used for loading a
+ * simulation script.  When the action is performed, the action opens
+ * a file chooser dialog.  If the user chooses a file, the action calls the 
+ * SimulationMAnagerModel to load the script file.
+ * @author Matthew Cechini
+ */ 
+@SuppressWarnings("serial")
+public class LoadScriptAction extends AbstractAction {
+    
+    /** Reference to the SimulationManagerView object. */
+    private SimulationManagerView theSimManagerView = null;
+    
+    /** 
+     * Constructor.
+     * @param view View class object for the Simulation Manager.
+     */ 
+    public LoadScriptAction(SimulationManagerView view) {
+        super("Load Script");
+        
+        theSimManagerView = view;       
+    }
+    
+    public void actionPerformed(ActionEvent evt) {
+        SwingUtilities.invokeLater(new Runnable(){      
+            public void run() { 
+                JFileChooser chooser = new JFileChooser(
+                        SimulationManagerView.SCRIPT_DIR);
+                
+                chooser.setDialogTitle("Open Simulation Script File");
+                chooser.setMultiSelectionEnabled(false);        
+                chooser.setFileFilter(new XmlFilter());
+        
+                int result = chooser.showOpenDialog(null);
+                
+                File selectedFile = chooser.getSelectedFile();
+                
+                if(result == JFileChooser.APPROVE_OPTION) {
+                
+                    try{ 
+                        theSimManagerView.getModel().loadScript(selectedFile);
+                    }
+                    catch (ScriptException se) {
+                        theSimManagerView.ScriptExceptionHandler(se);
+                    }
+                    catch (SimulationException se) {
+                        theSimManagerView.SimulationExceptionHandler(se);   
+                    }
+                }
+            }
+        });
+    }
+
+}
Index: trunk/src/tmcsim/simulationmanager/actions/AddIncidentAction.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/actions/AddIncidentAction.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/actions/AddIncidentAction.java	(revision 2)
@@ -0,0 +1,171 @@
+package tmcsim.simulationmanager.actions;
+
+import java.awt.event.ActionEvent;
+import java.io.File;
+import java.util.Vector;
+
+import javax.swing.AbstractAction;
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+import javax.xml.parsers.SAXParserFactory;
+
+import tmcsim.client.cadclientgui.data.Incident;
+import tmcsim.common.ScriptException;
+import tmcsim.client.cadclientgui.ScriptHandler;
+import tmcsim.common.SimulationException;
+import tmcsim.common.CADEnums.SCRIPT_STATUS;
+import tmcsim.simulationmanager.SimulationManagerView;
+import tmcsim.simulationmanager.dialogs.AddIncidentDialog;
+
+
+/**
+ * AddIncidentAction is an AbstractAction that is used for adding an incident
+ * into the current simulation.  When the action is performed, a file chooser
+ * is shown and the user is prompted to select which file they want to load
+ * script incidents from.  If the user selects a file, the script file is parsed
+ * and available incidents are displayed in the AddIncidentDialog.  When the dialog
+ * window is closed, the action checks for selected incidents.  If a selected incident
+ * has a conflicting log number with a current incident, or if the scheduled time
+ * is prior to the current simulation time, the dialog is reshown with an error.
+ * Once the user has selected 0 or more incidents that can be added to the 
+ * simulation, the SimulationManagerModel is called with the new incidents to add.
+ * If incidents were added and the simulation has not been started, the 
+ * ScriptStatus is set to SCRIPT_STOPPED_NOT_STARTED.
+ */
+@SuppressWarnings("serial")
+public class AddIncidentAction extends AbstractAction {
+    
+    /** Reference to the SimulationManagerView object. */
+    private SimulationManagerView theSimManagerView = null;
+    
+    /** AddIncidentDialog used for adding new incidents into the simulation. */
+    private AddIncidentDialog theAddIncidentDialog; 
+    
+    /** 
+     * Constructor.
+     * @param view View class object for the Simulation Manager.
+     */     
+    public AddIncidentAction(SimulationManagerView view) {
+        super("Add New Incident");
+        
+        theSimManagerView = view;
+
+        theAddIncidentDialog  = new AddIncidentDialog(
+                theSimManagerView);
+    }
+
+    public void actionPerformed(ActionEvent evt) {
+        Runnable addRunnable = new Runnable(){      
+            public void run() { 
+                try{                
+                    JFileChooser chooser   = new JFileChooser(
+                            SimulationManagerView.SCRIPT_DIR);
+                    
+                    chooser.setDialogTitle("Open Simulation Script File");
+                    chooser.setMultiSelectionEnabled(false);
+            
+                    if(chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
+                        
+                        File selectedFile = chooser.getSelectedFile();                              
+                        ScriptHandler sh  = null;
+                        
+                        try {                   
+                            sh = new ScriptHandler();
+                            SAXParserFactory.newInstance().newSAXParser().parse(selectedFile, sh);
+                            
+                        } catch (Exception e) {
+                            throw new SimulationException(SimulationException.INVALID_SCRIPT_FILE);
+                        }
+                        
+                        boolean incidentsAdded     = false;
+                        boolean incidentsValidated = true;
+                        Vector<Incident> currIncidents   = theSimManagerView.getModel().getIncidentList();
+                        Vector<Incident> parsedIncidents = sh.getIncidents();
+                        Vector<Integer>  duplicateIncNum = new Vector<Integer>();
+                        Vector<Integer>  invalidIncTime  = new Vector<Integer>();
+                                                
+                        //Show the dialog with the initialized list of incidents.
+                        theAddIncidentDialog.setModelData(parsedIncidents);
+                        
+                        //Loop until the user selects a list(may be empty) of valid incidents.
+                        do {                
+                            incidentsValidated = true;
+                            theAddIncidentDialog.showDialog();
+                            
+                            duplicateIncNum.clear();
+                            invalidIncTime.clear();
+                            
+                            //Validate the selected incidents.  Validation fails if:
+                            //  +  A selected incident's log number matches a log number already in the simulation.
+                            //  +  A selected incident has been scheduled to occur at a time that has passed in the simulation.
+                            for(Integer incidentNum : theAddIncidentDialog.getSelectedIncidentTimes().keySet()) {
+                                
+                                for(Incident inc : currIncidents) {
+                                    if(inc.logNum.equals(incidentNum)) {
+                                        duplicateIncNum.add(incidentNum);
+                                        incidentsValidated = false;
+                                    }
+                                }
+                                
+                                long incSchedTime = theAddIncidentDialog.getSelectedIncidentTimes().get(incidentNum); 
+                                if(incSchedTime < theSimManagerView.getCurrentSimTime()) 
+                                {
+                                    invalidIncTime.add(incidentNum);
+                                    incidentsValidated = false;
+                                }                               
+                            }
+                            
+                            if(duplicateIncNum.size() > 0) {
+                                JOptionPane.showMessageDialog(null, 
+                                        "Duplicate incidents selected: " + 
+                                        duplicateIncNum.toString().substring(1, 
+                                                duplicateIncNum.toString().length()-1),
+                                        "Error",
+                                        JOptionPane.ERROR_MESSAGE);
+                            }
+                            else if(invalidIncTime.size() > 0) {
+                                JOptionPane.showMessageDialog(null,
+                                        "Simulation time already passed for incidents: " + 
+                                        invalidIncTime.toString().substring(1, 
+                                                invalidIncTime.toString().length()-1),
+                                        "Error",
+                                        JOptionPane.ERROR_MESSAGE);
+                            }
+                            
+                        } while(!incidentsValidated);
+                        
+                
+                        //Loop through all selected incidents, set the new start time, and add the Incident
+                        //to simulation.
+                        for(Integer incidentNum : theAddIncidentDialog.getSelectedIncidentTimes().keySet()) {
+                            for(Incident inc : parsedIncidents) {
+                                if(inc.logNum.equals(incidentNum)) {
+                                    incidentsAdded = true;
+                                    inc.setSecondsToStart(theAddIncidentDialog
+                                            .getSelectedIncidentTimes().get(incidentNum));
+                                    
+                                    theSimManagerView.getModel().addIncident(inc);
+                                }
+                            }
+                        }
+                
+                        
+                        if(incidentsAdded && !theSimManagerView.isSimulationStarted()) 
+                        {
+                            theSimManagerView.setScriptStatus(
+                                    SCRIPT_STATUS.SCRIPT_STOPPED_NOT_STARTED);
+                        }
+                    } 
+                } 
+                catch (SimulationException se) {
+                    theSimManagerView.SimulationExceptionHandler(se);   
+                }
+            }
+        };
+        
+        Thread theThread = new Thread(addRunnable);
+        theThread.start();
+
+    }
+
+}
Index: trunk/src/tmcsim/simulationmanager/actions/ResetSimulationAction.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/actions/ResetSimulationAction.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/actions/ResetSimulationAction.java	(revision 2)
@@ -0,0 +1,48 @@
+package tmcsim.simulationmanager.actions;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+
+import tmcsim.common.SimulationException;
+import tmcsim.simulationmanager.SimulationManagerView;
+
+/**
+ * ResetSimulationAction is an AbstractAction that is used for resetting
+ * the simulation. When the action is performed, the action calls the 
+ * SimulationManagerModel to reset the simulation.
+ * @author Matthew Cechini
+ */ 
+@SuppressWarnings("serial")
+public class ResetSimulationAction extends AbstractAction {
+    
+    /** Reference to the SimulationManagerView object. */
+    private SimulationManagerView theSimManagerView = null;
+    
+    /**
+     * Constructor.
+     * @param view View class object for the Simulation Manager.
+     */
+    public ResetSimulationAction(SimulationManagerView view) {
+        super("Reset");
+        
+        theSimManagerView = view;
+    }
+
+    public void actionPerformed(ActionEvent evt) {
+        Runnable resetRunnable = new Runnable(){        
+            public void run() { 
+                try {
+                    theSimManagerView.getModel().resetSimulation();
+                }
+                catch (SimulationException se) {
+                    theSimManagerView.SimulationExceptionHandler(se);   
+                }
+            }
+        };
+
+        Thread theThread = new Thread(resetRunnable);
+        theThread.start();
+    }
+
+}
Index: trunk/src/tmcsim/simulationmanager/actions/ApplyDiversionAction.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/actions/ApplyDiversionAction.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/actions/ApplyDiversionAction.java	(revision 2)
@@ -0,0 +1,109 @@
+package tmcsim.simulationmanager.actions;
+
+import java.awt.event.ActionEvent;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.AbstractAction;
+import javax.swing.JComboBox;
+
+import tmcsim.cadmodels.CMSDiversion;
+import tmcsim.common.SimulationException;
+import tmcsim.simulationmanager.SimulationManagerView;
+import tmcsim.simulationmanager.dialogs.CMSDiversionDialog;
+
+
+/**
+ * ApplyDiversionAction is an AbstractAction that is used for settings traffic
+ * diversions in the simulation.  When the action is performed, the action gets 
+ * the selected CMS ID from the CMSIDComboBox in the SimulationManagerView.
+ * The action then calls the SimulationManagerModel to get the current CMSInfo
+ * for this id.  The CMSDiversionDialog is then shown with this CMSInfo.  If
+ * the user updates the diversions at this CMS, the new info is sent to the
+ * SimulationManagerModel to update the current diversions.
+ * <br/>
+ * <br/>
+ * The CMS_ID_COMBO_BOX key should be assigned the CMSID JComboBox object
+ * from the SimulationManagerView object.
+ */
+@SuppressWarnings("serial")
+public class ApplyDiversionAction extends AbstractAction {
+    
+    /** 
+     * This key string is used to reference the CMSID JComboBox object
+     * from the SimulationManagerView object.
+     */
+    public static final String CMS_ID_COMBO_BOX = "CMS_ID_COMBO_BOX";
+    
+    /** Reference to the SimulationManagerView object. */
+    private SimulationManagerView theSimManagerView = null;
+
+    /** CMSDiversionDialog used for updating diversions in the simulation. */
+    private CMSDiversionDialog theCMSDiversionDialog;
+    
+    /** 
+     * Constructor.
+     * @param view View class object for the Simulation Manager.
+     */         
+    public ApplyDiversionAction(SimulationManagerView view) {
+        super("Divert Traffic");
+        
+        theSimManagerView     = view;
+        theCMSDiversionDialog = new CMSDiversionDialog(theSimManagerView);
+    }
+
+    public void actionPerformed(ActionEvent evt) {
+        if(getValue(CMS_ID_COMBO_BOX) == null) {
+            Logger.getLogger("tmcsim.simulationmanager.actions").logp(
+                    Level.WARNING, "ApplyDiversionAction", 
+                    "actionPerformed", 
+                    "Object for CMS_ID_COMBO_BOX is null.");
+            return;
+        }
+        
+
+        showDiversionDialog((String)((JComboBox)getValue(CMS_ID_COMBO_BOX)).getSelectedItem());
+    }
+
+    public void showDiversionDialog(final String cms_id) {
+
+        Runnable divertRunnable = new Runnable(){       
+            public void run() { 
+    
+                try{
+                    
+                    theCMSDiversionDialog.showDialog(
+                            theSimManagerView.getModel().getCMSDiversionInfo(cms_id));
+                    
+                    long currentSimTime = theSimManagerView.getCurrentSimTime(); 
+
+                    if(theCMSDiversionDialog.theCMSInfo.isUpdated()) {  
+
+                        for(CMSDiversion div : theCMSDiversionDialog.theCMSInfo.possibleDiversions) {
+                            if(div.isUpdated()) {
+                                div.timeApplied = currentSimTime;
+                                
+                                theSimManagerView.removeDiversion(theCMSDiversionDialog.theCMSInfo, div);
+                        
+                                if(!div.isCleared()) {
+                                    theSimManagerView.addDiversion(theCMSDiversionDialog.theCMSInfo, div);
+                                }
+                            }
+                        }
+                        
+                        theSimManagerView.getModel().applyDiversions(theCMSDiversionDialog.theCMSInfo);
+                    }   
+                    
+                }
+                catch (SimulationException se) {
+                    theSimManagerView.SimulationExceptionHandler(se);   
+                }
+            }
+        };
+
+        Thread theThread = new Thread(divertRunnable);
+        theThread.start();
+        
+    }
+    
+}
Index: trunk/src/tmcsim/simulationmanager/actions/ExitAction.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/actions/ExitAction.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/actions/ExitAction.java	(revision 2)
@@ -0,0 +1,41 @@
+package tmcsim.simulationmanager.actions;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JOptionPane;
+
+import tmcsim.simulationmanager.SimulationManagerView;
+/**
+ * ExitAction is an AbstractAction that is used for exiting the Simulation
+ * Manager application.  When the action is performed, the action prompts the 
+ * user to confirm the exit, and then disposes of the SimulationManagerView class. 
+ * @author Matthew Cechini
+ */
+@SuppressWarnings("serial")
+public class ExitAction extends AbstractAction {    
+    
+    /** Reference to the SimulationManagerView object. */
+    private SimulationManagerView theSimManagerView = null;
+    
+    /** 
+     * Constructor.
+     * @param view View class object for the Simulation Manager.
+     */
+    public ExitAction(SimulationManagerView view) {
+        super("Exit");
+        
+        theSimManagerView = view;       
+    }
+    
+
+    public void actionPerformed(ActionEvent evt) {
+        
+        if(JOptionPane.showConfirmDialog(
+                null, "Exit Simulation Manager?", "Confirm Exit",
+                JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) 
+        {   
+            theSimManagerView.dispose();    
+        }   
+    }
+}
Index: trunk/src/tmcsim/simulationmanager/actions/LoadParamicsNetworkAction.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/actions/LoadParamicsNetworkAction.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/actions/LoadParamicsNetworkAction.java	(revision 2)
@@ -0,0 +1,89 @@
+package tmcsim.simulationmanager.actions;
+
+import java.awt.event.ActionEvent;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.AbstractAction;
+import javax.swing.JSpinner;
+import javax.swing.SpinnerNumberModel;
+
+import tmcsim.common.ScriptException;
+import tmcsim.common.SimulationException;
+import tmcsim.common.CADEnums.PARAMICS_STATUS;
+import tmcsim.simulationmanager.SimulationManagerView;
+
+/**
+ * LoadParamicsNetworkAction is an AbstractAction that is used for loading 
+ * a Paramics traffic network.  When the action is performed, the action gets
+ * the network ID from the NetworkIDSpinner in the SimulationManagerView.  The 
+ * action sets the paramics status to SENDING_NETWORK_ID and calls the
+ * SimulationManagerModel to load the Paramics network.
+ * <br/>
+ * <br/>
+ * The NETWORK_ID_SPINNER key should be assigned the NetworkIDSpinner object
+ * from the SimulationManagerView object.
+ * @author Matthew Cechini
+ */
+@SuppressWarnings("serial")
+public class LoadParamicsNetworkAction extends AbstractAction {
+    
+    /** 
+     * This key string is used to reference the NetworkIDSpinner object
+     * from the SimulationManagerView object.
+     */
+    public static final String NETWORK_ID_SPINNER = "NETWORK_ID_SPINNER";
+    
+    /** Reference to the SimulationManagerView object. */
+    private SimulationManagerView theSimManagerView = null;
+    
+    /** 
+     * Constructor.
+     * @param view View class object for the Simulation Manager.
+     */ 
+    public LoadParamicsNetworkAction(SimulationManagerView view) {
+        super("Load Network");
+        
+        theSimManagerView = view;
+    }
+
+    public void actionPerformed(ActionEvent evt) {
+        if(getValue(NETWORK_ID_SPINNER) == null) {
+            Logger.getLogger("tmcsim.simulationmanager.actions").logp(
+                    Level.WARNING, "LoadParamicsNetworkAction", 
+                    "actionPerformed", 
+                    "Object for NETWORK_ID_SPINNER is null.");
+            return;
+        }
+        
+        Runnable loadNetworkRunnable = new Runnable(){      
+            public void run() { 
+                try { 
+                
+                    int id = ((SpinnerNumberModel) ((JSpinner) getValue(NETWORK_ID_SPINNER))
+                            .getModel()).getNumber().intValue();
+                    
+                    theSimManagerView.setParamicsStatus(
+                            PARAMICS_STATUS.SENDING_NETWORK_ID);
+                            
+                    theSimManagerView.getModel().loadParamicsNetwork(id);
+                     
+                }
+                catch (NumberFormatException nfe) {
+                    theSimManagerView.ScriptExceptionHandler(
+                            new ScriptException("Invalid Network ID"));
+                }
+                catch (ScriptException se) {
+                    theSimManagerView.ScriptExceptionHandler(se);
+                }
+                catch (SimulationException se) {
+                    theSimManagerView.SimulationExceptionHandler(se);   
+                }           
+            }
+        };
+
+        Thread theThread = new Thread(loadNetworkRunnable);
+        theThread.start();
+    }
+
+}
Index: trunk/src/tmcsim/simulationmanager/model/AppliedDiversionTableItem.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/model/AppliedDiversionTableItem.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/model/AppliedDiversionTableItem.java	(revision 2)
@@ -0,0 +1,40 @@
+package tmcsim.simulationmanager.model;
+
+/** 
+ * Container class to hold information displayed in the table.
+ * @author Matthew Cechini
+ */
+public class AppliedDiversionTableItem implements
+        Comparable<AppliedDiversionTableItem> {
+
+    public String cmsID;
+
+    public String originalPath;
+
+    public String newPath;
+
+    public Integer currentDiv;
+
+    public Long timeApplied;
+    
+    
+    public AppliedDiversionTableItem(String id, String oPath, String nPath,
+            Integer div, Long time) {
+        cmsID = id;
+        originalPath = oPath;
+        newPath = nPath;
+        currentDiv = div;
+        timeApplied = time;
+    }
+
+    public int compareTo(AppliedDiversionTableItem arg) {
+
+        if (cmsID.equals(arg.cmsID)) {
+            if (originalPath.equals(arg.originalPath)) {
+                return newPath.compareTo(arg.newPath);
+            }
+            return originalPath.compareTo(arg.originalPath);
+        } else
+            return cmsID.compareTo(arg.cmsID);
+    }
+}
Index: trunk/src/tmcsim/simulationmanager/model/IncidentHistoryTableModel.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/model/IncidentHistoryTableModel.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/model/IncidentHistoryTableModel.java	(revision 2)
@@ -0,0 +1,196 @@
+package tmcsim.simulationmanager.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.event.TableModelEvent;
+import javax.swing.table.DefaultTableModel;
+
+import tmcsim.cadmodels.IncidentInquiryDetails;
+import tmcsim.client.cadclientgui.data.IncidentEvent;
+
+/** 
+ * IncidentHistoryTableModel is a DefaultTableModel used to display the 
+ * list of current incident events in the Event History portion of the
+ * Simulation Manager.  The columns in this table show the event source,
+ * the simulation time the event occured, and the event's description.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+@SuppressWarnings("serial")
+public class IncidentHistoryTableModel extends DefaultTableModel {
+    
+    /**
+     * Enumeration of columns for this table.
+     * @author Matthew Cechini
+     */ 
+    public static enum EVENT_HIST_COLUMNS {
+        POSITION_COL    ("Position", 0, 70, 110, 80),
+        TIME_COL        ("Time", 1, 50, 100, 60),
+        EVENT_DESC_COL  ("Event Description", 2, 250, 600, 300);
+        
+        public String colName;
+        public int colNum;
+        public int colMinWidth;
+        public int colMaxWidth;
+        public int colPrefWidth;
+        
+        private EVENT_HIST_COLUMNS (String name, int num, int min, int max, int pref) {
+            colName      = name;
+            colNum       = num;
+            colMinWidth  = min;
+            colMaxWidth  = max;
+            colPrefWidth = pref;
+        }
+        
+        public static int colCount() {
+            return values().length;
+        }
+        
+        public static String columnName(int num) {
+            
+            for(EVENT_HIST_COLUMNS column : EVENT_HIST_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colName;
+            }
+            
+            return "";
+        }
+        
+        public static int columnMinWidth(int num) {
+            
+            for(EVENT_HIST_COLUMNS column : EVENT_HIST_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colMinWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static int columnMaxWidth(int num) {
+            
+            for(EVENT_HIST_COLUMNS column : EVENT_HIST_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colMaxWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static int columnPrefWidth(int num) {
+            
+            for(EVENT_HIST_COLUMNS column : EVENT_HIST_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colPrefWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static EVENT_HIST_COLUMNS fromColNum(int column) {
+            for(EVENT_HIST_COLUMNS c : EVENT_HIST_COLUMNS.values()) {
+                if(c.colNum == column)
+                    return c;
+            }
+            
+            return POSITION_COL;
+        }
+    }  
+    
+    /** 
+     * Container class to hold information displayed in the table.
+     * @author Matthew Cechini
+     */
+    protected class EventHistoryInfo {
+
+        public String source;
+        public Long   secondsOccured;
+        public String details;
+        
+        public EventHistoryInfo(String src, Long seconds, String d) {
+            source         = src;
+            secondsOccured = seconds;
+            details        = d;
+        }
+    }
+    
+
+    /** List of data displayed in the table. */
+    private List<EventHistoryInfo> event_list;
+    
+    /** Constructor. */
+    public IncidentHistoryTableModel() {
+        event_list = new ArrayList<EventHistoryInfo>();
+    }
+
+    public int getRowCount() {
+        if(event_list == null) {
+            return 0;
+        }
+        else
+            return event_list.size();
+    }
+
+    public int getColumnCount() {
+        return EVENT_HIST_COLUMNS.colCount();
+    }
+
+    public String getColumnName(int col) {
+        return EVENT_HIST_COLUMNS.columnName(col);
+    }
+
+    public int getColumnMinWidth(int c){
+        return EVENT_HIST_COLUMNS.columnMinWidth(c);
+    }
+
+    public int getColumnMaxWidth(int c){
+        return EVENT_HIST_COLUMNS.columnMaxWidth(c);
+    }
+
+    public int getColumnPrefWidth(int c){
+        return EVENT_HIST_COLUMNS.columnPrefWidth(c);
+    }
+
+    public boolean isCellEditable(int row, int col) {
+        return false;
+    }   
+    
+    public Object getValueAt(int row, int col) {
+        switch (EVENT_HIST_COLUMNS.fromColNum(col)) {
+            case EVENT_DESC_COL:
+                return event_list.get(row).details;
+            case POSITION_COL:
+                return event_list.get(row).source;
+            case TIME_COL:
+                return event_list.get(row).secondsOccured;
+            default:
+                return "";
+        }        
+    }
+    
+    /**
+     * Method adds a new incident event into the table.
+     * @param logNumber Incident log number corresponding to the parameter event.
+     * @param newEvent Incident event object to add.
+     */    
+    public void addEvent(IncidentEvent newEvent) {
+        
+        for(IncidentInquiryDetails detail : newEvent.eventInfo.getDetails()) {
+            event_list.add(new EventHistoryInfo(
+                    newEvent.eventInfo.getSource(),
+                    newEvent.secondsOccuredInSimulation,
+                    detail.details));       
+        }
+        fireTableChanged(new TableModelEvent(this));
+    }
+    
+    /** 
+     * Remove all events from the table's data.
+     */    
+    public void clearModelData() {
+        event_list.clear();
+        fireTableChanged(new TableModelEvent(this));
+    }
+    
+}
Index: trunk/src/tmcsim/simulationmanager/model/AppliedDiversionTableModel.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/model/AppliedDiversionTableModel.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/model/AppliedDiversionTableModel.java	(revision 2)
@@ -0,0 +1,240 @@
+package tmcsim.simulationmanager.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.event.TableModelEvent;
+import javax.swing.table.DefaultTableModel;
+
+import tmcsim.cadmodels.CMSDiversion;
+import tmcsim.cadmodels.CMSInfo;
+
+/** 
+ * AppliedDiversionTableModel is a DefaultTableModel used to display the 
+ * list of current diversions in the Simulation Manager.  The columns in 
+ * this table show the divesion cms id, old path, new path, diversion pct,
+ * and simulation time it was applied. 
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+@SuppressWarnings("serial")
+public class AppliedDiversionTableModel extends DefaultTableModel implements
+    Comparator<AppliedDiversionTableItem> {
+    
+    /**
+     * Enumeration of columns for this table.
+     * @author Matthew Cechini
+     */     
+    public static enum APPLIED_DIV_COLUMNS {
+        CMS_ID_COL     ("ID", 0, 140, 280, 180),
+        OLD_PATH_COL   ("Old Path", 1, 70, 120, 70),
+        NEW_PATH_COL   ("New Path", 2, 70, 120, 70),
+        PERCENT_COL    ("%", 3, 30, 60, 30),
+        APPLIED_COL    ("Applied", 4, 70, 120, 70);
+        
+        public String colName;
+        public int colNum;
+        public int colMinWidth;
+        public int colMaxWidth;
+        public int colPrefWidth;
+        
+        private APPLIED_DIV_COLUMNS (String name, int num, int min, int max, int pref) {
+            colName      = name;
+            colNum       = num;
+            colMinWidth  = min;
+            colMaxWidth  = max;
+            colPrefWidth = pref;
+        }
+        
+        public static int colCount() {
+            return values().length;
+        }
+        
+        public static String columnName(int num) {
+            
+            for(APPLIED_DIV_COLUMNS column : APPLIED_DIV_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colName;
+            }
+            
+            return "";
+        }
+        
+        public static int columnMinWidth(int num) {
+            
+            for(APPLIED_DIV_COLUMNS column : APPLIED_DIV_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colMinWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static int columnMaxWidth(int num) {
+            
+            for(APPLIED_DIV_COLUMNS column : APPLIED_DIV_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colMaxWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static int columnPrefWidth(int num) {
+            
+            for(APPLIED_DIV_COLUMNS column : APPLIED_DIV_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colPrefWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static APPLIED_DIV_COLUMNS fromColNum(int column) {
+            for(APPLIED_DIV_COLUMNS c : APPLIED_DIV_COLUMNS.values()) {
+                if(c.colNum == column)
+                    return c;
+            }
+            
+            return CMS_ID_COL;
+        }
+    }  
+
+
+    /** List of data displayed in the table. */
+    private List<AppliedDiversionTableItem> diversion_list;
+    
+    /** Constructor. */
+    public AppliedDiversionTableModel() {
+        diversion_list = new ArrayList<AppliedDiversionTableItem>();
+    }
+
+    public String getColumnName(int col) {
+        return APPLIED_DIV_COLUMNS.columnName(col);
+    }
+
+    public int getRowCount() {
+        if(diversion_list == null) {
+            return 0;
+        }
+        else
+            return diversion_list.size();
+    }
+
+    public int getColumnCount() {
+        return APPLIED_DIV_COLUMNS.colCount();
+    }
+
+    public int getColumnMinWidth(int c){
+        return APPLIED_DIV_COLUMNS.columnMinWidth(c);
+    }
+
+    public int getColumnMaxWidth(int c){
+        return APPLIED_DIV_COLUMNS.columnMaxWidth(c);
+    }
+
+    public int getColumnPrefWidth(int c){
+        return APPLIED_DIV_COLUMNS.columnPrefWidth(c);
+    }
+
+    public boolean isCellEditable(int row, int col) {
+        return false;
+    }          
+    
+    public Object getValueAt(int row, int col) {
+        switch (APPLIED_DIV_COLUMNS.fromColNum(col)) {
+            case APPLIED_COL:
+                return diversion_list.get(row).timeApplied;
+            case NEW_PATH_COL:
+                return diversion_list.get(row).newPath;
+            case CMS_ID_COL:
+                return diversion_list.get(row).cmsID;
+            case OLD_PATH_COL:
+                return diversion_list.get(row).originalPath;
+            case PERCENT_COL:
+                return diversion_list.get(row).currentDiv;
+            default:
+                return "";
+        }        
+    }
+    
+    public int compare(AppliedDiversionTableItem item0, AppliedDiversionTableItem item1) {
+        return item0.compareTo(item1);
+    }
+    
+    /**
+     * Find the insertion point for the argument in a sorted list.
+     * 
+     * @param element find this object's insertion point in the sorted list
+     * @return the index of the insertion point
+     */
+    private int findInsertionPoint(AppliedDiversionTableItem element) {
+
+        // Find the new element's insertion point.
+        int insertionPoint = Collections.binarySearch(diversion_list, element, this);
+        if (insertionPoint < 0) {
+            insertionPoint = -(insertionPoint + 1);
+        }
+        return insertionPoint;
+    }
+    
+    /**
+     * Method adds a new diversion into the table.
+     * @param theCMSInfo CMSInfo that the diversion is set for.
+     * @param theDiversion The new diversion data.
+     */        
+    public void addDiversion(CMSInfo theCMSInfo, CMSDiversion theDiversion) {
+        
+        AppliedDiversionTableItem newDiv = new AppliedDiversionTableItem(
+                theCMSInfo.cmsID,
+                theDiversion.originalPath,
+                theDiversion.newPath,
+                theDiversion.getCurrDiv(),
+                theDiversion.timeApplied);
+        
+        diversion_list.add(findInsertionPoint(newDiv), newDiv);
+        
+        fireTableChanged(new TableModelEvent(this));
+            
+    }
+    
+    /**
+     * Method removes a diversion from the table.
+     * @param theCMSInfo CMSInfo that the diversion is set for.
+     * @param theDiversion The new diversion data.
+     */        
+    public void removeDiversion(CMSInfo theCMSInfo, CMSDiversion theDiversion) {
+        
+        //loop through all rows.  Move down a row until the cmsID for the current diversion
+        //is greater ("04 - CMS 4" > "03 - CMS 3") than the current row, or the matching diversion row is found
+        //If the matching row is found, delete the current row for the new info will be added below. 
+        
+        AppliedDiversionTableItem divInfo = null;
+        for(Iterator<AppliedDiversionTableItem> divInfoIter = diversion_list.iterator();
+            divInfoIter.hasNext();) {
+            
+            divInfo = divInfoIter.next();
+            
+            if(divInfo.cmsID.equals(theCMSInfo.cmsID)) {
+                if(divInfo.originalPath.equals(theDiversion.originalPath) &&
+                   divInfo.newPath.equals(theDiversion.newPath)) {
+                    divInfoIter.remove();
+                }
+            }
+        }
+
+        fireTableChanged(new TableModelEvent(this));
+    }
+    
+    /** 
+     * Remove all diversions from the table's data.
+     */    
+    public void clearModelData() {
+        diversion_list.clear();
+        fireTableChanged(new TableModelEvent(this));
+    }
+}
Index: trunk/src/tmcsim/simulationmanager/model/LogEntryCellRenderer.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/model/LogEntryCellRenderer.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/model/LogEntryCellRenderer.java	(revision 2)
@@ -0,0 +1,116 @@
+package tmcsim.simulationmanager.model;
+
+import java.awt.Component;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.swing.JTable;
+import javax.swing.JTextArea;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumn;
+import javax.swing.table.TableColumnModel;
+
+/**
+ * TableCellRender to display a multi-line cell.
+ * 
+ * http://www.roseindia.net/javatutorials/JTable_in_JDK.shtml
+ * @author Dr. Heinz M. Kabutz
+ */
+@SuppressWarnings("serial")
+public class LogEntryCellRenderer extends JTextArea implements
+        TableCellRenderer {
+
+    /** DefaultTableCellRenderer for displaying multi line cells*/
+    private final DefaultTableCellRenderer adaptee;
+
+    /** map from table to map of rows to map of column heights */
+    private final Map<JTable, Map<Integer, Map<Integer, Integer>>> cellSizes;
+
+    public LogEntryCellRenderer() {
+
+        adaptee   = new DefaultTableCellRenderer();
+        cellSizes = new HashMap<JTable, Map<Integer, Map<Integer, Integer>>>();
+        
+        setLineWrap(true);
+        setWrapStyleWord(true);
+    }
+
+    public Component getTableCellRendererComponent(JTable table, Object obj,
+            boolean isSelected, boolean hasFocus, int row, int column) {
+
+        // set the colours, etc. using the standard for that platform
+        adaptee.getTableCellRendererComponent(table, obj, isSelected, hasFocus,
+                row, column);
+        setForeground(adaptee.getForeground());
+        setBackground(adaptee.getBackground());
+        setBorder(adaptee.getBorder());
+        setFont(adaptee.getFont());
+        setText(adaptee.getText());
+
+        // This line was very important to get it working with JDK1.4
+        TableColumnModel columnModel = table.getColumnModel();
+        setSize(columnModel.getColumn(column).getWidth(), 100000);
+        int height_wanted = (int) getPreferredSize().getHeight();
+        addSize(table, row, column, height_wanted);
+        height_wanted = findTotalMaximumRowSize(table, row);
+        if (height_wanted != table.getRowHeight(row)) {
+            table.setRowHeight(row, height_wanted);
+        }
+        
+        return this;
+    }
+
+    private void addSize(JTable table, int row, int column, int height) {
+        Map<Integer, Map<Integer, Integer>> rows = cellSizes.get(table);
+        if (rows == null) {
+            cellSizes.put(table, rows = new HashMap<Integer, Map<Integer, Integer>>());
+        }
+        
+        Map<Integer, Integer> rowheights = rows.get(new Integer(row));
+        if (rowheights == null) {
+            rows.put(new Integer(row), rowheights = new HashMap<Integer, Integer>());
+        }
+        rowheights.put(new Integer(column), new Integer(height));
+    }
+
+    /**
+     * Look through all columns and get the renderer.  If it is
+     * also a TextAreaRenderer, we look at the maximum height in
+     * its hash table for this row.
+     */
+    private int findTotalMaximumRowSize(JTable table, int row) {
+        int maximum_height = 0;
+        Enumeration columns = table.getColumnModel().getColumns();
+        while (columns.hasMoreElements()) {
+            TableColumn tc = (TableColumn) columns.nextElement();
+            TableCellRenderer cellRenderer = tc.getCellRenderer();
+            if (cellRenderer instanceof LogEntryCellRenderer) {
+                LogEntryCellRenderer tar = (LogEntryCellRenderer) cellRenderer;
+                maximum_height = Math.max(maximum_height, tar
+                        .findMaximumRowSize(table, row));
+            }
+        }
+        return maximum_height;
+    }
+
+    private int findMaximumRowSize(JTable table, int row) {
+        Map<Integer, Map<Integer, Integer>> rows = cellSizes.get(table);
+        if (rows == null)
+            return 0;
+        
+        Map<Integer, Integer> rowheights = rows.get(new Integer(row));
+        if (rowheights == null)
+            return 0;
+        int maximum_height = 0;
+        
+        for (Iterator it = rowheights.entrySet().iterator(); it.hasNext();) {
+            Map.Entry entry = (Map.Entry) it.next();
+            int cellHeight = ((Integer) entry.getValue()).intValue();
+            maximum_height = Math.max(maximum_height, cellHeight);
+        }
+        return maximum_height;
+    }
+}
Index: trunk/src/tmcsim/simulationmanager/model/AddIncidentListTableModel.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/model/AddIncidentListTableModel.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/model/AddIncidentListTableModel.java	(revision 2)
@@ -0,0 +1,248 @@
+package tmcsim.simulationmanager.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.TreeMap;
+
+import javax.swing.event.TableModelEvent;
+import javax.swing.table.DefaultTableModel;
+
+import tmcsim.client.cadclientgui.data.Incident;
+
+/** 
+ * AddIncidentListTableModel is a DefaultTableModel used to display the 
+ * list of current incidents that may be added as a part of the 
+ * AddIncidentDialog.  The columns in this table show the incident log number, 
+ * description, length, a boolean checkbox, and scheduled time. 
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+@SuppressWarnings("serial")
+public class AddIncidentListTableModel extends DefaultTableModel {
+
+    /**
+     * Enumeration of columns for this table.
+     * @author Matthew Cechini
+     */ 
+    public static enum ADD_INCIDENT_LIST_COLUMNS {
+        LOG_NUM_COL    ("Log #", 0, 50, 100, 50),
+        EVENT_DESC_COL ("Event Description", 1, 120, 300, 120),
+        EVENT_LEN_COL  ("Event Length", 2, 80, 100, 80),
+        ADD_COL        ("Add?", 3, 60, 80, 60),
+        SCHEDULED_COL  ("Scheduled Time", 4, 80, 120, 80);
+        
+        public String colName;
+        public int colNum;
+        public int colMinWidth;
+        public int colMaxWidth;
+        public int colPrefWidth;
+        
+        private ADD_INCIDENT_LIST_COLUMNS (String name, int num, int min, int max, int pref) {
+            colName      = name;
+            colNum       = num;
+            colMinWidth  = min;
+            colMaxWidth  = max;
+            colPrefWidth = pref;
+        }
+        
+        public static int colCount() {
+            return values().length;
+        }
+        
+        public static String columnName(int num) {
+            
+            for(ADD_INCIDENT_LIST_COLUMNS column : ADD_INCIDENT_LIST_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colName;
+            }
+            
+            return "";
+        }
+        
+        public static int columnMinWidth(int num) {
+            
+            for(ADD_INCIDENT_LIST_COLUMNS column : ADD_INCIDENT_LIST_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colMinWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static int columnMaxWidth(int num) {
+            
+            for(ADD_INCIDENT_LIST_COLUMNS column : ADD_INCIDENT_LIST_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colMaxWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static int columnPrefWidth(int num) {
+            
+            for(ADD_INCIDENT_LIST_COLUMNS column : ADD_INCIDENT_LIST_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colPrefWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static ADD_INCIDENT_LIST_COLUMNS fromColNum(int column) {
+            for(ADD_INCIDENT_LIST_COLUMNS c : ADD_INCIDENT_LIST_COLUMNS.values()) {
+                if(c.colNum == column)
+                    return c;
+            }
+            
+            return LOG_NUM_COL;
+        }
+    }  
+
+    /** 
+     * Container class to hold information displayed in the table.
+     * @author Matthew Cechini
+     */ 
+    protected class AddIncidentEventInfo {
+    
+        public Integer logNumber;
+        public String  description;
+        public Long    length;
+        public Boolean addFlag;
+        public Long    scheduleTime;
+        
+        public AddIncidentEventInfo(Integer log, String desc, Long len, Boolean add, Long time) {
+            logNumber    = log;
+            description  = desc;
+            length       = len;
+            addFlag      = add;
+            scheduleTime = time;
+        }
+    }
+
+    /** List of data displayed in the table. */
+    private List<AddIncidentEventInfo> event_list;
+    
+    /** Constructor. */
+    public AddIncidentListTableModel() {
+        event_list = new ArrayList<AddIncidentEventInfo>();
+    } 
+
+    public String getColumnName(int col) {
+        return ADD_INCIDENT_LIST_COLUMNS.columnName(col);
+    }
+    
+    public Class getColumnClass(int c) {
+        return getValueAt(0, c).getClass();
+    }
+
+    public int getRowCount() {
+        if(event_list == null) {
+            return 0;
+        }
+        else
+            return event_list.size();
+    }
+
+    public int getColumnCount() {
+        return ADD_INCIDENT_LIST_COLUMNS.colCount();
+    }
+
+
+    public int getColumnMinWidth(int c){
+        return ADD_INCIDENT_LIST_COLUMNS.columnMinWidth(c);
+    }
+
+
+    public int getColumnMaxWidth(int c){
+        return ADD_INCIDENT_LIST_COLUMNS.columnMaxWidth(c);
+    }
+
+
+    public int getColumnPrefWidth(int c){
+        return ADD_INCIDENT_LIST_COLUMNS.columnPrefWidth(c);
+    }
+
+    public boolean isCellEditable(int row, int col) {
+        switch (ADD_INCIDENT_LIST_COLUMNS.fromColNum(col)) {
+            case ADD_COL:
+            case SCHEDULED_COL:
+                return true;
+            case LOG_NUM_COL:
+            case EVENT_DESC_COL:
+            case EVENT_LEN_COL:
+            default:
+                return false;
+        }        
+
+    }      
+    
+    public Object getValueAt(int row, int col) {
+        switch (ADD_INCIDENT_LIST_COLUMNS.fromColNum(col)) {
+            case ADD_COL:
+                return event_list.get(row).addFlag;
+            case LOG_NUM_COL:
+                return event_list.get(row).logNumber;
+            case SCHEDULED_COL:
+                return event_list.get(row).scheduleTime;
+            case EVENT_DESC_COL:
+                return event_list.get(row).description;
+            case EVENT_LEN_COL:
+                return event_list.get(row).length;
+            default: 
+                return "";
+        }  
+    }
+       
+    public void setValueAt(Object value, int row, int col) {
+        switch (ADD_INCIDENT_LIST_COLUMNS.fromColNum(col)) {
+            case ADD_COL:
+                event_list.get(row).addFlag = (Boolean)value;
+                break;
+            case SCHEDULED_COL:
+                event_list.get(row).scheduleTime = (Long)value;
+                break;
+        }    
+        fireTableChanged(new TableModelEvent(this));
+    }
+    
+    /**
+     * Method adds a new incident into the table.
+     * @param newIncident Incident object to add.
+     */
+    public void addIncident(Incident newIncident) {
+        event_list.add(new AddIncidentEventInfo(
+                newIncident.getLogNumber(),
+                newIncident.description,
+                newIncident.getIncidentLength(),
+                new Boolean(false), new Long(0)));
+        fireTableChanged(new TableModelEvent(this));
+    }    
+    
+
+    /**
+     * Method gets a map of incidents, and the scheduled start time
+     * for all incidents that have been selected in the table.
+     * 
+     * @return Map of incident log numbers (key) and scheduled start time (value)
+     */
+    public TreeMap<Integer, Long> getSelectedIncidentTimes() {
+        TreeMap<Integer, Long> selectedIncMap = new TreeMap<Integer, Long>();
+        
+        for(AddIncidentEventInfo info : event_list) {
+            if(info.addFlag)
+                selectedIncMap.put(info.logNumber, info.scheduleTime);
+        }   
+        
+        return selectedIncMap;
+    }
+    
+    /** 
+     * Remove all incidents from the table's data.
+     */    
+    public void clearModelData() {
+        event_list.clear();
+        fireTableChanged(new TableModelEvent(this));
+    }
+}
Index: trunk/src/tmcsim/simulationmanager/model/UpperCaseField.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/model/UpperCaseField.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/model/UpperCaseField.java	(revision 2)
@@ -0,0 +1,53 @@
+package tmcsim.simulationmanager.model;
+
+import javax.swing.JTextField;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.text.PlainDocument;
+
+
+/**
+ * UpperCaseField extends from JTextField to provide a text field that only
+ * displays upper case characters.
+ * 
+ * @author Matthew Cechini
+ * @version 
+ */
+@SuppressWarnings("serial")
+public class UpperCaseField extends JTextField {
+
+    /**
+     * Constructor.
+     * @param cols Number of columns for the text field.
+     */ 
+    public UpperCaseField(int cols) {
+        super(cols);
+    }
+
+    protected Document createDefaultModel() {
+          return new UpperCaseDocument();
+    }
+
+    /**
+     * The UpperCaseDocument extends from PlainDocument to overload the
+     * insertString method to ensure that all characters are upper case.
+     * @author Matthew Cechini
+     */
+    class UpperCaseDocument extends PlainDocument {
+        
+        public void insertString(int offs, String str, AttributeSet a) 
+              throws BadLocationException {
+
+              if (str == null) {
+              return;
+              }
+              char[] upper = str.toCharArray();
+              for (int i = 0; i < upper.length; i++) {
+              upper[i] = Character.toUpperCase(upper[i]);
+              }
+              super.insertString(offs, new String(upper), a);
+          }
+    }
+    
+}
Index: trunk/src/tmcsim/simulationmanager/model/IncidentTimeSpinnerModel.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/model/IncidentTimeSpinnerModel.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/model/IncidentTimeSpinnerModel.java	(revision 2)
@@ -0,0 +1,102 @@
+package tmcsim.simulationmanager.model;
+
+import javax.swing.AbstractSpinnerModel;
+
+/**
+ * IncidentTimeSpinnerModel is an AbstractSpinnerModel used in rescheduling 
+ * and adding incidents into the simulation. The spinner shows a simulation time
+ * of format H:MM:SS.  The next and previous values are calculated by adding or 
+ * subtracting 30 seconds from the current value.  
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public class IncidentTimeSpinnerModel extends AbstractSpinnerModel {
+
+    /** Current simulation time value (seconds). */
+    private long currentTime = 0;
+    
+    /**
+     * Constructor.
+     */
+    public IncidentTimeSpinnerModel() { }
+    
+    /**
+     * Method returns the next time value by adding 30 seconds
+     * to the current time value.  The returned value is a string
+     * of format H:MM:SS
+     * 
+     * @return H:MM:SS formatted time
+     */
+    public Object getNextValue() {
+        currentTime += 30 - (currentTime % 30);
+        
+        return longToTime();
+    }   
+
+    /**
+     * Method returns the previous time value by subtracting 30 seconds
+     * to the current time value.  If the current value is less than 0:00:30,
+     * the time is set to 0.  The returned value is a string of format H:MM:SS.
+     * 
+     * @return H:MM:SS formatted time
+     */ 
+    public Object getPreviousValue() {
+        if(currentTime > 30)
+            currentTime -= 30 + (currentTime % 30);
+        else 
+            currentTime = 0;
+        
+        return longToTime();
+    }
+    
+    /**
+     * Method returns the current time value as a string of format H:MM:SS.
+     * 
+     * @return H:MM:SS formatted time
+     */     
+    public Object getValue() {
+        return longToTime();
+    }
+    
+    /**
+     * Sets the current time.  If the parameter is a Long, set
+     * the current time to this value and call this class again
+     * with the String representation to update the spinner.
+     */
+    public void setValue(Object o) {
+        if(o.getClass() == String.class)
+            fireStateChanged();
+        else if (o.getClass() == Long.class) {
+            currentTime = ((Long)o).longValue();
+            setValue(longToTime());
+        }
+    }
+    
+    /** 
+     * Converts the currentTime value into string of format H:MM:SS.
+     * @return H:MM:SS format of the current simulation time.
+     */
+    private String longToTime() {
+        
+        String time = new String();     
+        long tempTime = currentTime;    
+        
+        time += String.valueOf(tempTime / 3600) + ":";      
+        
+        tempTime = tempTime % 3600;
+        
+        if(tempTime / 60 < 10)
+            time += "0";
+        
+        time += String.valueOf(tempTime / 60) + ":";        
+        tempTime = tempTime % 60;   
+        
+        if(tempTime < 10)
+            time += "0";
+        
+        time += String.valueOf(tempTime);
+        return time;        
+    }   
+
+}
Index: trunk/src/tmcsim/simulationmanager/model/IncidentListTableItem.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/model/IncidentListTableItem.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/model/IncidentListTableItem.java	(revision 2)
@@ -0,0 +1,20 @@
+package tmcsim.simulationmanager.model;
+
+public class IncidentListTableItem implements Comparable<IncidentListTableItem> {
+    
+    public Integer logNumber;
+    public Long    scheduleTime;
+    public String  description;
+    
+    public IncidentListTableItem(Integer log, Long time, String desc) {
+        logNumber    = log;
+        scheduleTime = time;
+        description  = desc;
+    }
+    
+    public int compareTo(IncidentListTableItem arg) {
+        return scheduleTime.compareTo(arg.scheduleTime);
+    }
+    
+    
+}
Index: trunk/src/tmcsim/simulationmanager/model/CMSDiversionSliderBox.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/model/CMSDiversionSliderBox.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/model/CMSDiversionSliderBox.java	(revision 2)
@@ -0,0 +1,111 @@
+package tmcsim.simulationmanager.model;
+
+import java.awt.Dimension;
+import java.text.NumberFormat;
+import java.util.Hashtable;
+
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JFormattedTextField;
+import javax.swing.JLabel;
+import javax.swing.JSlider;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.text.NumberFormatter;
+
+import tmcsim.cadmodels.CMSDiversion;
+
+/**
+ * The CMSDiversionSliderBox is a GUI component that is used to create
+ * the diversion slider that allows the user to select a diversion percentage.
+ * This object represents a single possible diversion for a CMS.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+@SuppressWarnings("serial")
+public class CMSDiversionSliderBox extends Box implements ChangeListener {
+
+    /** CMSDiversion object with data for this diversion slider. */
+    private CMSDiversion diversionObject;
+
+    /** Slider to allow user to adjust the diversion percentage. */
+    private JSlider diversionSlider;
+
+    /** Formatted Text Field to display current percentage. */
+    private JFormattedTextField textField;
+
+    /** Maximum allowed diversion percentage. */
+    private int maxDiversion;
+
+    /** Label table for diversion slider. */
+    private Hashtable<Integer, JLabel> diversionLabelTable = null;
+
+    
+    /**
+     * Constructor.  Initialize GUI components.  Create the diversion
+     * slider with a maximum value equal to the maximum diversion
+     * percentage in the parameter CMSDiversion object.
+     * 
+     * @param newDivObj CMS diversion data to be displayed.
+     */
+    public CMSDiversionSliderBox(CMSDiversion newDivObj) {
+        super(BoxLayout.Y_AXIS);
+        setAlignmentX(Box.CENTER_ALIGNMENT);
+
+        diversionObject = newDivObj;
+        maxDiversion    = diversionObject.maxDiversionPercent.intValue();
+
+        diversionLabelTable = new Hashtable<Integer, JLabel>();
+        diversionLabelTable.put(new Integer(0), new JLabel("0%"));
+        diversionLabelTable.put(new Integer(maxDiversion), 
+                new JLabel(String.valueOf(maxDiversion) + "%"));
+
+        NumberFormat numberFormat = NumberFormat.getPercentInstance();
+        NumberFormatter formatter = new NumberFormatter(numberFormat);
+        formatter.setMinimum(new Integer(0));
+        formatter.setMaximum(new Integer(maxDiversion));
+
+        textField = new JFormattedTextField(formatter);
+        textField.setValue(new Integer(0));
+        textField.setColumns(5);
+        textField.setAlignmentX(Box.CENTER_ALIGNMENT);
+        textField.setMaximumSize(new Dimension(50, 25));
+        textField.setMinimumSize(new Dimension(40, 25));
+
+        diversionSlider = new JSlider(JSlider.VERTICAL, 0, maxDiversion, 0);
+        diversionSlider.addChangeListener(this);
+        diversionSlider.setAlignmentX(Box.CENTER_ALIGNMENT);
+        diversionSlider.setPaintTicks(true);
+        diversionSlider.setPaintLabels(true);
+        diversionSlider.setMinorTickSpacing(10);
+        diversionSlider.setLabelTable(diversionLabelTable);
+        diversionSlider.setValue(diversionObject.getCurrDiv());
+
+        add(textField);
+        add(diversionSlider);
+    }
+
+    /**
+     * Set the CMSDiversion object's diversion percentage to the 
+     * new value on the slider.
+     */
+    public void apply() {
+        diversionObject.setCurrDiv(diversionSlider.getValue());
+    }
+
+    /**
+     * ChangeListener method.  When the slider changes, update the
+     * formatted text field with the new percentage.
+     */
+    public void stateChanged(ChangeEvent e) {
+
+        float newDiv = diversionSlider.getValue();
+        
+        if (!diversionSlider.getValueIsAdjusting()) {
+            textField.setValue(new Float(newDiv / 100f));
+        } else {
+            textField.setText(String.valueOf((int) newDiv) + "%");
+        }
+    }
+}
Index: trunk/src/tmcsim/simulationmanager/model/IncidentListTableModel.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/model/IncidentListTableModel.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/model/IncidentListTableModel.java	(revision 2)
@@ -0,0 +1,259 @@
+package tmcsim.simulationmanager.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.event.TableModelEvent;
+import javax.swing.table.DefaultTableModel;
+
+import tmcsim.client.cadclientgui.data.Incident;
+
+/** 
+ * IncidentListTableModel is a DefaultTableModel used to display the 
+ * list of current incidents in the Simulation Manager.  The columns in 
+ * this table show the incident log number, it's schedule time, and the
+ * incident description. The startIncident() method is used to set
+ * an incident in the table to 'started.'  See the method description for
+ * more information.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+@SuppressWarnings("serial")
+public class IncidentListTableModel extends DefaultTableModel implements
+        Comparator<IncidentListTableItem> {
+    
+    /**
+     * Enumeration of columns for this table.
+     * @author Matthew Cechini
+     */
+    public static enum INCIDENT_LIST_COLUMNS {
+        LOG_NUM_COL    ("Log #", 0, 70, 100, 70),
+        SCHEDULED_COL  ("Scheduled", 1, 50, 80, 80),
+        INC_DESC_COL   ("Incident Description", 2, 130, 460, 200);
+        
+        public String colName;
+        public int colNum;
+        public int colMinWidth;
+        public int colMaxWidth;
+        public int colPrefWidth;
+        
+        private INCIDENT_LIST_COLUMNS (String name, int num, int min, int max, int pref) {
+            colName      = name;
+            colNum       = num;
+            colMinWidth  = min;
+            colMaxWidth  = max;
+            colPrefWidth = pref;
+        }
+        
+        public static int colCount() {
+            return values().length;
+        }
+        
+        public static String columnName(int num) {
+            
+            for(INCIDENT_LIST_COLUMNS column : INCIDENT_LIST_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colName;
+            }
+            
+            return "";
+        }
+        
+        public static int columnMinWidth(int num) {
+            
+            for(INCIDENT_LIST_COLUMNS column : INCIDENT_LIST_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colMinWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static int columnMaxWidth(int num) {
+            
+            for(INCIDENT_LIST_COLUMNS column : INCIDENT_LIST_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colMaxWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static int columnPrefWidth(int num) {
+            
+            for(INCIDENT_LIST_COLUMNS column : INCIDENT_LIST_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colPrefWidth;
+            }
+            
+            return 0;
+        }
+        
+        public static INCIDENT_LIST_COLUMNS fromColNum(int column) {
+            for(INCIDENT_LIST_COLUMNS c : INCIDENT_LIST_COLUMNS.values()) {
+                if(c.colNum == column)
+                    return c;
+            }
+            
+            return LOG_NUM_COL;
+        }
+    }  
+
+
+    /** List of data displayed in the table. */
+    private List<IncidentListTableItem> event_list;
+    
+    /** 
+     * Constructor.
+     */
+    public IncidentListTableModel() {
+        event_list = new ArrayList<IncidentListTableItem>();
+    } 
+
+    public String getColumnName(int col) {
+        return INCIDENT_LIST_COLUMNS.columnName(col);
+    }
+
+    public int getRowCount() {
+        if(event_list == null) {
+            return 0;
+        }
+        else
+            return event_list.size();
+    }
+
+    public int getColumnCount() {
+        return INCIDENT_LIST_COLUMNS.colCount();
+    }
+
+
+    public int getColumnMinWidth(int c){
+        return INCIDENT_LIST_COLUMNS.columnMinWidth(c);
+    }
+
+
+    public int getColumnMaxWidth(int c){
+        return INCIDENT_LIST_COLUMNS.columnMaxWidth(c);
+    }
+
+
+    public int getColumnPrefWidth(int c){
+        return INCIDENT_LIST_COLUMNS.columnPrefWidth(c);
+    }
+
+    public boolean isCellEditable(int row, int col) {
+        return false;
+    }        
+    
+    public Object getValueAt(int row, int col) {
+        switch (INCIDENT_LIST_COLUMNS.fromColNum(col)) {
+            case INC_DESC_COL:
+                return event_list.get(row).description;
+            case LOG_NUM_COL:
+                return event_list.get(row).logNumber;
+            case SCHEDULED_COL:
+                return event_list.get(row).scheduleTime;
+            default:
+                return "";
+        }        
+    }
+   
+    
+    public void setValueAt(Object arg, int row, int col) {
+        switch (INCIDENT_LIST_COLUMNS.fromColNum(col)) {
+            case INC_DESC_COL:
+                event_list.get(row).description  = (String)arg;
+                break;
+            case LOG_NUM_COL:
+                event_list.get(row).logNumber    = (Integer)arg;
+                break;
+            case SCHEDULED_COL:
+                event_list.get(row).scheduleTime = (Long)arg;
+                break;
+        }        
+
+        fireTableChanged(new TableModelEvent(this));
+    }
+    
+    public int compare(IncidentListTableItem item0, IncidentListTableItem item1) {
+        return item0.compareTo(item1);
+    }
+    
+    /**
+     * Find the insertion point for the argument in a sorted list.
+     * 
+     * @param element find this object's insertion point in the sorted list
+     * @return the index of the insertion point
+     */
+    private int findInsertionPoint(IncidentListTableItem element) {
+
+        // Find the new element's insertion point.
+        int insertionPoint = Collections.binarySearch(event_list, element, this);
+        if (insertionPoint < 0) {
+            insertionPoint = -(insertionPoint + 1);
+        }
+        return insertionPoint;
+    }
+    
+    /**
+     * Method 'starts' the incident from the table whose log number
+     * matches the parameter value.  When an incident is 'started,' its
+     * scheduled time is set to -1.  This specific value is used by
+     * the CellRenderer to display "Started" in the table.
+     * @param logNumber Unique log number of an incident to 'start.'
+     */
+    public void startIncident(Integer logNumber) {
+        for(IncidentListTableItem eventInfo : event_list) {
+            if(eventInfo.logNumber.equals(logNumber)) {
+                eventInfo.scheduleTime = -1L;
+                fireTableChanged(new TableModelEvent(this));
+            }
+        }
+    }
+
+    /**
+     * Method adds a new incident into the table.
+     * @param newIncident Incident object to add.
+     */
+    public void addIncident(Incident newIncident) {
+        
+        IncidentListTableItem newItem = new IncidentListTableItem(
+                newIncident.getLogNumber(),
+                newIncident.getSecondsToStart(),
+                newIncident.description);
+        
+        event_list.add(findInsertionPoint(newItem), newItem);
+        fireTableChanged(new TableModelEvent(this));
+    }
+    
+    /**
+     * Method removes the incident from the table whose log number
+     * matches the parameter value.
+     * @param logNumber Unique log number of incident to remove.
+     */
+    public void removeIncident(Integer logNumber) {
+        for(Iterator<IncidentListTableItem> eventInfoIter = event_list.iterator();
+            eventInfoIter.hasNext();) {
+            
+            if(eventInfoIter.next().logNumber.equals(logNumber)) {
+                eventInfoIter.remove(); 
+                fireTableChanged(new TableModelEvent(this));
+            }
+        }       
+    }
+   
+    /** 
+     * Remove all incidents from the table's data.
+     */
+    public void clearModelData() {
+        event_list.clear();
+        fireTableChanged(new TableModelEvent(this));
+    }
+
+
+}
Index: trunk/src/tmcsim/simulationmanager/model/IncidentTimeCellEditor.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/model/IncidentTimeCellEditor.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/model/IncidentTimeCellEditor.java	(revision 2)
@@ -0,0 +1,56 @@
+package tmcsim.simulationmanager.model;
+
+
+import java.awt.Component;
+import java.util.StringTokenizer;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultCellEditor;
+import javax.swing.JCheckBox;
+import javax.swing.JSpinner;
+import javax.swing.JTable;
+
+/**
+ * A DefaultCellEditor overriding the necessary base methods to 
+ * provide editor capability for changing the incident time to occur.
+ * This editor uses a JSpinner as its editor component.
+ * 
+ * @author Matthew
+ * @version
+ */
+@SuppressWarnings("serial")
+public class IncidentTimeCellEditor extends DefaultCellEditor {
+
+    public IncidentTimeCellEditor(JSpinner spinner) {
+          super(new JCheckBox());
+
+        editorComponent = spinner;
+        editorComponent.setOpaque(true);
+        editorComponent.setBorder(BorderFactory.createEmptyBorder());
+        setClickCountToStart(2);
+    }
+
+    public Object getCellEditorValue() {
+        
+        StringTokenizer strTok = new StringTokenizer(
+                (String)((JSpinner)editorComponent).getModel().getValue(), ":");
+        
+        
+        return Long.parseLong(strTok.nextToken()) * 3600  +
+                    Long.parseLong(strTok.nextToken()) * 60  + 
+                    Long.parseLong(strTok.nextToken());
+
+    }
+
+        
+    public Component getTableCellEditorComponent(JTable table,
+                                                 Object value,
+                                                 boolean isSelected,
+                                                 int row,
+                                                 int column) {
+      
+        ((JSpinner)editorComponent).getModel().setValue(value);
+        
+        return editorComponent;
+    }
+}
Index: trunk/src/tmcsim/simulationmanager/model/IncidentTimeCellRenderer.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/model/IncidentTimeCellRenderer.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/model/IncidentTimeCellRenderer.java	(revision 2)
@@ -0,0 +1,48 @@
+package tmcsim.simulationmanager.model;
+
+import javax.swing.table.DefaultTableCellRenderer;
+
+/**
+ * IncidentTimeCellRenderer is a DefaultCellEditor overriding the necessary 
+ * base methods to render the Long incident time value as a string of format
+ * H:MM:SS.  If the incident time value is -1, this means the incident has 
+ * started, and the renderer returns "Started" as the display value.
+ * 
+ * @author Matthew
+ * @version
+ */
+@SuppressWarnings("serial")
+public class IncidentTimeCellRenderer extends DefaultTableCellRenderer {
+
+    public IncidentTimeCellRenderer() { }
+    
+    protected void setValue(Object value) {
+
+        if(value != null && value instanceof Number) {
+            String time_str = new String();
+            Long   time_val = (Long)value;
+                        
+            if(time_val == -1) {
+                super.setValue("Started");
+                return;
+            }
+                        
+            time_str += String.valueOf(time_val / 3600) + ":";      
+            
+            time_val = time_val % 3600;
+            
+            if(time_val / 60 < 10)
+                time_str += "0";
+            
+            time_str += String.valueOf(time_val / 60) + ":";        
+            time_val = time_val % 60;   
+            
+            if(time_val < 10)
+                time_str += "0";
+            
+            time_str += String.valueOf(time_val);
+
+            super.setValue(time_str);
+        }
+    }
+}
Index: trunk/src/tmcsim/simulationmanager/model/XmlFilter.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/model/XmlFilter.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/model/XmlFilter.java	(revision 2)
@@ -0,0 +1,42 @@
+
+
+package tmcsim.simulationmanager.model;
+
+import java.io.File;
+
+import javax.swing.filechooser.FileFilter;
+
+/**
+ * FileFilter used to select only .xml files.
+ * 
+ * @author Matthew
+ * @version
+ */
+public class XmlFilter extends FileFilter{
+    
+    
+    public boolean accept(File f) {
+        if (f.isDirectory()) {
+            return true;
+        }
+
+        String s = f.getName();
+        int i = s.lastIndexOf('.');
+
+        if (i > 0 &&  i < s.length() - 1) {
+            String extension = s.substring(i+1).toLowerCase();
+            if (extension.equals("xml")) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /** 
+     * Get description for display in file chooser. 
+     * @return "XML Files (.xml)"
+     */
+    public String getDescription() {
+        return "XML Files (.xml)";
+    }
+}
Index: trunk/src/tmcsim/simulationmanager/dialogs/GotoTimeIndexDialog.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/dialogs/GotoTimeIndexDialog.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/dialogs/GotoTimeIndexDialog.java	(revision 2)
@@ -0,0 +1,150 @@
+package tmcsim.simulationmanager.dialogs;
+
+import java.awt.Dimension;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JSpinner;
+
+import tmcsim.simulationmanager.SimulationManagerView;
+import tmcsim.simulationmanager.model.IncidentTimeSpinnerModel;
+
+
+/**
+ * GotoTimeIndexDialog is a dialog used to prompt the user for the
+ * simulation time that the simulation will be reset to.  
+ * When the dialog is closed, the gotoApplied flag is set to true 
+ * if the user has chosen a time to seek to.  Otherwise, the flag is false.
+ *
+ * @author Matthew Cechini
+ * @version
+ */
+@SuppressWarnings("serial")
+public class GotoTimeIndexDialog extends JDialog {
+    
+    /** 
+     *  Boolean flag to designate whether the user has chosen to goto
+     *  a new position in the simulation.
+     */
+    public boolean gotoApplied = false;
+
+    /**
+     * Constructor.
+     *
+     * @param simulationManagerView View object to attach this dialog to.
+     * @param initialValue Long value (in seconds) of time to initialize spinner with. 
+     */
+    public GotoTimeIndexDialog(SimulationManagerView simulationManagerView, long initialValue) {
+        super(simulationManagerView, "Goto CAD Time Index", true);
+        
+        initComponents();   
+        
+        timeSpinner.setValue(initialValue);     
+
+        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+        setLocation(screenSize.width/2 - getWidth()/2, screenSize.height/2 - getHeight()/2);
+        
+        setSize(new Dimension(250, 150));
+        setResizable(false);
+        setModal(true);
+        setVisible(true);
+            
+    }   
+    
+    /**
+     * Initialize GUI Swing elements and listeners.
+     */
+    private void initComponents() {
+        
+        addWindowListener(new WindowListener() {
+            public void windowClosed(WindowEvent e)  {}
+            public void windowOpened(WindowEvent e)  {}            
+            public void windowIconified(WindowEvent e)  {}         
+            public void windowDeiconified(WindowEvent e)  {}    
+            public void windowActivated(WindowEvent e)  {}                             
+            public void windowDeactivated(WindowEvent e)  {}         
+            public void windowClosing(WindowEvent e)  {
+                gotoApplied = false;                
+            }    
+        });     
+        
+        gotoLabel = new JLabel("Choose the new simulation time:");
+        gotoLabel.setAlignmentX(Box.CENTER_ALIGNMENT);  
+
+        okButton = new JButton("OK");
+        okButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                gotoApplied = true;
+                setVisible(false);  
+            }
+            
+        });
+        
+        cancelButton = new JButton("Cancel");        
+        cancelButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                gotoApplied = false;
+                setVisible(false);  
+            }           
+        });
+        
+        incidentTimeModel = new IncidentTimeSpinnerModel();
+        timeSpinner = new JSpinner(incidentTimeModel);
+        timeSpinner.setMaximumSize(new Dimension(70,20));
+        timeSpinner.setAlignmentX(Box.CENTER_ALIGNMENT);
+        
+        buttonBox = new Box(BoxLayout.X_AXIS);
+        buttonBox.add(Box.createHorizontalStrut(20));
+        buttonBox.add(Box.createHorizontalGlue());
+        buttonBox.add(okButton);
+        buttonBox.add(Box.createHorizontalStrut(20));
+        buttonBox.add(cancelButton);
+        buttonBox.add(Box.createHorizontalGlue());
+        buttonBox.add(Box.createHorizontalStrut(20));   
+        buttonBox.setAlignmentX(Box.CENTER_ALIGNMENT);  
+              
+        gotoIndexBox = new Box(BoxLayout.Y_AXIS);
+        gotoIndexBox.add(Box.createVerticalStrut(10));
+        gotoIndexBox.add(Box.createVerticalGlue());
+        gotoIndexBox.add(gotoLabel);
+        gotoIndexBox.add(Box.createVerticalStrut(10));
+        gotoIndexBox.add(timeSpinner);
+        gotoIndexBox.add(Box.createVerticalStrut(10));
+        gotoIndexBox.add(buttonBox);    
+        gotoIndexBox.add(Box.createVerticalGlue());   
+        gotoIndexBox.add(Box.createVerticalStrut(10)); 
+        
+        getContentPane().add(gotoIndexBox);
+        pack();     
+    }       
+    
+    /**
+     * Gets a string representation of the time set by the time
+     * spinner in the dialog.  Format:  H:MM:SS
+     * @return String representation of spinner time.
+     */
+    public String getGotoTime() {
+        return (String)timeSpinner.getValue();
+    }   
+    
+    
+    private JLabel gotoLabel;
+    private JSpinner timeSpinner;
+    
+    private IncidentTimeSpinnerModel incidentTimeModel;
+    
+    private JButton cancelButton;;
+    private JButton okButton;
+
+    private Box gotoIndexBox;   
+    private Box buttonBox;  
+    
+}
Index: trunk/src/tmcsim/simulationmanager/dialogs/CMSDiversionDialog.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/dialogs/CMSDiversionDialog.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/dialogs/CMSDiversionDialog.java	(revision 2)
@@ -0,0 +1,234 @@
+package tmcsim.simulationmanager.dialogs;
+
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Vector;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JSeparator;
+import javax.swing.JTextField;
+import javax.swing.border.CompoundBorder;
+
+import tmcsim.cadmodels.CMSDiversion;
+import tmcsim.cadmodels.CMSInfo;
+import tmcsim.simulationmanager.model.CMSDiversionSliderBox;
+
+
+/**
+ * The CMSDiversionDialog is used to allow the user to select diversion percentages
+ * for a specific changeable message sign.  This dialog is initialized with a CMSInfo
+ * object, which contains the unique identifying information and diversions for a CMS.
+ * A slider for each possible diversion is created and represented on the dialog.  
+ * The user may modify diversion percentages and then choose to apply them, or cancel 
+ * and close the dialog.  Diversion percentages are updated in the RouteSliderBox,
+ * which points to the local CMSInfo object.
+ * 
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/06 20:46:41 $ $Revision: 1.7 
+ */
+@SuppressWarnings("serial")
+public class CMSDiversionDialog extends JDialog {
+    
+    /** CMSInfo object associated with this dialog. */
+    public CMSInfo theCMSInfo = null;
+    
+    /** Vector of RouteSliderBox objects, each representing a possible diversion. */
+    private Vector<CMSDiversionSliderBox> diversionSliders;
+
+    /**
+     * Constructor.  Initialize GUI components.
+     * 
+     * @param parent View object to attach.
+     * @param newCMSInfo CMSInfo object containing diversion info.
+     */ 
+    public CMSDiversionDialog(Frame parent) {
+        super(parent, "Add New Diversion", true);
+        
+        diversionSliders = new Vector<CMSDiversionSliderBox>();
+        
+    }
+    
+    public void showDialog(CMSInfo newCMSInfo) {
+        theCMSInfo = newCMSInfo;
+        
+        diversionSliders.clear();
+        getContentPane().removeAll();
+        
+        initComponents(theCMSInfo);     
+
+        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+        setLocation(screenSize.width/2 - getWidth()/2, screenSize.height/2 - getHeight()/2);
+        
+        setVisible(true);
+    }
+    
+    /**
+     * Initialize GUI Swing elements and listeners.  Create RouteSliderBox 
+     * objects for each possible diversion in the CMSInfo object.
+     * 
+     * @param theDiversion
+     */
+    private void initComponents(CMSInfo theCMS) {
+
+        Box cmsSignInfoBox = new Box(BoxLayout.X_AXIS);
+        cmsSignInfoBox.setAlignmentX(Box.CENTER_ALIGNMENT);
+        
+        JLabel cmsIDLabel        = new JLabel("CMS ID:  ");
+        JLabel cmsPostmileLabel  = new JLabel("Postmile:  ");
+        JLabel cmsMainLineLabel  = new JLabel("Main Line:  ");      
+        
+        JTextField cmsIDTextField        = new JTextField(String.valueOf(theCMS.cmsID), 4);
+        JTextField cmsPostmileTextField  = new JTextField(String.valueOf(theCMS.postmile), 10);
+        JTextField cmsMainLineTextField  = new JTextField(theCMS.initialRoute, 10);     
+        
+        cmsIDTextField.setEditable(false);
+        cmsIDTextField.setMaximumSize(new Dimension(190, 25));
+        cmsIDTextField.setMinimumSize(new Dimension(120, 25));
+        cmsPostmileTextField.setEditable(false);
+        cmsPostmileTextField.setMaximumSize(new Dimension(60, 25));
+        cmsPostmileTextField.setMinimumSize(new Dimension(40, 25));;
+        cmsMainLineTextField.setEditable(false);                
+        cmsMainLineTextField.setMaximumSize(new Dimension(60, 25));
+        cmsMainLineTextField.setMinimumSize(new Dimension(40, 25));
+
+        cmsSignInfoBox.add(cmsIDLabel);
+        cmsSignInfoBox.add(cmsIDTextField);     
+        cmsSignInfoBox.add(Box.createHorizontalStrut(10));
+        cmsSignInfoBox.add(cmsPostmileLabel);
+        cmsSignInfoBox.add(cmsPostmileTextField);       
+        cmsSignInfoBox.add(Box.createHorizontalStrut(10));
+        cmsSignInfoBox.add(cmsMainLineLabel);
+        cmsSignInfoBox.add(cmsMainLineTextField);       
+        
+        Box diversionSlidersBox = new Box(BoxLayout.X_AXIS);
+        diversionSlidersBox.setAlignmentX(Box.CENTER_ALIGNMENT);
+        
+        Box labelBox = new Box(BoxLayout.Y_AXIS);
+        JLabel oldPathLabel = new JLabel("Old Path:");
+        oldPathLabel.setAlignmentX(Box.CENTER_ALIGNMENT);
+        JLabel spaceLabel = new JLabel(" ");
+        oldPathLabel.setAlignmentX(Box.CENTER_ALIGNMENT);
+        JLabel newPathLabel = new JLabel("New Path:");
+        newPathLabel.setAlignmentX(Box.CENTER_ALIGNMENT);
+        
+        labelBox.add(oldPathLabel);
+        labelBox.add(spaceLabel);
+        labelBox.add(newPathLabel);
+        labelBox.add(Box.createVerticalGlue());
+
+        diversionSlidersBox.add(labelBox);
+        
+        CMSDiversionSliderBox slider;
+        // For each diversion, create a new RouteSliderBox and
+        // needed labels and GUI elements.
+        for(CMSDiversion cmsd : theCMS.possibleDiversions) {
+            
+            Box singleDiversionBox = new Box(BoxLayout.Y_AXIS);
+            JLabel originalLabel = new JLabel(cmsd.originalPath);
+            JLabel toLabel       = new JLabel("To");
+            JLabel newLabel      = new JLabel(cmsd.newPath);
+            
+            originalLabel.setAlignmentX(Box.CENTER_ALIGNMENT);
+            toLabel.setAlignmentX(Box.CENTER_ALIGNMENT);
+            newLabel.setAlignmentX(Box.CENTER_ALIGNMENT);
+            
+            singleDiversionBox.add(originalLabel);
+            singleDiversionBox.add(toLabel);
+            singleDiversionBox.add(newLabel);
+    
+            slider = new CMSDiversionSliderBox(cmsd);
+            diversionSliders.add(slider);
+            singleDiversionBox.add(slider);
+            singleDiversionBox.add(Box.createHorizontalStrut(85));
+            
+            diversionSlidersBox.add(singleDiversionBox);
+            
+        }
+        
+        JLabel instructionsLabel = new JLabel("Choose the percentage of traffic " + 
+                                              "traveling on the main line that will be diverted.");
+        instructionsLabel.setAlignmentX(Box.CENTER_ALIGNMENT);
+        
+        Box diversionInteractionBox = new Box(BoxLayout.Y_AXIS);
+        diversionInteractionBox.setAlignmentX(Box.CENTER_ALIGNMENT);
+        diversionInteractionBox.add(cmsSignInfoBox);
+        diversionInteractionBox.add(Box.createVerticalStrut(5));
+        diversionInteractionBox.add(new JSeparator());
+        diversionInteractionBox.add(instructionsLabel);
+        diversionInteractionBox.add(Box.createVerticalStrut(10));
+        diversionInteractionBox.add(diversionSlidersBox);       
+
+        CompoundBorder cBorder = BorderFactory.createCompoundBorder(
+                BorderFactory.createTitledBorder(BorderFactory.createRaisedBevelBorder(), 
+                                                 "Diversion Information"),
+                BorderFactory.createEmptyBorder(5,5,5,5));
+        diversionInteractionBox.setBorder(cBorder);         
+        
+        
+        JButton applyButton = new JButton("Apply");
+        applyButton.addActionListener(new ActionListener() {
+            /* 
+             * Set this dialog's visibility to false, and call the apply() 
+             * method in all route slider boxes to set the new diversion 
+             * percentages into the CMSDiversion objects.  
+             */
+            public void actionPerformed(ActionEvent evt) {
+                for(CMSDiversionSliderBox rs : diversionSliders)
+                    rs.apply();
+                
+                setVisible(false);              
+            }
+        });  
+        
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new ActionListener() {
+            /* 
+             * Set this dialog's visibility to false, and call the reset() 
+             * method in all route slider boxes to reset them to the 
+             * original diversion percentage.
+             */         
+            public void actionPerformed(ActionEvent evt) {
+                theCMSInfo.reset();
+
+                setVisible(false);
+            }
+        });  
+        
+        Box diversionButtonBox = new Box(BoxLayout.X_AXIS);
+        diversionButtonBox.setAlignmentX(Box.CENTER_ALIGNMENT);     
+        
+        diversionButtonBox.add(Box.createHorizontalGlue());
+        diversionButtonBox.add(applyButton);
+        diversionButtonBox.add(Box.createHorizontalStrut(20));
+        diversionButtonBox.add(cancelButton);
+        diversionButtonBox.add(Box.createHorizontalStrut(15));      
+        
+                    
+        Box diversionDialogBox = new Box(BoxLayout.Y_AXIS);
+        diversionDialogBox.add(Box.createVerticalStrut(10));        
+        diversionDialogBox.add(diversionInteractionBox);
+        diversionDialogBox.add(diversionButtonBox);
+    
+        getContentPane().add(diversionDialogBox);
+        pack();
+        
+        int width = 550 > diversionSliders.size()*100 ? 550 : diversionSliders.size()*100;
+        setSize(new Dimension(width, 500));
+        setResizable(false);        
+        
+    }   
+    
+}
+
+
+
+
+
Index: trunk/src/tmcsim/simulationmanager/dialogs/AddIncidentDialog.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/dialogs/AddIncidentDialog.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/dialogs/AddIncidentDialog.java	(revision 2)
@@ -0,0 +1,215 @@
+package tmcsim.simulationmanager.dialogs;
+
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.TreeMap;
+import java.util.Vector;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JScrollPane;
+import javax.swing.JSpinner;
+import javax.swing.JTable;
+import javax.swing.border.EtchedBorder;
+import javax.swing.border.TitledBorder;
+
+import tmcsim.client.cadclientgui.data.Incident;
+import tmcsim.simulationmanager.model.AddIncidentListTableModel;
+import tmcsim.simulationmanager.model.IncidentTimeCellEditor;
+import tmcsim.simulationmanager.model.IncidentTimeCellRenderer;
+import tmcsim.simulationmanager.model.IncidentTimeSpinnerModel;
+import tmcsim.simulationmanager.model.AddIncidentListTableModel.ADD_INCIDENT_LIST_COLUMNS;
+
+
+/**
+ * This dialog is used when the user chooses to add a new incident into the 
+ * simulation.  To show the dialog, mthe showDialog() method is called with
+ * the Incidents to display in the dialog.  These incidents are displayed to 
+ * the user, who may then select which incidents to add to the simulation, 
+ * and assign a time that each incident will occur.  
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2006/06/14 00:12:38 $ $Revision: 1.7 
+ */
+@SuppressWarnings("serial")
+public class AddIncidentDialog extends JDialog implements ActionListener {
+    
+    /**
+     * Constructor.  Initialize lists and GUI elements.
+     */ 
+    public AddIncidentDialog(Frame parent) {
+        super(parent);
+
+        setTitle("Add New Incidents");
+        setModal(true);
+        
+        setSize(new Dimension(600, 350));
+        setResizable(false);
+    
+        initComponents();   
+    }
+    
+    /**
+     * Populate the Incident Table with the parameter data.
+     *
+     * @param incidentList Vector of Incidents that have been read in from a
+     * selected file.
+     */
+    public void setModelData(Vector<Incident> incidentList) {
+        incidentListTableModel.clearModelData();
+        
+        for(Incident inc : incidentList) {
+            incidentListTableModel.addIncident(inc);
+        }
+
+    }
+    
+    /**
+     * Reposition the dialog to the center of the screen at set visible.
+     */
+    public void showDialog() {
+        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+        setLocation(screenSize.width/2 - getWidth()/2, screenSize.height/2 - getHeight()/2);
+        
+        setVisible(true);
+    }
+    
+    /**
+     * Method gets a map of incidents, and the scheduled start time
+     * for all incidents that have been selected in the table.
+     * 
+     * @return Map of incident log numbers (key) and scheduled start time (value)
+     */
+    public TreeMap<Integer, Long> getSelectedIncidentTimes() {
+        return incidentListTableModel.getSelectedIncidentTimes();
+    }
+    
+    public void actionPerformed(ActionEvent evt) {
+    
+        if(evt.getSource().equals(okButton)) {
+            incidentListTable.getColumnModel().getColumn(
+                    ADD_INCIDENT_LIST_COLUMNS.SCHEDULED_COL.colNum)
+                    .getCellEditor().stopCellEditing(); 
+            
+            setVisible(false);
+        }
+        else if(evt.getSource().equals(cancelButton)) {             
+            incidentListTable.getColumnModel().getColumn(
+                    ADD_INCIDENT_LIST_COLUMNS.SCHEDULED_COL.colNum)
+                    .getCellEditor().cancelCellEditing();
+            
+            incidentListTableModel.clearModelData();
+
+            setVisible(false);
+        }
+            
+    }
+    
+    /**
+     * Initialize GUI Swing elements and listeners.
+     */
+    private void initComponents() {
+
+        initIncidentTable();
+        initButtons();
+              
+        addIncidentBox = new Box(BoxLayout.Y_AXIS);
+        addIncidentBox.add(Box.createVerticalStrut(10));
+        addIncidentBox.add(incidentListPane);  
+        addIncidentBox.add(Box.createVerticalStrut(5));        
+        addIncidentBox.add(buttonBox);        
+        addIncidentBox.add(Box.createVerticalStrut(10));
+        
+        getContentPane().add(addIncidentBox);
+        pack();
+        
+    }   
+    
+    /**
+     * Initialize Incident Table Swing elements
+     */
+    private void initIncidentTable() {
+        
+        incidentTimeModel = new IncidentTimeSpinnerModel();
+        incidentSpinner   = new JSpinner(incidentTimeModel);
+        
+        incidentListTableModel = new AddIncidentListTableModel();        
+        incidentListTable = new JTable(incidentListTableModel);
+        incidentListTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
+        incidentListTable.setDragEnabled(false);      
+                
+        for(int c = 0; c < incidentListTable.getColumnCount(); c++) {
+            incidentListTable.getColumnModel().getColumn(c).setMinWidth(
+                    incidentListTableModel.getColumnMinWidth(c));
+            incidentListTable.getColumnModel().getColumn(c).setMaxWidth(
+                    incidentListTableModel.getColumnMaxWidth(c));
+            incidentListTable.getColumnModel().getColumn(c).setPreferredWidth(
+                    incidentListTableModel.getColumnPrefWidth(c));
+            incidentListTable.getColumnModel().getColumn(c).setResizable(true);
+            
+            if(c == ADD_INCIDENT_LIST_COLUMNS.EVENT_LEN_COL.colNum) {
+                incidentListTable.getColumnModel().getColumn(c).setCellRenderer(
+                        new IncidentTimeCellRenderer());                
+            }
+            else if(c == ADD_INCIDENT_LIST_COLUMNS.SCHEDULED_COL.colNum) {
+                incidentListTable.getColumnModel().getColumn(c).setCellRenderer(
+                        new IncidentTimeCellRenderer());
+                incidentListTable.getColumnModel().getColumn(c).setCellEditor(
+                        new IncidentTimeCellEditor(incidentSpinner));
+            }               
+        }
+        
+                
+        incidentListPane  = new JScrollPane();      
+        incidentListPane.setMaximumSize(new Dimension(650, 400));       
+        incidentListPane.setMinimumSize(new Dimension(525, 200));   
+        incidentListPane.setPreferredSize(new Dimension(525, 200));
+        incidentListPane.setViewportView(incidentListTable);
+        incidentListPane.setAlignmentX(Box.CENTER_ALIGNMENT);       
+
+        TitledBorder title = BorderFactory.createTitledBorder(
+                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), 
+                "Possible Incidents");
+        title.setTitleJustification(TitledBorder.LEFT);
+        incidentListPane.setBorder(title);                
+        
+    }
+    
+    /**
+     * Intialize Ok and Cancel button Swing elements and listeners.
+     */
+    private void initButtons() {
+        
+        okButton = new JButton("OK");
+        okButton.addActionListener(this);
+        
+        cancelButton = new JButton("Cancel");        
+        cancelButton.addActionListener(this);
+        
+        buttonBox = new Box(BoxLayout.X_AXIS);
+        buttonBox.add(okButton);
+        buttonBox.add(Box.createHorizontalStrut(50));
+        buttonBox.add(cancelButton);
+        buttonBox.setAlignmentX(Box.CENTER_ALIGNMENT);      
+    }   
+
+
+    private JTable incidentListTable;
+    private AddIncidentListTableModel incidentListTableModel;
+    private JScrollPane incidentListPane;
+    private JSpinner incidentSpinner;
+    private IncidentTimeSpinnerModel incidentTimeModel; 
+    
+    private JButton cancelButton;;
+    private JButton okButton;
+    
+    private Box addIncidentBox;
+    private Box buttonBox;  
+}
Index: trunk/src/tmcsim/simulationmanager/SimulationManagerView.java
===================================================================
--- trunk/src/tmcsim/simulationmanager/SimulationManagerView.java	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/SimulationManagerView.java	(revision 2)
@@ -0,0 +1,1272 @@
+ package tmcsim.simulationmanager;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.util.TreeMap;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSpinner;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.SpinnerNumberModel;
+import javax.swing.border.CompoundBorder;
+import javax.swing.border.EtchedBorder;
+import javax.swing.border.TitledBorder;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+
+import tmcsim.cadmodels.CMSDiversion;
+import tmcsim.cadmodels.CMSInfo;
+import tmcsim.client.cadclientgui.data.Incident;
+import tmcsim.client.cadclientgui.data.IncidentEvent;
+import tmcsim.common.ScriptException;
+import tmcsim.common.SimulationException;
+import tmcsim.common.CADEnums.PARAMICS_STATUS;
+import tmcsim.common.CADEnums.SCRIPT_STATUS;
+import tmcsim.simulationmanager.actions.AddIncidentAction;
+import tmcsim.simulationmanager.actions.ApplyDiversionAction;
+import tmcsim.simulationmanager.actions.ConnectToParamicsAction;
+import tmcsim.simulationmanager.actions.DeleteIncidentAction;
+import tmcsim.simulationmanager.actions.ExitAction;
+import tmcsim.simulationmanager.actions.GotoTimeIndexAction;
+import tmcsim.simulationmanager.actions.LoadParamicsNetworkAction;
+import tmcsim.simulationmanager.actions.LoadScriptAction;
+import tmcsim.simulationmanager.actions.PauseSimulationAction;
+import tmcsim.simulationmanager.actions.RescheduleIncidentAction;
+import tmcsim.simulationmanager.actions.ResetSimulationAction;
+import tmcsim.simulationmanager.actions.StartSimulationAction;
+import tmcsim.simulationmanager.actions.TriggerIncidentAction;
+import tmcsim.simulationmanager.model.AppliedDiversionTableModel;
+import tmcsim.simulationmanager.model.IncidentListTableModel;
+import tmcsim.simulationmanager.model.IncidentTimeCellRenderer;
+import tmcsim.simulationmanager.model.IncidentTimeSpinnerModel;
+import tmcsim.simulationmanager.model.AppliedDiversionTableModel.APPLIED_DIV_COLUMNS;
+import tmcsim.simulationmanager.model.IncidentListTableModel.INCIDENT_LIST_COLUMNS;
+
+/**
+ * This class is the view component to the SimlationManager.  User 
+ * interaction with the SimulationManager is handled in this object.  
+ * The data contained within the SimlationManagerModel class is 
+ * displayed in the JTables contained in this class.  The view class 
+ * does not validate the user input.  Exception handling
+ * takes care of error in the user input.
+ *
+ * @author Matthew Cechini 
+ * @version $Revision: 1.6 $ $Date: 2006/06/06 22:52:56 $
+ */
+@SuppressWarnings("serial")
+public class SimulationManagerView extends JFrame { 
+
+    /** Default Paramics network ID */
+    private static int DEFAULT_NETWORK_ID = 1;
+
+    /** Maximum Paramics network ID (100) */
+    private static int MAX_NETWORK_ID    = 100;
+
+    /** Default directory for script loading. */
+    public static String SCRIPT_DIR      = ".";
+
+    /** Reference to the simulation manager model. */
+    private SimulationManagerModel theSimManagerModel;
+        
+    /** The Table Model for the incident list table. */
+    private IncidentListTableModel incidentListTableModel;
+    
+    /** The Table Model for the applied diversions table. */    
+    private AppliedDiversionTableModel appliedDiversionTableModel;
+    
+    /**
+     * A map of DefaultTableModel objects associated with each incident
+     * in the simulation.  Key values are the log numberes of incidents.  
+     */
+    //private TreeMap<Integer, IncidentHistoryTableModel> incidentTableMap = null;
+    private TreeMap<Integer, IncidentHistoryPanel> incidentTableMap = null;
+    
+    /** The current simulation time. */
+    private long currentSimulationTime = 0;
+    
+    /**
+     * Flag to designate whether the simulation has started. Initialized to false.
+     * Becomes true when the user presses the start button.  Becomes false again
+     * when the simulation is "reset" or another script is loaded.
+     */
+    private boolean simulationStarted = false;
+    
+    /** 
+     * Flag to designate whether a connection has been made to the remote 
+     * Paramics Communicator.
+     */
+    private boolean connectedToParamics = false;
+    
+    
+    /**
+     * Constructor. This class sets the local reference to the simulation manager
+     * model to the parameter object.  It then initializes all of the swing
+     * components that are used in this user interface.
+     *
+     * @param newModel The reference to the SimulationManagerModel object
+     */
+    public SimulationManagerView(SimulationManagerModel newModel) {
+        super("Simulation Manager");
+        
+        theSimManagerModel   = newModel;    
+        
+        incidentTableMap = new TreeMap<Integer, IncidentHistoryPanel>();
+        
+        initComponents();
+
+    }
+ 
+    /**
+     * Method gets the model object for the SimulationManagerView class.
+     * @return SimulationManagerModel object.
+     */
+    public SimulationManagerModel getModel() {
+        return theSimManagerModel;
+    }
+    
+    /**
+     * Method returns the boolean value designating whether a current
+     * connection has been made to the Paramics Communicator.
+     * 
+     * @return True if connected, false if not.
+     */
+    public Boolean isConnectedToParamics() {
+        return connectedToParamics;
+    }
+    
+    /**
+     * Method returns the boolean value designating whether the 
+     * simulation has started or not.
+     * 
+     * @return True if started, false if not.
+     */
+    public Boolean isSimulationStarted() {
+        return simulationStarted;
+    }
+    
+    /**
+     * Method returns the value of the current simulation time.
+     * 
+     * @return Current simulation time (in seconds).
+     */
+    public Long getCurrentSimTime() {
+        return currentSimulationTime;
+    }
+    
+    /**
+     * Creates a local JTable for the event history portion of the user interface
+     * with the table model passed in as a parameter.  The table has three columns.
+     * Addition and subtraction to this table are handled in the model clas.
+     *
+     * @param logNumber Log number for this incident.
+     */ 
+    public void addIncidentTab(Integer logNumber) {
+        
+        IncidentHistoryPanel newHistoryPanel = new IncidentHistoryPanel();
+    
+        incidentTableMap.put(logNumber, newHistoryPanel);
+
+        eventHistoryPane.addTab(String.valueOf(logNumber), newHistoryPanel);
+        
+    }
+    
+    /**
+     * Remove the incident tab whose log number matches the parameter.
+     * 
+     * @param logNumber Incident log number.
+     */
+    public void removeIncidentTab(Integer logNumber) {
+        for(int i = 0; i < eventHistoryPane.getTabCount(); i++) {
+            if(eventHistoryPane.getTitleAt(i).compareTo(String.valueOf(logNumber)) == 0) {
+                eventHistoryPane.remove(i);
+                break;  
+            }
+        }
+    }
+    
+    /**
+     * Remove all incident tabs from the event history pane.
+     */
+    public void resetIncidentTabs() {
+        eventHistoryPane.removeAll();
+    }
+    
+    /**
+     * Method is called to add a new incident to the IncidentManagement
+     * panel.  The incident object is added to the IncidentListTableModel.
+     * 
+     * @param newIncident The incident object being added to the simulation. 
+     */ 
+    public void addIncident(Incident newIncident) {
+        incidentListTableModel.addIncident(newIncident);
+    }   
+    
+    /**
+     * Method starts an incident found in the IncidentListTableModel. 
+     * @param logNumber Incident log number.
+     */
+    public void startIncident(Integer logNumber) {
+        incidentListTableModel.startIncident(logNumber);        
+    }   
+    
+    /**
+     * Method removes an incident by removing it from the 
+     * IncidentListTableModel.  If there are no more incidents
+     * in the simulation, reset the start, pause, and reset buttons
+     * to be disabled, and enable the load script button.
+     * 
+     * @param logNumber Incident log number.
+     */
+    public void removeIncident(Integer logNumber) {
+        incidentListTableModel.removeIncident(logNumber);       
+        
+        //TODO check if simulation started??    
+        if(incidentListTableModel.getRowCount() == 0 && !simulationStarted) 
+        {
+            startButton.setEnabled(false);
+            pauseButton.setEnabled(false);
+            resetButton.setEnabled(false);  
+            
+            loadScriptButton.setEnabled(true);
+        }       
+    }
+    
+    /**
+     * Method resets the current list of Incidents by clearing the 
+     * IncidentListTableModel. 
+     */ 
+    public void resetIncidents() {
+        incidentListTableModel.clearModelData();
+    }
+    
+    /**
+     * Method adds a new Incident event to the IncidentHistoryTableModel
+     * that corresponds to the Incident log number.  If the IncidentEvent
+     * has been received from a terminal, the tab containing the 
+     * incident's table will be colored red to notify the user.
+     * 
+     * @param logNumber Incident log number.
+     * @param newEvent Incident event to add.
+     */
+    public void addIncidentEvent(Integer logNumber, IncidentEvent newEvent) {
+        //IncidentHistoryTableModel historyTableModel = incidentTableMap.get(logNumber);
+        IncidentHistoryPanel historyPanel = incidentTableMap.get(logNumber);
+        
+        //historyTableModel.addEvent(logNumber, newEvent);
+        historyPanel.updateIncidentHistory(newEvent);
+    }
+    
+    /**
+     * Method is called to add a new diversion to the Diversions panel.  
+     * The CMSInfo and CMSDiversion objects are added to the 
+     * AppliedDiversionTableModel, which creates its needed view data.
+     * 
+     * @param theCMSInfo The CMSInfo that the new diversion corresponds to.
+     * @param theDiversion A new diversion to be applied.
+     */
+    public void addDiversion(CMSInfo theCMSInfo, CMSDiversion theDiversion) {       
+        appliedDiversionTableModel.addDiversion(theCMSInfo, theDiversion);
+    }       
+
+    /**
+     * Method is called to remove an existing diversion from the Diversions panel.  
+     * The diversion information is removed from the AppliedDiversionTableModel, 
+     * which removes the corresponding row.
+     * 
+     * @param theCMSInfo The CMSInfo that the new diversion corresponds to.
+     * @param theDiversion A new diversion to be applied.
+     */
+    public void removeDiversion(CMSInfo theCMSInfo, CMSDiversion theDiversion) {
+        appliedDiversionTableModel.removeDiversion(theCMSInfo, theDiversion);
+
+    }
+    
+    /**
+     * Method resets the list of diversions by clearing the 
+     * AppliedDiversionTableModel.
+     */
+    public void resetDiversions() {
+        appliedDiversionTableModel.clearModelData();
+    }
+    
+    /**
+     * Build the CMS ID combo box with the list of parameter ids.
+     * 
+     * @param cmsIDArray Array of cms IDs
+     */
+    public void setCMS_IDList(Object[] cmsIDArray) {
+        for(int i = 0; i < cmsIDArray.length; i++) {
+            cmsIDComboBox.addItem(cmsIDArray[i]);   
+        }
+    }
+    
+    /**
+     * Method is called by the model everytime a second has passed during the simulation.
+     * The time in the parameter is shown in the simulationClockLabel.  The parameter
+     * is formatted HH:MM:SS.
+     *
+     * @param time The new time.
+     */
+    public void tick(long time) {
+        currentSimulationTime = time;
+        
+        String newTime = longToTime(currentSimulationTime);
+        
+        simulationClockLabel.setText(newTime);
+        CADClientClockLabel.setText(newTime);
+    }
+    
+    /**
+     * Method updates the simulation control and 'load script' buttons' enabled status
+     * and the status text according to the parameter SCRIPT_STATUS.
+     * The following table describes each status and the actions taken. <br>
+     *
+     *<table cellpadding="2" cellspacing="2" border="1"
+     * style="text-align: left; width: 250px;">
+     *  <tbody>
+     *    <tr>
+     *      <th>Status<br></th>
+     *      <th>Actions Taken<br></th>
+     *    </tr>
+     *    <tr>
+     *      <td>NO_SCRIPT<br></td>
+     *      <td>Set the simulation status text to a black "No Script".  Then 
+     *          disable all simulation buttons.  Enable the 'Load Script' button.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>SCRIPT_STOPPED_NOT_STARTED<br></td>
+     *      <td>Set the simulation status text to a red "Not Started".  Then 
+     *          enable the 'Start' and 'Reset' buttons, and disable the 'Pause'
+     *          button. Enable the 'Load Script' button.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>SCRIPT_STOPPED_STARTED<br></td>
+     *      <td>Set the simulation status text to a red "Paused".  Then 
+     *          enable the 'Start' and 'Reset' buttons, and disable the 'Pause'
+     *          button. Enable the 'Load Script' button. Set the simulationStarted
+     *          flag to true.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>SCRIPT_RUNNING<br></td>
+     *      <td>Set the simulation status text to a green "Running".  Then 
+     *          disable the 'Start' and 'Reset' buttons, and enable the 'Pause'
+     *          button. Disable the 'Load Script' button.  Set the simulationStarted
+     *          flag to true.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>ATMS_SYNCHRONIZATION<br></td>
+     *      <td>Set the simulation status text to an orange "Synchronizing".  Then 
+     *          disable all simulation buttons and the 'Load Script' button.<br></td>
+     *    </tr>
+     *  </tbody>
+     *</table>
+     *
+     * @param status Script status value.
+     */
+    public void setScriptStatus(SCRIPT_STATUS status) {
+        
+        switch(status) {
+            case NO_SCRIPT:
+                simulationStatusText.setText("No Script");
+                simulationStatusText.setForeground(Color.BLACK);
+                    
+                startButton.setEnabled(false);
+                pauseButton.setEnabled(false);
+                resetButton.setEnabled(false);                                              
+                break;          
+                
+            case SCRIPT_STOPPED_NOT_STARTED:
+                
+                simulationStatusText.setText("Ready");
+                simulationStatusText.setForeground(Color.RED);
+                    
+                startButton.setEnabled(true);
+                pauseButton.setEnabled(false);
+                resetButton.setEnabled(true);       
+                
+                loadScriptButton.setEnabled(true);
+                
+                //simulationClockLabel.setText("0:00:00");
+                //CADClientClockLabel.setText("0:00:00");               
+                break;          
+                
+            case SCRIPT_PAUSED_STARTED:
+                simulationStatusText.setText("Paused");
+                simulationStatusText.setForeground(Color.RED);
+                    
+                startButton.setEnabled(true);
+                pauseButton.setEnabled(false);
+                resetButton.setEnabled(true);               
+                simulationStarted = true;
+
+                loadScriptButton.setEnabled(true);
+                break;
+                
+            case SCRIPT_RUNNING:
+                simulationStatusText.setText("Running");
+                simulationStatusText.setForeground(Color.GREEN.darker());
+                
+                startButton.setEnabled(false);
+                pauseButton.setEnabled(true);
+                resetButton.setEnabled(false);  
+                simulationStarted = true;
+
+                loadScriptButton.setEnabled(false);
+                break;
+            case ATMS_SYNCHRONIZATION:
+                simulationStatusText.setText("Synchronizing");
+                simulationStatusText.setForeground(Color.ORANGE);
+                
+                startButton.setEnabled(false);
+                pauseButton.setEnabled(false);
+                resetButton.setEnabled(false);  
+                simulationStarted = false;
+
+                loadScriptButton.setEnabled(false);
+                break;
+        }       
+    }
+    
+
+    /**
+     * Method updates the paramics control buttons' enabled status
+     * and the paramics status text according to the parameter PARAMICS_STATUS.
+     * The following table describes each status and the actions taken. <br>
+     *
+     *<table cellpadding="2" cellspacing="2" border="1"
+     * style="text-align: left; width: 250px;">
+     *  <tbody>
+     *    <tr>
+     *      <th>Status<br></th>
+     *      <th>Actions Taken<br></th>
+     *    </tr>
+     *    <tr>
+     *      <td>UNREACHABLE<br></td>
+     *      <td>Show a message dialog to the user notifying them that a 
+     *          connection to Paramics could not be made.  Reset the
+     *          connect button to be labled 'Connect to Paramics' and
+     *          set the status text to 'Unreachable'.  Enable the connect
+     *          button and disable the network load button.  Set the connected
+     *          to paramics flag to false.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>DROPPED<br></td>
+     *      <td>Show a message dialog to the user notifying them that the 
+     *          connection to Paramics has been dropped.  Reset the
+     *          connect button to be labled 'Connect to Paramics' and
+     *          set the status text to 'Dropped'.  <br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>CONNECTING<br></td>
+     *      <td>Set the status text to 'Connecting'.  Disable the connect
+     *          button and network load button.  <br></td>          
+     *    </tr>
+     *    <tr>
+     *      <td>CONNECTED<br></td>
+     *      <td>Set the connect button to be labled 'Disconnect from Paramics' 
+     *          and set the status text to 'Connected'.  Enable the disconnect
+     *          button and network load button.  Set the connected to paramics flag 
+     *          to true.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>DISCONNECTED<br></td>
+     *      <td>Set the connect button to be labled 'Connect to Paramics' 
+     *          and set the status text to 'Disconnected'.  Enable the connect
+     *          button and disable the network load button.  Set the connected 
+     *          to paramics flag to false.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>SENDING_NETWORK_ID<br></td>
+     *      <td>Set the status text to 'Sending Network ID'.  Disable the 
+     *          network load button.<br></td>      
+     *    </tr>
+     *    <tr>
+     *      <td>WARMING<br></td>
+     *      <td>Set the status text to 'Warming'.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>LOADING<br></td>
+     *      <td>Set the status text to 'Loading'.<br></td>
+     *    </tr>
+     *    <tr>
+     *      <td>LOADED<br></td>
+     *      <td>Get the paramics network that has been been loaded from
+     *          the model.   Set the status text to 'Network # Loaded'.
+     *          Enable the connect button and disable the network
+     *          load button<br></td>
+     *    </tr>
+     *  </tbody>
+     *</table>
+     *
+     * @param status Paramics status value.
+     */
+    public void setParamicsStatus(PARAMICS_STATUS status) {
+        
+        switch(status) {
+        
+            case UNREACHABLE:           
+                JOptionPane.showMessageDialog(this, 
+                "Unable to connect to Paramics.", 
+                "Communication Error", JOptionPane.ERROR_MESSAGE);
+        
+                connectToParamicsButton.setText("Connect to Paramics");
+                paramicsStatusInfoLabel.setText("Unreachable");
+
+                connectToParamicsButton.setEnabled(true);
+                loadParamicsNetworkButton.setEnabled(false);
+                //networkIDSpinner.setEnabled(false);       
+                connectedToParamics = false;
+                
+            break;
+            case DROPPED:
+            
+                JOptionPane.showMessageDialog(this, 
+                "      Connection to Paramics has been dropped.\n" +
+                "Restart the Paramics Communicator and reconnect.", 
+                "Communication Error", JOptionPane.ERROR_MESSAGE);
+        
+                connectToParamicsButton.setText("Connect to Paramics");
+                paramicsStatusInfoLabel.setText("Dropped");
+                
+                loadParamicsNetworkButton.setEnabled(false);
+                //networkIDSpinner.setEnabled(false);       
+                connectedToParamics = false;
+            break;          
+            case CONNECTING:
+                paramicsStatusInfoLabel.setText("Connecting");
+                
+                connectToParamicsButton.setEnabled(false);
+                loadParamicsNetworkButton.setEnabled(false);
+                //networkIDSpinner.setEnabled(true);    
+            break;
+            case CONNECTED:
+                connectToParamicsButton.setText("Disconnect from Paramics");                
+                paramicsStatusInfoLabel.setText("Connected");
+                
+                connectToParamicsButton.setEnabled(true);
+                loadParamicsNetworkButton.setEnabled(true);
+                //networkIDSpinner.setEnabled(true);    
+                connectedToParamics = true;         
+                break;          
+                
+            case DISCONNECTED:
+                connectToParamicsButton.setText("Connect to Paramics");                             
+                paramicsStatusInfoLabel.setText("Disconnected");
+
+                connectToParamicsButton.setEnabled(true);
+                loadParamicsNetworkButton.setEnabled(false);
+                //networkIDSpinner.setEnabled(false);       
+                connectedToParamics = false;
+                        
+                break;  
+            case SENDING_NETWORK_ID:
+                paramicsStatusInfoLabel.setText("Sending Network ID");
+                
+                loadParamicsNetworkButton.setEnabled(false);
+            break;      
+            case WARMING:
+                paramicsStatusInfoLabel.setText("Warming Up");
+            break;
+            case LOADING:
+                paramicsStatusInfoLabel.setText("Loading Network");
+            break;      
+            case LOADED:            
+                String network = "";
+                try {                   
+                    int networkLoaded = theSimManagerModel.getParamicsNetworkLoaded();
+                    
+                    if(networkLoaded != -1)
+                        network = String.valueOf(networkLoaded);
+                }
+                catch (SimulationException se) {
+                    SimulationExceptionHandler(se);
+                }
+                
+                paramicsStatusInfoLabel.setText("Network " + network + " Loaded");
+
+                connectToParamicsButton.setEnabled(true);
+                loadParamicsNetworkButton.setEnabled(false);
+                
+            break;
+        }   
+    }
+
+    /**
+     * Method is used to convert a String containing a time in format H:MM:SS to a long
+     * value of the number of seconds represented. 
+     *
+     * @param time String containing a time in format H:MM:SS
+     * @throws StringIndexOutOfBoundsException if parameter is not in format H:MM:SS
+     * @return long Number of seconds in parameter time  
+     */
+    public static long stringTimeToLong(String time) throws StringIndexOutOfBoundsException{
+        long seconds = 0;   
+        
+        seconds =  ((long) Character.digit(time.charAt(0), 10) * 3600 +
+                        Character.digit(time.charAt(2), 10) * 600 + 
+                        Character.digit(time.charAt(3), 10) * 60 + 
+                        Character.digit(time.charAt(5), 10) * 10 +
+                        Character.digit(time.charAt(6), 10));
+
+              
+        return seconds;
+    }
+    
+    /**
+     * Converts a the long representation of the time, to the H:MM:SS String format
+     *
+     * @param seconds number of seconds.
+     * @return String H:MM:SS time representation.
+     */
+    public static String longToTime(long seconds) {
+        String time = new String();     
+        long timeSegment;   
+        
+        timeSegment = seconds / 3600;
+        time += String.valueOf(timeSegment) + ":";      
+        
+        seconds = seconds % 3600;
+        
+        timeSegment = seconds / 60;
+        if(timeSegment < 10)
+            time += "0";
+        
+        time += String.valueOf(timeSegment) + ":";      
+        seconds = seconds % 60; 
+        
+        timeSegment = seconds;
+        if(timeSegment < 10)
+            time += "0";
+        
+        time += String.valueOf(timeSegment);
+        
+        return time;        
+    }
+
+    /**
+     * This method is used to disply a message dialog with the received 
+     * ScriptException's information.  The possible exceptions are found in the 
+     * ScriptException class information.
+     *
+     * @param se The ScriptException to display
+     * @see ScriptException
+     */
+    public void ScriptExceptionHandler(ScriptException se) {
+        JOptionPane.showMessageDialog(this, se.getMessage(), "Script Error", JOptionPane.ERROR_MESSAGE);    
+    }
+
+/**
+     * This method is used to disply a message dialog with the received 
+     * SimulationException's information.  The possible exceptions are found in the 
+     * SimulationException class information.
+     *
+     * @param se The SimulationException to display
+     * @see SimulationException
+     */
+    public void SimulationExceptionHandler(SimulationException se) {
+        JOptionPane.showMessageDialog(this, se.getMessage(), "Simulation Error", JOptionPane.ERROR_MESSAGE);    
+    }
+    
+
+      
+    /**
+     * Initilize the GUI swing components.
+     */  
+    private void initComponents() {
+
+        createMenuBar();
+        createTimeAndStatus();
+        createSimulationControl();
+        createParamicsControl();
+        createIncidentManagement();
+        createCMSTrafficDiversion();
+        createAdmin();
+        createEventHistory();   
+
+        addSimulationTab();     
+
+        setMinimumSize(new Dimension(1024, 768));
+        setMaximumSize(new Dimension(1600, 1200));
+        setPreferredSize(new Dimension(1024, 768)); 
+        
+        pack();
+    }
+    
+    /**
+     * Create the menu bar components.
+     */
+    private void createMenuBar() {
+
+        gotoMenuItem = new JMenuItem(new GotoTimeIndexAction(this));        
+        exitMenuItem = new JMenuItem(new ExitAction(this));
+        
+        fileMenu = new JMenu("File");
+        fileMenu.add(gotoMenuItem);
+        fileMenu.add(exitMenuItem);
+        
+        simManagerMenuBar = new JMenuBar();
+        simManagerMenuBar.add(fileMenu);
+        
+        setJMenuBar(simManagerMenuBar);
+    }
+    
+    /**
+     * Create the time and status boxes, buttons, and listeners.
+     */
+    private void createTimeAndStatus() {
+        
+        simulationTime       = new JPanel();
+        simulationClock      = new JPanel();
+        simulationStatus     = new JLabel("Simulation Status");
+        simulationStatusText = new JLabel("No Script");
+        simulationStatusText.setFont(new Font("Geneva", Font.BOLD, 14));
+        
+        simulationTime.setLayout(new BorderLayout());       
+        simulationClock.setPreferredSize(new Dimension(100, 60));
+        
+        startButton = new JButton(new StartSimulationAction(this));
+        
+        pauseButton  = new JButton(new PauseSimulationAction(this));
+        resetButton = new JButton(new ResetSimulationAction(this));
+        
+        startButton.setEnabled(false);
+        pauseButton.setEnabled(false);
+        resetButton.setEnabled(false);
+
+        simulationStatusBox     = new Box(BoxLayout.Y_AXIS);        
+        simulationTimeBox       = new Box(BoxLayout.Y_AXIS);
+        simulationClockBox      = new Box(BoxLayout.X_AXIS);
+        simulationTimeButtonBox = new Box(BoxLayout.X_AXIS);
+        
+        simulationTimeButtonBox.add(startButton);
+        simulationTimeButtonBox.add(pauseButton);
+        simulationTimeButtonBox.add(resetButton);
+        
+        simulationStatus.setAlignmentX(Box.CENTER_ALIGNMENT);
+        simulationStatusText.setAlignmentX(Box.CENTER_ALIGNMENT);
+        simulationStatusText.setName("simulationStatusText");
+        
+        TitledBorder title = BorderFactory.createTitledBorder(
+                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Status");
+        title.setTitleJustification(TitledBorder.LEFT);
+        simulationStatusBox.setBorder(title);
+        
+        simulationStatusBox.setMaximumSize(new Dimension(140, 60));
+        simulationStatusBox.setAlignmentX(Box.CENTER_ALIGNMENT);                    
+        
+        simulationStatusBox.add(Box.createVerticalGlue());
+        simulationStatusBox.add(simulationStatusText);
+        simulationStatusBox.add(Box.createVerticalGlue());
+        
+        scriptBox = new Box(BoxLayout.Y_AXIS);
+        scriptBox.setAlignmentX(Box.CENTER_ALIGNMENT);
+        
+        loadScriptButton = new JButton(new LoadScriptAction(this));
+        loadScriptButton.setAlignmentX(Box.CENTER_ALIGNMENT);
+        
+        scriptBox.add(simulationStatusBox);
+        scriptBox.add(Box.createVerticalStrut(5));
+        scriptBox.add(loadScriptButton);
+        
+        simulationClockLabel = new JLabel("0:00:00");
+        simulationClockLabel.setFont(new Font("Geneva", Font.BOLD, 70));
+        simulationClockLabel.setForeground(Color.BLACK);
+        simulationClockLabel.setBackground(Color.BLACK);
+        simulationClockBox.setForeground(Color.BLACK);
+        simulationClockBox.setBackground(Color.BLACK);
+        simulationClockBox.add(simulationClockLabel);
+        simulationClockBox.setAlignmentX(Box.CENTER_ALIGNMENT); 
+        simulationTimeButtonBox.setAlignmentX(Box.CENTER_ALIGNMENT);
+        simulationTimeBox.add(simulationClockBox);
+        simulationTimeBox.add(simulationTimeButtonBox);
+
+        simulationTimeAndStatusBox = Box.createHorizontalBox();
+        simulationTimeAndStatusBox.setAlignmentX(Box.LEFT_ALIGNMENT);
+        simulationTimeAndStatusBox.setMaximumSize(new Dimension(640, 200));
+        simulationTimeAndStatusBox.setPreferredSize(new Dimension(640, 160));
+        simulationTimeAndStatusBox.add(Box.createHorizontalStrut(5));
+        simulationTimeAndStatusBox.add(simulationTimeBox);
+        simulationTimeAndStatusBox.add(Box.createHorizontalStrut(20));
+        simulationTimeAndStatusBox.add(scriptBox);
+        simulationTimeAndStatusBox.add(Box.createHorizontalStrut(5));
+        
+        //*** Clock for CAD Tab ***//
+        CADClientClockLabel = new JLabel("0:00:00");
+        CADClientClockLabel.setFont(new Font("Geneva", Font.BOLD, 60));
+        CADClientClockLabel.setForeground(Color.BLACK);
+        CADClientClockLabel.setBackground(Color.BLACK);
+        CADClientClockLabel.setAlignmentX(Box.CENTER_ALIGNMENT);        
+        
+    }
+    
+    
+    /**
+     * Create Simulation Control Box
+     */
+    private void createSimulationControl() {
+        
+        simulationControlBox = new Box(BoxLayout.Y_AXIS);
+        simulationControlBox.add(simulationTimeAndStatusBox);
+                
+        CompoundBorder cBorder = BorderFactory.createCompoundBorder(
+            BorderFactory.createTitledBorder(
+                BorderFactory.createRaisedBevelBorder(), "Simulation Control"),
+                BorderFactory.createEmptyBorder(5,5,5,5));
+
+        
+        simulationControlBox.setBorder(cBorder);    
+    }
+    
+    /**
+     * Create ParamicsControl Box
+     */
+    private void createParamicsControl() {
+        
+        paramicsControlBox = new Box(BoxLayout.Y_AXIS);
+        paramicsControlBox.setAlignmentX(Box.LEFT_ALIGNMENT);
+        paramicsControlBox.setMaximumSize(new Dimension(650, 150));     
+        paramicsControlBox.setMinimumSize(new Dimension(250, 95));  
+        paramicsControlBox.setPreferredSize(new Dimension(380, 95));
+        
+        paramicsStatusBox       = new Box(BoxLayout.X_AXIS);        
+        paramicsStatusLabel     = new JLabel("Status:");
+        paramicsStatusInfoLabel = new JLabel("Unknown");
+        paramicsStatusBox.add(paramicsStatusLabel);
+        paramicsStatusBox.add(Box.createHorizontalStrut(10));
+        paramicsStatusBox.add(paramicsStatusInfoLabel);
+        paramicsStatusBox.add(Box.createHorizontalGlue());
+        
+        networkIDSpinner = new JSpinner(
+            new SpinnerNumberModel(DEFAULT_NETWORK_ID, 1, MAX_NETWORK_ID, 1));
+        networkIDSpinner.setEnabled(false);     
+        networkIDSpinner.setMaximumSize(new Dimension(60, 30));
+        
+        connectToParamicsButton = new JButton(new ConnectToParamicsAction(this));
+
+        loadParamicsNetworkButton = new JButton(new LoadParamicsNetworkAction(this));
+        loadParamicsNetworkButton.setEnabled(false);
+        loadParamicsNetworkButton.getAction().putValue(
+                LoadParamicsNetworkAction.NETWORK_ID_SPINNER, networkIDSpinner);
+        
+
+        paramicsButtonBox = new Box(BoxLayout.X_AXIS);
+        paramicsButtonBox.add(Box.createHorizontalGlue());
+        paramicsButtonBox.add(connectToParamicsButton);
+        paramicsButtonBox.add(Box.createHorizontalGlue());
+        paramicsButtonBox.add(loadParamicsNetworkButton);
+        paramicsButtonBox.add(Box.createHorizontalStrut(10));
+        paramicsButtonBox.add(networkIDSpinner);
+        paramicsButtonBox.add(Box.createHorizontalGlue());
+
+        paramicsControlBox.add(Box.createVerticalStrut(5));
+        paramicsControlBox.add(paramicsStatusBox);
+        paramicsControlBox.add(Box.createVerticalStrut(5));
+        paramicsControlBox.add(paramicsButtonBox);  
+        paramicsControlBox.add(Box.createVerticalStrut(5));
+                
+        CompoundBorder cBorder = BorderFactory.createCompoundBorder(
+            BorderFactory.createTitledBorder(
+                BorderFactory.createRaisedBevelBorder(), "Paramics Control"),
+                BorderFactory.createEmptyBorder(5,5,5,5));
+
+        
+        paramicsControlBox.setBorder(cBorder);      
+    
+    }   
+    
+    /**
+     * Create the Incident Management portion of the Simulation 
+     * Management Box
+     */        
+    private void createIncidentManagement() {
+    
+        createIncidentListTable();
+        
+        incidentTimeModel = new IncidentTimeSpinnerModel();
+        reschedSpinner = new JSpinner(incidentTimeModel);        
+        reschedSpinner.setEnabled(false);
+        reschedSpinner.setMaximumSize(new Dimension(70,20));
+                
+        
+        triggerButton     = new JButton(new TriggerIncidentAction(this));
+        triggerButton.getAction().putValue(
+                TriggerIncidentAction.INCIDENT_LIST_TABLE, incidentListTable);
+        
+        deleteIncButton   = new JButton(new DeleteIncidentAction(this));
+        deleteIncButton.getAction().putValue(
+                DeleteIncidentAction.INCIDENT_LIST_TABLE, incidentListTable);
+    
+        reschedButton     = new JButton(new RescheduleIncidentAction(this));
+        reschedButton.getAction().putValue(
+                RescheduleIncidentAction.INCIDENT_LIST_TABLE, incidentListTable);
+        reschedButton.getAction().putValue(
+                RescheduleIncidentAction.INCIDENT_TIME_MODEL, incidentTimeModel);
+        
+        addIncidentButton = new JButton(new AddIncidentAction(this));
+        
+        timeScheduledLabel  = new JLabel("Time Scheduled: ");   
+                    
+        triggerButton.setEnabled(false);
+        deleteIncButton.setEnabled(false);
+        reschedButton.setEnabled(false);
+
+        Box temp = new Box(BoxLayout.X_AXIS);
+        temp.setAlignmentX(Box.CENTER_ALIGNMENT);       
+        temp.add(timeScheduledLabel);
+        temp.add(Box.createHorizontalStrut(10));
+        temp.add(reschedSpinner);
+        temp.add(Box.createHorizontalStrut(20));
+        temp.add(reschedButton);        
+
+        incidentManagementReSchedBox = new Box(BoxLayout.Y_AXIS);
+        incidentManagementReSchedBox.setAlignmentX(Box.CENTER_ALIGNMENT);       
+        incidentManagementReSchedBox.add(temp);     
+                
+        Box temp2 = new Box(BoxLayout.X_AXIS);
+        temp2.setAlignmentX(Box.CENTER_ALIGNMENT);
+        temp2.add(triggerButton);
+        temp2.add(Box.createHorizontalStrut(20));
+        temp2.add(deleteIncButton);
+        temp2.add(Box.createHorizontalStrut(20));
+        temp2.add(addIncidentButton);                   
+
+        incidentManagementButtonsBox = new Box(BoxLayout.Y_AXIS);
+        incidentManagementButtonsBox.setAlignmentY(Box.CENTER_ALIGNMENT);
+        incidentManagementButtonsBox.add(temp2);
+        
+        incidentManagementActionBox = new Box(BoxLayout.Y_AXIS);
+        incidentManagementActionBox.setMaximumSize(new Dimension(500, 100));
+        incidentManagementActionBox.setAlignmentX(Box.LEFT_ALIGNMENT);
+        incidentManagementActionBox.add(incidentManagementReSchedBox);      
+        incidentManagementActionBox.add(Box.createVerticalStrut(10));       
+        incidentManagementActionBox.add(incidentManagementButtonsBox);      
+
+        incidentManagementBox = new Box(BoxLayout.Y_AXIS);
+        incidentManagementBox.setAlignmentX(Box.LEFT_ALIGNMENT);
+        incidentManagementBox.setMaximumSize(new Dimension(650, 500));      
+        incidentManagementBox.setMinimumSize(new Dimension(250, 240));  
+        incidentManagementBox.setPreferredSize(new Dimension(380, 240));
+        incidentManagementBox.add(Box.createVerticalStrut(5));
+        incidentManagementBox.add(incidentListPane);        
+        incidentManagementBox.add(Box.createVerticalStrut(10));     
+        incidentManagementBox.add(incidentManagementActionBox);         
+        incidentManagementBox.add(Box.createVerticalStrut(5));
+        
+        CompoundBorder cBorder = BorderFactory.createCompoundBorder(
+            BorderFactory.createTitledBorder(
+                BorderFactory.createRaisedBevelBorder(), "Incident Management"),
+                BorderFactory.createEmptyBorder(5,5,5,5));
+
+        
+        incidentManagementBox.setBorder(cBorder);       
+    
+    }
+    
+    private void createIncidentListTable() {
+    
+        incidentListTableModel = new IncidentListTableModel();    
+        incidentListTableModel.addTableModelListener(new TableModelListener() {
+            public void tableChanged(TableModelEvent arg0) {
+
+                boolean incidentToTrigger = false;
+                
+                for(int i = 0; i < incidentListTableModel.getRowCount(); i++) {
+                    
+                    incidentToTrigger |= (((Long)incidentListTableModel.
+                            getValueAt(i, INCIDENT_LIST_COLUMNS.SCHEDULED_COL.colNum)) != -1); 
+                }                   
+
+                triggerButton.setEnabled(incidentToTrigger);
+                deleteIncButton.setEnabled(incidentToTrigger);
+                reschedButton.setEnabled(incidentToTrigger);
+                reschedSpinner.setEnabled(incidentToTrigger);           
+                
+            }
+        });
+            
+        incidentListTable = new JTable(incidentListTableModel);     
+        incidentListTable.getTableHeader().setReorderingAllowed(false);  
+        incidentListTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
+        incidentListTable.setDragEnabled(false);      
+                
+        for(int c = 0; c < incidentListTable.getColumnCount(); c++) {
+            incidentListTable.getColumnModel().getColumn(c).setMinWidth(
+                    incidentListTableModel.getColumnMinWidth(c));
+            incidentListTable.getColumnModel().getColumn(c).setMaxWidth(
+                    incidentListTableModel.getColumnMaxWidth(c));
+            incidentListTable.getColumnModel().getColumn(c).setPreferredWidth(
+                    incidentListTableModel.getColumnPrefWidth(c));
+            incidentListTable.getColumnModel().getColumn(c).setResizable(true);
+            
+            if(c == INCIDENT_LIST_COLUMNS.SCHEDULED_COL.colNum)
+                incidentListTable.getColumnModel().getColumn(c).setCellRenderer(
+                        new IncidentTimeCellRenderer());
+                
+        }
+
+        incidentListPane = new JScrollPane();
+        incidentListPane.setAlignmentX(Box.LEFT_ALIGNMENT);
+        incidentListPane.setMaximumSize(new Dimension(650, 400));       
+        incidentListPane.setMinimumSize(new Dimension(200, 100));   
+        incidentListPane.setPreferredSize(new Dimension(380, 100));
+        incidentListPane.setViewportView(incidentListTable);
+        
+        incidentListTable.addMouseListener(new MouseListener() {
+            public void mouseClicked(MouseEvent e) {}
+            public void mouseEntered(MouseEvent e) {}           
+            public void mouseExited(MouseEvent e) {}            
+            public void mousePressed(MouseEvent e) {}           
+            public void mouseReleased(MouseEvent e)  {
+                long incTime = (Long)incidentListTable.getValueAt(incidentListTable.getSelectedRow(), 
+                        INCIDENT_LIST_COLUMNS.SCHEDULED_COL.colNum);
+                if(incTime != -1) {
+                    incidentTimeModel.setValue(incTime);
+                    triggerButton.setEnabled(true);
+                    deleteIncButton.setEnabled(true);
+                    reschedButton.setEnabled(true);
+                    reschedSpinner.setEnabled(true);
+                }
+                else {
+                    triggerButton.setEnabled(false);
+                    deleteIncButton.setEnabled(false);
+                    reschedButton.setEnabled(false);
+                    reschedSpinner.setEnabled(false);       
+                }
+                
+            }           
+        });
+    }
+
+    /**
+     * Create the cms traffic diversion box.
+     */    
+    private void createCMSTrafficDiversion() {
+    
+        cmsTrafficDiversionBox = new Box(BoxLayout.Y_AXIS);
+        cmsTrafficDiversionBox.setAlignmentX(Box.LEFT_ALIGNMENT);
+        cmsTrafficDiversionBox.setMaximumSize(new Dimension(650, 350));     
+        cmsTrafficDiversionBox.setMinimumSize(new Dimension(200, 145)); 
+        cmsTrafficDiversionBox.setPreferredSize(new Dimension(380, 250));   
+        
+        CompoundBorder cBorder = BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(BorderFactory.createRaisedBevelBorder(), "CMS Diversion Management"),
+                                                                    BorderFactory.createEmptyBorder(5,5,5,5));
+
+        cmsTrafficDiversionBox.setBorder(cBorder);                  
+                        
+        appliedDiversionTableModel = new AppliedDiversionTableModel();
+        appliedDiversionTable = new JTable(appliedDiversionTableModel);
+        appliedDiversionTable.getTableHeader().setReorderingAllowed(false);
+        appliedDiversionTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
+        appliedDiversionTable.setCellSelectionEnabled(false);
+        appliedDiversionTable.setRowSelectionAllowed(true);
+        appliedDiversionTable.addMouseListener(new MouseListener() {
+            public void mouseClicked(MouseEvent evt)  {
+                if(evt.getClickCount() >= 2) {
+                    ((ApplyDiversionAction)divertButton.getAction()).showDiversionDialog(
+                            (String)appliedDiversionTableModel.getValueAt(
+                                    appliedDiversionTable.getSelectedRow(),
+                                    APPLIED_DIV_COLUMNS.CMS_ID_COL.colNum));
+                }
+            };
+            public void mouseEntered(MouseEvent arg0)  {};
+            public void mouseExited(MouseEvent arg0)   {};
+            public void mousePressed(MouseEvent arg0)  {};
+            public void mouseReleased(MouseEvent arg0) {};          
+        });
+        
+        for(int c = 0; c < appliedDiversionTable.getColumnCount(); c++) {
+            appliedDiversionTable.getColumnModel().getColumn(c).setMinWidth(
+                    appliedDiversionTableModel.getColumnMinWidth(c));
+            appliedDiversionTable.getColumnModel().getColumn(c).setMaxWidth(
+                    appliedDiversionTableModel.getColumnMaxWidth(c));
+            appliedDiversionTable.getColumnModel().getColumn(c).setPreferredWidth(
+                    appliedDiversionTableModel.getColumnPrefWidth(c));
+            appliedDiversionTable.getColumnModel().getColumn(c).setResizable(false);
+            
+            if(c == APPLIED_DIV_COLUMNS.APPLIED_COL.colNum) {
+                appliedDiversionTable.getColumnModel().getColumn(c).setCellRenderer(
+                        new IncidentTimeCellRenderer());
+            }       
+        }       
+
+        appliedDiversionPane = new JScrollPane();
+        appliedDiversionPane.setAlignmentX(Box.CENTER_ALIGNMENT);       
+        appliedDiversionPane.setMaximumSize(new Dimension(650, 800));       
+        appliedDiversionPane.setMinimumSize(new Dimension(200, 75));    
+        appliedDiversionPane.setPreferredSize(new Dimension(380,100));              
+        appliedDiversionPane.setViewportView(appliedDiversionTable);    
+        
+        cmsIDComboBox = new JComboBox();
+        cmsIDComboBox.setMaximumSize(new Dimension(40, 25));
+        
+        divertButton = new JButton(new ApplyDiversionAction(this));
+        divertButton.getAction().putValue(
+                ApplyDiversionAction.CMS_ID_COMBO_BOX, cmsIDComboBox);
+                
+        appliedDiversionButtonBox = new Box(BoxLayout.X_AXIS);
+        appliedDiversionButtonBox.setAlignmentX(Box.CENTER_ALIGNMENT);
+        appliedDiversionButtonBox.setMaximumSize(new Dimension(1010, 40));
+        appliedDiversionButtonBox.add(Box.createGlue());
+        appliedDiversionButtonBox.add(new JLabel("CMS ID:  "));
+        appliedDiversionButtonBox.add(cmsIDComboBox);
+        appliedDiversionButtonBox.add(Box.createHorizontalStrut(15));
+        appliedDiversionButtonBox.add(divertButton);    
+        appliedDiversionButtonBox.add(Box.createGlue());
+
+        cmsTrafficDiversionBox.add(Box.createVerticalStrut(5));
+        cmsTrafficDiversionBox.add(appliedDiversionPane);       
+        cmsTrafficDiversionBox.add(Box.createVerticalStrut(5));
+        cmsTrafficDiversionBox.add(appliedDiversionButtonBox);      
+        cmsTrafficDiversionBox.add(Box.createVerticalStrut(5));             
+    
+    }
+        
+    /**
+     * Create the main admin box.
+     */            
+    private void createAdmin() {        
+        
+        adminInteractionBox = new Box(BoxLayout.Y_AXIS);
+        adminInteractionBox.setAlignmentX(Box.LEFT_ALIGNMENT);  
+        adminInteractionBox.setMinimumSize(new Dimension(425, 740));    
+        adminInteractionBox.setPreferredSize(new Dimension(425, 740));  
+        adminInteractionBox.setMaximumSize(new Dimension(625, 1975));       
+        
+        adminInteractionBox.add(Box.createVerticalStrut(10));       
+        adminInteractionBox.add(simulationControlBox);
+        adminInteractionBox.add(Box.createVerticalStrut(10));   
+        adminInteractionBox.add(paramicsControlBox);
+        adminInteractionBox.add(Box.createVerticalStrut(10));   
+        adminInteractionBox.add(incidentManagementBox);
+        adminInteractionBox.add(Box.createVerticalStrut(10));   
+        adminInteractionBox.add(cmsTrafficDiversionBox);        
+        adminInteractionBox.add(Box.createVerticalStrut(10));   
+        
+    }
+
+    /**
+     * Create the event history box.
+     */    
+    private void createEventHistory() {
+    
+        eventHistoryPane = new JTabbedPane();
+        
+        eventHistoryBox = new Box(BoxLayout.Y_AXIS);
+        eventHistoryBox.setAlignmentX(Box.CENTER_ALIGNMENT);
+        eventHistoryBox.setMinimumSize(new Dimension(525, 700));    
+        eventHistoryBox.setPreferredSize(new Dimension(525, 700));
+        eventHistoryBox.setMaximumSize(new Dimension(925, 1975));   
+        
+        eventHistoryBox.add(eventHistoryPane);
+        eventHistoryBox.add(Box.createVerticalStrut(10));   
+        
+        CompoundBorder cBorder = BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(BorderFactory.createRaisedBevelBorder(), "Event History"),
+                                                                    BorderFactory.createEmptyBorder(5,5,5,5));
+        
+        eventHistoryBox.setBorder(cBorder);     
+        
+    }
+    
+
+    /**
+     * Create the administrator tab
+     */            
+    private void addSimulationTab() {
+        
+    simulationRightSideBox = new Box(BoxLayout.Y_AXIS);             
+        simulationRightSideBox.add(Box.createVerticalStrut(10));
+        simulationRightSideBox.add(eventHistoryBox);
+        simulationRightSideBox.add(Box.createVerticalStrut(10));    
+                
+        simulationBox = new Box(BoxLayout.X_AXIS);      
+        simulationBox.add(Box.createHorizontalStrut(20));
+        simulationBox.add(adminInteractionBox);
+        simulationBox.add(Box.createHorizontalStrut(20));   
+        simulationBox.add(simulationRightSideBox);
+        simulationBox.add(Box.createHorizontalStrut(20));
+                
+        getContentPane().add(simulationBox);
+    }   
+    
+    private JTabbedPane eventHistoryPane;
+    
+    private JScrollPane incidentListPane; 
+    private JScrollPane appliedDiversionPane;
+
+    private JTable incidentListTable;
+    private JTable appliedDiversionTable;
+    
+    private JPanel simulationTime;
+    private JPanel simulationClock;
+            
+    private JLabel paramicsStatusLabel;
+    private JLabel paramicsStatusInfoLabel;
+    private JLabel simulationStatus;
+    private JLabel simulationClockLabel;
+    private JLabel simulationStatusText;
+    private JLabel timeScheduledLabel;
+    private JLabel CADClientClockLabel;
+            
+    private Box adminInteractionBox;    
+    private Box simulationRightSideBox;
+    private Box simulationBox;          
+    private Box appliedDiversionButtonBox;  
+    private Box cmsTrafficDiversionBox;     
+    private Box eventHistoryBox;    
+    private Box incidentManagementActionBox;
+    private Box incidentManagementBox;  
+    private Box incidentManagementButtonsBox;
+    private Box incidentManagementReSchedBox;
+    private Box scriptBox;      
+    private Box paramicsButtonBox;
+    private Box paramicsControlBox; 
+    private Box paramicsStatusBox;
+    private Box simulationTimeAndStatusBox;
+    private Box simulationStatusBox;        
+    private Box simulationTimeBox;
+    private Box simulationClockBox;
+    private Box simulationControlBox;
+    private Box simulationTimeButtonBox;
+
+    private IncidentTimeSpinnerModel incidentTimeModel;
+    private JSpinner reschedSpinner;
+    private JSpinner networkIDSpinner;
+    
+    private JButton addIncidentButton;          
+    private JButton deleteIncButton;
+    private JButton loadScriptButton;
+    private JButton divertButton;
+    private JButton reschedButton;
+    private JButton resetButton;
+    private JButton startButton;
+    private JButton pauseButton;
+    private JButton triggerButton;  
+    private JButton connectToParamicsButton;
+    private JButton loadParamicsNetworkButton;
+    
+    private JComboBox cmsIDComboBox;                    
+        
+    private JMenuBar simManagerMenuBar;
+    private JMenu fileMenu;
+    private JMenuItem gotoMenuItem;
+    private JMenuItem exitMenuItem;
+    
+}
+
Index: trunk/src/tmcsim/simulationmanager/package.html
===================================================================
--- trunk/src/tmcsim/simulationmanager/package.html	(revision 2)
+++ trunk/src/tmcsim/simulationmanager/package.html	(revision 2)
@@ -0,0 +1,5 @@
+<html>
+  <body>
+  	This package contains the classes for the Simulation Manager
+  </body>
+</html>
Index: trunk/src/tmcsim/paramicscommunicator/FileRegUpdate.java
===================================================================
--- trunk/src/tmcsim/paramicscommunicator/FileRegUpdate.java	(revision 2)
+++ trunk/src/tmcsim/paramicscommunicator/FileRegUpdate.java	(revision 2)
@@ -0,0 +1,52 @@
+package tmcsim.paramicscommunicator;
+
+import tmcsim.paramicscommunicator.FileIOUpdate.IO_TYPE;
+
+/**
+ * FileRegUpdate is an update class used to record registration operations 
+ * performed by the ParamicsCommunicator.
+ *  
+ * @author Matthew Cechini
+ * @version
+ */
+public class FileRegUpdate {
+
+    /**
+     * Enumeration of registration actions.
+     * @author Matthew Cechini
+     */
+    public static enum REG_TYPE { REGISTER, UNREGISTER };
+    
+    /** I/O action type performed by this Paramics FileReader or FileWriter */
+    public IO_TYPE  ioType;
+
+    /** Registration action performed. */
+    public REG_TYPE regType;
+
+    /** ID of FileReader or FileWriter. */
+    public String   ioID;
+
+    /** Target file to read from or write to. */
+    public String   targetFile;
+
+    /** Interval (in seconds) that the I/O action is performed. */
+    public Integer  ioInterval;
+    
+    /**
+     * Constructor.
+     * 
+     * @param io I/O action type.
+     * @param reg Registration action type.
+     * @param id   I/O object id.
+     * @param file Target file for I/O operation.
+     * @param interval Interval for I/O action.
+     */
+    public FileRegUpdate(IO_TYPE io, REG_TYPE reg, String id, String file, Integer interval) {
+        ioType  = io;
+        ioID    = id;
+        regType = reg;
+        targetFile = file;
+        ioInterval = interval;
+    }
+    
+}
Index: trunk/src/tmcsim/paramicscommunicator/ParamicsCommunicator.java
===================================================================
--- trunk/src/tmcsim/paramicscommunicator/ParamicsCommunicator.java	(revision 2)
+++ trunk/src/tmcsim/paramicscommunicator/ParamicsCommunicator.java	(revision 2)
@@ -0,0 +1,462 @@
+package tmcsim.paramicscommunicator;
+
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import java.io.EOFException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.SocketTimeoutException;
+import java.util.Observable;
+import java.util.Observer;
+import java.util.Properties;
+import java.util.TreeMap;
+import java.util.logging.FileHandler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.JOptionPane;
+import javax.swing.UIManager;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import tmcsim.common.CADProtocol.PARAMICS_ACTIONS;
+import tmcsim.common.CADProtocol.PARAMICS_COMM_TAGS;
+import tmcsim.paramicscommunicator.FileIOUpdate.IO_TYPE;
+import tmcsim.paramicscommunicator.FileRegUpdate.REG_TYPE;
+import tmcsim.paramicscommunicator.gui.ParamicsCommunicatorGUI;
+import tmcsim.simulationmanager.SimulationManager;
+
+
+/**
+ * ParamicsCommunicator is the main class for this module.  The Paramics 
+ * Communicator is used to provide communication between the CAD Simulator
+ * and the Paramics traffic modeler.  While the application is running, data 
+ * is received on a socket from the CAD Simulator.  Transmitted data are
+ * XML documents containing information and action commands. The CAD Simulator 
+ * registers readers and writers with the ParamicsCommunicator.  Any data read 
+ * by a ParamicsReader is sent back to the CAD Simulator.  All data to be 
+ * written by a ParamicsWriter is received through the socket.<br><br>  
+ * The properties file for the ParamicsCommunicator class contains the following data.<br>
+ * <code>
+ * -----------------------------------------------------------------------------<br>
+ * Socket Port          The port number to use for socket communication.<br>
+ * Working Directory    The working directory use for Paramics file communication.<br>
+ * Error File           The target file to use for error logging.<br>
+ * -----------------------------------------------------------------------------<br>
+ * Example File: <br>
+ * SocketPort          = 4450 <br>
+ * WorkingDirectory    = c:\\tmc_simulator\\ <br>
+ * ErrorFile           = sim_mgr_error.xml <br>
+ * -----------------------------------------------------------------------------<br>
+ * </code>
+ *
+ * @author Matthew Cechini (mcechini@calpoly.edu)
+ * @version $Date: 2009/04/17 16:27:46 $ $Revision: 1.7 
+ */
+public class ParamicsCommunicator extends Observable implements Observer, Runnable {
+
+    /** Error logger. */
+    private static Logger paramLogger = Logger.getLogger("tmcsim.paramicscommunicator");
+    
+    /**
+     * Enumeration containing property names.
+     * @author Matthew Cechini
+     */
+    private static enum PROPERTIES {
+        
+        SOCKET_PORT ("SocketPort"),
+        WORKING_DIR ("WorkingDirectory");       
+        
+        public String name;
+        
+        private PROPERTIES(String n) {
+            name = n;
+        }
+    }
+    
+        
+    /** Properties object. */
+    private Properties paramicsCommProp = null; 
+    
+    /** Current working directory where files will be read and written */
+    private String workingDirectory = null;
+    
+    /** Socket used to create socket communication with the CAD Simulator.  */
+    private ServerSocket serverSocket = null;
+    
+    /** Soccket used to communicate with CAD Simulator.*/
+    private Socket paramicsSocket = null;   
+    
+    /** Input Stream for reading data from the CAD Simulator. */
+    private ObjectInputStream in = null;
+    
+    /** Output Stream for writing data to the CAD Simulator.  */
+    private ObjectOutputStream out = null;
+    
+    /** Map of all current ParamicsFileWriters referenced by I/O ID. */
+    private TreeMap<String, ParamicsFileWriter> writers = null;
+    
+    /** Map of all current ParamicsFileReaders referenced by I/O ID.  */
+    private TreeMap<String, ParamicsFileReader> readers = null;
+    
+    /** The view class for the ParamicsCommunicator. */
+    private ParamicsCommunicatorGUI theGUI;
+    
+    /**
+     * Constructor.  Read in the property values.  If the properties file 
+     * does not contain a value for the working directory, open a dialog
+     * to prompt the user for the path of the Paramics working directory.
+     * An empty string is not accepted.  A null signifies that the user
+     * pressed cancel.  Prompt the user to accept the cancel and exit the
+     * application if confirmed.  Continue until a valid directory has been
+     * entered, that exists, and append a '\' to the end of the directory
+     * if necessary.
+     * 
+     * Initialize the Sockets
+     * and begin communication.
+     *
+     * @param propertiesFilePath File Path of ParamicsCommunicator properties file.
+     */
+    public ParamicsCommunicator (String propertiesFile) 
+    {
+        
+        writers = new TreeMap<String, ParamicsFileWriter>();
+        readers = new TreeMap<String, ParamicsFileReader>();
+
+        theGUI = new ParamicsCommunicatorGUI();
+        addObserver(theGUI);
+        theGUI.addWindowListener(new WindowListener() {         
+            public void windowActivated(WindowEvent arg0) {};
+            public void windowClosed(WindowEvent arg0) {};
+            public void windowClosing(WindowEvent arg0) {
+                System.exit(0);
+            }
+            public void windowDeactivated(WindowEvent arg0) {};
+            public void windowDeiconified(WindowEvent arg0) {};
+            public void windowIconified(WindowEvent arg0) {};
+            public void windowOpened(WindowEvent arg0) {};
+        });
+        
+        try {
+            paramicsCommProp = new Properties();
+            paramicsCommProp.load(new FileInputStream(propertiesFile));
+            
+            if(paramicsCommProp.getProperty(PROPERTIES.SOCKET_PORT.name) == null) 
+            {
+                JOptionPane.showMessageDialog(theGUI, 
+                        "Properties file missing CAD Simulator Port information.", 
+                        "Invalid Configuration", JOptionPane.ERROR_MESSAGE);
+                System.exit(0);
+            }
+            else if(paramicsCommProp.getProperty(PROPERTIES.WORKING_DIR.name) == null || 
+                    paramicsCommProp.getProperty(PROPERTIES.WORKING_DIR.name).length() == 0) {
+                
+                try {
+                    String workingDir = null;
+                    
+                    while (workingDir == null || workingDir.length() == 0) {                        
+                        workingDir = JOptionPane.showInputDialog(null,
+                                "Please set the output directory for Paramics communication.",
+                                "Paramics Working Directory", JOptionPane.QUESTION_MESSAGE);
+                        
+                        if(workingDir == null) {
+                            
+                        }
+                        else if(!new File(workingDir).exists()) {
+                            JOptionPane.showMessageDialog(null,
+                                    "Directory does not exist.",
+                                    "Invalid Working Directory", JOptionPane.WARNING_MESSAGE);
+                            
+                            workingDir = null;
+                        }
+                        else if(!new File(workingDir).isDirectory()) {
+                            JOptionPane.showMessageDialog(null,
+                                    workingDir + " is not a directory.",
+                                    "Invalid Working Directory", JOptionPane.WARNING_MESSAGE);
+                            
+                            workingDir = null;
+                        }                       
+                    }
+
+                    if(workingDir.lastIndexOf("\\") != workingDir.length()-1) {
+                        workingDir = workingDir + "\\";
+                    }
+                    
+                    paramicsCommProp.setProperty(PROPERTIES.WORKING_DIR.name, workingDir);      
+                    paramicsCommProp.store(new FileOutputStream(propertiesFile), "");
+                } catch (IOException ioe) {
+                    paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", "Constructor", 
+                            "Exception in writing properties file.", ioe);
+                }
+                
+            }
+
+            workingDirectory = paramicsCommProp.getProperty(
+                    PROPERTIES.WORKING_DIR.name).trim();                    
+
+        } catch (Exception e) {
+            paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", "Constructor", 
+                    "Exception in reading properties file.", e);
+        }
+        
+        
+        try {
+            initializeSockets(Integer.parseInt(paramicsCommProp.getProperty(
+                    PROPERTIES.SOCKET_PORT.name).trim()));
+        }
+        catch (Exception e) {
+            paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", "Constructor", 
+                    "Exception in initializing sockets.", e);
+        }
+
+    }
+    
+    /**
+     * Transmits a message XML document object to the CAD Simulator.
+     *
+     * @param mess The ParamicsCommMessage to be transmitted.
+     */
+    private void write(Document mess) {
+        
+        synchronized(paramicsSocket) {
+            try {
+                out.writeObject(mess);
+                out.flush();
+            }
+            catch (Exception e) {
+                paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", "write", 
+                        "Exception in writing to the socket.", e);
+            }
+        }
+    }
+    
+    /**
+     * Observer/Observable update method.  The Paramics Communicator observers
+     * registered ParamicsReaders.  When messages are to be sent, they are sent
+     * through this method.  All messages are ParamicsCommMessage objects.  Send 
+     * these messages to the write() method for transmission on the socket.
+     */
+    public void update(Observable o, Object arg) {      
+
+        if(arg instanceof Document) {
+            write((Document)arg);               
+        }           
+    }
+    
+    /**
+     * Runnable method.  While this thread is not interrupted, read in an 
+     * object from the socket input stream.  If an object exists, call
+     * doMessage() to parse and perform the received action in the message.  
+     */
+    public void run() {
+        
+        while(true) {                       
+            try {
+                doMessage((Document)in.readObject());
+            } 
+            catch(SocketTimeoutException ste) {
+                //just try again
+            }   
+            catch(EOFException eofe) {
+                paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", 
+                        "run", "EOF Exception in reading data from the socket.", eofe);
+            }
+            catch(Exception e) {
+                paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", 
+                        "run", "Exception in reading data from the socket.", e);
+
+                JOptionPane.showMessageDialog(theGUI, 
+                        "Connection has been lost to the CAD Simulator.  " +
+                        "Paramics Communicator will now shutdown.", 
+                        "Dropped Connection", JOptionPane.ERROR_MESSAGE);
+                break;
+            }                   
+        }
+        
+        
+        try { in.close(); } catch (Exception e) {}
+        try { out.close(); } catch (Exception e) {}
+        try { serverSocket.close(); } catch (Exception e) {}
+        try { paramicsSocket.close(); } catch (Exception e) {}
+        
+    }
+    
+    /**
+     * Perform the action represented in the received XML document message.
+     * First determine if the action is from a READER, WRITER, and RESET.  
+     * If the paramics action is REGISTER, add a new ParamicsFileReader/Writer 
+     * to the local list of readers/writers and update the GUI with a 
+     * FileRegUpdate object. If the paramics action is UNREGISTER, remove the 
+     * ParamicsFileReader/Writer from the local list of readers/writers and update
+     * the GUI with a FileRegUpdate object.  If RESET is received, clear all 
+     * readers and writers. 
+     * 
+     * @param mess Received XML document message.
+     */
+    private void doMessage (Document mess) {
+        
+        Element rootElement = mess.getDocumentElement();
+
+        String id     = null;
+        String action = null;
+        
+        switch(PARAMICS_COMM_TAGS.fromString(rootElement.getNodeName())) {
+            case READER:
+                id     = rootElement.getAttribute(PARAMICS_COMM_TAGS.ID.tag);
+                action = rootElement.getAttribute(PARAMICS_COMM_TAGS.ACTION.tag);
+                
+                switch(PARAMICS_ACTIONS.fromString(action)) {
+                    case REGISTER:
+                        Integer interval   = Integer.parseInt(rootElement.getChildNodes().item(0).getTextContent());
+                        String  targetFile = rootElement.getChildNodes().item(1).getTextContent();
+                        
+                        readers.put(id, new ParamicsFileReader(workingDirectory, id, 
+                                interval, targetFile));
+                        readers.get(id).addObserver(this);
+                        readers.get(id).addObserver(theGUI);
+                        
+                        setChanged();
+                        notifyObservers(new FileRegUpdate(IO_TYPE.READ, 
+                                REG_TYPE.REGISTER, id, targetFile, interval));
+                        break;
+                    case UNREGISTER: 
+                        readers.get(id).deleteObserver(this);
+                        readers.get(id).deleteObserver(theGUI);
+                        readers.remove(id);
+
+                        setChanged();
+                        notifyObservers(new FileRegUpdate(IO_TYPE.READ, 
+                                REG_TYPE.UNREGISTER, id, null, null));                      
+                        break;
+                }
+                break;
+            case WRITER:
+                id     = rootElement.getAttribute(PARAMICS_COMM_TAGS.ID.tag);
+                action = rootElement.getAttribute(PARAMICS_COMM_TAGS.ACTION.tag);
+                
+                switch(PARAMICS_ACTIONS.fromString(action)) {
+                    case REGISTER:
+                        String targetFile = rootElement.getChildNodes().item(0).getTextContent(); 
+                        
+                        writers.put(id, new ParamicsFileWriter(id, 
+                                workingDirectory, targetFile));
+                        writers.get(id).addObserver(theGUI);
+                        
+                        setChanged();
+                        notifyObservers(new FileRegUpdate(IO_TYPE.WRITE, 
+                                REG_TYPE.REGISTER, id, targetFile, null));      
+                        break;
+                    case UNREGISTER: 
+                        writers.remove(id);
+                        
+                        writers.get(id).deleteObserver(theGUI);
+
+                        setChanged();
+                        notifyObservers(new FileRegUpdate(IO_TYPE.WRITE, 
+                                REG_TYPE.UNREGISTER, id, null, null));
+                        break;
+                    case WRITE_FILE:
+                        writers.get(id).writeMessage((Element)rootElement.getChildNodes().item(0));
+                        break;
+                }
+                break;
+            case RESET:
+                readers.clear();
+                writers.clear();
+                break;
+        }   
+    }
+    
+    /**
+     * Method waits to accept a socket connection from the CAD Simulator.  
+     * When a connection has been established the method exits.  The input and
+     * output streams are created on the new socket.
+     * 
+     * @param socketPort Socket port to use for establishing Socket communication.
+     * @throws IOException if there is an exception in establishing Socket communication.
+     */
+    private void initializeSockets(Integer socketPort) throws IOException {
+    
+        boolean waiting = true;
+        
+        try {
+            serverSocket = new ServerSocket(socketPort);            
+            //delay for accept timeout(milliseconds)        
+            serverSocket.setSoTimeout(10 * 1000);  
+        }
+        catch (IOException ioe) {
+            throw new IOException("Exception in creating " +
+                    "the server socket on port " + socketPort);
+        }
+        
+        while(waiting) {            
+            try{
+                paramicsSocket = serverSocket.accept();
+                waiting = false;
+            } 
+            catch(SocketTimeoutException ste) {
+                System.out.println("...waiting...");
+            }   
+            catch(IOException ioe) {
+                throw new IOException("Exception in creating " +
+                        "the receiving socket on port " + socketPort);
+            }
+        }
+
+        
+        //** out must be performed before in to unlock for connecting socket **//
+        try {       
+            out     = new ObjectOutputStream(paramicsSocket.getOutputStream());
+            in      = new ObjectInputStream(paramicsSocket.getInputStream());
+        }
+        catch (IOException ioe) {
+            throw new IOException("Exception in creating input " +
+                    "and output streams on socket.");
+        }
+            
+    }
+
+    /**
+     * Construct the ParamicsCommunicator with the properties file path, 
+     * either from the command line arguments or default.
+     * 
+     * @param args Command line arguments.
+     */
+    public static void main(String[] args) {
+
+        try
+        {
+            if(System.getProperty("PARAMICS_COMM_PROPERTIES") != null)
+            {
+                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+    
+                new Thread(new ParamicsCommunicator(System.getProperty(
+                        "PARAMICS_COMM_PROPERTIES"))).start();
+            }
+            else
+            {
+                throw new Exception ("PARAMICS_COMM_PROPERTIES system property not defined.");
+            }
+        } 
+        catch (Exception e) 
+        {
+            paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", "Main", 
+                    "Error occured initializing application", e);
+
+            JOptionPane.showMessageDialog(null, e.getMessage(), 
+                    "Error - Program Exiting", JOptionPane.ERROR_MESSAGE);  
+            
+            System.exit(-1);
+        }
+    
+        
+    }   
+    
+}
Index: trunk/src/tmcsim/paramicscommunicator/ParamicsFileReader.java
===================================================================
--- trunk/src/tmcsim/paramicscommunicator/ParamicsFileReader.java	(revision 2)
+++ trunk/src/tmcsim/paramicscommunicator/ParamicsFileReader.java	(revision 2)
@@ -0,0 +1,169 @@
+package tmcsim.paramicscommunicator;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Observable;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import tmcsim.common.CADProtocol.PARAMICS_ACTIONS;
+import tmcsim.common.CADProtocol.PARAMICS_COMM_TAGS;
+import tmcsim.paramicscommunicator.FileIOUpdate.IO_TYPE;
+
+
+/**
+ * The ParamicsFileReader handles reading fom a target file which
+ * is written to by Paramics.  Once initialized, a timer task is
+ * started which periodically checks the target file for updates.
+ * If the file has been modified, it is read and cleared.  The read
+ * data is transmitted to the CAD Simulator.
+ *
+ * @author Matthew Cechini
+ * @version
+ */
+public class ParamicsFileReader extends Observable {
+    
+    /** Error Logger. */
+    private Logger paramLogger = Logger.getLogger("tmcsim.paramicscommunicator");   
+    
+    /** FileReader ID used for creation of the ParamicsCommMessage */
+    private String readerID = null;
+    
+    /** File reference to the file where data is read. */
+    private File inputFile = null;
+    
+    /** FileReader used to read data from the input file. */
+    private FileReader fileReader = null;
+    
+    /** FileWriter used to clear the input file. */
+    private FileWriter fileWriter = null;
+    
+    /** Value (seconds since 1/1/1970) of input file's last modification time. */
+    private long lastModified = 0;
+    
+    /** Timer used to schedule file reading tasks. */
+    private Timer readerTimer = null;
+    
+    /** 
+     * Duration (in seconds) that the TimerTask will be scheduled to
+     * read from the target file.
+     */
+    private long readerInterval;
+    
+    /**
+     * A TimerTask to read from the target file.  If the file has been modified since
+     * last read, read the file and transmit the data to the CAD Simulator.
+     * @author Matthew Cechini
+     */
+    private class ReaderTimerTask extends TimerTask {
+        public void run() {     
+            
+            if (lastModified < inputFile.lastModified()) {
+                                
+                try {
+                    Document readerDoc = DocumentBuilderFactory.newInstance()
+                        .newDocumentBuilder().newDocument();
+            
+                    Element readerElem = readerDoc.createElement(PARAMICS_COMM_TAGS.READER.tag);
+                    readerElem.setAttribute(PARAMICS_COMM_TAGS.ID.tag, readerID);
+                    readerElem.setAttribute(PARAMICS_COMM_TAGS.ACTION.tag, 
+                            PARAMICS_ACTIONS.READ_FILE.action);
+                    
+                    Element messageElem = readerDoc.createElement(PARAMICS_COMM_TAGS.MESSAGE.tag);
+                    messageElem.appendChild(readerDoc.createTextNode(readFromFile()));
+                    readerElem.appendChild(messageElem);
+                    
+                    readerDoc.appendChild(readerElem);          
+                        
+                    setChanged();
+                    notifyObservers(readerDoc);
+                }                   
+                catch (Exception e) {
+                    paramLogger.logp(Level.SEVERE, 
+                            "ParamicsFileReader.ReaderTimerTask", "run()", 
+                            "Exception in reading from file: " + 
+                            inputFile.getName(), e);
+                }
+            }
+        }
+    }
+
+
+    /**
+     * Constructor.  Set the reader id and interval from the parsed
+     * ParamicsCommMessage.  The interval is found within the first three
+     * characters of the object's "message" data member.  Create a file
+     * object for the target file, and create a new file if it does
+     * not already exist.  Instantiate the timer and ReaderTimerTask
+     * to begin periodic reading of the file.
+     * 
+     * @param workingDir Target working directory.
+     * @param mess ParamicsCommMessage object containing registration data.
+     * @param theComm Reference to the ParamicsCommunicator.
+     */
+    public ParamicsFileReader(String workingDir, String id, Integer interval, String targetFile) {
+        
+        try {       
+            readerID       = id;
+            readerInterval = interval;
+                    
+            inputFile = new File(workingDir + targetFile);  
+                        
+            if(!inputFile.exists()) {
+                inputFile.createNewFile();
+            }
+            
+            readerTimer = new Timer();
+            readerTimer.scheduleAtFixedRate(new ReaderTimerTask(), 
+                0L, readerInterval * 1000); 
+            
+        } catch (IOException ioe) {
+            paramLogger.logp(Level.SEVERE, "ParamicsFileReader", 
+                    "Constructor()", "Exception in initializing file reading.", ioe);
+        }
+    }
+    
+    
+    /**
+     * Method opens the target file and reads all contents.  The file is then 
+     * cleared.
+     *
+     * @returns
+     * @throws IOException if there is an error in reading or writing to the file.
+     */
+    private String readFromFile() throws IOException {
+        
+        char[] input = new char[(int)inputFile.length()];
+        
+        fileReader = new FileReader(inputFile);
+        fileReader.read(input);     
+        fileReader.close();
+        
+        //make sure the new file has a modified time that is different
+        try {
+            Thread.sleep(1000);
+        }
+        catch (Exception e) {}
+        
+        //clear file after reading contents
+        fileWriter = new FileWriter(inputFile);
+        fileWriter.write("");
+        fileWriter.close();
+        
+        lastModified = inputFile.lastModified();
+        
+        setChanged();
+        notifyObservers(new FileIOUpdate(IO_TYPE.READ, readerID, (long)input.length));      
+                        
+        return new String(input);
+    }       
+}
Index: trunk/src/tmcsim/paramicscommunicator/gui/ParamicsCommunicatorGUI.java
===================================================================
--- trunk/src/tmcsim/paramicscommunicator/gui/ParamicsCommunicatorGUI.java	(revision 2)
+++ trunk/src/tmcsim/paramicscommunicator/gui/ParamicsCommunicatorGUI.java	(revision 2)
@@ -0,0 +1,239 @@
+package tmcsim.paramicscommunicator.gui;
+
+import java.awt.Dimension;
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.Observable;
+import java.util.Observer;
+import java.util.TreeMap;
+import java.util.logging.Handler;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import java.util.logging.Logger;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JFrame;
+import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
+import javax.swing.JTextArea;
+
+import tmcsim.paramicscommunicator.FileIOUpdate;
+import tmcsim.paramicscommunicator.FileRegUpdate;
+
+/**
+ * ParamicsCommunicatorGUI is the view class for the ParamicsCommunicator.
+ * The user interface shows a tab for each I/O reader or writer that has
+ * been registered with the ParamicsCommunicator.  The tab shows the 
+ * history of I/O reads and writes, and the unique information for the
+ * target file and I/O interval.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+@SuppressWarnings("serial")
+public class ParamicsCommunicatorGUI extends JFrame implements Observer {
+    
+    /**
+     * Logging handler that writes all received log records to the
+     * error text area.
+     * @author Matthew Cechini
+     */
+    protected class ParamicsLoggerHandler extends Handler {
+
+        DateFormat timeFormat = DateFormat.getTimeInstance();
+        
+        public void close() throws SecurityException {
+        }
+        
+        public void flush() {
+        }
+        
+        public void publish(LogRecord record) {
+            StringBuffer errorBuf = new StringBuffer();
+            
+            errorBuf.append(timeFormat.format(new Date(record.getMillis())));
+            errorBuf.append("  -  " + record.getMessage() + "\n");          
+            
+            errorTA.setText(errorTA.getText() + errorBuf.toString()); 
+        }       
+    }
+
+    /** Map of FileIOTableModel objects for each reader id. */
+    protected TreeMap<String, FileIOTableModel> readerTables;
+
+    /** Map of FileIOTableModel objects for each writer id. */
+    protected TreeMap<String, FileIOTableModel> writerTables;
+    
+    /**
+     * Constructor.  Initialize local lists, set up the logging handler and
+     * initialize the GUI.
+     */
+    public ParamicsCommunicatorGUI() {      
+        super("Paramics Communicator");
+        
+        readerTables = new TreeMap<String, FileIOTableModel>();
+        writerTables = new TreeMap<String, FileIOTableModel>();
+        
+        Logger.getLogger("tmcsim.paramicscommunicator").addHandler(new ParamicsLoggerHandler());
+        
+        initializeGUI();
+    }   
+    
+    /**
+     * Observer update method.  If the update object is a FileIOUpdate object,
+     * update the TableModel corresponding to the unique I/O id.  If the
+     * update object is a FileRegUpdate object, add a new tab if the 
+     * registration type is REGISTER, or update an existing tab if the
+     * registration type is UNREGISTER.
+     */
+    public void update(Observable o, Object arg) {
+        
+        if(arg instanceof FileIOUpdate) {
+
+            try {
+                FileIOUpdate update = (FileIOUpdate)arg;
+                
+                switch(update.ioType) {
+                    case READ:
+                        readerTables.get(update.ioID).addIOUpdate(update);
+                        break;
+                    case WRITE:
+                        writerTables.get(update.ioID).addIOUpdate(update);
+                        break;
+                }
+            }
+            catch (Exception e) {
+                Logger.getLogger("tmcsim.paramicscommunicator.gui").logp(
+                        Level.SEVERE, "ParamicsCommunicatorGUI", "update", 
+                        "Exception in receiving FileIOUpdate object.", e);
+            }
+        }
+        else if(arg instanceof FileRegUpdate) {
+            try {
+                FileRegUpdate update = (FileRegUpdate)arg;
+                
+                switch(update.ioType) {
+                    case READ:
+                        switch(update.regType) {
+                            case REGISTER:
+                                FileIOTableModel model = new FileIOTableModel();
+                                readerTables.put(update.ioID, model);
+    
+                                addTab(update, model);
+                                break;
+                            case UNREGISTER:
+                                //unregister
+                                break;
+                        }
+                        break;
+                    case WRITE:
+                        switch(update.regType) {
+                            case REGISTER:
+                                FileIOTableModel model = new FileIOTableModel();
+                                writerTables.put(update.ioID, model);
+                                
+                                addTab(update, model);
+                                break;
+                            case UNREGISTER:
+                                //unregister
+                                break;
+                        }                   
+                        break;
+                }
+
+            }
+            catch (Exception e) {
+                Logger.getLogger("tmcsim.paramicscommunicator.gui").logp(
+                        Level.SEVERE, "ParamicsCommunicatorGUI", "update", 
+                        "Exception in receiving FileRegUpdate object.", e);
+            }
+        }       
+    }
+    
+    private void initializeGUI() {
+        
+        /* Added by Nathaniel Lehrer */
+        this.setJMenuBar(new javax.swing.JMenuBar() {
+            {
+                javax.swing.JMenu fileMenu = new javax.swing.JMenu("File");
+                javax.swing.JMenuItem logItem = new javax.swing.JMenuItem("Show Log");
+                
+                logItem.addActionListener(new java.awt.event.ActionListener() {
+                    public void actionPerformed(java.awt.event.ActionEvent evt) {
+                        tmcsim.paramicslog.gui.ParamicsLogGUI.getInstance().display(); 
+                    }
+                });
+                
+                fileMenu.add(logItem);
+                this.add(fileMenu);
+            }
+        });
+        /* End Add by Nathaniel Lehrer */
+        
+        fileIOTabs = new JTabbedPane();
+        fileIOTabs.setAlignmentX(Box.CENTER_ALIGNMENT);
+        fileIOTabs.setMinimumSize(new Dimension(420, 480));
+        fileIOTabs.setPreferredSize(new Dimension(420, 480));
+        fileIOTabs.setMaximumSize(new Dimension(420, 480));
+        fileIOTabs.setBorder(BorderFactory.createCompoundBorder(
+                BorderFactory.createTitledBorder(
+                    BorderFactory.createRaisedBevelBorder(), "Registered I/O"),
+                    BorderFactory.createEmptyBorder(5,5,5,5)));
+    
+        errorTA = new JTextArea();
+        errorTA.setLineWrap(true);
+        
+        errorPane = new JScrollPane();
+        errorPane.setViewportView(errorTA);
+        errorPane.setAlignmentX(Box.CENTER_ALIGNMENT);
+        errorPane.setBorder(BorderFactory.createCompoundBorder(
+                BorderFactory.createTitledBorder(
+                    BorderFactory.createRaisedBevelBorder(), "Errors"),
+                    BorderFactory.createEmptyBorder(5,5,5,5)));
+        
+        
+        Box guiBox = new Box(BoxLayout.Y_AXIS);
+        guiBox.add(fileIOTabs);
+        guiBox.add(Box.createVerticalStrut(10));
+        guiBox.add(errorPane);
+        
+        add(guiBox);
+        
+        setMinimumSize(new Dimension(420, 680));
+        setPreferredSize(new Dimension(420, 680));
+        setResizable(false);
+        pack();
+        setVisible(true);
+    }
+    
+    /**
+     * Method creates a new tab for the new I/O object.  The tab is labeled
+     * "Reader #" or "Writer #", where '#' is the I/O object's ID.
+     * @param update Initial update object.
+     * @param model TableModel for reader/writer that will display I/O operations.
+     */
+    private void addTab(FileRegUpdate update, FileIOTableModel model) {
+        
+        String tabName = null;
+        
+        switch(update.ioType) {
+            case READ:
+                tabName = "Reader " + update.ioID;
+                break;
+            case WRITE:
+                tabName = "Writer " + update.ioID;
+                break;
+        }
+        
+        fileIOTabs.add(tabName, new ParamicsIOInfoPanel(update, model));
+    }
+    
+    private JTabbedPane fileIOTabs;
+
+    private JScrollPane errorPane;
+    
+    private JTextArea errorTA;
+
+}
Index: trunk/src/tmcsim/paramicscommunicator/gui/FileIOTableModel.java
===================================================================
--- trunk/src/tmcsim/paramicscommunicator/gui/FileIOTableModel.java	(revision 2)
+++ trunk/src/tmcsim/paramicscommunicator/gui/FileIOTableModel.java	(revision 2)
@@ -0,0 +1,172 @@
+package tmcsim.paramicscommunicator.gui;
+
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.swing.event.TableModelEvent;
+import javax.swing.table.DefaultTableModel;
+
+import tmcsim.paramicscommunicator.FileIOUpdate;
+
+/**
+ * FileIOTableModel is a DefaultTableModel used to display the 
+ * list of I/O operations that have been performed by a 
+ * Paramics FileWriter or FileReader. The columns in this table 
+ * show the I/O time and bytes written or read. 
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+@SuppressWarnings("serial")
+public class FileIOTableModel extends DefaultTableModel {
+
+    /**
+     * Enumeration of columns for this table.
+     * @author Matthew Cechini
+     */     
+    public static enum FILE_IO_COLUMNS {
+        TIME_COL       ("Time", 0, 100),
+        NUM_BYTES_COL  ("Num Bytes", 1, 60);
+        
+        public String colName;
+        public int colNum;
+        public int colWidth;
+        
+        private FILE_IO_COLUMNS (String name, int num, int width) {
+            colName  = name;
+            colNum   = num;
+            colWidth = width;
+        }
+        
+        public static int colCount() {
+            return values().length;
+        }
+        
+        public static String columnName(int num) {
+            
+            for(FILE_IO_COLUMNS column : FILE_IO_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colName;
+            }
+            
+            return "";
+        }
+        
+        public static int columnWidth(int num) {
+            
+            for(FILE_IO_COLUMNS column : FILE_IO_COLUMNS.values()) {
+                if(column.colNum == num)
+                    return column.colWidth;
+            }
+            
+            return 0;
+        }
+    }
+    
+    /** 
+     * Container class to hold information displayed in the table.
+     * @author Matthew Cechini
+     */     
+    protected class FileIOTableItem {
+        String  ioTime;
+        Long    ioBytes;
+        
+        public FileIOTableItem(String time, Long bytes) {
+            ioTime  = time;
+            ioBytes = bytes;
+        }
+    }
+    
+
+    /** List of data displayed in the table. */
+    protected List<FileIOTableItem> tableData;
+    
+    /** DateFormat used to format time table values. */
+    protected DateFormat timeFormatter;
+    
+    /** Constructor. */
+    public FileIOTableModel() {
+        tableData = new ArrayList<FileIOTableItem>();
+        
+        timeFormatter = DateFormat.getTimeInstance();
+    }   
+
+    /**
+     *  Gets the rowCount attribute of the RideTableModel object
+     *
+     *@return    The rowCount value
+     */
+    public int getRowCount() {
+        if(tableData == null)
+            return 0;
+        else
+            return tableData.size();
+    }
+
+
+
+    /**
+     *  Gets the columnCount attribute of the RideTableModel object
+     *
+     *@return    The columnCount value
+     */
+    public int getColumnCount() {
+        return FILE_IO_COLUMNS.colCount();
+    }
+
+
+
+    /**
+     *  Gets the valueAt attribute of the RideTableModel object
+     *
+     *@param  row  Description of the Parameter
+     *@param  col  Description of the Parameter
+     *@return      The valueAt value
+     */
+    public Object getValueAt(int row, int col) {
+        
+        if(col == FILE_IO_COLUMNS.TIME_COL.colNum)
+            return tableData.get(row).ioTime;
+        else if(col == FILE_IO_COLUMNS.NUM_BYTES_COL.colNum)
+            return tableData.get(row).ioBytes;
+        else
+            return "";
+    }
+
+
+    public String getColumnName(int col) {
+        return FILE_IO_COLUMNS.columnName(col);
+    }
+
+    public int getColumnWidth(int col){
+        return FILE_IO_COLUMNS.columnWidth(col);
+    }
+    
+    /**
+     *  Gets the cellEditable attribute of the RideTableModel object
+     *
+     *@param  row  Description of the Parameter
+     *@param  col  Description of the Parameter
+     *@return      The cellEditable value
+     */
+    public boolean isCellEditable(int row, int col) {
+        return false;
+    }
+
+    
+    /**
+     * Add a new IOUpdate into the table model. Update the table.
+     * @param update New update object.
+     */
+    public void addIOUpdate(FileIOUpdate update) {
+ 
+        tableData.add(new FileIOTableItem(timeFormatter.format(new Date()), 
+                update.ioBytes));
+        
+        fireTableChanged(new TableModelEvent(this));        
+    }
+    
+
+}
Index: trunk/src/tmcsim/paramicscommunicator/gui/ParamicsIOInfoPanel.java
===================================================================
--- trunk/src/tmcsim/paramicscommunicator/gui/ParamicsIOInfoPanel.java	(revision 2)
+++ trunk/src/tmcsim/paramicscommunicator/gui/ParamicsIOInfoPanel.java	(revision 2)
@@ -0,0 +1,122 @@
+package tmcsim.paramicscommunicator.gui;
+
+import java.awt.Dimension;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+
+import tmcsim.paramicscommunicator.FileRegUpdate;
+import tmcsim.paramicscommunicator.FileIOUpdate.IO_TYPE;
+import tmcsim.paramicscommunicator.FileRegUpdate.REG_TYPE;
+
+/**
+ * ParamicsIOInfoPanel is a JPanel used in the ParamicsCommunicatorGUI to 
+ * display registration and I/O operations performed for a specific 
+ * Paramics FileReader or FileWriter.
+ * 
+ * @author Matthew Cechini
+ * @version 
+ */
+@SuppressWarnings("serial")
+public class ParamicsIOInfoPanel extends JPanel {
+    
+    /**
+     * Constructor. Initialie the GUI elements for this panel.
+     * 
+     * @param update Initial FileRegUpdate object.
+     * @param tableModel TableModel to be displayed on panel.
+     */
+    public ParamicsIOInfoPanel(FileRegUpdate update, FileIOTableModel tableModel) {
+        
+        Box infoBox = new Box(BoxLayout.Y_AXIS);
+        infoBox.setAlignmentY(Box.CENTER_ALIGNMENT);
+        infoBox.add(Box.createVerticalGlue());
+
+        idLbl = new JLabel("ID:");
+        idLbl.setAlignmentX(Box.LEFT_ALIGNMENT);
+        idTF  = new JTextField(update.ioID);
+        idTF.setAlignmentX(Box.LEFT_ALIGNMENT);
+        idTF.setMinimumSize(new Dimension(150, 25));
+        idTF.setPreferredSize(new Dimension(150, 25));
+        idTF.setMaximumSize(new Dimension(200, 25));
+        idTF.setEditable(false);
+        infoBox.add(idLbl);
+        infoBox.add(idTF);
+        infoBox.add(Box.createVerticalStrut(5));
+        
+        targetFileLbl = new JLabel("Target File:");
+        targetFileLbl.setAlignmentX(Box.LEFT_ALIGNMENT);
+        targetFileTF  = new JTextField(update.targetFile);
+        targetFileTF.setAlignmentX(Box.LEFT_ALIGNMENT);
+        targetFileTF.setMinimumSize(new Dimension(150, 25));
+        targetFileTF.setPreferredSize(new Dimension(150, 25));
+        targetFileTF.setMaximumSize(new Dimension(200, 25));
+        targetFileTF.setEditable(false);
+        infoBox.add(targetFileLbl);
+        infoBox.add(targetFileTF);
+        
+        if(update.ioType == IO_TYPE.READ) {
+            intervalLbl = new JLabel("Interval: ");
+            intervalLbl.setAlignmentX(Box.LEFT_ALIGNMENT);
+            intervalTF  = new JTextField(String.valueOf(update.ioInterval));
+            intervalTF.setAlignmentX(Box.LEFT_ALIGNMENT);
+            intervalTF.setMinimumSize(new Dimension(150, 25));
+            intervalTF.setPreferredSize(new Dimension(150, 25));
+            intervalTF.setMaximumSize(new Dimension(200, 25));
+            intervalTF.setEditable(false);
+
+            infoBox.add(Box.createVerticalStrut(5));
+            infoBox.add(intervalLbl);
+            infoBox.add(intervalTF);
+        }
+        infoBox.add(Box.createVerticalGlue());
+        infoBox.setMinimumSize(new Dimension(150, 200));
+        infoBox.setPreferredSize(new Dimension(150, 200));
+        infoBox.setMaximumSize(new Dimension(200, 200));
+        infoBox.setBorder(BorderFactory.createCompoundBorder(
+                BorderFactory.createTitledBorder(
+                    BorderFactory.createRaisedBevelBorder(), "Information"),
+                    BorderFactory.createEmptyBorder(5,5,5,5)));
+        
+        ioUpdateTable = new JTable(tableModel);     
+        ioUpdateTable.getTableHeader().setReorderingAllowed(false);  
+        ioUpdatePane  = new JScrollPane();
+        ioUpdatePane.setMinimumSize(new Dimension(200, 400));
+        ioUpdatePane.setPreferredSize(new Dimension(200, 400));
+        ioUpdatePane.setMaximumSize(new Dimension(200, 400));
+        ioUpdatePane.setViewportView(ioUpdateTable);
+        ioUpdatePane.setAlignmentY(Box.CENTER_ALIGNMENT);
+        
+        Box panelBox = new Box(BoxLayout.X_AXIS);
+        panelBox.add(ioUpdatePane);
+        panelBox.add(Box.createHorizontalStrut(20));
+        panelBox.add(infoBox);
+        panelBox.add(Box.createHorizontalGlue());
+        
+        add(panelBox);
+    }
+    
+    
+    public IO_TYPE  ioType; 
+    public REG_TYPE regType;
+    public String   ioID;
+    public String   targetFile;
+    public Integer  ioInterval;
+    
+    private JLabel idLbl;
+    private JLabel targetFileLbl;
+    private JLabel intervalLbl;
+    
+    private JTextField idTF;
+    private JTextField targetFileTF;
+    private JTextField intervalTF;
+    
+    private JTable ioUpdateTable;
+    private JScrollPane ioUpdatePane;
+}
Index: trunk/src/tmcsim/paramicscommunicator/FileIOUpdate.java
===================================================================
--- trunk/src/tmcsim/paramicscommunicator/FileIOUpdate.java	(revision 2)
+++ trunk/src/tmcsim/paramicscommunicator/FileIOUpdate.java	(revision 2)
@@ -0,0 +1,40 @@
+package tmcsim.paramicscommunicator;
+
+/**
+ * FileIOUpdate is an update class used to record I/O operations 
+ * performed by FileReaders and FileWriters registered with the
+ * ParamicsCommunicator.
+ *  
+ * @author Matthew Cechini
+ * @version
+ */
+public class FileIOUpdate {
+
+    /**
+     * Enumeration of I/O action types.
+     * @author Matthew Cechini
+     */
+    public static enum IO_TYPE {READ, WRITE};
+    
+    /** Type of I/O performed. */
+    public IO_TYPE ioType;
+
+    /** ID of FileReader or FileWriter. */
+    public String  ioID;
+
+    /** Number of bytes written to or read from the target file. */
+    public Long    ioBytes;
+    
+    /**
+     * Constructor.
+     * 
+     * @param type I/O type.
+     * @param id   I/O object id.
+     * @param bytes Number of bytes for I/O action.
+     */
+    public FileIOUpdate(IO_TYPE type, String id, Long bytes) {
+        ioType       = type;
+        ioID         = id;
+        ioBytes      = bytes;
+    }
+}
Index: trunk/src/tmcsim/paramicscommunicator/ParamicsFileWriter.java
===================================================================
--- trunk/src/tmcsim/paramicscommunicator/ParamicsFileWriter.java	(revision 2)
+++ trunk/src/tmcsim/paramicscommunicator/ParamicsFileWriter.java	(revision 2)
@@ -0,0 +1,223 @@
+package tmcsim.paramicscommunicator;
+
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.Observable;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.xml.serialize.OutputFormat;
+import org.apache.xml.serialize.XMLSerializer;
+import org.w3c.dom.Element;
+
+import tmcsim.paramicscommunicator.FileIOUpdate.IO_TYPE;
+
+/**
+ * The ParamicsFileWriter handles writing messages to a target file which
+ * is read by Paramics.  Messages are received through the writeMessage() method.
+ * This object handles queueing messages and writing as the file becomes
+ * available.  New data is written to the target file when it has been
+ * modified (cleared) by Paramics.  If this does not happen, messages
+ * are queued and a timer is used to periodically determine if the
+ * file has become available for writing.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public class ParamicsFileWriter extends Observable {
+    
+    /** 
+     * Duration (in  ms) that the TimerTask will be scheduled to
+     * retry writing to the target file. Default = 2000ms
+     */
+    private static long TIMER_DURATION = 2000;
+    
+    /** Error Logger. */
+    private Logger paramLogger = Logger.getLogger("tmcsim.paramicscommunicator");
+    
+    /** Linked List of messages that have been received */
+    private LinkedList<Element> queuedMessages = null;
+    
+    /**  */
+    private String writerID = null;
+
+    /** File name of the file where data is written */
+    private String outputFile = null;
+    
+    /** FileWriter used to write data to the output file. */
+    private FileWriter fileWriter = null;
+    
+    /** Value (seconds since 1/1/1970) of output file's last modifcation time */
+    private long lastModified = 0;  
+    
+    /** Timer used to schedule file writing tasks. */
+    private Timer writerTimer = null;
+    
+    /**
+     * A TimerTask to retry writing messages that have been queued within this
+     * ParamicsWriter.  If a message has been queued, see if the target file
+     * has been modified since last write.  If so, write the first queued message
+     * to the file and remove the message from the queue.  If writing is unsuccessful,
+     * do not remove the message from the queue.  If there are no more messages in 
+     * the queue, cancel this timer.
+     */
+    private class WriterTimerTask extends TimerTask {
+        public void run() {
+
+            synchronized(lock) {
+            
+                //if we've queued something, continue.
+                if(queuedMessages.size() > 0) {         
+                    
+                    //if file has been modified, write to it
+                    if(lastModified < new File(outputFile).lastModified())
+                    {       
+                        try {
+                            writeToFile(queuedMessages.getFirst());
+                            queuedMessages.remove(0);
+                        }
+                        catch (IOException ioe) {
+                            paramLogger.logp(Level.SEVERE, "ParamicsFileWriter.WriterTimerTask", 
+                                    "run()", "Exception in writing to the target file: " + 
+                                    outputFile + ".  Queue size = " + queuedMessages.size(), ioe);
+                        }
+                        
+                        //all queued messages gone, cancel timer
+                        if(queuedMessages.size() == 0)
+                            this.cancel();
+                    }   
+                }
+            }               
+        }
+    }
+    
+    /** Synchronizing lock to protect File IO and message queuing. */
+    private Object lock = null;     
+    
+    /**
+     * Constructor.  Initialize data objects.  If the target file exists, delete 
+     * it, and then create a new file.  
+     *
+     * @param workingDir Directory path where the output file is to be written
+     * @param mess The ParamicsCommMessage containing the outputFile filename.
+     */
+    public ParamicsFileWriter(String id, String workingDir, String targetFile) {
+
+        try {
+            writerID = id;
+    
+            queuedMessages  = new LinkedList<Element>();    
+            lock            = new Object();
+                        
+            outputFile      = workingDir + targetFile;  
+            
+            File tempFile = new File(outputFile);           
+            if(tempFile.exists()) {
+                tempFile.delete();
+            }
+
+            tempFile.createNewFile();           
+                                                
+            writerTimer     = new Timer();
+            
+        } catch (IOException ioe) {
+            paramLogger.logp(Level.SEVERE, "ParamicsFileWriter", "Constructor", 
+                    "Unable to create Paramics File Writer.", ioe);
+        }
+        
+    }
+    
+    
+    /**
+     * Method is called when a message has been received from the CAD Simulator.
+     * If the message queue is not empty, add the new message to the queue.
+     * If the output file has not been modified (read) since last write,
+     * add the message to the queue and set a timer to repeatedly check for 
+     * modification to the output file.  Else, write the new message to the file.  
+     * If there is an error in writing the data, queue the message start a timer
+     * to retry the writing.
+     *
+     * @param newMessage The received message which is to be written to 
+     * the output file.
+     */
+    public void writeMessage(Element messageElem) {
+        
+        synchronized(lock) {
+            
+            //messages already queued... get in line.           
+            if(queuedMessages.size() > 0) {
+                queuedMessages.add(messageElem);
+
+                paramLogger.log(Level.INFO, "Queueing message, new queue " +
+                        "size = " + queuedMessages.size());
+            }               
+            //No modification since last write. (first queue)               
+            else if (lastModified >= new File(outputFile).lastModified()) {
+                queuedMessages.add(messageElem);                
+                                
+                writerTimer.scheduleAtFixedRate(new WriterTimerTask(), 
+                        0L, TIMER_DURATION);
+
+                paramLogger.log(Level.INFO, "First message queued");
+            }           
+            //free and clear, write.
+            else {
+                try {
+                    writeToFile(messageElem);
+                }
+                catch(IOException ioe) {
+                    paramLogger.logp(Level.SEVERE, "ParamicsFileWriter", 
+                            "writeMessage()", "Exception in writing to the " +
+                            "target file: " + outputFile, ioe);
+                    
+                    queuedMessages.add(messageElem);
+                    
+                    writerTimer.scheduleAtFixedRate(new WriterTimerTask(), 
+                            0L, TIMER_DURATION);
+                }
+            }
+        }
+    }
+        
+    /**
+     * Method writes data to the output file.
+     * 
+     * @param output Data to be written to the file.
+     */
+    private void writeToFile(Element output) throws IOException {       
+        
+        fileWriter = new FileWriter(outputFile);
+        
+        OutputFormat of = new OutputFormat("XML","ISO-8859-1",true);
+        of.setIndent(1);
+        of.setIndenting(true);
+        
+        XMLSerializer serializer = new XMLSerializer(fileWriter, of);
+        serializer.asDOMSerializer();
+        serializer.serialize(output);
+
+        /** Added by Nathaniel Lehrer */
+        try {
+            java.io.ByteArrayOutputStream outputStream = new java.io.ByteArrayOutputStream();
+            new XMLSerializer(outputStream, of).serialize(output);
+            tmcsim.paramicslog.ParamicsLog.getInstance().writeToLog(outputStream.toString());
+        } catch(Exception e) {
+            System.out.println(e);
+        }
+        /** End Add by Nathaniel Lehrer */
+        
+        fileWriter.flush();
+        fileWriter.close();
+        
+        lastModified = new File(outputFile).lastModified();     
+        
+        setChanged();
+        notifyObservers(new FileIOUpdate(IO_TYPE.WRITE, writerID, new File(outputFile).length()));
+                            
+    }               
+}
Index: trunk/src/tmcsim/paramicslog/ParamicsLog.java
===================================================================
--- trunk/src/tmcsim/paramicslog/ParamicsLog.java	(revision 2)
+++ trunk/src/tmcsim/paramicslog/ParamicsLog.java	(revision 2)
@@ -0,0 +1,331 @@
+package tmcsim.paramicslog;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.rmi.Naming;
+import java.util.Observable;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.JOptionPane;
+
+import org.w3c.dom.Element;
+
+import tmcsim.common.SimulationException;
+import tmcsim.interfaces.CoordinatorInterface;
+import tmcsim.paramicslog.gui.ParamicsLogGUI;
+
+/**
+ * Logs communication from ParamicsCommunicator to ParamicsSimulator.
+ * 
+ * The system property "PARAMICS_LOG_CONFIG" should be set to the path
+ * where the properties file for this class is located. <br><br>
+ * The data for the properties file follows. <br>
+ * <code>
+ * -----------------------------------------------------------------<br>
+ * Log File                The file to write the communication to.
+ * CAD Simulator Host      The host that runs the CAD Simulator.
+ * CAD Simulator RMI Port  The port on the host that runs the CAD 
+ *                         Simulator where the RMI Coordinator
+ *                         object is registered to. 
+ * -----------------------------------------------------------------<br>
+ * Example File: <br>
+ * LogFile=c:\\log.txt
+ * CADSimulatorHost=localhost
+ * CADSimulatorRMIPort=4445
+ * -----------------------------------------------------------------<br>
+ * </code>
+ * 
+ * @author Nathaniel Lehrer
+ * @version 
+ */
+public class ParamicsLog extends Observable 
+{   
+    /**
+     * Enmeration containing property names.
+     * @author Nathaniel Lehrer
+     */
+    private enum PROPERTIES 
+    {
+        LOG_FILE      ("LogFile"),
+        CAD_SIM_HOST  ("CADSimulatorHost"),
+        CAD_SIM_PORT  ("CADSimulatorRMIPort");
+        
+        public String name;
+        
+        private PROPERTIES(String n)
+        {
+            name = n;
+        }
+    }
+    
+    /** Error logger. */
+    private static Logger paramLogger = Logger.getLogger("tmcsim.paramicslog");
+    
+    /** Static instance. */
+    private static ParamicsLog instance;
+    
+    /** Properties object. */
+    private Properties paramicsLogProp;
+    
+    /** File log entries are written to */
+    private File logFile;
+    
+    /** Stores the log entries. This contains the same information logFile. */
+    private StringBuilder log;
+
+    /** Remote reference to the simulation */
+    private CoordinatorInterface theCoorInt;
+    
+    /** Object for synchronizing IO */
+    Object lock;
+    
+    /**
+     * Creates the singleton instance of this class.
+     */
+    static
+    {
+        try 
+        {
+            if (System.getProperty("PARAMICS_LOG_PROPERTIES") != null)
+            {
+                instance = new ParamicsLog(System.getProperty("PARAMICS_LOG_PROPERTIES"));
+            }
+            else
+            {
+                throw new Exception("PARAMICS_LOG_PROPERTIES system property not defined.");
+            }
+        } 
+        catch (Exception e) 
+        {
+            instance = new ParamicsLog();
+            
+            paramLogger.logp(Level.WARNING, "ParamicsLog", "static initializer", 
+                    "Error occured initializing application", e);
+
+            JOptionPane.showMessageDialog(null, e.getMessage(), 
+                    "Error - ParamicsLog will not save log to file.", 
+                    JOptionPane.ERROR_MESSAGE); 
+        }
+        
+        instance.addObserver(ParamicsLogGUI.getInstance());
+    }
+    
+    /**
+     * Creates an instance of ParamicsLog that does not write to a file when 
+     * writeToLog is called.
+     */
+    private ParamicsLog() {
+        
+        lock = new Object();
+        log = new StringBuilder("");
+    }
+    
+    /**
+     * Creates an instance of ParamicsLog that writes to a file when writeToLog is called.
+     * @param propertiesFile
+     */
+    private ParamicsLog(String propertiesFile) {
+        this();
+        
+        String logFile = null;
+        String CADSIMHost = null;
+        String CADSIMPort = null;
+        
+        try {
+            paramicsLogProp = new Properties();
+            paramicsLogProp.load(new FileInputStream(propertiesFile));
+            
+            if ((logFile = paramicsLogProp.getProperty(PROPERTIES.LOG_FILE.name)) == null)
+            {
+                throw new Exception("Properties file missing log file location.");
+            }
+            else if ((CADSIMHost = paramicsLogProp.getProperty(PROPERTIES.CAD_SIM_HOST.name)) == null)
+            {   
+                throw new Exception("Properties file missing CAD Simulator host.");
+            }
+            else if ((CADSIMPort = paramicsLogProp.getProperty(PROPERTIES.CAD_SIM_PORT.name)) == null)
+            {
+                throw new Exception("Properties file missing CAD Simulator RMI port.");
+            }
+            
+            try
+            {
+                connect(CADSIMHost, CADSIMPort);
+            }
+            catch (Exception e)
+            {
+                JOptionPane.showMessageDialog(null, 
+                        "ParamicsLog: Could not connect to remote Coordinator object.", 
+                        "Network Error", JOptionPane.ERROR_MESSAGE);                
+            }
+            
+            try 
+            {
+                createLogFile(logFile);
+            }
+            catch (Exception e)
+            {
+                JOptionPane.showMessageDialog(null, 
+                        "ParamicsLog: Could not create new log file.", 
+                        "File Error", JOptionPane.ERROR_MESSAGE);
+            }
+            
+        } catch (Exception e) {
+            
+            paramLogger.logp(Level.WARNING, "ParamicsLog", "ParamicsLog constructor", 
+                    "Properties file incorrect or missing.", e);
+            
+            JOptionPane.showMessageDialog(null, 
+                    "ParamicsLog: Properties file invalid.", 
+                    "Invalid Configuration", JOptionPane.ERROR_MESSAGE);
+        }
+    }
+    
+    /**
+     * Creates the log file.
+     * @param filePath The path to the file including the file name.
+     * @throws IOException If the log file could not be created.
+     */
+    private void createLogFile(String filePath) throws IOException
+    {
+        try {
+            logFile = new File(filePath);
+            
+            if (logFile.exists()) {
+                logFile.delete();
+            }
+            
+            logFile.createNewFile();
+            
+        } catch (Exception e) {
+            
+            logFile = null;
+            
+            paramLogger.logp(Level.WARNING, "ParamicsLog", "ParamicsLog constructor", 
+                    "Could not create new log file.", e);
+            
+            throw new IOException("Could not create log file.");
+        }               
+    }
+    
+    /**
+     * Connect to the Coordinator's RMI object.
+     * @param hostname Host name of the CAD Simulator.    
+     * @param portNumber Port number of the CAD Simulator RMI communication. 
+     * @throws SimulationException if there is an error creating the RMI connection.
+     */ 
+    private void connect(String hostname, String portNumber) 
+        throws SimulationException {
+        
+        String coorIntURL = "";
+        
+        try {  
+            coorIntURL = "rmi://" + hostname + ":" + portNumber + "/coordinator"; 
+            
+            theCoorInt = (CoordinatorInterface)Naming.lookup(coorIntURL);           
+        }
+        catch (Exception e) 
+        {
+            paramLogger.logp(Level.WARNING, "ParamicsLog", 
+                    "establishRMIConnection", "Unable to establish RMI " +
+                    "communication with the CAD Simulator.  URL <" + coorIntURL + ">", e);
+        }   
+    }
+    
+    /**
+     * Accessor to the entries in the log. No file IO is used.
+     * @return The entries in the log.
+     */
+    public String getLog() {
+        
+        return log.toString();
+    }
+    
+    /**
+     * Writes an entry to the log. 
+     * The simulator time when the message was sent is prepended to the entry.
+     * Entries are padded by a blank line before and after them.
+     * TODO: Ensure output is written in order of request.
+     * @param entry
+     */
+    public void writeToLog(String entry) {
+        
+        String time = "?";
+        String formattedEntry;
+        
+        if (theCoorInt != null)
+        {
+            try
+            {
+                time = formatTime(theCoorInt.getCurrentSimulationTime());
+            }
+            catch (Exception e)
+            {
+                paramLogger.logp(Level.WARNING, "ParamicsLog", 
+                        "RMICommunication", "Unable to communicate with RMI object", e);
+            }
+        }
+        
+        formattedEntry = "\n" + "<!-- Time written to file: " + time + " -->\n" + entry + "\n";
+        log.append(formattedEntry);
+        
+        if (logFile != null)
+        {
+            try 
+            {
+                synchronized(lock)
+                {
+                    FileWriter writer = new FileWriter(logFile, true);
+                    writer.append(formattedEntry);
+                    writer.flush();
+                    writer.close();
+                }
+            } 
+            catch (IOException e) 
+            {
+                paramLogger.logp(Level.WARNING, "ParamicsLog", "writeToLog", 
+                        "Could not write to log file.", e);
+            }
+        }
+        
+        setChanged();
+        notifyObservers(entry);
+    }
+    
+    /**
+     * Formats the time given in seconds to hh:mm:ss format.
+     * @param time The time in seconds.
+     */
+    private String formatTime(long time)
+    {
+        long seconds = time % 60;
+        long minutes = (time - seconds) / 60;
+        long hours = (time - seconds - minutes * 60) / 60;
+
+        return padr(hours) + ":" + padr(minutes) + ":" + padr(seconds);
+    }
+    
+    private String padr(long n)
+    {
+        if (n < 10)
+        {
+            return "0" + n;
+        }
+        {
+            return "" + n;
+        }
+    }
+    
+    /**
+     * Accessor for static instance of this class.
+     * @return The instance of this class.
+     */
+    public static ParamicsLog getInstance() {
+        
+        return instance;
+    }
+}
Index: trunk/src/tmcsim/paramicslog/gui/ParamicsLogGUI.java
===================================================================
--- trunk/src/tmcsim/paramicslog/gui/ParamicsLogGUI.java	(revision 2)
+++ trunk/src/tmcsim/paramicslog/gui/ParamicsLogGUI.java	(revision 2)
@@ -0,0 +1,87 @@
+package tmcsim.paramicslog.gui;
+
+import javax.swing.*;
+import java.awt.event.WindowEvent;
+import java.util.*;
+
+/**
+ * The UI for ParamicsLog. 
+ * @author Nathaniel Lehrer
+ * @version
+ */
+public class ParamicsLogGUI extends JFrame implements Observer {
+
+    /** The static instance */
+    private static ParamicsLogGUI instance = new ParamicsLogGUI();
+
+    /** The text area to display the log in */
+    private JTextArea textArea;
+    
+    /** Creates an instance of this class */
+    public ParamicsLogGUI() {
+        
+        setupGUI();
+    }
+    
+    /** Creates the UI */
+    private void setupGUI()
+    {
+        try {
+            UIManager.setLookAndFeel(
+                UIManager.getSystemLookAndFeelClassName());
+        } catch (Exception e) {
+            System.err.println("Couldn't use system look and feel.");
+        }
+        
+        this.addWindowListener(new java.awt.event.WindowAdapter() {
+            
+            public void windowClosing(WindowEvent e)
+            {
+                setVisible(false);
+            }
+        });
+        
+        
+        setTitle("Paramics Log");
+        
+        textArea = new JTextArea();
+        textArea.setColumns(60);
+        textArea.setRows(30);
+        JScrollPane scrollPane = new JScrollPane(textArea);
+        
+        getContentPane().add(scrollPane);
+        
+    }
+    
+    /** Shows the UI window */
+    public void display()
+    {
+        pack();
+        setVisible(true);
+    }
+
+    /**
+     * Updates the text area. If the observable class given is of type ParamicsLog then
+     * the log entries are displayed.
+     * @param o The model for this viewer.
+     * @param arg An argument that is not used.
+     */
+    public void update(Observable o, Object arg)
+    {
+        if (o instanceof tmcsim.paramicslog.ParamicsLog)
+        {
+            textArea.setText(((tmcsim.paramicslog.ParamicsLog) o).getLog());
+        } 
+
+        repaint();
+    }
+    
+    /**
+     * Accessor for the instance of ParamicsLogGUI.
+     * @return The instance of ParamicsLogGUI.
+     */
+    public static ParamicsLogGUI getInstance() {
+        return instance;
+    }
+    
+}
Index: trunk/src/tmcsim/interfaces/SimulationManagerInterface.java
===================================================================
--- trunk/src/tmcsim/interfaces/SimulationManagerInterface.java	(revision 2)
+++ trunk/src/tmcsim/interfaces/SimulationManagerInterface.java	(revision 2)
@@ -0,0 +1,92 @@
+package tmcsim.interfaces;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+import tmcsim.client.cadclientgui.data.Incident;
+import tmcsim.client.cadclientgui.data.IncidentEvent;
+import tmcsim.common.CADEnums.PARAMICS_STATUS;
+import tmcsim.common.CADEnums.SCRIPT_STATUS;
+
+
+/**
+ * RMI Interface providing methods for the SimulationManager to be updated
+ * with current simulation data.  The Simulation Manager is notified
+ * when the simulation time changes, new Incidents and IncidentEvents
+ * occur, new Incidents are added to the simulation, and when the Script 
+ * and Paramics connection statuses change.
+ *
+ * @author Matthew Cechini
+ * @version $Revision: 1.3 $ $Date: 2006/06/06 20:46:41 $
+ */
+public interface SimulationManagerInterface extends Remote {
+
+    /**
+     * Notifies the SimulationManager when current simulation time changes.
+     *
+     * @param theTime The value (in seconds) of the current simulation time.
+     * @throws RemoteException if there is an error in the RMI communication.
+     */
+    public void tick(long theTime) throws RemoteException;
+    
+    /**
+     * Notifies the SimulationManager that a new IncidentEvent has occured for
+     * a current Incident.  
+     *
+     * @param logNumber The current log number being updated.
+     * @param theEvent The most recently occured incident event.
+     * @throws RemoteException if there is an error in the RMI communication
+     */
+    public void eventOccured(Integer logNumber, IncidentEvent theEvent) throws RemoteException;
+
+    /**
+     * Notifies the SimulationManager that an Incident has been added to the 
+     * simulation.
+     * 
+     * @param newIncident Incident that has been added.
+     * @throws RemoteException if there is an error in the RMI communication
+     */
+    public void incidentAdded(Incident newIncident) throws RemoteException;
+
+    /**
+     * Notifies the SimulationManager that an incident has begun.  This will
+     * occur if the user triggers an incident, or the incident occurs according
+     * to its assigned simulation time.  
+     * 
+     * @param logNumber The log number of the Incident that has started.
+     * @throws RemoteException if there is an error in the RMI communication
+     */
+    public void incidentStarted(Integer logNumber) throws RemoteException;
+    
+    /**
+     * Notifies the SimulationManager that an incident has been removed
+     * from the simulation.
+     * 
+     * @param logNumber The log number of the Incident that has been removed.
+     * @throws RemoteException if there is an error in the RMI communication
+     */ 
+    public void incidentRemoved(Integer logNumber) throws RemoteException;
+
+    /**
+     * Notifies the SimulationManager that the current status of the Script
+     * has changed.  Possible status values are determined in the SCRIPT_STATUS 
+     * enumeration.  
+     * 
+     * @see SCRIPT_STATUS
+     * @param newStatus Updated SCRIPT_STATUS.
+     * @throws RemoteException if there is an error in the RMI communication
+     */
+    public void setScriptStatus(SCRIPT_STATUS newStatus) throws RemoteException;
+
+    /**
+     * Notifies the SimulationManager that the current status of the Paramics
+     * connection has changed.  Possible status values are determined in the
+     * PARAMICS_STATUS enumeration.  
+     * 
+     * @see PARAMICS_STATUS
+     * @param newStatus Updated PARAMICS_STATUS.
+     * @throws RemoteException if there is an error in the RMI communication
+     */
+    public void setParamicsStatus(PARAMICS_STATUS newStatus) throws RemoteException;
+
+}
Index: trunk/src/tmcsim/interfaces/ParamicsControlInterface.java
===================================================================
--- trunk/src/tmcsim/interfaces/ParamicsControlInterface.java	(revision 2)
+++ trunk/src/tmcsim/interfaces/ParamicsControlInterface.java	(revision 2)
@@ -0,0 +1,45 @@
+package tmcsim.interfaces;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+import tmcsim.common.SimulationException;
+
+/**
+ * RMI interface to provide methods to control the Paramics connection.
+ * Provided functionality allows the connection to the remote Paramics
+ * Communicator to be established and dropped.  Also, the 
+ * loadParamicsNetwork() method sends a command to Paramics to begin
+ * loading a traffic network.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public interface ParamicsControlInterface extends Remote {
+
+    /**
+     *Establishes a connection to the remote Paramics Communicator.
+     *
+     * @throws RemoteException if there is an error in the RMI communication.
+     */
+    public void connectToParamics() throws RemoteException;
+
+
+    /**
+     * Drops the connection to the remote Paramics Communicator.
+     *
+     * @throws RemoteException if there is an error in the RMI communication.
+     */
+    public void disconnectFromParamics() throws RemoteException;
+
+
+    /**
+     * Sends a command to Paramics to begin loading a traffic network.
+     *
+     * @param networkID The unique indentifier for the network load request.
+     * @throws RemoteException if there is an error in the RMI communication.
+     * @throws SimulationException if there is an error loading the Paramics network.
+     */
+    public void loadParamicsNetwork(int networkID) throws RemoteException, SimulationException;
+    
+}
Index: trunk/src/tmcsim/interfaces/CoordinatorInterface.java
===================================================================
--- trunk/src/tmcsim/interfaces/CoordinatorInterface.java	(revision 2)
+++ trunk/src/tmcsim/interfaces/CoordinatorInterface.java	(revision 2)
@@ -0,0 +1,18 @@
+package tmcsim.interfaces;
+
+import java.rmi.Remote;
+
+import tmcsim.client.cadclientgui.data.CADData;
+
+/**
+ * The CoordinatorInterface extends from all interfaces that the
+ * Coordinator implements in order to provide remote method functionality.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public interface CoordinatorInterface extends SimulationControlInterface, 
+    SimulationStatusInterface, ParamicsControlInterface, CADInterface, Remote {
+
+
+}
Index: trunk/src/tmcsim/interfaces/SimulationControlInterface.java
===================================================================
--- trunk/src/tmcsim/interfaces/SimulationControlInterface.java	(revision 2)
+++ trunk/src/tmcsim/interfaces/SimulationControlInterface.java	(revision 2)
@@ -0,0 +1,144 @@
+package tmcsim.interfaces;
+
+import java.io.File;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+import tmcsim.cadmodels.CMSInfo;
+import tmcsim.client.cadclientgui.data.Incident;
+import tmcsim.common.ScriptException;
+
+/**
+ * RMI Interface providing methods for control of the simulation data.  
+ * This interface allows for registration of a remote SimulationManager.
+ * This object is notified of simulation information as the simulation
+ * runs.  Simulation control functionality includes starting, pausing, 
+ * resetting, and moving the repositioning the simulation.  The
+ * SimulationControlInterface also provides methods to load a new 
+ * script into the simulation, manually trigger incidents, delete
+ * current incidents, reschedule current incidents, and add new
+ * incidents.  The final control functionality allows new diversions
+ * to be applied to the simulation. 
+ *  
+ * @author Matthew Cechini
+ * @version
+ */
+public interface SimulationControlInterface extends Remote {
+
+    /**
+     * Registers a remote SimulationManager for callback.  Only one 
+     * SimulationManager can be connected at a time. The last one to 
+     * connect will be referenced in the callback RMI.
+     *
+     * @param simManInt Interface to the SimulationManager for callback RMI
+     * @throws RemoteException if there is an error in the RMI communication.
+     */
+    public void registerForCallback(SimulationManagerInterface simManInt)
+        throws RemoteException;
+
+    /**
+     * Unregisters a remote SimulationManager from callback.  The coordinator
+     * will cease calling that SimulationManager with the updated simulation data.
+     *
+     * @param simManInt Interface to the SimulationManager for callback RMI
+     * @throws RemoteException if there is an error in the RMI communication.
+     */
+    public void unregisterForCallback(SimulationManagerInterface simManInt)
+        throws RemoteException;
+    
+    /**
+     * Starts the simualation.  Simulation time begins.
+     *
+     * @throws RemoteException if there is an error in the RMI communication.
+     * @throws ScriptException if a script has not been loaded.
+     */
+    public void startSimulation() throws RemoteException, ScriptException;
+
+    /**
+     * Pauses the simulation.  Simulation time is suspended.
+     *
+     * @throws RemoteException if error occurs in RMI
+     */
+    public void pauseSimulation() throws RemoteException;
+
+    /**
+     * Reset the simulation.  Counters are reset and local lists
+     * of simulation objects are cleared.
+     *
+     * throws RemoteException if error occurs in RMI
+     */
+    public void resetSimulation() throws RemoteException;
+
+    /**
+     * Reposition the simulation to a new time mark.  After repositioning,
+     * all incidents and events will exist in the simulation data.
+     * 
+     * @param time The number of seconds to 'fast-forward' the simulation to.
+     * @throws RemoteException
+     */
+    public void gotoSimulationTime(long time) throws RemoteException;
+    
+    /**
+     * Loads a new script into the simulation.  Any existing script data
+     * is replaced by the new script data.
+     *
+     * @param scriptFile The script file to read into the coordinator
+     *
+     * @throws RemoteException if there is a problem in the RMI communication
+     * @throws ScriptException if there is an error in reading the script file
+     */
+    public void loadScriptFile(File scriptFile) throws RemoteException, ScriptException;
+    
+    /**
+     * Manually triggers an incident that has not yet occured in the simulation.
+     * 
+     * @param incidentNumber Integer value of the incident number that is to be
+     * manually triggered.
+     *
+     * @throws RemoteException if there is an error in the RMI communication.
+     * @throws ScriptException if the simulation has not been started, or if a
+     * script has not been loaded.
+     */
+    public void triggerIncident(Integer incidentNumber) throws RemoteException, ScriptException;
+
+    /**
+     * Deletes an incident that has not yet occured from the simulation.
+     *
+     * @param incidentNumber Integer value of the incident number that is to be manually triggered.
+     *
+     * @throws RemoteException if there is an error in the RMI communication.
+     * @throws ScriptException if the incident that is being deleted has already occurred.
+     */
+    public void deleteIncident(Integer incidentNumber) throws RemoteException, ScriptException;
+
+    /**
+     * Reschedule an incident that has not yet occured in the simulation.
+     *
+     * @param incidentNumber Integer value of the incident number that is to be rescheduled.
+     * @param newTime Value (in seconds) of the new time the incident is to be scheduled for.
+     *
+     * @throws RemoteException if there is an error in the RMI communication.
+     * @throws ScriptException if the new time for this incident has already passed in the simulation
+     */
+    public void rescheduleIncident(Integer incidentNumber, long newTime)
+        throws RemoteException, ScriptException;
+
+    /**
+     * Add a new incident into the current simulation.
+     *
+     * @param newIncident Incident that is to be added to the simulation.
+     * @throws RemoteException if there is an error in the RMI communication.
+     */
+    public void addIncident(Incident newIncident) throws RemoteException;
+
+    /**
+     * Applies a new set of diversions for a specific CMS.  The new CMSInfo
+     * object is passed on to the CMSDiversionDB and updated information sent
+     * to the Paramics Communicator.
+     *
+     * @param theDiversion The CMSDiversion object containing the diversion information for a CMS.
+     * @throws RemoteException if there is an error in the RMI communication
+     */
+    public void applyDiversions(CMSInfo theDiversion) throws RemoteException;
+    
+}
Index: trunk/src/tmcsim/interfaces/CADClientInterface.java
===================================================================
--- trunk/src/tmcsim/interfaces/CADClientInterface.java	(revision 2)
+++ trunk/src/tmcsim/interfaces/CADClientInterface.java	(revision 2)
@@ -0,0 +1,18 @@
+package tmcsim.interfaces;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+import tmcsim.client.cadclientgui.data.CADData;
+
+/**This interface exists for CADClient to communicate with Coordinator through the RMI. RMI requires that objects sent through implement
+ * an interface that extends Remote.
+ * @author Vincent
+ *
+ */
+
+public interface CADClientInterface extends Remote  {
+    
+    public void refresh() throws RemoteException;
+    
+}
Index: trunk/src/tmcsim/interfaces/CADInterface.java
===================================================================
--- trunk/src/tmcsim/interfaces/CADInterface.java	(revision 2)
+++ trunk/src/tmcsim/interfaces/CADInterface.java	(revision 2)
@@ -0,0 +1,313 @@
+package tmcsim.interfaces;
+
+import java.awt.List;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.util.LinkedList;
+
+import javax.swing.JList;
+import javax.swing.table.DefaultTableModel;
+
+import tmcsim.client.cadclientgui.data.CADData;
+import tmcsim.client.cadclientgui.data.CardfileDataObject;
+import tmcsim.client.cadclientgui.data.CardfileList;
+import tmcsim.client.cadclientgui.data.ChangeLog;
+import tmcsim.client.cadclientgui.enums.CADScriptTags.UNIT_TAGS;
+import tmcsim.client.cadclientgui.enums.CADScriptTags;
+import tmcsim.client.cadclientgui.enums.IncidentEnums;
+import tmcsim.client.cadclientgui.enums.UnitStatusEnums;
+import tmcsim.client.cadclientgui.enums.CADDataEnums.*;
+
+public interface CADInterface extends Remote{
+
+    /**
+     * Registers a remote CADClient for callback.  
+     *
+     * @param client Interface to the CADClient for callback RMI
+     * @throws RemoteException if there is an error in the RMI communication.
+     */
+    public void registerForCallback(CADClientInterface client)
+        throws RemoteException;
+
+    /**
+     * Unregisters a remote CADClient from callback.  
+     * @param client Interface to the CADClient for callback RMI
+     * @throws RemoteException if there is an error in the RMI communication.
+     */
+    public void unregisterForCallback(CADClientInterface client)
+        throws RemoteException;
+    
+    /**
+     * Checks the CADData for an existing incident with id
+     * @param id the incident id
+     * @return true if CADData contains such an incident, otherwise false.
+     * @throws RemoteException
+     */
+    public boolean checkForValidIncidentID(int id) throws RemoteException;
+    
+    /**
+     * Uses an Incident's masterInc to lookup its ID.
+     * @param masterInc the Incident to look up
+     * @return the same Incident's ID, -1 if invalid masterInc
+     * @throws RemoteException
+     */
+    public int getIncidentId(String masterInc) throws RemoteException;
+    
+    /**
+     * Returns a table model out of CADData based on tag.
+     * @param tag a CADDataEnums tag
+     * @throws RemoteException
+     */
+    public DefaultTableModel getCadDataTable(TABLE tag) throws RemoteException;
+    
+    /**
+    * Returns the specified incident's table based on the tag.
+    * @param tag a CADDataEnums tag
+    * @param incidentId the incident's ID to look up
+    * @return
+    * @throws RemoteException
+    */
+   public DefaultTableModel getCadDataIncidentTable(INC_TABLE tag, int incidentId) throws RemoteException;
+   
+   /**
+    * Adds a row of data to a specified incident's table based on the tag.
+    * @param tag a CADDataEnums tag
+    * @param incidentId the incident's ID to look up
+    * @fields the row of fields to add to the specified table
+    * @throws RemoteException
+    */
+   public void addCadDataIncidentTable(INC_TABLE tag, int incidentId, String[] fields) throws RemoteException;
+    
+    /**
+     * Returns an object out of Incident based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public Object getCadDataIncVal(INC_VAL tag, int incidentId) throws RemoteException;
+    
+    /**
+     * Set incidentId's field based on tag to value.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public void setCadDataIncVal(INC_VAL tag, int incidentId, String value) throws RemoteException;
+    
+    /**
+     * Returns a string out of IncidentLocation based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncLoc(INC_LOC tag, int incidentId) throws RemoteException;
+    
+    /**
+     * Set incidentId's field based on tag to value.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public void setCadDataIncLoc(INC_LOC tag, int incidentId, String value) throws RemoteException;
+    
+    /**
+     * Returns a string out of IncidentCaller based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncCaller(INC_CALLER tag, int incidentId) throws RemoteException;
+    
+    /**
+     * Set incidentId's field based on tag to value.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public void setCadDataIncCaller(INC_CALLER tag, int incidentId, String value) throws RemoteException;
+    
+    /**
+     * Returns a string out of IncidentProblem based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncProblem(INC_PROBLEM tag, int incidentId) throws RemoteException;
+    
+    /**
+     * Set incidentId's field based on tag to value.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public void setCadDataIncProblem(INC_PROBLEM tag, int incidentId, String value) throws RemoteException;
+    
+    /**
+     * Returns a string out of IncidentGeneralInfo based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncGenInfo(INC_GEN_INFO tag, int incidentId) throws RemoteException;
+    
+    /**
+     * Set incidentId's field based on tag to value.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public void setCadDataIncGenInfo(INC_GEN_INFO tag, int incidentId, String value) throws RemoteException;
+    
+    /**
+     * Returns a string out of IncidentResponse based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncResp(INC_RESP tag, int incidentId) throws RemoteException;
+    
+    /**
+     * Set incidentId's field based on tag to value.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public void setCadDataIncResp(INC_RESP tag, int incidentId, String value) throws RemoteException;
+    
+    /**
+     * Returns a string out of IncidentAdditionalInfo based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncAddInfo(INC_ADD_INFO tag, int incidentId) throws RemoteException;
+    
+    /**
+     * Set incidentId's field based on tag to value.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public void setCadDataIncAddInfo(INC_ADD_INFO tag, int incidentId, String value) throws RemoteException;
+    
+    /**
+     * Returns a string out of IncidentActivities based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncActivities(INC_ACTIVITIES tag, int incidentId) throws RemoteException;
+    
+    /**
+     * Set incidentId's field based on tag to value.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public void setCadDataIncActivities(INC_ACTIVITIES tag, int incidentId, String value) throws RemoteException;
+    
+    /**
+     * Returns a string out of IncidentCallback based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncCallBack(INC_CALLBACK tag, int incidentId) throws RemoteException;
+    
+    /**
+     * Returns a string out of IncidentEditLog based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncEditLog(INC_EDIT_LOG tag, int incidentId) throws RemoteException;
+    
+    /**
+     * Returns a string out of IncidentInfo based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncInfo(INC_INFO tag, int incidentId) throws RemoteException;
+    
+    /**
+     * Returns a string out of IncidentTimes based on tag.
+     * @param tag a CADDataEnums tag
+     * @param incidentId the incident's ID to look up
+     * @throws RemoteException
+     */
+    public String getCadDataIncTimes(INC_TIMES tag, int incidentId) throws RemoteException; 
+    
+    /**
+     * Returns a CardfileList matching the tag.
+     */
+    public CardfileList getCardfileList(CARDFILE tag) throws RemoteException;
+    
+    /**
+     * Receives the fields of the ChangeLog in Cardfile.java and uses those fields
+     * to make changes to its own copy of the Cardfiledata.
+     */
+    public void editCardfile(ChangeLog log) throws RemoteException;
+    
+    /**
+     * Obtain a new unique ID for a cardfileDataObject.
+     */
+    public int obtainNewUniqueId() throws RemoteException;
+    
+    /**
+     * Returns the unitNum's status.
+     * @param unitNum the unitNum to look up
+     * @throws RemoteException
+     */
+    public UnitStatusEnums getCadDataUnitStatus(String unitNum) throws RemoteException;
+    
+    /**
+     * Returns a string field from Unit based on tag.
+     * @param tag a CADScriptTags tag
+     * @param unitNum the unitNum to look up
+     * @return A string value
+     * @throws RemoteException
+     */
+    public String getCadDataUnitValue(String unitNum, CADScriptTags.UNIT_TAGS tag) throws RemoteException;
+    
+    /**
+     * Sets a field from Unit based on tag.
+     * @param tag a CADScriptTags tag
+     * @param unitNum the unitNum to look up
+     * @param value the new value to be set
+     * @throws RemoteException
+     */
+    public void setCadDataUnitValue(String unitNum, UNIT_TAGS tag, Object value) throws RemoteException;
+    
+    /**
+     * Assigns a unit to the specified incident.
+     * @param unitNum the unitNum to look up
+     * @param id the incident id that this unit is assigned to.
+     * @throws RemoteException
+     */
+    public void setCadDataUnitAssignedId(String unitNum, int id) throws RemoteException;
+    
+    /**
+     * Adds a unit to the incident's list of assigned units.
+     * @param incidentId the incident
+     * @param assignedUnitNum the unit that's been assigned to the incident
+     * @throws RemoteException
+     */
+    public void addCadDataIncidentAssignedUnitNum(int incidentId, String assignedUnitNum) throws RemoteException;
+    
+    /**
+     * Sets the specified incident to the specified status.
+     * @param incidentId the incident
+     * @param status the status of the incident
+     * @throws RemoteException
+     */
+    public void setCadDataIncidentStatus(int incidentId, IncidentEnums status) throws RemoteException;
+    
+    /** 
+     * Returns a LinkedList containing entries that match the search string.
+     * @param search the string entry to be searched
+     * @return linked list of CardfileDataObjects matching search
+     */
+    public LinkedList<CardfileDataObject> getSearchList(String search) throws RemoteException;
+}
+
Index: trunk/src/tmcsim/interfaces/SimulationStatusInterface.java
===================================================================
--- trunk/src/tmcsim/interfaces/SimulationStatusInterface.java	(revision 2)
+++ trunk/src/tmcsim/interfaces/SimulationStatusInterface.java	(revision 2)
@@ -0,0 +1,101 @@
+package tmcsim.interfaces;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.Vector;
+
+import tmcsim.cadmodels.CMSInfo;
+import tmcsim.client.cadclientgui.data.Incident;
+import tmcsim.client.cadclientgui.data.IncidentEvent;
+import tmcsim.common.CADEnums.PARAMICS_STATUS;
+import tmcsim.common.CADEnums.SCRIPT_STATUS;
+
+/**
+ * RMI Interface providing methods to get the current status information
+ * for the simulation.  This data includes a list of all Incidents 
+ * loaded into the simulation, all IncidentEvents that have
+ * previously occured, and the current simulation time.  The status of the 
+ * Script and Paramics connection, along with the current Paramics network
+ * loaded, are also through methods in this interface.  Diversion information 
+ * provided includes a list of all CMS ID strings and the CMSInfo objects 
+ * for these IDs.
+ * 
+ * @author Matthew Cechini
+ * @version
+ */
+public interface SimulationStatusInterface extends Remote {
+
+    /**
+     * Gets the list of all Incident objects in the current simulation.
+     *
+     * @return Vector of Incident current objects.
+     * @throws RemoteException if there is a problem in the RMI communication.
+     */
+    public Vector<Incident> getIncidentList() throws RemoteException;
+
+    /**
+     * Gets a map of IncidentEvents that have occured in this simulation.  The
+     * map keys are the log numbers for triggered Incidents.  Map values are 
+     * Vectors of the IncidentEvents that are triggered for each Incident.
+     *
+     * @return Map of IncidentEvent objects for the corresponding Incidents.
+     * @throws RemoteException if there is a problem in RMI Communication.
+     */
+    public TreeMap<Integer, Vector<IncidentEvent>> getTriggeredEvents() throws RemoteException;
+
+    /**
+     * Gets the current simulation time (in seconds).
+     *
+     * @return Value of current simulation time(in seconds).
+     * @throws RemoteException if there is a problem in RMI Communication
+     */
+    public long getCurrentSimulationTime() throws RemoteException;
+
+    /**
+     * Get the current status of the script.  
+     *
+     * @return SCRIPT_STATUS enumeration value.
+     * @throws RemoteException if there is a problem in RMI Communication.
+     * @see SCRIPT_STATUS
+     */
+    public SCRIPT_STATUS getScriptStatus() throws RemoteException;
+
+    /**
+     * Get the current status of the paramics connection.  
+     *
+     * @return PARAMICS_STATUS enumeration value.
+     * @throws RemoteException if there is a problem in RMI Communication.
+     * @see PARAMICS_STATUS
+     */
+    public PARAMICS_STATUS getParamicsStatus() throws RemoteException;
+
+    /**
+     * Get the value of the Paramics network that is loaded.
+     *
+     * @return Value of the Network ID loaded.  Returns -1 if no network is loaded.  *
+     * @throws RemoteException if there is an error in the RMI communication.
+     */
+    public int getParamicsNetworkLoaded() throws RemoteException;
+
+    /**
+     * Gets the current list of CMSInfo ID strings.
+     *
+     * @return Set of CMSInfo ID strings.
+     * @throws RemoteException if there is an error in the RMI communication
+     */
+    public TreeSet<String> getCMSIDs() throws RemoteException;
+    
+    /**
+     * Gets the current CMSInfo diversion object for the parameter unique
+     * CMS ID string.
+     * @param theCMSID A unique CMS ID string.
+     * @return The CMSInfo object found for the parameter ID.  Returns null
+     *         if an invalid ID string is given.
+     * @throws RemoteException if there is an error in the RMI communication
+     */
+    public CMSInfo getCMSDiversionInfo(String theCMSID) throws RemoteException;
+
+    
+}
