Commit 78d8e70a authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Add scope target name, if available either from direct sky map interaction or via the scheduler

parent 7ff6d450
......@@ -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());
}
......@@ -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);
......
......@@ -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>
......
......@@ -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);
......
......@@ -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:
......
......@@ -280,7 +280,8 @@ protected slots:
signals:
void newLog();
void weatherChanged(IPState state);
void weatherChanged(IPState state);
void newTarget(const QString &);
private:
......
......@@ -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;
}
......
......@@ -73,6 +73,9 @@ public slots:
bool UnPark();
bool setSlewRate(int index);
signals:
void newTarget(const QString &);
private:
SkyPoint currentCoord;
double minAlt,maxAlt;
......
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