Compilation fixes for Arch Linux
This commit is contained in:
+241
-241
@@ -1,241 +1,241 @@
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Martin Hotar <mhotar@gmail.com>
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum CzechPrompts {
|
||||
CZ_PROMPT_NUMBERS_BASE = 0,
|
||||
CZ_PROMPT_NULA = CZ_PROMPT_NUMBERS_BASE+0, //0-99
|
||||
CZ_PROMPT_STO = CZ_PROMPT_NUMBERS_BASE+100, //100,200 .. 900
|
||||
CZ_PROMPT_TISIC = CZ_PROMPT_NUMBERS_BASE+109, //1000
|
||||
CZ_PROMPT_TISICE = CZ_PROMPT_NUMBERS_BASE+110,
|
||||
CZ_PROMPT_JEDEN = CZ_PROMPT_NUMBERS_BASE+111,
|
||||
CZ_PROMPT_JEDNO = CZ_PROMPT_NUMBERS_BASE+112,
|
||||
CZ_PROMPT_DVE = CZ_PROMPT_NUMBERS_BASE+113,
|
||||
CZ_PROMPT_CELA = CZ_PROMPT_NUMBERS_BASE+114,
|
||||
CZ_PROMPT_CELE = CZ_PROMPT_NUMBERS_BASE+115,
|
||||
CZ_PROMPT_CELYCH = CZ_PROMPT_NUMBERS_BASE+116,
|
||||
CZ_PROMPT_MINUS = CZ_PROMPT_NUMBERS_BASE+117,
|
||||
|
||||
CZ_PROMPT_UNITS_BASE = 118, //(jeden)volt,(dva)volty,(pet)voltu,(desetina)voltu
|
||||
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define CZ_PUSH_UNIT_PROMPT(p, u) cz_pushUnitPrompt((p), (u), id)
|
||||
#else
|
||||
#define CZ_PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u))
|
||||
#endif
|
||||
|
||||
#define MUZSKY 0x80
|
||||
#define ZENSKY 0x81
|
||||
#define STREDNI 0x82
|
||||
|
||||
I18N_PLAY_FUNCTION(cz, pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
if (number == 1)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
else if (number > 1 && number < 5)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 1);
|
||||
else
|
||||
PUSH_UNIT_PROMPT(unitprompt, 2);
|
||||
#else
|
||||
unitprompt = CZ_PROMPT_UNITS_BASE+((unitprompt-1)*4);
|
||||
if (number == 1)
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else if (number > 1 && number < 5)
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
else
|
||||
PUSH_NUMBER_PROMPT(unitprompt+2);
|
||||
#endif
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(cz, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div(number, 10);
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, ZENSKY);
|
||||
if (qr.quot == 0)
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_CELA);
|
||||
else
|
||||
CZ_PUSH_UNIT_PROMPT(qr.quot, CZ_PROMPT_CELA);
|
||||
PLAY_NUMBER(qr.rem, 0, ZENSKY);
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_UNITS_BASE+((unit-1)*4)+3);
|
||||
return;
|
||||
}
|
||||
else
|
||||
number = qr.quot;
|
||||
}
|
||||
|
||||
int16_t tmp = number;
|
||||
#if defined(CPUARM)
|
||||
switch(unit) {
|
||||
case 0:
|
||||
break;
|
||||
case 6:
|
||||
case 8:
|
||||
case 10:
|
||||
case 14:
|
||||
case 18:
|
||||
case 21:
|
||||
case 22:
|
||||
case 23:
|
||||
case 24:
|
||||
case 25:
|
||||
case 26:
|
||||
att = ZENSKY;
|
||||
break;
|
||||
case 13:
|
||||
case 19:
|
||||
att = STREDNI;
|
||||
break;
|
||||
default:
|
||||
att = MUZSKY;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
switch(unit) {
|
||||
case 0:
|
||||
break;
|
||||
case 4:
|
||||
case 10:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
case 17:
|
||||
case 18:
|
||||
att = ZENSKY;
|
||||
break;
|
||||
case 8:
|
||||
case 19:
|
||||
att = STREDNI;
|
||||
break;
|
||||
default:
|
||||
att = MUZSKY;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((number == 1) && (att == MUZSKY)) {
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_JEDEN);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number == 1) && (att == STREDNI)) {
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_JEDNO);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number == 2) && ((att == ZENSKY) || (att == STREDNI))) {
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_DVE);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if (number >= 1000) {
|
||||
if (number >= 2000)
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
if (number >= 2000 && number < 5000)
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_TISICE);
|
||||
else
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_TISIC);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_STO + (number/100)-1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if (number >= 0) {
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_NULA+number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
CZ_PUSH_UNIT_PROMPT(tmp, unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(cz, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||
PLAY_NUMBER(tmp, UNIT_HOURS, ZENSKY);
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, UNIT_MINUTES, ZENSKY);
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
PLAY_NUMBER(seconds, UNIT_SECONDS, ZENSKY);
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE(cz, "Czech");
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Martin Hotar <mhotar@gmail.com>
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum CzechPrompts {
|
||||
CZ_PROMPT_NUMBERS_BASE = 0,
|
||||
CZ_PROMPT_NULA = CZ_PROMPT_NUMBERS_BASE+0, //0-99
|
||||
CZ_PROMPT_STO = CZ_PROMPT_NUMBERS_BASE+100, //100,200 .. 900
|
||||
CZ_PROMPT_TISIC = CZ_PROMPT_NUMBERS_BASE+109, //1000
|
||||
CZ_PROMPT_TISICE = CZ_PROMPT_NUMBERS_BASE+110,
|
||||
CZ_PROMPT_JEDEN = CZ_PROMPT_NUMBERS_BASE+111,
|
||||
CZ_PROMPT_JEDNO = CZ_PROMPT_NUMBERS_BASE+112,
|
||||
CZ_PROMPT_DVE = CZ_PROMPT_NUMBERS_BASE+113,
|
||||
CZ_PROMPT_CELA = CZ_PROMPT_NUMBERS_BASE+114,
|
||||
CZ_PROMPT_CELE = CZ_PROMPT_NUMBERS_BASE+115,
|
||||
CZ_PROMPT_CELYCH = CZ_PROMPT_NUMBERS_BASE+116,
|
||||
CZ_PROMPT_MINUS = CZ_PROMPT_NUMBERS_BASE+117,
|
||||
|
||||
CZ_PROMPT_UNITS_BASE = 118, //(jeden)volt,(dva)volty,(pet)voltu,(desetina)voltu
|
||||
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define CZ_PUSH_UNIT_PROMPT(p, u) cz_pushUnitPrompt((p), (u), id)
|
||||
#else
|
||||
#define CZ_PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u))
|
||||
#endif
|
||||
|
||||
#define MUZSKY 0x80
|
||||
#define ZENSKY 0x81
|
||||
#define STREDNI 0x82
|
||||
|
||||
I18N_PLAY_FUNCTION(cz, pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
if (number == 1)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
else if (number > 1 && number < 5)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 1);
|
||||
else
|
||||
PUSH_UNIT_PROMPT(unitprompt, 2);
|
||||
#else
|
||||
unitprompt = CZ_PROMPT_UNITS_BASE+((unitprompt-1)*4);
|
||||
if (number == 1)
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else if (number > 1 && number < 5)
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
else
|
||||
PUSH_NUMBER_PROMPT(unitprompt+2);
|
||||
#endif
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(cz, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div((int)number, 10);
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, ZENSKY);
|
||||
if (qr.quot == 0)
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_CELA);
|
||||
else
|
||||
CZ_PUSH_UNIT_PROMPT(qr.quot, CZ_PROMPT_CELA);
|
||||
PLAY_NUMBER(qr.rem, 0, ZENSKY);
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_UNITS_BASE+((unit-1)*4)+3);
|
||||
return;
|
||||
}
|
||||
else
|
||||
number = qr.quot;
|
||||
}
|
||||
|
||||
int16_t tmp = number;
|
||||
#if defined(CPUARM)
|
||||
switch(unit) {
|
||||
case 0:
|
||||
break;
|
||||
case 6:
|
||||
case 8:
|
||||
case 10:
|
||||
case 14:
|
||||
case 18:
|
||||
case 21:
|
||||
case 22:
|
||||
case 23:
|
||||
case 24:
|
||||
case 25:
|
||||
case 26:
|
||||
att = ZENSKY;
|
||||
break;
|
||||
case 13:
|
||||
case 19:
|
||||
att = STREDNI;
|
||||
break;
|
||||
default:
|
||||
att = MUZSKY;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
switch(unit) {
|
||||
case 0:
|
||||
break;
|
||||
case 4:
|
||||
case 10:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
case 17:
|
||||
case 18:
|
||||
att = ZENSKY;
|
||||
break;
|
||||
case 8:
|
||||
case 19:
|
||||
att = STREDNI;
|
||||
break;
|
||||
default:
|
||||
att = MUZSKY;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((number == 1) && (att == MUZSKY)) {
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_JEDEN);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number == 1) && (att == STREDNI)) {
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_JEDNO);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number == 2) && ((att == ZENSKY) || (att == STREDNI))) {
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_DVE);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if (number >= 1000) {
|
||||
if (number >= 2000)
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
if (number >= 2000 && number < 5000)
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_TISICE);
|
||||
else
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_TISIC);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_STO + (number/100)-1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if (number >= 0) {
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_NULA+number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
CZ_PUSH_UNIT_PROMPT(tmp, unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(cz, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(CZ_PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||
PLAY_NUMBER(tmp, UNIT_HOURS, ZENSKY);
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, UNIT_MINUTES, ZENSKY);
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
PLAY_NUMBER(seconds, UNIT_SECONDS, ZENSKY);
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE(cz, "Czech");
|
||||
|
||||
#endif
|
||||
|
||||
+246
-246
@@ -1,246 +1,246 @@
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl <andreas.weitl@gmx.de>
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Benjamin Boy <rcbebo82@googlemail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum GermanPrompts {
|
||||
DE_PROMPT_NUMBERS_BASE = 0,
|
||||
DE_PROMPT_NULL = DE_PROMPT_NUMBERS_BASE+0,
|
||||
DE_PROMPT_EIN = DE_PROMPT_NUMBERS_BASE+100,
|
||||
DE_PROMPT_EINE = DE_PROMPT_NUMBERS_BASE+101,
|
||||
DE_PROMPT_HUNDERT = DE_PROMPT_NUMBERS_BASE+102,
|
||||
DE_PROMPT_TAUSEND = DE_PROMPT_NUMBERS_BASE+103,
|
||||
DE_PROMPT_COMMA = 104,
|
||||
DE_PROMPT_UND,
|
||||
DE_PROMPT_MINUS,
|
||||
DE_PROMPT_UHR,
|
||||
DE_PROMPT_MINUTE,
|
||||
DE_PROMPT_MINUTEN,
|
||||
DE_PROMPT_SEKUNDE,
|
||||
DE_PROMPT_SEKUNDEN,
|
||||
DE_PROMPT_STUNDE,
|
||||
DE_PROMPT_STUNDEN,
|
||||
|
||||
DE_PROMPT_UNITS_BASE = 114,
|
||||
DE_PROMPT_VOLTS = DE_PROMPT_UNITS_BASE+UNIT_VOLTS,
|
||||
DE_PROMPT_AMPS = DE_PROMPT_UNITS_BASE+UNIT_AMPS,
|
||||
DE_PROMPT_METERS_PER_SECOND = DE_PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND,
|
||||
DE_PROMPT_SPARE1 = DE_PROMPT_UNITS_BASE+UNIT_RAW,
|
||||
DE_PROMPT_KMH = DE_PROMPT_UNITS_BASE+UNIT_SPEED,
|
||||
DE_PROMPT_METERS = DE_PROMPT_UNITS_BASE+UNIT_DIST,
|
||||
DE_PROMPT_DEGREES = DE_PROMPT_UNITS_BASE+UNIT_TEMPERATURE,
|
||||
DE_PROMPT_PERCENT = DE_PROMPT_UNITS_BASE+UNIT_PERCENT,
|
||||
DE_PROMPT_MILLIAMPS = DE_PROMPT_UNITS_BASE+UNIT_MILLIAMPS,
|
||||
DE_PROMPT_MAH = DE_PROMPT_UNITS_BASE+UNIT_MAH,
|
||||
DE_PROMPT_WATTS = DE_PROMPT_UNITS_BASE+UNIT_WATTS,
|
||||
DE_PROMPT_FEET = DE_PROMPT_UNITS_BASE+UNIT_FEET,
|
||||
DE_PROMPT_KTS = DE_PROMPT_UNITS_BASE+UNIT_KTS,
|
||||
DE_PROMPT_HOURS = DE_PROMPT_UNITS_BASE+UNIT_HOURS,
|
||||
DE_PROMPT_MINUTES = DE_PROMPT_UNITS_BASE+UNIT_MINUTES,
|
||||
DE_PROMPT_SECONDS = DE_PROMPT_UNITS_BASE+UNIT_SECONDS,
|
||||
DE_PROMPT_RPMS = DE_PROMPT_UNITS_BASE+UNIT_RPMS,
|
||||
DE_PROMPT_G = DE_PROMPT_UNITS_BASE+UNIT_G,
|
||||
#if defined(CPUARM)
|
||||
DE_PROMPT_MILLILITERS = DE_PROMPT_UNITS_BASE+UNIT_MILLILITERS,
|
||||
DE_PROMPT_FLOZ = DE_PROMPT_UNITS_BASE+UNIT_FLOZ,
|
||||
DE_PROMPT_FEET_PER_SECOND = DE_PROMPT_UNITS_BASE+UNIT_FEET_PER_SECOND,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
#if defined(CPUARM)
|
||||
#define DE_PUSH_UNIT_PROMPT(u) de_pushUnitPrompt((u), id)
|
||||
#else
|
||||
#define DE_PUSH_UNIT_PROMPT(u) pushUnitPrompt((u))
|
||||
#endif
|
||||
|
||||
I18N_PLAY_FUNCTION(de, pushUnitPrompt, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
#else
|
||||
unitprompt = DE_PROMPT_UNITS_BASE + unitprompt*2
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
#endif
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(de, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
/* if digit >= 1000000000:
|
||||
temp_digit, digit = divmod(digit, 1000000000)
|
||||
prompts.extend(self.getNumberPrompt(temp_digit))
|
||||
prompts.append(Prompt(GUIDE_00_BILLION, dir=2))
|
||||
if digit >= 1000000:
|
||||
temp_digit, digit = divmod(digit, 1000000)
|
||||
prompts.extend(self.getNumberPrompt(temp_digit))
|
||||
prompts.append(Prompt(GUIDE_00_MILLION, dir=2))
|
||||
*/
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div(number, 10);
|
||||
if (qr.rem > 0) {
|
||||
PUSH_NUMBER_PROMPT(qr.quot);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_COMMA);
|
||||
PUSH_NUMBER_PROMPT(qr.rem);
|
||||
}
|
||||
else {
|
||||
if (qr.quot == 1) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_EIN);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(qr.quot);
|
||||
}
|
||||
}
|
||||
DE_PUSH_UNIT_PROMPT(unit);
|
||||
return;
|
||||
}
|
||||
|
||||
if (number >= 2000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_TAUSEND);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number >= 1000) && (number < 2000)) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_EIN);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_TAUSEND);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number >= 200) && (number < 1000)) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_NULL + number / 100);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_HUNDERT);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number >= 100) && (number < 200)) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_EIN);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_HUNDERT);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if (number >= 0) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_NULL + number / 1);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
DE_PUSH_UNIT_PROMPT(unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(de, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
|
||||
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||
if (tmp > 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_STUNDEN);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_EINE);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_STUNDE);
|
||||
}
|
||||
if (seconds > 0) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_UND);
|
||||
}
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
|
||||
if (tmp > 0) {
|
||||
if (tmp > 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_MINUTEN);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_EINE);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_MINUTE);
|
||||
}
|
||||
if (seconds > 0) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_UND);
|
||||
}
|
||||
}
|
||||
|
||||
if (seconds > 1) {
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_SEKUNDEN);
|
||||
}
|
||||
else {
|
||||
if (seconds == 1) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_EINE);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_SEKUNDE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE(de, "Deutsch");
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl <andreas.weitl@gmx.de>
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Benjamin Boy <rcbebo82@googlemail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum GermanPrompts {
|
||||
DE_PROMPT_NUMBERS_BASE = 0,
|
||||
DE_PROMPT_NULL = DE_PROMPT_NUMBERS_BASE+0,
|
||||
DE_PROMPT_EIN = DE_PROMPT_NUMBERS_BASE+100,
|
||||
DE_PROMPT_EINE = DE_PROMPT_NUMBERS_BASE+101,
|
||||
DE_PROMPT_HUNDERT = DE_PROMPT_NUMBERS_BASE+102,
|
||||
DE_PROMPT_TAUSEND = DE_PROMPT_NUMBERS_BASE+103,
|
||||
DE_PROMPT_COMMA = 104,
|
||||
DE_PROMPT_UND,
|
||||
DE_PROMPT_MINUS,
|
||||
DE_PROMPT_UHR,
|
||||
DE_PROMPT_MINUTE,
|
||||
DE_PROMPT_MINUTEN,
|
||||
DE_PROMPT_SEKUNDE,
|
||||
DE_PROMPT_SEKUNDEN,
|
||||
DE_PROMPT_STUNDE,
|
||||
DE_PROMPT_STUNDEN,
|
||||
|
||||
DE_PROMPT_UNITS_BASE = 114,
|
||||
DE_PROMPT_VOLTS = DE_PROMPT_UNITS_BASE+UNIT_VOLTS,
|
||||
DE_PROMPT_AMPS = DE_PROMPT_UNITS_BASE+UNIT_AMPS,
|
||||
DE_PROMPT_METERS_PER_SECOND = DE_PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND,
|
||||
DE_PROMPT_SPARE1 = DE_PROMPT_UNITS_BASE+UNIT_RAW,
|
||||
DE_PROMPT_KMH = DE_PROMPT_UNITS_BASE+UNIT_SPEED,
|
||||
DE_PROMPT_METERS = DE_PROMPT_UNITS_BASE+UNIT_DIST,
|
||||
DE_PROMPT_DEGREES = DE_PROMPT_UNITS_BASE+UNIT_TEMPERATURE,
|
||||
DE_PROMPT_PERCENT = DE_PROMPT_UNITS_BASE+UNIT_PERCENT,
|
||||
DE_PROMPT_MILLIAMPS = DE_PROMPT_UNITS_BASE+UNIT_MILLIAMPS,
|
||||
DE_PROMPT_MAH = DE_PROMPT_UNITS_BASE+UNIT_MAH,
|
||||
DE_PROMPT_WATTS = DE_PROMPT_UNITS_BASE+UNIT_WATTS,
|
||||
DE_PROMPT_FEET = DE_PROMPT_UNITS_BASE+UNIT_FEET,
|
||||
DE_PROMPT_KTS = DE_PROMPT_UNITS_BASE+UNIT_KTS,
|
||||
DE_PROMPT_HOURS = DE_PROMPT_UNITS_BASE+UNIT_HOURS,
|
||||
DE_PROMPT_MINUTES = DE_PROMPT_UNITS_BASE+UNIT_MINUTES,
|
||||
DE_PROMPT_SECONDS = DE_PROMPT_UNITS_BASE+UNIT_SECONDS,
|
||||
DE_PROMPT_RPMS = DE_PROMPT_UNITS_BASE+UNIT_RPMS,
|
||||
DE_PROMPT_G = DE_PROMPT_UNITS_BASE+UNIT_G,
|
||||
#if defined(CPUARM)
|
||||
DE_PROMPT_MILLILITERS = DE_PROMPT_UNITS_BASE+UNIT_MILLILITERS,
|
||||
DE_PROMPT_FLOZ = DE_PROMPT_UNITS_BASE+UNIT_FLOZ,
|
||||
DE_PROMPT_FEET_PER_SECOND = DE_PROMPT_UNITS_BASE+UNIT_FEET_PER_SECOND,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
#if defined(CPUARM)
|
||||
#define DE_PUSH_UNIT_PROMPT(u) de_pushUnitPrompt((u), id)
|
||||
#else
|
||||
#define DE_PUSH_UNIT_PROMPT(u) pushUnitPrompt((u))
|
||||
#endif
|
||||
|
||||
I18N_PLAY_FUNCTION(de, pushUnitPrompt, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
#else
|
||||
unitprompt = DE_PROMPT_UNITS_BASE + unitprompt*2
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
#endif
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(de, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
/* if digit >= 1000000000:
|
||||
temp_digit, digit = divmod(digit, 1000000000)
|
||||
prompts.extend(self.getNumberPrompt(temp_digit))
|
||||
prompts.append(Prompt(GUIDE_00_BILLION, dir=2))
|
||||
if digit >= 1000000:
|
||||
temp_digit, digit = divmod(digit, 1000000)
|
||||
prompts.extend(self.getNumberPrompt(temp_digit))
|
||||
prompts.append(Prompt(GUIDE_00_MILLION, dir=2))
|
||||
*/
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div((int)number, 10);
|
||||
if (qr.rem > 0) {
|
||||
PUSH_NUMBER_PROMPT(qr.quot);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_COMMA);
|
||||
PUSH_NUMBER_PROMPT(qr.rem);
|
||||
}
|
||||
else {
|
||||
if (qr.quot == 1) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_EIN);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(qr.quot);
|
||||
}
|
||||
}
|
||||
DE_PUSH_UNIT_PROMPT(unit);
|
||||
return;
|
||||
}
|
||||
|
||||
if (number >= 2000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_TAUSEND);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number >= 1000) && (number < 2000)) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_EIN);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_TAUSEND);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number >= 200) && (number < 1000)) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_NULL + number / 100);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_HUNDERT);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number >= 100) && (number < 200)) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_EIN);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_HUNDERT);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if (number >= 0) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_NULL + number / 1);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
DE_PUSH_UNIT_PROMPT(unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(de, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
|
||||
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||
if (tmp > 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_STUNDEN);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_EINE);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_STUNDE);
|
||||
}
|
||||
if (seconds > 0) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_UND);
|
||||
}
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
|
||||
if (tmp > 0) {
|
||||
if (tmp > 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_MINUTEN);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_EINE);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_MINUTE);
|
||||
}
|
||||
if (seconds > 0) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_UND);
|
||||
}
|
||||
}
|
||||
|
||||
if (seconds > 1) {
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_SEKUNDEN);
|
||||
}
|
||||
else {
|
||||
if (seconds == 1) {
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_EINE);
|
||||
PUSH_NUMBER_PROMPT(DE_PROMPT_SEKUNDE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE(de, "Deutsch");
|
||||
|
||||
#endif
|
||||
|
||||
+175
-175
@@ -1,175 +1,175 @@
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
* - Cameron Weeks <th9xer@gmail.com>
|
||||
* - Erez Raviv
|
||||
* - Gabriel Birkus
|
||||
* - Jean-Pierre Parisy
|
||||
* - Karl Szmutny
|
||||
* - Michael Blandford
|
||||
* - Michal Hlavinka
|
||||
* - Pat Mackenzie
|
||||
* - Philip Moss
|
||||
* - Rob Thomson
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum EnglishPrompts {
|
||||
EN_PROMPT_NUMBERS_BASE = 0,
|
||||
EN_PROMPT_ZERO = EN_PROMPT_NUMBERS_BASE+0, //02-99
|
||||
EN_PROMPT_HUNDRED = EN_PROMPT_NUMBERS_BASE+100, //100,200 .. 900
|
||||
EN_PROMPT_THOUSAND = EN_PROMPT_NUMBERS_BASE+109, //1000
|
||||
EN_PROMPT_AND = EN_PROMPT_NUMBERS_BASE+110,
|
||||
EN_PROMPT_MINUS = EN_PROMPT_NUMBERS_BASE+111,
|
||||
EN_PROMPT_POINT = EN_PROMPT_NUMBERS_BASE+112,
|
||||
EN_PROMPT_UNITS_BASE = 113,
|
||||
EN_PROMPT_POINT_BASE = 167, //.0 - .9
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define EN_PUSH_UNIT_PROMPT(p, u) en_pushUnitPrompt((p), (u), id)
|
||||
#else
|
||||
#define EN_PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u))
|
||||
#endif
|
||||
|
||||
I18N_PLAY_FUNCTION(en, pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
if (number == 1)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
else
|
||||
PUSH_UNIT_PROMPT(unitprompt, 1);
|
||||
#else
|
||||
unitprompt = EN_PROMPT_UNITS_BASE + unitprompt*2;
|
||||
if (number == 1)
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
#endif
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(en, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(EN_PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div(number, 10);
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(EN_PROMPT_POINT_BASE + qr.rem);
|
||||
number = -1;
|
||||
}
|
||||
else {
|
||||
number = qr.quot;
|
||||
}
|
||||
}
|
||||
|
||||
int16_t tmp = number;
|
||||
|
||||
if (number >= 1000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(EN_PROMPT_THOUSAND);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_NUMBER_PROMPT(EN_PROMPT_HUNDRED + (number/100)-1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 0) {
|
||||
PUSH_NUMBER_PROMPT(EN_PROMPT_ZERO + number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
EN_PUSH_UNIT_PROMPT(tmp, unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(en, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds == 0) {
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(EN_PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||
PLAY_NUMBER(tmp, UNIT_HOURS, 0);
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
|
||||
if (seconds > 0)
|
||||
PUSH_NUMBER_PROMPT(EN_PROMPT_AND);
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE_DEFAULT(en, "English");
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
* - Cameron Weeks <th9xer@gmail.com>
|
||||
* - Erez Raviv
|
||||
* - Gabriel Birkus
|
||||
* - Jean-Pierre Parisy
|
||||
* - Karl Szmutny
|
||||
* - Michael Blandford
|
||||
* - Michal Hlavinka
|
||||
* - Pat Mackenzie
|
||||
* - Philip Moss
|
||||
* - Rob Thomson
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum EnglishPrompts {
|
||||
EN_PROMPT_NUMBERS_BASE = 0,
|
||||
EN_PROMPT_ZERO = EN_PROMPT_NUMBERS_BASE+0, //02-99
|
||||
EN_PROMPT_HUNDRED = EN_PROMPT_NUMBERS_BASE+100, //100,200 .. 900
|
||||
EN_PROMPT_THOUSAND = EN_PROMPT_NUMBERS_BASE+109, //1000
|
||||
EN_PROMPT_AND = EN_PROMPT_NUMBERS_BASE+110,
|
||||
EN_PROMPT_MINUS = EN_PROMPT_NUMBERS_BASE+111,
|
||||
EN_PROMPT_POINT = EN_PROMPT_NUMBERS_BASE+112,
|
||||
EN_PROMPT_UNITS_BASE = 113,
|
||||
EN_PROMPT_POINT_BASE = 167, //.0 - .9
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define EN_PUSH_UNIT_PROMPT(p, u) en_pushUnitPrompt((p), (u), id)
|
||||
#else
|
||||
#define EN_PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u))
|
||||
#endif
|
||||
|
||||
I18N_PLAY_FUNCTION(en, pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
if (number == 1)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
else
|
||||
PUSH_UNIT_PROMPT(unitprompt, 1);
|
||||
#else
|
||||
unitprompt = EN_PROMPT_UNITS_BASE + unitprompt*2;
|
||||
if (number == 1)
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
#endif
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(en, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(EN_PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div((int)number, 10);
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(EN_PROMPT_POINT_BASE + qr.rem);
|
||||
number = -1;
|
||||
}
|
||||
else {
|
||||
number = qr.quot;
|
||||
}
|
||||
}
|
||||
|
||||
int16_t tmp = number;
|
||||
|
||||
if (number >= 1000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(EN_PROMPT_THOUSAND);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_NUMBER_PROMPT(EN_PROMPT_HUNDRED + (number/100)-1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 0) {
|
||||
PUSH_NUMBER_PROMPT(EN_PROMPT_ZERO + number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
EN_PUSH_UNIT_PROMPT(tmp, unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(en, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds == 0) {
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(EN_PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||
PLAY_NUMBER(tmp, UNIT_HOURS, 0);
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
|
||||
if (seconds > 0)
|
||||
PUSH_NUMBER_PROMPT(EN_PROMPT_AND);
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE_DEFAULT(en, "English");
|
||||
|
||||
#endif
|
||||
|
||||
+267
-267
@@ -1,267 +1,267 @@
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
* - Cameron Weeks <th9xer@gmail.com>
|
||||
* - Erez Raviv
|
||||
* - Gabriel Birkus
|
||||
* - Jean-Pierre Parisy
|
||||
* - Karl Szmutny
|
||||
* - Michael Blandford
|
||||
* - Michal Hlavinka
|
||||
* - Pat Mackenzie
|
||||
* - Philip Moss
|
||||
* - Rob Thomson
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum SpanishPrompts {
|
||||
ES_PROMPT_NUMBERS_BASE = 0,
|
||||
ES_PROMPT_ZERO = ES_PROMPT_NUMBERS_BASE+0,
|
||||
ES_PROMPT_CIEN = ES_PROMPT_NUMBERS_BASE+100,
|
||||
ES_PROMPT_CIENTO = ES_PROMPT_NUMBERS_BASE+101,
|
||||
ES_PROMPT_DOSCIENTOS = ES_PROMPT_NUMBERS_BASE+102,
|
||||
ES_PROMPT_TRESCIENTOS,
|
||||
ES_PROMPT_CUATROCIENTOS,
|
||||
ES_PROMPT_QUINIENTOS,
|
||||
ES_PROMPT_SESCIENTOS,
|
||||
ES_PROMPT_SETECIENTOS,
|
||||
ES_PROMPT_OCHOCIENTOS,
|
||||
ES_PROMPT_NUEVECIENTOS,
|
||||
ES_PROMPT_MIL = ES_PROMPT_NUMBERS_BASE+110,
|
||||
ES_PROMPT_VIRGOLA = 111,
|
||||
ES_PROMPT_UN,
|
||||
ES_PROMPT_UNA,
|
||||
ES_PROMPT_Y,
|
||||
ES_PROMPT_MENO,
|
||||
ES_PROMPT_HORA,
|
||||
ES_PROMPT_HORAS,
|
||||
ES_PROMPT_MINUTO,
|
||||
ES_PROMPT_MINUTOS,
|
||||
ES_PROMPT_SEGUNDO,
|
||||
ES_PROMPT_SEGUNDOS,
|
||||
|
||||
ES_PROMPT_UNITS_BASE = 122,
|
||||
ES_PROMPT_VOLTS = ES_PROMPT_UNITS_BASE+UNIT_VOLTS,
|
||||
ES_PROMPT_AMPS = ES_PROMPT_UNITS_BASE+UNIT_AMPS,
|
||||
ES_PROMPT_METERS_PER_SECOND = ES_PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND,
|
||||
ES_PROMPT_SPARE1 = ES_PROMPT_UNITS_BASE+UNIT_RAW,
|
||||
ES_PROMPT_KMH = ES_PROMPT_UNITS_BASE+UNIT_SPEED,
|
||||
ES_PROMPT_METERS = ES_PROMPT_UNITS_BASE+UNIT_DIST,
|
||||
ES_PROMPT_DEGREES = ES_PROMPT_UNITS_BASE+UNIT_TEMPERATURE,
|
||||
ES_PROMPT_PERCENT = ES_PROMPT_UNITS_BASE+UNIT_PERCENT,
|
||||
ES_PROMPT_MILLIAMPS = ES_PROMPT_UNITS_BASE+UNIT_MILLIAMPS,
|
||||
ES_PROMPT_MAH = ES_PROMPT_UNITS_BASE+UNIT_MAH,
|
||||
ES_PROMPT_WATTS = ES_PROMPT_UNITS_BASE+UNIT_WATTS,
|
||||
ES_PROMPT_FEET = ES_PROMPT_UNITS_BASE+UNIT_FEET,
|
||||
ES_PROMPT_KTS = ES_PROMPT_UNITS_BASE+UNIT_KTS,
|
||||
ES_PROMPT_HOURS = ES_PROMPT_UNITS_BASE+UNIT_HOURS,
|
||||
ES_PROMPT_MINUTES = ES_PROMPT_UNITS_BASE+UNIT_MINUTES,
|
||||
ES_PROMPT_SECONDS = ES_PROMPT_UNITS_BASE+UNIT_SECONDS,
|
||||
ES_PROMPT_RPMS = ES_PROMPT_UNITS_BASE+UNIT_RPMS,
|
||||
ES_PROMPT_G = ES_PROMPT_UNITS_BASE+UNIT_G,
|
||||
#if defined(CPUARM)
|
||||
ES_PROMPT_MILLILITERS = ES_PROMPT_UNITS_BASE+UNIT_MILLILITERS,
|
||||
ES_PROMPT_FLOZ = ES_PROMPT_UNITS_BASE+UNIT_FLOZ,
|
||||
ES_PROMPT_FEET_PER_SECOND = ES_PROMPT_UNITS_BASE+UNIT_FEET_PER_SECOND,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
#if defined(CPUARM)
|
||||
#define ES_PUSH_UNIT_PROMPT(u) es_pushUnitPrompt((u), id)
|
||||
#else
|
||||
#define ES_PUSH_UNIT_PROMPT(u) pushUnitPrompt((u))
|
||||
#endif
|
||||
|
||||
I18N_PLAY_FUNCTION(es, pushUnitPrompt, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
#else
|
||||
unitprompt = ES_PROMPT_UNITS_BASE + unitprompt*2;
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
#endif
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(es, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
/* if digit >= 1000000000:
|
||||
temp_digit, digit = divmod(digit, 1000000000)
|
||||
prompts.extend(self.getNumberPrompt(temp_digit))
|
||||
prompts.append(Prompt(GUIDE_00_BILLION, dir=2))
|
||||
if digit >= 1000000:
|
||||
temp_digit, digit = divmod(digit, 1000000)
|
||||
prompts.extend(self.getNumberPrompt(temp_digit))
|
||||
prompts.append(Prompt(GUIDE_00_MILLION, dir=2))
|
||||
*/
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_MENO);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div(number, 10);
|
||||
if (qr.rem > 0) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_VIRGOLA);
|
||||
if (mode==2 && qr.rem < 10)
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_ZERO);
|
||||
PLAY_NUMBER(qr.rem, unit, 0);
|
||||
}
|
||||
else {
|
||||
PLAY_NUMBER(qr.quot, unit, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (number >= 1000) {
|
||||
if (number >= 2000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_MIL);
|
||||
} else {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_MIL);
|
||||
}
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number > 100) {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_CIENTO + (number/100) - 1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number == 100) {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_CIEN);
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 0) {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_ZERO+number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
ES_PUSH_UNIT_PROMPT(unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(es, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_MENO);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t ore = 0;
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||
ore = tmp;
|
||||
if (tmp > 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_HOURS, 1);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_UNA);
|
||||
PUSH_UNIT_PROMPT(UNIT_HOURS, 0);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_HORAS);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_UNA);
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_HORA);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp > 0 || ore >0) {
|
||||
if (tmp != 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_MINUTES, 1);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_UNA);
|
||||
PUSH_UNIT_PROMPT(UNIT_MINUTES, 0);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_MINUTOS);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_MINUTO);
|
||||
#endif
|
||||
}
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_Y);
|
||||
}
|
||||
|
||||
if (seconds != 1) {
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_SECONDS, 1);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_UNA);
|
||||
PUSH_UNIT_PROMPT(UNIT_SECONDS, 0);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_SEGUNDOS);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_SEGUNDO);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE(es, "Espanol");
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
* - Cameron Weeks <th9xer@gmail.com>
|
||||
* - Erez Raviv
|
||||
* - Gabriel Birkus
|
||||
* - Jean-Pierre Parisy
|
||||
* - Karl Szmutny
|
||||
* - Michael Blandford
|
||||
* - Michal Hlavinka
|
||||
* - Pat Mackenzie
|
||||
* - Philip Moss
|
||||
* - Rob Thomson
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum SpanishPrompts {
|
||||
ES_PROMPT_NUMBERS_BASE = 0,
|
||||
ES_PROMPT_ZERO = ES_PROMPT_NUMBERS_BASE+0,
|
||||
ES_PROMPT_CIEN = ES_PROMPT_NUMBERS_BASE+100,
|
||||
ES_PROMPT_CIENTO = ES_PROMPT_NUMBERS_BASE+101,
|
||||
ES_PROMPT_DOSCIENTOS = ES_PROMPT_NUMBERS_BASE+102,
|
||||
ES_PROMPT_TRESCIENTOS,
|
||||
ES_PROMPT_CUATROCIENTOS,
|
||||
ES_PROMPT_QUINIENTOS,
|
||||
ES_PROMPT_SESCIENTOS,
|
||||
ES_PROMPT_SETECIENTOS,
|
||||
ES_PROMPT_OCHOCIENTOS,
|
||||
ES_PROMPT_NUEVECIENTOS,
|
||||
ES_PROMPT_MIL = ES_PROMPT_NUMBERS_BASE+110,
|
||||
ES_PROMPT_VIRGOLA = 111,
|
||||
ES_PROMPT_UN,
|
||||
ES_PROMPT_UNA,
|
||||
ES_PROMPT_Y,
|
||||
ES_PROMPT_MENO,
|
||||
ES_PROMPT_HORA,
|
||||
ES_PROMPT_HORAS,
|
||||
ES_PROMPT_MINUTO,
|
||||
ES_PROMPT_MINUTOS,
|
||||
ES_PROMPT_SEGUNDO,
|
||||
ES_PROMPT_SEGUNDOS,
|
||||
|
||||
ES_PROMPT_UNITS_BASE = 122,
|
||||
ES_PROMPT_VOLTS = ES_PROMPT_UNITS_BASE+UNIT_VOLTS,
|
||||
ES_PROMPT_AMPS = ES_PROMPT_UNITS_BASE+UNIT_AMPS,
|
||||
ES_PROMPT_METERS_PER_SECOND = ES_PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND,
|
||||
ES_PROMPT_SPARE1 = ES_PROMPT_UNITS_BASE+UNIT_RAW,
|
||||
ES_PROMPT_KMH = ES_PROMPT_UNITS_BASE+UNIT_SPEED,
|
||||
ES_PROMPT_METERS = ES_PROMPT_UNITS_BASE+UNIT_DIST,
|
||||
ES_PROMPT_DEGREES = ES_PROMPT_UNITS_BASE+UNIT_TEMPERATURE,
|
||||
ES_PROMPT_PERCENT = ES_PROMPT_UNITS_BASE+UNIT_PERCENT,
|
||||
ES_PROMPT_MILLIAMPS = ES_PROMPT_UNITS_BASE+UNIT_MILLIAMPS,
|
||||
ES_PROMPT_MAH = ES_PROMPT_UNITS_BASE+UNIT_MAH,
|
||||
ES_PROMPT_WATTS = ES_PROMPT_UNITS_BASE+UNIT_WATTS,
|
||||
ES_PROMPT_FEET = ES_PROMPT_UNITS_BASE+UNIT_FEET,
|
||||
ES_PROMPT_KTS = ES_PROMPT_UNITS_BASE+UNIT_KTS,
|
||||
ES_PROMPT_HOURS = ES_PROMPT_UNITS_BASE+UNIT_HOURS,
|
||||
ES_PROMPT_MINUTES = ES_PROMPT_UNITS_BASE+UNIT_MINUTES,
|
||||
ES_PROMPT_SECONDS = ES_PROMPT_UNITS_BASE+UNIT_SECONDS,
|
||||
ES_PROMPT_RPMS = ES_PROMPT_UNITS_BASE+UNIT_RPMS,
|
||||
ES_PROMPT_G = ES_PROMPT_UNITS_BASE+UNIT_G,
|
||||
#if defined(CPUARM)
|
||||
ES_PROMPT_MILLILITERS = ES_PROMPT_UNITS_BASE+UNIT_MILLILITERS,
|
||||
ES_PROMPT_FLOZ = ES_PROMPT_UNITS_BASE+UNIT_FLOZ,
|
||||
ES_PROMPT_FEET_PER_SECOND = ES_PROMPT_UNITS_BASE+UNIT_FEET_PER_SECOND,
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
#if defined(CPUARM)
|
||||
#define ES_PUSH_UNIT_PROMPT(u) es_pushUnitPrompt((u), id)
|
||||
#else
|
||||
#define ES_PUSH_UNIT_PROMPT(u) pushUnitPrompt((u))
|
||||
#endif
|
||||
|
||||
I18N_PLAY_FUNCTION(es, pushUnitPrompt, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
#else
|
||||
unitprompt = ES_PROMPT_UNITS_BASE + unitprompt*2;
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
#endif
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(es, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
/* if digit >= 1000000000:
|
||||
temp_digit, digit = divmod(digit, 1000000000)
|
||||
prompts.extend(self.getNumberPrompt(temp_digit))
|
||||
prompts.append(Prompt(GUIDE_00_BILLION, dir=2))
|
||||
if digit >= 1000000:
|
||||
temp_digit, digit = divmod(digit, 1000000)
|
||||
prompts.extend(self.getNumberPrompt(temp_digit))
|
||||
prompts.append(Prompt(GUIDE_00_MILLION, dir=2))
|
||||
*/
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_MENO);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div((int)number, 10);
|
||||
if (qr.rem > 0) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_VIRGOLA);
|
||||
if (mode==2 && qr.rem < 10)
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_ZERO);
|
||||
PLAY_NUMBER(qr.rem, unit, 0);
|
||||
}
|
||||
else {
|
||||
PLAY_NUMBER(qr.quot, unit, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (number >= 1000) {
|
||||
if (number >= 2000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_MIL);
|
||||
} else {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_MIL);
|
||||
}
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number > 100) {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_CIENTO + (number/100) - 1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number == 100) {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_CIEN);
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 0) {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_ZERO+number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
ES_PUSH_UNIT_PROMPT(unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(es, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_MENO);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t ore = 0;
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||
ore = tmp;
|
||||
if (tmp > 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_HOURS, 1);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_UNA);
|
||||
PUSH_UNIT_PROMPT(UNIT_HOURS, 0);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_HORAS);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_UNA);
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_HORA);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp > 0 || ore >0) {
|
||||
if (tmp != 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_MINUTES, 1);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_UNA);
|
||||
PUSH_UNIT_PROMPT(UNIT_MINUTES, 0);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_MINUTOS);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_MINUTO);
|
||||
#endif
|
||||
}
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_Y);
|
||||
}
|
||||
|
||||
if (seconds != 1) {
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_SECONDS, 1);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_UNA);
|
||||
PUSH_UNIT_PROMPT(UNIT_SECONDS, 0);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_SEGUNDOS);
|
||||
}
|
||||
else {
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(ES_PROMPT_SEGUNDO);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE(es, "Espanol");
|
||||
|
||||
#endif
|
||||
|
||||
@@ -114,7 +114,7 @@ I18N_PLAY_FUNCTION(fr, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div(number, 10);
|
||||
div_t qr = div((int)number, 10);
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(FR_PROMPT_VIRGULE_BASE + qr.rem);
|
||||
|
||||
+176
-176
@@ -1,176 +1,176 @@
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
* - Cameron Weeks <th9xer@gmail.com>
|
||||
* - Erez Raviv
|
||||
* - Gabriel Birkus
|
||||
* - Jean-Pierre Parisy
|
||||
* - Karl Szmutny
|
||||
* - Michael Blandford
|
||||
* - Michal Hlavinka
|
||||
* - Pat Mackenzie
|
||||
* - Philip Moss
|
||||
* - Rob Thomson
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum HungarianPrompts {
|
||||
HU_PROMPT_NUMBERS_BASE = 0,
|
||||
HU_PROMPT_ZERO = HU_PROMPT_NUMBERS_BASE+0, //02-99
|
||||
HU_PROMPT_HUNDRED = HU_PROMPT_NUMBERS_BASE+100, //100,200 .. 900
|
||||
HU_PROMPT_THOUSAND = HU_PROMPT_NUMBERS_BASE+109, //1000
|
||||
HU_PROMPT_AND = HU_PROMPT_NUMBERS_BASE+110,
|
||||
HU_PROMPT_MINUS = HU_PROMPT_NUMBERS_BASE+111,
|
||||
HU_PROMPT_POINT = HU_PROMPT_NUMBERS_BASE+112,
|
||||
HU_PROMPT_UNITS_BASE = 113,
|
||||
HU_PROMPT_POINT_BASE = 165, //.0 - .9
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define HU_PUSH_UNIT_PROMPT(p, u) hu_pushUnitPrompt((p), (u), id)
|
||||
#else
|
||||
#define HU_PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u))
|
||||
#endif
|
||||
|
||||
I18N_PLAY_FUNCTION(hu, pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
if (number == 1)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
else
|
||||
PUSH_UNIT_PROMPT(unitprompt, 1);
|
||||
#else
|
||||
unitprompt = HU_PROMPT_UNITS_BASE + unitprompt*2;
|
||||
if (number == 1)
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
#endif
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(hu, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(HU_PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div(number, 10);
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(HU_PROMPT_POINT_BASE + qr.rem);
|
||||
number = -1;
|
||||
}
|
||||
else {
|
||||
number = qr.quot;
|
||||
}
|
||||
}
|
||||
|
||||
int16_t tmp = number;
|
||||
|
||||
if (number >= 1000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(HU_PROMPT_THOUSAND);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_NUMBER_PROMPT(HU_PROMPT_HUNDRED + (number/100)-1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 0) {
|
||||
PUSH_NUMBER_PROMPT(HU_PROMPT_ZERO + number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
HU_PUSH_UNIT_PROMPT(tmp, unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(hu, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds == 0) {
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(HU_PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||
PLAY_NUMBER(tmp, UNIT_HOURS, 0);
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
|
||||
// This is not necessary in the Hungarian
|
||||
//if (seconds > 0)
|
||||
//PUSH_NUMBER_PROMPT(HU_PROMPT_AND);
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE(hu, "Hungarian");
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
* - Cameron Weeks <th9xer@gmail.com>
|
||||
* - Erez Raviv
|
||||
* - Gabriel Birkus
|
||||
* - Jean-Pierre Parisy
|
||||
* - Karl Szmutny
|
||||
* - Michael Blandford
|
||||
* - Michal Hlavinka
|
||||
* - Pat Mackenzie
|
||||
* - Philip Moss
|
||||
* - Rob Thomson
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum HungarianPrompts {
|
||||
HU_PROMPT_NUMBERS_BASE = 0,
|
||||
HU_PROMPT_ZERO = HU_PROMPT_NUMBERS_BASE+0, //02-99
|
||||
HU_PROMPT_HUNDRED = HU_PROMPT_NUMBERS_BASE+100, //100,200 .. 900
|
||||
HU_PROMPT_THOUSAND = HU_PROMPT_NUMBERS_BASE+109, //1000
|
||||
HU_PROMPT_AND = HU_PROMPT_NUMBERS_BASE+110,
|
||||
HU_PROMPT_MINUS = HU_PROMPT_NUMBERS_BASE+111,
|
||||
HU_PROMPT_POINT = HU_PROMPT_NUMBERS_BASE+112,
|
||||
HU_PROMPT_UNITS_BASE = 113,
|
||||
HU_PROMPT_POINT_BASE = 165, //.0 - .9
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define HU_PUSH_UNIT_PROMPT(p, u) hu_pushUnitPrompt((p), (u), id)
|
||||
#else
|
||||
#define HU_PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u))
|
||||
#endif
|
||||
|
||||
I18N_PLAY_FUNCTION(hu, pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
if (number == 1)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
else
|
||||
PUSH_UNIT_PROMPT(unitprompt, 1);
|
||||
#else
|
||||
unitprompt = HU_PROMPT_UNITS_BASE + unitprompt*2;
|
||||
if (number == 1)
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
#endif
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(hu, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(HU_PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div((int)number, 10);
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(HU_PROMPT_POINT_BASE + qr.rem);
|
||||
number = -1;
|
||||
}
|
||||
else {
|
||||
number = qr.quot;
|
||||
}
|
||||
}
|
||||
|
||||
int16_t tmp = number;
|
||||
|
||||
if (number >= 1000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(HU_PROMPT_THOUSAND);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_NUMBER_PROMPT(HU_PROMPT_HUNDRED + (number/100)-1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 0) {
|
||||
PUSH_NUMBER_PROMPT(HU_PROMPT_ZERO + number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
HU_PUSH_UNIT_PROMPT(tmp, unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(hu, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds == 0) {
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(HU_PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||
PLAY_NUMBER(tmp, UNIT_HOURS, 0);
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
|
||||
// This is not necessary in the Hungarian
|
||||
//if (seconds > 0)
|
||||
//PUSH_NUMBER_PROMPT(HU_PROMPT_AND);
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE(hu, "Hungarian");
|
||||
|
||||
#endif
|
||||
|
||||
+244
-244
@@ -1,244 +1,244 @@
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum ItalianPrompts {
|
||||
IT_PROMPT_NUMBERS_BASE = 0,
|
||||
IT_PROMPT_ZERO = IT_PROMPT_NUMBERS_BASE+0,
|
||||
IT_PROMPT_CENT = IT_PROMPT_NUMBERS_BASE+100,
|
||||
IT_PROMPT_MILA = IT_PROMPT_NUMBERS_BASE+101,
|
||||
IT_PROMPT_MILLE = IT_PROMPT_NUMBERS_BASE+102,
|
||||
IT_PROMPT_VIRGOLA = 103,
|
||||
IT_PROMPT_UN,
|
||||
IT_PROMPT_E,
|
||||
IT_PROMPT_MENO,
|
||||
IT_PROMPT_ORA,
|
||||
IT_PROMPT_ORE,
|
||||
IT_PROMPT_MINUTO,
|
||||
IT_PROMPT_MINUTI,
|
||||
IT_PROMPT_SECONDO,
|
||||
IT_PROMPT_SECONDI,
|
||||
|
||||
IT_PROMPT_UNITS_BASE = 113,
|
||||
IT_PROMPT_VOLTS = IT_PROMPT_UNITS_BASE+(UNIT_VOLTS*2),
|
||||
IT_PROMPT_AMPS = IT_PROMPT_UNITS_BASE+(UNIT_AMPS*2),
|
||||
IT_PROMPT_METERS_PER_SECOND = IT_PROMPT_UNITS_BASE+(UNIT_METERS_PER_SECOND*2),
|
||||
IT_PROMPT_SPARE1 = IT_PROMPT_UNITS_BASE+(UNIT_RAW*2),
|
||||
IT_PROMPT_KMH = IT_PROMPT_UNITS_BASE+(UNIT_SPEED*2),
|
||||
IT_PROMPT_METERS = IT_PROMPT_UNITS_BASE+(UNIT_DIST*2),
|
||||
IT_PROMPT_DEGREES = IT_PROMPT_UNITS_BASE+(UNIT_TEMPERATURE*2),
|
||||
IT_PROMPT_PERCENT = IT_PROMPT_UNITS_BASE+(UNIT_PERCENT*2),
|
||||
IT_PROMPT_MILLIAMPS = IT_PROMPT_UNITS_BASE+(UNIT_MILLIAMPS*2),
|
||||
IT_PROMPT_MAH = IT_PROMPT_UNITS_BASE+(UNIT_MAH*2),
|
||||
IT_PROMPT_WATTS = IT_PROMPT_UNITS_BASE+(UNIT_WATTS*2),
|
||||
IT_PROMPT_FEET = IT_PROMPT_UNITS_BASE+(UNIT_FEET*2),
|
||||
IT_PROMPT_KTS = IT_PROMPT_UNITS_BASE+(UNIT_KTS*2),
|
||||
#if defined(CPUARM)
|
||||
IT_PROMPT_MILLILITERS = IT_PROMPT_UNITS_BASE+(UNIT_MILLILITERS*2),
|
||||
IT_PROMPT_FLOZ = IT_PROMPT_UNITS_BASE+(UNIT_FLOZ*2),
|
||||
IT_PROMPT_FEET_PER_SECOND = IT_PROMPT_UNITS_BASE+(UNIT_FEET_PER_SECOND*2),
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
#if defined(CPUARM)
|
||||
#define IT_PUSH_UNIT_PROMPT(p, u) it_pushUnitPrompt((p), (u), id)
|
||||
#else
|
||||
#define IT_PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u))
|
||||
#endif
|
||||
|
||||
I18N_PLAY_FUNCTION(it, pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
if (number == 1)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
else
|
||||
PUSH_UNIT_PROMPT(unitprompt, 1);
|
||||
#else
|
||||
unitprompt = IT_PROMPT_UNITS_BASE + unitprompt*2;
|
||||
if (number == 1)
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
I18N_PLAY_FUNCTION(it, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
/* if digit >= 1000000000:
|
||||
temp_digit, digit = divmod(digit, 1000000000)
|
||||
prompts.extend(self.getNumberPrompt(temp_digit))
|
||||
prompts.append(Prompt(GUIDE_00_BILLION, dir=2))
|
||||
if digit >= 1000000:
|
||||
temp_digit, digit = divmod(digit, 1000000)
|
||||
prompts.extend(self.getNumberPrompt(temp_digit))
|
||||
prompts.append(Prompt(GUIDE_00_MILLION, dir=2))
|
||||
*/
|
||||
getvalue_t orignumber;
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_MENO);
|
||||
number = -number;
|
||||
}
|
||||
orignumber=number;
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div(number, 10);
|
||||
if (qr.rem > 0) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_VIRGOLA);
|
||||
if (mode==2 && qr.rem < 10)
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_ZERO);
|
||||
PLAY_NUMBER(qr.rem, 0, 0);
|
||||
}
|
||||
else {
|
||||
if (qr.quot==1) {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_UN);
|
||||
if (unit) {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_UNITS_BASE+(unit*2));
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (orignumber == 1 && unit) {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_UN);
|
||||
} else {
|
||||
if (number >= 1000) {
|
||||
if (number >= 2000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_MILA);
|
||||
} else {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_MILLE);
|
||||
}
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
if (number >= 200)
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_ZERO + number/100);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_CENT);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_ZERO+number);
|
||||
}
|
||||
}
|
||||
if (unit) {
|
||||
IT_PUSH_UNIT_PROMPT(orignumber, unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(it, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_MENO);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t ore = 0;
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
if (tmp > 0) {
|
||||
ore=tmp;
|
||||
if (tmp > 1 || IS_PLAY_TIME()) {
|
||||
#if defined(CPUARM)
|
||||
PLAY_NUMBER(tmp, UNIT_HOURS, 0);
|
||||
#else
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_ORE);
|
||||
} else {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_ORA);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (seconds>0) {
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp>0 && seconds==0 && ore>0) {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_E);
|
||||
}
|
||||
if (tmp > 0) {
|
||||
if (tmp != 1) {
|
||||
#if defined(CPUARM)
|
||||
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
|
||||
#else
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_MINUTI);
|
||||
} else {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_MINUTO);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if ((tmp>0 || ore>0) && seconds>0) {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_E);
|
||||
}
|
||||
}
|
||||
if (seconds != 0 || (ore==0 && tmp==0)) {
|
||||
if (seconds != 1) {
|
||||
#if defined(CPUARM)
|
||||
PLAY_NUMBER(tmp, UNIT_SECONDS, 0);
|
||||
#else
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_SECONDI);
|
||||
} else {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_SECONDO);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE(it, "Italiano");
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum ItalianPrompts {
|
||||
IT_PROMPT_NUMBERS_BASE = 0,
|
||||
IT_PROMPT_ZERO = IT_PROMPT_NUMBERS_BASE+0,
|
||||
IT_PROMPT_CENT = IT_PROMPT_NUMBERS_BASE+100,
|
||||
IT_PROMPT_MILA = IT_PROMPT_NUMBERS_BASE+101,
|
||||
IT_PROMPT_MILLE = IT_PROMPT_NUMBERS_BASE+102,
|
||||
IT_PROMPT_VIRGOLA = 103,
|
||||
IT_PROMPT_UN,
|
||||
IT_PROMPT_E,
|
||||
IT_PROMPT_MENO,
|
||||
IT_PROMPT_ORA,
|
||||
IT_PROMPT_ORE,
|
||||
IT_PROMPT_MINUTO,
|
||||
IT_PROMPT_MINUTI,
|
||||
IT_PROMPT_SECONDO,
|
||||
IT_PROMPT_SECONDI,
|
||||
|
||||
IT_PROMPT_UNITS_BASE = 113,
|
||||
IT_PROMPT_VOLTS = IT_PROMPT_UNITS_BASE+(UNIT_VOLTS*2),
|
||||
IT_PROMPT_AMPS = IT_PROMPT_UNITS_BASE+(UNIT_AMPS*2),
|
||||
IT_PROMPT_METERS_PER_SECOND = IT_PROMPT_UNITS_BASE+(UNIT_METERS_PER_SECOND*2),
|
||||
IT_PROMPT_SPARE1 = IT_PROMPT_UNITS_BASE+(UNIT_RAW*2),
|
||||
IT_PROMPT_KMH = IT_PROMPT_UNITS_BASE+(UNIT_SPEED*2),
|
||||
IT_PROMPT_METERS = IT_PROMPT_UNITS_BASE+(UNIT_DIST*2),
|
||||
IT_PROMPT_DEGREES = IT_PROMPT_UNITS_BASE+(UNIT_TEMPERATURE*2),
|
||||
IT_PROMPT_PERCENT = IT_PROMPT_UNITS_BASE+(UNIT_PERCENT*2),
|
||||
IT_PROMPT_MILLIAMPS = IT_PROMPT_UNITS_BASE+(UNIT_MILLIAMPS*2),
|
||||
IT_PROMPT_MAH = IT_PROMPT_UNITS_BASE+(UNIT_MAH*2),
|
||||
IT_PROMPT_WATTS = IT_PROMPT_UNITS_BASE+(UNIT_WATTS*2),
|
||||
IT_PROMPT_FEET = IT_PROMPT_UNITS_BASE+(UNIT_FEET*2),
|
||||
IT_PROMPT_KTS = IT_PROMPT_UNITS_BASE+(UNIT_KTS*2),
|
||||
#if defined(CPUARM)
|
||||
IT_PROMPT_MILLILITERS = IT_PROMPT_UNITS_BASE+(UNIT_MILLILITERS*2),
|
||||
IT_PROMPT_FLOZ = IT_PROMPT_UNITS_BASE+(UNIT_FLOZ*2),
|
||||
IT_PROMPT_FEET_PER_SECOND = IT_PROMPT_UNITS_BASE+(UNIT_FEET_PER_SECOND*2),
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
#if defined(CPUARM)
|
||||
#define IT_PUSH_UNIT_PROMPT(p, u) it_pushUnitPrompt((p), (u), id)
|
||||
#else
|
||||
#define IT_PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u))
|
||||
#endif
|
||||
|
||||
I18N_PLAY_FUNCTION(it, pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
if (number == 1)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
else
|
||||
PUSH_UNIT_PROMPT(unitprompt, 1);
|
||||
#else
|
||||
unitprompt = IT_PROMPT_UNITS_BASE + unitprompt*2;
|
||||
if (number == 1)
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
I18N_PLAY_FUNCTION(it, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
/* if digit >= 1000000000:
|
||||
temp_digit, digit = divmod(digit, 1000000000)
|
||||
prompts.extend(self.getNumberPrompt(temp_digit))
|
||||
prompts.append(Prompt(GUIDE_00_BILLION, dir=2))
|
||||
if digit >= 1000000:
|
||||
temp_digit, digit = divmod(digit, 1000000)
|
||||
prompts.extend(self.getNumberPrompt(temp_digit))
|
||||
prompts.append(Prompt(GUIDE_00_MILLION, dir=2))
|
||||
*/
|
||||
getvalue_t orignumber;
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_MENO);
|
||||
number = -number;
|
||||
}
|
||||
orignumber=number;
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div((int)number, 10);
|
||||
if (qr.rem > 0) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_VIRGOLA);
|
||||
if (mode==2 && qr.rem < 10)
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_ZERO);
|
||||
PLAY_NUMBER(qr.rem, 0, 0);
|
||||
}
|
||||
else {
|
||||
if (qr.quot==1) {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_UN);
|
||||
if (unit) {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_UNITS_BASE+(unit*2));
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (orignumber == 1 && unit) {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_UN);
|
||||
} else {
|
||||
if (number >= 1000) {
|
||||
if (number >= 2000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_MILA);
|
||||
} else {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_MILLE);
|
||||
}
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
if (number >= 200)
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_ZERO + number/100);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_CENT);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_ZERO+number);
|
||||
}
|
||||
}
|
||||
if (unit) {
|
||||
IT_PUSH_UNIT_PROMPT(orignumber, unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(it, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_MENO);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t ore = 0;
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
if (tmp > 0) {
|
||||
ore=tmp;
|
||||
if (tmp > 1 || IS_PLAY_TIME()) {
|
||||
#if defined(CPUARM)
|
||||
PLAY_NUMBER(tmp, UNIT_HOURS, 0);
|
||||
#else
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_ORE);
|
||||
} else {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_ORA);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (seconds>0) {
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp>0 && seconds==0 && ore>0) {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_E);
|
||||
}
|
||||
if (tmp > 0) {
|
||||
if (tmp != 1) {
|
||||
#if defined(CPUARM)
|
||||
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
|
||||
#else
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_MINUTI);
|
||||
} else {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_MINUTO);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if ((tmp>0 || ore>0) && seconds>0) {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_E);
|
||||
}
|
||||
}
|
||||
if (seconds != 0 || (ore==0 && tmp==0)) {
|
||||
if (seconds != 1) {
|
||||
#if defined(CPUARM)
|
||||
PLAY_NUMBER(tmp, UNIT_SECONDS, 0);
|
||||
#else
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_SECONDI);
|
||||
} else {
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_UN);
|
||||
PUSH_NUMBER_PROMPT(IT_PROMPT_SECONDO);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE(it, "Italiano");
|
||||
|
||||
#endif
|
||||
|
||||
@@ -146,7 +146,7 @@ I18N_PLAY_FUNCTION(pl, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div(number, 10);
|
||||
div_t qr = div((int)number, 10);
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, ZENSKI);
|
||||
if (qr.quot == 0)
|
||||
|
||||
+250
-250
@@ -1,250 +1,250 @@
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
* - Cameron Weeks <th9xer@gmail.com>
|
||||
* - Erez Raviv
|
||||
* - Gabriel Birkus
|
||||
* - Jean-Pierre Parisy
|
||||
* - Karl Szmutny
|
||||
* - Michael Blandford
|
||||
* - Michal Hlavinka
|
||||
* - Pat Mackenzie
|
||||
* - Philip Moss
|
||||
* - Rob Thomson
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum PortuguesePrompts {
|
||||
PT_PROMPT_NUMBERS_BASE = 0,
|
||||
PT_PROMPT_ZERO = PT_PROMPT_NUMBERS_BASE+0,
|
||||
PT_PROMPT_CEM = PT_PROMPT_NUMBERS_BASE+100,
|
||||
PT_PROMPT_CENTO = PT_PROMPT_NUMBERS_BASE+101,
|
||||
PT_PROMPT_DUZENTOS = PT_PROMPT_NUMBERS_BASE+102,
|
||||
PT_PROMPT_TREZCENTOS,
|
||||
PT_PROMPT_QUATROCENTOS,
|
||||
PT_PROMPT_QUINHENTOS,
|
||||
PT_PROMPT_SEISCENTOS,
|
||||
PT_PROMPT_SETECENTOS,
|
||||
PT_PROMPT_OITOCENTOS,
|
||||
PT_PROMPT_NUEVECENTOS,
|
||||
PT_PROMPT_MIL = PT_PROMPT_NUMBERS_BASE+110,
|
||||
PT_PROMPT_VIRGULA = 111,
|
||||
PT_PROMPT_UMA,
|
||||
PT_PROMPT_DUAS,
|
||||
PT_PROMPT_E,
|
||||
PT_PROMPT_MENOS,
|
||||
PT_PROMPT_HORA,
|
||||
PT_PROMPT_HORAS,
|
||||
PT_PROMPT_MINUTO,
|
||||
PT_PROMPT_MINUTOS,
|
||||
PT_PROMPT_SEGUNDO,
|
||||
PT_PROMPT_SEGUNDOS,
|
||||
|
||||
PT_PROMPT_UNITS_BASE = 122,
|
||||
PT_PROMPT_VOLTS = PT_PROMPT_UNITS_BASE+UNIT_VOLTS,
|
||||
PT_PROMPT_AMPS = PT_PROMPT_UNITS_BASE+UNIT_AMPS,
|
||||
PT_PROMPT_METERS_PER_SECOND = PT_PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND,
|
||||
PT_PROMPT_SPARE1 = PT_PROMPT_UNITS_BASE+UNIT_RAW,
|
||||
PT_PROMPT_KMH = PT_PROMPT_UNITS_BASE+UNIT_SPEED,
|
||||
PT_PROMPT_METERS = PT_PROMPT_UNITS_BASE+UNIT_DIST,
|
||||
PT_PROMPT_DEGREES = PT_PROMPT_UNITS_BASE+UNIT_TEMPERATURE,
|
||||
PT_PROMPT_PERCENT = PT_PROMPT_UNITS_BASE+UNIT_PERCENT,
|
||||
PT_PROMPT_MILLIAMPS = PT_PROMPT_UNITS_BASE+UNIT_MILLIAMPS,
|
||||
PT_PROMPT_MAH = PT_PROMPT_UNITS_BASE+UNIT_MAH,
|
||||
PT_PROMPT_WATTS = PT_PROMPT_UNITS_BASE+UNIT_WATTS,
|
||||
PT_PROMPT_FEET = PT_PROMPT_UNITS_BASE+UNIT_FEET,
|
||||
PT_PROMPT_KTS = PT_PROMPT_UNITS_BASE+UNIT_KTS,
|
||||
#if defined(CPUARM)
|
||||
PT_PROMPT_MILLILITERS = PT_PROMPT_UNITS_BASE+UNIT_MILLILITERS,
|
||||
PT_PROMPT_FLOZ = PT_PROMPT_UNITS_BASE+UNIT_FLOZ,
|
||||
PT_PROMPT_FEET_PER_SECOND = PT_PROMPT_UNITS_BASE+UNIT_FEET_PER_SECOND,
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define PT_PUSH_UNIT_PROMPT(u) pt_pushUnitPrompt((u), id)
|
||||
#else
|
||||
#define PT_PUSH_UNIT_PROMPT(u) pushUnitPrompt((u))
|
||||
#endif
|
||||
|
||||
I18N_PLAY_FUNCTION(pt, pushUnitPrompt, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
#else
|
||||
unitprompt = PT_PROMPT_UNITS_BASE + unitprompt*2;
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
#endif
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(pt, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_MENOS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div(number, 10);
|
||||
if (qr.rem > 0) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_VIRGULA);
|
||||
if (mode==2 && qr.rem < 10)
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_ZERO);
|
||||
PLAY_NUMBER(qr.rem, unit, 0);
|
||||
}
|
||||
else {
|
||||
PLAY_NUMBER(qr.quot, unit, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (number >= 1000) {
|
||||
if (number >= 2000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_MIL);
|
||||
} else {
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_MIL);
|
||||
}
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_CENTO + number/100);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_ZERO+number);
|
||||
|
||||
if (unit) {
|
||||
PT_PUSH_UNIT_PROMPT(unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(pt, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_MENOS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t ore = 0;
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||
ore=tmp;
|
||||
if (tmp > 2) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_HOURS, 1);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_HORAS);
|
||||
#endif
|
||||
} else if (tmp==2) {
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_DUAS);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_HOURS, 1);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_HORAS);
|
||||
#endif
|
||||
} else if (tmp==1) {
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_UMA);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_HOURS, 0);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_HORAS);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp > 0 || ore >0) {
|
||||
if (tmp != 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_MINUTES, 1);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_MINUTOS);
|
||||
#endif
|
||||
} else {
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_NUMBERS_BASE+1);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_MINUTES, 0);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_MINUTO);
|
||||
#endif
|
||||
}
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_E);
|
||||
}
|
||||
|
||||
if (seconds != 1) {
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_SECONDS, 1);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_SEGUNDOS);
|
||||
#endif
|
||||
} else {
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_NUMBERS_BASE+1);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_SECONDS, 0);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_SEGUNDO);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE(pt, "Portugues");
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
* - Cameron Weeks <th9xer@gmail.com>
|
||||
* - Erez Raviv
|
||||
* - Gabriel Birkus
|
||||
* - Jean-Pierre Parisy
|
||||
* - Karl Szmutny
|
||||
* - Michael Blandford
|
||||
* - Michal Hlavinka
|
||||
* - Pat Mackenzie
|
||||
* - Philip Moss
|
||||
* - Rob Thomson
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum PortuguesePrompts {
|
||||
PT_PROMPT_NUMBERS_BASE = 0,
|
||||
PT_PROMPT_ZERO = PT_PROMPT_NUMBERS_BASE+0,
|
||||
PT_PROMPT_CEM = PT_PROMPT_NUMBERS_BASE+100,
|
||||
PT_PROMPT_CENTO = PT_PROMPT_NUMBERS_BASE+101,
|
||||
PT_PROMPT_DUZENTOS = PT_PROMPT_NUMBERS_BASE+102,
|
||||
PT_PROMPT_TREZCENTOS,
|
||||
PT_PROMPT_QUATROCENTOS,
|
||||
PT_PROMPT_QUINHENTOS,
|
||||
PT_PROMPT_SEISCENTOS,
|
||||
PT_PROMPT_SETECENTOS,
|
||||
PT_PROMPT_OITOCENTOS,
|
||||
PT_PROMPT_NUEVECENTOS,
|
||||
PT_PROMPT_MIL = PT_PROMPT_NUMBERS_BASE+110,
|
||||
PT_PROMPT_VIRGULA = 111,
|
||||
PT_PROMPT_UMA,
|
||||
PT_PROMPT_DUAS,
|
||||
PT_PROMPT_E,
|
||||
PT_PROMPT_MENOS,
|
||||
PT_PROMPT_HORA,
|
||||
PT_PROMPT_HORAS,
|
||||
PT_PROMPT_MINUTO,
|
||||
PT_PROMPT_MINUTOS,
|
||||
PT_PROMPT_SEGUNDO,
|
||||
PT_PROMPT_SEGUNDOS,
|
||||
|
||||
PT_PROMPT_UNITS_BASE = 122,
|
||||
PT_PROMPT_VOLTS = PT_PROMPT_UNITS_BASE+UNIT_VOLTS,
|
||||
PT_PROMPT_AMPS = PT_PROMPT_UNITS_BASE+UNIT_AMPS,
|
||||
PT_PROMPT_METERS_PER_SECOND = PT_PROMPT_UNITS_BASE+UNIT_METERS_PER_SECOND,
|
||||
PT_PROMPT_SPARE1 = PT_PROMPT_UNITS_BASE+UNIT_RAW,
|
||||
PT_PROMPT_KMH = PT_PROMPT_UNITS_BASE+UNIT_SPEED,
|
||||
PT_PROMPT_METERS = PT_PROMPT_UNITS_BASE+UNIT_DIST,
|
||||
PT_PROMPT_DEGREES = PT_PROMPT_UNITS_BASE+UNIT_TEMPERATURE,
|
||||
PT_PROMPT_PERCENT = PT_PROMPT_UNITS_BASE+UNIT_PERCENT,
|
||||
PT_PROMPT_MILLIAMPS = PT_PROMPT_UNITS_BASE+UNIT_MILLIAMPS,
|
||||
PT_PROMPT_MAH = PT_PROMPT_UNITS_BASE+UNIT_MAH,
|
||||
PT_PROMPT_WATTS = PT_PROMPT_UNITS_BASE+UNIT_WATTS,
|
||||
PT_PROMPT_FEET = PT_PROMPT_UNITS_BASE+UNIT_FEET,
|
||||
PT_PROMPT_KTS = PT_PROMPT_UNITS_BASE+UNIT_KTS,
|
||||
#if defined(CPUARM)
|
||||
PT_PROMPT_MILLILITERS = PT_PROMPT_UNITS_BASE+UNIT_MILLILITERS,
|
||||
PT_PROMPT_FLOZ = PT_PROMPT_UNITS_BASE+UNIT_FLOZ,
|
||||
PT_PROMPT_FEET_PER_SECOND = PT_PROMPT_UNITS_BASE+UNIT_FEET_PER_SECOND,
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define PT_PUSH_UNIT_PROMPT(u) pt_pushUnitPrompt((u), id)
|
||||
#else
|
||||
#define PT_PUSH_UNIT_PROMPT(u) pushUnitPrompt((u))
|
||||
#endif
|
||||
|
||||
I18N_PLAY_FUNCTION(pt, pushUnitPrompt, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
#else
|
||||
unitprompt = PT_PROMPT_UNITS_BASE + unitprompt*2;
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
#endif
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(pt, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_MENOS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div((int)number, 10);
|
||||
if (qr.rem > 0) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_VIRGULA);
|
||||
if (mode==2 && qr.rem < 10)
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_ZERO);
|
||||
PLAY_NUMBER(qr.rem, unit, 0);
|
||||
}
|
||||
else {
|
||||
PLAY_NUMBER(qr.quot, unit, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (number >= 1000) {
|
||||
if (number >= 2000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_MIL);
|
||||
} else {
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_MIL);
|
||||
}
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_CENTO + number/100);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_ZERO+number);
|
||||
|
||||
if (unit) {
|
||||
PT_PUSH_UNIT_PROMPT(unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(pt, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_MENOS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t ore = 0;
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||
ore=tmp;
|
||||
if (tmp > 2) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_HOURS, 1);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_HORAS);
|
||||
#endif
|
||||
} else if (tmp==2) {
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_DUAS);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_HOURS, 1);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_HORAS);
|
||||
#endif
|
||||
} else if (tmp==1) {
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_UMA);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_HOURS, 0);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_HORAS);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp > 0 || ore >0) {
|
||||
if (tmp != 1) {
|
||||
PLAY_NUMBER(tmp, 0, 0);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_MINUTES, 1);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_MINUTOS);
|
||||
#endif
|
||||
} else {
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_NUMBERS_BASE+1);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_MINUTES, 0);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_MINUTO);
|
||||
#endif
|
||||
}
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_E);
|
||||
}
|
||||
|
||||
if (seconds != 1) {
|
||||
PLAY_NUMBER(seconds, 0, 0);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_SECONDS, 1);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_SEGUNDOS);
|
||||
#endif
|
||||
} else {
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_NUMBERS_BASE+1);
|
||||
#if defined(CPUARM)
|
||||
PUSH_UNIT_PROMPT(UNIT_SECONDS, 0);
|
||||
#else
|
||||
PUSH_NUMBER_PROMPT(PT_PROMPT_SEGUNDO);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE(pt, "Portugues");
|
||||
|
||||
#endif
|
||||
|
||||
+171
-171
@@ -1,171 +1,171 @@
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
* - Cameron Weeks <th9xer@gmail.com>
|
||||
* - Erez Raviv
|
||||
* - Gabriel Birkus
|
||||
* - Jean-Pierre Parisy
|
||||
* - Kjell Kernen
|
||||
* - Karl Szmutny
|
||||
* - Michael Blandford
|
||||
* - Michal Hlavinka
|
||||
* - Pat Mackenzie
|
||||
* - Philip Moss
|
||||
* - Rob Thomson
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum SwedishPrompts {
|
||||
SE_PROMPT_NUMBERS_BASE = 0,
|
||||
SE_PROMPT_ZERO = SE_PROMPT_NUMBERS_BASE+0, //02-99
|
||||
SE_PROMPT_HUNDRED = SE_PROMPT_NUMBERS_BASE+100, //100,200 .. 900
|
||||
SE_PROMPT_THOUSAND = SE_PROMPT_NUMBERS_BASE+109, //1000
|
||||
SE_PROMPT_AND = SE_PROMPT_NUMBERS_BASE+110,
|
||||
SE_PROMPT_MINUS = SE_PROMPT_NUMBERS_BASE+111,
|
||||
SE_PROMPT_POINT = SE_PROMPT_NUMBERS_BASE+112,
|
||||
SE_PROMPT_UNITS_BASE = 113,
|
||||
SE_PROMPT_POINT_BASE = 165, //.0 - .9
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define SE_PUSH_UNIT_PROMPT(p, u) se_pushUnitPrompt((p), (u), id)
|
||||
#else
|
||||
#define SE_PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u))
|
||||
#endif
|
||||
|
||||
I18N_PLAY_FUNCTION(se, pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
if (number == 1)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
else
|
||||
PUSH_UNIT_PROMPT(unitprompt, 1);
|
||||
#else
|
||||
unitprompt = SE_PROMPT_UNITS_BASE + unitprompt*2;
|
||||
if (number == 1)
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
#endif
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(se, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(SE_PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div(number, 10);
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(SE_PROMPT_POINT_BASE + qr.rem);
|
||||
number = -1;
|
||||
}
|
||||
else {
|
||||
number = qr.quot;
|
||||
}
|
||||
}
|
||||
|
||||
int16_t tmpNumber = number;
|
||||
|
||||
if (number >= 1000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(SE_PROMPT_THOUSAND);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_NUMBER_PROMPT(SE_PROMPT_HUNDRED + (number/100)-1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 0) {
|
||||
PUSH_NUMBER_PROMPT(SE_PROMPT_ZERO + number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
SE_PUSH_UNIT_PROMPT(tmpNumber, unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(se, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(SE_PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||
PLAY_NUMBER(tmp, UNIT_HOURS, 0);
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
|
||||
if (seconds > 0)
|
||||
PUSH_NUMBER_PROMPT(SE_PROMPT_AND);
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE(se, "Swedish");
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
* - Cameron Weeks <th9xer@gmail.com>
|
||||
* - Erez Raviv
|
||||
* - Gabriel Birkus
|
||||
* - Jean-Pierre Parisy
|
||||
* - Kjell Kernen
|
||||
* - Karl Szmutny
|
||||
* - Michael Blandford
|
||||
* - Michal Hlavinka
|
||||
* - Pat Mackenzie
|
||||
* - Philip Moss
|
||||
* - Rob Thomson
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum SwedishPrompts {
|
||||
SE_PROMPT_NUMBERS_BASE = 0,
|
||||
SE_PROMPT_ZERO = SE_PROMPT_NUMBERS_BASE+0, //02-99
|
||||
SE_PROMPT_HUNDRED = SE_PROMPT_NUMBERS_BASE+100, //100,200 .. 900
|
||||
SE_PROMPT_THOUSAND = SE_PROMPT_NUMBERS_BASE+109, //1000
|
||||
SE_PROMPT_AND = SE_PROMPT_NUMBERS_BASE+110,
|
||||
SE_PROMPT_MINUS = SE_PROMPT_NUMBERS_BASE+111,
|
||||
SE_PROMPT_POINT = SE_PROMPT_NUMBERS_BASE+112,
|
||||
SE_PROMPT_UNITS_BASE = 113,
|
||||
SE_PROMPT_POINT_BASE = 165, //.0 - .9
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define SE_PUSH_UNIT_PROMPT(p, u) se_pushUnitPrompt((p), (u), id)
|
||||
#else
|
||||
#define SE_PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u))
|
||||
#endif
|
||||
|
||||
I18N_PLAY_FUNCTION(se, pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
if (number == 1)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
else
|
||||
PUSH_UNIT_PROMPT(unitprompt, 1);
|
||||
#else
|
||||
unitprompt = SE_PROMPT_UNITS_BASE + unitprompt*2;
|
||||
if (number == 1)
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
#endif
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(se, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(SE_PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div((int)number, 10);
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(SE_PROMPT_POINT_BASE + qr.rem);
|
||||
number = -1;
|
||||
}
|
||||
else {
|
||||
number = qr.quot;
|
||||
}
|
||||
}
|
||||
|
||||
int16_t tmpNumber = number;
|
||||
|
||||
if (number >= 1000) {
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
PUSH_NUMBER_PROMPT(SE_PROMPT_THOUSAND);
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_NUMBER_PROMPT(SE_PROMPT_HUNDRED + (number/100)-1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 0) {
|
||||
PUSH_NUMBER_PROMPT(SE_PROMPT_ZERO + number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
SE_PUSH_UNIT_PROMPT(tmpNumber, unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(se, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(SE_PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||
PLAY_NUMBER(tmp, UNIT_HOURS, 0);
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, UNIT_MINUTES, 0);
|
||||
if (seconds > 0)
|
||||
PUSH_NUMBER_PROMPT(SE_PROMPT_AND);
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
PLAY_NUMBER(seconds, UNIT_SECONDS, 0);
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE(se, "Swedish");
|
||||
|
||||
#endif
|
||||
|
||||
+257
-257
@@ -1,257 +1,257 @@
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
* - Cameron Weeks <th9xer@gmail.com>
|
||||
* - Erez Raviv
|
||||
* - Gabriel Birkus
|
||||
* - Jean-Pierre Parisy
|
||||
* - Karl Szmutny
|
||||
* - Martin Hotar
|
||||
* - Michael Blandford
|
||||
* - Michal Hlavinka
|
||||
* - Pat Mackenzie
|
||||
* - Philip Moss
|
||||
* - Rob Thomson
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum SlovakPrompts {
|
||||
SK_PROMPT_NUMBERS_BASE = 0,
|
||||
SK_PROMPT_NULA = SK_PROMPT_NUMBERS_BASE+0, //0-99
|
||||
SK_PROMPT_STO = SK_PROMPT_NUMBERS_BASE+100, //100,200 .. 900
|
||||
SK_PROMPT_TISIC = SK_PROMPT_NUMBERS_BASE+109, //1000
|
||||
SK_PROMPT_DVETISIC = SK_PROMPT_NUMBERS_BASE+110,
|
||||
SK_PROMPT_JEDEN = SK_PROMPT_NUMBERS_BASE+111,
|
||||
SK_PROMPT_JEDNO = SK_PROMPT_NUMBERS_BASE+112,
|
||||
SK_PROMPT_DVE = SK_PROMPT_NUMBERS_BASE+113,
|
||||
SK_PROMPT_CELA = SK_PROMPT_NUMBERS_BASE+114,
|
||||
SK_PROMPT_CELE = SK_PROMPT_NUMBERS_BASE+115,
|
||||
SK_PROMPT_CELYCH = SK_PROMPT_NUMBERS_BASE+116,
|
||||
SK_PROMPT_MINUS = SK_PROMPT_NUMBERS_BASE+117,
|
||||
|
||||
SK_PROMPT_UNITS_BASE = 118, //(jeden)volt,(dva)volty,(pet)voltu,(desetina)voltu
|
||||
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define SK_PUSH_UNIT_PROMPT(p, u) sk_pushUnitPrompt((p), (u), id)
|
||||
#else
|
||||
#define SK_PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u))
|
||||
#endif
|
||||
|
||||
#define MUZSKY 0x80
|
||||
#define ZENSKY 0x81
|
||||
#define STREDNI 0x82
|
||||
|
||||
I18N_PLAY_FUNCTION(sk, pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
if (number == 1)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
else if (number > 1 && number < 5)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 1);
|
||||
else
|
||||
PUSH_UNIT_PROMPT(unitprompt, 2);
|
||||
#else
|
||||
unitprompt = SK_PROMPT_UNITS_BASE + unitprompt*4;
|
||||
if (number == 1)
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else if (number > 1 && number < 5)
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
else
|
||||
PUSH_NUMBER_PROMPT(unitprompt+2);
|
||||
#endif
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(sk, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div(number, 10);
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, ZENSKY);
|
||||
if (qr.quot == 0)
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_CELA);
|
||||
else
|
||||
SK_PUSH_UNIT_PROMPT(qr.quot, SK_PROMPT_CELA);
|
||||
PLAY_NUMBER(qr.rem, 0, ZENSKY);
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_UNITS_BASE+((unit-1)*4)+3);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
number = qr.quot;
|
||||
}
|
||||
}
|
||||
|
||||
int16_t tmp = number;
|
||||
|
||||
#if defined(CPUARM)
|
||||
switch(unit) {
|
||||
case 0:
|
||||
break;
|
||||
case 6:
|
||||
case 8:
|
||||
case 10:
|
||||
case 14:
|
||||
case 17:
|
||||
case 21:
|
||||
case 22:
|
||||
case 23:
|
||||
case 24:
|
||||
att = ZENSKY;
|
||||
break;
|
||||
case 13:
|
||||
case 18:
|
||||
att = STREDNI;
|
||||
break;
|
||||
default:
|
||||
att = MUZSKY;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
switch(unit) {
|
||||
case 0:
|
||||
break;
|
||||
case 4:
|
||||
case 10:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
case 17:
|
||||
case 18:
|
||||
att = ZENSKY;
|
||||
break;
|
||||
case 8:
|
||||
case 19:
|
||||
att = STREDNI;
|
||||
break;
|
||||
default:
|
||||
att = MUZSKY;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((number == 1) && (att == MUZSKY)) {
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_JEDEN);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number == 1) && (att == STREDNI)) {
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_JEDNO);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number == 2) && ((att == ZENSKY) || (att == STREDNI))) {
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_DVE);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if (number >= 1000) {
|
||||
if (number >= 3000)
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
if (number >= 2000 && number < 3000)
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_DVETISIC);
|
||||
else
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_TISIC);
|
||||
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_STO + (number/100)-1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if (number >= 0) {
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_NULA+number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
SK_PUSH_UNIT_PROMPT(tmp, unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(sk, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||
PLAY_NUMBER(tmp, UNIT_HOURS, ZENSKY);
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, UNIT_MINUTES, ZENSKY);
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
PLAY_NUMBER(seconds, UNIT_SECONDS, ZENSKY);
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE(sk, "Slovak");
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Andre Bernet <bernet.andre@gmail.com>
|
||||
* - Andreas Weitl
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
* - Cameron Weeks <th9xer@gmail.com>
|
||||
* - Erez Raviv
|
||||
* - Gabriel Birkus
|
||||
* - Jean-Pierre Parisy
|
||||
* - Karl Szmutny
|
||||
* - Martin Hotar
|
||||
* - Michael Blandford
|
||||
* - Michal Hlavinka
|
||||
* - Pat Mackenzie
|
||||
* - Philip Moss
|
||||
* - Rob Thomson
|
||||
* - Romolo Manfredini <romolo.manfredini@gmail.com>
|
||||
* - Thomas Husterer
|
||||
*
|
||||
* opentx is based on code named
|
||||
* gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
|
||||
* er9x by Erez Raviv: http://code.google.com/p/er9x/,
|
||||
* and the original (and ongoing) project by
|
||||
* Thomas Husterer, th9x: http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
enum SlovakPrompts {
|
||||
SK_PROMPT_NUMBERS_BASE = 0,
|
||||
SK_PROMPT_NULA = SK_PROMPT_NUMBERS_BASE+0, //0-99
|
||||
SK_PROMPT_STO = SK_PROMPT_NUMBERS_BASE+100, //100,200 .. 900
|
||||
SK_PROMPT_TISIC = SK_PROMPT_NUMBERS_BASE+109, //1000
|
||||
SK_PROMPT_DVETISIC = SK_PROMPT_NUMBERS_BASE+110,
|
||||
SK_PROMPT_JEDEN = SK_PROMPT_NUMBERS_BASE+111,
|
||||
SK_PROMPT_JEDNO = SK_PROMPT_NUMBERS_BASE+112,
|
||||
SK_PROMPT_DVE = SK_PROMPT_NUMBERS_BASE+113,
|
||||
SK_PROMPT_CELA = SK_PROMPT_NUMBERS_BASE+114,
|
||||
SK_PROMPT_CELE = SK_PROMPT_NUMBERS_BASE+115,
|
||||
SK_PROMPT_CELYCH = SK_PROMPT_NUMBERS_BASE+116,
|
||||
SK_PROMPT_MINUS = SK_PROMPT_NUMBERS_BASE+117,
|
||||
|
||||
SK_PROMPT_UNITS_BASE = 118, //(jeden)volt,(dva)volty,(pet)voltu,(desetina)voltu
|
||||
|
||||
};
|
||||
|
||||
#if defined(VOICE)
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define SK_PUSH_UNIT_PROMPT(p, u) sk_pushUnitPrompt((p), (u), id)
|
||||
#else
|
||||
#define SK_PUSH_UNIT_PROMPT(p, u) pushUnitPrompt((p), (u))
|
||||
#endif
|
||||
|
||||
#define MUZSKY 0x80
|
||||
#define ZENSKY 0x81
|
||||
#define STREDNI 0x82
|
||||
|
||||
I18N_PLAY_FUNCTION(sk, pushUnitPrompt, int16_t number, uint8_t unitprompt)
|
||||
{
|
||||
#if defined(CPUARM)
|
||||
if (number == 1)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 0);
|
||||
else if (number > 1 && number < 5)
|
||||
PUSH_UNIT_PROMPT(unitprompt, 1);
|
||||
else
|
||||
PUSH_UNIT_PROMPT(unitprompt, 2);
|
||||
#else
|
||||
unitprompt = SK_PROMPT_UNITS_BASE + unitprompt*4;
|
||||
if (number == 1)
|
||||
PUSH_NUMBER_PROMPT(unitprompt);
|
||||
else if (number > 1 && number < 5)
|
||||
PUSH_NUMBER_PROMPT(unitprompt+1);
|
||||
else
|
||||
PUSH_NUMBER_PROMPT(unitprompt+2);
|
||||
#endif
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(sk, playNumber, getvalue_t number, uint8_t unit, uint8_t att)
|
||||
{
|
||||
|
||||
if (number < 0) {
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_MINUS);
|
||||
number = -number;
|
||||
}
|
||||
|
||||
#if !defined(CPUARM)
|
||||
if (unit) {
|
||||
unit--;
|
||||
convertUnit(number, unit);
|
||||
if (IS_IMPERIAL_ENABLE()) {
|
||||
if (unit == UNIT_DIST) {
|
||||
unit = UNIT_FEET;
|
||||
}
|
||||
if (unit == UNIT_SPEED) {
|
||||
unit = UNIT_KTS;
|
||||
}
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
#endif
|
||||
|
||||
int8_t mode = MODE(att);
|
||||
if (mode > 0) {
|
||||
#if defined(CPUARM)
|
||||
if (mode == 2) {
|
||||
number /= 10;
|
||||
}
|
||||
#else
|
||||
// we assume that we are PREC1
|
||||
#endif
|
||||
div_t qr = div((int)number, 10);
|
||||
if (qr.rem) {
|
||||
PLAY_NUMBER(qr.quot, 0, ZENSKY);
|
||||
if (qr.quot == 0)
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_CELA);
|
||||
else
|
||||
SK_PUSH_UNIT_PROMPT(qr.quot, SK_PROMPT_CELA);
|
||||
PLAY_NUMBER(qr.rem, 0, ZENSKY);
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_UNITS_BASE+((unit-1)*4)+3);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
number = qr.quot;
|
||||
}
|
||||
}
|
||||
|
||||
int16_t tmp = number;
|
||||
|
||||
#if defined(CPUARM)
|
||||
switch(unit) {
|
||||
case 0:
|
||||
break;
|
||||
case 6:
|
||||
case 8:
|
||||
case 10:
|
||||
case 14:
|
||||
case 17:
|
||||
case 21:
|
||||
case 22:
|
||||
case 23:
|
||||
case 24:
|
||||
att = ZENSKY;
|
||||
break;
|
||||
case 13:
|
||||
case 18:
|
||||
att = STREDNI;
|
||||
break;
|
||||
default:
|
||||
att = MUZSKY;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
switch(unit) {
|
||||
case 0:
|
||||
break;
|
||||
case 4:
|
||||
case 10:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
case 17:
|
||||
case 18:
|
||||
att = ZENSKY;
|
||||
break;
|
||||
case 8:
|
||||
case 19:
|
||||
att = STREDNI;
|
||||
break;
|
||||
default:
|
||||
att = MUZSKY;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((number == 1) && (att == MUZSKY)) {
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_JEDEN);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number == 1) && (att == STREDNI)) {
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_JEDNO);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if ((number == 2) && ((att == ZENSKY) || (att == STREDNI))) {
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_DVE);
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if (number >= 1000) {
|
||||
if (number >= 3000)
|
||||
PLAY_NUMBER(number / 1000, 0, 0);
|
||||
if (number >= 2000 && number < 3000)
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_DVETISIC);
|
||||
else
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_TISIC);
|
||||
|
||||
number %= 1000;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
if (number >= 100) {
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_STO + (number/100)-1);
|
||||
number %= 100;
|
||||
if (number == 0)
|
||||
number = -1;
|
||||
}
|
||||
|
||||
if (number >= 0) {
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_NULA+number);
|
||||
}
|
||||
|
||||
if (unit) {
|
||||
SK_PUSH_UNIT_PROMPT(tmp, unit);
|
||||
}
|
||||
}
|
||||
|
||||
I18N_PLAY_FUNCTION(sk, playDuration, int seconds PLAY_DURATION_ATT)
|
||||
{
|
||||
if (seconds < 0) {
|
||||
PUSH_NUMBER_PROMPT(SK_PROMPT_MINUS);
|
||||
seconds = -seconds;
|
||||
}
|
||||
|
||||
uint8_t tmp = seconds / 3600;
|
||||
seconds %= 3600;
|
||||
if (tmp > 0 || IS_PLAY_TIME()) {
|
||||
PLAY_NUMBER(tmp, UNIT_HOURS, ZENSKY);
|
||||
}
|
||||
|
||||
tmp = seconds / 60;
|
||||
seconds %= 60;
|
||||
if (tmp > 0) {
|
||||
PLAY_NUMBER(tmp, UNIT_MINUTES, ZENSKY);
|
||||
}
|
||||
|
||||
if (seconds > 0) {
|
||||
PLAY_NUMBER(seconds, UNIT_SECONDS, ZENSKY);
|
||||
}
|
||||
}
|
||||
|
||||
LANGUAGE_PACK_DECLARE(sk, "Slovak");
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user