private void BtnOK_Click(object sender, EventArgs e)
        {
            TelescopeHardware.StartCoordinates.X = double.Parse(txtStartAzimuth.Text);
            TelescopeHardware.StartCoordinates.Y = double.Parse(txtStartAltitude.Text);
            TelescopeHardware.ParkAzimuth        = double.Parse(txtParkAzimuth.Text);
            TelescopeHardware.ParkAltitude       = double.Parse(txtParkAltitude.Text);
            TelescopeHardware.HomePosition.X     = double.Parse(TxtHomeAzimuth.Text);
            TelescopeHardware.HomePosition.Y     = double.Parse(TxtHomeAltitude.Text);
            using (ASCOM.Utilities.Profile profile = new ASCOM.Utilities.Profile())
            {
                profile.WriteValue(SharedResources.PROGRAM_ID, "HomeAzimuth", TelescopeHardware.HomePosition.X.ToString(CultureInfo.InvariantCulture));
                profile.WriteValue(SharedResources.PROGRAM_ID, "HomeAltitude", TelescopeHardware.HomePosition.Y.ToString(CultureInfo.InvariantCulture));
                profile.WriteValue(SharedResources.PROGRAM_ID, "ParkAzimuth", TelescopeHardware.ParkAzimuth.ToString(CultureInfo.InvariantCulture));
                profile.WriteValue(SharedResources.PROGRAM_ID, "ParkAltitude", TelescopeHardware.ParkAltitude.ToString(CultureInfo.InvariantCulture));
                profile.WriteValue(SharedResources.PROGRAM_ID, "StartAzimuthConfigured", TelescopeHardware.StartCoordinates.X.ToString(CultureInfo.InvariantCulture));
                profile.WriteValue(SharedResources.PROGRAM_ID, "StartAltitudeConfigured", TelescopeHardware.StartCoordinates.Y.ToString(CultureInfo.InvariantCulture));
                profile.WriteValue(SharedResources.PROGRAM_ID, "StartUpMode", cmbStartupMode.Text);
            }

            this.Close();
        }
Exemple #2
0
 private void cmdOK_Click(object sender, EventArgs e)
 {
     profile.WriteValue(ASCOM.Arduino.Telescope.s_csDriverID, "ComPort", this.comboComPort.SelectedItem.ToString());
     Dispose();
 }
Exemple #3
0
 public void WriteStringToProfile(string Key, string Value)
 {
     Profile.WriteValue(ProfileName, Key, Value);
 }
Exemple #4
0
 public void Set(string name, string val)
 {
     profile.WriteValue(SharedResources.ScopeDriverId, name, val);
 }