Skip to content

Commit

Permalink
event_queue and display settings page fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Mar 26, 2020
1 parent 1765413 commit 3786706
Show file tree
Hide file tree
Showing 9 changed files with 42,408 additions and 42,394 deletions.
186 changes: 93 additions & 93 deletions modular-psu-firmware.eez-project
Original file line number Diff line number Diff line change
Expand Up @@ -25283,6 +25283,78 @@
"height": 168,
"name": "Content",
"widgets": [
{
"type": "Text",
"style": {
"inheritFrom": "edit_value_S_left"
},
"left": 12,
"top": 14,
"width": 58,
"height": 28,
"text": "Theme:"
},
{
"type": "Text",
"style": {
"inheritFrom": "edit_value_active_S_center"
},
"data": "selected_theme",
"action": "select_theme",
"left": 71,
"top": 14,
"width": 141,
"height": 28,
"text": ""
},
{
"type": "Text",
"style": {
"inheritFrom": "edit_value_S_left"
},
"left": 12,
"top": 50,
"width": 123,
"height": 28,
"text": "Anim. duration:"
},
{
"type": "DisplayData",
"style": {
"inheritFrom": "edit_value_active_S_center"
},
"data": "animations_duration",
"action": "edit_animations_duration",
"left": 135,
"top": 50,
"width": 77,
"height": 28,
"displayOption": 0
},
{
"type": "Text",
"style": {
"inheritFrom": "edit_value_active_S_center"
},
"action": "show_sys_settings_screen_calibration",
"left": 12,
"top": 92,
"width": 200,
"height": 28,
"text": "Touchscreen calibration"
},
{
"type": "Text",
"style": {
"inheritFrom": "edit_value_active_S_center"
},
"action": "turn_display_off",
"left": 12,
"top": 128,
"width": 200,
"height": 28,
"text": "Turn display off"
},
{
"type": "Text",
"style": {
Expand Down Expand Up @@ -25355,36 +25427,25 @@
{
"type": "Text",
"style": {
"inheritFrom": "edit_value_S_left"
"inheritFrom": "edit_value_active_S_center"
},
"left": 316,
"top": 84,
"width": 84,
"height": 28,
"text": "Status"
"left": 232,
"top": 112,
"width": 58,
"height": 34,
"text": "@",
"ignoreLuminocity": true
},
{
"type": "Text",
"style": {
"inheritFrom": "edit_value_S_left"
},
"left": 400,
"left": 316,
"top": 84,
"width": 68,
"width": 84,
"height": 28,
"text": "Pop up"
},
{
"type": "Text",
"style": {
"inheritFrom": "edit_value_active_S_center"
},
"left": 232,
"top": 112,
"width": 58,
"height": 34,
"text": "@",
"ignoreLuminocity": true
"text": "Status"
},
{
"type": "Text",
Expand All @@ -25410,6 +25471,17 @@
"text": "@",
"ignoreLuminocity": true
},
{
"type": "Text",
"style": {
"inheritFrom": "edit_value_S_left"
},
"left": 400,
"top": 84,
"width": 68,
"height": 28,
"text": "Pop up"
},
{
"type": "Text",
"style": {
Expand All @@ -25433,78 +25505,6 @@
"text": "@",
"ignoreLuminocity": true
},
{
"type": "Text",
"style": {
"inheritFrom": "edit_value_S_left"
},
"left": 12,
"top": 14,
"width": 58,
"height": 28,
"text": "Theme:"
},
{
"type": "Text",
"style": {
"inheritFrom": "edit_value_active_S_center"
},
"data": "selected_theme",
"action": "select_theme",
"left": 71,
"top": 14,
"width": 141,
"height": 28,
"text": ""
},
{
"type": "Text",
"style": {
"inheritFrom": "edit_value_S_left"
},
"left": 12,
"top": 44,
"width": 123,
"height": 28,
"text": "Anim. duration:"
},
{
"type": "DisplayData",
"style": {
"inheritFrom": "edit_value_active_S_center"
},
"data": "animations_duration",
"action": "edit_animations_duration",
"left": 135,
"top": 44,
"width": 77,
"height": 28,
"displayOption": 0
},
{
"type": "Text",
"style": {
"inheritFrom": "edit_value_active_S_center"
},
"action": "show_sys_settings_screen_calibration",
"left": 12,
"top": 92,
"width": 200,
"height": 28,
"text": "Touchscreen calibration"
},
{
"type": "Text",
"style": {
"inheritFrom": "edit_value_active_S_center"
},
"action": "turn_display_off",
"left": 12,
"top": 128,
"width": 200,
"height": 28,
"text": "Turn display off"
},
{
"type": "Rectangle",
"style": {
Expand Down
7 changes: 7 additions & 0 deletions src/eez/gui/app_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ Page *AppContext::getActivePage() {
return m_pageNavigationStack[getActivePageStackPointer()].page;
}

int AppContext::getPreviousPageId() {
if (getActivePageStackPointer() == 0) {
return PAGE_ID_NONE;
}
return m_pageNavigationStack[getActivePageStackPointer() - 1].pageId;
}

void AppContext::onPageChanged(int previousPageId, int activePageId) {
eez::mcu::display::turnOn();
psu::idle::noteHmiActivity();
Expand Down
2 changes: 2 additions & 0 deletions src/eez/gui/app_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class AppContext {

bool isActivePageInternal();

int getPreviousPageId();

void replacePage(int pageId, Page *page = nullptr);

Page *getPage(int pageId);
Expand Down
Loading

0 comments on commit 3786706

Please sign in to comment.