Commit 1913758d authored by charras's avatar charras
Browse files

pcbnew: finished control of local masks clearance and local net clearance in footprints and pads

parent c4f16f80
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -305,6 +305,8 @@ bool MODULE::Save( FILE* aFile ) const
        fprintf( aFile, ".SolderPaste %d\n",m_LocalSolderPasteMargin);
    if( m_LocalSolderPasteMarginRatio != 0)
        fprintf( aFile, ".SolderPasteRatio %g\n",m_LocalSolderPasteMarginRatio);
    if( m_LocalClearance != 0 )
        fprintf( aFile, ".LocalClearance %d\n",m_LocalClearance );

    // attributes
    if( m_Attributs != MOD_DEFAULT )
@@ -612,6 +614,8 @@ int MODULE::ReadDescr( FILE* File, int* LineNum )
                m_LocalSolderPasteMargin = atoi(Line+13);
            else if( strnicmp(Line, ".SolderPasteRatio ", 18) == 0 )
                m_LocalSolderPasteMarginRatio = atof(Line+18);
            else if( strnicmp(Line, ".LocalClearance ", 16 ) == 0 )
                m_LocalClearance = atoi(Line+16);
           break;

        default:
+4 −0
Original line number Diff line number Diff line
@@ -454,6 +454,8 @@ int D_PAD::ReadDescr( FILE* File, int* LineNum )
                m_LocalSolderPasteMargin = atoi(Line+13);
            else if( strnicmp(Line, ".SolderPasteRatio ", 18 ) == 0 )
                m_LocalSolderPasteMarginRatio = atoi(Line+18);
            else if( strnicmp(Line, ".LocalClearance ", 16 ) == 0 )
                m_LocalClearance = atoi(Line+16);
            break;

        default:
@@ -540,6 +542,8 @@ bool D_PAD::Save( FILE* aFile ) const
        fprintf( aFile, ".SolderPaste %d\n",m_LocalSolderPasteMargin);
    if( m_LocalSolderPasteMarginRatio != 0)
        fprintf( aFile, ".SolderPasteRatio %g\n",m_LocalSolderPasteMarginRatio);
    if( m_LocalClearance != 0 )
        fprintf( aFile, ".LocalClearance %d\n",m_LocalClearance );

    if( fprintf( aFile, "$EndPAD\n" ) != sizeof("$EndPAD\n") - 1 )
        return false;
+16 −5
Original line number Diff line number Diff line
@@ -101,17 +101,26 @@ void DIALOG_MODULE_BOARD_EDITOR::InitBoardProperties()
    m_OrientValue->SetValue( msg );
    m_OrientValue->Enable( select );

    // Initialize dilaog relative to masks clearances
    // Initialize dialog relative to masks clearances
    m_NetClearanceUnits->SetLabel( GetUnitsLabel( g_UnitMetric ) );
    m_SolderMaskMarginUnits->SetLabel( GetUnitsLabel( g_UnitMetric ) );
    m_SolderPasteMarginUnits->SetLabel( GetUnitsLabel( g_UnitMetric ) );

    int Internal_Unit = m_Parent->m_InternalUnits;
    int internalUnit = m_Parent->m_InternalUnits;
    PutValueInLocalUnits( *m_NetClearanceValueCtrl,
                          m_CurrentModule->m_LocalClearance, internalUnit );
    PutValueInLocalUnits( *m_SolderMaskMarginCtrl,
                          m_CurrentModule->m_LocalSolderMaskMargin,
                          Internal_Unit );
                          internalUnit );
    // These 2 parameters are usually < 0, so prepare entering a negative value, if current is 0
    PutValueInLocalUnits( *m_SolderPasteMarginCtrl,
                          m_CurrentModule->m_LocalSolderPasteMargin,
                          Internal_Unit );
                          internalUnit );
    if( m_CurrentModule->m_LocalSolderPasteMargin == 0 )
        m_SolderPasteMarginCtrl->SetValue( wxT("-") + m_SolderPasteMarginCtrl->GetValue() );
    if( m_CurrentModule->m_LocalSolderPasteMarginRatio == 0.0 )
        msg.Printf( wxT( "-%.1f" ), m_CurrentModule->m_LocalSolderPasteMarginRatio * 100.0 );
    else
        msg.Printf( wxT( "%.1f" ), m_CurrentModule->m_LocalSolderPasteMarginRatio * 100.0 );
    m_SolderPasteMarginRatioCtrl->SetValue( msg );
}
@@ -430,6 +439,8 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
    }

    // Initialize masks clearances
    m_CurrentModule->m_LocalClearance =
        ReturnValueFromTextCtrl( *m_NetClearanceValueCtrl,  m_Parent->m_InternalUnits );
    m_CurrentModule->m_LocalSolderMaskMargin =
        ReturnValueFromTextCtrl( *m_SolderMaskMarginCtrl, m_Parent->m_InternalUnits );
    m_CurrentModule->m_LocalSolderPasteMargin =
