Bílý vrch
icon TrekBuddy
www.trekbuddy.net
Outdoor companion.
  • internal / bluetooth / simulator GPS
  • offline raster maps
  • smart GPX / raw NMEA logs
  • waypoints and simple navigation
  • custom views
  • MIDP and Symbian phones
  • Blackberry
  • Android
Visit wiki to see all features, guides and howtos. Project tracker.

Partners:    (Polish/Polski)(Polski) Compass mapy      (Polish/Polski)(Polski) Galileos mapy      (Polish/Polski)(Polski) CartoMedia      (Czech/Èesky)(Èesky) Eaglesoft trasy      (Polish/Polski)(Polski) ExpressMap     

 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Unit system => Nautical, with dist-t displayed in km

 
Post new topic   Reply to topic    TrekBuddy Forum Index -> Themes
View previous topic :: View next topic  
Author Message
Lomic



Joined: 09 Dec 2009
Posts: 19

PostPosted: Sat Jun 28, 2014 8:48 am    Post subject: Unit system => Nautical, with dist-t displayed in km Reply with quote

I don't know how to deal with that, my units are nautical, I want speed in knots, but I want to display dist-t in kilometers, because right now I am constantly making mental arithmetic when I am sailing to know my distance in kilometers.

Is there a way to do that?

Will that be an answer:

Code:
<value>Distance: <script>print [* $cms::dist-t 1.852]</script> km</value>


Thanks
Back to top
View user's profile Send private message
Lomic



Joined: 09 Dec 2009
Posts: 19

PostPosted: Sat Jun 28, 2014 10:41 am    Post subject: Reply with quote

It does not work this way, I also tried:

Code:
<area x="50" y="268" w="100" h="48" font="Fd24" align="left">
   <value>Distance: </value>
</area>
<area x="70" y="268" w="100" h="48" font="Fd24" align="left">
   <script>print [* $cms::dist-t 1.852]</script>
</area>
<area x="90" y="268" w="10" h="48" font="Fd24" align="left">
   <value>km</value>
</area>
but I receive an IO error : file is a directory (wtf?)

I don't know how I am supposed to use the <script> tags.
Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5662

PostPosted: Sat Jun 28, 2014 4:17 pm    Post subject: Reply with quote

script element cannot be nested in value element, but the latter example looks fine (and works ok for me in emulator). What device are you using? Is script element really causing that strange I/O error? Could you send me complete xml file?

Last edited by kruch on Sat Jun 28, 2014 4:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
Lomic



Joined: 09 Dec 2009
Posts: 19

PostPosted: Sat Jun 28, 2014 4:22 pm    Post subject: Reply with quote

I think I've found where it goes wrong:

On the CMS I use there is a background image :
Code:
<screen mode="full" w="240" h="320" background="sail04.png">

I want to erase it, so I edited like this
Code:
<screen mode="full" w="240" h="320" background="">
Problem must be here, I should put something in "" of background or delete background parameter, not sure how to do it best

[Edit]yes the problem was there! thank you for your answer and all the good job on TB Wink

is there a way to write in landscape rather then portrait?
Back to top
View user's profile Send private message
kruch
Site Admin


Joined: 02 Jul 2006
Posts: 5662

PostPosted: Sat Jun 28, 2014 4:35 pm    Post subject: Reply with quote

It is not supported, but you can design CMS for landscape, it just won't fit into screen in portrait orientation.

When I was testing your script, I found a bug. If you use just scriptlets without HECL handler for location updated event, it will print 0.000 all the time for dist-t and any other variable.
Please copy the attached file to ui-profiles folder, the dummy script will make TB invalidate cached values with every location update.



dummy.hcl
 Description:

Download
 Filename:  dummy.hcl
 Filesize:  37 Bytes
 Downloaded:  8 Time(s)

Back to top
View user's profile Send private message
Lomic



Joined: 09 Dec 2009
Posts: 19

PostPosted: Sat Jun 28, 2014 4:50 pm    Post subject: Reply with quote

oh thanks!

Can I add the unit in the script output?

like
Code:
<script>print [* $cms::dist-t 1.852] Km</script>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    TrekBuddy Forum Index -> Themes All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group