1
0
forked from me/IronOS

Add rough russian

This commit is contained in:
Ben V. Brown
2017-11-04 14:37:47 +11:00
parent d7a9e1a9ea
commit afa8257bce
4 changed files with 66 additions and 37 deletions

View File

@@ -24,16 +24,6 @@ extern const char SettingLeftChar;
extern const char SettingAutoChar; extern const char SettingAutoChar;
#define LANG_EN #define LANG_EN
#define LANG
#ifndef LANG
#define LANG_EN
#define LANG
#endif
#ifndef LANG
#error NO LANGUAGE DEFINED
#endif
#endif /* TRANSLATION_H_ */ #endif /* TRANSLATION_H_ */

View File

@@ -86,6 +86,7 @@ void OLED::refresh() {
screenBuffer[12] = 0x40; //start of data marker screenBuffer[12] = 0x40; //start of data marker
taskENTER_CRITICAL(); taskENTER_CRITICAL();
//Because I2C is shared, we cant task switch in the middle of the xfer
HAL_I2C_Master_Transmit(i2c, DEVICEADDR_OLED, screenBuffer, 12 + 96 * 2 + 1, 0xFFFF); HAL_I2C_Master_Transmit(i2c, DEVICEADDR_OLED, screenBuffer, 12 + 96 * 2 + 1, 0xFFFF);
taskEXIT_CRITICAL(); taskEXIT_CRITICAL();

View File

@@ -7,25 +7,60 @@
#include "Translation.h" #include "Translation.h"
#ifdef LANG_EN #ifdef LANG_EN
const char* SettingsLongNames[16] = {
/*These are all the help text for all the settings.*/
/*No requirements on spacing or length*/
"Power source. Sets cutoff voltage. <DC 10V> <S 3.3V per cell>", //Power Source
"Sleep Temperature <C>",//Sleep Temp
"Sleep Timeout <Minutes/Seconds>",//Sleep Timeout
"Shutdown Timeout <Minutes>",//Shutdown Time
"Motion Sensitivity <0.Off 1.least sensitive 9.most sensitive>",//Motion Sensitivity
"Temperature Unit <C=Celsius F=Fahrenheit>",//Temp Unit
"Display detailed information in a smaller font on the idle screen.",//Detailed Information
"Display Orientation <A. Automatic L. Left Handed R. Right Handed>",//Orientation
"Enable front key enters boost mode 450C mode when soldering",//Boost enable
"Temperature when in \"boost\" mode",//Boost Temp
"Automatically starts the iron into soldering on power up. T=Soldering, S= Sleep mode,F=Off",//Auto start
"Blink the temperature on the cooling screen while the tip is still hot.",//Cooling Blink
"Calibrate tip offset.",//Calibrate Tip
"Reset all settings",//Reset Settings
"VIN Calibration. Buttons adjust, long press to exit",//VIN Cal
"Display detailed information while soldering",//ADV SLD
};
const char* SettingsCalibrationWarning = "Please ensure the tip is at room temperature before continuing!";
const char* UVLOWarningString = "LOW VOLT"; //Fixed width 8 chars
const char* SleepingSimpleString = "Zzzz";// Must be <= 4 chars
const char* SleepingAdvancedString = "Sleeping...";// <=17 chars
const char* WarningSimpleString = "HOT!";//Must be <= 4 chars
const char* WarningAdvancedString = "WARNING! TIP HOT!";
const char SettingTrueChar = 'T';
const char SettingFalseChar = 'F';
const char SettingRightChar = 'R';
const char SettingLeftChar = 'L';
const char SettingAutoChar = 'A';
#endif
#ifdef LANG_RU
const char* SettingsLongNames[16] = { const char* SettingsLongNames[16] = {
/*These are all the help text for all the settings.*/ /*These are all the help text for all the settings.*/
/*No requirements on spacing or length*/ /*No requirements on spacing or length*/
"Power source. Sets cutoff voltage. <DC 10V> <S 3.3V per cell>", //Power Source "Источник питания. Установка напряжения отключения. <DC 10V> <S 3.3 V на батарею>", //Cell count
"Sleep Temperature <C>", //Sleep Temp "Температура Сна <С>", //Sleep Temp
"Sleep Timeout <Minutes>", //Sleep Timeout "Переход в режим Сна <Минуты>", //Sleep timeout
"Shutdown Timeout <Minutes>", //Shutdown Time "Переходит в режим ожидания <Минуты>", //Shutdown timeout
"Motion Sensitivity <0.Off 1.least sensitive 9.most sensitive>", //Motion Sensitivity "Акселерометр <0. Выкл. 1. мин. чувствительный 9. макс. чувствительный>", //Sensitivity
"Temperature Unit <C=Celsius F=Fahrenheit>", //Temp Unit "В чем измерять температуру", //Temp Unit
"Display detailed information in a smaller font on the idle screen.", //Detailed Information "Display detailed information in a smaller font on the idle screen.", //Detailed Information
"Display Orientation <A. Automatic L. Left Handed R. Right Handed>", //Orientation "Ориентация Дисплея <A. Автоматический L. Левая Рука R. Правая Рука>", //Orientation
"Enable front key enters boost mode 450C mode when soldering", //Boost enable "Активация кнопки A для Турбо режима до 450С при пайке ", //Boost enable
"Temperature when in \"boost\" mode", //Boost Temp "Установка температуры для Турбо режима", //Boost temp
"Automatically starts the iron into soldering on power up. T=Soldering, S= Sleep mode,F=Off", //Auto start "Автоматический запуск паяльника при включении питания. T=Нагрев, S= Режим Сна,F=Выкл.", //Auto start
"Blink the temperature on the cooling screen while the tip is still hot.", //Cooling Blink "Мигает температура на экране охлаждения, пока жало остается горячим." //Cooling blink
"Calibrate tip offset.", //Calibrate Tip "Calibrate tip offset.",//Calibrate Tip
"Reset all settings", //Reset Settings "Reset all settings", //Reset Settings
"VIN Calibration. Buttons adjust, long press to exit", //VIN Cal "VIN Calibration. Buttons adjust, long press to exit", //VIN Cal
"Display detailed information while soldering",//ADV SLD "Display detailed information while soldering", //ADV SLD
}; };
const char* SettingsCalibrationWarning = "Please ensure the tip is at room temperature before continuing!"; const char* SettingsCalibrationWarning = "Please ensure the tip is at room temperature before continuing!";
@@ -41,7 +76,7 @@ const char SettingRightChar = 'R';
const char SettingLeftChar = 'L'; const char SettingLeftChar = 'L';
const char SettingAutoChar = 'A'; const char SettingAutoChar = 'A';
#endif #endif
//Currently the settings names are not translated
const char* SettingsShortNames[16] = { /**/ const char* SettingsShortNames[16] = { /**/
"PWRSC ", // Power Source (DC or batt) "PWRSC ", // Power Source (DC or batt)
"STMP ", // Sleep Temperature "STMP ", // Sleep Temperature
@@ -57,6 +92,5 @@ const char* SettingsShortNames[16] = { /**/
"CLBLNK ", // Cooldown blink "CLBLNK ", // Cooldown blink
"TMP CAL?", // Temperature calibration enter menu "TMP CAL?", // Temperature calibration enter menu
"RESET? ", // Settings reset command "RESET? ", // Settings reset command
"CAL VIN?", "CAL VIN?", "ADVSLD ", //advanced soldering screens
"ADVSLD ", //advanced soldering screens
}; };

View File

@@ -73,7 +73,7 @@ int main(void) {
} }
} }
void GUIDelay() { void GUIDelay() {
osDelay(50);//20Hz osDelay(50); //20Hz
} }
ButtonState getButtonState() { ButtonState getButtonState() {
/* /*
@@ -411,11 +411,11 @@ static int gui_showTipTempWarning() {
GUIDelay(); GUIDelay();
} }
} }
static uint16_t min(uint16_t a,uint16_t b) static uint16_t min(uint16_t a, uint16_t b) {
{ if (a > b)
if(a>b)
return b; return b;
else return a; else
return a;
} }
static int gui_SolderingSleepingMode() { static int gui_SolderingSleepingMode() {
//Drop to sleep temperature and display until movement or button press //Drop to sleep temperature and display until movement or button press
@@ -430,9 +430,11 @@ static int gui_SolderingSleepingMode() {
return 1; //return non-zero on error return 1; //return non-zero on error
if (systemSettings.temperatureInF) if (systemSettings.temperatureInF)
currentlyActiveTemperatureTarget = ftoTipMeasurement(min(systemSettings.SleepTemp,systemSettings.SolderingTemp)); currentlyActiveTemperatureTarget = ftoTipMeasurement(
min(systemSettings.SleepTemp, systemSettings.SolderingTemp));
else else
currentlyActiveTemperatureTarget = ctoTipMeasurement(min(systemSettings.SleepTemp,systemSettings.SolderingTemp)); currentlyActiveTemperatureTarget = ctoTipMeasurement(
min(systemSettings.SleepTemp, systemSettings.SolderingTemp));
//draw the lcd //draw the lcd
uint16_t tipTemp; uint16_t tipTemp;
if (systemSettings.temperatureInF) if (systemSettings.temperatureInF)
@@ -797,9 +799,11 @@ void startPIDTask(void const * argument) {
int32_t kp, ki, kd, kb; int32_t kp, ki, kd, kb;
int32_t backoffOverflow = 0; int32_t backoffOverflow = 0;
kp = 20; kp = 20;
ki = 40; ki = 50;
kd = 30; kd = 40;
kb = 0; kb = 0;
// REMEBER ^^^^ These constants are backwards
// They act as dividers, so to 'increase' a P term, you make the number smaller.
const int32_t itermMax = 40; const int32_t itermMax = 40;
for (;;) { for (;;) {
uint16_t rawTemp = getTipRawTemp(1); //get instantaneous reading uint16_t rawTemp = getTipRawTemp(1); //get instantaneous reading
@@ -892,7 +896,7 @@ void startMOVTask(void const * argument) {
lcd.print(" "); lcd.print(" ");
lcd.printNumber(abs(avgy - (int32_t) ty), 5); lcd.printNumber(abs(avgy - (int32_t) ty), 5);
if ((abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz)) > max) if ((abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz)) > max)
max = (abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz)); max = (abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz));
lcd.setCursor(0, 8); lcd.setCursor(0, 8);
lcd.printNumber(max, 5); lcd.printNumber(max, 5);
lcd.print(" "); lcd.print(" ");
@@ -900,7 +904,7 @@ void startMOVTask(void const * argument) {
lcd.printNumber((abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz)), 5); lcd.printNumber((abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz)), 5);
lcd.refresh(); lcd.refresh();
if (HAL_GPIO_ReadPin(KEY_A_GPIO_Port, KEY_A_Pin) == GPIO_PIN_RESET) if (HAL_GPIO_ReadPin(KEY_A_GPIO_Port, KEY_A_Pin) == GPIO_PIN_RESET)
max = 0; max = 0;
#endif #endif
//Only run the actual processing if the sensitivity is set (aka we are enabled) //Only run the actual processing if the sensitivity is set (aka we are enabled)
if (systemSettings.sensitivity) { if (systemSettings.sensitivity) {