Skip to content

Commit a8daefc

Browse files
V1.1.10.0 Updates
- NINA3 AutoPA support - Checklist uses WPF only now
1 parent 01b5ba5 commit a8daefc

File tree

9 files changed

+622
-14
lines changed

9 files changed

+622
-14
lines changed

OATControl/DlgAppSettings.xaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,16 @@
305305
Margin="0,2,0,0"
306306
Command="{Binding ConfigureChecklistCommand}" Padding="0" Style="{StaticResource ImageSquareButtonStyle}" ToolTip="Configure the items on the checklist to display." />
307307
</StackPanel>
308+
<StackPanel Grid.Row="2" Grid.Column="0" VerticalAlignment="Top">
309+
<TextBlock Text="N.I.N.A. Log folder" Style="{StaticResource TextBlockLabel}" VerticalAlignment="Top"/>
310+
<TextBlock Text="The log folder of N.I.N.A. to monitor for Polar Alignment. Only N.I.N.A. V3.1 and later is supported." Style="{StaticResource TextBlockOptionHelp}" VerticalAlignment="Top" HorizontalAlignment="Left"/>
311+
</StackPanel>
312+
<TextBox Grid.Row="2" Grid.Column="1"
313+
Style="{StaticResource TextBoxSmall}"
314+
Width="Auto"
315+
HorizontalAlignment="Stretch"
316+
Text="{Binding NinaLogFolder}"
317+
VerticalAlignment="Center" Margin="10,4,20,0"/>
308318
</Grid>
309319
</TabItem>
310320

OATControl/DlgAppSettings.xaml.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public partial class DlgAppSettings : MetroWindow, INotifyPropertyChanged
4848
DelegateCommand _editPointCommand;
4949
DelegateCommand _addPointCommand;
5050
DelegateCommand _configureChecklistCommand;
51+
5152
private GridViewColumnHeader _lastHeaderClicked;
5253

5354
public DlgAppSettings(MountVM mount)
@@ -119,6 +120,19 @@ public List<PointOfInterest> AllPointsOfInterest
119120
}
120121
}
121122

