Opened 8 years ago

Last modified 6 years ago

#895 new defect/bug

hide speed and ETA indicators if there's no destination set

Reported by: andrea piras 85 Owned by: Singesang
Priority: minor Milestone: version 0.6.0
Component: osd/core Version: git master
Severity: Keywords: osd, speed
Cc:

Description

currently, on the android port, when visualizing a map, the window frames that will contain eta, and speed are still visible ( and empty ) even if there's no destination set, it's pointless to display them and they distract / take away useful space to view the map ( I know they are partially transparent, but still ... )

Change History (4)

comment:1 Changed 8 years ago by stkauwitz

There is a solution via OSD Layout. See the XML-Part in http://wiki.navit-project.org/index.php/OSD_Layouts#Netbook_Layout_2

It switches the OSD-Configuration dependend on the route_status. It works very well on my Android-Tablet.

<!-- Distance to Next Maneouvre -->
<osd enabled="yes" type="text" label="${navigation.item[1].length[named]}" x="0" y="0" font_size="350" w="75" h="30" align="0" background_color="#000000c8" osd_configuration="2" />
<!-- Next Maneouvre Icon -->
<osd enabled="yes" type="navigation_next_turn" x="0" y="30" background_color="#000000c8" w="75" osd_configuration="2" />
<!-- Next Road -->
<osd enabled="yes" type="text" label="   ${navigation.item[1].street_name} ${navigation.item[1].street_name_systematic}" x="75" y="0" font_size="450" w="824" h="40" align="4" background_color="#000000c8" osd_configuration="2" />

<!-- Enable/Disable routing information depending upon the route status -->
<osd name="my_osd_cmdif_2" h="1" w="1"  update_period="2"  enabled="yes" type="cmd_interface" x="-1"  y="-1" command='osd_configuration=
route.route_status==1     ? 1 : 
(route.route_status==0     ? 1 :  
(route.route_status==3     ? 1 : 
(route.route_status==5     ? 1 : 
(route.route_status==13    ? 1 : 
(route.route_status==17    ? 2 : 
(route.route_status==33    ? 2 : 1
)))))))
' />

comment:2 Changed 8 years ago by tryagain

looks like the

route.route_status==1     ? 1 : 
(route.route_status==0     ? 1 :  
(route.route_status==3     ? 1 : 
(route.route_status==5     ? 1 : 
(route.route_status==13    ? 1 : 
(route.route_status==17    ? 2 : 
(route.route_status==33    ? 2 : 1
)))))))

phrase can be as simple as

(route.route_status==17    ? 2 : 
(route.route_status==33    ? 2 : 1
))

or even as

(route.route_status==17 || route.route_status==33) ? 2 : 1

And even more short one,

(route.route_status & 48 )!=0 ? 2 : 1

comment:3 Changed 8 years ago by korrosa

Ha! That was my layout being quoted, and I guess I did it like that so it was easy to see what's going on. I like how it can all be shortened to one line - good work tryagain!

comment:4 Changed 6 years ago by usul

  • Keywords osd speed added
  • Milestone set to version 0.6.0

So looks to be solved? Maybe a short method would be great, that doesn't create so much hard to read code.

Note: See TracTickets for help on using tickets.