Skip to content

Commit

Permalink
date time format
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Feb 25, 2020
1 parent 669f8ea commit 7c92b6e
Show file tree
Hide file tree
Showing 24 changed files with 134,102 additions and 133,594 deletions.
1,092 changes: 600 additions & 492 deletions modular-psu-firmware.eez-project

Large diffs are not rendered by default.

45 changes: 39 additions & 6 deletions src/eez/gui/action_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,14 @@ void action_date_time_select_dst_rule() {
((SysSettingsDateTimePage *)getActivePage())->selectDstRule();
}

void action_date_time_select_format() {
((SysSettingsDateTimePage *)getActivePage())->selectFormat();
}

void action_date_time_toggle_am_pm() {
((SysSettingsDateTimePage *)getActivePage())->toggleAmPm();
}

void action_show_user_profiles() {
showPage(PAGE_ID_USER_PROFILES);
}
Expand Down Expand Up @@ -833,7 +841,7 @@ void action_stand_by() {

void action_restart() {
popPage();
yesNoDialog(PAGE_ID_YES_NO, "Do you want to reset?", eez::restart, nullptr, nullptr);
yesNoDialog(PAGE_ID_YES_NO, "Do you want to restart?", eez::restart, nullptr, nullptr);
}

void action_shutdown() {
Expand Down Expand Up @@ -1158,11 +1166,36 @@ void action_dlog_start_recording() {
if (isStringEmpty(dlog_record::g_guiParameters.filePath)) {
uint8_t year, month, day, hour, minute, second;
datetime::getDateTime(year, month, day, hour, minute, second);
sprintf(filePath, "%s/%s%d_%02d_%02d-%02d_%02d_%02d.dlog",
RECORDINGS_DIR,
dlog_record::g_guiParameters.filePath,
(int)(year + 2000), (int)month, (int)day,
(int)hour, (int)minute, (int)second);

if (persist_conf::devConf.dateTimeFormat == datetime::FORMAT_DMY_24) {
sprintf(filePath, "%s/%s%02d_%02d_%02d-%02d_%02d_%02d.dlog",
RECORDINGS_DIR,
dlog_record::g_guiParameters.filePath,
(int)day, (int)month, (int)year,
(int)hour, (int)minute, (int)second);
} else if (persist_conf::devConf.dateTimeFormat == datetime::FORMAT_MDY_24) {
sprintf(filePath, "%s/%s%02d_%02d_%02d-%02d_%02d_%02d.dlog",
RECORDINGS_DIR,
dlog_record::g_guiParameters.filePath,
(int)month, (int)day, (int)year,
(int)hour, (int)minute, (int)second);
} else if (persist_conf::devConf.dateTimeFormat == datetime::FORMAT_DMY_12) {
bool am;
datetime::convertTime24to12(hour, am);
sprintf(filePath, "%s/%s%02d_%02d_%02d-%02d_%02d_%02d_%s.dlog",
RECORDINGS_DIR,
dlog_record::g_guiParameters.filePath,
(int)day, (int)month, (int)year,
(int)hour, (int)minute, (int)second, am ? "AM" : "PM");
} else if (persist_conf::devConf.dateTimeFormat == datetime::FORMAT_MDY_12) {
bool am;
datetime::convertTime24to12(hour, am);
sprintf(filePath, "%s/%s%02d_%02d_%02d-%02d_%02d_%02d_%s.dlog",
RECORDINGS_DIR,
dlog_record::g_guiParameters.filePath,
(int)month, (int)day, (int)year,
(int)hour, (int)minute, (int)second, am ? "AM" : "PM");
}
} else {
sprintf(filePath, "%s/%s.dlog", RECORDINGS_DIR, dlog_record::g_guiParameters.filePath);
}
Expand Down
152,735 changes: 76,379 additions & 76,356 deletions src/eez/gui/document_simulator.cpp

Large diffs are not rendered by default.

Loading

0 comments on commit 7c92b6e

Please sign in to comment.