View previous topic :: View next topic |
Author |
Message |
kruch Site Admin
Joined: 02 Jul 2006 Posts: 5676
|
Posted: Thu Mar 12, 2009 6:51 pm Post subject: 0.9.84-devel |
|
|
This is development snapshot of 0.9.84 with new CMS feature - integration of HECL scripting language (www.hecl.org). The build should be quite stable, but it is intended mainly for people interested in CMS, to get early feedback.
HECL may become extensibility vehicle for TB for features like live-tracking plugins, I plan to test it, we'll see. In this version, only its core is integrated, which should be enough for custom calculations, etc.
What is new in CMS?
Handlers for the following events can be defined:* onTrackingStart - invoked when trackign is started; possible use: reset custom variables
* onTrackingStop
* onLocationUpdated - invoked when new location is received; example use: calculate custom variables
* onKeyPress - invoked when key 2 / joy up is pressed (the only key left ); example use: change custom variable scale
The handler(s) must be defined in a text file with .hcl extension. Example (rather stupid):
Code: |
var kruch::xxx 0
proc kruch::onTrackingStart {} {
set kruch::xxx 0
}
proc kruch::onLocationUpdated {} {
set kruch::xxx [* $cms::spd 3.14]
} |
In the script file, custom variables may be defined and later used in the screen definition:
Code: |
<area x="0" y="0" w="80" h="20">
<value>{$kruch::xxx}</value>
</area> |
For very simple stateless formulas, you can embed scriptlet directly:
Code: |
<area x="0" y="20" w="80" h="20">
<script>print [* $cms::spd 3.14]</script>
</area> |
I suggest to use developer-specific prefixes for global variables, handlers (procedures) to avoid collisions since users may use profiles from more designers. I favour C++like "namespacing" which I used in the above examples (kruch::), and I would also use kruch.hcl and cms.kruch.xml filenames.
More complex example: http://www.trekbuddy.net/forum/viewtopic.php?t=2923
The following TB-specific HECL commands were added:
var - declares global variable that may be used in screen
print - "prints" argument(s) to area valuearea
The following TB variables (subject to change) are available during script execution:
cms::profile
cms::course
cms::course-d
cms::asc-t
cms::desc-t
cms::dist-t
cms::alt
cms::alt-d
cms::hdop
cms::fix
cms::sat
cms::satv
cms::spd
cms::spd-avg-auto
cms::spd-avg
cms::spd-max
They are the same variables already available but prefxied with cms::, except for cms::profile, which is filename of currently
displayed screen.
You can get status of last invocation of your handler as a variable with the same name, eg. if you have a handler
Code: |
proc xxx::onLocationUpdated {} { ... |
then variable $xxx::onLocationUpdated will either be "{SUCCESS}" or (hecl)exception that occured during handler processing.
To play with HECL, you can eg. download HECL distribution, and run your script with commandline like java -jar jars\j2se\hecl.jar test.hcl.
http://www.trekbuddy.net/beta/0984-20090312.zip (generic version)
This build also contains:
- UIQ back key fix
- larger max map scrolling step
- "north-locking" on compass screen (press key 5 / FIRE)
- sliding compass feature in CMS (willbe demonstrated in the announced example too)
- various changes here and there (input handling etc)
2009-07-02 22:00 newer build:
- Blackberry "white screen" fix
- CMS/HECL bugfixes
- new CMS/HECL vars: cms::lat, cms::lon, cms::time (time of the fix, not system), cms::utm_x, cms::utm_y, cms::wpt-azi
generic version
blackberry 4.2+ version
Last edited by kruch on Thu Jul 02, 2009 8:08 pm; edited 15 times in total |
|
Back to top |
|
 |
vincent
Joined: 11 Feb 2008 Posts: 196
|
Posted: Thu Mar 12, 2009 7:12 pm Post subject: |
|
|
directly to test this huge upgrade !  _________________ SE K750i + 512MB MS2 OR HTC Diamond + Qstarz BT-818 + Wintec 301 + latest TB |
|
Back to top |
|
 |
kruch Site Admin
Joined: 02 Jul 2006 Posts: 5676
|
Posted: Thu Mar 12, 2009 7:16 pm Post subject: |
|
|
You are fast! I suggest to wait for the announced example  |
|
Back to top |
|
 |
vincent
Joined: 11 Feb 2008 Posts: 196
|
Posted: Thu Mar 12, 2009 7:21 pm Post subject: |
|
|
ok ok ...but it's so enormous that .... _________________ SE K750i + 512MB MS2 OR HTC Diamond + Qstarz BT-818 + Wintec 301 + latest TB |
|
Back to top |
|
 |
MaleSMurf
Joined: 10 Sep 2007 Posts: 120
|
|
Back to top |
|
 |
vincent
Joined: 11 Feb 2008 Posts: 196
|
Posted: Thu Mar 12, 2009 7:39 pm Post subject: |
|
|
the download link of beta do not work for me ? _________________ SE K750i + 512MB MS2 OR HTC Diamond + Qstarz BT-818 + Wintec 301 + latest TB |
|
Back to top |
|
 |
kruch Site Admin
Joined: 02 Jul 2006 Posts: 5676
|
Posted: Thu Mar 12, 2009 8:19 pm Post subject: |
|
|
What ??  |
|
Back to top |
|
 |
vincent
Joined: 11 Feb 2008 Posts: 196
|
Posted: Thu Mar 12, 2009 8:56 pm Post subject: |
|
|
my reliable provider .. grgrgr !
ok now ... _________________ SE K750i + 512MB MS2 OR HTC Diamond + Qstarz BT-818 + Wintec 301 + latest TB |
|
Back to top |
|
 |
Wunibald
Joined: 29 Jul 2008 Posts: 35
|
Posted: Fri Mar 13, 2009 6:20 pm Post subject: |
|
|
... great, works very good !!!
W. |
|
Back to top |
|
 |
milan.zeleznik
Joined: 04 Mar 2008 Posts: 25
|
Posted: Fri Mar 13, 2009 10:01 pm Post subject: |
|
|
Works great! ...
...but I'm still missing total-ascend & total descent data  _________________ Samsung Galaxy Core 2
http://mygpx.blogspot.com |
|
Back to top |
|
 |
MaleSMurf
Joined: 10 Sep 2007 Posts: 120
|
Posted: Fri Mar 13, 2009 10:14 pm Post subject: |
|
|
With HECL you can code these features...
Thats the reason why HECL is implemented in TB...
Well, I'll think about it how this could be done... |
|
Back to top |
|
 |
milan.zeleznik
Joined: 04 Mar 2008 Posts: 25
|
Posted: Fri Mar 13, 2009 10:28 pm Post subject: |
|
|
@MaleSMurf:
Yes, that's right. But you are IN this code, I'm not...
I'm glad to hear: I will think about...  _________________ Samsung Galaxy Core 2
http://mygpx.blogspot.com |
|
Back to top |
|
 |
MaleSMurf
Joined: 10 Sep 2007 Posts: 120
|
Posted: Fri Mar 13, 2009 10:31 pm Post subject: |
|
|
@milan.zeleznik
IN this code...
I had some sleepless nights to get my new CMS with HECL working.  |
|
Back to top |
|
 |
milan.zeleznik
Joined: 04 Mar 2008 Posts: 25
|
Posted: Fri Mar 13, 2009 11:21 pm Post subject: |
|
|
Quote: |
I had some sleepless nights |
I can imagine... _________________ Samsung Galaxy Core 2
http://mygpx.blogspot.com |
|
Back to top |
|
 |
kruch Site Admin
Joined: 02 Jul 2006 Posts: 5676
|
|
Back to top |
|
 |
|