* Populates the window with appropriate design/timing data.
*/
public void loadCurrentDesignData(){
switch(this.type){
case NETS:
model = new QStandardItemModel(0, 7, this);
setHeaders(model, new String[]
{"Name", "Type", "Source Instance", "Fanout", "PIP Count", "Module Instance Name", "Module Name"});
if(explorer.design == null) break;
for(Net net : explorer.design.getNets()){
if(net.getPins().size() == 0) continue;
ArrayList<QStandardItem> items = new ArrayList<QStandardItem>();
items.add(new DesignItem(net.getName(), net));
items.add(new DesignItem(net.getType().toString(), net));
items.add(createNewHyperlinkItem(net.getSource() == null ? null : net.getSource().getInstanceName(), net));
items.add(new DesignItem(String.format("%3d", net.getPins().size()-1), net));
items.add(new DesignItem(String.format("%5d", net.getPIPs().size()), net));
items.add(createNewHyperlinkItem(net.getModuleInstance()==null ? null : net.getModuleInstance().getName(), net));
items.add(createNewHyperlinkItem(net.getModuleTemplate()==null ? null : net.getModuleTemplate().getName(), net));
model.appendRow(items);
}
break;
case INSTANCES:
model = new QStandardItemModel(0, 6, this);
setHeaders(model, new String[]
{"Name", "Type", "Primitive Site", "Tile", "Module Instance Name", "Module Name"});
if(explorer.design == null) break;
for(Instance instance : explorer.design.getInstances()){
ArrayList<QStandardItem> items = new ArrayList<QStandardItem>();
items.add(new DesignItem(instance.getName(), instance));
items.add(new DesignItem(instance.getType().toString(), instance));
items.add(createNewHyperlinkItem(instance.getPrimitiveSiteName(), instance));
items.add(createNewHyperlinkItem(instance.getPrimitiveSite()==null ? null : instance.getPrimitiveSite().getTile().toString(), instance));
items.add(createNewHyperlinkItem(instance.getModuleInstanceName(), instance));
items.add(createNewHyperlinkItem(instance.getModuleTemplate()==null ? null : instance.getModuleTemplate().getName(), instance));
model.appendRow(items);
}
break;
case MODULES:
model = new QStandardItemModel(0, 6, this);
setHeaders(model, new String[]
{"Name", "Anchor Name", "Anchor Site", "Instance Count", "Net Count", "Port Count"});
if(explorer.design == null) break;
for(Module module : explorer.design.getModules()){
ArrayList<QStandardItem> items = new ArrayList<QStandardItem>();
items.add(new DesignItem(module.getName(), module));
items.add(new DesignItem(module.getAnchor().getName(), module));
items.add(createNewHyperlinkItem(module.getAnchor().getPrimitiveSiteName(), module));
items.add(new DesignItem(String.format("%5d", module.getInstances().size(), module)));
items.add(new DesignItem(String.format("%5d", module.getNets().size(), module)));
items.add(new DesignItem(String.format("%5d", module.getPorts().size(), module)));
model.appendRow(items);
}
break;
case MODULE_INSTANCES:
model = new QStandardItemModel(0, 4, this);
setHeaders(model, new String[]
{"Name", "Anchor Name", "Anchor Site", "Module Template"});
if(explorer.design == null) break;
for(ModuleInstance moduleInstance : explorer.design.getModuleInstances()){
ArrayList<QStandardItem> items = new ArrayList<QStandardItem>();
items.add(new DesignItem(moduleInstance.getName(), moduleInstance));
items.add(new DesignItem(moduleInstance.getAnchor().getName(), moduleInstance));
items.add(createNewHyperlinkItem(moduleInstance.getAnchor().getPrimitiveSiteName(), moduleInstance));
items.add(createNewHyperlinkItem(moduleInstance.getModule().getName(), moduleInstance));
model.appendRow(items);
}
break;
case DELAYS:
model = new QStandardItemModel(0, 5, this);
setHeaders(model, new String[]
{"Delay", "Source", "Destination", "Data Path Delay", "Levels of Logic"});
if(explorer.delays == null) break;
for(PathDelay pd : explorer.delays){
ArrayList<QStandardItem> items = new ArrayList<QStandardItem>();
items.add(new DesignItem(String.format("%5.3f", pd.getDelay()) + "ns", pd));
items.add(new DesignItem(pd.getSource(), pd));
items.add(new DesignItem(pd.getDestination(), pd));
items.add(new DesignItem(String.format("%5.3f", pd.getDataPathDelay()) + "ns", pd));
items.add(new DesignItem(String.format("%5d", pd.getLevelsOfLogic(), pd)));
model.appendRow(items);
}
break;
case OFFSETS:
model = new QStandardItemModel(0, 7, this);
setHeaders(model, new String[]
{"Offset", "Source", "Destination", "Data Path Delay", "Levels of Logic (Data)", "Clock Path Delay", "Levels of Logic (Clock)"});
if(explorer.offsets == null) break;
for(PathOffset po : explorer.offsets){
ArrayList<QStandardItem> items = new ArrayList<QStandardItem>();