bool Allocation::updateOffsets() { clearOffsets(); auto rtimes = getResponseTimes();//compute original rtimes for all functions auto offsets = setNewOffsets();//set new offsets based on rtimes auto rtimes_new = getResponseTimes();//compute new rtimes given new offsets int limits = 0; while(rtimes_new != rtimes && ++limits < 50) { rtimes = rtimes_new; offsets = setNewOffsets(); rtimes_new = getResponseTimes(); } if(rtimes_new != rtimes) return false; return true; }
void DStkInfo::clear() { clearOffsets(); if ( this->metaData.CalibrationUnits != NULL ) _TIFFfree(this->metaData.CalibrationUnits); if ( this->metaData.Name != NULL ) _TIFFfree(this->metaData.Name); if ( this->metaData.grayUnitName != NULL ) _TIFFfree(this->metaData.grayUnitName); if ( this->metaData.StagePositionX != NULL ) _TIFFfree(this->metaData.StagePositionX); if ( this->metaData.StagePositionY != NULL ) _TIFFfree(this->metaData.StagePositionY); if ( this->metaData.CameraChipOffsetX != NULL ) _TIFFfree(this->metaData.CameraChipOffsetX); if ( this->metaData.CameraChipOffsetY != NULL ) _TIFFfree(this->metaData.CameraChipOffsetY); if ( this->metaData.StageLabel != NULL ) _TIFFfree(this->metaData.StageLabel); if ( this->metaData.AbsoluteZ != NULL ) _TIFFfree(this->metaData.AbsoluteZ); if ( this->metaData.AbsoluteZValid != NULL ) _TIFFfree(this->metaData.AbsoluteZValid); if ( this->metaData.wavelength != NULL ) _TIFFfree(this->metaData.wavelength); if ( this->metaData.zDistance != NULL ) _TIFFfree(this->metaData.zDistance); if ( this->metaData.creationDate != NULL ) _TIFFfree(this->metaData.creationDate); if ( this->metaData.creationTime != NULL ) _TIFFfree(this->metaData.creationTime); if ( this->metaData.modificationDate != NULL ) _TIFFfree(this->metaData.modificationDate); if ( this->metaData.modificationTime != NULL ) _TIFFfree(this->metaData.modificationTime); init(); }