icon TrekBuddy
www.trekbuddy.net
Outdoor companion.
  • bluetooth / serial / internal GPS, simulator
  • offline raster maps (common grids and projections)
  • smart GPX / raw NMEA logs
  • waypoints and simple navigation
  • ... and more
  • MIDP and Symbian phones
  • Blackberry
  • Android
  • Windows Mobile 5.x/6.x
  • Windows Phone coming
Visit our 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 
Help with some finer points of HECL please

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



Joined: 06 Jun 2008
Posts: 31

PostPosted: Sun Oct 25, 2009 1:20 am    Post subject: Help with some finer points of HECL please Reply with quote

Hi guys. I'm doing a hiking CMS that I hope to share shortly.
I thought I had the hang of HECL, but keep getting an 'Exception' on the screen - wonder if anyone can help?

#1. I set some previously defined variables ....
set mm::naismith-kph {3.0 3.5 4.0 5.0 5.5 6.0 6.5 7.0};
set mm::naismith-m100 {9.9 9.9 9.9 9.9 9.9 9.9 9.9 9.9};
set mm::i 0;

2. I attempt to work with the lists (assume the formulae are correct and that there's no division by zero)....
for {set mm::i 0} {< $mm::i 9} {incr $mm::i} {
set naismith-t1 [/ $cms::dist-t [lindex $mm::naismith-kph $mm::i ];
lset naismith-m100 $mm::i [/ [-$mm::timer-elapsed [* $mm::naismith-t1 3600]] [* 0.6 $mm::CumUp10]];
}

3. Then I try to print it out with a scriptlet
<area x="120" y="106" w="40" h="22" font="mm-16" align="left">
<script>print [lindex $mm::naismith-m100 2]</script>
</area>

This gives an 'Exception' Confused Syntax problem? Any help in preserving my sanity greatly appreciated !
Back to top
View user's profile Send private message
vincent



Joined: 11 Feb 2008
Posts: 196

PostPosted: Sun Oct 25, 2009 7:23 am    Post subject: Reply with quote

after a fast look at :

missing one braket

t1 [/ $cms::dist-t [lindex $mm::naismith-kph $mm::i ];

and on your xml file :

use instead for example :
<area x="356" y="428" w="63" h="19" font="smurf_digi_mc" align="right">
<value>{$vinc::speedbeammax}</value>
</area>

where you set this variable in your code with the lindex.
but if you succed to print ... take me an MP !

and... personnaly I don't use ";" in my code ... Smile

_________________
SE K750i + 512MB MS2 OR HTC Diamond + Qstarz BT-818 + Wintec 301 + latest TB
Back to top
View user's profile Send private message
MaxMunro



Joined: 06 Jun 2008
Posts: 31

PostPosted: Sun Oct 25, 2009 3:16 pm    Post subject: Reply with quote

Thanks Vincent - much appreciated.
1. missing bracket Embarassed

2. in the scriptlet, I am trying to print a specific item from a list created in the hecl code - I think this requires some sort of scriptlet???

3. am also having a problem with exposing cms::dist-t in the hecl code (as indicated below - says variable not defined), but I noticed you mentioned probelms with this on a recent post, and perhaps i need to upgrade from 0.9.84....I'll try this now. (using a blackberry 8310)

Thanks from diverting from your TB programming activities!!

--------------------------------------------------------
var cmsdist 0
proc mm::onLocationUpdated {} {
set mm::cmsdist $cms::dist-t
}

proc mm::onTrackingStart {} {
set mm::cmsdist 0
}

proc mm::onTrackingStop {} {
}

------------------
<area x="5" y="170" w="315" h="20" font="small" align="left">
<value>mm-cmsdist: {$mm::cmsdist}</value>
</area>
Back to top
View user's profile Send private message
vincent



Joined: 11 Feb 2008
Posts: 196

PostPosted: Sun Oct 25, 2009 3:27 pm    Post subject: Reply with quote

1 - as usual with hecl code !
2 - affect the item list value to a global variable and use this globa varaible inthe xml . that's much simpler to read the xml code.
3 - using $cms::dist-t without any problem. yes perhaps you should upgrade to the 0.9.90

the problem I got with this var is that the value of dist is not updated in each update location ... so it give me false results when used to compute average speed for example.


but before upgrade, you also could declare the same var name that you use in functions Wink

_________________
SE K750i + 512MB MS2 OR HTC Diamond + Qstarz BT-818 + Wintec 301 + latest TB
Back to top
View user's profile Send private message
MaxMunro



Joined: 06 Jun 2008
Posts: 31

PostPosted: Sun Oct 25, 2009 3:39 pm    Post subject: Reply with quote

Thanks again Vincent.
Yes - cms:: dist-t now showing, although I also had to inset mm:: in the following statement:
var cmsdist 0

Re dist-t updating, it seems to update on some combination of a) time and b) incremental distance travelled..

Cheers. Max. Very Happy
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