use of EAnalysis.BinPacking.Processor in project osate2 by osate.
the class PackingSuccessfulDialog method buildNetArea.
private void buildNetArea(final Composite parent) {
parent.setLayout(new FillLayout());
final Table table = new Table(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
table.setHeaderVisible(true);
table.setLinesVisible(false);
final TableColumn threadsCol = new TableColumn(table, SWT.RIGHT, 0);
threadsCol.setText("Network");
threadsCol.setWidth(150);
threadsCol.setResizable(true);
final TableColumn procsCol = new TableColumn(table, SWT.LEFT, 1);
procsCol.setText("% Available");
procsCol.setWidth(150);
procsCol.setResizable(true);
final Vector processed = new Vector();
for (final Iterator i = hwGraph.iterator(); i.hasNext(); ) {
final Processor p = (Processor) i.next();
for (Iterator nics = p.getNetInterfaces().iterator(); nics.hasNext(); ) {
NetInterface nic = (NetInterface) nics.next();
Link link = nic.getLink();
// avoid duplication
if (processed.contains(link))
continue;
processed.add(link);
final double available = link.getAvailableCapacity() / link.getCyclesPerSecond();
final TableItem row = new TableItem(table, SWT.NONE);
final ComponentInstance bus = (ComponentInstance) link.getSemanticObject();
row.setText(new String[] { bus.getInstanceObjectPath(), Integer.toString((int) (available * 100)) + "%" });
}
}
}
use of EAnalysis.BinPacking.Processor in project osate2 by osate.
the class PackingSuccessfulDialog method buildMsgMappingArea.
private void buildMsgMappingArea(final Composite parent) {
parent.setLayout(new FillLayout());
final Table table = new Table(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
table.setHeaderVisible(true);
table.setLinesVisible(false);
final TableColumn msgCol = new TableColumn(table, SWT.RIGHT, 0);
msgCol.setText("Message");
msgCol.setWidth(150);
msgCol.setResizable(true);
final TableColumn netCol = new TableColumn(table, SWT.LEFT, 1);
netCol.setText("Network");
netCol.setWidth(150);
netCol.setResizable(true);
final Vector processed = new Vector();
for (final Iterator i = hwGraph.iterator(); i.hasNext(); ) {
final Processor p = (Processor) i.next();
for (Iterator nics = p.getNetInterfaces().iterator(); nics.hasNext(); ) {
NetInterface nic = (NetInterface) nics.next();
Link link = nic.getLink();
// avoid duplication
if (processed.contains(link))
continue;
processed.add(link);
final ComponentInstance bus = (ComponentInstance) link.getSemanticObject();
for (Iterator msgs = link.getTaskSet().iterator(); msgs.hasNext(); ) {
Message msg = (Message) msgs.next();
final TableItem row = new TableItem(table, SWT.NONE);
row.setText(new String[] { "Msg[" + Double.toString(msg.getBandwidth()) + "]", bus.getInstanceObjectPath() });
}
}
}
}
Aggregations