Skip to content

Commit

Permalink
Tests (ter)
Browse files Browse the repository at this point in the history
  • Loading branch information
florian6973 committed Dec 21, 2020
1 parent 29705c1 commit de9cc96
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
5 changes: 4 additions & 1 deletion data/config.mm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
wav.ta¤3
wav.espaceinter¤1
wav.espacelettre¤3
wav.espacelettre2¤13
wav.espacemot¤7
wav.espacemot2¤9
wav.espacemot3¤38
wav.debug¤0
Expand Down Expand Up @@ -89,5 +92,5 @@
ï¤---...
begin¤.-.-
paragraphe¤-...-
paragraphe¤-...--...-
end¤...-.-
24 changes: 6 additions & 18 deletions src/lib/wav.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,27 +244,15 @@ string MorseL::Wav::read_file(Config& cfg)
if (cfg.wav["wav.debug"])
cout << morse[i] << " ";

switch (morse[i])
{
case 1:
int mi = morse[i];
if (mi == cfg.wav["wav.ti"])
output.append(".");
break;

case 3:
else if (mi == cfg.wav["wav.ta"])
output.append("-");
break;

case -3:
case -13: // https://www.meridianoutpost.com/resources/etools/calculators/calculator-morse-code.php
else if ((mi == -cfg.wav["wav.espacelettre"]) || (mi == -cfg.wav["wav.espacelettre2"])) // https://www.meridianoutpost.com/resources/etools/calculators/calculator-morse-code.php
output.append(" ");
break;

case -7:
case -9: // https://www.radio-amater.rs/morsecodegenerator/
case -38: // https://www.meridianoutpost.com/resources/etools/calculators/calculator-morse-code.php
output.append("/");
break;
}
else if ((mi == -cfg.wav["wav.espacemot"]) || (mi == -cfg.wav["wav.espacemot2"]) || (mi == -cfg.wav["wav.espacemot3"])) // https://www.meridianoutpost.com/resources/etools/calculators/calculator-morse-code.php et // https://www.radio-amater.rs/morsecodegenerator/
output.append("/");
}

if (cfg.wav["wav.debug"])
Expand Down
4 changes: 3 additions & 1 deletion test/str02.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Je suis passionné par l'informatique.
Je suis passionné par l'informatique.

3 + 4 = 9

0 comments on commit de9cc96

Please sign in to comment.