mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Updating translations
This commit is contained in:
@@ -47,9 +47,11 @@ enum SettingsOptions {
|
||||
PDMissingWarningCounter = 30, // Counter of how many times we have warned we cannot detect the pd interface
|
||||
UILanguage = 31, // Selected UI Language code, null-terminated *only if* the length is less than 8 chars
|
||||
PDNegTimeout = 32, // PD timeout in 100ms steps
|
||||
OLEDInversion = 33, // Invert the colours on the display
|
||||
OLEDContrast = 34, // Contrast for the OLED display
|
||||
|
||||
//
|
||||
SettingsOptionsLength = 33, //
|
||||
SettingsOptionsLength = 35, //
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -59,6 +59,8 @@ enum class SettingsItemIndex : uint8_t {
|
||||
PowerPulseWait,
|
||||
PowerPulseDuration,
|
||||
LanguageSwitch,
|
||||
Contrast,
|
||||
ColourInversion,
|
||||
NUM_ITEMS,
|
||||
};
|
||||
|
||||
|
||||
@@ -75,8 +75,11 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp
|
||||
{0, 10, 1, 0}, // PDMissingWarningCounter
|
||||
{0, 0xFFFF, 0, 41431 /*EN*/}, // UILanguage
|
||||
{0, 51, 1, 0}, // PDNegTimeout
|
||||
{0, 2, 1, 0}, // OLEDInversion
|
||||
{7, 256, 0x08, 51}, // OLEDContrast
|
||||
|
||||
};
|
||||
static_assert((sizeof(settingsConstants) / sizeof(SettingConstants)) == ((int)SettingsOptions::SettingsOptionsLength));
|
||||
|
||||
void saveSettings() { flash_save_buffer((uint8_t *)&systemSettings, sizeof(systemSettingsType)); }
|
||||
|
||||
|
||||
@@ -14,10 +14,6 @@
|
||||
#include "configuration.h"
|
||||
#include "main.hpp"
|
||||
|
||||
#define POW_DC
|
||||
#define POW_PD
|
||||
#define POW_QC
|
||||
#define HALL_SENSOR
|
||||
void gui_Menu(const menuitem *menu);
|
||||
|
||||
#ifdef POW_DC
|
||||
@@ -47,31 +43,31 @@ static bool settings_displayPowerLimit(void);
|
||||
static bool settings_setDisplayRotation(void);
|
||||
static bool settings_displayDisplayRotation(void);
|
||||
#endif
|
||||
static bool settings_setBoostTemp(void);
|
||||
static bool settings_displayBoostTemp(void);
|
||||
static bool settings_displayAutomaticStartMode(void);
|
||||
static bool settings_displayLockingMode(void);
|
||||
static bool settings_displayCoolingBlinkEnabled(void);
|
||||
static bool settings_setResetSettings(void);
|
||||
static bool settings_displayResetSettings(void);
|
||||
static bool settings_setCalibrate(void);
|
||||
static bool settings_displayCalibrate(void);
|
||||
static bool settings_setCalibrateVIN(void);
|
||||
static bool settings_displayCalibrateVIN(void);
|
||||
static bool settings_displayReverseButtonTempChangeEnabled(void);
|
||||
static bool settings_displayTempChangeShortStep(void);
|
||||
static bool settings_displayTempChangeLongStep(void);
|
||||
static bool settings_displayPowerPulse(void);
|
||||
static bool settings_displayAnimationSpeed(void);
|
||||
static bool settings_displayAnimationLoop(void);
|
||||
static bool settings_displayPowerPulseWait(void);
|
||||
static bool settings_displayPowerPulseDuration(void);
|
||||
static bool settings_setPowerPulseDuration(void);
|
||||
static bool settings_displayBrightnessLevel(void);
|
||||
static bool settings_setBrightnessLevel(void);
|
||||
static bool settings_displayInvertColor(void);
|
||||
static bool settings_setInvertColor(void);
|
||||
#ifdef HALL_SENSOR static bool settings_displayHallEffect(void);
|
||||
|
||||
static bool settings_setBoostTemp(void);
|
||||
static bool settings_displayBoostTemp(void);
|
||||
static bool settings_displayAutomaticStartMode(void);
|
||||
static bool settings_displayLockingMode(void);
|
||||
static bool settings_displayCoolingBlinkEnabled(void);
|
||||
static bool settings_setResetSettings(void);
|
||||
static bool settings_displayResetSettings(void);
|
||||
static bool settings_setCalibrate(void);
|
||||
static bool settings_displayCalibrate(void);
|
||||
static bool settings_setCalibrateVIN(void);
|
||||
static bool settings_displayCalibrateVIN(void);
|
||||
static bool settings_displayReverseButtonTempChangeEnabled(void);
|
||||
static bool settings_displayTempChangeShortStep(void);
|
||||
static bool settings_displayTempChangeLongStep(void);
|
||||
static bool settings_displayPowerPulse(void);
|
||||
static bool settings_displayAnimationSpeed(void);
|
||||
static bool settings_displayAnimationLoop(void);
|
||||
static bool settings_displayPowerPulseWait(void);
|
||||
static bool settings_displayPowerPulseDuration(void);
|
||||
static bool settings_displayBrightnessLevel(void);
|
||||
static bool settings_displayInvertColor(void);
|
||||
|
||||
#ifdef HALL_SENSOR
|
||||
static bool settings_displayHallEffect(void);
|
||||
#endif
|
||||
// Menu functions
|
||||
|
||||
@@ -200,12 +196,12 @@ const menuitem UIMenu[] = {
|
||||
{SETTINGS_DESC(SettingsItemIndex::CooldownBlink), nullptr, settings_displayCoolingBlinkEnabled, SettingsOptions::CoolingTempBlink}, /*Cooling blink warning*/
|
||||
{SETTINGS_DESC(SettingsItemIndex::ScrollingSpeed), nullptr, settings_displayScrollSpeed, SettingsOptions::DescriptionScrollSpeed}, /*Scroll Speed for descriptions*/
|
||||
{SETTINGS_DESC(SettingsItemIndex::ReverseButtonTempChange), nullptr, settings_displayReverseButtonTempChangeEnabled,
|
||||
SettingsOptions::ReverseButtonTempChangeEnabled}, /* Reverse Temp change buttons + - */
|
||||
{SETTINGS_DESC(SettingsItemIndex::AnimSpeed), nullptr, settings_displayAnimationSpeed, SettingsOptions::AnimationSpeed}, /*Animation Speed adjustment */
|
||||
{SETTINGS_DESC(SettingsItemIndex::AnimLoop), nullptr, settings_displayAnimationLoop, SettingsOptions::AnimationLoop}, /*Animation Loop switch */
|
||||
{0, settings_setBrightnessLevel, settings_displayBrightnessLevel}, /*Brightness Level*/
|
||||
{0, settings_setInvertColor, settings_displayInvertColor}, /*Invert screen colour*/
|
||||
{0, nullptr, nullptr, SettingsOptions::SettingsOptionsLength} // end of menu marker. DO NOT REMOVE
|
||||
SettingsOptions::ReverseButtonTempChangeEnabled}, /* Reverse Temp change buttons + - */
|
||||
{SETTINGS_DESC(SettingsItemIndex::AnimSpeed), nullptr, settings_displayAnimationSpeed, SettingsOptions::AnimationSpeed}, /*Animation Speed adjustment */
|
||||
{SETTINGS_DESC(SettingsItemIndex::AnimLoop), nullptr, settings_displayAnimationLoop, SettingsOptions::AnimationLoop}, /*Animation Loop switch */
|
||||
{SETTINGS_DESC(SettingsItemIndex::Contrast), nullptr, settings_displayBrightnessLevel, SettingsOptions::OLEDContrast}, /*Brightness Level*/
|
||||
{SETTINGS_DESC(SettingsItemIndex::ColourInversion), nullptr, settings_displayInvertColor, SettingsOptions::OLEDInversion}, /*Invert screen colour*/
|
||||
{0, nullptr, nullptr, SettingsOptions::SettingsOptionsLength} // end of menu marker. DO NOT REMOVE
|
||||
};
|
||||
const menuitem PowerSavingMenu[] = {
|
||||
/*
|
||||
@@ -787,40 +783,19 @@ static bool settings_displayPowerPulseDuration(void) {
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t brightness = 0x00;
|
||||
|
||||
static bool settings_displayBrightnessLevel(void) {
|
||||
OLED::drawArea(0, 0, 16, 16, brightnessIcon);
|
||||
OLED::setCursor(5 * FONT_12_WIDTH - 2, 0);
|
||||
OLED::printNumber(brightness, 3, FontStyle::LARGE);
|
||||
OLED::printNumber(getSettingValue(SettingsOptions::OLEDContrast), 3, FontStyle::LARGE);
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool settings_setBrightnessLevel(void) {
|
||||
if (brightness > (0xFF - 0x08 + 1)) {
|
||||
brightness = 0;
|
||||
} else if (brightness == 0) {
|
||||
brightness = 7;
|
||||
} else {
|
||||
brightness += 0x08;
|
||||
}
|
||||
OLED::setContrast(brightness);
|
||||
return brightness == 0xFF;
|
||||
}
|
||||
|
||||
static bool invertColor = false;
|
||||
|
||||
static bool settings_displayInvertColor(void) {
|
||||
OLED::drawArea(0, 0, 24, 16, invertDisplayIcon);
|
||||
OLED::setCursor(7 * FONT_12_WIDTH - 2, 0);
|
||||
OLED::drawCheckbox(invertColor);
|
||||
OLED::drawCheckbox(getSettingValue(SettingsOptions::OLEDInversion));
|
||||
return false;
|
||||
}
|
||||
static bool settings_setInvertColor(void) {
|
||||
invertColor = !invertColor;
|
||||
OLED::setInverseDisplay(invertColor);
|
||||
return invertColor;
|
||||
}
|
||||
|
||||
#ifdef HALL_SENSOR
|
||||
static bool settings_displayHallEffect(void) {
|
||||
|
||||
Reference in New Issue
Block a user