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.

20 changes: 16 additions & 4 deletions src/eez/gui/document_simulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,11 @@ enum DataEnum {
DATA_ID_FILE_MANAGER_STORAGE_ALARM = 362,
DATA_ID_EVENT_QUEUE_IS_LONG_MESSAGE_TEXT = 363,
DATA_ID_EVENT_QUEUE_EVENT_LONG_MESSAGE_OVERLAY = 364,
DATA_ID_EVENT_QUEUE_EVENT_IS_SELECTED = 365
DATA_ID_EVENT_QUEUE_EVENT_IS_SELECTED = 365,
DATA_ID_DATE_TIME_FORMAT = 366,
DATA_ID_DATE_TIME_FORMAT_IS_DMY = 367,
DATA_ID_DATE_TIME_FORMAT_IS_24H = 368,
DATA_ID_DATE_TIME_AM_PM = 369
};

void data_none(DataOperationEnum operation, Cursor &cursor, Value &value);
Expand Down Expand Up @@ -733,6 +737,10 @@ void data_file_manager_storage_alarm(DataOperationEnum operation, Cursor &cursor
void data_event_queue_is_long_message_text(DataOperationEnum operation, Cursor &cursor, Value &value);
void data_event_queue_event_long_message_overlay(DataOperationEnum operation, Cursor &cursor, Value &value);
void data_event_queue_event_is_selected(DataOperationEnum operation, Cursor &cursor, Value &value);
void data_date_time_format(DataOperationEnum operation, Cursor &cursor, Value &value);
void data_date_time_format_is_dmy(DataOperationEnum operation, Cursor &cursor, Value &value);
void data_date_time_format_is_24h(DataOperationEnum operation, Cursor &cursor, Value &value);
void data_date_time_am_pm(DataOperationEnum operation, Cursor &cursor, Value &value);

typedef void (*DataOperationsFunction)(DataOperationEnum operation, Cursor &cursor, Value &value);

Expand Down Expand Up @@ -958,7 +966,9 @@ enum ActionsEnum {
ACTION_ID_PROFILE_IMPORT = 216,
ACTION_ID_PROFILE_EXPORT = 217,
ACTION_ID_EVENT_QUEUE_FILTER = 218,
ACTION_ID_EVENT_QUEUE_SELECT_EVENT = 219
ACTION_ID_EVENT_QUEUE_SELECT_EVENT = 219,
ACTION_ID_DATE_TIME_SELECT_FORMAT = 220,
ACTION_ID_DATE_TIME_TOGGLE_AM_PM = 221
};

void action_channel_toggle_output();
Expand Down Expand Up @@ -1180,6 +1190,8 @@ void action_profile_import();
void action_profile_export();
void action_event_queue_filter();
void action_event_queue_select_event();
void action_date_time_select_format();
void action_date_time_toggle_am_pm();

extern ActionExecFunc g_actionExecFunctions[];

Expand Down Expand Up @@ -1582,7 +1594,7 @@ enum PagesEnum {
};

#ifdef OPTION_SDRAM
extern const uint8_t assets[394176];
extern const uint8_t assets[394438];
#else
extern const uint8_t assets[3864888];
extern const uint8_t assets[3864892];
#endif
Loading

0 comments on commit 7c92b6e

Please sign in to comment.