Italian tts fixes

This commit is contained in:
romolo.manfredini@gmail.com
2012-08-27 22:39:47 +00:00
parent dd230b7e5a
commit f1abf9a8c8
2 changed files with 44 additions and 16 deletions
+27 -11
View File
@@ -39,17 +39,18 @@ enum ItalianPrompts {
PROMPT_CENT = PROMPT_NUMBERS_BASE+100,
PROMPT_MILA = PROMPT_NUMBERS_BASE+101,
PROMPT_MILLE = PROMPT_NUMBERS_BASE+102,
PROMPT_UN = 103,
PROMPT_E = 104,
PROMPT_MENO = 105,
PROMPT_ORA = 106,
PROMPT_ORE = 107,
PROMPT_MINUTO = 108,
PROMPT_MINUTI = 109,
PROMPT_SECONDO = 110,
PROMPT_SECONDI = 111,
PROMPT_VIGOLA = 103,
PROMPT_UN,
PROMPT_E,
PROMPT_MENO,
PROMPT_ORA,
PROMPT_ORE,
PROMPT_MINUTO,
PROMPT_MINUTI,
PROMPT_SECONDO,
PROMPT_SECONDI,
PROMPT_UNITS_BASE = 112,
PROMPT_UNITS_BASE = 113,
PROMPT_VOLTS = PROMPT_UNITS_BASE+UNIT_VOLTS,
PROMPT_AMPS = PROMPT_UNITS_BASE+UNIT_AMPS,
PROMPT_METERS_PER_SECOND = PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND,
@@ -64,7 +65,7 @@ enum ItalianPrompts {
PROMPT_FEET = PROMPT_UNITS_BASE+UNIT_FEET,
PROMPT_KTS = PROMPT_UNITS_BASE+UNIT_KTS,
PROMPT_LABELS_BASE = 126,
PROMPT_LABELS_BASE = 127,
PROMPT_TIMER1 = PROMPT_LABELS_BASE+TELEM_TM1,
PROMPT_TIMER2 = PROMPT_LABELS_BASE+TELEM_TM2,
PROMPT_RSSI_TX = PROMPT_LABELS_BASE+TELEM_RSSI_TX,
@@ -111,6 +112,21 @@ PLAY_FUNCTION(playNumber, int16_t number, uint8_t unit, uint8_t att)
PUSH_PROMPT(PROMPT_MENO);
number = -number;
}
int8_t mode = MODE(att);
if (mode > 0) {
div_t qr = div(number, (mode == 1 ? 10 : 100));
if (qr.rem > 0) {
PLAY_NUMBER(qr.quot, 0, 0);
PUSH_PROMPT(PROMPT_VIRGOLA);
if (mode==2 && qr.rem < 10)
PUSH_PROMPT(PROMPT_ZERO);
PLAY_NUMBER(qr.rem, unit, 0);
}
else {
PLAY_NUMBER(qr.quot, unit, 0);
}
return;
}
if (number >= 1000) {
if (number >= 2000) {
+17 -5
View File
@@ -241,20 +241,32 @@ if __name__ == "__main__":
systemSounds.extend(generate(str(i), i))
systemSounds.extend(generate("mila", 101))
systemSounds.extend(generate("mille", 102))
for i, s in enumerate(["un", "e", "meno", "ora", "ore", "minuto", "minuti", "secondo", "secondi"]):
for i, s in enumerate(["virgola", "un", "e", "meno", "ora", "ore", "minuto", "minuti", "secondo", "secondi"]):
systemSounds.extend(generate(s, 103+i))
for i, s in enumerate(["volt", "amper", "meetri per secondo", "", "chilomeetri ora", "meetri", "gradi", "percento", "milliamper", "milliamper ora", "watt", "", "piedi", "nodi"]):
systemSounds.extend(generate(s, 112+i))
for s, f, a in [(u"trim centrato", "midtrim", 244),
(u"massimo trim raggiunto", "endtrim", 0),
systemSounds.extend(generate(s, 113+i))
for s, f, a in [(u"radio inattiva controllare", "inactiv", 230),
(u"batteria della radio scarica", "lowbatt", 231),
(u"controllo motore non in posizione, verificare", "thralert", 232),
(u"interruttori non in posizione, verificare", "swalert", 233),
(u"eeprom corrotta", "eebad", 0),
(u"formattazone eeprom in corso", "eeformat", 0),
(u"errore", "error", 0),
(u"trim centrato", "midtrim", 244),
(u"tada", "tada", 245),
(u"potenziometro centrato", "midpot", 246),
(u"massimo trim raggiunto", "endtrim", 0),
(u"3 secondi al termine", "timerlt3", 250),
(u"dieci secondi", "timer10", 251),
(u"venti secondi", "timer20", 252),
(u"trenta secondi", "timer30", 253),
]:
systemSounds.extend(generate(s, f, a))
for i, s in enumerate(["timer", "", "tensione", "tensione", "trasmissione", "ricezione", "altitudine", "motore",
"carburante", "temperatura", "temperatura", "velocita'", "distanza", "altitudine", "cella lipo",
"totale lipo", "tensione", "corrente", "consumo", "potenza", "accelerazione X", "accellerazione Y", "accelerazione Z",
"direzione", "variometro"]):
systemSounds.extend(generate(s, 126+i))
systemSounds.extend(generate(s, 127+i))
for i, (s, f) in enumerate([
(u"carrello chiuso", "gearup"),
(u"carrello aperto", "geardn"),