Beispiel #1
0
        private void LA2Frm2_FormClosing(object sender, FormClosingEventArgs e)
        {
            //Channels.CurrentSettings.Rows.Clear();
            DSSettings.CurrentSettingsRow R  = (DSSettings.CurrentSettingsRow)Channels.CurrentSettings.Rows[0];
            DSSettings.ColorsRow          CR = (DSSettings.ColorsRow)Channels.Colors.Rows[0];

            R.SamplingClock = cbClock.SelectedIndex;

            /*
             * R.Baud = Int32.Parse(String.Format("{0}", cbBaud.Text).Trim());
             * R.ComPort = cbPort.Text;
             * R.SamplingClock = cbClock.SelectedIndex;
             * R.ChannelGroup_0 = cg0.Checked;
             * R.ChannelGroup_1 = cg1.Checked;
             * R.ChannelGroup_2 = cg2.Checked;
             * R.ChannelGroup_3 = cg3.Checked;
             *
             * R.NoiseFilter = cbNoiseFilter.Checked;
             * R.RLE = cbRLE.Checked;
             *
             * Channels.CurrentSettings.AddCurrentSettingsRow(R);
             */


            R.AcceptChanges();


            CR.EvenTraceBackColor = CCEvenBG.ARGBColor;
            CR.OddTraceBackColor  = CCOddBG.ARGBColor;
            CR.EvenTraceColor     = CCEvenFG.ARGBColor;
            CR.OddTraceColor      = CCOddFG.ARGBColor;

            CR.AcceptChanges();

            Channels.CurrentSettings.AcceptChanges();
            Channels.Colors.AcceptChanges();
            Channels.AcceptChanges();
            Channels.WriteXml("ChannelsConfig.xml");

            if (serialPort1.IsOpen)
            {
                serialPort1.Close();
            }
            serialPort1.Dispose();
        }