@@ -680,13 +680,15 @@ public void OnAutoHomeRA()
680
680
{
681
681
string dir = AutoHomeRaDirection == "East" ? "R" : "L" ;
682
682
string dist = AutoHomeRaDistance . ToString ( "0" ) ;
683
+ Log . WriteLine ( $ "MOUNT: Sending Autohome command MHR{ dir } command in direction { AutoHomeRaDirection } for { AutoHomeRaDistance } degrees") ;
683
684
_oatMount . SendCommand ( $ ":MHR{ dir } { dist } #,n", ( a ) => { } ) ;
684
685
}
685
686
686
687
public void OnAutoHomeDEC ( )
687
688
{
688
689
string dir = AutoHomeDecDirection == "South" ? "D" : "U" ;
689
690
string dist = AutoHomeDecDistance . ToString ( "0" ) ;
691
+ Log . WriteLine ( $ "MOUNT: Sending Autohome command MHD{ dir } command in direction { AutoHomeDecDirection } for { AutoHomeDecDistance } degrees") ;
690
692
_oatMount . SendCommand ( $ ":MHD{ dir } { dist } #,n", ( a ) => { } ) ;
691
693
}
692
694
@@ -2623,9 +2625,11 @@ private async Task<bool> ChooseTelescope()
2623
2625
Log . WriteLine ( "MOUNT: RA Auto Home starting" ) ;
2624
2626
var statuses = new List < string > ( ) ;
2625
2627
var doneEvent = new AsyncAutoResetEvent ( ) ;
2626
- // The MHRR command actually returns 0 or 1, but we ignore it, so that we can monitor progress
2627
- Log . WriteLine ( "MOUNT: Sending MHRR command...." ) ;
2628
- _oatMount . SendCommand ( $ ":MHRR#", ( a ) => { doneEvent . Set ( ) ; } ) ;
2628
+ // The MHRR/L command actually returns 0 or 1, but we ignore it, so that we can monitor progress
2629
+ string dir = AutoHomeRaDirection == "East" ? "R" : "L" ;
2630
+ string dist = AutoHomeRaDistance . ToString ( "0" ) ;
2631
+ Log . WriteLine ( $ "MOUNT: Sending Autohome command MHR{ dir } command in direction { AutoHomeRaDirection } for { AutoHomeRaDistance } degrees") ;
2632
+ _oatMount . SendCommand ( $ ":MHR{ dir } { dist } #,n", ( a ) => { doneEvent . Set ( ) ; } ) ;
2629
2633
await doneEvent . WaitAsync ( ) ;
2630
2634
2631
2635
Log . WriteLine ( "MOUNT: Waiting for homing to end...." ) ;
@@ -2657,9 +2661,11 @@ private async Task<bool> ChooseTelescope()
2657
2661
Log . WriteLine ( "MOUNT: DEC Auto Home starting" ) ;
2658
2662
var statuses = new List < string > ( ) ;
2659
2663
var doneEvent = new AsyncAutoResetEvent ( ) ;
2660
- // The MHDU command actually returns 0 or 1, but we ignore it, so that we can monitor progress
2661
- Log . WriteLine ( "MOUNT: Sending MHDU command" ) ;
2662
- _oatMount . SendCommand ( $ ":MHDU#", ( a ) => { doneEvent . Set ( ) ; } ) ;
2664
+ // The MHDU/D command actually returns 0 or 1, but we ignore it, so that we can monitor progress
2665
+ string dir = AutoHomeDecDirection == "South" ? "D" : "U" ;
2666
+ string dist = AutoHomeDecDistance . ToString ( "0" ) ;
2667
+ Log . WriteLine ( $ "MOUNT: Sending Autohome command MHD{ dir } command in { AutoHomeDecDirection } for { AutoHomeDecDistance } degrees") ;
2668
+ _oatMount . SendCommand ( $ ":MHD{ dir } { dist } #,n", ( a ) => { doneEvent . Set ( ) ; } ) ;
2663
2669
await doneEvent . WaitAsync ( ) ;
2664
2670
Log . WriteLine ( "MOUNT: Waiting for homing to end...." ) ;
2665
2671
@@ -4118,37 +4124,37 @@ public static string CoordToString(double dpos, CoordSeparators sep = CoordSepar
4118
4124
switch ( sep )
4119
4125
{
4120
4126
case CoordSeparators . NoSeparators :
4121
- {
4122
- var ra = new DayTime ( pos ) ;
4123
- int hours , mins , secs ;
4124
- ra . GetTime ( out hours , out mins , out secs ) ;
4125
- return string . Format ( "{0} {1} {2}" , hours , mins , secs ) ;
4126
- }
4127
+ {
4128
+ var ra = new DayTime ( pos ) ;
4129
+ int hours , mins , secs ;
4130
+ ra . GetTime ( out hours , out mins , out secs ) ;
4131
+ return string . Format ( "{0} {1} {2}" , hours , mins , secs ) ;
4132
+ }
4127
4133
case CoordSeparators . Colons :
4128
- {
4129
- var ra = new DayTime ( pos ) ;
4130
- int hours , mins , secs ;
4131
- ra . GetTime ( out hours , out mins , out secs ) ;
4132
- return string . Format ( "{0:00}:{1:00}:{2:00}" , hours , mins , secs ) ;
4133
- }
4134
+ {
4135
+ var ra = new DayTime ( pos ) ;
4136
+ int hours , mins , secs ;
4137
+ ra . GetTime ( out hours , out mins , out secs ) ;
4138
+ return string . Format ( "{0:00}:{1:00}:{2:00}" , hours , mins , secs ) ;
4139
+ }
4134
4140
case CoordSeparators . RaSeparators :
4135
- {
4136
- var ra = new DayTime ( pos ) ;
4137
- int hours , mins , secs ;
4138
- ra . GetTime ( out hours , out mins , out secs ) ;
4139
- int absHours = Math . Abs ( hours ) ;
4140
- string sign = ra . TotalSeconds < 0 ? "-" : "" ;
4141
- return string . Format ( $ "{ sign } { absHours : 00} h { mins : 00} m { secs : 00} s") ;
4142
- }
4141
+ {
4142
+ var ra = new DayTime ( pos ) ;
4143
+ int hours , mins , secs ;
4144
+ ra . GetTime ( out hours , out mins , out secs ) ;
4145
+ int absHours = Math . Abs ( hours ) ;
4146
+ string sign = ra . TotalSeconds < 0 ? "-" : "" ;
4147
+ return string . Format ( $ "{ sign } { absHours : 00} h { mins : 00} m { secs : 00} s") ;
4148
+ }
4143
4149
case CoordSeparators . DecSeparators :
4144
- {
4145
- var dec = new Declination ( pos ) ;
4146
- int degrees , mins , secs ;
4147
- dec . GetTime ( out degrees , out mins , out secs ) ;
4148
- int absDegrees = Math . Abs ( degrees ) ;
4149
- string sign = dec . TotalSeconds < 0 ? "-" : "" ;
4150
- return string . Format ( $ "{ sign } { absDegrees : 00} ° { mins : 00} \" { secs : 00} '") ;
4151
- }
4150
+ {
4151
+ var dec = new Declination ( pos ) ;
4152
+ int degrees , mins , secs ;
4153
+ dec . GetTime ( out degrees , out mins , out secs ) ;
4154
+ int absDegrees = Math . Abs ( degrees ) ;
4155
+ string sign = dec . TotalSeconds < 0 ? "-" : "" ;
4156
+ return string . Format ( $ "{ sign } { absDegrees : 00} ° { mins : 00} \" { secs : 00} '") ;
4157
+ }
4152
4158
}
4153
4159
return "what" ;
4154
4160
}
0 commit comments