Module morseToneGeneration :: Class MorseGenerator
[hide private]
[frames] | no frames]

Class MorseGenerator

source code

object --+
         |
        MorseGenerator

Manages non-UI issues for Morse code generation: Interacts with the tone generator, regulates auto dot/dash generation speed.

Nested Classes [hide private]
  DotGenerator
  DashGenerator
Instance Methods [hide private]
 
__init__(self, callback=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
startMorseSeq(self, morseElement)
Start a sequence of dots or dashes.
source code
 
stopMorseSeq(self)
Stop a running sequence of dots or dashes.
source code
 
abortCurrentMorseElement(self) source code
 
setAutoMorse(self, yesNo)
Determine whether dots and dashes are generated one at a time each time startMorseSeq() is called, or whether each call generates sequences of signals until stopMorseGenerator() is called.
source code
 
numRecentDots(self) source code
 
numRecentDashes(self) source code
 
setSpeed(self, dotsPlusPausePerSec)
Sets speed at which automatic dots and dashes are generated.
source code
 
setInterLetterDelay(self, secs)
Sets the time that must elapse between two letters.
source code
 
setInterWordDelay(self, secs)
Sets the time that must elapse between two words.
source code
 
stopMorseGenerator(self)
Stop the entire generator.
source code
 
getAndRemoveAlphaStr(self) source code
 
setAlphaStr(self, newAlphaStr) source code
 
setMorseResult(self, newMorseResult) source code
 
getInterLetterTime(self)
Return the minimum amount of silence time required for the system to conclude that the Morse code equivalent of a letter has been generated.
source code
 
getInterWordTime(self)
Return the minimum amount of silence time required for the system to conclude that a word has ended.
source code
 
reallySleep(self, secs)
Truly return only after specified time.
source code
 
addMorseElements(self, dotsOrDashes, numElements) source code
 
watchdogExpired(self, reason) source code
 
decodeMorseLetter(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, callback=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

startMorseSeq(self, morseElement)

source code 

Start a sequence of dots or dashes. If auto-morse is False, only one dot or dash is produced per call. Else a dashes or dots are produced at an adjustable speed until stopMorseSeq() is called. Use setAutoMorse() to control whether single-shot or automatic sequences are produced. Use setSpeed() to set the speed at which the signals are generated.

After stopMorseSeq() is called, use getRecentDots() or getRecentDashes() return the number of dots or dashes that were generated.

Parameters:
  • morseElement (Morse enum) - whether to produce dots or dashes

stopMorseSeq(self)

source code 

Stop a running sequence of dots or dashes. After this call, use getRecentDots() or getRecentDashes() to get a count of Morse elements (dots or dashes) that were emitted. If automatic Morse generation is disabled, it is not necessary to call this method. See setAutoMorse(). Called when mouse cursor leaves

setAutoMorse(self, yesNo)

source code 

Determine whether dots and dashes are generated one at a time each time startMorseSeq() is called, or whether each call generates sequences of signals until stopMorseGenerator() is called.

Parameters:
  • yesNo ()

setSpeed(self, dotsPlusPausePerSec)

source code 

Sets speed at which automatic dots and dashes are generated. Units are Herz. One cycle is a single dot, followed by the pause that separates two dots. Since that pause is standardized to be equal to a dot length, one can think of the speed as the number times the letter "i" is generated per second.

The higher the number, the faster the dots/dashes are generated. Default is 3.3.

Parameters:
  • dotsPlusPausePerSec (float) - rate at which dots or dashes are produced in automatic mode.

setInterLetterDelay(self, secs)

source code 

Sets the time that must elapse between two letters.

Parameters:
  • secs (float) - fractional seconds

setInterWordDelay(self, secs)

source code 

Sets the time that must elapse between two words. If negative, no word segmentation is performed.

Parameters:
  • secs (float) - fractional seconds

stopMorseGenerator(self)

source code 

Stop the entire generator. All threads are killed. Subsequent calls to startMorseSeq() or stopMorseSeq() generate exceptions.

getInterLetterTime(self)

source code 

Return the minimum amount of silence time required for the system to conclude that the Morse code equivalent of a letter has been generated. I.e.: end-of-letter pause.

getInterWordTime(self)

source code 

Return the minimum amount of silence time required for the system to conclude that a word has ended. I.e.: end-of-word pause.

reallySleep(self, secs)

source code 

Truly return only after specified time. Just using time.sleep() sleeps shorter if any interrupts occur during the sleep period.

Parameters:
  • secs (float) - fractional seconds to sleep