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 
GPS time (Solved)
Goto page Previous  1, 2
 
Post new topic   Reply to topic    TrekBuddy Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
JNT



Joined: 10 Jan 2009
Posts: 407
Location: Sweden

PostPosted: Tue Sep 05, 2017 1:53 pm    Post subject: Reply with quote

I vaguely remember playing with http://www.hecl.org/docs/clock.html in my first sailing CMS. Might work for your case.
Back to top
View user's profile Send private message
boowoo



Joined: 12 Jun 2013
Posts: 518
Location: France

PostPosted: Tue Sep 05, 2017 7:20 pm    Post subject: Reply with quote

Thanks JNT, i'll try to experiment but i need to learn a little before ...
Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 407
Location: Sweden

PostPosted: Tue Sep 05, 2017 7:52 pm    Post subject: Reply with quote

The main problem is that there is no easy way to format variables as time (or duration). How I do it (not necessarily the best way):
Code:
    set sail::test1 [sail::timeformat [+ [sail::spt [clock time]] [* 3600 $sail::t-zone]]];


Extra functions required due to the lack of formatting options.

Code:

##### Calculates seconds past today #####
proc sail::spt {num-in} {
  return [* [- [/ [double $num-in] 86400000] [floor [/ [double $num-in] 86400000]]] 86400];
}
#
#
##### Formats number into time hh:mm:ss #####
proc sail::timeformat {time-in} {
  set sail::n-days 0;
  if {< $time-in 0} {
    set time-out "-";
    set time-in [- 0 $time-in];
  } else {
    set time-out "";
    }
    set sail::hrs [round [floor [/ $time-in 3600]]];
    set sail::min [round [floor [/ [- $time-in [* $sail::hrs 3600]] 60]]];
    set sail::sec [round [floor [- $time-in [+ [* $sail::hrs 3600] [* $sail::min 60]]]]];

    if {> $sail::hrs 23} {
      set sail::n-days [round [floor [/ $sail::hrs 24]]];
      append $time-out "+";
      append $time-out $sail::n-days;
      append $time-out "d ";
      set sail::hrs [- $sail::hrs [* $sail::n-days 24]];
    }
    if {< $sail::hrs 10} {
      append $time-out "0";
    }
    append $time-out $sail::hrs;
    append $time-out ":";
    if {< $sail::min 10} {
      append $time-out "0";
    }
    append $time-out $sail::min;
    if {< $sail::n-days 1} {
      append $time-out ":";
      if {< $sail::sec 10} {
        append $time-out "0";
      }
      append $time-out $sail::sec;
    }
    return $time-out;
}
Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 407
Location: Sweden

PostPosted: Tue Sep 05, 2017 8:00 pm    Post subject: Reply with quote

If you don't mind having the full hecl clock format you can do it directly in the xml file:
Code:
        <area x="50" y="100" w="900" h="60" font="Sb60" align="center">
            <script>print [clock format [clock time]] </script>
        </area>
Back to top
View user's profile Send private message
boowoo



Joined: 12 Jun 2013
Posts: 518
Location: France

PostPosted: Tue Sep 05, 2017 8:44 pm    Post subject: Reply with quote

Thank you very much for all.
hecl is hard for me (i don't have your level ...)
In XML, when i use
code : <script>print [clock format [clock time]] </script>
the result in my CMS is the date shown Tue Sep ... It's right but i would like only time like 22:45
What's wrong ?
Back to top
View user's profile Send private message
JNT



Joined: 10 Jan 2009
Posts: 407
Location: Sweden

PostPosted: Wed Sep 06, 2017 11:14 am    Post subject: Reply with quote

Yes, that is unfortunately exactly the problem. There is no easy way (yet...) to format it as "time".
Doing it directly in the xml file you get the full date and time format.
If you want pure time, then you have to do it in the hecl file and format the variable yourself with the extra user functions.

One of my submitted wishes is to be able to format the display of variables more easily.
Back to top
View user's profile Send private message
boowoo



Joined: 12 Jun 2013
Posts: 518
Location: France

PostPosted: Wed Sep 06, 2017 11:28 am    Post subject: Reply with quote

Thanks for explanation ...
Manage hecl file is not for me yet ... I'll wait Kruch advice about this request !
Back to top
View user's profile Send private message
boowoo



Joined: 12 Jun 2013
Posts: 518
Location: France

PostPosted: Wed Oct 04, 2017 6:53 am    Post subject: Reply with quote

End of story ... Smile and Evil or Very Mad
Finally, my problem came from bad android 7 integration on Blackview BV6000 !
The solution for me to get a right GPS time, was to flash the phone and rollback to android 6 whitch is a more stable version for this device.
Now, my GPS time is displayed correctly in TrekBuddy but this phone has been a pain for me (Good on paper but many hardware/software problems since the beginning !)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    TrekBuddy Forum Index -> Bugs All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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