Merge lp:~stellarium/stellarium/gz_planetSpeed into lp:stellarium

Proposed by gzotti on 2017-11-20
Status: Needs review
Proposed branch: lp:~stellarium/stellarium/gz_planetSpeed
Merge into: lp:stellarium
Diff against target: 2735 lines (+877/-647)
35 files modified
src/StelMainView.cpp (+43/-4)
src/StelMainView.hpp (+24/-9)
src/core/StelApp.cpp (+19/-3)
src/core/StelApp.hpp (+9/-1)
src/core/StelMovementMgr.hpp (+6/-1)
src/core/StelObject.hpp (+14/-13)
src/core/modules/Comet.cpp (+19/-10)
src/core/modules/MinorPlanet.cpp (+17/-0)
src/core/modules/Orbit.cpp (+14/-24)
src/core/modules/Orbit.hpp (+3/-2)
src/core/modules/Planet.cpp (+50/-9)
src/core/modules/Planet.hpp (+21/-12)
src/core/modules/SolarSystem.cpp (+20/-22)
src/core/planetsephems/EphemWrapper.cpp (+253/-223)
src/core/planetsephems/EphemWrapper.hpp (+46/-46)
src/core/planetsephems/de430.cpp (+19/-10)
src/core/planetsephems/de431.cpp (+17/-9)
src/core/planetsephems/elliptic_to_rectangular.c (+2/-2)
src/core/planetsephems/elliptic_to_rectangular.h (+5/-0)
src/core/planetsephems/gust86.c (+10/-3)
src/core/planetsephems/gust86.h (+2/-1)
src/core/planetsephems/l1.c (+10/-3)
src/core/planetsephems/l1.h (+4/-1)
src/core/planetsephems/marssat.c (+17/-5)
src/core/planetsephems/marssat.h (+3/-2)
src/core/planetsephems/tass17.c (+10/-3)
src/core/planetsephems/tass17.h (+3/-1)
src/core/planetsephems/vsop87.c (+1/-2)
src/gui/ConfigurationDialog.cpp (+61/-74)
src/gui/ConfigurationDialog.hpp (+0/-7)
src/gui/SearchDialog.cpp (+2/-1)
src/gui/SkyGui.cpp (+2/-0)
src/gui/StelGui.cpp (+11/-10)
src/gui/StelGui.hpp (+33/-27)
src/gui/configurationDialog.ui (+107/-107)
To merge this branch: bzr merge lp:~stellarium/stellarium/gz_planetSpeed
Reviewer Review Type Date Requested Status
Stellarium 2017-11-20 Pending
Review via email: mp+333965@code.launchpad.net

Description of the change

This branch is actually just one commit. I re-activated the velocity computations from the various ephemerides and added an eclipticalVelocity field to the Planet class. We will require velocity for aberration correction which will follow in another branch past 0.17.0, so this re-discovery is a first step.

The current solution requires a few copying operations from a local six-element "buffer" array to the object's Vec3ds. Not sure if this could be simplified in any way. Any ideas from the C++ gurus? Store a 6-array and just use Vec3d in the get/set methods? But then those need the copying.

I don't have velocities in our lunar ELP82 and in the EllipticalOrbit class, so these objects (our Moon and small moons of outer planets) currently only deliver zero speed. The latter class could be entirely removed IMHO, and CometOrbit could take over as "KeplerOrbit" class, solving the 2-body problem with either orbital elements or state vector (JDE&position&speed). This could allow interplanetary spaceflight or "orbital observers with propulsion control", but needs again a larger change in the ssystem_*.ini files, so will come only after 0.17.

To post a comment you must log in.
9973. By gzotti on 2017-11-23

Added/fixed velocity display to Planets, MinorPlanets and Comets

9974. By gzotti on 2017-11-23

GUI changes for velocity display option. This also puts StelApp, StelGui and Mainview under StelProperty control. Also, Mouse Cursor hiding is back (still incomplete, though).

Unmerged revisions

9974. By gzotti on 2017-11-23

GUI changes for velocity display option. This also puts StelApp, StelGui and Mainview under StelProperty control. Also, Mouse Cursor hiding is back (still incomplete, though).

9973. By gzotti on 2017-11-23

Added/fixed velocity display to Planets, MinorPlanets and Comets

9972. By gzotti on 2017-11-20

