[Kstars-devel] KDE/kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Wed Jul 23 16:48:38 CEST 2008


SVN commit 837021 by harris:

Initial commit for Sky Calendar tool.  Here's an example of what I'm going for:
http://www.astroscu.unam.mx/~jdo/sky1999.htm

There's a lot TODO:
+ populating the plot is currently VERY slow, so you have to press the Update 
button when you open the tool (then go get some coffee!).

+ lines are unlabeled, but they represent the rise, set and transit times of all 
major solar system bodies (incl. Pluto).

+ The Horizons (which are the times of sunset and sunrise) are currently stored in 
pixel coordinates, so don't try to resize the plot yet

+ Currently I assume that the sun rises and sets daily, so locations near the 
poles will have problems.

+ To be added: Moon phases, twilight lines, better axis labeling


If anyone's interested in helping develop this tool, please feel free to join me!

CCMAIL: kstars-devel at kde.org



 M  +4 -1      CMakeLists.txt  
 M  +1 -1      kstars.cpp  
 M  +7 -0      kstars.h  
 M  +6 -0      kstarsactions.cpp  
 M  +5 -0      kstarsinit.cpp  
 M  +1 -0      kstarsui.rc  
 M  +6 -2      skyobject.cpp  
 M  +4 -1      skyobject.h  
 A             tools/calendarwidget.cpp   [License: GPL (v2+)]
 A             tools/calendarwidget.h   [License: GPL (v2+)]
 A             tools/skycalendar.cpp   [License: GPL (v2+)]
 A             tools/skycalendar.h   [License: GPL (v2+)]
 A             tools/skycalendar.ui  


--- trunk/KDE/kdeedu/kstars/kstars/CMakeLists.txt #837020:837021
@@ -43,6 +43,7 @@
 	tools/altvstime.cpp
 	tools/astrocalc.cpp
 	tools/avtplotwidget.cpp
+        tools/calendarwidget.cpp
 	tools/conjunctions.cpp
 	tools/eqplotwidget.cpp
 	tools/jmoontool.cpp
@@ -67,6 +68,7 @@
 	tools/scriptargwidgets.cpp
 	tools/scriptbuilder.cpp
 	tools/scriptfunction.cpp
+        tools/skycalendar.cpp
 	tools/wutdialog.cpp
 	)
 
@@ -125,7 +127,8 @@
 	tools/optionstreeview.ui
 	tools/planetviewer.ui
 	tools/scriptbuilder.ui
-	tools/scriptnamedialog.ui
+        tools/scriptnamedialog.ui
+        tools/skycalendar.ui
 	tools/wutdialog.ui )
 
 
--- trunk/KDE/kdeedu/kstars/kstars/kstars.cpp #837020:837021
@@ -56,7 +56,7 @@
 KStars::KStars( bool doSplash, bool clockrun, const QString &startdate ) :
         KXmlGuiWindow(), kstarsData(0), splash(0), skymap(0), TimeStep(0),
         colorActionMenu(0), fovActionMenu(0),
-        AAVSODialog(0), findDialog(0), obsList(0), avt(0), wut(0),
+        AAVSODialog(0), findDialog(0), obsList(0), avt(0), wut(0), skycal(0), 
         sb(0), pv(0), jmt(0), indimenu(0), indidriver(0), indiseq(0),
         DialogIsObsolete(false), StartClockRunning( clockrun ),
         StartDateString( startdate )
--- trunk/KDE/kdeedu/kstars/kstars/kstars.h #837020:837021
@@ -43,6 +43,7 @@
 class AltVsTime;
 class LCGenerator;
 class WUTDialog;
+class SkyCalendar;
 class ScriptBuilder;
 class PlanetViewer;
 class JMoonTool;
@@ -531,6 +532,11 @@
     void slotWUT();
 
     /**
+     * action slot: open Sky Calendar tool
+     */
+    void slotCalendar();
+
+    /**
      * action slot: open the glossary
      */
     void slotGlossary();
@@ -698,6 +704,7 @@
     ObservingList *obsList;
     AltVsTime *avt;
     WUTDialog *wut;
+    SkyCalendar *skycal;
     ScriptBuilder *sb;
     PlanetViewer *pv;
     JMoonTool *jmt;
