Commit d690d0bf authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Merge branch 'master' of git://anongit.kde.org/kstars

parents e120f3d0 bbf323c2
PROJECT(kstars CXX C)
set (KStars_VERSION_MAJOR 2)
set (KStars_VERSION_MINOR 7)
set (KStars_VERSION_REVISION 0)
set (KStars_VERSION_REVISION 1)
set (CMAKE_CXX_STANDARD 11)
#Build KStars Lite with -DKSTARS_LITE=ON
option(BUILD_KSTARS_LITE "Build KStars Lite" OFF)
......
......@@ -1167,9 +1167,9 @@ void Align::processTelescopeNumber(INumberVectorProperty *coord)
}
if (Options::alignmentLogging())
/*if (Options::alignmentLogging())
qDebug() << "Alignment: State is " << Ekos::getAlignStatusString(state) << " isSlewing? " << currentTelescope->isSlewing() << " slew Dirty? " << slew_dirty
<< " Current GOTO Mode? " << currentGotoMode << " LoadSlewState? " << pstateStr(loadSlewState);
<< " Current GOTO Mode? " << currentGotoMode << " LoadSlewState? " << pstateStr(loadSlewState);*/
switch (azStage)
{
......
......@@ -440,7 +440,7 @@ void Capture::stop(bool abort)
secondsLabel->clear();
disconnect(currentCCD, SIGNAL(BLOBUpdated(IBLOB*)), this, SLOT(newFITS(IBLOB*)));
disconnect(currentCCD, SIGNAL(newImage(QImage*,ISD::CCDChip*)), this, SLOT(sendNewImage(QImage*,ISD::CCDChip*)));
disconnect(currentCCD, SIGNAL(newExposureValue(ISD::CCDChip*,double, IPState)), this, SLOT(updateCaptureProgress(ISD::CCDChip*,double,IPState)));
disconnect(currentCCD, SIGNAL(newExposureValue(ISD::CCDChip*,double, IPState)), this, SLOT(setExposureProgress(ISD::CCDChip*,double,IPState)));
currentCCD->setFITSDir("");
......@@ -1024,7 +1024,7 @@ void Capture::newFITS(IBLOB *bp)
bool Capture::setCaptureComplete()
{
disconnect(currentCCD, SIGNAL(newExposureValue(ISD::CCDChip*,double,IPState)), this, SLOT(updateCaptureProgress(ISD::CCDChip*,double,IPState)));
disconnect(currentCCD, SIGNAL(newExposureValue(ISD::CCDChip*,double,IPState)), this, SLOT(setExposureProgress(ISD::CCDChip*,double,IPState)));
DarkLibrary::Instance()->disconnect(this);
secondsLabel->setText(i18n("Complete."));
......@@ -1281,7 +1281,7 @@ void Capture::captureImage()
switch (rc)
{
case SequenceJob::CAPTURE_OK:
connect(currentCCD, SIGNAL(newExposureValue(ISD::CCDChip*,double,IPState)), this, SLOT(updateCaptureProgress(ISD::CCDChip*,double,IPState)), Qt::UniqueConnection);
connect(currentCCD, SIGNAL(newExposureValue(ISD::CCDChip*,double,IPState)), this, SLOT(setExposureProgress(ISD::CCDChip*,double,IPState)), Qt::UniqueConnection);
appendLogText(i18n("Capturing image..."));
break;
......@@ -1423,17 +1423,20 @@ void Capture::clearLog()
emit newLog();
}
void Capture::updateCaptureProgress(ISD::CCDChip * tChip, double value, IPState state)
void Capture::setExposureProgress(ISD::CCDChip * tChip, double value, IPState state)
{
if (targetChip != tChip || targetChip->getCaptureMode() != FITS_NORMAL || meridianFlipStage >= MF_ALIGNING)
return;
exposeOUT->setText(QString::number(value, 'd', 2));
if (activeJob)
{
activeJob->setExposeLeft(value);
emit newExposureProgress(activeJob);
}
if (activeJob && state == IPS_ALERT)
{
int retries = activeJob->getCaptureRetires()+1;
......@@ -1712,6 +1715,8 @@ void Capture::removeJob()
SequenceJob *job = jobs.at(currentRow);
jobs.removeOne(job);
if (job == activeJob)
activeJob = NULL;
delete (job);
if (queueTable->rowCount() == 0)
......@@ -2980,6 +2985,7 @@ void Capture::processTelescopeNumber(INumberVectorProperty *nvp)
appendLogText(i18n("Performing post flip re-alignment..."));
secondsLabel->setText(i18n("Aligning..."));
retries = 0;
state = CAPTURE_ALIGNING;
emit newStatus(Ekos::CAPTURE_ALIGNING);
......@@ -2989,6 +2995,7 @@ void Capture::processTelescopeNumber(INumberVectorProperty *nvp)
return;
}
retries = 0;
checkGuidingAfterFlip();
break;
......@@ -3124,6 +3131,7 @@ void Capture::setAlignStatus(AlignState state)
if (meridianFlipStage == MF_ALIGNING)
{
appendLogText(i18n("Post flip re-alignment completed successfully."));
retries = 0;
checkGuidingAfterFlip();
}
break;
......@@ -3132,8 +3140,21 @@ void Capture::setAlignStatus(AlignState state)
// TODO run it 3 times before giving up
if (meridianFlipStage == MF_ALIGNING)
{
appendLogText(i18n("Post-flip alignment failed."));
abort();
if (++retries == 3)
{
appendLogText(i18n("Post-flip alignment failed."));
abort();
}
else
{
appendLogText(i18n("Post-flip alignment failed. Retrying..."));
secondsLabel->setText(i18n("Aligning..."));
this->state = CAPTURE_ALIGNING;
emit newStatus(Ekos::CAPTURE_ALIGNING);
meridianFlipStage = MF_ALIGNING;
}
}
break;
......@@ -3172,8 +3193,16 @@ void Capture::setGuideStatus(GuideState state)
// TODO try restarting calibration a couple of times before giving up
if (meridianFlipStage == MF_GUIDING)
{
appendLogText(i18n("Post meridian flip calibration error. Aborting..."));
abort();
if (++retries == 3)
{
appendLogText(i18n("Post meridian flip calibration error. Aborting..."));
abort();
}
else
{
appendLogText(i18n("Post meridian flip calibration error. Restarting..."));
checkGuidingAfterFlip();
}
}
break;
......
......@@ -396,7 +396,7 @@ private slots:
void checkFrameType(int index);
void resetFrame();
void updateCaptureProgress(ISD::CCDChip *tChip, double value, IPState state);
void setExposureProgress(ISD::CCDChip *tChip, double value, IPState state);
void checkSeqBoundary(const QString &path);
void saveFITSDirectory();
void setDefaultCCD(QString ccd);
......@@ -448,6 +448,7 @@ signals:
void meridianFlipCompleted();
void newStatus(Ekos::CaptureState status);
void newImage(QImage *image, Ekos::SequenceJob *job);
void newExposureProgress(Ekos::SequenceJob *job);
private:
......
......@@ -97,9 +97,13 @@ EkosManager::EkosManager(QWidget *parent) : QDialog(parent)
mountPI=capturePI=focusPI=guidePI=NULL;
captureProgress->setValue(0);
sequenceProgress->setValue(0);
sequenceProgress->setValue(0);
sequenceProgress->setDecimals(0);
sequenceProgress->setFormat("%v");
imageProgress->setValue(0);
imageProgress->setDecimals(1);
imageProgress->setFormat("%v");
imageProgress->setBarStyle(QRoundProgressBar::StyleLine);
countdownTimer.setInterval(1000);
connect(&countdownTimer, SIGNAL(timeout()), this, SLOT(updateCaptureCountDown()));
......@@ -312,6 +316,7 @@ void EkosManager::reset()
captureProgress->setValue(0);
overallRemainingTime->setText("--:--:--");
sequenceRemainingTime->setText("--:--:--");
imageRemainingTime->setText("--:--:--");
mountStatus->setText(i18n("Idle"));
captureStatus->setText(i18n("Idle"));
focusStatus->setText(i18n("Idle"));
......@@ -1377,9 +1382,11 @@ void EkosManager::initCapture()
connect(captureProcess, SIGNAL(newLog()), this, SLOT(updateLog()));
connect(captureProcess, SIGNAL(newStatus(Ekos::CaptureState)), this, SLOT(updateCaptureStatus(Ekos::CaptureState)));
connect(captureProcess, SIGNAL(newImage(QImage*, Ekos::SequenceJob*)), this, SLOT(updateCaptureProgress(QImage*, Ekos::SequenceJob*)));
connect(captureProcess, SIGNAL(newExposureProgress(Ekos::SequenceJob*)), this, SLOT(updateExposureProgress(Ekos::SequenceJob*)));
captureGroup->setEnabled(true);
sequenceProgress->setEnabled(true);
captureProgress->setEnabled(true);
imageProgress->setEnabled(true);
capturePI = new QProgressIndicator(captureProcess);
captureStatusLayout->addWidget(capturePI);
......@@ -1880,6 +1887,7 @@ void EkosManager::updateCaptureStatus(Ekos::CaptureState status)
capturePI->stopAnimation();
countdownTimer.stop();
imageRemainingTime->setText("--:--:--");
overallRemainingTime->setText("--:--:--");
sequenceRemainingTime->setText("--:--:--");
}
......@@ -1895,11 +1903,10 @@ void EkosManager::updateCaptureProgress(QImage *image, Ekos::SequenceJob *job)
previewImage->setPixmap(previewPixmap->scaled(previewImage->width(), previewImage->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
}
if (job->isPreview() == false)
{
// Image is set to NULL only on initial capture start up
int completed = (image == NULL) ? job->getCompleted() : job->getCompleted()+1;
int completed = (image == NULL) ? job->getCompleted() : job->getCompleted()+1;
sequenceLabel->setText(QString("Job # %1/%2 %3 (%4/%5)").arg(captureProcess->getActiveJobID()+1).arg(captureProcess->getJobCount()).arg(job->getPrefix()).arg(completed).arg(job->getCount()));
sequenceProgress->setRange(0, job->getCount());
......@@ -1907,8 +1914,21 @@ void EkosManager::updateCaptureProgress(QImage *image, Ekos::SequenceJob *job)
}
}
void EkosManager::updateCaptureCountDown()
void EkosManager::updateExposureProgress(Ekos::SequenceJob *job)
{
imageCountDown.setHMS(0,0,0);
imageCountDown = imageCountDown.addSecs(job->getExposeLeft());
if (imageCountDown.hour() == 23)
imageCountDown.setHMS(0,0,0);
imageProgress->setRange(0, job->getExposure());
imageProgress->setValue(job->getExposeLeft());
imageRemainingTime->setText(imageCountDown.toString("hh:mm:ss"));
}
void EkosManager::updateCaptureCountDown()
{
overallCountDown = overallCountDown.addSecs(-1);
if (overallCountDown.hour() == 23)
overallCountDown.setHMS(0,0,0);
......@@ -1918,7 +1938,7 @@ void EkosManager::updateCaptureCountDown()
sequenceCountDown.setHMS(0,0,0);
overallRemainingTime->setText(overallCountDown.toString("hh:mm:ss"));
sequenceRemainingTime->setText(sequenceCountDown.toString("hh:mm:ss"));
sequenceRemainingTime->setText(sequenceCountDown.toString("hh:mm:ss"));
}
void EkosManager::updateFocusStarPixmap(QPixmap &starPixmap)
......
......@@ -193,6 +193,7 @@ private slots:
// Capture Summary
void updateCaptureStatus(Ekos::CaptureState status);
void updateCaptureProgress(QImage *image, Ekos::SequenceJob *job);
void updateExposureProgress(Ekos::SequenceJob *job);
void updateCaptureCountDown();
// Focus summary
......@@ -272,6 +273,7 @@ private slots:
QProgressIndicator *mountPI;
// Capture Summary
QTime imageCountDown;
QTime overallCountDown;
QTime sequenceCountDown;
QTimer countdownTimer;
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>546</width>
<height>636</height>
<width>612</width>
<height>652</height>
</rect>
</property>
<property name="maximumSize">
......@@ -434,22 +434,7 @@
<property name="title">
<string>Capture</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<property name="spacing">
<number>1</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_13">
<item>
<layout class="QHBoxLayout" name="captureStatusLayout">
<property name="spacing">
......@@ -533,8 +518,91 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<property name="spacing">
<number>1</number>
<number>3</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_10">
<property name="spacing">
<number>1</number>
</property>
<item>
<widget class="QLabel" name="sequenceLabel_2">
<property name="text">
<string>Image</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<property name="spacing">
<number>1</number>
</property>
<item>
<spacer name="horizontalSpacer_11">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>13</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QRoundProgressBar" name="imageProgress" native="true">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12"/>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>13</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="imageRemainingTime">
<property name="text">
<string>--:--:--</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="spacing">
......
......@@ -2280,6 +2280,11 @@ void Focus::checkAutoStarTimeout()
abort();
setAutoFocusResult(false);
}
else if (state == FOCUS_WAITING)
{
state = FOCUS_IDLE;
emit newStatus(state);
}
}
void Focus::setAbsoluteFocusTicks()
......
......@@ -1000,7 +1000,7 @@ bool Guide::dither()
if (state != GUIDE_GUIDING)
capture();
state = GUIDE_DITHERING;
setStatus(GUIDE_DITHERING);
return true;
}
......@@ -1191,7 +1191,7 @@ void Guide::setStatus(Ekos::GuideState newState)
break;
case GUIDE_GUIDING:
if (previousState == GUIDE_SUSPENDED)
if (previousState == GUIDE_SUSPENDED || previousState == GUIDE_DITHERING_SUCCESS)
appendLogText(i18n("Guiding resumed."));
else
{
......@@ -1231,11 +1231,9 @@ void Guide::setStatus(Ekos::GuideState newState)
break;
case GUIDE_DITHERING_SUCCESS:
appendLogText(i18n("Dithering completed successfully. Resuming guiding..."));
emit newStatus(state);
appendLogText(i18n("Dithering completed successfully."));
// Go back to guiding state immediately
state = GUIDE_GUIDING;
emit newStatus(state);
setStatus(GUIDE_GUIDING);
capture();
break;
default:
......@@ -1809,7 +1807,7 @@ void Guide::setAxisDelta(double ra, double de)
emit newAxisDelta(ra,de);
profilePixmap = driftGraph->grab(QRect(QPoint(0, 50), QSize(driftGraph->width(), 101)));
profilePixmap = driftGraph->grab(QRect(QPoint(0, 50), QSize(driftGraph->width(), 150)));
emit newProfilePixmap(profilePixmap);
}
......
......@@ -725,8 +725,8 @@ int FITSData::findCannyStar(FITSData *data, const QRect &boundary)
template<typename T> int FITSData::findCannyStar(FITSData *data, const QRect &boundary)
{
int subX = boundary.isNull() ? 0 : boundary.x();
int subY = boundary.isNull() ? 0 : boundary.y();
int subX = qMax(0, boundary.isNull() ? 0 : boundary.x());
int subY = qMax(0, boundary.isNull() ? 0 : boundary.y());
int subW = (boundary.isNull() ? data->getWidth() : boundary.width());
int subH = (boundary.isNull() ? data->getHeight(): boundary.height());
......
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