/** * Do the actual autoplacement. * @param aManual - if true, use extra heuristics for smarter placement when manually * called up. */ void DoAutoplace( bool aManual ) { bool force_wire_spacing = false; SIDE field_side = choose_side_for_fields( aManual ); wxPoint fbox_pos = field_box_placement( field_side ); EDA_RECT field_box( fbox_pos, m_fbox_size ); if( aManual ) force_wire_spacing = fit_fields_between_wires( &field_box, field_side ); // Move the fields int last_y_coord = field_box.GetTop(); for( unsigned field_idx = 0; field_idx < m_fields.size(); ++field_idx ) { SCH_FIELD* field = m_fields[field_idx]; if( m_allow_rejustify ) justify_field( field, field_side ); wxPoint pos( field_horiz_placement( field, field_box ), field_vert_placement( field, field_box, &last_y_coord, !force_wire_spacing ) ); if( m_align_to_grid ) { pos.x = round_n( pos.x, 50, field_side.x >= 0 ); pos.y = round_n( pos.y, 50, field_side.y == 1 ); } field->SetPosition( pos ); } }
float change_float_param(float param){ static int temp =0; if((int)nxt_motor_get_count(NXT_PORT_C) - temp>0){ param=param+ADJUST_FLOAT_STEP; } else if((int)nxt_motor_get_count(NXT_PORT_C) - temp<0){ param=param-ADJUST_FLOAT_STEP; } temp=(int)nxt_motor_get_count(NXT_PORT_C); systick_wait_ms(100); param= round_n(param,2); return param; }