Enabled computation of planet velocities. Most of the ephemerides already came with it, but it was never exploited so far, and the respective lines were commented away. We can use this for information, but will especially need this for aberration correction. Note that velocity of the outer moons (EllipticalOrbit) and even our Moon (ELP82) is not available! (The latter is included with DE43x solutions.)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/StelMainView.cpp'
2--- src/StelMainView.cpp 2017-10-10 09:47:54 +0000
3+++ src/StelMainView.cpp 2017-11-23 14:55:50 +0000
4@@ -350,12 +350,10 @@
5 //important to call this, or Qt may have invalid state after we have drawn (wrong textures, etc...)
6 painter->beginNativePainting();
7
8- //fix for bug 1628072 caused by QTBUG-56798
9+ //fix for bug LP:1628072 caused by QTBUG-56798
10 #ifndef QT_NO_DEBUG
11 StelOpenGL::clearGLErrors();
12 #endif
13-
14-
15 QOpenGLFunctions* gl = QOpenGLContext::currentContext()->functions();
16
17 //clear the buffer (not strictly required for us because we repaint all pixels, but should improve perf on tile-based renderers)
18@@ -368,6 +366,7 @@
19 app.draw();
20 painter->endNativePainting();
21
22+ mainView->handleMouseCursorTimeout(now);
23 mainView->drawEnded();
24 }
25
26@@ -397,6 +396,10 @@
27
28 void mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE
29 {
30+ // GZ TODO: Where to place the mouse cursor wake-up?
31+ qDebug() << "StelRootItem::mouseMoveEvent()";
32+ if (QGuiApplication::overrideCursor()!=0)
33+ QGuiApplication::restoreOverrideCursor();
34 QMouseEvent ev = convertMouseEvent(event);
35 QPointF pos = ev.pos();
36 event->setAccepted(StelApp::getInstance().handleMove(pos.x(), pos.y(), ev.buttons()));
37@@ -574,7 +577,7 @@
38
39 setWindowIcon(QIcon(":/mainWindow/icon.bmp"));
40 initTitleI18n();
41- setObjectName("Mainview");
42+ setObjectName("MainView");
43
44 setViewportUpdateMode(QGraphicsView::NoViewportUpdate);
45 setFrameShape(QFrame::NoFrame);
46@@ -639,6 +642,8 @@
47 glWidget->makeCurrent();
48 glWidget->initializeGL();
49 #endif
50+ // We cannot use global mousetracking. Only if mouse is hidden!
51+ //setMouseTracking(true);
52 }
53
54 void StelMainView::resizeEvent(QResizeEvent* event)
55@@ -654,6 +659,18 @@
56 QGraphicsView::resizeEvent(event);
57 }
58
59+// GZ: This should do something to make the cursor visible again when the mouse is moved.
60+// However, any implementation of this method seems to gobble all mouse moves.
61+//void StelMainView::mouseMoveEvent(QMouseEvent *event)
62+//{
63+//// //Q_UNUSED(event)
64+////// thereWasAnEvent();
65+// event->ignore();
66+//// if (QGuiApplication::overrideCursor()!=0)
67+//// QGuiApplication::restoreOverrideCursor();
68+//}
69+
70+
71 void StelMainView::focusSky() {
72 //scene()->setActiveWindow(0);
73 rootItem->setFocus();
74@@ -1277,6 +1294,28 @@
75 }
76 }
77
78+void StelMainView::handleMouseCursorTimeout(const double now)
79+{
80+ // GZ restore mouse cursor stuff from pre-0.15.2.
81+ // Manage cursor timeout
82+ if (cursorTimeout>0.f && (now-lastEventTimeSec>cursorTimeout) && flagCursorTimeout)
83+ {
84+ if (QGuiApplication::overrideCursor()==0)
85+ {
86+ QGuiApplication::setOverrideCursor(Qt::BlankCursor);
87+ setMouseTracking(true);
88+ }
89+ }
90+ else
91+ {
92+ if (QGuiApplication::overrideCursor()!=0)
93+ {
94+ QGuiApplication::restoreOverrideCursor();
95+ setMouseTracking(false);
96+ }
97+ }
98+}
99+
100 void StelMainView::minFPSUpdate()
101 {
102 if(!updateQueued)
103
104=== modified file 'src/StelMainView.hpp'
105--- src/StelMainView.hpp 2017-05-18 11:28:23 +0000
106+++ src/StelMainView.hpp 2017-11-23 14:55:50 +0000
107@@ -47,7 +47,13 @@
108 friend class StelGraphicsScene;
109 friend class NightModeGraphicsEffect;
110 Q_OBJECT
111- Q_PROPERTY(bool fullScreen READ isFullScreen WRITE setFullScreen NOTIFY fullScreenChanged)
112+ Q_PROPERTY(bool fullScreen READ isFullScreen WRITE setFullScreen NOTIFY fullScreenChanged)
113+ Q_PROPERTY(bool flagInvertScreenShotColors READ getFlagInvertScreenShotColors WRITE setFlagInvertScreenShotColors NOTIFY flagInvertScreenShotColorsChanged)
114+ Q_PROPERTY(bool flagOverwriteScreenshots READ getFlagOverwriteScreenShots WRITE setFlagOverwriteScreenShots NOTIFY flagOverwriteScreenshotsChanged)
115+ Q_PROPERTY(bool flagUseButtonsBackground READ getFlagUseButtonsBackground WRITE setFlagUseButtonsBackground NOTIFY flagUseButtonsBackgroundChanged)
116+ Q_PROPERTY(bool flagCursorTimeout READ getFlagCursorTimeout WRITE setFlagCursorTimeout NOTIFY flagCursorTimeoutChanged)
117+ Q_PROPERTY(double cursorTimeout READ getCursorTimeout WRITE setCursorTimeout NOTIFY cursorTimeoutChanged)
118+
119
120 public:
121 //! Contains some basic info about the OpenGL context used
122@@ -117,21 +123,21 @@
123 //! Get whether colors are inverted when saving screenshot
124 bool getFlagInvertScreenShotColors() const {return flagInvertScreenShotColors;}
125 //! Set whether colors should be inverted when saving screenshot
126- void setFlagInvertScreenShotColors(bool b) {flagInvertScreenShotColors=b;}
127+ void setFlagInvertScreenShotColors(bool b) {flagInvertScreenShotColors=b; emit flagInvertScreenShotColorsChanged(b);}
128
129 //! Get whether existing files are overwritten when saving screenshot
130 bool getFlagOverwriteScreenShots() const {return flagOverwriteScreenshots;}
131 //! Set whether existing files are overwritten when saving screenshot
132- void setFlagOverwriteScreenShots(bool b) {flagOverwriteScreenshots=b;}
133+ void setFlagOverwriteScreenShots(bool b) {flagOverwriteScreenshots=b; emit flagOverwriteScreenshotsChanged(b);}
134
135 //! Get the state of the mouse cursor timeout flag
136 bool getFlagCursorTimeout() {return flagCursorTimeout;}
137 //! Get the mouse cursor timeout in seconds
138- float getCursorTimeout() const {return cursorTimeout;}
139+ double getCursorTimeout() const {return cursorTimeout;}
140 //! Get the state of the mouse cursor timeout flag
141- void setFlagCursorTimeout(bool b) {flagCursorTimeout=b;}
142+ void setFlagCursorTimeout(bool b) {flagCursorTimeout=b; emit flagCursorTimeoutChanged(b);}
143 //! Set the mouse cursor timeout in seconds
144- void setCursorTimeout(float t) {cursorTimeout=t;}
145+ void setCursorTimeout(double t) {cursorTimeout=t; emit cursorTimeoutChanged(t);}
146
147 //! Set the minimum frames per second. Usually this minimum will be switched to after there are no
148 //! user events for some seconds to save power. However, if can be useful to set this to a high
149@@ -157,7 +163,7 @@
150 bool needsMaxFPS() const;
151
152 //! Set the state of the flag of usage background for GUI buttons
153- void setFlagUseButtonsBackground(bool b) { flagUseButtonsBackground=b; }
154+ void setFlagUseButtonsBackground(bool b) { flagUseButtonsBackground=b; emit flagUseButtonsBackgroundChanged(b); }
155 //! Get the state of the flag of usage background for GUI buttons
156 bool getFlagUseButtonsBackground() { return flagUseButtonsBackground; }
157
158@@ -170,6 +176,8 @@
159 //! Handle window resized events, and change the size of the underlying
160 //! QGraphicsScene to be the same
161 virtual void resizeEvent(QResizeEvent* event) Q_DECL_OVERRIDE;
162+// //! Wake up mouse cursor (if it was hidden)
163+// virtual void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
164 signals:
165 //! emitted when saveScreenShot is requested with saveScreenShot().
166 //! doScreenshot() does the actual work (it has to do it in the main
167@@ -184,6 +192,11 @@
168 void reloadShadersRequested();
169
170 void updateIconsRequested();
171+ void flagInvertScreenShotColorsChanged(bool b);
172+ void flagOverwriteScreenshotsChanged(bool b);
173+ void flagUseButtonsBackgroundChanged(bool b);
174+ void flagCursorTimeoutChanged(bool b);
175+ void cursorTimeoutChanged(double t);
176
177 private slots:
178 // Do the actual screenshot generation in the main thread with this method.
179@@ -200,6 +213,8 @@
180 private:
181 //! The graphics scene notifies us when a draw finished, so that we can queue the next one
182 void drawEnded();
183+ //! hide mouse cursor after some time if configured.
184+ void handleMouseCursorTimeout(const double now);
185 //! Returns the desired OpenGL format settings,
186 //! on desktop this corresponds to a GL 2.1 context,
187 //! with 32bit RGBA buffer and 24/8 depth/stencil buffer
188@@ -237,8 +252,8 @@
189 QString screenShotPrefix;
190 QString screenShotDir;
191
192- // Number of second before the mouse cursor disappears
193- float cursorTimeout;
194+ // Number of seconds before the mouse cursor disappears
195+ double cursorTimeout;
196 bool flagCursorTimeout;
197
198 bool flagUseButtonsBackground;
199
200=== modified file 'src/core/StelApp.cpp'
201--- src/core/StelApp.cpp 2017-11-16 15:27:36 +0000
202+++ src/core/StelApp.cpp 2017-11-23 14:55:50 +0000
203@@ -439,6 +439,10 @@
204 planetLocationMgr = new StelLocationMgr();
205 actionMgr = new StelActionMgr();
206
207+ // register non-modules for StelProperty tracking
208+ propMgr->registerObject(this);
209+ propMgr->registerObject(mainWin);
210+
211 // Stel Object Data Base manager
212 stelObjectMgr = new StelObjectMgr();
213 stelObjectMgr->init();
214@@ -878,17 +882,29 @@
215
216 void StelApp::setFlagShowDecimalDegrees(bool b)
217 {
218- flagShowDecimalDegrees = b;
219+ if (flagShowDecimalDegrees!=b)
220+ {
221+ flagShowDecimalDegrees = b;
222+ emit flagShowDecimalDegreesChanged(b);
223+ }
224 }
225
226 void StelApp::setFlagUseFormattingOutput(bool b)
227 {
228- flagUseFormattingOutput = b;
229+ if (flagUseFormattingOutput!=b)
230+ {
231+ flagUseFormattingOutput = b;
232+ emit flagUseFormattingOutputChanged(b);
233+ }
234 }
235
236 void StelApp::setFlagUseCCSDesignation(bool b)
237 {
238- flagUseCCSDesignation = b;
239+ if (flagUseCCSDesignation!=b)
240+ {
241+ flagUseCCSDesignation = b;
242+ emit flagUseCCSDesignationChanged(b);
243+ }
244 }
245
246 // Update translations and font for sky everywhere in the program
247
248=== modified file 'src/core/StelApp.hpp'
249--- src/core/StelApp.hpp 2017-10-23 05:06:42 +0000
250+++ src/core/StelApp.hpp 2017-11-23 14:55:50 +0000
251@@ -69,6 +69,10 @@
252 {
253 Q_OBJECT
254 Q_PROPERTY(bool nightMode READ getVisionModeNight WRITE setVisionModeNight NOTIFY visionNightModeChanged)
255+ Q_PROPERTY(bool flagShowDecimalDegrees READ getFlagShowDecimalDegrees WRITE setFlagShowDecimalDegrees NOTIFY flagShowDecimalDegreesChanged)
256+ Q_PROPERTY(bool flagUseAzimuthFromSouth READ getFlagSouthAzimuthUsage WRITE setFlagSouthAzimuthUsage NOTIFY flagUseAzimuthFromSouthChanged)
257+ Q_PROPERTY(bool flagUseCCSDesignation READ getFlagUseCCSDesignation WRITE setFlagUseCCSDesignation NOTIFY flagUseCCSDesignationChanged)
258+ Q_PROPERTY(bool flagUseFormattingOutput READ getFlagUseFormattingOutput WRITE setFlagUseFormattingOutput NOTIFY flagUseFormattingOutputChanged)
259
260 public:
261 friend class StelAppGraphicsWidget;
262@@ -237,7 +241,7 @@
263 //! Set flag for using calculation of azimuth from south towards west (instead north towards east)
264 bool getFlagSouthAzimuthUsage() const { return flagUseAzimuthFromSouth; }
265 //! Get flag for using calculation of azimuth from south towards west (instead north towards east)
266- void setFlagSouthAzimuthUsage(bool use) { flagUseAzimuthFromSouth=use; }
267+ void setFlagSouthAzimuthUsage(bool use) { flagUseAzimuthFromSouth=use; emit flagUseAzimuthFromSouthChanged(use);}
268
269 //! Set flag for using of formatting output for coordinates
270 void setFlagUseFormattingOutput(bool b);
271@@ -278,6 +282,10 @@
272 void quit();
273 signals:
274 void visionNightModeChanged(bool);
275+ void flagShowDecimalDegreesChanged(bool);
276+ void flagUseAzimuthFromSouthChanged(bool);
277+ void flagUseCCSDesignationChanged(bool);
278+ void flagUseFormattingOutputChanged(bool);
279 void colorSchemeChanged(const QString&);
280 void languageChanged();
281
282
283=== modified file 'src/core/StelMovementMgr.hpp'
284--- src/core/StelMovementMgr.hpp 2017-11-17 00:14:42 +0000
285+++ src/core/StelMovementMgr.hpp 2017-11-23 14:55:50 +0000
286@@ -41,6 +41,10 @@
287 READ getFlagTracking
288 WRITE setFlagTracking
289 NOTIFY flagTrackingChanged)
290+ Q_PROPERTY(bool flagIndicationMountMode
291+ READ getFlagIndicationMountMode
292+ WRITE setFlagIndicationMountMode
293+ NOTIFY flagIndicationMountModeChanged)
294
295 //The targets of viewport offset animation
296 Q_PROPERTY(float viewportHorizontalOffsetTarget
297@@ -182,7 +186,7 @@
298 //! Get the state of flag for indication of mount mode
299 bool getFlagIndicationMountMode() const {return flagIndicationMountMode;}
300 //! Set the state of flag for indication of mount mode
301- void setFlagIndicationMountMode(bool b) { flagIndicationMountMode=b; }
302+ void setFlagIndicationMountMode(bool b) { flagIndicationMountMode=b; emit flagIndicationMountModeChanged(b); }
303
304 //! Move the view to a specified J2000 position.
305 //! @param aim The position to move to expressed as a vector.
306@@ -309,6 +313,7 @@
307 //! Emitted when the tracking property changes
308 void flagTrackingChanged(bool b);
309 void equatorialMountChanged(bool b);
310+ void flagIndicationMountModeChanged(bool b);
311
312 void flagAutoZoomOutResetsDirectionChanged(bool b);
313
314
315=== modified file 'src/core/StelObject.hpp'
316--- src/core/StelObject.hpp 2017-07-10 12:38:17 +0000
317+++ src/core/StelObject.hpp 2017-11-23 14:55:50 +0000
318@@ -54,18 +54,19 @@
319 AltAzi = 0x00000020, //!< The position (Altitude/Azimuth)
320 Distance = 0x00000040, //!< Info about an object's distance
321 Size = 0x00000080, //!< Info about an object's size
322- Extra = 0x00000100, //!< Derived class-specific extra fields
323- HourAngle = 0x00000200, //!< The hour angle + DE (of date)
324- AbsoluteMagnitude = 0x00000400, //!< The absolute magnitude
325- GalacticCoord = 0x00000800, //!< The galactic position
326- SupergalacticCoord = 0x00001000, //!< The supergalactic position
327- ObjectType = 0x00002000, //!< The type of the object (star, planet, etc.)
328- EclipticCoordJ2000 = 0x00004000, //!< The ecliptic position (J2000.0 ref) [+ XYZ of VSOP87A (used mainly for debugging, not public)]
329- EclipticCoordOfDate = 0x00008000, //!< The ecliptic position (of date)
330- IAUConstellation = 0x00010000, //!< Three-letter constellation code (And, Boo, Cas, ...)
331- SiderealTime = 0x00020000, //!< Mean and Apparent Sidereal Time
332- NoFont = 0x00040000,
333- PlainText = 0x00080000, //!< Strip HTML tags from output
334+ Velocity = 0x00000100, //!< Info about object's velocity
335+ Extra = 0x00000200, //!< Derived class-specific extra fields
336+ HourAngle = 0x00000400, //!< The hour angle + DE (of date)
337+ AbsoluteMagnitude = 0x00000800, //!< The absolute magnitude
338+ GalacticCoord = 0x00001000, //!< The galactic position
339+ SupergalacticCoord = 0x00002000, //!< The supergalactic position
340+ ObjectType = 0x00004000, //!< The type of the object (star, planet, etc.)
341+ EclipticCoordJ2000 = 0x00008000, //!< The ecliptic position (J2000.0 ref) [+ XYZ of VSOP87A (used mainly for debugging, not public)]
342+ EclipticCoordOfDate = 0x00010000, //!< The ecliptic position (of date)
343+ IAUConstellation = 0x00020000, //!< Three-letter constellation code (And, Boo, Cas, ...)
344+ SiderealTime = 0x00040000, //!< Mean and Apparent Sidereal Time
345+ NoFont = 0x00080000,
346+ PlainText = 0x00100000, //!< Strip HTML tags from output
347 // TODO GZ
348 // RaDecJ2000Planetocentric = 0x00020000, //!< The planetocentric equatorial position (J2000 ref) [Mostly to compare with almanacs]
349 // RaDecOfDatePlanetocentric = 0x00040000 //!< The planetocentric equatorial position (of date)
350@@ -75,7 +76,7 @@
351 Q_DECLARE_FLAGS(InfoStringGroup, InfoStringGroupFlags)
352
353 //! A pre-defined set of specifiers for the getInfoString flags argument to getInfoString
354- static const InfoStringGroupFlags AllInfo = (InfoStringGroupFlags)(Name|CatalogNumber|Magnitude|RaDecJ2000|RaDecOfDate|AltAzi|Distance|Size|Extra|HourAngle|
355+ static const InfoStringGroupFlags AllInfo = (InfoStringGroupFlags)(Name|CatalogNumber|Magnitude|RaDecJ2000|RaDecOfDate|AltAzi|Distance|Size|Velocity|Extra|HourAngle|
356 AbsoluteMagnitude|GalacticCoord|SupergalacticCoord|ObjectType|EclipticCoordJ2000|
357 EclipticCoordOfDate|IAUConstellation|SiderealTime);
358 //! A pre-defined set of specifiers for the getInfoString flags argument to getInfoString
359
360=== modified file 'src/core/modules/Comet.cpp'
361--- src/core/modules/Comet.cpp 2017-11-16 15:27:36 +0000
362+++ src/core/modules/Comet.cpp 2017-11-23 14:55:50 +0000
363@@ -187,6 +187,7 @@
364 oss << QString("%1: %2").arg(q_("Absolute Magnitude")).arg(absoluteMagnitude, 0, 'f', 2) << "<br>";
365 }
366
367+
368 oss << getCommonInfoString(core, flags);
369
370 // TRANSLATORS: Unit of measure for distance - kilometers
371@@ -231,6 +232,18 @@
372 oss << QString("%1: %2%3 (%4 %5)").arg(q_("Distance"), distAU, au, distKM, useKM ? km : Mkm) << "<br />";
373 }
374
375+ if (flags&Velocity)
376+ {
377+ QString kms = qc_("km/s", "speed");
378+
379+ Vec3d orbitalVel=getEclipticVelocity();
380+ double orbVel=orbitalVel.length();
381+ if (orbVel>0.)
382+ { // AU/d * km/AU /24
383+ oss << QString("%1: %2 %3").arg(q_("Velocity")).arg(orbVel* AU/86400., 0, 'f', 3).arg(kms) << "<br />";
384+ }
385+ }
386+
387 if (flags&Extra)
388 {
389 // If semi-major axis not zero then calculate and display orbital period for comet in days
390@@ -241,10 +254,10 @@
391 oss << QString("%1: %2 a").arg(q_("Sidereal period"), QString::number(siderealPeriod/365.25, 'f', 3)) << "<br />";
392 }
393
394- // TRANSLATORS: Unit of measure for speed - kilometers per second
395- QString kms = qc_("km/s", "speed");
396- // GZ: Add speed. I don't know where else to place that bit of information.
397- oss << QString("%1: %2 %3").arg(q_("Speed"), QString::number(((CometOrbit*)orbitPtr)->getVelocity().length()*AU/86400.0, 'f', 3), kms) << "<br />";
398+// // TRANSLATORS: Unit of measure for speed - kilometers per second
399+// QString kms = qc_("km/s", "speed");
400+// // GZ: Add speed. I don't know where else to place that bit of information.
401+// oss << QString("%1: %2 %3").arg(q_("Speed"), QString::number(((CometOrbit*)orbitPtr)->getVelocity().length()*AU/86400.0, 'f', 3), kms) << "<br />";
402
403 const Vec3d& observerHelioPos = core->getObserverHeliocentricEclipticPos();
404 const double elongation = getElongation(observerHelioPos);
405@@ -353,11 +366,6 @@
406 {
407 lastJDEtail=dateJDE;
408
409- // The CometOrbit is in fact available in userDataPtr!
410- CometOrbit* orbit=(CometOrbit*)orbitPtr;
411- Q_ASSERT(orbit);
412- if (!orbit->objectDateValid(dateJDE)) return; // out of useful date range. This should allow having hundreds of comet elements.
413-
414 if (orbit->getUpdateTails()){
415 // Compute lengths and orientations from orbit object, but only if required.
416 tailFactors=getComaDiameterAndTailLengthAU();
417@@ -434,7 +442,8 @@
418 float gasMagFactor=qMin(0.9f*aLum, 0.7f);
419 float dustMagFactor=qMin(dustTailBrightnessFactor*aLum, 0.7f);
420
421- Vec3f gasColor(0.15f*gasMagFactor,0.35f*gasMagFactor,0.6f*gasMagFactor); // Orig color 0.15/0.15/0.6
422+ // TODO: Maybe make gas color distance dependent? (various typical ingredients outgas at different temperatures...)
423+ Vec3f gasColor(0.15f*gasMagFactor,0.35f*gasMagFactor,0.6f*gasMagFactor); // Orig color 0.15/0.15/0.6.
424 Vec3f dustColor(dustMagFactor, dustMagFactor,0.6f*dustMagFactor);
425
426 if (withAtmosphere)
427
428=== modified file 'src/core/modules/MinorPlanet.cpp'
429--- src/core/modules/MinorPlanet.cpp 2017-11-16 15:27:36 +0000
430+++ src/core/modules/MinorPlanet.cpp 2017-11-23 14:55:50 +0000
431@@ -302,6 +302,23 @@
432 oss << QString("%1: %2%3 (%4 %5)").arg(q_("Distance"), distAU, au, distKM, km) << "<br />";
433 }
434
435+ if (flags&Velocity)
436+ {
437+ // TRANSLATORS: Unit of measure for speed - kilometers per second
438+ QString kms = qc_("km/s", "speed");
439+
440+ Vec3d orbitalVel=getEclipticVelocity();
441+ double orbVel=orbitalVel.length();
442+ if (orbVel>0.)
443+ { // AU/d * km/AU /24
444+ double orbVelKms=orbVel* AU/86400.;
445+ oss << QString("%1: %2 %3").arg(q_("Orbital Velocity")).arg(orbVelKms, 0, 'f', 3).arg(kms) << "<br />";
446+ double helioVel=getHeliocentricEclipticVelocity().length(); // just in case we have asteroid moons!
447+ if (helioVel!=orbVel)
448+ oss << QString("%1: %2 %3").arg(q_("Heliocentric velocity")).arg(helioVel* AU/86400., 0, 'f', 3).arg(kms) << "<br />";
449+ }
450+ }
451+
452 double angularSize = 2.*getAngularSize(core)*M_PI/180.;
453 if (flags&Size && angularSize>=4.8e-7)
454 {
455
456=== modified file 'src/core/modules/Orbit.cpp'
457--- src/core/modules/Orbit.cpp 2017-03-12 21:25:07 +0000
458+++ src/core/modules/Orbit.cpp 2017-11-23 14:55:50 +0000
459@@ -251,6 +251,7 @@
460
461 void CometOrbit::positionAtTimevInVSOP87Coordinates(double JDE, double *v, bool updateVelocityVector)
462 {
463+ Q_UNUSED(updateVelocityVector);
464 JDE -= t0;
465 double rCosNu,rSinNu;
466 if (e < 1.0) InitEll(q,n,e,JDE,rCosNu,rSinNu); // Laguerre-Conway seems stable enough to go for <1.0.
467@@ -261,16 +262,17 @@
468 }
469 else InitPar(q,n,JDE,rCosNu,rSinNu);
470 double p0,p1,p2, s0, s1, s2;
471- Init3D(i,Om,w,rCosNu,rSinNu,p0,p1,p2, s0, s1, s2, updateVelocityVector, e, q);
472+ //Init3D(i,Om,w,rCosNu,rSinNu,p0,p1,p2, s0, s1, s2, updateVelocityVector, e, q);
473+ Init3D(i,Om,w,rCosNu,rSinNu,p0,p1,p2, s0, s1, s2, true, e, q);
474 v[0] = rotateToVsop87[0]*p0 + rotateToVsop87[1]*p1 + rotateToVsop87[2]*p2;
475 v[1] = rotateToVsop87[3]*p0 + rotateToVsop87[4]*p1 + rotateToVsop87[5]*p2;
476 v[2] = rotateToVsop87[6]*p0 + rotateToVsop87[7]*p1 + rotateToVsop87[8]*p2;
477
478- if (updateVelocityVector)
479- {
480+ //if (updateVelocityVector)
481+ //{
482 rdot.set(s0, s1, s2);
483 updateTails=true;
484- }
485+ //}
486 }
487
488
489@@ -459,6 +461,7 @@
490 }
491 else if (eccentricity > 1.0) // N.B. This is odd at least: elliptical must have ecc<1!
492 {
493+ Q_ASSERT(0); // We should never come here!
494 double a = pericenterDistance / (1.0 - eccentricity);
495 x = -a * (eccentricity - cosh(E));
496 z = -a * std::sqrt(eccentricity * eccentricity - 1) * -sinh(E);
497@@ -466,6 +469,7 @@
498 else
499 {
500 // TODO: Handle parabolic orbits
501+ Q_ASSERT(0); // We should never come here!
502 x = 0.0;
503 z = 0.0;
504 }
505@@ -487,22 +491,6 @@
506 return positionAtE(E);
507 }
508
509-//void EllipticalOrbit::positionAtTime(double JDE, double * X, double * Y, double * Z) const
510-//{
511-// Vec3d pos = positionAtTime(JDE);
512-// *X=pos[2];
513-// *Y=pos[0];
514-// *Z=pos[1];
515-//}
516-
517-//void EllipticalOrbit::positionAtTimev(double JDE, double* v)
518-//{
519-// Vec3d pos = positionAtTime(JDE);
520-// v[0]=pos[2];
521-// v[1]=pos[0];
522-// v[2]=pos[1];
523-//}
524-
525 void EllipticalOrbit::positionAtTimevInVSOP87Coordinates(const double JDE, double* v) const
526 {
527 Vec3d pos = positionAtTime(JDE);
528@@ -516,21 +504,23 @@
529 return period;
530 }
531
532-
533+/* Found undocumented and unused in pre-0.17.
534+// return apocenter distance
535 double EllipticalOrbit::getBoundingRadius() const
536 {
537 // TODO: watch out for unbounded parabolic and hyperbolic orbits
538 return pericenterDistance * ((1.0 + eccentricity) / (1.0 - eccentricity));
539 }
540-
541-
542+*/
543+/*
544+ * Found undocumented and unused pre-0.17.
545 void EllipticalOrbit::sample(double, double, int nSamples, OrbitSampleProc& proc) const
546 {
547 double dE = 2. * M_PI / (double) nSamples;
548 for (int i = 0; i < nSamples; i++)
549 proc.sample(positionAtE(dE * i));
550 }
551-
552+*/
553 /*
554 * Stuff found unused and deactivated pre-0.15
555 Vec3d CachingOrbit::positionAtTime(double JDE) const
556
557=== modified file 'src/core/modules/Orbit.hpp'
558--- src/core/modules/Orbit.hpp 2017-03-12 21:25:07 +0000
559+++ src/core/modules/Orbit.hpp 2017-11-23 14:55:50 +0000
560@@ -56,8 +56,8 @@
561 // Original one
562 Vec3d positionAtTime(const double JDE) const;
563 double getPeriod() const;
564- double getBoundingRadius() const;
565- virtual void sample(double, double, int, OrbitSampleProc&) const;
566+ // double getBoundingRadius() const; // Return apoapsis distance. UNUSED!
567+ // virtual void sample(double, double, int, OrbitSampleProc&) const; //UNDOCUMENTED & UNUSED
568
569 private:
570 //! returns eccentric anomaly E for Mean anomaly M
571@@ -98,6 +98,7 @@
572 void setUpdateTails(const bool update){ updateTails=update; }
573 //! return speed value [AU/d] last computed by positionAtTimevInVSOP87Coordinates(JDE, v, true)
574 Vec3d getVelocity() const { return rdot; }
575+ void getVelocity(double *vel) const { vel[0]=rdot[0]; vel[1]=rdot[1]; vel[2]=rdot[2];}
576 double getSemimajorAxis() const { return (e==1. ? 0. : q / (1.-e)); }
577 double getEccentricity() const { return e; }
578 bool objectDateValid(const double JDE) const { return (fabs(t0-JDE)<orbitGood); }
579
580=== modified file 'src/core/modules/Planet.cpp'
581--- src/core/modules/Planet.cpp 2017-11-16 15:27:36 +0000
582+++ src/core/modules/Planet.cpp 2017-11-23 14:55:50 +0000
583@@ -197,6 +197,7 @@
584 radius(radius),
585 oneMinusOblateness(1.0-oblateness),
586 eclipticPos(0.,0.,0.),
587+ eclipticVelocity(0.,0.,0.),
588 haloColor(halocolor),
589 absoluteMagnitude(-99.0f),
590 albedo(albedo),
591@@ -487,6 +488,26 @@
592 oss << QString("%1: %2%3 (%4 %5)").arg(q_("Distance"), distAU, au, distKM, km) << "<br />";
593 }
594
595+ if (flags&Velocity)
596+ {
597+ // TRANSLATORS: Unit of measure for speed - kilometers per second
598+ QString kms = qc_("km/s", "speed");
599+
600+ Vec3d orbitalVel=getEclipticVelocity();
601+ double orbVel=orbitalVel.length();
602+ if (orbVel>0.)
603+ { // AU/d * km/AU /24
604+ double orbVelKms=orbVel* AU/86400.;
605+ if (englishName=="moon")
606+ orbVelKms=orbVel;
607+ oss << QString("%1: %2 %3").arg(q_("Orbital Velocity")).arg(orbVelKms, 0, 'f', 3).arg(kms) << "<br />";
608+ double helioVel=getHeliocentricEclipticVelocity().length();
609+ if (helioVel!=orbVel)
610+ oss << QString("%1: %2 %3").arg(q_("Heliocentric Velocity")).arg(helioVel* AU/86400., 0, 'f', 3).arg(kms) << "<br />";
611+ }
612+ }
613+
614+
615 double angularSize = 2.*getAngularSize(core)*M_PI/180.;
616 if (flags&Size && angularSize>=4.8e-7)
617 {
618@@ -649,6 +670,9 @@
619 map.insert("elongation-deg", StelUtils::radToDecDegStr(elongation));
620 map.insert("type", getPlanetTypeString()); // replace existing "type=Planet" by something more detailed.
621 // TBD: Is there ANY reason to keep "type"="Planet" and add a "ptype"=getPlanetTypeString() field?
622+ map.insert("velocity", getEclipticVelocity().toString());
623+ map.insert("heliocentric-velocity", getHeliocentricEclipticVelocity().toString());
624+
625 }
626
627 return map;
628@@ -738,7 +762,7 @@
629 {
630 if (fabs(lastJDE-dateJDE)>deltaJDE)
631 {
632- coordFunc(dateJDE, eclipticPos, orbitPtr);
633+ coordFunc(dateJDE, eclipticPos, eclipticVelocity, orbitPtr);
634 lastJDE = dateJDE;
635 }
636 }
637@@ -851,11 +875,11 @@
638 computeTransMatrix(calc_date-core->computeDeltaT(calc_date)/86400.0, calc_date);
639 if (osculatingFunc)
640 {
641- (*osculatingFunc)(dateJDE,calc_date,eclipticPos);
642+ (*osculatingFunc)(dateJDE,calc_date,eclipticPos, eclipticVelocity);
643 }
644 else
645 {
646- coordFunc(calc_date, eclipticPos, orbitPtr);
647+ coordFunc(calc_date, eclipticPos, eclipticVelocity, orbitPtr);
648 }
649 orbitP[d] = eclipticPos;
650 orbit[d] = getHeliocentricEclipticPos();
651@@ -881,11 +905,11 @@
652
653 computeTransMatrix(calc_date-core->computeDeltaT(calc_date)/86400.0, calc_date);
654 if (osculatingFunc) {
655- (*osculatingFunc)(dateJDE,calc_date,eclipticPos);
656+ (*osculatingFunc)(dateJDE,calc_date,eclipticPos, eclipticVelocity);
657 }
658 else
659 {
660- coordFunc(calc_date, eclipticPos, orbitPtr);
661+ coordFunc(calc_date, eclipticPos, eclipticVelocity, orbitPtr);
662 }
663 orbitP[d] = eclipticPos;
664 orbit[d] = getHeliocentricEclipticPos();
665@@ -910,11 +934,11 @@
666 computeTransMatrix(calc_date-core->computeDeltaT(calc_date)/86400.0, calc_date);
667 if (osculatingFunc)
668 {
669- (*osculatingFunc)(dateJDE,calc_date,eclipticPos);
670+ (*osculatingFunc)(dateJDE,calc_date,eclipticPos, eclipticVelocity);
671 }
672 else
673 {
674- coordFunc(calc_date, eclipticPos, orbitPtr);
675+ coordFunc(calc_date, eclipticPos, eclipticVelocity, orbitPtr);
676 }
677 orbitP[d] = eclipticPos;
678 orbit[d] = getHeliocentricEclipticPos();
679@@ -926,7 +950,7 @@
680
681
682 // calculate actual Planet position
683- coordFunc(dateJDE, eclipticPos, orbitPtr);
684+ coordFunc(dateJDE, eclipticPos, eclipticVelocity, orbitPtr);
685
686 lastJDE = dateJDE;
687
688@@ -934,7 +958,7 @@
689 else if (fabs(lastJDE-dateJDE)>deltaJDE)
690 {
691 // calculate actual Planet position
692- coordFunc(dateJDE, eclipticPos, orbitPtr);
693+ coordFunc(dateJDE, eclipticPos, eclipticVelocity, orbitPtr);
694 if (orbitFader.getInterstate()>0.000001)
695 for( int d=0; d<ORBIT_SEGMENTS; d++ )
696 orbit[d]=getHeliocentricPos(orbitP[d]);
697@@ -1132,6 +1156,23 @@
698 }
699 }
700 }
701+// Return heliocentric velocity of planet.
702+Vec3d Planet::getHeliocentricEclipticVelocity() const
703+{
704+ // Note: using shared copies is too slow here. So we use direct access
705+ // instead.
706+ Vec3d vel = eclipticVelocity;
707+ const Planet* pp = parent.data();
708+ if (pp)
709+ {
710+ while (pp->parent.data())
711+ {
712+ vel += pp->eclipticVelocity;
713+ pp = pp->parent.data();
714+ }
715+ }
716+ return vel;
717+}
718
719 // Compute the distance to the given position in heliocentric coordinate (in AU)
720 // This is called by SolarSystem::draw()
721
722=== modified file 'src/core/modules/Planet.hpp'
723--- src/core/modules/Planet.hpp 2017-10-28 04:59:28 +0000
724+++ src/core/modules/Planet.hpp 2017-11-23 14:55:50 +0000
725@@ -31,10 +31,11 @@
726 #include <QString>
727
728 // The callback type for the external position computation function
729+// arguments are JDE, position[3], velocity[3].
730 // The last variable is the userData pointer.
731-typedef void (*posFuncType)(double, double*, void*);
732+typedef void (*posFuncType)(double, double*, double*, void*);
733
734-typedef void (OsculatingFunctType)(double jde0,double jde,double xyz[3]);
735+typedef void (OsculatingFunctType)(double jde0,double jde,double xyz[3], double xyzdot[3]);
736
737 // epoch J2000: 12 UT on 1 Jan 2000
738 #define J2000 2451545.0
739@@ -289,21 +290,27 @@
740 //! Get the Planet position in the parent Planet ecliptic coordinate in AU
741 Vec3d getEclipticPos() const;
742
743- // Return the heliocentric ecliptical position
744+ //! Return the heliocentric ecliptical position
745 Vec3d getHeliocentricEclipticPos() const {return getHeliocentricPos(eclipticPos);}
746
747- // Return the heliocentric transformation for local coordinate
748+ //! Return the heliocentric transformation for local coordinate
749 Vec3d getHeliocentricPos(Vec3d) const;
750 void setHeliocentricEclipticPos(const Vec3d &pos);
751
752- // Compute the distance to the given position in heliocentric coordinate (in AU)
753+ //! Get the planet velocity around the parent planet in ecliptical coordinates in AU/d
754+ Vec3d getEclipticVelocity() const {return eclipticVelocity;}
755+
756+ //! Get the planet's heliocentric velocity in the solar system in ecliptical coordinates in AU/d. Required for aberration!
757+ Vec3d getHeliocentricEclipticVelocity() const;
758+
759+ //! Compute the distance to the given position in heliocentric coordinates (in AU)
760 double computeDistance(const Vec3d& obsHelioPos);
761 double getDistance(void) const {return distance;}
762
763 void setRings(Ring* r) {rings = r;}
764
765 void setSphereScale(float s) { if(s!=sphereScale) { sphereScale = s; if(objModel) objModel->needsRescale=true; } }
766- float getSphereScale() { return sphereScale; }
767+ float getSphereScale() const { return sphereScale; }
768
769 const QSharedPointer<Planet> getParent(void) const {return parent;}
770
771@@ -321,11 +328,11 @@
772
773 bool flagNativeName;
774 void setFlagNativeName(bool b) { flagNativeName = b; }
775- bool getFlagNativeName(void) { return flagNativeName; }
776+ bool getFlagNativeName(void) const { return flagNativeName; }
777
778 bool flagTranslatedName;
779 void setFlagTranslatedName(bool b) { flagTranslatedName = b; }
780- bool getFlagTranslatedName(void) { return flagTranslatedName; }
781+ bool getFlagTranslatedName(void) const { return flagTranslatedName; }
782
783 ///////////////////////////////////////////////////////////////////////////
784 // DEPRECATED
785@@ -457,7 +464,6 @@
786 StelOBJ* obj;
787 //! The opengl array, created by loadObjModel() but filled later in main thread
788 StelOpenGLArray* arr;
789-
790 };
791
792 static StelTextureSP texEarthShadow; // for lunar eclipses
793@@ -499,10 +505,13 @@
794 RotationElements re; // Rotation param
795 double radius; // Planet radius in AU
796 double oneMinusOblateness; // (polar radius)/(equatorial radius)
797- Vec3d eclipticPos; // Position in AU in the rectangular ecliptic coordinate system around the parent body. To get heliocentric coordinates, use getHeliocentricEclipticPos()
798- // centered on the parent Planet
799+ Vec3d eclipticPos; // Position in AU in the rectangular ecliptic coordinate system (J2000) around the parent body.
800+ // To get heliocentric coordinates, use getHeliocentricEclipticPos()
801+ Vec3d eclipticVelocity; // Speed in AU/d in the rectangular ecliptic coordinate system (J2000) around the parent body.
802+ // NEW FEATURE in late 2017. For now, this may be 0/0/0 when we are not yet able to compute it.
803+ // to get velocity, preferrably read getEclipticVelocity() and getHeliocentricEclipticVelocity()
804+ // The "State Vector" [Heafner 1999] can be formed from (JDE, eclipticPos, eclipticVelocity)
805 Vec3d screenPos; // Used to store temporarily the 2D position on screen
806-// Vec3d previousScreenPos; // The position of this planet in the previous frame. 0.16pre: DEAD CODE!
807 Vec3f haloColor; // used for drawing the planet halo. Also, when non-spherical (OBJ) model without texture is used, its color is derived from haloColour*albedo.
808
809 float absoluteMagnitude; // since 2017 this moved to the Planet class: V(1,0) from Explanatory Supplement or WGCCRE2009 paper for the planets, H in the H,G magnitude system for Minor planets, H10 for comets.
810
811=== modified file 'src/core/modules/SolarSystem.cpp'
812--- src/core/modules/SolarSystem.cpp 2017-10-21 12:47:45 +0000
813+++ src/core/modules/SolarSystem.cpp 2017-11-23 14:55:50 +0000
814@@ -394,13 +394,16 @@
815 }
816 }
817
818-void ellipticalOrbitPosFunc(double jd,double xyz[3], void* userDataPtr)
819+void ellipticalOrbitPosFunc(double jd,double xyz[3], double xyzdot[3], void* orbitPtr)
820 {
821- static_cast<EllipticalOrbit*>(userDataPtr)->positionAtTimevInVSOP87Coordinates(jd, xyz);
822+ static_cast<EllipticalOrbit*>(orbitPtr)->positionAtTimevInVSOP87Coordinates(jd, xyz);
823+ // TODO: Implement a way to retrieve velocities.
824+ xyzdot[0]=xyzdot[1]=xyzdot[2]=0.0;
825 }
826-void cometOrbitPosFunc(double jd,double xyz[3], void* userDataPtr)
827+void cometOrbitPosFunc(double jd,double xyz[3], double xyzdot[3], void* orbitPtr)
828 {
829- static_cast<CometOrbit*>(userDataPtr)->positionAtTimevInVSOP87Coordinates(jd, xyz);
830+ static_cast<CometOrbit*>(orbitPtr)->positionAtTimevInVSOP87Coordinates(jd, xyz, true);
831+ static_cast<CometOrbit*>(orbitPtr)->getVelocity(xyzdot);
832 }
833
834 // Init and load the solar system data (2 files)
835@@ -638,9 +641,8 @@
836 if (pericenterDistance <= 0.0) {
837 semi_major_axis = pd.value(secname+"/orbit_SemiMajorAxis",-1e100).toDouble();
838 if (semi_major_axis <= -1e100) {
839- qDebug() << "ERROR: " << englishName
840+ qDebug() << "ERROR loading " << englishName
841 << ": you must provide orbit_PericenterDistance or orbit_SemiMajorAxis";
842- //abort();
843 continue;
844 } else {
845 semi_major_axis /= AU;
846@@ -692,12 +694,8 @@
847 }
848
849 // when the parent is the sun use ecliptic rather than sun equator:
850- const double parentRotObliquity = parent->getParent()
851- ? parent->getRotObliquity(2451545.0)
852- : 0.0;
853- const double parent_rot_asc_node = parent->getParent()
854- ? parent->getRotAscendingNode()
855- : 0.0;
856+ const double parentRotObliquity = parent->getParent() ? parent->getRotObliquity(2451545.0) : 0.0;
857+ const double parent_rot_asc_node = parent->getParent() ? parent->getRotAscendingNode() : 0.0;
858 double parent_rot_j2000_longitude = 0.0;
859 if (parent->getParent()) {
860 const double c_obl = cos(parentRotObliquity);
861@@ -714,16 +712,16 @@
862 }
863
864 // Create an elliptical orbit
865- EllipticalOrbit *orb = new EllipticalOrbit(pericenterDistance,
866- eccentricity,
867- inclination,
868- ascending_node,
869- arg_of_pericenter,
870- mean_anomaly,
871- period,
872- epoch,
873- parentRotObliquity,
874- parent_rot_asc_node,
875+ EllipticalOrbit *orb = new EllipticalOrbit(pericenterDistance, // [AU]
876+ eccentricity, // 0..>1, but practically only 0..1
877+ inclination, // [radians]
878+ ascending_node, // [radians]
879+ arg_of_pericenter, // [radians]
880+ mean_anomaly, // [radians]
881+ period, // [days]
882+ epoch, // [JDE]
883+ parentRotObliquity, // [radians]
884+ parent_rot_asc_node, // [radians]
885 parent_rot_j2000_longitude);
886 orbits.push_back(orb);
887
888
889=== modified file 'src/core/planetsephems/EphemWrapper.cpp'
890--- src/core/planetsephems/EphemWrapper.cpp 2017-03-17 20:17:25 +0000
891+++ src/core/planetsephems/EphemWrapper.cpp 2017-11-23 14:55:50 +0000
892@@ -95,9 +95,10 @@
893 }
894
895 // planet_id is ONLY one of the #defined values 0..8 above.
896-void get_planet_helio_coordsv(const double jd, double xyz[3], const int planet_id)
897+void get_planet_helio_coordsv(const double jd, double xyz[3], double xyzdot[3], const int planet_id)
898 {
899 bool deOk=false;
900+ double xyz6[6];
901 if(!std::isfinite(jd))
902 {
903 qDebug() << "get_planet_helio_coordsv(): SKIPPED CoordCalc, jd is infinite/nan: " << jd;
904@@ -106,23 +107,27 @@
905
906 if(use_de430(jd))
907 {
908- deOk=GetDe430Coor(jd, planet_id + 1, xyz);
909+ deOk=GetDe430Coor(jd, planet_id + 1, xyz6);
910 }
911 else if(use_de431(jd))
912 {
913- deOk=GetDe431Coor(jd, planet_id + 1, xyz);
914+ deOk=GetDe431Coor(jd, planet_id + 1, xyz6);
915 }
916 if (!deOk) //VSOP87 as fallback
917 {
918- GetVsop87Coor(jd, planet_id, xyz);
919+ GetVsop87Coor(jd, planet_id, xyz6);
920 }
921+ xyz[0] =xyz6[0]; xyz[1] =xyz6[1]; xyz[2] =xyz6[2];
922+ xyzdot[0]=xyz6[3]; xyzdot[1]=xyz6[4]; xyzdot[2]=xyz6[5];
923+
924 }
925
926 // Osculating positions for time JDE in elements for JDE0, if possible by the theory used (e.g. VSOP87).
927 // For ephemerides like DE4xx, JDE0 is irrelevant.
928-void get_planet_helio_osculating_coordsv(double jd0, double jd, double xyz[3], int planet_id)
929+void get_planet_helio_osculating_coordsv(double jd0, double jd, double xyz[3], double xyzdot[3], int planet_id)
930 {
931 bool deOk=false;
932+ double xyz6[6];
933 if(!(std::isfinite(jd) && std::isfinite(jd0)))
934 {
935 qDebug() << "get_planet_helio_osculating_coordsv(): SKIPPED CoordCalc, jd0 or jd is infinite/nan. jd0:" << jd0 << "jd: "<< jd;
936@@ -131,16 +136,18 @@
937
938 if(use_de430(jd))
939 {
940- deOk=GetDe430Coor(jd, planet_id + 1, xyz);
941+ deOk=GetDe430Coor(jd, planet_id + 1, xyz6);
942 }
943 else if(use_de431(jd))
944 {
945- deOk=GetDe431Coor(jd, planet_id + 1, xyz);
946+ deOk=GetDe431Coor(jd, planet_id + 1, xyz6);
947 }
948 if (!deOk) //VSOP87 as fallback
949 {
950- GetVsop87OsculatingCoor(jd0, jd, planet_id, xyz);
951+ GetVsop87OsculatingCoor(jd0, jd, planet_id, xyz6);
952 }
953+ xyz[0] =xyz6[0]; xyz[1] =xyz6[1]; xyz[2] =xyz6[2];
954+ xyzdot[0]=xyz6[3]; xyzdot[1]=xyz6[4]; xyzdot[2]=xyz6[5];
955 }
956
957 /* Chapter 31 Pg 206-207 Equ 31.1 31.2, 31.3 using VSOP 87
958@@ -148,10 +155,11 @@
959 * for given Julian Day. Values are in AU.
960 * params : Julian day, rect coords */
961
962-void get_pluto_helio_coordsv(double jd,double xyz[3], void* unused)
963+void get_pluto_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void* unused)
964 {
965 Q_UNUSED(unused);
966 bool deOk=false;
967+ double xyz6[6];
968 if(!std::isfinite(jd))
969 {
970 qDebug() << "get_pluto_helio_coordsv(): SKIPPED PlutoCoordCalc, jd is infinite/nan:" << jd;
971@@ -160,41 +168,50 @@
972
973 if(use_de430(jd))
974 {
975- deOk=GetDe430Coor(jd, EPHEM_JPL_PLUTO_ID, xyz);
976+ deOk=GetDe430Coor(jd, EPHEM_JPL_PLUTO_ID, xyz6);
977 }
978 else if(use_de431(jd))
979 {
980- deOk=GetDe431Coor(jd, EPHEM_JPL_PLUTO_ID, xyz);
981- }
982- if (!deOk) // fallback to previous solution
983+ deOk=GetDe431Coor(jd, EPHEM_JPL_PLUTO_ID, xyz6);
984+ }
985+
986+ if (deOk)
987+ {
988+ xyz[0] =xyz6[0]; xyz[1] =xyz6[1]; xyz[2] =xyz6[2];
989+ xyzdot[0]=xyz6[3]; xyzdot[1]=xyz6[4]; xyzdot[2]=xyz6[5];
990+ }
991+ else // fallback to previous solution
992 {
993 get_pluto_helio_coords(jd, &xyz[0], &xyz[1], &xyz[2]);
994+ xyzdot[0]=xyzdot[1]=xyzdot[2]=0.0; // TODO: Some meaningful way to get speed?
995 }
996 }
997
998 /* Return 0 for the sun */
999-void get_sun_helio_coordsv(double jd,double xyz[3], void* unused)
1000+void get_sun_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void* unused)
1001 {
1002 Q_UNUSED(jd);
1003 Q_UNUSED(unused);
1004- xyz[0]=0.; xyz[1]=0.; xyz[2]=0.;
1005-}
1006-
1007-void get_mercury_helio_coordsv(double jd,double xyz[3], void* unused)
1008-{
1009- Q_UNUSED(unused);
1010- get_planet_helio_coordsv(jd, xyz, EPHEM_MERCURY_ID);
1011-}
1012-void get_venus_helio_coordsv(double jd,double xyz[3], void* unused)
1013-{
1014- Q_UNUSED(unused);
1015- get_planet_helio_coordsv(jd, xyz, EPHEM_VENUS_ID);
1016-}
1017-
1018-void get_earth_helio_coordsv(const double jd,double xyz[3], void* unused)
1019+ xyz[0] =0.; xyz[1] =0.; xyz[2] =0.;
1020+ xyzdot[0]=0.; xyzdot[1]=0.; xyzdot[2]=0.;
1021+}
1022+
1023+void get_mercury_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void* unused)
1024+{
1025+ Q_UNUSED(unused);
1026+ get_planet_helio_coordsv(jd, xyz, xyzdot, EPHEM_MERCURY_ID);
1027+}
1028+void get_venus_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void* unused)
1029+{
1030+ Q_UNUSED(unused);
1031+ get_planet_helio_coordsv(jd, xyz, xyzdot, EPHEM_VENUS_ID);
1032+}
1033+
1034+void get_earth_helio_coordsv(const double jd,double xyz[3], double xyzdot[3], void* unused)
1035 {
1036 Q_UNUSED(unused);
1037 bool deOk=false;
1038+ double xyz6[6];
1039 if(!std::isfinite(jd))
1040 {
1041 qDebug() << "get_earth_helio_coordsv(): SKIPPED EarthCoordCalc, jd is infinite/nan:" << jd;
1042@@ -203,94 +220,97 @@
1043
1044 if(use_de430(jd))
1045 {
1046- deOk=GetDe430Coor(jd, EPHEM_JPL_EARTH_ID, xyz);
1047+ deOk=GetDe430Coor(jd, EPHEM_JPL_EARTH_ID, xyz6);
1048 }
1049 else if(use_de431(jd))
1050 {
1051- deOk=GetDe431Coor(jd, EPHEM_JPL_EARTH_ID, xyz);
1052+ deOk=GetDe431Coor(jd, EPHEM_JPL_EARTH_ID, xyz6);
1053 }
1054 if (!deOk) //VSOP87 as fallback
1055 {
1056 double moon[3];
1057- GetVsop87Coor(jd,EPHEM_EMB_ID,xyz);
1058+ GetVsop87Coor(jd,EPHEM_EMB_ID,xyz6);
1059 GetElp82bCoor(jd,moon);
1060 /* Earth != EMB:
1061 0.0121505677733761 = mu_m/(1+mu_m),
1062 mu_m = mass(moon)/mass(earth) = 0.01230002 */
1063- xyz[0] -= 0.0121505677733761 * moon[0];
1064- xyz[1] -= 0.0121505677733761 * moon[1];
1065- xyz[2] -= 0.0121505677733761 * moon[2];
1066+ xyz6[0] -= 0.0121505677733761 * moon[0];
1067+ xyz6[1] -= 0.0121505677733761 * moon[1];
1068+ xyz6[2] -= 0.0121505677733761 * moon[2];
1069+ // TODO: HOW TO FIX EARTH SPEED?
1070 }
1071-}
1072-
1073-void get_mars_helio_coordsv(double jd,double xyz[3], void* unused)
1074-{
1075- Q_UNUSED(unused);
1076- get_planet_helio_coordsv(jd, xyz, EPHEM_MARS_ID);
1077-}
1078-
1079-void get_jupiter_helio_coordsv(double jd,double xyz[3], void* unused)
1080-{
1081- Q_UNUSED(unused);
1082- get_planet_helio_coordsv(jd, xyz, EPHEM_JUPITER_ID);
1083-}
1084-
1085-void get_saturn_helio_coordsv(double jd,double xyz[3], void* unused)
1086-{
1087- Q_UNUSED(unused);
1088- get_planet_helio_coordsv(jd, xyz, EPHEM_SATURN_ID);
1089-}
1090-
1091-void get_uranus_helio_coordsv(double jd,double xyz[3], void* unused)
1092-{
1093- Q_UNUSED(unused);
1094- get_planet_helio_coordsv(jd, xyz, EPHEM_URANUS_ID);
1095-}
1096-
1097-void get_neptune_helio_coordsv(double jd,double xyz[3], void* unused)
1098-{
1099- Q_UNUSED(unused);
1100- get_planet_helio_coordsv(jd, xyz, EPHEM_NEPTUNE_ID);
1101-}
1102-
1103-void get_mercury_helio_osculating_coords(double jd0,double jd,double xyz[3])
1104-{
1105- get_planet_helio_osculating_coordsv(jd0, jd, xyz, EPHEM_MERCURY_ID);
1106-}
1107-
1108-void get_venus_helio_osculating_coords(double jd0,double jd,double xyz[3])
1109-{
1110- get_planet_helio_osculating_coordsv(jd0, jd, xyz, EPHEM_VENUS_ID);
1111-}
1112-
1113-void get_earth_helio_osculating_coords(double jd0,double jd,double xyz[3])
1114-{
1115- get_planet_helio_osculating_coordsv(jd0, jd, xyz, EPHEM_EMB_ID);
1116-}
1117-
1118-void get_mars_helio_osculating_coords(double jd0,double jd,double xyz[3])
1119-{
1120- get_planet_helio_osculating_coordsv(jd0, jd, xyz, EPHEM_MARS_ID);
1121-}
1122-
1123-void get_jupiter_helio_osculating_coords(double jd0,double jd,double xyz[3])
1124-{
1125- get_planet_helio_osculating_coordsv(jd0, jd, xyz, EPHEM_JUPITER_ID);
1126-}
1127-
1128-void get_saturn_helio_osculating_coords(double jd0,double jd,double xyz[3])
1129-{
1130- get_planet_helio_osculating_coordsv(jd0, jd, xyz, EPHEM_SATURN_ID);
1131-}
1132-
1133-void get_uranus_helio_osculating_coords(double jd0,double jd,double xyz[3])
1134-{
1135- get_planet_helio_osculating_coordsv(jd0, jd, xyz, EPHEM_URANUS_ID);
1136-}
1137-
1138-void get_neptune_helio_osculating_coords(double jd0,double jd,double xyz[3])
1139-{
1140- get_planet_helio_osculating_coordsv(jd0, jd, xyz, EPHEM_NEPTUNE_ID);
1141+ xyz[0] =xyz6[0]; xyz[1] =xyz6[1]; xyz[2] =xyz6[2];
1142+ xyzdot[0]=xyz6[3]; xyzdot[1]=xyz6[4]; xyzdot[2]=xyz6[5];
1143+}
1144+
1145+void get_mars_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void* unused)
1146+{
1147+ Q_UNUSED(unused);
1148+ get_planet_helio_coordsv(jd, xyz, xyzdot, EPHEM_MARS_ID);
1149+}
1150+
1151+void get_jupiter_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void* unused)
1152+{
1153+ Q_UNUSED(unused);
1154+ get_planet_helio_coordsv(jd, xyz, xyzdot, EPHEM_JUPITER_ID);
1155+}
1156+
1157+void get_saturn_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void* unused)
1158+{
1159+ Q_UNUSED(unused);
1160+ get_planet_helio_coordsv(jd, xyz, xyzdot, EPHEM_SATURN_ID);
1161+}
1162+
1163+void get_uranus_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void* unused)
1164+{
1165+ Q_UNUSED(unused);
1166+ get_planet_helio_coordsv(jd, xyz, xyzdot, EPHEM_URANUS_ID);
1167+}
1168+
1169+void get_neptune_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void* unused)
1170+{
1171+ Q_UNUSED(unused);
1172+ get_planet_helio_coordsv(jd, xyz, xyzdot, EPHEM_NEPTUNE_ID);
1173+}
1174+
1175+void get_mercury_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3])
1176+{
1177+ get_planet_helio_osculating_coordsv(jd0, jd, xyz, xyzdot, EPHEM_MERCURY_ID);
1178+}
1179+
1180+void get_venus_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3])
1181+{
1182+ get_planet_helio_osculating_coordsv(jd0, jd, xyz, xyzdot, EPHEM_VENUS_ID);
1183+}
1184+
1185+void get_earth_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3])
1186+{
1187+ get_planet_helio_osculating_coordsv(jd0, jd, xyz, xyzdot, EPHEM_EMB_ID);
1188+}
1189+
1190+void get_mars_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3])
1191+{
1192+ get_planet_helio_osculating_coordsv(jd0, jd, xyz, xyzdot, EPHEM_MARS_ID);
1193+}
1194+
1195+void get_jupiter_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3])
1196+{
1197+ get_planet_helio_osculating_coordsv(jd0, jd, xyz, xyzdot, EPHEM_JUPITER_ID);
1198+}
1199+
1200+void get_saturn_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3])
1201+{
1202+ get_planet_helio_osculating_coordsv(jd0, jd, xyz, xyzdot, EPHEM_SATURN_ID);
1203+}
1204+
1205+void get_uranus_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3])
1206+{
1207+ get_planet_helio_osculating_coordsv(jd0, jd, xyz, xyzdot, EPHEM_URANUS_ID);
1208+}
1209+
1210+void get_neptune_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3])
1211+{
1212+ get_planet_helio_osculating_coordsv(jd0, jd, xyz, xyzdot, EPHEM_NEPTUNE_ID);
1213 }
1214
1215 /* Calculate the rectangular geocentric lunar coordinates to the inertial mean
1216@@ -300,129 +320,139 @@
1217 * Michelle Chapront-Touze and Jean Chapront of the Bureau des Longitudes,
1218 * Paris. ELP 2000-82B theory
1219 * param jd Julian day, rect pos */
1220-void get_lunar_parent_coordsv(double jde,double xyz[3], void* unused)
1221+void get_lunar_parent_coordsv(double jde, double xyz[3], double xyzdot[3], void* unused)
1222 {
1223 Q_UNUSED(unused);
1224+ double xyz6[6];
1225 bool deOk=false;
1226 if(use_de430(jde))
1227- deOk=GetDe430Coor(jde, EPHEM_JPL_MOON_ID, xyz, EPHEM_JPL_EARTH_ID);
1228+ deOk=GetDe430Coor(jde, EPHEM_JPL_MOON_ID, xyz6, EPHEM_JPL_EARTH_ID);
1229 else if(use_de431(jde))
1230- deOk=GetDe431Coor(jde, EPHEM_JPL_MOON_ID, xyz, EPHEM_JPL_EARTH_ID);
1231- if (!deOk) // fallback...
1232+ deOk=GetDe431Coor(jde, EPHEM_JPL_MOON_ID, xyz6, EPHEM_JPL_EARTH_ID);
1233+
1234+ if (deOk)
1235+ {
1236+ xyz[0] =xyz6[0]; xyz[1] =xyz6[1]; xyz[2] =xyz6[2];
1237+ xyzdot[0]=xyz6[3]; xyzdot[1]=xyz6[4]; xyzdot[2]=xyz6[5];
1238+ }
1239+ else
1240+ { // fallback to DE-less solution.
1241 GetElp82bCoor(jde,xyz);
1242-}
1243-
1244-void get_phobos_parent_coordsv(double jd,double xyz[3], void* unused)
1245-{
1246- Q_UNUSED(unused);
1247- GetMarsSatCoor(jd,MARS_SAT_PHOBOS,xyz);
1248-}
1249-
1250-void get_deimos_parent_coordsv(double jd,double xyz[3], void* unused)
1251-{
1252- Q_UNUSED(unused);
1253- GetMarsSatCoor(jd,MARS_SAT_DEIMOS,xyz);
1254-}
1255-
1256-void get_io_parent_coordsv(double jd,double xyz[3], void* unused)
1257-{
1258- Q_UNUSED(unused);
1259- GetL1Coor(jd,L1_IO,xyz);
1260-}
1261-
1262-void get_europa_parent_coordsv(double jd,double xyz[3], void* unused)
1263-{
1264- Q_UNUSED(unused);
1265- GetL1Coor(jd,L1_EUROPA,xyz);
1266-}
1267-
1268-void get_ganymede_parent_coordsv(double jd,double xyz[3], void* unused)
1269-{
1270- Q_UNUSED(unused);
1271- GetL1Coor(jd,L1_GANYMEDE,xyz);
1272-}
1273-
1274-void get_callisto_parent_coordsv(double jd,double xyz[3], void* unused)
1275-{
1276- Q_UNUSED(unused);
1277- GetL1Coor(jd,L1_CALLISTO,xyz);
1278-}
1279-
1280-void get_mimas_parent_coordsv(double jd,double xyz[3], void* unused)
1281-{
1282- Q_UNUSED(unused);
1283- GetTass17Coor(jd,TASS17_MIMAS,xyz);
1284-}
1285-
1286-void get_enceladus_parent_coordsv(double jd,double xyz[3], void* unused)
1287-{
1288- Q_UNUSED(unused);
1289- GetTass17Coor(jd,TASS17_ENCELADUS,xyz);
1290-}
1291-
1292-void get_tethys_parent_coordsv(double jd,double xyz[3], void* unused)
1293-{
1294- Q_UNUSED(unused);
1295- GetTass17Coor(jd,TASS17_TETHYS,xyz);
1296-}
1297-
1298-void get_dione_parent_coordsv(double jd,double xyz[3], void* unused)
1299-{
1300- Q_UNUSED(unused);
1301- GetTass17Coor(jd,TASS17_DIONE,xyz);
1302-}
1303-
1304-void get_rhea_parent_coordsv(double jd,double xyz[3], void* unused)
1305-{
1306- Q_UNUSED(unused);
1307- GetTass17Coor(jd,TASS17_RHEA,xyz);
1308-}
1309-
1310-void get_titan_parent_coordsv(double jd,double xyz[3], void* unused)
1311-{
1312- Q_UNUSED(unused);
1313- GetTass17Coor(jd,TASS17_TITAN,xyz);
1314-}
1315-
1316-void get_hyperion_parent_coordsv(double jd,double xyz[3], void* unused)
1317-{
1318- Q_UNUSED(unused);
1319- GetTass17Coor(jd,TASS17_HYPERION,xyz);
1320-}
1321-
1322-void get_iapetus_parent_coordsv(double jd,double xyz[3], void* unused)
1323-{
1324- Q_UNUSED(unused);
1325- GetTass17Coor(jd,TASS17_IAPETUS,xyz);
1326-}
1327-
1328-void get_miranda_parent_coordsv(double jd,double xyz[3], void* unused)
1329-{
1330- Q_UNUSED(unused);
1331- GetGust86Coor(jd,GUST86_MIRANDA,xyz);
1332-}
1333-
1334-void get_ariel_parent_coordsv(double jd,double xyz[3], void* unused)
1335-{
1336- Q_UNUSED(unused);
1337- GetGust86Coor(jd,GUST86_ARIEL,xyz);
1338-}
1339-
1340-void get_umbriel_parent_coordsv(double jd,double xyz[3], void* unused)
1341-{
1342- Q_UNUSED(unused);
1343- GetGust86Coor(jd,GUST86_UMBRIEL,xyz);
1344-}
1345-
1346-void get_titania_parent_coordsv(double jd,double xyz[3], void* unused)
1347-{
1348- Q_UNUSED(unused);
1349- GetGust86Coor(jd,GUST86_TITANIA,xyz);
1350-}
1351-
1352-void get_oberon_parent_coordsv(double jd,double xyz[3], void* unused)
1353-{
1354- Q_UNUSED(unused);
1355- GetGust86Coor(jd,GUST86_OBERON,xyz);
1356+ xyzdot[0]=xyzdot[1]=xyzdot[3]=0.0; // TODO: Some meaningful way to get speed?
1357+ }
1358+}
1359+
1360+void get_phobos_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1361+{
1362+ Q_UNUSED(unused);
1363+ GetMarsSatCoor(jd, MARS_SAT_PHOBOS, xyz, xyzdot);
1364+}
1365+
1366+void get_deimos_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1367+{
1368+ Q_UNUSED(unused);
1369+ GetMarsSatCoor(jd, MARS_SAT_DEIMOS, xyz, xyzdot);
1370+}
1371+
1372+void get_io_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1373+{
1374+ Q_UNUSED(unused);
1375+ GetL1Coor(jd, L1_IO, xyz, xyzdot);
1376+}
1377+
1378+void get_europa_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1379+{
1380+ Q_UNUSED(unused);
1381+ GetL1Coor(jd, L1_EUROPA, xyz, xyzdot);
1382+}
1383+
1384+void get_ganymede_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1385+{
1386+ Q_UNUSED(unused);
1387+ GetL1Coor(jd, L1_GANYMEDE, xyz, xyzdot);
1388+}
1389+
1390+void get_callisto_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1391+{
1392+ Q_UNUSED(unused);
1393+ GetL1Coor(jd, L1_CALLISTO, xyz, xyzdot);
1394+}
1395+
1396+void get_mimas_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1397+{
1398+ Q_UNUSED(unused);
1399+ GetTass17Coor(jd, TASS17_MIMAS, xyz, xyzdot);
1400+}
1401+
1402+void get_enceladus_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1403+{
1404+ Q_UNUSED(unused);
1405+ GetTass17Coor(jd, TASS17_ENCELADUS, xyz, xyzdot);
1406+}
1407+
1408+void get_tethys_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1409+{
1410+ Q_UNUSED(unused);
1411+ GetTass17Coor(jd, TASS17_TETHYS, xyz, xyzdot);
1412+}
1413+
1414+void get_dione_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1415+{
1416+ Q_UNUSED(unused);
1417+ GetTass17Coor(jd, TASS17_DIONE, xyz, xyzdot);
1418+}
1419+
1420+void get_rhea_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1421+{
1422+ Q_UNUSED(unused);
1423+ GetTass17Coor(jd, TASS17_RHEA, xyz, xyzdot);
1424+}
1425+
1426+void get_titan_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1427+{
1428+ Q_UNUSED(unused);
1429+ GetTass17Coor(jd, TASS17_TITAN, xyz, xyzdot);
1430+}
1431+
1432+void get_hyperion_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1433+{
1434+ Q_UNUSED(unused);
1435+ GetTass17Coor(jd, TASS17_HYPERION, xyz, xyzdot);
1436+}
1437+
1438+void get_iapetus_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1439+{
1440+ Q_UNUSED(unused);
1441+ GetTass17Coor(jd, TASS17_IAPETUS, xyz, xyzdot);
1442+}
1443+
1444+void get_miranda_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1445+{
1446+ Q_UNUSED(unused);
1447+ GetGust86Coor(jd, GUST86_MIRANDA, xyz, xyzdot);
1448+}
1449+
1450+void get_ariel_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1451+{
1452+ Q_UNUSED(unused);
1453+ GetGust86Coor(jd, GUST86_ARIEL, xyz, xyzdot);
1454+}
1455+
1456+void get_umbriel_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1457+{
1458+ Q_UNUSED(unused);
1459+ GetGust86Coor(jd, GUST86_UMBRIEL, xyz, xyzdot);
1460+}
1461+
1462+void get_titania_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1463+{
1464+ Q_UNUSED(unused);
1465+ GetGust86Coor(jd, GUST86_TITANIA, xyz, xyzdot);
1466+}
1467+
1468+void get_oberon_parent_coordsv(double jd, double xyz[3], double xyzdot[3], void* unused)
1469+{
1470+ Q_UNUSED(unused);
1471+ GetGust86Coor(jd, GUST86_OBERON, xyz, xyzdot);
1472 }
1473
1474
1475=== modified file 'src/core/planetsephems/EphemWrapper.hpp'
1476--- src/core/planetsephems/EphemWrapper.hpp 2017-05-28 00:31:46 +0000
1477+++ src/core/planetsephems/EphemWrapper.hpp 2017-11-23 14:55:50 +0000
1478@@ -26,7 +26,7 @@
1479 * - DE431
1480 *
1481 * Extending the old stellplanet-class, this updated version now
1482- * includes access to DE430 and DE431 for a more precise, yet storage-space intensive solution.
1483+ * includes access to DE430 and DE431 for a more accurate, yet storage-space intensive solution.
1484 */
1485
1486 #ifndef _EPHEMWRAPPER_HPP_
1487@@ -44,51 +44,51 @@
1488 };
1489
1490 // These functions have an unused void pointer to be compatible to PosFuncType in SolarSystem and Planet classes.
1491-void get_sun_helio_coordsv(double jd,double xyz[3], void*);
1492-void get_mercury_helio_coordsv(double jd,double xyz[3], void*);
1493-void get_venus_helio_coordsv(double jd,double xyz[3], void*);
1494-void get_earth_helio_coordsv(double jd,double xyz[3], void*);
1495-void get_mars_helio_coordsv(double jd,double xyz[3], void*);
1496-void get_jupiter_helio_coordsv(double jd,double xyz[3], void*);
1497-void get_saturn_helio_coordsv(double jd,double xyz[3], void*);
1498-void get_uranus_helio_coordsv(double jd,double xyz[3], void*);
1499-void get_neptune_helio_coordsv(double jd,double xyz[3], void*);
1500-void get_pluto_helio_coordsv(double jd,double xyz[3], void*);
1501-
1502-void get_mercury_helio_osculating_coords(double jd0,double jd,double xyz[3]);
1503-void get_venus_helio_osculating_coords(double jd0,double jd,double xyz[3]);
1504-void get_earth_helio_osculating_coords(double jd0,double jd,double xyz[3]);
1505-void get_mars_helio_osculating_coords(double jd0,double jd,double xyz[3]);
1506-void get_jupiter_helio_osculating_coords(double jd0,double jd,double xyz[3]);
1507-void get_saturn_helio_osculating_coords(double jd0,double jd,double xyz[3]);
1508-void get_uranus_helio_osculating_coords(double jd0,double jd,double xyz[3]);
1509-void get_neptune_helio_osculating_coords(double jd0,double jd,double xyz[3]);
1510-void get_pluto_helio_osculating_coords(double jd0,double jd,double xyz[3]);
1511-
1512-void get_lunar_parent_coordsv(double jde, double xyz[3], void*);
1513-
1514-void get_phobos_parent_coordsv(double jd,double xyz[3], void*);
1515-void get_deimos_parent_coordsv(double jd,double xyz[3], void*);
1516-
1517-void get_io_parent_coordsv(double jd,double xyz[3], void*);
1518-void get_europa_parent_coordsv(double jd,double xyz[3], void*);
1519-void get_ganymede_parent_coordsv(double jd,double xyz[3], void*);
1520-void get_callisto_parent_coordsv(double jd,double xyz[3], void*);
1521-
1522-void get_mimas_parent_coordsv(double jd,double xyz[3], void*);
1523-void get_enceladus_parent_coordsv(double jd,double xyz[3], void*);
1524-void get_tethys_parent_coordsv(double jd,double xyz[3], void*);
1525-void get_dione_parent_coordsv(double jd,double xyz[3], void*);
1526-void get_rhea_parent_coordsv(double jd,double xyz[3], void*);
1527-void get_titan_parent_coordsv(double jd,double xyz[3], void*);
1528-void get_hyperion_parent_coordsv(double jd,double xyz[3], void*);
1529-void get_iapetus_parent_coordsv(double jd,double xyz[3], void*);
1530-
1531-void get_miranda_parent_coordsv(double jd,double xyz[3], void*);
1532-void get_ariel_parent_coordsv(double jd,double xyz[3], void*);
1533-void get_umbriel_parent_coordsv(double jd,double xyz[3], void*);
1534-void get_titania_parent_coordsv(double jd,double xyz[3], void*);
1535-void get_oberon_parent_coordsv(double jd,double xyz[3], void*);
1536+void get_sun_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1537+void get_mercury_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1538+void get_venus_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1539+void get_earth_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1540+void get_mars_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1541+void get_jupiter_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1542+void get_saturn_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1543+void get_uranus_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1544+void get_neptune_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1545+void get_pluto_helio_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1546+
1547+void get_mercury_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3]);
1548+void get_venus_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3]);
1549+void get_earth_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3]);
1550+void get_mars_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3]);
1551+void get_jupiter_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3]);
1552+void get_saturn_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3]);
1553+void get_uranus_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3]);
1554+void get_neptune_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3]);
1555+void get_pluto_helio_osculating_coords(double jd0,double jd,double xyz[3], double xyzdot[3]);
1556+
1557+void get_lunar_parent_coordsv(double jde, double xyz[3], double xyzdot[3], void*);
1558+
1559+void get_phobos_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1560+void get_deimos_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1561+
1562+void get_io_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1563+void get_europa_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1564+void get_ganymede_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1565+void get_callisto_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1566+
1567+void get_mimas_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1568+void get_enceladus_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1569+void get_tethys_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1570+void get_dione_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1571+void get_rhea_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1572+void get_titan_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1573+void get_hyperion_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1574+void get_iapetus_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1575+
1576+void get_miranda_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1577+void get_ariel_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1578+void get_umbriel_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1579+void get_titania_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1580+void get_oberon_parent_coordsv(double jd,double xyz[3], double xyzdot[3], void*);
1581
1582 #endif // _EPHEMWRAPPER_HPP_
1583
1584
1585=== modified file 'src/core/planetsephems/de430.cpp'
1586--- src/core/planetsephems/de430.cpp 2016-08-18 13:45:26 +0000
1587+++ src/core/planetsephems/de430.cpp 2017-11-23 14:55:50 +0000
1588@@ -36,8 +36,10 @@
1589
1590 static void * ephem;
1591
1592-static Vec3d tempECL = Vec3d(0,0,0);
1593-static Vec3d tempICRF = Vec3d(0,0,0);
1594+static Vec3d tempECLpos = Vec3d(0,0,0);
1595+static Vec3d tempECLspd = Vec3d(0,0,0);
1596+static Vec3d tempICRFpos = Vec3d(0,0,0);
1597+static Vec3d tempICRFspd = Vec3d(0,0,0);
1598 static char nams[JPL_MAX_N_CONSTANTS][6];
1599 static double vals[JPL_MAX_N_CONSTANTS];
1600 static double tempXYZ[6];
1601@@ -79,7 +81,7 @@
1602 if(initDone)
1603 {
1604 // This may return some error code!
1605- int jplresult=jpl_pleph(ephem, jde, planet_id, centralBody_id, tempXYZ, 0);
1606+ int jplresult=jpl_pleph(ephem, jde, planet_id, centralBody_id, tempXYZ, 1);
1607
1608 switch (jplresult)
1609 {
1610@@ -111,18 +113,25 @@
1611 break;
1612 }
1613
1614- jpl_pleph(ephem, jde, planet_id, centralBody_id, tempXYZ, 0);
1615+ // Why do we duplicate this?
1616+ // jpl_pleph(ephem, jde, planet_id, centralBody_id, tempXYZ, 0);
1617
1618- tempICRF = Vec3d(tempXYZ[0], tempXYZ[1], tempXYZ[2]);
1619+ tempICRFpos = Vec3d(tempXYZ[0], tempXYZ[1], tempXYZ[2]);
1620+ tempICRFspd = Vec3d(tempXYZ[3], tempXYZ[4], tempXYZ[5]);
1621 #ifdef UNIT_TEST
1622- tempECL = matJ2000ToVsop87 * tempICRF;
1623+ tempECLpos = matJ2000ToVsop87 * tempICRFpos;
1624+ tempECLspd = matJ2000ToVsop87 * tempICRFspd;
1625 #else
1626- tempECL = StelCore::matJ2000ToVsop87 * tempICRF;
1627+ tempECLpos = StelCore::matJ2000ToVsop87 * tempICRFpos;
1628+ tempECLspd = StelCore::matJ2000ToVsop87 * tempICRFspd;
1629 #endif
1630
1631- xyz[0] = tempECL[0];
1632- xyz[1] = tempECL[1];
1633- xyz[2] = tempECL[2];
1634+ xyz[0] = tempECLpos[0];
1635+ xyz[1] = tempECLpos[1];
1636+ xyz[2] = tempECLpos[2];
1637+ xyz[3] = tempECLspd[0];
1638+ xyz[4] = tempECLspd[1];
1639+ xyz[5] = tempECLspd[2];
1640 return true;
1641 }
1642 return false;
1643
1644=== modified file 'src/core/planetsephems/de431.cpp'
1645--- src/core/planetsephems/de431.cpp 2016-08-18 13:45:26 +0000
1646+++ src/core/planetsephems/de431.cpp 2017-11-23 14:55:50 +0000
1647@@ -37,8 +37,10 @@
1648
1649 static void * ephem;
1650
1651-static Vec3d tempECL = Vec3d(0,0,0);
1652-static Vec3d tempICRF = Vec3d(0,0,0);
1653+static Vec3d tempECLpos = Vec3d(0,0,0);
1654+static Vec3d tempECLspd = Vec3d(0,0,0);
1655+static Vec3d tempICRFpos = Vec3d(0,0,0);
1656+static Vec3d tempICRFspd = Vec3d(0,0,0);
1657 static char nams[JPL_MAX_N_CONSTANTS][6];
1658 static double vals[JPL_MAX_N_CONSTANTS];
1659 static double tempXYZ[6];
1660@@ -80,7 +82,7 @@
1661 if(initDone)
1662 {
1663 // This may return some error code!
1664- int jplresult=jpl_pleph(ephem, jde, planet_id, centralBody_id, tempXYZ, 0);
1665+ int jplresult=jpl_pleph(ephem, jde, planet_id, centralBody_id, tempXYZ, 1);
1666
1667 switch (jplresult)
1668 {
1669@@ -112,16 +114,22 @@
1670 break;
1671 }
1672
1673- tempICRF = Vec3d(tempXYZ[0], tempXYZ[1], tempXYZ[2]);
1674+ tempICRFpos = Vec3d(tempXYZ[0], tempXYZ[1], tempXYZ[2]);
1675+ tempICRFspd = Vec3d(tempXYZ[3], tempXYZ[4], tempXYZ[5]);
1676 #ifdef UNIT_TEST
1677- tempECL = matJ2000ToVsop87 * tempICRF;
1678+ tempECLpos = matJ2000ToVsop87 * tempICRFpos;
1679+ tempECLspd = matJ2000ToVsop87 * tempICRFspd;
1680 #else
1681- tempECL = StelCore::matJ2000ToVsop87 * tempICRF;
1682+ tempECLpos = StelCore::matJ2000ToVsop87 * tempICRFpos;
1683+ tempECLspd = StelCore::matJ2000ToVsop87 * tempICRFspd;
1684 #endif
1685
1686- xyz[0] = tempECL[0];
1687- xyz[1] = tempECL[1];
1688- xyz[2] = tempECL[2];
1689+ xyz[0] = tempECLpos[0];
1690+ xyz[1] = tempECLpos[1];
1691+ xyz[2] = tempECLpos[2];
1692+ xyz[3] = tempECLspd[0];
1693+ xyz[4] = tempECLspd[1];
1694+ xyz[5] = tempECLspd[2];
1695 return true;
1696 }
1697 return false;
1698
1699=== modified file 'src/core/planetsephems/elliptic_to_rectangular.c'
1700--- src/core/planetsephems/elliptic_to_rectangular.c 2017-08-05 14:14:24 +0000
1701+++ src/core/planetsephems/elliptic_to_rectangular.c 2017-11-23 14:55:50 +0000
1702@@ -116,7 +116,7 @@
1703 xyz[1] = x1 * rdg + y1 * rtq;
1704 xyz[2] = (-x1 * elem[5] + y1 * elem[4]) * dwho;
1705
1706-/*
1707+// /* GZ 2017-11: Re-enable these lines, they seem to be velocity!
1708 const double rsam1 = -elem[2]*cLe - elem[3]*sLe;
1709 const double h = a*n / (1.0 + rsam1);
1710 const double vx1 = h * (-sLe - psi*rsam1*elem[3]);
1711@@ -125,7 +125,7 @@
1712 xyz[3] = vx1 * rtp + vy1 * rdg;
1713 xyz[4] = vx1 * rdg + vy1 * rtq;
1714 xyz[5] = (-vx1 * elem[5] + vy1 * elem[4]) * dwho;
1715-*/
1716+// */
1717 }
1718 }
1719
1720
1721=== modified file 'src/core/planetsephems/elliptic_to_rectangular.h'
1722--- src/core/planetsephems/elliptic_to_rectangular.h 2017-08-05 14:14:24 +0000
1723+++ src/core/planetsephems/elliptic_to_rectangular.h 2017-11-23 14:55:50 +0000
1724@@ -65,6 +65,11 @@
1725 e = excentricity
1726
1727 Units are suspected to be: Julian days, AU, rad
1728+
1729+ Results:
1730+ xyz[0,1,2]=Position [AU]
1731+ xyz[3,4,5]=Velocity [AU/d]
1732+
1733 */
1734
1735 void EllipticToRectangularN(double mu,const double elem[6],double dt,
1736
1737=== modified file 'src/core/planetsephems/gust86.c'
1738--- src/core/planetsephems/gust86.c 2017-08-05 14:14:24 +0000
1739+++ src/core/planetsephems/gust86.c 2017-11-23 14:55:50 +0000
1740@@ -438,13 +438,16 @@
1741 static double gust86_jd0 = -1e100;
1742 static double gust86_elem[GUST86_DIM];
1743
1744-void GetGust86Coor(const double jd,const int body,double *xyz) {
1745- GetGust86OsculatingCoor(jd,jd,body,xyz);
1746+void GetGust86Coor(const double jd, const int body, double *xyz, double *xyzdot) {
1747+ double xyz6[6];
1748+ GetGust86OsculatingCoor(jd,jd,body,xyz6);
1749+ xyz[0] =xyz6[0]; xyz[1] =xyz6[1]; xyz[2] =xyz6[2];
1750+ xyzdot[0]=xyz6[3]; xyzdot[1]=xyz6[4]; xyzdot[2]=xyz6[5];
1751 }
1752
1753 void GetGust86OsculatingCoor(const double jd0,const double jd,
1754 const int body,double *xyz) {
1755- double x[3];
1756+ double x[6];
1757 if (jd0 != gust86_jd0) {
1758 const double t0 = jd0 - 2444239.5;
1759 gust86_jd0 = jd0;
1760@@ -465,4 +468,8 @@
1761 xyz[0] = GUST86toVsop87[0]*x[0]+GUST86toVsop87[1]*x[1]+GUST86toVsop87[2]*x[2];
1762 xyz[1] = GUST86toVsop87[3]*x[0]+GUST86toVsop87[4]*x[1]+GUST86toVsop87[5]*x[2];
1763 xyz[2] = GUST86toVsop87[6]*x[0]+GUST86toVsop87[7]*x[1]+GUST86toVsop87[8]*x[2];
1764+ // GZ Updated to a 6-vector
1765+ xyz[3] = GUST86toVsop87[0]*x[3]+GUST86toVsop87[1]*x[4]+GUST86toVsop87[2]*x[5];
1766+ xyz[4] = GUST86toVsop87[3]*x[3]+GUST86toVsop87[4]*x[4]+GUST86toVsop87[5]*x[5];
1767+ xyz[5] = GUST86toVsop87[6]*x[3]+GUST86toVsop87[7]*x[4]+GUST86toVsop87[8]*x[5];
1768 }
1769
1770=== modified file 'src/core/planetsephems/gust86.h'
1771--- src/core/planetsephems/gust86.h 2017-08-05 14:14:24 +0000
1772+++ src/core/planetsephems/gust86.h 2017-11-23 14:55:50 +0000
1773@@ -60,7 +60,7 @@
1774 #define GUST86_TITANIA 3
1775 #define GUST86_OBERON 4
1776
1777-void GetGust86Coor(const double jd, const int body, double *xyz);
1778+void GetGust86Coor(const double jd, const int body, double *xyz, double *xyzdot);
1779 /* Return the rectangular coordinates of the given satellite
1780 and the given julian date jd expressed in dynamical time (TAI+32.184s).
1781 The origin of the xyz-coordinates is the center of the planet.
1782@@ -91,6 +91,7 @@
1783
1784 void GetGust86OsculatingCoor(const double jd0, const double jd, const int body, double *xyz);
1785 /* The oculating orbit of epoch jd0, evaluated at jd, is returned.
1786+ * xyz is a 6-vector (position&speed)
1787 */
1788
1789 #ifdef __cplusplus
1790
1791=== modified file 'src/core/planetsephems/l1.c'
1792--- src/core/planetsephems/l1.c 2017-08-05 14:14:24 +0000
1793+++ src/core/planetsephems/l1.c 2017-11-23 14:55:50 +0000
1794@@ -997,13 +997,16 @@
1795 CalcL1Elem(t,ugly_static_parameter_body,elem);
1796 }
1797
1798-void GetL1Coor(double jd,int body,double *xyz) {
1799- GetL1OsculatingCoor(jd,jd,body,xyz);
1800+void GetL1Coor(double jd, int body, double *xyz, double *xyzdot) {
1801+ double xyz6[6];
1802+ GetL1OsculatingCoor(jd,jd,body,xyz6);
1803+ xyz[0] =xyz6[0]; xyz[1] =xyz6[1]; xyz[2] =xyz6[2];
1804+ xyzdot[0]=xyz6[3]; xyzdot[1]=xyz6[4]; xyzdot[2]=xyz6[5];
1805 }
1806
1807 void GetL1OsculatingCoor(const double jd0,const double jd,
1808 const int body,double *xyz) {
1809- double x[3];
1810+ double x[6];
1811 if (jd0 != l1_jd0[body]) {
1812 const double t0 = jd0 - 2433282.5;
1813 l1_jd0[body] = jd0;
1814@@ -1018,4 +1021,8 @@
1815 xyz[0] = L1toVsop87[0]*x[0]+L1toVsop87[1]*x[1]+L1toVsop87[2]*x[2];
1816 xyz[1] = L1toVsop87[3]*x[0]+L1toVsop87[4]*x[1]+L1toVsop87[5]*x[2];
1817 xyz[2] = L1toVsop87[6]*x[0]+L1toVsop87[7]*x[1]+L1toVsop87[8]*x[2];
1818+ // GZ Pure guesswork. I hope these make sense...
1819+ xyz[3] = L1toVsop87[0]*x[3]+L1toVsop87[1]*x[4]+L1toVsop87[2]*x[5];
1820+ xyz[4] = L1toVsop87[3]*x[3]+L1toVsop87[4]*x[4]+L1toVsop87[5]*x[5];
1821+ xyz[5] = L1toVsop87[6]*x[3]+L1toVsop87[7]*x[4]+L1toVsop87[8]*x[5];
1822 }
1823
1824=== modified file 'src/core/planetsephems/l1.h'
1825--- src/core/planetsephems/l1.h 2017-08-05 14:14:24 +0000
1826+++ src/core/planetsephems/l1.h 2017-11-23 14:55:50 +0000
1827@@ -56,19 +56,22 @@
1828 #define L1_GANYMEDE 2
1829 #define L1_CALLISTO 3
1830
1831-void GetL1Coor(double jd,int body,double *xyz);
1832+void GetL1Coor(double jd,int body,double *xyz, double *xyzdot);
1833 /* Return the rectangular coordinates of the given satellite
1834 and the given julian date jd expressed in dynamical time (TAI+32.184s).
1835 The origin of the xyz-coordinates is the center of the planet.
1836 The reference frame is "dynamical equinox and ecliptic J2000",
1837 which is the reference frame in VSOP87 and VSOP87A.
1838
1839+ GZ2017-11: added xyzdot, now last 2 parameters should be 3-vectors of position and speed.
1840+
1841 WARNING! Due to static internal variables, this function is not reentrant and not parallelizable!
1842 */
1843
1844 void GetL1OsculatingCoor(const double jd0,const double jd, const int body,double *xyz);
1845
1846 /* The oculating orbit of epoch jd0, evaluated at jd, is returned.
1847+ GZ2017-11: xyz now is a 6-vector of position and speed.
1848 */
1849
1850
1851
1852=== modified file 'src/core/planetsephems/marssat.c'
1853--- src/core/planetsephems/marssat.c 2017-08-05 14:14:24 +0000
1854+++ src/core/planetsephems/marssat.c 2017-11-23 14:55:50 +0000
1855@@ -428,13 +428,16 @@
1856
1857 static double mars_sat_to_vsop87[9];
1858
1859-void GetMarsSatCoor(double jd,int body,double *xyz) {
1860- GetMarsSatOsculatingCoor(jd,jd,body,xyz);
1861+void GetMarsSatCoor(double jd,int body,double *xyz, double *xyzdot) {
1862+ double xyz6[6];
1863+ GetMarsSatOsculatingCoor(jd,jd,body,xyz6);
1864+ xyz[0] =xyz6[0]; xyz[1] =xyz6[1]; xyz[2] =xyz6[2];
1865+ xyzdot[0]=xyz6[3]; xyzdot[1]=xyz6[4]; xyzdot[2]=xyz6[5];
1866 }
1867
1868 void GetMarsSatOsculatingCoor(const double jd0,const double jd,
1869 const int body,double *xyz) {
1870- double x[3];
1871+ double x[6];
1872 if (jd0 != marssat_jd0) {
1873 const double t0 = jd0 - 2451545.0 + 6491.5;
1874 marssat_jd0 = jd0;
1875@@ -445,8 +448,7 @@
1876 &t_2,marssat_elem_2);
1877 GenerateMarsSatToVSOP87(t0,mars_sat_to_vsop87);
1878 }
1879- EllipticToRectangularA(mars_sat_bodies[body].mu,marssat_elem+(body*6),
1880- jd-jd0,x);
1881+ EllipticToRectangularA(mars_sat_bodies[body].mu,marssat_elem+(body*6),jd-jd0,x);
1882 xyz[0] = mars_sat_to_vsop87[0]*x[0]
1883 + mars_sat_to_vsop87[1]*x[1]
1884 + mars_sat_to_vsop87[2]*x[2];
1885@@ -456,6 +458,16 @@
1886 xyz[2] = mars_sat_to_vsop87[6]*x[0]
1887 + mars_sat_to_vsop87[7]*x[1]
1888 + mars_sat_to_vsop87[8]*x[2];
1889+ // GZ This is a guess, based on the structure of other operations...
1890+ xyz[3] = mars_sat_to_vsop87[0]*x[3]
1891+ + mars_sat_to_vsop87[1]*x[4]
1892+ + mars_sat_to_vsop87[2]*x[5];
1893+ xyz[4] = mars_sat_to_vsop87[3]*x[3]
1894+ + mars_sat_to_vsop87[4]*x[4]
1895+ + mars_sat_to_vsop87[5]*x[5];
1896+ xyz[5] = mars_sat_to_vsop87[6]*x[3]
1897+ + mars_sat_to_vsop87[7]*x[4]
1898+ + mars_sat_to_vsop87[8]*x[5];
1899 /*
1900 printf("%d %18.9lf %15.12lf %15.12lf %15.12lf\n",
1901 body,jd,xyz[0],xyz[1],xyz[2]);
1902
1903=== modified file 'src/core/planetsephems/marssat.h'
1904--- src/core/planetsephems/marssat.h 2017-08-05 14:14:24 +0000
1905+++ src/core/planetsephems/marssat.h 2017-11-23 14:55:50 +0000
1906@@ -58,8 +58,8 @@
1907 #define MARS_SAT_PHOBOS 0
1908 #define MARS_SAT_DEIMOS 1
1909
1910-void GetMarsSatCoor(double jd,int body,double *xyz);
1911- /* Return the rectangular coordinates of the given satellite
1912+void GetMarsSatCoor(double jd, int body, double *xyz, double *xyzdot);
1913+ /* Return the rectangular coordinates and speed of the given satellite
1914 and the given julian date jd expressed in dynamical time (TAI+32.184s).
1915 The origin of the xyz-coordinates is the center of the planet.
1916 The reference frame is "dynamical equinox and ecliptic J2000",
1917@@ -68,6 +68,7 @@
1918
1919 void GetMarsSatOsculatingCoor(const double jd0, const double jd, const int body,double *xyz);
1920 /* The oculating orbit of epoch jd0, evatuated at jd, is returned.
1921+ * xyz is a 6-vector
1922 */
1923
1924 #ifdef __cplusplus
1925
1926=== modified file 'src/core/planetsephems/tass17.c'
1927--- src/core/planetsephems/tass17.c 2017-08-05 14:14:24 +0000
1928+++ src/core/planetsephems/tass17.c 2017-11-23 14:55:50 +0000
1929@@ -3163,14 +3163,17 @@
1930 for (body=0;body<=7;body++) CalcTass17Elem(t,lon,body,elem+(body*6));
1931 }
1932
1933-void GetTass17Coor(double jd,int body,double *xyz)
1934+void GetTass17Coor(double jd,int body,double *xyz, double *xyzdot)
1935 {
1936- GetTass17OsculatingCoor(jd,jd,body,xyz);
1937+ double xyz6[6];
1938+ GetTass17OsculatingCoor(jd,jd,body,xyz6);
1939+ xyz[0] =xyz6[0]; xyz[1] =xyz6[1]; xyz[2] =xyz6[2];
1940+ xyzdot[0]=xyz6[3]; xyzdot[1]=xyz6[4]; xyzdot[2]=xyz6[5];
1941 }
1942
1943 void GetTass17OsculatingCoor(const double jd0,const double jd, const int body,double *xyz)
1944 {
1945- double x[3];
1946+ double x[6];
1947 if (jd0 != tass17_jd0)
1948 {
1949 const double t0 = jd0 - 2444240.0;
1950@@ -3192,6 +3195,10 @@
1951 xyz[0] = TASS17toVSOP87[0]*x[0]+TASS17toVSOP87[1]*x[1]+TASS17toVSOP87[2]*x[2];
1952 xyz[1] = TASS17toVSOP87[3]*x[0]+TASS17toVSOP87[4]*x[1]+TASS17toVSOP87[5]*x[2];
1953 xyz[2] = TASS17toVSOP87[6]*x[0]+TASS17toVSOP87[7]*x[1]+TASS17toVSOP87[8]*x[2];
1954+ // GZ Updated to a 6-vector including speed...
1955+ xyz[3] = TASS17toVSOP87[0]*x[3]+TASS17toVSOP87[1]*x[4]+TASS17toVSOP87[2]*x[5];
1956+ xyz[4] = TASS17toVSOP87[3]*x[3]+TASS17toVSOP87[4]*x[4]+TASS17toVSOP87[5]*x[5];
1957+ xyz[5] = TASS17toVSOP87[6]*x[3]+TASS17toVSOP87[7]*x[4]+TASS17toVSOP87[8]*x[5];
1958 }
1959
1960
1961
1962=== modified file 'src/core/planetsephems/tass17.h'
1963--- src/core/planetsephems/tass17.h 2017-08-05 14:14:24 +0000
1964+++ src/core/planetsephems/tass17.h 2017-11-23 14:55:50 +0000
1965@@ -66,7 +66,9 @@
1966 #define TASS17_HYPERION 7
1967 #define TASS17_IAPETUS 6
1968
1969-void GetTass17Coor(double jd,int body,double *xyz);
1970+// xyz and xyzdot are 3-vectors (position&speed)
1971+void GetTass17Coor(double jd, int body, double *xyz, double *xyzdot);
1972+// xyz is a 6-vector (position&speed)
1973 void GetTass17OsculatingCoor(const double jd0,const double jd, const int body,double *xyz);
1974
1975 #ifdef __cplusplus
1976
1977=== modified file 'src/core/planetsephems/vsop87.c'
1978--- src/core/planetsephems/vsop87.c 2017-08-05 14:14:24 +0000
1979+++ src/core/planetsephems/vsop87.c 2017-11-23 14:55:50 +0000
1980@@ -137338,8 +137338,7 @@
1981 GetVsop87OsculatingCoor(jd,jd,body,xyz);
1982 }
1983
1984-void GetVsop87OsculatingCoor(const double jd0,const double jd,
1985- const int body,double *xyz) {
1986+void GetVsop87OsculatingCoor(const double jd0,const double jd,const int body,double *xyz) {
1987 if (jd0 != vsop87_jd0) {
1988 const double t0 = (jd0 - 2451545.0) / 365250.0;
1989 vsop87_jd0 = jd0;
1990
1991=== modified file 'src/gui/ConfigurationDialog.cpp'
1992--- src/gui/ConfigurationDialog.cpp 2017-10-29 10:34:00 +0000
1993+++ src/gui/ConfigurationDialog.cpp 2017-11-23 14:55:50 +0000
1994@@ -195,11 +195,9 @@
1995 // Additional settings for selected object info
1996 connectBoolProperty(ui->checkBoxUMSurfaceBrightness, "NebulaMgr.flagSurfaceBrightnessArcsecUsage");
1997 connectBoolProperty(ui->checkBoxUMShortNotationSurfaceBrightness, "NebulaMgr.flagSurfaceBrightnessShortNotationUsage");
1998- ui->checkBoxUseFormattingOutput->setChecked(StelApp::getInstance().getFlagUseFormattingOutput());
1999- connect(ui->checkBoxUseFormattingOutput, SIGNAL(toggled(bool)), this, SLOT(updateSettingFormattingOutput(bool)));
2000- ui->checkBoxUseCCSDesignations->setChecked(StelApp::getInstance().getFlagUseCCSDesignation());
2001- connect(ui->checkBoxUseCCSDesignations, SIGNAL(toggled(bool)), this, SLOT(updateSettingCCSDesignations(bool)));
2002-
2003+ connectBoolProperty(ui->checkBoxUseFormattingOutput, "StelApp.flagUseFormattingOutput");
2004+ connectBoolProperty(ui->checkBoxUseCCSDesignations, "StelApp.flagUseCCSDesignation");
2005+
2006 connect(ui->noSelectedInfoRadio, SIGNAL(released()), this, SLOT(setNoSelectedInfo()));
2007 connect(ui->allSelectedInfoRadio, SIGNAL(released()), this, SLOT(setAllSelectedInfo()));
2008 connect(ui->briefSelectedInfoRadio, SIGNAL(released()), this, SLOT(setBriefSelectedInfo()));
2009@@ -223,6 +221,7 @@
2010 ui->fixedDateTimeEdit->setDateTime(StelUtils::jdToQDateTime(core->getPresetSkyTime()));
2011 connect(ui->fixedDateTimeEdit, SIGNAL(dateTimeChanged(QDateTime)), core, SLOT(setPresetSkyTime(QDateTime)));
2012
2013+ // TODO: convert to properties
2014 ui->enableKeysNavigationCheckBox->setChecked(mvmgr->getFlagEnableMoveKeys() || mvmgr->getFlagEnableZoomKeys());
2015 ui->enableMouseNavigationCheckBox->setChecked(mvmgr->getFlagEnableMouseNavigation());
2016 connect(ui->enableKeysNavigationCheckBox, SIGNAL(toggled(bool)), mvmgr, SLOT(setFlagEnableMoveKeys(bool)));
2017@@ -284,46 +283,31 @@
2018 connect(ui->diskViewportCheckbox, SIGNAL(toggled(bool)), this, SLOT(setDiskViewport(bool)));
2019 connectBoolProperty(ui->autoZoomResetsDirectionCheckbox, "StelMovementMgr.flagAutoZoomOutResetsDirection");
2020
2021- ui->showFlipButtonsCheckbox->setChecked(gui->getFlagShowFlipButtons());
2022- connect(ui->showFlipButtonsCheckbox, SIGNAL(toggled(bool)), gui, SLOT(setFlagShowFlipButtons(bool)));
2023-
2024- ui->showNebulaBgButtonCheckbox->setChecked(gui->getFlagShowNebulaBackgroundButton());
2025- connect(ui->showNebulaBgButtonCheckbox, SIGNAL(toggled(bool)), gui, SLOT(setFlagShowNebulaBackgroundButton(bool)));
2026-
2027- ui->showToastSurveyButtonCheckbox->setChecked(gui->getFlagShowToastSurveyButton());
2028- connect(ui->showToastSurveyButtonCheckbox, SIGNAL(toggled(bool)), gui, SLOT(setFlagShowToastSurveyButton(bool)));
2029-
2030- ui->showBookmarksButtonCheckBox->setChecked(gui->getFlagShowBookmarksButton());
2031- connect(ui->showBookmarksButtonCheckBox, SIGNAL(toggled(bool)), gui, SLOT(setFlagShowBookmarksButton(bool)));
2032-
2033- ui->showICRSGridButtonCheckBox->setChecked(gui->getFlagShowICRSGridButton());
2034- connect(ui->showICRSGridButtonCheckBox, SIGNAL(toggled(bool)), gui, SLOT(setFlagShowICRSGridButton(bool)));
2035-
2036- ui->showGalacticGridButtonCheckBox->setChecked(gui->getFlagShowGalacticGridButton());
2037- connect(ui->showGalacticGridButtonCheckBox, SIGNAL(toggled(bool)), gui, SLOT(setFlagShowGalacticGridButton(bool)));
2038-
2039- ui->showEclipticGridButtonCheckBox->setChecked(gui->getFlagShowEclipticGridButton());
2040- connect(ui->showEclipticGridButtonCheckBox, SIGNAL(toggled(bool)), gui, SLOT(setFlagShowEclipticGridButton(bool)));
2041-
2042- ui->showConstellationBoundariesButtonCheckBox->setChecked(gui->getFlagShowConstellationBoundariesButton());
2043- connect(ui->showConstellationBoundariesButtonCheckBox, SIGNAL(toggled(bool)), gui, SLOT(setFlagShowConstellationBoundariesButton(bool)));
2044-
2045- ui->decimalDegreeCheckBox->setChecked(StelApp::getInstance().getFlagShowDecimalDegrees());
2046- connect(ui->decimalDegreeCheckBox, SIGNAL(toggled(bool)), gui, SLOT(setFlagShowDecimalDegrees(bool)));
2047- ui->azimuthFromSouthcheckBox->setChecked(StelApp::getInstance().getFlagSouthAzimuthUsage());
2048- connect(ui->azimuthFromSouthcheckBox, SIGNAL(toggled(bool)), this, SLOT(updateStartPointForAzimuth(bool)));
2049-
2050- ui->mouseTimeoutCheckbox->setChecked(StelMainView::getInstance().getFlagCursorTimeout());
2051- ui->mouseTimeoutSpinBox->setValue(StelMainView::getInstance().getCursorTimeout());
2052- connect(ui->mouseTimeoutCheckbox, SIGNAL(clicked()), this, SLOT(cursorTimeOutChanged()));
2053- connect(ui->mouseTimeoutCheckbox, SIGNAL(toggled(bool)), this, SLOT(cursorTimeOutChanged()));
2054- connect(ui->mouseTimeoutSpinBox, SIGNAL(valueChanged(double)), this, SLOT(cursorTimeOutChanged(double)));
2055-
2056- ui->useButtonsBackgroundCheckBox->setChecked(StelMainView::getInstance().getFlagUseButtonsBackground());
2057- connect(ui->useButtonsBackgroundCheckBox, SIGNAL(toggled(bool)), this, SLOT(usageButtonsBackgroundChanged(bool)));
2058-
2059- ui->indicationMountModeCheckBox->setChecked(mvmgr->getFlagIndicationMountMode());
2060- connect(ui->indicationMountModeCheckBox, SIGNAL(toggled(bool)), mvmgr, SLOT(setFlagIndicationMountMode(bool)));
2061+ connectBoolProperty(ui->showFlipButtonsCheckbox, "StelGui.flagShowFlipButtons");
2062+ connectBoolProperty(ui->showNebulaBgButtonCheckbox, "StelGui.flagShowNebulaBackgroundButton");
2063+ connectBoolProperty(ui->showToastSurveyButtonCheckbox, "StelGui.flagShowToastSurveyButton");
2064+ connectBoolProperty(ui->showBookmarksButtonCheckBox, "StelGui.flagShowBookmarksButton");
2065+ connectBoolProperty(ui->showICRSGridButtonCheckBox, "StelGui.flagShowICRSGridButton");
2066+ connectBoolProperty(ui->showGalacticGridButtonCheckBox, "StelGui.flagShowGalacticGridButton");
2067+ connectBoolProperty(ui->showEclipticGridButtonCheckBox, "StelGui.flagShowEclipticGridButton");
2068+ connectBoolProperty(ui->showConstellationBoundariesButtonCheckBox, "StelGui.flagShowConstellationBoundariesButton");
2069+
2070+ //ui->decimalDegreeCheckBox->setChecked(StelApp::getInstance().getFlagShowDecimalDegrees());
2071+ //connect(ui->decimalDegreeCheckBox, SIGNAL(toggled(bool)), gui, SLOT(setFlagShowDecimalDegrees(bool)));
2072+ // TODO: Make sure to remove this setter function, rather listen to StelApp's signal.
2073+ connectBoolProperty(ui->decimalDegreeCheckBox, "StelApp.flagShowDecimalDegrees");
2074+
2075+ connectBoolProperty(ui->azimuthFromSouthcheckBox, "StelApp.flagUseAzimuthFromSouth");
2076+
2077+ //ui->mouseTimeoutCheckbox->setChecked(StelMainView::getInstance().getFlagCursorTimeout());
2078+ //ui->mouseTimeoutSpinBox->setValue(StelMainView::getInstance().getCursorTimeout());
2079+ //connect(ui->mouseTimeoutCheckbox, SIGNAL(clicked()), this, SLOT(cursorTimeOutChanged()));
2080+ //connect(ui->mouseTimeoutCheckbox, SIGNAL(toggled(bool)), this, SLOT(cursorTimeOutChanged()));
2081+ //connect(ui->mouseTimeoutSpinBox, SIGNAL(valueChanged(double)), this, SLOT(cursorTimeOutChanged(double)));
2082+ connectBoolProperty(ui->mouseTimeoutCheckbox, "MainView.flagCursorTimeout");
2083+ connectDoubleProperty(ui->mouseTimeoutSpinBox, "MainView.cursorTimeout");
2084+ connectBoolProperty(ui->useButtonsBackgroundCheckBox, "MainView.flagUseButtonsBackground");
2085+ connectBoolProperty(ui->indicationMountModeCheckBox, "StelMovementMgr.flagIndicationMountMode");
2086
2087 // General Option Save
2088 connect(ui->saveViewDirAsDefaultPushButton, SIGNAL(clicked()), this, SLOT(saveCurrentViewDirSettings()));
2089@@ -334,9 +318,7 @@
2090 ui->screenshotDirEdit->setText(StelFileMgr::getScreenshotDir());
2091 connect(ui->screenshotDirEdit, SIGNAL(textChanged(QString)), this, SLOT(selectScreenshotDir(QString)));
2092 connect(ui->screenshotBrowseButton, SIGNAL(clicked()), this, SLOT(browseForScreenshotDir()));
2093-
2094- ui->invertScreenShotColorsCheckBox->setChecked(StelMainView::getInstance().getFlagInvertScreenShotColors());
2095- connect(ui->invertScreenShotColorsCheckBox, SIGNAL(toggled(bool)), &StelMainView::getInstance(), SLOT(setFlagInvertScreenShotColors(bool)));
2096+ connectBoolProperty(ui->invertScreenShotColorsCheckBox, "MainView.flagInvertScreenShotColors");
2097
2098 connectBoolProperty(ui->autoEnableAtmosphereCheckBox, "LandscapeMgr.flagAtmosphereAutoEnabling");
2099 connectBoolProperty(ui->autoChangeLandscapesCheckBox, "LandscapeMgr.flagLandscapeAutoSelection");
2100@@ -519,6 +501,8 @@
2101 flags |= StelObject::AltAzi;
2102 if (ui->checkBoxDistance->isChecked())
2103 flags |= StelObject::Distance;
2104+ if (ui->checkBoxVelocity->isChecked())
2105+ flags |= StelObject::Velocity;
2106 if (ui->checkBoxSize->isChecked())
2107 flags |= StelObject::Size;
2108 if (ui->checkBoxExtra->isChecked())
2109@@ -542,32 +526,32 @@
2110 }
2111
2112
2113-void ConfigurationDialog::updateStartPointForAzimuth(bool b)
2114-{
2115- StelApp::getInstance().setFlagSouthAzimuthUsage(b);
2116-}
2117-
2118-void ConfigurationDialog::updateSettingFormattingOutput(bool b)
2119-{
2120- StelApp::getInstance().setFlagUseFormattingOutput(b);
2121-}
2122-
2123-void ConfigurationDialog::updateSettingCCSDesignations(bool b)
2124-{
2125- StelApp::getInstance().setFlagUseCCSDesignation(b);
2126-}
2127-
2128-void ConfigurationDialog::cursorTimeOutChanged()
2129-{
2130- StelMainView::getInstance().setFlagCursorTimeout(ui->mouseTimeoutCheckbox->isChecked());
2131- StelMainView::getInstance().setCursorTimeout(ui->mouseTimeoutSpinBox->value());
2132-}
2133-
2134-void ConfigurationDialog::usageButtonsBackgroundChanged(bool b)
2135-{
2136- StelMainView::getInstance().setFlagUseButtonsBackground(b);
2137- emit StelMainView::getInstance().updateIconsRequested();
2138-}
2139+//void ConfigurationDialog::updateStartPointForAzimuth(bool b)
2140+//{
2141+// StelApp::getInstance().setFlagSouthAzimuthUsage(b);
2142+//}
2143+
2144+//void ConfigurationDialog::updateSettingFormattingOutput(bool b)
2145+//{
2146+// StelApp::getInstance().setFlagUseFormattingOutput(b);
2147+//}
2148+
2149+//void ConfigurationDialog::updateSettingCCSDesignations(bool b)
2150+//{
2151+// StelApp::getInstance().setFlagUseCCSDesignation(b);
2152+//}
2153+
2154+//void ConfigurationDialog::cursorTimeOutChanged()
2155+//{
2156+// StelMainView::getInstance().setFlagCursorTimeout(ui->mouseTimeoutCheckbox->isChecked());
2157+// StelMainView::getInstance().setCursorTimeout(ui->mouseTimeoutSpinBox->value());
2158+//}
2159+
2160+//void ConfigurationDialog::usageButtonsBackgroundChanged(bool b)
2161+//{
2162+// StelMainView::getInstance().setFlagUseButtonsBackground(b);
2163+// emit StelMainView::getInstance().updateIconsRequested();
2164+//}
2165
2166 void ConfigurationDialog::browseForScreenshotDir()
2167 {
2168@@ -848,6 +832,8 @@
2169 (bool) (flags & StelObject::AltAzi));
2170 conf->setValue("flag_show_distance",
2171 (bool) (flags & StelObject::Distance));
2172+ conf->setValue("flag_show_velocity",
2173+ (bool) (flags & StelObject::Velocity));
2174 conf->setValue("flag_show_size",
2175 (bool) (flags & StelObject::Size));
2176 conf->setValue("flag_show_extra",
2177@@ -1428,6 +1414,7 @@
2178 ui->checkBoxHourAngle->setChecked(flags & StelObject::HourAngle);
2179 ui->checkBoxAltAz->setChecked(flags & StelObject::AltAzi);
2180 ui->checkBoxDistance->setChecked(flags & StelObject::Distance);
2181+ ui->checkBoxVelocity->setChecked(flags & StelObject::Velocity);
2182 ui->checkBoxSize->setChecked(flags & StelObject::Size);
2183 ui->checkBoxExtra->setChecked(flags & StelObject::Extra);
2184 ui->checkBoxGalacticCoordinates->setChecked(flags & StelObject::GalacticCoord);
2185
2186=== modified file 'src/gui/ConfigurationDialog.hpp'
2187--- src/gui/ConfigurationDialog.hpp 2017-07-12 13:57:34 +0000
2188+++ src/gui/ConfigurationDialog.hpp 2017-11-23 14:55:50 +0000
2189@@ -90,13 +90,6 @@
2190 void showShortcutsWindow();
2191 void setDiskViewport(bool);
2192 void setSphericMirror(bool);
2193- void cursorTimeOutChanged();
2194- void cursorTimeOutChanged(double) {cursorTimeOutChanged();}
2195- void usageButtonsBackgroundChanged(bool b);
2196-
2197- void updateStartPointForAzimuth(bool b);
2198- void updateSettingFormattingOutput(bool b);
2199- void updateSettingCCSDesignations(bool b);
2200
2201 void newStarCatalogData();
2202 void downloadStars();
2203
2204=== modified file 'src/gui/SearchDialog.cpp'
2205--- src/gui/SearchDialog.cpp 2017-05-22 13:27:14 +0000
2206+++ src/gui/SearchDialog.cpp 2017-11-23 14:55:50 +0000
2207@@ -146,6 +146,7 @@
2208 useLockPosition = conf->value("search/flag_lock_position", true).toBool();
2209 simbadServerUrl = conf->value("search/simbad_server_url", DEF_SIMBAD_URL).toString();
2210 setCurrentCoordinateSystemKey(conf->value("search/coordinate_system", "equatorialJ2000").toString());
2211+ connect(&StelApp::getInstance(), SIGNAL(flagShowDecimalDegreesChanged(bool)), this, SLOT(populateCoordinateAxis()));
2212 }
2213
2214 SearchDialog::~SearchDialog()
2215@@ -223,7 +224,7 @@
2216
2217 void SearchDialog::populateCoordinateAxis()
2218 {
2219- bool withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDegrees();;
2220+ bool withDecimalDegree = StelApp::getInstance().getFlagShowDecimalDegrees();
2221 bool xnormal = true;
2222
2223 ui->AxisXSpinBox->setDecimals(2);
2224
2225=== modified file 'src/gui/SkyGui.cpp'
2226--- src/gui/SkyGui.cpp 2017-05-22 13:27:14 +0000
2227+++ src/gui/SkyGui.cpp 2017-11-23 14:55:50 +0000
2228@@ -72,6 +72,8 @@
2229 infoTextFilters |= StelObject::AltAzi;
2230 if (conf->value("flag_show_distance", false).toBool())
2231 infoTextFilters |= StelObject::Distance;
2232+ if (conf->value("flag_show_velocity", false).toBool())
2233+ infoTextFilters |= StelObject::Velocity;
2234 if (conf->value("flag_show_size", false).toBool())
2235 infoTextFilters |= StelObject::Size;
2236 if (conf->value("flag_show_extra", false).toBool())
2237
2238=== modified file 'src/gui/StelGui.cpp'
2239--- src/gui/StelGui.cpp 2017-06-05 16:15:26 +0000
2240+++ src/gui/StelGui.cpp 2017-11-23 14:55:50 +0000
2241@@ -119,6 +119,7 @@
2242 #endif
2243
2244 {
2245+ setObjectName("StelGui");
2246 // QPixmapCache::setCacheLimit(30000); ?
2247 }
2248
2249@@ -245,6 +246,8 @@
2250 connect(scriptMgr, SIGNAL(scriptRunning()), this, SLOT(scriptStarted()));
2251 connect(scriptMgr, SIGNAL(scriptStopped()), this, SLOT(scriptStopped()));
2252 #endif
2253+ // Put StelGui under the StelProperty system (simpler and more consistent GUI)
2254+ StelApp::getInstance().getStelPropertyManager()->registerObject(this);
2255
2256 ///////////////////////////////////////////////////////////////////////////
2257 //// QGraphicsView based GUI
2258@@ -699,6 +702,7 @@
2259 if (initDone) {
2260 skyGui->updateBarsPos();
2261 }
2262+ emit flagShowFlipButtonsChanged(b);
2263 }
2264
2265 // Define whether the button toggling nebulae backround images should be visible
2266@@ -720,6 +724,7 @@
2267 if (initDone) {
2268 skyGui->updateBarsPos();
2269 }
2270+ emit flagShowNebulaBackgroundButtonChanged(b);
2271 }
2272
2273 // Define whether the button toggling bookmarks should be visible
2274@@ -741,6 +746,7 @@
2275 if (initDone) {
2276 skyGui->updateBarsPos();
2277 }
2278+ emit flagShowBookmarksButtonChanged(b);
2279 }
2280
2281 // Define whether the button toggling ICRS grid should be visible
2282@@ -762,6 +768,7 @@
2283 if (initDone) {
2284 skyGui->updateBarsPos();
2285 }
2286+ emit flagShowICRSGridButtonChanged(b);
2287 }
2288
2289 // Define whether the button toggling galactic grid should be visible
2290@@ -783,6 +790,7 @@
2291 if (initDone) {
2292 skyGui->updateBarsPos();
2293 }
2294+ emit flagShowGalacticGridButtonChanged(b);
2295 }
2296
2297 // Define whether the button toggling ecliptic grid should be visible
2298@@ -825,6 +833,7 @@
2299 if (initDone) {
2300 skyGui->updateBarsPos();
2301 }
2302+ emit flagShowConstellationBoundariesButtonChanged(b);
2303 }
2304
2305 // Define whether the button toggling TOAST survey images should be visible
2306@@ -843,16 +852,7 @@
2307 getButtonBar()->hideButton("actionShow_Toast_Survey");
2308 }
2309 flagShowToastSurveyButton = b;
2310-}
2311-
2312-void StelGui::setFlagShowDecimalDegrees(bool b)
2313-{
2314- StelApp::getInstance().setFlagShowDecimalDegrees(b);
2315- if (searchDialog->visible())
2316- {
2317- // Update format of input fields if Search Dialog is open
2318- searchDialog->populateCoordinateAxis();
2319- }
2320+ emit flagShowToastSurveyButtonChanged(b);
2321 }
2322
2323 void StelGui::setVisible(bool b)
2324@@ -997,6 +997,7 @@
2325 void StelGui::setGuiVisible(bool b)
2326 {
2327 setVisible(b);
2328+ emit visibleChanged(b);
2329 }
2330
2331 StelAction* StelGui::getAction(const QString& actionName)
2332
2333=== modified file 'src/gui/StelGui.hpp'
2334--- src/gui/StelGui.hpp 2017-05-22 13:27:14 +0000
2335+++ src/gui/StelGui.hpp 2017-11-23 14:55:50 +0000
2336@@ -56,6 +56,14 @@
2337 Q_PROPERTY(bool visible READ getVisible WRITE setVisible NOTIFY visibleChanged)
2338 Q_PROPERTY(bool autoHideHorizontalButtonBar READ getAutoHideHorizontalButtonBar WRITE setAutoHideHorizontalButtonBar NOTIFY autoHideHorizontalButtonBarChanged)
2339 Q_PROPERTY(bool autoHideVerticalButtonBar READ getAutoHideVerticalButtonBar WRITE setAutoHideVerticalButtonBar NOTIFY autoHideVerticalButtonBarChanged)
2340+ Q_PROPERTY(bool flagShowFlipButtons READ getFlagShowFlipButtons WRITE setFlagShowFlipButtons NOTIFY flagShowFlipButtonsChanged)
2341+ Q_PROPERTY(bool flagShowNebulaBackgroundButton READ getFlagShowNebulaBackgroundButton WRITE setFlagShowNebulaBackgroundButton NOTIFY flagShowNebulaBackgroundButtonChanged)
2342+ Q_PROPERTY(bool flagShowToastSurveyButton READ getFlagShowToastSurveyButton WRITE setFlagShowToastSurveyButton NOTIFY flagShowToastSurveyButtonChanged)
2343+ Q_PROPERTY(bool flagShowBookmarksButton READ getFlagShowBookmarksButton WRITE setFlagShowBookmarksButton NOTIFY flagShowBookmarksButtonChanged)
2344+ Q_PROPERTY(bool flagShowICRSGridButton READ getFlagShowICRSGridButton WRITE setFlagShowICRSGridButton NOTIFY flagShowICRSGridButtonChanged)
2345+ Q_PROPERTY(bool flagShowGalacticGridButton READ getFlagShowGalacticGridButton WRITE setFlagShowGalacticGridButton NOTIFY flagShowGalacticGridButtonChanged )
2346+ Q_PROPERTY(bool flagShowEclipticGridButton READ getFlagShowEclipticGridButton WRITE setFlagShowEclipticGridButton NOTIFY flagShowEclipticGridButtonChanged )
2347+ Q_PROPERTY(bool flagShowConstellationBoundariesButton READ getFlagShowConstellationBoundariesButton WRITE setFlagShowConstellationBoundariesButton NOTIFY flagShowConstellationBoundariesButtonChanged )
2348
2349 public:
2350 friend class ViewDialog;
2351@@ -85,30 +93,6 @@
2352 //! Get the SkyGui instance (useful for adding other interface elements).
2353 //! It will return a valid object only if called after init().
2354 class SkyGui* getSkyGui() const;
2355-
2356- //! Get whether the buttons toggling image flip are visible
2357- bool getFlagShowFlipButtons() const;
2358-
2359- //! Get whether the button toggling nebulae background is visible
2360- bool getFlagShowNebulaBackgroundButton() const;
2361-
2362- //! Get whether the button toggling TOAST survey is visible
2363- bool getFlagShowToastSurveyButton() const;
2364-
2365- //! Get whether the button toggling bookmarks is visible
2366- bool getFlagShowBookmarksButton() const;
2367-
2368- //! Get whether the button toggling ICRS grid is visible
2369- bool getFlagShowICRSGridButton() const;
2370-
2371- //! Get whether the button toggling galactic grid is visible
2372- bool getFlagShowGalacticGridButton() const;
2373-
2374- //! Get whether the button toggling ecliptic grid is visible
2375- bool getFlagShowEclipticGridButton() const;
2376-
2377- //! Get whether the button toggling constellation boundaries is visible
2378- bool getFlagShowConstellationBoundariesButton() const;
2379
2380 //! returns true if the gui has completed init process.
2381 bool initComplete(void) const;
2382@@ -134,29 +118,43 @@
2383 public slots:
2384 //! Define whether the buttons toggling image flip should be visible
2385 void setFlagShowFlipButtons(bool b);
2386-
2387+ //! Get whether the buttons toggling image flip are visible
2388+ bool getFlagShowFlipButtons() const;
2389+
2390 //! Define whether the button toggling nebulae background should be visible
2391 void setFlagShowNebulaBackgroundButton(bool b);
2392+ //! Get whether the button toggling nebulae background is visible
2393+ bool getFlagShowNebulaBackgroundButton() const;
2394
2395 //! Define whether the button toggling TOAST survey should be visible
2396 void setFlagShowToastSurveyButton(bool b);
2397+ //! Get whether the button toggling TOAST survey is visible
2398+ bool getFlagShowToastSurveyButton() const;
2399
2400 //! Define whether the button toggling bookmarks should be visible
2401 void setFlagShowBookmarksButton(bool b);
2402+ //! Get whether the button toggling bookmarks is visible
2403+ bool getFlagShowBookmarksButton() const;
2404
2405 //! Define whether the button toggling ICRS grid should be visible
2406 void setFlagShowICRSGridButton(bool b);
2407+ //! Get whether the button toggling ICRS grid is visible
2408+ bool getFlagShowICRSGridButton() const;
2409
2410 //! Define whether the button toggling galactic grid should be visible
2411 void setFlagShowGalacticGridButton(bool b);
2412+ //! Get whether the button toggling galactic grid is visible
2413+ bool getFlagShowGalacticGridButton() const;
2414
2415 //! Define whether the button toggling ecliptic grid should be visible
2416 void setFlagShowEclipticGridButton(bool b);
2417+ //! Get whether the button toggling ecliptic grid is visible
2418+ bool getFlagShowEclipticGridButton() const;
2419
2420 //! Define whether the button toggling constellation boundaries should be visible
2421 void setFlagShowConstellationBoundariesButton(bool b);
2422-
2423- void setFlagShowDecimalDegrees(bool b);
2424+ //! Get whether the button toggling constellation boundaries is visible
2425+ bool getFlagShowConstellationBoundariesButton() const;
2426
2427 //! Get the auto-hide status of the horizontal toolbar.
2428 bool getAutoHideHorizontalButtonBar() const;
2429@@ -194,6 +192,14 @@
2430 void visibleChanged(bool b);
2431 void autoHideHorizontalButtonBarChanged(bool b);
2432 void autoHideVerticalButtonBarChanged(bool b);
2433+ void flagShowFlipButtonsChanged(bool b);
2434+ void flagShowNebulaBackgroundButtonChanged(bool b);
2435+ void flagShowToastSurveyButtonChanged(bool b);
2436+ void flagShowBookmarksButtonChanged(bool b);
2437+ void flagShowICRSGridButtonChanged(bool b);
2438+ void flagShowGalacticGridButtonChanged(bool b);
2439+ void flagShowEclipticGridButtonChanged(bool b);
2440+ void flagShowConstellationBoundariesButtonChanged(bool b);
2441
2442 private slots:
2443 void reloadStyle();
2444
2445=== modified file 'src/gui/configurationDialog.ui'
2446--- src/gui/configurationDialog.ui 2017-10-22 18:13:13 +0000
2447+++ src/gui/configurationDialog.ui 2017-11-23 14:55:50 +0000
2448@@ -613,10 +613,10 @@
2449 </attribute>
2450 </widget>
2451 </item>
2452- <item row="3" column="1">
2453- <widget class="QCheckBox" name="checkBoxSupergalacticCoordinates">
2454+ <item row="1" column="0">
2455+ <widget class="QCheckBox" name="checkBoxCatalogNumbers">
2456 <property name="text">
2457- <string>Supergalactic coordinates</string>
2458+ <string>Catalog number(s)</string>
2459 </property>
2460 <attribute name="buttonGroup">
2461 <string notr="true">buttonGroupDisplayedFields</string>
2462@@ -624,29 +624,6 @@
2463 </widget>
2464 </item>
2465 <item row="7" column="0">
2466- <widget class="QCheckBox" name="checkBoxType">
2467- <property name="toolTip">
2468- <string>The type of the object (star, planet, etc.)</string>
2469- </property>
2470- <property name="text">
2471- <string>Type</string>
2472- </property>
2473- <attribute name="buttonGroup">
2474- <string notr="true">buttonGroupDisplayedFields</string>
2475- </attribute>
2476- </widget>
2477- </item>
2478- <item row="1" column="1">
2479- <widget class="QCheckBox" name="checkBoxAbsoluteMag">
2480- <property name="text">
2481- <string>Absolute magnitude</string>
2482- </property>
2483- <attribute name="buttonGroup">
2484- <string notr="true">buttonGroupDisplayedFields</string>
2485- </attribute>
2486- </widget>
2487- </item>
2488- <item row="5" column="0">
2489 <widget class="QCheckBox" name="checkBoxEclipticCoordsOfDate">
2490 <property name="toolTip">
2491 <string>Ecliptic coordinates, equinox of date (only for Earth)</string>
2492@@ -659,56 +636,10 @@
2493 </attribute>
2494 </widget>
2495 </item>
2496- <item row="6" column="0">
2497- <widget class="QCheckBox" name="checkBoxSize">
2498- <property name="toolTip">
2499- <string>Angular or physical size</string>
2500- </property>
2501- <property name="text">
2502- <string>Size</string>
2503- </property>
2504- <attribute name="buttonGroup">
2505- <string notr="true">buttonGroupDisplayedFields</string>
2506- </attribute>
2507- </widget>
2508- </item>
2509- <item row="5" column="1">
2510- <widget class="QCheckBox" name="checkBoxAltAz">
2511- <property name="toolTip">
2512- <string>Horizontal coordinates</string>
2513- </property>
2514- <property name="text">
2515- <string>Azimuth/Altitude</string>
2516- </property>
2517- <attribute name="buttonGroup">
2518- <string notr="true">buttonGroupDisplayedFields</string>
2519- </attribute>
2520- </widget>
2521- </item>
2522- <item row="1" column="0">
2523- <widget class="QCheckBox" name="checkBoxCatalogNumbers">
2524- <property name="text">
2525- <string>Catalog number(s)</string>
2526- </property>
2527- <attribute name="buttonGroup">
2528- <string notr="true">buttonGroupDisplayedFields</string>
2529- </attribute>
2530- </widget>
2531- </item>
2532- <item row="6" column="1">
2533- <widget class="QCheckBox" name="checkBoxDistance">
2534- <property name="text">
2535- <string>Distance</string>
2536- </property>
2537- <attribute name="buttonGroup">
2538- <string notr="true">buttonGroupDisplayedFields</string>
2539- </attribute>
2540- </widget>
2541- </item>
2542- <item row="2" column="1">
2543- <widget class="QCheckBox" name="checkBoxGalacticCoordinates">
2544- <property name="text">
2545- <string>Galactic coordinates</string>
2546+ <item row="0" column="0">
2547+ <widget class="QCheckBox" name="checkBoxName">
2548+ <property name="text">
2549+ <string>Name</string>
2550 </property>
2551 <attribute name="buttonGroup">
2552 <string notr="true">buttonGroupDisplayedFields</string>
2553@@ -728,17 +659,7 @@
2554 </attribute>
2555 </widget>
2556 </item>
2557- <item row="0" column="0">
2558- <widget class="QCheckBox" name="checkBoxName">
2559- <property name="text">
2560- <string>Name</string>
2561- </property>
2562- <attribute name="buttonGroup">
2563- <string notr="true">buttonGroupDisplayedFields</string>
2564- </attribute>
2565- </widget>
2566- </item>
2567- <item row="4" column="0">
2568+ <item row="6" column="0">
2569 <widget class="QCheckBox" name="checkBoxEclipticCoordsJ2000">
2570 <property name="toolTip">
2571 <string>Ecliptic coordinates, equinox J2000.0</string>
2572@@ -751,7 +672,17 @@
2573 </attribute>
2574 </widget>
2575 </item>
2576- <item row="4" column="1">
2577+ <item row="8" column="0">
2578+ <widget class="QCheckBox" name="checkBoxGalacticCoordinates">
2579+ <property name="text">
2580+ <string>Galactic coordinates</string>
2581+ </property>
2582+ <attribute name="buttonGroup">
2583+ <string notr="true">buttonGroupDisplayedFields</string>
2584+ </attribute>
2585+ </widget>
2586+ </item>
2587+ <item row="4" column="0">
2588 <widget class="QCheckBox" name="checkBoxHourAngle">
2589 <property name="toolTip">
2590 <string>Equatorial coordinates, equinox of date</string>
2591@@ -764,7 +695,66 @@
2592 </attribute>
2593 </widget>
2594 </item>
2595- <item row="0" column="1">
2596+ <item row="9" column="0">
2597+ <widget class="QCheckBox" name="checkBoxSupergalacticCoordinates">
2598+ <property name="text">
2599+ <string>Supergalactic coordinates</string>
2600+ </property>
2601+ <attribute name="buttonGroup">
2602+ <string notr="true">buttonGroupDisplayedFields</string>
2603+ </attribute>
2604+ </widget>
2605+ </item>
2606+ <item row="5" column="0">
2607+ <widget class="QCheckBox" name="checkBoxAltAz">
2608+ <property name="toolTip">
2609+ <string>Horizontal coordinates</string>
2610+ </property>
2611+ <property name="text">
2612+ <string>Azimuth/Altitude</string>
2613+ </property>
2614+ <attribute name="buttonGroup">
2615+ <string notr="true">buttonGroupDisplayedFields</string>
2616+ </attribute>
2617+ </widget>
2618+ </item>
2619+ <item row="4" column="1">
2620+ <widget class="QCheckBox" name="checkBoxSize">
2621+ <property name="toolTip">
2622+ <string>Angular or physical size</string>
2623+ </property>
2624+ <property name="text">
2625+ <string>Size</string>
2626+ </property>
2627+ <attribute name="buttonGroup">
2628+ <string notr="true">buttonGroupDisplayedFields</string>
2629+ </attribute>
2630+ </widget>
2631+ </item>
2632+ <item row="3" column="1">
2633+ <widget class="QCheckBox" name="checkBoxType">
2634+ <property name="toolTip">
2635+ <string>The type of the object (star, planet, etc.)</string>
2636+ </property>
2637+ <property name="text">
2638+ <string>Type</string>
2639+ </property>
2640+ <attribute name="buttonGroup">
2641+ <string notr="true">buttonGroupDisplayedFields</string>
2642+ </attribute>
2643+ </widget>
2644+ </item>
2645+ <item row="2" column="1">
2646+ <widget class="QCheckBox" name="checkBoxAbsoluteMag">
2647+ <property name="text">
2648+ <string>Absolute magnitude</string>
2649+ </property>
2650+ <attribute name="buttonGroup">
2651+ <string notr="true">buttonGroupDisplayedFields</string>
2652+ </attribute>
2653+ </widget>
2654+ </item>
2655+ <item row="1" column="1">
2656 <widget class="QCheckBox" name="checkBoxVisualMag">
2657 <property name="text">
2658 <string>Visual magnitude</string>
2659@@ -774,7 +764,7 @@
2660 </attribute>
2661 </widget>
2662 </item>
2663- <item row="8" column="0">
2664+ <item row="0" column="1">
2665 <widget class="QCheckBox" name="checkBoxConstellation">
2666 <property name="toolTip">
2667 <string>3-letter IAU constellation abbreviation</string>
2668@@ -787,6 +777,33 @@
2669 </attribute>
2670 </widget>
2671 </item>
2672+ <item row="5" column="1">
2673+ <widget class="QCheckBox" name="checkBoxVelocity">
2674+ <property name="text">
2675+ <string>Velocity</string>
2676+ </property>
2677+ </widget>
2678+ </item>
2679+ <item row="6" column="1">
2680+ <widget class="QCheckBox" name="checkBoxDistance">
2681+ <property name="text">
2682+ <string>Distance</string>
2683+ </property>
2684+ <attribute name="buttonGroup">
2685+ <string notr="true">buttonGroupDisplayedFields</string>
2686+ </attribute>
2687+ </widget>
2688+ </item>
2689+ <item row="7" column="1">
2690+ <widget class="QCheckBox" name="checkBoxSiderealTime">
2691+ <property name="text">
2692+ <string>Sidereal time</string>
2693+ </property>
2694+ <attribute name="buttonGroup">
2695+ <string notr="true">buttonGroupDisplayedFields</string>
2696+ </attribute>
2697+ </widget>
2698+ </item>
2699 <item row="8" column="1">
2700 <widget class="QCheckBox" name="checkBoxExtra">
2701 <property name="toolTip">
2702@@ -800,16 +817,6 @@
2703 </attribute>
2704 </widget>
2705 </item>
2706- <item row="7" column="1">
2707- <widget class="QCheckBox" name="checkBoxSiderealTime">
2708- <property name="text">
2709- <string>Sidereal time</string>
2710- </property>
2711- <attribute name="buttonGroup">
2712- <string notr="true">buttonGroupDisplayedFields</string>
2713- </attribute>
2714- </widget>
2715- </item>
2716 </layout>
2717 </widget>
2718 </item>
2719@@ -2102,16 +2109,9 @@
2720 <tabstop>saveSettingsAsDefaultPushButton</tabstop>
2721 <tabstop>restoreDefaultsButton</tabstop>
2722 <tabstop>checkBoxName</tabstop>
2723- <tabstop>checkBoxVisualMag</tabstop>
2724 <tabstop>checkBoxCatalogNumbers</tabstop>
2725- <tabstop>checkBoxAbsoluteMag</tabstop>
2726 <tabstop>checkBoxRaDecJ2000</tabstop>
2727- <tabstop>checkBoxGalacticCoordinates</tabstop>
2728- <tabstop>checkBoxSupergalacticCoordinates</tabstop>
2729 <tabstop>checkBoxRaDecOfDate</tabstop>
2730- <tabstop>checkBoxSize</tabstop>
2731- <tabstop>checkBoxDistance</tabstop>
2732- <tabstop>checkBoxType</tabstop>
2733 <tabstop>checkBoxEclipticCoordsJ2000</tabstop>
2734 <tabstop>checkBoxEclipticCoordsOfDate</tabstop>
2735 <tabstop>enableKeysNavigationCheckBox</tabstop>