navit-project.org
http://forum.navit-project.org/

next street in route
http://forum.navit-project.org/viewtopic.php?f=12&t=516
Page 2 of 2

Author:  DAP [ 23 Aug 2014, 18:48 ]
Post subject:  Re: next street in route

tauso wrote:
DAP wrote:
Could you point me at some documentation describing what kind of conditionals are allowed in XML files?


Of course, it's in the Wiki. But i've tried the above for myself and it seams navigation.item doesn't work in this conditionals.

Unfortunately, it looks like "command=" only executes when someone clicks on an item. from the wiki: "The command will be called when the item is clicked.". So this is not useful in this context.

I did try an alternative I found in the wiki:
Code:
      <osd name="next_street_cmdif" update_period="1" enabled="yes" type="cmd_interface" w="450" h="25" x="200" y="15" command='osd_set_attr("next_street_text","label",
         ( navigation.item[1].street_name!="" && navigation.item[1].street_name_systematic !="")    ? navigation.item[1].street_name :
         ((navigation.item[2].street_name!="" && navigation.item[2].street_name_systematic !="")    ? navigation.item[2].street_name :
         ((navigation.item[3].street_name!="" && navigation.item[3].street_name_systematic !="")    ? navigation.item[3].street_name :
         ((navigation.item[4].street_name!="" && navigation.item[4].street_name_systematic !="")    ? navigation.item[4].street_name : navigation.item[5].street_name
         ))))
         '  />

Unfortunately, if this code is in the xml file, navit errors out on my pandora with the following error message:
./navit: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory

Once this happens, it is not sufficient to comment this code out, I must comment this code out, and then restart my pandora before I can run Navit again.
This makes it increadibly difficult to debug this code.

Author:  DAP [ 23 Aug 2014, 21:34 ]
Post subject:  Re: next street in route

I have installed Navit on my desktop for testing to avoid the problem on my Pandora. With this setup, I was able to find a few errors in my code and fix them. The code is currently as follows:
Code:
      <osd name="next_street_text" enabled="yes" type="text" label="initializing" x="200" y="0" />
      <osd name="next_street_cmdif" update_period="1" enabled="yes" type="cmd_interface" w="450" h="25" x="200" y="0" command='osd_set_attr("next_street_text","label",
         ( (navigation.item[1].street_name != "") &amp;&amp; (navigation.item[1].street_name_systematic != ""))    ? navigation.item[1].street_name :
         (((navigation.item[2].street_name != "") &amp;&amp; (navigation.item[2].street_name_systematic != ""))    ? navigation.item[2].street_name :
         (((navigation.item[3].street_name != "") &amp;&amp; (navigation.item[3].street_name_systematic != ""))    ? navigation.item[3].street_name :
         (((navigation.item[4].street_name != "") &amp;&amp; (navigation.item[4].street_name_systematic != ""))    ? navigation.item[4].street_name : navigation.item[5].street_name
         )))))
         '  />

Unfortunately, this results in a continuous stream of errors:
"navit:command_evaluate:error 10 starting at 1].street_name != "") && (navig"
It is not clear to me what it is complaining about, and google was not helpful here.

Author:  DAP [ 31 Aug 2014, 05:24 ]
Post subject:  Re: next street in route

I am stuck. I really don't know what to try next.
Does that error message mean that what I am trying to do is impossible?

Author:  DAP [ 26 Oct 2014, 18:10 ]
Post subject:  Re: next street in route

*crickets*

Author:  Jandegr [ 27 Oct 2014, 14:10 ]
Post subject:  Re: next street in route

DAP wrote:
*crickets*

their noise made me make a trac ticket for it




http://trac.navit-project.org/ticket/1271

regards,
Jan

Author:  DAP [ 27 Oct 2014, 16:09 ]
Post subject:  Re: next street in route

Jandegr wrote:
DAP wrote:
*crickets*

their noise made me make a trac ticket for it




http://trac.navit-project.org/ticket/1271

regards,
Jan


Thank you. Now I wonder how long this will take to filter down to the Pandora version.

Author:  Jandegr [ 29 Oct 2014, 16:48 ]
Post subject:  Re: next street in route

Hi,
solving it through command.c seems to be not trivial and those commands with
periodical reevaluation also take quite a bit of CPU.
With 5 of them active and a refresh of 1 second I can make the device unresponsive.
Below another solution, functionally almost identical to the solution with a command.
Code:
<osd enabled="yes" name="next_street" type="text" align="4" label=">${navigation.item[1].street_name} ${navigation.item[1].street_name_systematic}>${navigation.item[2].street_name} ${navigation.item[2].street_name_systematic}>${navigation.item[3].street_name} ${navigation.item[3].street_name_systematic}" w="320" x="125" y="135"/>


The available names shift to the left and the brackets give an indication of the number
of unnamed sections.
Unfortunatly through navigation.item we can only have street_name_systematic if there
is a street_name for the same section.

regards,
Jan

Author:  xj25vm [ 01 Jun 2016, 15:38 ]
Post subject:  Re: next street in route

This is a beautifully simple solution - thank you very much! This issue has been bugging me for a good while now - you glance at Navit and have no idea what road is next and what street sign you are supposed to look for. I've tried your suggestion on my laptop just now and it works a treat! On my laptop I could even add both the street_name and street_name_systematic - and it works for all the elements of the array.

Page 2 of 2 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/