maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N9 / N950 (https://talk.maemo.org/forumdisplay.php?f=51)
-   -   [MOD] Enable Traffic/Automatic day-night in Drive & Traffic in Maps (https://talk.maemo.org/showthread.php?t=85353)

colin.stephane 2012-07-16 11:06

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by Morpog (Post 1238164)
Nevermind, I didn't follow your link and assumed you added it to both :D

The last patch of mbanck was applied to Stable and Unstable, because if you look closely, you can see it's only the refresh subroutine for Day/Night auto-switch added to some well chose location to force the refresh.

That why I stated "since it doesn't hurt anything ..." in my message ...

A++

mbanck 2012-07-16 12:15

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Cosmetic change for the time-to-destination MOD:

- now rounds seconds to nearest 5 seconds, i.e. 23 -> 25, otherwise it updates ridiculously often

- never print spaces around "/" to make it fit better in the widget

- indentation fix

Patch (on top of the last one): http://paste.debian.net/download/179330

I tested the feature this morning and the reported time-to-destination values look correct and update smoothly.

colin.stephane 2012-07-16 12:54

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by mbanck (Post 1238199)
Cosmetic change for the time-to-destination MOD:

- now rounds seconds to nearest 5 seconds, i.e. 23 -> 25, otherwise it updates ridiculously often

- never print spaces around "/" to make it fit better in the widget

- indentation fix

Patch (on top of the last one): http://paste.debian.net/download/179330

I tested the feature this morning and the reported time-to-destination values look correct and update smoothly.

Hi mbanck,

As usual, thanks for your investigations !!!

I also tested the feature this morning to came at work, and it was already accurate even without this last patch.

Anyhow, I updated my full patch in section Unstable for this one ...

A++

jimthefly 2012-07-16 13:26

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Hi mbanck,

great work, but it is possible to reduce the font size of the distance and the time. Because it is not possible to see both.

Morpog 2012-07-16 13:36

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
No need to, Sony123 is working on a solution to switch both by touching it. Just like on Symbian (and I assume on WP).

taviman 2012-07-16 14:26

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by praveenchand (Post 1237888)
using terminal, goto the folder containing .deb file and type dpkg -i patchfilename


BusyBox v1.20.0.git (MeeGo 3:1.20-0.2+0m8) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ # cd /home/user
/home/user # dpkg -i patch_2.6-2+maemo7+0m6_arm
el.deb
Aegis rejecting patch_2.6-2+maemo7+0m6_armel.deb: Could not open debian archive
aegis aborting dpkg -- all listed package files rejected
Compilation failed in require.
/home/user #


I still cannot install the .deb.

colin.stephane 2012-07-16 14:33

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by taviman (Post 1238238)
BusyBox v1.20.0.git (MeeGo 3:1.20-0.2+0m8) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ # cd /home/user
/home/user # dpkg -i patch_2.6-2+maemo7+0m6_arm
el.deb
Aegis rejecting patch_2.6-2+maemo7+0m6_armel.deb: Could not open debian archive
aegis aborting dpkg -- all listed package files rejected
Compilation failed in require.
/home/user #

I still cannot install the .deb.

Don't connect directly as root, connect as user then switch to root with devel-su and finally dpkg -i /where_you_put_your/package.deb

A++

taviman 2012-07-16 14:52

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Got it. It was not my command sting but the place where the package was.
Aegis just didn't want to open the .deb from home/user.
I moved it to MyDocs and it went fine (so far).

My N9 helps me learn something new every day...

nbedford 2012-07-16 14:57

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
If I have already applied one .diff file using patch -p0 -i patch.diff, what is the correct way to go about updating to a new diff file.

Is there patch syntax to undo the previous .diff file, or does patch magically know what has already been changed and just apply the new additions in a later .diff file?

mbanck 2012-07-16 15:46

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by nbedford (Post 1238249)
Is there patch syntax to undo the previous .diff file, or does patch magically know what has already been changed and just apply the new additions in a later .diff file?

patch -R will unapply a patch.

jimthefly 2012-07-17 08:28

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Hi mbanck

how does the toggle button for Distance/Time-to-arrival work. If I'm push this, there are no effect for me. Only the time and distance is showing.

colin.stephane 2012-07-17 08:40

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by jimthefly (Post 1238594)
Hi mbanck

how does the toggle button for Distance/Time-to-arrival work. If I'm push this, there are no effect for me. Only the time and distance is showing.

Ok, let me clarify the situation ...

mbanck have already made al the TTD calculation logic working fine.

Now I'm in touch with sony123 for the toggle button TTD/Distance switch.

It would be better to wait until we tested the functionnality with sony123 before release any patch that can prevent the drive app to start (we are actually in this bad step ...).

So please wait and don't forget we all do the work in our free time ...

A++

jimthefly 2012-07-17 09:00

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Hi colin.stephane,
excuse my impatience. I've read about the role and was thrilled. This feature I miss most in Drive. And all of you do a great work.

colin.stephane 2012-07-17 09:11

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by jimthefly (Post 1238611)
Hi colin.stephane,
excuse my impatience. I've read about the role and was thrilled. This feature I miss most in Drive. And all of you do a great work.

No problems, but just for information sony123 go bed right now :-)

By the way I have made a big mistake, thinking I have updated the unstable full patch where it was not ...

I have corrected my mistake now.

To quickly apply :

- copy the patch (stable or unstable) to the device.

then devel-su and use this one line installation (modify the bold part to reflect your location) :

Code:

apt-get install -y --reinstall nokia-drive-qml && sync && patch -p0 -i /where_you_transfered_the/Patch-to-enable-traffic-and-day-night-autoswitch-in-drive-for-N9-PR1.3+ETA-UNSTABLE.diff
A++

mbanck 2012-07-17 10:47

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by colin.stephane (Post 1238600)
Now I'm in touch with sony123 for the toggle button TTD/Distance switch.

It would be better to wait until we tested the functionnality with sony123 before release any patch that can prevent the drive app to start (we are actually in this bad step ...).

Yay!

By the way, I think it would be neat to also calculate the ETA (estimated time of arrival, should be fairly easy), and have a three-way cycle DIST, TTD, ETA.

nbedford 2012-07-17 19:00

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Surely ETA is just current time + TTD

mbanck 2012-07-17 21:30

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by nbedford (Post 1238899)
Surely ETA is just current time + TTD

Yeah, modulo handling of units and seconds/minutesh/hours conversion. Fairly simple, as I said.

tomtom 2012-07-18 10:07

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by colin.stephane (Post 1237183)
Hi all,

After clarifications, here is a patch taking care of all remarks I found in this thread (auto Day/Night Mode, Traffic option enabled and properly refreshed button) :

Stable (Enable Traffic + Auto Switch Day/Night mode) :

- Patch-to-enable-traffic-and-day-night-autoswitch-in-drive-for-N9-PR1.3.diff

Unstable (Enable Traffic + Auto Switch Day/Night mode + Estimated Time Arrival) :

- Patch-to-enable-traffic-and-day-night-autoswitch-in-drive-for-N9-PR1.3+ETA-UNSTABLE.diff

Can someone apply it and report if all goes well ?

A++

- Edit #1 : Added changes from mbanck on post #143 ...
- Edit #2 : Like mbanck stated on post #146, reverting back, the time he can propose something more usable (correct refreshing of Distance/ETA).
- Edit #3 : Ok, to avoid troubles, managing a new full patch containing lasts changes about Estimated Arrival Time support from mbank on post #149.
- Edit #4 : Added latest patch from mbanck on post #152 to Stable & Unstable since it doesn't hurt ...
- Edit #5 : Added latest patch from mbanck on post #162 to Unstable (Refreshing & Cosmetic for TTD Time To Destination) ...

Pardon my n00biness, how does one install these patches? I appreciated the ease of jd4200's #27 post but have no idea how to use .diff files. Cheers.

jimthefly 2012-07-18 12:33

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by tomtom (Post 1239181)
Pardon my n00biness, how does one install these patches? I appreciated the ease of jd4200's #27 post but have no idea how to use .diff files. Cheers.

Hi tomtom,

look at the first thread and you find this command:

patch -p0 -i Patch-to-enable-traffic-and-day-night-autoswitch-in-drive-for-N9-PR1.3.diff

Iryus 2012-07-18 15:23

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by jimthefly (Post 1239226)
Hi tomtom,

look at the first thread and you find this command:

patch -p0 -i Patch-to-enable-traffic-and-day-night-autoswitch-in-drive-for-N9-PR1.3.diff


it don't works how install these .diff or mbanck's patch please.

Iryus 2012-07-18 15:34

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
-sh: patch: Operation not permitted etc etc in root user

Iryus 2012-07-18 21:20

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
I found how to do that thank you for these patches colin.stephane :D

colin.stephane 2012-07-19 13:07

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Hi all,

Glad to see you have been patient, so, sony123 ask me to give you the most awaited patch to be able to switch from Distance to Time To Destination ...

I have tested successfully during mid time to go restaurant, it worked like expected.

As usual, I have updated my full patch in section Unstable ...

Please report it worked properly on your device then I can remove the Unstable section to keep only one full patch as Stable.

Also, don't forget to thanks :

- sony123.
- nieldk.
- Arie.
- mbanck.
- nailwood.
- jd4200.

Because nothing can be done without all these guys working on there free time to debug, fix & enhance Nokia Drive application for our precious ...

A++

godofwar424 2012-07-19 13:23

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by colin.stephane (Post 1239755)
Hi all,

Glad to see you have been patient, so, sony123 ask me to give you the most awaited patch to be able to switch from Distance to Time To Destination ...

I have tested successfully during mid time to go restaurant, it worked like expected.

As usual, I have updated my full patch in section Unstable ...

Please report it worked properly on your device then I can remove the Unstable section to keep only one full patch as Stable.

Also, don't forget to thanks :

- sony123.
- nieldk.
- Arie.
- mbanck.
- nailwood.
- jd4200.

Because nothing can be done without all these guys working on there free time to debug, fix & enhance Nokia Drive application for our precious ...

A++

Can you please give the actual changes so that I can do this without using the patch. I prefer doing it manually.

Or just make a patch that ONLY contains this TTD fix.

colin.stephane 2012-07-19 13:36

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by godofwar424 (Post 1239765)
Can you please give the actual changes so that I can do this without using the patch. I prefer doing it manually.

Or just make a patch that ONLY contains this TTD fix.

Since sony123 and I have troubles to apply the TTD patch on my side (we not find why), then we manage the thing another way.

He sent me the full tree of '/usr/lib/drive-qml/' then I made a script to automatically track change between his work and the original files, and generate the unified diff file ...

So, I have no differential patch to provide.

By the way even reviewing the full patch by yourself doesn't require more than 5 minutes ...

A++

jimthefly 2012-07-19 13:46

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by colin.stephane (Post 1239755)
Hi all,

Glad to see you have been patient, so, sony123 ask me to give you the most awaited patch to be able to switch from Distance to Time To Destination ...

I have tested successfully during mid time to go restaurant, it worked like expected.

As usual, I have updated my full patch in section Unstable ...

Please report it worked properly on your device then I can remove the Unstable section to keep only one full patch as Stable.

Also, don't forget to thanks :

- sony123.
- nieldk.
- Arie.
- mbanck.
- nailwood.
- jd4200.

Because nothing can be done without all these guys working on there free time to debug, fix & enhance Nokia Drive application for our precious ...

A++

Hi colin.stephane,

i'll be able to test during the weekend long and hard.

Thanks at all for the hard and good work.

mbanck 2012-07-19 13:50

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by colin.stephane (Post 1239755)
Hi all,

Glad to see you have been patient, so, sony123 ask me to give you the most awaited patch to be able to switch from Distance to Time To Destination ...

I have tested successfully during mid time to go restaurant, it worked like expected.

Works great for me, many thanks to both of you!

godofwar424 2012-07-19 14:16

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by colin.stephane (Post 1239768)
Since sony123 and I have troubles to apply the TTD patch on my side (we not find why), then we manage the thing another way.

He sent me the full tree of '/usr/lib/drive-qml/' then I made a script to automatically track change between his work and the original files, and generate the unified diff file ...

So, I have no differential patch to provide.

By the way even reviewing the full patch by yourself doesn't require more than 5 minutes ...

A++

Yeah I did look at it manually, the thing I wanted to know, was what files it touches just for TTD.

mbanck 2012-07-19 15:29

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
So about traffic and taking it into account for routing:

in models/RoutingModel.qml, line 44 reads:

routeType: RouteOptions.TYPE_FASTEST

RouteOptions.TYPE_FASTEST translates to "1" if you print it out on the console. If I change that to

routeType: RouteOptions.TYPE_SHORTEST

that translates to "2", and I actually get the shortest route (will dismiss highways etc.).

Now I bet that the underlying code actually allows for traffic to be taken into account, my old Symbian Ovi Maps routing has an option "optimal", however RouteOptions.TYPE_OPTIMAL or RouteOptions.TYPE_OPTIMIZED does not seem to work (you get an error like "unable to assign [undefined] to int routeType" on the console).

However, when I set it to "3" manually via a property, I do not get an error. On the other hand, on some initial tests, traffic jams do not seem to get evaded either, so I am not sure what it means.

But if people want to test around, here is a patch: http://paste.debian.net/download/179798

(Setting routeOptionType to 2 instead of 3 clearly selects the shortest route for me)

Morpog 2012-07-19 15:29

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
I reinstalled drive-qml and applied your full unstable patch.

When I choose automatic for day/night mode, it shows only a blank ui without map data. Was working well with latest full stable patch.

http://www.abload.de/img/2012-07-19_17-35-457zktw.png

mbanck 2012-07-19 15:36

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Wow, I take that back - I just tried again, and it gave me a crazy route which is clearly neither the shortest nor the (previously) fastest...

Obviously, you need to have traffic enabled, and maybe wait a bit for it to be processed or something.

Fastest:

http://i49.tinypic.com/ma8d1x.png

Shortest:

http://i50.tinypic.com/2nvtctk.png

Presumably optimal:
http://i49.tinypic.com/rcja02.png

Note that traffic shows that there is indeed a traffic jams on the roads picked for fastest and (the last part of) shortest

WhitP 2012-07-19 16:50

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
mbanck - nice work!

I assume you're editing the files by hand? The ability to select this in the routing menu would be excellent!

sony123 2012-07-19 17:16

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by Morpog (Post 1239819)
I reinstalled drive-qml and applied your full unstable patch.

When I choose automatic for day/night mode, it shows only a blank ui without map data. Was working well with latest full stable patch.

I can re-produce this.... will take a look when I have time.
Temporary workaround is to toggle traffic for maps to be re-drawn. :p

solstice88 2012-07-19 18:09

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by mbanck (Post 1239818)
So about traffic and taking it into account for routing:

Now I bet that the underlying code actually allows for traffic to be taken into account, my old Symbian Ovi Maps routing has an option "optimal", however RouteOptions.TYPE_OPTIMAL or RouteOptions.TYPE_OPTIMIZED does not seem to work (you get an error like "unable to assign [undefined] to int routeType" on the console).

However, when I set it to "3" manually via a property, I do not get an error. On the other hand, on some initial tests, traffic jams do not seem to get evaded either, so I am not sure what it means.

(Setting routeOptionType to 2 instead of 3 clearly selects the shortest route for me)

This is awesome! mbanck, and sony123.

Are you guys secretly working as the Nokia Drive team at Nokia? haha! Keep up the great work! :cool:

Also thanks to colin.stephane once again for putting together and updating a patch. It provided me great learning experience in reading and editing qml code. :)

