Time format

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Time format

ka2pbt
Is there any easy way to change the spoken time format from 12HR to 24HR ..... so far my thinking is I need to hack "playTime" in Locale.tcl .... 

Thanks,

--> Rob



------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel
Reply | Threaded
Open this post in threaded view
|

Re: Time format

Rob Janssen
ka2pbt wrote:
> Is there any easy way to change the spoken time format from 12HR to 24HR ..... so far my thinking is I need to hack "playTime" in Locale.tcl ....
>
> Thanks,
>
> --> Rob
>

That is correct.   But you need to think about how you actually announce the time and handle some special cases.

Right now the AM/PM serves as a nice terminator of the time field. "The time is four PM".  "The time is four thirty PM".

When you just cut out the AM/PM stuff in playTime, it will say "The time is four" when announcing at the top of the hour.
Probably you want to say "The time is four o'clock" or whatever is the local habit.

When you have a good solution, please share it.

Rob

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel
Reply | Threaded
Open this post in threaded view
|

Re: Time format

F5VMR Orange
The French voices I use include a tcl file that gives the time in 24 hour mode. It sits in the sound folder. Would you like me to look it out for you?

Sent from my iPhone

> On 26 Nov 2015, at 19:47, Rob Janssen <[hidden email]> wrote:
>
> ka2pbt wrote:
>> Is there any easy way to change the spoken time format from 12HR to 24HR ..... so far my thinking is I need to hack "playTime" in Locale.tcl ....
>>
>> Thanks,
>>
>> --> Rob
>
> That is correct.   But you need to think about how you actually announce the time and handle some special cases.
>
> Right now the AM/PM serves as a nice terminator of the time field. "The time is four PM".  "The time is four thirty PM".
>
> When you just cut out the AM/PM stuff in playTime, it will say "The time is four" when announcing at the top of the hour.
> Probably you want to say "The time is four o'clock" or whatever is the local habit.
>
> When you have a good solution, please share it.
>
> Rob
>
> ------------------------------------------------------------------------------
> Go from Idea to Many App Stores Faster with Intel(R) XDK
> Give your users amazing mobile app experiences with Intel(R) XDK.
> Use one codebase in this all-in-one HTML5 development environment.
> Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
> http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
> _______________________________________________
> Svxlink-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/svxlink-devel

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel
Reply | Threaded
Open this post in threaded view
|

Re: Time format

ka2pbt
In reply to this post by Rob Janssen
Thanks .... Understand .... I'm looking at something like "16 hours 23 minutes" or just "16 hours" on the hour .... kinda like WWV :)




--> Rob, KA2PBT
721st Mechanized Contest Battalion



On Thu, Nov 26, 2015 at 6:47 PM, Rob Janssen <[hidden email]> wrote:
ka2pbt wrote:
> Is there any easy way to change the spoken time format from 12HR to 24HR ..... so far my thinking is I need to hack "playTime" in Locale.tcl ....
>
> Thanks,
>
> --> Rob
>

That is correct.   But you need to think about how you actually announce the time and handle some special cases.

Right now the AM/PM serves as a nice terminator of the time field. "The time is four PM".  "The time is four thirty PM".

When you just cut out the AM/PM stuff in playTime, it will say "The time is four" when announcing at the top of the hour.
Probably you want to say "The time is four o'clock" or whatever is the local habit.

When you have a good solution, please share it.

Rob

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel
Reply | Threaded
Open this post in threaded view
|

Re: Time format

ka2pbt
In reply to this post by F5VMR Orange
Sure I'll take a look .. Thanks.


--> Rob, KA2PBT
721st Mechanized Contest Battalion



On Thu, Nov 26, 2015 at 7:11 PM, F5VMR <[hidden email]> wrote:
The French voices I use include a tcl file that gives the time in 24 hour mode. It sits in the sound folder. Would you like me to look it out for you?

Sent from my iPhone

