MorseCW
Extends:
Class to create the on/off timings needed by e.g. sound generators. Timings are in milliseconds; "off" timings are negative.
Example:
import MorseCW from 'morse-pro-cw';
var morseCW = new MorseCW();
morseCW.translate("abc");
var timings = morseCW.getTimings();
Static Method Summary
| Static Public Methods | ||
| public static |
getTimingsGeneral(dit: number, dah: number, ditSpace: number, charSpace: number, wordSpace: number, morse: string): number[] Return an array of millisecond timings. |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(prosigns: boolean, wpm: number, fwpm: number) this constructor was deprecated.
|
|
Member Summary
| Public Members | ||
| public set |
Set the Farnsworth WPM speed. |
|
| public get |
|
|
| public get |
Get the length of the space between words in ms. |
|
| public set |
Set the WPM speed. |
|
| public get |
|
|
| Private Members | ||
| private |
_fwpm: * |
|
| private |
_wpm: * |
|
Method Summary
| Public Methods | ||
| public |
getDuration(): * Get the total duration of the message in ms 8 @return {number} |
|
| public |
getTimings(): number[] Return an array of millisecond timings. |
|
Inherited Summary
| From class MorseMessage | ||
| public get |
timings: * |
|
| public get |
wave: * |
|
| public |
errors: * |
|
| public |
hasError: * |
|
| public |
|
|
| public |
morse: * |
|
| public |
morseCWWave: * |
|
| public |
morseTokens: * |
|
| public |
rawInput: * |
|
| public |
text: * |
|
| public |
textTokens: * |
|
| public |
cleanText(): * |
|
| public |
getInputErrorString(prefix: String, suffix: String, escapeMap: Map): * |
|
| public |
getMorseErrorString(prefix: *, suffix: *): * |
|
| public |
getOutputErrorString(prefix: *, suffix: *, escapeMap: {}): * |
|
| public |
getTextErrorString(prefix: *, suffix: *, escapeMap: {}): * |
|
| public |
loadMorse(input: *): * |
|
| public |
loadText(input: *): * |
|
| public |
Translate to or from Morse. |
|
| private |
_completeFields(d: *) |
|
Static Public Methods
public static getTimingsGeneral(dit: number, dah: number, ditSpace: number, charSpace: number, wordSpace: number, morse: string): number[] source
Return an array of millisecond timings. Each sound and space has a duration. The durations of the spaces are distinguished by being negative.
Params:
| Name | Type | Attribute | Description |
| dit | number | the length of a dit in milliseconds |
|
| dah | number | the length of a dah in milliseconds (normally 3 * dit) |
|
| ditSpace | number | the length of an intra-character space in milliseconds (1 * dit) |
|
| charSpace | number | the length of an inter-character space in milliseconds (normally 3 * dit) |
|
| wordSpace | number | the length of an inter-word space in milliseconds (normally 7 * dit) |
|
| morse | string | the (canonical) morse code string (matching [.-/ ]*) |
Public Constructors
public constructor(prosigns: boolean, wpm: number, fwpm: number) source
Override:
MorseMessage#constructorParams:
| Name | Type | Attribute | Description |
| prosigns | boolean |
|
whether or not to include prosigns in the translations |
| wpm | number |
|
the speed in words per minute using PARIS as the standard word |
| fwpm | number |
|
the Farnsworth speed in words per minute (defaults to wpm) |
Public Members
public set fwpm: number source
Set the Farnsworth WPM speed. Ensures that WPM is no slower than Farnsworth WPM.
Private Members
private _fwpm: * source
private _wpm: * source
Public Methods
public getDuration(): * source
Get the total duration of the message in ms 8 @return {number}
Return:
| * |