   }
 }
 
-
 void evaluateCondition(struct ad *source,time_t ts)
 {
   float value;

      break;
    }
  }
  Serial.print("target = ");
  Serial.print(start->source);
  Serial.print(" / ");
  Serial.println(stop->source);
  ret = (adder + start->target) - ((v - start->source) / (stop->source - start->source) * (start->target - stop->target));
  return ret;
}

	// calculate target
	iTable=(struct convert *) conditions[i].target;
	conditions[i].limit2->value=resolveConversion(value,conditions[i].limit->value,iTable);
	float radReq=conditions[i].limit2->value;
	if (!turnBypass(0,ts,radReq))
	  conditions[i].source->flags &= ~FLAGS_EVALUATE;

	break;
      }
    }
  }
}



int turnBypass(int bno,time_t ts,float requested)
{
  int ret=1;
  float diff;
  long turntime;

  bypasses[bno].targetAd=requested;
  if (bypasses[bno].actualTemp->measured.analog==-273) return ret;

  diff = requested - bypasses[bno].actualTemp->measured.analog;
  turntime=abs(diff) * bypasses[bno].timeMultiplier;
  Serial.print(" diff is ");
  Serial.println(diff);
  bypasses[bno].changed=ts;
  if (turntime > bypasses[bno].maxTurntime)
    turntime=bypasses[bno].maxTurntime;
  else if (turntime < bypasses[bno].minTurntime)
    turntime=bypasses[bno].minTurntime;

  if (diff > bypasses[bno].hysteresis)
    sched.oscillate(bypasses[bno].up,turntime,LOW,1);
  else if (diff < (-1.0 * bypasses[bno].hysteresis))
    sched.oscillate(bypasses[bno].dn,turntime,LOW,1);
  else
    ret=0;
  return ret;
}


