Skip to content

Commit 6b78a25

Browse files
V6.6.7.3 Updates
- Support querying and setting time and date through ASCOM
1 parent f9c11e1 commit 6b78a25

File tree

4 files changed

+36
-9
lines changed

4 files changed

+36
-9
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")]

0 commit comments

Comments
 (0)