diff --git a/kstars/ekos/focus/focus.cpp b/kstars/ekos/focus/focus.cpp
--- a/kstars/ekos/focus/focus.cpp
+++ b/kstars/ekos/focus/focus.cpp
@@ -1097,7 +1097,7 @@
}
// Let's now report the current HFR
- qCDebug(KSTARS_EKOS_FOCUS) << "Focus newFITS #" << HFRFrames.count() + 1 << ": Current HFR " << currentHFR;
+ qCDebug(KSTARS_EKOS_FOCUS) << "Focus newFITS #" << HFRFrames.count() + 1 << ": Current HFR " << currentHFR << " Num stars " << (starSelected ? 1 : image_data->getDetectedStars());
// Add it to existing frames in case we need to take an average
HFRFrames.append(currentHFR);
@@ -1169,6 +1169,7 @@
// Format the HFR value into a string
QString HFRText = QString("%1").arg(currentHFR, 0, 'f', 2);
HFROut->setText(HFRText);
+ starsOut->setText(QString("%1").arg(image_data->getDetectedStars()));
// Display message in case _last_ HFR was negative
if (lastHFR == -1)
@@ -3389,6 +3390,7 @@
focusingWidget->setLayout(vlayout);
connect(focusView, &FITSView::trackingStarSelected, this, &Ekos::Focus::focusStarSelected, Qt::UniqueConnection);
focusView->setStarsEnabled(true);
+ focusView->setStarsHFREnabled(true);
}
}
diff --git a/kstars/ekos/focus/focus.ui b/kstars/ekos/focus/focus.ui
--- a/kstars/ekos/focus/focus.ui
+++ b/kstars/ekos/focus/focus.ui
@@ -6,8 +6,8 @@
0
0
- 697
- 537
+ 884
+ 646
@@ -38,6 +38,12 @@
-
+
+
+ 0
+ 0
+
+
Focuser
@@ -62,7 +68,7 @@
0
- 28
+ 32
@@ -107,7 +113,7 @@
0
- 28
+ 32
@@ -132,7 +138,7 @@
0
- 28
+ 32
@@ -184,7 +190,7 @@
0
- 28
+ 32
@@ -242,7 +248,7 @@
0
- 28
+ 32
@@ -264,6 +270,12 @@
false
+
+
+ 29
+ 29
+
+
32
@@ -367,6 +379,12 @@
-
+
+
+ 0
+ 0
+
+
CCD && Filter Wheel
@@ -401,24 +419,34 @@
-
+
+ 1
+
-
-
+
+
+
+ 0
+ 32
+
+
+
-
false
- 22
- 22
+ 32
+ 32
- 22
- 22
+ 32
+ 32
@@ -433,8 +461,8 @@
- 22
- 22
+ 28
+ 28
@@ -461,6 +489,12 @@
-
+
+
+ 0
+ 32
+
+
3
@@ -482,44 +516,56 @@
- 22
- 22
+ 32
+ 32
- 22
- 22
+ 32
+ 32
Toggle Full Screen
+
+
+ 28
+ 28
+
+
-
- 22
- 22
+ 32
+ 32
- 22
- 22
+ 32
+ 32
Show in FITS Viewer
+
+
+ 28
+ 28
+
+
@@ -541,6 +587,12 @@
false
+
+
+ 0
+ 32
+
+
-
@@ -554,7 +606,14 @@
-
-
+
+
+
+ 0
+ 32
+
+
+
@@ -573,6 +632,12 @@
false
+
+
+ 0
+ 32
+
+
-
@@ -596,6 +661,12 @@
false
+
+
+ 0
+ 32
+
+
-
--
@@ -629,17 +700,29 @@
false
+
+
+ 0
+ 32
+
+
-
false
+
+
+ 32
+ 32
+
+
- 22
- 22
+ 32
+ 32
@@ -652,6 +735,12 @@
..
+
+
+ 28
+ 28
+
+
@@ -668,6 +757,12 @@
-
+
+
+ 0
+ 32
+
+
-
--
@@ -684,6 +779,12 @@
-
+
+
+ 0
+ 32
+
+
Reset focus subframe to full capture
@@ -697,6 +798,12 @@
-
+
+
+ 0
+ 0
+
+
Settings
@@ -718,11 +825,20 @@
-
+
+ QLayout::SetDefaultConstraint
+
3
-
+
+
+ 0
+ 29
+
+
Subframe around the focus star during the autofocus procedure
@@ -822,14 +938,26 @@
-
-
+
- Qt::Horizontal
+ Qt::Vertical
-
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 6
+
+
+
-
-
+
+
+ 3
+
-
@@ -840,7 +968,7 @@
- -
+
-
0.010000000000000
@@ -872,7 +1000,7 @@
- -
+
-
-
@@ -886,17 +1014,17 @@
- -
+
-
- Number of frames to average
+ <html><body><p>Number of frames to capture in order to average the HFR value at the current focuser position.</p></body></html>
1
- -
+
-
Increase to restrict the centroid to bright cores. Decrease to enclose fuzzy stars.
@@ -906,7 +1034,7 @@
- -
+
-
false
@@ -925,7 +1053,7 @@
- -
+
-
<b>Initial</b> step size in ticks to cause a noticeable change in HFR value. For timer based focuser, it is the initial time in milliseconds to move the focuser inward or outward
@@ -964,7 +1092,7 @@
- -
+
-
<html><head/><body><p>Select focus process algorithm:</p>
@@ -979,7 +1107,7 @@
- -
+
-
1
@@ -995,7 +1123,7 @@
- -
+
-
Number of frames to average
@@ -1005,7 +1133,7 @@
- -
+
-
-
@@ -1029,7 +1157,7 @@
- -
+
-
<html><head/><body><p>Select star detection algorithm</p></body></html>
@@ -1039,7 +1167,7 @@
- -
+
-
Decrease value to narrow optimal focus point solution radius. Increase to expand solution radius
@@ -1049,14 +1177,14 @@
- -
+
-
Settle:
- -
+
-
<html><head/><body><p>Wait for this many seconds after moving the focuser before capturing the next image during Auto Focus.</p></body></html>
@@ -1069,34 +1197,34 @@
- -
+
-
Backlash:
- -
+
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
@@ -1191,15 +1319,53 @@
-
+
+
+ 0
+ 0
+
+
+
+ <html><body><p>HFR value in pixels consolidated at the current focuser position.</p></body></html>
+
+
+ 32767
+
+
+ true
+
true
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
-
- pixels
+ Stars:
+
+
+
+ -
+
+
+ <html><body><p>Number of stars used for HFR computation at the current focuser position.</p></body></html>
+
+
+ true
diff --git a/kstars/fitsviewer/fitsdata.cpp b/kstars/fitsviewer/fitsdata.cpp
--- a/kstars/fitsviewer/fitsdata.cpp
+++ b/kstars/fitsviewer/fitsdata.cpp
@@ -1954,7 +1954,7 @@
HFRs << center->HFR;
std::sort(HFRs.begin(), HFRs.end());
- double sum = std::accumulate(HFRs.begin(), HFRs.end(), 0);
+ double sum = std::accumulate(HFRs.begin(), HFRs.end(), 0.0);
double m = sum / HFRs.size();
if (HFRs.size() > 3)
@@ -1977,7 +1977,7 @@
});
// New mean
- sum = std::accumulate(HFRs.begin(), HFRs.end(), 0);
+ sum = std::accumulate(HFRs.begin(), HFRs.end(), 0.0);
m = sum / HFRs.size();
}
diff --git a/kstars/fitsviewer/fitsview.h b/kstars/fitsviewer/fitsview.h
--- a/kstars/fitsviewer/fitsview.h
+++ b/kstars/fitsviewer/fitsview.h
@@ -157,6 +157,7 @@
int findStars(StarAlgorithm algorithm = ALGORITHM_CENTROID, const QRect &searchBox = QRect());
void toggleStars(bool enable);
void setStarsEnabled(bool enable);
+ void setStarsHFREnabled(bool enable);
void setStarFilterRange(float const innerRadius, float const outerRadius);
int filterStars();
@@ -288,6 +289,7 @@
bool showObjects { false };
bool showEQGrid { false };
bool showPixelGrid { false };
+ bool showStarsHFR { false };
struct
{
diff --git a/kstars/fitsviewer/fitsview.cpp b/kstars/fitsviewer/fitsview.cpp
--- a/kstars/fitsviewer/fitsview.cpp
+++ b/kstars/fitsviewer/fitsview.cpp
@@ -880,9 +880,6 @@
{
painter->setRenderHint(QPainter::Antialiasing, Options::useAntialias());
- if (markStars)
- drawStarCentroid(painter);
-
if (trackingBoxEnabled && getCursorMode() != FITSView::scopeCursor)
drawTrackingBox(painter);
@@ -900,6 +897,9 @@
if (showPixelGrid)
drawPixelGrid(painter);
+
+ if (markStars)
+ drawStarCentroid(painter);
}
void FITSView::updateMode(FITSMode fmode)
@@ -938,19 +938,31 @@
void FITSView::drawStarCentroid(QPainter * painter)
{
- painter->setPen(QPen(Qt::red, 2));
+ float const ratio = currentZoom / ZOOM_DEFAULT;
- // image_data->getStarCenter();
+ if (showStarsHFR)
+ {
+ QFont painterFont;
+ painterFont.setPointSizeF(painterFont.pointSizeF() * 3 * ratio);
+ painter->setFont(painterFont);
+ }
- QList starCenters = imageData->getStarCenters();
+ painter->setPen(QPen(Qt::red, 2));
- for (int i = 0; i < starCenters.count(); i++)
+ foreach (Edge *starCenter, imageData->getStarCenters())
{
- int x1 = (starCenters[i]->x - starCenters[i]->width / 2) * (currentZoom / ZOOM_DEFAULT);
- int y1 = (starCenters[i]->y - starCenters[i]->width / 2) * (currentZoom / ZOOM_DEFAULT);
- int w = (starCenters[i]->width) * (currentZoom / ZOOM_DEFAULT);
+ int x1 = std::floor((starCenter->x - starCenter->width / 2.0f) * ratio);
+ int y1 = std::floor((starCenter->y - starCenter->width / 2.0f) * ratio);
+ int w = std::ceil(starCenter->width * ratio);
painter->drawEllipse(x1, y1, w, w);
+
+ if (showStarsHFR)
+ {
+ painter->setPen(QPen(Qt::red, 3));
+ painter->drawText(x1+w+5, y1+w/2, QString("%1").arg(starCenter->HFR, 0, 'f', 2));
+ painter->setPen(QPen(Qt::red, 2));
+ }
}
}
@@ -1928,3 +1940,8 @@
}
}
}
+
+void FITSView::setStarsHFREnabled(bool enable)
+{
+ showStarsHFR = enable;
+}