Generate per-language translation sources (#806)
This generates dedicates Translation.cpp files for translation language and derives all language-specific data from them. The Makefile is extended to also take care of generating these source files. This allows reuse of nearly all object files between builds of different languages for the same model and regenerating the translation sources if necessary. This speeds up the release builds and the normal write-compile-cycle considerably. It also eliminates miscompilations when manually building different languages.
This commit is contained in:
@@ -18,7 +18,6 @@ extern "C" {
|
||||
#include "main.hpp"
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
#include "unit.h"
|
||||
#include <MMA8652FC.hpp>
|
||||
#include <gui.hpp>
|
||||
#include <history.hpp>
|
||||
@@ -69,11 +68,9 @@ void GUIDelay() {
|
||||
void gui_drawTipTemp(bool symbol) {
|
||||
// Draw tip temp handling unit conversion & tolerance near setpoint
|
||||
uint32_t Temp = 0;
|
||||
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
||||
if (systemSettings.temperatureInF) {
|
||||
Temp = TipThermoModel::getTipInF();
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
Temp = TipThermoModel::getTipInC();
|
||||
}
|
||||
@@ -82,19 +79,15 @@ void gui_drawTipTemp(bool symbol) {
|
||||
if (symbol) {
|
||||
if (OLED::getFont() == 0) {
|
||||
// Big font, can draw nice symbols
|
||||
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
||||
if (systemSettings.temperatureInF)
|
||||
OLED::drawSymbol(0);
|
||||
else
|
||||
#endif
|
||||
OLED::drawSymbol(1);
|
||||
} else {
|
||||
// Otherwise fall back to chars
|
||||
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
||||
if (systemSettings.temperatureInF)
|
||||
OLED::print(SymbolDegF);
|
||||
else
|
||||
#endif
|
||||
OLED::print(SymbolDegC);
|
||||
}
|
||||
}
|
||||
@@ -252,15 +245,12 @@ static void gui_solderingTempAdjust() {
|
||||
autoRepeatAcceleration = PRESS_ACCEL_INTERVAL_MAX - PRESS_ACCEL_INTERVAL_MIN;
|
||||
}
|
||||
// constrain between 10-450 C
|
||||
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
||||
if (systemSettings.temperatureInF) {
|
||||
if (systemSettings.SolderingTemp > 850)
|
||||
systemSettings.SolderingTemp = 850;
|
||||
if (systemSettings.SolderingTemp < 60)
|
||||
systemSettings.SolderingTemp = 60;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
} else {
|
||||
if (systemSettings.SolderingTemp > 450)
|
||||
systemSettings.SolderingTemp = 450;
|
||||
if (systemSettings.SolderingTemp < 10)
|
||||
@@ -282,11 +272,9 @@ static void gui_solderingTempAdjust() {
|
||||
|
||||
OLED::print(SymbolSpace);
|
||||
OLED::printNumber(systemSettings.SolderingTemp, 3);
|
||||
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
||||
if (systemSettings.temperatureInF)
|
||||
OLED::drawSymbol(0);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
OLED::drawSymbol(1);
|
||||
}
|
||||
@@ -330,22 +318,16 @@ static int gui_SolderingSleepingMode(bool stayOff, bool autoStarted) {
|
||||
if (checkVoltageForExit())
|
||||
return 1; // return non-zero on error
|
||||
#endif
|
||||
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
||||
if (systemSettings.temperatureInF) {
|
||||
currentTempTargetDegC = stayOff ? 0 : TipThermoModel::convertFtoC(min(systemSettings.SleepTemp, systemSettings.SolderingTemp));
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
} else {
|
||||
currentTempTargetDegC = stayOff ? 0 : min(systemSettings.SleepTemp, systemSettings.SolderingTemp);
|
||||
}
|
||||
// draw the lcd
|
||||
uint16_t tipTemp;
|
||||
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
||||
if (systemSettings.temperatureInF)
|
||||
tipTemp = TipThermoModel::getTipInF();
|
||||
else
|
||||
#endif
|
||||
{
|
||||
else {
|
||||
tipTemp = TipThermoModel::getTipInC();
|
||||
}
|
||||
|
||||
@@ -357,12 +339,9 @@ static int gui_SolderingSleepingMode(bool stayOff, bool autoStarted) {
|
||||
OLED::setCursor(0, 8);
|
||||
OLED::print(SleepingTipAdvancedString);
|
||||
OLED::printNumber(tipTemp, 3);
|
||||
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
||||
if (systemSettings.temperatureInF)
|
||||
OLED::print(SymbolDegF);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
else {
|
||||
OLED::print(SymbolDegC);
|
||||
}
|
||||
|
||||
@@ -373,12 +352,9 @@ static int gui_SolderingSleepingMode(bool stayOff, bool autoStarted) {
|
||||
OLED::setFont(0);
|
||||
OLED::print(SleepingSimpleString);
|
||||
OLED::printNumber(tipTemp, 3);
|
||||
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
||||
if (systemSettings.temperatureInF)
|
||||
OLED::drawSymbol(0);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
else {
|
||||
OLED::drawSymbol(1);
|
||||
}
|
||||
}
|
||||
@@ -613,21 +589,15 @@ static void gui_solderingMode(uint8_t jumpToSleep) {
|
||||
|
||||
// Update the setpoints for the temperature
|
||||
if (boostModeOn) {
|
||||
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
||||
if (systemSettings.temperatureInF)
|
||||
currentTempTargetDegC = TipThermoModel::convertFtoC(systemSettings.BoostTemp);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
else {
|
||||
currentTempTargetDegC = (systemSettings.BoostTemp);
|
||||
}
|
||||
} else {
|
||||
#ifdef ENABLED_FAHRENHEIT_SUPPORT
|
||||
if (systemSettings.temperatureInF)
|
||||
currentTempTargetDegC = TipThermoModel::convertFtoC(systemSettings.SolderingTemp);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
else {
|
||||
currentTempTargetDegC = (systemSettings.SolderingTemp);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user