Skip to content

Commit

Permalink
Add a Critical warning box
Browse files Browse the repository at this point in the history
  • Loading branch information
gzotti committed Mar 5, 2023
1 parent f1e7747 commit c580f29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions plugins/TelescopeControl/src/TelescopeClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "INDI/TelescopeClientINDI.hpp"
#include "StelTranslator.hpp"
#include "StelCore.hpp"
#include "StelMainView.hpp"

#include <cmath>

Expand All @@ -41,6 +42,7 @@
#include <QString>
#include <QTcpSocket>
#include <QTextStream>
#include <QMessageBox>

#ifdef Q_OS_WIN
#include "ASCOM/TelescopeClientASCOM.hpp"
Expand Down Expand Up @@ -142,6 +144,12 @@ QString TelescopeClient::getInfoString(const StelCore* core, const InfoStringGro
return str;
}

void TelescopeClient::telescopeAbortSlew()
{
qWarning() << "Telescope" << getID() << "does not support AbortSlew()!";
QMessageBox::critical(&StelMainView::getInstance(), q_("QUICK!"), q_("This Telescope does not support Abort command!"));
}

void TelescopeClient::move(double angle, double speed)
{
Q_UNUSED(angle)
Expand Down
4 changes: 3 additions & 1 deletion plugins/TelescopeControl/src/TelescopeClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ class TelescopeClient : public QObject, public StelObject
// Methods specific to telescope
virtual void telescopeGoto(const Vec3d &j2000Pos, StelObjectP selectObject) = 0;
virtual void telescopeSync(const Vec3d &j2000Pos, StelObjectP selectObject) = 0;
virtual void telescopeAbortSlew() { qWarning() << "Telescope" << getID() << "does not support AbortSlew()!"; }
//! Send command to abort slew. Not all telescopes support this, base implementation only gives a warning.
//! After abort, the current position should be retrieved and displayed.
virtual void telescopeAbortSlew();

//!
//! \brief move
Expand Down

0 comments on commit c580f29

Please sign in to comment.