Skip to content

Commit a474488

Browse files
committed
profiles handling redesign
1 parent bed94f7 commit a474488

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+122050
-122254
lines changed

modular-psu-firmware.eez-project

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,11 +1487,6 @@
14871487
"type": "string",
14881488
"defaultValue": "Default"
14891489
},
1490-
{
1491-
"name": "profile_dirty",
1492-
"type": "boolean",
1493-
"defaultValue": "1"
1494-
},
14951490
{
14961491
"name": "channel_title",
14971492
"type": "string",
@@ -17352,7 +17347,7 @@
1735217347
"action": "channel_lists_clear_column",
1735317348
"left": 12,
1735417349
"top": 44,
17355-
"width": 292,
17350+
"width": 304,
1735617351
"height": 32,
1735717352
"text": "Clear column from cursor down",
1735817353
"enabled": "channel_lists_clear_column_enabled",
@@ -17397,9 +17392,9 @@
1739717392
}
1739817393
],
1739917394
"closePageIfTouchedOutside": true,
17400-
"left": 123,
17395+
"left": 119,
1740117396
"top": 88,
17402-
"width": 316,
17397+
"width": 324,
1740317398
"height": 152
1740417399
},
1740517400
{
@@ -21308,7 +21303,8 @@
2130821303
{
2130921304
"type": "MultilineText",
2131021305
"style": {
21311-
"inheritFrom": "icon_and_text_S"
21306+
"inheritFrom": "icon_and_text_S",
21307+
"alignHorizontal": "center"
2131221308
},
2131321309
"data": "",
2131421310
"action": "edit_system_password",

src/eez/firmware.cpp

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -273,17 +273,14 @@ bool testMaster() {
273273
bool test() {
274274
bool testResult = true;
275275

276-
psu::profile::saveAtLocation(10);
277-
bool wasSaveProfileEnabled = psu::profile::enableSave(false);
276+
psu::profile::saveToLocation(10);
278277
psu::psuReset();
279278

280279
testResult &= testMaster();
281280

282281
testResult &= psu::testChannels();
283282

284-
psu::profile::enableSave(wasSaveProfileEnabled);
285-
int err;
286-
psu::profile::recall(10, &err);
283+
psu::profile::recallFromLocation(10);
287284

288285
if (!testResult) {
289286
sound::playBeep();
@@ -300,12 +297,7 @@ bool reset() {
300297
return true;
301298
}
302299

303-
if (psuReset()) {
304-
profile::save();
305-
return true;
306-
}
307-
308-
return false;
300+
return psuReset();
309301
}
310302

311303
void standBy() {
@@ -332,12 +324,10 @@ void shutdown() {
332324

333325
g_shutdownInProgress = true;
334326

327+
profile::shutdownSave();
328+
335329
if (psu::isPowerUp()) {
336-
profile::saveIfDirty();
337-
profile::enableSave(false);
338330
psu::changePowerState(false);
339-
} else {
340-
profile::saveIfDirty();
341331
}
342332

343333
osDelay(50);

src/eez/gui/action_impl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,6 @@ void action_ch_settings_prot_toggle_type() {
420420
} else {
421421
selectChannel();
422422
channel_dispatcher::setOvpType(*g_channel, g_channel->prot_conf.flags.u_type ? 0 : 1);
423-
profile::save();
424423
}
425424
}
426425

@@ -502,11 +501,11 @@ void action_profile_toggle_is_auto_recall_location() {
502501
}
503502

504503
void action_profile_recall() {
505-
((UserProfilesPage *)getActivePage())->recall();
504+
((UserProfilesPage *)getActivePage())->recallProfile();
506505
}
507506

508507
void action_profile_save() {
509-
((UserProfilesPage *)getActivePage())->save();
508+
((UserProfilesPage *)getActivePage())->saveProfile();
510509
}
511510

512511
void action_profile_import() {

src/eez/gui/app_context.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ AppContext::AppContext() {
4848

4949
void AppContext::stateManagment() {
5050
// remove alert message after period of time
51-
uint32_t inactivityPeriod = psu::idle::getGuiAndEncoderInactivityPeriod();
51+
uint32_t inactivityPeriod = psu::idle::getHmiInactivityPeriod();
5252
if (getActivePageId() == INTERNAL_PAGE_ID_TOAST_MESSAGE) {
5353
ToastMessagePage *page = (ToastMessagePage *)getActivePage();
5454
if (!page->hasAction() && inactivityPeriod >= CONF_GUI_TOAST_DURATION_MS) {
@@ -131,7 +131,7 @@ Page *AppContext::getActivePage() {
131131

132132
void AppContext::onPageChanged(int previousPageId, int activePageId) {
133133
eez::mcu::display::turnOn();
134-
psu::idle::noteGuiActivity();
134+
psu::idle::noteHmiActivity();
135135
}
136136

137137
void AppContext::doShowPage(int pageId, Page *page, int previousPageId) {

src/eez/gui/data.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ struct Value {
153153
{
154154
}
155155

156-
typedef float (*YtDataGetValueFunctionPointer)(int rowIndex, int columnIndex, float *max);
156+
typedef float (*YtDataGetValueFunctionPointer)(uint32_t rowIndex, uint8_t columnIndex, float *max);
157157

158158
Value(YtDataGetValueFunctionPointer ytDataGetValueFunctionPointer)
159159
: type_(VALUE_TYPE_YT_DATA_GET_VALUE_FUNCTION_POINTER), pVoid_((void *)ytDataGetValueFunctionPointer)

src/eez/gui/document_simulator.cpp

Lines changed: 70858 additions & 70856 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)