@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value="FE_FLOATING_POINT_EQUALITY",justification="OK to compare floating point") protected void newInternalMinute(){
  double origCurrent=mCurrentIntensity;
  int origState=mState;
  int steps=getNumberOfSteps();
  if ((mTransitionDuration > 0) && (steps > 0)) {
    double stepsPerMinute=steps / mTransitionDuration;
    double stepSize=1 / (double)steps;
    double intensityDiffPerMinute=stepSize * stepsPerMinute;
    if (Math.abs(mCurrentIntensity - mTransitionTargetIntensity) != 0) {
      if (log.isDebugEnabled()) {
        log.debug("before Target: " + mTransitionTargetIntensity + " Current: "+ mCurrentIntensity);
      }
      if (mTransitionTargetIntensity > mCurrentIntensity) {
        mCurrentIntensity=mCurrentIntensity + intensityDiffPerMinute;
        if (mCurrentIntensity >= mTransitionTargetIntensity) {
          mCurrentIntensity=mTransitionTargetIntensity;
          if (mCurrentIntensity >= getMaxIntensity()) {
            mState=ON;
          }
 else {
            mState=INTERMEDIATE;
          }
        }
      }
 else {
        mCurrentIntensity=mCurrentIntensity - intensityDiffPerMinute;
        if (mCurrentIntensity <= mTransitionTargetIntensity) {
          mCurrentIntensity=mTransitionTargetIntensity;
          if (mCurrentIntensity <= getMinIntensity()) {
            mState=OFF;
          }
 else {
            mState=INTERMEDIATE;
          }
        }
      }
      sendIntensity(mCurrentIntensity);
      if (log.isDebugEnabled()) {
        log.debug("after Target: " + mTransitionTargetIntensity + " Current: "+ mCurrentIntensity);
      }
    }
  }
  if (origCurrent != mCurrentIntensity) {
    firePropertyChange("CurrentIntensity",Double.valueOf(origCurrent),Double.valueOf(mCurrentIntensity));
    if (log.isDebugEnabled()) {
      log.debug("firePropertyChange intensity " + origCurrent + " -> "+ mCurrentIntensity);
    }
  }
  if (origState != mState) {
    firePropertyChange("KnownState",Integer.valueOf(origState),Integer.valueOf(mState));
    if (log.isDebugEnabled()) {
      log.debug("firePropertyChange intensity " + origCurrent + " -> "+ mCurrentIntensity);
    }
  }
}

@ edu . umd . cs . findbugs . annotations . SuppressFBWarnings ( value = "FE_FLOATING_POINT_EQUALITY" , justification = "OK to compare floating point" ) protected void newInternalMinute ( ) { double origCurrent = mCurrentIntensity ; int origState = mState ; int steps = getNumberOfSteps ( ) ; if ( ( mTransitionDuration > 0 ) && ( steps > 0 ) ) { double stepsPerMinute = steps / mTransitionDuration ; double stepSize = 1 / ( double ) steps ; double intensityDiffPerMinute = stepSize * stepsPerMinute ; if ( Math . abs ( mCurrentIntensity - mTransitionTargetIntensity ) != 0 ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "before Target: " + mTransitionTargetIntensity + " Current: " + mCurrentIntensity ) ; } if ( mTransitionTargetIntensity > mCurrentIntensity ) { mCurrentIntensity = mCurrentIntensity + intensityDiffPerMinute ; if ( mCurrentIntensity >= mTransitionTargetIntensity ) { mCurrentIntensity = mTransitionTargetIntensity ; if ( mCurrentIntensity >= getMaxIntensity ( ) ) { mState = ON ; } else { mState = INTERMEDIATE ; } } } else { mCurrentIntensity = mCurrentIntensity - intensityDiffPerMinute ; if ( mCurrentIntensity <= mTransitionTargetIntensity ) { mCurrentIntensity = mTransitionTargetIntensity ; if ( mCurrentIntensity <= getMinIntensity ( ) ) { mState = OFF ; } else { mState = INTERMEDIATE ; } } } sendIntensity ( mCurrentIntensity ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "after Target: " + mTransitionTargetIntensity + " Current: " + mCurrentIntensity ) ; } } } if ( origCurrent != mCurrentIntensity ) { firePropertyChange ( "CurrentIntensity" , Double . valueOf ( origCurrent ) , Double . valueOf ( mCurrentIntensity ) ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "firePropertyChange intensity " + origCurrent + " -> " + mCurrentIntensity ) ; } } if ( origState != mState ) { firePropertyChange ( "KnownState" , Integer . valueOf ( origState ) , Integer . valueOf ( mState ) ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "firePropertyChange intensity " + origCurrent + " -> " + mCurrentIntensity ) ; } } }
layout time has changed to a new minute . process effect that might be having on intensity . currently , this implementation assumes there ' s a fixed number of steps between min and max brightness .
