[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kstars/dbus_work] kstars: Capture module DBus migration first pass is complete. All connections mig
From:       Jasem Mutlaq <null () kde ! org>
Date:       2018-09-02 10:35:28
Message-ID: E1fwPj6-0006n3-LH () code ! kde ! org
[Download RAW message or body]

Git commit 7d6d6d386c23a08495c7925cfd16baddd5f617d1 by Jasem Mutlaq.
Committed on 02/09/2018 at 10:35.
Pushed by mutlaqja into branch 'dbus_work'.

Capture module DBus migration first pass is complete. All connections migrated to new \
Qt style

M  +1    -1    kstars/CMakeLists.txt
M  +24   -6    kstars/ekos/align/align.cpp
M  +236  -167  kstars/ekos/capture/capture.cpp
M  +48   -31   kstars/ekos/capture/capture.h
M  +17   -1    kstars/ekos/ekos.cpp
M  +14   -5    kstars/ekos/ekos.h
R  +2    -2    kstars/ekos/manager.cpp
M  +36   -11   kstars/ekos/mount/mount.cpp
M  +209  -164  kstars/ekos/scheduler/scheduler.cpp
M  +9    -2    kstars/ekos/scheduler/scheduler.h
M  +4    -4    kstars/indi/indiccd.cpp
M  +1    -1    kstars/indi/indiccd.h
M  +28   -24   kstars/org.kde.kstars.Ekos.Capture.xml

https://commits.kde.org/kstars/7d6d6d386c23a08495c7925cfd16baddd5f617d1

diff --cc kstars/ekos/capture/capture.cpp
index b1c769ad1,219de8c55..702432ee3
--- a/kstars/ekos/capture/capture.cpp
+++ b/kstars/ekos/capture/capture.cpp
@@@ -48,6 -48,6 +48,9 @@@ Capture::Capture(
  {
      setupUi(this);
  
++    qRegisterMetaType<Ekos::CaptureState>("Ekos::CaptureState");
++    qDBusRegisterMetaType<Ekos::CaptureState>();
++
      new CaptureAdaptor(this);
      QDBusConnection::sessionBus().registerObject("/KStars/Ekos/Capture", this);
  
@@@ -66,10 -66,10 +69,10 @@@
      seqFileCount = 0;
      //seqWatcher		= new KDirWatch();
      seqTimer = new QTimer(this);
--    connect(seqTimer, SIGNAL(timeout()), this, SLOT(captureImage()));
++    connect(seqTimer, &QTimer::timeout, this, &Ekos::Capture::captureImage);
  
--    connect(startB, SIGNAL(clicked()), this, SLOT(toggleSequence()));
--    connect(pauseB, SIGNAL(clicked()), this, SLOT(pause()));
++    connect(startB, &QPushButton::clicked, this, &Ekos::Capture::toggleSequence);
++    connect(pauseB, &QPushButton::clicked, this, &Ekos::Capture::pause);
  
      startB->setIcon(QIcon::fromTheme("media-playback-start"));
      startB->setAttribute(Qt::WA_LayoutUsesWidgetRect);
@@@ -81,17 -81,17 +84,17 @@@
  
      FilterDevicesCombo->addItem("--");
  
--    connect(binXIN, SIGNAL(valueChanged(int)), binYIN, SLOT(setValue(int)));
++    connect(binXIN, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), \
binYIN, &QSpinBox::setValue);  
--    connect(CCDCaptureCombo, SIGNAL(activated(QString)), this, \
                SLOT(setDefaultCCD(QString)));
--    connect(CCDCaptureCombo, SIGNAL(activated(int)), this, SLOT(checkCCD(int)));
++    connect(CCDCaptureCombo, static_cast<void (QComboBox::*)(const \
QString&)>(&QComboBox::activated), this, &Ekos::Capture::setDefaultCCD); ++    \
connect(CCDCaptureCombo, static_cast<void \
(QComboBox::*)(int)>(&QComboBox::activated), this, &Ekos::Capture::checkCCD);  
--    connect(liveVideoB, SIGNAL(clicked(bool)), this, SLOT(toggleVideo(bool)));
++    connect(liveVideoB, &QPushButton::clicked, this, &Ekos::Capture::toggleVideo);
  
      guideDeviationTimer.setInterval(GD_TIMER_TIMEOUT);
--    connect(&guideDeviationTimer, SIGNAL(timeout()), this, \
SLOT(checkGuideDeviationTimeout())); ++    connect(&guideDeviationTimer, \
&QTimer::timeout, this, &Ekos::Capture::checkGuideDeviationTimeout);  
--    connect(FilterDevicesCombo, SIGNAL(activated(int)), this, \
SLOT(checkFilter(int))); ++    connect(FilterDevicesCombo, static_cast<void \
(QComboBox::*)(int)>(&QComboBox::activated), this, &Ekos::Capture::checkFilter);  
      connect(temperatureCheck, &QCheckBox::toggled, [this](bool toggled)
      {
@@@ -108,30 -108,30 +111,30 @@@
      {
          updateHFRThreshold();
      });
--    connect(previewB, SIGNAL(clicked()), this, SLOT(captureOne()));
--
--    //connect( seqWatcher, SIGNAL(dirty(QString)), this, \
                SLOT(checkSeqFile(QString)));
--
--    connect(addToQueueB, SIGNAL(clicked()), this, SLOT(addJob()));
--    connect(removeFromQueueB, SIGNAL(clicked()), this, SLOT(removeJob()));
--    connect(queueUpB, SIGNAL(clicked()), this, SLOT(moveJobUp()));
--    connect(queueDownB, SIGNAL(clicked()), this, SLOT(moveJobDown()));
--    connect(selectFITSDirB, SIGNAL(clicked()), this, SLOT(saveFITSDirectory()));
--    connect(queueSaveB, SIGNAL(clicked()), this, SLOT(saveSequenceQueue()));
--    connect(queueSaveAsB, SIGNAL(clicked()), this, SLOT(saveSequenceQueueAs()));
--    connect(queueLoadB, SIGNAL(clicked()), this, SLOT(loadSequenceQueue()));
--    connect(resetB, SIGNAL(clicked()), this, SLOT(resetJobs()));
--    connect(queueTable, SIGNAL(doubleClicked(QModelIndex)), this, \
                SLOT(editJob(QModelIndex)));
--    connect(queueTable, SIGNAL(itemSelectionChanged()), this, \
SLOT(resetJobEdit())); ++    connect(previewB, &QPushButton::clicked, this, \
&Ekos::Capture::captureOne); ++
++    //connect( seqWatcher, SIGNAL(dirty(QString)), this, \
&Ekos::Capture::checkSeqFile(QString))); ++
++    connect(addToQueueB, &QPushButton::clicked, this, &Ekos::Capture::addJob);
++    connect(removeFromQueueB, &QPushButton::clicked, this, \
&Ekos::Capture::removeJob); ++    connect(queueUpB, &QPushButton::clicked, this, \
&Ekos::Capture::moveJobUp); ++    connect(queueDownB, &QPushButton::clicked, this, \
&Ekos::Capture::moveJobDown); ++    connect(selectFITSDirB, &QPushButton::clicked, \
this, &Ekos::Capture::saveFITSDirectory); ++    connect(queueSaveB, \
&QPushButton::clicked, this, \
static_cast<void(Ekos::Capture::*)()>(&Ekos::Capture::saveSequenceQueue)); ++    \
connect(queueSaveAsB, &QPushButton::clicked, this, \
&Ekos::Capture::saveSequenceQueueAs); ++    connect(queueLoadB, \
&QPushButton::clicked, this, \
static_cast<void(Ekos::Capture::*)()>(&Ekos::Capture::loadSequenceQueue)); ++    \
connect(resetB, &QPushButton::clicked, this, &Ekos::Capture::resetJobs); ++    \
connect(queueTable, &QAbstractItemView::doubleClicked, this, \
&Ekos::Capture::editJob); ++    connect(queueTable, \
&QTableWidget::itemSelectionChanged, this, &Ekos::Capture::resetJobEdit);  \
connect(setTemperatureB, &QPushButton::clicked, [&]() {  if (currentCCD)
              currentCCD->setTemperature(temperatureIN->value());
--    });
--    connect(temperatureIN, SIGNAL(editingFinished()), setTemperatureB, \
                SLOT(setFocus()));
--    connect(frameTypeCombo, SIGNAL(currentIndexChanged(int)), this, \
                SLOT(checkFrameType(int)));
