In AutoSegment slackening, bad positioning of the perpandicular.

This commit is contained in:
Jean-Paul Chaput 2016-08-28 19:09:07 +02:00
parent 22bf92af2c
commit cbb5e8781d
4 changed files with 53 additions and 35 deletions

View File

@ -272,11 +272,12 @@ namespace Anabatic {
cdebug_log(149,0) << "test:" << (getLength() < 5*getPitch()) << endl;
cdebug_log(149,0) << "length:" << DbU::getValueString(getLength()) << endl;
int lowSlack = (flags & Flags::HalfSlacken) ? 3 : 10;
bool slackened = false;
bool halfSlackened = false;
DbU::Unit targetPosition = getTargetPosition();
AutoSegment* parallel = this;
int lowSlack = (flags & Flags::HalfSlacken) ? 3 : 10;
bool sourceSlackened = false;
bool targetSlackened = false;
bool halfSlackened = false;
DbU::Unit targetPosition = getTargetPosition();
AutoSegment* parallel = this;
if (source->isTerminal()) {
Interval perpandConstraints = getAutoTarget()->getUConstraints(Flags::Horizontal);
@ -293,14 +294,14 @@ namespace Anabatic {
if ((nativeSlack < lowSlack) or (nativeSlack - slack < 3)) {
cdebug_log(149,0) << "Slackening from Source: " << source << endl;
_makeDogleg( source->getGCell(), Flags::NoFlags );
slackened = true;
sourceSlackened = true;
} else if (slack < 10) {
halfSlackened = true;
}
const vector<AutoSegment*>& doglegs = Session::getDoglegs();
if (doglegs.size() >= 2) {
cdebug_log(149,0) << "AutoSegment::_slaken(): Source @" << DbU::getValueString(getSourcePosition()) << endl;
if (sourceSlackened and (doglegs.size() >= 2)) {
cdebug_log(149,0) << "AutoHorizontal::_slacken(): Source @" << DbU::getValueString(getSourcePosition()) << endl;
doglegs[doglegs.size()-2]->setAxis( getSourcePosition() );
success = true;
@ -331,21 +332,14 @@ namespace Anabatic {
if ((nativeSlack < lowSlack) or (nativeSlack - slack < 3)) {
cdebug_log(149,0) << "Slackening from Target: " << target << endl;
parallel->_makeDogleg( target->getGCell(), Flags::NoFlags );
slackened = true;
targetSlackened = true;
} else if (slack < 10) {
halfSlackened = true;
}
if (halfSlackened) {
setFlags( SegHalfSlackened );
} else if (slackened) {
setFlags ( SegSlackened );
unsetFlags( SegHalfSlackened );
}
const vector<AutoSegment*>& doglegs = Session::getDoglegs();
if (doglegs.size() >= 2) {
cdebug_log(149,0) << "AutoSegment::_slaken(): Target @" << DbU::getValueString(targetPosition) << endl;
if (targetSlackened and (doglegs.size() >= 2)) {
cdebug_log(149,0) << "AutoHorizontal::_slacken(): Target @" << DbU::getValueString(targetPosition) << endl;
doglegs[doglegs.size()-2]->setAxis( targetPosition );
success = true;
@ -358,6 +352,21 @@ namespace Anabatic {
}
}
}
if (sourceSlackened and targetSlackened) {
setFlags ( SegSlackened );
unsetFlags( SegHalfSlackened );
} else {
if (sourceSlackened or targetSlackened) {
if (halfSlackened) {
setFlags( SegHalfSlackened );
} else {
setFlags ( SegSlackened );
unsetFlags( SegHalfSlackened );
}
}
}
cdebug_tabw(149,-1);
return success;
@ -720,7 +729,7 @@ namespace Anabatic {
unsigned int AutoHorizontal::_makeDogleg ( GCell* doglegGCell, unsigned int flags )
{
DebugSession::open( getNet(), 140, 150 );
cdebug_log(149,0) << "AutoHorizontal::_makeDogleg(GCell*)" << endl;
cdebug_log(149,0) << "AutoHorizontal::_makeDogleg(GCell*) in " << doglegGCell << endl;
cdebug_tabw(149,1);
//Session::doglegReset();

View File

@ -838,7 +838,7 @@ namespace Anabatic {
if ( (axis == getAxis()) and not (flags & Flags::Realignate) ) return;
cdebug_log(149,0) << "setAxis() @"
cdebug_log(159,0) << "setAxis() @"
<< ((isHorizontal())?"Y ":"X ") << DbU::toLambda(getAxis())
<< " to " << DbU::toLambda(axis) << " on " << this << endl;
cdebug_tabw(145,1);

View File

@ -237,12 +237,13 @@ namespace Anabatic {
cdebug_log(149,0) << "test:" << (getLength() < getPitch()*5) << endl;
cdebug_log(149,0) << "length:" << DbU::getValueString(getLength()) << endl;
bool success = false;
bool slackened = false;
bool halfSlackened = false;
int lowSlack = (flags & Flags::HalfSlacken) ? 3 : 10;
AutoContact* source = getAutoSource();
AutoSegment* parallel = this;
bool success = false;
bool sourceSlackened = false;
bool targetSlackened = false;
bool halfSlackened = false;
int lowSlack = (flags & Flags::HalfSlacken) ? 3 : 10;
AutoContact* source = getAutoSource();
AutoSegment* parallel = this;
if (source->isTerminal()) {
Interval constraints = source->getUConstraints (Flags::Horizontal|Flags::NoGCellShrink);
@ -253,14 +254,14 @@ namespace Anabatic {
// Ugly: GCell's track number is hardwired.
if ((slack < lowSlack) or (nativeSlack - slack < 3)) {
_makeDogleg( source->getGCell(), Flags::NoFlags );
slackened = true;
sourceSlackened = true;
} else if (slack < 10) {
halfSlackened = true;
}
const vector<AutoSegment*>& doglegs = Session::getDoglegs();
if (doglegs.size() >= 2) {
cdebug_log(149,0) << "AutoSegment::_slaken(): Source @" << DbU::getValueString(getSourcePosition()) << endl;
if (sourceSlackened and (doglegs.size() >= 2)) {
cdebug_log(149,0) << "AutoVertical::_slacken(): Source @" << DbU::getValueString(getSourcePosition()) << endl;
doglegs[doglegs.size()-2]->_setAxis( getSourcePosition() );
success = true;
@ -284,24 +285,31 @@ namespace Anabatic {
// Ugly: GCell's track number is hardwired.
if ((slack < lowSlack) or (nativeSlack - slack < 3)) {
_makeDogleg( target->getGCell(), Flags::NoFlags );
slackened = true;
targetSlackened = true;
} else if (slack < 10) {
halfSlackened = true;
}
const vector<AutoSegment*>& doglegs = Session::getDoglegs();
if (doglegs.size() >= 2) {
cdebug_log(149,0) << "AutoSegment::_slaken(): Source @" << DbU::getValueString(getTargetPosition()) << endl;
if (targetSlackened and (doglegs.size() >= 2)) {
cdebug_log(149,0) << "AutoVertical::_slacken(): Source @" << DbU::getValueString(getTargetPosition()) << endl;
doglegs[doglegs.size()-2]->_setAxis( getTargetPosition() );
success = true;
}
}
if (halfSlackened) {
setFlags( SegHalfSlackened );
} else if (slackened) {
if (sourceSlackened and targetSlackened) {
setFlags ( SegSlackened );
unsetFlags( SegHalfSlackened );
} else {
if (sourceSlackened or targetSlackened) {
if (halfSlackened) {
setFlags( SegHalfSlackened );
} else {
setFlags ( SegSlackened );
unsetFlags( SegHalfSlackened );
}
}
}
cdebug_tabw(149,-1);

View File

@ -422,6 +422,7 @@ namespace Katana {
return (not isSlackened() and (getDoglegLevel() <= 3)) ? _base->canSlacken(Flags::Propagate) : false;
}
bool TrackSegment::slacken ( unsigned int flags )
{
cdebug_log(159,0) << "TrackSegment::slacken()" << endl;