[Kstars-devel] [kstars] kstars: Add an option under the advanced tab to enable / disable

Akarsh Simha akarshsimha at gmail.com
Sun Apr 15 21:28:47 UTC 2012


Git commit 797fe29ef17c81ffa7b43ac6ca1a41bd532fe94f by Akarsh Simha.
Committed on 15/04/2012 at 23:23.
Pushed by asimha into branch 'master'.

Add an option under the advanced tab to enable / disable
short-circuiting of precession, nutation and aberration calculations.

CCMAIL: kstars-devel at kde.org

M  +5    -0    kstars/kstars.kcfg
M  +10   -0    kstars/options/opsadvanced.ui
M  +4    -3    kstars/skyobjects/skypoint.cpp
M  +2    -1    kstars/skyobjects/starobject.cpp

http://commits.kde.org/kstars/797fe29ef17c81ffa7b43ac6ca1a41bd532fe94f

diff --git a/kstars/kstars.kcfg b/kstars/kstars.kcfg
index af4a83b..df0715c 100644
--- a/kstars/kstars.kcfg
+++ b/kstars/kstars.kcfg
@@ -1150,6 +1150,11 @@
     </entry>
   </group>
   <group name="General">
+    <entry name="AlwaysRecomputeCoordinates" type="Bool">
+      <label>Always recompute coordinates</label>
+      <whatsthis>Checking this option causes recomputation of current equatorial coordinates from catalog coordinates (i.e. application of precession, nutation and aberration corrections) for every redraw of the map. This makes processing slower when there are many stars to handle, but is more likely to be bug free. There are known bugs in the rendering of stars when this recomputation is avoided.</whatsthis>
+      <default>true</default>
+    </entry>
     <entry name="DefaultDSSImageSize" type="Double">
       <label>Default size for DSS images</label>
       <whatsthis>The default size for DSS images downloaded from the internet.</whatsthis>
diff --git a/kstars/options/opsadvanced.ui b/kstars/options/opsadvanced.ui
index edf504b..5484533 100644
--- a/kstars/options/opsadvanced.ui
+++ b/kstars/options/opsadvanced.ui
@@ -56,6 +56,16 @@
             </property>
            </widget>
           </item>
+          <item>
+           <widget class="QCheckBox" name="kcfg_AlwaysRecomputeCoordinates">
+            <property name="whatsThis">
+             <string>Checking this option causes recomputation of current equatorial coordinates from catalog coordinates (i.e. application of precession, nutation and aberration corrections) for every redraw of the map. This makes processing slower when there are many stars to handle, but is more likely to be bug-free. There are known bugs in the rendering of stars when this recomputation is avoided.</string>
+            </property>
+            <property name="text">
+             <string>Always recompute coordinates</string>
+            </property>
+           </widget>
+          </item>
          </layout>
         </widget>
        </item>
diff --git a/kstars/skyobjects/skypoint.cpp b/kstars/skyobjects/skypoint.cpp
index 7789e5c..f0d4b01 100644
--- a/kstars/skyobjects/skypoint.cpp
+++ b/kstars/skyobjects/skypoint.cpp
@@ -333,11 +333,12 @@ void SkyPoint::updateCoords( KSNumbers *num, bool /*includePlanets*/, const dms
         lens = true;
     }
     else {
-        recompute = (( lastPrecessJD - num->getJD() ) >= 0.0005 || (lastPrecessJD - num->getJD() ) <= -0.0005 ); // 0.0005 solar days is less than a minute
+        recompute = ( Options::alwaysRecomputeCoordinates() ||
+                      ( lastPrecessJD - num->getJD() ) >= 0.0005 ||
+                      (lastPrecessJD - num->getJD() ) <= -0.0005 || forceRecompute ); // 0.0005 solar days is less than a minute
         lens = false;
     }
-
-    if( recompute || forceRecompute ) {
+    if( recompute ) {
         precess(num);
         nutate(num);
         if( lens )
diff --git a/kstars/skyobjects/starobject.cpp b/kstars/skyobjects/starobject.cpp
index 3cf9787..e28a7cf 100644
--- a/kstars/skyobjects/starobject.cpp
+++ b/kstars/skyobjects/starobject.cpp
@@ -313,13 +313,13 @@ void StarObject::JITupdate()
 {
     static KStarsData *data = KStarsData::Instance();
 
-    updateID = data->updateID();
     if ( updateNumID != data->updateNumID() ) {
         // TODO: This can be optimized and reorganized further in a better manner.
         // Maybe we should do this only for stars, since this is really a slow step only for stars
         Q_ASSERT( isfinite( lastPrecessJD ) );
         if( ( lastPrecessJD - data->updateNum()->getJD() ) >= 0.0005 // TODO: Make this 0.0005 a constant / define it
             || ( lastPrecessJD - data->updateNum()->getJD() ) <= -0.0005
+            || Options::alwaysRecomputeCoordinates()
             || ( Options::useRelativistic() && checkBendLight() ) ) {
 
             // Short circuit right here, if recomputing coordinates is not required. NOTE: POTENTIALLY DANGEROUS
@@ -329,6 +329,7 @@ void StarObject::JITupdate()
         updateNumID = data->updateNumID();
     }
     EquatorialToHorizontal( data->lst(), data->geo()->lat() );
+    updateID = data->updateID();
 }
 
 QString StarObject::sptype( void ) const {


More information about the Kstars-devel mailing list