diff --git a/CurrentVersion.txt b/CurrentVersion.txt index a2aa9c1f9..144530e46 100644 --- a/CurrentVersion.txt +++ b/CurrentVersion.txt @@ -1 +1 @@ -DeepSkyStackerVersion=5.1.2 +DeepSkyStackerVersion=5.1.3 diff --git a/DeepSkyStacker/DeepSkyStacker.h b/DeepSkyStacker/DeepSkyStacker.h index 751668cbc..ea7fb57a7 100644 --- a/DeepSkyStacker/DeepSkyStacker.h +++ b/DeepSkyStacker/DeepSkyStacker.h @@ -1,6 +1,4 @@ #pragma once -#include "dssbase.h" -#include "dss_settings.h" /**************************************************************************** ** ** Copyright (C) 2020, 2022 David C. Partridge @@ -36,6 +34,8 @@ ** ** ****************************************************************************/ +#include "dssbase.h" +#include "dss_settings.h" namespace DSS { class PictureList; @@ -43,7 +43,6 @@ namespace DSS } class ExplorerBar; class QStackedWidget; -class QStackedWidget; class QWinHost; class CProcessingDlg; class CDSSSettings; diff --git a/DeepSkyStacker/FrameList.cpp b/DeepSkyStacker/FrameList.cpp index 7b4980806..be194f820 100644 --- a/DeepSkyStacker/FrameList.cpp +++ b/DeepSkyStacker/FrameList.cpp @@ -196,7 +196,9 @@ namespace DSS { for (auto it = group.pictures->cbegin(); it != group.pictures->cend(); ++it) { - if (it->IsLightFrame() && it->m_bChecked == Qt::Checked && it->m_bUseAsStarting) + if (it->IsLightFrame() && + it->m_bUseAsStarting + ) { return QString::fromStdU16String(it->filePath.generic_u16string()); } @@ -663,8 +665,17 @@ namespace DSS ++row; } } - + // + // The function template 'checkSelective' is used as a common function for the below checkAllDarks(), checkAllFlats(), etc. + // Selector is a non-type-template-parameter, it needs to be invocable (i.e. a lambda). + // It is called to decide, if the current file shall be checked or unchecked (i.e. file.m_bChecked set to a Qt::CheckState). + // It must return a pair. + // checkSelective() accepts a variable number of arguments, which are forwarded to the Selector. + // By that we can use Selectors with different arguments (used e.g. in checkImage() below). + // If the template parameter bool ImmediateReturn is true, the function will be escaped after the first found file. + // template + requires (std::invocable) void FrameList::checkSelective(const bool check, const Args&... args) { for (auto& group : imageGroups) @@ -687,22 +698,21 @@ namespace DSS void FrameList::checkAll(bool check) { - constexpr auto Selector = [](const auto&, const bool check) { return std::make_pair(true, check ? Qt::Checked : Qt::Unchecked); }; - checkSelective(check); - //const auto checkState = check ? Qt::Checked : Qt::Unchecked; + const auto checkState = check ? Qt::Checked : Qt::Unchecked; - //for (auto& group : imageGroups) - //{ - // for (auto& file : group.pictures->mydata) - // { - // file.m_bChecked = checkState; - // } - // QModelIndex start{ group.pictures->createIndex(0, 0) }; - // QModelIndex end{ group.pictures->createIndex(group.pictures->rowCount(), 0) }; - // const QVector role{ Qt::CheckStateRole }; - // group.pictures->dataChanged(start, end, role); - // group.setDirty(); - //} + for (auto& group : imageGroups) + { + for (auto& file : group.pictures->mydata) + { + file.m_bChecked = checkState; + } + group.pictures->dataChanged( + group.pictures->createIndex(0, 0), + group.pictures->createIndex(group.pictures->rowCount(), 0), + QList{ Qt::CheckStateRole } + ); + group.setDirty(); + } } void FrameList::checkAllDarks(bool check) diff --git a/DeepSkyStacker/FrameList.h b/DeepSkyStacker/FrameList.h index 0770972ed..37fc65291 100644 --- a/DeepSkyStacker/FrameList.h +++ b/DeepSkyStacker/FrameList.h @@ -31,7 +31,8 @@ namespace DSS void changePictureType(int nItem, PICTURETYPE PictureType); private: - template + template + requires (std::invocable) void checkSelective(const bool check, const Args&... args); public: void checkAbove(double threshold); diff --git a/DeepSkyStacker/RegisterSettings.cpp b/DeepSkyStacker/RegisterSettings.cpp index da24c9812..60ac8ccfd 100644 --- a/DeepSkyStacker/RegisterSettings.cpp +++ b/DeepSkyStacker/RegisterSettings.cpp @@ -118,6 +118,7 @@ void RegisterSettings::onInitDialog() ui->luminanceThreshold-> setSliderPosition(value); ui->luminancePercent->setText(QString("%1%").arg(value)); + detectionThreshold = value; ui->medianFilter-> setChecked(workspace->value("Register/ApplyMedianFilter", false).toBool()); diff --git a/DeepSkyStacker/StackingEngine.cpp b/DeepSkyStacker/StackingEngine.cpp index d1575efa5..2275c088e 100644 --- a/DeepSkyStacker/StackingEngine.cpp +++ b/DeepSkyStacker/StackingEngine.cpp @@ -455,7 +455,11 @@ bool CStackingEngine::AddLightFramesToList(CAllStackingTasks& tasks) lfi = bitmap; lfi.RefreshSuperPixel(); - if (!m_strReferenceFrame.CompareNoCase(lfi.filePath.c_str())) + // + // m_strReferenceFrame is a CString but contains the reference frame path + // with / separators rather than \\ + // + if (!m_strReferenceFrame.CompareNoCase(lfi.filePath.generic_wstring().c_str())) { lfi.m_bStartingFrame = true; bReferenceFrameFound = true; @@ -819,7 +823,7 @@ void CStackingEngine::ComputeOffsets() const int lLast = static_cast(m_vBitmaps.size() * m_fKeptPercentage / 100.0); if (m_pProgress) - m_pProgress->Start1(strText, lLast, false); + m_pProgress->Start1(strText, lLast, true); // The first bitmap is the best one if (m_vBitmaps.size() > 1) diff --git a/DeepSkyStacker/StdAfx.h b/DeepSkyStacker/StdAfx.h index 1f7223fe0..424b4d7e5 100644 --- a/DeepSkyStacker/StdAfx.h +++ b/DeepSkyStacker/StdAfx.h @@ -72,6 +72,7 @@ #include #include #include +#include #include #include diff --git a/DeepSkyStackerLive/DeepSkyStackerLive.cpp b/DeepSkyStackerLive/DeepSkyStackerLive.cpp index a96f5c83e..48d82f8a0 100644 --- a/DeepSkyStackerLive/DeepSkyStackerLive.cpp +++ b/DeepSkyStackerLive/DeepSkyStackerLive.cpp @@ -99,6 +99,39 @@ bool hasExpired() return bResult; }; +DeepSkyStackerLive::DeepSkyStackerLive() : + QMainWindow(), + initialised{ false }, + winHost{ nullptr }, + args{ qApp->arguments() }, + baseTitle{ QString("DeepSkyStackerLive %1").arg(VERSION_DEEPSKYSTACKER) }, + statusBarText{ new QLabel("") } + +{ +} + +DeepSkyStackerLive::~DeepSkyStackerLive() +{ +} + +void DeepSkyStackerLive::createStatusBar() +{ + statusBarText->setAlignment(Qt::AlignHCenter); + statusBar()->addWidget(statusBarText, 1); + //connect(stackingDlg, SIGNAL(statusMessage(const QString&)), this, SLOT(updateStatus(const QString&))); +} + +void DeepSkyStackerLive::updateStatus(const QString& text) +{ + statusBarText->setText(text); +} + +void DeepSkyStackerLive::displayMessage(const QString& message, QMessageBox::Icon icon) +{ + QMessageBox msgBox{ icon, "DeepSkyStacker", message, QMessageBox::Ok , this }; + msgBox.exec(); +} + /* ------------------------------------------------------------------- */ QTranslator theQtTranslator; QTranslator theAppTranslator; diff --git a/DeepSkyStackerLive/DeepSkyStackerLive.h b/DeepSkyStackerLive/DeepSkyStackerLive.h index a09b895f6..1ce0c0e1e 100644 --- a/DeepSkyStackerLive/DeepSkyStackerLive.h +++ b/DeepSkyStackerLive/DeepSkyStackerLive.h @@ -1,6 +1,82 @@ #pragma once -// DeepSkyStackerLive.h : main header file for the PROJECT_NAME application +/**************************************************************************** +** +** Copyright (C) 2020, 2022 David C. Partridge +** +** BSD License Usage +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of DeepSkyStacker nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** +****************************************************************************/ +// DeepSkyStackerLive.h : main header file for DeepSkyStackerLive // +#include "dssbase.h" + +class QWinHost; + +class DeepSkyStackerLive : + public QMainWindow, + public DSSBase +{ + typedef QMainWindow + Inherited; + + Q_OBJECT + +public: + DeepSkyStackerLive(); + ~DeepSkyStackerLive(); + + // + // Don't intend this to be copied or assigned. + // + DeepSkyStackerLive(const DeepSkyStackerLive&) = delete; + DeepSkyStackerLive& operator=(const DeepSkyStackerLive&) = delete; + DeepSkyStackerLive(DeepSkyStackerLive&& rhs) = delete; + DeepSkyStackerLive& operator=(DeepSkyStackerLive&& rhs) = delete; + + inline qreal pixelRatio() { return devicePixelRatioF(); } + +protected slots: + void updateStatus(const QString& text); + void displayMessage(const QString& message, QMessageBox::Icon icon); + +private: + bool initialised; + QWinHost* winHost; + QStringList args; + QString baseTitle; + QLabel* statusBarText; + + void createStatusBar(); +}; + class CDeepSkyStackerLiveApp : public CWinApp { public: diff --git a/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj b/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj index a149c9ec2..3e1a14e1d 100644 --- a/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj +++ b/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj @@ -369,7 +369,7 @@ - + diff --git a/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj.filters b/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj.filters index ba0d15534..f41a70e67 100644 --- a/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj.filters +++ b/DeepSkyStackerLive/DeepSkyStackerLive.vcxproj.filters @@ -31,6 +31,9 @@ {35296fcd-9a3b-4ce5-b85c-721aa046fc66} + + {4abe7899-f800-4251-9c3f-1ebce915fbfb} + @@ -311,9 +314,6 @@ - - Header Files - Header Files @@ -677,6 +677,9 @@ Kernel + + Header Files + diff --git a/Installers/README.txt b/Installers/README.txt index a46a4bd85..f17cb8224 100644 --- a/Installers/README.txt +++ b/Installers/README.txt @@ -3,70 +3,51 @@ Welcome to DeepSkyStacker 5.1.4 Only 64 bit versions of Windows 10 and later are supported in this release. -Changes since the last release: +This is a bug fix release for problems reported against 5.1.0, 5.1.1, 5.1.2 -1. Upgrade CFISTIO library to 4.2.0 - -2. Always create a tracefile in DeepSkyStacker sub-folder of the user's Documents folder. The file will be called e.g. - - DSSTrace_yyyy-mm-ddThh-hh-ssZ.log where the timestamp is GMT time. - -The trace file will be deleted on normal application exit, but an option is provided to keep the file. - -Welcome to DeepSkyStacker 5.1.3 -=============================== - -Changes since the last release: - -1. Bug fix - correct problems with drag drop of a directory. - -2. Enhancement - if Custom Rectangle mode is read from a filelist or settings file, switch to Intersection mode. - -3. Bug fix - correct handling of reference frame in filelist. +1. Possible bug fix - DeepSkyStacker terminated at startup when running on ARM version of Windows 11 in x64 emulation mode. Unable to test. -4. Bug Fix - FITS/DDP choice of Camera was not being handled correctly. +2. Bug fix - A corrupt info.txt file caused an infinite loop. -Welcome to DeepSkyStacker 5.1.2 -=============================== +3. Diagnostic added - Report processor architecture and processor type in trace file and to stderr at startup. -This is a bug fix release for problems reported against 5.1.0 and 5.1.1 +4. Bug fix - Stacked FITS images in SuperPixel mode were displayed only in the top left corner. -1. Bug fix - correct handling of file types (TIFF/FITS) in DeepSkyStackerCL for intermediate and final files +5. Bug fix - Resolve occasional odd problems when using edit stars mode. -2. Bug fix - correct handling of Stacking Mode (Standard/Mosaic/Intersection/Custom) +6. Bug fix - DeepSkyStackerCL was only displaying the help text regardless of command line input. -3. Bug fix - unable to select a custom rectangle immediately after opening image file +7. Enhancement - Reinstate Image Properties as a Qt based dialogue to allow changing e.g. exposure for multiple images at once -4. Bug fix - fileids in filelist files were being incorrectly written as ANSI not UTF8 +8. Bug fix - Fields in the image list and the group tabs were not updated when switching to another language. -5. Bug fix - the selection for a custom rectangle was not always visible +9. Bug fix - remove all "Set Black Point to Zero" recommendations from "Recommended Settings" -6. Enhancement - reduce the minium size for the image list to be two rows +10. Bug fix - Invalid input in RAW/DDP settings for scale factors caused an assertion failure -Welcome to DeepSkyStacker 5.1.1 -=============================== +11. Bug fix - correct handling of file types (TIFF/FITS) in DeepSkyStackerCL for intermediate and final files -This is a bug fix release for problems reported against 5.1.0 +12. Bug fix - correct handling of Stacking Mode (Standard/Mosaic/Intersection/Custom) -1. Possible bug fix - DeepSkyStacker terminated at startup when running on ARM version of Windows 11 in x64 emulation mode. Unable to test. +13. Bug fix - unable to select a custom rectangle immediately after opening image file -2. Bug fix - A corrupt info.txt file caused an infinite loop. +14. Bug fix - fileids in filelist files were being incorrectly written as ANSI not UTF8 -3. Diagnostic added - Report processor architecture and processor type in trace file and to stderr at startup. +15. Bug fix - the selection for a custom rectangle was not always visible -4. Bug fix - Stacked FITS images in SuperPixel mode were displayed only in the top left corner. +16. Enhancement - reduce the minimum size for the image list to be two rows -5. Bug fix - Resolve occasional odd problems when using edit stars mode. +17. Bug fix - correct problems with drag drop of a directory. -6. Bug fix - DeepSkyStackerCL was only displaying the help text regardless of command line input. +18. Enhancement - if Custom Rectangle mode is read from a filelist or settings file, switch to Intersection mode. -7. Enhancement - Reinstate Image Properties as a Qt based dialogue to allow changing e.g. exposure for multiple images at once +19. Bug fix - correct handling of reference frame in filelist. -8. Bug fix - Fields in the image list and the group tabs were not updated when switching to another language. +20. Bug Fix - FITS/DDP choice of Camera was not being handled correctly. -9. Bug fix - remove all "Set Black Point to Zero" recommendations from "Recommended Settings" +21. Bug fix - ensure that reference frame is used a) when checked, and b) when not checked -10. Bug fix - Invalid input in RAW/DDP settings for scale factors caused an assertion failure +22. Bug fix - Register settings set a value of 0 for the luminance threshold when it was initially set to 20. Welcome to DeepSkyStacker 5.1.0 ===============================