Re: [Svxlink-devel] Sending identification time
Brought to you by:
sm0svx
From: Tobias B. <sm...@us...> - 2011-10-29 14:25:19
|
On Sunday 23 October 2011 00.41.55 Volodymyr UR3QJW wrote: > Hello! > > Found this information: > > There are a couple of functions that can be used within a TCL function > > to make things happen in the SvxLink core. > > > > *playTime* /hour minute/ > > > > Play the specified time. For example "playTime 13 35" will produce > > "One Thirtyfive PM", when using an English language pack and > > "tretton trettiofem" with a Swedish language pack. > > http://sourceforge.net/apps/trac/svxlink/wiki/InstallationInstructions > > Please tell me. > How best to make. > Information to "Sending the identification of time" has been a 24-hour > format: > > "The time is: Twenty-One Thirty"(21:30). > > When choosing a Ukrainian or Russian language pack. Create a new directory in your language pack called "events.d". Copy the file there called "locale.tcl" from the global events.d directory. Also copy any other files there that you need to modify. Modify the functions that need modifications. Remove the untouched functions for better compatibility with later SvxLink updates. In the Swedish language pack, we use the modified locale.tcl below. 24 hour clock format is one thing that has been modified. 73's de SM0SVX / Tobias ############################################################################### # # 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. # # This file contains modifications of the functions to say # numbers and time, for the Swedish language. # ############################################################################### # # Say the specified three digit number (000 - 999) # proc playThreeDigitNumber {number} { if {[string length $number] != 3} { puts "*** WARNING: Function playThreeDigitNumber received a non three digit number: $number"; return; } set first [string index $number 0]; if {($first == "0") || ($first == "O")} { spellNumber $number } else { append first "00"; playMsg "Default" $first; if {[string index $number 1] != "0"} { playTwoDigitNumber [string range $number 1 2]; } elseif {[string index $number 2] != "0"} { playMsg "Default" [string index $number 2]; } } } # # 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 {$hour < 10} { set hour "0$hour"; } playTwoDigitNumber $hour; if {$hour > 9 && $minute >= 10} { playMsg "Default" and } else { playSilence 100 } if {$minute < 10} { set minute "0$minute"; } playTwoDigitNumber $minute; playSilence 100; } # # This file has not been truncated # |