using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; //using System.Drawing; using System.Text; using System.Windows.Forms; namespace SBD_Parser { public partial class KMLSettings : Form { public KMLSettings() { InitializeComponent(); } private void KMLSettings_Load(object sender, EventArgs e) { try { tbThickness.Value = (int)Properties.Settings.Default["kmlpathwidth"]; cbAddTimeStamp.Checked = (bool)Properties.Settings.Default["kmltimestamp"]; cbSupplyVoltage.Checked = (bool)Properties.Settings.Default["kmlsupplyvoltage"]; cbAdc2.Checked = (bool)Properties.Settings.Default["kmladc2"]; cbAdc3.Checked = (bool)Properties.Settings.Default["kmladc3"]; cbGpio0.Checked = (bool)Properties.Settings.Default["kmlgpio0"]; cbGpio1.Checked = (bool)Properties.Settings.Default["kmlgpio1"]; cbAccelerometer.Checked = (bool)Properties.Settings.Default["kmlacc"]; cbGyroscope.Checked = (bool)Properties.Settings.Default["kmlgyro"]; cbDrawPath.Checked = (bool)Properties.Settings.Default["kmlpath"]; lblThicknessValue.Text = tbThickness.Value.ToString(); } catch(Exception ex) { MessageBox.Show(ex.Message); } } private void btnSelectColor_Click(object sender, EventArgs e) { if (kmlcolorDialog.ShowDialog() == DialogResult.OK) { try { string color = kmlcolorDialog.Color.A.ToString("X").PadLeft(2, '0') + kmlcolorDialog.Color.B.ToString("X").PadLeft(2, '0') + kmlcolorDialog.Color.G.ToString("X").PadLeft(2, '0') + kmlcolorDialog.Color.R.ToString("X").PadLeft(2, '0'); Properties.Settings.Default["kmlcolor"] = color; rsColor.BackColor = kmlcolorDialog.Color; } catch (Exception ex) { MessageBox.Show(ex.Message); } } } private void trackBar1_Scroll(object sender, EventArgs e) { lblThicknessValue.Text = tbThickness.Value.ToString(); Properties.Settings.Default["kmlpathwidth"] = tbThickness.Value; } private void cbAddTimeStamp_CheckedChanged(object sender, EventArgs e) { if(cbAddTimeStamp.Checked) Properties.Settings.Default["kmltimestamp"] = true; else Properties.Settings.Default["kmltimestamp"] = false; } private void cbDrawLine_CheckedChanged(object sender, EventArgs e) { if (cbDrawPath.Checked) Properties.Settings.Default["kmlpath"] = true; else Properties.Settings.Default["kmlpath"] = false; } private void btnSave_Click(object sender, EventArgs e) { this.Close(); } private void cbAddTimeStamp_CheckedChanged_1(object sender, EventArgs e) { if (cbAddTimeStamp.Checked) Properties.Settings.Default["kmltimestamp"] = true; else Properties.Settings.Default["kmltimestamp"] = false; } private void cbSupplyVoltage_CheckedChanged(object sender, EventArgs e) { if (cbSupplyVoltage.Checked) Properties.Settings.Default["kmlsupplyvoltage"] = true; else Properties.Settings.Default["kmlsupplyvoltage"] = false; } private void cbAdc2_CheckedChanged(object sender, EventArgs e) { if (cbAdc2.Checked) Properties.Settings.Default["kmladc2"] = true; else Properties.Settings.Default["kmladc2"] = false; } private void cbAdc3_CheckedChanged(object sender, EventArgs e) { if (cbAdc3.Checked) Properties.Settings.Default["kmladc3"] = true; else Properties.Settings.Default["kmladc3"] = false; } private void cbGpio0_CheckedChanged(object sender, EventArgs e) { if (cbGpio0.Checked) Properties.Settings.Default["kmlgpio0"] = true; else Properties.Settings.Default["kmlgpio0"] = false; } private void cbGpio1_CheckedChanged(object sender, EventArgs e) { if (cbGpio1.Checked) Properties.Settings.Default["kmlgpio1"] = true; else Properties.Settings.Default["kmlgpio1"] = false; } private void cbAccelerometer_CheckedChanged(object sender, EventArgs e) { if (cbAccelerometer.Checked) Properties.Settings.Default["kmlacc"] = true; else Properties.Settings.Default["kmlacc"] = false; } private void cbGyroscope_CheckedChanged(object sender, EventArgs e) { if (cbAccelerometer.Checked) Properties.Settings.Default["kmlgyro"] = true; else Properties.Settings.Default["kmlgyro"] = false; } private void btnSelectAll_Click(object sender, EventArgs e) { cbAddTimeStamp.Checked = true; cbSupplyVoltage.Checked = true; cbAdc2.Checked = true; cbAdc3.Checked = true; cbGpio0.Checked = true; cbGpio1.Checked = true; cbAccelerometer.Checked = true; cbGyroscope.Checked = true; } } }