Commit 5951a7f9 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Pcbnew: fix an issue when collecting vias (for instance when left clicking on...

Pcbnew: fix an issue when collecting vias (for instance when left clicking on a via, it was not always detected)
This bug was mainly noticeable when using buried vias (some were never detected)
Minor other fixes (typos, strings hard to translate ...)
parent 7c0af1bf
Loading
Loading
Loading
Loading
+7 −29
Original line number Original line Diff line number Diff line
@@ -867,10 +867,6 @@ void EDGE_MODULE::Draw3D( EDA_3D_CANVAS* glcanvas )
// Draw 3D pads.
// Draw 3D pads.
void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas )
void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas )
{
{
    int layer, nlmax;
    bool    Oncu, Oncmp, Both;
    int     color;

    double scale = g_Parm_3D_Visu.m_BiuTo3Dunits;
    double scale = g_Parm_3D_Visu.m_BiuTo3Dunits;


    // Calculate the center of the pad shape.
    // Calculate the center of the pad shape.
@@ -932,10 +928,7 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas )


    glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis
    glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis


    nlmax = g_Parm_3D_Visu.m_CopperLayersCount - 1;
    int nlmax = g_Parm_3D_Visu.m_CopperLayersCount - 1;
    Oncu  = (m_layerMask & LAYER_BACK) ? true : false;
    Oncmp = (m_layerMask & LAYER_FRONT) ? true : false;
    Both  = Oncu && Oncmp;


    // Store here the points to approximate pad shape by segments
    // Store here the points to approximate pad shape by segments
    std::vector<CPolyPt> polyPadShape;
    std::vector<CPolyPt> polyPadShape;
@@ -943,26 +936,18 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas )
    switch( GetShape() )
    switch( GetShape() )
    {
    {
    case PAD_CIRCLE:
    case PAD_CIRCLE:
        for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
        for( int layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
        {
        {
            if( layer && (layer == nlmax) )
            if( layer && (layer == nlmax) )
                layer = LAYER_N_FRONT;
                layer = LAYER_N_FRONT;


            if( (layer == LAYER_N_FRONT) && !Oncmp )
            if( !IsOnLayer( layer ) )
                continue;

            if( (layer == LAYER_N_BACK) && !Oncu )
                continue;
                continue;


            if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER) && !Both )
                continue;

            color = g_ColorsSettings.GetLayerColor( layer );

            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
                continue;
                continue;


            SetGLColor( color );
            SetGLColor( g_ColorsSettings.GetLayerColor( layer ) );
            int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer );
            int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer );
            int ring_radius = (m_Size.x + m_Drill.x) / 4;
            int ring_radius = (m_Size.x + m_Drill.x) / 4;
            if( thickness == 0 )
            if( thickness == 0 )
@@ -1022,25 +1007,18 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas )


    if( polyPadShape.size() )
    if( polyPadShape.size() )
    {
    {
        for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
        for( int layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
        {
        {
            if( layer && (layer == nlmax) )
            if( layer && (layer == nlmax) )
                layer = LAYER_N_FRONT;
                layer = LAYER_N_FRONT;


            if( (layer == LAYER_N_FRONT) && !Oncmp )
            if( !IsOnLayer( layer ) )
                continue;

            if( (layer == LAYER_N_BACK) && !Oncu )
                continue;

            if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER) && !Both )
                continue;
                continue;


            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
            if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
                continue;
                continue;


            color = g_ColorsSettings.GetLayerColor( layer );
            SetGLColor( g_ColorsSettings.GetLayerColor( layer ) );
            SetGLColor( color );


            if( thickness == 0 )
            if( thickness == 0 )
                glNormal3f( 0.0, 0.0, Get3DLayer_Z_Orientation( layer ) );
                glNormal3f( 0.0, 0.0, Get3DLayer_Z_Orientation( layer ) );
+1 −1
Original line number Original line Diff line number Diff line
@@ -356,7 +356,7 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
    }
    }
    else
    else
    {
    {
        msg.Printf( _( "Help file %s not found." ), GetChars( wxGetApp().GetHelpFileName() ) );
        msg.Printf( _( "Help file %s could not be found." ), GetChars( wxGetApp().GetHelpFileName() ) );
        wxMessageBox( msg );
        wxMessageBox( msg );
    }
    }


+1 −1
Original line number Original line Diff line number Diff line
@@ -58,7 +58,7 @@ void DisplayInfoMessage( wxWindow* parent, const wxString& text, int displaytime
{
{
    wxMessageDialog* dialog;
    wxMessageDialog* dialog;


    dialog = new wxMessageDialog( parent, text, _( "Info:" ),
    dialog = new wxMessageDialog( parent, text, _( "Info" ),
                                  wxOK | wxCENTRE | wxICON_INFORMATION );
                                  wxOK | wxCENTRE | wxICON_INFORMATION );


    dialog->ShowModal();
    dialog->ShowModal();
+7 −3
Original line number Original line Diff line number Diff line
@@ -27,6 +27,7 @@


#include <class_module.h>
#include <class_module.h>
#include <class_pad.h>
#include <class_pad.h>
#include <class_track.h>
#include <class_marker_pcb.h>
#include <class_marker_pcb.h>




@@ -148,6 +149,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, const void* testDa
    MODULE*     module = NULL;
    MODULE*     module = NULL;
    D_PAD*      pad    = NULL;
    D_PAD*      pad    = NULL;
    bool        pad_through = false;
    bool        pad_through = false;
    SEGVIA*     via    = NULL;
    MARKER_PCB* marker = NULL;
    MARKER_PCB* marker = NULL;


#if 0   // debugging
#if 0   // debugging
@@ -249,7 +251,8 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, const void* testDa


        break;
        break;


    case PCB_VIA_T:
    case PCB_VIA_T:     // vias are on many layers, so layer test is specific
        via = (SEGVIA*) item;
        break;
        break;


    case PCB_TRACE_T:
    case PCB_TRACE_T:
@@ -351,7 +354,8 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, const void* testDa


        // Modules and their subcomponents: text and pads are not sensitive to the layer
        // Modules and their subcomponents: text and pads are not sensitive to the layer
        // visibility controls.  They all have their own separate visibility controls
        // visibility controls.  They all have their own separate visibility controls
        if( module || pad || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() )
        // for vias, GetLayer() has no meaning, but IsOnLayer() works fine
        if( via || module || pad || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() )
        {
        {
            if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
            if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
            {
            {
@@ -378,7 +382,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, const void* testDa


        // Modules and their subcomponents: text and pads are not sensitive to the layer
        // Modules and their subcomponents: text and pads are not sensitive to the layer
        // visibility controls.  They all have their own separate visibility controls
        // visibility controls.  They all have their own separate visibility controls
        if( module || pad || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() )
        if( via || module || pad || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() )
        {
        {
            if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
            if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
            {
            {