Skip to content

Commit be7f03d

Browse files
Merge pull request #64 from OpenAstroTech/ascom-7-and-fixes
Been a while, need to bring main branch up to date
2 parents 183aa88 + ff8c123 commit be7f03d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+7057
-1219
lines changed

ASCOM.Driver/OpenAstroTracker/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// Build Number
2222
// Revision
2323
//
24-
[assembly: AssemblyVersion("6.6.7.2")]
25-
[assembly: AssemblyFileVersion("6.6.7.2")]
24+
[assembly: AssemblyVersion("6.6.7.3")]
25+
[assembly: AssemblyFileVersion("6.6.7.3")]
2626

2727
[assembly: ComVisibleAttribute(false)]

ASCOM.Driver/OpenAstroTracker/README.txt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
+--------------------------------------------------------------------------+
22
| |
3-
| OpenAstroTracker ASCOM Driver V6.6.7.2 Release |
4-
| Published: 20. April 2025 |
3+
| OpenAstroTracker ASCOM Driver V6.6.7.3 Pre-Release |
4+
| Published: 23. June 2025 |
55
| |
66
+--------------------------------------------------------------------------+
77

@@ -33,6 +33,8 @@ Support
3333

3434
Testing
3535
-------
36+
* 6.6.7.3 Not tested.
37+
3638
* 6.6.7.2 Conformance Test (2025-Apr-20)
3739
- Telescope: All tests passed, no errors, no warnings, 18 issues (all expected).
3840

@@ -73,6 +75,15 @@ So... keep your towel handy and supervise operations.
7375

7476
Release History
7577
---------------
78+
- 6.6.7.3 : Pre-Released 2025-06-23
79+
Added support for ASCOM driver to get and set time and date from and to mount.
80+
81+
- 6.6.7.2 : Pre-Released 2025-04-20
82+
FindHome and AtHome implemented.
83+
Fixed a bug that caused errors when syncing location.
84+
Propagated location changes to the mount if connected.
85+
Fix user-input number parsing issues for non-US locales.
86+
7687
- 6.6.7.1 : Pre-Released 2025-02-28
7788
Fixed a bug that caused errors when syncing location.
7889
Propagated location changes to the mount if connected.

ASCOM.Driver/TelescopeDriver/Driver.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.Windows.Forms;
1111
using System.Runtime.CompilerServices;
1212
using static ASCOM.OpenAstroTracker.SharedResources;
13+
using System.Globalization;
1314

