Commit c6cbf353 authored by Jasem Mutlaq's avatar Jasem Mutlaq

Abort rapid giude if guide star is lost

parent 356356cc
......@@ -361,7 +361,13 @@ void Guide::viewerClosed()
void Guide::processRapidStarData(ISD::CCDChip *targetChip, double dx, double dy, double fit)
{
INDI_UNUSED(fit);
// Check if guide star is lost
if (dx == -1 && dy == -1 && fit == -1)
{
KMessageBox::error(NULL, i18n("Lost track of the guide star. Rapid guide aborted."));
guider->abort();
return;
}
FITSView *targetImage = targetChip->getImage(FITS_GUIDE);
......
......@@ -607,39 +607,56 @@ void CCD::processNumber(INumberVectorProperty *nvp)
{
double dx=-1,dy=-1,fit=-1;
INumber *np=NULL;
np = IUFindNumber(nvp, "GUIDESTAR_X");
if (np)
dx = np->value;
np = IUFindNumber(nvp, "GUIDESTAR_Y");
if (np)
dy = np->value;
np = IUFindNumber(nvp, "GUIDESTAR_FIT");
if (np)
fit = np->value;
if (dx >= 0 && dy >= 0 && fit >= 0)
emit newGuideStarData(primaryChip, dx, dy, fit);
if (nvp->s == IPS_ALERT)
{
emit newGuideStarData(primaryChip, -1, -1, -1);
}
else
{
np = IUFindNumber(nvp, "GUIDESTAR_X");
if (np)
dx = np->value;
np = IUFindNumber(nvp, "GUIDESTAR_Y");
if (np)
dy = np->value;
np = IUFindNumber(nvp, "GUIDESTAR_FIT");
if (np)
fit = np->value;
if (dx >= 0 && dy >= 0 && fit >= 0)
emit newGuideStarData(primaryChip, dx, dy, fit);
}
}
if (!strcmp(nvp->name, "GUIDER_RAPID_GUIDE_DATA"))
{
double dx=-1,dy=-1,fit=-1;
INumber *np=NULL;
np = IUFindNumber(nvp, "GUIDESTAR_X");
if (np)
dx = np->value;
np = IUFindNumber(nvp, "GUIDESTAR_Y");
if (np)
dy = np->value;
np = IUFindNumber(nvp, "GUIDESTAR_FIT");
if (np)
fit = np->value;
if (dx >= 0 && dy >= 0 && fit >= 0)
emit newGuideStarData(guideChip, dx, dy, fit);
}
if (nvp->s == IPS_ALERT)
{
emit newGuideStarData(guideChip, -1, -1, -1);
}
else
{
np = IUFindNumber(nvp, "GUIDESTAR_X");
if (np)
dx = np->value;
np = IUFindNumber(nvp, "GUIDESTAR_Y");
if (np)
dy = np->value;
np = IUFindNumber(nvp, "GUIDESTAR_FIT");
if (np)
fit = np->value;
if (dx >= 0 && dy >= 0 && fit >= 0)
emit newGuideStarData(guideChip, dx, dy, fit);
}
}
DeviceDecorator::processNumber(nvp);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment