* ./crlcore:
- Change: In RoutingLayerGauge, no longer throw exception when the position requested it outside the track grid. Instead returns first/last track index.
This commit is contained in:
parent
b8e42d2efc
commit
10682d9c7c
|
@ -223,15 +223,19 @@ namespace CRL {
|
||||||
|
|
||||||
trace << "depth := " << depth << endl;
|
trace << "depth := " << depth << endl;
|
||||||
|
|
||||||
if ( depth < 0 )
|
if ( depth < 0 ) {
|
||||||
throw Error ( negativeIndex
|
trace_out ();
|
||||||
, getString(this).c_str()
|
return 0;
|
||||||
, DbU::getValueString(position).c_str()
|
|
||||||
, DbU::getValueString(start).c_str()
|
|
||||||
, DbU::getValueString(stop).c_str()
|
|
||||||
);
|
|
||||||
|
|
||||||
if ( ( mode & Constant::Exact ) && ( modulo != 0 ) )
|
// throw Error ( negativeIndex
|
||||||
|
// , getString(this).c_str()
|
||||||
|
// , DbU::getValueString(position).c_str()
|
||||||
|
// , DbU::getValueString(start).c_str()
|
||||||
|
// , DbU::getValueString(stop).c_str()
|
||||||
|
// );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ( mode & Constant::Exact ) and ( modulo != 0 ) )
|
||||||
throw Error ( badExactPosition, getString(this).c_str(), DbU::getValueString(position).c_str() );
|
throw Error ( badExactPosition, getString(this).c_str(), DbU::getValueString(position).c_str() );
|
||||||
|
|
||||||
if ( mode & Constant::Superior ) {
|
if ( mode & Constant::Superior ) {
|
||||||
|
@ -240,13 +244,17 @@ namespace CRL {
|
||||||
if ( modulo > _pitch / 2 ) depth++;
|
if ( modulo > _pitch / 2 ) depth++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (unsigned)depth >= getTrackNumber(start,stop) )
|
unsigned int tracksNumber = getTrackNumber(start,stop);
|
||||||
throw Error ( overflowIndex
|
if ( (unsigned)depth >= tracksNumber ) {
|
||||||
, getString(this).c_str()
|
trace_out ();
|
||||||
, DbU::getValueString(position).c_str()
|
return (tracksNumber > 0) ? tracksNumber-1 : 0;
|
||||||
, DbU::getValueString(start).c_str()
|
// throw Error ( overflowIndex
|
||||||
, DbU::getValueString(stop).c_str()
|
// , getString(this).c_str()
|
||||||
);
|
// , DbU::getValueString(position).c_str()
|
||||||
|
// , DbU::getValueString(start).c_str()
|
||||||
|
// , DbU::getValueString(stop).c_str()
|
||||||
|
// );
|
||||||
|
}
|
||||||
|
|
||||||
trace_out ();
|
trace_out ();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue