summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-08 20:29:28 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-08 20:29:28 (GMT)
commitd56d662db3c30832d3c9fdd5699258f92d82302e (patch)
treedc7b882d65ac3634bc7cb5ab51a9f41721c05916
parenta9d48717d1917988bf67c72a507c2709358acbe6 (diff)
Adding option to enable/disable guide images coming from external guide applications
-rw-r--r--kstars/ekos/guide/opsguide.cpp22
-rw-r--r--kstars/ekos/guide/opsguide.h13
-rw-r--r--kstars/ekos/guide/opsguide.ui14
-rw-r--r--kstars/kstars.kcfg4
4 files changed, 36 insertions, 17 deletions
diff --git a/kstars/ekos/guide/opsguide.cpp b/kstars/ekos/guide/opsguide.cpp
index 1ed3fe0..a037885 100644
--- a/kstars/ekos/guide/opsguide.cpp
+++ b/kstars/ekos/guide/opsguide.cpp
@@ -18,7 +18,6 @@
#include "Options.h"
#include "opsguide.h"
-#include "guide.h"
#include "kstars.h"
#include "internalguide/internalguider.h"
@@ -26,12 +25,10 @@
namespace Ekos
{
-OpsGuide::OpsGuide(InternalGuider *guiderObject) : QFrame( KStars::Instance() )
+OpsGuide::OpsGuide() : QFrame( KStars::Instance() )
{
setupUi(this);
- guider = guiderObject;
-
//Get a pointer to the KConfigDialog
m_ConfigDialog = KConfigDialog::exists( "guidesettings" );
@@ -49,10 +46,10 @@ OpsGuide::~OpsGuide() {}
void OpsGuide::showEvent(QShowEvent *)
{
- slotLoadSettings(Options::guiderType());
+ slotLoadSettings(static_cast<Guide::GuiderType>(Options::guiderType()));
}
-void OpsGuide::slotLoadSettings(int guiderType)
+void OpsGuide::slotLoadSettings(Guide::GuiderType guiderType)
{
switch (guiderType)
{
@@ -79,29 +76,36 @@ void OpsGuide::slotLoadSettings(int guiderType)
externalHost->setText(Options::lINGuiderHost());
externalPort->setText(QString::number(Options::lINGuiderPort()));
break;
- }
+ }
}
void OpsGuide::slotApply()
{
+ Guide::GuiderType type;
+
switch (guiderTypeButtonGroup->checkedId())
{
case Guide::GUIDE_INTERNAL:
+ type = Guide::GUIDE_INTERNAL;
Options::setGuiderType(Guide::GUIDE_INTERNAL);
break;
case Guide::GUIDE_PHD2:
- Options::setGuiderType(Guide::GUIDE_INTERNAL);
+ type = Guide::GUIDE_PHD2;
+ Options::setGuiderType(Guide::GUIDE_PHD2);
Options::setPHD2Host(externalHost->text());
Options::setPHD2Port(externalPort->text().toInt());
break;
case Guide::GUIDE_LINGUIDER:
- Options::setGuiderType(Guide::GUIDE_INTERNAL);
+ type = Guide::GUIDE_LINGUIDER;
+ Options::setGuiderType(Guide::GUIDE_LINGUIDER);
Options::setLINGuiderHost(externalHost->text());
Options::setLINGuiderPort(externalPort->text().toInt());
break;
}
+
+ emit guiderTypeChanged(type);
}
}
diff --git a/kstars/ekos/guide/opsguide.h b/kstars/ekos/guide/opsguide.h
index c1f7164..0799afe 100644
--- a/kstars/ekos/guide/opsguide.h
+++ b/kstars/ekos/guide/opsguide.h
@@ -11,14 +11,13 @@
#define OpsGuide_H_
#include "ui_opsguide.h"
+#include "guide.h"
class KConfigDialog;
namespace Ekos
{
-class InternalGuider;
-
/**
* @class OpsGuide
*
@@ -31,7 +30,7 @@ class OpsGuide : public QFrame, public Ui::OpsGuide
Q_OBJECT
public:
- explicit OpsGuide(InternalGuider *guiderObject);
+ explicit OpsGuide();
~OpsGuide();
protected:
@@ -40,11 +39,13 @@ protected:
private slots:
void slotApply();
- void slotLoadSettings(int guiderType);
+ void slotLoadSettings(Guide::GuiderType guiderType);
+
+signals:
+ void guiderTypeChanged(Guide::GuiderType guiderType);
private:
- KConfigDialog *m_ConfigDialog;
- InternalGuider *guider;
+ KConfigDialog *m_ConfigDialog;
};
}
diff --git a/kstars/ekos/guide/opsguide.ui b/kstars/ekos/guide/opsguide.ui
index c7fbbbf..e1702e8 100644
--- a/kstars/ekos/guide/opsguide.ui
+++ b/kstars/ekos/guide/opsguide.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>275</width>
- <height>223</height>
+ <width>269</width>
+ <height>229</height>
</rect>
</property>
<property name="windowTitle">
@@ -117,6 +117,16 @@
</item>
</layout>
</item>
+ <item>
+ <widget class="QCheckBox" name="kcfg_GuideRemoteImagesEnabled">
+ <property name="toolTip">
+ <string>For external guiders, enable receiving guide images in Ekos.</string>
+ </property>
+ <property name="text">
+ <string>Receive external guide frames</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
diff --git a/kstars/kstars.kcfg b/kstars/kstars.kcfg
index da1cdf9..531cb60 100644
--- a/kstars/kstars.kcfg
+++ b/kstars/kstars.kcfg
@@ -1629,6 +1629,10 @@
<label>Automatically select the square size based on the selected star width.</label>
<default>false</default>
</entry>
+ <entry name="GuideRemoteImagesEnabled" type="Bool">
+ <label>When using external guiders, enable reception of remote images in Ekos guide module. By default, remote images are disabled.</label>
+ <default>false</default>
+ </entry>
<entry name="AutoModeIterations" type="UInt">
<label>Number of automode iterations for calibration process.</label>
<default>5</default>