Commit d390e122 authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Support displaying captured FITS images in a single tab only

parent a69fb8f0
......@@ -221,7 +221,7 @@ int FITSViewer::addFITS(const KUrl *imageName, FITSMode mode, FITSScale filter)
switch (mode)
{
case FITS_NORMAL:
fitsTab->addTab(tab, imageName->fileName());
fitsTab->addTab(tab, Options::singlePreviewFITS() ? i18n("Preview") : imageName->fileName());
break;
case FITS_CALIBRATE:
......@@ -267,14 +267,29 @@ int FITSViewer::addFITS(const KUrl *imageName, FITSMode mode, FITSScale filter)
bool FITSViewer::updateFITS(const KUrl *imageName, int fitsUID, FITSScale filter)
{
FITSTab *tab = fitsMap.value(fitsUID);
if (tab == NULL)
return false;
bool rc=false;
if (tab->isVisible())
led->setColor(Qt::yellow);
if (tab)
{
rc = tab->loadFITS(imageName, tab->getImage()->getMode(), filter);
int tabIndex = fitsTab->indexOf(tab);
if (tabIndex != -1 && tab->getImage()->getMode() == FITS_NORMAL)
{
if (imageName->path().startsWith("/tmp") && Options::singlePreviewFITS())
fitsTab->setTabText(tabIndex,i18n("Preview"));
else
fitsTab->setTabText(tabIndex, imageName->fileName());
}
}
if (tab->isVisible())
{
if (rc)
......
......@@ -954,7 +954,11 @@ void CCD::processBLOB(IBLOB* bp)
switch (targetChip->getCaptureMode())
{
case FITS_NORMAL:
normalTabID = fv->addFITS(&fileURL, FITS_NORMAL, captureFilter);
if (normalTabID == -1 || Options::singlePreviewFITS() == false)
normalTabID = fv->addFITS(&fileURL, FITS_NORMAL, captureFilter);
else if (fv->updateFITS(&fileURL, normalTabID, captureFilter) == false)
normalTabID = fv->addFITS(&fileURL, FITS_NORMAL, captureFilter);
targetChip->setImage(fv->getImage(normalTabID), FITS_NORMAL);
break;
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>495</width>
<height>485</height>
<height>523</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
......@@ -274,12 +274,15 @@
<property name="title">
<string>Display</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="kcfg_showTargetCrosshair">
<property name="toolTip">
<string>Display the telescope position on the sky map</string>
</property>
<property name="statusTip">
<string>Display a telescope marker on the sky map in order to track the telescope motion across the sky.</string>
</property>
<property name="whatsThis">
<string>Display a telescope marker on the sky map in order to track the telescope motion across the sky.</string>
</property>
......@@ -296,6 +299,9 @@
<property name="toolTip">
<string>Display INDI status messages in the status bar</string>
</property>
<property name="statusTip">
<string>Display incoming INDI status messages in KStars status bar</string>
</property>
<property name="whatsThis">
<string>Display incoming INDI status messages in KStars status bar</string>
</property>
......@@ -309,6 +315,9 @@
</item>
<item>
<widget class="QCheckBox" name="kcfg_showFITS">
<property name="statusTip">
<string>When a FITS image is captured from a camera, download and display the FITS automatically in KStars FITS Viewer</string>
</property>
<property name="whatsThis">
<string>When a FITS image is captured from a camera, download and display the FITS automatically in KStars FITS Viewer</string>
</property>
......@@ -320,6 +329,22 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_singlePreviewFITS">
<property name="statusTip">
<string>Display all captured FITS images in a single tab instead of multiple tabs per image.</string>
</property>
<property name="whatsThis">
<string>Display all captured FITS images in a single tab instead of multiple tabs per image.</string>
</property>
<property name="text">
<string>Single Preview FITS</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
......@@ -400,7 +425,16 @@
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>11</number>
</property>
<property name="topMargin">
<number>11</number>
</property>
<property name="rightMargin">
<number>11</number>
</property>
<property name="bottomMargin">
<number>11</number>
</property>
<item>
......@@ -408,7 +442,16 @@
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -432,7 +475,16 @@
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -533,7 +585,16 @@
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item>
......@@ -541,7 +602,16 @@
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -565,7 +635,16 @@
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......
......@@ -142,6 +142,11 @@
<whatsthis>Toggle automatic display of FITS files upon capture.</whatsthis>
<default>true</default>
</entry>
<entry name="singlePreviewFITS" type="Bool">
<label>Preview FITS in a single tab?</label>
<whatsthis>Display all captured FITS images in a single tab instead of multiple tabs per image.</whatsthis>
<default>false</default>
</entry>
<entry name="telescopePort" type="String">
<label>INDI Telescope port</label>
<whatsthis>The port to which the telescope is attached (e.g., /dev/ttyUSB0)</whatsthis>
......
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