Skip to content

Commit ba3b7a0

Browse files
committed
Merge branch 'master' into StickFigure
2 parents e54e795 + 4ae6344 commit ba3b7a0

File tree

39 files changed

+7185
-7008
lines changed

39 files changed

+7185
-7008
lines changed

.github/workflows/bundle-build.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Bundle Build
2+
3+
on:
4+
push:
5+
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
env:
13+
parallel_processes: 6 # A good default counts is: available Threads + 2
14+
15+
jobs:
16+
build:
17+
runs-on: windows-latest
18+
strategy:
19+
matrix:
20+
build_type: ["MinSizeRel"]
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Install Qt
26+
uses: jurplel/install-qt-action@v4
27+
with:
28+
aqtversion: '==3.1.*'
29+
version: '6.5.1'
30+
host: 'windows'
31+
target: 'desktop'
32+
cache: true
33+
arch: 'win64_msvc2019_64'
34+
modules: 'qt3d qtactiveqt qtcharts qtconnectivity qtdatavis3d qtgrpc qthttpserver qtimageformats qtlanguageserver qtlocation qtlottie qtmultimedia qtnetworkauth qtpdf qtpositioning qtquick3dphysics qtquickeffectmaker qtremoteobjects qtscxml qtsensors qtserialbus qtserialport qtspeech qtvirtualkeyboard qtwebchannel qtwebengine qtwebsockets qtwebview debug_info qt5compat qtquick3d qtquicktimeline qtshadertools'
35+
36+
- name: Cache Inno Setup
37+
id: cache-innosetup
38+
uses: actions/cache@v4
39+
with:
40+
path: innosetup.exe
41+
key: innosetup-6.4.3
42+
43+
- name: Download Inno Setup
44+
if: steps.cache-innosetup.outputs.cache-hit != 'true'
45+
shell: powershell
46+
run: |
47+
wget -O innosetup.exe "https://jrsoftware.org/download.php/innosetup-6.4.3.exe"
48+
49+
- name: Install Inno Setup
50+
run: |
51+
./innosetup.exe /silent /dir=${{github.workspace}}/innoSetup /CURRENTUSER /NOICONS
52+
set innoPath=
53+
set PATH=%PATH%;${{github.workspace}}/innoSetup
54+
55+
# Packages should be automatically downloaded using vcpkg through the toolchain
56+
- name: Configure CMake
57+
env:
58+
CMAKE_PREFIX_PATH: ${{env.QT_ROOT_DIR}}
59+
# Choose CMakeLists.text from a specific source directory with -S.
60+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
61+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
62+
run: |
63+
cmake -B build -S . -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_INSTALL_PREFIX=stellarium-bin
64+
65+
- name: Build
66+
# Build your program with the given configuration
67+
run: |
68+
cmake --build build --config ${{matrix.build_type}} -j ${{env.parallel_processes}} --target install
69+
cmake --build build --config ${{matrix.build_type}} -j ${{env.parallel_processes}} --target stellarium-installer
70+
71+
# We use the first find as it should only be one
72+
- name: Install Stellarium for Bundeling
73+
run: |
74+
$installer = Get-ChildItem -Path installers -Recurse -Filter 'stellarium-*-qt6-win64.exe' | Select-Object -First 1
75+
if ($installer) {
76+
New-Item -ItemType Directory -Path stellarium-installer -Force | Out-Null
77+
Copy-Item $installer.FullName stellarium-installer\
78+
79+
$quickInstallScript = "stellarium-installer\quickInstall.bat"
80+
$installerRelativePath = ".\" + $installer.Name
81+
$quickInstallContent = "`"$installerRelativePath`" /silent /dir=stellarium /CURRENTUSER /NOICONS /LOG=`"installation.log`" /MERGETASKS=`"!desktopicon`""
82+
$quickInstallContent += "`r`nmklink stellarium.exe stellarium\stellarium.exe"
83+
Set-Content -Path $quickInstallScript -Value $quickInstallContent
84+
} else {
85+
Write-Error "Installer not found."
86+
}
87+
88+
- name: Deploy Stellarium installer
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: stellarium-windows-installer
92+
path: stellarium-installer
93+
retention-days: 3 # Don't store to long as stellarium builds are large

