コード例 #1
0
ファイル: TimeStamp.cpp プロジェクト: kroimon/WordQlock
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);
}
コード例 #2
0
ファイル: timer.cpp プロジェクト: baronleonardo/tamatem
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 );
}
コード例 #3
0
ファイル: console.cpp プロジェクト: NedFreed/master_clock
//_____________________________________
// 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 ;
}
コード例 #4
0
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);
}
コード例 #5
0
void RecipeIngredient::fromXml(QDomElement element)
{
    setIngredient(Ingredient::createIngredient(element.elementsByTagName("Ingredient").at(0).toElement()));
    setQuantity(Quantity(element.elementsByTagName("Quantity").at(0).toElement()));
    setMinutes(element.attribute("minutes", QString().setNum(minutes())).toDouble());
}