items.add(new DesignItem(String.format("%5.3f", lpe.getDelay(), pd)));
items.add(createNewHyperlinkItem(lpe.getInstance().getName(), pd));
subModels[0].appendRow(items);
}
else{
RoutingPathElement rpe = (RoutingPathElement) pe;
ArrayList<QStandardItem> items = new ArrayList<QStandardItem>();
items.add(createNewHyperlinkItem(rpe.getPin().getInstance().getPrimitiveSiteName() + "." + rpe.getPin().getName(), pd));
items.add(new DesignItem(rpe.getType().toString() + " (fanout=" + rpe.getNet().getFanOut() + ")", pd));
items.add(new DesignItem(String.format("%5.3f", rpe.getDelay(), pd)));
items.add(createNewHyperlinkItem(rpe.getNet().getName(), pd));
subModels[0].appendRow(items);
}
}
}
break;
case OFFSETS:
if(index.model().objectName().equals("Max")){
if(index.column() == 0){
Tile t = explorer.device.getPrimitiveSite(data.substring(0, data.indexOf('.'))).getTile();
switchToTileTab(t.getName());
}
else if(index.column() == 3){
if(((String)index.model().data(index.row(), 1)).startsWith("NET")){
switchToNetTab(data);
}
else{
switchToInstanceTab(data);
}
}
}
else if(index.model().objectName().equals("Min")){
if(index.column() == 0){
Tile t = explorer.device.getPrimitiveSite(data.substring(0, data.indexOf('.'))).getTile();
switchToTileTab(t.getName());
}
else if(index.column() == 3){
if(((String)index.model().data(index.row(), 1)).startsWith("NET")){
switchToNetTab(data);
}
else{
switchToInstanceTab(data);
}
}
}
else{
subModels[0].removeRows(0, subModels[0].rowCount());
subModels[1].removeRows(0, subModels[1].rowCount());
subViews[0].setSortingEnabled(true);
subViews[0].sortByColumn(0, Qt.SortOrder.AscendingOrder);
subViews[1].setSortingEnabled(true);
subViews[1].sortByColumn(0, Qt.SortOrder.AscendingOrder);
Path pd2 = (Path)((DesignItem)model.itemFromIndex(proxyModel.mapToSource(index))).refObject;
for(PathElement pe : pd2.getMaxDataPath()){
if(pe.getClass().equals(LogicPathElement.class)){
LogicPathElement lpe = (LogicPathElement) pe;
ArrayList<QStandardItem> items = new ArrayList<QStandardItem>();
items.add(createNewHyperlinkItem(lpe.getInstance().getPrimitiveSiteName() + "." + lpe.getPin().getName(), pd2));
items.add(new DesignItem(lpe.getType().toString(), pd2));
items.add(new DesignItem(String.format("%5.3f", lpe.getDelay()), pd2));
items.add(createNewHyperlinkItem(lpe.getInstance().getName(), pd2));
subModels[0].appendRow(items);
}
else{
RoutingPathElement rpe = (RoutingPathElement) pe;
ArrayList<QStandardItem> items = new ArrayList<QStandardItem>();
items.add(createNewHyperlinkItem(rpe.getPin().getInstance().getPrimitiveSiteName() + "." + rpe.getPin().getName(), pd2));
items.add(new DesignItem(rpe.getType().toString() + " (fanout=" + rpe.getNet().getFanOut() + ")", pd2));
items.add(new DesignItem(String.format("%5.3f", rpe.getDelay()), pd2));
items.add(createNewHyperlinkItem(rpe.getNet().getName(), pd2));
subModels[0].appendRow(items);
}
}
for(PathElement pe : ((PathOffset)pd2).getMinDataPath()){
if(pe.getClass().equals(LogicPathElement.class)){
LogicPathElement lpe = (LogicPathElement) pe;
ArrayList<QStandardItem> items = new ArrayList<QStandardItem>();
items.add(createNewHyperlinkItem(lpe.getInstance().getPrimitiveSiteName() + "." + lpe.getPin().getName(), pd2));
items.add(new DesignItem(lpe.getType().toString(), pd2));
items.add(new DesignItem(String.format("%5.3f", lpe.getDelay()), pd2));
items.add(createNewHyperlinkItem(lpe.getInstance().getName(), pd2));
subModels[1].appendRow(items);
}
else{
RoutingPathElement rpe = (RoutingPathElement) pe;
ArrayList<QStandardItem> items = new ArrayList<QStandardItem>();
items.add(createNewHyperlinkItem(rpe.getPin().getInstance().getPrimitiveSiteName() + "." + rpe.getPin().getName(), pd2));
items.add(new DesignItem(rpe.getType().toString() + " (fanout=" + rpe.getNet().getFanOut() + ")", pd2));
items.add(new DesignItem(String.format("%5.3f", rpe.getDelay()), pd2));
items.add(createNewHyperlinkItem(rpe.getNet().getName(), pd2));
subModels[1].appendRow(items);
}
}
}
break;