Skip to content

Commit 31c473b

Browse files
author
openastrotech
committed
Merge branch 'develop' into NEMA-steppers
2 parents 96020e3 + 49ec343 commit 31c473b

Some content is hidden

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

44 files changed

+1668
-454
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,9 @@ MigrationBackup/
349349
# Ionide (cross platform F# VS Code tools) working folder
350350
.ionide/
351351

352+
# VSCode auto-generated config folder
353+
.vscode/
354+
352355
Software/OpenAstroTracker ASCOM/OpenAstroTracker ASCOM/bin/
353356
Software/OpenAstroTracker ASCOM/OAT PC Control/bin
354357
Software/PC control/bin

Software/Arduino code/OpenAstroTracker/DayTime.cpp

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,23 @@ void DayTime::subtractTime(const DayTime& other)
158158
char achBuf[32];
159159

160160
// Convert to a standard string (like 14:45:06)
161-
const char* DayTime::ToString() const
161+
const char* DayTime::ToString() const
162162
{
163163
char* p = achBuf;
164164

165-
if (hours < 10) {
165+
int absHours = hours < 0 ? -hours : hours;
166+
if (hours < 0)
167+
{
168+
*p++ = '-';
169+
}
170+
if (absHours < 10) {
166171
*p++ = '0';
167172
}
168173
else {
169-
*p++ = '0' + (hours / 10);
174+
*p++ = '0' + (absHours / 10);
170175
}
171176

172-
*p++ = '0' + (hours % 10);
177+
*p++ = '0' + (absHours % 10);
173178

174179
*p++ = ':';
175180
if (mins < 10) {
@@ -189,7 +194,10 @@ const char* DayTime::ToString() const
189194
}
190195

191196
*p++ = '0' + (secs % 10);
192-
sprintf(p, " (%.4f)", this->getTotalHours());
197+
*p++ = ' ';
198+
*p++ = '(';
199+
strcpy(p, String(this->getTotalHours(), 5).c_str());
200+
strcat(p, ")");
193201
return achBuf;
194202
}
195203

@@ -260,7 +268,7 @@ const char* DegreeTime::ToString() const
260268
*p++ = '0' + (mins / 10);
261269
}
262270
*p++ = '0' + (mins % 10);
263-
271+
264272
*p++ = ':';
265273
if (secs < 10) {
266274
*p++ = '0';
@@ -270,7 +278,10 @@ const char* DegreeTime::ToString() const
270278
}
271279

272280
*p++ = '0' + (secs % 10);
273-
sprintf(p, " (%.4f)", NORTHERN_HEMISPHERE ? getTotalHours() + 90 : getTotalHours() - 90);
281+
*p++ = ' ';
282+
*p++ = '(';
283+
strcpy(p, String(NORTHERN_HEMISPHERE ? getTotalHours() + 90 : getTotalHours() - 90, 4).c_str());
284+
strcat(p, ")");
274285

275286
return achBufDeg;
276287
}

Software/Arduino code/OpenAstroTracker/Globals.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ extern int PolarisRASecond;
2828
// Uncomment to run a key diagnostic. No tracker functions are on at all.
2929
// #define LCD_BUTTON_TEST
3030

31+
// Uncomment to reverse the direction of RA motor
32+
//#define INVERT_RA_DIR
33+
34+
// Uncomment to reverse the direction of DEC motor
35+
//#define INVERT_DEC_DIR
36+
3137
////////////////////////////////////////////////////////////////
3238
//
3339
// FEATURE SUPPORT SECTION
@@ -94,7 +100,7 @@ extern int PolarisRASecond;
94100

95101
// If we are making a headleass (no screen, no keyboard) client, always enable Serial.
96102
#ifdef HEADLESS_CLIENT
97-
#define SUPPORT_SERIAL_CONTROL
103+
#define SUPPORT_SERIAL_CONTROL
98104
#endif
99105

100106
#endif

Software/Arduino code/OpenAstroTracker/MeadeCommandProcessor.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "MeadeCommandProcessor.h"
22
#include "Globals.h"
33
#include "Utility.h"
4+
#include "WifiControl.hpp"
45

56
/////////////////////////////////////////////////////////////////////////////////////////
67
//
@@ -228,6 +229,12 @@
228229
// Get the current HA of the mount.
229230
// Returns: HHMMSS
230231
//
232+
// :XGN#
233+
// Get network settings
234+
// Gets the current status of the Wifi connection. Reply only available when running on ESP8266 boards.
235+
// Returns: 1,<stats>,<hostname>,<ip>:<port># - if Wifi is enabled
236+
// Returns: 0,# - if Wifi is not enabled
237+
//
231238
// :XGL#
232239
// Get LST
233240
// Get the current LST of the mount.
@@ -604,6 +611,13 @@ String MeadeCommandProcessor::handleMeadeExtraCommands(String inCmd) {
604611
sprintf(scratchBuffer, "%02d%02d%02d#", _mount->LST().getHours(), _mount->LST().getMinutes(), _mount->LST().getSeconds());
605612
return String(scratchBuffer);
606613
}
614+
else if (inCmd[1] == 'N') {
615+
#ifdef WIFI_ENABLED
616+
return wifiControl.getStatus() + "#";
617+
#endif
618+
619+
return "0,#";
620+
}
607621
}
608622
else if (inCmd[0] == 'S') { // Set RA/DEC steps/deg, speedfactor
609623
if (inCmd[1] == 'R') {

0 commit comments

Comments
 (0)