+28 −6
Original line number Diff line number Diff line
@@ -153,13 +153,35 @@ DIALOG_MODULE_BOARD_EDITOR_BASE::DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* pare
	fgSizerClearances->SetFlexibleDirection( wxBOTH );
	fgSizerClearances->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
	
	m_staticTextNetClearance = new wxStaticText( m_PanelProperties, wxID_ANY, _("All pads nets clearance"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticTextNetClearance->Wrap( -1 );
	m_staticTextNetClearance->SetToolTip( _("This is the local net clearance for all pad of this footprint\nIf 0, the Netclass values are used\nThis value can be superseded by a pad local value.") );
	
	fgSizerClearances->Add( m_staticTextNetClearance, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
	
	m_NetClearanceValueCtrl = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	fgSizerClearances->Add( m_NetClearanceValueCtrl, 0, wxALL, 5 );
	
	m_NetClearanceUnits = new wxStaticText( m_PanelProperties, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 );
	m_NetClearanceUnits->Wrap( -1 );
	fgSizerClearances->Add( m_NetClearanceUnits, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_staticline1 = new wxStaticLine( m_PanelProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
	fgSizerClearances->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
	
	m_staticline2 = new wxStaticLine( m_PanelProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
	fgSizerClearances->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
	
	m_staticline3 = new wxStaticLine( m_PanelProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
	fgSizerClearances->Add( m_staticline3, 0, wxEXPAND | wxALL, 5 );
	
	m_MaskClearanceTitle = new wxStaticText( m_PanelProperties, wxID_ANY, _("Solder mask clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_MaskClearanceTitle->Wrap( -1 );
	m_MaskClearanceTitle->SetToolTip( _("This is the local clearance between pads and the solder mask\nfor this footprint\nThis value can be superseded by a pad local value.\nIf 0, the global value is used") );
	
	fgSizerClearances->Add( m_MaskClearanceTitle, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_SolderMaskMarginCtrl = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	m_SolderMaskMarginCtrl->SetToolTip( _("This is the global clearance between pads and the solder mask\nThis value can be superseded by a pad local value.") );
	
	fgSizerClearances->Add( m_SolderMaskMarginCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_SolderMaskMarginUnits = new wxStaticText( m_PanelProperties, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 );
@@ -168,11 +190,11 @@ DIALOG_MODULE_BOARD_EDITOR_BASE::DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* pare
	
	m_staticTextSolderPaste = new wxStaticText( m_PanelProperties, wxID_ANY, _("Solder paste clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticTextSolderPaste->Wrap( -1 );
	m_staticTextSolderPaste->SetToolTip( _("This is the local clearance between pads and the solder paste\nfor this footprint.\nThis value can be superseded by a pad local values.\nThe final clearance value is the sum of this value and the clearance value ratio\nA negative value means a smaller mask size than pad size") );
	
	fgSizerClearances->Add( m_staticTextSolderPaste, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
	
	m_SolderPasteMarginCtrl = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	m_SolderPasteMarginCtrl->SetToolTip( _("This is the global clearance between pads and the solder paste\nThis value can be superseded by a pad local values.\nThe final clearance value is the sum of this value and the clearance value ratio\nA negative value means a smaller mask size than pad size") );
	
	fgSizerClearances->Add( m_SolderPasteMarginCtrl, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
	
	m_SolderPasteMarginUnits = new wxStaticText( m_PanelProperties, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 );
@@ -181,11 +203,11 @@ DIALOG_MODULE_BOARD_EDITOR_BASE::DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* pare
	
	m_staticTextRatio = new wxStaticText( m_PanelProperties, wxID_ANY, _("Solder mask ratio clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticTextRatio->Wrap( -1 );
	m_staticTextRatio->SetToolTip( _("This is the local clearance ratio in per cent between pads and the solder paste\nfor this footprint.\nA value of 10 means the clearance value is 10% of the pad size\nThis value can be superseded by a pad local value.\nThe final clearance value is the sum of this value and the clearance value\nA negative value means a smaller mask size than pad size.") );
	
	fgSizerClearances->Add( m_staticTextRatio, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_SolderPasteMarginRatioCtrl = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	m_SolderPasteMarginRatioCtrl->SetToolTip( _("This is the global clearance ratio in per cent between pads and the solder paste\nA value of 10 means the clearance value is 10% of the pad size\nThis value can be superseded by a pad local value.\nThe final clearance value is the sum of this value and the clearance value\nA negative value means a smaller mask size than pad size") );
	
	fgSizerClearances->Add( m_SolderPasteMarginRatioCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	m_SolderPasteRatioMarginUnits = new wxStaticText( m_PanelProperties, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
+310 −6

File changed.

Preview size limit exceeded, changes collapsed.

Loading