Skip to content

Commit f7d054a

Browse files
committed
Merge branch 'master' into release
2 parents 55a0797 + 2c1b784 commit f7d054a

24 files changed

+212
-157
lines changed

.github/ISSUE_TEMPLATE/⚠️-please-raise-any-issues--bugs-or-enhancement-requests-on-the-deepskystacker-mailing-list-at-groups-io---please-supply-the-information-listed-below-in-your-email-⚠️.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ assignees: ''
1111
**Check the Wiki**
1212
Before you report any issues it is worth checking the DeepSkyStacker Wiki: <https://groups.io/g/DeepSkyStacker/wiki>
1313

14+
If you aren't a member the DeepSkyStacker mailing list, please join by sending an email to:
15+
16+
17+
18+
Once you have successfully joined the mailing list please report the problem on the mailing list by sending an email to:
19+
20+
21+
22+
Your email should contain the following information:
23+
1424
**Describe the bug**
1525
A clear and concise description of what the bug is. Please specify the version of DeepSkyStacker and if relevant whether the problem is with DeepSkyStacker Live or DeepSkyStacker Command Line
1626

DeepSkyStacker/DeepSkyStacker.cpp

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737
//
3838
#include <stdafx.h>
3939
#include <htmlhelp.h>
40-
#include <boost/interprocess/sync/named_mutex.hpp>
40+
#include <boost/interprocess/sync/file_lock.hpp>
41+
#include <boost/interprocess/sync/scoped_lock.hpp>
42+
#include <boost/interprocess/exceptions.hpp>
43+
44+
#include <fstream>
4145

4246
namespace bip = boost::interprocess;
4347

@@ -1108,23 +1112,12 @@ int main(int argc, char* argv[])
11081112

11091113
reportCpuType();
11101114

1111-
ZTRACE_RUNTIME("Creating Main Window");
1112-
DeepSkyStacker mainWindow;
1113-
1114-
ZTRACE_RUNTIME("Checking Mutex");
1115-
bip::named_mutex dssMutex{ bip::open_or_create, "DeepSkyStacker.Mutex.UniqueID.12354687" };
1116-
bip::scoped_lock<bip::named_mutex> lk(dssMutex, bip::defer_lock);
1117-
const bool firstInstance{ lk.try_lock() };
1118-
ZTRACE_RUNTIME(" firstInstance: %s", firstInstance ? "true" : "false");
1119-
11201115
//
11211116
// Set things up to capture terminal errors
11221117
//
11231118
setDssExceptionHandling();
11241119

11251120
askIfVersionCheckWanted();
1126-
if (firstInstance)
1127-
deleteRemainingTempFiles();
11281121

11291122
//
11301123
// Register PICTURETYPE and QMessageBox::Icon enums as meta types
@@ -1141,13 +1134,58 @@ int main(int argc, char* argv[])
11411134
ZTRACE_RUNTIME("Invoking QApplication::exec()");
11421135
try
11431136
{
1137+
ZTRACE_RUNTIME("Creating Main Window");
1138+
DeepSkyStacker mainWindow;
1139+
1140+
ZTRACE_RUNTIME("Checking Mutex");
1141+
//
1142+
// Get the name of the writable local application data directory
1143+
// and create the directories if necessary
1144+
//
1145+
QString mutexFileName{ QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) };
1146+
fs::path file{ mutexFileName.toStdU16String() };
1147+
create_directories(file);
1148+
1149+
//
1150+
// Append the file name to the directory name
1151+
//
1152+
mutexFileName += "/DeepSkyStacker.Interprocess.Mutex";
1153+
1154+
//
1155+
// Create the file if it doesn't exist. It is intentionally never deleted.
1156+
//
1157+
auto newFile = std::ofstream(mutexFileName.toUtf8().constData());
1158+
1159+
//
1160+
// Use a boost::interprocess::file_lock as unlike a named_mutex, the OS removes the lock in the case of abnormal termination
1161+
//
1162+
bip::file_lock dssMutex{ mutexFileName.toUtf8().constData() };
1163+
bip::scoped_lock<bip::file_lock> lock(dssMutex, bip::try_to_lock);
1164+
const bool firstInstance{ lock.owns() };
1165+
ZTRACE_RUNTIME(" firstInstance: %s", firstInstance ? "true" : "false");
1166+
1167+
if (firstInstance)
1168+
deleteRemainingTempFiles();
1169+
11441170
Exiv2::XmpParser::initialize();
11451171
::atexit(Exiv2::XmpParser::terminate);
11461172