--    connect(resetFrameB, SIGNAL(clicked()), this, SLOT(resetFrame()));
--    connect(calibrationB, SIGNAL(clicked()), this, SLOT(openCalibrationDialog()));
--    connect(rotatorB, SIGNAL(clicked()), rotatorSettings.get(), SLOT(show()));
++    });   
++    connect(temperatureIN, &QDoubleSpinBox::editingFinished, setTemperatureB, \
static_cast<void (QPushButton::*)()>(&QPushButton::setFocus)); ++    \
connect(frameTypeCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), \
this, &Ekos::Capture::checkFrameType); ++    connect(resetFrameB, \
&QPushButton::clicked, this, &Ekos::Capture::resetFrame); ++    connect(calibrationB, \
&QPushButton::clicked, this, &Ekos::Capture::openCalibrationDialog); ++    \
connect(rotatorB, &QPushButton::clicked, rotatorSettings.get(), \
&Ekos::Capture::show);  
      addToQueueB->setIcon(QIcon::fromTheme("list-add"));
      addToQueueB->setAttribute(Qt::WA_LayoutUsesWidgetRect);
@@@ -171,33 -171,33 +174,43 @@@
      guideDeviation->setValue(Options::guideDeviation());
      autofocusCheck->setChecked(Options::enforceAutofocus());
      refocusEveryNCheck->setChecked(Options::enforceRefocusEveryN());
--    meridianCheck->setChecked(Options::autoMeridianFlip());
++    meridianCheck->setChecked(Options::autoMeridianFlip());    
      meridianHours->setValue(Options::autoMeridianHours());
  
--    connect(autofocusCheck, SIGNAL(toggled(bool)), this, SLOT(setDirty()));
--    connect(refocusEveryNCheck, SIGNAL(toggled(bool)), this, SLOT(setDirty()));
--    connect(HFRPixels, SIGNAL(valueChanged(double)), this, SLOT(setDirty()));
--    connect(guideDeviationCheck, SIGNAL(toggled(bool)), this, SLOT(setDirty()));
--    connect(guideDeviation, SIGNAL(valueChanged(double)), this, SLOT(setDirty()));
--    connect(meridianCheck, SIGNAL(toggled(bool)), this, SLOT(setDirty()));
--    connect(meridianHours, SIGNAL(valueChanged(double)), this, SLOT(setDirty()));
--    connect(uploadModeCombo, SIGNAL(activated(int)), this, SLOT(setDirty()));
--    connect(remoteDirIN, SIGNAL(editingFinished()), this, SLOT(setDirty()));
--
--    observerName = Options::defaultObserver();
++    QCheckBox * const checkBoxes[] = {
++        guideDeviationCheck,
++        refocusEveryNCheck,
++        guideDeviationCheck,
++        meridianCheck
++    };
++    for (const QCheckBox* control : checkBoxes)
++        connect(control, &QCheckBox::toggled, this, &Ekos::Capture::setDirty);
++
++    QDoubleSpinBox *const dspinBoxes[] {
++        HFRPixels,
++        guideDeviation,
++        meridianHours
++    };
++    for (const QDoubleSpinBox *control : dspinBoxes)
++       connect(control, static_cast<void \
(QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged), this, \
&Ekos::Capture::setDirty); ++
++    connect(uploadModeCombo, static_cast<void \
(QComboBox::*)(int)>(&QComboBox::activated), this, &Ekos::Capture::setDirty); ++    \
connect(remoteDirIN, &QLineEdit::editingFinished, this, &Ekos::Capture::setDirty); ++
++    m_ObserverName = Options::defaultObserver();
      observerB->setIcon(QIcon::fromTheme("im-user"));
      observerB->setAttribute(Qt::WA_LayoutUsesWidgetRect);
--    connect(observerB, SIGNAL(clicked()), this, SLOT(showObserverDialog()));
++    connect(observerB, &QPushButton::clicked, this, \
&Ekos::Capture::showObserverDialog);  
      // Post capture script
--    connect(&postCaptureScript, SIGNAL(finished(int)), this, \
SLOT(postScriptFinished(int))); ++    connect(&postCaptureScript, static_cast<void \
(QProcess::*)(int exitCode)>(&QProcess::finished), this, \
&Ekos::Capture::postScriptFinished);  
      // Remote directory
      connect(uploadModeCombo, static_cast<void \
(QComboBox::*)(int)>(&QComboBox::activated), this,  [&](int index) { \
remoteDirIN->setEnabled(index != 0); });  
      customPropertiesDialog.reset(new CustomProperties());
--    connect(customValuesB, SIGNAL(clicked()), customPropertiesDialog.get(), \
SLOT(show())); ++    connect(customValuesB, &QPushButton::clicked, \
customPropertiesDialog.get(), &Ekos::Capture::show);  
      flatFieldSource = \
                static_cast<FlatFieldSource>(Options::calibrationFlatSourceIndex());
      flatFieldDuration = \