.github/workflows/ci.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
# The branches below must be a subset of the branches above
1111
branches: [master]
1212

13+
env:
14+
parallel_processes: 6 # A good default counts is: available Threads + 2
15+
1316
jobs:
1417
# CI on Linux (Qt5)
1518
ci-linux-qt5:
@@ -43,7 +46,7 @@ jobs:
4346
4447
- name: Compile
4548
working-directory: build
46-
run: make -j3
49+
run: make -j ${{env.parallel_processes}}
4750

4851
- name: Run unit tests
4952
uses: coactions/setup-xvfb@v1
@@ -84,7 +87,7 @@ jobs:
8487
8588
- name: Compile
8689
working-directory: build
87-
run: make -j3
90+
run: make -j ${{env.parallel_processes}}
8891

8992
- name: Run unit tests
9093
uses: coactions/setup-xvfb@v1
@@ -131,7 +134,7 @@ jobs:
131134
132135
- name: Compile
133136
working-directory: build
134-
run: make -j3
137+
run: make -j ${{env.parallel_processes}}
135138

136139
- name: Run unit tests
137140
uses: coactions/setup-xvfb@v1
@@ -170,7 +173,7 @@ jobs:
170173
171174
- name: Compile
172175
working-directory: build
173-
run: make -j3
176+
run: make -j ${{env.parallel_processes}}
174177

175178
- name: Run unit tests
176179
uses: coactions/setup-xvfb@v1
@@ -209,7 +212,7 @@ jobs:
209212
210213
- name: Compile
211214
working-directory: build
212-
run: make -j3
215+
run: make -j ${{env.parallel_processes}}
213216

214217
- name: Run unit tests
215218
uses: coactions/setup-xvfb@v1
@@ -251,7 +254,7 @@ jobs:
251254
252255
- name: Compile
253256
working-directory: build
254-
run: make -j3
257+
run: make -j ${{env.parallel_processes}}
255258

256259
- name: Run unit tests
257260
uses: coactions/setup-xvfb@v1
@@ -287,9 +290,9 @@ jobs:
287290
mkdir builds
288291
cd builds
289292
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSTELLARIUM_RELEASE_BUILD=Off -DENABLE_TESTING=On "${{ github.workspace }}"
290-
make -j3
293+
make -j ${{env.parallel_processes}}
291294
Xvfb :0 -ac -screen 0 1024x768x24+32 >/dev/null 2>&1 &
292295
sleep 3
293296
ctest --output-on-failure
294297
sleep 1
295-
pkill Xvfb
298+
pkill Xvfb

CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,6 @@ ENDIF()
299299
SET(CMAKE_CXX_STANDARD 17)
300300
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
301301
SET(CMAKE_CXX_EXTENSIONS OFF)
302-
# NOTE: C_STANDARD 17 and 23 values added in CMake 3.21
303-
# https://gitlab.kitware.com/cmake/cmake/-/issues/22366
304-
# Ubuntu 18.04 have GCC 7.5 - so, C11 only
305-
SET(CMAKE_C_STANDARD 11)
306-
SET(CMAKE_C_STANDARD_REQUIRED ON)
307-
SET(CMAKE_C_EXTENSIONS OFF)
308302

