Exemplo n.º 1
0
        private void setCompassParamsButton_Click(object sender, EventArgs e)
        {
            ParameterInputBox tib = new ParameterInputBox(Properties.Settings.Default.compassParams);
            DialogResult      result;

            result = tib.ShowDialog();
            if (result == DialogResult.OK)
            {
                Properties.Settings.Default.compassParams = tib.parameters;
                Properties.Settings.Default.Save();
                setupCompass();
            }
        }
Exemplo n.º 2
0
 private void setCompassParamsButton_Click(object sender, EventArgs e)
 {
     ParameterInputBox tib = new ParameterInputBox(Properties.Settings.Default.compassParams);
     DialogResult result;
     result = tib.ShowDialog();
     if (result == DialogResult.OK)
     {
         Properties.Settings.Default.compassParams = tib.parameters;
         Properties.Settings.Default.Save();
         setupCompass();
     }
 }
Exemplo n.º 3
0
 private void setCompassParamsButton_Click(object sender, EventArgs e)
 {
     String calibrationString = "";
     int index = -1;
     if (Properties.Settings.Default.compassParams2 != null)
     {
         foreach (String str in Properties.Settings.Default.compassParams2)
         {
             if (str.StartsWith(spatial.SerialNumber.ToString()))
             {
                 index = Properties.Settings.Default.compassParams2.IndexOf(str);
                 calibrationString = str.Substring(str.IndexOf(',') + 1);
                 break;
             }
         }
     }
     ParameterInputBox tib = new ParameterInputBox(calibrationString);
     DialogResult result;
     result = tib.ShowDialog();
     if (result == DialogResult.OK)
     {
         //remove old string, add the new one
         if (index >= 0)
             Properties.Settings.Default.compassParams2.RemoveAt(index);
         if (Properties.Settings.Default.compassParams2 == null)
             Properties.Settings.Default.compassParams2 = new System.Collections.Specialized.StringCollection();
         if(tib.parameters.Length > 0)
             Properties.Settings.Default.compassParams2.Add(spatial.SerialNumber.ToString() + "," + tib.parameters);
         Properties.Settings.Default.Save();
         setupCompass();
     }
 }