[Kstars-devel] branches/kstars/summer/kdeedu/kstars/kstars

Akarsh Simha akarshsimha at gmail.com
Fri Jul 11 23:12:40 CEST 2008


SVN commit 831104 by asimha:

Making some changes in the debug code and then commenting it out
altogether, leaving it only for those interested in verifying the
correctness of the proper motion duplications.

CCMAIL: kstars-devel at kde.org



 M  +41 -15    starobject.cpp  
 M  +6 -1      starobject.h  


--- branches/kstars/summer/kdeedu/kstars/kstars/starobject.cpp #831103:831104
@@ -34,6 +34,13 @@
 QMap<QString, QColor> StarObject::ColorMap;
 QHash<QString, QPixmap> StarObject::StarImage;
 
+// DEBUG EDIT. Uncomment for testing Proper Motion
+// You will also need to uncomment all related blocks
+// from this file, starobject.h and also the trixel-boundaries
+// block from lines 253 - 257 of skymapcomposite.cpp
+//QVector<SkyPoint *> StarObject::Trail;
+// END DEBUG
+
 //----- Static Methods -----
 //
 double StarObject::reindexInterval( double pm )
@@ -159,16 +166,18 @@
     Multiplicity = stardata->flags & 0x02;
     Variability = stardata->flags & 0x04 ;
     updateID = updateNumID = 0;
-}
 
-void StarObject::setNames( QString name, QString name2 ) {
-    QString lname;
-
-    setName( name );
-
-    // DEBUG Edit. For testing proper motion. TODO: Remove later
-    if( name == "Rigel Kentaurus" ) {
+    // DEBUG Edit. For testing proper motion. Uncomment all related blocks to test.
+    // WARNING: You can debug only ONE STAR AT A TIME, because
+    //          the StarObject::Trail is static. It has to be
+    //          static, because otherwise, we can run into segfaults
+    //          due to the memcpy() that we do to create stars
+    /*
+    testStar = false;
+    if( stardata->HD == 224635 ) {
       // Populate Trail with various positions
+        kDebug() << "TEST STAR FOUND!";
+        testStar = true;
         KSNumbers num( J2000 ); // Some estimate, doesn't matter.
         long double jy;
         for( jy = -10000.0; jy <= 10000.0; jy += 500.0 ) {
@@ -177,9 +186,19 @@
             getIndexCoords( &num, &ra, &dec );
             Trail.append( new SkyPoint( ra / 15.0, dec ) );
         }
+        kDebug() << "Populated the star's trail with " << Trail.size() << " entries.";
     }
+    */
     // END EDIT.
 
+
+}
+
+void StarObject::setNames( QString name, QString name2 ) {
+    QString lname;
+
+    setName( name );
+
     setName2( name2 );
 
     if ( hasName() ) {
@@ -291,11 +310,16 @@
     setRA0( newRA );
     setDec0( newDec );
 
-    // DEBUG Edit. For testing proper motion. TODO: Remove Later
-    KStarsData *data = KStarsData::Instance();
-    for( int i = 0; i < Trail.size(); i++ ) {
-        Trail.at( i )->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
+    // DEBUG Edit. Uncomment all related blocks for testing proper motion.
+    /*
+    if( testStar ) {
+        kDebug() << "Test Star. update method";
+        KStarsData *data = KStarsData::Instance();
+        for( int i = 0; i < Trail.size(); i++ ) {
+            Trail.at( i )->EquatorialToHorizontal( data->lst(), data->geo()->lat() );
+        }
     }
+    */
     // END EDIT.
 
     SkyPoint::updateCoords( num );
@@ -535,9 +559,9 @@
     float offset = 0.5*StarImage[imKey].width();
     psky.drawPixmap( QPointF(x-offset, y-offset), StarImage[imKey] );
 
-    // DEBUG Edit. To check Proper Motion Corrections. TODO: Comment Later
-
-    if( Trail.count() <= 0 )
+    // DEBUG Edit. To check Proper Motion Corrections. Uncomment all related blocks for testing.
+    /*
+    if( !testStar )
         return;
     
     SkyMap *map = SkyMap::Instance();
@@ -551,6 +575,7 @@
     pLast = Trail.first();
     oLast = map->toScreen( pLast, true, &isVisibleLast );
     center = map->toScreen( map->focus() );
+    kDebug() << "Entering draw routine to draw PM arc.";
     for ( int i = 1; i < Trail.size(); i++ ) {
         pThis = Trail.at( i );
         oThis = map->toScreen( pThis, true, &isVisible );
@@ -577,6 +602,7 @@
         oLast = oThis;
         isVisibleLast = isVisible;
     }
+    */
     // END DEBUG.
               
               
--- branches/kstars/summer/kdeedu/kstars/kstars/starobject.h #831103:831104
@@ -337,8 +337,13 @@
 protected:
     static QMap<QString, QColor> ColorMap;
     static QHash<QString, QPixmap> StarImage;
-    QVector<SkyPoint *> Trail;
 
+    // DEBUG EDIT. For testing proper motion, uncomment this, and related blocks
+    // See starobject.cpp for further info.
+    //    static QVector<SkyPoint *> Trail;
+    //    bool testStar;
+    // END DEBUG
+
 private:
     char SpType[2];
 


More information about the Kstars-devel mailing list