Skip to content

Commit

Permalink
update eez-framework
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Jun 10, 2023
1 parent f8a9e4e commit 1caa9e1
Show file tree
Hide file tree
Showing 42 changed files with 46,791 additions and 46,093 deletions.
8 changes: 4 additions & 4 deletions src/bb3/assets_V2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <eez/gui/widgets/containers/app_view.h>
#include <eez/gui/widgets/containers/container.h>
#include <eez/gui/widgets/containers/grid.h>
#include <eez/gui/widgets/containers/layout_view.h>
#include <eez/gui/widgets/containers/user_widget.h>
#include <eez/gui/widgets/containers/list.h>
#include <eez/gui/widgets/containers/select.h>

Expand Down Expand Up @@ -444,11 +444,11 @@ static uint32_t convertWidget(WidgetV2 &widgetV2) {
return savedOffset;
}

if (widgetV2.type == WIDGET_TYPE_LAYOUT_VIEW) {
if (widgetV2.type == WIDGET_TYPE_USER_WIDGET) {
auto &widgetV2Specific = *(LayoutViewWidgetV2 *)specificV2;
auto &widgetV3Specific = (LayoutViewWidget &)widgetV3;
auto &widgetV3Specific = (UserWidgetWidget &)widgetV3;

ADD_V3_OFFSET(sizeof(LayoutViewWidget));
ADD_V3_OFFSET(sizeof(UserWidgetWidget));

widgetV3Specific.layout = widgetV2Specific.layout;
widgetV3Specific.context = widgetV2Specific.context;
Expand Down
91,376 changes: 45,697 additions & 45,679 deletions src/bb3/gui/document.cpp

Large diffs are not rendered by default.

188 changes: 94 additions & 94 deletions src/bb3/gui/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -2321,52 +2321,52 @@ enum PagesEnum {
PAGE_ID_USER_PROFILES = 70,
PAGE_ID_USER_PROFILE_SETTINGS = 71,
PAGE_ID_USER_PROFILE_0_SETTINGS = 72,
PAGE_ID_PROFILE_BASIC_INFO = 73,
PAGE_ID_STAND_BY_MENU = 74,
PAGE_ID_ENTERING_STANDBY = 75,
PAGE_ID_STANDBY = 76,
PAGE_ID_SAVING = 77,
PAGE_ID_SHUTDOWN = 78,
PAGE_ID_DISPLAY_OFF = 79,
PAGE_ID_SLOT_DEF_VERT = 80,
PAGE_ID_SLOT_DEF_VERT_VIEW_WITH_BORDER = 81,
PAGE_ID_SLOT_DEF_VERT_VIEW_WITH_BORDER_2COL = 82,
PAGE_ID_SLOT_DEF_VERT_TITLE = 83,
PAGE_ID_SLOT_DEF_VERT_TITLE_2COL = 84,
PAGE_ID_SLOT_DEF_VERT_ERROR = 85,
PAGE_ID_SLOT_DEF_VERT_ERROR_2COL = 86,
PAGE_ID_SLOT_DEF_VERT_NOT_INSTALLED = 87,
PAGE_ID_SLOT_DEF_VERT_NOT_INSTALLED_2COL = 88,
PAGE_ID_SLOT_DEF_HORZ = 89,
PAGE_ID_SLOT_DEF_HORZ_VIEW_WITH_BORDER = 90,
PAGE_ID_SLOT_DEF_HORZ_VIEW_WITH_BORDER_2COL = 91,
PAGE_ID_SLOT_DEF_HORZ_TITLE = 92,
PAGE_ID_SLOT_DEF_HORZ_TITLE_2COL = 93,
PAGE_ID_SLOT_DEF_HORZ_ERROR = 94,
PAGE_ID_SLOT_DEF_HORZ_ERROR_2COL = 95,
PAGE_ID_SLOT_DEF_HORZ_NOT_INSTALLED = 96,
PAGE_ID_SLOT_DEF_HORZ_NOT_INSTALLED_2COL = 97,
PAGE_ID_SLOT_DEF_HORZ_EMPTY = 98,
PAGE_ID_SLOT_DEF_HORZ_EMPTY_2COL = 99,
PAGE_ID_SLOT_MAX_ERROR = 100,
PAGE_ID_SLOT_MAX_NOT_INSTALLED = 101,
PAGE_ID_DLOG_VIEW = 102,
PAGE_ID_DLOG_VIEW_DRAWER = 103,
PAGE_ID_DLOG_PARAMS = 104,
PAGE_ID_IMAGE_VIEW = 105,
PAGE_ID_PINOUT = 106,
PAGE_ID_FILE_MANAGER = 107,
PAGE_ID_FILE_BROWSER = 108,
PAGE_ID_FILE_MENU = 109,
PAGE_ID_FILE_MANAGER_DETAILS_VIEW = 110,
PAGE_ID_FILE_MANAGER_SCRIPTS_VIEW = 111,
PAGE_ID_FILE_MANAGER_SCRIPTS_ALTER_VIEW = 112,
PAGE_ID_FILE_MANAGER_LARGE_ICONS_VIEW = 113,
PAGE_ID_TOUCH_TEST = 114,
PAGE_ID_FOCUS_VALUE_OVERLAY = 115,
PAGE_ID_OVP_TYPE = 116,
PAGE_ID_SLOT_LABELS_AND_COLORS = 117,
PAGE_ID_COLOR_PICKER = 118,
PAGE_ID_STAND_BY_MENU = 73,
PAGE_ID_ENTERING_STANDBY = 74,
PAGE_ID_STANDBY = 75,
PAGE_ID_SAVING = 76,
PAGE_ID_SHUTDOWN = 77,
PAGE_ID_DISPLAY_OFF = 78,
PAGE_ID_DLOG_VIEW = 79,
PAGE_ID_DLOG_PARAMS = 80,
PAGE_ID_IMAGE_VIEW = 81,
PAGE_ID_PINOUT = 82,
PAGE_ID_FILE_MANAGER = 83,
PAGE_ID_FILE_BROWSER = 84,
PAGE_ID_FILE_MENU = 85,
PAGE_ID_TOUCH_TEST = 86,
PAGE_ID_FOCUS_VALUE_OVERLAY = 87,
PAGE_ID_OVP_TYPE = 88,
PAGE_ID_COLOR_PICKER = 89,
PAGE_ID_PROFILE_BASIC_INFO = 90,
PAGE_ID_SLOT_DEF_VERT = 91,
PAGE_ID_SLOT_DEF_VERT_VIEW_WITH_BORDER = 92,
PAGE_ID_SLOT_DEF_VERT_VIEW_WITH_BORDER_2COL = 93,
PAGE_ID_SLOT_DEF_VERT_TITLE = 94,
PAGE_ID_SLOT_DEF_VERT_TITLE_2COL = 95,
PAGE_ID_SLOT_DEF_VERT_ERROR = 96,
PAGE_ID_SLOT_DEF_VERT_ERROR_2COL = 97,
PAGE_ID_SLOT_DEF_VERT_NOT_INSTALLED = 98,
PAGE_ID_SLOT_DEF_VERT_NOT_INSTALLED_2COL = 99,
PAGE_ID_SLOT_DEF_HORZ = 100,
PAGE_ID_SLOT_DEF_HORZ_VIEW_WITH_BORDER = 101,
PAGE_ID_SLOT_DEF_HORZ_VIEW_WITH_BORDER_2COL = 102,
PAGE_ID_SLOT_DEF_HORZ_TITLE = 103,
PAGE_ID_SLOT_DEF_HORZ_TITLE_2COL = 104,
PAGE_ID_SLOT_DEF_HORZ_ERROR = 105,
PAGE_ID_SLOT_DEF_HORZ_ERROR_2COL = 106,
PAGE_ID_SLOT_DEF_HORZ_NOT_INSTALLED = 107,
PAGE_ID_SLOT_DEF_HORZ_NOT_INSTALLED_2COL = 108,
PAGE_ID_SLOT_DEF_HORZ_EMPTY = 109,
PAGE_ID_SLOT_DEF_HORZ_EMPTY_2COL = 110,
PAGE_ID_SLOT_MAX_ERROR = 111,
PAGE_ID_SLOT_MAX_NOT_INSTALLED = 112,
PAGE_ID_DLOG_VIEW_DRAWER = 113,
PAGE_ID_FILE_MANAGER_DETAILS_VIEW = 114,
PAGE_ID_FILE_MANAGER_SCRIPTS_VIEW = 115,
PAGE_ID_FILE_MANAGER_SCRIPTS_ALTER_VIEW = 116,
PAGE_ID_FILE_MANAGER_LARGE_ICONS_VIEW = 117,
PAGE_ID_SLOT_LABELS_AND_COLORS = 118,
PAGE_ID_DIB_DCP405_SLOT_DEF_1CH_NUM_ON = 119,
PAGE_ID_DIB_DCP405_SLOT_DEF_1CH_NUM_ON_2COL = 120,
PAGE_ID_DIB_DCP405_SLOT_DEF_1CH_VBAR_ON = 121,
Expand Down Expand Up @@ -2482,7 +2482,7 @@ enum PagesEnum {
PAGE_ID_DIB_MUX14D_RELAY_CYCLES = 231
};

extern const uint8_t assets[315947];
extern const uint8_t assets[316001];

#elif defined(EEZ_PLATFORM_SIMULATOR)

Expand Down Expand Up @@ -4826,52 +4826,52 @@ enum PagesEnum {
PAGE_ID_USER_PROFILES = 70,
PAGE_ID_USER_PROFILE_SETTINGS = 71,
PAGE_ID_USER_PROFILE_0_SETTINGS = 72,
PAGE_ID_PROFILE_BASIC_INFO = 73,
PAGE_ID_STAND_BY_MENU = 74,
PAGE_ID_ENTERING_STANDBY = 75,
PAGE_ID_STANDBY = 76,
PAGE_ID_SAVING = 77,
PAGE_ID_SHUTDOWN = 78,
PAGE_ID_DISPLAY_OFF = 79,
PAGE_ID_SLOT_DEF_VERT = 80,
PAGE_ID_SLOT_DEF_VERT_VIEW_WITH_BORDER = 81,
PAGE_ID_SLOT_DEF_VERT_VIEW_WITH_BORDER_2COL = 82,
PAGE_ID_SLOT_DEF_VERT_TITLE = 83,
PAGE_ID_SLOT_DEF_VERT_TITLE_2COL = 84,
PAGE_ID_SLOT_DEF_VERT_ERROR = 85,
PAGE_ID_SLOT_DEF_VERT_ERROR_2COL = 86,
PAGE_ID_SLOT_DEF_VERT_NOT_INSTALLED = 87,
PAGE_ID_SLOT_DEF_VERT_NOT_INSTALLED_2COL = 88,
PAGE_ID_SLOT_DEF_HORZ = 89,
PAGE_ID_SLOT_DEF_HORZ_VIEW_WITH_BORDER = 90,
PAGE_ID_SLOT_DEF_HORZ_VIEW_WITH_BORDER_2COL = 91,
PAGE_ID_SLOT_DEF_HORZ_TITLE = 92,
PAGE_ID_SLOT_DEF_HORZ_TITLE_2COL = 93,
PAGE_ID_SLOT_DEF_HORZ_ERROR = 94,
PAGE_ID_SLOT_DEF_HORZ_ERROR_2COL = 95,
PAGE_ID_SLOT_DEF_HORZ_NOT_INSTALLED = 96,
PAGE_ID_SLOT_DEF_HORZ_NOT_INSTALLED_2COL = 97,
PAGE_ID_SLOT_DEF_HORZ_EMPTY = 98,
PAGE_ID_SLOT_DEF_HORZ_EMPTY_2COL = 99,
PAGE_ID_SLOT_MAX_ERROR = 100,
PAGE_ID_SLOT_MAX_NOT_INSTALLED = 101,
PAGE_ID_DLOG_VIEW = 102,
PAGE_ID_DLOG_VIEW_DRAWER = 103,
PAGE_ID_DLOG_PARAMS = 104,
PAGE_ID_IMAGE_VIEW = 105,
PAGE_ID_PINOUT = 106,
PAGE_ID_FILE_MANAGER = 107,
PAGE_ID_FILE_BROWSER = 108,
PAGE_ID_FILE_MENU = 109,
PAGE_ID_FILE_MANAGER_DETAILS_VIEW = 110,
PAGE_ID_FILE_MANAGER_SCRIPTS_VIEW = 111,
PAGE_ID_FILE_MANAGER_SCRIPTS_ALTER_VIEW = 112,
PAGE_ID_FILE_MANAGER_LARGE_ICONS_VIEW = 113,
PAGE_ID_TOUCH_TEST = 114,
PAGE_ID_FOCUS_VALUE_OVERLAY = 115,
PAGE_ID_OVP_TYPE = 116,
PAGE_ID_SLOT_LABELS_AND_COLORS = 117,
PAGE_ID_COLOR_PICKER = 118,
PAGE_ID_STAND_BY_MENU = 73,
PAGE_ID_ENTERING_STANDBY = 74,
PAGE_ID_STANDBY = 75,
PAGE_ID_SAVING = 76,
PAGE_ID_SHUTDOWN = 77,
PAGE_ID_DISPLAY_OFF = 78,
PAGE_ID_DLOG_VIEW = 79,
PAGE_ID_DLOG_PARAMS = 80,
PAGE_ID_IMAGE_VIEW = 81,
PAGE_ID_PINOUT = 82,
PAGE_ID_FILE_MANAGER = 83,
PAGE_ID_FILE_BROWSER = 84,
PAGE_ID_FILE_MENU = 85,
PAGE_ID_TOUCH_TEST = 86,
PAGE_ID_FOCUS_VALUE_OVERLAY = 87,
PAGE_ID_OVP_TYPE = 88,
PAGE_ID_COLOR_PICKER = 89,
PAGE_ID_PROFILE_BASIC_INFO = 90,
PAGE_ID_SLOT_DEF_VERT = 91,
PAGE_ID_SLOT_DEF_VERT_VIEW_WITH_BORDER = 92,
PAGE_ID_SLOT_DEF_VERT_VIEW_WITH_BORDER_2COL = 93,
PAGE_ID_SLOT_DEF_VERT_TITLE = 94,
PAGE_ID_SLOT_DEF_VERT_TITLE_2COL = 95,
PAGE_ID_SLOT_DEF_VERT_ERROR = 96,
PAGE_ID_SLOT_DEF_VERT_ERROR_2COL = 97,
PAGE_ID_SLOT_DEF_VERT_NOT_INSTALLED = 98,
PAGE_ID_SLOT_DEF_VERT_NOT_INSTALLED_2COL = 99,
PAGE_ID_SLOT_DEF_HORZ = 100,
PAGE_ID_SLOT_DEF_HORZ_VIEW_WITH_BORDER = 101,
PAGE_ID_SLOT_DEF_HORZ_VIEW_WITH_BORDER_2COL = 102,
PAGE_ID_SLOT_DEF_HORZ_TITLE = 103,
PAGE_ID_SLOT_DEF_HORZ_TITLE_2COL = 104,
PAGE_ID_SLOT_DEF_HORZ_ERROR = 105,
PAGE_ID_SLOT_DEF_HORZ_ERROR_2COL = 106,
PAGE_ID_SLOT_DEF_HORZ_NOT_INSTALLED = 107,
PAGE_ID_SLOT_DEF_HORZ_NOT_INSTALLED_2COL = 108,
PAGE_ID_SLOT_DEF_HORZ_EMPTY = 109,
PAGE_ID_SLOT_DEF_HORZ_EMPTY_2COL = 110,
PAGE_ID_SLOT_MAX_ERROR = 111,
PAGE_ID_SLOT_MAX_NOT_INSTALLED = 112,
PAGE_ID_DLOG_VIEW_DRAWER = 113,
PAGE_ID_FILE_MANAGER_DETAILS_VIEW = 114,
PAGE_ID_FILE_MANAGER_SCRIPTS_VIEW = 115,
PAGE_ID_FILE_MANAGER_SCRIPTS_ALTER_VIEW = 116,
PAGE_ID_FILE_MANAGER_LARGE_ICONS_VIEW = 117,
PAGE_ID_SLOT_LABELS_AND_COLORS = 118,
PAGE_ID_FRONT_PANEL = 119,
PAGE_ID_FRONT_PANEL_EMPTY_SLOT = 120,
PAGE_ID_FRONT_PANEL_NUMERIC_KEYPAD = 121,
Expand Down Expand Up @@ -4999,7 +4999,7 @@ enum PagesEnum {
PAGE_ID_DIB_MUX14D_RELAY_CYCLES = 243
};

extern const uint8_t assets[429685];
extern const uint8_t assets[429920];

#endif

Expand Down
59 changes: 58 additions & 1 deletion src/bb3/psu/scpi/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@

#include <bb3/fpga/prog.h>

#include <bb3/memory.h>

extern bool g_supervisorWatchdogEnabled;

namespace eez {
Expand Down Expand Up @@ -168,6 +170,49 @@ scpi_result_t scpi_cmd_debug(scpi_t *context) {
#endif // DEBUG
}

static char *g_buffer = (char *)DLOG_RECORD_BUFFER;

void dumpFreq(scpi_t *context) {
g_buffer[0] = 0;
stringAppendString(g_buffer, DLOG_RECORD_BUFFER_SIZE, "frequencies\r\n");
for (int i = 0; i < 290; i++) {
char buffer[100];
snprintf(buffer, sizeof(buffer), "%g\r\n", 240000000.0 + i * 2487889.0);
stringAppendString(g_buffer, DLOG_RECORD_BUFFER_SIZE, buffer);
}
SCPI_ResultCharacters(context, g_buffer, strlen(g_buffer));
}

void dumpTrace1(scpi_t *context) {
g_buffer[0] = 0;
for (int i = 0; i < 290; i++) {
char buffer[100];
snprintf(buffer, sizeof(buffer), "trace 1 value %d %g\r\n", i, i * 2.0);
stringAppendString(g_buffer, DLOG_RECORD_BUFFER_SIZE, buffer);
}
SCPI_ResultCharacters(context, g_buffer, strlen(g_buffer));
}

void dumpTrace2(scpi_t *context) {
g_buffer[0] = 0;
for (int i = 0; i < 290; i++) {
char buffer[100];
snprintf(buffer, sizeof(buffer), "trace 2 value %d %g\r\n", i, i * 3.0);
stringAppendString(g_buffer, DLOG_RECORD_BUFFER_SIZE, buffer);
}
SCPI_ResultCharacters(context, g_buffer, strlen(g_buffer));
}

void dumpTrace3(scpi_t *context) {
g_buffer[0] = 0;
for (int i = 0; i < 290; i++) {
char buffer[100];
snprintf(buffer, sizeof(buffer), "trace 3 value %d %g\r\n", i, 500 + 500 * sin(i * 2 * 3.14 / 290));
stringAppendString(g_buffer, DLOG_RECORD_BUFFER_SIZE, buffer);
}
SCPI_ResultCharacters(context, g_buffer, strlen(g_buffer));
}

scpi_result_t scpi_cmd_debugQ(scpi_t *context) {
#ifdef DEBUG
int32_t cmd;
Expand All @@ -193,7 +238,19 @@ scpi_result_t scpi_cmd_debugQ(scpi_t *context) {
} else if (cmd == 35) {
dumpAlloc(context);
return SCPI_RES_OK;
} else {
} else if (cmd == 101) {
dumpFreq(context);
return SCPI_RES_OK;
} else if (cmd == 102) {
dumpTrace1(context);
return SCPI_RES_OK;
} else if (cmd == 103) {
dumpTrace2(context);
return SCPI_RES_OK;
} else if (cmd == 104) {
dumpTrace3(context);
return SCPI_RES_OK;
} else {
SCPI_ErrorPush(context, SCPI_ERROR_HARDWARE_MISSING);
return SCPI_RES_ERR;
}
Expand Down
6 changes: 5 additions & 1 deletion src/eez-framework/src/eez/core/action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#include <eez/core/action.h>

#if defined(EEZ_FOR_LVGL)
#include <eez/flow/hooks.h>
#endif

namespace eez {

#if EEZ_OPTION_GUI
Expand All @@ -28,7 +32,7 @@ namespace gui {

void executeActionFunction(int actionId) {
#if defined(EEZ_FOR_LVGL)
g_actionExecFunctions[actionId](0);
eez::flow::executeLvglActionHook(actionId - 1);
#else
g_actionExecFunctions[actionId]();
#endif
Expand Down
6 changes: 2 additions & 4 deletions src/eez-framework/src/eez/core/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ namespace eez {
namespace gui {
#endif

#if defined(EEZ_FOR_LVGL)
typedef void (*ActionExecFunc)(lv_event_t * e);
#else
#if !defined(EEZ_FOR_LVGL)
typedef void (*ActionExecFunc)();
#endif
extern ActionExecFunc g_actionExecFunctions[];
#endif

void executeActionFunction(int actionId);

Expand Down
24 changes: 20 additions & 4 deletions src/eez-framework/src/eez/core/assets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,35 @@ int getThemesCount() {
}

Theme *getTheme(int i) {
return g_mainAssets->colorsDefinition->themes[i];
if (i < 0 || i >= (int)g_mainAssets->colorsDefinition->themes.count) {
return nullptr;
}
return g_mainAssets->colorsDefinition->themes[i];
}

const char *getThemeName(int i) {
return static_cast<const char *>(getTheme(i)->name);
auto theme = getTheme(i);
if (!theme) {
return "";
}
return static_cast<const char *>(theme->name);
}

const uint32_t getThemeColorsCount(int themeIndex) {
return getTheme(themeIndex)->colors.count;
auto theme = getTheme(themeIndex);
if (!theme) {
return 0;
}
return theme->colors.count;
}

const uint16_t *getThemeColors(int themeIndex) {
return static_cast<uint16_t *>(getTheme(themeIndex)->colors.items);
auto theme = getTheme(themeIndex);
if (!theme) {
static uint16_t *g_themeColors = { 0 };
return g_themeColors;
}
return static_cast<uint16_t *>(theme->colors.items);
}

const uint16_t *getColors() {
Expand Down
Loading

0 comments on commit 1caa9e1

Please sign in to comment.