diff options
Diffstat (limited to 'indi-lxd650/lxd650.cpp')
-rw-r--r-- | indi-lxd650/lxd650.cpp | 148 |
1 files changed, 130 insertions, 18 deletions
diff --git a/indi-lxd650/lxd650.cpp b/indi-lxd650/lxd650.cpp index 8126ac9..813f6bd 100644 --- a/indi-lxd650/lxd650.cpp +++ b/indi-lxd650/lxd650.cpp @@ -495,47 +495,159 @@ bool LXD650::ISNewText(const char *dev, const char *name, char *texts[], char *n ///////////////////////////////////////////////////////////////////////////////////// /// +// +// +// +//void ///////////////////////////////////////////////////////////////////////////////////// +// + + +void LXD650::GuideNorthCB(void) +{ + GuideNorth_TID = 0; + HaltMovement(PortFD, LX200_NORTH); +} + + +void LXD650::GuideNorthProxy(void *context) +{ + static_cast<LXD650 *>(context)->GuideNorthCB(); +} + + IPState LXD650::GuideNorth(uint32_t ms) { - int8_t rate = static_cast<int8_t>(GuideRateNP[AXIS_ALT].getValue() * 100); - guidePulse(AXIS_DE, ms, rate); + double rate = GuideRateNP[AXIS_ALT].getValue(); + + ms = (uint32_t) (rate * (double) ms); + + setSlewMode(PortFD, LX200_SLEW_GUIDE); + + if (GuideNorth_TID) + { + IERmTimer(GuideNorth_TID); + GuideNorth_TID = 0; + } + + + MoveTo(PortFD, LX200_NORTH); + + GuideNorth_TID = IEAddTimer(ms, GuideNorthProxy, this); + return IPS_BUSY; } + +void LXD650::GuideSouthCB(void) +{ + GuideSouth_TID = 0; + HaltMovement(PortFD, LX200_SOUTH); +} + + +void LXD650::GuideSouthProxy(void *context) +{ + static_cast<LXD650 *>(context)->GuideSouthCB(); +} + + IPState LXD650::GuideSouth(uint32_t ms) { - int8_t rate = static_cast<int8_t>(GuideRateNP[AXIS_ALT].getValue() * 100); - guidePulse(AXIS_DE, ms, -rate); + double rate = GuideRateNP[AXIS_ALT].getValue(); + + ms = (uint32_t) (rate * (double) ms); + + setSlewMode(PortFD, LX200_SLEW_GUIDE); + + if (GuideSouth_TID) + { + IERmTimer(GuideSouth_TID); + GuideSouth_TID = 0; + } + + + MoveTo(PortFD, LX200_SOUTH); + + GuideSouth_TID = IEAddTimer(ms, GuideSouthProxy, this); + return IPS_BUSY; } -IPState LXD650::GuideEast(uint32_t ms) + +void LXD650::GuideWestCB(void) { - int8_t rate = static_cast<int8_t>(GuideRateNP[AXIS_AZ].getValue() * 100); - guidePulse(AXIS_RA, ms, -rate); - return IPS_BUSY; + GuideWest_TID = 0; + HaltMovement(PortFD, LX200_WEST); +} + + +void LXD650::GuideWestProxy(void *context) +{ + static_cast<LXD650 *>(context)->GuideWestCB(); } + IPState LXD650::GuideWest(uint32_t ms) { - int8_t rate = static_cast<int8_t>(GuideRateNP[AXIS_AZ].getValue() * 100); - guidePulse(AXIS_RA, ms, rate); + double rate = GuideRateNP[AXIS_ALT].getValue(); + + ms = (uint32_t) (rate * (double) ms); + + setSlewMode(PortFD, LX200_SLEW_GUIDE); + + if (GuideWest_TID) + { + IERmTimer(GuideWest_TID); + GuideWest_TID = 0; + } + + + MoveTo(PortFD, LX200_WEST); + + GuideWest_TID = IEAddTimer(ms, GuideWestProxy, this); + return IPS_BUSY; } -bool LXD650::guidePulse(INDI_EQ_AXIS axis, uint32_t ms, int8_t rate) + +void LXD650::GuideEastCB(void) { - // FIXME - // - // - (void) axis; - (void) ms; - (void) rate; - return true; + GuideEast_TID = 0; + HaltMovement(PortFD, LX200_EAST); +} + + +void LXD650::GuideEastProxy(void *context) +{ + static_cast<LXD650 *>(context)->GuideEastCB(); } +IPState LXD650::GuideEast(uint32_t ms) +{ + double rate = GuideRateNP[AXIS_ALT].getValue(); + + ms = (uint32_t) (rate * (double) ms); + + setSlewMode(PortFD, LX200_SLEW_GUIDE); + + if (GuideEast_TID) + { + IERmTimer(GuideEast_TID); + GuideEast_TID = 0; + } + + + MoveTo(PortFD, LX200_EAST); + + GuideEast_TID = IEAddTimer(ms, GuideEastProxy, this); + + return IPS_BUSY; +} + + + /************************************************************************************** ** ***************************************************************************************/ |