private void LogFileBox_CheckedChanged(object sender, EventArgs e)
 {
     if (Is_Log_Running())
     {
         // create output stream writer, if OUTPUT file given
         string file = LogTextBox.Text;
         if ((file.Length > 0) && (file != "<add file name>"))
         {
             _swLog = new FgfsLog(file);
             _swLog.AddTime = true;  // add TIME to messages
         }
         else
         {
             LogTextBox.Text = "<add file name>";
         }
     }
     else
     {
         // close output stream writer
         if (_swLog != null)
         {
             Close_Log_File();
         }
     }
 }
 private void Close_Log_File()
 {
     string maxmin = string.Format("END: Pitch max={0} min={1}, Roll max={2} min={3}",
         _max_pitch.ToString(), _min_pitch.ToString(),
         _max_roll.ToString(), _min_roll.ToString());
     _swLog.LogWrite(maxmin);
     _swLog.Close();
     _swLog = null;
 }
        private void InitializePrivates()
        {
            Console.WriteLine("Init the privates ...");
            //init the privates
            _dataObject = new FgfsDataObject();
            _dataHelper = new FgfsDataHelper(_dataObject);
            _registredDisplays = new ArrayList();
            //_display = new FgfsDisplay();

            #if USING_MS_SAPI
            // MS Speech SDK
            //SpeechVoiceSpeakFlags SpFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;
            SpFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;
            ms_Voice = null;
            //this._speechObj = null;
            #else
            this._soundCheckBox.Enabled = false;
            #endif

            this._sPort = null;
            this._swLog = null;

            //prepare the gui
            IpComboBox.DataSource = FgfsServer.DeterminePossibleIPs();

            // initialize pitch/roll max/min
            _max_pitch = -1;
            _min_pitch = 999999;
            _max_roll = -1;
            _min_roll = 999999;

            pitch_max = this.PitchBar.Maximum;
            pitch_min = this.PitchBar.Minimum;
            roll_max = this.RollBar.Maximum;
            roll_min = this.RollBar.Minimum;
            pitch_scale = pitch_max - pitch_min;
            roll_scale = roll_max - roll_min;
            pitch_scale2 = pitch_scale / 2;
            roll_scale2 = roll_scale / 2;
            Console.WriteLine("pitch {0} {1} {2} {3} roll {4} {5} {6} {7}",
                pitch_min, pitch_max, pitch_scale, pitch_scale2,
                roll_min, roll_max, roll_scale, roll_scale2);
        }