Skip to content

Commit

Permalink
create stable uid's for timers
Browse files Browse the repository at this point in the history
  • Loading branch information
pipelka committed Mar 21, 2014
1 parent 7f49bfa commit 86b1113
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/tools/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,14 @@ const cChannel* FindChannelByUID(uint32_t channelUID) {
}

uint32_t CreateTimerUID(const cTimer* timer) {
cString channelid = timer->ToText(true);
return CreateStringHash(channelid);
cString timerid = cString::sprintf("%s:%s:%04d:%04d:%s",
*timer->Channel()->GetChannelID().ToString(),
*timer->PrintDay(timer->Day(), timer->WeekDays(), true),
timer->Start(),
timer->Stop(),
timer->File());

return CreateStringHash(timerid);
}

cTimer* FindTimerByUID(uint32_t timerUID) {
Expand Down

0 comments on commit 86b1113

Please sign in to comment.