Changeset View
Changeset View
Standalone View
Standalone View
kstars/ekos/capture/capture.cpp
Show First 20 Lines • Show All 1801 Lines • ▼ Show 20 Line(s) | 1787 | #endif | |||
---|---|---|---|---|---|
1802 | } | 1802 | } | ||
1803 | } | 1803 | } | ||
1804 | 1804 | | |||
1805 | return true; | 1805 | return true; | ||
1806 | } | 1806 | } | ||
1807 | 1807 | | |||
1808 | bool Capture::startFocusIfRequired() | 1808 | bool Capture::startFocusIfRequired() | ||
1809 | { | 1809 | { | ||
1810 | if (activeJob->getFrameType() != FRAME_LIGHT) | 1810 | if (activeJob == nullptr || activeJob->getFrameType() != FRAME_LIGHT) | ||
1811 | return false; | 1811 | return false; | ||
1812 | 1812 | | |||
1813 | // if (autoFocusReady == false) | | |||
1814 | // return false; | | |||
1815 | | ||||
1816 | // check if time for forced refocus | 1813 | // check if time for forced refocus | ||
1817 | if (refocusEveryNCheck->isChecked()) | 1814 | if (refocusEveryNCheck->isChecked()) | ||
1818 | { | 1815 | { | ||
1819 | qCDebug(KSTARS_EKOS_CAPTURE) << "Focus elapsed time (secs): " << getRefocusEveryNTimerElapsedSec() << ". Requested Interval (secs): " << refocusEveryN->value() * 60; | 1816 | qCDebug(KSTARS_EKOS_CAPTURE) << "Focus elapsed time (secs): " << getRefocusEveryNTimerElapsedSec() << ". Requested Interval (secs): " << refocusEveryN->value() * 60; | ||
1820 | isRefocus = getRefocusEveryNTimerElapsedSec() >= refocusEveryN->value() * 60; | 1817 | isRefocus = getRefocusEveryNTimerElapsedSec() >= refocusEveryN->value() * 60; | ||
1821 | } | 1818 | } | ||
1822 | else | 1819 | else | ||
1823 | isRefocus = false; | 1820 | isRefocus = false; | ||
▲ Show 20 Lines • Show All 1622 Lines • ▼ Show 20 Line(s) | 3441 | case Mount::FLIP_PLANNED: | |||
3446 | { | 3443 | { | ||
3447 | // it seems like the meridian flip had been postponed | 3444 | // it seems like the meridian flip had been postponed | ||
3448 | resumeSequence(); | 3445 | resumeSequence(); | ||
3449 | return; | 3446 | return; | ||
3450 | } | 3447 | } | ||
3451 | else | 3448 | else | ||
3452 | { | 3449 | { | ||
3453 | // If we are autoguiding, we should resume autoguiding after flip | 3450 | // If we are autoguiding, we should resume autoguiding after flip | ||
3454 | resumeGuidingAfterFlip = (guideState == GUIDE_GUIDING); | 3451 | resumeGuidingAfterFlip = isGuidingActive(); | ||
3455 | 3452 | | |||
3456 | if (m_State == CAPTURE_IDLE || m_State == CAPTURE_ABORTED || m_State == CAPTURE_COMPLETE || m_State == CAPTURE_PAUSED) | 3453 | if (m_State == CAPTURE_IDLE || m_State == CAPTURE_ABORTED || m_State == CAPTURE_COMPLETE || m_State == CAPTURE_PAUSED) | ||
3457 | { | 3454 | { | ||
3458 | setMeridianFlipStage(MF_INITIATED); | 3455 | setMeridianFlipStage(MF_INITIATED); | ||
3459 | emit newMeridianFlipStatus(Mount::FLIP_ACCEPTED); | 3456 | emit newMeridianFlipStatus(Mount::FLIP_ACCEPTED); | ||
3460 | } | 3457 | } | ||
3461 | else | 3458 | else | ||
3462 | setMeridianFlipStage(MF_REQUESTED); | 3459 | setMeridianFlipStage(MF_REQUESTED); | ||
▲ Show 20 Lines • Show All 1061 Lines • ▼ Show 20 Line(s) | 4503 | { | |||
4524 | } | 4521 | } | ||
4525 | } | 4522 | } | ||
4526 | 4523 | | |||
4527 | if (error > 0) | 4524 | if (error > 0) | ||
4528 | return "Error"; | 4525 | return "Error"; | ||
4529 | 4526 | | |||
4530 | if (aborted > 0) | 4527 | if (aborted > 0) | ||
4531 | { | 4528 | { | ||
4532 | //if (guideState >= GUIDE_GUIDING && deviationDetected) | | |||
4533 | if (m_State == CAPTURE_SUSPENDED) | 4529 | if (m_State == CAPTURE_SUSPENDED) | ||
4534 | return "Suspended"; | 4530 | return "Suspended"; | ||
4535 | else | 4531 | else | ||
4536 | return "Aborted"; | 4532 | return "Aborted"; | ||
4537 | } | 4533 | } | ||
4538 | 4534 | | |||
4539 | if (running > 0) | 4535 | if (running > 0) | ||
4540 | return "Running"; | 4536 | return "Running"; | ||
▲ Show 20 Lines • Show All 202 Lines • ▼ Show 20 Line(s) | |||||
4743 | 4739 | | |||
4744 | void Capture::setGuideStatus(GuideState state) | 4740 | void Capture::setGuideStatus(GuideState state) | ||
4745 | { | 4741 | { | ||
4746 | switch (state) | 4742 | switch (state) | ||
4747 | { | 4743 | { | ||
4748 | case GUIDE_IDLE: | 4744 | case GUIDE_IDLE: | ||
4749 | case GUIDE_ABORTED: | 4745 | case GUIDE_ABORTED: | ||
4750 | // If Autoguiding was started before and now stopped, let's abort (unless we're doing a meridian flip) | 4746 | // If Autoguiding was started before and now stopped, let's abort (unless we're doing a meridian flip) | ||
4751 | if (guideState == GUIDE_GUIDING && meridianFlipStage == MF_NONE && | 4747 | if (isGuidingActive() && meridianFlipStage == MF_NONE && | ||
4752 | ((activeJob && activeJob->getStatus() == SequenceJob::JOB_BUSY) || | 4748 | ((activeJob && activeJob->getStatus() == SequenceJob::JOB_BUSY) || | ||
4753 | this->m_State == CAPTURE_SUSPENDED || this->m_State == CAPTURE_PAUSED)) | 4749 | this->m_State == CAPTURE_SUSPENDED || this->m_State == CAPTURE_PAUSED)) | ||
4754 | { | 4750 | { | ||
4755 | appendLogText(i18n("Autoguiding stopped. Aborting...")); | 4751 | appendLogText(i18n("Autoguiding stopped. Aborting...")); | ||
4756 | abort(); | 4752 | abort(); | ||
4757 | } | 4753 | } | ||
4758 | break; | 4754 | break; | ||
4759 | 4755 | | |||
▲ Show 20 Lines • Show All 1177 Lines • ▼ Show 20 Line(s) | 5918 | { | |||
5937 | // Then if nothing else, just resume sequence. | 5933 | // Then if nothing else, just resume sequence. | ||
5938 | else | 5934 | else | ||
5939 | { | 5935 | { | ||
5940 | appendLogText(i18n("Resuming sequence...")); | 5936 | appendLogText(i18n("Resuming sequence...")); | ||
5941 | resumeSequence(); | 5937 | resumeSequence(); | ||
5942 | } | 5938 | } | ||
5943 | } | 5939 | } | ||
5944 | 5940 | | |||
5945 | // FIXME Migrate to Filter Manager | | |||
5946 | #if 0 | | |||
5947 | void Capture::loadFilterOffsets() | | |||
5948 | { | | |||
5949 | // Get all OAL equipment filter list | | |||
5950 | KStarsData::Instance()->userdb()->GetAllFilters(m_filterList); | | |||
5951 | filterFocusOffsets.clear(); | | |||
5952 | | ||||
5953 | for (int i = 0; i < FilterPosCombo->count(); i++) | | |||
5954 | { | | |||
5955 | FocusOffset * oneOffset = new FocusOffset; | | |||
5956 | oneOffset->filter = FilterPosCombo->itemText(i); | | |||
5957 | oneOffset->offset = 0; | | |||
5958 | | ||||
5959 | // Find matching filter if any and loads its offset | | |||
5960 | foreach (OAL::Filter * o, m_filterList) | | |||
5961 | { | | |||
5962 | if (o->vendor() == FilterCaptureCombo->currentText() && o->color() == oneOffset->filter) | | |||
5963 | { | | |||
5964 | oneOffset->offset = o->offset().toInt(); | | |||
5965 | break; | | |||
5966 | } | | |||
5967 | } | | |||
5968 | | ||||
5969 | filterFocusOffsets.append(oneOffset); | | |||
5970 | } | | |||
5971 | } | | |||
5972 | | ||||
5973 | void Capture::showFilterOffsetDialog() | | |||
5974 | { | | |||
5975 | loadFilterOffsets(); | | |||
5976 | | ||||
5977 | QDialog filterOffsetDialog; | | |||
5978 | | ||||
5979 | filterOffsetDialog.setWindowTitle(i18n("Filter Focus Offsets")); | | |||
5980 | | ||||
5981 | QDialogButtonBox * buttonBox = | | |||
5982 | new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &filterOffsetDialog); | | |||
5983 | | ||||
5984 | connect(buttonBox, SIGNAL(accepted()), &filterOffsetDialog, &Ekos::Capture::accept())); | | |||
5985 | connect(buttonBox, SIGNAL(rejected()), &filterOffsetDialog, &Ekos::Capture::reject())); | | |||
5986 | | ||||
5987 | QVBoxLayout * mainLayout = new QVBoxLayout(&filterOffsetDialog); | | |||
5988 | QGridLayout * grid = new QGridLayout(&filterOffsetDialog); | | |||
5989 | QHBoxLayout * tipLayout = new QHBoxLayout(&filterOffsetDialog); | | |||
5990 | | ||||
5991 | QLabel * tipIcon = new QLabel(&filterOffsetDialog); | | |||
5992 | QLabel * tipText = new QLabel(&filterOffsetDialog); | | |||
5993 | | ||||
5994 | tipIcon->setPixmap( | | |||
5995 | QIcon::fromTheme("kstars_flag").pixmap(QSize(32, 32))); | | |||
5996 | tipIcon->setFixedSize(32, 32); | | |||
5997 | | ||||
5998 | tipText->setText(i18n("Set <em>relative</em> filter focus offset in steps.")); | | |||
5999 | | ||||
6000 | tipLayout->addWidget(tipIcon); | | |||
6001 | tipLayout->addWidget(tipText); | | |||
6002 | | ||||
6003 | mainLayout->addLayout(grid); | | |||
6004 | mainLayout->addLayout(tipLayout); | | |||
6005 | mainLayout->addWidget(buttonBox); | | |||
6006 | | ||||
6007 | //filterOffsetDialog.setLayout(mainLayout); | | |||
6008 | | ||||
6009 | for (int i = 0; i < filterFocusOffsets.count(); i++) | | |||
6010 | { | | |||
6011 | FocusOffset * oneOffset = filterFocusOffsets.at(i); | | |||
6012 | | ||||
6013 | QLabel * label = new QLabel(oneOffset->filter, &filterOffsetDialog); | | |||
6014 | QSpinBox * spin = new QSpinBox(&filterOffsetDialog); | | |||
6015 | spin->setMinimum(-10000); | | |||
6016 | spin->setMaximum(10000); | | |||
6017 | spin->setSingleStep(100); | | |||
6018 | spin->setValue(oneOffset->offset); | | |||
6019 | | ||||
6020 | grid->addWidget(label, i, 0); | | |||
6021 | grid->addWidget(spin, i, 1); | | |||
6022 | } | | |||
6023 | | ||||
6024 | if (filterOffsetDialog.exec() == QDialog::Accepted) | | |||
6025 | { | | |||
6026 | for (int i = 0; i < filterFocusOffsets.count(); i++) | | |||
6027 | { | | |||
6028 | FocusOffset * oneOffset = filterFocusOffsets.at(i); | | |||
6029 | oneOffset->offset = static_cast<QSpinBox *>(grid->itemAtPosition(i, 1)->widget())->value(); | | |||
6030 | | ||||
6031 | // Find matching filter if any and save its offset | | |||
6032 | OAL::Filter * matchedFilter = nullptr; | | |||
6033 | | ||||
6034 | foreach (OAL::Filter * o, m_filterList) | | |||
6035 | { | | |||
6036 | if (o->vendor() == FilterCaptureCombo->currentText() && o->color() == oneOffset->filter) | | |||
6037 | { | | |||
6038 | o->setOffset(QString::number(oneOffset->offset)); | | |||
6039 | matchedFilter = o; | | |||
6040 | break; | | |||
6041 | } | | |||
6042 | } | | |||
6043 | | ||||
6044 | #if 0 | | |||
6045 | // If no filter exists, let's create one | | |||
6046 | if (matchedFilter == nullptr) | | |||
6047 | { | | |||
6048 | KStarsData::Instance()->userdb()->AddFilter(FilterCaptureCombo->currentText(), "", "", | | |||
6049 | QString::number(oneOffset->offset), oneOffset->filter, "1"); | | |||
6050 | } | | |||
6051 | // Or update Existing one | | |||
6052 | else | | |||
6053 | { | | |||
6054 | KStarsData::Instance()->userdb()->AddFilter(FilterCaptureCombo->currentText(), "", "", | | |||
6055 | QString::number(oneOffset->offset), oneOffset->filter, | | |||
6056 | matchedFilter->exposure(), matchedFilter->id()); | | |||
6057 | } | | |||
6058 | #endif | | |||
6059 | } | | |||
6060 | } | | |||
6061 | } | | |||
6062 | #endif | | |||
6063 | 5941 | | |||
6064 | void Capture::toggleVideo(bool enabled) | 5942 | void Capture::toggleVideo(bool enabled) | ||
6065 | { | 5943 | { | ||
6066 | if (currentCCD == nullptr) | 5944 | if (currentCCD == nullptr) | ||
6067 | return; | 5945 | return; | ||
6068 | 5946 | | |||
6069 | if (currentCCD->isBLOBEnabled() == false) | 5947 | if (currentCCD->isBLOBEnabled() == false) | ||
6070 | { | 5948 | { | ||
▲ Show 20 Lines • Show All 573 Lines • Show Last 20 Lines |