2 * Authors (alphabetical order)
3 * - Andre Bernet <bernet.andre@gmail.com>
4 * - Andreas Weitl <andreas.weitl@gmx.de>
5 * - Bertrand Songis <bsongis@gmail.com>
6 * - Benjamin Boy <rcbebo82@googlemail.com>
9 * opentx is based on code named
10 * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
11 * er9x by Erez Raviv: http://code.google.com/p/er9x/,
12 * and the original (and ongoing) project by
13 * Thomas Husterer, th9x: http://code.google.com/p/th9x/
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
29 DE_PROMPT_NUMBERS_BASE
= 0,
30 DE_PROMPT_NULL
= DE_PROMPT_NUMBERS_BASE
+0,
31 DE_PROMPT_EIN
= DE_PROMPT_NUMBERS_BASE
+100,
32 DE_PROMPT_EINE
= DE_PROMPT_NUMBERS_BASE
+101,
33 DE_PROMPT_HUNDERT
= DE_PROMPT_NUMBERS_BASE
+102,
34 DE_PROMPT_TAUSEND
= DE_PROMPT_NUMBERS_BASE
+103,
35 DE_PROMPT_COMMA
= 104,
46 DE_PROMPT_UNITS_BASE
= 114,
47 DE_PROMPT_VOLTS
= DE_PROMPT_UNITS_BASE
+UNIT_VOLTS
,
48 DE_PROMPT_AMPS
= DE_PROMPT_UNITS_BASE
+UNIT_AMPS
,
49 DE_PROMPT_METERS_PER_SECOND
= DE_PROMPT_UNITS_BASE
+UNIT_METERS_PER_SECOND
,
50 DE_PROMPT_SPARE1
= DE_PROMPT_UNITS_BASE
+UNIT_RAW
,
51 DE_PROMPT_KMH
= DE_PROMPT_UNITS_BASE
+UNIT_SPEED
,
52 DE_PROMPT_METERS
= DE_PROMPT_UNITS_BASE
+UNIT_DIST
,
53 DE_PROMPT_DEGREES
= DE_PROMPT_UNITS_BASE
+UNIT_TEMPERATURE
,
54 DE_PROMPT_PERCENT
= DE_PROMPT_UNITS_BASE
+UNIT_PERCENT
,
55 DE_PROMPT_MILLIAMPS
= DE_PROMPT_UNITS_BASE
+UNIT_MILLIAMPS
,
56 DE_PROMPT_MAH
= DE_PROMPT_UNITS_BASE
+UNIT_MAH
,
57 DE_PROMPT_WATTS
= DE_PROMPT_UNITS_BASE
+UNIT_WATTS
,
58 DE_PROMPT_FEET
= DE_PROMPT_UNITS_BASE
+UNIT_FEET
,
59 DE_PROMPT_KTS
= DE_PROMPT_UNITS_BASE
+UNIT_KTS
,
60 DE_PROMPT_HOURS
= DE_PROMPT_UNITS_BASE
+UNIT_HOURS
,
61 DE_PROMPT_MINUTES
= DE_PROMPT_UNITS_BASE
+UNIT_MINUTES
,
62 DE_PROMPT_SECONDS
= DE_PROMPT_UNITS_BASE
+UNIT_SECONDS
,
63 DE_PROMPT_RPMS
= DE_PROMPT_UNITS_BASE
+UNIT_RPMS
,
64 DE_PROMPT_G
= DE_PROMPT_UNITS_BASE
+UNIT_G
,
66 DE_PROMPT_MILLILITERS
= DE_PROMPT_UNITS_BASE
+UNIT_MILLILITERS
,
67 DE_PROMPT_FLOZ
= DE_PROMPT_UNITS_BASE
+UNIT_FLOZ
,
68 DE_PROMPT_FEET_PER_SECOND
= DE_PROMPT_UNITS_BASE
+UNIT_FEET_PER_SECOND
,
75 #define DE_PUSH_UNIT_PROMPT(u) de_pushUnitPrompt((u), id)
77 #define DE_PUSH_UNIT_PROMPT(u) pushUnitPrompt((u))
80 I18N_PLAY_FUNCTION(de
, pushUnitPrompt
, uint8_t unitprompt
)
83 PUSH_UNIT_PROMPT(unitprompt
, 0);
85 unitprompt
= DE_PROMPT_UNITS_BASE
+ unitprompt
*2
86 PUSH_NUMBER_PROMPT(unitprompt
);
90 I18N_PLAY_FUNCTION(de
, playNumber
, getvalue_t number
, uint8_t unit
, uint8_t att
)
92 /* if digit >= 1000000000:
93 temp_digit, digit = divmod(digit, 1000000000)
94 prompts.extend(self.getNumberPrompt(temp_digit))
95 prompts.append(Prompt(GUIDE_00_BILLION, dir=2))
97 temp_digit, digit = divmod(digit, 1000000)
98 prompts.extend(self.getNumberPrompt(temp_digit))
99 prompts.append(Prompt(GUIDE_00_MILLION, dir=2))
103 PUSH_NUMBER_PROMPT(DE_PROMPT_MINUS
);
110 convertUnit(number
, unit
);
111 if (IS_IMPERIAL_ENABLE()) {
112 if (unit
== UNIT_DIST
) {
115 if (unit
== UNIT_SPEED
) {
123 int8_t mode
= MODE(att
);
130 // we assume that we are PREC1
132 div_t qr
= div((int)number
, 10);
134 PUSH_NUMBER_PROMPT(qr
.quot
);
135 PUSH_NUMBER_PROMPT(DE_PROMPT_COMMA
);
136 PUSH_NUMBER_PROMPT(qr
.rem
);
140 PUSH_NUMBER_PROMPT(DE_PROMPT_EIN
);
143 PUSH_NUMBER_PROMPT(qr
.quot
);
146 DE_PUSH_UNIT_PROMPT(unit
);
150 if (number
>= 2000) {
151 PLAY_NUMBER(number
/ 1000, 0, 0);
152 PUSH_NUMBER_PROMPT(DE_PROMPT_TAUSEND
);
158 if ((number
>= 1000) && (number
< 2000)) {
159 PUSH_NUMBER_PROMPT(DE_PROMPT_EIN
);
160 PUSH_NUMBER_PROMPT(DE_PROMPT_TAUSEND
);
166 if ((number
>= 200) && (number
< 1000)) {
167 PUSH_NUMBER_PROMPT(DE_PROMPT_NULL
+ number
/ 100);
168 PUSH_NUMBER_PROMPT(DE_PROMPT_HUNDERT
);
174 if ((number
>= 100) && (number
< 200)) {
175 PUSH_NUMBER_PROMPT(DE_PROMPT_EIN
);
176 PUSH_NUMBER_PROMPT(DE_PROMPT_HUNDERT
);
183 PUSH_NUMBER_PROMPT(DE_PROMPT_NULL
+ number
/ 1);
187 DE_PUSH_UNIT_PROMPT(unit
);
191 I18N_PLAY_FUNCTION(de
, playDuration
, int seconds PLAY_DURATION_ATT
)
194 PUSH_NUMBER_PROMPT(DE_PROMPT_MINUS
);
198 uint8_t tmp
= seconds
/ 3600;
201 if (tmp
> 0 || IS_PLAY_TIME()) {
203 PLAY_NUMBER(tmp
, 0, 0);
204 PUSH_NUMBER_PROMPT(DE_PROMPT_STUNDEN
);
207 PUSH_NUMBER_PROMPT(DE_PROMPT_EINE
);
208 PUSH_NUMBER_PROMPT(DE_PROMPT_STUNDE
);
211 PUSH_NUMBER_PROMPT(DE_PROMPT_UND
);
220 PLAY_NUMBER(tmp
, 0, 0);
221 PUSH_NUMBER_PROMPT(DE_PROMPT_MINUTEN
);
224 PUSH_NUMBER_PROMPT(DE_PROMPT_EINE
);
225 PUSH_NUMBER_PROMPT(DE_PROMPT_MINUTE
);
228 PUSH_NUMBER_PROMPT(DE_PROMPT_UND
);
233 PLAY_NUMBER(seconds
, 0, 0);
234 PUSH_NUMBER_PROMPT(DE_PROMPT_SEKUNDEN
);
238 PUSH_NUMBER_PROMPT(DE_PROMPT_EINE
);
239 PUSH_NUMBER_PROMPT(DE_PROMPT_SEKUNDE
);
244 LANGUAGE_PACK_DECLARE(de
, "Deutsch");