--- trunk/KDE/kdeedu/kstars/kstars/kstarsactions.cpp #837020:837021
@@ -75,6 +75,7 @@
 #include "tools/astrocalc.h"
 #include "tools/altvstime.h"
 #include "tools/wutdialog.h"
+#include "tools/skycalendar.h"
 #include "tools/scriptbuilder.h"
 #include "tools/planetviewer.h"
 #include "tools/jmoontool.h"
@@ -227,6 +228,11 @@
     wut->show();
 }
 
+void KStars::slotCalendar() {
+    if ( ! skycal ) skycal = new SkyCalendar(this);
+    skycal->show();
+}
+
 void KStars::slotGlossary(){
     // 	GlossaryDialog *dlg = new GlossaryDialog( this, true );
     // 	QString glossaryfile =data()->stdDirs->findResource( "data", "kstars/glossary.xml" );
--- trunk/KDE/kdeedu/kstars/kstars/kstarsinit.cpp #837020:837021
@@ -355,6 +355,11 @@
     ka->setShortcuts( KShortcut(Qt::CTRL+Qt::Key_U ) );
     connect( ka, SIGNAL( triggered() ), this, SLOT( slotWUT() ) );
 
+    ka = actionCollection()->addAction( "skycalendar");
+    ka->setText( i18n( "Sky Calendar...") );
+//    ka->setShortcuts( KShortcut(Qt::CTRL+Qt::Key_H ) );
+    connect( ka, SIGNAL( triggered() ), this, SLOT( slotCalendar() ) );
+
 //FIXME: implement glossary
 //     ka = actionCollection()->addAction( "glossary");
 //     ka->setText( i18n( "Glossary...") );
--- trunk/KDE/kdeedu/kstars/kstars/kstarsui.rc #837020:837021
@@ -71,6 +71,7 @@
 
 	<Menu name="tools" noMerge="1"><text>&amp;Tools</text>
 		<Action name="astrocalculator" />
+                <Action name="skycalendar" />
 		<Action name="obslist" />
 		<Action name="lightcurvegenerator" />
 		<Action name="altitude_vs_time" />
--- trunk/KDE/kdeedu/kstars/kstars/skyobject.cpp #837020:837021
@@ -103,7 +103,7 @@
     }
 }
 
-QTime SkyObject::riseSetTime( const KStarsDateTime &dt, const GeoLocation *geo, bool rst ) {
+QTime SkyObject::riseSetTime( const KStarsDateTime &dt, const GeoLocation *geo, bool rst, bool exact ) {
     //this object does not rise or set; return an invalid time
     if ( checkCircumpolar(geo->lat()) )
         return QTime( 25, 0, 0 );
@@ -122,7 +122,11 @@
         }
     }
 
-    return geo->UTtoLT( KStarsDateTime( dt2.date(), riseSetTimeUT( dt2, geo, rst ) ) ).time();
+    if ( exact ) 
+        return geo->UTtoLT( KStarsDateTime( dt2.date(), riseSetTimeUT( dt2, geo, rst ) ) ).time();
+    else
+        return geo->UTtoLT( KStarsDateTime( dt2.date(), auxRiseSetTimeUT( dt2, geo, ra(), dec(), rst ) ) ).time();
+
 }
 
 QTime SkyObject::riseSetTimeUT( const KStarsDateTime &dt, const GeoLocation *geo, bool riseT ) {
--- trunk/KDE/kdeedu/kstars/kstars/skyobject.h #837020:837021
@@ -204,7 +204,7 @@
      *@param geo current geographic location
      *@param rst If true, compute rise time. If false, compute set time.
      */
-    QTime riseSetTime( const KStarsDateTime &dt, const GeoLocation *geo, bool rst );
+    QTime riseSetTime( const KStarsDateTime &dt, const GeoLocation *geo, bool rst, bool exact=true );
 
     /**
      *@return the UT time when the object will rise or set
@@ -212,6 +212,9 @@
      *@param geo pointer to Geographic location
      *@param rst Boolean. If true will compute rise time. If false
      *       will compute set time.
+     *@param exact if true, compute the exact rise/set time; 
+     *       otherwise compute it approximately 
+     *       (which takes less CPU time)
      */
     QTime riseSetTimeUT( const KStarsDateTime &dt, const GeoLocation *geo, bool rst);
 


More information about the Kstars-devel mailing list