Ignore:
Timestamp:
08/02/09 21:42:23 (4 years ago)
Author:
werner
Message:
  • widths can now be edited
  • when selecting a measurement, the offset is now shown in the name field
  • fixed integer overflow in dist_line_xy
File:
1 edited

Legend:

Unmodified
Added
Removed
  • developers/werner/fped/inst.c

    r5367 r5368  
    183183 
    184184 
    185 static void rect_status(struct coord a, struct coord b) 
     185static void rect_status(struct coord a, struct coord b, unit_type width) 
    186186{ 
    187187        struct coord d = sub_vec(b, a); 
     
    198198        } 
    199199        status_set_r("r = %5.2f mm", hypot(units_to_mm(d.x), units_to_mm(d.y))); 
     200        if (width != -1) 
     201                status_set_name("width = %5.2f mm", units_to_mm(width)); 
    200202} 
    201203 
     
    269271{ 
    270272        status_set_name(self->vec->name ? self->vec->name : ""); 
    271         rect_status(self->base, self->u.rect.end); 
     273        rect_status(self->base, self->u.rect.end, -1); 
    272274        edit_unique_null(&self->vec->name, validate_vec_name, self->vec); 
    273275} 
     
    308310static void line_op_select(struct inst *self) 
    309311{ 
    310         rect_status(self->bbox.min, self->bbox.max); 
     312        rect_status(self->bbox.min, self->bbox.max, self->u.rect.width); 
     313        edit_expr(&self->obj->u.line.width); 
    311314} 
    312315 
     
    347350static void rect_op_select(struct inst *self) 
    348351{ 
    349         rect_status(self->bbox.min, self->bbox.max); 
     352        rect_status(self->bbox.min, self->bbox.max, self->u.rect.width); 
     353        edit_expr(&self->obj->u.rect.width); 
    350354} 
    351355 
     
    399403{ 
    400404        status_set_name(self->u.name); 
    401         rect_status(self->bbox.min, self->bbox.max); 
     405        rect_status(self->bbox.min, self->bbox.max, -1); 
    402406        edit_name(&self->obj->u.pad.name, validate_pad_name, NULL); 
    403407} 
     
    443447            self->u.arc.a2-self->u.arc.a1); 
    444448        status_set_r("r = %5.2f mm", units_to_mm(self->u.arc.r)); 
     449        status_set_name("width = %5.2f mm", units_to_mm(self->u.arc.width)); 
     450        edit_expr(&self->obj->u.arc.width); 
    445451} 
    446452 
     
    496502static void meas_op_select(struct inst *self) 
    497503{ 
    498         rect_status(self->bbox.min, self->bbox.max); 
     504        rect_status(self->bbox.min, self->bbox.max, -1); 
     505        status_set_name("offset = %5.2f mm", units_to_mm(self->u.meas.offset)); 
    499506        edit_expr(&self->obj->u.meas.offset); 
    500507} 
Note: See TracChangeset for help on using the changeset viewer.