309303
IF(WIN32)
310304
# We don't need the extra Windows.h stuff, this may speed up compilation a tiny bit
@@ -329,8 +323,10 @@ IF(WIN32)
329323
# C4305: type truncation
330324
# C4351: "new" behaviour, member array default initialization. Required since at least C++98, but funny MSVC throws a warning.
331325
# C4996: deprecated POSIX names (used in zlib)
332-
# C5105: defines in macros
333-
SET(STEL_MSVC_FLAGS "/wd4244 /wd4305 /wd4351 /wd4996 /wd5105 /utf-8")
326+
# C5105: defines in macros
327+
# Zc:_cplusplus: Qt >5.9.0 requieres a C++17 compiler
328+
# permissiv: requiered by Qt >6.9.0
329+
SET(STEL_MSVC_FLAGS "/wd4244 /wd4305 /wd4351 /wd4996 /wd5105 /utf-8 /Zc:__cplusplus /permissive-")
334330
# Avoid type conflict with C++17 standard
335331
# SET(STEL_MSVC_FLAGS "${STEL_MSVC_FLAGS} /D_HAS_STD_BYTE=0") # Don't do this in Qt6. Just avoid "using namespace std" anywhere! https://developercommunity.visualstudio.com/t/error-c2872-byte-ambiguous-symbol/93889
336332
# Set multiprocessing and minimal version of Windows
@@ -906,7 +902,11 @@ IF(WIN32)
906902
SET(ISS_AUTOGENERATED_WARNING "Do not edit this file! It has been automatically generated by CMake. Your changes will be lost the next time CMake is run.")
907903

908904
GET_FILENAME_COMPONENT(_qt_bin_dir "${QMAKE_LOCATION}" DIRECTORY)
909-
FIND_PROGRAM(WINDEPLOYQT_COMMAND windeployqt HINTS "${_qt_bin_dir}")
905+
IF(Qt6_FOUND)
906+
FIND_PROGRAM(WINDEPLOYQT_COMMAND windeployqt6 HINTS "${_qt_bin_dir}")
907+
ELSE()
908+
FIND_PROGRAM(WINDEPLOYQT_COMMAND windeployqt HINTS "${_qt_bin_dir}")
909+
ENDIF()
910910
IF(WINDEPLOYQT_COMMAND)
911911
MESSAGE(STATUS "Found windeployqt: ${WINDEPLOYQT_COMMAND}")
912912
ELSE()

plugins/LensDistortionEstimator/src/LensDistortionEstimator.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,15 @@ void LensDistortionEstimator::setProjectionCenterMarkerEnabled(const bool enable
819819
emit pointMarkersToggled(enable);
820820
}
821821

