Index: src_plugins/io_pads/delay_create.c =================================================================== --- src_plugins/io_pads/delay_create.c (revision 33755) +++ src_plugins/io_pads/delay_create.c (revision 33756) @@ -62,6 +62,9 @@ { pcb_dlcr_layer_t **p; + if (layer->id < 0) + layer->id = dlcr->id2layer.used; + htsp_set(&dlcr->name2layer, layer->name, layer); p = (pcb_dlcr_layer_t **)vtp0_get(&dlcr->id2layer, layer->id, 1); *p = layer; @@ -284,6 +287,20 @@ else ly = (*dlp)->ly; } + else if (obj->val.obj.lyt != 0) { + long n; + for(n = 0; n < dlcr->id2layer.used; n++) { + pcb_dlcr_layer_t *dl = dlcr->id2layer.array[n]; + if (dl->lyt == obj->val.obj.lyt) { + ly = dl->ly; + break; + } + } + if (ly == NULL) { + rnd_message(RND_MSG_ERROR, "delay create: invalid layer type '%x' (loc: %ld)\n", obj->val.obj.lyt, obj->loc_line); + return NULL; + } + } if ((ly == NULL) && (obj->val.obj.layer_name != NULL)) { pcb_dlcr_layer_t *dl = htsp_get(&dlcr->name2layer, obj->val.obj.layer_name); *specd = 1; Index: src_plugins/io_pads/delay_create.h =================================================================== --- src_plugins/io_pads/delay_create.h (revision 33755) +++ src_plugins/io_pads/delay_create.h (revision 33756) @@ -49,6 +49,7 @@ pcb_pstk_t pstk; } obj; long layer_id; + pcb_layer_type_t lyt; char *layer_name; } obj; struct { Index: src_plugins/io_pads/read_high.c =================================================================== --- src_plugins/io_pads/read_high.c (revision 33755) +++ src_plugins/io_pads/read_high.c (revision 33756) @@ -330,9 +330,23 @@ TODO("do not ignore text alignment"); text = pcb_dlcr_text_new(&rctx->dlcr, x+xo, y+yo+w*9, rot, scale, 0, str); - text->val.obj.layer_id = level; text->loc_line = rctx->line; + if (is_label) { + text->val.obj.layer_id = -1; + switch(level) { + case 1: text->val.obj.lyt = PCB_LYT_TOP | PCB_LYT_SILK; break; + case 2: text->val.obj.lyt = PCB_LYT_BOTTOM | PCB_LYT_SILK; break; TODO("need to check what happens on the bottom side, is it really LID 2?"); + default: + TODO("Figure what does this mean"); + PADS_ERROR((RND_MSG_ERROR, "invalid label level %ld\n", level)); + text->val.obj.layer_id = level; + break; + } + } + else + text->val.obj.layer_id = level; + pads_eatup_till_nl(rctx); return 1;