Merge lp:~i-martividal/stellarium/Observability-Preces into lp:stellarium

Proposed by Ivan Marti-Vidal
Status: Merged
Merged at revision: 8192
Proposed branch: lp:~i-martividal/stellarium/Observability-Preces
Merge into: lp:stellarium
Diff against target: 90 lines (+3/-10)
2 files modified
CMakeLists.txt (+0/-3)
plugins/Observability/src/Observability.cpp (+3/-7)
To merge this branch: bzr merge lp:~i-martividal/stellarium/Observability-Preces
Reviewer Review Type Date Requested Status
Alexander Wolf Needs Information
Review via email: mp+286783@code.launchpad.net

Description of the change

Hi all,

A user of Stellarium sent me an e-mail describing a bug about wrong rise/set times in Observability for years far in the past. In the end, it is due to Observability not updating properly all the parameters when the year is changed: it still estimated well the time spent since/to the rise/set, but didn't convert them well well to local time.

Here I propose a simple fix to this.

   Cheers!

          Ivan

To post a comment you must log in.
Revision history for this message
Alexander Wolf (alexwolf) wrote :

Why you use SET(Boost_USE_STATIC_LIBS OFF) in CMakeLists.txt?

review: Needs Information
8191. By Ivan Marti-Vidal

Corrected CMakeLists

8192. By Ivan Marti-Vidal

Corrected CMakeLists

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-01-31 08:42:04 +0000
3+++ CMakeLists.txt 2016-02-22 11:51:36 +0000
4@@ -228,7 +228,6 @@
5 FIND_PACKAGE(Qt5Network REQUIRED)
6 FIND_PACKAGE(Qt5OpenGL REQUIRED)
7 FIND_PACKAGE(Qt5Widgets REQUIRED)
8-FIND_PACKAGE(Qt5PrintSupport REQUIRED)
9 IF(USE_PLUGIN_TELESCOPECONTROL)
10 FIND_PACKAGE(Qt5SerialPort REQUIRED)
11 ENDIF()
12@@ -374,7 +373,6 @@
13 GET_TARGET_PROPERTY(QtWidgets_location Qt5::Widgets LOCATION)
14 GET_TARGET_PROPERTY(QtSql_location Qt5::Sql LOCATION)
15 GET_TARGET_PROPERTY(QtXmlPatterns_location Qt5::XmlPatterns LOCATION)
16- GET_TARGET_PROPERTY(QtPrintSupport_location Qt5::PrintSupport LOCATION)
17 IF(ENABLE_SCRIPTING)
18 GET_TARGET_PROPERTY(QtScript_location Qt5::Script LOCATION)
19 SET(ISS_QT_SCRIPT "Source: \"${QtScript_location}\"; DestDir: \"{app}\";")
20@@ -515,7 +513,6 @@
21 ${CMAKE_SOURCE_DIR}/src/core/planetsephems
22 ${CMAKE_SOURCE_DIR}/src/core/external
23 ${CMAKE_SOURCE_DIR}/src/core/external/qtcompress
24- ${CMAKE_SOURCE_DIR}/src/core/external/qcustomplot
25 ${CMAKE_SOURCE_DIR}/src/core/external/glues_stel/source/
26 ${CMAKE_SOURCE_DIR}/src/core/external/glues_stel/source/libtess
27 ${CMAKE_SOURCE_DIR}/src/gui
28
29=== modified file 'plugins/Observability/src/Observability.cpp'
30--- plugins/Observability/src/Observability.cpp 2016-01-08 11:42:06 +0000
31+++ plugins/Observability/src/Observability.cpp 2016-02-22 11:51:36 +0000
32@@ -290,10 +290,8 @@
33 // GMTShift = StelUtils::getGMTShiftFromQT(currJD)/24.0;
34 GMTShift = StelApp::getInstance().getLocaleMgr().getGMTShift(currJD)/24.0;
35
36-// qDebug() << QString("%1%2 ").arg(GMTShift);
37
38 double currLocalT = 24.*modf(currJD + GMTShift,&currJDint);
39-
40 int auxm, auxd, auxy;
41 StelUtils::getDateFromJulianDay(currJD, &auxy, &auxm, &auxd);
42 bool isSource = StelApp::getInstance().getStelObjectMgr().getWasSelected();
43@@ -366,6 +364,7 @@
44 {
45 updateSunH();
46 lastJDMoon = 0.0;
47+
48 };
49
50 //////////////////////////////////////////////////////////////////
51@@ -466,8 +465,9 @@
52 // Compute source's altitude (in radians):
53 alti = std::asin(LocPos[2]);
54
55+
56 // Force re-computation of ephemeris if the location changes or the user changes the configuration:
57- if (locChanged || configChanged)
58+ if (locChanged || configChanged || yearChanged)
59 {
60 souChanged=true;
61 configChanged=false;
62@@ -1415,7 +1415,6 @@
63 if (qAbs(myJD.first-lastJDMoon)>StelCore::JD_SECOND || lastType!=bodyType || souChanged)
64 {
65
66-// qDebug() << q_("%1 %2 %3 %4").arg(Kind).arg(LastObject).arg(myJD,0,'f',5).arg(lastJDMoon,0,'f',5);
67
68 lastType = bodyType;
69
70@@ -1588,7 +1587,6 @@
71 culmAlt = qAbs(mylat-dec); // 90 - altitude at transit.
72 };
73
74-// qDebug() << q_("%1").arg(MoonCulm,0,'f',5);
75
76
77 lastJDMoon = myJD.first;
78@@ -1659,13 +1657,11 @@
79
80 };
81
82- // qDebug() << QString("%1 %2 %3 %4 ").arg(Sec1).arg(Sec2).arg(Temp1).arg(Temp2);
83
84
85 if (qAbs(Sec2.first-Sec1.first) < 10.*dT) // 1 minute accuracy; convergence.
86 {
87 TempFullMoon = (Sec1.first+Sec2.first)/2.;
88- // qDebug() << QString("%1%2 ").arg(TempFullMoon);
89 break;
90 };
91