Merge with latest 2.3

This commit is contained in:
Bertrand Songis
2020-10-07 21:01:45 +02:00
376 changed files with 10566 additions and 8633 deletions
+5
View File
@@ -24,6 +24,7 @@
#include "libopenui_config.h"
#define WHITE RGB(0xFF, 0xFF, 0xFF)
#define LIGHTWHITE RGB(238, 234, 238)
#define BLACK RGB(0, 0, 0)
#define YELLOW RGB(0xF0, 0xD0, 0x10)
#define BLUE RGB(0x30, 0xA0, 0xE0)
@@ -34,6 +35,10 @@
#define RED RGB(229, 32, 30)
#define DARKRED RGB(160, 0, 6)
#define GREEN RGB(25, 150, 50)
#define LIGHTBROWN RGB(156, 109, 32)
#define DARKBROWN RGB(106, 72, 16)
#define BRIGHTGREEN RGB(0, 180, 60)
#define ORANGE RGB(229, 100, 30)
#define TEXT_STATUSBAR_COLOR COLOR(TEXT_STATUSBAR_COLOR_INDEX)
#define LINE_COLOR COLOR(LINE_COLOR_INDEX)
+1 -4
View File
@@ -18,8 +18,7 @@
* GNU General Public License for more details.
*/
#ifndef _LAYOUT_H_
#define _LAYOUT_H_
#pragma once
#include <list>
#include "widgets_container.h"
@@ -125,5 +124,3 @@ Layout * loadLayout(const char * name, Layout::PersistentData * persistentData);
void loadCustomScreens();
std::list<const LayoutFactory *> & getRegisteredLayouts();
#endif // _LAYOUT_H_
@@ -242,6 +242,10 @@ void onDeleteModelConfirm(const char * result)
void onModelSelectMenu(const char * result)
{
if (result == STR_SELECT_MODEL) {
if (!g_eeGeneral.disableRssiPoweroffAlarm) {
if (!confirmModelChange())
return;
}
// we store the latest changes if any
storageFlushCurrentModel();
storageCheck(true);
@@ -259,6 +263,10 @@ void onModelSelectMenu(const char * result)
deleteMode = MODE_DELETE_MODEL;
}
else if (result == STR_CREATE_MODEL) {
if (!g_eeGeneral.disableRssiPoweroffAlarm) {
if (!confirmModelChange())
return;
}
storageCheck(true);
modelslist.addModel(currentCategory, createModel());
selectMode = MODE_SELECT_MODEL;
+2 -2
View File
@@ -711,9 +711,9 @@ class ModuleWindow : public FormGroup {
}
#endif
#if defined (PCBNV14)
else if (isModuleFlysky(moduleIdx)) {
else if (isModuleAFHDS3(moduleIdx)) {
grid.nextLine();
rfChoice = new Choice(this, grid.getFieldSlot(), STR_FLYSKY_PROTOCOLS, 0, 3,
rfChoice = new Choice(this, grid.getFieldSlot(), STR_AFHDS3_PROTOCOLS, 0, 3,
GET_DEFAULT(g_model.moduleData[moduleIdx].flysky.mode),
[=](int32_t newValue) -> void {
g_model.moduleData[moduleIdx].flysky.mode = newValue;
+9 -7
View File
@@ -49,14 +49,16 @@ void GaugeWidget::refresh()
uint16_t color = persistentData->options[3].value.unsignedValue;
int32_t value = getValue(index);
int32_t value_in_range = value;
if (value < min)
value_in_range = min;
else if (value > max)
value_in_range = max;
int w = divRoundClosest(zone.w * (value_in_range - min), (max - min));
int percent = divRoundClosest(100 * (value_in_range - min), (max - min));
if (min > max) {
SWAP(min, max);
value = value - min - max;
}
value = limit(min, value, max);
int w = divRoundClosest(zone.w * (value - min), (max - min));
int percent = divRoundClosest(100 * (value - min), (max - min));
// Gauge label
drawSource(zone.x, zone.y, index, FONT(XS) | FOCUS_COLOR);
+1 -1
View File
@@ -30,7 +30,7 @@ class ModelBitmapWidget: public Widget
{
}
virtual ~ModelBitmapWidget()
~ModelBitmapWidget() override
{
delete buffer;
}
+2 -2
View File
@@ -97,7 +97,7 @@ void ValueWidget::refresh()
if (field >= MIXSRC_FIRST_TIMER && field <= MIXSRC_LAST_TIMER) {
TimerState & timerState = timersStates[field-MIXSRC_FIRST_TIMER];
if (timerState.val < 0) {
lcdSetColor(ALARM_COLOR_INDEX);
lcdSetColor(lcdColorTable[ALARM_COLOR_INDEX]);
}
drawSource(x+NUMBERS_PADDING, y+2, field, CUSTOM_COLOR);
drawSource(x+NUMBERS_PADDING + 1, y + 3, field, BLACK);
@@ -108,7 +108,7 @@ void ValueWidget::refresh()
if (field >= MIXSRC_FIRST_TELEM) {
TelemetryItem & telemetryItem = telemetryItems[(field-MIXSRC_FIRST_TELEM)/3]; // TODO macro to convert a source to a telemetry index
if (!telemetryItem.isAvailable() || telemetryItem.isOld()) {
lcdSetColor(ALARM_COLOR_INDEX);
lcdSetColor(lcdColorTable[TEXT_DISABLE_COLOR_INDEX]);
}
}
+3 -3
View File
@@ -80,7 +80,7 @@ class WidgetsContainer: public WidgetsContainerInterface
}
}
virtual void createWidget(unsigned int index, const WidgetFactory * factory)
void createWidget(unsigned int index, const WidgetFactory * factory) override
{
if (widgets) {
memset(persistentData->zones[index].widgetName, 0, sizeof(persistentData->zones[index].widgetName));
@@ -123,9 +123,9 @@ class WidgetsContainer: public WidgetsContainerInterface
return &persistentData->options[index].value;
}
virtual unsigned int getZonesCount() const = 0;
unsigned int getZonesCount() const override = 0;
virtual Zone getZone(unsigned int index) const = 0;
Zone getZone(unsigned int index) const override = 0;
virtual void refresh()
{