Commit 32225eca authored by Jasem Mutlaq's avatar Jasem Mutlaq

Minor GUI fixes. Check if WCS header exists before trying to load WCS data in FITSView

parent 53155f1f
......@@ -246,20 +246,6 @@ bool FITSView::loadFITS (const QString &inFilename , bool silent)
maxPixel = imageData->getMax();
minPixel = imageData->getMin();
if (Options::autoWCS() && (mode == FITS_NORMAL || mode == FITS_ALIGN))
{
if (fitsProg.wasCanceled())
return false;
// Only invoke loadWCS when we are not restricted by CPU/Memory
else if (Options::limitedResourcesMode() == false)
{
QFuture<bool> future = QtConcurrent::run(imageData, &FITSData::loadWCS);
wcsWatcher.setFuture(future);
fitsProg.setValue(75);
qApp->processEvents();
}
}
initDisplayImage();
// Rescale to fits window
......@@ -293,7 +279,13 @@ bool FITSView::loadFITS (const QString &inFilename , bool silent)
setAlignment(Qt::AlignCenter);
if (Options::autoWCS() == false)
// Load WCS data now if selected and image contains valid WCS header
if (imageData->hasWCS() && Options::autoWCS() && (mode == FITS_NORMAL || mode == FITS_ALIGN))
{
QFuture<bool> future = QtConcurrent::run(imageData, &FITSData::loadWCS);
wcsWatcher.setFuture(future);
}
else
syncWCSState();
if (isVisible())
......@@ -1501,9 +1493,6 @@ void FITSView::createFloatingToolBar()
}
}
/**
This methood either enables or disables the scope mouse mode so you can slew your scope to coordinates
just by clicking the mouse on a spot in the image.
......
......@@ -24,6 +24,7 @@ OpsFITS::OpsFITS() : QFrame(KStars::Instance())
{
kcfg_Auto3DCube->setChecked(false);
kcfg_AutoDebayer->setChecked(false);
kcfg_AutoWCS->setChecked(false);
}
});
connect(kcfg_Auto3DCube, &QCheckBox::toggled, this, [this](bool toggled)
......@@ -34,4 +35,8 @@ OpsFITS::OpsFITS() : QFrame(KStars::Instance())
{
if (toggled) kcfg_LimitedResourcesMode->setChecked(false);
});
connect(kcfg_AutoWCS, &QCheckBox::toggled, this, [this](bool toggled)
{
if (toggled) kcfg_LimitedResourcesMode->setChecked(false);
});
}
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>335</width>
<height>128</height>
<height>150</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
......@@ -120,13 +120,7 @@
<item>
<widget class="QCheckBox" name="kcfg_LimitedResourcesMode">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enable limited resource mode to turn off any resource-intensive operations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Auto Debayer: Bayered images will not be debayered. Only grayscale images are shown.&lt;/li&gt;
&lt;li&gt;3D Cube: RGB images will not be processed. Only grayscale images are shown.&lt;/li&gt;
&lt;li&gt;World Coordinate System (WCS): WCS data will not be processed. WCS maps sky coordiantes to image coordinates. Equatorial grid lines, object identification, and telescope slew within an image are disabled.&lt;/li&gt;
&lt;/ul&gt;
&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enable limited resource mode to turn off any resource-intensive operations:&lt;/p&gt;&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Auto Debayer&lt;/span&gt;: Bayered images will not be debayered. Only grayscale images are shown.&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Auto WCS&lt;/span&gt;: World Coordinate System data will not be processed. WCS maps sky coordiantes to image coordinates. Equatorial grid lines, object identification, and telescope slew within an image are disabled.&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;3D Cube&lt;/span&gt;: RGB images will not be processed. Only grayscale images are shown.&lt;/li&gt;&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Limited Resources Mode</string>
......
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