Skip to content

Commit

Permalink
single user profiles page
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Oct 14, 2019
1 parent 71d2fd9 commit 90b3004
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 304 deletions.
366 changes: 104 additions & 262 deletions modular-psu-firmware.eez-project

Large diffs are not rendered by default.

15 changes: 2 additions & 13 deletions src/eez/apps/psu/gui/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,9 +790,6 @@ Page *getUserProfilesPage() {
if (!page) {
page = getPage(PAGE_ID_USER_PROFILES);
}
if (!page) {
page = getPage(PAGE_ID_USER_PROFILES2);
}
return page;
}

Expand Down Expand Up @@ -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;
}
}

Expand Down
21 changes: 6 additions & 15 deletions src/eez/apps/psu/gui/psu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down
4 changes: 0 additions & 4 deletions src/eez/gui/action_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
24 changes: 19 additions & 5 deletions src/eez/gui/widgets/grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/eez/gui/widgets/grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/eez/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/eez/modules/dcpX05/ioexp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/third_party/stm32_r1b5/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="-1346926534290759488" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="-1085687496758362492" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
4 changes: 4 additions & 0 deletions src/third_party/stm32_r1b5_cubeide/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.2114599218" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.2099938454" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
<listOptionValue builtIn="false" value="__weak=__attribute__((weak))"/>
<listOptionValue builtIn="false" value="__packed=__attribute__((__packed__))"/>
<listOptionValue builtIn="false" value="STM32F769xx"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="EEZ_BP3C_REVISION_R3B1=1"/>
Expand Down Expand Up @@ -96,6 +98,8 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.353999828" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols.1251341370" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
<listOptionValue builtIn="false" value="__weak=__attribute__((weak))"/>
<listOptionValue builtIn="false" value="__packed=__attribute__((__packed__))"/>
<listOptionValue builtIn="false" value="STM32F769xx"/>
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="EEZ_BP3C_REVISION_R3B1=1"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="182303503271802531" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="1052215446472245763" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand All @@ -18,7 +18,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="182303503271802531" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="1052215446472245763" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down

0 comments on commit 90b3004

Please sign in to comment.