Index: trunk/src/view.c =================================================================== --- trunk/src/view.c (revision 35144) +++ trunk/src/view.c (revision 35145) @@ -46,6 +46,7 @@ #include #include "conf_core.h" +#include "netlist.h" static unsigned long int pcb_view_next_uid = 0; @@ -55,6 +56,8 @@ pcb_idpath_list_clear(&item->objs[0]); pcb_idpath_list_clear(&item->objs[1]); free(item->title); + free(item->netname[0]); + free(item->netname[1]); if (item->long_desc.used == 0) free(item->description); @@ -160,6 +163,9 @@ else pcb_idpath_list_append(&view->objs[grp], idp); break; + case PCB_OBJ_NET: + view->netname[grp] = rnd_strdup(((pcb_net_t *)obj)->name); + break; default: rnd_message(RND_MSG_ERROR, "Internal error in pcb_drc_append_obj: unknown object type %i\n", obj->type); } @@ -269,6 +275,11 @@ } } + if (v->netname[0] != NULL) + rnd_append_printf(dst, "%s netname.0 = {%s}\n", prefix, v->netname[0]); + if (v->netname[1] != NULL) + rnd_append_printf(dst, "%s netname.0 = {%s}\n", prefix, v->netname[1]); + switch(v->data_type) { case PCB_VIEW_PLAIN: rnd_append_printf(dst, "%s data_type = plain\n", prefix); @@ -535,6 +546,17 @@ if ((n != NULL) && (n->type == LHT_LIST)) pcb_view_load_objs(dst, 1, n); + n = lht_dom_hash_get(ctx->next, "netname.0"); + if ((n != NULL) && (n->type == LHT_TEXT)) { + dst->netname[0] = n->data.text.value; + n->data.text.value = NULL; + } + n = lht_dom_hash_get(ctx->next, "netname.1"); + if ((n != NULL) && (n->type == LHT_TEXT)) { + dst->netname[1] = n->data.text.value; + n->data.text.value = NULL; + } + switch(dst->data_type) { case PCB_VIEW_PLAIN: break; case PCB_VIEW_DRC: Index: trunk/src/view.h =================================================================== --- trunk/src/view.h (revision 35144) +++ trunk/src/view.h (revision 35145) @@ -63,6 +63,7 @@ rnd_coord_t x, y; /* optional: a coord to mark on the preview */ pcb_idpath_list_t objs[2]; /* optional: two groups of objects to highlight on preview */ + char *netname[2]; /* optional: two net names (when either group is a net) */ gds_t long_desc; /* optional: if non-empty, description shall point to long_desc.array */