Search in sources :

Example 1 with Processor

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)) + "%" });
        }
    }
}
Also used : Table(org.eclipse.swt.widgets.Table) Processor(EAnalysis.BinPacking.Processor) NetInterface(EAnalysis.BinPacking.NetInterface) TableItem(org.eclipse.swt.widgets.TableItem) Iterator(java.util.Iterator) ComponentInstance(org.osate.aadl2.instance.ComponentInstance) FillLayout(org.eclipse.swt.layout.FillLayout) TableColumn(org.eclipse.swt.widgets.TableColumn) Vector(java.util.Vector) Link(EAnalysis.BinPacking.Link)

Example 2 with Processor

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() });
            }
        }
    }
}
Also used : Table(org.eclipse.swt.widgets.Table) Processor(EAnalysis.BinPacking.Processor) Message(EAnalysis.BinPacking.Message) NetInterface(EAnalysis.BinPacking.NetInterface) TableItem(org.eclipse.swt.widgets.TableItem) Iterator(java.util.Iterator) ComponentInstance(org.osate.aadl2.instance.ComponentInstance) FillLayout(org.eclipse.swt.layout.FillLayout) TableColumn(org.eclipse.swt.widgets.TableColumn) Vector(java.util.Vector) Link(EAnalysis.BinPacking.Link)

Aggregations

Link (EAnalysis.BinPacking.Link)2 NetInterface (EAnalysis.BinPacking.NetInterface)2 Processor (EAnalysis.BinPacking.Processor)2 Iterator (java.util.Iterator)2 Vector (java.util.Vector)2 FillLayout (org.eclipse.swt.layout.FillLayout)2 Table (org.eclipse.swt.widgets.Table)2 TableColumn (org.eclipse.swt.widgets.TableColumn)2 TableItem (org.eclipse.swt.widgets.TableItem)2 ComponentInstance (org.osate.aadl2.instance.ComponentInstance)2 Message (EAnalysis.BinPacking.Message)1