822+
void LensDistortionEstimator::setImgPosResetOnLoadingEnabled(const bool enable)
823+
{
824+
if(imgPosResetOnLoadingEnabled == enable) return;
825+
826+
imgPosResetOnLoadingEnabled = enable;
827+
conf_->setValue("LensDistortionEstimator/reset_img_pos_on_loading", enable);
828+
emit pointMarkersToggled(enable);
829+
}
830+
822831
void LensDistortionEstimator::setImageAxesEnabled(const bool enable)
823832
{
824833
if(imageAxesEnabled == enable) return;
@@ -853,6 +862,7 @@ void LensDistortionEstimator::loadSettings()
853862
setImageAxesEnabled(conf_->value("LensDistortionEstimator/show_image_axes", false).toBool());
854863
setPointMarkersEnabled(conf_->value("LensDistortionEstimator/mark_picked_points", true).toBool());
855864
setProjectionCenterMarkerEnabled(conf_->value("LensDistortionEstimator/mark_center_of_projection", false).toBool());
865+
setImgPosResetOnLoadingEnabled(conf_->value("LensDistortionEstimator/reset_img_pos_on_loading", true).toBool());
856866
imageAxesColor = Vec3f(conf_->value("LensDistortionEstimator/image_axes_color", defaultImageAxesColor).toString());
857867
pointMarkerColor = Vec3f(conf_->value("LensDistortionEstimator/point_marker_color", defaultPointMarkerColor).toString());
858868
selectedPointMarkerColor = Vec3f(conf_->value("LensDistortionEstimator/selected_point_marker_color", defaultSelectedPointMarkerColor).toString());

plugins/LensDistortionEstimator/src/LensDistortionEstimator.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class LensDistortionEstimator : public StelModule
3939
Q_PROPERTY(bool imageAxesEnabled READ areImageAxesEnabled WRITE setImageAxesEnabled NOTIFY imageAxesToggled)
4040
Q_PROPERTY(bool pointMarkersEnabled READ arePointMarkersEnabled WRITE setPointMarkersEnabled NOTIFY pointMarkersToggled)
4141
Q_PROPERTY(bool projectionCenterMarkerEnabled READ isProjectionCenterMarkerEnabled WRITE setProjectionCenterMarkerEnabled NOTIFY projectionCenterMarkerToggled)
42+
Q_PROPERTY(bool imgPosResetOnLoadingEnabled READ isImgPosResetOnLoadingEnabled WRITE setImgPosResetOnLoadingEnabled NOTIFY imgPosResetOnLoadingToggled)
4243
Q_PROPERTY(Vec3f selectedPointMarkerColor READ getSelectedPointMarkerColor WRITE setSelectedPointMarkerColor NOTIFY selectedPointMarkerColorChanged )
4344
Q_PROPERTY(Vec3f pointMarkerColor READ getPointMarkerColor WRITE setPointMarkerColor NOTIFY pointMarkerColorChanged )
4445
Q_PROPERTY(Vec3f projectionCenterMarkerColor READ getProjectionCenterMarkerColor WRITE setProjectionCenterMarkerColor NOTIFY projectionCenterMarkerColorChanged )
@@ -62,6 +63,7 @@ class LensDistortionEstimator : public StelModule
6263
bool configureGui(bool show = true) override;
6364
bool arePointMarkersEnabled() const { return pointMarkersEnabled; }
6465
bool isProjectionCenterMarkerEnabled() const { return projectionCenterMarkerEnabled; }
66+
bool isImgPosResetOnLoadingEnabled() const { return imgPosResetOnLoadingEnabled; }
6567
bool areImageAxesEnabled() const { return imageAxesEnabled; }
6668
bool isImageEnabled() const { return imageEnabled; }
6769
bool isDialogVisible() const { return dialogVisible; }
@@ -78,6 +80,7 @@ public slots:
7880
void setImageAxesEnabled(bool enabled);
7981
void setPointMarkersEnabled(bool enabled);
8082
void setProjectionCenterMarkerEnabled(bool enabled);
83+
void setImgPosResetOnLoadingEnabled(bool enabled);
8184
void setProjectionCenterMarkerColor(const Vec3f& color);
8285
void setSelectedPointMarkerColor(const Vec3f& color);
8386
void setPointMarkerColor(const Vec3f& color);
@@ -87,6 +90,7 @@ public slots:
8790
void dialogToggled(bool enabled);
8891
void imageAxesToggled(bool enabled);
8992
void pointMarkersToggled(bool enabled);
93+
void imgPosResetOnLoadingToggled(bool enabled);
9094
void projectionCenterMarkerToggled(bool enabled);
9195
void projectionCenterMarkerColorChanged(const Vec3f& color);
9296
void selectedPointMarkerColorChanged(const Vec3f& color);
@@ -141,6 +145,7 @@ public slots:
141145
bool rotatingImage_ = false;
142146
bool pointMarkersEnabled = true;
143147
bool projectionCenterMarkerEnabled = false;
148+
bool imgPosResetOnLoadingEnabled = true;
144149
bool imageAxesEnabled = false;
145150
bool imageEnabled = true;
146151
bool dialogVisible = false;

plugins/LensDistortionEstimator/src/gui/LensDistortionEstimatorDialog.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ void LensDistortionEstimatorDialog::createDialogContent()
273273
connectBoolProperty(ui_->imageAxesEnabled, "LensDistortionEstimator.imageAxesEnabled");
274274
connectBoolProperty(ui_->markPickedPoints, "LensDistortionEstimator.pointMarkersEnabled");
275275
connectBoolProperty(ui_->markProjectionCenter, "LensDistortionEstimator.projectionCenterMarkerEnabled");
276+
connectBoolProperty(ui_->imgPosResetOnLoadingEnabled, "LensDistortionEstimator.imgPosResetOnLoadingEnabled");
276277
ui_->imageAxesColor->setup("LensDistortionEstimator.imageAxesColor", "LensDistortionEstimator/image_axes_color");
277278
ui_->pointMarkerColor->setup("LensDistortionEstimator.pointMarkerColor", "LensDistortionEstimator/point_marker_color");
278279
ui_->selectedPointMarkerColor->setup("LensDistortionEstimator.selectedPointMarkerColor",
@@ -1246,7 +1247,8 @@ void LensDistortionEstimatorDialog::updateImage()
12461247
imageChanged_ = true;
12471248
setupGenerateLensfunModelButton();
12481249
computeColorToSubtract();
1249-
placeImageInCenterOfScreen();
1250+
if(ui_->imgPosResetOnLoadingEnabled->isChecked())
1251+
placeImageInCenterOfScreen();
12501252

12511253
#ifdef HAVE_EXIV2
12521254
try

plugins/LensDistortionEstimator/src/gui/lensDistortionEstimatorDialog.ui

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -730,13 +730,6 @@ distortion</string>
730730
<bool>true</bool>
731731
</property>
732732
<layout class="QGridLayout" name="gridLayout_6">
733-
<item row="2" column="2">
734-
<widget class="ColorButton" name="imageAxesColor">
735-
<property name="text">
736-
<string/>
737-
</property>
738-
</widget>
739-
</item>
740733
<item row="0" column="1">
741734
<spacer name="horizontalSpacer_2">
742735
<property name="orientation">
@@ -750,14 +743,21 @@ distortion</string>
750743
</property>
751744
</spacer>
752745
</item>
746+
<item row="2" column="2">
747+
<widget class="ColorButton" name="imageAxesColor">
748+
<property name="text">
749+
<string/>
750+
</property>
751+
</widget>
752+
</item>
753753
<item row="0" column="3">
754754
<widget class="QLabel" name="label_10">
755755
<property name="text">
756756
<string comment="As in &quot;normal&quot; points, the opposite being &quot;selected&quot;">normal</string>
757757
</property>
758758
</widget>
759759
</item>
760-
<item row="3" column="1">
760+
<item row="4" column="1">
761761
<spacer name="verticalSpacer">
762762
<property name="orientation">
763763
<enum>Qt::Vertical</enum>
@@ -770,24 +770,17 @@ distortion</string>
770770
</property>
771771
</spacer>
772772
</item>
773-
<item row="2" column="0">
774-
<widget class="QCheckBox" name="imageAxesEnabled">
775-
<property name="text">
776-
<string>Mark image axes</string>
777-
</property>
778-
</widget>
779-
</item>
780-
<item row="0" column="5">
781-
<widget class="QLabel" name="label_11">
773+
<item row="0" column="0">
774+
<widget class="QCheckBox" name="markPickedPoints">
782775
<property name="text">
783-
<string comment="As in &quot;selected points&quot;">selected</string>
776+
<string>Mark picked points</string>
784777
</property>
785778
</widget>
786779
</item>
787-
<item row="0" column="0">
788-
<widget class="QCheckBox" name="markPickedPoints">
780+
<item row="1" column="2">
781+
<widget class="ColorButton" name="projectionCenterMarkerColor">
789782
<property name="text">
790-
<string>Mark picked points</string>
783+
<string/>
791784
</property>
792785
</widget>
793786
</item>
@@ -805,17 +798,31 @@ distortion</string>
805798
</property>
806799
</widget>
807800
</item>
801+
<item row="2" column="0">
802+
<widget class="QCheckBox" name="imageAxesEnabled">
803+
<property name="text">
804+
<string>Mark image axes</string>
805+
</property>
806+
</widget>
807+
</item>
808+
<item row="0" column="5">
809+
<widget class="QLabel" name="label_11">
810+
<property name="text">
811+
<string comment="As in &quot;selected points&quot;">selected</string>
812+
</property>
813+
</widget>
814+
</item>
808815
<item row="1" column="0">
809816
<widget class="QCheckBox" name="markProjectionCenter">
810817
<property name="text">
811818
<string>Mark center of projection</string>
812819
</property>
813820
</widget>
814821
</item>
815-
<item row="1" column="2">
816-
<widget class="ColorButton" name="projectionCenterMarkerColor">
822+
<item row="3" column="0">
823+
<widget class="QCheckBox" name="imgPosResetOnLoadingEnabled">
817824
<property name="text">
818-
<string/>
825+
<string>Reset image position on loading</string>
819826
</property>
820827
</widget>
821828
</item>

0 commit comments

Comments
 (0)