Added Focal Length property to telescope setup screen

This commit is contained in:
2022-04-28 23:55:35 +01:00
parent 1a66f41d78
commit dc68bb0b4c
12 changed files with 313 additions and 149 deletions
+20 -1
View File
@@ -188,6 +188,15 @@ namespace ASCOM.Meade.net
txtParkedAz.Text = "180";
}
try
{
txtFocalLength.Text = profileProperties.FocalLength.ToString(CultureInfo.CurrentCulture);
}
catch (Exception)
{
txtFocalLength.Text = "2000";
}
UpdateParkedItemsEnabled();
}
@@ -214,7 +223,8 @@ namespace ASCOM.Meade.net
SendDateTime = cbxSendDateTime.Checked,
ParkedBehaviour = EnumExtensionMethods.GetValueFromDescription<ParkedBehaviour>(cboParkedBehaviour.SelectedItem.ToString()),
ParkedAlt = double.Parse(txtParkedAlt.Text),
ParkedAz = double.Parse(txtParkedAz.Text)
ParkedAz = double.Parse(txtParkedAz.Text),
FocalLength = double.Parse(txtFocalLength.Text)
};
return profileProperties;
@@ -320,6 +330,15 @@ namespace ASCOM.Meade.net
txtParkedAz.Text = txtParkedAz.Text.Remove(txtParkedAz.Text.Length - 1);
}
}
private void txt_FocalLength_TextChanged_1(object sender, EventArgs e)
{
if (System.Text.RegularExpressions.Regex.IsMatch(txtFocalLength.Text, "[^0-9]"))
{
MessageBox.Show(Resources.SetupDialogForm_txtFocalLength_TextChanged_1_Please_enter_only_numbers_);
txtFocalLength.Text = txtFocalLength.Text.Remove(txtFocalLength.Text.Length - 1);
}
}
}
}