The Following 8 Users Say Thank You to mbanck For This Useful Post: | ||
|
2012-07-12
, 04:02
|
Moderator |
Posts: 6,215 |
Thanked: 6,400 times |
Joined on Nov 2011
|
#112
|
|
2012-07-12
, 07:41
|
Guest |
Posts: n/a |
Thanked: 0 times |
Joined on
|
#113
|
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);
The Following 2 Users Say Thank You to For This Useful Post: | ||
|
2012-07-12
, 07:43
|
Posts: 11 |
Thanked: 5 times |
Joined on Jun 2012
@ Russia
|
#114
|
The Following 2 Users Say Thank You to 3sigma For This Useful Post: | ||
|
2012-07-12
, 08:51
|
Posts: 1 |
Thanked: 9 times |
Joined on Feb 2012
@ Vienna
|
#115
|
The Following 9 Users Say Thank You to nailwood For This Useful Post: | ||
|
2012-07-12
, 09:29
|
Posts: 36 |
Thanked: 28 times |
Joined on Jul 2011
@ Germany
|
#116
|
The Following User Says Thank You to MaikEF For This Useful Post: | ||
|
2012-07-12
, 10:20
|
Posts: 24 |
Thanked: 7 times |
Joined on Apr 2006
|
#117
|
|
2012-07-12
, 10:28
|
|
Posts: 234 |
Thanked: 175 times |
Joined on Jun 2010
@ Genova (Italy)
|
#118
|
i think, the better way to switch day/night is to use the lightsensor... itīs more helpfull in tunnel...
is there a possibility to realice so?
I would also prefer a solution in help of the light sensor. I think this is a better way to switch between day and night.
|
2012-07-12
, 10:51
|
Posts: 1,320 |
Thanked: 915 times |
Joined on Feb 2010
|
#119
|
|
2012-07-12
, 11:50
|
Posts: 458 |
Thanked: 783 times |
Joined on Jan 2010
@ France
|
#120
|
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 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: