diff --git a/modular-psu-firmware.eez-project b/modular-psu-firmware.eez-project index 8b067abbb..0f41e2eff 100644 --- a/modular-psu-firmware.eez-project +++ b/modular-psu-firmware.eez-project @@ -1,7 +1,6 @@ { "settings": { "general": { - "projectVersion": "v2", "scpiDocFolder": "doc\\SCPI reference guide\\Commands" }, "build": { @@ -906,14 +905,9 @@ "defaultValue": "0" }, { - "name": "profiles.list1", + "name": "profiles.list", "type": "list", - "defaultValue": "[{}, {}, {}, {}]" - }, - { - "name": "profiles.list2", - "type": "list", - "defaultValue": "[{}, {}, {}, {}, {}, {}]" + "defaultValue": "[{}, {}, {}, {}, {}, {}, {}, {}, {}, {}]" }, { "name": "profiles.autoRecall.status", @@ -924,7 +918,7 @@ }, { "name": "profiles.autoRecall.location", - "type": "integer", + "type": "string", "defaultValue": "0" }, { @@ -2086,9 +2080,6 @@ { "name": "show_user_profiles" }, - { - "name": "show_user_profiles2" - }, { "name": "show_user_profile_settings" }, @@ -26799,7 +26790,7 @@ "padding": 0 }, "data": "profiles.autoRecall.status", - "left": 189, + "left": 192, "top": 8, "width": 40, "height": 28, @@ -26841,182 +26832,96 @@ ] }, { - "type": "Text", - "style": { - "inheritFrom": "edit_value_S_left", - "padding": 0 - }, - "activeStyle": { - "inheritFrom": "default", - "padding": 0 - }, - "left": 8, - "top": 36, - "width": 133, - "height": 28, - "text": "Power-on profile:" - }, - { - "type": "Text", - "style": { - "inheritFrom": "value_S", - "padding": 0 - }, - "activeStyle": { - "inheritFrom": "default", - "padding": 0 - }, - "data": "profiles.autoRecall.location", - "left": 141, - "top": 36, - "width": 35, - "height": 28, - "text": "" - }, - { - "type": "List", - "style": { - "inheritFrom": "default", - "padding": 0 - }, - "activeStyle": { - "inheritFrom": "default", - "padding": 0 - }, - "data": "profiles.list1", - "left": 8, - "top": 64, - "width": 464, - "height": 116, - "itemWidget": { - "type": "LayoutView", - "style": { - "inheritFrom": "default", - "padding": 0 - }, - "activeStyle": { - "inheritFrom": "default", - "padding": 0 - }, - "left": 0, - "top": 0, - "width": 464, - "height": 28, - "layout": "profile" - }, - "listType": "vertical" - }, - { - "type": "Container", + "type": "Select", "style": { "inheritFrom": "default" }, "activeStyle": { "inheritFrom": "default" }, - "left": 0, - "top": 240, - "width": 480, - "height": 32, - "name": "Status line", + "data": "profiles.autoRecall.status", + "left": 244, + "top": 8, + "width": 171, + "height": 28, "widgets": [ { - "type": "Text", + "type": "Rectangle", "style": { - "inheritFrom": "status_bgnd", - "font": "Heydings14", - "padding": 0 + "inheritFrom": "default" }, "activeStyle": { - "inheritFrom": "default", - "padding": 0 + "inheritFrom": "default" }, - "action": "show_main_page", "left": 0, "top": 0, - "width": 41, - "height": 32, - "text": "H" + "width": 171, + "height": 28, + "invertColors": true }, { - "type": "Text", + "type": "Container", "style": { - "inheritFrom": "bottom_button_textual_S_left" - }, - "activeStyle": { "inheritFrom": "default" }, - "left": 41, - "top": 0, - "width": 343, - "height": 32, - "text": "User profiles (1)" - }, - { - "type": "Text", - "style": { - "inheritFrom": "bottom_button_disabled", - "font": "Heydings14", - "padding": 0 - }, - "activeStyle": { - "inheritFrom": "default", - "padding": 0 - }, - "left": 384, - "top": 0, - "width": 48, - "height": 32, - "text": "(" - }, - { - "type": "Text", - "style": { - "inheritFrom": "bottom_button", - "font": "Heydings14", - "padding": 0 - }, "activeStyle": { - "inheritFrom": "default", - "padding": 0 + "inheritFrom": "default" }, - "action": "show_user_profiles2", - "left": 432, + "left": 0, "top": 0, - "width": 48, - "height": 32, - "text": ")" + "width": 171, + "height": 28, + "widgets": [ + { + "type": "Text", + "style": { + "inheritFrom": "edit_value_S_left", + "padding": 0 + }, + "activeStyle": { + "inheritFrom": "default", + "padding": 0 + }, + "left": 0, + "top": 0, + "width": 133, + "height": 28, + "text": "Power-on profile:" + }, + { + "type": "Text", + "style": { + "inheritFrom": "value_S" + }, + "activeStyle": { + "inheritFrom": "default" + }, + "data": "profiles.autoRecall.location", + "left": 136, + "top": 0, + "width": 35, + "height": 28, + "text": "" + } + ] } ] - } - ], - "left": 0, - "top": 0, - "width": 480, - "height": 272 - }, - { - "name": "user_profiles2", - "description": "User profiles information and settings page 2", - "style": "default", - "widgets": [ + }, { - "type": "List", + "type": "Grid", "style": { - "inheritFrom": "default", - "padding": 0 + "inheritFrom": "default" }, "activeStyle": { - "inheritFrom": "default", - "padding": 0 + "inheritFrom": "default" }, - "data": "profiles.list2", + "data": "profiles.list", "left": 8, - "top": 8, - "width": 464, - "height": 168, + "top": 54, + "width": 472, + "height": 180, "itemWidget": { - "type": "LayoutView", + "type": "Container", "style": { "inheritFrom": "default", "padding": 0 @@ -27025,13 +26930,48 @@ "inheritFrom": "default", "padding": 0 }, + "action": "show_user_profile_settings", "left": 0, "top": 0, - "width": 464, - "height": 28, - "layout": "profile" + "width": 236, + "height": 36, + "widgets": [ + { + "type": "Text", + "style": { + "inheritFrom": "edit_value_active_S_center" + }, + "activeStyle": { + "inheritFrom": "default" + }, + "data": "profile.label", + "action": "", + "left": 0, + "top": 0, + "width": 36, + "height": 28, + "text": "" + }, + { + "type": "Text", + "style": { + "inheritFrom": "edit_value_active_S_left", + "padding": 0 + }, + "activeStyle": { + "inheritFrom": "default", + "padding": 0 + }, + "data": "profile.remark", + "left": 36, + "top": 0, + "width": 192, + "height": 28, + "text": "" + } + ] }, - "listType": "vertical" + "gridFlow": "column" }, { "type": "Container", @@ -27075,45 +27015,9 @@ }, "left": 41, "top": 0, - "width": 343, - "height": 32, - "text": "User profiles (2)" - }, - { - "type": "Text", - "style": { - "inheritFrom": "bottom_button", - "font": "Heydings14", - "padding": 0 - }, - "activeStyle": { - "inheritFrom": "default", - "padding": 0 - }, - "action": "show_user_profiles", - "left": 384, - "top": 0, - "width": 48, - "height": 32, - "text": "(" - }, - { - "type": "Text", - "style": { - "inheritFrom": "bottom_button_disabled", - "font": "Heydings14", - "padding": 0 - }, - "activeStyle": { - "inheritFrom": "default", - "padding": 0 - }, - "action": "", - "left": 432, - "top": 0, - "width": 48, + "width": 438, "height": 32, - "text": ")" + "text": "User profiles" } ] } @@ -27697,68 +27601,6 @@ "width": 480, "height": 272 }, - { - "name": "profile", - "style": "default", - "widgets": [ - { - "type": "Container", - "style": { - "inheritFrom": "default", - "padding": 0 - }, - "activeStyle": { - "inheritFrom": "default", - "padding": 0 - }, - "left": 0, - "top": 0, - "width": 464, - "height": 28, - "widgets": [ - { - "type": "Text", - "style": { - "inheritFrom": "edit_S", - "padding": 0 - }, - "activeStyle": { - "inheritFrom": "default", - "padding": 0 - }, - "data": "profile.label", - "action": "show_user_profile_settings", - "left": 0, - "top": 0, - "width": 36, - "height": 28, - "text": "" - }, - { - "type": "Text", - "style": { - "inheritFrom": "edit_value_S_left", - "padding": 0 - }, - "activeStyle": { - "inheritFrom": "default", - "padding": 0 - }, - "data": "profile.remark", - "left": 36, - "top": 0, - "width": 428, - "height": 28, - "text": "" - } - ] - } - ], - "left": 0, - "top": 0, - "width": 464, - "height": 28 - }, { "name": "profile_basic_info", "description": "", diff --git a/src/eez/apps/psu/gui/data.cpp b/src/eez/apps/psu/gui/data.cpp index c0d3e5649..2e2e497eb 100644 --- a/src/eez/apps/psu/gui/data.cpp +++ b/src/eez/apps/psu/gui/data.cpp @@ -790,9 +790,6 @@ Page *getUserProfilesPage() { if (!page) { page = getPage(PAGE_ID_USER_PROFILES); } - if (!page) { - page = getPage(PAGE_ID_USER_PROFILES2); - } return page; } @@ -2848,17 +2845,9 @@ void data_set_page_dirty(data::DataOperationEnum operation, data::Cursor &cursor } } -void data_profiles_list1(data::DataOperationEnum operation, data::Cursor &cursor, data::Value &value) { - if (operation == data::DATA_OPERATION_COUNT) { - value = 4; - } -} - -void data_profiles_list2(data::DataOperationEnum operation, data::Cursor &cursor, data::Value &value) { +void data_profiles_list(data::DataOperationEnum operation, data::Cursor &cursor, data::Value &value) { if (operation == data::DATA_OPERATION_COUNT) { - value = 6; - } else if (operation == data::DATA_OPERATION_SELECT) { - cursor.i = 4 + value.getInt(); + value = 10; } } diff --git a/src/eez/apps/psu/gui/psu.cpp b/src/eez/apps/psu/gui/psu.cpp index 699c5a241..888a3fb57 100644 --- a/src/eez/apps/psu/gui/psu.cpp +++ b/src/eez/apps/psu/gui/psu.cpp @@ -114,9 +114,12 @@ void PsuAppContext::stateManagment() { #if GUI_BACK_TO_MAIN_ENABLED uint32_t inactivityPeriod = psu::idle::getGuiAndEncoderInactivityPeriod(); - if (activePageId == PAGE_ID_EVENT_QUEUE || activePageId == PAGE_ID_USER_PROFILES || - activePageId == PAGE_ID_USER_PROFILES2 || activePageId == PAGE_ID_USER_PROFILE_0_SETTINGS || - activePageId == PAGE_ID_USER_PROFILE_SETTINGS) { + if ( + activePageId == PAGE_ID_EVENT_QUEUE || + activePageId == PAGE_ID_USER_PROFILES || + activePageId == PAGE_ID_USER_PROFILE_0_SETTINGS || + activePageId == PAGE_ID_USER_PROFILE_SETTINGS + ) { if (inactivityPeriod >= GUI_BACK_TO_MAIN_DELAY * 1000UL) { showPage(PAGE_ID_MAIN); } @@ -206,16 +209,6 @@ void PsuAppContext::onPageChanged() { animateSlideDown(); } else if (activePageId == PAGE_ID_MAIN) { animateSlideUp(); - } else if (activePageId == PAGE_ID_USER_PROFILES2) { - animateSlideLeft(); - } - } else if (m_previousPageId == PAGE_ID_USER_PROFILES2) { - if (activePageId == PAGE_ID_USER_PROFILE_SETTINGS) { - animateSlideDown(); - } else if (activePageId == PAGE_ID_MAIN) { - animateSlideUp(); - } else if (activePageId == PAGE_ID_USER_PROFILES) { - animateSlideRight(); } } else if (m_previousPageId == PAGE_ID_USER_PROFILE_0_SETTINGS) { if (activePageId == PAGE_ID_MAIN) { @@ -228,8 +221,6 @@ void PsuAppContext::onPageChanged() { animateSlideUp(); } else if (activePageId == PAGE_ID_USER_PROFILES) { animateSlideUp(); - } else if (activePageId == PAGE_ID_USER_PROFILES2) { - animateSlideUp(); } } else if (m_previousPageId == PAGE_ID_SYS_INFO) { if (activePageId == PAGE_ID_MAIN) { diff --git a/src/eez/gui/action_impl.cpp b/src/eez/gui/action_impl.cpp index d9431159c..5c0c5b9da 100644 --- a/src/eez/gui/action_impl.cpp +++ b/src/eez/gui/action_impl.cpp @@ -477,10 +477,6 @@ void action_show_user_profiles() { showPage(PAGE_ID_USER_PROFILES); } -void action_show_user_profiles2() { - showPage(PAGE_ID_USER_PROFILES2); -} - void action_show_user_profile_settings() { ((UserProfilesPage *)getActivePage())->showProfile(); } diff --git a/src/eez/gui/widgets/grid.cpp b/src/eez/gui/widgets/grid.cpp index 2020ecb4b..c1b746728 100644 --- a/src/eez/gui/widgets/grid.cpp +++ b/src/eez/gui/widgets/grid.cpp @@ -73,15 +73,29 @@ void GridWidget_enum(WidgetCursor &widgetCursor, EnumWidgetsCallback callback) { enumWidget(widgetCursor, callback); - if (xOffset + childWidget->w < parentWidget->w) { - xOffset += childWidget->w; + if (gridWidget->gridFlow == GRID_FLOW_ROW) { + if (xOffset + childWidget->w < parentWidget->w) { + xOffset += childWidget->w; + } else { + if (yOffset + childWidget->h < parentWidget->h) { + yOffset += childWidget->h; + xOffset = 0; + } else { + // TODO: add vertical scroll + break; + } + } } else { if (yOffset + childWidget->h < parentWidget->h) { yOffset += childWidget->h; - xOffset = 0; } else { - // TODO: add horizontal scroll - break; + if (xOffset + childWidget->w < parentWidget->w) { + yOffset = 0; + xOffset += childWidget->w; + } else { + // TODO: add horizontal scroll + break; + } } } diff --git a/src/eez/gui/widgets/grid.h b/src/eez/gui/widgets/grid.h index b076b6694..fe83dfd97 100644 --- a/src/eez/gui/widgets/grid.h +++ b/src/eez/gui/widgets/grid.h @@ -23,7 +23,11 @@ namespace eez { namespace gui { +#define GRID_FLOW_ROW 1 +#define GRID_FLOW_COLUMN 2 + struct GridWidget { + uint8_t gridFlow; // GRID_FLOW_ROW or GRID_FLOW_COLUMN #if OPTION_SDRAM const Widget *itemWidget; #else diff --git a/src/eez/index.cpp b/src/eez/index.cpp index f3831232b..5811bdd49 100644 --- a/src/eez/index.cpp +++ b/src/eez/index.cpp @@ -289,7 +289,6 @@ Page *getPageFromId(int pageId) { page = &g_SysSettingsSerialPage; break; case PAGE_ID_USER_PROFILES: - case PAGE_ID_USER_PROFILES2: case PAGE_ID_USER_PROFILE_0_SETTINGS: case PAGE_ID_USER_PROFILE_SETTINGS: page = &g_UserProfilesPage; diff --git a/src/eez/modules/dcpX05/ioexp.cpp b/src/eez/modules/dcpX05/ioexp.cpp index e8563c5d0..8b95bb49d 100644 --- a/src/eez/modules/dcpX05/ioexp.cpp +++ b/src/eez/modules/dcpX05/ioexp.cpp @@ -72,7 +72,7 @@ static const uint8_t REG_VALUE_DEFVALB = 0B00000000; // static const uint8_t REG_VALUE_INTCONA = 0B00100000; // compare HW OVP Fault value with default value static const uint8_t REG_VALUE_INTCONB = 0B00000000; // static const uint8_t REG_VALUE_IOCON = 0B00100000; // sequential operation disabled, hw addressing disabled -static const uint8_t REG_VALUE_GPPUA = 0B00000000; // pull up with 100K resistor pins 1 (CC) and 2 (CV) +static const uint8_t REG_VALUE_GPPUA = 0B00100001; // pull up with 100K static const uint8_t REG_VALUE_GPPUB = 0B00000000; // static const uint8_t DCP505_REG_VALUE_GPIOA = 0B00100000; // disable OVP diff --git a/src/third_party/stm32_r1b5/.settings/language.settings.xml b/src/third_party/stm32_r1b5/.settings/language.settings.xml index 1eec3ce78..b010eb478 100644 --- a/src/third_party/stm32_r1b5/.settings/language.settings.xml +++ b/src/third_party/stm32_r1b5/.settings/language.settings.xml @@ -4,7 +4,7 @@ - + diff --git a/src/third_party/stm32_r1b5_cubeide/.cproject b/src/third_party/stm32_r1b5_cubeide/.cproject index f19774ab7..896cbaf6d 100644 --- a/src/third_party/stm32_r1b5_cubeide/.cproject +++ b/src/third_party/stm32_r1b5_cubeide/.cproject @@ -39,6 +39,8 @@