[Kstars-devel] [kstars/altvstime] kstars/tools: Solved the UTC issue.

Raphael Cojocaru raphael.cojocaru at yahoo.com
Tue Feb 23 20:47:35 UTC 2016


Git commit 85cca8b7cfde2f7c3e5ad1c8000eeb2b2c76689a by Raphael Cojocaru.
Committed on 23/02/2016 at 20:38.
Pushed by raphaelc into branch 'altvstime'.

Solved the UTC issue.
Now, the xAxis range is 12 - 36 hours (as before). Also, the Rise point is now correctly marked.
CCMAIL: kstars-devel at kde.org

M  +13   -18   kstars/tools/altvstime.cpp
M  +0    -1    kstars/tools/altvstime.h

http://commits.kde.org/kstars/85cca8b7cfde2f7c3e5ad1c8000eeb2b2c76689a

diff --git a/kstars/tools/altvstime.cpp b/kstars/tools/altvstime.cpp
index 2563347..77679d4 100644
--- a/kstars/tools/altvstime.cpp
+++ b/kstars/tools/altvstime.cpp
@@ -76,6 +76,8 @@ AltVsTime::AltVsTime( QWidget* parent)  :
     avtUI->View->yAxis->setLabel("Altitude");
     avtUI->View->xAxis->setRange(43200, 129600);
     avtUI->View->xAxis2->setRange(61200, 147600);
+    avtUI->View->xAxis->setDateTimeSpec(Qt::UTC);
+    avtUI->View->xAxis2->setDateTimeSpec(Qt::UTC);
     avtUI->View->xAxis->setTickLabelType(QCPAxis::ltDateTime);
     avtUI->View->xAxis2->setTickLabelType(QCPAxis::ltDateTime);
     avtUI->View->xAxis->setDateTimeFormat("h:mm");
@@ -123,10 +125,6 @@ AltVsTime::AltVsTime( QWidget* parent)  :
     // set up the initial minimum and maximum altitude
     minAlt = 0;
     maxAlt = 0;
-    // set up the markers booleans for Rise/Set/Transit
-    markedRiseTime = false;
-    markedSetTime = false;
-    markedTransitTime = false;
     showCurrentDate();
     if ( getDate().time().hour() > 12 )
         DayOffset = 1;
@@ -407,8 +405,8 @@ void AltVsTime::plotMousePress(QCPAbstractPlottable *abstractPlottable, QMouseEv
             if(graph){
                 double key = 0;
                 double value = 0;
-                QTime localTime(2,0,0,0);
-                QTime localSiderealTime(7,0,0,0);
+                QTime localTime(0,0,0,0);
+                QTime localSiderealTime(5,0,0,0);
                 bool ok = false;
                 double m = std::numeric_limits<double>::max();
 
@@ -516,9 +514,8 @@ void AltVsTime::slotComputeAltitudeByTime(){
         double hours = timeFormat.hour();
         double minutes = timeFormat.minute();
         // convert the hours over 24 to correct their values
-        if( hours < 14 )
+        if( hours < 12 )
             hours += 24;
-        hours -= 2;
         double timeValue = hours * 3600 + minutes * 60;
         QCPGraph *selectedGraph;
         // get the graph's name from the name box
@@ -575,13 +572,12 @@ void AltVsTime::slotMarkRiseTime(){
         selectedGraph = avtUI->View->graph(graphIndex);
 
         QTime rt = selectedObject->riseSetTime( ut, geo, true ); //true = use rise time
-        // mark the Rise time with a red circle
+        // mark the Rise time with a solid red circle
         if ( rt.isValid() && selectedGraph ) {
             hours = rt.hour();
             minutes = rt.minute();
-            if( hours < 14 )
+            if( hours < 12 )
                 hours += 24;
-            hours -= 2;
             time = hours * 3600 + minutes * 60;
             riseTimeTracer = new QCPItemTracer(avtUI->View);
             avtUI->View->addItem(riseTimeTracer);
@@ -625,13 +621,12 @@ void AltVsTime::slotMarkSetTime(){
         QTime st = selectedObject->riseSetTime(  ut, geo, false ); //false = use set time
         if ( st < rt )
             st = selectedObject->riseSetTime( ut.addDays( 1 ), geo, false ); //false = use set time
-        // mark the Set time with a blue circle
+        // mark the Set time with a solid blue circle
         if ( rt.isValid() ) {
             hours = st.hour();
             minutes = st.minute();
-            if( hours < 14 )
+            if( hours < 12 )
                 hours += 24;
-            hours -= 2;
             time = hours * 3600 + minutes * 60;
             setTimeTracer = new QCPItemTracer(avtUI->View);
             avtUI->View->addItem(setTimeTracer);
@@ -673,14 +668,14 @@ void AltVsTime::slotMarkTransitTime(){
         QTime rt = selectedObject->riseSetTime( ut, geo, true ); //true = use rise time
         //If transit time is before rise time, use transit time for tomorrow
         QTime tt = selectedObject->transitTime( ut, geo );
+
         if ( tt < rt )
-        tt = selectedObject->transitTime( ut.addDays( 1 ), geo );
-        // mark the Transit time with a green circle
+          tt = selectedObject->transitTime( ut.addDays( 1 ), geo );
+        // mark the Transit time with a solid green circle
         hours = tt.hour();
         minutes = tt.minute();
-        if( hours < 14 )
+        if( hours < 12 )
             hours += 24;
-        hours -= 2;
         time = hours * 3600 + minutes * 60;
         transitTimeTracer = new QCPItemTracer(avtUI->View);
         avtUI->View->addItem(transitTimeTracer);
diff --git a/kstars/tools/altvstime.h b/kstars/tools/altvstime.h
index 551ab12..e32baab 100644
--- a/kstars/tools/altvstime.h
+++ b/kstars/tools/altvstime.h
@@ -184,7 +184,6 @@ private:
     int DayOffset;
     int minAlt;
     int maxAlt;
-    bool markedRiseTime, markedSetTime, markedTransitTime;
     double sunRise, sunSet;
 };
 


More information about the Kstars-devel mailing list