summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-28 08:57:37 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-28 08:57:37 (GMT)
commit78d8e70a6f3a440647fe74c85853da67d2e7fe73 (patch)
treedaefc15f676941331b9f4f97217d4fd9c7308b94
parent7ff6d45093e495d5ca2c6855975a2fca6c8ecdf1 (diff)
Add scope target name, if available either from direct sky map interaction or via the scheduler
-rw-r--r--kstars/ekos/ekosmanager.cpp10
-rw-r--r--kstars/ekos/ekosmanager.h3
-rw-r--r--kstars/ekos/ekosmanager.ui28
-rw-r--r--kstars/ekos/mount.cpp1
-rw-r--r--kstars/ekos/mount.h1
-rw-r--r--kstars/ekos/scheduler.h3
-rw-r--r--kstars/indi/inditelescope.cpp6
-rw-r--r--kstars/indi/inditelescope.h3
8 files changed, 49 insertions, 6 deletions
diff --git a/kstars/ekos/ekosmanager.cpp b/kstars/ekos/ekosmanager.cpp
index 203b71d..7b3a899 100644
--- a/kstars/ekos/ekosmanager.cpp
+++ b/kstars/ekos/ekosmanager.cpp
@@ -24,6 +24,7 @@
#include "kstarsdata.h"
#include "auxiliary/ksuserdb.h"
#include "fitsviewer/fitsviewer.h"
+#include "skymap.h"
#include "sequencejob.h"
@@ -143,6 +144,7 @@ EkosManager::EkosManager()
toolsWidget->addTab( schedulerProcess, QIcon(":/icons/ekos_scheduler.png"), "");
toolsWidget->tabBar()->setTabToolTip(1, i18n("Scheduler"));
connect(schedulerProcess, SIGNAL(newLog()), this, SLOT(updateLog()));
+ connect(schedulerProcess, SIGNAL(newTarget(QString)), mountTarget, SLOT(setText(QString)));
// Temporary fix. Not sure how to resize Ekos Dialog to fit contents of the various tabs in the QScrollArea which are added
// dynamically. I used setMinimumSize() but it doesn't appear to make any difference.
@@ -1452,9 +1454,12 @@ void EkosManager::initMount()
mountProcess = new Ekos::Mount();
int index = toolsWidget->addTab(mountProcess, QIcon(":/icons/ekos_mount.png"), "");
toolsWidget->tabBar()->setTabToolTip(index, i18n("Mount"));
+
connect(mountProcess, SIGNAL(newLog()), this, SLOT(updateLog()));
connect(mountProcess, SIGNAL(newCoords(QString,QString,QString,QString)), this, SLOT(updateMountCoords(QString,QString,QString,QString)));
connect(mountProcess, SIGNAL(newStatus(ISD::Telescope::TelescopeStatus)), this, SLOT(updateMountStatus(ISD::Telescope::TelescopeStatus)));
+ connect(mountProcess, SIGNAL(newTarget(QString)), mountTarget, SLOT(setText(QString)));
+
mountPI = new QProgressIndicator(mountProcess);
mountStatusLayout->addWidget(mountPI);
mountGroup->setEnabled(true);
@@ -1945,3 +1950,8 @@ void EkosManager::updateGuideProfilePixmap(QPixmap & profilePix)
guideProfileImage->setToolTip(QString("<img src='%1'>").arg(guideProfileFile.fileName()));
}
+
+void EkosManager::setTarget(SkyObject *o)
+{
+ mountTarget->setText(o->name());
+}
diff --git a/kstars/ekos/ekosmanager.h b/kstars/ekos/ekosmanager.h
index 2b5299d..dc205af 100644
--- a/kstars/ekos/ekosmanager.h
+++ b/kstars/ekos/ekosmanager.h
@@ -185,7 +185,8 @@ private slots:
// Mount Summary
void updateMountCoords(const QString &ra, const QString &dec ,const QString &az ,const QString &alt);
- void updateMountStatus(ISD::Telescope::TelescopeStatus status);
+ void updateMountStatus(ISD::Telescope::TelescopeStatus status);
+ void setTarget(SkyObject *o);
// Capture Summary
void updateCaptureStatus(Ekos::CaptureState status);
diff --git a/kstars/ekos/ekosmanager.ui b/kstars/ekos/ekosmanager.ui
index 8dc76da..b132c2e 100644
--- a/kstars/ekos/ekosmanager.ui
+++ b/kstars/ekos/ekosmanager.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>813</width>
- <height>645</height>
+ <width>868</width>
+ <height>683</height>
</rect>
</property>
<property name="baseSize">
@@ -54,8 +54,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>799</width>
- <height>631</height>
+ <width>854</width>
+ <height>669</height>
</rect>
</property>
<property name="sizePolicy">
@@ -401,6 +401,26 @@
</property>
</spacer>
</item>
+ <item>
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Target:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="mountTarget">
+ <property name="minimumSize">
+ <size>
+ <width>50</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
<item>
diff --git a/kstars/ekos/mount.cpp b/kstars/ekos/mount.cpp
index ee9a550..d07517f 100644
--- a/kstars/ekos/mount.cpp
+++ b/kstars/ekos/mount.cpp
@@ -118,6 +118,7 @@ void Mount::setTelescope(ISD::GDInterface *newTelescope)
connect(currentTelescope, SIGNAL(numberUpdated(INumberVectorProperty*)), this, SLOT(updateNumber(INumberVectorProperty*)), Qt::UniqueConnection);
connect(currentTelescope, SIGNAL(switchUpdated(ISwitchVectorProperty*)), this, SLOT(updateSwitch(ISwitchVectorProperty*)), Qt::UniqueConnection);
+ connect(currentTelescope, SIGNAL(newTarget(QString)), this, SIGNAL(newTarget(QString)), Qt::UniqueConnection);
//Disable this for now since ALL INDI drivers now log their messages to verbose output
//connect(currentTelescope, SIGNAL(messageUpdated(int)), this, SLOT(updateLog(int)), Qt::UniqueConnection);
diff --git a/kstars/ekos/mount.h b/kstars/ekos/mount.h
index 99c0f2d..a6ed495 100644
--- a/kstars/ekos/mount.h
+++ b/kstars/ekos/mount.h
@@ -212,6 +212,7 @@ public slots:
signals:
void newLog();
void newCoords(const QString &ra, const QString &dec, const QString &az, const QString &alt);
+ void newTarget(const QString &name);
void newStatus(ISD::Telescope::TelescopeStatus status);
private:
diff --git a/kstars/ekos/scheduler.h b/kstars/ekos/scheduler.h
index cffefbe..77f9fc1 100644
--- a/kstars/ekos/scheduler.h
+++ b/kstars/ekos/scheduler.h
@@ -280,7 +280,8 @@ protected slots:
signals:
void newLog();
- void weatherChanged(IPState state);
+ void weatherChanged(IPState state);
+ void newTarget(const QString &);
private:
diff --git a/kstars/indi/inditelescope.cpp b/kstars/indi/inditelescope.cpp
index 96ed3c5..b1c4e88 100644
--- a/kstars/indi/inditelescope.cpp
+++ b/kstars/indi/inditelescope.cpp
@@ -14,6 +14,7 @@
#include "inditelescope.h"
#include "kstars.h"
#include "skymap.h"
+#include "skymapcomposite.h"
#include "clientmanager.h"
#include "driverinfo.h"
@@ -454,6 +455,11 @@ bool Telescope::sendCoords(SkyPoint *ScopeTarget)
AltEle->value = currentAlt;
}
+ double maxrad = 1000.0/Options::zoomFactor();
+ SkyObject *so = KStarsData::Instance()->skyComposite()->objectNearest(ScopeTarget, maxrad );
+ if (so)
+ emit newTarget(so->name());
+
return true;
}
diff --git a/kstars/indi/inditelescope.h b/kstars/indi/inditelescope.h
index ecd9b7b..166bb14 100644
--- a/kstars/indi/inditelescope.h
+++ b/kstars/indi/inditelescope.h
@@ -73,6 +73,9 @@ public slots:
bool UnPark();
bool setSlewRate(int index);
+signals:
+ void newTarget(const QString &);
+
private:
SkyPoint currentCoord;
double minAlt,maxAlt;