diff options
author | Norbert Preining <norbert@preining.info> | 2020-10-12 03:04:00 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-10-12 03:04:00 +0000 |
commit | 0ce40abb18ec02ec6fd6bcc5f21612c88daa7578 (patch) | |
tree | 416289fe1448873fd8ca33051f50ad85bffa8aaa /support/dktools/DkClockData.cpp | |
parent | fdb18507cd80dc17f5a5256153d34668b4f4e61c (diff) |
CTAN sync 202010120303
Diffstat (limited to 'support/dktools/DkClockData.cpp')
-rw-r--r-- | support/dktools/DkClockData.cpp | 217 |
1 files changed, 0 insertions, 217 deletions
diff --git a/support/dktools/DkClockData.cpp b/support/dktools/DkClockData.cpp deleted file mode 100644 index 53d10c12d3..0000000000 --- a/support/dktools/DkClockData.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/* -Copyright (C) 2017-2020, Dirk Krause -SPDX-License-Identifier: BSD-3-Clause -*/ - -/* - WARNING: This file was generated by the dkct program (see - http://dktools.sourceforge.net/ for details). - Changes you make here will be lost if dkct is run again! - You should modify the original source and run dkct on it. - Original source: DkClockData.cpt -*/ - -/** @file DkClockData.cpp The DkClockData module. -*/ - - -#line 88 "DkClockData.cpt" - -#include "dk3conf.h" -#include "wxdkclock.h" - - - - -#line 94 "DkClockData.cpt" - - -DkClockData::DkClockData() -{ - - -#line 99 "DkClockData.cpt" - clvd.h = 0; - clvd.m = 0; - clvd.s = 0; - clvd.a = 0; - iAlertHour = 0; - iAlertMinute = 0; - iAlertEnabled = 0; - iAlertState = 0; - tmCurrent.Y = 0; - tmCurrent.M = 0; - tmCurrent.D = 0; - tmCurrent.h = 0; - tmCurrent.m = 0; - tmCurrent.s = 0; - - -#line 114 "DkClockData.cpt" -} - - - -void -DkClockData::getData(clockview_data_t *dptr) -{ - - -#line 122 "DkClockData.cpt" - if(dptr) { - wxMutexLocker lock(mxProtectData); - dk3mem_cpy((void *)dptr, (void *)(&clvd), sizeof(clockview_data_t)); - } - - -#line 127 "DkClockData.cpt" -} - - - -int -DkClockData::setTime(dk3_time_t *ct) -{ - dk3_tm_t lct; - int back = 0; - - -#line 137 "DkClockData.cpt" - if(dk3sf_localtime_app(&lct, ct, NULL)) { - wxMutexLocker lock(mxProtectData); - /* - Check date change. - */ - if(2 == iAlertState) { - if(lct.Y != tmCurrent.Y) { - iAlertState = 0; - } else { - if(lct.M != tmCurrent.M) { - iAlertState = 0; - } else { - if(lct.D != tmCurrent.D) { - iAlertState = 0; - } - } - } - } - /* - Check alert state change. - */ - if((0 != iAlertEnabled) && (0 == iAlertState)) { - if(lct.h > iAlertHour) { - iAlertState = 1; back = 1; - } else { - if(lct.h == iAlertHour) { - if(lct.m >= iAlertMinute) { - iAlertState = 1; back = 1; - } - } - } - } - /* - Copy current time. - */ - dk3mem_cpy((void *)(&tmCurrent), (void *)(&lct), sizeof(dk3_tm_t)); - /* - Copy to output structure. - */ - clvd.h = lct.h; - clvd.m = lct.m; - clvd.s = lct.s; - clvd.a = ((1 == iAlertState) ? 1 : 0); - } - -#line 181 "DkClockData.cpt" - return back; -} - - - -void -DkClockData::setAlert(bool flag, int hour, int min) -{ - - -#line 190 "DkClockData.cpt" - iAlertState = 0; - { - wxMutexLocker lock(mxProtectData); - if(flag) { - -#line 194 "DkClockData.cpt" - if((0 <= hour) && (23 >= hour) && (0 <= min) && (59 >= min)) { - iAlertEnabled = 1; - -#line 196 "DkClockData.cpt" - iAlertHour = hour; - iAlertMinute = min; - if(tmCurrent.h > hour) { - iAlertState = 2; - } else { - if(tmCurrent.h == hour) { - if(tmCurrent.m >= min) { - iAlertState = 2; - } - } - } - } else { - -#line 208 "DkClockData.cpt" - iAlertEnabled = 0; - iAlertHour = 0; - iAlertMinute = 0; - } - } else { - -#line 213 "DkClockData.cpt" - iAlertEnabled = 0; - iAlertHour = 0; - iAlertMinute = 0; - } - } - -#line 218 "DkClockData.cpt" -} - - - -void -DkClockData::endAlert(void) -{ - - -#line 226 "DkClockData.cpt" - { - wxMutexLocker lock(mxProtectData); - if(1 == iAlertState) { - iAlertState = 2; - } - } - -#line 232 "DkClockData.cpt" -} - - - -void -DkClockData::getAlertData(int *en, int *h, int *m) -{ - - -#line 240 "DkClockData.cpt" - if((en) && (h) && (m)) { - wxMutexLocker lock(mxProtectData); - *en = iAlertEnabled; - -#line 243 "DkClockData.cpt" - *h = iAlertHour; - -#line 244 "DkClockData.cpt" - *m = iAlertMinute; - -#line 245 "DkClockData.cpt" - } - -#line 246 "DkClockData.cpt" -} |