Multi screen support, with dyn alignment (#2801)

This commit is contained in:
Totoo
2025-10-03 19:10:10 +02:00
committed by GitHub
parent 23cabb8b8a
commit 371b6b5079
161 changed files with 4042 additions and 4157 deletions
+6 -2
View File
@@ -198,8 +198,12 @@ void RecentEntriesTable<ui::external_app::tpmsrx::TPMSRecentEntries>::draw(
const Entry& entry,
const Rect& target_rect,
Painter& painter,
const Style& style) {
std::string line = ui::external_app::tpmsrx::format::type(entry.type) + " " + ui::external_app::tpmsrx::format::id(entry.id);
const Style& style,
RecentEntriesColumns& columns) {
std::string line = ui::external_app::tpmsrx::format::type(entry.type) + " ";
std::string lid = ui::external_app::tpmsrx::format::id(entry.id);
lid.resize(columns.at(1).second, ' ');
line += lid;
if (entry.last_pressure.is_valid()) {
line += " " + ui::external_app::tpmsrx::format::pressure(entry.last_pressure.value());
+12 -14
View File
@@ -134,19 +134,17 @@ class TPMSAppView : public View {
ui::Rect view_normal_rect{};
RSSI rssi{
{21 * 8, 0, 6 * 8, 4},
{UI_POS_X(21), 0, UI_POS_WIDTH_REMAINING(24), 4},
};
AudioVolumeField field_volume{
{screen_width - 2 * 8, 0 * 16}};
Channel channel{
{21 * 8, 5, 6 * 8, 4},
{UI_POS_X(21), 5, UI_POS_WIDTH_REMAINING(24), 4},
};
AudioVolumeField field_volume{
{UI_POS_X_RIGHT(2), UI_POS_Y(0)}};
// "315 MHz" TPMS sensors transmit at either 314.9 or 315 MHz but we should pick up either
OptionsField options_band{
{0 * 8, 0 * 16},
{UI_POS_X(0), UI_POS_Y(0)},
5,
{
{"314.9", 314900000},
@@ -155,32 +153,32 @@ class TPMSAppView : public View {
}};
OptionsField options_pressure{
{6 * 8, 0 * 16},
{6 * 8, UI_POS_Y(0)},
3,
{{"kPa", 0},
{"PSI", 1}}};
OptionsField options_temperature{
{10 * 8, 0 * 16},
{10 * 8, UI_POS_Y(0)},
2,
{{STR_DEGREES_C, 0},
{STR_DEGREES_F, 1}}};
RFAmpField field_rf_amp{
{13 * 8, 0 * 16}};
{13 * 8, UI_POS_Y(0)}};
LNAGainField field_lna{
{15 * 8, 0 * 16}};
{15 * 8, UI_POS_Y(0)}};
VGAGainField field_vga{
{18 * 8, 0 * 16}};
{18 * 8, UI_POS_Y(0)}};
TPMSRecentEntries recent{};
std::unique_ptr<TPMSLogger> logger{};
const RecentEntriesColumns columns{{
RecentEntriesColumns columns{{
{"Tp", 2},
{"ID", 8},
{"ID", 0},
{"Pres", 4},
{"Temp", 4},
{"Cnt", 3},