Commit bae46bec authored by Jasem Mutlaq's avatar Jasem Mutlaq

Only clear alignment model if mount support such operation

parent 0503574c
......@@ -4269,8 +4269,12 @@ void Align::startPAHProcess()
if (Options::limitedResourcesMode())
appendLogText(i18n("Warning: Equatorial Grid Lines will not be drawn due to limited resources mode."));
appendLogText(i18n("Clearing mount Alignment Model..."));
currentTelescope->clearAlignmentModel();
if (currentTelescope->hasAlignmentModel())
{
appendLogText(i18n("Clearing mount Alignment Model..."));
currentTelescope->clearAlignmentModel();
}
PAHWidgets->setCurrentWidget(PAHFirstCapturePage);
}
......
......@@ -90,7 +90,11 @@ Mount::Mount()
connect(mountToolBoxB, SIGNAL(clicked()), this, SLOT(showMountToolBox()));
connect(clearAlignmentModelB, &QPushButton::clicked, this, [this]() {
connect(clearAlignmentModelB, &QPushButton::clicked, this, [this]()
{
if (currentTelescope->hasAlignmentModel() == false)
return;
if (currentTelescope->clearAlignmentModel())
appendLogText(i18n("Alignment Model cleared."));
else
......
......@@ -104,6 +104,9 @@ void Telescope::registerProperty(INDI::Property *prop)
}
}
if (!strcmp(prop->getName(), "ALIGNMENT_POINTSET_ACTION") || !strcmp(prop->getName(), "ALIGNLIST"))
m_hasAlignmentModel = true;
DeviceDecorator::registerProperty(prop);
}
......
......@@ -91,6 +91,7 @@ class Telescope : public DeviceDecorator
// Alignment Model
bool setAlignmentModelEnabled(bool enable);
bool clearAlignmentModel();
bool hasAlignmentModel() { return m_hasAlignmentModel; }
protected:
bool sendCoords(SkyPoint *ScopeTarget);
......@@ -113,6 +114,7 @@ class Telescope : public DeviceDecorator
QTimer *centerLockTimer = nullptr;
SkyObject *currentObject = nullptr;
bool inManualMotion = false;
bool m_hasAlignmentModel = false;
IPState NSPreviousState = IPS_IDLE;
IPState WEPreviousState = IPS_IDLE;
};
......
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