Arie 2012-07-19 18:11

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by solstice88 (Post 1239894)
This is awesome! mbanck, and sony123.

Are you guys secretly working as the Nokia Drive team at Nokia? haha! Keep up the great work! :cool:

Also thanks to colin.stephane once again for putting together and updating a patch. It provided me great learning experience in reading and editing qml code. :)

No they aren't the Nokia Drive team...

As funny as this sounds it can all be done, it just has to have work done to make it work, the good news is that ovi maps/drive is not closed source on our N9's :)

rainisto 2012-07-19 21:32

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by Morpog (Post 1239819)
I reinstalled drive-qml and applied your full unstable patch.

When I choose automatic for day/night mode, it shows only a blank ui without map data. Was working well with latest full stable patch.

http://www.abload.de/img/2012-07-19_17-35-457zktw.png

Yes I can confirm this bug, unstable fails day/night mode for me too.

mbanck 2012-07-19 21:36

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by WhitP (Post 1239870)
The ability to select this in the routing menu would be excellent!

If it is indeed the right setting (I am waiting on others to confirm this), it should be possible to integrate it into the UI. Probably no further artwork would be needed for this, just an entry "Preferred Route" or so along the other routing options (like ferry etc.) with the three sub-option "shortest, fastest and optimized". Just wondering how translations should be done for that.

mbanck 2012-07-19 21:55

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by rainisto (Post 1239980)
Yes I can confirm this bug, unstable fails day/night mode for me too.

This appears to be caused by my patch in #152: http://talk.maemo.org/showpost.php?p...&postcount=152

If you revert that one, do you still get that issue?

rainisto 2012-07-19 22:08

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by mbanck (Post 1239992)
This appears to be caused by my patch in #152: http://talk.maemo.org/showpost.php?p...&postcount=152

If you revert that one, do you still get that issue?

after the revert it seems to work. Atleast automatic is night currently, don't know if it turns to day in the morning :)

mbanck 2012-07-19 22:10

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by rainisto (Post 1240000)
after the revert it seems to work. Atleast automatic is night currently, don't know if it turns to day in the morning :)

Well, not automatically if you keep the app open - but it should be set correctly when you restart it.

Back to square one...


All times are GMT. The time now is 08:11.

vBulletin® Version 3.8.8