Commit ffca5239 authored by charras's avatar charras

code cleaning in zones functions

parent cbdf6a90
......@@ -43,6 +43,7 @@ set(CVPCB_EXTRA_SRCS
../pcbnew/class_text_mod.cpp
../pcbnew/class_track.cpp
../pcbnew/class_zone.cpp
../pcbnew/class_zone_setting.cpp
../pcbnew/classpcb.cpp
../pcbnew/collectors.cpp
../pcbnew/ioascii.cpp
......
......@@ -17,6 +17,7 @@ LIBVIEWER3D = ../3d-viewer/3d-viewer.a
OBJECTS = $(TARGET).o \
class_cvpcb.o\
class_zone.o\
class_zone_setting.o\
memoire.o \
cvframe.o\
listboxes.o\
......@@ -81,6 +82,9 @@ class_mire.o: ../pcbnew/class_mire.cpp ../pcbnew/class_mire.h $(COMMON)
class_zone.o: ../pcbnew/class_zone.cpp ../pcbnew/class_zone.h $(COMMON)
$(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_zone_setting.o: ../pcbnew/class_zone_setting.cpp ../pcbnew/class_zone_setting.h $(COMMON)
$(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_cotation.o: ../pcbnew/class_cotation.cpp ../pcbnew/class_cotation.h $(COMMON)
$(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
......
......@@ -419,8 +419,8 @@ void WinEDA_SchematicFrame::SetToolbars()
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_BUS_WIRES_ORIENT,
g_HVLines );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_BUS_WIRES_ORIENT,
g_HVLines ? _( "Snap Grid (OFF)" ) :
_( "Snap Grid (ON)" ) );
g_HVLines ? _( "Allows any direction for wires and busses" ) :
_( "Allows horizontal and vertical wires and busses only" ) );
}
DisplayUnitsMsg();
......
......@@ -48,6 +48,7 @@ set(GERBVIEW_EXTRA_SRCS
../pcbnew/class_pcb_text.cpp
../pcbnew/class_track.cpp
../pcbnew/class_zone.cpp
../pcbnew/class_zone_setting.cpp
../pcbnew/classpcb.cpp
../pcbnew/collectors.cpp
../pcbnew/sel_layer.cpp
......
......@@ -13,6 +13,7 @@ OBJECTS= \
$(TARGET).o\
classpcb.o\
class_zone.o\
class_zone_setting.o\
select_layers_to_pcb.o\
sel_layer.o\
lay2plot.o\
......@@ -78,6 +79,9 @@ class_marker.o: ../pcbnew/class_marker.cpp ../pcbnew/class_marker.h $(COMMON)
class_zone.o: ../pcbnew/class_zone.cpp ../pcbnew/class_zone.h $(COMMON)
$(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_zone_setting.o: ../pcbnew/class_zone_setting.cpp ../pcbnew/class_zone_setting.h $(COMMON)
$(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
class_drawsegment.o: ../pcbnew/class_drawsegment.cpp ../pcbnew/class_drawsegment.h $(DEPEND)
$(CXX) -c $(EDACPPFLAGS) -o $@ ../pcbnew/$*.cpp
......
......@@ -158,7 +158,6 @@ public:
int m_PcbTextWidth; // current Pcb (not module) Text width
wxSize m_PcbTextSize; // current Pcb (not module) Text size
int m_TrackClearence; // track to track and track to pads clearance
int m_ZoneClearence; // zone to track and zone to pads clearance
int m_MaskMargin; // Solder mask margin
// Color options for screen display of the Printed Board:
......
No preview for this file type
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -32,6 +32,7 @@ set(PCBNEW_SRCS
class_text_mod.cpp
class_track.cpp
class_zone.cpp
class_zone_setting.cpp
clean.cpp
# cleaningoptions_dialog.cpp
collectors.cpp
......
......@@ -12,7 +12,6 @@
#include "pcbnew.h"
#include "trigo.h"
#include "zones.h"
#include "autorout.h"
/************************/
......@@ -25,16 +24,10 @@ ZONE_CONTAINER::ZONE_CONTAINER( BOARD* parent ) :
{
m_NetCode = -1; // Net number for fast comparisons
m_CornerSelection = -1;
m_ZoneClearance = g_DesignSettings.m_ZoneClearence; // a reasonnable clerance value
m_GridFillValue = g_GridRoutingSize; // a reasonnable grid used for filling
m_PadOption = g_Zone_Pad_Options;
utility = 0; // flags used in polygon calculations
utility2 = 0; // flags used in polygon calculations
m_Poly = new CPolyLine(); // Outlines
m_ArcToSegmentsCount = g_Zone_Arc_Approximation; // Use 16 or 32segment to convert a circle to a polygon
m_DrawOptions = 0;
m_ThermalReliefGapValue = g_ThermalReliefGapValue; // tickness of the gap in thermal reliefs
m_ThermalReliefCopperBridgeValue = g_ThermalReliefCopperBridgeValue; // tickness of the copper bridge in thermal reliefs
g_Zone_Default_Setting.ExportSetting(*this);
}
......@@ -941,3 +934,21 @@ void ZONE_CONTAINER::Copy( ZONE_CONTAINER* src )
m_PadOption = src->m_PadOption;
m_Poly->SetHatch( src->m_Poly->GetHatchStyle() );
}
/**
* Function SetNetNameFromNetCode
* Fin the nat name corresponding to the net code.
* @param aPcb: the curren board
* @return bool - true if net found, else false
*/
bool ZONE_CONTAINER::SetNetNameFromNetCode( void )
{
EQUIPOT* net;
if ( m_Parent && (net = ((BOARD*)m_Parent)->FindNet( GetNet()) ) )
{
m_Netname = net->m_Netname;
return true;
}
return false;
}
......@@ -9,6 +9,7 @@
#include "PolyLine.h"
/************************/
/* class ZONE_CONTAINER */
/************************/
......@@ -21,19 +22,13 @@
class ZONE_CONTAINER : public BOARD_ITEM
{
public:
enum m_PadInZone { // How pads are covered by copper in zone
PAD_NOT_IN_ZONE, // Pads are not covered
THERMAL_PAD, // Use thermal relief for pads
PAD_IN_ZONE // pads are covered by copper
};
wxString m_Netname; // Net Name
CPolyLine* m_Poly; // outlines
int m_CornerSelection; // For corner moving, corner index to drag, or -1 if no selection
int m_ZoneClearance; // clearance value
int m_GridFillValue; // Grid used for filling, 0 = use polygonal areas to fill
int m_ArcToSegmentsCount; // number of segments to convert a cirlce to a polygon (uses 16 or 32)
m_PadInZone m_PadOption; // see m_PadInZone
int m_PadOption; //
int m_ThermalReliefGapValue; // tickness of the gap in thermal reliefs
int m_ThermalReliefCopperBridgeValue; // tickness of the copper bridge in thermal reliefs
int utility, utility2; // flags used in polygon calculations
......@@ -143,6 +138,13 @@ public:
void SetNet( int anet_code );
/**
* Function SetNetNameFromNetCode
* Fin the nat name corresponding to the net code.
* @return bool - true if net found, else false
*/
bool SetNetNameFromNetCode( void);
/**
* Function HitTest
* tests if the given wxPoint is within the bounds of this object.
......@@ -286,6 +288,11 @@ public:
{
m_Poly->AppendCorner( position.x, position.y );
}
int GetHatchStyle() const
{
return m_Poly->GetHatchStyle();
}
};
......
/******************************************************/
/* class ZONE_SETTING used to handle zones parameters */
/******************************************************/
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
/* For compilers that support precompilation:
*/
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#include "fctsys.h"
#include "PolyLine.h"
#include "common.h"
#include "pcbnew.h"
#include "zones.h"
#include "class_zone.h"
ZONE_SETTING::ZONE_SETTING( void )
{
m_GridFillValue = 250; // Grid value for filling zone by segments, 0 to used polygons to fill
m_ZoneClearance = 200; // Clearance value
m_NetcodeSelection = 0; // Net code selection for the current zone
m_CurrentZone_Layer = 0; // Layer used to create the current zone
m_Zone_HatchingStyle = CPolyLine::DIAGONAL_EDGE; // Option to show the zone area (outlines only, short hatches or full hatches
m_ArcToSegmentsCount = 16; /* Option to select number of segments to approximate a circle
* 16 or 32 segments */
m_FilledAreasShowMode = 0; // Used to select draw options for filled areas in a zone (currently normal =0, sketch = 1)
m_ThermalReliefGapValue = 200; // tickness of the gap in thermal reliefs
m_ThermalReliefCopperBridgeValue = 200; // tickness of the copper bridge in thermal reliefs
m_Zone_Pad_Options = THERMAL_PAD; // How pads are covered by copper in zone
}
/** function ImportSetting
* copy settings from a given zone
* @param aSource: the given zone
*/
void ZONE_SETTING::ImportSetting( const ZONE_CONTAINER& aSource )
{
m_GridFillValue = aSource.m_GridFillValue;
m_ZoneClearance = aSource.m_ZoneClearance;
m_NetcodeSelection = aSource.GetNet();
m_CurrentZone_Layer = aSource.GetLayer();
m_Zone_HatchingStyle = aSource.GetHatchStyle();
m_ArcToSegmentsCount = aSource.m_ArcToSegmentsCount;
m_FilledAreasShowMode = aSource.m_DrawOptions;
m_ThermalReliefGapValue = aSource.m_ThermalReliefGapValue;
m_ThermalReliefCopperBridgeValue = aSource.m_ThermalReliefCopperBridgeValue;
m_Zone_Pad_Options = aSource.m_PadOption;
}
/** function ExportSetting
* copy settings to a given zone
* @param aTarget: the given zone
* Note: parameters NOT exported (because they cannot be safely exported):
* m_NetcodeSelection
*/
void ZONE_SETTING::ExportSetting( ZONE_CONTAINER& aTarget )
{
aTarget.m_GridFillValue = m_GridFillValue;
aTarget.m_ZoneClearance = m_ZoneClearance;
aTarget.SetNet(m_NetcodeSelection);
aTarget.SetLayer(m_CurrentZone_Layer);
aTarget.m_Poly->SetHatch(m_Zone_HatchingStyle);
aTarget.m_ArcToSegmentsCount = m_ArcToSegmentsCount;
aTarget.m_DrawOptions = m_FilledAreasShowMode;
aTarget.m_ThermalReliefGapValue = m_ThermalReliefGapValue;
aTarget.m_ThermalReliefCopperBridgeValue = m_ThermalReliefCopperBridgeValue;
aTarget.m_PadOption = m_Zone_Pad_Options;
}
/****************************************************************/
/* class ZONE_SETTING used to handle zones parameters in dialogs */
/****************************************************************/
#ifndef ZONE_SETTING_H
#define ZONE_SETTING_H
#ifndef eda_global
#define eda_global extern
#endif
/*************************************************/
/* Class ZONE_SETTING to handle zones parameters */
/*************************************************/
class ZONE_SETTING
{
public:
int m_GridFillValue; // Grid value for filling zone by segments, 0 to used polygons to fill
int m_ZoneClearance; // Clearance value
int m_NetcodeSelection; // Net code selection for the current zone
int m_CurrentZone_Layer; // Layer used to create the current zone
int m_Zone_HatchingStyle; // Option to show the zone area (outlines only, short hatches or full hatches
int m_ArcToSegmentsCount; /* Option to select number of segments to approximate a circle
* 16 or 32 segments */
int m_FilledAreasShowMode; // Used to select draw options for filled areas in a zone (currently normal =0, sketch = 1)
long m_ThermalReliefGapValue; // tickness of the gap in thermal reliefs
long m_ThermalReliefCopperBridgeValue; // tickness of the copper bridge in thermal reliefs
int m_Zone_Pad_Options; // How pads are covered by copper in zone
public:
ZONE_SETTING( void );
/** function ImportSetting
* copy settings from a given zone
* @param aSource: the given zone
*/
void ImportSetting( const ZONE_CONTAINER& aSource );
/** function ExportSetting
* copy settings to a given zone
* @param aTarget: the given zone
*/
void ExportSetting( ZONE_CONTAINER& aTarget );
};
#endif // ifndef ZONE_SETTING_H
......@@ -157,7 +157,6 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
m_PcbTextWidth = 100; // current Pcb (not module) Text width
m_PcbTextSize = wxSize( 500, 500 ); // current Pcb (not module) Text size
m_TrackClearence = 100; // track to track and track to pads clearance
m_ZoneClearence = 150; // zone to track and zone to pads clearance
m_MaskMargin = 150; // Solder mask margin
/* Color options for screen display of the Printed Board: */
m_PcbGridColor = DARKGRAY; // Grid color
......
This diff is collapsed.
......@@ -11,17 +11,16 @@ class dialog_copper_zone: public dialog_copper_zone_frame
{
public:
WinEDA_PcbFrame* m_Parent;
ZONE_CONTAINER * m_Zone_Container;
ZONE_SETTING * m_Zone_Setting;
long m_NetSorting;
int m_LayerId[LAYER_COUNT]; // Handle the real layer number from layer name position in m_LayerSelectionCtrl
public:
dialog_copper_zone( WinEDA_PcbFrame* parent, ZONE_CONTAINER * zone_container);
dialog_copper_zone( WinEDA_PcbFrame* parent, ZONE_SETTING * zone_setting);
void OnInitDialog( wxInitDialogEvent& event );
void OnButtonOkClick( wxCommandEvent& event );
void OnButtonCancelClick( wxCommandEvent& event );
bool AcceptOptions(bool aPromptForErrors, bool aUseExportableSetupOnly = false);
void OnRemoveFillZoneButtonClick( wxCommandEvent& event );
void OnNetSortingOptionSelected( wxCommandEvent& event );
void ExportSetupToOtherCopperZones( wxCommandEvent& event );
void OnPadsInZoneClick( wxCommandEvent& event );
......
......@@ -15,7 +15,6 @@ BEGIN_EVENT_TABLE( dialog_copper_zone_frame, wxDialog )
EVT_BUTTON( wxID_BUTTON_EXPORT, dialog_copper_zone_frame::_wxFB_ExportSetupToOtherCopperZones )
EVT_BUTTON( wxID_OK, dialog_copper_zone_frame::_wxFB_OnButtonOkClick )
EVT_BUTTON( wxID_CANCEL, dialog_copper_zone_frame::_wxFB_OnButtonCancelClick )
EVT_BUTTON( wxID_BUTTON_UNFILL, dialog_copper_zone_frame::_wxFB_OnRemoveFillZoneButtonClick )
EVT_RADIOBOX( ID_NET_SORTING_OPTION, dialog_copper_zone_frame::_wxFB_OnNetSortingOptionSelected )
END_EVENT_TABLE()
......@@ -155,9 +154,6 @@ dialog_copper_zone_frame::dialog_copper_zone_frame( wxWindow* parent, wxWindowID
m_ButtonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
m_RightBoxSizer->Add( m_ButtonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_UnFillZoneButton = new wxButton( this, wxID_BUTTON_UNFILL, _("Remove Filling"), wxDefaultPosition, wxDefaultSize, 0 );
m_RightBoxSizer->Add( m_UnFillZoneButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_RightBoxSizer->Add( 5, 20, 0, wxEXPAND, 5 );
......
......@@ -1012,58 +1012,6 @@
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_BUTTON_UNFILL</property>
<property name="label">Remove Filling</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_UnFillZoneButton</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnRemoveFillZoneButtonClick</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
......
......@@ -41,7 +41,6 @@ class dialog_copper_zone_frame : public wxDialog
void _wxFB_ExportSetupToOtherCopperZones( wxCommandEvent& event ){ ExportSetupToOtherCopperZones( event ); }
void _wxFB_OnButtonOkClick( wxCommandEvent& event ){ OnButtonOkClick( event ); }
void _wxFB_OnButtonCancelClick( wxCommandEvent& event ){ OnButtonCancelClick( event ); }
void _wxFB_OnRemoveFillZoneButtonClick( wxCommandEvent& event ){ OnRemoveFillZoneButtonClick( event ); }
void _wxFB_OnNetSortingOptionSelected( wxCommandEvent& event ){ OnNetSortingOptionSelected( event ); }
......@@ -55,7 +54,6 @@ class dialog_copper_zone_frame : public wxDialog
ID_RADIOBOX_OUTLINES_OPTION,
wxID_ARC_APPROX,
wxID_BUTTON_EXPORT,
wxID_BUTTON_UNFILL,
ID_NET_SORTING_OPTION,
ID_TEXTCTRL_NETNAMES_FILTER,
ID_NETNAME_SELECTION,
......@@ -79,7 +77,6 @@ class dialog_copper_zone_frame : public wxDialog
wxButton* m_OkButton;
wxButton* m_ButtonCancel;
wxButton* m_UnFillZoneButton;
wxRadioBox* m_NetSortingOption;
wxStaticText* m_staticText5;
......@@ -95,7 +92,6 @@ class dialog_copper_zone_frame : public wxDialog
virtual void ExportSetupToOtherCopperZones( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnRemoveFillZoneButtonClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnNetSortingOptionSelected( wxCommandEvent& event ){ event.Skip(); }
......
......@@ -352,7 +352,7 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
if( stricmp( Line, "ZoneClearence" ) == 0 )
{
g_DesignSettings.m_ZoneClearence = atoi( data );
g_Zone_Default_Setting.m_ZoneClearance = atoi( data );
continue;
}
......@@ -543,7 +543,7 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame, BOARD* aBoard )
}
fprintf( aFile, "TrackClearence %d\n", g_DesignSettings.m_TrackClearence );
fprintf( aFile, "ZoneClearence %d\n", g_DesignSettings.m_ZoneClearence );
fprintf( aFile, "ZoneClearence %d\n", g_Zone_Default_Setting.m_ZoneClearance );
fprintf( aFile, "DrawSegmWidth %d\n", g_DesignSettings.m_DrawSegmentWidth );
fprintf( aFile, "EdgeSegmWidth %d\n", g_DesignSettings.m_EdgeSegmentWidth );
......
......@@ -57,6 +57,7 @@ OBJECTS= $(TARGET).o classpcb.o\
class_drc_item.o\
class_board.o\
class_zone.o\
class_zone_setting.o\
drawframe.o\
drawpanel.o\
track.o \
......
......@@ -47,7 +47,7 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
g_GridRoutingSize = 25;
// Set the g_DesignSettings.m_TrackClearence (used to fill board map) to the max of m_TrackClearence and m_ZoneClearence
g_DesignSettings.m_TrackClearence = max ( g_DesignSettings.m_TrackClearence, g_DesignSettings.m_ZoneClearence);
g_DesignSettings.m_TrackClearence = max ( g_DesignSettings.m_TrackClearence, m_ZoneClearance);
// In order to avoid ends of segments used to fill the zone, and to the clearence the radius of ends
// which is g_GridRoutingSize/2
......
......@@ -10,12 +10,14 @@
#define eda_global extern
#endif
#include "class_zone_setting.h"
// keys used to store net sort option in config file :
#define ZONE_NET_OUTLINES_HATCH_OPTION_KEY wxT( "Zone_Ouline_Hatch_Opt" )
#define ZONE_NET_SORT_OPTION_KEY wxT( "Zone_NetSort_Opt" )
#define ZONE_NET_FILTER_STRING_KEY wxT( "Zone_Filter_Opt" )
#define ZONE_THERMAL_RELIEF_GAP_STRING_KEY wxT( "Zone_TH_Gap" )
#define ZONE_NET_OUTLINES_HATCH_OPTION_KEY wxT( "Zone_Ouline_Hatch_Opt" )
#define ZONE_NET_SORT_OPTION_KEY wxT( "Zone_NetSort_Opt" )
#define ZONE_NET_FILTER_STRING_KEY wxT( "Zone_Filter_Opt" )
#define ZONE_THERMAL_RELIEF_GAP_STRING_KEY wxT( "Zone_TH_Gap" )
#define ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY wxT( "Zone_TH_Copper_Width" )
enum zone_cmd {
......@@ -24,44 +26,29 @@ enum zone_cmd {
};
enum { // How pads are covered by copper in zone
PAD_NOT_IN_ZONE, // Pads are not covered
THERMAL_PAD, // Use thermal relief for pads
PAD_IN_ZONE // pads are covered by copper
};
/************************************************/
/* variables used in zone dialogs and functions */
/************************************************/
/* parametre grid size for automatic routing and zone filling */
/* parametre grid size for automatic routing */
#if defined MAIN
int g_GridRoutingSize = 250;
int g_GridRoutingSize = 250;
#else
extern int g_GridRoutingSize;
extern int g_GridRoutingSize;
#endif
// @todo: make a class like ZONE_GENERAL_SETTING instead of many global variables
eda_global bool g_Zone_45_Only
#ifdef MAIN
= FALSE
#endif
;
eda_global int g_NetcodeSelection; // Net code selection for the current zone
eda_global int g_CurrentZone_Layer; // Layer used to create the current zone
eda_global int g_Zone_Hatching; // Option to show the zone area (outlines only, short hatches or full hatches
eda_global int g_Zone_Arc_Approximation; // Option to select number of segments to approximate a circle
// 16 or 32 segments
eda_global int g_FilledAreasShowMode; // Used to select draw options for filled areas in a zone (currently normal =0, sketch = 1)
eda_global long g_ThermalReliefGapValue // tickness of the gap in thermal reliefs
#ifdef MAIN
= 200
#endif
;
eda_global long g_ThermalReliefCopperBridgeValue // tickness of the copper bridge in thermal reliefs
#ifdef MAIN
= 200
#endif
;
eda_global ZONE_CONTAINER::m_PadInZone g_Zone_Pad_Options
#ifdef MAIN
= ZONE_CONTAINER::THERMAL_PAD
#endif
;
eda_global ZONE_SETTING g_Zone_Default_Setting; // Default setting used when creating a new zone
#endif // ifndef ZONES_H
This diff is collapsed.
......@@ -74,7 +74,7 @@ void DialogNonCopperZonesEditor::InitDialog( wxInitDialogEvent& event )
if( g_Zone_45_Only )
m_OrientEdgesOpt->SetSelection( 1 );
switch( g_Zone_Hatching )
switch( g_Zone_Default_Setting.m_Zone_HatchingStyle )
{
case CPolyLine::NO_HATCH:
m_OutlineAppearanceCtrl->SetSelection( 0 );
......@@ -122,22 +122,22 @@ void DialogNonCopperZonesEditor::OnOkClick( wxCommandEvent& event )
switch( m_OutlineAppearanceCtrl->GetSelection() )
{
case 0:
g_Zone_Hatching = CPolyLine::NO_HATCH;
g_Zone_Default_Setting.m_Zone_HatchingStyle = CPolyLine::NO_HATCH;
break;
case 1:
g_Zone_Hatching = CPolyLine::DIAGONAL_EDGE;
g_Zone_Default_Setting.m_Zone_HatchingStyle = CPolyLine::DIAGONAL_EDGE;
break;
case 2:
g_Zone_Hatching = CPolyLine::DIAGONAL_FULL;
g_Zone_Default_Setting.m_Zone_HatchingStyle = CPolyLine::DIAGONAL_FULL;
break;
}
if( m_Parent->m_Parent->m_EDA_Config )
{
m_Parent->m_Parent->m_EDA_Config->Write( ZONE_NET_OUTLINES_HATCH_OPTION_KEY,
(long) g_Zone_Hatching );
(long) g_Zone_Default_Setting.m_Zone_HatchingStyle );
}
if( m_OrientEdgesOpt->GetSelection() == 0 )
......@@ -152,7 +152,7 @@ void DialogNonCopperZonesEditor::OnOkClick( wxCommandEvent& event )
DisplayError( this, _( "Error : you must choose a layer" ) );
return;
}
g_CurrentZone_Layer = ii + FIRST_NO_COPPER_LAYER;
g_Zone_Default_Setting.m_CurrentZone_Layer = ii + FIRST_NO_COPPER_LAYER;
EndModal( ZONE_OK );
}
......@@ -209,11 +209,11 @@ int ZONE_CONTAINER::BuildFilledPolysListData( BOARD * aPcb )
}
m_Poly->FreeKboolEngine();
/* For copper layers, we now must add holes in the Polygon list.
holes are pads and tracks with their clearance area
*/
if ( IsOnCopperLayer() )
AddClearanceAreasPolygonsToPolysList( aPcb );
......
......@@ -1059,6 +1059,7 @@ bool DRC::doEdgeZoneDrc( ZONE_CONTAINER* aArea, int aCornerIndex )
for( int ia2 = 0; ia2 < m_pcb->GetAreaCount(); ia2++ )
{
ZONE_CONTAINER* Area_To_Test = m_pcb->GetArea( ia2 );
int zone_clearance = max(Area_To_Test->m_ZoneClearance, aArea->m_ZoneClearance);
// test for same layer
if( Area_To_Test->GetLayer() != aArea->GetLayer() )
......@@ -1111,9 +1112,9 @@ bool DRC::doEdgeZoneDrc( ZONE_CONTAINER* aArea, int aCornerIndex )
0,
ax1, ay1, ax2, ay2, astyle,
0,
g_DesignSettings.m_ZoneClearence,
zone_clearance,
&x, &y );
if( d < g_DesignSettings.m_ZoneClearence )
if( d < zone_clearance )
{
// COPPERAREA_COPPERAREA error : edge intersect or too close
m_currentMarker = fillMarker( aArea, wxPoint( x, y ),
......
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