Hi!

here is my small python script to test navit-dbus plugin:
you have to pass "lat" and "long" as params to the script, and navit will set 
this a target for routing


=============================================================================
#!/usr/bin/python

import dbus
import math
import sys

lat=float(sys.argv[1])
long=float(sys.argv[2])

bus = dbus.SessionBus()
conn = bus.get_object('org.navit_project.navit','/org/navit_project/navit')
iface = dbus.Interface(conn, dbus_interface='org.navit_project.navit');
iter=iface.iter();
navit=bus.get_object('org.navit_project.navit', conn.get_navit(iter));
iface.iter_destroy(iter);
navit_iface = dbus.Interface(navit, 
dbus_interface='org.navit_project.navit.navit');

# Show a message in Navit
navit_iface.add_message("Geocache Ziel");
# M_PI=math.pi
M_PI=3.1415926535897931
# M_PI_4=math.pi/4
M_PI_4=0.78539816339744828
# x=long*6371000.0*float(M_PI)/float(180)
x=long*111194.92664455873
y=math.log(math.tan(M_PI_4+lat*M_PI/360))*6371000.0
# Set as route destination
navit_iface.set_destination((1,int(x),int(y)),'geocache');
=============================================================================


        Z.

Martin Jansa wrote:
> On Sun, Jan 10, 2010 at 11:55:45AM +0100, Christian Rüb wrote:
>>> On Sat, Jan 09, 2010 at 07:19:49PM +0100, Zoff wrote:
>>>>> have you tried to add "unset LC_ALL&&" to Exec param in navit.desktop?
>>>>> it works for me
>>>> i also have this in MY desktop file.
>>>> i want it fixed for ALL users , not only for myself.
>>>
>>> Sent with small svnrev bump
>>> http://git.openembedded.org/cgit.cgi/openembedded/commit/?id=182b7546b2fd5fa27ecb8c606fe5ad8c95f76ee2
>>
>> If you are just about navit - could you make dbus plugin be turned on by 
>> default? Or are there any reasons for not doing so? It is not turned on in 
>> navit's default config.
>>
>> Do you need a patch?
>
> I never used/started navit with dbus, So I'm not sure how to do that or
> test it properly, so please send a patch for OE repo.
>
> IIRC:
>  From what I've seen there was additional navit.service file in some patch
> from playya, but then the same file was added in navit source directly,
> so I removed the additional one from OE files and adjusted bb recipe to
> install navit.service from source.
>
>> Thanks.
>>
>> Christian
>> _______________________________________________
>> Shr-devel mailing list
>> [email protected]
>> http://lists.shr-project.org/mailman/listinfo/shr-devel
>

-- 
"My malpractice insurance doesn’t cover alien autopsies."
_______________________________________________
Shr-devel mailing list
[email protected]
http://lists.shr-project.org/mailman/listinfo/shr-devel

Reply via email to