Index: fields.sphash =================================================================== --- fields.sphash (revision 35679) +++ fields.sphash (revision 35680) @@ -56,3 +56,5 @@ netname netseg net +lyt +thermal Index: query.h =================================================================== --- query.h (revision 35679) +++ query.h (revision 35680) @@ -142,6 +142,7 @@ pcb_qry_val_t result; /* of pure functions and subtrees and constant values converted e.g. to coord */ re_se_t *regex; long cnst; /* named constant */ + long iconst; /* integer constant */ pcb_any_obj_t *obj; const pcb_flag_bits_t *flg; vti0_t *it_active; Index: query_access.c =================================================================== --- query_access.c (revision 35679) +++ query_access.c (revision 35680) @@ -830,7 +830,8 @@ { pcb_pstk_t *p = (pcb_pstk_t *)obj; pcb_pstk_proto_t *proto = pcb_pstk_get_proto(p); - query_fields_keys_t fh1; + pcb_qry_node_t *f3; + query_fields_keys_t fh1, fh2; fld2hash_req(fh1, fld, 0); @@ -863,9 +864,32 @@ NETNAME_FIELDS(ec); + /* two or more fh's */ + switch(fh1) { + case query_fields_thermal: + fld2hash_req(fh2, fld, 1); + if (fh2 != query_fields_lyt) + PCB_QRY_RET_INV(res); + + fld_nth_req(f3, fld, 2); + if ((f3->type != PCBQ_DATA_CONST) || (f3->precomp.iconst < 0)) + PCB_QRY_RET_INV(res); + { + int th; + char val[8]; + + rnd_layer_id_t lid = f3->precomp.iconst; + th = lid < p->thermals.used ? p->thermals.shape[lid] : 0; + PCB_QRY_RET_STR(res, pcb_thermal_bits2chars_const(th)); + } + break; + default:; + } + if (fld->next != NULL) PCB_QRY_RET_INV(res); + /* only fh1 */ switch(fh1) { case query_fields_x: PCB_QRY_RET_COORD(res, p->x); case query_fields_y: PCB_QRY_RET_COORD(res, p->y);