Corrected the "port makeall" command so that it actually works, and

since the edit box was undefined in the code, potentially this
fixes any number of random problems that might be seen with the
"port" command.  Also:  Modified the cell bounding box recalculation
so that it does not continually update a parent cell on every
addition of a child cell but only once for each child cell found.
This greatly reduces the time for GDS file input in the case of
large arrays of cells.
This commit is contained in:
Tim Edwards 2018-09-13 21:09:38 -04:00
parent 7139e0fbb1
commit f8b79133fb
2 changed files with 36 additions and 24 deletions

View File

@ -1196,6 +1196,9 @@ CmdPort(w, cmd)
goto portWrongNumArgs;
else
{
/* Make sure edit box exists */
if (!ToolGetEditBox(&editBox)) return;
/* Handle syntax "port <name>|<index> [option ...]" */
/* Does not require a selection. */
@ -1271,7 +1274,7 @@ CmdPort(w, cmd)
}
}
if ((option != PORT_LAST) && lab == NULL)
if ((option != PORT_LAST) && (option != PORT_MAKEALL) && (lab == NULL))
{
/* Let "port remove" fail without complaining. */
if (option != PORT_REMOVE)
@ -1509,16 +1512,28 @@ portWrongNumArgs:
parseindex:
while (1) {
/* For this syntax, the label must not already be a port */
if (lab->lab_flags & PORT_DIR_MASK)
if ((option != PORT_MAKEALL) && (lab->lab_flags & PORT_DIR_MASK))
{
/* For this syntax, the label must not already be a port */
TxError("The selected label is already a port.\n");
TxError("Do \"port help\" to get a list of options.\n");
return;
}
while (lab != NULL) {
if (option == PORT_MAKEALL)
{
/* Get the next valid label, skipping any that are not */
/* inside the edit box or are already marked as ports. */
while ((lab != NULL) && (!GEO_OVERLAP(&editBox, &lab->lab_rect)
|| (lab->lab_flags & PORT_DIR_MASK)))
lab = lab->lab_next;
if (lab == NULL) break;
}
else if (lab->lab_flags & PORT_DIR_MASK) break;
if ((argc > argstart) && StrIsInt(cmd->tx_argv[argstart]))
{
idx = atoi(cmd->tx_argv[argstart]);
@ -1642,21 +1657,6 @@ parsepositions:
lab->lab_rect = editBox;
DBWLabelChanged(editDef, lab, DBW_ALLWINDOWS);
lab->lab_rect = tmpArea;
if (option == PORT_MAKEALL)
{
/* Get the next valid label, skipping any that are not */
/* inside the edit box or are already marked as ports. */
lab = lab->lab_next;
while ((lab != NULL) && (!GEO_OVERLAP(&editBox, &lab->lab_rect)
|| (lab->lab_flags & PORT_DIR_MASK)))
lab = lab->lab_next;
if (lab == NULL) break;
}
else
break;
}
editDef->cd_flags |= (CDMODIFIED | CDGETNEWSTAMP);
}

View File

@ -611,7 +611,7 @@ dbReComputeBboxFunc(cellDef, boundProc, recurseProc)
Rect rect, area, extended, *box;
Rect redisplayArea;
CellUse *use;
CellDef *parent;
CellDef *parent, *last;
Label *label;
bool foundAny;
int pNum;
@ -740,8 +740,15 @@ dbReComputeBboxFunc(cellDef, boundProc, recurseProc)
* of their respective parents. Also, redisplay the use
* in each parent, in each window where the cell isn't
* expanded (i.e. the bounding box is no longer correct).
*
* Because more than one cell may be in an array, avoid
* running recurseProc more than once on the same parent.
* The simple way is just wait until the parent cell changes
* to run the process, although this could be done more
* thoroughly.
*/
last = NULL;
for (use = cellDef->cd_parents; use != NULL; use = use->cu_nextuse)
{
redisplayArea = use->cu_extended;
@ -750,12 +757,17 @@ dbReComputeBboxFunc(cellDef, boundProc, recurseProc)
{
parent->cd_flags |= CDBOXESCHANGED;
DBPlaceCell(use, parent);
(*recurseProc)(parent);
if (last != parent)
{
if (last != NULL) (*recurseProc)(last);
last = parent;
}
(void) GeoInclude(&use->cu_extended, &redisplayArea);
DBWAreaChanged(parent, &redisplayArea, (int) ~use->cu_expandMask,
&DBAllButSpaceBits);
}
}
if ((last != NULL) && (parent != NULL)) (*recurseProc)(parent);
UndoEnable();
}