mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
* Starting GUI render refactor to be more immediate mode Update TemperatureAdjust.cpp . Cleanup Soldering Sleep SolderingProfiles Soldering Rework Rough pass GUI Temp Adjust Cleanup old OperatingMode Debug Menu * Update TemperatureAdjust.cpp * Roughing some transition work * Fixup! Hook in the init starter helper * Better home screen button handler * FIXUP! Fix typo's . * Update SettingsMenu.cpp * More settings rework * More settings rendering * Fixup * Transitions Update SolderingProfile.cpp Hook in transistions * Update TemperatureAdjust.cpp * Update push.yml * Add auto-repeat to settings menu * Miniware: Use IT for I2C writes * Update USBPDDebug_HUSB238.cpp * Force write screen on side animation cancel . * Refactor moving down the settings list * Update settingsGUI.cpp * Update I2C_Wrapper.cpp * Update OLED.cpp * Rework button handling * Fix PD debug at boot * Fixup not showing right menu options * silence some warnings * Style cleanup * Fkit use bit-bang I2C for Miniware * Update GUIRendering.md * Fixup transition on enter soldering mode * Save Settings * Fixes for some animations not running Dont bail on animations if keypress is still held * Fixup settings acceleration * OLED Up animation * Link up/down on debug meny * Make all accelerometers I2C bus aware Update accelerometers_common.h * Make I2C mag optional * Miniware -> Only Bit-Bang I2C * Fixup for scrollbar FIXUP! Debug menu returns to home screen FIXUP! Up oled animation Fix temp exit * Settings menu -> Both buttons return a menu layer * Merge fixup * Update BMA223.cpp * Re-Enable OLED sleep * Save Setting on temp adjust exit * WiP on startup mode * Some autostart working * Add hibernation mode & more autostart fixes * If cant CJC; go to startup * Hibernate in sleep * Cleanup scroll indicator * FIXUP! Ensure startup warnings are linked in * FIXUP! Ensure we render out temp change before timing out * Ensure 100ms delay between CJC samples * Fix not re-calculating menu length on entering menu * Implement NegotiationinProgress for USB-PD * Mask heating until PD finishes negotiation * Fixup staying in hibernate correctly * Warning timeout * Show reset settings warning * Correctly compensate help text start time * Update GUIThread.cpp * Update USBPD.cpp * . * Fixup sleep time * Update printSleepCountdown.cpp * replacing countdown with big plus while in boost mode * bringing back the + 1 since it was missing when not in boost mode * Bail on USB-PD check after 3 seconds incase of DC source * Fix hibernate * Update PIDThread.cpp * did center plus symbol (boost mode) * Big refactor to not make settings increment handler handle the "is last item" return * Fixup boot logo * Fix flashing * Fixup recalculate the menu length on long hold * Fixup missing menu entries * Fix junk left on screen after user confirmation * Re-order button handler to use custom, then default order to allow setting associated setting * Attach setting for settings using custom handler * Fix swap +/- keys * Fix boost temp * Implement last menu option for Language selector * Wait for init before CJC runs * Check last setting via increment value * Update BSP.cpp * removed = from >= Otherwise incrementing would stop and the scroll bar would already flash at the second to last value. * (Hacky) Fix for Settings reset --------- Co-authored-by: discip <53649486+discip@users.noreply.github.com>
190 lines
5.2 KiB
C++
190 lines
5.2 KiB
C++
/*
|
|
* Translation.h
|
|
*
|
|
* Created on: 31Aug.,2017
|
|
* Author: Ben V. Brown
|
|
*/
|
|
|
|
#ifndef TRANSLATION_H_
|
|
#define TRANSLATION_H_
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
extern const bool HasFahrenheit;
|
|
|
|
extern const char *SmallSymbolPlus;
|
|
extern const char *LargeSymbolPlus;
|
|
extern const char *SmallSymbolMinus;
|
|
extern const char *LargeSymbolMinus;
|
|
extern const char *SmallSymbolSpace;
|
|
extern const char *LargeSymbolSpace;
|
|
extern const char *SmallSymbolAmps;
|
|
extern const char *LargeSymbolAmps;
|
|
extern const char *SmallSymbolDot;
|
|
extern const char *LargeSymbolDot;
|
|
extern const char *SmallSymbolSlash;
|
|
extern const char *SmallSymbolColon;
|
|
extern const char *SmallSymbolDegC;
|
|
extern const char *LargeSymbolDegC;
|
|
extern const char *SmallSymbolDegF;
|
|
extern const char *LargeSymbolDegF;
|
|
extern const char *LargeSymbolMinutes;
|
|
extern const char *SmallSymbolMinutes;
|
|
extern const char *LargeSymbolSeconds;
|
|
extern const char *SmallSymbolSeconds;
|
|
extern const char *LargeSymbolWatts;
|
|
extern const char *SmallSymbolWatts;
|
|
extern const char *LargeSymbolVolts;
|
|
extern const char *SmallSymbolVolts;
|
|
extern const char *LargeSymbolDC;
|
|
extern const char *SmallSymbolDC;
|
|
extern const char *LargeSymbolCellCount;
|
|
extern const char *SmallSymbolCellCount;
|
|
//
|
|
extern const char *SmallSymbolVersionNumber;
|
|
extern const char *SmallSymbolPDDebug;
|
|
extern const char *SmallSymbolState;
|
|
extern const char *SmallSymbolNoVBus;
|
|
extern const char *SmallSymbolVBus;
|
|
|
|
extern const char *DebugMenu[];
|
|
extern const char *AccelTypeNames[];
|
|
extern const char *PowerSourceNames[];
|
|
|
|
enum class SettingsItemIndex : uint8_t {
|
|
DCInCutoff,
|
|
MinVolCell,
|
|
QCMaxVoltage,
|
|
PDNegTimeout,
|
|
PDVpdo,
|
|
BoostTemperature,
|
|
AutoStart,
|
|
TempChangeShortStep,
|
|
TempChangeLongStep,
|
|
LockingMode,
|
|
ProfilePhases,
|
|
ProfilePreheatTemp,
|
|
ProfilePreheatSpeed,
|
|
ProfilePhase1Temp,
|
|
ProfilePhase1Duration,
|
|
ProfilePhase2Temp,
|
|
ProfilePhase2Duration,
|
|
ProfilePhase3Temp,
|
|
ProfilePhase3Duration,
|
|
ProfilePhase4Temp,
|
|
ProfilePhase4Duration,
|
|
ProfilePhase5Temp,
|
|
ProfilePhase5Duration,
|
|
ProfileCooldownSpeed,
|
|
MotionSensitivity,
|
|
SleepTemperature,
|
|
SleepTimeout,
|
|
ShutdownTimeout,
|
|
HallEffSensitivity,
|
|
TemperatureUnit,
|
|
DisplayRotation,
|
|
CooldownBlink,
|
|
ScrollingSpeed,
|
|
ReverseButtonTempChange,
|
|
AnimSpeed,
|
|
AnimLoop,
|
|
Brightness,
|
|
ColourInversion,
|
|
LOGOTime,
|
|
AdvancedIdle,
|
|
AdvancedSoldering,
|
|
BluetoothLE,
|
|
PowerLimit,
|
|
CalibrateCJC,
|
|
VoltageCalibration,
|
|
PowerPulsePower,
|
|
PowerPulseWait,
|
|
PowerPulseDuration,
|
|
SettingsReset,
|
|
LanguageSwitch,
|
|
NUM_ITEMS,
|
|
};
|
|
|
|
struct TranslationIndexTable {
|
|
uint16_t CalibrationDone;
|
|
uint16_t ResetOKMessage;
|
|
uint16_t SettingsResetMessage;
|
|
uint16_t NoAccelerometerMessage;
|
|
uint16_t NoPowerDeliveryMessage;
|
|
uint16_t LockingKeysString;
|
|
uint16_t UnlockingKeysString;
|
|
uint16_t WarningKeysLockedString;
|
|
uint16_t WarningThermalRunaway;
|
|
uint16_t WarningTipShorted;
|
|
|
|
uint16_t SettingsCalibrationWarning;
|
|
uint16_t CJCCalibrating;
|
|
uint16_t SettingsResetWarning;
|
|
uint16_t UVLOWarningString;
|
|
uint16_t UndervoltageString;
|
|
uint16_t InputVoltageString;
|
|
uint16_t ProfilePreheatString;
|
|
uint16_t ProfileCooldownString;
|
|
|
|
uint16_t SleepingSimpleString;
|
|
uint16_t SleepingAdvancedString;
|
|
uint16_t SleepingTipAdvancedString;
|
|
uint16_t DeviceFailedValidationWarning;
|
|
uint16_t TooHotToStartProfileWarning;
|
|
|
|
uint16_t SettingRightChar;
|
|
uint16_t SettingLeftChar;
|
|
uint16_t SettingAutoChar;
|
|
uint16_t SettingSlowChar;
|
|
uint16_t SettingMediumChar;
|
|
uint16_t SettingFastChar;
|
|
uint16_t SettingStartSolderingChar;
|
|
uint16_t SettingStartSleepChar;
|
|
uint16_t SettingStartSleepOffChar;
|
|
uint16_t SettingLockBoostChar;
|
|
uint16_t SettingLockFullChar;
|
|
|
|
uint16_t SettingsDescriptions[static_cast<uint32_t>(SettingsItemIndex::NUM_ITEMS)];
|
|
uint16_t SettingsShortNames[static_cast<uint32_t>(SettingsItemIndex::NUM_ITEMS)];
|
|
uint16_t SettingsMenuEntriesDescriptions[5]; // unused
|
|
uint16_t SettingsMenuEntries[5];
|
|
};
|
|
|
|
extern const TranslationIndexTable *Tr;
|
|
|
|
extern const char *TranslationStrings;
|
|
|
|
struct TranslationData {
|
|
TranslationIndexTable indices;
|
|
// Translation strings follows the translation index table.
|
|
// C++ does not support flexible array member as in C, so we use a 1-element
|
|
// array as a placeholder.
|
|
char strings[1];
|
|
};
|
|
|
|
struct FontSection {
|
|
const uint8_t *font12_start_ptr;
|
|
const uint8_t *font06_start_ptr;
|
|
uint16_t font12_decompressed_size;
|
|
uint16_t font06_decompressed_size;
|
|
const uint8_t *font12_compressed_source; // Pointer to compressed data or null
|
|
const uint8_t *font06_compressed_source; // Pointer to compressed data or null
|
|
};
|
|
|
|
extern const FontSection FontSectionInfo;
|
|
|
|
constexpr uint8_t settings_item_index(const SettingsItemIndex i) { return static_cast<uint8_t>(i); }
|
|
// Use a constexpr function for type-checking.
|
|
#define SETTINGS_DESC(i) (settings_item_index(i) + 1)
|
|
|
|
const char *translatedString(uint16_t index);
|
|
|
|
void prepareTranslations();
|
|
void settings_displayLanguageSwitch(void);
|
|
bool settings_showLanguageSwitch(void);
|
|
void settings_setLanguageSwitch(void);
|
|
bool isLastLanguageOption(void);
|
|
|
|
#endif /* TRANSLATION_H_ */
|