LinInterpolValueIteratorI::LinInterpolValueIteratorI (ValueIteratorI *base, double deltaT)
{
	_base = base;
	if (! base)
		throwDetailedArchiveException (Invalid, "Invalid base iterator");

	if (! base->isValid())
		throwDetailedArchiveException (Invalid, "Invalid base iterator");

	_deltaT = deltaT;
	_maxDeltaT = 0;
	_value = base->getValue()->clone ();
	_time = roundTime (_value->getTime(), _deltaT);
}
void UtilitiesView::addLapTime(){
    QTime currentTime(0,0,0,0), prevTime(0,0,0,0), prevRoundTime(0,0,0,0), roundTime(0,0,0,0), gap(0,0,0,0);

    if(currentLap>0){
        prevTime = QTime::fromString(ui->timeTable->item(currentLap-1,0)->text(),"mm:ss:zzz");
        prevRoundTime = QTime::fromString(ui->timeTable->item(currentLap-1,1)->text(),"mm:ss:zzz");
    }

    ui->timeTable->insertRow(currentLap);

    currentTime = currentTime.addMSecs(lastTime);
    ui->timeTable->setItem(currentLap, 0, new QTableWidgetItem(currentTime.toString("mm:ss:zzz")));

    roundTime = roundTime.addMSecs(prevTime.msecsTo(currentTime));
    ui->timeTable->setItem(currentLap, 1, new QTableWidgetItem(roundTime.toString("mm:ss:zzz")));

    gap = gap.addMSecs(prevRoundTime.msecsTo(roundTime));
    ui->timeTable->setItem(currentLap, 2, new QTableWidgetItem(gap.toString("ss:zzz")));


    currentLap++;
}