Commit 362b6b53 authored by dickelbeck's avatar dickelbeck

NETCLASS work, see CHANGELOG.txt

parent 8682a9fa
...@@ -4,6 +4,20 @@ KiCad ChangeLog 2009 ...@@ -4,6 +4,20 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2009-Sep-10 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++pcbnew
More NETCLASS work, started on the UI also. Almost done. Put NETCLASS support
into DRC. Fixed DRC dialog so progress during DRC is sensible and visible.
The specctra_export probably still needs a little work regarding VIAs.
Don't install this version of PCBNEW if you need stability. You can compile
and look but I would not install it quite yet. I compiled wxformbuilder
from source, so you may need to upgrade to load my *.fbp files.
Jean-Pierre @ todo: pcbnew/zones_test_and_combine_areas.cpp needs to
use NETCLASS and not g_DesignSettings.m_TrackClearance
2009-sept-10 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> 2009-sept-10 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================ ================================================================================
++pcbnew ++pcbnew
...@@ -12,6 +26,7 @@ email address. ...@@ -12,6 +26,7 @@ email address.
The Kbool's author, Klaas Holveda, is still working on these problems The Kbool's author, Klaas Holveda, is still working on these problems
Thanks to Klaas Thanks to Klaas
2009-aug-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> 2009-aug-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================ ================================================================================
++pcbnew ++pcbnew
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -267,15 +267,20 @@ public: ...@@ -267,15 +267,20 @@ public:
/** /**
* Function GetClearance * Function GetClearance
* returns the clearance in 1/10000 inches to aItem from this BOARD_CONNECTED_ITEM. * returns the clearance in 1/10000 inches. If \a aItem is not NULL then the
* returned clearance is the greater of this object's NETCLASS clearance and
* aItem's NETCLASS clearance. If \a aItem is NULL, then this objects clearance
* is returned.
* @param aItem is another BOARD_CONNECTED_ITEM or NULL
* @return int - the clearance in 1/10000 inches.
*/ */
virtual int GetClearance( BOARD_CONNECTED_ITEM* aItem ) const; virtual int GetClearance( BOARD_CONNECTED_ITEM* aItem = NULL ) const;
/** /**
* Function GetNetClass * Function GetNetClass
* returns the NETCLASS for this item. * returns the NETCLASS for this item.
*/ */
virtual NETCLASS* GetNetClass() const; NETCLASS* GetNetClass() const;
}; };
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
#ifndef _CLASS_DRC_ITEM_H #ifndef _CLASS_DRC_ITEM_H
#define _CLASS_DRC_ITEM_H #define _CLASS_DRC_ITEM_H
#include "macros.h"
/** /**
* Class DRC_ITEM * Class DRC_ITEM
* is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item. * is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item.
...@@ -46,7 +49,7 @@ protected: ...@@ -46,7 +49,7 @@ protected:
wxPoint m_MainPosition; ///< the location of the first (or main ) BOARD_ITEM or SCH_ITEM. This is also the position of the marker wxPoint m_MainPosition; ///< the location of the first (or main ) BOARD_ITEM or SCH_ITEM. This is also the position of the marker
wxPoint m_AuxiliaryPosition; ///< the location of the second BOARD_ITEM or SCH_ITEM wxPoint m_AuxiliaryPosition; ///< the location of the second BOARD_ITEM or SCH_ITEM
bool m_hasSecondItem; ///< true when 2 items create a DRC/ERC error, false if only one item bool m_hasSecondItem; ///< true when 2 items create a DRC/ERC error, false if only one item
bool m_noCoordinate;
public: public:
...@@ -54,9 +57,9 @@ public: ...@@ -54,9 +57,9 @@ public:
{ {
m_ErrorCode = 0; m_ErrorCode = 0;
m_hasSecondItem = false; m_hasSecondItem = false;
m_noCoordinate = false;
} }
DRC_ITEM( int aErrorCode, DRC_ITEM( int aErrorCode,
const wxString& aMainText, const wxString& bAuxiliaryText, const wxString& aMainText, const wxString& bAuxiliaryText,
const wxPoint& aMainPos, const wxPoint& bAuxiliaryPos ) const wxPoint& aMainPos, const wxPoint& bAuxiliaryPos )
...@@ -66,7 +69,6 @@ public: ...@@ -66,7 +69,6 @@ public:
aMainPos, bAuxiliaryPos ); aMainPos, bAuxiliaryPos );
} }
DRC_ITEM( int aErrorCode, DRC_ITEM( int aErrorCode,
const wxString& aText, const wxPoint& aPos ) const wxString& aText, const wxPoint& aPos )
{ {
...@@ -124,11 +126,14 @@ public: ...@@ -124,11 +126,14 @@ public:
bool HasSecondItem() const { return m_hasSecondItem; } bool HasSecondItem() const { return m_hasSecondItem; }
void SetShowNoCoordinate() { m_noCoordinate = true; }
/** acces to A and B texts /** acces to A and B texts
*/ */
wxString GetMainText() const { return m_MainText; } wxString GetMainText() const { return m_MainText; }
wxString GetAuxiliaryText() const { return m_AuxiliaryText; } wxString GetAuxiliaryText() const { return m_AuxiliaryText; }
/** /**
* Function ShowHtml * Function ShowHtml
* translates this object into a fragment of HTML suitable for the * translates this object into a fragment of HTML suitable for the
...@@ -139,22 +144,30 @@ public: ...@@ -139,22 +144,30 @@ public:
{ {
wxString ret; wxString ret;
if( m_hasSecondItem ) if( m_noCoordinate )
{
// omit the coordinate, a NETCLASS has no location
ret.Printf( _( "ErrType(%d): <b>%s</b><ul><li> %s </li></ul>" ),
m_ErrorCode,
GetChars( GetErrorText() ),
GetChars( m_MainText ) );
}
else if( m_hasSecondItem )
{ {
// an html fragment for the entire message in the listbox. feel free // an html fragment for the entire message in the listbox. feel free
// to add color if you want: // to add color if you want:
ret.Printf( _( "ErrType(%d): <b>%s</b><ul><li> %s: %s </li><li> %s: %s </li></ul>" ), ret.Printf( _( "ErrType(%d): <b>%s</b><ul><li> %s: %s </li><li> %s: %s </li></ul>" ),
m_ErrorCode, m_ErrorCode,
GetErrorText().GetData(), GetChars( GetErrorText() ),
ShowCoord( m_MainPosition ).GetData(), m_MainText.GetData(), GetChars( ShowCoord( m_MainPosition )), GetChars( m_MainText ),
ShowCoord( m_AuxiliaryPosition ).GetData(), m_AuxiliaryText.GetData() ); GetChars( ShowCoord( m_AuxiliaryPosition )), GetChars( m_AuxiliaryText ) );
} }
else else
{ {
ret.Printf( _( "ErrType(%d): <b>%s</b><ul><li> %s: %s </li></ul>" ), ret.Printf( _( "ErrType(%d): <b>%s</b><ul><li> %s: %s </li></ul>" ),
m_ErrorCode, m_ErrorCode,
GetErrorText().GetData(), GetChars( GetErrorText() ),
ShowCoord( m_MainPosition ).GetData(), m_MainText.GetData() ); GetChars( ShowCoord( m_MainPosition ) ), GetChars( m_MainText ) );
} }
return ret; return ret;
......
...@@ -135,7 +135,8 @@ public: ...@@ -135,7 +135,8 @@ public:
const wxString& aText, const wxPoint& aPos ); const wxString& aText, const wxPoint& aPos );
/** Function SetAuxiliaryData /**
* Function SetAuxiliaryData
* initialize data for the second (auxiliary) item * initialize data for the second (auxiliary) item
* @param aAuxiliaryText = the second text (main text) concerning the second schematic or board item * @param aAuxiliaryText = the second text (main text) concerning the second schematic or board item
* @param aAuxiliaryPos = position the second item * @param aAuxiliaryPos = position the second item
...@@ -145,6 +146,10 @@ public: ...@@ -145,6 +146,10 @@ public:
m_drc.SetAuxiliaryData( aAuxiliaryText, aAuxiliaryPos ); m_drc.SetAuxiliaryData( aAuxiliaryText, aAuxiliaryPos );
} }
void SetShowNoCoordinate()
{
m_drc.SetShowNoCoordinate();
}
/** /**
* Function GetReporter * Function GetReporter
......
...@@ -155,8 +155,8 @@ public: ...@@ -155,8 +155,8 @@ public:
int m_EdgeSegmentWidth; // current graphic line width (EDGE layer only) int m_EdgeSegmentWidth; // current graphic line width (EDGE layer only)
int m_PcbTextWidth; // current Pcb (not module) Text width int m_PcbTextWidth; // current Pcb (not module) Text width
wxSize m_PcbTextSize; // current Pcb (not module) Text size wxSize m_PcbTextSize; // current Pcb (not module) Text size
int m_TrackClearence; // track to track and track to pads clearance int m_TrackClearance; // track to track and track to pads clearance
int m_TrackClearenceHistory[HISTORY_NUMBER]; // Last HISTORY_NUMBER used track widths int m_TrackClearanceHistory[HISTORY_NUMBER]; // Last HISTORY_NUMBER used track widths
int m_TrackMinWidth; // track min value for width ((min copper size value int m_TrackMinWidth; // track min value for width ((min copper size value
int m_ViasMinSize; // vias (not micro vias) min diameter int m_ViasMinSize; // vias (not micro vias) min diameter
int m_MicroViasMinSize; // micro vias (not vias) min diameter int m_MicroViasMinSize; // micro vias (not vias) min diameter
......
...@@ -543,8 +543,11 @@ void WinEDA_PcbFrame::GenModuleOnBoard( MODULE* Module ) ...@@ -543,8 +543,11 @@ void WinEDA_PcbFrame::GenModuleOnBoard( MODULE* Module )
TraceFilledRectangle( GetBoard(), ox, oy, fx, fy, masque_layer, TraceFilledRectangle( GetBoard(), ox, oy, fx, fy, masque_layer,
CELL_is_MODULE, WRITE_OR_CELL ); CELL_is_MODULE, WRITE_OR_CELL );
int trackWidth = GetBoard()->m_NetClasses.GetDefault()->GetTrackWidth();
int clearance = GetBoard()->m_NetClasses.GetDefault()->GetClearance();
/* Trace des pads et leur surface de securite */ /* Trace des pads et leur surface de securite */
marge = g_DesignSettings.m_TrackClearence + g_DesignSettings.m_CurrentTrackWidth; marge = trackWidth + clearance;
for( Pad = Module->m_Pads; Pad != NULL; Pad = Pad->Next() ) for( Pad = Module->m_Pads; Pad != NULL; Pad = Pad->Next() )
{ {
......
...@@ -182,8 +182,15 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag ) ...@@ -182,8 +182,15 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag )
int marge, via_marge; int marge, via_marge;
int masque_layer; int masque_layer;
marge = g_DesignSettings.m_TrackClearence + (g_DesignSettings.m_CurrentTrackWidth / 2); // use the default NETCLASS?
via_marge = g_DesignSettings.m_TrackClearence + (g_DesignSettings.m_CurrentViaSize / 2); NETCLASS* nc = aPcb->m_NetClasses.GetDefault();
int trackWidth = nc->GetTrackWidth();
int clearance = nc->GetClearance();
int viaSize = nc->GetViaDiameter();
marge = clearance + (trackWidth / 2);
via_marge = clearance + (viaSize / 2);
///////////////////////////////////// /////////////////////////////////////
// Placement des PADS sur le board // // Placement des PADS sur le board //
......
...@@ -31,12 +31,17 @@ BOARD::BOARD( EDA_BaseStruct* parent, WinEDA_BasePcbFrame* frame ) : ...@@ -31,12 +31,17 @@ BOARD::BOARD( EDA_BaseStruct* parent, WinEDA_BasePcbFrame* frame ) :
m_CurrentZoneContour = NULL; // This ZONE_CONTAINER handle the zone contour cuurently in progress m_CurrentZoneContour = NULL; // This ZONE_CONTAINER handle the zone contour cuurently in progress
m_NetInfo = new NETINFO_LIST( this ); // handle nets info list (name, design constraints .. m_NetInfo = new NETINFO_LIST( this ); // handle nets info list (name, design constraints ..
for( int layer = 0; layer<NB_COPPER_LAYERS; ++layer ) for( int layer = 0; layer<NB_COPPER_LAYERS; ++layer )
{ {
m_Layer[layer].m_Name = ReturnPcbLayerName( layer, true ); m_Layer[layer].m_Name = ReturnPcbLayerName( layer, true );
m_Layer[layer].m_Type = LT_SIGNAL; m_Layer[layer].m_Type = LT_SIGNAL;
} }
// Initial parameters for the default NETCLASS come from the global preferences
// within g_DesignSettings via the NETCLASS() constructor.
// Should user eventually load a board from a disk file, then these defaults
// will get overwritten during load.
m_NetClasses.GetDefault()->SetDescription( _("This is the default net class.") );
} }
...@@ -829,16 +834,16 @@ NETINFO_ITEM* BOARD::FindNet( int anetcode ) const ...@@ -829,16 +834,16 @@ NETINFO_ITEM* BOARD::FindNet( int anetcode ) const
// the first valid netcode is 1 and the last is m_NetInfo->GetCount()-1. // the first valid netcode is 1 and the last is m_NetInfo->GetCount()-1.
// zero is reserved for "no connection" and is not used. // zero is reserved for "no connection" and is not used.
// NULL is returned for non valid netcodes // NULL is returned for non valid netcodes
NETINFO_ITEM* item = m_NetInfo->GetNetItem( anetcode ); NETINFO_ITEM* net = m_NetInfo->GetNetItem( anetcode );
#if defined(DEBUG) #if defined(DEBUG)
if ( item ) // item can be NULL if anetcode is not valid if( net ) // item can be NULL if anetcode is not valid
{ {
wxASSERT( anetcode == item->GetNet() ); wxASSERT( anetcode == net->GetNet() );
} }
#endif #endif
return item; return net;
} }
......
...@@ -348,6 +348,7 @@ public: ...@@ -348,6 +348,7 @@ public:
*/ */
void SynchronizeNetsAndNetClasses(); void SynchronizeNetsAndNetClasses();
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.brd" format.
......
...@@ -72,22 +72,29 @@ void BOARD_CONNECTED_ITEM::SetZoneSubNet( int aSubNetCode ) ...@@ -72,22 +72,29 @@ void BOARD_CONNECTED_ITEM::SetZoneSubNet( int aSubNetCode )
int BOARD_CONNECTED_ITEM::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const int BOARD_CONNECTED_ITEM::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const
{ {
NETCLASS* hisclass = aItem->GetNetClass();
NETCLASS* myclass = GetNetClass(); NETCLASS* myclass = GetNetClass();
wxASSERT( hisclass );
wxASSERT( myclass ); wxASSERT( myclass );
if( myclass ) if( myclass )
{ {
// @todo : after GetNetClass() is reliably not returning NULL, remove the
// tests for if( myclass ) and if( hisclass )
if( aItem )
{
NETCLASS* hisclass = aItem->GetNetClass();
wxASSERT( hisclass );
if( hisclass ) if( hisclass )
return MAX( hisclass->GetClearance(), myclass->GetClearance() );
else
return myclass->GetClearance();
}
else if( hisclass )
{ {
return hisclass->GetClearance(); int hisClearance = hisclass->GetClearance();
int myClearance = myclass->GetClearance();
return max( hisClearance, myClearance );
}
}
return myclass->GetClearance();
} }
return 0; return 0;
......
...@@ -84,6 +84,19 @@ wxString DRC_ITEM::GetErrorText() const ...@@ -84,6 +84,19 @@ wxString DRC_ITEM::GetErrorText() const
case DRCE_TOO_SMALL_MICROVIA: case DRCE_TOO_SMALL_MICROVIA:
return wxString( _("Too small micro via size")); return wxString( _("Too small micro via size"));
// use &lt; since this is text ultimately embedded in HTML
case DRCE_NETCLASS_TRACKWIDTH:
return wxString( _("NetClass Track Width &lt; global limit"));
case DRCE_NETCLASS_CLEARANCE:
return wxString( _("NetClass Clearance &lt; global limit"));
case DRCE_NETCLASS_VIASIZE:
return wxString( _("NetClass Via Dia &lt; global limit"));
case DRCE_NETCLASS_VIADRILLSIZE:
return wxString( _("NetClass Via Drill &lt; global limit"));
case DRCE_NETCLASS_uVIASIZE:
return wxString( _("NetClass uVia Dia &lt; global limit"));
case DRCE_NETCLASS_uVIADRILLSIZE:
return wxString( _("NetClass uVia Drill &lt; global limit"));
default: default:
return wxString( wxT("PROGRAM BUG, PLEASE LEAVE THE ROOM.") ); return wxString( wxT("PROGRAM BUG, PLEASE LEAVE THE ROOM.") );
......
...@@ -28,6 +28,7 @@ public: ...@@ -28,6 +28,7 @@ public:
MARKER_PCB( int aErrorCode, const wxPoint& aMarkerPos, MARKER_PCB( int aErrorCode, const wxPoint& aMarkerPos,
const wxString& aText, const wxPoint& aPos, const wxString& aText, const wxPoint& aPos,
const wxString& bText, const wxPoint& bPos ); const wxString& bText, const wxPoint& bPos );
/** /**
* Constructor * Constructor
* @param aErrorCode The categorizing identifier for an error * @param aErrorCode The categorizing identifier for an error
...@@ -38,7 +39,6 @@ public: ...@@ -38,7 +39,6 @@ public:
MARKER_PCB( int aErrorCode, const wxPoint& aMarkerPos, MARKER_PCB( int aErrorCode, const wxPoint& aMarkerPos,
const wxString& aText, const wxPoint& aPos ); const wxString& aText, const wxPoint& aPos );
~MARKER_PCB(); ~MARKER_PCB();
/** /**
......
...@@ -782,7 +782,7 @@ EDA_Rect MODULE::GetBoundingBox() ...@@ -782,7 +782,7 @@ EDA_Rect MODULE::GetBoundingBox()
// Add the Clearence shape size: (shape around the pads when the clearence is shown // Add the Clearence shape size: (shape around the pads when the clearence is shown
// Not optimized, but the draw cost is small (perhaps smaller than optimization) // Not optimized, but the draw cost is small (perhaps smaller than optimization)
area.Inflate(g_DesignSettings.m_TrackClearence, g_DesignSettings.m_TrackClearence); area.Inflate(g_DesignSettings.m_TrackClearance, g_DesignSettings.m_TrackClearance);
return area; return area;
} }
......
...@@ -31,25 +31,42 @@ ...@@ -31,25 +31,42 @@
#include "pcbnew.h" #include "pcbnew.h"
// "kicad_default" is what we are using in the specctra_export. // This will get mapped to "kicad_default" in the specctra_export.
const wxString NETCLASS::Default = wxT("kicad_default"); const wxString NETCLASS::Default = wxT("Default");
NETCLASS::NETCLASS( BOARD* aParent, const wxString& aName ) : NETCLASS::NETCLASS( BOARD* aParent, const wxString& aName, const NETCLASS* initialParameters ) :
m_Parent( aParent ), m_Parent( aParent ),
m_Name( aName ) m_Name( aName )
{ {
m_TrackWidth = 160; // use initialParameters if not NULL, else set the initial
// parameters from g_DesignSettings
m_TrackMinWidth = 40; SetParams( initialParameters );
}
m_ViaSize = 350;
m_ViaMinSize = 220;
m_ViaDrillSize = 200;
m_Clearance = 140; void NETCLASS::SetParams( const NETCLASS* defaults )
{
if( defaults )
{
SetClearance( defaults->GetClearance() );
SetTrackWidth( defaults->GetTrackWidth() );
SetViaDiameter( defaults->GetViaDiameter() );
SetViaDrill( defaults->GetViaDrill() );
SetuViaDiameter( defaults->GetuViaDiameter() );
SetuViaDrill( defaults->GetuViaDrill() );
}
else
{
const EDA_BoardDesignSettings& g = g_DesignSettings;
SetClearance( g.m_TrackClearance );
SetTrackWidth( g.m_TrackMinWidth );
SetViaDiameter( g.m_ViasMinSize );
SetViaDrill( g.m_ViaDrill );
SetuViaDiameter(g.m_MicroViasMinSize );
SetuViaDrill( g.m_MicroViaDrill );
}
} }
...@@ -95,26 +112,33 @@ void NETCLASSES::Clear() ...@@ -95,26 +112,33 @@ void NETCLASSES::Clear()
} }
bool NETCLASSES::Add( const NETCLASS& aNetClass ) bool NETCLASSES::Add( NETCLASS* aNetClass )
{ {
const wxString& name = aNetClass.GetName(); const wxString& name = aNetClass->GetName();
if( name == NETCLASS::Default ) if( name == NETCLASS::Default )
{ {
// invoke operator=(), which is currently generated by compiler. // invoke operator=(), which is currently generated by compiler.
m_Default = aNetClass; m_Default = *aNetClass;
delete aNetClass; // we own aNetClass, must delete it since we copied it.
return true; return true;
} }
// Test for an existing netclass: // Test for an existing netclass:
if( !Find( name ) ) if( !Find( name ) )
{ {
// insert since name not found, invoke copy constructor. // name not found, take ownership
m_NetClasses[name] = new NETCLASS( aNetClass ); m_NetClasses[name] = aNetClass;
return true; return true;
} }
else
return false; // name already exists {
// name already exists
// do not "take ownership" and return false telling caller such.
return false;
}
} }
...@@ -248,24 +272,26 @@ bool NETCLASS::Save( FILE* aFile ) const ...@@ -248,24 +272,26 @@ bool NETCLASS::Save( FILE* aFile ) const
{ {
bool result = true; bool result = true;
fprintf( aFile, "$NETCLASS\n" ); fprintf( aFile, "$" BRD_NETCLASS "\n" );
fprintf( aFile, "Name \"%s\"\n", CONV_TO_UTF8( m_Name ) ); fprintf( aFile, "Name \"%s\"\n", CONV_TO_UTF8( m_Name ) );
fprintf( aFile, "Desc \"%s\"\n", CONV_TO_UTF8( GetDescription() ) ); fprintf( aFile, "Desc \"%s\"\n", CONV_TO_UTF8( GetDescription() ) );
// Write parameters // Write parameters
fprintf( aFile, "TrackWidth %d\n", GetTrackWidth() );
fprintf( aFile, "TrackMinWidth %d\n", GetTrackMinWidth() );
fprintf( aFile, "ViaSize %d\n", GetViaSize() );
fprintf( aFile, "ViaDrillSize %d\n", GetViaDrillSize() );
fprintf( aFile, "ViaMinSize %d\n", GetViaMinSize() );
fprintf( aFile, "Clearance %d\n", GetClearance() ); fprintf( aFile, "Clearance %d\n", GetClearance() );
fprintf( aFile, "TrackWidth %d\n", GetTrackWidth() );
fprintf( aFile, "ViaDia %d\n", GetViaDiameter() );
fprintf( aFile, "ViaDrill %d\n", GetViaDrill() );
fprintf( aFile, "uViaDia %d\n", GetuViaDiameter() );
fprintf( aFile, "uViaDrill %d\n", GetuViaDrill() );
// Write members: // Write members:
for( const_iterator i = begin(); i!=end(); ++i ) for( const_iterator i = begin(); i!=end(); ++i )
fprintf( aFile, "AddNet \"%s\"\n", CONV_TO_UTF8( *i ) ); fprintf( aFile, "AddNet \"%s\"\n", CONV_TO_UTF8( *i ) );
fprintf( aFile, "$EndNETCLASS\n" ); fprintf( aFile, "$End" BRD_NETCLASS "\n" );
return result; return result;
} }
...@@ -311,43 +337,44 @@ bool NETCLASS::ReadDescr( FILE* aFile, int* aLineNum ) ...@@ -311,43 +337,44 @@ bool NETCLASS::ReadDescr( FILE* aFile, int* aLineNum )
continue; continue;
} }
if( strnicmp( Line, "$endNETCLASS", 6 ) == 0 ) if( strnicmp( Line, "$end" BRD_NETCLASS, sizeof( "$end" BRD_NETCLASS)-1) == 0 )
{ {
result = true; result = true;
break; break;
} }
if( strnicmp( Line, "TrackWidth", 10 ) == 0 ) if( strnicmp( Line, "Clearance", 9 ) == 0 )
{ {
SetTrackWidth( atoi( Line + 10 ) ); SetClearance( atoi( Line + 9 ) );
continue; continue;
} }
if( strnicmp( Line, "ViaSize", 7 ) == 0 ) if( strnicmp( Line, "TrackWidth", 10 ) == 0 )
{ {
SetViaSize( atoi( Line + 7 ) ); SetTrackWidth( atoi( Line + 10 ) );
continue; continue;
} }
if( strnicmp( Line, "ViaDrillSize", 12 ) == 0 ) if( strnicmp( Line, "ViaDia", 6 ) == 0 )
{ {
SetViaDrillSize( atoi( Line + 12 ) ); SetViaDiameter( atoi( Line + 6 ) );
continue; continue;
} }
if( strnicmp( Line, "ViaDrill", 8 ) == 0 )
if( strnicmp( Line, "Clearance", 9 ) == 0 )
{ {
SetClearance( atoi( Line + 9 ) ); SetViaDrill( atoi( Line + 8 ) );
continue; continue;
} }
if( strnicmp( Line, "TrackMinWidth", 13 ) == 0 )
if( strnicmp( Line, "uViaDia", 7 ) == 0 )
{ {
SetTrackMinWidth( atoi( Line + 13 ) ); SetuViaDiameter( atoi( Line + 7 ) );
continue; continue;
} }
if( strnicmp( Line, "ViaMinSize", 10 ) == 0 ) if( strnicmp( Line, "uViaDrill", 9 ) == 0 )
{ {
SetViaMinSize( atoi( Line + 10 ) ); SetuViaDrill( atoi( Line + 9 ) );
continue; continue;
} }
if( strnicmp( Line, "Name", 4 ) == 0 ) if( strnicmp( Line, "Name", 4 ) == 0 )
{ {
ReadDelimitedText( Buffer, Line + 4, sizeof(Buffer) ); ReadDelimitedText( Buffer, Line + 4, sizeof(Buffer) );
......
...@@ -49,20 +49,38 @@ protected: ...@@ -49,20 +49,38 @@ protected:
STRINGSET m_Members; ///< names of NET members of this class STRINGSET m_Members; ///< names of NET members of this class
/// The units on these parameters is 1/10000 of an inch. /// The units on these parameters is 1/10000 of an inch, see #define PCB_INTERNAL_UNIT
int m_TrackWidth; ///< value for tracks thickness used to route this net
int m_TrackMinWidth; ///< minimum value for tracks thickness (used in DRC)
int m_ViaSize; ///< default via size used to route this net
int m_ViaDrillSize; ///< default via drill size used to create vias in this net
int m_ViaMinSize; ///< minimum size for vias (used in DRC)
int m_Clearance; ///< clearance when routing int m_Clearance; ///< clearance when routing
int m_TrackWidth; ///< track width used to route NETs in this NETCLASS
int m_ViaDia; ///< via diameter
int m_ViaDrill; ///< via drill hole diameter
int m_uViaDia; ///< microvia diameter
int m_uViaDrill; ///< microvia drill hole diameter
public: public:
static const wxString Default; ///< the name of the default NETCLASS static const wxString Default; ///< the name of the default NETCLASS
NETCLASS( BOARD* aParent, const wxString& aName ); /**
* Name of identifier within BOARD file.
* 08-Sept-2009: changed the name from "NETCLASS" to this so we can
* toss any previous NETCLASSes in migratory BOARD files which will not have
* the proper parameters in the default netclass (from g_DesignSettings) in them.
* Spare the user from having to enter those defaults manually.
*/
#define BRD_NETCLASS "NCLASS"
/**
* Constructor
* stuffs a NETCLASS instance with aParent, aName, and optionally the initialParameters
* @param initialParameters is a NETCLASS to copy parameters from, or if
* NULL tells me to copy from g_DesignSettings.
*/
NETCLASS( BOARD* aParent, const wxString& aName, const NETCLASS* initialParameters = NULL );
~NETCLASS(); ~NETCLASS();
wxString GetClass() const wxString GetClass() const
...@@ -134,24 +152,33 @@ public: ...@@ -134,24 +152,33 @@ public:
const wxString& GetDescription() const { return m_Description; } const wxString& GetDescription() const { return m_Description; }
void SetDescription( const wxString& aDesc ) { m_Description = aDesc; } void SetDescription( const wxString& aDesc ) { m_Description = aDesc; }
int GetClearance() const { return m_Clearance; }
void SetClearance( int aClearance ) { m_Clearance = aClearance; }
int GetTrackWidth() const { return m_TrackWidth; } int GetTrackWidth() const { return m_TrackWidth; }
void SetTrackWidth( int aWidth ) { m_TrackWidth = aWidth; } void SetTrackWidth( int aWidth ) { m_TrackWidth = aWidth; }
int GetTrackMinWidth() const { return m_TrackMinWidth; } int GetViaDiameter() const { return m_ViaDia; }
void SetTrackMinWidth( int aWidth ) { m_TrackMinWidth = aWidth; } void SetViaDiameter( int aDia ) { m_ViaDia = aDia; }
int GetViaSize() const { return m_ViaSize; } int GetViaDrill() const { return m_ViaDrill; }
void SetViaSize( int aSize ) { m_ViaSize = aSize; } void SetViaDrill( int aSize ) { m_ViaDrill = aSize; }
int GetViaDrillSize() const { return m_ViaDrillSize; } int GetuViaDiameter() const { return m_uViaDia; }
void SetViaDrillSize( int aSize ) { m_ViaDrillSize = aSize; } void SetuViaDiameter( int aSize ) { m_uViaDia = aSize; }
int GetViaMinSize() const { return m_ViaMinSize; } int GetuViaDrill() const { return m_uViaDrill; }
void SetViaMinSize( int aSize ) { m_ViaMinSize = aSize; } void SetuViaDrill( int aSize ) { m_uViaDrill = aSize; }
int GetClearance() const { return m_Clearance; }
void SetClearance( int aClearance ) { m_Clearance = aClearance; }
/**
* Function SetParams
* will set all the parameters by copying them from \a defaults.
* Parameters are the values like m_ViaSize, etc, but do not include m_Description.
* @param defaults is another NETCLASS to copy from. If NULL, then copy
* from global preferences instead.
*/
void SetParams( const NETCLASS* defaults = NULL );
/** /**
* Function Save * Function Save
...@@ -236,14 +263,14 @@ public: ...@@ -236,14 +263,14 @@ public:
return (NETCLASS*) &m_Default; return (NETCLASS*) &m_Default;
} }
/** /**
* Function Add * Function Add
* takes ownership of \a aNetclass and puts it into this NETCLASSES container.
* @param aNetclass is netclass to add * @param aNetclass is netclass to add
* @return true if Ok, false if cannot be added (mainly because a * @return true if the name within aNetclass is unique and it could be inserted OK,
* netclass with the same name exists) * else false because the name was not unique and caller still owns aNetclass.
*/ */
bool Add( const NETCLASS& aNetclass ); bool Add( NETCLASS* aNetclass );
/** /**
* Function Remove * Function Remove
......
...@@ -208,7 +208,7 @@ public: ...@@ -208,7 +208,7 @@ public:
return m_NetClassName; return m_NetClassName;
} }
#if 0
/** /**
* Function GetTrackWidth * Function GetTrackWidth
* returns the width of tracks used to route this net. * returns the width of tracks used to route this net.
...@@ -221,10 +221,10 @@ public: ...@@ -221,10 +221,10 @@ public:
/** /**
* Function GetTrackMinWidth * Function GetTrackWidth
* returns the Minimum value for tracks thickness (used in DRC) * returns the Minimum value for tracks thickness (used in DRC)
*/ */
int GetTrackMinWidth() int GetTrackWidth()
{ {
wxASSERT( m_NetClass ); wxASSERT( m_NetClass );
return m_NetClass->GetTrackMinWidth(); return m_NetClass->GetTrackMinWidth();
...@@ -273,7 +273,7 @@ public: ...@@ -273,7 +273,7 @@ public:
wxASSERT( m_NetClass ); wxASSERT( m_NetClass );
return m_NetClass->GetClearance(); return m_NetClass->GetClearance();
} }
#endif
/* Reading and writing data on files */ /* Reading and writing data on files */
int ReadDescr( FILE* File, int* LineNum ); int ReadDescr( FILE* File, int* LineNum );
......
...@@ -11,7 +11,6 @@ class Pcb3D_GLCanvas; ...@@ -11,7 +11,6 @@ class Pcb3D_GLCanvas;
class D_PAD : public BOARD_CONNECTED_ITEM class D_PAD : public BOARD_CONNECTED_ITEM
{ {
private: private:
int m_NetCode; // Net number for fast comparisons
wxString m_Netname; // Full net name like /mysheet/mysubsheet/vout used by eeschema wxString m_Netname; // Full net name like /mysheet/mysubsheet/vout used by eeschema
wxString m_ShortNetname; // short net name, like vout from /mysheet/mysubsheet/vout wxString m_ShortNetname; // short net name, like vout from /mysheet/mysubsheet/vout
......
...@@ -207,6 +207,8 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin ...@@ -207,6 +207,8 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
SetAlpha(&color, 170); SetAlpha(&color, 170);
int padClearance = GetClearance();
switch( GetShape() ) switch( GetShape() )
{ {
case PAD_CIRCLE: case PAD_CIRCLE:
...@@ -221,7 +223,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin ...@@ -221,7 +223,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
DC, DC,
xc, xc,
yc, yc,
dx + g_DesignSettings.m_TrackClearence, dx + padClearance,
0, 0,
color ); color );
} }
...@@ -259,7 +261,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin ...@@ -259,7 +261,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
/* Trace de la marge d'isolement */ /* Trace de la marge d'isolement */
if( DisplayIsol ) if( DisplayIsol )
{ {
rotdx = rotdx + g_DesignSettings.m_TrackClearence + g_DesignSettings.m_TrackClearence; rotdx = rotdx + 2 * padClearance;
GRCSegm( &panel->m_ClipBox, DC, ux0 + delta_cx, uy0 + delta_cy, GRCSegm( &panel->m_ClipBox, DC, ux0 + delta_cx, uy0 + delta_cy,
ux0 - delta_cx, uy0 - delta_cy, ux0 - delta_cx, uy0 - delta_cy,
...@@ -297,8 +299,8 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin ...@@ -297,8 +299,8 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
if( DisplayIsol ) if( DisplayIsol )
{ {
dx += g_DesignSettings.m_TrackClearence; dx += padClearance;
dy += g_DesignSettings.m_TrackClearence; dy += padClearance;
coord[0].x = -dx - ddy; coord[0].x = -dx - ddy;
coord[0].y = dy + ddx; coord[0].y = dy + ddx;
......
...@@ -257,7 +257,7 @@ EDA_Rect TRACK::GetBoundingBox() ...@@ -257,7 +257,7 @@ EDA_Rect TRACK::GetBoundingBox()
if( ShowClearance( this ) ) if( ShowClearance( this ) )
{ {
// + 1 is for the clearance line itself. // + 1 is for the clearance line itself.
radius += g_DesignSettings.m_TrackClearence + 1; radius += GetClearance() + 1;
} }
ymax += radius; ymax += radius;
...@@ -664,7 +664,7 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin ...@@ -664,7 +664,7 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
{ {
GRCSegm( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, GRCSegm( &panel->m_ClipBox, DC, m_Start.x, m_Start.y,
m_End.x, m_End.y, m_End.x, m_End.y,
m_Width + (g_DesignSettings.m_TrackClearence * 2), color ); m_Width + (GetClearance() * 2), color );
} }
/* Display the short netname for tracks, not for zone segments. /* Display the short netname for tracks, not for zone segments.
...@@ -794,7 +794,7 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi ...@@ -794,7 +794,7 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
if( DisplayOpt.ShowTrackClearanceMode == SHOW_CLEARANCE_ALWAYS ) if( DisplayOpt.ShowTrackClearanceMode == SHOW_CLEARANCE_ALWAYS )
GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y,
rayon + g_DesignSettings.m_TrackClearence, color ); rayon + GetClearance(), color );
// for Micro Vias, draw a partial cross : // for Micro Vias, draw a partial cross :
// X on component layer, or + on copper layer // X on component layer, or + on copper layer
......
...@@ -206,7 +206,7 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings() ...@@ -206,7 +206,7 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
for( ii = 0; ii < HISTORY_NUMBER; ii++ ) for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{ {
m_TrackWidthHistory[ii] = 0; // Last HISTORY_NUMBER used track widths m_TrackWidthHistory[ii] = 0; // Last HISTORY_NUMBER used track widths
m_TrackClearenceHistory[ii] = 0; m_TrackClearanceHistory[ii] = 0;
m_ViaSizeHistory[ii] = 0; // Last HISTORY_NUMBER used via sizes m_ViaSizeHistory[ii] = 0; // Last HISTORY_NUMBER used via sizes
} }
...@@ -214,7 +214,7 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings() ...@@ -214,7 +214,7 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
m_EdgeSegmentWidth = 100; // current graphic line width (EDGE layer only) m_EdgeSegmentWidth = 100; // current graphic line width (EDGE layer only)
m_PcbTextWidth = 100; // current Pcb (not module) Text width m_PcbTextWidth = 100; // current Pcb (not module) Text width
m_PcbTextSize = wxSize( 500, 500 ); // current Pcb (not module) Text size m_PcbTextSize = wxSize( 500, 500 ); // current Pcb (not module) Text size
m_TrackClearence = 100; // track to track and track to pads clearance m_TrackClearance = 100; // track to track and track to pads clearance
m_TrackMinWidth = 80; // track min value for width ((min copper size value m_TrackMinWidth = 80; // track min value for width ((min copper size value
m_ViasMinSize = 350; // vias (not micro vias) min diameter m_ViasMinSize = 350; // vias (not micro vias) min diameter
m_MicroViasMinSize = 200; // micro vias (not vias) min diameter m_MicroViasMinSize = 200; // micro vias (not vias) min diameter
......
...@@ -596,9 +596,7 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -596,9 +596,7 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
// "as is", and let ShowNewTrackWhenMovingCursor figure out what to do. // "as is", and let ShowNewTrackWhenMovingCursor figure out what to do.
if( !Drc_On || !g_CurrentTrackSegment if( !Drc_On || !g_CurrentTrackSegment
|| g_CurrentTrackSegment != this->GetCurItem() || g_CurrentTrackSegment != this->GetCurItem()
|| !LocateIntrusion( m_Pcb->m_Track, || !LocateIntrusion( m_Pcb->m_Track, g_CurrentTrackSegment ))
g_CurrentTrackSegment->GetNet(),
g_CurrentTrackSegment->m_Width ) )
{ {
GetScreen()->m_Curseur = on_grid; GetScreen()->m_Curseur = on_grid;
} }
......
This diff is collapsed.
...@@ -7,17 +7,32 @@ ...@@ -7,17 +7,32 @@
#include "dialog_design_rules_base.h" #include "dialog_design_rules_base.h"
struct NETCUP
{
NETCUP( const wxString& aNet, const wxString& aClass )
{
net = aNet;
clazz = aClass;
}
wxString net;
wxString clazz;
};
typedef std::vector<NETCUP> NETCUPS;
typedef std::vector<NETCUP*> PNETCUPS;
class DIALOG_DESIGN_RULES : public DIALOG_DESIGN_RULES_BASE class DIALOG_DESIGN_RULES : public DIALOG_DESIGN_RULES_BASE
{ {
private: private:
WinEDA_PcbFrame * m_Parent;
int m_ActivesLayersCount; static const wxString wildCard;
BOARD * m_Pcb;
LAYER_T m_LayersType[4]; WinEDA_PcbFrame* m_Parent;
wxString m_LayersTypeName[4]; BOARD* m_Pcb;
std::vector<NETINFO_ITEM*> m_StockNets; // full list of nets on board
std::vector<int> m_NetsLinkToClasses; // index to affect each net to an existing net class std::vector<wxString> m_NetClasses;
NETCUPS m_AllNets;
private: private:
void OnLayerCountClick( wxCommandEvent& event ); void OnLayerCountClick( wxCommandEvent& event );
...@@ -40,8 +55,28 @@ class DIALOG_DESIGN_RULES : public DIALOG_DESIGN_RULES_BASE ...@@ -40,8 +55,28 @@ class DIALOG_DESIGN_RULES : public DIALOG_DESIGN_RULES_BASE
void InitRulesList(); void InitRulesList();
void InitializeRulesSelectionBoxes(); void InitializeRulesSelectionBoxes();
void CopyRulesListToBoard(); void CopyRulesListToBoard();
void SetRoutableLayerStatus( ); void SetRoutableLayerStatus();
void FillListBoxWithNetsNames(wxListBox* aListBox, int aNetclassIndex); void FillListBoxWithNetNames( wxListCtrl* aListCtrl, const wxString& aNetClass );
/**
* Function swapNetClass
* replaces one net class name with another in the master list, m_AllNets.
*/
void swapNetClass( const wxString& oldClass, const wxString& newClass )
{
for( NETCUPS::iterator i = m_AllNets.begin(); i!=m_AllNets.end(); ++i )
{
if( i->clazz == oldClass )
i->clazz = newClass;
}
}
void makePointers( PNETCUPS* aList, const wxString& aNetClassName );
void setNetClass( const wxString& aNetName, const wxString& aClassName );
static void setRowItem( wxListCtrl* aListCtrl, int aRow, NETCUP* aNetAndClass );
public: public:
DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent ); DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent );
......
This diff is collapsed.
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Sep 9 2009)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -10,37 +10,28 @@ ...@@ -10,37 +10,28 @@
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/string.h>
#include <wx/radiobox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/string.h>
#include <wx/font.h>
#include <wx/grid.h> #include <wx/grid.h>
#include <wx/sizer.h> #include <wx/gdicmn.h>
#include <wx/panel.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/sizer.h>
#include <wx/statbox.h> #include <wx/statbox.h>
#include <wx/choice.h> #include <wx/choice.h>
#include <wx/listbox.h> #include <wx/listctrl.h>
#include <wx/notebook.h>
#include <wx/stattext.h>
#include <wx/html/htmlwin.h> #include <wx/html/htmlwin.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#define ID_LAYERS_COUNT_SELECTION 1000 #define wxID_ADD_NETCLASS 1000
#define ID_LAYERS_PROPERTIES 1001 #define wxID_REMOVE_NETCLASS 1001
#define wxID_ADD_NETCLASS 1002 #define ID_LEFT_CHOICE_CLICK 1002
#define wxID_REMOVE_NETCLASS 1003 #define ID_LEFT_TO_RIGHT_COPY 1003
#define ID_LEFT_CHOICE_CLICK 1004 #define ID_RIGHT_TO_LEFT_COPY 1004
#define ID_LEFT_TO_RIGHT_COPY 1005 #define ID_RIGHT_CHOICE_CLICK 1005
#define ID_RIGHT_TO_LEFT_COPY 1006
#define ID_RIGHT_CHOICE_CLICK 1007
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_DESIGN_RULES_BASE /// Class DIALOG_DESIGN_RULES_BASE
...@@ -50,48 +41,41 @@ class DIALOG_DESIGN_RULES_BASE : public wxDialog ...@@ -50,48 +41,41 @@ class DIALOG_DESIGN_RULES_BASE : public wxDialog
private: private:
protected: protected:
wxNotebook* m_notebook; wxGrid* m_grid;
wxPanel* m_panelLayers; wxButton* m_addButton;
wxRadioBox* m_LayersCountSelection; wxButton* m_removeButton;
wxGrid* m_gridLayersProperties; wxButton* m_moveUpButton;
wxPanel* m_panelNetClasses; wxChoice* m_leftClassChoice;
wxGrid* m_gridNetClassesProperties; wxListCtrl* m_leftListCtrl;
wxButton* m_buttonADD;
wxButton* m_buttonRemove;
wxChoice* m_CBoxLeftSelection;
wxListBox* m_listBoxLeftNetSelect;
wxButton* m_buttonRightToLeft; wxButton* m_buttonRightToLeft;
wxButton* m_buttonLeftToRight; wxButton* m_buttonLeftToRight;
wxButton* m_buttonLeftSelAll; wxButton* m_buttonLeftSelAll;
wxButton* m_buttonRightSelAll; wxButton* m_buttonRightSelAll;
wxChoice* m_CBoxRightSelection; wxChoice* m_rightClassChoice;
wxListBox* m_listBoxRightNetSelect; wxListCtrl* m_rightListCtrl;
wxStaticText* m_staticTextMsg;
wxHtmlWindow* m_MessagesList; wxHtmlWindow* m_MessagesList;
wxStdDialogButtonSizer* m_sdbSizer1; wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel; wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnLayerCountClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnNetClassesGridLeftClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnLayerGridLeftClick( wxGridEvent& event ){ event.Skip(); } virtual void OnNetClassesGridRightClick( wxGridEvent& event ) { event.Skip(); }
virtual void OnLayerGridRighttClick( wxGridEvent& event ){ event.Skip(); } virtual void OnAddNetclassClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnNetClassesGridLeftClick( wxGridEvent& event ){ event.Skip(); } virtual void OnRemoveNetclassClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnNetClassesGridRightClick( wxGridEvent& event ){ event.Skip(); } virtual void OnLeftCBSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void OnAddNetclassClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnRightToLeftCopyButton( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRemoveNetclassClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnLeftToRightCopyButton( wxCommandEvent& event ) { event.Skip(); }
virtual void OnLeftCBSelection( wxCommandEvent& event ){ event.Skip(); } virtual void OnLeftSelectAllButton( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRightToLeftCopyButton( wxCommandEvent& event ){ event.Skip(); } virtual void OnRightSelectAllButton( wxCommandEvent& event ) { event.Skip(); }
virtual void OnLeftToRightCopyButton( wxCommandEvent& event ){ event.Skip(); } virtual void OnRightCBSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void OnLeftSelectAllButton( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRightSelectAllButton( wxCommandEvent& event ){ event.Skip(); } virtual void OnOkButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRightCBSelection( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelButtonClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkButtonClick( wxCommandEvent& event ){ event.Skip(); }
public: public:
DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Design Rules Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 684,568 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Design Rules Editor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 750,520 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_DESIGN_RULES_BASE(); ~DIALOG_DESIGN_RULES_BASE();
}; };
......
...@@ -87,7 +87,7 @@ void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event ) ...@@ -87,7 +87,7 @@ void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event )
reportName = m_RptFilenameCtrl->GetValue(); reportName = m_RptFilenameCtrl->GetValue();
} }
g_DesignSettings.m_TrackClearence = g_DesignSettings.m_TrackClearance =
ReturnValueFromTextCtrl( *m_SetClearance, m_Parent->m_InternalUnits ); ReturnValueFromTextCtrl( *m_SetClearance, m_Parent->m_InternalUnits );
g_DesignSettings.m_TrackMinWidth = g_DesignSettings.m_TrackMinWidth =
ReturnValueFromTextCtrl( *m_SetTrackMinWidthCtrl, m_Parent->m_InternalUnits ); ReturnValueFromTextCtrl( *m_SetTrackMinWidthCtrl, m_Parent->m_InternalUnits );
...@@ -101,7 +101,6 @@ void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event ) ...@@ -101,7 +101,6 @@ void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event )
true, // DRC test for zones enabled true, // DRC test for zones enabled
reportName, m_CreateRptCtrl->IsChecked() ); reportName, m_CreateRptCtrl->IsChecked() );
DelDRCMarkers(); DelDRCMarkers();
wxBeginBusyCursor(); wxBeginBusyCursor();
...@@ -127,7 +126,7 @@ void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event ) ...@@ -127,7 +126,7 @@ void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event )
fclose( fp ); fclose( fp );
wxString msg; wxString msg;
msg.Printf( _( "Report file \"%s\" created" ), reportName.GetData() ); msg.Printf( _( "Report file \"%s\" created" ), GetChars( reportName ) );
wxString caption( _( "Disk File Report Completed" ) ); wxString caption( _( "Disk File Report Completed" ) );
wxMessageDialog popupWindow( this, msg, caption ); wxMessageDialog popupWindow( this, msg, caption );
...@@ -173,7 +172,7 @@ void DIALOG_DRC_CONTROL::OnListUnconnectedClick( wxCommandEvent& event ) ...@@ -173,7 +172,7 @@ void DIALOG_DRC_CONTROL::OnListUnconnectedClick( wxCommandEvent& event )
reportName = m_RptFilenameCtrl->GetValue(); reportName = m_RptFilenameCtrl->GetValue();
} }
g_DesignSettings.m_TrackClearence = g_DesignSettings.m_TrackClearance =
ReturnValueFromTextCtrl( *m_SetClearance, m_Parent->m_InternalUnits ); ReturnValueFromTextCtrl( *m_SetClearance, m_Parent->m_InternalUnits );
g_DesignSettings.m_TrackMinWidth = g_DesignSettings.m_TrackMinWidth =
ReturnValueFromTextCtrl( *m_SetTrackMinWidthCtrl, m_Parent->m_InternalUnits ); ReturnValueFromTextCtrl( *m_SetTrackMinWidthCtrl, m_Parent->m_InternalUnits );
...@@ -208,7 +207,7 @@ void DIALOG_DRC_CONTROL::OnListUnconnectedClick( wxCommandEvent& event ) ...@@ -208,7 +207,7 @@ void DIALOG_DRC_CONTROL::OnListUnconnectedClick( wxCommandEvent& event )
fclose( fp ); fclose( fp );
wxString msg; wxString msg;
msg.Printf( _( "Report file \"%s\" created" ), reportName.GetData() ); msg.Printf( _( "Report file \"%s\" created" ), GetChars( reportName ) );
wxString caption( _( "Disk File Report Completed" ) ); wxString caption( _( "Disk File Report Completed" ) );
wxMessageDialog popupWindow( this, msg, caption ); wxMessageDialog popupWindow( this, msg, caption );
popupWindow.ShowModal(); popupWindow.ShowModal();
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Sep 9 2009)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -77,7 +77,6 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i ...@@ -77,7 +77,6 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
ReportFileSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Create Report File") ), wxHORIZONTAL ); ReportFileSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Create Report File") ), wxHORIZONTAL );
m_CreateRptCtrl = new wxCheckBox( this, ID_CHECKBOX_RPT_FILE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_CreateRptCtrl = new wxCheckBox( this, ID_CHECKBOX_RPT_FILE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_CreateRptCtrl->SetToolTip( _("Enable writing report to this file") ); m_CreateRptCtrl->SetToolTip( _("Enable writing report to this file") );
ReportFileSizer->Add( m_CreateRptCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); ReportFileSizer->Add( m_CreateRptCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
...@@ -157,7 +156,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i ...@@ -157,7 +156,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
m_panelClearanceListBox->SetSizer( bSizeClearanceBox ); m_panelClearanceListBox->SetSizer( bSizeClearanceBox );
m_panelClearanceListBox->Layout(); m_panelClearanceListBox->Layout();
bSizeClearanceBox->Fit( m_panelClearanceListBox ); bSizeClearanceBox->Fit( m_panelClearanceListBox );
m_Notebook->AddPage( m_panelClearanceListBox, _("Distance Problem Markers"), true ); m_Notebook->AddPage( m_panelClearanceListBox, _("Problems / Markers"), true );
m_panelUnconnectedBox = new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelUnconnectedBox = new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerUnconnectedBox; wxBoxSizer* bSizerUnconnectedBox;
bSizerUnconnectedBox = new wxBoxSizer( wxVERTICAL ); bSizerUnconnectedBox = new wxBoxSizer( wxVERTICAL );
...@@ -215,4 +214,5 @@ DIALOG_DRC_CONTROL_BASE::~DIALOG_DRC_CONTROL_BASE() ...@@ -215,4 +214,5 @@ DIALOG_DRC_CONTROL_BASE::~DIALOG_DRC_CONTROL_BASE()
m_UnconnectedListBox->Disconnect( wxEVT_RIGHT_UP, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnRightUpUnconnected ), NULL, this ); m_UnconnectedListBox->Disconnect( wxEVT_RIGHT_UP, wxMouseEventHandler( DIALOG_DRC_CONTROL_BASE::OnRightUpUnconnected ), NULL, this );
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnCancelClick ), NULL, this ); m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnCancelClick ), NULL, this );
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnOkClick ), NULL, this ); m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DRC_CONTROL_BASE::OnOkClick ), NULL, this );
} }
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Sep 9 2009)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -71,18 +71,18 @@ class DIALOG_DRC_CONTROL_BASE : public wxDialog ...@@ -71,18 +71,18 @@ class DIALOG_DRC_CONTROL_BASE : public wxDialog
wxButton* m_sdbSizer1Cancel; wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnReportCheckBoxClicked( wxCommandEvent& event ){ event.Skip(); } virtual void OnReportCheckBoxClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonBrowseRptFileClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnButtonBrowseRptFileClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnStartdrcClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnStartdrcClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnListUnconnectedClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnListUnconnectedClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDeleteAllClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnDeleteAllClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDeleteOneClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnDeleteOneClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnLeftDClickClearance( wxMouseEvent& event ){ event.Skip(); } virtual void OnLeftDClickClearance( wxMouseEvent& event ) { event.Skip(); }
virtual void OnRightUpClearance( wxMouseEvent& event ){ event.Skip(); } virtual void OnRightUpClearance( wxMouseEvent& event ) { event.Skip(); }
virtual void OnLeftDClickUnconnected( wxMouseEvent& event ){ event.Skip(); } virtual void OnLeftDClickUnconnected( wxMouseEvent& event ) { event.Skip(); }
virtual void OnRightUpUnconnected( wxMouseEvent& event ){ event.Skip(); } virtual void OnRightUpUnconnected( wxMouseEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
public: public:
...@@ -94,7 +94,8 @@ class DIALOG_DRC_CONTROL_BASE : public wxDialog ...@@ -94,7 +94,8 @@ class DIALOG_DRC_CONTROL_BASE : public wxDialog
wxTextCtrl* m_RptFilenameCtrl; wxTextCtrl* m_RptFilenameCtrl;
DRCLISTBOX* m_ClearanceListBox; DRCLISTBOX* m_ClearanceListBox;
DRCLISTBOX* m_UnconnectedListBox; DRCLISTBOX* m_UnconnectedListBox;
DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("DRC Control"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 683,508 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("DRC Control"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800,508 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_DRC_CONTROL_BASE(); ~DIALOG_DRC_CONTROL_BASE();
}; };
......
...@@ -70,7 +70,7 @@ void DIALOG_TRACKS_OPTIONS::SetDisplayValue() ...@@ -70,7 +70,7 @@ void DIALOG_TRACKS_OPTIONS::SetDisplayValue()
g_DesignSettings.m_ViaDrillCustomValue, g_DesignSettings.m_ViaDrillCustomValue,
Internal_Unit ); Internal_Unit );
PutValueInLocalUnits( *m_OptTrackWidth, g_DesignSettings.m_CurrentTrackWidth, Internal_Unit ); PutValueInLocalUnits( *m_OptTrackWidth, g_DesignSettings.m_CurrentTrackWidth, Internal_Unit );
PutValueInLocalUnits( *m_OptTrackClearance, g_DesignSettings.m_TrackClearence, Internal_Unit ); PutValueInLocalUnits( *m_OptTrackClearance, g_DesignSettings.m_TrackClearance, Internal_Unit );
PutValueInLocalUnits( *m_OptMaskMargin, g_DesignSettings.m_MaskMargin, Internal_Unit ); PutValueInLocalUnits( *m_OptMaskMargin, g_DesignSettings.m_MaskMargin, Internal_Unit );
if( g_DesignSettings.m_CurrentViaType != VIA_THROUGH ) if( g_DesignSettings.m_CurrentViaType != VIA_THROUGH )
m_OptViaType->SetSelection( 1 ); m_OptViaType->SetSelection( 1 );
...@@ -109,7 +109,7 @@ void DIALOG_TRACKS_OPTIONS::OnButtonOkClick( wxCommandEvent& event ) ...@@ -109,7 +109,7 @@ void DIALOG_TRACKS_OPTIONS::OnButtonOkClick( wxCommandEvent& event )
g_DesignSettings.m_CurrentTrackWidth = g_DesignSettings.m_CurrentTrackWidth =
ReturnValueFromTextCtrl( *m_OptTrackWidth, m_Parent->m_InternalUnits ); ReturnValueFromTextCtrl( *m_OptTrackWidth, m_Parent->m_InternalUnits );
g_DesignSettings.m_TrackClearence = g_DesignSettings.m_TrackClearance =
ReturnValueFromTextCtrl( *m_OptTrackClearance, m_Parent->m_InternalUnits ); ReturnValueFromTextCtrl( *m_OptTrackClearance, m_Parent->m_InternalUnits );
g_DesignSettings.m_MaskMargin = g_DesignSettings.m_MaskMargin =
...@@ -119,7 +119,7 @@ void DIALOG_TRACKS_OPTIONS::OnButtonOkClick( wxCommandEvent& event ) ...@@ -119,7 +119,7 @@ void DIALOG_TRACKS_OPTIONS::OnButtonOkClick( wxCommandEvent& event )
m_Parent->AddHistory( g_DesignSettings.m_CurrentViaSize, TYPE_VIA ); m_Parent->AddHistory( g_DesignSettings.m_CurrentViaSize, TYPE_VIA );
m_Parent->AddHistory( g_DesignSettings.m_CurrentTrackWidth, TYPE_TRACK ); m_Parent->AddHistory( g_DesignSettings.m_CurrentTrackWidth, TYPE_TRACK );
m_Parent->AddHistory( g_DesignSettings.m_TrackClearence, TYPE_CLEARANCE ); m_Parent->AddHistory( g_DesignSettings.m_TrackClearance, TYPE_CLEARANCE );
EndModal( 1 ); EndModal( 1 );
} }
...@@ -169,12 +169,12 @@ void WinEDA_BasePcbFrame::AddHistory( int value, KICAD_T type ) ...@@ -169,12 +169,12 @@ void WinEDA_BasePcbFrame::AddHistory( int value, KICAD_T type )
g_DesignSettings.m_TrackWidthHistory[ii + 1] ); g_DesignSettings.m_TrackWidthHistory[ii + 1] );
} }
} }
break; break;
case TYPE_CLEARANCE: case TYPE_CLEARANCE:
for( ii = 0; ii < HISTORY_NUMBER; ii++ ) for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{ {
if( g_DesignSettings.m_TrackClearenceHistory[ii] == value ) if( g_DesignSettings.m_TrackClearanceHistory[ii] == value )
{ {
addhistory = FALSE; addhistory = FALSE;
break; break;
...@@ -186,27 +186,27 @@ void WinEDA_BasePcbFrame::AddHistory( int value, KICAD_T type ) ...@@ -186,27 +186,27 @@ void WinEDA_BasePcbFrame::AddHistory( int value, KICAD_T type )
for( ii = HISTORY_NUMBER - 1; ii > 0; ii-- ) for( ii = HISTORY_NUMBER - 1; ii > 0; ii-- )
{ {
g_DesignSettings.m_TrackClearenceHistory[ii] = g_DesignSettings.m_TrackClearanceHistory[ii] =
g_DesignSettings.m_TrackClearenceHistory[ii - 1]; g_DesignSettings.m_TrackClearanceHistory[ii - 1];
} }
g_DesignSettings.m_TrackClearenceHistory[0] = value; g_DesignSettings.m_TrackClearanceHistory[0] = value;
// Reclassement par valeur croissante // Reclassement par valeur croissante
for( ii = 0; ii < HISTORY_NUMBER - 1; ii++ ) for( ii = 0; ii < HISTORY_NUMBER - 1; ii++ )
{ {
if( g_DesignSettings.m_TrackClearenceHistory[ii + 1] == 0 ) if( g_DesignSettings.m_TrackClearanceHistory[ii + 1] == 0 )
break; // Fin de liste break; // Fin de liste
if( g_DesignSettings.m_TrackClearenceHistory[ii] > if( g_DesignSettings.m_TrackClearanceHistory[ii] >
g_DesignSettings.m_TrackClearenceHistory[ii + 1] ) g_DesignSettings.m_TrackClearanceHistory[ii + 1] )
{ {
EXCHG( g_DesignSettings.m_TrackClearenceHistory[ii], EXCHG( g_DesignSettings.m_TrackClearanceHistory[ii],
g_DesignSettings.m_TrackClearenceHistory[ii + 1] ); g_DesignSettings.m_TrackClearanceHistory[ii + 1] );
} }
} }
break; break;
case TYPE_VIA: case TYPE_VIA:
for( ii = 0; ii < HISTORY_NUMBER; ii++ ) for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{ {
......
This diff is collapsed.
...@@ -64,6 +64,12 @@ ...@@ -64,6 +64,12 @@
#define DRCE_TOO_SMALL_TRACK_WIDTH 27 ///< Too small track width #define DRCE_TOO_SMALL_TRACK_WIDTH 27 ///< Too small track width
#define DRCE_TOO_SMALL_VIA 28 ///< Too small via size #define DRCE_TOO_SMALL_VIA 28 ///< Too small via size
#define DRCE_TOO_SMALL_MICROVIA 29 ///< Too small micro via size #define DRCE_TOO_SMALL_MICROVIA 29 ///< Too small micro via size
#define DRCE_NETCLASS_TRACKWIDTH 30 ///< netclass has TrackWidth < g_DesignSettings.m_TrackMinWidth
#define DRCE_NETCLASS_CLEARANCE 31 ///< netclass has Clearance < g_DesignSettings.m_TrackClearance
#define DRCE_NETCLASS_VIASIZE 32 ///< netclass has ViaSize < g_DesignSettings.m_ViasMinSize
#define DRCE_NETCLASS_VIADRILLSIZE 33 ///< netclass has ViaDrillSize < g_DesignSettings.m_ViaDrill
#define DRCE_NETCLASS_uVIASIZE 34
#define DRCE_NETCLASS_uVIADRILLSIZE 35
class WinEDA_DrawPanel; class WinEDA_DrawPanel;
...@@ -211,8 +217,27 @@ private: ...@@ -211,8 +217,27 @@ private:
*/ */
MARKER_PCB* fillMarker( const ZONE_CONTAINER * aArea, const wxPoint & aPos, int aErrorCode, MARKER_PCB* fillMe ); MARKER_PCB* fillMarker( const ZONE_CONTAINER * aArea, const wxPoint & aPos, int aErrorCode, MARKER_PCB* fillMe );
/**
* Function fillMarker
* fills a MARKER which will report on a generic problem with the board which is
* not geographically locatable.
*/
MARKER_PCB* fillMarker( int aErrorCode, const wxString& aMessage, MARKER_PCB* fillMe );
//-----<categorical group tests>----------------------------------------- //-----<categorical group tests>-----------------------------------------
/**
* Function testNetClasses
* goes through each NETCLASS and verifies that its clearance, via size,
* track width, and track clearance are larger than those in g_DesignSettings.
* This is necessary because the actual DRC checks are run against the NETCLASS
* limits, so in order enforce global limits, we first check the NETCLASSes against
* the global limits.
* @return bool - true if succes, else false but only after
* reporting _all_ NETCLASS violations.
*/
bool testNetClasses();
void testTracks(); void testTracks();
void testPad2Pad(); void testPad2Pad();
...@@ -224,6 +249,8 @@ private: ...@@ -224,6 +249,8 @@ private:
//-----<single "item" tests>----------------------------------------- //-----<single "item" tests>-----------------------------------------
bool doNetClass( NETCLASS* aNetClass, wxString& msg );
/** /**
* Function doPadToPadsDrc * Function doPadToPadsDrc
* tests the clearance between aRefPad and other pads. * tests the clearance between aRefPad and other pads.
...@@ -231,10 +258,10 @@ private: ...@@ -231,10 +258,10 @@ private:
* @param aRefPad The pad to test * @param aRefPad The pad to test
* @param aStart The start of the pad list to test against * @param aStart The start of the pad list to test against
* @param aEnd Marks the end of the list and is not included * @param aEnd Marks the end of the list and is not included
* @param max_size The size of the biggest pad (used to stop the test when the X distance is > max_size) * @param x_limit is used to stop the test (when the any pad's X coord exceeds this)
*/ */
bool doPadToPadsDrc( D_PAD* aRefPad, LISTE_PAD* aStart, bool doPadToPadsDrc( D_PAD* aRefPad, LISTE_PAD* aStart,
LISTE_PAD* aEnd, int max_size ); LISTE_PAD* aEnd, int x_limit );
/** /**
* Function DoTrackDrc * Function DoTrackDrc
...@@ -267,7 +294,7 @@ private: ...@@ -267,7 +294,7 @@ private:
* @param aPad Another pad to check against * @param aPad Another pad to check against
* @return bool - true if clearance between aRefPad and pad is >= dist_min, else false * @return bool - true if clearance between aRefPad and pad is >= dist_min, else false
*/ */
bool checkClearancePadToPad( D_PAD* aRefPad, D_PAD* aPad, const int dist_min ); bool checkClearancePadToPad( D_PAD* aRefPad, D_PAD* aPad );
/** /**
...@@ -358,7 +385,6 @@ public: ...@@ -358,7 +385,6 @@ public:
return doTrackDrc( aRefSeg, aList ) ? OK_DRC : BAD_DRC; return doTrackDrc( aRefSeg, aList ) ? OK_DRC : BAD_DRC;
} }
/** /**
* Function ShowDialog * Function ShowDialog
* opens a dialog and prompts the user, then if a test run button is * opens a dialog and prompts the user, then if a test run button is
...@@ -367,7 +393,6 @@ public: ...@@ -367,7 +393,6 @@ public:
*/ */
void ShowDialog(); void ShowDialog();
/** /**
* Function DestroyDialog * Function DestroyDialog
* deletes this ui dialog box and zeros out its pointer to remember * deletes this ui dialog box and zeros out its pointer to remember
...@@ -396,7 +421,6 @@ public: ...@@ -396,7 +421,6 @@ public:
m_doCreateRptFile = aSaveReport; m_doCreateRptFile = aSaveReport;
} }
/** /**
* Function RunTests * Function RunTests
* will actually run all the tests specified with a previous call to * will actually run all the tests specified with a previous call to
...@@ -405,7 +429,6 @@ public: ...@@ -405,7 +429,6 @@ public:
*/ */
void RunTests(wxTextCtrl * aMessages = NULL); void RunTests(wxTextCtrl * aMessages = NULL);
/** /**
* Function ListUnconnectedPad * Function ListUnconnectedPad
* gathers a list of all the unconnected pads and shows them in the * gathers a list of all the unconnected pads and shows them in the
......
...@@ -1007,8 +1007,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -1007,8 +1007,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_AUX_TOOLBAR_PCB_CLR_WIDTH: case ID_AUX_TOOLBAR_PCB_CLR_WIDTH:
{ {
int ii = m_SelClrWidthBox->GetChoice(); int ii = m_SelClrWidthBox->GetChoice();
g_DesignSettings.m_TrackClearence = g_DesignSettings.m_TrackClearance =
g_DesignSettings.m_TrackClearenceHistory[ii]; g_DesignSettings.m_TrackClearanceHistory[ii];
DisplayTrackSettings(); DisplayTrackSettings();
m_SelTrackWidthBox_Changed = false; m_SelTrackWidthBox_Changed = false;
m_SelClrWidthBox_Changed = false; m_SelClrWidthBox_Changed = false;
......
...@@ -549,15 +549,17 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC ) ...@@ -549,15 +549,17 @@ void WinEDA_PcbFrame::End_Route( TRACK* aTrack, wxDC* DC )
} }
TRACK* LocateIntrusion( TRACK* start, int net, int width ) TRACK* LocateIntrusion( TRACK* listStart, TRACK* aTrack )
{ {
int net = aTrack->GetNet();
int width = aTrack->m_Width;
int layer = ( (PCB_SCREEN*) ActiveScreen )->m_Active_Layer; int layer = ( (PCB_SCREEN*) ActiveScreen )->m_Active_Layer;
wxPoint ref = ActiveScreen->RefPos( true ); wxPoint ref = ActiveScreen->RefPos( true );
TRACK* found = NULL; TRACK* found = NULL;
for( TRACK* track = start; track; track = track->Next() ) for( TRACK* track = listStart; track; track = track->Next() )
{ {
if( track->Type() == TYPE_TRACK ) // skip vias if( track->Type() == TYPE_TRACK ) // skip vias
{ {
...@@ -571,7 +573,7 @@ TRACK* LocateIntrusion( TRACK* start, int net, int width ) ...@@ -571,7 +573,7 @@ TRACK* LocateIntrusion( TRACK* start, int net, int width )
continue; continue;
/* TRACK::HitTest */ /* TRACK::HitTest */
int dist = width / 2 + track->m_Width / 2 + g_DesignSettings.m_TrackClearence; int dist = (width + track->m_Width) / 2 + aTrack->GetClearance( track );
wxPoint pos = ref - track->m_Start; wxPoint pos = ref - track->m_Start;
wxPoint vec = track->m_End - track->m_Start; wxPoint vec = track->m_End - track->m_Start;
...@@ -619,7 +621,7 @@ static void PushTrack( WinEDA_DrawPanel* panel ) ...@@ -619,7 +621,7 @@ static void PushTrack( WinEDA_DrawPanel* panel )
int dist; int dist;
double f; double f;
other = LocateIntrusion( pcb->m_Track, track->GetNet(), track->m_Width ); other = LocateIntrusion( pcb->m_Track, track );
/* are we currently pointing into a conflicting trace ? */ /* are we currently pointing into a conflicting trace ? */
if( !other ) if( !other )
...@@ -637,8 +639,7 @@ static void PushTrack( WinEDA_DrawPanel* panel ) ...@@ -637,8 +639,7 @@ static void PushTrack( WinEDA_DrawPanel* panel )
if( !det ) if( !det )
return; return;
dist = (track->m_Width + 1) / 2 + (other->m_Width + 1) / 2 + dist = (track->m_Width + 1) / 2 + (other->m_Width + 1) / 2 + track->GetClearance( other ) + 2;
g_DesignSettings.m_TrackClearence + 2;
/* /*
* DRC wants >, so +1. * DRC wants >, so +1.
...@@ -683,6 +684,8 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ...@@ -683,6 +684,8 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase
DisplayOpt.DisplayPcbTrackFill = true; DisplayOpt.DisplayPcbTrackFill = true;
int showTrackClearanceMode = DisplayOpt.ShowTrackClearanceMode; int showTrackClearanceMode = DisplayOpt.ShowTrackClearanceMode;
NETCLASS* netclass = g_FirstTrackSegment->GetNetClass();
if( showTrackClearanceMode != DO_NOT_SHOW_CLEARANCE ) if( showTrackClearanceMode != DO_NOT_SHOW_CLEARANCE )
DisplayOpt.ShowTrackClearanceMode = SHOW_CLEARANCE_ALWAYS; DisplayOpt.ShowTrackClearanceMode = SHOW_CLEARANCE_ALWAYS;
...@@ -690,13 +693,16 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ...@@ -690,13 +693,16 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase
if( erase ) if( erase )
{ {
Trace_Une_Piste( panel, DC, g_FirstTrackSegment, g_CurrentTrackList.GetCount(), GR_XOR ); Trace_Une_Piste( panel, DC, g_FirstTrackSegment, g_CurrentTrackList.GetCount(), GR_XOR );
( (WinEDA_BasePcbFrame*)(panel->m_Parent) )->trace_ratsnest_pad( DC ); ( (WinEDA_BasePcbFrame*)(panel->m_Parent) )->trace_ratsnest_pad( DC );
if( showTrackClearanceMode >= SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS ) // Show the via area if( showTrackClearanceMode >= SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS ) // Show the via area
{ {
int color = g_DesignSettings.m_LayerColor[g_CurrentTrackSegment->GetLayer()]; int color = g_DesignSettings.m_LayerColor[g_CurrentTrackSegment->GetLayer()];
GRCircle( &panel->m_ClipBox, DC, g_CurrentTrackSegment->m_End.x, GRCircle( &panel->m_ClipBox, DC, g_CurrentTrackSegment->m_End.x,
g_CurrentTrackSegment->m_End.y, g_CurrentTrackSegment->m_End.y,
(g_DesignSettings.m_CurrentViaSize / 2) + g_DesignSettings.m_TrackClearence, (netclass->GetViaDiameter() / 2) + netclass->GetClearance(),
color ); color );
} }
} }
...@@ -708,7 +714,7 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ...@@ -708,7 +714,7 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase
/* dessin de la nouvelle piste : mise a jour du point d'arrivee */ /* dessin de la nouvelle piste : mise a jour du point d'arrivee */
g_CurrentTrackSegment->SetLayer( screen->m_Active_Layer ); g_CurrentTrackSegment->SetLayer( screen->m_Active_Layer );
if( !g_DesignSettings.m_UseConnectedTrackWidth ) if( !g_DesignSettings.m_UseConnectedTrackWidth )
g_CurrentTrackSegment->m_Width = g_DesignSettings.m_CurrentTrackWidth; g_CurrentTrackSegment->m_Width = netclass->GetTrackWidth();
if( g_TwoSegmentTrackBuild ) if( g_TwoSegmentTrackBuild )
{ {
...@@ -716,8 +722,9 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ...@@ -716,8 +722,9 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase
if( previous_track && previous_track->Type()==TYPE_TRACK ) if( previous_track && previous_track->Type()==TYPE_TRACK )
{ {
previous_track->SetLayer( screen->m_Active_Layer ); previous_track->SetLayer( screen->m_Active_Layer );
if( !g_DesignSettings.m_UseConnectedTrackWidth ) if( !g_DesignSettings.m_UseConnectedTrackWidth )
previous_track->m_Width = g_DesignSettings.m_CurrentTrackWidth; previous_track->m_Width = netclass->GetTrackWidth();
} }
} }
...@@ -751,12 +758,14 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase ...@@ -751,12 +758,14 @@ void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, wxDC* DC, bool erase
D( g_CurrentTrackList.VerifyListIntegrity(); ); D( g_CurrentTrackList.VerifyListIntegrity(); );
Trace_Une_Piste( panel, DC, g_FirstTrackSegment, g_CurrentTrackList.GetCount(), GR_XOR ); Trace_Une_Piste( panel, DC, g_FirstTrackSegment, g_CurrentTrackList.GetCount(), GR_XOR );
if( showTrackClearanceMode >= SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS ) // Show the via area if( showTrackClearanceMode >= SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS ) // Show the via area
{ {
int color = g_DesignSettings.m_LayerColor[g_CurrentTrackSegment->GetLayer()]; int color = g_DesignSettings.m_LayerColor[g_CurrentTrackSegment->GetLayer()];
GRCircle( &panel->m_ClipBox, DC, g_CurrentTrackSegment->m_End.x, GRCircle( &panel->m_ClipBox, DC, g_CurrentTrackSegment->m_End.x,
g_CurrentTrackSegment->m_End.y, g_CurrentTrackSegment->m_End.y,
(g_DesignSettings.m_CurrentViaSize / 2) + g_DesignSettings.m_TrackClearence, (netclass->GetViaDiameter() / 2) + netclass->GetClearance(),
color ); color );
} }
......
...@@ -180,11 +180,11 @@ bool WinEDA_PcbFrame::Clear_Pcb( bool aQuery ) ...@@ -180,11 +180,11 @@ bool WinEDA_PcbFrame::Clear_Pcb( bool aQuery )
{ {
g_DesignSettings.m_ViaSizeHistory[ii] = g_DesignSettings.m_ViaSizeHistory[ii] =
g_DesignSettings.m_TrackWidthHistory[ii] = 0; g_DesignSettings.m_TrackWidthHistory[ii] = 0;
g_DesignSettings.m_TrackClearenceHistory[ii] = 0; g_DesignSettings.m_TrackClearanceHistory[ii] = 0;
} }
g_DesignSettings.m_TrackWidthHistory[0] = g_DesignSettings.m_CurrentTrackWidth; g_DesignSettings.m_TrackWidthHistory[0] = g_DesignSettings.m_CurrentTrackWidth;
g_DesignSettings.m_TrackClearenceHistory[0] = g_DesignSettings.m_TrackClearence; g_DesignSettings.m_TrackClearanceHistory[0] = g_DesignSettings.m_TrackClearance;
g_DesignSettings.m_ViaSizeHistory[0] = g_DesignSettings.m_CurrentViaSize; g_DesignSettings.m_ViaSizeHistory[0] = g_DesignSettings.m_CurrentViaSize;
g_DesignSettings.m_CopperLayerCount = 2; // Default copper layers count set to 2: double layer board g_DesignSettings.m_CopperLayerCount = 2; // Default copper layers count set to 2: double layer board
......
This diff is collapsed.
...@@ -178,15 +178,15 @@ bool Read_Config( const wxString& projectFileName ) ...@@ -178,15 +178,15 @@ bool Read_Config( const wxString& projectFileName )
/* User library path takes precedent over default library search paths. */ /* User library path takes precedent over default library search paths. */
wxGetApp().InsertLibraryPath( g_UserLibDirBuffer, 1 ); wxGetApp().InsertLibraryPath( g_UserLibDirBuffer, 1 );
/* Some parameters must be reinitialize after loading a new board or config: */ // Some parameters must be reinitialized after loading a new board or config
g_DesignSettings.m_TrackWidthHistory[0] = g_DesignSettings.m_CurrentTrackWidth; g_DesignSettings.m_TrackWidthHistory[0] = g_DesignSettings.m_CurrentTrackWidth;
g_DesignSettings.m_TrackClearenceHistory[0] = g_DesignSettings.m_TrackClearence; g_DesignSettings.m_TrackClearanceHistory[0] = g_DesignSettings.m_TrackClearance;
g_DesignSettings.m_ViaSizeHistory[0] = g_DesignSettings.m_CurrentViaSize; g_DesignSettings.m_ViaSizeHistory[0] = g_DesignSettings.m_CurrentViaSize;
for( ii = 1; ii < HISTORY_NUMBER; ii++ ) for( ii = 1; ii < HISTORY_NUMBER; ii++ )
{ {
g_DesignSettings.m_TrackWidthHistory[ii] = 0; g_DesignSettings.m_TrackWidthHistory[ii] = 0;
g_DesignSettings.m_TrackClearenceHistory[ii] = 0; g_DesignSettings.m_TrackClearanceHistory[ii] = 0;
g_DesignSettings.m_ViaSizeHistory[ii] = 0; g_DesignSettings.m_ViaSizeHistory[ii] = 0;
} }
......
...@@ -126,7 +126,7 @@ static PARAM_CFG_INT ShowNetNamesModeCfg ...@@ -126,7 +126,7 @@ static PARAM_CFG_INT ShowNetNamesModeCfg
static PARAM_CFG_INT TrackClearenceCfg static PARAM_CFG_INT TrackClearenceCfg
( (
wxT( "Isol" ), /* Keyword */ wxT( "Isol" ), /* Keyword */
&g_DesignSettings.m_TrackClearence, /* Parameter address */ &g_DesignSettings.m_TrackClearance, /* Parameter address */
120, /* Default value */ 120, /* Default value */
0, 0xFFFF /* Min and max values*/ 0, 0xFFFF /* Min and max values*/
); );
......
...@@ -533,10 +533,10 @@ void WinEDA_PcbFrame::SetToolbars() ...@@ -533,10 +533,10 @@ void WinEDA_PcbFrame::SetToolbars()
for( ii = 0; ii < HISTORY_NUMBER; ii++ ) for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{ {
if( g_DesignSettings.m_TrackClearenceHistory[ii] == 0 ) if( g_DesignSettings.m_TrackClearanceHistory[ii] == 0 )
break; // Fin de liste break; // Fin de liste
double value = To_User_Unit( g_UnitMetric, double value = To_User_Unit( g_UnitMetric,
g_DesignSettings.m_TrackClearenceHistory[ii], g_DesignSettings.m_TrackClearanceHistory[ii],
PCB_INTERNAL_UNIT ); PCB_INTERNAL_UNIT );
if( g_UnitMetric == INCHES ) if( g_UnitMetric == INCHES )
...@@ -546,8 +546,8 @@ void WinEDA_PcbFrame::SetToolbars() ...@@ -546,8 +546,8 @@ void WinEDA_PcbFrame::SetToolbars()
m_SelClrWidthBox->Append( msg ); m_SelClrWidthBox->Append( msg );
if( g_DesignSettings.m_TrackClearenceHistory[ii] == if( g_DesignSettings.m_TrackClearanceHistory[ii] ==
g_DesignSettings.m_TrackClearence ) g_DesignSettings.m_TrackClearance )
m_SelClrWidthBox->SetSelection( ii ); m_SelClrWidthBox->SetSelection( ii );
} }
} }
......
...@@ -248,7 +248,7 @@ MODULE* Load_Module_From_Library( WinEDA_DrawFrame* frame, wxDC* DC ); ...@@ -248,7 +248,7 @@ MODULE* Load_Module_From_Library( WinEDA_DrawFrame* frame, wxDC* DC );
/* EDITRACK.C : */ /* EDITRACK.C : */
/****************/ /****************/
TRACK* LocateIntrusion( TRACK* start, int net, int width ); TRACK* LocateIntrusion( TRACK* listStart, TRACK* aTrack );
void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel, void ShowNewTrackWhenMovingCursor( WinEDA_DrawPanel* panel,
wxDC* DC, bool erase ); wxDC* DC, bool erase );
......
...@@ -99,9 +99,9 @@ void WinEDA_PcbFrame::GlobalRoute( wxDC* DC ) ...@@ -99,9 +99,9 @@ void WinEDA_PcbFrame::GlobalRoute( wxDC* DC )
fprintf( outfile, " %d", g_GridRoutingSize / PSCALE ); fprintf( outfile, " %d", g_GridRoutingSize / PSCALE );
fprintf( outfile, " %d %d %d", /* isolation Pad, track, via */ fprintf( outfile, " %d %d %d", /* isolation Pad, track, via */
g_DesignSettings.m_TrackClearence / PSCALE, g_DesignSettings.m_TrackClearance / PSCALE,
g_DesignSettings.m_TrackClearence / PSCALE, g_DesignSettings.m_TrackClearance / PSCALE,
g_DesignSettings.m_TrackClearence / PSCALE ); g_DesignSettings.m_TrackClearance / PSCALE );
fprintf( outfile, " 0" ); /* via type */ fprintf( outfile, " 0" ); /* via type */
......
...@@ -355,8 +355,8 @@ static int Autoroute_One_Track( WinEDA_PcbFrame* pcbframe, wxDC* DC, ...@@ -355,8 +355,8 @@ static int Autoroute_One_Track( WinEDA_PcbFrame* pcbframe, wxDC* DC,
result = NOSUCCESS; result = NOSUCCESS;
marge = g_DesignSettings.m_TrackClearence + (g_DesignSettings.m_CurrentTrackWidth / 2); marge = g_DesignSettings.m_TrackClearance + (g_DesignSettings.m_CurrentTrackWidth / 2);
via_marge = g_DesignSettings.m_TrackClearence + (g_DesignSettings.m_CurrentViaSize / 2); via_marge = g_DesignSettings.m_TrackClearance + (g_DesignSettings.m_CurrentViaSize / 2);
/* clear direction flags */ /* clear direction flags */
i = Nrows * Ncols * sizeof(char); i = Nrows * Ncols * sizeof(char);
...@@ -1048,8 +1048,8 @@ static void Place_Piste_en_Buffer( WinEDA_PcbFrame* pcbframe, wxDC* DC ) ...@@ -1048,8 +1048,8 @@ static void Place_Piste_en_Buffer( WinEDA_PcbFrame* pcbframe, wxDC* DC )
int marge, via_marge; int marge, via_marge;
WinEDA_DrawPanel* panel = pcbframe->DrawPanel; WinEDA_DrawPanel* panel = pcbframe->DrawPanel;
marge = g_DesignSettings.m_TrackClearence + (g_DesignSettings.m_CurrentTrackWidth / 2); marge = g_DesignSettings.m_TrackClearance + (g_DesignSettings.m_CurrentTrackWidth / 2);
via_marge = g_DesignSettings.m_TrackClearence + (g_DesignSettings.m_CurrentViaSize / 2); via_marge = g_DesignSettings.m_TrackClearance + (g_DesignSettings.m_CurrentViaSize / 2);
/* tst point d'arrivee : doit etre sur pad start */ /* tst point d'arrivee : doit etre sur pad start */
......
...@@ -3924,6 +3924,15 @@ class SPECCTRA_DB : public OUTPUTFORMATTER ...@@ -3924,6 +3924,15 @@ class SPECCTRA_DB : public OUTPUTFORMATTER
nets.clear(); nets.clear();
} }
/**
* Function exportNETCLASS
* exports \a aNetClass to the DSN file.
*/
void exportNETCLASS( NETCLASS* aNetClass );
//-----</FromBOARD>------------------------------------------------------ //-----</FromBOARD>------------------------------------------------------
//-----<FromSESSION>----------------------------------------------------- //-----<FromSESSION>-----------------------------------------------------
......
This diff is collapsed.
...@@ -186,7 +186,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) ...@@ -186,7 +186,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
CopyPolygonsFromFilledPolysListToBoolengine( booleng, GROUP_A ); CopyPolygonsFromFilledPolysListToBoolengine( booleng, GROUP_A );
// Calculates the clearance value that meet DRC requirements // Calculates the clearance value that meet DRC requirements
int clearance = max( m_ZoneClearance, g_DesignSettings.m_TrackClearence ); int clearance = max( m_ZoneClearance, g_DesignSettings.m_TrackClearance );
clearance += m_ZoneMinThickness / 2; clearance += m_ZoneMinThickness / 2;
...@@ -260,7 +260,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) ...@@ -260,7 +260,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
} }
// Draw graphic items (copper texts) and board edges // Draw graphic items (copper texts) and board edges
// zone clearance is used here regardless of the g_DesignSettings.m_TrackClearence value // zone clearance is used here regardless of the g_DesignSettings.m_TrackClearance value
for( BOARD_ITEM* item = aPcb->m_Drawings; item; item = item->Next() ) for( BOARD_ITEM* item = aPcb->m_Drawings; item; item = item->Next() )
{ {
if( item->GetLayer() != GetLayer() && item->GetLayer() != EDGE_N ) if( item->GetLayer() != GetLayer() && item->GetLayer() != EDGE_N )
...@@ -288,7 +288,6 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) ...@@ -288,7 +288,6 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
break; break;
default: default:
AddRoundedEndsSegmentPolygon( booleng, AddRoundedEndsSegmentPolygon( booleng,
( (DRAWSEGMENT*) item )->m_Start, ( (DRAWSEGMENT*) item )->m_Start,
( (DRAWSEGMENT*) item )->m_End, ( (DRAWSEGMENT*) item )->m_End,
...@@ -297,7 +296,6 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) ...@@ -297,7 +296,6 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
have_poly_to_substract = true; have_poly_to_substract = true;
break; break;
} }
break; break;
case TYPE_TEXTE: case TYPE_TEXTE:
......
...@@ -952,16 +952,19 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E ...@@ -952,16 +952,19 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E
} }
int bstyle = Area_To_Test->m_Poly->GetSideStyle( ic2 ); int bstyle = Area_To_Test->m_Poly->GetSideStyle( ic2 );
int x, y; int x, y;
int d = GetClearanceBetweenSegments( int d = GetClearanceBetweenSegments(
bx1, by1, bx2, by2, bstyle, bx1, by1, bx2, by2, bstyle,
0, 0,
ax1, ay1, ax2, ax1, ay1, ax2,
ay2, astyle, ay2, astyle,
0, 0,
g_DesignSettings.
m_TrackClearence, // @todo: decide what to use here.
g_DesignSettings.m_TrackClearance,
&x, &y ); &x, &y );
if( d < g_DesignSettings.m_TrackClearence )
if( d < g_DesignSettings.m_TrackClearance )
{ {
// COPPERAREA_COPPERAREA error : intersect or too close // COPPERAREA_COPPERAREA error : intersect or too close
if( aCreate_Markers ) if( aCreate_Markers )
......
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