2 * Authors (alphabetical order)
3 * - Andre Bernet <bernet.andre@gmail.com>
5 * - Bertrand Songis <bsongis@gmail.com>
6 * - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
7 * - Cameron Weeks <th9xer@gmail.com>
10 * - Jean-Pierre Parisy
18 * - Romolo Manfredini <romolo.manfredini@gmail.com>
21 * opentx is based on code named
22 * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/,
23 * er9x by Erez Raviv: http://code.google.com/p/er9x/,
24 * and the original (and ongoing) project by
25 * Thomas Husterer, th9x: http://code.google.com/p/th9x/
27 * This program is free software; you can redistribute it and/or modify
28 * it under the terms of the GNU General Public License version 2 as
29 * published by the Free Software Foundation.
31 * This program is distributed in the hope that it will be useful,
32 * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 * GNU General Public License for more details.
41 SE_PROMPT_NUMBERS_BASE
= 0,
42 SE_PROMPT_ZERO
= SE_PROMPT_NUMBERS_BASE
+0, //02-99
43 SE_PROMPT_HUNDRED
= SE_PROMPT_NUMBERS_BASE
+100, //100,200 .. 900
44 SE_PROMPT_THOUSAND
= SE_PROMPT_NUMBERS_BASE
+109, //1000
45 SE_PROMPT_AND
= SE_PROMPT_NUMBERS_BASE
+110,
46 SE_PROMPT_MINUS
= SE_PROMPT_NUMBERS_BASE
+111,
47 SE_PROMPT_POINT
= SE_PROMPT_NUMBERS_BASE
+112,
48 SE_PROMPT_UNITS_BASE
= 113,
49 SE_PROMPT_POINT_BASE
= 165, //.0 - .9
55 #define SE_PUSH_UNIT_PROMPT(u, p) se_pushUnitPrompt((u), (p), id)
57 #define SE_PUSH_UNIT_PROMPT(u, p) pushUnitPrompt((u), (p))
60 I18N_PLAY_FUNCTION(se
, pushUnitPrompt
, uint8_t unitprompt
, int16_t number
)
64 PUSH_UNIT_PROMPT(unitprompt
, 0);
66 PUSH_UNIT_PROMPT(unitprompt
, 1);
68 unitprompt
= SE_PROMPT_UNITS_BASE
+ unitprompt
*2;
70 PUSH_NUMBER_PROMPT(unitprompt
);
72 PUSH_NUMBER_PROMPT(unitprompt
+1);
76 I18N_PLAY_FUNCTION(se
, playNumber
, getvalue_t number
, uint8_t unit
, uint8_t att
)
79 PUSH_NUMBER_PROMPT(SE_PROMPT_MINUS
);
86 convertUnit(number
, unit
);
87 if (IS_IMPERIAL_ENABLE()) {
88 if (unit
== UNIT_DIST
) {
91 if (unit
== UNIT_SPEED
) {
99 int8_t mode
= MODE(att
);
106 // we assume that we are PREC1
108 div_t qr
= div((int)number
, 10);
110 PLAY_NUMBER(qr
.quot
, 0, 0);
111 PUSH_NUMBER_PROMPT(SE_PROMPT_POINT_BASE
+ qr
.rem
);
119 int16_t tmpNumber
= number
;
121 if (number
>= 1000) {
122 PLAY_NUMBER(number
/ 1000, 0, 0);
123 PUSH_NUMBER_PROMPT(SE_PROMPT_THOUSAND
);
129 PUSH_NUMBER_PROMPT(SE_PROMPT_HUNDRED
+ (number
/100)-1);
135 PUSH_NUMBER_PROMPT(SE_PROMPT_ZERO
+ number
);
139 SE_PUSH_UNIT_PROMPT(unit
, tmpNumber
);
143 I18N_PLAY_FUNCTION(se
, playDuration
, int seconds PLAY_DURATION_ATT
)
146 PUSH_NUMBER_PROMPT(SE_PROMPT_MINUS
);
150 uint8_t tmp
= seconds
/ 3600;
152 if (tmp
> 0 || IS_PLAY_TIME()) {
153 PLAY_NUMBER(tmp
, UNIT_HOURS
, 0);
159 PLAY_NUMBER(tmp
, UNIT_MINUTES
, 0);
161 PUSH_NUMBER_PROMPT(SE_PROMPT_AND
);
165 PLAY_NUMBER(seconds
, UNIT_SECONDS
, 0);
169 LANGUAGE_PACK_DECLARE(se
, "Swedish");