virtual bool ivalidate( void ) { // Set the stop time to Now Stop.now(); // figure the elapsed time setHours(); return true; }
TimeStamp::TimeStamp(byte seconds, byte minutes, byte hours, byte dayOfWeek, byte day, byte month, byte year) { setSeconds(seconds); setMinutes(minutes); setHours(hours); setDayOfWeek(dayOfWeek); setDay(day); setMonth(month); setYear(year); }
Timer::Timer( int hours, int minutes, int seconds, QObject *parent ) : QObject( parent ) { setSeconds( seconds ); setMinutes( minutes ); setHours( hours ); time = new QTime( 0, 0, 0 ); timer = new QTimer( this ); }
virtual bool uvalidate( changeMap & changes ) { // if start or stop time were changed if( changes.find("Stop") != changes.end() || changes.find("Start") != changes.end() ) { setHours(); changes["Hours"]="Hours"; } return true; }
//_____________________________________ // Read user input and act on it bool controlMode( char ch ) { static int arg = -1; int retval = false; if (isdigit( ch )) { if (arg < 0) arg = 0; arg = arg * 10 + (ch - '0'); return false; } switch ( ch ) { // 'N' triggers the NTP protocol manually case 'N': case 'n': triggerNtp() ; retval = true ; break ; // Left-arrow (Less-Than) slows down the clock for simulation runs case '<': case ',': slowDown() ; retval = true ; break ; // Right-arrow (Greater-Than) speeds up the clock for simulation runs case '>': case '.': speedUp() ; retval = true ; break ; // PLUS advances the digital clock minute case '+': case '=': incMinutes() ; retval = true ; break ; // MINUS decrements the digital clock minute case '_': case '-': decMinutes() ; retval = true ; break ; // H, M, S set hours, minutes, seconds case 'H': case 'h': if (arg >= 0) setHours(arg); retval = true ; break ; case 'M': case 'm': if (arg >= 0) setMinutes(arg); retval = true ; break ; case 'S': case 's': if (arg >= 0) setSeconds(arg); syncTime() ; retval = true ; break ; // 'Z' resets the digital clock seconds case 'z': case 'Z': setSeconds(0) ; syncTime() ; return true ; // A, B and C manually force the A/B output pulses but do not affect the internal clock // A and B add to the force count for the A and B signals. C adds to both signals. case 'A': case 'a': if (arg < 0) arg = 1 ; sendPulsesA(arg) ; break ; case 'B': case 'b': if (arg < 0) arg = 1 ; sendPulsesB(arg) ; break ; case 'C': case 'c': if (arg < 0) arg = 1 ; sendPulsesA(arg) ; sendPulsesB(arg) ; break ; case 'D': case 'd': if (arg < 0) arg = 1 ; sendPulsesD(arg) ; break ; case 'E': case 'e': sendPulsesE(1) ; break ; case 'f': setState(LOW); break ; case 'F': setState(HIGH); break ; case 'I': case 'i': if (arg < 0) arg = 60*60; clockHold(arg, arg) ; break ; case 'U': case 'u': if (arg < 0) arg = 60*60; clockHold(arg, 0) ; break ; case 'V': case 'v': if (arg < 0) arg = 60*60; clockHold(0, arg) ; break ; default: break; } arg = -1; return retval ; }
void RealTimeClockDS1307::switchTo24h() { if(!is12hour()) { return ; } int h = getHours(); if(h==12) {//12 PM is just 12; 12 AM is 0 hours. h = 0; } if (isPM()) {//if it was 12 PM, then h=0 above and so we're back to 12: h = h+12; } set24h(); setHours(h); }
WeekdayListItem(Calendar *cal, int wd, QTreeWidget *parent, const QString& name, QTreeWidgetItem *after) : QTreeWidgetItem(parent, after), original(cal->weekday(wd)), calendar(cal), weekday(wd) { setText(0, name); day = new CalendarDay(original); if (day->state() == CalendarDay::NonWorking) { setHours(); } else { setText(1, KGlobal::locale()->formatNumber(day->duration().toDouble(Duration::Unit_h))); } }
void RealTimeClockDS1307::switchTo12h() { if(is12hour()) { return; } int h = getHours(); if (h < 12) { setAM(); } else { h = h-12; setPM(); } if (h==0) { h=12; } setHours(h); }
TimeCode::TimeCode (int hours, int minutes, int seconds, int frame, bool dropFrame, bool colorFrame, bool fieldPhase, bool bgf0, bool bgf1, bool bgf2, int binaryGroup1, int binaryGroup2, int binaryGroup3, int binaryGroup4, int binaryGroup5, int binaryGroup6, int binaryGroup7, int binaryGroup8) { setHours (hours); setMinutes (minutes); setSeconds (seconds); setFrame (frame); setDropFrame (dropFrame); setColorFrame (colorFrame); setFieldPhase (fieldPhase); setBgf0 (bgf0); setBgf1 (bgf1); setBgf2 (bgf2); setBinaryGroup (1, binaryGroup1); setBinaryGroup (2, binaryGroup2); setBinaryGroup (3, binaryGroup3); setBinaryGroup (4, binaryGroup4); setBinaryGroup (5, binaryGroup5); setBinaryGroup (6, binaryGroup6); setBinaryGroup (7, binaryGroup7); setBinaryGroup (8, binaryGroup8); }
HourlyWorker::HourlyWorker(const std::string& first, const std::string& last, const std::string& ssn, double hours, double wage) : Employee(first, last, ssn) { setHours(hours); setWage(wage); }
/** Setzt die Wortminuten, je nach hours/minutes. */ void Renderer::setMinutes(char hours, byte minutes, byte language, word matrix[16]) { while (hours < 0) { hours += 24; } while (hours > 23) { hours -= 24; } switch (language) { #ifdef ENABLE_LANGUAGE_DE // // Deutsch: Hochdeutsch // case LANGUAGE_DE_DE: case LANGUAGE_DE_SW: case LANGUAGE_DE_BA: case LANGUAGE_DE_SA: DE_ESIST; switch (minutes / 5) { case 0: // glatte Stunde setHours(hours, true, language, matrix); break; case 1: // 5 nach DE_FUENF; DE_NACH; setHours(hours, false, language, matrix); break; case 2: // 10 nach DE_ZEHN; DE_NACH; setHours(hours, false, language, matrix); break; case 3: // viertel nach if ((language == LANGUAGE_DE_SW) || (language == LANGUAGE_DE_SA)) { DE_VIERTEL; setHours(hours + 1, false, language, matrix); } else { DE_VIERTEL; DE_NACH; setHours(hours, false, language, matrix); } break; case 4: // 20 nach if (language == LANGUAGE_DE_SA) { DE_ZEHN; DE_VOR; DE_HALB; setHours(hours + 1, false, language, matrix); } else { DE_ZWANZIG; DE_NACH; setHours(hours, false, language, matrix); } break; case 5: // 5 vor halb DE_FUENF; DE_VOR; DE_HALB; setHours(hours + 1, false, language, matrix); break; case 6: // halb DE_HALB; setHours(hours + 1, false, language, matrix); break; case 7: // 5 nach halb DE_FUENF; DE_NACH; DE_HALB; setHours(hours + 1, false, language, matrix); break; case 8: // 20 vor if (language == LANGUAGE_DE_SA) { DE_ZEHN; DE_NACH; DE_HALB; setHours(hours + 1, false, language, matrix); } else { DE_ZWANZIG; DE_VOR; setHours(hours + 1, false, language, matrix); } break; case 9: // viertel vor if ((language == LANGUAGE_DE_SW) || (language == LANGUAGE_DE_BA) || (language == LANGUAGE_DE_SA)) { DE_DREIVIERTEL; setHours(hours + 1, false, language, matrix); } else { DE_VIERTEL; DE_VOR; setHours(hours + 1, false, language, matrix); } break; case 10: // 10 vor DE_ZEHN; DE_VOR; setHours(hours + 1, false, language, matrix); break; case 11: // 5 vor DE_FUENF; DE_VOR; setHours(hours + 1, false, language, matrix); break; default: ; } break; #endif #ifdef ENABLE_LANGUAGE_CH // // Schweiz: Berner-Deutsch // case LANGUAGE_CH_X: if (minutes % 5) { CH_GSI; } case LANGUAGE_CH: CH_ESISCH; switch (minutes / 5) { case 0: // glatte Stunde setHours(hours, true, language, matrix); break; case 1: // 5 ab CH_FUEF; CH_AB; setHours(hours, false, language, matrix); break; case 2: // 10 ab CH_ZAEAE; CH_AB; setHours(hours, false, language, matrix); break; case 3: // viertel ab CH_VIERTU; CH_AB; setHours(hours, false, language, matrix); break; case 4: // 20 ab CH_ZWAENZG; CH_AB; setHours(hours, false, language, matrix); break; case 5: // 5 vor halb CH_FUEF; CH_VOR; CH_HAUBI; setHours(hours + 1, false, language, matrix); break; case 6: // halb CH_HAUBI; setHours(hours + 1, false, language, matrix); break; case 7: // 5 ab halb CH_FUEF; CH_AB; CH_HAUBI; setHours(hours + 1, false, language, matrix); break; case 8: // 20 vor CH_ZWAENZG; CH_VOR; setHours(hours + 1, false, language, matrix); break; case 9: // viertel vor CH_VIERTU; CH_VOR; setHours(hours + 1, false, language, matrix); break; case 10: // 10 vor CH_ZAEAE; CH_VOR; setHours(hours + 1, false, language, matrix); break; case 11: // 5 vor CH_FUEF; CH_VOR; setHours(hours + 1, false, language, matrix); break; default: ; } break; #endif #ifdef ENABLE_LANGUAGE_EN // // Englisch // case LANGUAGE_EN: EN_ITIS; switch (minutes / 5) { case 0: // glatte Stunde setHours(hours, true, language, matrix); break; case 1: // 5 nach EN_FIVE; EN_PAST; setHours(hours, false, language, matrix); break; case 2: // 10 nach EN_TEN; EN_PAST; setHours(hours, false, language, matrix); break; case 3: // viertel nach EN_A; EN_QUATER; EN_PAST; setHours(hours, false, language, matrix); break; case 4: // 20 nach EN_TWENTY; EN_PAST; setHours(hours, false, language, matrix); break; case 5: // 5 vor halb EN_TWENTY; EN_FIVE; EN_PAST; setHours(hours, false, language, matrix); break; case 6: // halb EN_HALF; EN_PAST; setHours(hours, false, language, matrix); break; case 7: // 5 nach halb EN_TWENTY; EN_FIVE; EN_TO; setHours(hours + 1, false, language, matrix); break; case 8: // 20 vor EN_TWENTY; EN_TO; setHours(hours + 1, false, language, matrix); break; case 9: // viertel vor EN_A; EN_QUATER; EN_TO; setHours(hours + 1, false, language, matrix); break; case 10: // 10 vor EN_TEN; EN_TO; setHours(hours + 1, false, language, matrix); break; case 11: // 5 vor EN_FIVE; EN_TO; setHours(hours + 1, false, language, matrix); break; } break; #endif #ifdef ENABLE_LANGUAGE_FR // // Franzoesisch // case LANGUAGE_FR: FR_ILEST; switch (minutes / 5) { case 0: // glatte Stunde setHours(hours, true, language, matrix); FR_hours(hours, matrix); break; case 1: // 5 nach setHours(hours, false, language, matrix); FR_hours(hours, matrix); FR_CINQ; break; case 2: // 10 nach setHours(hours, false, language, matrix); FR_hours(hours, matrix); FR_DIX; break; case 3: // viertel nach setHours(hours, false, language, matrix); FR_hours(hours, matrix); FR_ET; FR_QUART; break; case 4: // 20 nach setHours(hours, false, language, matrix); FR_hours(hours, matrix); FR_VINGT; break; case 5: // 5 vor halb setHours(hours, false, language, matrix); FR_hours(hours, matrix); FR_VINGT; FR_TRAIT; FR_CINQ; break; case 6: // halb setHours(hours, false, language, matrix); FR_hours(hours, matrix); FR_ET; FR_DEMI; break; case 7: // 5 nach halb setHours(hours + 1, false, language, matrix); FR_hours(hours + 1, matrix); FR_MOINS; FR_VINGT; FR_TRAIT; FR_CINQ; break; case 8: // 20 vor setHours(hours + 1, false, language, matrix); FR_hours(hours + 1, matrix); FR_MOINS; FR_VINGT; break; case 9: // viertel vor setHours(hours + 1, false, language, matrix); FR_hours(hours + 1, matrix); FR_MOINS; FR_LE; FR_QUART; break; case 10: // 10 vor setHours(hours + 1, false, language, matrix); FR_hours(hours + 1, matrix); FR_MOINS; FR_DIX; break; case 11: // 5 vor setHours(hours + 1, false, language, matrix); FR_hours(hours + 1, matrix); FR_MOINS; FR_CINQ; break; } break; #endif #ifdef ENABLE_LANGUAGE_IT // // Italienisch // case LANGUAGE_IT: switch (minutes / 5) { case 0: // glatte Stunde setHours(hours, true, language, matrix); IT_hours(hours, matrix); break; case 1: // 5 nach IT_E2; IT_CINQUE; setHours(hours, false, language, matrix); IT_hours(hours, matrix); break; case 2: // 10 nach IT_E2; IT_DIECI; setHours(hours, false, language, matrix); IT_hours(hours, matrix); break; case 3: // viertel nach IT_E2; IT_UN; IT_QUARTO; setHours(hours, false, language, matrix); IT_hours(hours, matrix); break; case 4: // 20 nach IT_E2; IT_VENTI; setHours(hours, false, language, matrix); IT_hours(hours, matrix); break; case 5: // 5 vor halb IT_E2; IT_VENTI; IT_CINQUE; setHours(hours, false, language, matrix); IT_hours(hours, matrix); break; case 6: // halb IT_E2; IT_MEZZA; setHours(hours, false, language, matrix); IT_hours(hours, matrix); break; case 7: // 5 nach halb IT_MENO; IT_VENTI; IT_CINQUE; setHours(hours + 1, false, language, matrix); IT_hours(hours + 1, matrix); break; case 8: // 20 vor IT_MENO; IT_VENTI; setHours(hours + 1, false, language, matrix); IT_hours(hours + 1, matrix); break; case 9: // viertel vor IT_MENO; IT_UN; IT_QUARTO; setHours(hours + 1, false, language, matrix); IT_hours(hours + 1, matrix); break; case 10: // 10 vor IT_MENO; IT_DIECI; setHours(hours + 1, false, language, matrix); IT_hours(hours + 1, matrix); break; case 11: // 5 vor IT_MENO; IT_CINQUE; setHours(hours + 1, false, language, matrix); IT_hours(hours + 1, matrix); break; } break; #endif #ifdef ENABLE_LANGUAGE_NL // // Niederlaendisch // case LANGUAGE_NL: NL_HETIS; switch (minutes / 5) { case 0: // glatte Stunde setHours(hours, true, language, matrix); break; case 1: // 5 nach NL_VIJF; NL_OVER; setHours(hours, false, language, matrix); break; case 2: // 10 nach NL_TIEN; NL_OVER; setHours(hours, false, language, matrix); break; case 3: // viertel nach NL_KWART; NL_OVER2; setHours(hours, false, language, matrix); break; case 4: // 10 vor halb NL_TIEN; NL_VOOR; NL_HALF; setHours(hours + 1, false, language, matrix); break; case 5: // 5 vor halb NL_VIJF; NL_VOOR; NL_HALF; setHours(hours + 1, false, language, matrix); break; case 6: // halb NL_HALF; setHours(hours + 1, false, language, matrix); break; case 7: // 5 nach halb NL_VIJF; NL_OVER; NL_HALF; setHours(hours + 1, false, language, matrix); break; case 8: // 20 vor NL_TIEN; NL_OVER; NL_HALF; setHours(hours + 1, false, language, matrix); break; case 9: // viertel vor NL_KWART; NL_VOOR2; setHours(hours + 1, false, language, matrix); break; case 10: // 10 vor NL_TIEN; NL_VOOR; setHours(hours + 1, false, language, matrix); break; case 11: // 5 vor NL_VIJF; NL_VOOR; setHours(hours + 1, false, language, matrix); break; } break; #endif #ifdef ENABLE_LANGUAGE_ES // // Spanisch // case LANGUAGE_ES: switch (minutes / 5) { case 0: // glatte Stunde ES_hours(hours, matrix); setHours(hours, false, language, matrix); break; case 1: // 5 nach ES_Y; ES_CINCO; ES_hours(hours, matrix); setHours(hours, false, language, matrix); break; case 2: // 10 nach ES_Y; ES_DIEZ; ES_hours(hours, matrix); setHours(hours, false, language, matrix); break; case 3: // viertel nach ES_Y; ES_CUARTO; ES_hours(hours, matrix); setHours(hours, false, language, matrix); break; case 4: // 20 nach ES_Y; ES_VEINTE; ES_hours(hours, matrix); setHours(hours, false, language, matrix); break; case 5: // 5 vor halb ES_Y; ES_VEINTICINCO; ES_hours(hours, matrix); setHours(hours, false, language, matrix); break; case 6: // halb ES_Y; ES_MEDIA; ES_hours(hours, matrix); setHours(hours, false, language, matrix); break; case 7: // 5 nach halb ES_MENOS; ES_VEINTICINCO; ES_hours(hours + 1, matrix); setHours(hours + 1, false, language, matrix); break; case 8: // 20 vor ES_MENOS; ES_VEINTE; ES_hours(hours + 1, matrix); setHours(hours + 1, false, language, matrix); break; case 9: // viertel vor ES_MENOS; ES_CUARTO; ES_hours(hours + 1, matrix); setHours(hours + 1, false, language, matrix); break; case 10: // 10 vor ES_MENOS; ES_DIEZ; ES_hours(hours + 1, matrix); setHours(hours + 1, false, language, matrix); break; case 11: // 5 vor ES_MENOS; ES_CINCO; ES_hours(hours + 1, matrix); setHours(hours + 1, false, language, matrix); break; } break; #endif #ifdef ENABLE_LANGUAGE_D3 // // Schwaebisch (D3) // case LANGUAGE_D3: D3_ESISCH; switch (minutes / 5) { case 0: // glatte Stunde setHours(hours, true, language, matrix); break; case 1: // 5 nach D3_FUENF; D3_NACH; setHours(hours, false, language, matrix); break; case 2: // 10 nach D3_ZEHN; D3_NACH; setHours(hours, false, language, matrix); break; case 3: // viertl nach D3_VIERTL; setHours(hours + 1, false, language, matrix); break; case 4: // 10 vor halb D3_ZEHN; D3_VOR; D3_HALB; setHours(hours + 1, false, language, matrix); break; case 5: // 5 vor halb D3_FUENF; D3_VOR; D3_HALB; setHours(hours + 1, false, language, matrix); break; case 6: // halb D3_HALB; setHours(hours + 1, false, language, matrix); break; case 7: // 5 nach halb D3_FUENF; D3_NACH; D3_HALB; setHours(hours + 1, false, language, matrix); break; case 8: // 10 nach halb D3_ZEHN; D3_NACH; D3_HALB; setHours(hours + 1, false, language, matrix); break; case 9: // viertel vor D3_DREIVIERTL; setHours(hours + 1, false, language, matrix); break; case 10: // 10 vor D3_ZEHN; D3_VOR; setHours(hours + 1, false, language, matrix); break; case 11: // 5 vor D3_FUENF; D3_VOR; setHours(hours + 1, false, language, matrix); break; } break; #endif default: ; } }
NumDays NumDays::operator --(int) { setHours(getHours() - 1); return *this; }
NumDays NumDays::operator ++(int) { setHours(getHours() + 1); return *this; }