View Single Post
Posts: 1,320 | Thanked: 915 times | Joined on Feb 2010
#122
Originally Posted by colin.stephane View Post
Thanks for this perspicuous Fix, I like guys verifying behavior of modifications.

Now, the button to switch traffic on/off be refreshed properly ...

Also, I have reread all the thread, but not be able to find how to add the "auto" tick option, there is only the 2 original options "day" & "night" tick options.

If someone have the modification, feel free to put it here ...

A++
The traffic button refresh is a few posts above yours!


Originally Posted by nailwood View Post
When you click on the toggle item for the traffic mode in the main settings screen, you can see that the label changes to "Hide traffic" for a fraction of a second before the screen is closed - But when the settings screen is opened again, the label is still set to "Show traffic". So I found out this small UI improvement:

In assistanceModeSettingsPage.qml, line 207 (inside the block "onBeforeShow:"), you can add the following line:

buttonModel.updateTraffic();

This will show the label "Hide traffic" and the corresponding icon if traffic has been activated.

The changes for auto night switch are in this post.


Originally Posted by solstice88 View Post
Here is what i understood:

views\settings\mapModeSettingsPage.qml


uncomment the lines between 38 - 47

models\MapSettingsModel.qml


uncomment the lines between 88 - 91 and 129 - 163

views\assistancePage.qml

uncomment the lines between 100 - 105

sections of code that should have the /*, */ syntax removed.
And the changes to the isNight function to make auto switch work correctly is here.


Originally Posted by mbanck View Post
So I took a look at http://en.wikipedia.org/wiki/Sunrise_equation and http://users.electromagnetic.net/bu/...unrise-set.php

The drive-qml approximation for the declination is legit, it is equation 3 from http://solardat.uoregon.edu/SolarRadiationBasics.html

What seems to be missing is probably a better approximation of the sun transit, i.e. the true sun noon.

Otherwise, just some signs were apparently wrong in the sunrise/sunset calculation, with that fixed, it works well enough for me.

This is the patch: http://paste.debian.net/download/178685

Or inline:

Code:
--- /usr/lib/drive-qml/models/MapSettingsModel.qml.orig
+++ /usr/lib/drive-qml/models/MapSettingsModel.qml
@@ -135,8 +135,8 @@
         var lat_rad = pos.latitude * (Math.PI/180);
         var declination = (23.4*Math.PI)/180 * Math.sin(2*Math.PI * (284+dayOfTheYear)/365);
         var omega = Math.acos(-Math.tan(declination) * Math.tan(lat_rad));
-        var sunset = 12 - (1/15) * omega * (180/Math.PI) - pos.longitude/15 + today.getTimezoneOffset()/60;
-        var sunrise = 24  - sunset; //(1/15) * omega * (180/Math.PI) - pos.longitude/15 + today.getTimezoneOffset()/60;
+        var sunset = 12 + (1/15) * omega * (180/Math.PI) - pos.longitude/15 - today.getTimezoneOffset()/60;
+        var sunrise = 12  - (1/15) * omega * (180/Math.PI) - pos.longitude/15 - today.getTimezoneOffset()/60;
 
         console.log("Sunset:" + sunset);
         console.log("Sunrise:" + sunrise);
__________________
Well Nokia do at least know how to build a decent phone, just apparently don't know how to support it..

N900 Died Replaced with N8, Requested E7, "Accidentally Broke E7", Now rolling with an N9 and im loving it!


My Contributions

N900 Conversations Wiki Page
 

The Following 3 Users Say Thank You to godofwar424 For This Useful Post: