Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add layout 4+2B right side 3QRT+1QRT #3315

Merged
merged 3 commits into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions companion/src/companion.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -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>
2 changes: 1 addition & 1 deletion companion/src/firmwares/customisation_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Binary file added companion/src/images/layouts/mask_layout4+2b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions radio/src/datastructs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion radio/src/datastructs_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
36 changes: 36 additions & 0 deletions radio/src/gui/colorlcd/layouts/layout4+2b.cpp
Original file line number Diff line number Diff line change
@@ -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);
4 changes: 2 additions & 2 deletions radio/src/storage/yaml/yaml_datastructs_nv14.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions radio/src/storage/yaml/yaml_datastructs_x10.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions radio/src/storage/yaml/yaml_datastructs_x12s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down Expand Up @@ -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),
Expand Down