feat(color): Add layout 4+2B right side 3QRT+1QRT (#3315)

* Add layout 4+2B right side 3QRT+1QRT

* Fix Layout 4+2B LayoutId, length max 9 char

* Maybe this will work?

---------

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
daniel-snowsurf
2023-04-10 12:00:59 +10:00
committed by GitHub
co-authored by Peter Feerick
parent 227780d784
commit f935ce8c2b
9 changed files with 49 additions and 12 deletions
+1
View File
@@ -1288,5 +1288,6 @@
<file alias="mask_layout2x3.png">images/layouts/mask_layout2x3.png</file>
<file alias="mask_layout2x4.png">images/layouts/mask_layout2x4.png</file>
<file alias="mask_layout4p2.png">images/layouts/mask_layout4+2.png</file>
<file alias="mask_layout4p2b.png">images/layouts/mask_layout4+2b.png</file>
</qresource>
</RCC>
+1 -1
View File
@@ -40,7 +40,7 @@ constexpr int WIDGET_NAME_LEN {10};
constexpr int MAX_WIDGET_OPTIONS {5};
constexpr int MAX_TOPBAR_ZONES {4};
constexpr int MAX_TOPBAR_OPTIONS {1};
constexpr int LAYOUT_ID_LEN {10};
constexpr int LAYOUT_ID_LEN {12};
// Common 'ZoneOptionValue's among all layouts
enum {
Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

+4 -4
View File
@@ -85,7 +85,7 @@ static inline void check_struct()
CHKSIZE(SwashRingData, 8);
CHKSIZE(ModelHeader, 131);
CHKSIZE(CurveHeader, 4);
CHKSIZE(CustomScreenData, 850);
CHKSIZE(CustomScreenData, 852);
CHKTYPE(TopBarPersistentData, 300);
#elif defined(PCBNV14)
// TODO
@@ -140,14 +140,14 @@ static inline void check_struct()
#elif defined(PCBHORUS)
#if defined(PCBX10)
CHKSIZE(RadioData, 950);
CHKSIZE(ModelData, 15431);
CHKSIZE(ModelData, 15451);
#else
CHKSIZE(RadioData, 932);
CHKSIZE(ModelData, 15429);
CHKSIZE(ModelData, 15449);
#endif
#elif defined(PCBNV14)
CHKSIZE(RadioData, 878);
CHKSIZE(ModelData, 15245);
CHKSIZE(ModelData, 15265);
#endif
#undef CHKSIZE
+1 -1
View File
@@ -577,7 +577,7 @@ typedef uint32_t swarnstate_t;
#elif defined(COLORLCD)
#include "gui/colorlcd/layout.h"
#include "gui/colorlcd/topbar.h"
#define LAYOUT_ID_LEN 10
#define LAYOUT_ID_LEN 12
PACK(struct CustomScreenData {
char LayoutId[LAYOUT_ID_LEN];
LayoutPersistentData layoutData;
@@ -0,0 +1,36 @@
/*
* Copyright (C) EdgeTX
*
* Based on code named
* opentx - https://github.com/opentx/opentx
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "layout.h"
#include "layout_factory_impl.h"
static uint8_t zmap[] = {
LAYOUT_MAP_0, LAYOUT_MAP_0, LAYOUT_MAP_HALF, LAYOUT_MAP_1QTR,
LAYOUT_MAP_0, LAYOUT_MAP_1QTR, LAYOUT_MAP_HALF, LAYOUT_MAP_1QTR,
LAYOUT_MAP_0, LAYOUT_MAP_HALF, LAYOUT_MAP_HALF, LAYOUT_MAP_1QTR,
LAYOUT_MAP_0, LAYOUT_MAP_3QTR, LAYOUT_MAP_HALF, LAYOUT_MAP_1QTR,
LAYOUT_MAP_HALF, LAYOUT_MAP_0, LAYOUT_MAP_HALF, LAYOUT_MAP_3QTR,
LAYOUT_MAP_HALF, LAYOUT_MAP_3QTR, LAYOUT_MAP_HALF, LAYOUT_MAP_1QTR,
};
BaseLayoutFactory<Layout> layout4P2B("Layout4P2B", "4 + 2B",
defaultZoneOptions,
6, zmap);
@@ -847,7 +847,7 @@ static const struct YamlNode struct_LayoutPersistentData[] = {
};
static const struct YamlNode struct_CustomScreenData[] = {
YAML_IDX,
YAML_STRING("LayoutId", 10),
YAML_STRING("LayoutId", 12),
YAML_STRUCT("layoutData", 6720, struct_LayoutPersistentData, NULL),
YAML_END
};
@@ -914,7 +914,7 @@ static const struct YamlNode struct_ModelData[] = {
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
YAML_ARRAY("potsWarnPosition", 8, 5, struct_signed_8, NULL),
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
YAML_ARRAY("screenData", 6800, 10, struct_CustomScreenData, NULL),
YAML_ARRAY("screenData", 6816, 10, struct_CustomScreenData, NULL),
YAML_STRUCT("topbarData", 1248, struct_TopBarPersistentData, NULL),
YAML_UNSIGNED( "view", 8 ),
YAML_STRING("modelRegistrationID", 8),
@@ -878,7 +878,7 @@ static const struct YamlNode struct_LayoutPersistentData[] = {
};
static const struct YamlNode struct_CustomScreenData[] = {
YAML_IDX,
YAML_STRING("LayoutId", 10),
YAML_STRING("LayoutId", 12),
YAML_STRUCT("layoutData", 6720, struct_LayoutPersistentData, NULL),
YAML_END
};
@@ -945,7 +945,7 @@ static const struct YamlNode struct_ModelData[] = {
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
YAML_ARRAY("potsWarnPosition", 8, 11, struct_signed_8, NULL),
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
YAML_ARRAY("screenData", 6800, 10, struct_CustomScreenData, NULL),
YAML_ARRAY("screenData", 6816, 10, struct_CustomScreenData, NULL),
YAML_STRUCT("topbarData", 2400, struct_TopBarPersistentData, NULL),
YAML_UNSIGNED( "view", 8 ),
YAML_STRING("modelRegistrationID", 8),
@@ -876,7 +876,7 @@ static const struct YamlNode struct_LayoutPersistentData[] = {
};
static const struct YamlNode struct_CustomScreenData[] = {
YAML_IDX,
YAML_STRING("LayoutId", 10),
YAML_STRING("LayoutId", 12),
YAML_STRUCT("layoutData", 6720, struct_LayoutPersistentData, NULL),
YAML_END
};
@@ -943,7 +943,7 @@ static const struct YamlNode struct_ModelData[] = {
YAML_UNSIGNED( "potsWarnEnabled", 16 ),
YAML_ARRAY("potsWarnPosition", 8, 9, struct_signed_8, NULL),
YAML_ARRAY("telemetrySensors", 112, 60, struct_TelemetrySensor, NULL),
YAML_ARRAY("screenData", 6800, 10, struct_CustomScreenData, NULL),
YAML_ARRAY("screenData", 6816, 10, struct_CustomScreenData, NULL),
YAML_STRUCT("topbarData", 2400, struct_TopBarPersistentData, NULL),
YAML_UNSIGNED( "view", 8 ),
YAML_STRING("modelRegistrationID", 8),