--- gsch2pcb.c.orig 2005-01-12 11:22:49.000000000 -0600 +++ gsch2pcb.c 2005-01-12 11:18:47.000000000 -0600 @@ -94,7 +94,7 @@ n_none, n_empty; -static gboolean remove_unfound_elements, +static gboolean remove_unfound_elements = TRUE, force_element_files, preserve, fix_elements, @@ -1086,9 +1086,15 @@ if (!strcmp(config, "remove-unfound") || !strcmp(config, "r")) { + /* This is default behavior set in header section */ remove_unfound_elements = TRUE; return 0; } + if (!strcmp(config, "keep-unfound") || !strcmp(config, "k")) + { + remove_unfound_elements = FALSE; + return 0; + } if (!strcmp(config, "preserve") || !strcmp(config, "p")) { preserve = TRUE; @@ -1202,6 +1208,11 @@ " -r, --remove-unfound Don't include references to unfound elements in\n" " the generated .pcb files. Use if you want PCB to\n" " be able to load the (incomplete) .pcb file.\n" +" This is the default behavior.\n" +" -k, --keep-unfound Keep include references to unfound elements in\n" +" the generated .pcb files. Use if you want to hand\n" +" edit or otherwise preprocess the generated .pcb file\n" +" before running pcb.\n" " -p, --preserve Preserve elements in PCB files which are not found\n" " in the schematics. Note that elements with an empty\n" " element name (schematic refdes) are never deleted,\n" @@ -1302,6 +1313,7 @@ *tmp; gint i; gboolean initial_pcb = TRUE; + gboolean created_pcb_file = TRUE; if (argc < 2) usage(); @@ -1390,8 +1402,10 @@ update_element_descriptions(pcb_file_name, bak_file_name); prune_elements(pcb_file_name, bak_file_name); + /* Report work done during processing */ if (verbose) printf("\n"); + printf("\nDone processing. Work performed:\n"); if (n_deleted > 0 || n_fixed > 0 || need_PKG_purge || n_changed_value > 0) printf("%s is backed up as %s.\n", pcb_file_name, bak_file_name); @@ -1401,8 +1415,12 @@ if (n_added_ef + n_added_m4 > 0) printf("%d file elements and %d m4 elements added to %s.\n", n_added_ef, n_added_m4, pcb_new_file_name); - else if (n_not_found == 0) - printf("No elements to add so not creating %s\n", pcb_new_file_name); + else if (n_not_found == 0) + { + printf("No elements to add so not creating %s\n", pcb_new_file_name); + created_pcb_file = FALSE; + } + if (n_not_found > 0) { printf("%d not found elements added to %s.\n", @@ -1423,14 +1441,46 @@ if (n_fixed > 0) printf("%d elements fixed in %s.\n", n_fixed, pcb_file_name); if (n_PKG_removed_old > 0) - printf("%d unknown elements removed from %s.\n", - n_PKG_removed_old, pcb_file_name); + { + printf("%d elements could not be found.", n_PKG_removed_old); + if (created_pcb_file) + printf(" So %s is incomplete.\n", pcb_file_name); + else + printf("\n"); + } if (n_PKG_removed_new > 0) - printf("%d unknown elements removed from %s.\n", - n_PKG_removed_new, pcb_new_file_name); + { + printf("%d elements could not be found.", n_PKG_removed_new); + if (created_pcb_file) + printf(" So %s is incomplete.\n", pcb_new_file_name); + else + printf("\n"); + } if (n_preserved > 0) printf("%d elements not in the schematic preserved in %s.\n", n_preserved, pcb_file_name); + /* Tell user what to do next */ + if (verbose) + printf("\n"); + + if (n_added_ef + n_added_m4 > 0) + { + if (initial_pcb) + { + printf("\nNext step:\n"); + printf("\tRun pcb on your file %s.\n", pcb_file_name); + } + else + { + printf("\nNext steps:\n"); + printf("\tRun pcb on your file %s. From within PCB, select\n", + pcb_file_name); + printf("\t\"file -> Load layout data to paste buffer\" and copy new\n"); + printf("\tfootprints from %s into your existing layout.\n", + pcb_new_file_name); + } + } + return 0; }