11471173
mainWindow.show();
11481174
//result = app.run(&theApp);
11491175
result = app.exec();
11501176
}
1177+
catch (bip::interprocess_exception& e)
1178+
{
1179+
ZTRACE_RUNTIME("boost::interprocess_exception caught: %s", e.what());
1180+
traceControl.setDeleteOnExit(false);
1181+
QString errorMessage(e.what());
1182+
#if defined(_CONSOLE)
1183+
std::cerr << errorMessage.toUtf8().constData();
1184+
#else
1185+
QMessageBox::critical(nullptr, "DeepSkyStacker", errorMessage);
1186+
#endif
1187+
1188+
}
11511189
catch (std::exception& e)
11521190
{
11531191
ZTRACE_RUNTIME("std::exception caught: %s", e.what());

DeepSkyStacker/ExplorerBar.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ void ExplorerBar::onLoadSettings()
357357
create_directories(fileName); // In case they don't exist
358358

359359
fileName /= "DSSLive.settings"; // Append the filename with a path separator
360-
ZTRACE_RUNTIME("Loading DSSLive settings from: %s", fileName.generic_string().c_str());
360+
ZTRACE_RUNTIME("Loading DSSLive settings from: %s", fileName.generic_u8string().c_str());
361361
workspace.ReadFromFile(fileName);
362362
workspace.saveSettings();
363363
}
@@ -416,7 +416,7 @@ void ExplorerBar::onSaveSettings()
416416
create_directories(fileName); // In case they don't exist
417417