123+
public String NinaLogFolder
124+
{
125+
get { return _mount.NinaLogFolder; }
126+
set
127+
{
128+
if (_mount.NinaLogFolder != value)
129+
{
130+
_mount.NinaLogFolder = value;
131+
OnPropertyChanged();
132+
}
133+
}
134+
}
135+
122136
public String SelectedBaudRate
123137
{
124138
get { return _serialBaudRate; }
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<Controls:MetroWindow x:Class="OATControl.DlgNinaPolarAlignment"
2+
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
xmlns:local="clr-namespace:OATControl" xmlns:controls="clr-namespace:OATControl.Converters"
8+
mc:Ignorable="d"
9+
Background="#600"
10+
Title="N.I.N.A. Polar Alignment" Height="250" Width="420" WindowStyle="ToolWindow" FontSize="16" FontWeight="Bold" SizeToContent="Height">
11+
<Controls:MetroWindow.Resources>
12+
<Style x:Key="StateText" TargetType="TextBlock">
13+
<Setter Property="Margin" Value="10,0" />
14+
<Setter Property="Foreground" Value="#FFFF1010" />
15+
<Setter Property="TextWrapping" Value="Wrap" />
16+
<Setter Property="VerticalAlignment" Value="Center" />
17+
<Setter Property="HorizontalAlignment" Value="Left" />
18+
</Style>
19+
<Style x:Key="StateButton" TargetType="Button" BasedOn="{StaticResource AccentedSquareButtonStyle}" >
20+
<Setter Property="Margin" Value="10,10" />
21+
<Setter Property="Padding" Value="10,10" />
22+
<Setter Property="Width" Value="100" />
23+
<Setter Property="Foreground" Value="{StaticResource AccentSelectedColorBrush}" />
24+
<Setter Property="VerticalAlignment" Value="Center" />
25+
<Setter Property="HorizontalAlignment" Value="Left" />
26+
</Style>
27+
<controls:IntToVisibilityConverter x:Key="State1Visible" VisibleValue="1" Operator=">="/>
28+
<controls:IntToVisibilityConverter x:Key="State2Visible" VisibleValue="2" Operator=">=" />
29+
<controls:IntToVisibilityConverter x:Key="State3Visible" VisibleValue="3" Operator=">=" />
30+
<controls:IntToBoolConverter x:Key="State1Enabled" TrueValue="1" Operator="=="/>
31+
<controls:IntToBoolConverter x:Key="State2Enabled" TrueValue="2" Operator="==" />
32+
<controls:IntToBoolConverter x:Key="State3Enabled" TrueValue="3" Operator="==" />
33+
<Style x:Key="ChecklistItemTextStyle" TargetType="TextBlock">
34+
<Setter Property="FontWeight" Value="Normal"/>
35+
<Setter Property="FontSize" Value="13"/>
36+
<Setter Property="Foreground" Value="#933"/>
37+
<Style.Triggers>
38+
<DataTrigger Binding="{Binding IsComplete}" Value="True">
39+
<Setter Property="FontWeight" Value="Bold"/>
40+
<Setter Property="Foreground" Value="#E44"/>
41+
</DataTrigger>
42+
</Style.Triggers>
43+
</Style>
44+
</Controls:MetroWindow.Resources>
45+
<Grid>
46+
<Grid.ColumnDefinitions>
47+
<ColumnDefinition Width="*" />
48+
</Grid.ColumnDefinitions>
49+
<Grid.RowDefinitions>
50+
<RowDefinition Height="Auto" />
51+
<RowDefinition Height="Auto"/>
52+
<RowDefinition Height="Auto"/>
53+
<RowDefinition Height="Auto"/>
54+
<RowDefinition Height="Auto"/>
55+
<RowDefinition Height="Auto" />
56+
<RowDefinition Height="Auto" />
57+
<RowDefinition Height="Auto" />
58+
</Grid.RowDefinitions>
59+
60+
<TextBlock Grid.Row="0"
61+
Text="N.I.N.A. has started Polar Alignment"
62+
FontWeight="Bold"
63+
Style="{StaticResource StateText}"
64+
Margin="20,10,20,16"/>
65+
<ItemsControl Grid.Row="1" ItemsSource="{Binding ChecklistItems}" Margin="20,20,0,60">
66+
<ItemsControl.ItemTemplate>
67+
<DataTemplate>
68+
<TextBlock Text="{Binding Text}" Style="{StaticResource ChecklistItemTextStyle}" Margin="0,2"/>
69+
</DataTemplate>
70+
</ItemsControl.ItemTemplate>
71+
</ItemsControl>
72+
73+
<TextBlock Grid.Row="2" Text="{Binding ErrorMessage}"
74+
FontWeight="Bold"
75+
FontSize="14"
76+
Style="{StaticResource StateText}"
77+
HorizontalAlignment="Center"
78+
Margin="20,10,20,16"/>
79+
80+
81+
<Button Grid.Row="3"
82+
Content="Close"
83+
Command="{Binding CloseCommand}"
84+
Style="{StaticResource StateButton}"
85+
IsCancel="True"
86+
HorizontalAlignment="Right"
87+
VerticalAlignment="Bottom"
88+
Margin="0,0,20,20" />
89+
</Grid>
90+
</Controls:MetroWindow>
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
using MahApps.Metro.Controls;
2+
using OATCommunications.CommunicationHandlers;
3+
using OATCommunications.Model;
4+
using OATCommunications.WPF;
5+
using OATCommunications.WPF.CommunicationHandlers;
6+
using OATControl.Properties;
7+
using OATControl.ViewModels;
8+
using System;
9+
using System.Collections.Generic;
10+
using System.Collections.ObjectModel;
11+
using System.ComponentModel;
12+
using System.Drawing;
13+
using System.IO;
14+
using System.Linq;
15+
using System.Text;
16+
using System.Threading;
17+
using System.Threading.Tasks;
18+
using System.Windows;
19+
using System.Windows.Controls;
20+
using System.Windows.Data;
21+
using System.Windows.Documents;
22+
using System.Windows.Input;
23+
using System.Windows.Media;
24+
using System.Windows.Media.Imaging;
25+
using System.Windows.Shapes;
26+
27+
namespace OATControl
28+
{
29+
/// <summary>
30+
/// Interaction logic for DlgNinaPoolarAlignment.xaml
31+
/// </summary>
32+
public partial class DlgNinaPolarAlignment : MetroWindow, INotifyPropertyChanged
33+
{
34+
public class ChecklistItem : INotifyPropertyChanged
35+
{
36+
public event PropertyChangedEventHandler PropertyChanged;
37+
private string _text;
38+
private bool _isComplete;
39+
public string Text
40+
{
41+
get { return _text; }
42+
set
43+
{
44+
if (_text != value)
45+
{
46+
_text = value;
47+
OnPropertyChanged(nameof(Text));
48+
}
49+
}
50+
}
51+
public bool IsComplete
52+
{
53+
get { return _isComplete; }
54+
set
55+
{
56+
if (_isComplete != value)
57+
{
58+
_isComplete = value;
59+
OnPropertyChanged(nameof(IsComplete));
60+
}
61+
}
62+
}
63+
protected void OnPropertyChanged(string propertyName)
64+
{
65+
if (PropertyChanged != null)
66+
{
67+
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
68+
}
69+
}
70+
}
71+
72+
private DelegateCommand _closeCommand;
73+
private string _errorMessage;
74+
75+
public DlgNinaPolarAlignment(Action closeCallback)
76+
{
77+
_closeCommand = new DelegateCommand(() =>
78+
{
79+
closeCallback();
80+
});
81+
82+
this.DataContext = this;
83+
InitializeComponent();
84+
}
85+
86+
public ObservableCollection<ChecklistItem> ChecklistItems { get; } = new ObservableCollection<ChecklistItem>
87+
{
88+
new ChecklistItem { Text = "Plate solved first point..." },
89+
new ChecklistItem { Text = "Plate solved second point..." },
90+
new ChecklistItem { Text = "Plate solved third point..." },
91+
new ChecklistItem { Text = "Calculating error... " },
92+
new ChecklistItem { Text = "Adjusting mount AZ/ALT..." },
93+
};
94+
95+
96+
public void SetStatus(string state, string statusDetails)
97+
{
98+
switch (state)
99+
{
100+
case "Measure":
101+
if (statusDetails.Contains("First"))
102+
{
103+
ChecklistItems[0].IsComplete = true;
104+
}
105+
else if (statusDetails.Contains("Second"))
106+
{
107+
ChecklistItems[1].IsComplete = true;
108+
}
109+
else if (statusDetails.Contains("Third"))
110+
{
111+
ChecklistItems[2].IsComplete = true;
112+
}
113+
break;
114+
case "CalculateSettle":
115+
ChecklistItems[3].IsComplete = true;
116+
ChecklistItems[3].Text = statusDetails;
117+
break;
118+
case "Adjust":
119+
ChecklistItems[4].IsComplete = true;
120+
break;
121+
case "ResetLoop":
122+
ChecklistItems[3].IsComplete = false;
123+
ChecklistItems[3].Text = "";
124+
ChecklistItems[4].IsComplete = false;
125+
break;
126+
case "Error":
127+
ErrorMessage = statusDetails;
128+
break;
129+
default:
130+
break;
131+
}
132+
}
133+
134+
public ICommand CloseCommand { get { return _closeCommand; } }
135+
136+
public string ErrorMessage
137+
{
138+
get { return _errorMessage; }
139+
set
140+
{
141+
if (_errorMessage != value)
142+
{
143+
_errorMessage = value;
144+
OnPropertyChanged(nameof(ErrorMessage));
145+
}
146+
}
147+
}
148+
149+
public event PropertyChangedEventHandler PropertyChanged;
150+
private void OnPropertyChanged(string field)
151+
{
152+
if (PropertyChanged != null)
153+
{
154+
PropertyChanged(this, new PropertyChangedEventArgs(field));
155+
}
156+
}
157+
}
158+
}

OATControl/OATControl Setup.iss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "OATControl"
5-
#define MyAppVersion "1.1.8.0"
5+
#define MyAppVersion "1.1.9.0"
66
#define MyAppPublisher "OpenAstroTech"
77
#define MyAppURL "https://wiki.openastrotech.com/"
88
#define MyAppExeName "OATControl.exe"
@@ -44,9 +44,7 @@ Source: ".\bin\Release\OATControl.exe"; DestDir: "{app}"; Flags: ignoreversion
4444
Source: ".\bin\Release\ControlzEx.dll"; DestDir: "{app}"; Flags: ignoreversion
4545
Source: ".\bin\Release\MahApps.Metro.dll"; DestDir: "{app}"; Flags: ignoreversion
4646
Source: ".\bin\Release\MahApps.Metro.xml"; DestDir: "{app}"; Flags: ignoreversion
47-
Source: ".\bin\Release\Microsoft.Web.WebView2.Core.dll"; DestDir: "{app}"; Flags: ignoreversion
48-
Source: ".\bin\Release\Microsoft.Web.WebView2.Wpf.dll"; DestDir: "{app}"; Flags: ignoreversion
49-
Source: ".\bin\Release\Newtonsoft.Json.dll"; DestDir: "{app}"; Flags: ignoreversion
47+
Source: ".\bin\Release\Newtonsoft.Json.dll"; DestDir: "{app}"; Flags: ignoreversion
5048
Source: ".\bin\Release\runtimes\*"; DestDir: "{app}\runtimes"; Flags: ignoreversion recursesubdirs
5149
Source: ".\bin\Release\OATCommunications.dll"; DestDir: "{app}"; Flags: ignoreversion
5250
Source: ".\bin\Release\OATCommunications.WPF.dll"; DestDir: "{app}"; Flags: ignoreversion

OATControl/OATControl.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@
117117
<Compile Include="DlgCustomActionSetup.xaml.cs">
118118
<DependentUpon>DlgCustomActionSetup.xaml</DependentUpon>
119119
</Compile>
120+
<Compile Include="DlgNinaPolarAlignment.xaml.cs">
121+
<DependentUpon>DlgNinaPolarAlignment.xaml</DependentUpon>
122+
</Compile>
120123
<Compile Include="DlgRunPolarAlignment.xaml.cs">
121124
<DependentUpon>DlgRunPolarAlignment.xaml</DependentUpon>
122125
</Compile>
@@ -190,6 +193,10 @@
190193
<SubType>Designer</SubType>
191194
<Generator>MSBuild:Compile</Generator>
192195
</Page>
196+
<Page Include="DlgNinaPolarAlignment.xaml">
197+
<Generator>MSBuild:Compile</Generator>
198+
<SubType>Designer</SubType>
199+
</Page>
193200
<Page Include="DlgRunPolarAlignment.xaml">
194201
<Generator>MSBuild:Compile</Generator>
195202
<SubType>Designer</SubType>

OATControl/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("1.1.8.0")]
55-
[assembly: AssemblyFileVersion("1.1.8.0")]
54+
[assembly: AssemblyVersion("1.1.10.0")]
55+
[assembly: AssemblyFileVersion("1.1.10.0")]

OATControl/Readme.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
Revision History
22
----------------
33

4+
OATControl V1.1.10.0 22 Jun 2025
5+
- Added support for AutoPA feature from N.I.N.A. 3.1 and later. Only TPPA
6+
supported at this time.
7+
8+
OATControl V1.1.9.0 22 May 2025
9+
- Added a Slewpoint dialog to allow you to define slew points in stepper
10+
coordinates.
11+
- Switched Checklist rendering to WPF, instead of web based.
12+
- Support custom park position.
13+
414
OATControl V1.1.8.0 7 Mar 2025
515
- Made Autohoming from connection screen use the same settings as the homing
616
commands from the main UI and Settings dialog.

0 commit comments

Comments
 (0)