> On 26 Nov 2015, at 19:47, Rob Janssen <[hidden email]> wrote:
>
> ka2pbt wrote:
>> Is there any easy way to change the spoken time format from 12HR to 24HR ..... so far my thinking is I need to hack "playTime" in Locale.tcl ....
>>
>> Thanks,
>>
>> --> Rob
>
> That is correct.   But you need to think about how you actually announce the time and handle some special cases.
>
> Right now the AM/PM serves as a nice terminator of the time field. "The time is four PM".  "The time is four thirty PM".
>
> When you just cut out the AM/PM stuff in playTime, it will say "The time is four" when announcing at the top of the hour.
> Probably you want to say "The time is four o'clock" or whatever is the local habit.
>
> When you have a good solution, please share it.
>
> Rob
>
> ------------------------------------------------------------------------------
> Go from Idea to Many App Stores Faster with Intel(R) XDK
> Give your users amazing mobile app experiences with Intel(R) XDK.
> Use one codebase in this all-in-one HTML5 development environment.
> Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
> http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
> _______________________________________________
> Svxlink-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/svxlink-devel

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel
Reply | Threaded
Open this post in threaded view
|

Re: Time format

F5VMR Orange
In reply to this post by Rob Janssen
Hi Rob & Rob,

Here is the File from our repeaters that all play 24 hour time.
The file itself site in the /usr/share/svxlink/sounds/fr_FR/events.d/ folder
so it it is selected by our versions.
I suppose the same could be done in yours Rob.

Best of luck. Not easy reading others code.

Chris F5VMR G4NAB

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel

