private static boolean via_exists( IntPoint p_location, library.Padstack p_padstack, int[] p_net_no_arr, board.BasicBoard p_board) { ItemSelectionFilter filter = new ItemSelectionFilter(ItemSelectionFilter.SelectableChoices.VIAS); int from_layer = p_padstack.from_layer(); int to_layer = p_padstack.to_layer(); Collection<Item> picked_items = p_board.pick_items(p_location, p_padstack.from_layer(), filter); for (Item curr_item : picked_items) { Via curr_via = (Via) curr_item; if (curr_via.nets_equal(p_net_no_arr) && curr_via.get_center().equals(p_location) && curr_via.first_layer() == from_layer && curr_via.last_layer() == to_layer) { return true; } } return false; }
private static void write_via_scope(WriteScopeParameter p_par, Via p_via) throws java.io.IOException { library.Padstack via_padstack = p_via.get_padstack(); FloatPoint via_location = p_via.get_center().to_float(); double[] via_coor = p_par.coordinate_transform.board_to_dsn(via_location); int net_no; rules.Net via_net; if (p_via.net_count() > 0) { net_no = p_via.get_net_no(0); via_net = p_par.board.rules.nets.get(net_no); } else { net_no = 0; via_net = null; } p_par.file.start_scope(); p_par.file.write("via "); p_par.identifier_type.write(via_padstack.name, p_par.file); for (int i = 0; i < via_coor.length; ++i) { p_par.file.write(" "); p_par.file.write((new Double(via_coor[i])).toString()); } if (via_net != null) { write_net(via_net, p_par.file, p_par.identifier_type); } Rule.write_item_clearance_class( p_par.board.rules.clearance_matrix.get_name(p_via.clearance_class_no()), p_par.file, p_par.identifier_type); write_fixed_state(p_par.file, p_via.get_fixed_state()); p_par.file.end_scope(); }