@Test public void getDnaDesigns_MockNetlist_ShouldReturnTwoDesigns() throws CelloException { final List<String> designs = DnaPlotLibUtils.getDnaDesigns(DnaPlotLibUtilsTest.netlist, DnaPlotLibUtilsTest.tdi); assert designs.size() == 2; }
public static List<String> getDnaDesigns(final Netlist netlist, final TargetDataInstance tdi) throws CelloException { final List<String> rtn = new ArrayList<>(); rtn.add("design_name,parts,"); final Placements placements = netlist.getResultNetlistData().getPlacements(); for (int i = 0; i < placements.getNumPlacement(); i++) { final List<String> design = new ArrayList<>(); final Placement placement = placements.getPlacementAtIdx(i); String name = placement.getName(); if (name.isEmpty()) { name = netlist.getName() + String.valueOf(i); } design.add(name); for (int j = 0; j < placement.getNumPlacementGroup(); j++) { final PlacementGroup group = placement.getPlacementGroupAtIdx(j); for (int k = 0; k < group.getNumComponent(); k++) { final Component component = group.getComponentAtIdx(k); for (int l = 0; l < component.getNumPart(); l++) { final String obj = component.getPartAtIdx(l); final Collection<String> parts = DnaPlotLibUtils.unNestDevice(obj, component, netlist, tdi); if (parts.size() == 0) { design.add(obj); } else { design.addAll(parts); } } } if (j + 1 < placement.getNumPlacementGroup() && design.size() > 1 && !design.get(design.size() - 1).equals(S_NONCEPAD)) { design.add(S_NONCEPAD); } } final String record = String.join(",", design); rtn.add(record); } return rtn; }
DnaPlotLibUtils { public static List<String> getDnaDesigns(final Netlist netlist, final TargetDataInstance tdi) throws CelloException { final List<String> rtn = new ArrayList<>(); rtn.add("design_name,parts,"); final Placements placements = netlist.getResultNetlistData().getPlacements(); for (int i = 0; i < placements.getNumPlacement(); i++) { final List<String> design = new ArrayList<>(); final Placement placement = placements.getPlacementAtIdx(i); String name = placement.getName(); if (name.isEmpty()) { name = netlist.getName() + String.valueOf(i); } design.add(name); for (int j = 0; j < placement.getNumPlacementGroup(); j++) { final PlacementGroup group = placement.getPlacementGroupAtIdx(j); for (int k = 0; k < group.getNumComponent(); k++) { final Component component = group.getComponentAtIdx(k); for (int l = 0; l < component.getNumPart(); l++) { final String obj = component.getPartAtIdx(l); final Collection<String> parts = DnaPlotLibUtils.unNestDevice(obj, component, netlist, tdi); if (parts.size() == 0) { design.add(obj); } else { design.addAll(parts); } } } if (j + 1 < placement.getNumPlacementGroup() && design.size() > 1 && !design.get(design.size() - 1).equals(S_NONCEPAD)) { design.add(S_NONCEPAD); } } final String record = String.join(",", design); rtn.add(record); } return rtn; } }
DnaPlotLibUtils { public static List<String> getDnaDesigns(final Netlist netlist, final TargetDataInstance tdi) throws CelloException { final List<String> rtn = new ArrayList<>(); rtn.add("design_name,parts,"); final Placements placements = netlist.getResultNetlistData().getPlacements(); for (int i = 0; i < placements.getNumPlacement(); i++) { final List<String> design = new ArrayList<>(); final Placement placement = placements.getPlacementAtIdx(i); String name = placement.getName(); if (name.isEmpty()) { name = netlist.getName() + String.valueOf(i); } design.add(name); for (int j = 0; j < placement.getNumPlacementGroup(); j++) { final PlacementGroup group = placement.getPlacementGroupAtIdx(j); for (int k = 0; k < group.getNumComponent(); k++) { final Component component = group.getComponentAtIdx(k); for (int l = 0; l < component.getNumPart(); l++) { final String obj = component.getPartAtIdx(l); final Collection<String> parts = DnaPlotLibUtils.unNestDevice(obj, component, netlist, tdi); if (parts.size() == 0) { design.add(obj); } else { design.addAll(parts); } } } if (j + 1 < placement.getNumPlacementGroup() && design.size() > 1 && !design.get(design.size() - 1).equals(S_NONCEPAD)) { design.add(S_NONCEPAD); } } final String record = String.join(",", design); rtn.add(record); } return rtn; }  }
DnaPlotLibUtils { public static List<String> getDnaDesigns(final Netlist netlist, final TargetDataInstance tdi) throws CelloException { final List<String> rtn = new ArrayList<>(); rtn.add("design_name,parts,"); final Placements placements = netlist.getResultNetlistData().getPlacements(); for (int i = 0; i < placements.getNumPlacement(); i++) { final List<String> design = new ArrayList<>(); final Placement placement = placements.getPlacementAtIdx(i); String name = placement.getName(); if (name.isEmpty()) { name = netlist.getName() + String.valueOf(i); } design.add(name); for (int j = 0; j < placement.getNumPlacementGroup(); j++) { final PlacementGroup group = placement.getPlacementGroupAtIdx(j); for (int k = 0; k < group.getNumComponent(); k++) { final Component component = group.getComponentAtIdx(k); for (int l = 0; l < component.getNumPart(); l++) { final String obj = component.getPartAtIdx(l); final Collection<String> parts = DnaPlotLibUtils.unNestDevice(obj, component, netlist, tdi); if (parts.size() == 0) { design.add(obj); } else { design.addAll(parts); } } } if (j + 1 < placement.getNumPlacementGroup() && design.size() > 1 && !design.get(design.size() - 1).equals(S_NONCEPAD)) { design.add(S_NONCEPAD); } } final String record = String.join(",", design); rtn.add(record); } return rtn; }  static void writeCSV(final Collection<String> records, final File file); static String getRgb(final Color color); static String getPartType(final String type); static List<String> getDnaDesigns(final Netlist netlist, final TargetDataInstance tdi); static List<String> getPartsInformation(
      final Netlist netlist, final TargetDataInstance tdi); static List<String> getRegulatoryInformation(
      final Netlist netlist, final TargetDataInstance tdi); }
