Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/focus/focus.cpp
Show First 20 Lines • Show All 1091 Lines • ▼ Show 20 Line(s) | 1076 | { | |||
---|---|---|---|---|---|
1092 | 1092 | | |||
1093 | // Get maximum HFR in the frame | 1093 | // Get maximum HFR in the frame | ||
1094 | currentHFR = image_data->getHFR(HFR_MAX); | 1094 | currentHFR = image_data->getHFR(HFR_MAX); | ||
1095 | } | 1095 | } | ||
1096 | } | 1096 | } | ||
1097 | } | 1097 | } | ||
1098 | 1098 | | |||
1099 | // Let's now report the current HFR | 1099 | // Let's now report the current HFR | ||
1100 | qCDebug(KSTARS_EKOS_FOCUS) << "Focus newFITS #" << HFRFrames.count() + 1 << ": Current HFR " << currentHFR; | 1100 | qCDebug(KSTARS_EKOS_FOCUS) << "Focus newFITS #" << HFRFrames.count() + 1 << ": Current HFR " << currentHFR << " Num stars " << (starSelected ? 1 : image_data->getDetectedStars()); | ||
1101 | // Add it to existing frames in case we need to take an average | 1101 | // Add it to existing frames in case we need to take an average | ||
1102 | HFRFrames.append(currentHFR); | 1102 | HFRFrames.append(currentHFR); | ||
1103 | 1103 | | |||
1104 | // Check if we need to average more than a single frame | 1104 | // Check if we need to average more than a single frame | ||
1105 | if (HFRFrames.count() >= focusFramesSpin->value()) | 1105 | if (HFRFrames.count() >= focusFramesSpin->value()) | ||
1106 | { | 1106 | { | ||
1107 | currentHFR = 0; | 1107 | currentHFR = 0; | ||
1108 | 1108 | | |||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | |||||
1164 | if (canAbsMove) | 1164 | if (canAbsMove) | ||
1165 | emit newHFR(currentHFR, static_cast<int>(currentPosition)); | 1165 | emit newHFR(currentHFR, static_cast<int>(currentPosition)); | ||
1166 | else | 1166 | else | ||
1167 | emit newHFR(currentHFR, -1); | 1167 | emit newHFR(currentHFR, -1); | ||
1168 | 1168 | | |||
1169 | // Format the HFR value into a string | 1169 | // Format the HFR value into a string | ||
1170 | QString HFRText = QString("%1").arg(currentHFR, 0, 'f', 2); | 1170 | QString HFRText = QString("%1").arg(currentHFR, 0, 'f', 2); | ||
1171 | HFROut->setText(HFRText); | 1171 | HFROut->setText(HFRText); | ||
1172 | starsOut->setText(QString("%1").arg(image_data->getDetectedStars())); | ||||
1172 | 1173 | | |||
1173 | // Display message in case _last_ HFR was negative | 1174 | // Display message in case _last_ HFR was negative | ||
1174 | if (lastHFR == -1) | 1175 | if (lastHFR == -1) | ||
1175 | appendLogText(i18n("FITS received. No stars detected.")); | 1176 | appendLogText(i18n("FITS received. No stars detected.")); | ||
1176 | 1177 | | |||
1177 | // If we have a valid HFR value | 1178 | // If we have a valid HFR value | ||
1178 | if (currentHFR > 0) | 1179 | if (currentHFR > 0) | ||
1179 | { | 1180 | { | ||
▲ Show 20 Lines • Show All 2204 Lines • ▼ Show 20 Line(s) | 3383 | { | |||
3384 | focusView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); | 3385 | focusView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); | ||
3385 | focusView->setBaseSize(focusingWidget->size()); | 3386 | focusView->setBaseSize(focusingWidget->size()); | ||
3386 | focusView->createFloatingToolBar(); | 3387 | focusView->createFloatingToolBar(); | ||
3387 | QVBoxLayout *vlayout = new QVBoxLayout(); | 3388 | QVBoxLayout *vlayout = new QVBoxLayout(); | ||
3388 | vlayout->addWidget(focusView); | 3389 | vlayout->addWidget(focusView); | ||
3389 | focusingWidget->setLayout(vlayout); | 3390 | focusingWidget->setLayout(vlayout); | ||
3390 | connect(focusView, &FITSView::trackingStarSelected, this, &Ekos::Focus::focusStarSelected, Qt::UniqueConnection); | 3391 | connect(focusView, &FITSView::trackingStarSelected, this, &Ekos::Focus::focusStarSelected, Qt::UniqueConnection); | ||
3391 | focusView->setStarsEnabled(true); | 3392 | focusView->setStarsEnabled(true); | ||
3393 | focusView->setStarsHFREnabled(true); | ||||
3392 | } | 3394 | } | ||
3393 | 3395 | | |||
3394 | } | 3396 | } |