Commit 2f928fbf authored by Artem Fedoskin's avatar Artem Fedoskin
Browse files

KStars Lite - Fix bug with INDI in Android version

parent 3b3e27ea
......@@ -83,7 +83,7 @@ add_definitions(${EIGEN_DEFINITIONS})
include_directories(${EIGEN3_INCLUDE_DIR})
if(BUILD_KSTARS_LITE)
find_package(CFitsio) #REQUIRED)
find_package(CFitsio REQUIRED)
else()
find_package(CFitsio)
endif()
......
......@@ -29,12 +29,10 @@
#include "ksutils.h"
#include "Options.h"
#ifdef HAVE_INDI
#include <basedevice.h>
#include "indi/indilistener.h"
#include "indi/indistd.h"
#include "indi/driverinfo.h"
#endif
#include <QImage>
#define ZOOM_DEFAULT 100.0
......
......@@ -27,9 +27,7 @@
#include "ksplanetbase.h"
#include <QScreen>
#ifdef HAVE_INDI
#include "indi/clientmanagerlite.h"
#endif
#include "kspaths.h"
......@@ -59,11 +57,9 @@ KStarsLite::KStarsLite( bool doSplash, bool startClock, const QString &startDate
m_KStarsData = KStarsData::Create();
Q_ASSERT( m_KStarsData );
#ifdef HAVE_INDI
//INDI Android Client
m_clientManager = new ClientManagerLite;
m_Engine.rootContext()->setContextProperty("ClientManagerLite", m_clientManager);
#endif
//Make instance of KStarsLite and KStarsData available to QML
m_Engine.rootContext()->setContextProperty("KStarsLite", this);
......
......@@ -36,9 +36,7 @@ class FindDialogLite;
class DetailDialogLite;
class LocationDialogLite;
#ifdef HAVE_INDI
class ClientManagerLite;
#endif
class QQuickItem;
......@@ -110,10 +108,8 @@ public:
/** @return true if tutorial should be shown **/
bool getRunTutorial();
#ifdef HAVE_INDI
/** @return pointer to KStarsData object which handles connection to INDI server. */
inline ClientManagerLite *clientManagerLite() const { return m_clientManager; }
#endif
/** @defgroup kconfigwrappers QML wrappers around KConfig
* @{
......@@ -241,9 +237,7 @@ private:
DetailDialogLite *m_detailDialogLite;
LocationDialogLite *m_locationDialogLite;
#ifdef HAVE_INDI
ClientManagerLite *m_clientManager;
#endif
};
#endif
......
......@@ -98,6 +98,7 @@ KSPage {
notification.showNotification(xi18n("Couldn't connect to the server"))
}
} else {
ClientManagerLite.disconnectHost()
}
Qt.inputMethod.hide()
......
......@@ -38,10 +38,8 @@
#include "kstarslite/skyitems/lines/eclipticitem.h"
#include "kstarslite/skyitems/lines/milkywayitem.h"
#ifdef HAVE_INDI
//Symbols
#include "kstarslite/skyitems/telescopesymbolsitem.h"
#endif
#include "kstarslite/skyitems/fovitem.h"
......@@ -98,9 +96,7 @@ RootNode::RootNode()
m_internedResolvedCatalogItem = new SyncedCatalogItem(m_skyComposite->internetResolvedComponent(), this);
m_manualAdditionsCatalogItem = new SyncedCatalogItem(m_skyComposite->manualAdditionsComponent(), this);
#ifdef HAVE_INDI
m_telescopeSymbols = new TelescopeSymbolsItem(this);
#endif
setIsRectangular(false);
updateClipPoly();
......@@ -268,9 +264,7 @@ void RootNode::update(bool clearTextures) {
m_internedResolvedCatalogItem->update();
m_manualAdditionsCatalogItem->update();
#ifdef HAVE_INDI
m_telescopeSymbols->update();
#endif
m_labelsItem->update();
m_FOVItem->update();
......
......@@ -49,9 +49,7 @@ class SyncedCatalogItem;
class FOVItem;
#ifdef HAVE_INDI
class TelescopeSymbolsItem;
#endif
/** @class RootNode
*
......@@ -107,9 +105,7 @@ public:
*/
void genCachedTextures();
#ifdef HAVE_INDI
inline TelescopeSymbolsItem *telescopeSymbolsItem() { return m_telescopeSymbols; }
#endif
private:
QVector<QVector<QSGTexture *>> m_textureCache;
QVector<QVector<QSGTexture *>> m_oldTextureCache;
......@@ -145,8 +141,6 @@ private:
QSGGeometryNode *m_visualizeClipping;
FOVItem *m_FOVItem;
#ifdef HAVE_INDI
TelescopeSymbolsItem *m_telescopeSymbols;
#endif
};
#endif
......@@ -18,11 +18,9 @@
#include "kstarsdata.h"
#include "kstarslite.h"
#ifdef HAVE_INDI
#include "indi/inditelescopelite.h"
#include "indi/clientmanagerlite.h"
#include "kstarslite/skyitems/telescopesymbolsitem.h"
#endif
#include "projections/projector.h"
#include "projections/lambertprojector.h"
......@@ -133,12 +131,10 @@ SkyMapLite::SkyMapLite()
connect( this, SIGNAL( destinationChanged() ), this, SLOT( slewFocus() ) );
connect( KStarsData::Instance(), SIGNAL( skyUpdate( bool ) ), this, SLOT( slotUpdateSky( bool ) ) );
#ifdef HAVE_INDI
ClientManagerLite *clientMng = KStarsLite::Instance()->clientManagerLite();
connect(clientMng, &ClientManagerLite::telescopeAdded, [this](TelescopeLite *newTelescope){ this->m_newTelescopes.append(newTelescope->getDevice()); });
connect(clientMng, &ClientManagerLite::telescopeRemoved, [this](TelescopeLite *newTelescope){ this->m_delTelescopes.append(newTelescope->getDevice()); });
#endif
}
QSGNode* SkyMapLite::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) {
......@@ -155,7 +151,6 @@ QSGNode* SkyMapLite::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *upda
m_rootNode = n;
}
/** Add or delete telescope crosshairs **/
#ifdef HAVE_INDI
if(m_newTelescopes.count() > 0) {
foreach(INDI::BaseDevice *telescope, m_newTelescopes) {
n->telescopeSymbolsItem()->addTelescope(telescope);
......@@ -169,7 +164,6 @@ QSGNode* SkyMapLite::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *upda
}
m_delTelescopes.clear();
}
#endif
//Notify RootNode that textures for point node should be recreated
n->update(clearTextures);
clearTextures = false;
......
......@@ -30,9 +30,7 @@
#include "kstarsdata.h"
#include "kstarslite/skyitems/rootnode.h"
#ifdef HAVE_INDI
#include "basedevice.h"
#endif
class dms;
class KStarsData;
......@@ -684,10 +682,8 @@ private:
bool tapBegan;
#ifdef HAVE_INDI
QList<INDI::BaseDevice *> m_newTelescopes;
QList<INDI::BaseDevice *> m_delTelescopes;
#endif
};
#endif
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