Allow nearest Track selection in Katana::RoutingPlane::getTrackByPosition().
* Change: In Katana::RoutingPlane::getTrackByPosition(), when requesting a track less than *one pitch* beyond the last one, return the last one instead of NULL. Only if the mode allows it (i.e. Nearest or Inferior).
This commit is contained in:
parent
580ca0892c
commit
80dcd264bb
|
@ -327,11 +327,15 @@ namespace Katana {
|
|||
|
||||
cdebug_log(159,0) << "* Nearest " << track << endl;
|
||||
|
||||
if (not track)
|
||||
throw Error( "NegociateWindow::createTracksegment(): No track near axis of %s."
|
||||
, getString(autoSegment).c_str() );
|
||||
|
||||
if (track->getAxis() > uside.getVMax()) track = track->getPreviousTrack();
|
||||
if (track->getAxis() < uside.getVMin()) track = track->getNextTrack();
|
||||
|
||||
if (not track)
|
||||
throw Error( "NegociateWindow::createTracksegment(): No track near axis of %s."
|
||||
throw Error( "NegociateWindow::createTracksegment(): No track near axis of %s (after adjust)."
|
||||
, getString(autoSegment).c_str() );
|
||||
|
||||
cdebug_log(159,0) << "* GCell U-side " << uside << endl;
|
||||
|
|
|
@ -162,11 +162,14 @@ namespace Katana {
|
|||
|
||||
Track* RoutingPlane::getTrackByPosition ( DbU::Unit axis, uint32_t mode ) const
|
||||
{
|
||||
return getTrackByIndex( getLayerGauge()->getTrackIndex( getAxisMin()
|
||||
, getAxisMax()
|
||||
, axis
|
||||
, mode
|
||||
) );
|
||||
size_t index = getLayerGauge()->getTrackIndex( getAxisMin(), getAxisMax(), axis, mode );
|
||||
if (index == getTracksSize()) {
|
||||
if (not index) return NULL;
|
||||
if ((mode == Constant::Superior) or (mode == Constant::Exact)) return NULL;
|
||||
--index;
|
||||
}
|
||||
|
||||
return getTrackByIndex( index );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue