Skip to content

Commit 6ddd7f5

Browse files
committed
fixed profile save
1 parent a5cf720 commit 6ddd7f5

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/eez/apps/psu/gui/data.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2907,12 +2907,7 @@ void data_channel_list_count(data::DataOperationEnum operation, data::Cursor &cu
29072907

29082908
void data_channel_lists(data::DataOperationEnum operation, data::Cursor &cursor,
29092909
data::Value &value) {
2910-
if (operation == data::DATA_OPERATION_GET) {
2911-
ChSettingsListsPage *page = (ChSettingsListsPage *)getPage(PAGE_ID_CH_SETTINGS_LISTS);
2912-
if (page) {
2913-
value = data::Value(page->m_listVersion);
2914-
}
2915-
} else if (operation == data::DATA_OPERATION_COUNT) {
2910+
if (operation == data::DATA_OPERATION_COUNT) {
29162911
value = LIST_ITEMS_PER_PAGE;
29172912
} else if (operation == data::DATA_OPERATION_GET_FLOAT_LIST_LENGTH) {
29182913
ChSettingsListsPage *page = (ChSettingsListsPage *)getPage(PAGE_ID_CH_SETTINGS_LISTS);

src/eez/apps/psu/profile.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ void doSave() {
318318
}
319319

320320
void save(bool immediately) {
321-
if (g_saveEnabled) {
321+
if (g_saveEnabled && isAutoSaveAllowed()) {
322322
if (immediately) {
323323
doSave();
324324
g_profileDirty = false;
@@ -329,7 +329,7 @@ void save(bool immediately) {
329329
}
330330

331331
void tick() {
332-
if (g_profileDirty && isAutoSaveAllowed() && !list::isActive() && !calibration::isEnabled() && idle::isIdle()) {
332+
if (g_profileDirty && !list::isActive() && !calibration::isEnabled() && idle::isIdle()) {
333333
doSave();
334334
g_profileDirty = false;
335335
}
@@ -365,6 +365,7 @@ bool recall(int location) {
365365
if (persist_conf::loadProfile(location, &profile) && profile.flags.isValid) {
366366
if (persist_conf::saveProfile(0, &profile)) {
367367
if (recallFromProfile(&profile, location)) {
368+
save();
368369
event_queue::pushEvent(event_queue::EVENT_INFO_RECALL_FROM_PROFILE_0 + location);
369370
return true;
370371
} else {

0 commit comments

Comments
 (0)