Commit 23f581b9 authored by Robert Lancaster's avatar Robert Lancaster Committed by Jasem Mutlaq

+ Fading the floating toolbar so its not as obtrusive. Note that the effect can be modified.

+ Made a button to make the FITSViewer optional for taking images with the capture module.  This would make sense if you are taking lots of photos and are using the summary page to monitor and would prefer to avoid window clutter.
+ Put a preview fits view in the ekos manager that loads when you take a FITS_NORMAL image.  This is great for monitoring the image in the summary page since you can zoom way in or out to see that different aspects of your image are being recorded well .  The image can also get loaded in the fits viewer simultaneously.  This can have the added benefit of monitoring one area of the image in the fits viewer and another in the summary page.
+ Figured out why the graph in the focus module got scrunched that one time when I was talking with you on google hangouts and I couldn’t figure out what had happened.  It was because I had just been using the full screen focus window and had put it back away. When it was added to the right panel, it took on its minimum size.  So I came up with a way that the user can resize the fits view and the graph on the right hand side of the focus module.
parent e5718338
......@@ -212,6 +212,7 @@ Capture::Capture()
autofocusCheck->setChecked(Options::enforceAutofocus());
meridianCheck->setChecked(Options::autoMeridianFlip());
meridianHours->setValue(Options::autoMeridianHours());
useFITSViewerInCapture->setChecked(Options::useFITSViewerInCapture());
connect(autofocusCheck, SIGNAL(toggled(bool)), this, SLOT(setDirty()));
connect(HFRPixels, SIGNAL(valueChanged(double)), this, SLOT(setDirty()));
......@@ -222,6 +223,7 @@ Capture::Capture()
connect(uploadModeCombo, SIGNAL(activated(int)), this, SLOT(setDirty()));
connect(remoteDirIN, SIGNAL(editingFinished()), this, SLOT(setDirty()));
// Post capture script
connect(&postCaptureScript, SIGNAL(finished(int)), this, SLOT(postScriptFinished(int)));
......@@ -337,6 +339,7 @@ void Capture::start()
Options::setEnforceAutofocus(autofocusCheck->isChecked());
Options::setAutoMeridianFlip(meridianCheck->isChecked());
Options::setAutoMeridianHours(meridianHours->value());
Options::setUseFITSViewerInCapture(useFITSViewerInCapture->isChecked());
if (queueTable->rowCount() ==0)
addJob();
......@@ -1227,6 +1230,8 @@ bool Capture::resumeSequence()
void Capture::captureOne()
{
Options::setUseFITSViewerInCapture(useFITSViewerInCapture->isChecked());
//if (currentCCD->getUploadMode() == ISD::CCD::UPLOAD_LOCAL)
if (uploadModeCombo->currentIndex() != 0)
{
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>587</width>
<height>544</height>
<width>736</width>
<height>590</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_5" columnstretch="1,2">
......@@ -1546,13 +1546,35 @@
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QCheckBox" name="useFITSViewerInCapture">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Use FITS Viewer </string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="darkSubCheck">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Perform automatic dark subtraction in preview mode</string>
</property>
<property name="text">
<string>Auto dark subtract</string>
<string>Auto dark subtract </string>
</property>
<property name="checked">
<bool>false</bool>
......
......@@ -25,6 +25,8 @@
#include "kstarsdata.h"
#include "auxiliary/ksuserdb.h"
#include "fitsviewer/fitsviewer.h"
#include "fitsviewer/fitstab.h"
#include "fitsviewer/fitsview.h"
#include "skymap.h"
#include "capture/sequencejob.h"
......@@ -179,6 +181,15 @@ EkosManager::EkosManager(QWidget *parent) : QDialog(parent)
// Also set Layout policy to SetMinAndMaxSize as well. Any idea how to fix this?
// FIXME
//resize(1000,750);
previewView = new FITSView(previewWidget, FITS_NORMAL);
previewWidget->setContentsMargins(0,0,0,0);
previewView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
previewView->setBaseSize(previewWidget->size());
previewView->createFloatingToolBar();
QVBoxLayout *vlayout = new QVBoxLayout();
vlayout->addWidget(previewView);
previewWidget->setLayout(vlayout);
}
void EkosManager::changeAlwaysOnTop(Qt::ApplicationState state)
......@@ -232,7 +243,7 @@ void EkosManager::showEvent(QShowEvent * /*event*/)
void EkosManager::resizeEvent(QResizeEvent *)
{
previewImage->setPixmap(previewPixmap->scaled(previewImage->width(), previewImage->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
//previewImage->setPixmap(previewPixmap->scaled(previewImage->width(), previewImage->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
if (focusStarPixmap)
focusStarImage->setPixmap(focusStarPixmap->scaled(focusStarImage->width(), focusStarImage->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
//if (focusProfilePixmap)
......@@ -1926,9 +1937,9 @@ void EkosManager::updateCaptureProgress(QImage *image, Ekos::SequenceJob *job)
{
if (image)
{
delete (previewPixmap);
previewPixmap = new QPixmap(QPixmap::fromImage(*image));
previewImage->setPixmap(previewPixmap->scaled(previewImage->width(), previewImage->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
//delete (previewPixmap);
//previewPixmap = new QPixmap(QPixmap::fromImage(*image));
//previewImage->setPixmap(previewPixmap->scaled(previewImage->width(), previewImage->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
}
if (job->isPreview() == false)
......
......@@ -80,6 +80,7 @@ public:
Ekos::Guide *guideModule() { return guideProcess;}
Ekos::Align *alignModule() { return alignProcess;}
Ekos::Mount *mountModule() { return mountProcess;}
FITSView *getPreviewView() { return previewView; }
/** @defgroup EkosDBusInterface Ekos DBus Interface
* EkosManager interface provides advanced scripting capabilities to establish and shutdown Ekos services.
......@@ -122,6 +123,8 @@ public:
*/
Q_SCRIPTABLE bool stop();
protected:
void closeEvent(QCloseEvent *);
void hideEvent(QHideEvent *);
......@@ -281,6 +284,8 @@ private slots:
QTimer countdownTimer;
QPixmap *previewPixmap;
QProgressIndicator *capturePI;
// Preview Frame
FITSView *previewView;
// Focus Summary
QProgressIndicator *focusPI;
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>612</width>
<height>629</height>
<width>624</width>
<height>692</height>
</rect>
</property>
<property name="maximumSize">
......@@ -431,6 +431,18 @@
<string>Capture</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_13">
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<layout class="QHBoxLayout" name="captureStatusLayout">
<property name="spacing">
......@@ -472,42 +484,21 @@
</layout>
</item>
<item>
<widget class="QLabel" name="previewImage">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="QWidget" name="previewWidget" native="true">
<property name="minimumSize">
<size>
<width>250</width>
<height>250</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="cursor">
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">background-color:black;</string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="text">
<string/>
<property name="toolTipDuration">
<number>1</number>
</property>
<property name="scaledContents">
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<property name="styleSheet">
<string notr="true"/>
</property>
</widget>
</item>
......
......@@ -674,143 +674,145 @@ Otherwise, the autofocus process will utilize whatever filter currently set by t
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="rightLayout" stretch="4,3">
<property name="spacing">
<number>1</number>
<widget class="QSplitter" name="rightLayout">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<widget class="QWidget" name="focusingWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QWidget" name="focusingWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>320</width>
<height>240</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>40</width>
<height>30</height>
</size>
</property>
</widget>
<widget class="QGroupBox" name="groupBox_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>200</height>
</size>
</property>
<property name="title">
<string>V-Curve</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>-1</number>
</property>
<property name="minimumSize">
<size>
<width>320</width>
<height>240</height>
</size>
<property name="leftMargin">
<number>3</number>
</property>
<property name="sizeIncrement">
<size>
<width>40</width>
<height>30</height>
</size>
<property name="topMargin">
<number>3</number>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>200</height>
</size>
<property name="rightMargin">
<number>3</number>
</property>
<property name="title">
<string>V-Curve</string>
<property name="bottomMargin">
<number>3</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>1</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QCustomPlot" name="HFRPlot" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>100</height>
</size>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing">
<number>1</number>
</property>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>HFR:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="HFROut">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>pixels</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="relativeProfileB">
<property name="text">
<string>Relative Profile...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clearDataB">
<property name="text">
<string>Clear Data</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
<item>
<widget class="QCustomPlot" name="HFRPlot" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>100</height>
</size>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing">
<number>1</number>
</property>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>HFR:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="HFROut">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>pixels</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="relativeProfileB">
<property name="text">
<string>Relative Profile...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clearDataB">
<property name="text">
<string>Clear Data</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</item>
......
......@@ -134,6 +134,33 @@ int FITSView::getMouseMode(){
return mouseMode;
}
void FITSView::enterEvent(QEvent * event){
if(floatingToolBar){
QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(this);
floatingToolBar->setGraphicsEffect(eff);
QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity");
a->setDuration(500);
a->setStartValue(0.2);
a->setEndValue(1);
a->setEasingCurve(QEasingCurve::InBack);
a->start(QPropertyAnimation::DeleteWhenStopped); }
}
void FITSView::leaveEvent(QEvent * event){
if(floatingToolBar){
QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(this);
floatingToolBar->setGraphicsEffect(eff);
QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity");
a->setDuration(500);
a->setStartValue(1);
a->setEndValue(0.2);
a->setEasingCurve(QEasingCurve::OutBack);
a->start(QPropertyAnimation::DeleteWhenStopped);
}
}
/**
This method was added to make the panning function work.
If the mouse button is released, it resets mouseButtonDown variable and the mouse cursor.
......@@ -1576,8 +1603,11 @@ void FITSView::createFloatingToolBar()
return;
floatingToolBar = new QToolBar(this);
floatingToolBar->setAttribute(Qt::WA_TranslucentBackground);
QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(this);
floatingToolBar->setGraphicsEffect(eff);
eff->setOpacity(0.2);
floatingToolBar->setStyleSheet("QToolBar{background: rgba(150, 150, 150, 210); border:none; color: yellow}"
"QToolButton{background: transparent; color: yellow}"
"QToolButton:hover{background: rgba(200, 200, 200, 255); color: yellow}");
floatingToolBar->setFloatable(true);
floatingToolBar->setIconSize(QSize(25,25));
......
......@@ -67,6 +67,7 @@ public:
bool getMouseButtonDown();
protected:
virtual void mouseMoveEvent(QMouseEvent *e);
virtual void mousePressEvent(QMouseEvent *e);
virtual void mouseReleaseEvent(QMouseEvent *e);
......@@ -136,6 +137,8 @@ public:
bool isTelescopeActive();
void enterEvent(QEvent * event);
void leaveEvent(QEvent * event);
int getMouseMode();
void setMouseMode(int mode);
void updateMouseCursor();
......
......@@ -1347,17 +1347,19 @@ void CCD::processBLOB(IBLOB* bp)
// If there is no FITSViewer, create it. Unless it is a dedicated Focus or Guide frame
// then no need for a FITS Viewer as they get displayed inside Ekos
if (fv.isNull() && targetChip->getCaptureMode() != FITS_GUIDE && targetChip->getCaptureMode() != FITS_FOCUS)
{
normalTabID = calibrationTabID = focusTabID = guideTabID = alignTabID = -1;
if (Options::useFITSViewerInCapture()||!targetChip->isBatchMode()){
if (fv.isNull() && targetChip->getCaptureMode() != FITS_GUIDE && targetChip->getCaptureMode() != FITS_FOCUS)
{
normalTabID = calibrationTabID = focusTabID = guideTabID = alignTabID = -1;
if (Options::singleWindowCapturedFITS())
fv = KStars::Instance()->genericFITSViewer();
else
fv = new FITSViewer(Options::independentWindowFITS() ? NULL : KStars::Instance());
if (Options::singleWindowCapturedFITS())
fv = KStars::Instance()->genericFITSViewer();
else
fv = new FITSViewer(Options::independentWindowFITS() ? NULL : KStars::Instance());
//connect(fv, SIGNAL(destroyed()), this, SLOT(FITSViewerDestroyed()));
//connect(fv, SIGNAL(destroyed()), this, SIGNAL(FITSViewerClosed()));
//connect(fv, SIGNAL(destroyed()), this, SLOT(FITSViewerDestroyed()));
//connect(fv, SIGNAL(destroyed()), this, SIGNAL(FITSViewerClosed()));
}
}
FITSScale captureFilter = targetChip->getCaptureFilter();
......@@ -1379,28 +1381,41 @@ void CCD::processBLOB(IBLOB* bp)
{
case FITS_NORMAL:
{
if (normalTabID == -1 || Options::singlePreviewFITS() == false)
tabRC = fv->addFITS(&fileURL, FITS_NORMAL, captureFilter, previewTitle);
else if (fv->updateFITS(&fileURL, normalTabID, captureFilter) == false)
//This is how to get the image to show up in the EkosManger preview FitsView.
FITSView *previewView = KStars::Instance()->ekosManager()->getPreviewView();
if (previewView)
{
fv->removeFITS(normalTabID);
tabRC = fv->addFITS(&fileURL, FITS_NORMAL, captureFilter, previewTitle);
previewView->setFilter(captureFilter);
bool imageLoad = previewView->loadFITS(filename, true);
if (imageLoad)
previewView->updateFrame();
}
else
tabRC = normalTabID;
if (Options::useFITSViewerInCapture()||!targetChip->isBatchMode()){
if (normalTabID == -1 || Options::singlePreviewFITS() == false)
tabRC = fv->addFITS(&fileURL, FITS_NORMAL, captureFilter, previewTitle);
else if (fv->updateFITS(&fileURL, normalTabID, captureFilter) == false)
{
fv->removeFITS(normalTabID);
tabRC = fv->addFITS(&fileURL, FITS_NORMAL, captureFilter, previewTitle);
}
else
tabRC = normalTabID;
if (tabRC >= 0)
{
normalTabID = tabRC;
targetChip->setImageView(fv->getView(normalTabID), FITS_NORMAL);
if (tabRC >= 0)
{