summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-11 22:16:19 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-11 22:16:19 (GMT)
commit31a227f70c31a12ce9f70968b1ddcd82b52a07f4 (patch)
tree3be61a484d31c8be307b16993a3c176dae8d1eff
parent694ef7f46647ffab0f7ae06bf0e79e5a520d17ad (diff)
Recenter tracking box around max HFR star in autofocus mode
-rw-r--r--kstars/ekos/focus.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/kstars/ekos/focus.cpp b/kstars/ekos/focus.cpp
index f2a5e6c..52f9c02 100644
--- a/kstars/ekos/focus.cpp
+++ b/kstars/ekos/focus.cpp
@@ -1026,19 +1026,19 @@ void Focus::newFITS(IBLOB *bp)
if (currentHFR > 0)
{
- /*if (starSelected)
+ // Center tracking box around selected star
+ if (starSelected && inAutoFocus)
{
Edge *maxStarHFR = image_data->getMaxHFRStar();
- int x = qMax(0, static_cast<int>(maxStarHFR->x-maxStarHFR->width));
- int y = qMax(0, static_cast<int>(maxStarHFR->y-maxStarHFR->width));
- int w = qMin(image_data->getWidth(), static_cast<long>(maxStarHFR->width*2));
- int h = qMin(image_data->getHeight(), static_cast<long>(maxStarHFR->width*2));
+ if (maxStarHFR)
+ {
+ int x = qMax(0, static_cast<int>(maxStarHFR->x-kcfg_focusBoxSize->value()/2));
+ int y = qMax(0, static_cast<int>(maxStarHFR->y-kcfg_focusBoxSize->value()/2));
- targetImage->setTrackingBox(QRect(x,y,w,h));
- //targetImage->setTrackingBoxCenter(QPointF(starBoundary.x(),starBoundary.y()));
- //targetImage->setTrackingBoxSize(QSize(starBoundary.width(), starBoundary.height()));
- }*/
+ targetImage->setTrackingBox(QRect(x, y, kcfg_focusBoxSize->value(), kcfg_focusBoxSize->value()));
+ }
+ }
if (currentHFR > maxHFR)
maxHFR = currentHFR;