Commit b536b1cf authored by Marco Mattila's avatar Marco Mattila

Add module and pad local parameters for pad-zone connections (thermal, solid etc.) in pcbnew.

parent bcd66579
...@@ -68,6 +68,7 @@ MODULE::MODULE( BOARD* parent ) : ...@@ -68,6 +68,7 @@ MODULE::MODULE( BOARD* parent ) :
m_LocalSolderMaskMargin = 0; m_LocalSolderMaskMargin = 0;
m_LocalSolderPasteMargin = 0; m_LocalSolderPasteMargin = 0;
m_LocalSolderPasteMarginRatio = 0.0; m_LocalSolderPasteMarginRatio = 0.0;
m_ZoneConnection = UNDEFINED_CONNECTION; // Use zone setting by default
m_Reference = new TEXTE_MODULE( this, TEXT_is_REFERENCE ); m_Reference = new TEXTE_MODULE( this, TEXT_is_REFERENCE );
...@@ -101,6 +102,7 @@ MODULE::MODULE( const MODULE& aModule ) : ...@@ -101,6 +102,7 @@ MODULE::MODULE( const MODULE& aModule ) :
m_LocalSolderMaskMargin = aModule.m_LocalSolderMaskMargin; m_LocalSolderMaskMargin = aModule.m_LocalSolderMaskMargin;
m_LocalSolderPasteMargin = aModule.m_LocalSolderPasteMargin; m_LocalSolderPasteMargin = aModule.m_LocalSolderPasteMargin;
m_LocalSolderPasteMarginRatio = aModule.m_LocalSolderPasteMarginRatio; m_LocalSolderPasteMarginRatio = aModule.m_LocalSolderPasteMarginRatio;
m_ZoneConnection = aModule.m_ZoneConnection;
// Copy reference and value. // Copy reference and value.
m_Reference = new TEXTE_MODULE( *aModule.m_Reference ); m_Reference = new TEXTE_MODULE( *aModule.m_Reference );
...@@ -216,6 +218,7 @@ void MODULE::Copy( MODULE* aModule ) ...@@ -216,6 +218,7 @@ void MODULE::Copy( MODULE* aModule )
m_LocalSolderMaskMargin = aModule->m_LocalSolderMaskMargin; m_LocalSolderMaskMargin = aModule->m_LocalSolderMaskMargin;
m_LocalSolderPasteMargin = aModule->m_LocalSolderPasteMargin; m_LocalSolderPasteMargin = aModule->m_LocalSolderPasteMargin;
m_LocalSolderPasteMarginRatio = aModule->m_LocalSolderPasteMarginRatio; m_LocalSolderPasteMarginRatio = aModule->m_LocalSolderPasteMarginRatio;
m_ZoneConnection = aModule->m_ZoneConnection;
// Copy reference and value. // Copy reference and value.
m_Reference->Copy( aModule->m_Reference ); m_Reference->Copy( aModule->m_Reference );
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include <class_board_item.h> #include <class_board_item.h>
#include <class_text_mod.h> #include <class_text_mod.h>
#include "zones.h"
class LINE_READER; class LINE_READER;
class EDA_3D_CANVAS; class EDA_3D_CANVAS;
...@@ -121,6 +121,8 @@ public: ...@@ -121,6 +121,8 @@ public:
///< value of pad size ///< value of pad size
// The final margin is the sum of these 2 values // The final margin is the sum of these 2 values
ZoneConnection m_ZoneConnection;
public: public:
MODULE( BOARD* parent ); MODULE( BOARD* parent );
...@@ -193,6 +195,9 @@ public: ...@@ -193,6 +195,9 @@ public:
double GetLocalSolderPasteMarginRatio() const { return m_LocalSolderPasteMarginRatio; } double GetLocalSolderPasteMarginRatio() const { return m_LocalSolderPasteMarginRatio; }
void SetLocalSolderPasteMarginRatio( double aRatio ) { m_LocalSolderPasteMarginRatio = aRatio; } void SetLocalSolderPasteMarginRatio( double aRatio ) { m_LocalSolderPasteMarginRatio = aRatio; }
void SetZoneConnection( ZoneConnection aType ) { m_ZoneConnection = aType; }
ZoneConnection GetZoneConnection() const { return m_ZoneConnection; }
int GetAttributes() const { return m_Attributs; } int GetAttributes() const { return m_Attributs; }
void SetAttributes( int aAttributes ) { m_Attributs = aAttributes; } void SetAttributes( int aAttributes ) { m_Attributs = aAttributes; }
......
...@@ -70,6 +70,7 @@ D_PAD::D_PAD( MODULE* parent ) : ...@@ -70,6 +70,7 @@ D_PAD::D_PAD( MODULE* parent ) :
m_LocalSolderMaskMargin = 0; m_LocalSolderMaskMargin = 0;
m_LocalSolderPasteMargin = 0; m_LocalSolderPasteMargin = 0;
m_LocalSolderPasteMarginRatio = 0.0; m_LocalSolderPasteMarginRatio = 0.0;
m_ZoneConnection = UNDEFINED_CONNECTION; // Use parent setting by default
// set layers mask to default for a standard pad // set layers mask to default for a standard pad
m_layerMask = PAD_STANDARD_DEFAULT_LAYERS; m_layerMask = PAD_STANDARD_DEFAULT_LAYERS;
...@@ -303,6 +304,7 @@ void D_PAD::Copy( D_PAD* source ) ...@@ -303,6 +304,7 @@ void D_PAD::Copy( D_PAD* source )
m_LocalSolderMaskMargin = source->m_LocalSolderMaskMargin; m_LocalSolderMaskMargin = source->m_LocalSolderMaskMargin;
m_LocalSolderPasteMargin = source->m_LocalSolderPasteMargin; m_LocalSolderPasteMargin = source->m_LocalSolderPasteMargin;
m_LocalSolderPasteMarginRatio = source->m_LocalSolderPasteMarginRatio; m_LocalSolderPasteMarginRatio = source->m_LocalSolderPasteMarginRatio;
m_ZoneConnection = source->m_ZoneConnection;
SetSubRatsnest( 0 ); SetSubRatsnest( 0 );
SetSubNet( 0 ); SetSubNet( 0 );
...@@ -440,6 +442,17 @@ wxSize D_PAD::GetSolderPasteMargin() ...@@ -440,6 +442,17 @@ wxSize D_PAD::GetSolderPasteMargin()
} }
ZoneConnection D_PAD::GetZoneConnection() const
{
MODULE* module = (MODULE*) GetParent();
if( m_ZoneConnection == UNDEFINED_CONNECTION && module )
return module->GetZoneConnection();
else
return m_ZoneConnection;
}
void D_PAD::DisplayInfo( EDA_DRAW_FRAME* frame ) void D_PAD::DisplayInfo( EDA_DRAW_FRAME* frame )
{ {
MODULE* module; MODULE* module;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include <pad_shapes.h> #include <pad_shapes.h>
#include <PolyLine.h> #include <PolyLine.h>
#include <param_config.h> // PARAM_CFG_ARRAY #include <param_config.h> // PARAM_CFG_ARRAY
#include "zones.h"
class LINE_READER; class LINE_READER;
class EDA_3D_CANVAS; class EDA_3D_CANVAS;
...@@ -266,6 +266,9 @@ public: ...@@ -266,6 +266,9 @@ public:
*/ */
wxSize GetSolderPasteMargin(); wxSize GetSolderPasteMargin();
void SetZoneConnection( ZoneConnection aType ) { m_ZoneConnection = aType; }
ZoneConnection GetZoneConnection() const;
/* Reading and writing data on files */ /* Reading and writing data on files */
int ReadDescr( LINE_READER* aReader ); int ReadDescr( LINE_READER* aReader );
...@@ -530,6 +533,7 @@ private: ...@@ -530,6 +533,7 @@ private:
double m_LocalSolderPasteMarginRatio; ///< Local solder mask margin ratio value of pad size double m_LocalSolderPasteMarginRatio; ///< Local solder mask margin ratio value of pad size
///< The final margin is the sum of these 2 values ///< The final margin is the sum of these 2 values
ZoneConnection m_ZoneConnection;
}; };
#endif // PAD_H_ #endif // PAD_H_
...@@ -80,7 +80,7 @@ ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) : ...@@ -80,7 +80,7 @@ ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) :
m_FillMode = aZone.m_FillMode; // Filling mode (segments/polygons) m_FillMode = aZone.m_FillMode; // Filling mode (segments/polygons)
m_priority = aZone.m_priority; m_priority = aZone.m_priority;
m_ArcToSegmentsCount = aZone.m_ArcToSegmentsCount; m_ArcToSegmentsCount = aZone.m_ArcToSegmentsCount;
m_PadOption = aZone.m_PadOption; m_PadConnection = aZone.m_PadConnection;
m_ThermalReliefGap = aZone.m_ThermalReliefGap; m_ThermalReliefGap = aZone.m_ThermalReliefGap;
m_ThermalReliefCopperBridge = aZone.m_ThermalReliefCopperBridge; m_ThermalReliefCopperBridge = aZone.m_ThermalReliefCopperBridge;
m_FilledPolysList = aZone.m_FilledPolysList; m_FilledPolysList = aZone.m_FilledPolysList;
...@@ -856,7 +856,7 @@ void ZONE_CONTAINER::Copy( ZONE_CONTAINER* src ) ...@@ -856,7 +856,7 @@ void ZONE_CONTAINER::Copy( ZONE_CONTAINER* src )
m_ZoneMinThickness = src->m_ZoneMinThickness; m_ZoneMinThickness = src->m_ZoneMinThickness;
m_FillMode = src->m_FillMode; // Filling mode (segments/polygons) m_FillMode = src->m_FillMode; // Filling mode (segments/polygons)
m_ArcToSegmentsCount = src->m_ArcToSegmentsCount; m_ArcToSegmentsCount = src->m_ArcToSegmentsCount;
m_PadOption = src->m_PadOption; m_PadConnection = src->m_PadConnection;
m_ThermalReliefGap = src->m_ThermalReliefGap; m_ThermalReliefGap = src->m_ThermalReliefGap;
m_ThermalReliefCopperBridge = src->m_ThermalReliefCopperBridge; m_ThermalReliefCopperBridge = src->m_ThermalReliefCopperBridge;
m_Poly->m_HatchStyle = src->m_Poly->GetHatchStyle(); m_Poly->m_HatchStyle = src->m_Poly->GetHatchStyle();
...@@ -882,6 +882,16 @@ bool ZONE_CONTAINER::SetNetNameFromNetCode( void ) ...@@ -882,6 +882,16 @@ bool ZONE_CONTAINER::SetNetNameFromNetCode( void )
} }
ZoneConnection ZONE_CONTAINER::GetPadConnection( D_PAD* aPad ) const
{
if( aPad == NULL || aPad->GetZoneConnection() == UNDEFINED_CONNECTION )
return m_PadConnection;
else
return aPad->GetZoneConnection();
}
wxString ZONE_CONTAINER::GetSelectMenuText() const wxString ZONE_CONTAINER::GetSelectMenuText() const
{ {
wxString text; wxString text;
......
...@@ -92,8 +92,6 @@ public: ...@@ -92,8 +92,6 @@ public:
//ARC_APPROX_SEGMENTS_COUNT_LOW_DEF or ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF) //ARC_APPROX_SEGMENTS_COUNT_LOW_DEF or ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF)
int m_ArcToSegmentsCount; int m_ArcToSegmentsCount;
int m_PadOption;
// thickness of the gap in thermal reliefs. // thickness of the gap in thermal reliefs.
int m_ThermalReliefGap; int m_ThermalReliefGap;
...@@ -128,6 +126,7 @@ private: ...@@ -128,6 +126,7 @@ private:
// the other zone priority, it will be created inside. // the other zone priority, it will be created inside.
// if priorities are equal, a DRC erroc is set // if priorities are equal, a DRC erroc is set
unsigned m_priority; unsigned m_priority;
ZoneConnection m_PadConnection;
public: public:
ZONE_CONTAINER( BOARD* parent ); ZONE_CONTAINER( BOARD* parent );
...@@ -292,8 +291,8 @@ public: ...@@ -292,8 +291,8 @@ public:
int GetZoneClearance() const { return m_ZoneClearance; } int GetZoneClearance() const { return m_ZoneClearance; }
void SetZoneClearance( int aZoneClearance ) { m_ZoneClearance = aZoneClearance; } void SetZoneClearance( int aZoneClearance ) { m_ZoneClearance = aZoneClearance; }
int GetPadOption() const { return m_PadOption; } ZoneConnection GetPadConnection( D_PAD* aPad = NULL ) const;
void SetPadOption( int aPadOption ) { m_PadOption = aPadOption; } void SetPadConnection( ZoneConnection aPadConnection ) { m_PadConnection = aPadConnection; }
int GetMinThickness() const { return m_ZoneMinThickness; } int GetMinThickness() const { return m_ZoneMinThickness; }
void SetMinThickness( int aMinThickness ) { m_ZoneMinThickness = aMinThickness; } void SetMinThickness( int aMinThickness ) { m_ZoneMinThickness = aMinThickness; }
......
...@@ -39,7 +39,7 @@ ZONE_SETTINGS::ZONE_SETTINGS() ...@@ -39,7 +39,7 @@ ZONE_SETTINGS::ZONE_SETTINGS()
m_ThermalReliefGap = 200; // tickness of the gap in thermal reliefs m_ThermalReliefGap = 200; // tickness of the gap in thermal reliefs
m_ThermalReliefCopperBridge = 200; // tickness of the copper bridge in thermal reliefs m_ThermalReliefCopperBridge = 200; // tickness of the copper bridge in thermal reliefs
m_Zone_Pad_Options = THERMAL_PAD; // How pads are covered by copper in zone m_PadConnection = THERMAL_PAD; // How pads are covered by copper in zone
m_Zone_45_Only = false; m_Zone_45_Only = false;
...@@ -60,7 +60,7 @@ ZONE_SETTINGS& ZONE_SETTINGS::operator << ( const ZONE_CONTAINER& aSource ) ...@@ -60,7 +60,7 @@ ZONE_SETTINGS& ZONE_SETTINGS::operator << ( const ZONE_CONTAINER& aSource )
m_ArcToSegmentsCount = aSource.m_ArcToSegmentsCount; m_ArcToSegmentsCount = aSource.m_ArcToSegmentsCount;
m_ThermalReliefGap = aSource.m_ThermalReliefGap; m_ThermalReliefGap = aSource.m_ThermalReliefGap;
m_ThermalReliefCopperBridge = aSource.m_ThermalReliefCopperBridge; m_ThermalReliefCopperBridge = aSource.m_ThermalReliefCopperBridge;
m_Zone_Pad_Options = aSource.m_PadOption; m_PadConnection = aSource.GetPadConnection();
cornerSmoothingType = aSource.GetCornerSmoothingType(); cornerSmoothingType = aSource.GetCornerSmoothingType();
cornerRadius = aSource.GetCornerRadius(); cornerRadius = aSource.GetCornerRadius();
...@@ -77,7 +77,7 @@ void ZONE_SETTINGS::ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport ) c ...@@ -77,7 +77,7 @@ void ZONE_SETTINGS::ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport ) c
aTarget.m_ArcToSegmentsCount = m_ArcToSegmentsCount; aTarget.m_ArcToSegmentsCount = m_ArcToSegmentsCount;
aTarget.m_ThermalReliefGap = m_ThermalReliefGap; aTarget.m_ThermalReliefGap = m_ThermalReliefGap;
aTarget.m_ThermalReliefCopperBridge = m_ThermalReliefCopperBridge; aTarget.m_ThermalReliefCopperBridge = m_ThermalReliefCopperBridge;
aTarget.m_PadOption = m_Zone_Pad_Options; aTarget.SetPadConnection( m_PadConnection );
aTarget.SetCornerSmoothingType( cornerSmoothingType ); aTarget.SetCornerSmoothingType( cornerSmoothingType );
aTarget.SetCornerRadius( cornerRadius ); aTarget.SetCornerRadius( cornerRadius );
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#ifndef ZONE_SETTINGS_H_ #ifndef ZONE_SETTINGS_H_
#define ZONE_SETTINGS_H_ #define ZONE_SETTINGS_H_
#include "zones.h"
class ZONE_CONTAINER; class ZONE_CONTAINER;
...@@ -45,13 +47,13 @@ public: ...@@ -45,13 +47,13 @@ public:
long m_ThermalReliefGap; ///< thickness of the gap in thermal reliefs long m_ThermalReliefGap; ///< thickness of the gap in thermal reliefs
long m_ThermalReliefCopperBridge; ///< thickness of the copper bridge in thermal reliefs long m_ThermalReliefCopperBridge; ///< thickness of the copper bridge in thermal reliefs
int m_Zone_Pad_Options; ///< How pads are covered by copper in zone
bool m_Zone_45_Only; bool m_Zone_45_Only;
private: private:
int cornerSmoothingType; ///< Corner smoothing type int cornerSmoothingType; ///< Corner smoothing type
unsigned int cornerRadius; ///< Corner chamfer distance / fillet radius unsigned int cornerRadius; ///< Corner chamfer distance / fillet radius
ZoneConnection m_PadConnection;
public: public:
ZONE_SETTINGS(); ZONE_SETTINGS();
...@@ -75,9 +77,9 @@ public: ...@@ -75,9 +77,9 @@ public:
*/ */
void ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport = true ) const; void ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport = true ) const;
void SetCornerSmoothingType( int aType) { cornerSmoothingType = aType; }; void SetCornerSmoothingType( int aType) { cornerSmoothingType = aType; }
int GetCornerSmoothingType() const { return cornerSmoothingType; }; int GetCornerSmoothingType() const { return cornerSmoothingType; }
void SetCornerRadius( int aRadius ) void SetCornerRadius( int aRadius )
{ {
...@@ -89,7 +91,11 @@ public: ...@@ -89,7 +91,11 @@ public:
cornerRadius = aRadius; cornerRadius = aRadius;
}; };
unsigned int GetCornerRadius() const { return cornerRadius; }; unsigned int GetCornerRadius() const { return cornerRadius; }
ZoneConnection GetPadConnection() const { return m_PadConnection; }
void SetPadConnection( ZoneConnection aPadConnection ) { m_PadConnection = aPadConnection; }
}; };
......
...@@ -189,12 +189,13 @@ void DIALOG_COPPER_ZONE::initDialog() ...@@ -189,12 +189,13 @@ void DIALOG_COPPER_ZONE::initDialog()
m_Parent->GetInternalUnits() ); m_Parent->GetInternalUnits() );
m_ZoneMinThicknessCtrl->SetValue( msg ); m_ZoneMinThicknessCtrl->SetValue( msg );
switch( m_settings.m_Zone_Pad_Options ) switch( m_settings.GetPadConnection() )
{ {
case PAD_NOT_IN_ZONE: // Pads are not covered case PAD_NOT_IN_ZONE: // Pads are not covered
m_PadInZoneOpt->SetSelection( 2 ); m_PadInZoneOpt->SetSelection( 2 );
break; break;
default:
case THERMAL_PAD: // Use thermal relief for pads case THERMAL_PAD: // Use thermal relief for pads
m_PadInZoneOpt->SetSelection( 1 ); m_PadInZoneOpt->SetSelection( 1 );
break; break;
...@@ -204,7 +205,7 @@ void DIALOG_COPPER_ZONE::initDialog() ...@@ -204,7 +205,7 @@ void DIALOG_COPPER_ZONE::initDialog()
break; break;
} }
if( m_settings.m_Zone_Pad_Options != THERMAL_PAD ) if( m_settings.GetPadConnection() != THERMAL_PAD )
{ {
m_AntipadSizeValue->Enable( false ); m_AntipadSizeValue->Enable( false );
m_CopperWidthValue->Enable( false ); m_CopperWidthValue->Enable( false );
...@@ -345,17 +346,17 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportab ...@@ -345,17 +346,17 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportab
{ {
case 2: case 2:
// Pads are not covered // Pads are not covered
m_settings.m_Zone_Pad_Options = PAD_NOT_IN_ZONE; m_settings.SetPadConnection( PAD_NOT_IN_ZONE );
break; break;
case 1: case 1:
// Use thermal relief for pads // Use thermal relief for pads
m_settings.m_Zone_Pad_Options = THERMAL_PAD; m_settings.SetPadConnection( THERMAL_PAD );
break; break;
case 0: case 0:
// pads are covered by copper // pads are covered by copper
m_settings.m_Zone_Pad_Options = PAD_IN_ZONE; m_settings.SetPadConnection( PAD_IN_ZONE );
break; break;
} }
......
...@@ -132,6 +132,26 @@ void DIALOG_MODULE_BOARD_EDITOR::InitBoardProperties() ...@@ -132,6 +132,26 @@ void DIALOG_MODULE_BOARD_EDITOR::InitBoardProperties()
m_SolderPasteMarginRatioCtrl->SetValue( wxT("-") + msg ); m_SolderPasteMarginRatioCtrl->SetValue( wxT("-") + msg );
else else
m_SolderPasteMarginRatioCtrl->SetValue( msg ); m_SolderPasteMarginRatioCtrl->SetValue( msg );
switch( m_CurrentModule->GetZoneConnection() )
{
default:
case UNDEFINED_CONNECTION:
m_ZoneConnectionChoice->SetSelection( 0 );
break;
case PAD_IN_ZONE:
m_ZoneConnectionChoice->SetSelection( 1 );
break;
case THERMAL_PAD:
m_ZoneConnectionChoice->SetSelection( 2 );
break;
case PAD_NOT_IN_ZONE:
m_ZoneConnectionChoice->SetSelection( 3 );
break;
}
} }
...@@ -482,6 +502,26 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event ) ...@@ -482,6 +502,26 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
m_CurrentModule->SetLocalSolderPasteMarginRatio( dtmp / 100 ); m_CurrentModule->SetLocalSolderPasteMarginRatio( dtmp / 100 );
switch( m_ZoneConnectionChoice->GetSelection() )
{
default:
case 0:
m_CurrentModule->SetZoneConnection( UNDEFINED_CONNECTION );
break;
case 1:
m_CurrentModule->SetZoneConnection( PAD_IN_ZONE );
break;
case 2:
m_CurrentModule->SetZoneConnection( THERMAL_PAD );
break;
case 3:
m_CurrentModule->SetZoneConnection( PAD_NOT_IN_ZONE );
break;
}
// Set Module Position // Set Module Position
modpos.x = ReturnValueFromTextCtrl( *m_ModPositionX, PCB_INTERNAL_UNIT ); modpos.x = ReturnValueFromTextCtrl( *m_ModPositionX, PCB_INTERNAL_UNIT );
modpos.y = ReturnValueFromTextCtrl( *m_ModPositionY, PCB_INTERNAL_UNIT ); modpos.y = ReturnValueFromTextCtrl( *m_ModPositionY, PCB_INTERNAL_UNIT );
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Aug 24 2011)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_edit_module_for_BoardEditor_base__ #ifndef __DIALOG_EDIT_MODULE_FOR_BOARDEDITOR_BASE_H__
#define __dialog_edit_module_for_BoardEditor_base__ #define __DIALOG_EDIT_MODULE_FOR_BOARDEDITOR_BASE_H__
#include <wx/intl.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/string.h> #include <wx/intl.h>
#include <wx/textctrl.h> #include <wx/string.h>
#include <wx/gdicmn.h> #include <wx/textctrl.h>
#include <wx/font.h> #include <wx/gdicmn.h>
#include <wx/colour.h> #include <wx/font.h>
#include <wx/settings.h> #include <wx/colour.h>
#include <wx/button.h> #include <wx/settings.h>
#include <wx/sizer.h> #include <wx/button.h>
#include <wx/statbox.h> #include <wx/sizer.h>
#include <wx/radiobox.h> #include <wx/statbox.h>
#include <wx/stattext.h> #include <wx/radiobox.h>
#include <wx/slider.h> #include <wx/stattext.h>
#include <wx/statline.h> #include <wx/slider.h>
#include <wx/panel.h> #include <wx/choice.h>
#include <wx/bitmap.h> #include <wx/statline.h>
#include <wx/image.h> #include <wx/panel.h>
#include <wx/icon.h> #include <wx/bitmap.h>
#include <wx/listbox.h> #include <wx/image.h>
#include <wx/notebook.h> #include <wx/icon.h>
#include <wx/dialog.h> #include <wx/listbox.h>
#include <wx/notebook.h>
/////////////////////////////////////////////////////////////////////////// #include <wx/dialog.h>
#define ID_NOTEBOOK 1000 ///////////////////////////////////////////////////////////////////////////
#define ID_LISTBOX_ORIENT_SELECT 1001
#define ID_MODULE_PROPERTIES_EXCHANGE 1002 #define ID_NOTEBOOK 1000
#define ID_GOTO_MODULE_EDITOR 1003 #define ID_LISTBOX_ORIENT_SELECT 1001
#define ID_BROWSE_3D_LIB 1004 #define ID_MODULE_PROPERTIES_EXCHANGE 1002
#define ID_ADD_3D_SHAPE 1005 #define ID_GOTO_MODULE_EDITOR 1003
#define ID_REMOVE_3D_SHAPE 1006 #define ID_BROWSE_3D_LIB 1004
#define ID_ADD_3D_SHAPE 1005
/////////////////////////////////////////////////////////////////////////////// #define ID_REMOVE_3D_SHAPE 1006
/// Class DIALOG_MODULE_BOARD_EDITOR_BASE
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DIALOG_MODULE_BOARD_EDITOR_BASE : public wxDialog /// Class DIALOG_MODULE_BOARD_EDITOR_BASE
{ ///////////////////////////////////////////////////////////////////////////////
private: class DIALOG_MODULE_BOARD_EDITOR_BASE : public wxDialog
wxBoxSizer* m_GeneralBoxSizer; {
wxBoxSizer* m_PropRightSizer; private:
wxBoxSizer* m_GeneralBoxSizer;
protected: wxBoxSizer* m_PropRightSizer;
wxNotebook* m_NoteBook;
wxPanel* m_PanelProperties; protected:
wxTextCtrl* m_ReferenceCtrl; wxNotebook* m_NoteBook;
wxButton* m_button4; wxPanel* m_PanelProperties;
wxTextCtrl* m_ValueCtrl; wxTextCtrl* m_ReferenceCtrl;
wxButton* m_button5; wxButton* m_button4;
wxRadioBox* m_LayerCtrl; wxTextCtrl* m_ValueCtrl;
wxRadioBox* m_OrientCtrl; wxButton* m_button5;
wxStaticText* m_staticText4; wxRadioBox* m_LayerCtrl;
wxTextCtrl* m_OrientValue; wxRadioBox* m_OrientCtrl;
wxStaticText* XPositionStatic; wxStaticText* m_staticText4;
wxTextCtrl* m_ModPositionX; wxTextCtrl* m_OrientValue;
wxStaticText* YPositionStatic; wxStaticText* XPositionStatic;
wxTextCtrl* m_ModPositionY; wxTextCtrl* m_ModPositionX;
wxButton* m_buttonExchange; wxStaticText* YPositionStatic;
wxButton* m_buttonModuleEditor; wxTextCtrl* m_ModPositionY;
wxRadioBox* m_AttributsCtrl; wxButton* m_buttonExchange;
wxRadioBox* m_AutoPlaceCtrl; wxButton* m_buttonModuleEditor;
wxStaticText* m_staticText11; wxRadioBox* m_AttributsCtrl;
wxSlider* m_CostRot90Ctrl; wxRadioBox* m_AutoPlaceCtrl;
wxStaticText* m_staticText12; wxStaticText* m_staticText11;
wxSlider* m_CostRot180Ctrl; wxSlider* m_CostRot90Ctrl;
wxStaticText* m_staticTextInfo; wxStaticText* m_staticText12;
wxStaticText* m_staticTextNetClearance; wxSlider* m_CostRot180Ctrl;
wxTextCtrl* m_NetClearanceValueCtrl; wxStaticText* m_staticText16;
wxStaticText* m_NetClearanceUnits; wxChoice* m_ZoneConnectionChoice;
wxStaticLine* m_staticline1; wxStaticText* m_staticTextInfo;
wxStaticLine* m_staticline2; wxStaticText* m_staticTextNetClearance;
wxStaticLine* m_staticline3; wxTextCtrl* m_NetClearanceValueCtrl;
wxStaticText* m_MaskClearanceTitle; wxStaticText* m_NetClearanceUnits;
wxTextCtrl* m_SolderMaskMarginCtrl; wxStaticLine* m_staticline1;
wxStaticText* m_SolderMaskMarginUnits; wxStaticLine* m_staticline2;
wxStaticText* m_staticTextSolderPaste; wxStaticLine* m_staticline3;
wxTextCtrl* m_SolderPasteMarginCtrl; wxStaticText* m_MaskClearanceTitle;
wxStaticText* m_SolderPasteMarginUnits; wxTextCtrl* m_SolderMaskMarginCtrl;
wxStaticText* m_staticTextRatio; wxStaticText* m_SolderMaskMarginUnits;
wxTextCtrl* m_SolderPasteMarginRatioCtrl; wxStaticText* m_staticTextSolderPaste;
wxStaticText* m_SolderPasteRatioMarginUnits; wxTextCtrl* m_SolderPasteMarginCtrl;
wxPanel* m_Panel3D; wxStaticText* m_SolderPasteMarginUnits;
wxStaticText* m_staticText3Dname; wxStaticText* m_staticTextRatio;
wxListBox* m_3D_ShapeNameListBox; wxTextCtrl* m_SolderPasteMarginRatioCtrl;
wxButton* m_buttonBrowse; wxStaticText* m_SolderPasteRatioMarginUnits;
wxButton* m_buttonAdd; wxPanel* m_Panel3D;
wxButton* m_buttonRemove; wxStaticText* m_staticText3Dname;
wxStdDialogButtonSizer* m_sdbSizerStdButtons; wxListBox* m_3D_ShapeNameListBox;
wxButton* m_sdbSizerStdButtonsOK; wxButton* m_buttonBrowse;
wxButton* m_sdbSizerStdButtonsCancel; wxButton* m_buttonAdd;
wxButton* m_buttonRemove;
// Virtual event handlers, overide them in your derived class wxStdDialogButtonSizer* m_sdbSizerStdButtons;
virtual void OnEditReference( wxCommandEvent& event ){ event.Skip(); } wxButton* m_sdbSizerStdButtonsOK;
virtual void OnEditValue( wxCommandEvent& event ){ event.Skip(); } wxButton* m_sdbSizerStdButtonsCancel;
virtual void ModuleOrientEvent( wxCommandEvent& event ){ event.Skip(); }
virtual void ExchangeModule( wxCommandEvent& event ){ event.Skip(); } // Virtual event handlers, overide them in your derived class
virtual void GotoModuleEditor( wxCommandEvent& event ){ event.Skip(); } virtual void OnEditReference( wxCommandEvent& event ) { event.Skip(); }
virtual void On3DShapeNameSelected( wxCommandEvent& event ){ event.Skip(); } virtual void OnEditValue( wxCommandEvent& event ) { event.Skip(); }
virtual void Browse3DLib( wxCommandEvent& event ){ event.Skip(); } virtual void ModuleOrientEvent( wxCommandEvent& event ) { event.Skip(); }
virtual void Add3DShape( wxCommandEvent& event ){ event.Skip(); } virtual void ExchangeModule( wxCommandEvent& event ) { event.Skip(); }
virtual void Remove3DShape( wxCommandEvent& event ){ event.Skip(); } virtual void GotoModuleEditor( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } virtual void On3DShapeNameSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } virtual void Browse3DLib( wxCommandEvent& event ) { event.Skip(); }
virtual void Add3DShape( wxCommandEvent& event ) { event.Skip(); }
virtual void Remove3DShape( wxCommandEvent& event ) { event.Skip(); }
public: virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
wxStaticBoxSizer* m_Sizer3DValues; virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Module properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 474,607 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_MODULE_BOARD_EDITOR_BASE();
public:
}; wxStaticBoxSizer* m_Sizer3DValues;
#endif //__dialog_edit_module_for_BoardEditor_base__ DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Module properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 550,800 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_MODULE_BOARD_EDITOR_BASE();
};
#endif //__DIALOG_EDIT_MODULE_FOR_BOARDEDITOR_BASE_H__
...@@ -187,9 +187,7 @@ void PCB_BASE_FRAME::InstallPadOptionsFrame( D_PAD* Pad ) ...@@ -187,9 +187,7 @@ void PCB_BASE_FRAME::InstallPadOptionsFrame( D_PAD* Pad )
} }
/***************************************/
void DIALOG_PAD_PROPERTIES::initValues() void DIALOG_PAD_PROPERTIES::initValues()
/***************************************/
{ {
SetFocus(); // Required under wxGTK if we want to dismiss the dialog with the ESC key SetFocus(); // Required under wxGTK if we want to dismiss the dialog with the ESC key
...@@ -297,6 +295,26 @@ void DIALOG_PAD_PROPERTIES::initValues() ...@@ -297,6 +295,26 @@ void DIALOG_PAD_PROPERTIES::initValues()
else else
m_SolderPasteMarginRatioCtrl->SetValue( msg ); m_SolderPasteMarginRatioCtrl->SetValue( msg );
switch( m_dummyPad->GetZoneConnection() )
{
default:
case UNDEFINED_CONNECTION:
m_ZoneConnectionChoice->SetSelection( 0 );
break;
case PAD_IN_ZONE:
m_ZoneConnectionChoice->SetSelection( 1 );
break;
case THERMAL_PAD:
m_ZoneConnectionChoice->SetSelection( 2 );
break;
case PAD_NOT_IN_ZONE:
m_ZoneConnectionChoice->SetSelection( 3 );
break;
}
if( m_CurrentPad ) if( m_CurrentPad )
{ {
MODULE* module = m_CurrentPad->GetParent(); MODULE* module = m_CurrentPad->GetParent();
...@@ -413,9 +431,7 @@ void DIALOG_PAD_PROPERTIES::initValues() ...@@ -413,9 +431,7 @@ void DIALOG_PAD_PROPERTIES::initValues()
} }
/*********************************************************************/
void DIALOG_PAD_PROPERTIES::OnPadShapeSelection( wxCommandEvent& event ) void DIALOG_PAD_PROPERTIES::OnPadShapeSelection( wxCommandEvent& event )
/*********************************************************************/
{ {
switch( m_PadShape->GetSelection() ) switch( m_PadShape->GetSelection() )
{ {
...@@ -453,9 +469,7 @@ void DIALOG_PAD_PROPERTIES::OnPadShapeSelection( wxCommandEvent& event ) ...@@ -453,9 +469,7 @@ void DIALOG_PAD_PROPERTIES::OnPadShapeSelection( wxCommandEvent& event )
} }
/**********************************************************************/
void DIALOG_PAD_PROPERTIES::OnDrillShapeSelected( wxCommandEvent& event ) void DIALOG_PAD_PROPERTIES::OnDrillShapeSelected( wxCommandEvent& event )
/**********************************************************************/
{ {
if( m_PadType->GetSelection() == 1 || m_PadType->GetSelection() == 2 ) if( m_PadType->GetSelection() == 1 || m_PadType->GetSelection() == 2 )
{ {
...@@ -484,9 +498,7 @@ void DIALOG_PAD_PROPERTIES::OnDrillShapeSelected( wxCommandEvent& event ) ...@@ -484,9 +498,7 @@ void DIALOG_PAD_PROPERTIES::OnDrillShapeSelected( wxCommandEvent& event )
} }
/*******************************************************************/
void DIALOG_PAD_PROPERTIES::PadOrientEvent( wxCommandEvent& event ) void DIALOG_PAD_PROPERTIES::PadOrientEvent( wxCommandEvent& event )
/********************************************************************/
{ {
switch( m_PadOrient->GetSelection() ) switch( m_PadOrient->GetSelection() )
{ {
...@@ -519,9 +531,7 @@ void DIALOG_PAD_PROPERTIES::PadOrientEvent( wxCommandEvent& event ) ...@@ -519,9 +531,7 @@ void DIALOG_PAD_PROPERTIES::PadOrientEvent( wxCommandEvent& event )
} }
/*****************************************************************/
void DIALOG_PAD_PROPERTIES::PadTypeSelected( wxCommandEvent& event ) void DIALOG_PAD_PROPERTIES::PadTypeSelected( wxCommandEvent& event )
/*****************************************************************/
/* Adjust the better mask layer according to the selected pad type /* Adjust the better mask layer according to the selected pad type
*/ */
...@@ -549,9 +559,7 @@ void DIALOG_PAD_PROPERTIES::PadTypeSelected( wxCommandEvent& event ) ...@@ -549,9 +559,7 @@ void DIALOG_PAD_PROPERTIES::PadTypeSelected( wxCommandEvent& event )
} }
/****************************************************************/
void DIALOG_PAD_PROPERTIES::SetPadLayersList( long layer_mask ) void DIALOG_PAD_PROPERTIES::SetPadLayersList( long layer_mask )
/****************************************************************/
/** SetPadLayersList /** SetPadLayersList
* Update the CheckBoxes state in pad layers list, * Update the CheckBoxes state in pad layers list,
...@@ -594,9 +602,7 @@ void DIALOG_PAD_PROPERTIES::OnSetLayers( wxCommandEvent& event ) ...@@ -594,9 +602,7 @@ void DIALOG_PAD_PROPERTIES::OnSetLayers( wxCommandEvent& event )
} }
/*************************************************************************/
void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event ) void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event )
/*************************************************************************/
/* Updates the different parameters for the component being edited. /* Updates the different parameters for the component being edited.
*/ */
...@@ -695,6 +701,7 @@ void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event ) ...@@ -695,6 +701,7 @@ void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event )
m_CurrentPad->SetLocalSolderMaskMargin( m_Pad_Master.GetLocalSolderMaskMargin() ); m_CurrentPad->SetLocalSolderMaskMargin( m_Pad_Master.GetLocalSolderMaskMargin() );
m_CurrentPad->SetLocalSolderPasteMargin( m_Pad_Master.GetLocalSolderPasteMargin() ); m_CurrentPad->SetLocalSolderPasteMargin( m_Pad_Master.GetLocalSolderPasteMargin() );
m_CurrentPad->SetLocalSolderPasteMarginRatio( m_Pad_Master.GetLocalSolderPasteMarginRatio() ); m_CurrentPad->SetLocalSolderPasteMarginRatio( m_Pad_Master.GetLocalSolderPasteMarginRatio() );
m_CurrentPad->SetZoneConnection( m_Pad_Master.GetZoneConnection() );
module->CalculateBoundingBox(); module->CalculateBoundingBox();
m_CurrentPad->DisplayInfo( m_Parent ); m_CurrentPad->DisplayInfo( m_Parent );
...@@ -742,6 +749,26 @@ bool DIALOG_PAD_PROPERTIES::TransfertDataToPad( D_PAD* aPad, bool aPromptOnError ...@@ -742,6 +749,26 @@ bool DIALOG_PAD_PROPERTIES::TransfertDataToPad( D_PAD* aPad, bool aPromptOnError
aPad->SetLocalSolderPasteMarginRatio( dtmp / 100 ); aPad->SetLocalSolderPasteMarginRatio( dtmp / 100 );
switch( m_ZoneConnectionChoice->GetSelection() )
{
default:
case 0:
aPad->SetZoneConnection( UNDEFINED_CONNECTION );
break;
case 1:
aPad->SetZoneConnection( PAD_IN_ZONE );
break;
case 2:
aPad->SetZoneConnection( THERMAL_PAD );
break;
case 3:
aPad->SetZoneConnection( PAD_NOT_IN_ZONE );
break;
}
// Read pad position: // Read pad position:
x = ReturnValueFromTextCtrl( *m_PadPosition_X_Ctrl, internalUnits ); x = ReturnValueFromTextCtrl( *m_PadPosition_X_Ctrl, internalUnits );
y = ReturnValueFromTextCtrl( *m_PadPosition_Y_Ctrl, internalUnits ); y = ReturnValueFromTextCtrl( *m_PadPosition_Y_Ctrl, internalUnits );
......
This diff is collapsed.
...@@ -210,7 +210,6 @@ bool ZONE_CONTAINER::Save( FILE* aFile ) const ...@@ -210,7 +210,6 @@ bool ZONE_CONTAINER::Save( FILE* aFile ) const
int ret; int ret;
unsigned corners_count = m_Poly->corner.size(); unsigned corners_count = m_Poly->corner.size();
int outline_hatch; int outline_hatch;
char padoption;
fprintf( aFile, "$CZONE_OUTLINE\n" ); fprintf( aFile, "$CZONE_OUTLINE\n" );
...@@ -258,23 +257,24 @@ bool ZONE_CONTAINER::Save( FILE* aFile ) const ...@@ -258,23 +257,24 @@ bool ZONE_CONTAINER::Save( FILE* aFile ) const
} }
// Save pad option and clearance // Save pad option and clearance
switch( m_PadOption ) int padConnection;
switch( m_PadConnection )
{ {
default: default:
case PAD_IN_ZONE: case PAD_IN_ZONE:
padoption = 'I'; padConnection = 'I';
break; break;
case THERMAL_PAD: case THERMAL_PAD:
padoption = 'T'; padConnection = 'T';
break; break;
case PAD_NOT_IN_ZONE: case PAD_NOT_IN_ZONE:
padoption = 'X'; padConnection = 'X';
break; break;
} }
ret = fprintf( aFile, "ZClearance %d %c\n", m_ZoneClearance, padoption ); ret = fprintf( aFile, "ZClearance %d %c\n", m_ZoneClearance, padConnection );
if( ret < 2 ) if( ret < 2 )
return false; return false;
...@@ -719,6 +719,9 @@ bool D_PAD::Save( FILE* aFile ) const ...@@ -719,6 +719,9 @@ bool D_PAD::Save( FILE* aFile ) const
if( GetLocalClearance() != 0 ) if( GetLocalClearance() != 0 )
fprintf( aFile, ".LocalClearance %d\n", GetLocalClearance() ); fprintf( aFile, ".LocalClearance %d\n", GetLocalClearance() );
if( m_ZoneConnection != UNDEFINED_CONNECTION )
fprintf( aFile, ".ZoneConnection %d\n", m_ZoneConnection );
if( fprintf( aFile, "$EndPAD\n" ) != sizeof("$EndPAD\n") - 1 ) if( fprintf( aFile, "$EndPAD\n" ) != sizeof("$EndPAD\n") - 1 )
return false; return false;
...@@ -779,6 +782,9 @@ bool MODULE::Save( FILE* aFile ) const ...@@ -779,6 +782,9 @@ bool MODULE::Save( FILE* aFile ) const
if( m_LocalClearance != 0 ) if( m_LocalClearance != 0 )
fprintf( aFile, ".LocalClearance %d\n", GetLocalClearance() ); fprintf( aFile, ".LocalClearance %d\n", GetLocalClearance() );
if( m_ZoneConnection != UNDEFINED_CONNECTION )
fprintf( aFile, ".ZoneConnection %d\n", m_ZoneConnection );
// attributes // attributes
if( m_Attributs != MOD_DEFAULT ) if( m_Attributs != MOD_DEFAULT )
{ {
...@@ -1026,6 +1032,8 @@ int D_PAD::ReadDescr( LINE_READER* aReader ) ...@@ -1026,6 +1032,8 @@ int D_PAD::ReadDescr( LINE_READER* aReader )
SetLocalSolderPasteMarginRatio( atoi( Line + 18 ) ); SetLocalSolderPasteMarginRatio( atoi( Line + 18 ) );
else if( strnicmp( Line, ".LocalClearance ", 16 ) == 0 ) else if( strnicmp( Line, ".LocalClearance ", 16 ) == 0 )
SetLocalClearance( atoi( Line + 16 ) ); SetLocalClearance( atoi( Line + 16 ) );
else if( strnicmp( Line, ".ZoneConnection ", 16 ) == 0 )
m_ZoneConnection = (ZoneConnection)atoi( Line + 16 );
break; break;
default: default:
...@@ -1271,6 +1279,8 @@ int MODULE::ReadDescr( LINE_READER* aReader ) ...@@ -1271,6 +1279,8 @@ int MODULE::ReadDescr( LINE_READER* aReader )
SetLocalSolderPasteMarginRatio( atof( Line + 18 ) ); SetLocalSolderPasteMarginRatio( atof( Line + 18 ) );
else if( strnicmp( Line, ".LocalClearance ", 16 ) == 0 ) else if( strnicmp( Line, ".LocalClearance ", 16 ) == 0 )
SetLocalClearance( atoi( Line + 16 ) ); SetLocalClearance( atoi( Line + 16 ) );
else if( strnicmp( Line, ".ZoneConnection ", 16 ) == 0 )
m_ZoneConnection = (ZoneConnection)atoi( Line + 16 );
break; break;
...@@ -1848,9 +1858,9 @@ int ZONE_CONTAINER::ReadDescr( LINE_READER* aReader ) ...@@ -1848,9 +1858,9 @@ int ZONE_CONTAINER::ReadDescr( LINE_READER* aReader )
else if( strnicmp( Line, "ZClearance", 10 ) == 0 ) // Clearance and pad options info found else if( strnicmp( Line, "ZClearance", 10 ) == 0 ) // Clearance and pad options info found
{ {
int clearance = 200; int clearance = 200;
char padoption; char padConnection;
text = Line + 10; text = Line + 10;
ret = sscanf( text, "%d %1c", &clearance, &padoption ); ret = sscanf( text, "%d %1c", &clearance, &padConnection );
if( ret < 2 ) if( ret < 2 )
{ {
...@@ -1860,21 +1870,21 @@ int ZONE_CONTAINER::ReadDescr( LINE_READER* aReader ) ...@@ -1860,21 +1870,21 @@ int ZONE_CONTAINER::ReadDescr( LINE_READER* aReader )
{ {
m_ZoneClearance = clearance; m_ZoneClearance = clearance;
switch( padoption ) switch( padConnection )
{ {
case 'i': case 'i':
case 'I': case 'I':
m_PadOption = PAD_IN_ZONE; m_PadConnection = PAD_IN_ZONE;
break; break;
case 't': case 't':
case 'T': case 'T':
m_PadOption = THERMAL_PAD; m_PadConnection = THERMAL_PAD;
break; break;
case 'x': case 'x':
case 'X': case 'X':
m_PadOption = PAD_NOT_IN_ZONE; m_PadConnection = PAD_NOT_IN_ZONE;
break; break;
} }
} }
......
...@@ -1018,6 +1018,12 @@ void KICAD_PLUGIN::loadMODULE() ...@@ -1018,6 +1018,12 @@ void KICAD_PLUGIN::loadMODULE()
module->SetLocalClearance( tmp ); module->SetLocalClearance( tmp );
} }
else if( TESTLINE( ".ZoneConnection" ) )
{
int tmp = intParse( line + SZ( ".ZoneConnection" ) );
module->SetZoneConnection( (ZoneConnection)tmp );
}
else if( TESTLINE( "$EndMODULE" ) ) else if( TESTLINE( "$EndMODULE" ) )
{ {
module->CalculateBoundingBox(); module->CalculateBoundingBox();
...@@ -1220,6 +1226,12 @@ void KICAD_PLUGIN::loadPAD( MODULE* aModule ) ...@@ -1220,6 +1226,12 @@ void KICAD_PLUGIN::loadPAD( MODULE* aModule )
pad->SetLocalClearance( tmp ); pad->SetLocalClearance( tmp );
} }
else if( TESTLINE( ".ZoneConnection" ) )
{
int tmp = intParse( line + SZ( ".ZoneConnection" ) );
pad->SetZoneConnection( (ZoneConnection)tmp );
}
else if( TESTLINE( "$EndPAD" ) ) else if( TESTLINE( "$EndPAD" ) )
{ {
wxPoint padpos = pad->GetPosition(); wxPoint padpos = pad->GetPosition();
...@@ -3177,6 +3189,9 @@ void KICAD_PLUGIN::savePAD( const D_PAD* me ) const ...@@ -3177,6 +3189,9 @@ void KICAD_PLUGIN::savePAD( const D_PAD* me ) const
if( me->GetLocalClearance() != 0 ) if( me->GetLocalClearance() != 0 )
fprintf( m_fp, ".LocalClearance %s\n", fmtBIU( me->GetLocalClearance( ) ).c_str() ); fprintf( m_fp, ".LocalClearance %s\n", fmtBIU( me->GetLocalClearance( ) ).c_str() );
if( me->GetZoneConnection() != UNDEFINED_CONNECTION )
fprintf( m_fp, ".ZoneConnection %d\n", me->GetZoneConnection() );
fprintf( m_fp, "$EndPAD\n" ); fprintf( m_fp, "$EndPAD\n" );
CHECK_WRITE_ERROR(); CHECK_WRITE_ERROR();
...@@ -3230,6 +3245,9 @@ void KICAD_PLUGIN::saveMODULE( const MODULE* me ) const ...@@ -3230,6 +3245,9 @@ void KICAD_PLUGIN::saveMODULE( const MODULE* me ) const
if( me->GetLocalClearance() != 0 ) if( me->GetLocalClearance() != 0 )
fprintf( m_fp, ".LocalClearance %s\n", fmtBIU( me->GetLocalClearance( ) ).c_str() ); fprintf( m_fp, ".LocalClearance %s\n", fmtBIU( me->GetLocalClearance( ) ).c_str() );
if( me->GetZoneConnection() != UNDEFINED_CONNECTION )
fprintf( m_fp, ".ZoneConnection %d\n", me->GetZoneConnection() );
// attributes // attributes
if( me->GetAttributes() != MOD_DEFAULT ) if( me->GetAttributes() != MOD_DEFAULT )
{ {
......
...@@ -21,7 +21,8 @@ enum ZONE_EDIT_T { ...@@ -21,7 +21,8 @@ enum ZONE_EDIT_T {
/// How pads are covered by copper in zone /// How pads are covered by copper in zone
enum { enum ZoneConnection {
UNDEFINED_CONNECTION = -1,
PAD_NOT_IN_ZONE, ///< Pads are not covered PAD_NOT_IN_ZONE, ///< Pads are not covered
THERMAL_PAD, ///< Use thermal relief for pads THERMAL_PAD, ///< Use thermal relief for pads
PAD_IN_ZONE ///< pads are covered by copper PAD_IN_ZONE ///< pads are covered by copper
......
...@@ -233,8 +233,8 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) ...@@ -233,8 +233,8 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
int gap = zone_clearance; int gap = zone_clearance;
if( (m_PadOption == PAD_NOT_IN_ZONE) if( ( GetPadConnection( pad ) == PAD_NOT_IN_ZONE )
|| (GetNet() == 0) || pad->GetShape() == PAD_TRAPEZOID ) || ( GetNet() == 0 ) || ( pad->GetShape() == PAD_TRAPEZOID ) )
// PAD_TRAPEZOID shapes are not in zones because they are used in microwave apps // PAD_TRAPEZOID shapes are not in zones because they are used in microwave apps
// and i think it is good that shapes are not changed by thermal pads or others // and i think it is good that shapes are not changed by thermal pads or others
...@@ -358,29 +358,29 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) ...@@ -358,29 +358,29 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
} }
// Remove thermal symbols // Remove thermal symbols
if( m_PadOption == THERMAL_PAD ) for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
{ {
for( MODULE* module = aPcb->m_Modules; module; module = module->Next() ) for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() )
{ {
for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() ) if( GetPadConnection( pad ) != THERMAL_PAD )
{ continue;
if( !pad->IsOnLayer( GetLayer() ) )
continue;
if( pad->GetNet() != GetNet() ) if( !pad->IsOnLayer( GetLayer() ) )
continue; continue;
item_boundingbox = pad->GetBoundingBox();
item_boundingbox.Inflate( m_ThermalReliefGap, m_ThermalReliefGap );
if( item_boundingbox.Intersects( zone_boundingbox ) ) if( pad->GetNet() != GetNet() )
{ continue;
CreateThermalReliefPadPolygon( cornerBufferPolysToSubstract, item_boundingbox = pad->GetBoundingBox();
*pad, m_ThermalReliefGap, item_boundingbox.Inflate( m_ThermalReliefGap, m_ThermalReliefGap );
m_ThermalReliefCopperBridge,
m_ZoneMinThickness, if( item_boundingbox.Intersects( zone_boundingbox ) )
s_CircleToSegmentsCount, {
s_Correction, s_thermalRot ); CreateThermalReliefPadPolygon( cornerBufferPolysToSubstract,
} *pad, m_ThermalReliefGap,
m_ThermalReliefCopperBridge,
m_ZoneMinThickness,
s_CircleToSegmentsCount,
s_Correction, s_thermalRot );
} }
} }
} }
...@@ -405,28 +405,25 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) ...@@ -405,28 +405,25 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
Test_For_Copper_Island_And_Remove_Insulated_Islands( aPcb ); Test_For_Copper_Island_And_Remove_Insulated_Islands( aPcb );
// Now we remove all unused thermal stubs. // Now we remove all unused thermal stubs.
if( m_PadOption == THERMAL_PAD ) cornerBufferPolysToSubstract.clear();
{
cornerBufferPolysToSubstract.clear();
// Test thermal stubs connections and add polygons to remove unconnected stubs. // Test thermal stubs connections and add polygons to remove unconnected stubs.
BuildUnconnectedThermalStubsPolygonList( cornerBufferPolysToSubstract, aPcb, this, BuildUnconnectedThermalStubsPolygonList( cornerBufferPolysToSubstract, aPcb, this,
s_Correction, s_thermalRot ); s_Correction, s_thermalRot );
// remove copper areas // remove copper areas
if( cornerBufferPolysToSubstract.size() ) if( cornerBufferPolysToSubstract.size() )
{ {
KPolygonSet polyset_holes; KPolygonSet polyset_holes;
AddPolygonCornersToKPolygonList( cornerBufferPolysToSubstract, polyset_holes ); AddPolygonCornersToKPolygonList( cornerBufferPolysToSubstract, polyset_holes );
polyset_zone_solid_areas -= polyset_holes; polyset_zone_solid_areas -= polyset_holes;
// put these areas in m_FilledPolysList // put these areas in m_FilledPolysList
m_FilledPolysList.clear(); m_FilledPolysList.clear();
CopyPolygonsFromKPolygonListToFilledPolysList( this, polyset_zone_solid_areas ); CopyPolygonsFromKPolygonListToFilledPolysList( this, polyset_zone_solid_areas );
if( GetNet() > 0 ) if( GetNet() > 0 )
Test_For_Copper_Island_And_Remove_Insulated_Islands( aPcb ); Test_For_Copper_Island_And_Remove_Insulated_Islands( aPcb );
}
} }
cornerBufferPolysToSubstract.clear(); cornerBufferPolysToSubstract.clear();
......
...@@ -54,9 +54,13 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe ...@@ -54,9 +54,13 @@ void BuildUnconnectedThermalStubsPolygonList( std::vector<CPolyPt>& aCornerBuffe
{ {
for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() ) for( D_PAD* pad = module->m_Pads; pad != NULL; pad = pad->Next() )
{ {
if( aZone->GetPadConnection( pad ) != THERMAL_PAD )
continue;
// check // check
if( !pad->IsOnLayer( aZone->GetLayer() ) ) if( !pad->IsOnLayer( aZone->GetLayer() ) )
continue; continue;
if( pad->GetNet() != aZone->GetNet() ) if( pad->GetNet() != aZone->GetNet() )
continue; continue;
......
...@@ -83,7 +83,7 @@ bool ZONE_CONTAINER::IsSame( const ZONE_CONTAINER& aZoneToCompare ) ...@@ -83,7 +83,7 @@ bool ZONE_CONTAINER::IsSame( const ZONE_CONTAINER& aZoneToCompare )
if( m_ArcToSegmentsCount != aZoneToCompare.m_ArcToSegmentsCount ) if( m_ArcToSegmentsCount != aZoneToCompare.m_ArcToSegmentsCount )
return false; return false;
if( m_PadOption != aZoneToCompare.m_PadOption ) if( m_PadConnection != aZoneToCompare.m_PadConnection )
return false; return false;
if( m_ThermalReliefGap != aZoneToCompare.m_ThermalReliefGap ) if( m_ThermalReliefGap != aZoneToCompare.m_ThermalReliefGap )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment