Commit 60fb3fb7 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: added a priority level for zones: a zone with a hight priority can be...

Pcbnew: added a priority level for zones: a zone with a hight priority can be now inside an other low priority zone.
useful for complex zones.
fix in footprint copy.
minor enhancement in netlist/ Footprints Test.
parents c0d39da5 e6306723
......@@ -8,6 +8,7 @@
#include <vector>
#include <fctsys.h>
#include <polygons_defs.h>
#include <pcbnew.h>
#include <wxPcbStruct.h>
#include <trigo.h>
......@@ -17,6 +18,7 @@
#include <class_track.h>
#include <class_drawsegment.h>
#include <class_pcb_text.h>
#include <class_zone.h>
/* Exported functions */
......@@ -130,6 +132,90 @@ void TEXTE_PCB::TransformShapeWithClearanceToPolygon( std::vector <CPolyPt>& aCo
aCornerBuffer.back().end_contour = true;
}
/* Function TransformShapeWithClearanceToPolygon
* Convert the track shape to a closed polygon
* Used in filling zones calculations
* Circles (vias) and arcs (ends of tracks) are approximated by segments
* param aCornerBuffer = a buffer to store the polygon
* param aClearanceValue = the clearance around the pad
* param aCircleToSegmentsCount = the number of segments to approximate a circle
* param aCorrectionFactor = the correction to apply to circles radius to keep
* param aAddClearance = true to add a clearance area to the polygon
* false to create the outline polygon.
* clearance when the circle is approximated by segment bigger or equal
* to the real clearance value (usually near from 1.0)
*/
void ZONE_CONTAINER::TransformShapeWithClearanceToPolygon( std::vector <CPolyPt>& aCornerBuffer,
int aClearanceValue,
int aCircleToSegmentsCount,
double aCorrectionFactor,
bool aAddClearance )
{
/* Creates the main polygon (i.e. the filled area using only one outline)
* and reserve a clearance margin around the outlines and holes
*/
std::vector <CPolyPt> zoneOutines;
BuildFilledPolysListData( NULL, &zoneOutines );
int clearance = 0;
if( aAddClearance )
{
GetClearance();
if( aClearanceValue > clearance )
clearance = aClearanceValue;
}
// Calculate the polygon with clearance and holes
// holes are linked to the main outline, so only one polygon should be created.
KPolygonSet polyset_zone_solid_areas;
std::vector<KPolyPoint> cornerslist;
unsigned ic = 0;
unsigned corners_count = zoneOutines.size();
while( ic < corners_count )
{
cornerslist.clear();
KPolygon poly;
{
for( ; ic < corners_count; ic++ )
{
CPolyPt* corner = &zoneOutines[ic];
cornerslist.push_back( KPolyPoint( corner->x, corner->y ) );
if( corner->end_contour )
{
ic++;
break;
}
}
bpl::set_points( poly, cornerslist.begin(), cornerslist.end() );
polyset_zone_solid_areas.push_back( poly );
}
}
polyset_zone_solid_areas += clearance;
// Put the resultng polygon in buffer
for( unsigned ii = 0; ii < polyset_zone_solid_areas.size(); ii++ )
{
KPolygon& poly = polyset_zone_solid_areas[ii];
CPolyPt corner( 0, 0, false );
for( unsigned jj = 0; jj < poly.size(); jj++ )
{
KPolyPoint point = *(poly.begin() + jj);
corner.x = point.x();
corner.y = point.y();
corner.end_contour = false;
aCornerBuffer.push_back( corner );
}
corner.end_contour = true;
aCornerBuffer.pop_back();
aCornerBuffer.push_back( corner );
}
}
/**
* Function TransformShapeWithClearanceToPolygon
......
......@@ -85,7 +85,9 @@ MODULE::MODULE( const MODULE& aModule ) :
m_Pos = aModule.m_Pos;
m_LibRef = aModule.m_LibRef;
m_Layer = aModule.m_Layer;
m_Attributs = aModule.m_Attributs;
m_ModuleStatus = aModule.m_ModuleStatus;
m_Orient = aModule.m_Orient;
m_BoundaryBox = aModule.m_BoundaryBox;
m_PadNum = aModule.m_PadNum;
......@@ -199,6 +201,7 @@ void MODULE::Copy( MODULE* aModule )
m_Layer = aModule->m_Layer;
m_LibRef = aModule->m_LibRef;
m_Attributs = aModule->m_Attributs;
m_ModuleStatus = aModule->m_ModuleStatus;
m_Orient = aModule->m_Orient;
m_BoundaryBox = aModule->m_BoundaryBox;
m_PadNum = aModule->m_PadNum;
......
......@@ -55,6 +55,7 @@ ZONE_CONTAINER::ZONE_CONTAINER( BOARD* parent ) :
m_CornerSelection = -1;
m_IsFilled = false; // fill status : true when the zone is filled
m_FillMode = 0; // How to fill areas: 0 = use filled polygons, != 0 fill with segments
m_priority = 0;
smoothedPoly = NULL;
cornerSmoothingType = ZONE_SETTING::SMOOTHING_NONE;
cornerRadius = 0;
......@@ -77,6 +78,7 @@ ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) :
m_ZoneClearance = aZone.m_ZoneClearance; // clearance value
m_ZoneMinThickness = aZone.m_ZoneMinThickness;
m_FillMode = aZone.m_FillMode; // Filling mode (segments/polygons)
m_priority = aZone.m_priority;
m_ArcToSegmentsCount = aZone.m_ArcToSegmentsCount;
m_PadOption = aZone.m_PadOption;
m_ThermalReliefGap = aZone.m_ThermalReliefGap;
......@@ -677,16 +679,21 @@ void ZONE_CONTAINER::DisplayInfo( EDA_DRAW_FRAME* frame )
}
frame->AppendMsgPanel( _( "NetName" ), msg, RED );
#if 1
// Display net code : (useful in test or debug)
msg.Printf( wxT( "%d" ), GetNet() );
frame->AppendMsgPanel( _( "NetCode" ), msg, RED );
#endif
// Display priority level
msg.Printf( wxT( "%d" ), GetPriority() );
frame->AppendMsgPanel( _( "Priority" ), msg, BLUE );
}
else
{
frame->AppendMsgPanel( _( "Non Copper Zone" ), wxEmptyString, RED );
}
/* Display net code : (useful in test or debug) */
msg.Printf( wxT( "%d" ), GetNet() );
frame->AppendMsgPanel( _( "NetCode" ), msg, RED );
msg = board->GetLayerName( m_Layer );
frame->AppendMsgPanel( _( "Layer" ), msg, BROWN );
......
......@@ -124,6 +124,10 @@ private:
CPolyLine* smoothedPoly; // Corner-smoothed version of m_Poly
int cornerSmoothingType;
unsigned int cornerRadius;
// Priority: when a zone outline is inside and other zone, if its priority is highter
// the other zone priority, it will be created inside.
// if priorities are equal, a DRC erroc is set
unsigned m_priority;
public:
ZONE_CONTAINER( BOARD* parent );
......@@ -149,6 +153,18 @@ public:
const wxPoint GetPosition() const; // overload
void SetPosition( const wxPoint& aPos ); // overload
/**
* Function SetPriority
* @param aPriority = the priority level
*/
void SetPriority( unsigned aPriority ) { m_priority = aPriority; }
/**
* Function GetPriority
* @return the priority level of this zone
*/
unsigned GetPriority() const { return m_priority; }
/**
* Function copy
* copy useful data from the source.
......@@ -305,11 +321,13 @@ public:
* in order to have drawable (and plottable) filled polygons
* drawable filled polygons are polygons without hole
* @param aPcb: the current board (can be NULL for non copper zones)
* @param aCornerBuffer: A reference to a buffer to put polygon corners, or NULL
* if NULL (default), uses m_FilledPolysList and fill current zone.
* @return number of polygons
* This function does not add holes for pads and tracks but calls
* AddClearanceAreasPolygonsToPolysList() to do that for copper layers
*/
int BuildFilledPolysListData( BOARD* aPcb );
int BuildFilledPolysListData( BOARD* aPcb, std::vector <CPolyPt>* aCornerBuffer = NULL );
/**
* Function AddClearanceAreasPolygonsToPolysList
......@@ -484,6 +502,25 @@ public:
return m_Poly->GetHatchStyle();
}
/**
* Function TransformShapeWithClearanceToPolygon
* Convert the track shape to a closed polygon
* Used in filling zones calculations
* Circles (vias) and arcs (ends of tracks) are approximated by segments
* @param aCornerBuffer = a buffer to store the polygon
* @param aClearanceValue = the clearance around the pad
* @param aCircleToSegmentsCount = the number of segments to approximate a circle
* @param aCorrectionFactor = the correction to apply to circles radius to keep
* @param aAddClearance = true to add a clearance area to the polygon
* false to create the outline polygon.
* clearance when the circle is approximated by segment bigger or equal
* to the real clearance value (usually near from 1.0)
*/
void TransformShapeWithClearanceToPolygon( std::vector <CPolyPt>& aCornerBuffer,
int aClearanceValue,
int aCircleToSegmentsCount,
double aCorrectionFactor,
bool aAddClearance );
/**
* Function IsSame
* tests if 2 zones are equivalent:
......
......@@ -24,6 +24,7 @@
ZONE_SETTING::ZONE_SETTING( void )
{
m_ZonePriority = 0;
m_FillMode = 0; // Mode for filling zone : 1 use segments, 0 use polygons
m_ZoneClearance = 200; // Clearance value
m_ZoneMinThickness = 100; // Min thickness value in filled areas
......@@ -50,6 +51,7 @@ ZONE_SETTING::ZONE_SETTING( void )
*/
void ZONE_SETTING::ImportSetting( const ZONE_CONTAINER& aSource )
{
m_ZonePriority = aSource.GetPriority();
m_FillMode = aSource.m_FillMode;
m_ZoneClearance = aSource.m_ZoneClearance;
m_ZoneMinThickness = aSource.m_ZoneMinThickness;
......@@ -88,6 +90,7 @@ void ZONE_SETTING::ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport )
aTarget.SetCornerRadius( cornerRadius );
if( aFullExport )
{
aTarget.SetPriority( m_ZonePriority );
aTarget.SetNet( m_NetcodeSelection );
aTarget.SetLayer( m_CurrentZone_Layer );
}
......
......@@ -30,6 +30,8 @@ public:
// Mode for filling zone : 1 use segments, 0 use polygons
int m_FillMode;
int m_ZonePriority; // Priority (0 ... N) of the zone
int m_ZoneClearance; // Clearance value
int m_ZoneMinThickness; // Min thickness value in filled areas
int m_NetcodeSelection; // Net code selection for the current zone
......
......@@ -119,6 +119,8 @@ void DIALOG_COPPER_ZONE::initDialog()
m_CopperWidthValue->Enable( true );
}
m_PriorityLevelCtrl->SetValue( m_Zone_Setting->m_ZonePriority );
AddUnitSymbol( *m_AntipadSizeText, g_UserUnit );
AddUnitSymbol( *m_CopperBridgeWidthText, g_UserUnit );
PutValueInLocalUnits( *m_AntipadSizeValue,
......@@ -323,6 +325,8 @@ bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportab
txtvalue = m_cornerSmoothingCtrl->GetValue();
m_Zone_Setting->SetCornerRadius( ReturnValueFromString( g_UserUnit, txtvalue, m_Parent->GetInternalUnits() ) );
m_Zone_Setting->m_ZonePriority = m_PriorityLevelCtrl->GetValue();
if( m_OrientEdgesOpt->GetSelection() == 0 )
g_Zone_45_Only = false;
else
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 18 2010)
// C++ code generated with wxFormBuilder (version Jun 30 2011)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -105,11 +105,11 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
m_MinThicknessValueTitle = new wxStaticText( this, wxID_ANY, _("Minimum width"), wxDefaultPosition, wxDefaultSize, 0 );
m_MinThicknessValueTitle->Wrap( -1 );
m_MinThicknessValueTitle->SetToolTip( _("Minimun thickness of filled areas.") );
bSizer9->Add( m_MinThicknessValueTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ZoneMinThicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_ZoneMinThicknessCtrl->SetToolTip( _("Minimun thickness of filled areas.") );
bSizer9->Add( m_ZoneMinThicknessCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticText151 = new wxStaticText( this, wxID_ANY, _("Corner smoothing:"), wxDefaultPosition, wxDefaultSize, 0 );
......@@ -172,6 +172,15 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i
wxBoxSizer* m_MiddleBox;
m_MiddleBox = new wxBoxSizer( wxVERTICAL );
m_staticText171 = new wxStaticText( this, wxID_ANY, _("Priority level:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText171->Wrap( -1 );
m_staticText171->SetToolTip( _("On each copper layer, zones are filled by priority order.\nSo when a zone is inside an other zone:\n* If its priority is highter: its outlines are removed from the other layer.\n* If its priority is equal: a DRC error is set.") );
m_MiddleBox->Add( m_staticText171, 0, wxRIGHT|wxLEFT, 5 );
m_PriorityLevelCtrl = new wxSpinCtrl( this, ID_M_PRIORITYLEVELCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 0 );
m_MiddleBox->Add( m_PriorityLevelCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticText11 = new wxStaticText( this, wxID_ANY, _("Fill mode:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText11->Wrap( -1 );
m_MiddleBox->Add( m_staticText11, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
......
......@@ -7,6 +7,7 @@
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">table</property>
<property name="file">dialog_copper_zones_base</property>
......@@ -28,6 +29,7 @@
<property name="TopDockable">1</property>
<property name="aui_managed">0</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -50,8 +52,10 @@
<property name="hidden">0</property>
<property name="id">ID_DIALOG_COPPER_ZONE_BASE</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -80,6 +84,12 @@
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnClose">OnClose</event>
<event name="OnEnterWindow"></event>
......@@ -141,6 +151,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -161,8 +172,10 @@
<property name="id">wxID_ANY</property>
<property name="label">Layer:</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -236,6 +249,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -256,8 +270,10 @@
<property name="id">wxID_ANY</property>
<property name="label">Net:</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -320,6 +336,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -340,8 +357,10 @@
<property name="hidden">0</property>
<property name="id">ID_NETNAME_SELECTION</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,-1</property>
<property name="moveable">1</property>
......@@ -419,6 +438,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -439,8 +459,10 @@
<property name="id">wxID_ANY</property>
<property name="label">Display:</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -503,6 +525,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -523,8 +546,10 @@
<property name="hidden">0</property>
<property name="id">ID_M_NETDISPLAYOPTION</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -587,6 +612,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -607,8 +633,10 @@
<property name="id">wxID_ANY</property>
<property name="label">Hidden net filter:</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -671,6 +699,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -690,9 +719,11 @@
<property name="hidden">0</property>
<property name="id">ID_TEXTCTRL_NETNAMES_FILTER</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -759,6 +790,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -779,8 +811,10 @@
<property name="id">wxID_ANY</property>
<property name="label">Visible net filter:</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -843,6 +877,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -862,9 +897,11 @@
<property name="hidden">0</property>
<property name="id">ID_TEXTCTRL_NETNAMES_FILTER</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -931,6 +968,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -952,8 +990,10 @@
<property name="id">wxID_APPLY_FILTERS</property>
<property name="label">Apply Filters</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -1041,6 +1081,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -1061,8 +1102,10 @@
<property name="id">wxID_ANY</property>
<property name="label">Clearance</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -1125,6 +1168,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -1144,9 +1188,11 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -1213,6 +1259,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -1233,8 +1280,10 @@
<property name="id">wxID_ANY</property>
<property name="label">Minimum width</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -1253,7 +1302,7 @@
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="tooltip">Minimun thickness of filled areas.</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
......@@ -1297,6 +1346,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -1316,9 +1366,11 @@
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -1337,7 +1389,7 @@
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip">Minimun thickness of filled areas.</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
......@@ -1385,6 +1437,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -1405,8 +1458,10 @@
<property name="id">wxID_ANY</property>
<property name="label">Corner smoothing:</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -1469,6 +1524,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -1489,8 +1545,10 @@
<property name="hidden">0</property>
<property name="id">ID_CORNER_SMOOTHING</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -1553,6 +1611,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -1573,8 +1632,10 @@
<property name="id">wxID_ANY</property>
<property name="label">Chamfer distance (mm):</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -1637,6 +1698,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -1656,9 +1718,11 @@
<property name="hidden">0</property>
<property name="id">ID_M_CORNERSMOOTHINGCTRL</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -1736,6 +1800,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -1756,8 +1821,10 @@
<property name="id">wxID_ANY</property>
<property name="label">Pad connection:</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -1820,6 +1887,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -1840,8 +1908,10 @@
<property name="hidden">0</property>
<property name="id">ID_M_PADINZONEOPT</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -1916,6 +1986,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -1936,8 +2007,10 @@
<property name="id">wxID_ANY</property>
<property name="label">Antipad clearance</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -2000,6 +2073,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -2019,9 +2093,11 @@
<property name="hidden">0</property>
<property name="id">wxID_ANTIPAD_SIZE</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -2088,6 +2164,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -2108,8 +2185,10 @@
<property name="id">wxID_ANY</property>
<property name="label">Spoke width</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -2172,6 +2251,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -2191,9 +2271,11 @@
<property name="hidden">0</property>
<property name="id">wxID_COPPER_BRIDGE_VALUE</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -2263,6 +2345,184 @@
<property name="name">m_MiddleBox</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Priority level:</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_staticText171</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="resize">Resizable</property>
<property name="row"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip">On each copper layer, zones are filled by priority order.&#x0A;So when a zone is inside an other zone:&#x0A;* If its priority is highter: its outlines are removed from the other layer.&#x0A;* If its priority is equal: a DRC error is set.</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<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">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxSpinCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_M_PRIORITYLEVELCTRL</property>
<property name="initial">0</property>
<property name="layer"></property>
<property name="max">100</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_PriorityLevelCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="resize">Resizable</property>
<property name="row"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxSP_ARROW_KEYS</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<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="OnSpinCtrl"></event>
<event name="OnSpinCtrlText"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxLEFT|wxRIGHT|wxTOP</property>
......@@ -2273,6 +2533,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -2293,8 +2554,10 @@
<property name="id">wxID_ANY</property>
<property name="label">Fill mode:</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -2357,6 +2620,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -2377,8 +2641,10 @@
<property name="hidden">0</property>
<property name="id">ID_M_FILLMODECTRL</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -2441,6 +2707,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -2461,8 +2728,10 @@
<property name="id">wxID_ANY</property>
<property name="label">Segments / 360 deg:</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -2525,6 +2794,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -2545,8 +2815,10 @@
<property name="hidden">0</property>
<property name="id">ID_M_ARCAPPROXIMATIONOPT</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -2620,6 +2892,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -2640,8 +2913,10 @@
<property name="id">wxID_ANY</property>
<property name="label">Outline slope:</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -2704,6 +2979,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -2724,8 +3000,10 @@
<property name="hidden">0</property>
<property name="id">ID_M_ORIENTEDGESOPT</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -2788,6 +3066,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -2808,8 +3087,10 @@
<property name="id">wxID_ANY</property>
<property name="label">Outline style:</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -2872,6 +3153,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -2892,8 +3174,10 @@
<property name="hidden">0</property>
<property name="id">ID_M_OUTLINEAPPEARANCECTRL</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -2969,6 +3253,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -2990,8 +3275,10 @@
<property name="id">wxID_BUTTON_EXPORT</property>
<property name="label">Export Settings to Other Zones</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -3054,6 +3341,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -3075,8 +3363,10 @@
<property name="id">wxID_OK</property>
<property name="label">Ok</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......@@ -3139,6 +3429,7 @@
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
......@@ -3160,8 +3451,10 @@
<property name="id">wxID_CANCEL</property>
<property name="label">Cancel</property>
<property name="layer"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 18 2010)
// C++ code generated with wxFormBuilder (version Jun 30 2011)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_copper_zones_base__
#define __dialog_copper_zones_base__
#ifndef __DIALOG_COPPER_ZONES_BASE_H__
#define __DIALOG_COPPER_ZONES_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
......@@ -22,6 +23,7 @@
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/statbox.h>
#include <wx/spinctrl.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
......@@ -59,6 +61,7 @@ class DIALOG_COPPER_ZONE_BASE : public wxDialog
ID_M_PADINZONEOPT,
wxID_ANTIPAD_SIZE,
wxID_COPPER_BRIDGE_VALUE,
ID_M_PRIORITYLEVELCTRL,
ID_M_FILLMODECTRL,
ID_M_ARCAPPROXIMATIONOPT,
ID_M_ORIENTEDGESOPT,
......@@ -92,6 +95,8 @@ class DIALOG_COPPER_ZONE_BASE : public wxDialog
wxTextCtrl* m_AntipadSizeValue;
wxStaticText* m_CopperBridgeWidthText;
wxTextCtrl* m_CopperWidthValue;
wxStaticText* m_staticText171;
wxSpinCtrl* m_PriorityLevelCtrl;
wxStaticText* m_staticText11;
wxChoice* m_FillModeCtrl;
wxStaticText* m_staticText12;
......@@ -123,4 +128,4 @@ class DIALOG_COPPER_ZONE_BASE : public wxDialog
};
#endif //__dialog_copper_zones_base__
#endif //__DIALOG_COPPER_ZONES_BASE_H__
......@@ -258,6 +258,13 @@ bool ZONE_CONTAINER::Save( FILE* aFile ) const
if( ret < 2 )
return false;
if( GetPriority() > 0 )
{
ret = fprintf( aFile, "ZPriority %d\n", GetPriority() );
if( ret < 1 )
return false;
}
// Save pad option and clearance
switch( m_PadOption )
{
......@@ -1797,6 +1804,17 @@ int ZONE_CONTAINER::ReadDescr( LINE_READER* aReader )
}
/* Set hatch mode later, after reading outlines corners data */
}
else if( strnicmp( Line, "ZPriority", 9 ) == 0 )
{
int tmp = 0;
text = Line + 9;
ret = sscanf( text, "%d", &tmp );
if( ret < 1 )
return false;
SetPriority( tmp );
}
else if( strnicmp( Line, "ZSmoothing", 10 ) == 0 )
{
int tempSmoothingType;
......
......@@ -65,6 +65,7 @@
#include <class_module.h>
#include <pcbnew.h>
#include <dialog_netlist.h>
#include <html_messagebox.h>
#include <netlist_reader.h>
......@@ -528,8 +529,9 @@ MODULE* PCB_EDIT_FRAME::ListAndSelectModuleName( void )
void PCB_EDIT_FRAME::Test_Duplicate_Missing_And_Extra_Footprints(
const wxString& aNetlistFullFilename )
{
int nberr = 0;
wxArrayString list; // The list of messages to display
#define ERR_CNT_MAX 100 // Max number of errors to output in dialog
// to avoid a too long calculation time
wxString list; // The messages to display
if( GetBoard()->m_Modules == NULL )
{
......@@ -542,6 +544,7 @@ void PCB_EDIT_FRAME::Test_Duplicate_Missing_And_Extra_Footprints(
return;
SetLastNetListRead( aNetlistFullFilename );
// Build the list of references of the net list modules.
NETLIST_READER netList_Reader( this );
netList_Reader.SetFilesnames( aNetlistFullFilename, wxEmptyString );
......@@ -558,10 +561,10 @@ void PCB_EDIT_FRAME::Test_Duplicate_Missing_And_Extra_Footprints(
}
// Search for duplicate footprints.
list.Add( _( "Duplicates" ) );
list << wxT("<p><b>") << _( "Duplicates:" ) << wxT("</b></p>");
int err_cnt = 0;
MODULE* module = GetBoard()->m_Modules;
for( ; module != NULL; module = module->Next() )
{
MODULE* altmodule = module->Next();
......@@ -571,18 +574,21 @@ void PCB_EDIT_FRAME::Test_Duplicate_Missing_And_Extra_Footprints(
if( module->m_Reference->m_Text.CmpNoCase( altmodule->m_Reference->m_Text ) == 0 )
{
if( module->m_Reference->m_Text.IsEmpty() )
list.Add( wxT("<noref>") );
list << wxT("<br>") << wxT("[noref)");
else
list.Add( module->m_Reference->m_Text );
list << wxT("<br>") << module->m_Reference->m_Text;
nberr++;
list << wxT(" (<i>") << module->m_Value->m_Text << wxT("</i>)");
err_cnt++;
break;
}
}
if( ERR_CNT_MAX < err_cnt )
break;
}
// Search for missing modules on board.
list.Add( _( "Missing:" ) );
list << wxT("<p><b>") << _( "Missing:" ) << wxT("</b></p>");
for( unsigned ii = 0; ii < moduleInfoList.size(); ii++ )
{
......@@ -590,13 +596,16 @@ void PCB_EDIT_FRAME::Test_Duplicate_Missing_And_Extra_Footprints(
module = GetBoard()->FindModuleByReference( mod_info->m_Reference );
if( module == NULL ) // Module missing, not found in board
{
list.Add( mod_info->m_Reference );
nberr++;
list << wxT("<br>") << mod_info->m_Reference;
list << wxT(" (<i>") << mod_info->m_Value << wxT("</i>)");
err_cnt++;
}
if( ERR_CNT_MAX < err_cnt )
break;
}
// Search for modules found on board but not in net list.
list.Add( _( "Not in Netlist:" ) );
list << wxT("<p><b>") << _( "Not in Netlist:" ) << wxT("</b></p>");
module = GetBoard()->m_Modules;
for( ; module != NULL; module = module->Next() )
......@@ -611,14 +620,25 @@ void PCB_EDIT_FRAME::Test_Duplicate_Missing_And_Extra_Footprints(
if( ii == moduleInfoList.size() ) // Module not found in netlist
{
list.Add( module->m_Reference->m_Text );
nberr++;
if( module->m_Reference->m_Text.IsEmpty() )
list << wxT("<br>") << wxT("[noref)");
else
list << wxT("<br>") << module->m_Reference->m_Text ;
list << wxT(" (<i>") << module->m_Value->m_Text << wxT("</i>)");
err_cnt++;
}
if( ERR_CNT_MAX < err_cnt )
break;
}
if( ERR_CNT_MAX < err_cnt )
{
list << wxT("<p><b>")
<< _( "Too many errors: some are skipped" )
<< wxT("</b></p>");
}
wxSingleChoiceDialog dlg( this, wxEmptyString, _( "Check Modules" ), list, NULL,
wxCHOICEDLG_STYLE & ~wxCANCEL );
HTML_MESSAGE_BOX dlg( this, _( "Check Modules" ) );
dlg.AddHTML_Text(list);
dlg.ShowModal();
}
......
......@@ -62,6 +62,41 @@ public:
*/
MODULE_INFO* ParseComp() throw( IO_ERROR, PARSE_ERROR );
/**
* Function ParseKicadFootprintFilterList
* Read the section "libparts" like:
* (libparts
* (libpart (lib device) (part C)
* (description "Condensateur non polarise")
* (footprints
* (fp SM*)
* (fp C?)
* (fp C1-1))
* (fields
* (field (name Reference) C)
* (field (name Value) C))
* (pins
* (pin (num 1) (name ~) (type passive))
* (pin (num 2) (name ~) (type passive))))
*
* And add the strings giving the footprint filter (subsection footprints)
* of the corresponding module info
* <p>This section is used by CvPcb, and is not useful in Pcbnew,
* therefore it it not always read </p>
*/
bool ParseKicadFootprintFilterList() throw( IO_ERROR, PARSE_ERROR );
/**
* Function ParseNet
* Parses a section like
* (net (code 20) (name /PC-A0)
* (node (ref BUS1) (pin 62))
* (node (ref U3) (pin 3))
* (node (ref U9) (pin M6)))
*
* and set the corresponfings pads netnames
*/
void ParseNet( BOARD * aBrd ) throw( IO_ERROR, PARSE_ERROR );
/**
......@@ -252,7 +287,7 @@ void NETLIST_READER_KICAD_PARSER::ParseNet( BOARD * aBrd )
}
}
// When there is onlu one item in net, clear pad netname
// When there is only one item in net, clear pad netname
if( nodecount < 2 && pad )
pad->SetNetname( wxEmptyString );
}
......@@ -333,3 +368,27 @@ MODULE_INFO* NETLIST_READER_KICAD_PARSER::ParseComp()
return mod_info;
}
/* Read the section "libparts" like:
* (libparts
* (libpart (lib device) (part C)
* (description "Condensateur non polarise")
* (footprints
* (fp SM*)
* (fp C?)
* (fp C1-1))
* (fields
* (field (name Reference) C)
* (field (name Value) C))
* (pins
* (pin (num 1) (name ~) (type passive))
* (pin (num 2) (name ~) (type passive))))
*
* And add the strings giving the footprint filter (subsection footprints)
* of the corresponding module info
*/
bool NETLIST_READER_KICAD_PARSER::ParseKicadFootprintFilterList() throw( IO_ERROR, PARSE_ERROR )
{
// TODO
return true;
}
......@@ -27,12 +27,15 @@
* in order to have drawable (and plottable) filled polygons
* drawable filled polygons are polygons without hole
* @param aPcb: the current board (can be NULL for non copper zones)
* @param aCornerBuffer: A reference to a buffer to put polygon corners, or NULL
* if NULL (default), uses m_FilledPolysList and fill current zone.
* @return number of polygons
* This function does not add holes for pads and tracks but calls
* AddClearanceAreasPolygonsToPolysList() to do that for copper layers
*/
int ZONE_CONTAINER::BuildFilledPolysListData( BOARD* aPcb )
int ZONE_CONTAINER::BuildFilledPolysListData( BOARD* aPcb, std::vector <CPolyPt>* aCornerBuffer )
{
if( aCornerBuffer == NULL )
m_FilledPolysList.clear();
/* convert outlines + holes to outlines without holes (adding extra segments if necessary)
......@@ -74,13 +77,24 @@ int ZONE_CONTAINER::BuildFilledPolysListData( BOARD* aPcb )
corner.x = (int) smoothedPoly->GetKboolEngine()->GetPolygonXPoint();
corner.y = (int) smoothedPoly->GetKboolEngine()->GetPolygonYPoint();
corner.end_contour = false;
if( aCornerBuffer )
aCornerBuffer->push_back( corner );
else
m_FilledPolysList.push_back( corner );
count++;
}
corner.end_contour = true;
if( aCornerBuffer )
{
aCornerBuffer->pop_back();
aCornerBuffer->push_back( corner );
}
else
{
m_FilledPolysList.pop_back();
m_FilledPolysList.push_back( corner );
}
smoothedPoly->GetKboolEngine()->EndPolygonGet();
}
......@@ -89,12 +103,14 @@ int ZONE_CONTAINER::BuildFilledPolysListData( BOARD* aPcb )
/* For copper layers, we now must add holes in the Polygon list.
* holes are pads and tracks with their clearance area
*/
if( ! aCornerBuffer )
{
if( IsOnCopperLayer() )
AddClearanceAreasPolygonsToPolysList( aPcb );
if ( m_FillMode ) // if fill mode uses segments, create them:
Fill_Zone_Areas_With_Segments( );
}
return count;
}
......
......@@ -329,6 +329,33 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
}
}
// Add zones outlines having an higher priority
for( int ii = 0; ii < GetBoard()->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* zone = GetBoard()->GetArea( ii );
if( zone->GetLayer() != GetLayer() )
continue;
if( zone->GetPriority() <= GetPriority() )
continue;
// A highter priority zone is found: remove its area
item_boundingbox = zone->GetBoundingBox();
if( !item_boundingbox.Intersects( zone_boundingbox ) )
continue;
// Add the zone outline area.
// However if the zone has the same net as the current zone,
// do not add clearance.
// the zone will be connected to the current zone, but filled areas
// will use different parameters (clearnce, thermal shapes )
bool addclearance = GetNet() != zone->GetNet();
zone->TransformShapeWithClearanceToPolygon(
cornerBufferPolysToSubstract,
zone_clearance, s_CircleToSegmentsCount,
s_Correction, addclearance );
}
// Remove thermal symbols
if( m_PadOption == THERMAL_PAD )
{
......
......@@ -92,6 +92,9 @@ bool ZONE_CONTAINER::IsSame( const ZONE_CONTAINER& aZoneToCompare )
if( m_ThermalReliefCopperBridge != aZoneToCompare.m_ThermalReliefCopperBridge )
return false;
if( GetPriority() != aZoneToCompare.GetPriority() )
return false;
// Compare outlines
wxASSERT( m_Poly ); // m_Poly == NULL Should never happen
wxASSERT( aZoneToCompare.m_Poly );
......
......@@ -454,6 +454,8 @@ int BOARD::CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList, int aNetCode,
if( area2->GetNet() != aNetCode )
continue;
if( curr_area->GetPriority() != area2->GetPriority() )
continue;
if( curr_area->GetLayer() == area2->GetLayer()
&& curr_area->utility2 != -1 && area2->utility2 != -1 )
......@@ -523,6 +525,9 @@ bool BOARD::TestAreaIntersections( ZONE_CONTAINER* area_to_test )
if( area_to_test->GetLayer() != area2->GetLayer() )
continue;
if( area_to_test->GetPriority() != area2->GetPriority() )
continue;
CPolyLine* poly2 = area2->m_Poly;
// test bounding rects
......@@ -942,6 +947,10 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E
if( Area_Ref->GetNet() == Area_To_Test->GetNet() && Area_Ref->GetNet() >= 0 )
continue;
// test for different priorities
if( Area_Ref->GetPriority() != Area_To_Test->GetPriority() )
continue;
// Examine a candidate zone: compare Area_To_Test to Area_Ref
// Get clearance used in zone to zone test. The policy used to
......@@ -1139,6 +1148,10 @@ bool DRC::doEdgeZoneDrc( ZONE_CONTAINER* aArea, int aCornerIndex )
if( ( aArea->GetNet() == Area_To_Test->GetNet() ) && (aArea->GetNet() >= 0) )
continue;
// test for same priority
if( Area_To_Test->GetPriority() != aArea->GetPriority() )
continue;
// test for ending line inside Area_To_Test
int x = end.x;
int y = end.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