Skip to content

Commit

Permalink
fixed profile save
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Jul 19, 2019
1 parent a5cf720 commit 6ddd7f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
7 changes: 1 addition & 6 deletions src/eez/apps/psu/gui/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2907,12 +2907,7 @@ void data_channel_list_count(data::DataOperationEnum operation, data::Cursor &cu

void data_channel_lists(data::DataOperationEnum operation, data::Cursor &cursor,
data::Value &value) {
if (operation == data::DATA_OPERATION_GET) {
ChSettingsListsPage *page = (ChSettingsListsPage *)getPage(PAGE_ID_CH_SETTINGS_LISTS);
if (page) {
value = data::Value(page->m_listVersion);
}
} else if (operation == data::DATA_OPERATION_COUNT) {
if (operation == data::DATA_OPERATION_COUNT) {
value = LIST_ITEMS_PER_PAGE;
} else if (operation == data::DATA_OPERATION_GET_FLOAT_LIST_LENGTH) {
ChSettingsListsPage *page = (ChSettingsListsPage *)getPage(PAGE_ID_CH_SETTINGS_LISTS);
Expand Down
5 changes: 3 additions & 2 deletions src/eez/apps/psu/profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ void doSave() {
}

void save(bool immediately) {
if (g_saveEnabled) {
if (g_saveEnabled && isAutoSaveAllowed()) {
if (immediately) {
doSave();
g_profileDirty = false;
Expand All @@ -329,7 +329,7 @@ void save(bool immediately) {
}

void tick() {
if (g_profileDirty && isAutoSaveAllowed() && !list::isActive() && !calibration::isEnabled() && idle::isIdle()) {
if (g_profileDirty && !list::isActive() && !calibration::isEnabled() && idle::isIdle()) {
doSave();
g_profileDirty = false;
}
Expand Down Expand Up @@ -365,6 +365,7 @@ bool recall(int location) {
if (persist_conf::loadProfile(location, &profile) && profile.flags.isValid) {
if (persist_conf::saveProfile(0, &profile)) {
if (recallFromProfile(&profile, location)) {
save();
event_queue::pushEvent(event_queue::EVENT_INFO_RECALL_FROM_PROFILE_0 + location);
return true;
} else {
Expand Down

0 comments on commit 6ddd7f5

Please sign in to comment.