1415
namespace ASCOM.OpenAstroTracker
1516
{
@@ -1268,14 +1269,29 @@ public ITrackingRates TrackingRates
12681269

12691270
public DateTime UTCDate
12701271
{
1271-
// ToDo - Can we handle this without bothering the mount?
12721272
get
12731273
{
1274-
DateTime utcDate = DateTime.UtcNow;
1274+
string localDate = CommandString(":GC#,#"); // mm/dd/yy
1275+
string localTime= CommandString(":GL#,#"); // HH:MM:SS in 24h format
1276+
DateTime now = DateTime.ParseExact(localDate + " " + localTime, "MM/dd/yy HH:mm:ss", CultureInfo.InvariantCulture);
1277+
DateTime utcDate = now.ToUniversalTime();
12751278
LogMessage(LoggingFlags.Scope, $"UTCDate Get => {utcDate}");
12761279
return utcDate;
12771280
}
1278-
set { throw new ASCOM.PropertyNotImplementedException("UTCDate", true); }
1281+
set
1282+
{
1283+
CultureInfo _oatCulture = new CultureInfo("en-US");
1284+
var utcNow = value;
1285+
var now = value.ToLocalTime();
1286+
1287+
LogMessage(LoggingFlags.Scope,$"DateTime Set => {utcNow}UTC, {now}Local");
1288+
CommandString(string.Format(_oatCulture, ":SL{0,2:00}:{1,2:00}:{2,2:00}#,n", now.Hour, now.Minute, now.Second));
1289+
CommandString(string.Format(_oatCulture, ":SC{0,2:00}/{1,2:00}/{2,2:00}#,##", now.Month, now.Day, now.Year - 2000));
1290+
1291+
var utcOffset = Math.Round((now - utcNow).TotalHours);
1292+
char sign = (utcOffset < 0) ? '+' : '-';
1293+
CommandString(string.Format(_oatCulture, ":SG{0}{1,2:00}#,n", sign, Math.Abs(utcOffset)));
1294+
}
12791295
}
12801296

12811297
public void Unpark()

ASCOM.Driver/TelescopeDriver/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@
3535
// by using the '*' as shown below:
3636
//
3737
// TODO - Set your driver's version here
38-
[assembly: AssemblyVersion("6.6.7.2")]
39-
[assembly: AssemblyFileVersion("6.6.7.2")]
38+
[assembly: AssemblyVersion("6.6.7.3")]
39+
[assembly: AssemblyFileVersion("6.6.7.3")]

OATControl/.editorconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,30 @@ dotnet_naming_style.begins_with_i.required_prefix = I
204204
dotnet_naming_style.begins_with_i.required_suffix =
205205
dotnet_naming_style.begins_with_i.word_separator =
206206
dotnet_naming_style.begins_with_i.capitalization = pascal_case
207+
csharp_style_namespace_declarations = block_scoped:silent
208+
csharp_style_prefer_method_group_conversion = true:silent
209+
csharp_style_prefer_top_level_statements = true:silent
210+
csharp_style_prefer_primary_constructors = true:suggestion
211+
csharp_prefer_system_threading_lock = true:suggestion
212+
213+
[*.{cs,vb}]
214+
dotnet_style_coalesce_expression = true:suggestion
215+
dotnet_style_null_propagation = true:suggestion
216+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
217+
dotnet_style_prefer_auto_properties = true:silent
218+
dotnet_style_object_initializer = true:suggestion
219+
dotnet_style_collection_initializer = true:suggestion
220+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
221+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
222+
dotnet_style_prefer_conditional_expression_over_return = true:silent
223+
dotnet_style_explicit_tuple_names = true:suggestion
224+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
225+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
226+
dotnet_style_prefer_compound_assignment = true:suggestion
227+
dotnet_style_prefer_simplified_interpolation = true:suggestion
228+
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
229+
dotnet_style_namespace_match_folder = true:suggestion
230+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
231+
tab_width = 4
232+
indent_size = 4
233+
end_of_line = crlf

OATControl/App.xaml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:local="clr-namespace:OATControl"
5-
StartupUri="MainWindow.xaml">
5+
>
66
<Application.Resources>
77
<ResourceDictionary>
88
<ResourceDictionary.MergedDictionaries>
@@ -13,6 +13,33 @@
1313
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Red.xaml" />
1414
<ResourceDictionary Source="pack://application:,,,/;component/Resources/RedControls.xaml" />
1515
</ResourceDictionary.MergedDictionaries>
16-
</ResourceDictionary>
16+
<DrawingImage x:Key="WaitingIcon">
17+
<DrawingImage.Drawing>
18+
<GeometryDrawing Brush="Red">
19+
<GeometryDrawing.Geometry>
20+
<Geometry>M0.60101273,29.959071C0.60101268,29.959071,0.60726115,29.959071,0.6150718,29.959071L0.6297169,29.959071 0.63850358,29.959071 0.64318994,29.959071 0.64494708,29.959071 17.834004,29.959071C18.334981,29.959071,18.536,29.959071,18.536,30.259074L18.536,31.562087C18.536,31.962081,18.334981,31.962081,17.834004,31.962081L0.70098832,31.962081C0.20001191,32.063081,-1.7566754E-07,31.962081,1.1368684E-13,31.662078L1.1368684E-13,30.359081C-1.7566754E-07,29.959071,0.20001191,29.959071,0.60101273,29.959071z M9.2179812,17.634044L8.5159864,17.935056C8.4160108,17.935056,6.4119834,18.837051,6.3120078,21.642049L9.2179812,21.642049 12.122978,21.642049C12.023003,18.837051,10.219995,18.035047,10.019007,17.935056z M3.5060097,5.8110187C3.4060036,6.9140179 3.5060097,8.3160298 4.006986,9.6190264 4.6090058,11.322033 6.0109824,12.62503 8.0150098,13.526034L9.4179935,14.12804 10.821008,13.526034C12.825004,12.62503 14.127005,11.322033 14.829001,9.6190264 15.329977,8.3160298 15.329977,6.9140179 15.329977,5.8110187L9.5179996,5.8110187z M1.302001,3.407006L9.2179812,3.407006 17.132985,3.407006C17.132985,3.4070058,20.138995,11.422039,11.42199,14.428044L11.321984,17.434047C11.321984,17.434047,18.134999,19.438051,17.43398,26.652072L17.232991,28.055074 9.1169986,28.055074 1.0020132,28.055074 0.80099442,26.652072C0.10000587,19.438051,6.91299,17.434047,6.91299,17.434047L6.8129839,14.428044C-1.7040091,11.422039,1.302001,3.4070058,1.302001,3.407006z M0.70098832,0L17.834004,0C18.334981,0,18.536,0.10000634,18.536,0.40100195L18.536,1.8040053C18.536,2.2040152,18.334981,2.1040089,17.834004,2.1040087L0.70098832,2.1040087C0.20001191,2.1040089,-1.7566754E-07,2.2040152,1.1368684E-13,1.8040053L1.1368684E-13,0.40100195C-1.7566754E-07,0.10000634,0.20001191,0,0.70098832,0z</Geometry>
21+
</GeometryDrawing.Geometry>
22+
</GeometryDrawing>
23+
</DrawingImage.Drawing>
24+
</DrawingImage>
25+
<DrawingImage x:Key="CompleteIcon">
26+
<DrawingImage.Drawing>
27+
<GeometryDrawing Brush="Red">
28+
<GeometryDrawing.Geometry>
29+
<Geometry>M29.403992,0L32,3.5860286 8.3720093,21.479001 5.7740173,17.895017 5.776001,17.893002 0,9.9110087 3.5079956,7.2570179 9.2829895,15.23602z</Geometry>
30+
</GeometryDrawing.Geometry>
31+
</GeometryDrawing>
32+
</DrawingImage.Drawing>
33+
</DrawingImage>
34+
<DrawingImage x:Key="InProgressIcon">
35+
<DrawingImage.Drawing>
36+
<GeometryDrawing Brush="Red">
37+
<GeometryDrawing.Geometry>
38+
<Geometry>M2,3.8790137L2,26.424095 17.708,15.066054z M12.441894,1.1261289L31.999938,15.054149 12.447936,29.192131 11.275939,27.571153 28.569945,15.066112 11.281921,2.75504z M0,0L21.138,15.054054 0,30.33811z</Geometry>
39+
</GeometryDrawing.Geometry>
40+
</GeometryDrawing>
41+
</DrawingImage.Drawing>
42+
</DrawingImage>
43+
</ResourceDictionary>
1744
</Application.Resources>
1845
</Application>

OATControl/App.xaml.cs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Windows.Threading;
66
using OATCommunications.Utilities;
77
using OATControl.Properties;
8+
using OATControl.ViewModels;
89

910
namespace OATControl
1011
{
@@ -26,13 +27,18 @@ public App()
2627
protected override void OnStartup(StartupEventArgs e)
2728
{
2829
bool enableLogging = true;
30+
bool autoConnect = false;
2931

30-
if (e.Args.Length > 0)
32+
for (int i = 0; i < e.Args.Length; i++)
3133
{
32-
if (e.Args[0].ToLower() == "-nolog")
34+
if (e.Args[i].ToLower() == "-nolog")
3335
{
3436
enableLogging = false;
3537
}
38+
if (e.Args[i].ToLower() == "-autoconnect")
39+
{
40+
autoConnect = true;
41+
}
3642
}
3743

3844
if (enableLogging)
@@ -54,8 +60,16 @@ protected override void OnStartup(StartupEventArgs e)
5460
ThemeManager.GetAccent("RedAccent"),
5561
ThemeManager.GetAppTheme("RedTheme"));
5662

57-
5863
base.OnStartup(e);
64+
65+
var mainWindow = new MainWindow();
66+
67+
if (mainWindow.DataContext is MountVM vm)
68+
{
69+
vm.AutoConnect = autoConnect;
70+
}
71+
72+
mainWindow.Show();
5973
}
6074

6175
protected override void OnExit(ExitEventArgs e)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System;
2+
using System.Globalization;
3+
using System.Windows;
4+
using System.Windows.Data;
5+
using System.Windows.Markup;
6+
7+
namespace OATControl.Converters
8+
{
9+
public class BoolToFontWeightConverter : MarkupExtension, IValueConverter
10+
{
11+
public FontWeight TrueWeight { get; set; } = FontWeights.Bold;
12+
public FontWeight FalseWeight { get; set; } = FontWeights.Normal;
13+
14+
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
15+
{
16+
if (value is bool b)
17+
return b ? TrueWeight : FalseWeight;
18+
return FalseWeight;
19+
}
20+
21+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
22+
{
23+
throw new NotImplementedException();
24+
}
25+
26+
public override object ProvideValue(IServiceProvider serviceProvider)
27+
{
28+
return this;
29+
}
30+
}
31+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Diagnostics;
4+
using System.Globalization;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
using System.Windows.Data;
9+
10+
namespace OATControl.Converters
11+
{
12+
public class DebugConverter : IValueConverter
13+
{
14+
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
15+
{
16+
Debug.WriteLine($"Binding value: {value}");
17+
return value;
18+
}
19+
20+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
21+
{
22+
return value;
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)