Skip to content

Commit

Permalink
Add rough russian
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralim committed Nov 4, 2017
1 parent d7a9e1a commit afa8257
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 37 deletions.
10 changes: 0 additions & 10 deletions workspace/TS100/inc/Translation.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ extern const char SettingLeftChar;
extern const char SettingAutoChar;

#define LANG_EN
#define LANG

#ifndef LANG
#define LANG_EN
#define LANG
#endif

#ifndef LANG
#error NO LANGUAGE DEFINED
#endif


#endif /* TRANSLATION_H_ */
1 change: 1 addition & 0 deletions workspace/TS100/src/OLED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ void OLED::refresh() {

screenBuffer[12] = 0x40; //start of data marker
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);
taskEXIT_CRITICAL();
Expand Down
66 changes: 50 additions & 16 deletions workspace/TS100/src/Translation.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,60 @@
#include "Translation.h"

#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] = {
/*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>", //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
"Источник питания. Установка напряжения отключения. <DC 10V> <S 3.3 V на батарею>", //Cell count
"Температура Сна <С>", //Sleep Temp
"Переход в режим Сна <Минуты>", //Sleep timeout
"Переходит в режим ожидания <Минуты>", //Shutdown timeout
"Акселерометр <0. Выкл. 1. мин. чувствительный 9. макс. чувствительный>", //Sensitivity
"В чем измерять температуру", //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
"Ориентация Дисплея <A. Автоматический L. Левая Рука R. Правая Рука>", //Orientation
"Активация кнопки A для Турбо режима до 450С при пайке ", //Boost enable
"Установка температуры для Турбо режима", //Boost temp
"Автоматический запуск паяльника при включении питания. T=Нагрев, S= Режим Сна,F=Выкл.", //Auto start
"Мигает температура на экране охлаждения, пока жало остается горячим." //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
"Display detailed information while soldering", //ADV SLD
};

const char* SettingsCalibrationWarning = "Please ensure the tip is at room temperature before continuing!";
Expand All @@ -41,7 +76,7 @@ const char SettingRightChar = 'R';
const char SettingLeftChar = 'L';
const char SettingAutoChar = 'A';
#endif

//Currently the settings names are not translated
const char* SettingsShortNames[16] = { /**/
"PWRSC ", // Power Source (DC or batt)
"STMP ", // Sleep Temperature
Expand All @@ -57,6 +92,5 @@ const char* SettingsShortNames[16] = { /**/
"CLBLNK ", // Cooldown blink
"TMP CAL?", // Temperature calibration enter menu
"RESET? ", // Settings reset command
"CAL VIN?",
"ADVSLD ", //advanced soldering screens
"CAL VIN?", "ADVSLD ", //advanced soldering screens
};
26 changes: 15 additions & 11 deletions workspace/TS100/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int main(void) {
}
}
void GUIDelay() {
osDelay(50);//20Hz
osDelay(50); //20Hz
}
ButtonState getButtonState() {
/*
Expand Down Expand Up @@ -411,11 +411,11 @@ static int gui_showTipTempWarning() {
GUIDelay();
}
}
static uint16_t min(uint16_t a,uint16_t b)
{
if(a>b)
static uint16_t min(uint16_t a, uint16_t b) {
if (a > b)
return b;
else return a;
else
return a;
}
static int gui_SolderingSleepingMode() {
//Drop to sleep temperature and display until movement or button press
Expand All @@ -430,9 +430,11 @@ static int gui_SolderingSleepingMode() {
return 1; //return non-zero on error

if (systemSettings.temperatureInF)
currentlyActiveTemperatureTarget = ftoTipMeasurement(min(systemSettings.SleepTemp,systemSettings.SolderingTemp));
currentlyActiveTemperatureTarget = ftoTipMeasurement(
min(systemSettings.SleepTemp, systemSettings.SolderingTemp));
else
currentlyActiveTemperatureTarget = ctoTipMeasurement(min(systemSettings.SleepTemp,systemSettings.SolderingTemp));
currentlyActiveTemperatureTarget = ctoTipMeasurement(
min(systemSettings.SleepTemp, systemSettings.SolderingTemp));
//draw the lcd
uint16_t tipTemp;
if (systemSettings.temperatureInF)
Expand Down Expand Up @@ -797,9 +799,11 @@ void startPIDTask(void const * argument) {
int32_t kp, ki, kd, kb;
int32_t backoffOverflow = 0;
kp = 20;
ki = 40;
kd = 30;
ki = 50;
kd = 40;
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;
for (;;) {
uint16_t rawTemp = getTipRawTemp(1); //get instantaneous reading
Expand Down Expand Up @@ -892,15 +896,15 @@ void startMOVTask(void const * argument) {
lcd.print(" ");
lcd.printNumber(abs(avgy - (int32_t) ty), 5);
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.printNumber(max, 5);
lcd.print(" ");

lcd.printNumber((abs(avgx - tx) + abs(avgy - ty) + abs(avgz - tz)), 5);
lcd.refresh();
if (HAL_GPIO_ReadPin(KEY_A_GPIO_Port, KEY_A_Pin) == GPIO_PIN_RESET)
max = 0;
max = 0;
#endif
//Only run the actual processing if the sensitivity is set (aka we are enabled)
if (systemSettings.sensitivity) {
Expand Down

0 comments on commit afa8257

Please sign in to comment.