private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (gotClients)
            {
                AASclient.Close();
                ADSclient.Close();
                APSclient.Close();
                writeToLog();
            }

            contWatcher = null;
            customWatcher = null;
        }
        private void contStartButton_Click(object sender, EventArgs e)
        {
            float[] appVals = new float[11];
            bool[] usedVals = new bool[7];
            bool valid = true;

            contResBox.Enabled = true;
            contTotalBox.Enabled = true;
            progBar.Value = 0;

            string invalidMsg = "Please enter valid Label, Location, Parameter and Append Settings";
            string invalidCpt = "Invalid Input";

            valid = float.TryParse(ptIntBox.Text, out appVals[0]);

            if (ptValRadio.Checked) valid = float.TryParse(ptValBox.Text, out appVals[1]);
            usedVals[0] = ptValRadio.Checked;

            if (contQcheck.Checked) valid = float.TryParse(contQbox.Text, out appVals[2]);
            usedVals[1] = contQcheck.Checked;

            if (contInterpCheck.Checked) valid = float.TryParse(contInterpBox.Text, out appVals[3]);
            usedVals[2] = contInterpCheck.Checked;

            if (contApprovCheck.Checked) valid = float.TryParse(contApprovBox.Text, out appVals[4]);
            usedVals[3] = contApprovCheck.Checked;

            if (contFlagCheck.Checked) valid = float.TryParse(contFlagBox.Text, out appVals[5]);
            usedVals[4] = contFlagCheck.Checked;

            valid = float.TryParse(appNumBox.Text, out appVals[6]);
            valid = float.TryParse(appIntBox.Text, out appVals[7]);

            if (ptIncCheckbox.Checked) valid = float.TryParse(ptIncBox.Text, out appVals[8]);
            usedVals[5] = ptIncCheckbox.Checked;

            if (stopTimeCheckbox.Checked)
            {
                valid = float.TryParse(stopTimeBox.Text, out appVals[9]);
                if (stopParamBox.SelectedIndex == -1) valid = false;
                else appVals[10] = (float)stopParamBox.SelectedIndex;
            }
            usedVals[6] = stopTimeCheckbox.Checked;

            string cLabel = contLabelBox.Text;
            string cLoc = contLocBox.Text;
            string cParam = contParamBox.Text;

            int labLength = cLabel.Length;
            int locLength = cLoc.Length;
            int paramLength = cParam.Length;

            System.Diagnostics.Trace.WriteLine(locLength);

            if ((cLabel.CompareTo(defLabel) == 0) || (cLoc.CompareTo(defLoc) == 0) || (cParam.CompareTo(defParam) == 0) || (labLength == 0) || (locLength == 0) || (paramLength == 0))
                valid = false;

            if (valid)
            {
                contStartButton.Enabled = false;
                contDelButton.Enabled = false;
                contStopButton.Enabled = true;
                contWatcher = new ContinuousAppendWatcher(this, cLabel, cLoc, cParam, appVals, usedVals);
                contWatcher.svcHost = textBoxHost.Text;
                contWatcher.newTS = contTScheckbox.Checked;
                contWatcher.Start();
            }
            else
            {
                MessageBox.Show(this, invalidMsg, invalidCpt);
            }

            writeToLog();
        }