static_cast<FlatFieldDuration>(Options::calibrationFlatDurationIndex()); @@@ -289,7 \
-289,7 +302,7 @@@ void Capture::addFilter(ISD::GDInterfac  void Capture::pause()
  {
      pauseFunction = nullptr;
--    state         = CAPTURE_PAUSED;
++    m_State         = CAPTURE_PAUSED;
      emit newStatus(Ekos::CAPTURE_PAUSED);
      appendLogText(i18n("Sequence shall be paused after current exposure is \
complete."));  pauseB->setEnabled(false);
@@@ -300,14 -300,14 +313,14 @@@
  
  void Capture::toggleSequence()
  {
--    if (state == CAPTURE_PAUSED)
++    if (m_State == CAPTURE_PAUSED)
      {
          startB->setIcon(
                      QIcon::fromTheme("media-playback-stop"));
          startB->setToolTip(i18n("Stop Sequence"));
          pauseB->setEnabled(true);
  
--        state = CAPTURE_CAPTURING;
++        m_State = CAPTURE_CAPTURING;
          emit newStatus(Ekos::CAPTURE_CAPTURING);
  
          appendLogText(i18n("Sequence resumed."));
@@@ -316,7 -316,7 +329,7 @@@
          if (pauseFunction)
              (this->*pauseFunction)();
      }
--    else if (state == CAPTURE_IDLE || state == CAPTURE_ABORTED || state == \
CAPTURE_COMPLETE) ++    else if (m_State == CAPTURE_IDLE || m_State == \
CAPTURE_ABORTED || m_State == CAPTURE_COMPLETE)  {
          start();
      }
@@@ -386,7 -386,7 +399,7 @@@ void Capture::start(
      // Record initialHA and initialMount position when we are starting fresh
      // If recovering from deviation error, these values should not be recorded.
      // Refocus timer should not be reset on deviation error
-     if (deviationDetected == false)
 -    if (deviationDetected == false && state != CAPTURE_SUSPENDED)
++    if (deviationDetected == false && m_State != CAPTURE_SUSPENDED)
      {
          initialHA         = getCurrentHA();
          qCDebug(KSTARS_EKOS_CAPTURE) << "Initial hour angle:" << initialHA;
@@@ -413,7 -422,7 +435,7 @@@
      ditherCounter     = Options::ditherFrames();
      inSequenceFocusCounter = Options::inSequenceCheckFrames();
  
--    state = CAPTURE_PROGRESS;
++    m_State = CAPTURE_PROGRESS;
      emit newStatus(Ekos::CAPTURE_PROGRESS);
  
      startB->setIcon(QIcon::fromTheme("media-playback-stop"));
@@@ -484,7 -507,7 +520,7 @@@ void Capture::stop(CaptureState targetS
      }
  
      calibrationStage = CAL_NONE;
-     state            = abort ? CAPTURE_ABORTED : CAPTURE_IDLE;
 -    state            = targetState;
++    m_State            = targetState;
  
      // Turn off any calibration light, IF they were turned on by Capture module
      if (dustCap && dustCapLightEnabled)
@@@ -499,11 -522,11 +535,9 @@@
      }
  
      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(setExposureProgress(ISD::CCDChip*, double, IPState)));
++    disconnect(currentCCD, &ISD::CCD::BLOBUpdated, this, &Ekos::Capture::newFITS);
++    disconnect(currentCCD, &ISD::CCD::newImage, this,  \
&Ekos::Capture::sendNewImage); ++    disconnect(currentCCD, \
&ISD::CCD::newExposureValue, this,  &Ekos::Capture::setExposureProgress);  
      currentCCD->setFITSDir("");
  
@@@ -520,7 -543,7 +554,7 @@@
  
      setBusy(false);
  
-     if (abort)
 -    if (state == CAPTURE_ABORTED || state == CAPTURE_SUSPENDED)
++    if (m_State == CAPTURE_ABORTED || m_State == CAPTURE_SUSPENDED)
      {
          startB->setIcon(
                      QIcon::fromTheme("media-playback-start"));
@@@ -536,13 -559,13 +570,17 @@@
      activeJob = nullptr;
  }
  
--void Capture::sendNewImage(QImage *image, ISD::CCDChip *myChip)
++void Capture::sendNewImage(QImage *image, const QString &filename, ISD::CCDChip \
*myChip)  {
      if (activeJob && myChip == targetChip)
++    {
          emit newImage(image, activeJob);
++        if (image && activeJob->isPreview() == false)
++            emit newSequenceImage(filename);
++    }
  }
  
--bool Capture::setCCD(const QString &device)
++bool Capture::setCamera(const QString &device)
  {
      for (int i = 0; i < CCDCaptureCombo->count(); i++)
          if (device == CCDCaptureCombo->itemText(i))
@@@ -555,6 -578,6 +593,14 @@@
      return false;
  }
  
++QString Capture::camera()
++{
++     if (currentCCD)
++         return currentCCD->getDeviceName();
++
++     return QString();
++}
++
  void Capture::checkCCD(int ccdNum)
  {
      if (ccdNum == -1)
@@@ -567,11 -590,11 +613,10 @@@
  
      foreach (ISD::CCD *ccd, CCDs)
      {
--        disconnect(ccd, SIGNAL(numberUpdated(INumberVectorProperty*)), this,
--                   SLOT(processCCDNumber(INumberVectorProperty*)));
--        disconnect(ccd, SIGNAL(newTemperatureValue(double)), this, \
                SLOT(updateCCDTemperature(double)));
--        disconnect(ccd, SIGNAL(newRemoteFile(QString)), this, \
                SLOT(setNewRemoteFile(QString)));
--        disconnect(ccd, SIGNAL(videoStreamToggled(bool)), this, \
SLOT(setVideoStreamEnabled(bool))); ++        disconnect(ccd, \
&ISD::CCD::numberUpdated, this, &Ekos::Capture::processCCDNumber); ++        \
disconnect(ccd, &ISD::CCD::newTemperatureValue, this, \
&Ekos::Capture::updateCCDTemperature); ++        disconnect(ccd, \
&ISD::CCD::newRemoteFile, this, &Ekos::Capture::setNewRemoteFile); ++        \
disconnect(ccd, &ISD::CCD::videoStreamToggled, this, \
&Ekos::Capture::setVideoStreamEnabled);  }
  
      if (ccdNum <= CCDs.count())
@@@ -704,12 -727,12 +749,10 @@@
          liveVideoB->setEnabled(currentCCD->hasVideoStream());
          setVideoStreamEnabled(currentCCD->isStreamingEnabled());
  
--        connect(currentCCD, SIGNAL(numberUpdated(INumberVectorProperty*)), this,
--                SLOT(processCCDNumber(INumberVectorProperty*)), \
                Qt::UniqueConnection);
--        connect(currentCCD, SIGNAL(newTemperatureValue(double)), this, \
                SLOT(updateCCDTemperature(double)),
--                Qt::UniqueConnection);
--        connect(currentCCD, SIGNAL(newRemoteFile(QString)), this, \
                SLOT(setNewRemoteFile(QString)));
--        connect(currentCCD, SIGNAL(videoStreamToggled(bool)), this, \
SLOT(setVideoStreamEnabled(bool))); ++        connect(currentCCD, \
&ISD::CCD::numberUpdated, this, &Ekos::Capture::processCCDNumber, \
Qt::UniqueConnection); ++        connect(currentCCD, &ISD::CCD::newTemperatureValue, \
this, &Ekos::Capture::updateCCDTemperature,   Qt::UniqueConnection); ++        \
connect(currentCCD, &ISD::CCD::newRemoteFile, this, \
&Ekos::Capture::setNewRemoteFile); ++        connect(currentCCD, \
&ISD::CCD::videoStreamToggled, this, &Ekos::Capture::setVideoStreamEnabled);  }
  }
  
@@@ -988,12 -1011,12 +1031,12 @@@ void Capture::syncFrameType(ISD::GDInte
      }
  }
  
--bool Capture::setFilter(const QString &device, const QString &filter)
++bool Capture::setFilterWheel(const QString &filterWheel)
  {
      bool deviceFound = false;
  
      for (int i = 1; i < FilterDevicesCombo->count(); i++)
--        if (device == FilterDevicesCombo->itemText(i))
++        if (filterWheel == FilterDevicesCombo->itemText(i))
          {
              checkFilter(i);
              deviceFound = true;
@@@ -1003,10 -1026,10 +1046,33 @@@
      if (deviceFound == false)
          return false;
  
--    FilterPosCombo->setCurrentText(filter);
      return true;
  }
  
++QString Capture::filterWheel()
++{
++    if (FilterDevicesCombo->currentIndex() >= 1)
++        return FilterDevicesCombo->currentText();
++
++    return QString();
++}
++
++bool Capture::setFilter(const QString &filter)
++{
++    if (FilterDevicesCombo->currentIndex() >= 1)
++    {
++        FilterPosCombo->setCurrentText(filter);
++        return true;
++    }
++
++    return false;
++}
++
++QString Capture::filter()
++{
++    return FilterPosCombo->currentText();
++}
++
  void Capture::checkFilter(int filterNum)
  {
      if (filterNum == -1)
@@@ -1075,7 -1098,7 +1141,7 @@@ void Capture::syncFilterInfo(
  
  bool Capture::startNextExposure()
  {
--    if (state == CAPTURE_PAUSED)
++    if (m_State == CAPTURE_PAUSED)
      {
          pauseFunction = &Capture::startNextExposure;
          appendLogText(i18n("Sequence paused."));
@@@ -1086,7 -1109,7 +1152,7 @@@
      if (seqDelay > 0)
      {
          secondsLabel->setText(i18n("Waiting..."));
--        state = CAPTURE_WAITING;
++        m_State = CAPTURE_WAITING;
          emit newStatus(Ekos::CAPTURE_WAITING);
      }
  
@@@ -1130,14 -1153,14 +1196,13 @@@ void Capture::newFITS(IBLOB *bp
  
          // If the FITS is not for our device, simply ignore
          //if (QString(bp->bvp->device)  != currentCCD->getDeviceName() || \
                (startB->isEnabled() && previewB->isEnabled()))
--        if (QString(bp->bvp->device) != currentCCD->getDeviceName() || state == \
CAPTURE_IDLE || state == CAPTURE_ABORTED) ++        if (QString(bp->bvp->device) != \
currentCCD->getDeviceName() || m_State == CAPTURE_IDLE || m_State == CAPTURE_ABORTED) \
return;  
          if (currentCCD->isLooping() == false)
          {
--            disconnect(currentCCD, SIGNAL(BLOBUpdated(IBLOB*)), this, \
                SLOT(newFITS(IBLOB*)));
--            disconnect(currentCCD, SIGNAL(newImage(QImage*, ISD::CCDChip*)), this,
--                       SLOT(sendNewImage(QImage *, ISD::CCDChip *)));
++            disconnect(currentCCD, &ISD::CCD::BLOBUpdated, this, \
&Ekos::Capture::newFITS); ++            disconnect(currentCCD, &ISD::CCD::newImage, \
this, &Ekos::Capture::sendNewImage);  
              if (useGuideHead == false && darkSubCheck->isChecked() && \
activeJob->isPreview())  {
@@@ -1146,8 -1169,8 +1211,8 @@@
                  uint16_t offsetX       = activeJob->getSubX() / \
                activeJob->getXBin();
                  uint16_t offsetY       = activeJob->getSubY() / \
activeJob->getYBin();  
--                connect(DarkLibrary::Instance(), SIGNAL(darkFrameCompleted(bool)), \
                this, SLOT(setCaptureComplete()));
--                connect(DarkLibrary::Instance(), SIGNAL(newLog(QString)), this, \
SLOT(appendLogText(QString))); ++                connect(DarkLibrary::Instance(), \
&DarkLibrary::darkFrameCompleted, this, &Ekos::Capture::setCaptureComplete); ++       \
connect(DarkLibrary::Instance(), &DarkLibrary::newLog, this, \
&Ekos::Capture::appendLogText);  
                  if (darkData)
                      DarkLibrary::Instance()->subtract(darkData, currentImage, \
activeJob->getCaptureFilter(), offsetX, @@@ -1161,7 -1184,7 +1226,7 @@@
          }
      }
      else
--        sendNewImage(nullptr, activeJob->getActiveChip());
++        sendNewImage(nullptr, QString(), activeJob->getActiveChip());
  
      setCaptureComplete();
  }
@@@ -1170,8 -1193,8 +1235,7 @@@ bool Capture::setCaptureComplete(
  {
      if (currentCCD->isLooping() == false)
      {
--        disconnect(currentCCD, SIGNAL(newExposureValue(ISD::CCDChip*, double, \
                IPState)), this,
--                   SLOT(setExposureProgress(ISD::CCDChip*, double, IPState)));
++        disconnect(currentCCD, &ISD::CCD::newExposureValue, this, \
&Ekos::Capture::setExposureProgress);  DarkLibrary::Instance()->disconnect(this);
      }
  
@@@ -1194,12 -1217,12 +1258,12 @@@
          if (guideState == GUIDE_SUSPENDED && suspendGuideOnDownload)
              emit resumeGuiding();
  
--        state = CAPTURE_IDLE;
++        m_State = CAPTURE_IDLE;
          emit newStatus(Ekos::CAPTURE_IDLE);
          return true;
      }
  
--    if (state == CAPTURE_PAUSED)
++    if (m_State == CAPTURE_PAUSED)
      {
          pauseFunction = &Capture::setCaptureComplete;
          appendLogText(i18n("Sequence paused."));
@@@ -1229,7 -1253,7 +1294,7 @@@
  
      appendLogText(i18n("Received image %1 out of %2.", activeJob->getCompleted(), \
activeJob->getCount()));  
--    state = CAPTURE_IMAGE_RECEIVED;
++    m_State = CAPTURE_IMAGE_RECEIVED;
      emit newStatus(Ekos::CAPTURE_IMAGE_RECEIVED);
  
      currentImgCountOUT->setText(QString::number(activeJob->getCompleted()));
@@@ -1287,7 -1311,7 +1352,7 @@@ void Capture::processJobCompletion(
  
          abort();
  
--        state = CAPTURE_COMPLETE;
++        m_State = CAPTURE_COMPLETE;
          emit newStatus(Ekos::CAPTURE_COMPLETE);
  
          //Resume guiding if it was suspended before
@@@ -1299,7 -1323,7 +1364,7 @@@
  
  bool Capture::resumeSequence()
  {
--    if (state == CAPTURE_PAUSED)
++    if (m_State == CAPTURE_PAUSED)
      {
          pauseFunction = &Capture::resumeSequence;
          appendLogText(i18n("Sequence paused."));
@@@ -1392,7 -1416,7 +1457,7 @@@
              if (currentCCD->isLooping())
                  targetChip->abortExposure();
  
--            state = CAPTURE_DITHERING;
++            m_State = CAPTURE_DITHERING;
              emit newStatus(Ekos::CAPTURE_DITHERING);
          }
          else if (isRefocus && activeJob->getFrameType() == FRAME_LIGHT)
@@@ -1407,7 -1431,7 +1472,7 @@@
              // force refocus
              emit checkFocus(0.1);
  
--            state = CAPTURE_FOCUSING;
++            m_State = CAPTURE_FOCUSING;
              emit newStatus(Ekos::CAPTURE_FOCUSING);
          }
          else if (isInSequenceFocus && activeJob->getFrameType() == FRAME_LIGHT && \
--inSequenceFocusCounter == 0) @@@ -1438,7 -1462,7 +1503,7 @@@
  
              qCDebug(KSTARS_EKOS_CAPTURE) << "In-sequence focusing started...";
  
--            state = CAPTURE_FOCUSING;
++            m_State = CAPTURE_FOCUSING;
              emit newStatus(Ekos::CAPTURE_FOCUSING);
          }
          else
@@@ -1530,9 -1554,9 +1595,8 @@@ void Capture::captureImage(
              currentCCD->setExposureLoopCount(remaining);
      }
  
--    connect(currentCCD, SIGNAL(BLOBUpdated(IBLOB*)), this, SLOT(newFITS(IBLOB*)), \
                Qt::UniqueConnection);
--    connect(currentCCD, SIGNAL(newImage(QImage*,ISD::CCDChip*)), this, \
                SLOT(sendNewImage(QImage*,ISD::CCDChip*)),
--            Qt::UniqueConnection);
++    connect(currentCCD, &ISD::CCD::BLOBUpdated, this, &Ekos::Capture::newFITS, \
Qt::UniqueConnection); ++    connect(currentCCD, &ISD::CCD::newImage, this, \
&Ekos::Capture::sendNewImage, Qt::UniqueConnection);  
      if (activeJob->getFrameType() == FRAME_FLAT)
      {
@@@ -1566,7 -1590,7 +1630,7 @@@
          currentCCD->setNextSequenceID(nextSequenceID);
      }
  
--    state = CAPTURE_CAPTURING;
++    m_State = CAPTURE_CAPTURING;
  
      //if (activeJob->isPreview() == false)
      // NOTE: Why we didn't emit this before for preview?
@@@ -1588,15 -1612,15 +1652,13 @@@
      // If using DSLR, make sure it is set to correct transfer format
      currentCCD->setTransformFormat(activeJob->getTransforFormat());
  
--    connect(currentCCD, SIGNAL(newExposureValue(ISD::CCDChip*,double,IPState)), \
                this,
--            SLOT(setExposureProgress(ISD::CCDChip*,double,IPState)), \
Qt::UniqueConnection); ++    connect(currentCCD, &ISD::CCD::newExposureValue, this, \
&Ekos::Capture::setExposureProgress, Qt::UniqueConnection);  
      rc = activeJob->capture(darkSubCheck->isChecked() ? true : false);
  
      if (rc != SequenceJob::CAPTURE_OK)
      {
--        disconnect(currentCCD, \
                SIGNAL(newExposureValue(ISD::CCDChip*,double,IPState)), this,
--                   SLOT(setExposureProgress(ISD::CCDChip*,double,IPState)));
++        disconnect(currentCCD, &ISD::CCD::newExposureValue, this, \
&Ekos::Capture::setExposureProgress);  }
      switch (rc)
      {
@@@ -1626,7 -1650,7 +1688,7 @@@
  
      case SequenceJob::CAPTURE_FILTER_BUSY:
          // Try again in 1 second if filter is busy
--        QTimer::singleShot(1000, this, SLOT(captureImage()));
++        QTimer::singleShot(1000, this, &Ekos::Capture::captureImage);
          break;
  
      case SequenceJob::CAPTURE_FOCUS_ERROR:
@@@ -1638,7 -1662,7 +1700,7 @@@
  
  bool Capture::resumeCapture()
  {
--    if (state == CAPTURE_PAUSED)
++    if (m_State == CAPTURE_PAUSED)
      {
          pauseFunction = &Capture::resumeCapture;
          appendLogText(i18n("Sequence paused."));
@@@ -1662,7 -1686,7 +1724,7 @@@
          secondsLabel->setText(i18n("Focusing..."));
          qCDebug(KSTARS_EKOS_CAPTURE) << "Requesting focusing if HFR >" << \
HFRPixels->value();  emit checkFocus(HFRPixels->value());
--        state = CAPTURE_FOCUSING;
++        m_State = CAPTURE_FOCUSING;
          emit newStatus(Ekos::CAPTURE_FOCUSING);
          return true;
      }
@@@ -1672,7 -1696,7 +1734,7 @@@
  
          secondsLabel->setText(i18n("Focusing..."));
          emit checkFocus(0.1);
--        state = CAPTURE_FOCUSING;
++        m_State = CAPTURE_FOCUSING;
          emit newStatus(Ekos::CAPTURE_FOCUSING);
          return true;
      }
@@@ -1747,18 -1771,18 +1809,18 @@@ void Capture::checkSeqBoundary(const QS
  
  void Capture::appendLogText(const QString &text)
  {
--    logText.insert(0, i18nc("log entry; %1 is the date, %2 is the text", "%1 %2",
++    m_LogText.insert(0, i18nc("log entry; %1 is the date, %2 is the text", "%1 %2",
                              \
QDateTime::currentDateTime().toString("yyyy-MM-ddThh:mm:ss"), text));  
      qCInfo(KSTARS_EKOS_CAPTURE) << text;
  
--    emit newLog();
++    emit newLog(text);
  }
  
  void Capture::clearLog()
  {
--    logText.clear();
--    emit newLog();
++    m_LogText.clear();
++    emit newLog(QString());
  }
  
  void Capture::setExposureProgress(ISD::CCDChip *tChip, double value, IPState state)
@@@ -1822,7 -1846,7 +1884,7 @@@
  
          secondsLabel->setText(i18n("Downloading..."));
  
--        //disconnect(currentCCD, \
SIGNAL(newExposureValue(ISD::CCDChip*,double,IPState)), this, \
SLOT(updateCaptureProgress(ISD::CCDChip*,double,IPState))); ++        \
//disconnect(currentCCD, &ISD::CCD::newExposureValue(ISD::CCDChip*,double,IPState)), \
this, &Ekos::Capture::updateCaptureProgress(ISD::CCDChip*,double,IPState)));  }
      // JM: Don't change to i18np, value is DOUBLE, not Integer.
      else if (value <= 1)
@@@ -1864,7 -1888,7 +1926,7 @@@ void Capture::updateRotatorNumber(INumb
  
  bool Capture::addJob(bool preview)
  {
--    if (state != CAPTURE_IDLE && state != CAPTURE_ABORTED && state != \
CAPTURE_COMPLETE) ++    if (m_State != CAPTURE_IDLE && m_State != CAPTURE_ABORTED && \
m_State != CAPTURE_COMPLETE)  return false;
  
      SequenceJob *job = nullptr;
@@@ -1983,10 -2007,10 +2045,10 @@@
      QString directoryPostfix;
  
      /* FIXME: Refactor directoryPostfix assignment, whose code is duplicated in \
                scheduler.cpp */
--    if (targetName.isEmpty())
++    if (m_TargetName.isEmpty())
          directoryPostfix = QLatin1Literal("/") + frameTypeCombo->currentText();
      else
--        directoryPostfix = QLatin1Literal("/") + targetName + QLatin1Literal("/") + \
frameTypeCombo->currentText(); ++        directoryPostfix = QLatin1Literal("/") + \
                m_TargetName + QLatin1Literal("/") + frameTypeCombo->currentText();
      if ((job->getFrameType() == FRAME_LIGHT || job->getFrameType() == FRAME_FLAT) \
&&  job->getFilterName().isEmpty() == false)  directoryPostfix += QLatin1Literal("/") \
+ job->getFilterName();  
@@@ -2107,7 -2131,7 +2169,7 @@@
  
  void Capture::removeJob(int index)
  {
--    if (state != CAPTURE_IDLE && state != CAPTURE_ABORTED && state != \
CAPTURE_COMPLETE) ++    if (m_State != CAPTURE_IDLE && m_State != CAPTURE_ABORTED && \
m_State != CAPTURE_COMPLETE)  return;
  
      if (jobUnderEdit)
@@@ -2258,7 -2282,7 +2320,7 @@@ void Capture::prepareJob(SequenceJob *j
  
      if (activeJob->getActiveCCD() != currentCCD)
      {
--        setCCD(activeJob->getActiveCCD()->getDeviceName());
++        setCamera(activeJob->getActiveCCD()->getDeviceName());
      }
  
      /*if (activeJob->isPreview())
@@@ -2382,7 -2406,7 +2444,7 @@@
      // Just notification of active job stating up
      emit newImage(nullptr, activeJob);
  
--    //connect(job, SIGNAL(checkFocus()), this, SLOT(startPostFilterAutoFocus()));
++    //connect(job, SIGNAL(checkFocus()), this, \
&Ekos::Capture::startPostFilterAutoFocus()));  
      // Reset calibration stage
      if (calibrationStage == CAL_CAPTURING)
@@@ -2482,15 -2506,15 +2544,15 @@@ void Capture::preparePreCaptureActions(
          startB->setToolTip(i18n("Stop"));
      }
  
--    connect(activeJob, SIGNAL(prepareState(Ekos::CaptureState)), this, \
                SLOT(updatePrepareState(Ekos::CaptureState)));
--    connect(activeJob, SIGNAL(prepareComplete()), this, SLOT(executeJob()));
++    connect(activeJob, &SequenceJob::prepareState, this, \
&Ekos::Capture::updatePrepareState); ++    connect(activeJob, \
&SequenceJob::prepareComplete, this, &Ekos::Capture::executeJob);  
      activeJob->prepareCapture();
  }
  
  void Capture::updatePrepareState(Ekos::CaptureState prepareState)
  {
--    state = prepareState;
++    m_State = prepareState;
      emit newStatus(prepareState);
  
      switch (prepareState)
@@@ -2516,10 -2540,10 +2578,10 @@@ void Capture::executeJob(
      activeJob->disconnect(this);
  
      QMap<QString, QString> FITSHeader;
--    if (observerName.isEmpty() == false)
--        FITSHeader["FITS_OBSERVER"] = observerName;
--    if (targetName.isEmpty() == false)
--        FITSHeader["FITS_OBJECT"] = targetName;
++    if (m_ObserverName.isEmpty() == false)
++        FITSHeader["FITS_OBSERVER"] = m_ObserverName;
++    if (m_TargetName.isEmpty() == false)
++        FITSHeader["FITS_OBJECT"] = m_TargetName;
      else if (activeJob->getRawPrefix().isEmpty() == false)
      {
          FITSHeader["FITS_OBJECT"] = activeJob->getRawPrefix();
@@@ -2565,7 -2589,7 +2627,7 @@@ void Capture::updatePreCaptureCalibrati
      else if (rc == IPS_BUSY)
      {
          secondsLabel->clear();
--        QTimer::singleShot(1000, this, SLOT(updatePreCaptureCalibrationStatus()));
++        QTimer::singleShot(1000, this, \
&Ekos::Capture::updatePreCaptureCalibrationStatus);  return;
      }
  
@@@ -2678,7 -2702,7 +2740,7 @@@ void Capture::setGuideDeviation(double 
                                     "resuming exposure in %3 seconds.",
                                     deviationText, guideDeviation->value(), seqDelay \
/ 1000.0));  
--            QTimer::singleShot(seqDelay, this, SLOT(start()));
++            QTimer::singleShot(seqDelay, this, &Ekos::Capture::start);
              return;
          }
          else appendLogText(i18n("Guiding deviation %1 is still higher than limit \
value of %2 arcsecs.", @@@ -2852,7 -2876,7 +2914,7 @@@ int \
Capture::getTotalFramesCount(QStrin  void Capture::setRotator(ISD::GDInterface \
*newRotator)  {
      currentRotator = newRotator;
--    connect(currentRotator, SIGNAL(numberUpdated(INumberVectorProperty*)), this, \
SLOT(updateRotatorNumber(INumberVectorProperty*)), Qt::UniqueConnection); ++    \
connect(currentRotator, &ISD::GDInterface::numberUpdated, this, \
&Ekos::Capture::updateRotatorNumber, Qt::UniqueConnection);  \
rotatorB->setEnabled(true);  
      rotatorSettings->setRotator(newRotator);
@@@ -2865,8 -2889,8 +2927,7 @@@ void Capture::setTelescope(ISD::GDInter
  {
      currentTelescope = static_cast<ISD::Telescope *>(newTelescope);
  
--    connect(currentTelescope, SIGNAL(numberUpdated(INumberVectorProperty*)), this,
--            SLOT(processTelescopeNumber(INumberVectorProperty*)), \
Qt::UniqueConnection); ++    connect(currentTelescope, \
&ISD::GDInterface::numberUpdated, this, &Ekos::Capture::processTelescopeNumber, \
Qt::UniqueConnection);  
      meridianHours->setEnabled(true);
  
@@@ -2907,15 -2931,15 +2968,14 @@@ void Capture::saveFITSDirectory(
  
  void Capture::loadSequenceQueue()
  {
--    QUrl fileURL = QFileDialog::getOpenFileUrl(KStars::Instance(), i18n("Open Ekos \
                Sequence Queue"), dirPath,
--                                               "Ekos Sequence Queue (*.esq)");
++    QUrl fileURL = QFileDialog::getOpenFileUrl(KStars::Instance(), i18n("Open Ekos \
Sequence Queue"), dirPath, "Ekos Sequence Queue (*.esq)");  if (fileURL.isEmpty())
          return;
  
      if (fileURL.isValid() == false)
      {
          QString message = i18n("Invalid URL: %1", fileURL.toLocalFile());
--        KMessageBox::sorry(0, message, i18n("Invalid URL"));
++        KMessageBox::sorry(nullptr, message, i18n("Invalid URL"));
          return;
      }
  
@@@ -2934,7 -2958,7 +2994,7 @@@ bool Capture::loadSequenceQueue(const Q
      if (!sFile.open(QIODevice::ReadOnly))
      {
          QString message = i18n("Unable to open file %1", fileURL);
--        KMessageBox::sorry(0, message, i18n("Could Not Open File"));
++        KMessageBox::sorry(nullptr, message, i18n("Could Not Open File"));
          return false;
      }
  
@@@ -2970,7 -2994,7 +3030,7 @@@
              {
                  if (!strcmp(tagXMLEle(ep), "Observer"))
                  {
--                    observerName = QString(pcdataXMLEle(ep));
++                    m_ObserverName = QString(pcdataXMLEle(ep));
                  }
                  else if (!strcmp(tagXMLEle(ep), "GuideDeviation"))
                  {
@@@ -3350,8 -3374,8 +3410,8 @@@ bool Capture::saveSequenceQueue(const Q
  
      outstream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
      outstream << "<SequenceQueue version='" << SQ_FORMAT_VERSION << "'>" << endl;
--    if (observerName.isEmpty() == false)
--        outstream << "<Observer>" << observerName << "</Observer>" << endl;
++    if (m_ObserverName.isEmpty() == false)
++        outstream << "<Observer>" << m_ObserverName << "</Observer>" << endl;
      outstream << "<CCD>" << CCDCaptureCombo->currentText() << "</CCD>" << endl;
      outstream << "<FilterWheel>" << FilterDevicesCombo->currentText() << \
                "</FilterWheel>" << endl;
      outstream << "<GuideDeviation enabled='" << (guideDeviationCheck->isChecked() ? \
"true" : "false") << "'>" @@@ -3784,7 -3808,7 +3844,7 @@@ void \
Capture::setTargetTemperature(doub  void Capture::clearSequenceQueue()
  {
      activeJob = nullptr;
--    targetName.clear();
++    m_TargetName.clear();
      stop();
      while (queueTable->rowCount() > 0)
          queueTable->removeRow(0);
@@@ -3830,7 -3854,7 +3890,8 @@@ QString Capture::getSequenceQueueStatus
  
      if (aborted > 0)
      {
--        if (guideState >= GUIDE_GUIDING && deviationDetected)
++        //if (guideState >= GUIDE_GUIDING && deviationDetected)
++        if (m_State == CAPTURE_SUSPENDED)
              return "Suspended";
          else
              return "Aborted";
@@@ -3904,7 -3928,7 +3965,7 @@@ void Capture::processTelescopeNumber(IN
              secondsLabel->setText(i18n("Aligning..."));
  
              retries = 0;
--            state   = CAPTURE_ALIGNING;
++            m_State   = CAPTURE_ALIGNING;
              emit newStatus(Ekos::CAPTURE_ALIGNING);
  
              meridianFlipStage = MF_ALIGNING;
@@@ -3936,7 -3960,7 +3997,7 @@@ void Capture::checkGuidingAfterFlip(
          appendLogText(i18n("Performing post flip re-calibration and guiding..."));
          secondsLabel->setText(i18n("Calibrating..."));
  
--        state = CAPTURE_CALIBRATING;
++        m_State = CAPTURE_CALIBRATING;
          emit newStatus(Ekos::CAPTURE_CALIBRATING);
  
          meridianFlipStage = MF_GUIDING;
@@@ -4013,10 -4037,10 +4074,10 @@@ bool Capture::checkMeridianFlip(
  
          retries = 0;
  
--        state = CAPTURE_MERIDIAN_FLIP;
++        m_State = CAPTURE_MERIDIAN_FLIP;
          emit newStatus(Ekos::CAPTURE_MERIDIAN_FLIP);
  
--        QTimer::singleShot(MF_TIMER_TIMEOUT, this, \
SLOT(checkMeridianFlipTimeout())); ++        QTimer::singleShot(MF_TIMER_TIMEOUT, \
this, &Ekos::Capture::checkMeridianFlipTimeout);  return true;
      }
  
@@@ -4055,6 -4079,13 +4116,13 @@@ void Capture::checkGuideDeviationTimeou
      {
          appendLogText(i18n("Guide module timed out."));
          deviationDetected = false;
+ 
+         // If capture was suspended, it should be aborted (failed) now.
 -        if (state == CAPTURE_SUSPENDED)
++        if (m_State == CAPTURE_SUSPENDED)
+         {
 -            state = CAPTURE_ABORTED;
 -            emit newStatus(state);
++            m_State = CAPTURE_ABORTED;
++            emit newStatus(m_State);
+         }
      }
  }
  
@@@ -4089,7 -4120,7 +4157,7 @@@ void Capture::setAlignStatus(AlignStat
                  appendLogText(i18n("Post-flip alignment failed. Retrying..."));
                  secondsLabel->setText(i18n("Aligning..."));
  
--                this->state = CAPTURE_ALIGNING;
++                this->m_State = CAPTURE_ALIGNING;
                  emit newStatus(Ekos::CAPTURE_ALIGNING);
  
                  meridianFlipStage = MF_ALIGNING;
@@@ -4124,7 -4155,7 +4192,7 @@@ void Capture::setGuideStatus(GuideStat
          // then let's resume capture once we are guiding again.
          if (autoGuideAbortedCapture &&
             (guideState == GUIDE_ABORTED || guideState == GUIDE_IDLE) &&
-            this->state == CAPTURE_ABORTED)
 -           (this->state == CAPTURE_ABORTED || this->state == CAPTURE_SUSPENDED))
++           (this->m_State == CAPTURE_ABORTED || this->m_State == \
CAPTURE_SUSPENDED))  {
              start();
              autoGuideAbortedCapture = false;
@@@ -4156,7 -4187,7 +4224,7 @@@
          {
              // N.B. Do NOT convert to i18np since guidingRate is DOUBLE value (e.g. \
                1.36) so we always use plural with that.
              appendLogText(i18n("Dither complete. Resuming capture in %1 \
                seconds...", Options::guidingSettle()));
--            QTimer::singleShot(Options::guidingSettle()*1000, this, \
SLOT(resumeCapture())); ++            \
QTimer::singleShot(Options::guidingSettle()*1000, this, \
&Ekos::Capture::resumeCapture);  }
          else
          {
@@@ -4170,7 -4201,7 +4238,7 @@@
          {
              // N.B. Do NOT convert to i18np since guidingRate is DOUBLE value (e.g. \
                1.36) so we always use plural with that.
              appendLogText(i18n("Warning: Dithering failed. Resuming capture in %1 \
                seconds...", Options::guidingSettle()));
--            QTimer::singleShot(Options::guidingSettle()*1000, this, \
SLOT(resumeCapture())); ++            \
QTimer::singleShot(Options::guidingSettle()*1000, this, \
&Ekos::Capture::resumeCapture);  }
          else
          {
@@@ -4377,7 -4408,7 +4445,7 @@@ void Capture::openCalibrationDialog(
      else
          calibrationOptions.parkDomeC->setEnabled(false);
  
--    //connect(calibrationOptions.wallSourceC, SIGNAL(toggled(bool)), \
calibrationOptions.parkC, SLOT(setDisabled(bool))); ++    \
//connect(calibrationOptions.wallSourceC, SIGNAL(toggled(bool)), \
calibrationOptions.parkC, &Ekos::Capture::setDisabled(bool)));  
      switch (flatFieldSource)
      {
@@@ -4905,6 -4936,6 +4973,7 @@@ bool Capture::processPostCaptureCalibra
  void Capture::setNewRemoteFile(QString file)
  {
      appendLogText(i18n("Remote image saved to %1", file));
++    emit newSequenceImage(file);
  }
  
  /*
@@@ -4986,8 -5017,8 +5055,8 @@@ void Capture::showFilterOffsetDialog(
      QDialogButtonBox *buttonBox =
              new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, \
Qt::Horizontal, &filterOffsetDialog);  
--    connect(buttonBox, SIGNAL(accepted()), &filterOffsetDialog, SLOT(accept()));
--    connect(buttonBox, SIGNAL(rejected()), &filterOffsetDialog, SLOT(reject()));
++    connect(buttonBox, SIGNAL(accepted()), &filterOffsetDialog, \
&Ekos::Capture::accept())); ++    connect(buttonBox, SIGNAL(rejected()), \
&filterOffsetDialog, &Ekos::Capture::reject()));  
      QVBoxLayout *mainLayout = new QVBoxLayout(&filterOffsetDialog);
      QGridLayout *grid       = new QGridLayout(&filterOffsetDialog);
@@@ -5142,7 -5173,7 +5211,7 @@@ void Capture::showObserverDialog(
  
      QComboBox observerCombo(&observersDialog);
      observerCombo.addItems(observers);
--    observerCombo.setCurrentText(observerName);
++    observerCombo.setCurrentText(m_ObserverName);
      observerCombo.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
  
      QPushButton manageObserver(&observersDialog);
@@@ -5162,7 -5193,7 +5231,7 @@@
  
          observerCombo.clear();
          observerCombo.addItems(observers);
--        observerCombo.setCurrentText(observerName);
++        observerCombo.setCurrentText(m_ObserverName);
  
      });
  
@@@ -5175,9 -5206,9 +5244,9 @@@
  
      observersDialog.exec();
  
--    observerName = observerCombo.currentText();
++    m_ObserverName = observerCombo.currentText();
  
--    Options::setDefaultObserver(observerName);
++    Options::setDefaultObserver(m_ObserverName);
  }
  
  
@@@ -5259,7 -5290,7 +5328,7 @@@ void Capture::setFilterManager(const QS
  
      connect(filterManager.data(), &FilterManager::newStatus, \
[this](Ekos::FilterState filterState)  {
--        if (state == CAPTURE_CHANGING_FILTER)
++        if (m_State == CAPTURE_CHANGING_FILTER)
          {
              secondsLabel->setText(Ekos::getFilterStatusString(filterState));
              switch (filterState)
diff --cc kstars/ekos/capture/capture.h
index cffe10f34,3c107f25f..528b40f8f
--- a/kstars/ekos/capture/capture.h
+++ b/kstars/ekos/capture/capture.h
@@@ -80,6 -80,6 +80,14 @@@ class Capture : public QWidget, public 
  {
      Q_OBJECT
      Q_CLASSINFO("D-Bus Interface", "org.kde.kstars.Ekos.Capture")
++    Q_PROPERTY(Ekos::CaptureState status READ status NOTIFY newStatus)
++    Q_PROPERTY(QString targetName MEMBER m_TargetName)
++    Q_PROPERTY(QString observerName MEMBER m_ObserverName)
++    Q_PROPERTY(QString camera READ camera WRITE setCamera)
++    Q_PROPERTY(QString filterWheel READ filterWheel WRITE setFilterWheel)
++    Q_PROPERTY(QString filter READ filter WRITE setFilter)
++    Q_PROPERTY(bool coolerControl READ hasCoolerControl WRITE setCoolerControl)
++    Q_SCRIPTABLE Q_PROPERTY(QStringList logText READ logText NOTIFY newLog)
  
    public:
      typedef enum { MF_NONE, MF_INITIATED, MF_FLIPPING, MF_SLEWING, MF_ALIGNING, \
MF_GUIDING } MFStage; @@@ -116,14 -116,14 +124,22 @@@
           * select the CCD device from the available CCD drivers.
           * @param device The CCD device name
           */
--    Q_SCRIPTABLE bool setCCD(const QString &device);
++    Q_SCRIPTABLE bool setCamera(const QString &device);
++    Q_SCRIPTABLE QString camera();
  
      /** DBUS interface function.
           * select the filter device from the available filter drivers. The filter \
device can be the same as the CCD driver if the filter functionality was embedded \
                within the driver.
           * @param device The filter device name
--         * @param filter the filter name
           */
--    Q_SCRIPTABLE bool setFilter(const QString &device, const QString &filter);
++    Q_SCRIPTABLE bool setFilterWheel(const QString &filterWheel);
++    Q_SCRIPTABLE QString filterWheel();
++
++    /** DBUS interface function.
++         * select the filter name from the available filters in case a filter \
device is active. ++         * @param device The filter name
++         */
++    Q_SCRIPTABLE bool setFilter(const QString &filter);
++    Q_SCRIPTABLE QString filter();
  
      /** DBUS interface function.
           * Aborts any current jobs and remove all sequence queue jobs.
@@@ -140,20 -140,20 +156,7 @@@
           * Loads the Ekos Sequence Queue file in the Sequence Queue. Jobs are \
                appended to existing jobs.
           * @param fileURL full URL of the filename
           */
--    Q_SCRIPTABLE bool loadSequenceQueue(const QString &fileURL);
--
--    /** DBUS interface function.
--         * Sets target name. The target name shall be appended to the root \
                directory specified by the user.
--         * e.g. If root directory is /home/jasem and target is M31, then root \
                directory becomes /home/jasem/M31
--         * @param name Name of desired target
--         */
--    Q_SCRIPTABLE Q_NOREPLY void setTargetName(const QString &name) { targetName = \
                name; }
--
--    /** DBUS interface function.
--         * Sets Observer name. Observer name is sent to INDI CCD driver to include \
                it in the FITS header
--         * @param name Full name of observer
--         */
--    Q_SCRIPTABLE Q_NOREPLY void setObservrName(const QString &name) { observerName \
= name; } ++    Q_SCRIPTABLE bool loadSequenceQueue(const QString &fileURL);    
  
      /** DBUS interface function.
           * Enables or disables the maximum guiding deviation and sets its value.
@@@ -271,6 -271,6 +274,10 @@@
           */
      Q_SCRIPTABLE Q_NOREPLY void setCapturedFramesMap(const QString &signature, int \
count);  
++    Q_SCRIPTABLE QStringList logText() { return m_LogText; }
++
++    Q_SCRIPTABLE Ekos::CaptureState status() { return m_State; }
++
      /** @}*/
  
      void addCCD(ISD::GDInterface *newCCD);
@@@ -287,7 -287,7 +294,7 @@@
      void syncFilterInfo();
  
      void clearLog();
--    QString getLogText() { return logText.join("\n"); }
++    QString getLogText() { return m_LogText.join("\n"); }
  
      /* Capture */
      void updateSequencePrefix(const QString &newPrefix, const QString &dir);
@@@ -538,7 -545,7 +553,7 @@@
      void updatePreCaptureCalibrationStatus();
  
      // Send image info
--    void sendNewImage(QImage *image, ISD::CCDChip *myChip);
++    void sendNewImage(QImage *image, const QString &filename, ISD::CCDChip \
*myChip);  
      // Capture
      bool setCaptureComplete();
@@@ -558,13 -565,13 +573,15 @@@
      void updateRotatorNumber(INumberVectorProperty *nvp);
  
    signals:
--    void newLog();
++    Q_SCRIPTABLE void newLog(const QString &text);
++    Q_SCRIPTABLE void meridianFlipStarted();
++    Q_SCRIPTABLE void meridianFlipCompleted();
++    Q_SCRIPTABLE void newStatus(Ekos::CaptureState status);
++    Q_SCRIPTABLE void newSequenceImage(const QString &filename);
++
      void checkFocus(double);
      void suspendGuiding();
--    void resumeGuiding();
--    void meridianFlipStarted();
--    void meridianFlipCompleted();
--    void newStatus(Ekos::CaptureState status);
++    void resumeGuiding();    
      void newImage(QImage *image, Ekos::SequenceJob *job);
      void newExposureProgress(Ekos::SequenceJob *job);
      void sequenceChanged(const QJsonArray &sequence);
@@@ -632,8 -639,8 +649,8 @@@
      bool autoGuideReady { false};
      bool autoGuideAbortedCapture { false };
  
--    QString targetName;
--    QString observerName;
++    QString m_TargetName;
++    QString m_ObserverName;
  
      SequenceJob *activeJob { nullptr };
  
@@@ -655,7 -662,7 +672,7 @@@
      ISD::LightBox *lightBox { nullptr };
      ISD::Dome *dome { nullptr };
  
--    QStringList logText;
++    QStringList m_LogText;
      QUrl sequenceURL;
      bool mDirty { false };
      bool jobUnderEdit { false };
@@@ -715,7 -722,7 +732,7 @@@
      QJsonArray m_SequenceArray;
  
      // State
--    CaptureState state { CAPTURE_IDLE };
++    CaptureState m_State { CAPTURE_IDLE };
      FocusState focusState { FOCUS_IDLE };
      GuideState guideState { GUIDE_IDLE };
      AlignState alignState { ALIGN_IDLE };
diff --cc kstars/ekos/ekos.cpp
index 70d678371,bbe80ee6f..a32d16e19
--- a/kstars/ekos/ekos.cpp
+++ b/kstars/ekos/ekos.cpp
@@@ -88,23 -88,3 +88,39 @@@ std::vector<double> gsl_polynomial_fit(
      return vc;
  }
  }
 +
 +QDBusArgument &operator<<(QDBusArgument &argument, const Ekos::CommunicationStatus& \
source)  +{
 +    argument.beginStructure();
 +    argument << static_cast<int>(source);
 +    argument.endStructure();
 +    return argument;
 +}
 +
 +const QDBusArgument &operator>>(const QDBusArgument &argument, \
Ekos::CommunicationStatus &dest)  +{
 +    int a;
 +    argument.beginStructure();
 +    argument >> a;
 +    argument.endStructure();
- 
 +    dest = static_cast<Ekos::CommunicationStatus>(a);
++    return argument;
++}
 +
++QDBusArgument &operator<<(QDBusArgument &argument, const Ekos::CaptureState& \
source) ++{
++    argument.beginStructure();
++    argument << static_cast<int>(source);
++    argument.endStructure();
++    return argument;
++}
++
++const QDBusArgument &operator>>(const QDBusArgument &argument, Ekos::CaptureState \
&dest) ++{
++    int a;
++    argument.beginStructure();
++    argument >> a;
++    argument.endStructure();
++    dest = static_cast<Ekos::CaptureState>(a);
 +    return argument;
 +}
diff --cc kstars/ekos/ekos.h
index f24643c4d,bcec6d407..333a0e94b
--- a/kstars/ekos/ekos.h
+++ b/kstars/ekos/ekos.h
@@@ -146,10 -145,4 +147,18 @@@ const QString &getFilterStatusString(Fi
  
  std::vector<double> gsl_polynomial_fit(const double *const data_x, const double \
*const data_y, const int n,  const int order, double &chisq);
 +
 +enum CommunicationStatus { STATUS_IDLE, STATUS_PENDING, STATUS_SUCCESS, \
STATUS_ERROR };  }
 +
++// Communication Status
 +Q_DECLARE_METATYPE(Ekos::CommunicationStatus)
 +QDBusArgument &operator<<(QDBusArgument &argument, const Ekos::CommunicationStatus& \
source);  +const QDBusArgument &operator>>(const QDBusArgument &argument, \
Ekos::CommunicationStatus &dest); ++
++// Capture Status
++// FIXME is there a way to avoid unnecessary duplicating code? The solution \
suggested in KDE WiKi is to use Boost ++// which we do not have to add as dependency
++Q_DECLARE_METATYPE(Ekos::CaptureState)
++QDBusArgument &operator<<(QDBusArgument &argument, const Ekos::CaptureState& \
source); ++const QDBusArgument &operator>>(const QDBusArgument &argument, \
                Ekos::CaptureState &dest);
diff --cc kstars/ekos/manager.cpp
index d3014c70b,bd8c5a7d4..9fbe6ca85
--- a/kstars/ekos/manager.cpp
+++ b/kstars/ekos/manager.cpp
@@@ -1202,9 -1179,9 +1202,9 @@@ void Manager::setCCD(ISD::GDInterface *
  
      bool rc = false;
      if (Options::defaultCaptureCCD().isEmpty() == false)
--        rc = captureProcess->setCCD(Options::defaultCaptureCCD());
++        rc = captureProcess->setCamera(Options::defaultCaptureCCD());
      if (rc == false && primaryCCD.isEmpty() == false)
--        captureProcess->setCCD(primaryCCD);
++        captureProcess->setCamera(primaryCCD);
  
      initFocus();
  
diff --cc kstars/ekos/scheduler/scheduler.cpp
index 7f67c4e1d,4a24c918c..55e7461eb
--- a/kstars/ekos/scheduler/scheduler.cpp
+++ b/kstars/ekos/scheduler/scheduler.cpp
@@@ -2419,6 -2414,18 +2416,18 @@@ bool Scheduler::checkEkosState(
      return false;
  }
  
+ bool Scheduler::isINDIConnected()
+ {
+     QDBusReply<int> isINDIConnected = ekosInterface->call(QDBus::AutoDetect, \
"getINDIConnectionStatus"); + 
+     if (isINDIConnected.error().type() != QDBusError::NoError)
+         return false;
 -    else if (isINDIConnected.value() == EkosManager::EKOS_STATUS_SUCCESS)
++    else if (isINDIConnected.value() == Ekos::STATUS_SUCCESS)
+         return true;
+     else // ERROR or IDLE
+         return false;
+ }
+ 
  bool Scheduler::checkINDIState()
  {
      if (state == SCHEDULER_PAUSED)
diff --cc kstars/indi/indiccd.cpp
index 013b27084,88f9254f3..959dea239
--- a/kstars/indi/indiccd.cpp
+++ b/kstars/indi/indiccd.cpp
@@@ -1488,7 -1483,7 +1488,7 @@@ void CCD::processBLOB(IBLOB *bp
                          normalTabID = tabRC;
                          targetChip->setImageView(fv->getView(normalTabID), \
FITS_NORMAL);  
--                        emit newImage(fv->getView(normalTabID)->getDisplayImage(), \
targetChip); ++                        emit \
newImage(fv->getView(normalTabID)->getDisplayImage(), filename, targetChip);  }
                      else
                      {
@@@ -1519,7 -1512,7 +1519,7 @@@
                          if (imageLoad)
                          {
                              focusView->updateFrame();
--                            emit newImage(focusView->getDisplayImage(), \
targetChip); ++                            emit \
newImage(focusView->getDisplayImage(), filename, targetChip);  }
                          else
                          {
@@@ -1540,7 -1533,7 +1540,7 @@@
                          if (imageLoad)
                          {
                              guideView->updateFrame();
--                            emit newImage(guideView->getDisplayImage(), \
targetChip); ++                            emit \
newImage(guideView->getDisplayImage(), filename, targetChip);  }
                          else
                          {
@@@ -1588,7 -1581,7 +1588,7 @@@
                          if (imageLoad)
                          {
                              alignView->updateFrame();
--                            emit newImage(alignView->getDisplayImage(), \
targetChip); ++                            emit \
newImage(alignView->getDisplayImage(), filename, targetChip);  }
                          else
                          {
diff --cc kstars/indi/indiccd.h
index f5421f64c,f5421f64c..797e8b83e
--- a/kstars/indi/indiccd.h
+++ b/kstars/indi/indiccd.h
@@@ -244,7 -244,7 +244,7 @@@ class CCD : public DeviceDecorato
      void newExposureValue(ISD::CCDChip *chip, double value, IPState state);
      void newGuideStarData(ISD::CCDChip *chip, double dx, double dy, double fit);
      void newRemoteFile(QString);
--    void newImage(QImage *image, ISD::CCDChip *targetChip);
++    void newImage(QImage *image, const QString &filename, ISD::CCDChip \
*targetChip);  void videoStreamToggled(bool enabled);
      void videoRecordToggled(bool enabled);
      void newFPS(double instantFPS, double averageFPS);
diff --cc kstars/org.kde.kstars.Ekos.Capture.xml
index dc9a14971,396adf146..8d2da2063
--- a/kstars/org.kde.kstars.Ekos.Capture.xml
+++ b/kstars/org.kde.kstars.Ekos.Capture.xml
@@@ -1,6 -1,6 +1,16 @@@
  <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" \
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">  <node>
    <interface name="org.kde.kstars.Ekos.Capture">
++    <property name="targetName" type="s" access="readwrite"/>
++    <property name="observerName" type="s" access="readwrite"/>
++    <property name="camera" type="s" access="readwrite"/>
++    <property name="filterWheel" type="s" access="readwrite"/>
++    <property name="filter" type="s" access="readwrite"/>
++    <property name="coolerControl" type="b" access="readwrite"/>
++    <property name="logText" type="as" access="read"/>
++    <property name="status" type="(i)" access="read">
++        <annotation name="org.qtproject.QtDBus.QtTypeName" \
value="Ekos::CaptureState"/> ++    </property>
      <method name="start">
        <annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/>
      </method>
@@@ -14,16 -16,16 +26,7 @@@
      <method name="toggleVideo">
        <arg name="enabled" type="b" direction="in"/>
        <annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/>
--    </method>
--    <method name="setCCD">
--      <arg type="b" direction="out"/>
--      <arg name="device" type="s" direction="in"/>
--    </method>
--    <method name="setFilter">
--      <arg type="b" direction="out"/>
--      <arg name="device" type="s" direction="in"/>
--      <arg name="filter" type="s" direction="in"/>
--    </method>
++    </method>    
      <method name="loadSequenceQueue">
        <arg type="b" direction="out"/>
        <arg name="fileURL" type="s" direction="in"/>
@@@ -33,11 -35,11 +36,7 @@@
      </method>
      <method name="getSequenceQueueStatus">
        <arg type="s" direction="out"/>
--    </method>
--    <method name="setTargetName">
--      <arg name="name" type="s" direction="in"/>
--      <annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/>
--    </method>
++    </method>    
      <method name="setMaximumGuidingDeviaiton">
        <arg name="enable" type="b" direction="in"/>
        <arg name="value" type="d" direction="in"/>
@@@ -80,14 -82,14 +79,7 @@@
      </method>
      <method name="getProgressPercentage">
        <arg type="d" direction="out"/>
--    </method>
--    <method name="hasCoolerControl">
--      <arg type="b" direction="out"/>
--    </method>
--    <method name="setCoolerControl">
--      <arg type="b" direction="out"/>
--      <arg type="b" name="enable" direction="in"/>
--    </method>
++    </method>    
      <method name="getActiveJobID">
        <arg type="i" direction="out"/>
      </method>
@@@ -108,5 -110,5 +100,17 @@@
        <arg name="count" type="i" direction="in"/>
        <annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/>
      </method>
++    <signal name="newLog">
++        <arg name="text" type="s" direction="out"/>
++    </signal>
++    <signal name="newSequenceImage">
++        <arg name="filename" type="s" direction="out"/>
++    </signal>
++    <signal name="meridianFlipStarted"/>
++    <signal name="meridianFlipCompleted"/>
++    <signal name="newStatus">
++        <arg name="status" type="(i)" direction="out"/>
++        <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" \
value="Ekos::CaptureState"/> ++    </signal>
    </interface>
  </node>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic