From kde-commits Fri Sep 30 20:38:34 2016 From: Jasem Mutlaq Date: Fri, 30 Sep 2016 20:38:34 +0000 To: kde-commits Subject: [kstars/bleeding] kstars/indi: Loading guide frame in its own separate view without need for FITSVie Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=147526793401790 Git commit 68711ba2a27f5a8d5f714e691e8d9f3c2cb80396 by Jasem Mutlaq. Committed on 30/09/2016 at 20:33. Pushed by mutlaqja into branch 'bleeding'. Loading guide frame in its own separate view without need for FITSViewer wi= ndow M +32 -12 kstars/indi/indiccd.cpp M +2 -2 kstars/indi/indiccd.h http://commits.kde.org/kstars/68711ba2a27f5a8d5f714e691e8d9f3c2cb80396 diff --git a/kstars/indi/indiccd.cpp b/kstars/indi/indiccd.cpp index fb1d658..3ef8852 100644 --- a/kstars/indi/indiccd.cpp +++ b/kstars/indi/indiccd.cpp @@ -64,7 +64,7 @@ CCDChip::CCDChip(ISD::CCD *ccd, ChipType cType) normalImage =3D focusImage =3D guideImage =3D calibrationImage =3D NUL= L; } = -FITSView * CCDChip::getImage(FITSMode imageType) +FITSView * CCDChip::getImageView(FITSMode imageType) { switch (imageType) { @@ -96,7 +96,7 @@ FITSView * CCDChip::getImage(FITSMode imageType) = } = -void CCDChip::setImage(FITSView *image, FITSMode imageType) +void CCDChip::setImageView(FITSView *image, FITSMode imageType) { switch (imageType) { @@ -116,7 +116,7 @@ void CCDChip::setImage(FITSView *image, FITSMode imageT= ype) calibrationImage =3D image; break; = - case FITS_ALIGN: + case FITS_ALIGN: alignImage =3D image; if (KStars::Instance()->ekosManager()->alignModule() && KStars::In= stance()->ekosManager()->alignModule()->fov()) KStars::Instance()->ekosManager()->alignModule()->fov()->setIm= age(alignImage->getDisplayImage()->copy()); @@ -1117,7 +1117,7 @@ void CCD::processBLOB(IBLOB* bp) QTemporaryFile tmpFile(QDir::tempPath() + "/fitsXXXXXX"); = //if (currentDir.endsWith('/')) - //currentDir.truncate(currentDir.size()-1); + //currentDir.truncate(currentDir.size()-1); = if (QDir(currentDir).exists() =3D=3D false) QDir().mkpath(currentDir); @@ -1282,7 +1282,7 @@ void CCD::processBLOB(IBLOB* bp) if (tabRC >=3D 0) { normalTabID =3D tabRC; - targetChip->setImage(fv->getView(normalTabID), FITS_NORMAL= ); + targetChip->setImageView(fv->getView(normalTabID), FITS_NO= RMAL); = emit newImage(fv->getView(normalTabID)->getDisplayImage(),= targetChip); } @@ -1309,7 +1309,7 @@ void CCD::processBLOB(IBLOB* bp) if (tabRC >=3D 0) { focusTabID =3D tabRC; - targetChip->setImage(fv->getView(focusTabID), FITS_FOCUS); + targetChip->setImageView(fv->getView(focusTabID), FITS_FOC= US); = emit newImage(fv->getView(focusTabID)->getDisplayImage(), = targetChip); } @@ -1322,6 +1322,7 @@ void CCD::processBLOB(IBLOB* bp) break; = case FITS_GUIDE: + /* if (guideTabID =3D=3D -1) tabRC =3D fv->addFITS(&fileURL, FITS_GUIDE, captureFilter); else if (fv->updateFITS(&fileURL, guideTabID, captureFilter) = =3D=3D false) @@ -1335,7 +1336,7 @@ void CCD::processBLOB(IBLOB* bp) if (tabRC >=3D 0) { guideTabID =3D tabRC; - targetChip->setImage(fv->getView(guideTabID), FITS_GUIDE); + targetChip->setImageView(fv->getView(guideTabID), FITS_GUI= DE); = emit newImage(fv->getView(guideTabID)->getDisplayImage(), = targetChip); } @@ -1343,7 +1344,26 @@ void CCD::processBLOB(IBLOB* bp) { emit newExposureValue(targetChip, 0, IPS_ALERT); return; + }*/ + { + FITSView *guideView =3D targetChip->getImageView(FITS_GUIDE); + if (guideView) + { + guideView->setFilter(captureFilter); + bool imageLoad =3D guideView->loadFITS(filename, true); + if (imageLoad) + { + //guideView->rescale(ZOOM_FIT_WINDOW); + guideView->updateFrame(); + emit newImage(guideView->getDisplayImage(), targetChip= ); + } + else + { + emit newExposureValue(targetChip, 0, IPS_ALERT); + return; + } } + } break; = case FITS_CALIBRATE: @@ -1360,7 +1380,7 @@ void CCD::processBLOB(IBLOB* bp) if (tabRC >=3D 0) { calibrationTabID =3D tabRC; - targetChip->setImage(fv->getView(calibrationTabID), FITS_C= ALIBRATE); + targetChip->setImageView(fv->getView(calibrationTabID), FI= TS_CALIBRATE); } else { @@ -1369,7 +1389,7 @@ void CCD::processBLOB(IBLOB* bp) } break; = - case FITS_ALIGN: + case FITS_ALIGN: if (alignTabID =3D=3D -1) tabRC =3D fv->addFITS(&fileURL, FITS_ALIGN, captureFilter); else if (fv->updateFITS(&fileURL, alignTabID, captureFilter) = =3D=3D false) @@ -1383,7 +1403,7 @@ void CCD::processBLOB(IBLOB* bp) if (tabRC >=3D 0) { alignTabID =3D tabRC; - targetChip->setImage(fv->getView(alignTabID), FITS_ALIGN); + targetChip->setImageView(fv->getView(alignTabID), FITS_ALI= GN); } else { @@ -1398,8 +1418,8 @@ void CCD::processBLOB(IBLOB* bp) = } = - fv->show(); - + if (targetChip->getCaptureMode() !=3D FITS_GUIDE) + fv->show(); } #endif = diff --git a/kstars/indi/indiccd.h b/kstars/indi/indiccd.h index d6a76ad..f0c1923 100644 --- a/kstars/indi/indiccd.h +++ b/kstars/indi/indiccd.h @@ -48,8 +48,8 @@ public: = CCDChip(ISD::CCD *ccd, ChipType cType); = - FITSView * getImage(FITSMode imageType); - void setImage(FITSView *image, FITSMode imageType); + FITSView * getImageView(FITSMode imageType); + void setImageView(FITSView *image, FITSMode imageType); void setCaptureMode(FITSMode mode) { captureMode =3D mode; } void setCaptureFilter(FITSScale fType) { captureFilter =3D fType; } =