Opened 8 years ago

Closed 8 years ago

#648 closed enhancement/feature request (fixed)

Odometer OSD

Reported by: tegzed Owned by: number6
Priority: minor Milestone:
Component: osd/core Version: git master
Severity: Keywords: odometer osd
Cc:

Description

Hello,

I have created a simple odometer OSD module for navit that displays the distance since initial start or reset (see attached patch). The usage is similar to stopwatch OSD (see ticket ##643). Single click starts/pauses counting, double click resets the odometer. If you find it useful please check it in to svn.

Regards, David Tegze

Attachments (4)

osd_core.c.odometer.diff (6.5 KB) - added by tegzed 8 years ago.
Patch to add odometer osd
osd_core.c.patch (2.6 KB) - added by chr 8 years ago.
make the idle text color user selectable with 'text_color'
color.patch2 (3.7 KB) - added by chr 8 years ago.
change color selection of the odometer and the stopwatch
persistent_odometer.diff (7.1 KB) - added by tegzed 8 years ago.
persistent odometer

Download all attachments as: .zip

Change History (16)

comment:1 in reply to: ↑ description Changed 8 years ago by tegzed

One note about the configuration: You will need an osd tag with type attribute set to "odometer" in your navit.xml. My entry looks like this:

<osd enabled="yes" type="odometer" w="150" h="40"  x="30" y="250"   font_size="500" />

Replying to http://wiki.navit-project.org/index.php/user:tegzed:

Hello,

I have created a simple odometer OSD module for navit that displays the distance since initial start or reset (see attached patch). The usage is similar to stopwatch OSD (see ticket ##643). Single click starts/pauses counting, double click resets the odometer. If you find it useful please check it in to svn.

Regards, David Tegze

comment:2 Changed 8 years ago by number6

  • Owner changed from Singesang to number6
  • Status changed from new to assigned

comment:3 Changed 8 years ago by number6

I like your patch, David.

Three things, from a usability standpoint.

1) Before the odometer is active, leave the text as green. 2) When the odometer is active, please have the text changed to white. 3) When the odometer is paused, please have the text changed to orange or red.

It can be very hard for the user to know what state the odometer is in.

Nick

comment:4 Changed 8 years ago by number6

  • Cc nick@… added

comment:5 Changed 8 years ago by tegzed

Hello Number6,

Thanks for your suggestion, I'll implement it soon, possibly I'll find a way to display the average speed of the measured intervals optionally also. Maybe I will use a format string substitution similar to osd text. I will also give colors to stopwatch osd (#643) accordingly.

Changed 8 years ago by tegzed

Patch to add odometer osd

comment:6 Changed 8 years ago by number6

  • Cc nick@… removed
  • Resolution set to fixed
  • Status changed from assigned to closed

It should be used as follows:

<osd enabled="yes" type="odometer" w="350" h="40" x="30" y="300" font_size="450" label="Dst:${distance} ; Spd:${avg_spd}" />

Distance== Total distance Travelled avg_spd == Average speed.

This feature was added in Revision 3557

Keep up the good work, David.

comment:7 Changed 8 years ago by chr

  • Resolution fixed deleted
  • Status changed from closed to reopened

Hi David,

thank you for these cool new features (odometer and stopwatch)! I love them and have to pay attention to keep driving not playing :-)

When using a blue background like 'background_color="#646FC3cc"' I can't distinguish 'orange' from 'white' very well. Thus I suggest the following patch, which makes the idle text color selectable by the user. The patch holds for the odometer and the stopwatch. The idle text color is selected by the 'text_color' arg via navit.xml.

I use the odometer and the stopwatch as follows:

<osd enabled="yes" type="odometer" text_color="#00ffffff" w="350" h="20" x="200" y="0" font_size="300" background_color="#646FC3cc" label="Dst:${distance} ; Spd:${avg_spd}" />
<osd enabled="yes" type="stopwatch" text_color="#00ffffff" w="100" h="20"  x="550" y="0" font_size="300" background_color="#646FC3cc" />

@admin: <CR>'s from DOS appeared in osd_core.c. My 'svn diff' ignores the eol-style, because I removed some <CR>'s in my local copy.

Regards, Christian

Changed 8 years ago by chr

make the idle text color user selectable with 'text_color'

comment:8 Changed 8 years ago by tegzed

Thanks Chr! Good idea, maybe it worth implementing it in stopwatch(#643) also and augmenting the wiki so the users know how to use this.

David

comment:9 Changed 8 years ago by number6

Hi Chr,

I like your idea. The user should be able to override the standard white and orange colour by using flags in nativ.xml

Can you create a diff that will do both the Odometer and stopwatch?

Regards,

Nick

comment:10 Changed 8 years ago by chr

Hi,

@David, @Nick: I expect the supplied attachment 'osd_core.c.patch' already to contain the diff for both, the odometer and the stopwatch. Am I wrong?

The patch (diff) has been generated with the following command:

LC_ALL=C svn diff -x --ignore-eol-style  navit/osd/core/osd_core.c >../osd_core.c.patch

Do you ask for something else?

After reading http://wiki.navit-project.org/index.php/OSD#Color I think we should first make a good choice for the attributes. Odometer and stopwatch should use the attributes in a consistent way with the other types. I like the following idea. What is now hardcoded 'white' should become selectable with 'text_color' and what is now 'orange' should get a new attribute may be 'idle_color'.

What do you think?

Bye, Christian

comment:11 Changed 8 years ago by chr

Hi,

here comes an alternative patch for the color selection of 'odometer' and 'stopwatch' as suggested before, 'color.patch2'. It can be used in the following way:

<osd enabled="yes" type="odometer" idle_color="#00ff00" text_color="#ffffff" w="350" h="20" x="200" y="0" font_size="300" background_color="#646FC3cc" label="Dst:${distance} ; Spd:${avg_spd}" />
<osd enabled="yes" type="stopwatch" idle_color="#00ff00" text_color="#ffffff" w="100" h="20"  x="550" y="0" font_size="300" background_color="#646FC3cc" />

'text_color' defaults to 'white' and 'idle_color' defaults to 'orange'.

Regards, Christian

Changed 8 years ago by chr

change color selection of the odometer and the stopwatch

comment:12 Changed 8 years ago by number6

  • Resolution set to fixed
  • Status changed from reopened to closed

Added in Revision 3568, thanks Chr!

Changed 8 years ago by tegzed

persistent odometer

Note: See TracTickets for help on using tickets.