Commit c0823cc3 authored by Jasem Mutlaq's avatar Jasem Mutlaq

Try to solve the issue of external guiding frames once and for all. When using...

Try to solve the issue of external guiding frames once and for all. When using external guiding app, ALL CCDs BLOBs get automatically disabled. However, when trying to capture in ANY of the CCDs, then its corresponding BLOB shall be enable without warning the user, just transparently
parent 80cb32f1
......@@ -2303,6 +2303,11 @@ bool Align::captureAndSolve()
return false;
}
if (currentCCD->isBLOBEnabled() == false)
{
currentCCD->setBLOBEnabled(true);
}
if (parser->init() == false)
return false;
......
......@@ -2030,14 +2030,13 @@ void Capture::prepareJob(SequenceJob *job)
setCCD(activeJob->getActiveCCD()->getDeviceName());
}
if (currentCCD->getDriverInfo()->getClientManager()->getBLOBMode(currentCCD->getDeviceName(), "CCD1") == B_NEVER)
if (currentCCD->isBLOBEnabled() == false)
{
if (KMessageBox::questionYesNo(
0, i18n("Image transfer is disabled for this camera. Would you like to enable it?")) ==
if (Options::guiderType() != Ekos::Guide::GUIDE_INTERNAL || KMessageBox::questionYesNo(0, i18n("Image transfer is disabled for this camera. Would you like to enable it?")) ==
KMessageBox::Yes)
{
currentCCD->getDriverInfo()->getClientManager()->setBLOBMode(B_ALSO, currentCCD->getDeviceName(), "CCD1");
currentCCD->getDriverInfo()->getClientManager()->setBLOBMode(B_ALSO, currentCCD->getDeviceName(), "CCD2");
currentCCD->setBLOBEnabled(true);
}
else
{
......
......@@ -913,6 +913,11 @@ void Focus::capture()
return;
}
if (currentCCD->isBLOBEnabled() == false)
{
currentCCD->setBLOBEnabled(true);
}
if (currentFilter != nullptr && lockFilterCheck->isChecked())
{
if (currentFilter->isConnected() == false)
......
......@@ -2334,25 +2334,24 @@ void Guide::showFITSViewer()
void Guide::setBLOBEnabled(bool enable)
{
// Nothing to do if guider is international or remote images are enabled
if (guiderType == GUIDE_INTERNAL || Options::guideRemoteImagesEnabled() || currentCCD == nullptr)
if (guiderType == GUIDE_INTERNAL || Options::guideRemoteImagesEnabled())
return;
// If guider is external and remote images option is disabled AND BLOB is enabled, then we disabled it
if (enable == false && currentCCD->getDriverInfo()->getClientManager()->getBLOBMode(currentCCD->getDeviceName(), "CCD1") != B_NEVER)
foreach(ISD::CCD *oneCCD, CCDs)
{
appendLogText(i18n("Disabling remote image reception from %1", currentCCD->getDeviceName()));
currentCCD->getDriverInfo()->getClientManager()->setBLOBMode(B_NEVER, currentCCD->getDeviceName(), "CCD1");
currentCCD->getDriverInfo()->getClientManager()->setBLOBMode(B_NEVER, currentCCD->getDeviceName(), "CCD2");
}
// Re-enable BLOB reception if it was disabled before when using external guiders
else if (enable && currentCCD->getDriverInfo()->getClientManager()->getBLOBMode(currentCCD->getDeviceName(), "CCD1") == B_NEVER)
{
appendLogText(i18n("Enabling remote image reception from %1", currentCCD->getDeviceName()));
currentCCD->getDriverInfo()->getClientManager()->setBLOBMode(B_ALSO, currentCCD->getDeviceName(), "CCD1");
currentCCD->getDriverInfo()->getClientManager()->setBLOBMode(B_ALSO, currentCCD->getDeviceName(), "CCD2");
if (enable == false && oneCCD->isBLOBEnabled())
{
appendLogText(i18n("Disabling remote image reception from %1", oneCCD->getDeviceName()));
oneCCD->setBLOBEnabled(enable);
}
// Re-enable BLOB reception if it was disabled before when using external guiders
else if (enable && oneCCD->isBLOBEnabled() == false)
{
appendLogText(i18n("Enabling remote image reception from %1", oneCCD->getDeviceName()));
oneCCD->setBLOBEnabled(enable);
}
}
}
}
......@@ -2405,4 +2405,26 @@ bool CCD::getGainMinMaxStep(double *min, double *max, double *step)
return true;
}
bool CCD::isBLOBEnabled()
{
return (clientManager->getBLOBMode(getDeviceName(), "CCD1") != B_NEVER);
}
bool CCD::setBLOBEnabled(bool enable)
{
if (enable)
{
clientManager->setBLOBMode(B_ALSO, getDeviceName(), "CCD1");
clientManager->setBLOBMode(B_ALSO, getDeviceName(), "CCD2");
}
else
{
clientManager->setBLOBMode(B_NEVER, getDeviceName(), "CCD1");
clientManager->setBLOBMode(B_NEVER, getDeviceName(), "CCD2");
}
return true;
}
}
......@@ -189,6 +189,10 @@ class CCD : public DeviceDecorator
TransferFormat getTransferFormat() { return transferFormat; }
bool setTransformFormat(CCD::TransferFormat format);
// BLOB control
bool isBLOBEnabled();
bool setBLOBEnabled(bool enable);
// Video Stream
bool setVideoStreamEnabled(bool enable);
bool resetStreamingFrame();
......
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