@@ -37,6 +37,7 @@ char* formatStringsDEC[] = {
3737 " %c%02d*%02d'%02d#" , // Meade
3838 " %c%02d %02d'%02d\" " , // Print
3939 " %c%02d@%02d'%02d\" " , // LCD display only
40+ " %c%02d%02d%02d" , // Compact
4041};
4142
4243char * formatStringsRA[] = {
@@ -45,6 +46,7 @@ char* formatStringsRA[] = {
4546 " %02d:%02d:%02d#" , // Meade
4647 " %02dh %02dm %02ds" , // Print
4748 " %02dh%02dm%02ds" , // LCD display only
49+ " %02d%02d%02d" , // Compact
4850};
4951
5052const float siderealDegreesInHour = 14.95902778 ;
@@ -486,6 +488,57 @@ String Mount::mountStatusString() {
486488}
487489#endif
488490
491+ // ///////////////////////////////
492+ //
493+ // getStatusString
494+ //
495+ // ///////////////////////////////
496+ String Mount::getStatusString () {
497+ String status;
498+ if (_mountStatus == STATUS_PARKED) {
499+ status = " Parked," ;
500+ }
501+ else if (_mountStatus & STATUS_PARKING) {
502+ status = " Parking," ;
503+ }
504+ else if (isGuiding ()) {
505+ status = " Guiding," ;
506+ }
507+ else if (slewStatus () & SLEW_MASK_ANY) {
508+ if (_mountStatus & STATUS_SLEWING_TO_TARGET) {
509+ status = " SlewToTarget," ;
510+ }
511+ else if (_mountStatus & STATUS_SLEWING_FREE) {
512+ status = " FreeSlew," ;
513+ }
514+ else {
515+ status = " Idle," ;
516+ }
517+ } else {
518+ status = " Idle," ;
519+ }
520+
521+ String disp = " ---," ;
522+ if (_mountStatus & STATUS_SLEWING) {
523+ byte slew = slewStatus ();
524+ if (slew & SLEWING_RA) disp[0 ] = _stepperRA->speed () < 0 ? ' R' : ' r' ;
525+ if (slew & SLEWING_DEC) disp[1 ] = _stepperDEC->speed () < 0 ? ' D' : ' d' ;
526+ if (slew & SLEWING_TRACKING) disp[2 ] = ' T' ;
527+ } else if (isSlewingTRK ()) {
528+ disp[2 ] = ' T' ;
529+ }
530+
531+ status += disp;
532+ status += String (_stepperRA->currentPosition ()) + " ," ;
533+ status += String (_stepperDEC->currentPosition ()) + " ," ;
534+ status += String (_stepperTRK->currentPosition ()) + " ," ;
535+
536+ status += RAString (COMPACT_STRING | CURRENT_STRING) + " ," ;
537+ status += DECString (COMPACT_STRING | CURRENT_STRING) + " ," ;
538+
539+ return status ;
540+ }
541+
489542// ///////////////////////////////
490543//
491544// slewingStatus
@@ -937,7 +990,7 @@ void Mount::displayStepperPosition() {
937990 else {
938991#ifdef SUPPORT_SERIAL_CONTROL
939992 if (inSerialControl) {
940- sprintf (scratchBuffer, " RA: %s" , RAString (LCD_STRING | CURRENT_STRING).c_str ());
993+ sprintf (scratchBuffer, " RA: %s" , RAString (LCD_STRING | CURRENT_STRING).c_str ());
941994 _lcdMenu->setCursor (0 , 0 );
942995 _lcdMenu->printMenu (scratchBuffer);
943996 sprintf (scratchBuffer, " DEC: %s" , DECString (LCD_STRING | CURRENT_STRING).c_str ());
0 commit comments