418418
fileName /= "DSSLive.settings"; // Append the filename with a path separator
419-
ZTRACE_RUNTIME("Saving DSSLive settings to: %s", fileName.generic_string().c_str());
419+
ZTRACE_RUNTIME("Saving DSSLive settings to: %s", fileName.generic_u8string().c_str());
420420
workspace.SaveToFile(fileName);
421421
}
422422
else if (a == saveAnother)
@@ -575,7 +575,7 @@ void ExplorerBar::LoadSettingFile()
575575
fs::path fileName(files.at(0).toStdU16String()); // as UTF-16
576576
if (status(fileName).type() == fs::file_type::regular)
577577
{
578-
ZTRACE_RUNTIME("Loading settings file: %s", fileName.generic_string().c_str());
578+
ZTRACE_RUNTIME("Loading settings file: %s", fileName.generic_u8string().c_str());
579579
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
580580

581581
workspace.ReadFromFile(fileName);
@@ -619,7 +619,7 @@ void ExplorerBar::SaveSettingFile()
619619
if (!file.isEmpty())
620620
{
621621
fs::path fileName(file.toStdU16String()); // as UTF-16
622-
ZTRACE_RUNTIME("Saving settings file: %s", fileName.generic_string().c_str());
622+
ZTRACE_RUNTIME("Saving settings file: %s", fileName.generic_u8string().c_str());
623623
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
624624

625625
workspace.SaveToFile(fileName);

DeepSkyStacker/RawDDPSettings.cpp

Lines changed: 28 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -384,13 +384,25 @@ void RawDDPSettings::onInitDialog()
384384
string = workspace->value("RawDDP/Interpolation", "Bilinear").toString();
385385

386386
if (isRawBayer)
387+
{
387388
ui->rawBayer->setChecked(true);
389+
ui->rawBayer_2->setChecked(true);
390+
}
388391
else if (isSuperPixels)
392+
{
389393
ui->superPixels->setChecked(true);
394+
ui->superPixels_2->setChecked(true);
395+
}
390396
else if (string == "Bilinear")
397+
{
391398
ui->bilinear->setChecked(true);
399+
ui->bilinear_2->setChecked(true);
400+
}
392401
else if (string == "AHD")
402+
{
393403
ui->AHD->setChecked(true);
404+
ui->AHD_2->setChecked(true);
405+
}
394406

395407
//
396408
// Now populate the FITS Files tab controls
@@ -406,17 +418,6 @@ void RawDDPSettings::onInitDialog()
406418
value = workspace->value("FitsDDP/BlueScale", "1.0").toDouble();
407419
ui->blueScale_2->setText(QString("%L1").arg(value, 0, 'f', 4));
408420

409-
string = workspace->value("FitsDDP/Interpolation", "Bilinear").toString();
410-
411-
if (string == "Bilinear")
412-
ui->bilinear_2->setChecked(true);
413-
else if (string == "RawBayer")
414-
ui->rawBayer_2->setChecked(true);
415-
else if (string == "AHD")
416-
ui->AHD_2->setChecked(true);
417-
else
418-
ui->superPixels_2->setChecked(true);
419-
420421
fillDSLRList(vector_DSLRs);
421422

422423
for (std::vector<CDSLR>::size_type i = 0; i < vector_DSLRs.size(); i++)
@@ -628,25 +629,29 @@ void RawDDPSettings::on_cameraWB_stateChanged()
628629

629630
void RawDDPSettings::on_bilinear_clicked()
630631
{
632+
ui->bilinear_2->setChecked(true);
631633
workspace->setValue("RawDDP/Interpolation", "Bilinear");
632634
workspace->setValue("RawDDP/RawBayer", false);
633635
workspace->setValue("RawDDP/SuperPixels", false);
634636
}
635637

636638
void RawDDPSettings::on_AHD_clicked()
637639
{
640+
ui->AHD_2->setChecked(true);
638641
workspace->setValue("RawDDP/Interpolation", "AHD");
639642
workspace->setValue("RawDDP/RawBayer", false);
640643
workspace->setValue("RawDDP/SuperPixels", false);
641644
}
642645
void RawDDPSettings::on_rawBayer_clicked()
643646
{
647+
ui->rawBayer_2->setChecked(true);
644648
workspace->setValue("RawDDP/Interpolation", "");
645649
workspace->setValue("RawDDP/RawBayer", true);
646650
workspace->setValue("RawDDP/SuperPixels", false);
647651
}
648652
void RawDDPSettings::on_superPixels_clicked()
649653
{
654+
ui->superPixels_2->setChecked(true);
650655
workspace->setValue("RawDDP/Interpolation", "");
651656
workspace->setValue("RawDDP/RawBayer", false);
652657
workspace->setValue("RawDDP/SuperPixels", true);
@@ -723,50 +728,28 @@ void RawDDPSettings::blueScale_2_editingFinished()
723728
}
724729
}
725730

726-
/**********************************************************************************/
727-
/* ***** NOTE WELL ***** */
728-
/* */
729-
/* The following four slots that process the Bayer Matrix Transformation Radio */
730-
/* Buttons of the FITS Files tab all set the value of "RawDDP/SuperPixels" in the */
731-
/* workspace (which is what the original pre-Qt code did). */
732-
/* */
733-
/* AS FAR AS I CAN DETERMINE THIS IS NOT A BUG */
734-
/* */
735-
/**********************************************************************************/
736-
void RawDDPSettings::on_bilinear_2_toggled(bool checked)
731+
void RawDDPSettings::on_bilinear_2_clicked()
737732
{
738-
if (checked)
739-
{
740-
workspace->setValue("FitsDDP/Interpolation", "Bilinear");
741-
workspace->setValue("RawDDP/SuperPixels", false);
742-
}
733+
ui->bilinear->setChecked(true);
734+
on_bilinear_clicked();
743735
}
744736

745-
void RawDDPSettings::on_AHD_2_toggled(bool checked)
737+
void RawDDPSettings::on_AHD_2_clicked()
746738
{
747-
if (checked)
748-
{
749-
workspace->setValue("FitsDDP/Interpolation", "AHD");
750-
workspace->setValue("RawDDP/SuperPixels", false);
751-
}
739+
ui->AHD->setChecked(true);
740+
on_AHD_clicked();
752741
}
753742

754-
void RawDDPSettings::on_rawBayer_2_toggled(bool checked)
743+
void RawDDPSettings::on_rawBayer_2_clicked()
755744
{
756-
if (checked)
757-
{
758-
workspace->setValue("FitsDDP/Interpolation", "RawBayer");
759-
workspace->setValue("RawDDP/SuperPixels", false);
760-
}
745+
ui->rawBayer->setChecked(true);
746+
on_rawBayer_clicked();
761747
}
762748

763-
void RawDDPSettings::on_superPixels_2_toggled(bool checked)
749+
void RawDDPSettings::on_superPixels_2_clicked()
764750
{
765-
if (checked)
766-
{
767-
workspace->setValue("FitsDDP/Interpolation", "SuperPixels");
768-
workspace->setValue("RawDDP/SuperPixels", true);
769-
}
751+
ui->superPixels->setChecked(true);
752+
on_superPixels_clicked();
770753
}
771754

772755
void RawDDPSettings::on_buttonBox_clicked(QAbstractButton *button)

DeepSkyStacker/RawDDPSettings.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ private slots:
4141
void brightness_2_editingFinished();
4242
void redScale_2_editingFinished();
4343
void blueScale_2_editingFinished();
44-
void on_bilinear_2_toggled(bool);
45-
void on_AHD_2_toggled(bool);
46-
void on_rawBayer_2_toggled(bool);
47-
void on_superPixels_2_toggled(bool);
44+
void on_bilinear_2_clicked();
45+
void on_AHD_2_clicked();
46+
void on_rawBayer_2_clicked();
47+
void on_superPixels_2_clicked();
48+
4849
private:
4950
Ui::RawDDPSettings *ui;
5051
std::unique_ptr<Workspace> workspace;

DeepSkyStacker/RecommendedSettings.cpp

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ void RecommendedSettings::insertHTML(const QString& html, const QColor& colour,
251251
/* ------------------------------------------------------------------- */
252252
/* ------------------------------------------------------------------- */
253253

254-
static void AddRAWNarrowBandRecommendation(RECOMMENDATIONVECTOR & vRecommendations, bool bFITS)
254+
static void AddRAWNarrowBandRecommendation(RECOMMENDATIONVECTOR & vRecommendations)
255255
{
256256
RecommendationItem ri;
257257
Recommendation rec;
@@ -265,16 +265,11 @@ static void AddRAWNarrowBandRecommendation(RECOMMENDATIONVECTOR & vRecommendatio
265265
"Use super-pixel mode",
266266
"IDS_RECO_RAWNARROWBAND_TEXT"));
267267

268-
if (bFITS)
269-
{
270-
ri.addSetting("FitsDDP/Interpolation", "SuperPixels");
271-
}
272-
else
273-
{
274-
ri.addSetting("RawDDP/SuperPixels", true);
275-
ri.addSetting("RawDDP/RawBayer", false);
276-
ri.addSetting("RawDDP/AHD", false);
277-
};
268+
269+
ri.addSetting("RawDDP/SuperPixels", true);
270+
ri.addSetting("RawDDP/RawBayer", false);
271+
ri.addSetting("RawDDP/AHD", false);
272+
278273
rec.isImportant = false;
279274
rec.addItem(ri);
280275

@@ -308,7 +303,7 @@ static void AddNarrowBandPerChannelBackgroundCalibration(RECOMMENDATIONVECTOR &
308303

309304
/* ------------------------------------------------------------------- */
310305

311-
static void AddRAWDebayering(RECOMMENDATIONVECTOR & vRecommendations, double fExposureTime, bool bFITS)
306+
static void AddRAWDebayering(RECOMMENDATIONVECTOR & vRecommendations, double fExposureTime)
312307
{
313308
RecommendationItem ri;
314309
Recommendation rec;
@@ -332,30 +327,20 @@ static void AddRAWDebayering(RECOMMENDATIONVECTOR & vRecommendations, double fEx
332327
"IDS_RECO_RAWLOWSNR_TEXT"));
333328
};
334329

335-
if (bFITS)
330+
if (fExposureTime > 4*60.0)
336331
{
337-
if (fExposureTime > 4*60.0)
338-
ri.addSetting("FitsDDP/Interpolation", "AHD");
339-
else
340-
ri.addSetting("FitsDDP/Interpolation", "Bilinear");
332+
ri.addSetting("RawDDP/SuperPixels", false);
333+
ri.addSetting("RawDDP/RawBayer", false);
334+
ri.addSetting("RawDDP/Interpolation", "AHD");
335+
ri.addSetting("RawDDP/AHD", true);
341336
}
342337
else
343338
{
344-
if (fExposureTime > 4*60.0)
345-
{
346-
ri.addSetting("RawDDP/SuperPixels", false);
347-
ri.addSetting("RawDDP/RawBayer", false);
348-
ri.addSetting("RawDDP/Interpolation", "AHD");
349-
ri.addSetting("RawDDP/AHD", true);
350-
}
351-
else
352-
{
353-
ri.addSetting("RawDDP/SuperPixels", false);
354-
ri.addSetting("RawDDP/RawBayer", false);
355-
ri.addSetting("RawDDP/Interpolation", "Bilinear");
356-
ri.addSetting("RawDDP/AHD", false);
357-
};
358-
};
339+
ri.addSetting("RawDDP/SuperPixels", false);
340+
ri.addSetting("RawDDP/RawBayer", false);
341+
ri.addSetting("RawDDP/Interpolation", "Bilinear");
342+
ri.addSetting("RawDDP/AHD", false);
343+
}
359344

360345
rec.addItem(ri);
361346
vRecommendations.push_back(rec);
@@ -737,9 +722,9 @@ void RecommendedSettings::fillWithRecommendedSettings()
737722

738723
if (pStackingTasks->AreBayerImageUsed())
739724
{
740-
AddRAWDebayering(vRecommendations, pStackingTasks->GetMaxExposureTime(), pStackingTasks->AreFITSImageUsed());
725+
AddRAWDebayering(vRecommendations, pStackingTasks->GetMaxExposureTime());
741726
AddModdedDSLR(vRecommendations, pStackingTasks->AreFITSImageUsed());
742-
AddRAWNarrowBandRecommendation(vRecommendations, pStackingTasks->AreFITSImageUsed());
727+
AddRAWNarrowBandRecommendation(vRecommendations);
743728
// if (!pStackingTasks->AreFITSImageUsed())
744729
// AddRAWBlackPoint(vRecommendations, pStackingTasks->AreFlatUsed(), pStackingTasks->AreBiasUsed());
745730
};

0 commit comments

Comments
 (0)