Skip to content

Commit 3446338

Browse files
V1.1.24.0 Fixes
1 parent fe4d8c8 commit 3446338

3 files changed

Lines changed: 22 additions & 12 deletions

File tree

OATControl/DlgAppSettings.xaml.cs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ public partial class DlgAppSettings : MetroWindow, INotifyPropertyChanged
4747
private bool _invertALTCorrections;
4848
private bool _invertAZCorrections;
4949
private bool _monitorNinaForPA;
50-
private string _ninaLogFolder;
50+
private string _ninaLogFolder = String.Empty;
5151
private bool _monitorSharpCapForPA;
52-
private string _sharpCapLogFolder;
52+
private string _sharpCapLogFolder = String.Empty;
5353

5454
private List<PointOfInterest> _pointsOfInterest;
5555
private PointOfInterest _selectedPoint;
@@ -78,6 +78,15 @@ public DlgAppSettings(MountVM mount)
7878
DecStartSouth = AppSettings.Instance.AutoHomeDecDirection == "South";
7979
DecDistance = AppSettings.Instance.AutoHomeDecDistance;
8080
ShowChecklist = AppSettings.Instance.ShowChecklist;
81+
ALTLimit = AppSettings.Instance.ALTLimit;
82+
AZLimit = AppSettings.Instance.AZLimit;
83+
PolarAlignmentMinimumTotalError = AppSettings.Instance.PolarAlignmentMinimumTotalError;
84+
InvertALTCorrections = AppSettings.Instance.InvertALTCorrections;
85+
InvertAZCorrections = AppSettings.Instance.InvertAZCorrections;
86+
MonitorNinaForPA = AppSettings.Instance.MonitorNinaPA;
87+
NinaLogFolder = AppSettings.Instance.NinaLogFolder;
88+
MonitorSharpCapForPA = AppSettings.Instance.MonitorSharpCapPA;
89+
SharpCapLogFolder = AppSettings.Instance.SharpCapLogFolder;
8190

8291
ContentTabs.SelectedIndex = 0;
8392
CategorySelector.SelectedIndex = 0;
@@ -101,7 +110,7 @@ public void OnAddPoint()
101110
dlg.ShowDialog();
102111
this.OnPropertyChanged("AllPointsOfInterest");
103112
}
104-
public bool IsPointSelected
113+
public bool IsPointSelected
105114
{
106115
get { return _selectedPoint != null; }
107116
}
@@ -139,7 +148,7 @@ public String NinaLogFolder
139148
_ninaLogFolder = value;
140149
OnPropertyChanged();
141150
}
142-
}
151+
}
143152
}
144153

145154
public bool MonitorNinaForPA
@@ -240,7 +249,7 @@ public float ALTLimit
240249
OnPropertyChanged();
241250
}
242251
}
243-
252+
244253
public float PolarAlignmentMinimumTotalError
245254
{
246255
get { return _totalErrorLimit; }
@@ -343,18 +352,18 @@ private void OnCloseClick(object sender, RoutedEventArgs e)
343352
AppSettings.Instance.AutoHomeDecDirection = DecStartSouth ? "South" : "North";
344353
AppSettings.Instance.AutoHomeDecDistance = DecDistance;
345354
AppSettings.Instance.ShowChecklist = ShowChecklist;
346-
AppSettings.Instance.AZLimit= AZLimit;
355+
AppSettings.Instance.AZLimit = AZLimit;
347356
AppSettings.Instance.ALTLimit = ALTLimit;
348-
AppSettings.Instance.PolarAlignmentMinimumTotalError= PolarAlignmentMinimumTotalError;
357+
AppSettings.Instance.PolarAlignmentMinimumTotalError = PolarAlignmentMinimumTotalError;
349358
AppSettings.Instance.InvertALTCorrections = InvertALTCorrections;
350359
AppSettings.Instance.InvertAZCorrections = InvertAZCorrections;
351360
AppSettings.Instance.MonitorNinaPA = MonitorNinaForPA;
352361
AppSettings.Instance.NinaLogFolder = NinaLogFolder;
353362
AppSettings.Instance.MonitorSharpCapPA = MonitorSharpCapForPA;
354-
AppSettings.Instance.SharpCapLogFolder= SharpCapLogFolder;
363+
AppSettings.Instance.SharpCapLogFolder = SharpCapLogFolder;
355364

356365
AppSettings.Instance.Save();
357-
_mount.SelectedBaudRate = _serialBaudRate;
366+
_mount.SelectedBaudRate = _serialBaudRate;
358367
_mount.AutoHomeDecDirection = AppSettings.Instance.AutoHomeDecDirection;
359368
_mount.AutoHomeRaDirection = AppSettings.Instance.AutoHomeRaDirection;
360369
_mount.AutoHomeDecDistance = AppSettings.Instance.AutoHomeDecDistance;

OATControl/ViewModels/MountVM.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5032,6 +5032,7 @@ internal bool AddPointOfInterest(PointOfInterest newPt)
50325032

50335033
private void OnPolarAlignCorrectionRequired(object sender, PolarAlignCorrectionEventArgs e)
50345034
{
5035+
if (_oatMount == null) return;
50355036
_oatMount.SendCommand($":MAL{e.AltAdjust:F4}#", (a) => { });
50365037
_oatMount.SendCommand($":MAZ{e.AzAdjust:F4}#", (a) => { });
50375038
}

OATControl/ViewModels/NinaPolarAlignLogProcessor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,12 @@ protected override void ProcessLogLines()
175175
}
176176

177177
var totalAdjust = ParseMinutes(totalError, @"^([+-]?\d+)[°\s]+(\d+)[\'\s]+(\d+)[\""\s]*$");
178-
if (totalAdjust*60 < 20)
178+
if (totalAdjust * 60 < AppSettings.Instance.PolarAlignmentMinimumTotalError)
179179
{
180-
Log.WriteLine($"NINALOG: Total error is below 20 arcsecs, alignment succeeded!!");
180+
Log.WriteLine($"NINALOG: Total error is below {AppSettings.Instance.PolarAlignmentMinimumTotalError} arcsecs, alignment succeeded!!");
181181
_examinedLines = lineCount;
182182
_polarAlignState = "Complete";
183-
ShowDialogStatus("Succeeded", "Polar Alignment succeeded, error below 20 arcsecs.");
183+
ShowDialogStatus("Succeeded", $"Polar Alignment succeeded, error below {AppSettings.Instance.PolarAlignmentMinimumTotalError} arcsecs.");
184184
return;
185185

186186
}

0 commit comments

Comments
 (0)