OpenAstroTech / OpenAstroTracker

3D printed DSLR tracking mount
Other
970 stars 124 forks source link

[OATControl] MeadeCommandProcessor wrong Longitude Interpretation #130

Open pmneo opened 3 years ago

pmneo commented 3 years ago

From Indilib driver (https://github.com/indilib/indi/blob/master/drivers/telescope/lx200driver.cpp#L1020) // Meade defines longitude as 0 to 360 WESTWARD int setSiteLongitude(int fd, double Long)

So the driver sends 10°44E as :Sg349:16# which will be interpreted from OAT as 10°44W ...

My suggested fix is to negate the dt.getTotalSeconds():

`Longitude Longitude::ParseFromMeade(String s) { Longitude result(0.0); LOGV2(DEBUG_GENERAL, F("Longitude.Parse(%s)"), s.c_str());

// Use the DayTime code to parse it. DayTime dt = DayTime::ParseFromMeade(s);

result.totalSeconds = 0 - dt.getTotalSeconds(); result.checkHours();

LOGV4(DEBUG_GENERAL, F("Longitude.Parse(%s) -> %s = %ls"), s.c_str(), result.ToString(), result.getTotalSeconds()); return result; }`