Commit 2b20c994 authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Improve summary screen

parent 72d38401
......@@ -102,9 +102,10 @@ if(INDI_FOUND)
)
set(ekos_SRCS
ekos/ekos.cpp
ekos/schedulerjob.cpp
ekos/scheduler.cpp
ekos/mosaic.cpp
ekos/mosaic.cpp
ekos/ekosmanager.cpp
ekos/capture.cpp
ekos/sequencejob.cpp
......@@ -658,7 +659,4 @@ install(TARGETS kstars ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
install(PROGRAMS org.kde.kstars.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES kstars.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
#install(FILES kstars.knsrc DESTINATION ${KDE_INSTALL_CONFDIR})
#install(FILES kstarsui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kstars)
#install(FILES fitsviewer.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kstars)
install(FILES kstars.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR})
......@@ -321,6 +321,8 @@ void Capture::start()
}
}*/
emit newStatus(Ekos::CAPTURE_PROGRESS);
prepareJob(first_job);
}
......@@ -344,7 +346,7 @@ void Capture::abort()
{
KNotification::event( QLatin1String( "CaptureFailed"), i18n("CCD capture failed with errors") );
activeJob->abort();
emit newStatus(i18n("Aborted"), getProgressPercentage());
emit newStatus(Ekos::CAPTURE_ABORTED);
}
activeJob->reset();
......@@ -365,7 +367,7 @@ void Capture::abort()
secondsLabel->clear();
//currentCCD->disconnect(this);
disconnect(currentCCD, SIGNAL(BLOBUpdated(IBLOB*)), this, SLOT(newFITS(IBLOB*)));
disconnect(currentCCD, SIGNAL(newImage(QImage*)), this, SIGNAL(newImage(QImage*)));
disconnect(currentCCD, SIGNAL(newImage(QImage*)), this, SLOT(sendNewImage(QImage*)));
disconnect(currentCCD, SIGNAL(newExposureValue(ISD::CCDChip*,double, IPState)), this, SLOT(updateCaptureProgress(ISD::CCDChip*,double,IPState)));
currentCCD->setFITSDir("");
......@@ -383,6 +385,12 @@ void Capture::abort()
}
void Capture::sendNewImage(QImage *image)
{
if (activeJob)
emit newImage(image, activeJob);
}
bool Capture::setCCD(QString device)
{
for (int i=0; i < CCDCaptureCombo->count(); i++)
......@@ -743,7 +751,7 @@ void Capture::startNextExposure()
if (seqDelay > 0)
{
secondsLabel->setText(i18n("Waiting..."));
emit newStatus(i18n("Waiting..."), getProgressPercentage());
emit newStatus(Ekos::CAPTURE_WAITING);
}
seqTimer->start(seqDelay);
......@@ -786,7 +794,7 @@ void Capture::newFITS(IBLOB *bp)
return;
disconnect(currentCCD, SIGNAL(BLOBUpdated(IBLOB*)), this, SLOT(newFITS(IBLOB*)));
disconnect(currentCCD, SIGNAL(newImage(QImage*)), this, SIGNAL(newImage(QImage*)));
disconnect(currentCCD, SIGNAL(newImage(QImage*)), this, SLOT(sendNewImage(QImage*)));
if (calibrationState == CALIBRATE_START)
{
......@@ -842,7 +850,7 @@ void Capture::newFITS(IBLOB *bp)
appendLogText(i18n("Received image %1 out of %2.", seqCurrentCount, seqTotalCount));
emit newStatus(i18n("Image received..."), getProgressPercentage());
emit newStatus(Ekos::CAPTURE_IMAGE_RECEIVED);
currentImgCountOUT->setText( QString::number(seqCurrentCount));
......@@ -878,7 +886,7 @@ void Capture::processJobCompletion()
{
KNotification::event( QLatin1String( "CaptureSuccessful"), i18n("CCD capture sequence completed"));
emit newStatus(i18n("Complete"), getProgressPercentage());
emit newStatus(Ekos::CAPTURE_COMPLETE);
if (parkCheck->isChecked() && currentTelescope && currentTelescope->canPark())
{
......@@ -946,14 +954,14 @@ bool Capture::resumeSequence()
secondsLabel->setText(i18n("Dithering..."));
emit exposureComplete();
emit newStatus(i18n("Dithering..."), getProgressPercentage());
emit newStatus(Ekos::CAPTURE_DITHERING);
}
else if (isAutoFocus && activeJob->getFrameType() == FRAME_LIGHT)
{
secondsLabel->setText(i18n("Focusing..."));
emit checkFocus(HFRPixels->value());
emit newStatus(i18n("Focusing..."), getProgressPercentage());
emit newStatus(Ekos::CAPTURE_FOCUSING);
}
else
startNextExposure();
......@@ -1006,7 +1014,7 @@ void Capture::captureImage()
}
connect(currentCCD, SIGNAL(BLOBUpdated(IBLOB*)), this, SLOT(newFITS(IBLOB*)), Qt::UniqueConnection);
connect(currentCCD, SIGNAL(newImage(QImage*)), this, SIGNAL(newImage(QImage*)), Qt::UniqueConnection);
connect(currentCCD, SIGNAL(newImage(QImage*)), this, SLOT(sendNewImage(QImage*)), Qt::UniqueConnection);
if (activeJob->getFrameType() == FRAME_FLAT)
{
......@@ -1021,7 +1029,8 @@ void Capture::captureImage()
if (currentCCD->getUploadMode() != ISD::CCD::UPLOAD_LOCAL)
checkSeqBoundary(activeJob->getFITSDir());
emit newStatus(i18n("Capturing..."), getProgressPercentage());
if (activeJob->isPreview() == false)
emit newStatus(Ekos::CAPTURE_CAPTURING);
rc = activeJob->capture(isDark);
......@@ -1069,7 +1078,7 @@ void Capture::resumeCapture()
{
secondsLabel->setText(i18n("Focusing..."));
emit checkFocus(HFRPixels->value());
emit newStatus(i18n("Focusing..."), getProgressPercentage());
emit newStatus(Ekos::CAPTURE_FOCUSING);
return;
}
......@@ -1579,7 +1588,7 @@ void Capture::prepareJob(SequenceJob *job)
appendLogText(i18n("Changing filter to %1...", FilterPosCombo->itemText(activeJob->getTargetFilter()-1)));
secondsLabel->setText(i18n("Set filter..."));
emit newStatus(i18n("Changing filter..."), getProgressPercentage());
emit newStatus(Ekos::CAPTURE_CHANGING_FILTER);
setBusy(true);
......@@ -1594,7 +1603,7 @@ void Capture::prepareJob(SequenceJob *job)
appendLogText(i18n("Setting temperature to %1 C...", activeJob->getTargetTemperature()));
secondsLabel->setText(i18n("Set %1 C...", activeJob->getTargetTemperature()));
emit newStatus(i18n("Setting temperature..."), getProgressPercentage());
emit newStatus(Ekos::CAPTURE_SETTING_TEMPERATURE);
setBusy(true);
}
......@@ -2457,6 +2466,20 @@ double Capture::getProgressPercentage()
return -1;
}
int Capture::getActiveJobID()
{
if (activeJob == NULL)
return -1;
for (int i=0; i < jobs.count(); i++)
{
if (activeJob == jobs[i])
return i;
}
return -1;
}
QString Capture::getJobState(int id)
{
if (id < jobs.count())
......@@ -2512,6 +2535,36 @@ double Capture::getJobExposureDuration(int id)
return -1;
}
int Capture::getJobRemainingTime(SequenceJob *job)
{
int remaining=0;
if (job->getStatus() == SequenceJob::JOB_BUSY)
remaining += (job->getExposure() + job->getDelay()) * (job->getCount() - job->getCompleted()) + job->getExposeLeft();
else
remaining += (job->getExposure() + job->getDelay()) * (job->getCount() - job->getCompleted());
return remaining;
}
int Capture::getOverallRemainingTime()
{
double remaining=0;
foreach(SequenceJob *job, jobs)
remaining += getJobRemainingTime(job);
return remaining;
}
int Capture::getActiveJobRemainingTime()
{
if (activeJob == NULL)
return -1;
return getJobRemainingTime(activeJob);
}
void Capture::setMaximumGuidingDeviaiton(bool enable, double value)
{
if (guideDeviationCheck->isEnabled())
......@@ -2548,7 +2601,7 @@ void Capture::setTemperature()
void Capture::clearSequenceQueue()
{
activeJob=NULL;
abort();
abort();
while (queueTable->rowCount() > 0)
queueTable->removeRow(0);
jobs.clear();
......@@ -2595,7 +2648,7 @@ QString Capture::getSequenceQueueStatus()
if (aborted > 0)
{
if (isAutoGuiding && deviationDetected)
return "Suspended";
return "Suspended";
else
return "Aborted";
}
......@@ -2658,7 +2711,7 @@ void Capture::processTelescopeNumber(INumberVectorProperty *nvp)
appendLogText(i18n("Performing post flip re-alignment..."));
secondsLabel->setText(i18n("Aligning..."));
emit newStatus(i18n("Aligning..."), getProgressPercentage());
emit newStatus(Ekos::CAPTURE_ALIGNING);
meridianFlipStage = MF_ALIGNING;
emit meridialFlipTracked();
......@@ -2688,7 +2741,7 @@ void Capture::checkGuidingAfterFlip()
appendLogText(i18n("Performing post flip re-calibration and guiding..."));
secondsLabel->setText(i18n("Calibrating..."));
emit newStatus(i18n("Calibrating..."), getProgressPercentage());
emit newStatus(Ekos::CAPTURE_CALIBRATING);
meridianFlipStage = MF_GUIDING;
emit meridianFlipCompleted();
......@@ -2755,7 +2808,7 @@ bool Capture::checkMeridianFlip()
currentTelescope->Slew(initialRA,dec);
secondsLabel->setText(i18n("Meridian Flip..."));
emit newStatus(i18n("Meridian Flip..."), getProgressPercentage());
emit newStatus(Ekos::CAPTURE_MERIDIAN_FLIP);
QTimer::singleShot(MF_TIMER_TIMEOUT, this, SLOT(checkMeridianFlipTimeout()));
return true;
......@@ -3405,7 +3458,7 @@ void Capture::startPostFilterAutoFocus()
secondsLabel->setText(i18n("Focusing..."));
emit newStatus(i18n("Focusing..."), getProgressPercentage());
emit newStatus(Ekos::CAPTURE_FOCUSING);
appendLogText(i18n("Post filter change Autofocus..."));
......@@ -3413,4 +3466,5 @@ void Capture::startPostFilterAutoFocus()
emit checkFocus(0.1);
}
}
......@@ -16,6 +16,7 @@
#include "ui_capture.h"
#include "ekos.h"
#include "fitsviewer/fitscommon.h"
#include "indi/indistd.h"
#include "indi/indiccd.h"
......@@ -181,6 +182,21 @@ public:
*/
Q_SCRIPTABLE int getJobCount() { return jobs.count(); }
/** DBUS interface function.
* @return Returns ID of current active job if any, or -1 if there are no active jobs.
*/
Q_SCRIPTABLE int getActiveJobID();
/** DBUS interface function.
* @return Returns time left in seconds until active job is estimated to be complete.
*/
int getActiveJobRemainingTime();
/** DBUS interface function.
* @return Returns overall time left in seconds until all jobs are estimated to be complete
*/
int getOverallRemainingTime();
/** DBUS interface function.
* @param id job number. Job IDs start from 0 to N-1.
* @return Returns the job state (Idle, In Progress, Error, Aborted, Complete)
......@@ -367,7 +383,6 @@ private slots:
void resetFrame();
void updateCaptureProgress(ISD::CCDChip *tChip, double value, IPState state);
void checkSeqBoundary(const QString &path);
//void checkSeqFile(const QString &path);
void saveFITSDirectory();
void setDefaultCCD(QString ccd);
void setNewRemoteFile(QString file);
......@@ -400,6 +415,9 @@ private slots:
IPState processPreCaptureCalibrationStage();
bool processPostCaptureCalibrationStage();
// Send image info
void sendNewImage(QImage *image);
signals:
void newLog();
void exposureComplete();
......@@ -409,8 +427,8 @@ signals:
void meridianFlipStarted();
void meridialFlipTracked();
void meridianFlipCompleted();
void newStatus(const QString status, double progress);
void newImage(QImage *image);
void newStatus(Ekos::CaptureState status);
void newImage(QImage *image, Ekos::SequenceJob *job);
private:
......@@ -432,6 +450,9 @@ private:
void checkGuidingAfterFlip();
double getCurrentHA();
// Remaining Time in seconds
int getJobRemainingTime(SequenceJob *job);
/* Capture */
double seqExpose;
int seqTotalCount;
......
#include "ekos.h"
namespace Ekos
{
const QString & getGuideStatusString(GuideState state) { return guideStates[state]; }
const QString & getCaptureStatusString(CaptureState state) { return captureStates[state]; }
}
#ifndef EKOS_H
#define EKOS_H
#include <KLocalizedString>
namespace Ekos
{
static const QStringList guideStates = { I18N_NOOP("Idle"), I18N_NOOP("Calibrating"), I18N_NOOP("Calibration successful"), I18N_NOOP("Calibration error"), I18N_NOOP("Guiding"),
I18N_NOOP("Aborted"), I18N_NOOP("Suspended"), I18N_NOOP("Dithering"), I18N_NOOP("Dithering Successful"), I18N_NOOP("Dithering error")};
typedef enum { GUIDE_IDLE, GUIDE_CALIBRATING, GUIDE_CALIBRATION_SUCESS, GUIDE_CALIBRATION_ERROR, GUIDE_GUIDING,
GUIDE_ABORTED, GUIDE_SUSPENDED, GUIDE_DITHERING, GUIDE_DITHERING_SUCCESS, GUIDE_DITHERING_ERROR } GuideState;
const QString & getGuideStatusString(GuideState state);
static const QStringList captureStates = { I18N_NOOP("Idle"), I18N_NOOP("In Progress"), I18N_NOOP("Capturing"), I18N_NOOP("Aborted"), I18N_NOOP("Waiting"), I18N_NOOP("Image Received"),
I18N_NOOP("Dithering"), I18N_NOOP("Focusing"), I18N_NOOP("Changing Filter"), I18N_NOOP("Setting Temperature"), I18N_NOOP("Aligning"),
I18N_NOOP("Calibrating"), I18N_NOOP("Meridian Flip"), I18N_NOOP("Complete") };
typedef enum { CAPTURE_IDLE, CAPTURE_PROGRESS, CAPTURE_CAPTURING, CAPTURE_ABORTED, CAPTURE_WAITING, CAPTURE_IMAGE_RECEIVED, CAPTURE_DITHERING, CAPTURE_FOCUSING,
CAPTURE_CHANGING_FILTER, CAPTURE_SETTING_TEMPERATURE, CAPTURE_ALIGNING, CAPTURE_CALIBRATING, CAPTURE_MERIDIAN_FLIP, CAPTURE_COMPLETE } CaptureState;
const QString &getCaptureStatusString(CaptureState state);
}
#endif // EKOS_H
This diff is collapsed.
......@@ -18,6 +18,8 @@
#endif
#include "ui_ekosmanager.h"
#include "ekos.h"
#include "indi/indistd.h"
#include "capture.h"
#include "focus.h"
......@@ -39,7 +41,7 @@ class KPageWidgetItem;
class QProgressIndicator;
/**
*@class EkosManager
*@class Manager
*@short Primary class to handle all Ekos modules.
* The Ekos Manager class manages startup and shutdown of INDI devices and registeration of devices within Ekos Modules. Ekos module consist of \ref Ekos::Mount, \ref Ekos::Capture, \ref Ekos::Focus, \ref Ekos::Guide, and \ref Ekos::Align modules.
* \ref EkosDBusInterface "Ekos DBus Interface" provides high level functions to control devices and Ekos modules for a total robotic operation:
......@@ -123,7 +125,8 @@ public:
protected:
void closeEvent(QCloseEvent *);
void hideEvent(QHideEvent *);
void showEvent(QShowEvent *);
void showEvent(QShowEvent *);
void resizeEvent(QResizeEvent *);
public slots:
......@@ -185,8 +188,19 @@ private slots:
void updateMountStatus(ISD::Telescope::TelescopeStatus status);
// Capture Summary
void updateCaptureStatus(const QString &status, double percentage);
void updateCaptureImage(QImage *image);
void updateCaptureStatus(Ekos::CaptureState status);
void updateCaptureImage(QImage *image, Ekos::SequenceJob *job);
void updateCaptureCountDown();
// Focus summary
void updateFocusStatus(bool status);
void updateFocusStarPixmap(QPixmap &starPixmap);
void updateFocusProfilePixmap(QPixmap &profilePixmap);
// Guide Summary
void updateGuideStatus(Ekos::GuideState status);
void updateGuideStarPixmap(QPixmap &starPix);
void updateGuideProfilePixmap(QPixmap &profilePix);
private:
......@@ -253,10 +267,28 @@ private slots:
// Mount Summary
QProgressIndicator *mountPI;
// Capture Summary
QTime overallCountDown;
QTime sequenceCountDown;
QTimer countdownTimer;
QPixmap *previewPixmap;
QProgressIndicator *capturePI;
// Focus Summary
QProgressIndicator *focusPI;
QPixmap *focusStarPixmap;
QPixmap *focusProfilePixmap;
QTemporaryFile focusStarFile;
QTemporaryFile focusProfileFile;
};
// Guide Summary
QProgressIndicator *guidePI;
QPixmap *guideStarPixmap;
QPixmap *guideProfilePixmap;
QTemporaryFile guideStarFile;
QTemporaryFile guideProfileFile;
};
#endif // EKOS_H
This diff is collapsed.
......@@ -23,6 +23,8 @@
#include "indi/clientmanager.h"
#include "indi/indifilter.h"
#include "auxiliary/kspaths.h"
#include "fitsviewer/fitsviewer.h"
#include "fitsviewer/fitstab.h"
#include "fitsviewer/fitsview.h"
......@@ -146,13 +148,18 @@ Focus::Focus()
profilePlot->xAxis->setLabelColor(Qt::white);
profilePlot->yAxis->setLabelColor(Qt::white);
profilePlot->addGraph();
profilePlot->graph(0)->setLineStyle(QCPGraph::lsLine);
profilePlot->graph(0)->setPen(QPen(Qt::red, 2));
firstGaus = NULL;
currentGaus = profilePlot->addGraph();
currentGaus->setLineStyle(QCPGraph::lsLine);
currentGaus->setPen(QPen(Qt::red, 2));
profilePlot->addGraph();
profilePlot->graph(1)->setLineStyle(QCPGraph::lsLine);
profilePlot->graph(1)->setPen(QPen(Qt::darkGreen, 1));
lastGaus = profilePlot->addGraph();
lastGaus->setLineStyle(QCPGraph::lsLine);
QPen pen(Qt::darkGreen);
pen.setStyle(Qt::DashLine);
pen.setWidth(2);
lastGaus->setPen(pen);
HFRPlot->setBackground(QBrush(Qt::black));
......@@ -631,6 +638,12 @@ void Focus::start()
clearDataPoints();
if (firstGaus)
{
profilePlot->removeGraph(firstGaus);
firstGaus = NULL;
}
Options::setFocusTicks(stepIN->value());
Options::setFocusTolerance(toleranceIN->value());
Options::setFocusExposure(exposureIN->value());
......@@ -695,7 +708,7 @@ void Focus::abort()
noStarCount = 0;
//maxHFR=1;
disconnect(currentCCD, SIGNAL(BLOBUpdated(IBLOB*)), this, SLOT(newFITS(IBLOB*)));
disconnect(currentCCD, SIGNAL(BLOBUpdated(IBLOB*)), this, SLOT(newFITS(IBLOB*)));
if (rememberUploadMode != currentCCD->getUploadMode())
currentCCD->setUploadMode(rememberUploadMode);
......@@ -779,7 +792,7 @@ void Focus::capture()
if (ISOCombo->isEnabled() && ISOCombo->currentIndex() != -1 && targetChip->getISOIndex() != ISOCombo->currentIndex())
targetChip->setISOIndex(ISOCombo->currentIndex());
connect(currentCCD, SIGNAL(BLOBUpdated(IBLOB*)), this, SLOT(newFITS(IBLOB*)));
connect(currentCCD, SIGNAL(BLOBUpdated(IBLOB*)), this, SLOT(newFITS(IBLOB*)));
targetChip->setFrameType(ccdFrame);
......@@ -962,6 +975,9 @@ void Focus::newFITS(IBLOB *bp)
disconnect(currentCCD, SIGNAL(BLOBUpdated(IBLOB*)), this, SLOT(newFITS(IBLOB*)));
starPixmap = targetImage->getTrackingBoxPixmap();
emit newStarPixmap(starPixmap);
// If we're not framing, let's try to detect stars
if (inFocusLoop == false)
{
......@@ -1002,7 +1018,6 @@ void Focus::newFITS(IBLOB *bp)
// If just framing, let's capture again
else
{
drawProfilePlot();
capture();
return;
......@@ -1019,12 +1034,13 @@ void Focus::newFITS(IBLOB *bp)
if (maxStar == NULL)
{
appendLogText(i18n("Failed to automatically select a star. Please select a star manually."));
targetImage->updateMode(FITS_GUIDE);
targetImage->setGuideBoxSize(kcfg_focusBoxSize->value());
//targetImage->updateMode(FITS_GUIDE);
targetImage->setTrackingBoxSize(QSize(kcfg_focusBoxSize->value(), kcfg_focusBoxSize->value()));
if (fw == 0 || fh == 0)
targetChip->getFrame(&fx, &fy, &fw, &fh);
targetImage->setGuideSquare(fw/2, fh/2);
connect(targetImage, SIGNAL(guideStarSelected(int,int)), this, SLOT(focusStarSelected(int, int)), Qt::UniqueConnection);
targetImage->setTrackingBoxCenter(QPointF(fw/2, fh/2));
targetImage->setTrackingBoxEnabled(true);
connect(targetImage, SIGNAL(trackingStarSelected(int,int)), this, SLOT(focusStarSelected(int, int)), Qt::UniqueConnection);
QTimer::singleShot(AUTO_STAR_TIMEOUT, this, SLOT(checkAutoStarTimeout()));
......@@ -1066,6 +1082,9 @@ void Focus::newFITS(IBLOB *bp)
frameModified = true;
haveDarkFrame=false;
calibrationState = CALIBRATE_NONE;
targetImage->setTrackingBoxCenter(QPointF(fw/2.0,fh/2.0));
targetImage->setTrackingBoxSize(QSize(subW/5.0, subH/5.0));
}
else
targetChip->getFrame(&fx, &fy, &fw, &fh);
......@@ -1081,10 +1100,11 @@ void Focus::newFITS(IBLOB *bp)
else if (kcfg_subFrame->isEnabled() && kcfg_subFrame->isChecked())
{
appendLogText(i18n("Capture complete. Select a star to focus."));
targetImage->updateMode(FITS_GUIDE);
targetImage->setGuideBoxSize(kcfg_focusBoxSize->value());
targetImage->setGuideSquare(fw/2, fh/2);
connect(targetImage, SIGNAL(guideStarSelected(int,int)), this, SLOT(focusStarSelected(int, int)), Qt::UniqueConnection);
//targetImage->updateMode(FITS_GUIDE);
targetImage->setTrackingBoxSize(QSize(kcfg_focusBoxSize->value(),kcfg_focusBoxSize->value()));
targetImage->setTrackingBoxCenter(QPointF(fw/2, fh/2));
targetImage->setTrackingBoxEnabled(true);
connect(targetImage, SIGNAL(trackingStarSelected(int,int)), this, SLOT(focusStarSelected(int, int)), Qt::UniqueConnection);
return;
}
}
......@@ -1129,6 +1149,16 @@ void Focus::newFITS(IBLOB *bp)
if (focusType == FOCUS_MANUAL || inAutoFocus==false)
return;
if (Options::focusLogging())
{
QDir dir;
QString path = KSPaths::writableLocation(QStandardPaths::GenericDataLocation) + "autofocus/" + QDateTime::currentDateTime().toString("yyyy-MM-dd");
dir.mkpath(path);
QString name = "autofocus_frame_" + QDateTime::currentDateTime().toString("HH:mm:ss") + ".fits";
QString filename = path + QStringLiteral("/") + name;
targetImage->getImageData()->saveFITS(filename);
}
if (canAbsMove || canRelMove)
autoFocusAbs();
else
......@@ -1146,7 +1176,7 @@ void Focus::clearDataPoints()
}
void Focus::drawHFRPlot()
{
{
v_graph->setData(hfr_position, hfr_value);
if (focusType == FOCUS_AUTO && (canAbsMove || canRelMove) )
......@@ -1168,8 +1198,8 @@ void Focus::drawHFRPlot()
void Focus::drawProfilePlot()
{
QVector<double> key;
QVector<double> currentGaus;
QVector<double> currentIndexes;
QVector<double> currentFrequencies;
// HFR = 50% * 1.36 = 68% aka one standard deviation
double stdDev = currentHFR * 1.36;
......@@ -1178,20 +1208,40 @@ void Focus::drawProfilePlot()
float step = stdDev*4 / 20.0;
for (float x=start; x < end; x+= step)
{
key.append(x);
currentGaus.append((1/(stdDev*sqrt(2*M_PI))) * exp(-1 * ( x*x ) / (2 * (stdDev * stdDev))));