DnaPlotLibUtils { public static List<String> getDnaDesigns(final Netlist netlist, final TargetDataInstance tdi) throws CelloException { final List<String> rtn = new ArrayList<>(); rtn.add("design_name,parts,"); final Placements placements = netlist.getResultNetlistData().getPlacements(); for (int i = 0; i < placements.getNumPlacement(); i++) { final List<String> design = new ArrayList<>(); final Placement placement = placements.getPlacementAtIdx(i); String name = placement.getName(); if (name.isEmpty()) { name = netlist.getName() + String.valueOf(i); } design.add(name); for (int j = 0; j < placement.getNumPlacementGroup(); j++) { final PlacementGroup group = placement.getPlacementGroupAtIdx(j); for (int k = 0; k < group.getNumComponent(); k++) { final Component component = group.getComponentAtIdx(k); for (int l = 0; l < component.getNumPart(); l++) { final String obj = component.getPartAtIdx(l); final Collection<String> parts = DnaPlotLibUtils.unNestDevice(obj, component, netlist, tdi); if (parts.size() == 0) { design.add(obj); } else { design.addAll(parts); } } } if (j + 1 < placement.getNumPlacementGroup() && design.size() > 1 && !design.get(design.size() - 1).equals(S_NONCEPAD)) { design.add(S_NONCEPAD); } } final String record = String.join(",", design); rtn.add(record); } return rtn; }  static void writeCSV(final Collection<String> records, final File file); static String getRgb(final Color color); static String getPartType(final String type); static List<String> getDnaDesigns(final Netlist netlist, final TargetDataInstance tdi); static List<String> getPartsInformation(
      final Netlist netlist, final TargetDataInstance tdi); static List<String> getRegulatoryInformation(
      final Netlist netlist, final TargetDataInstance tdi);  }