Skip to content

Commit

Permalink
Merge branch 'master' into KernelProject
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCSmith committed Apr 3, 2023
2 parents d0cea20 + c1709a0 commit 0e387d7
Show file tree
Hide file tree
Showing 12 changed files with 180 additions and 71 deletions.
2 changes: 1 addition & 1 deletion CurrentVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DeepSkyStackerVersion=5.1.2
DeepSkyStackerVersion=5.1.3
5 changes: 2 additions & 3 deletions DeepSkyStacker/DeepSkyStacker.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#include "dssbase.h"
#include "dss_settings.h"
/****************************************************************************
**
** Copyright (C) 2020, 2022 David C. Partridge
Expand Down Expand Up @@ -36,14 +34,15 @@
**
**
****************************************************************************/
#include "dssbase.h"
#include "dss_settings.h"
namespace DSS
{
class PictureList;
class StackingDlg;
}
class ExplorerBar;
class QStackedWidget;
class QStackedWidget;
class QWinHost;
class CProcessingDlg;
class CDSSSettings;
Expand Down
44 changes: 27 additions & 17 deletions DeepSkyStacker/FrameList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down Expand Up @@ -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<bool, Qt::CheckState>.
// 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 <auto Selector, bool ImmediateReturn, typename... Args>
requires (std::invocable<decltype(Selector), ListBitMap&, bool, const Args&...>)
void FrameList::checkSelective(const bool check, const Args&... args)
{
for (auto& group : imageGroups)
Expand All @@ -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<Selector, false>(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<int> 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<int>{ Qt::CheckStateRole }
);
group.setDirty();
}
}

void FrameList::checkAllDarks(bool check)
Expand Down
3 changes: 2 additions & 1 deletion DeepSkyStacker/FrameList.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ namespace DSS
void changePictureType(int nItem, PICTURETYPE PictureType);

private:
template <auto Selector, bool ImmediateReturn, typename... Args>
template <auto Selector, bool, typename... Args>
requires (std::invocable<decltype(Selector), ListBitMap&, bool, const Args&...>)
void checkSelective(const bool check, const Args&... args);
public:
void checkAbove(double threshold);
Expand Down
1 change: 1 addition & 0 deletions DeepSkyStacker/RegisterSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
8 changes: 6 additions & 2 deletions DeepSkyStacker/StackingEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -819,7 +823,7 @@ void CStackingEngine::ComputeOffsets()

const int lLast = static_cast<int>(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)
Expand Down
1 change: 1 addition & 0 deletions DeepSkyStacker/StdAfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
#include <future>
#include <inttypes.h>
#include <filesystem>
#include <tuple>
#include <boost/interprocess/sync/named_mutex.hpp>
#include <boost/interprocess/sync/scoped_lock.hpp>

Expand Down
33 changes: 33 additions & 0 deletions DeepSkyStackerLive/DeepSkyStackerLive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
78 changes: 77 additions & 1 deletion DeepSkyStackerLive/DeepSkyStackerLive.h
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion DeepSkyStackerLive/DeepSkyStackerLive.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@
<ClInclude Include="..\Tools\ListViewCtrlEx.h" />
<ClInclude Include="..\Tools\ToolTipButton.h" />
<ClInclude Include="..\Tools\WndImage.h" />
<ClInclude Include="DeepSkyStackerLive.h" />
<QtMoc Include="DeepSkyStackerLive.h" />
<ClInclude Include="DeepSkyStackerLiveDlg.h" />
<ClInclude Include="EmailSettings.h" />
<ClInclude Include="GraphView.h" />
Expand Down
9 changes: 6 additions & 3 deletions DeepSkyStackerLive/DeepSkyStackerLive.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<Filter Include="Qt\i18n">
<UniqueIdentifier>{35296fcd-9a3b-4ce5-b85c-721aa046fc66}</UniqueIdentifier>
</Filter>
<Filter Include="Qt\ui">
<UniqueIdentifier>{4abe7899-f800-4251-9c3f-1ebce915fbfb}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="DeepSkyStackerLive.cpp">
Expand Down Expand Up @@ -311,9 +314,6 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="DeepSkyStackerLive.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down Expand Up @@ -677,6 +677,9 @@
<QtMoc Include="..\DeepSkyStacker\ImageListModel.h">
<Filter>Kernel</Filter>
</QtMoc>
<QtMoc Include="DeepSkyStackerLive.h">
<Filter>Header Files</Filter>
</QtMoc>
</ItemGroup>
<ItemGroup>
<QtTranslation Include="i18n\DSSLive.ca.ts">
Expand Down
65 changes: 23 additions & 42 deletions Installers/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
===============================
Expand Down

0 comments on commit 0e387d7

Please sign in to comment.