locale.tcl (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Time format

Rob Janssen
F5VMR wrote:
> Hi Rob & Rob,
>
> Here is the File from our repeaters that all play 24 hour time.
> The file itself site in the /usr/share/svxlink/sounds/fr_FR/events.d/ folder
> so it it is selected by our versions.
> I suppose the same could be done in yours Rob.
>
> Best of luck. Not easy reading others code.
>

Yes we have used that on our repeater, but it says "The time is twenty" when it is 8PM.
We did not like that...

What Rob suggested, "The time is twenty hours", would be better.  Of course the proper
wav files for "hours" and "minutes" should be generated and added in that case.

For ka2pbt: make sure you check the procedure for adding local TCL code, by creating
a "local" directory and putting just the procs you are modifying into that.
Modifications of the original TCL files are overwritten whenever you update the software!

Rob

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel
Reply | Threaded
Open this post in threaded view
|

Re: Time format

Ken Koster
In reply to this post by ka2pbt
Catching up on my list reading I discovered:

ka2pbt wrote:
> Is there any easy way to change the spoken time format from 12HR to 24HR ..... so far my thinking is I need to hack "playTime" in Locale.tcl ....
>

I just recently got serious about using svxlink to replace the controller
on my 220Mhz repeater and here's my attempt at adding 24 hr announcements.

The only .wav file I needed to create was 'hundred.wav' which I made by
using audacity to edit the existing 100.wav file.

Use or modify as you wish.  Cut/Paste and put the resulting file in your
events.d/local directory.

Ken, N7IPB
------------------------------------------------locale.tcl--------------------------------
##############################################################################
#
# Locale specific functions for playing back time, numbers and spelling words.
# Often, the functions in this file are the only ones that have to be
# reimplemented for a new language pack.
#
# Modified to say time in 24hr format: "oh 4 hundred, 14 hundred, oh 412, oh 4 oh 2, etc."
# Ken Koster - N7IPB - 11 Nov 2015
###############################################################################
#
# Say the time specified by function arguments "hour" and "minute".
#
proc playTime {hour minute} {
  # Strip white space and leading zeros. Check ranges.
  if {[scan $hour "%d" hour] != 1 || $hour < 0 || $hour > 23} {
    error "playTime: Non digit hour or value out of range: $hour"
  }
  if {[scan $minute "%d" minute] != 1 || $minute < 0 || $minute > 59} {
    error "playTime: Non digit minute or value out of range: $hour"
  }
  if {$minute > 0} {
    if {$hour < 10} {
      playMsg "Default" O;
      playNumber  "[string index $hour 1]";
    } else {
     playNumber $hour;
    }
  #  playSilence 200
    if {$minute < 10} {
      playMsg "Default" O ;
      playNumber "[string index $minute 0]";
    } else {
       playNumber $minute;
    }
  } else {
    playMsg "Default" $hour;
    playMsg "Default" hundred;
  }
}

#
# This file has not been truncated
#

--
Ken - N7IPB
JID: [hidden email]
PGP Sig: F42B EF90 3CD3 31C7 3056  122E 993A 7B2E 5138 C42A

If the Police arrest a MIME, do they tell him he has the right to remain silent?

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Time format

Ken Koster
On Monday, November 30, 2015 11:13:17 PM [hidden email] wrote:
> Great stuff Ken, it was what I was alluding to.
> Chris

Actually there is at least one bug in it.  I noticed it last night when
it rolled over midnight.
Change the  "[string index $hour 1]" to  "[string index $hour 0]"
I had assumed that hours less than 10 were of the form '0x', they're not.

I'm sure there are others but I've only been running it on the test bench.

Now I'm off to play around making svxlink ID on SQL close with OPEN_SQL_FLANK
set to OPEN.

Ken

> Envoyé depuis l'application Mail Orange
>
> ----------------
> Le  01/12/2015  à  08:33:11, "Ken Koster" <[hidden email]> a écrit :
>
> Catching up on my list reading I discovered:
>
> ka2pbt wrote:
> > Is there any easy way to change the spoken time format from 12HR to 24HR ..... so far my thinking is I need to hack "playTime" in Locale.tcl ....
> >
>
> I just recently got serious about using svxlink to replace the controller
> on my 220Mhz repeater and here's my attempt at adding 24 hr announcements.
>
> The only .wav file I needed to create was 'hundred.wav' which I made by
> using audacity to edit the existing 100.wav file.
>
> Use or modify as you wish.  Cut/Paste and put the resulting file in your
> events.d/local directory.
>
> Ken, N7IPB
> ------------------------------------------------locale.tcl--------------------------------
> ##############################################################################
> #
> # Locale specific functions for playing back time, numbers and spelling words.
> # Often, the functions in this file are the only ones that have to be
> # reimplemented for a new language pack.
> #
> # Modified to say time in 24hr format: "oh 4 hundred, 14 hundred, oh 412, oh 4 oh 2, etc."
> # Ken Koster - N7IPB - 11 Nov 2015
> ###############################################################################
> #
> # Say the time specified by function arguments "hour" and "minute".
> #
> proc playTime {hour minute} {
>   # Strip white space and leading zeros. Check ranges.
>   if {[scan $hour "%d" hour] != 1 || $hour < 0 || $hour > 23} {
>     error "playTime: Non digit hour or value out of range: $hour"
>   }
>   if {[scan $minute "%d" minute] != 1 || $minute < 0 || $minute > 59} {
>     error "playTime: Non digit minute or value out of range: $hour"
>   }
>   if {$minute > 0} {
>     if {$hour < 10} {
>       playMsg "Default" O;
>       playNumber  "[string index $hour 1]";
>     } else {
>      playNumber $hour;
>     }
>   #  playSilence 200
>     if {$minute < 10} {
>       playMsg "Default" O ;
>       playNumber "[string index $minute 0]";
>     } else {
>        playNumber $minute;
>     }
>   } else {
>     playMsg "Default" $hour;
>     playMsg "Default" hundred;
>   }
> }
>
> #
> # This file has not been truncated
> #
>
>
--
Ken - N7IPB
JID: [hidden email]
PGP Sig: F42B EF90 3CD3 31C7 3056  122E 993A 7B2E 5138 C42A

If the Police arrest a MIME, do they tell him he has the right to remain silent?

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Svxlink-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/svxlink-devel

signature.asc (188 bytes) Download Attachment