In AutoSegment slackening, bad positioning of the perpandicular.
This commit is contained in:
parent
22bf92af2c
commit
cbb5e8781d
|
@ -273,7 +273,8 @@ namespace Anabatic {
|
||||||
cdebug_log(149,0) << "length:" << DbU::getValueString(getLength()) << endl;
|
cdebug_log(149,0) << "length:" << DbU::getValueString(getLength()) << endl;
|
||||||
|
|
||||||
int lowSlack = (flags & Flags::HalfSlacken) ? 3 : 10;
|
int lowSlack = (flags & Flags::HalfSlacken) ? 3 : 10;
|
||||||
bool slackened = false;
|
bool sourceSlackened = false;
|
||||||
|
bool targetSlackened = false;
|
||||||
bool halfSlackened = false;
|
bool halfSlackened = false;
|
||||||
DbU::Unit targetPosition = getTargetPosition();
|
DbU::Unit targetPosition = getTargetPosition();
|
||||||
AutoSegment* parallel = this;
|
AutoSegment* parallel = this;
|
||||||
|
@ -293,14 +294,14 @@ namespace Anabatic {
|
||||||
if ((nativeSlack < lowSlack) or (nativeSlack - slack < 3)) {
|
if ((nativeSlack < lowSlack) or (nativeSlack - slack < 3)) {
|
||||||
cdebug_log(149,0) << "Slackening from Source: " << source << endl;
|
cdebug_log(149,0) << "Slackening from Source: " << source << endl;
|
||||||
_makeDogleg( source->getGCell(), Flags::NoFlags );
|
_makeDogleg( source->getGCell(), Flags::NoFlags );
|
||||||
slackened = true;
|
sourceSlackened = true;
|
||||||
} else if (slack < 10) {
|
} else if (slack < 10) {
|
||||||
halfSlackened = true;
|
halfSlackened = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const vector<AutoSegment*>& doglegs = Session::getDoglegs();
|
const vector<AutoSegment*>& doglegs = Session::getDoglegs();
|
||||||
if (doglegs.size() >= 2) {
|
if (sourceSlackened and (doglegs.size() >= 2)) {
|
||||||
cdebug_log(149,0) << "AutoSegment::_slaken(): Source @" << DbU::getValueString(getSourcePosition()) << endl;
|
cdebug_log(149,0) << "AutoHorizontal::_slacken(): Source @" << DbU::getValueString(getSourcePosition()) << endl;
|
||||||
doglegs[doglegs.size()-2]->setAxis( getSourcePosition() );
|
doglegs[doglegs.size()-2]->setAxis( getSourcePosition() );
|
||||||
success = true;
|
success = true;
|
||||||
|
|
||||||
|
@ -331,21 +332,14 @@ namespace Anabatic {
|
||||||
if ((nativeSlack < lowSlack) or (nativeSlack - slack < 3)) {
|
if ((nativeSlack < lowSlack) or (nativeSlack - slack < 3)) {
|
||||||
cdebug_log(149,0) << "Slackening from Target: " << target << endl;
|
cdebug_log(149,0) << "Slackening from Target: " << target << endl;
|
||||||
parallel->_makeDogleg( target->getGCell(), Flags::NoFlags );
|
parallel->_makeDogleg( target->getGCell(), Flags::NoFlags );
|
||||||
slackened = true;
|
targetSlackened = true;
|
||||||
} else if (slack < 10) {
|
} else if (slack < 10) {
|
||||||
halfSlackened = true;
|
halfSlackened = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (halfSlackened) {
|
|
||||||
setFlags( SegHalfSlackened );
|
|
||||||
} else if (slackened) {
|
|
||||||
setFlags ( SegSlackened );
|
|
||||||
unsetFlags( SegHalfSlackened );
|
|
||||||
}
|
|
||||||
|
|
||||||
const vector<AutoSegment*>& doglegs = Session::getDoglegs();
|
const vector<AutoSegment*>& doglegs = Session::getDoglegs();
|
||||||
if (doglegs.size() >= 2) {
|
if (targetSlackened and (doglegs.size() >= 2)) {
|
||||||
cdebug_log(149,0) << "AutoSegment::_slaken(): Target @" << DbU::getValueString(targetPosition) << endl;
|
cdebug_log(149,0) << "AutoHorizontal::_slacken(): Target @" << DbU::getValueString(targetPosition) << endl;
|
||||||
doglegs[doglegs.size()-2]->setAxis( targetPosition );
|
doglegs[doglegs.size()-2]->setAxis( targetPosition );
|
||||||
success = true;
|
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);
|
cdebug_tabw(149,-1);
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
|
@ -720,7 +729,7 @@ namespace Anabatic {
|
||||||
unsigned int AutoHorizontal::_makeDogleg ( GCell* doglegGCell, unsigned int flags )
|
unsigned int AutoHorizontal::_makeDogleg ( GCell* doglegGCell, unsigned int flags )
|
||||||
{
|
{
|
||||||
DebugSession::open( getNet(), 140, 150 );
|
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);
|
cdebug_tabw(149,1);
|
||||||
|
|
||||||
//Session::doglegReset();
|
//Session::doglegReset();
|
||||||
|
|
|
@ -838,7 +838,7 @@ namespace Anabatic {
|
||||||
|
|
||||||
if ( (axis == getAxis()) and not (flags & Flags::Realignate) ) return;
|
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())
|
<< ((isHorizontal())?"Y ":"X ") << DbU::toLambda(getAxis())
|
||||||
<< " to " << DbU::toLambda(axis) << " on " << this << endl;
|
<< " to " << DbU::toLambda(axis) << " on " << this << endl;
|
||||||
cdebug_tabw(145,1);
|
cdebug_tabw(145,1);
|
||||||
|
|
|
@ -238,7 +238,8 @@ namespace Anabatic {
|
||||||
cdebug_log(149,0) << "length:" << DbU::getValueString(getLength()) << endl;
|
cdebug_log(149,0) << "length:" << DbU::getValueString(getLength()) << endl;
|
||||||
|
|
||||||
bool success = false;
|
bool success = false;
|
||||||
bool slackened = false;
|
bool sourceSlackened = false;
|
||||||
|
bool targetSlackened = false;
|
||||||
bool halfSlackened = false;
|
bool halfSlackened = false;
|
||||||
int lowSlack = (flags & Flags::HalfSlacken) ? 3 : 10;
|
int lowSlack = (flags & Flags::HalfSlacken) ? 3 : 10;
|
||||||
AutoContact* source = getAutoSource();
|
AutoContact* source = getAutoSource();
|
||||||
|
@ -253,14 +254,14 @@ namespace Anabatic {
|
||||||
// Ugly: GCell's track number is hardwired.
|
// Ugly: GCell's track number is hardwired.
|
||||||
if ((slack < lowSlack) or (nativeSlack - slack < 3)) {
|
if ((slack < lowSlack) or (nativeSlack - slack < 3)) {
|
||||||
_makeDogleg( source->getGCell(), Flags::NoFlags );
|
_makeDogleg( source->getGCell(), Flags::NoFlags );
|
||||||
slackened = true;
|
sourceSlackened = true;
|
||||||
} else if (slack < 10) {
|
} else if (slack < 10) {
|
||||||
halfSlackened = true;
|
halfSlackened = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const vector<AutoSegment*>& doglegs = Session::getDoglegs();
|
const vector<AutoSegment*>& doglegs = Session::getDoglegs();
|
||||||
if (doglegs.size() >= 2) {
|
if (sourceSlackened and (doglegs.size() >= 2)) {
|
||||||
cdebug_log(149,0) << "AutoSegment::_slaken(): Source @" << DbU::getValueString(getSourcePosition()) << endl;
|
cdebug_log(149,0) << "AutoVertical::_slacken(): Source @" << DbU::getValueString(getSourcePosition()) << endl;
|
||||||
doglegs[doglegs.size()-2]->_setAxis( getSourcePosition() );
|
doglegs[doglegs.size()-2]->_setAxis( getSourcePosition() );
|
||||||
success = true;
|
success = true;
|
||||||
|
|
||||||
|
@ -284,24 +285,31 @@ namespace Anabatic {
|
||||||
// Ugly: GCell's track number is hardwired.
|
// Ugly: GCell's track number is hardwired.
|
||||||
if ((slack < lowSlack) or (nativeSlack - slack < 3)) {
|
if ((slack < lowSlack) or (nativeSlack - slack < 3)) {
|
||||||
_makeDogleg( target->getGCell(), Flags::NoFlags );
|
_makeDogleg( target->getGCell(), Flags::NoFlags );
|
||||||
slackened = true;
|
targetSlackened = true;
|
||||||
} else if (slack < 10) {
|
} else if (slack < 10) {
|
||||||
halfSlackened = true;
|
halfSlackened = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const vector<AutoSegment*>& doglegs = Session::getDoglegs();
|
const vector<AutoSegment*>& doglegs = Session::getDoglegs();
|
||||||
if (doglegs.size() >= 2) {
|
if (targetSlackened and (doglegs.size() >= 2)) {
|
||||||
cdebug_log(149,0) << "AutoSegment::_slaken(): Source @" << DbU::getValueString(getTargetPosition()) << endl;
|
cdebug_log(149,0) << "AutoVertical::_slacken(): Source @" << DbU::getValueString(getTargetPosition()) << endl;
|
||||||
doglegs[doglegs.size()-2]->_setAxis( getTargetPosition() );
|
doglegs[doglegs.size()-2]->_setAxis( getTargetPosition() );
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (halfSlackened) {
|
if (sourceSlackened and targetSlackened) {
|
||||||
setFlags( SegHalfSlackened );
|
|
||||||
} else if (slackened) {
|
|
||||||
setFlags ( SegSlackened );
|
setFlags ( SegSlackened );
|
||||||
unsetFlags( SegHalfSlackened );
|
unsetFlags( SegHalfSlackened );
|
||||||
|
} else {
|
||||||
|
if (sourceSlackened or targetSlackened) {
|
||||||
|
if (halfSlackened) {
|
||||||
|
setFlags( SegHalfSlackened );
|
||||||
|
} else {
|
||||||
|
setFlags ( SegSlackened );
|
||||||
|
unsetFlags( SegHalfSlackened );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cdebug_tabw(149,-1);
|
cdebug_tabw(149,-1);
|
||||||
|
|
||||||
|
|
|
@ -422,6 +422,7 @@ namespace Katana {
|
||||||
return (not isSlackened() and (getDoglegLevel() <= 3)) ? _base->canSlacken(Flags::Propagate) : false;
|
return (not isSlackened() and (getDoglegLevel() <= 3)) ? _base->canSlacken(Flags::Propagate) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TrackSegment::slacken ( unsigned int flags )
|
bool TrackSegment::slacken ( unsigned int flags )
|
||||||
{
|
{
|
||||||
cdebug_log(159,0) << "TrackSegment::slacken()" << endl;
|
cdebug_log(159,0) << "TrackSegment::slacken()" << endl;
|
||||||
|
|
Loading…
Reference in New Issue