[Kstars-devel] kdeedu/kstars/kstars

Thomas Kabelmann tk78 at gmx.de
Wed Apr 28 16:58:22 CEST 2004


CVS commit by kabelmann: 

Re-enabled reloading of star data since it was not implemented in the new option dialog.

CCMAIL: kstars-devel at kde.org


  M +9 -3      kstarsdata.cpp   1.128
  M +2 -1      kstarsdata.h   1.80
  M +1 -1      kstarsinit.cpp   1.87
  M +17 -0     opscatalog.cpp   1.5
  M +3 -0      opscatalog.h   1.3
  M +1 -1      stardatasink.cpp   1.18


--- kdeedu/kstars/kstars/kstarsdata.cpp  #1.127:1.128
@@ -622,5 +622,5 @@ bool KStarsData::readStarData( void ) {
 }
 
-void KStarsData::processStar( QString *line ) {
+void KStarsData::processStar( QString *line, bool reloadMode ) {
         QString name, gname, SpType;
         int rah, ram, ras, ras2, dd, dm, ds, ds2;
@@ -693,4 +693,10 @@ void KStarsData::processStar( QString *l
         starList.append(o);
 
+        // get horizontal coordinates when object will loaded while running the application
+        // first run doesn't need this because updateTime() will called after loading all data
+        if (reloadMode) {
+                o->EquatorialToHorizontal( LST, geo()->lat() );
+        }
+        
         //STAR_SIZE
 //      StarObject *p = new StarObject(r, d, mag, name, gname, SpType, pmra, pmdec, plx, mult, var );
@@ -1501,6 +1507,6 @@ void KStarsData::initialize() {
         initTimer = new QTimer;
         QObject::connect(initTimer, SIGNAL(timeout()), this, SLOT( slotInitialize() ) );
-        initTimer->start(1);
         initCounter = 0;
+        initTimer->start(1);
 }
 

--- kdeedu/kstars/kstars/kstarsdata.h  #1.79:1.80
@@ -189,7 +189,8 @@ public:
                 *
                 *@param line pointer to the line of data to be processed as a StarObject
+                *@param reloadMode makes additional calculations in reload mode, not needed at start up
                 *@see KStarsData::readStarData()
                 */
-        void processStar( QString *line );
+        void processStar( QString *line, bool reloadMode = false );
 
         /**Populate the list of deep-sky objects from the database file.

--- kdeedu/kstars/kstars/kstarsinit.cpp  #1.86:1.87
@@ -528,5 +528,5 @@ void KStars::privatedata::buildGUI() {
         ks->skymap = new SkyMap( ks->data(), ks->centralWidget );
         // update skymap if KStarsData send update signal
-        QObject::connect(kstarsData, SIGNAL( update() ), ks->skymap, SLOT( forceUpdate() ) );
+        QObject::connect(kstarsData, SIGNAL( update() ), ks->skymap, SLOT( forceUpdateNow() ) );
 
         // get focus of keyboard and mouse actions (for example zoom in with +)

--- kdeedu/kstars/kstars/opscatalog.cpp  #1.4:1.5
@@ -58,4 +58,11 @@ OpsCatalog::OpsCatalog( QWidget *p, cons
         connect( RemoveCatalog, SIGNAL( clicked() ), this, SLOT( slotRemoveCatalog() ) );
 
+        // draw star magnitude box
+        connect( kcfg_MagLimitDrawStar, SIGNAL( valueChanged(double) ),
+                SLOT( slotSetDrawStarMagnitude(double) ) );
+        
+        // draw star zoom out magnitude box
+        connect( kcfg_MagLimitDrawStarZoomOut, SIGNAL( valueChanged(double) ),
+                SLOT( slotSetDrawStarZoomOutMagnitude(double) ) );
 }
 
@@ -135,3 +142,13 @@ void OpsCatalog::slotRemoveCatalog() {
 }
 
+void OpsCatalog::slotSetDrawStarMagnitude(double newValue) {
+        ksw->data()->setMagnitude( newValue );
+}
+
+void OpsCatalog::slotSetDrawStarZoomOutMagnitude(double newValue) {
+        Options::setMagLimitDrawStarZoomOut(newValue);
+        // force redraw
+        ksw->map()->forceUpdate();
+}
+
 #include "opscatalog.moc"

--- kdeedu/kstars/kstars/opscatalog.h  #1.2:1.3
@@ -50,4 +50,7 @@ private slots:
         void slotAddCatalog();
         void slotRemoveCatalog();
+        void slotSetDrawStarMagnitude(double newValue);
+        void slotSetDrawStarZoomOutMagnitude(double newValue);
+
 
 private:

--- kdeedu/kstars/kstars/stardatasink.cpp  #1.17:1.18
@@ -50,5 +50,5 @@ void StarDataSink::receive( const uchar 
         int counter = -1;
         while (++counter < entries) {  // run counter from 0 to entries -1
-                ksData->processStar(line);
+                ksData->processStar(line, true);
                 line++;
         }




More information about the Kstars-devel mailing list