7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-18 21:29:17 +00:00

NETCLASS work, see CHANGELOG.txt

This commit is contained in:
dickelbeck 2009-09-10 15:22:26 +00:00
parent 8682a9fa0a
commit 362b6b53f6
48 changed files with 5101 additions and 4864 deletions

View File

@ -4,6 +4,20 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with
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>
================================================================================
++pcbnew
@ -12,6 +26,7 @@ email address.
The Kbool's author, Klaas Holveda, is still working on these problems
Thanks to Klaas
2009-aug-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++pcbnew

File diff suppressed because it is too large Load Diff

View File

@ -267,15 +267,20 @@ public:
/**
* 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
* returns the NETCLASS for this item.
*/
virtual NETCLASS* GetNetClass() const;
NETCLASS* GetNetClass() const;
};

View File

@ -25,6 +25,9 @@
#ifndef _CLASS_DRC_ITEM_H
#define _CLASS_DRC_ITEM_H
#include "macros.h"
/**
* Class DRC_ITEM
* is a holder for a DRC (in Pcbnew) or ERC (in Eeschema) error item.
@ -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_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_noCoordinate;
public:
@ -54,9 +57,9 @@ public:
{
m_ErrorCode = 0;
m_hasSecondItem = false;
m_noCoordinate = false;
}
DRC_ITEM( int aErrorCode,
const wxString& aMainText, const wxString& bAuxiliaryText,
const wxPoint& aMainPos, const wxPoint& bAuxiliaryPos )
@ -66,7 +69,6 @@ public:
aMainPos, bAuxiliaryPos );
}
DRC_ITEM( int aErrorCode,
const wxString& aText, const wxPoint& aPos )
{
@ -124,11 +126,14 @@ public:
bool HasSecondItem() const { return m_hasSecondItem; }
void SetShowNoCoordinate() { m_noCoordinate = true; }
/** acces to A and B texts
*/
wxString GetMainText() const { return m_MainText; }
wxString GetAuxiliaryText() const { return m_AuxiliaryText; }
/**
* Function ShowHtml
* translates this object into a fragment of HTML suitable for the
@ -139,22 +144,30 @@ public:
{
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
// to add color if you want:
ret.Printf( _( "ErrType(%d): <b>%s</b><ul><li> %s: %s </li><li> %s: %s </li></ul>" ),
m_ErrorCode,
GetErrorText().GetData(),
ShowCoord( m_MainPosition ).GetData(), m_MainText.GetData(),
ShowCoord( m_AuxiliaryPosition ).GetData(), m_AuxiliaryText.GetData() );
GetChars( GetErrorText() ),
GetChars( ShowCoord( m_MainPosition )), GetChars( m_MainText ),
GetChars( ShowCoord( m_AuxiliaryPosition )), GetChars( m_AuxiliaryText ) );
}
else
{
ret.Printf( _( "ErrType(%d): <b>%s</b><ul><li> %s: %s </li></ul>" ),
m_ErrorCode,
GetErrorText().GetData(),
ShowCoord( m_MainPosition ).GetData(), m_MainText.GetData() );
GetChars( GetErrorText() ),
GetChars( ShowCoord( m_MainPosition ) ), GetChars( m_MainText ) );
}
return ret;

View File

@ -135,7 +135,8 @@ public:
const wxString& aText, const wxPoint& aPos );
/** Function SetAuxiliaryData
/**
* Function SetAuxiliaryData
* initialize data for the second (auxiliary) item
* @param aAuxiliaryText = the second text (main text) concerning the second schematic or board item
* @param aAuxiliaryPos = position the second item
@ -145,6 +146,10 @@ public:
m_drc.SetAuxiliaryData( aAuxiliaryText, aAuxiliaryPos );
}
void SetShowNoCoordinate()
{
m_drc.SetShowNoCoordinate();
}
/**
* Function GetReporter

View File

@ -155,13 +155,13 @@ public:
int m_EdgeSegmentWidth; // current graphic line width (EDGE layer only)
int m_PcbTextWidth; // current Pcb (not module) Text width
wxSize m_PcbTextSize; // current Pcb (not module) Text size
int m_TrackClearence; // track to track and track to pads clearance
int m_TrackClearenceHistory[HISTORY_NUMBER]; // Last HISTORY_NUMBER used track widths
int m_TrackClearance; // track to track and track to pads clearance
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_ViasMinSize; // vias (not micro vias) min diameter
int m_MicroViasMinSize; // micro vias (not vias) min diameter
int m_MaskMargin; // Solder mask margin
int m_LayerThickness; // Layer Thickness for 3D viewer
int m_LayerThickness; // Layer Thickness for 3D viewer
// Color options for screen display of the Printed Board:
int m_PcbGridColor; // Grid color

View File

@ -543,8 +543,11 @@ void WinEDA_PcbFrame::GenModuleOnBoard( MODULE* Module )
TraceFilledRectangle( GetBoard(), ox, oy, fx, fy, masque_layer,
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 */
marge = g_DesignSettings.m_TrackClearence + g_DesignSettings.m_CurrentTrackWidth;
marge = trackWidth + clearance;
for( Pad = Module->m_Pads; Pad != NULL; Pad = Pad->Next() )
{

View File

@ -178,12 +178,19 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag )
* si FORCE_PADS : tous les pads seront places meme ceux de meme net_code
*/
{
int ux0 = 0, uy0 = 0, ux1, uy1, dx, dy;
int marge, via_marge;
int masque_layer;
int ux0 = 0, uy0 = 0, ux1, uy1, dx, dy;
int marge, via_marge;
int masque_layer;
marge = g_DesignSettings.m_TrackClearence + (g_DesignSettings.m_CurrentTrackWidth / 2);
via_marge = g_DesignSettings.m_TrackClearence + (g_DesignSettings.m_CurrentViaSize / 2);
// use the default NETCLASS?
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 //
@ -275,14 +282,14 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag )
break;
case TYPE_TEXTE:
{
{
TEXTE_PCB* PtText;
PtText = (TEXTE_PCB*) item;
if( PtText->GetLength() == 0 )
break;
EDA_Rect textbox = PtText->GetTextBox(-1);
EDA_Rect textbox = PtText->GetTextBox(-1);
ux0 = textbox.GetX(); uy0 = textbox.GetY();
dx = textbox.GetWidth();
dy = textbox.GetHeight();
@ -307,7 +314,7 @@ void PlaceCells( BOARD* aPcb, int net_code, int flag )
ux1 + via_marge, uy1 + via_marge,
(int) (PtText->m_Orient),
masque_layer, VIA_IMPOSSIBLE, WRITE_OR_CELL );
}
}
break;
default:

View File

@ -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_NetInfo = new NETINFO_LIST( this ); // handle nets info list (name, design constraints ..
for( int layer = 0; layer<NB_COPPER_LAYERS; ++layer )
{
m_Layer[layer].m_Name = ReturnPcbLayerName( layer, true );
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
// the first valid netcode is 1 and the last is m_NetInfo->GetCount()-1.
// zero is reserved for "no connection" and is not used.
// 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 ( 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
return item;
return net;
}

View File

@ -99,7 +99,7 @@ public:
NETCLASSES m_NetClasses; ///< List of current netclasses. There is always the default netclass
ZONE_CONTAINER* m_CurrentZoneContour; // zone contour currently in progress
ZONE_CONTAINER* m_CurrentZoneContour; // zone contour currently in progress
BOARD( EDA_BaseStruct* aParent, WinEDA_BasePcbFrame* frame );
~BOARD();
@ -348,6 +348,7 @@ public:
*/
void SynchronizeNetsAndNetClasses();
/**
* Function Save
* writes the data structures for this object out to a FILE in "*.brd" format.

View File

@ -72,22 +72,29 @@ void BOARD_CONNECTED_ITEM::SetZoneSubNet( int aSubNetCode )
int BOARD_CONNECTED_ITEM::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const
{
NETCLASS* hisclass = aItem->GetNetClass();
NETCLASS* myclass = GetNetClass();
wxASSERT( hisclass );
wxASSERT( myclass );
if( myclass )
{
if( hisclass )
return MAX( hisclass->GetClearance(), myclass->GetClearance() );
else
return myclass->GetClearance();
}
else if( hisclass )
{
return hisclass->GetClearance();
// @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 )
{
int hisClearance = hisclass->GetClearance();
int myClearance = myclass->GetClearance();
return max( hisClearance, myClearance );
}
}
return myclass->GetClearance();
}
return 0;

View File

@ -84,6 +84,19 @@ wxString DRC_ITEM::GetErrorText() const
case DRCE_TOO_SMALL_MICROVIA:
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:
return wxString( wxT("PROGRAM BUG, PLEASE LEAVE THE ROOM.") );

View File

@ -28,7 +28,8 @@ public:
MARKER_PCB( int aErrorCode, const wxPoint& aMarkerPos,
const wxString& aText, const wxPoint& aPos,
const wxString& bText, const wxPoint& bPos );
/**
/**
* Constructor
* @param aErrorCode The categorizing identifier for an error
* @param aMarkerPos The position of the MARKER_PCB on the BOARD
@ -38,7 +39,6 @@ public:
MARKER_PCB( int aErrorCode, const wxPoint& aMarkerPos,
const wxString& aText, const wxPoint& aPos );
~MARKER_PCB();
/**

View File

@ -782,7 +782,7 @@ EDA_Rect MODULE::GetBoundingBox()
// 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)
area.Inflate(g_DesignSettings.m_TrackClearence, g_DesignSettings.m_TrackClearence);
area.Inflate(g_DesignSettings.m_TrackClearance, g_DesignSettings.m_TrackClearance);
return area;
}

View File

@ -31,25 +31,42 @@
#include "pcbnew.h"
// "kicad_default" is what we are using in the specctra_export.
const wxString NETCLASS::Default = wxT("kicad_default");
// This will get mapped to "kicad_default" in the specctra_export.
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_Name( aName )
{
m_TrackWidth = 160;
// use initialParameters if not NULL, else set the initial
// parameters from g_DesignSettings
SetParams( initialParameters );
}
m_TrackMinWidth = 40;
m_ViaSize = 350;
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;
m_ViaMinSize = 220;
m_ViaDrillSize = 200;
m_Clearance = 140;
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()
}
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 )
{
// 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;
}
// Test for an existing netclass:
if( !Find( name ) )
{
// insert since name not found, invoke copy constructor.
m_NetClasses[name] = new NETCLASS( aNetClass );
// name not found, take ownership
m_NetClasses[name] = aNetClass;
return true;
}
return false; // name already exists
else
{
// 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
{
bool result = true;
fprintf( aFile, "$NETCLASS\n" );
fprintf( aFile, "$" BRD_NETCLASS "\n" );
fprintf( aFile, "Name \"%s\"\n", CONV_TO_UTF8( m_Name ) );
fprintf( aFile, "Desc \"%s\"\n", CONV_TO_UTF8( GetDescription() ) );
// 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, "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:
for( const_iterator i = begin(); i!=end(); ++i )
fprintf( aFile, "AddNet \"%s\"\n", CONV_TO_UTF8( *i ) );
fprintf( aFile, "$EndNETCLASS\n" );
fprintf( aFile, "$End" BRD_NETCLASS "\n" );
return result;
}
@ -311,43 +337,44 @@ bool NETCLASS::ReadDescr( FILE* aFile, int* aLineNum )
continue;
}
if( strnicmp( Line, "$endNETCLASS", 6 ) == 0 )
if( strnicmp( Line, "$end" BRD_NETCLASS, sizeof( "$end" BRD_NETCLASS)-1) == 0 )
{
result = true;
break;
}
if( strnicmp( Line, "TrackWidth", 10 ) == 0 )
{
SetTrackWidth( atoi( Line + 10 ) );
continue;
}
if( strnicmp( Line, "ViaSize", 7 ) == 0 )
{
SetViaSize( atoi( Line + 7 ) );
continue;
}
if( strnicmp( Line, "ViaDrillSize", 12 ) == 0 )
{
SetViaDrillSize( atoi( Line + 12 ) );
continue;
}
if( strnicmp( Line, "Clearance", 9 ) == 0 )
{
SetClearance( atoi( Line + 9 ) );
continue;
}
if( strnicmp( Line, "TrackMinWidth", 13 ) == 0 )
if( strnicmp( Line, "TrackWidth", 10 ) == 0 )
{
SetTrackMinWidth( atoi( Line + 13 ) );
SetTrackWidth( atoi( Line + 10 ) );
continue;
}
if( strnicmp( Line, "ViaMinSize", 10 ) == 0 )
if( strnicmp( Line, "ViaDia", 6 ) == 0 )
{
SetViaMinSize( atoi( Line + 10 ) );
SetViaDiameter( atoi( Line + 6 ) );
continue;
}
if( strnicmp( Line, "ViaDrill", 8 ) == 0 )
{
SetViaDrill( atoi( Line + 8 ) );
continue;
}
if( strnicmp( Line, "uViaDia", 7 ) == 0 )
{
SetuViaDiameter( atoi( Line + 7 ) );
continue;
}
if( strnicmp( Line, "uViaDrill", 9 ) == 0 )
{
SetuViaDrill( atoi( Line + 9 ) );
continue;
}
if( strnicmp( Line, "Name", 4 ) == 0 )
{
ReadDelimitedText( Buffer, Line + 4, sizeof(Buffer) );

View File

@ -49,20 +49,38 @@ protected:
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_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:
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();
wxString GetClass() const
@ -134,24 +152,33 @@ public:
const wxString& GetDescription() const { return m_Description; }
void SetDescription( const wxString& aDesc ) { m_Description = aDesc; }
int GetTrackWidth() const { return m_TrackWidth; }
void SetTrackWidth( int aWidth ) { m_TrackWidth = aWidth; }
int GetTrackMinWidth() const { return m_TrackMinWidth; }
void SetTrackMinWidth( int aWidth ) { m_TrackMinWidth = aWidth; }
int GetViaSize() const { return m_ViaSize; }
void SetViaSize( int aSize ) { m_ViaSize = aSize; }
int GetViaDrillSize() const { return m_ViaDrillSize; }
void SetViaDrillSize( int aSize ) { m_ViaDrillSize = aSize; }
int GetViaMinSize() const { return m_ViaMinSize; }
void SetViaMinSize( int aSize ) { m_ViaMinSize = aSize; }
int GetClearance() const { return m_Clearance; }
void SetClearance( int aClearance ) { m_Clearance = aClearance; }
int GetTrackWidth() const { return m_TrackWidth; }
void SetTrackWidth( int aWidth ) { m_TrackWidth = aWidth; }
int GetViaDiameter() const { return m_ViaDia; }
void SetViaDiameter( int aDia ) { m_ViaDia = aDia; }
int GetViaDrill() const { return m_ViaDrill; }
void SetViaDrill( int aSize ) { m_ViaDrill = aSize; }
int GetuViaDiameter() const { return m_uViaDia; }
void SetuViaDiameter( int aSize ) { m_uViaDia = aSize; }
int GetuViaDrill() const { return m_uViaDrill; }
void SetuViaDrill( int aSize ) { m_uViaDrill = aSize; }
/**
* 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
@ -236,14 +263,14 @@ public:
return (NETCLASS*) &m_Default;
}
/**
* Function Add
* takes ownership of \a aNetclass and puts it into this NETCLASSES container.
* @param aNetclass is netclass to add
* @return true if Ok, false if cannot be added (mainly because a
* netclass with the same name exists)
* @return true if the name within aNetclass is unique and it could be inserted OK,
* else false because the name was not unique and caller still owns aNetclass.
*/
bool Add( const NETCLASS& aNetclass );
bool Add( NETCLASS* aNetclass );
/**
* Function Remove

View File

@ -208,7 +208,7 @@ public:
return m_NetClassName;
}
#if 0
/**
* Function GetTrackWidth
* returns the width of tracks used to route this net.
@ -221,10 +221,10 @@ public:
/**
* Function GetTrackMinWidth
* Function GetTrackWidth
* returns the Minimum value for tracks thickness (used in DRC)
*/
int GetTrackMinWidth()
int GetTrackWidth()
{
wxASSERT( m_NetClass );
return m_NetClass->GetTrackMinWidth();
@ -273,7 +273,7 @@ public:
wxASSERT( m_NetClass );
return m_NetClass->GetClearance();
}
#endif
/* Reading and writing data on files */
int ReadDescr( FILE* File, int* LineNum );

View File

@ -11,7 +11,6 @@ class Pcb3D_GLCanvas;
class D_PAD : public BOARD_CONNECTED_ITEM
{
private:
int m_NetCode; // Net number for fast comparisons
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

View File

@ -207,6 +207,8 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
SetAlpha(&color, 170);
int padClearance = GetClearance();
switch( GetShape() )
{
case PAD_CIRCLE:
@ -221,7 +223,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
DC,
xc,
yc,
dx + g_DesignSettings.m_TrackClearence,
dx + padClearance,
0,
color );
}
@ -259,7 +261,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
/* Trace de la marge d'isolement */
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,
ux0 - delta_cx, uy0 - delta_cy,
@ -297,8 +299,8 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
if( DisplayIsol )
{
dx += g_DesignSettings.m_TrackClearence;
dy += g_DesignSettings.m_TrackClearence;
dx += padClearance;
dy += padClearance;
coord[0].x = -dx - ddy;
coord[0].y = dy + ddx;
@ -481,7 +483,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
if( screen->Scale( tsize ) >= CHAR_SIZE_MIN ) // Not drawable in size too small.
{
if( !(!IsOnLayer( screen->m_Active_Layer )&& DisplayOpt.ContrastModeDisplay)){
if( !(!IsOnLayer( screen->m_Active_Layer )&& DisplayOpt.ContrastModeDisplay)){
tpos = tpos0;
if ( display_padnum )
@ -492,7 +494,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
DrawGraphicText( panel, DC, tpos,
WHITE, m_ShortNetname, t_angle, wxSize( tsize, tsize ),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7,
false, false );
}
false, false );
}
}
}

View File

@ -257,7 +257,7 @@ EDA_Rect TRACK::GetBoundingBox()
if( ShowClearance( this ) )
{
// + 1 is for the clearance line itself.
radius += g_DesignSettings.m_TrackClearence + 1;
radius += GetClearance() + 1;
}
ymax += radius;
@ -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,
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.
@ -712,14 +712,14 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
angle = 900; // angle is in 0.1 degree
if( panel->GetScreen()->Scale( tsize ) >= 6 )
{
if( !(!IsOnLayer( curr_layer )&& DisplayOpt.ContrastModeDisplay)){
if( !(!IsOnLayer( curr_layer )&& DisplayOpt.ContrastModeDisplay)){
tsize = (tsize * 8) / 10; // small reduction to give a better look
DrawGraphicText( panel, DC, tpos,
WHITE, net->GetShortNetname(), angle, wxSize( tsize, tsize ),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7,
false, false );
}
false, false );
}
}
}
}
@ -794,7 +794,7 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
if( DisplayOpt.ShowTrackClearanceMode == SHOW_CLEARANCE_ALWAYS )
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 :
// X on component layer, or + on copper layer
@ -871,7 +871,7 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
DrawGraphicText( panel, DC, m_Start,
WHITE, net->GetShortNetname(), 0, wxSize( tsize, tsize ),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, tsize / 7,
false, false);
false, false);
}
}
}

View File

@ -206,7 +206,7 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{
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
}
@ -214,7 +214,7 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
m_EdgeSegmentWidth = 100; // current graphic line width (EDGE layer only)
m_PcbTextWidth = 100; // current Pcb (not module) Text width
m_PcbTextSize = wxSize( 500, 500 ); // current Pcb (not module) Text size
m_TrackClearence = 100; // track to track and track to pads clearance
m_TrackClearance = 100; // track to track and track to pads clearance
m_TrackMinWidth = 80; // track min value for width ((min copper size value
m_ViasMinSize = 350; // vias (not micro vias) min diameter
m_MicroViasMinSize = 200; // micro vias (not vias) min diameter

View File

@ -596,9 +596,7 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
// "as is", and let ShowNewTrackWhenMovingCursor figure out what to do.
if( !Drc_On || !g_CurrentTrackSegment
|| g_CurrentTrackSegment != this->GetCurItem()
|| !LocateIntrusion( m_Pcb->m_Track,
g_CurrentTrackSegment->GetNet(),
g_CurrentTrackSegment->m_Width ) )
|| !LocateIntrusion( m_Pcb->m_Track, g_CurrentTrackSegment ))
{
GetScreen()->m_Curseur = on_grid;
}

View File

@ -18,17 +18,19 @@
#include "dialog_design_rules.h"
#include "wx/generic/gridctrl.h"
// Fields Positions on layer grid
#define LAYERS_GRID_ROUTABLE_POSITION 0
#define LAYERS_GRID_STATUS_POSITION 1
#define LAYERS_GRID_NAME_POSITION 2
// Fields Positions on rules grid
#define RULE_GRID_TRACKSIZE_POSITION 0
#define RULE_GRID_VIASIZE_POSITION 1
#define RULE_GRID_CLEARANCE_POSITION 2
#define RULE_GRID_MINTRACKSIZE_POSITION 3
#define RULE_GRID_MINVIASIZE_POSITION 4
// Field Positions on rules grid
enum {
GRID_CLEARANCE,
GRID_TRACKSIZE,
GRID_VIASIZE,
GRID_VIADRILL,
GRID_uVIASIZE,
GRID_uVIADRILL,
};
const wxString DIALOG_DESIGN_RULES::wildCard = _("* (Any)");
/***********************************************************************************/
DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent ) :
@ -37,6 +39,29 @@ DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent ) :
{
m_Parent = parent;
wxListItem column0;
wxListItem column1;
column0.Clear();
column1.Clear();
column0.SetImage( -1 );
column1.SetImage( -1 );
column0.SetText( _( "Net" ) );
column1.SetText( _( "Class" ) );
m_leftListCtrl->InsertColumn( 0, column0 );
m_leftListCtrl->InsertColumn( 1, column1 );
m_leftListCtrl->SetColumnWidth( 0, wxLIST_AUTOSIZE );
m_leftListCtrl->SetColumnWidth( 1, wxLIST_AUTOSIZE );
m_rightListCtrl->InsertColumn( 0, column0 );
m_rightListCtrl->InsertColumn( 1, column1 );
m_rightListCtrl->SetColumnWidth( 0, wxLIST_AUTOSIZE );
m_rightListCtrl->SetColumnWidth( 1, wxLIST_AUTOSIZE );
Init();
SetAutoLayout( true );
GetSizer()->Fit( this );
@ -52,105 +77,137 @@ void DIALOG_DESIGN_RULES::Init()
SetReturnCode( 0 );
// Initialize the layers grid:
m_ActivesLayersCount = g_DesignSettings.m_CopperLayerCount;
m_Pcb = m_Parent->GetBoard();
m_LayersCountSelection->SetSelection( m_ActivesLayersCount / 2 );
// Initialize the Routable column
SetRoutableLayerStatus();
// Initialize the Status column (layers attribute)
LAYER_T typelist[4] = { LT_SIGNAL, LT_POWER, LT_MIXED, LT_JUMPER };
for( int ii = 0; ii < 4; ii++ )
{
m_LayersType[ii] = typelist[ii];
m_LayersTypeName[ii] = CONV_FROM_UTF8( LAYER::ShowType( typelist[ii] ) );
}
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows(); ii++ )
{
m_gridLayersProperties->SetCellEditor( ii, LAYERS_GRID_STATUS_POSITION,
new wxGridCellChoiceEditor( WXSIZEOF(
m_LayersTypeName ),
m_LayersTypeName ) );
int select = LT_SIGNAL;
for( int jj = 0; jj < 4; jj++ )
{
int layer = LAYER_CMP_N - ii;
if( m_Pcb->GetLayerType( layer ) == m_LayersType[jj] )
{
select = m_LayersType[jj];
break;
}
}
m_gridLayersProperties->SetCellValue( ii, LAYERS_GRID_STATUS_POSITION,
m_LayersTypeName[select] );
m_gridLayersProperties->SetCellOverflow( ii, LAYERS_GRID_STATUS_POSITION, false );
}
// Initialize the Name column
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows(); ii++ )
{
wxString layer_name = m_Pcb->GetLayerName( LAYER_CMP_N - ii );
m_gridLayersProperties->SetCellValue( ii, LAYERS_GRID_NAME_POSITION, layer_name );
}
// Initialize the Rules List
InitRulesList();
/* Initialize the list of nets buffers
* (note the netcode 0 is not a real net, so it is not loaded)
*/
for( unsigned ii = 1; ; ii++ )
// copy all NETs into m_AllNets by adding them as NETCUPs.
NETCLASS* netclass;
NETCLASSES& netclasses = m_Pcb->m_NetClasses;
netclass = netclasses.GetDefault();
for( NETCLASS::const_iterator name = netclass->begin(); name != netclass->end(); ++name )
{
NETINFO_ITEM* net = m_Pcb->FindNet( ii );
if( net == NULL )
break;
m_StockNets.push_back( net );
m_AllNets.push_back( NETCUP( *name, netclass->GetName() ) );
}
// search the index in rules list for this net
int rules_idx = 0;
for( int jj = 0; jj < m_gridNetClassesProperties->GetNumberRows(); jj++ )
for( NETCLASSES::const_iterator nc = netclasses.begin(); nc != netclasses.end(); ++nc )
{
netclass = nc->second;
for( NETCLASS::const_iterator name = netclass->begin(); name != netclass->end(); ++name )
{
if( m_gridNetClassesProperties->GetRowLabelValue( jj ).CmpNoCase( net->GetClassName() )
== 0 )
{
rules_idx = jj;
break;
}
m_AllNets.push_back( NETCUP( *name, netclass->GetName() ) );
}
m_NetsLinkToClasses.push_back( rules_idx ); // All nets are set to default net class
}
InitializeRulesSelectionBoxes();
}
/** Function FillListBoxWithNetsNames
* populates the aListBox with net names members of the aNetclassIndex net class
* the "Client Data pointer" is used to store the index of nets in ne nets lists
*/
void DIALOG_DESIGN_RULES::FillListBoxWithNetsNames( wxListBox* aListBox, int aNetclassIndex )
// Sort comparison function
static bool sortByClassThenName( NETCUP* a, NETCUP* b )
{
aListBox->Clear();
unsigned idx = 0;
for( unsigned ii = 0; ii < m_StockNets.size(); ii++ )
{
if( aNetclassIndex == m_NetsLinkToClasses[ii] )
{
aListBox->Append( m_StockNets[ii]->GetNetname() );
// return a < b
// Store the index of this net
// This is a trick to get an unsigned integer index from a pointer value.
// Some compilers cannot accept to convert an unsigned to a pointer without complains
char * ptr = (char*)0 + ii;
aListBox->SetClientData( idx, ptr );
idx++;
if( a->clazz < b->clazz )
return true;
if( a->net < a->net )
return true;
return false;
}
void DIALOG_DESIGN_RULES::makePointers( PNETCUPS* aList, const wxString& aNetClassName )
{
aList->clear();
if( wildCard == aNetClassName )
{
for( NETCUPS::iterator n = m_AllNets.begin(); n != m_AllNets.end(); ++n )
{
aList->push_back( &*n );
}
sort( aList->begin(), aList->end(), sortByClassThenName );
// could use a different sort order for wildCard case.
}
else
{
for( NETCUPS::iterator n = m_AllNets.begin(); n != m_AllNets.end(); ++n )
{
if( n->clazz == aNetClassName )
aList->push_back( &*n );
}
sort( aList->begin(), aList->end(), sortByClassThenName );
}
}
void DIALOG_DESIGN_RULES::setRowItem( wxListCtrl* aListCtrl, int aRow, NETCUP* aNetAndClass )
{
wxASSERT( aRow >= 0 );
// insert blanks if aRow is larger than existing count
while( aRow >= aListCtrl->GetItemCount() )
{
long ndx = aListCtrl->InsertItem( aListCtrl->GetItemCount(), wxEmptyString );
wxASSERT( ndx >= 0 );
aListCtrl->SetItem( ndx, 1, wxEmptyString );
}
aListCtrl->SetItem( aRow, 0, aNetAndClass->net );
aListCtrl->SetItem( aRow, 1, aNetAndClass->clazz );
// recompute the column widths here, after setting texts
aListCtrl->SetColumnWidth( 0, wxLIST_AUTOSIZE );
aListCtrl->SetColumnWidth( 1, wxLIST_AUTOSIZE );
}
/**
* Function FillListBoxWithNetNames
* populates aListCtrl with net names members of the aNetclassIndex net class
* the "Client Data pointer" is used to store the index of nets in the net lists
*/
void DIALOG_DESIGN_RULES::FillListBoxWithNetNames( wxListCtrl* aListCtrl, const wxString& aNetClass )
{
aListCtrl->ClearAll();
#if 1
PNETCUPS ptrList;
makePointers( &ptrList, aNetClass );
#if defined(DEBUG)
int r = 0;
for( PNETCUPS::iterator i = ptrList.begin(); i!=ptrList.end(); ++i, ++r )
{
printf("[%d]: %s %s\n", r, CONV_TO_UTF8( (*i)->net ), CONV_TO_UTF8( (*i)->clazz ) );
}
#endif
// to speed up inserting we hide the control temporarily
aListCtrl->Hide();
int row = 0;
for( PNETCUPS::iterator i = ptrList.begin(); i!=ptrList.end(); ++i, ++row )
{
setRowItem( aListCtrl, row, *i );
}
aListCtrl->Show();
#endif
}
@ -158,94 +215,94 @@ void DIALOG_DESIGN_RULES::FillListBoxWithNetsNames( wxListBox* aListBox, int aNe
*/
void DIALOG_DESIGN_RULES::InitializeRulesSelectionBoxes()
{
m_CBoxRightSelection->Clear();
m_CBoxLeftSelection->Clear();
for( int ii = 0; ii < m_gridNetClassesProperties->GetNumberRows(); ii++ )
m_rightClassChoice->Clear();
m_leftClassChoice->Clear();
m_rightClassChoice->Append( wildCard );
m_leftClassChoice->Append( wildCard );
for( int ii = 0; ii < m_grid->GetNumberRows(); ii++ )
{
m_CBoxRightSelection->Append( m_gridNetClassesProperties->GetRowLabelValue( ii ) );
m_CBoxLeftSelection->Append( m_gridNetClassesProperties->GetRowLabelValue( ii ) );
m_rightClassChoice->Append( m_grid->GetRowLabelValue( ii ) );
m_leftClassChoice->Append( m_grid->GetRowLabelValue( ii ) );
}
m_CBoxRightSelection->Select( 0 );
m_CBoxLeftSelection->Select( 0 );
m_rightClassChoice->Select( 0 );
m_leftClassChoice->Select( 0 );
m_buttonRightToLeft->Enable( false );
m_buttonLeftToRight->Enable( false );;
FillListBoxWithNetsNames( m_listBoxLeftNetSelect, m_CBoxLeftSelection->GetCurrentSelection() );
FillListBoxWithNetsNames( m_listBoxRightNetSelect, m_CBoxRightSelection->GetCurrentSelection() );
}
/* Initialize the Routable column, and the R/W property of some cells
*/
void DIALOG_DESIGN_RULES::SetRoutableLayerStatus()
{
m_gridLayersProperties->SetColFormatBool( LAYERS_GRID_ROUTABLE_POSITION );
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows(); ii++ )
{
int layer = LAYER_CMP_N - ii;
wxString value = layer < (m_ActivesLayersCount - 1) ? wxT( "1" ) : wxT( "0" );
if( m_ActivesLayersCount > 1 && layer == LAYER_CMP_N )
value = wxT( "1" );
if( layer == COPPER_LAYER_N )
value = wxT( "1" );
m_gridLayersProperties->SetCellValue( ii, LAYERS_GRID_ROUTABLE_POSITION, value );
m_gridLayersProperties->SetReadOnly( ii, LAYERS_GRID_ROUTABLE_POSITION );
// Set to Read Only cell for non existing copper layers:
m_gridLayersProperties->SetReadOnly( ii, LAYERS_GRID_STATUS_POSITION, value != wxT( "1" ) );
m_gridLayersProperties->SetReadOnly( ii, LAYERS_GRID_NAME_POSITION, value != wxT( "1" ) );
}
FillListBoxWithNetNames( m_leftListCtrl, m_leftClassChoice->GetStringSelection() );
FillListBoxWithNetNames( m_rightListCtrl, m_rightClassChoice->GetStringSelection() );
}
/* Initialize the rules list from board
*/
static void class2gridRow( wxGrid* grid, int row, NETCLASS* nc, int units )
{
wxString msg;
// label is netclass name
grid->SetRowLabelValue( row, nc->GetName() );
msg = ReturnStringFromValue( g_UnitMetric, nc->GetClearance(), units );
grid->SetCellValue( row, GRID_CLEARANCE, msg );
msg = ReturnStringFromValue( g_UnitMetric, nc->GetTrackWidth(), units );
grid->SetCellValue( row, GRID_TRACKSIZE, msg );
msg = ReturnStringFromValue( g_UnitMetric, nc->GetViaDiameter(), units );
grid->SetCellValue( row, GRID_VIASIZE, msg );
msg = ReturnStringFromValue( g_UnitMetric, nc->GetViaDrill(), units );
grid->SetCellValue( row, GRID_VIADRILL, msg );
msg = ReturnStringFromValue( g_UnitMetric, nc->GetuViaDiameter(), units );
grid->SetCellValue( row, GRID_uVIASIZE, msg );
msg = ReturnStringFromValue( g_UnitMetric, nc->GetuViaDrill(), units );
grid->SetCellValue( row, GRID_uVIADRILL, msg );
}
void DIALOG_DESIGN_RULES::InitRulesList()
{
NETCLASSES& netclasses = m_Pcb->m_NetClasses;
int ii = 0;
for( NETCLASSES::iterator i=netclasses.begin(); i!=netclasses.end(); ++i, ++ii )
// the +1 is for the Default NETCLASS.
if( netclasses.GetCount()+1 > (unsigned) m_grid->GetNumberRows() )
{
m_grid->AppendRows( netclasses.GetCount()+1 - m_grid->GetNumberRows() );
}
class2gridRow( m_grid, 0, netclasses.GetDefault(), m_Parent->m_InternalUnits );
int row = 1;
for( NETCLASSES::iterator i=netclasses.begin(); i!=netclasses.end(); ++i, ++row )
{
NETCLASS* netclass = i->second;
// Creates one entry if needed
if( ii >= m_gridNetClassesProperties->GetNumberRows() )
m_gridNetClassesProperties->AppendRows();
// Init name
m_gridNetClassesProperties->SetRowLabelValue( ii, netclass->GetName() );
// Init data
wxString msg;
msg = ReturnStringFromValue( g_UnitMetric,
netclass->GetTrackWidth(),
m_Parent->m_InternalUnits, false );
m_gridNetClassesProperties->SetCellValue( ii, RULE_GRID_TRACKSIZE_POSITION, msg );
msg = ReturnStringFromValue( g_UnitMetric,
netclass->GetViaSize(),
m_Parent->m_InternalUnits, false );
m_gridNetClassesProperties->SetCellValue( ii, RULE_GRID_VIASIZE_POSITION, msg );
msg = ReturnStringFromValue( g_UnitMetric,
netclass->GetClearance(),
m_Parent->m_InternalUnits, false );
m_gridNetClassesProperties->SetCellValue( ii, RULE_GRID_CLEARANCE_POSITION, msg );
msg = ReturnStringFromValue( g_UnitMetric,
netclass->GetTrackMinWidth(),
m_Parent->m_InternalUnits, false );
m_gridNetClassesProperties->SetCellValue( ii, RULE_GRID_MINTRACKSIZE_POSITION, msg );
msg = ReturnStringFromValue( g_UnitMetric,
netclass->GetViaMinSize(),
m_Parent->m_InternalUnits, false );
m_gridNetClassesProperties->SetCellValue( ii, RULE_GRID_MINVIASIZE_POSITION, msg );
class2gridRow( m_grid, row, netclass, m_Parent->m_InternalUnits );
}
}
static void gridRow2class( wxGrid* grid, int row, NETCLASS* nc, int units )
{
#define MYCELL(col) \
ReturnValueFromString( g_UnitMetric, grid->GetCellValue( row, col ), units )
nc->SetClearance( MYCELL( GRID_CLEARANCE ) );
nc->SetTrackWidth( MYCELL( GRID_TRACKSIZE ) );
nc->SetViaDiameter( MYCELL( GRID_VIASIZE ) );
nc->SetViaDrill( MYCELL( GRID_VIADRILL ) );
nc->SetuViaDiameter( MYCELL( GRID_uVIASIZE ) );
nc->SetuViaDrill( MYCELL( GRID_uVIADRILL ) );
}
/* Copy the rules list to board
*/
void DIALOG_DESIGN_RULES::CopyRulesListToBoard()
@ -254,50 +311,30 @@ void DIALOG_DESIGN_RULES::CopyRulesListToBoard()
netclasses.Clear();
for( int ii = 0; ii < m_gridNetClassesProperties->GetNumberRows(); ii++ )
// gridRow2class( wxGrid* grid, int row, NETCLASS* nc, int units )
gridRow2class( m_grid, 0, netclasses.GetDefault(), m_Parent->m_InternalUnits );
for( int row = 1; row < m_grid->GetNumberRows(); ++row )
{
NETCLASS netclass( m_Pcb, m_gridNetClassesProperties->GetRowLabelValue( ii ) );
NETCLASS* nc = new NETCLASS( m_Pcb, m_grid->GetRowLabelValue( row ) );
// Init data
netclass.SetTrackWidth(
ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue( ii,
RULE_GRID_TRACKSIZE_POSITION ),
m_Parent->m_InternalUnits ));
netclass.SetViaSize(
ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue( ii,
RULE_GRID_VIASIZE_POSITION ),
m_Parent->m_InternalUnits ));
netclass.SetClearance(
ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue( ii,
RULE_GRID_CLEARANCE_POSITION ),
m_Parent->m_InternalUnits ));
netclass.SetTrackMinWidth(
ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue( ii,
RULE_GRID_MINTRACKSIZE_POSITION ),
m_Parent->m_InternalUnits ));
netclass.SetViaMinSize(
ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue( ii,
RULE_GRID_MINVIASIZE_POSITION ),
m_Parent->m_InternalUnits ));
// Copy the list of nets associated to this netclass:
for( unsigned idx = 0; idx < m_StockNets.size(); idx++ )
if( !m_Pcb->m_NetClasses.Add( nc ) )
{
if( m_NetsLinkToClasses[idx] == ii )
netclass.Add( m_StockNets[idx]->GetNetname() );
// @todo: put up an error message here.
delete nc;
continue;
}
// this calls copy constructor, so all data must be in 'netclass' before Add()ing.
m_Pcb->m_NetClasses.Add( netclass );
gridRow2class( m_grid, row, nc, m_Parent->m_InternalUnits );
}
for( NETCUPS::const_iterator netcup = m_AllNets.begin(); netcup != m_AllNets.end(); ++netcup )
{
NETCLASS* nc = netclasses.Find( netcup->clazz );
wxASSERT( nc );
nc->Add( netcup->net );
}
m_Pcb->SynchronizeNetsAndNetClasses();
@ -322,52 +359,12 @@ void DIALOG_DESIGN_RULES::OnOkButtonClick( wxCommandEvent& event )
return;
}
g_DesignSettings.m_CopperLayerCount = m_ActivesLayersCount;
// Initialize the new layer name
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows(); ii++ )
{
wxString layer_name = m_gridLayersProperties->GetCellValue( ii, LAYERS_GRID_NAME_POSITION );
if( layer_name != m_Pcb->GetLayerName( LAYER_CMP_N - ii ) )
{
m_Pcb->SetLayerName( LAYER_CMP_N - ii, layer_name );
}
}
// Initialize the layer type
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows(); ii++ )
{
wxString txt = m_gridLayersProperties->GetCellValue( ii, LAYERS_GRID_STATUS_POSITION );
int layer = LAYER_CMP_N - ii;
for( int jj = 0; jj < 3; jj++ )
{
if( m_LayersTypeName[jj] == txt )
{
m_Pcb->SetLayerType( layer, m_LayersType[jj] );
break;
}
}
}
CopyRulesListToBoard();
EndModal( wxID_OK );
}
/**************************************************************************/
void DIALOG_DESIGN_RULES::OnLayerCountClick( wxCommandEvent& event )
/**************************************************************************/
{
m_ActivesLayersCount = m_LayersCountSelection->GetSelection() * 2;
if( m_ActivesLayersCount <= 0 )
m_ActivesLayersCount = 1;
// Reinit the routable layers status
SetRoutableLayerStatus();
}
/**************************************************************************/
void DIALOG_DESIGN_RULES::OnAddNetclassClick( wxCommandEvent& event )
/**************************************************************************/
@ -381,10 +378,10 @@ void DIALOG_DESIGN_RULES::OnAddNetclassClick( wxCommandEvent& event )
return;
// The name must dot exists:
for( int ii = 0; ii < m_gridNetClassesProperties->GetNumberRows(); ii++ )
for( int ii = 0; ii < m_grid->GetNumberRows(); ii++ )
{
wxString value;
value = m_gridNetClassesProperties->GetRowLabelValue( ii );
value = m_grid->GetRowLabelValue( ii );
if( class_name.CmpNoCase( value ) == 0 ) // Already exists!
{
DisplayError( this, _( "This NetClass is already existing, cannot add it; Aborted" ) );
@ -392,18 +389,18 @@ void DIALOG_DESIGN_RULES::OnAddNetclassClick( wxCommandEvent& event )
}
}
m_gridNetClassesProperties->AppendRows();
m_gridNetClassesProperties->SetRowLabelValue(
m_gridNetClassesProperties->GetNumberRows() - 1,
m_grid->AppendRows();
m_grid->SetRowLabelValue(
m_grid->GetNumberRows() - 1,
class_name );
// Copy values of the previous class:
int irow = m_gridNetClassesProperties->GetNumberRows() - 1;
for( int icol = 0; icol < m_gridNetClassesProperties->GetNumberCols(); icol++ )
int irow = m_grid->GetNumberRows() - 1;
for( int icol = 0; icol < m_grid->GetNumberCols(); icol++ )
{
wxString value;
value = m_gridNetClassesProperties->GetCellValue( irow - 1, icol );
m_gridNetClassesProperties->SetCellValue( irow, icol, value );
value = m_grid->GetCellValue( irow - 1, icol );
m_grid->SetCellValue( irow, icol, value );
}
InitializeRulesSelectionBoxes();
@ -414,19 +411,18 @@ void DIALOG_DESIGN_RULES::OnAddNetclassClick( wxCommandEvent& event )
void DIALOG_DESIGN_RULES::OnRemoveNetclassClick( wxCommandEvent& event )
/**************************************************************************/
{
wxArrayInt select = m_gridNetClassesProperties->GetSelectedRows();
wxArrayInt select = m_grid->GetSelectedRows();
for( int ii = select.GetCount() - 1; ii >= 0; ii-- )
{
if( select[ii] != 0 ) // Do not remove the default class
{
m_gridNetClassesProperties->DeleteRows( select[ii] );
wxString classname = m_grid->GetRowLabelValue( ii );
// reset the net class to default for nets member of the removed net class
for( unsigned jj = 0; jj< m_NetsLinkToClasses.size(); jj++ )
if( m_NetsLinkToClasses[jj] == ii )
m_NetsLinkToClasses[jj] = 0; // Reset to default net class
m_grid->DeleteRows( select[ii] );
// reset the net class to default for members of the removed class
swapNetClass( classname, NETCLASS::Default );
}
}
@ -439,8 +435,8 @@ void DIALOG_DESIGN_RULES::OnRemoveNetclassClick( wxCommandEvent& event )
*/
void DIALOG_DESIGN_RULES::OnLeftCBSelection( wxCommandEvent& event )
{
FillListBoxWithNetsNames( m_listBoxLeftNetSelect, m_CBoxLeftSelection->GetCurrentSelection() );
if( m_CBoxLeftSelection->GetCurrentSelection() == m_CBoxRightSelection->GetCurrentSelection() )
FillListBoxWithNetNames( m_leftListCtrl, m_leftClassChoice->GetStringSelection() );
if( m_leftClassChoice->GetStringSelection() == m_rightClassChoice->GetStringSelection() )
{
m_buttonRightToLeft->Enable( false );
m_buttonLeftToRight->Enable( false );
@ -458,8 +454,8 @@ void DIALOG_DESIGN_RULES::OnLeftCBSelection( wxCommandEvent& event )
*/
void DIALOG_DESIGN_RULES::OnRightCBSelection( wxCommandEvent& event )
{
FillListBoxWithNetsNames( m_listBoxRightNetSelect, m_CBoxRightSelection->GetCurrentSelection() );
if( m_CBoxLeftSelection->GetCurrentSelection() == m_CBoxRightSelection->GetCurrentSelection() )
FillListBoxWithNetNames( m_rightListCtrl, m_rightClassChoice->GetStringSelection() );
if( m_leftClassChoice->GetStringSelection() == m_rightClassChoice->GetStringSelection() )
{
m_buttonRightToLeft->Enable( false );
m_buttonLeftToRight->Enable( false );;
@ -478,24 +474,27 @@ void DIALOG_DESIGN_RULES::OnRightCBSelection( wxCommandEvent& event )
void DIALOG_DESIGN_RULES::OnRightToLeftCopyButton( wxCommandEvent& event )
{
int idx_class = m_CBoxLeftSelection->GetCurrentSelection();
wxString oldClassName = m_leftClassChoice->GetStringSelection();
wxString newClassName = m_rightClassChoice->GetStringSelection();
if( idx_class == wxNOT_FOUND )
return;
for( unsigned ii = 0; ii < m_listBoxRightNetSelect->GetCount(); ii++ )
wxASSERT( oldClassName != wxEmptyString );
wxASSERT( newClassName != wxEmptyString );
for( int row = 0; row < m_rightListCtrl->GetItemCount(); ++row )
{
if( !m_listBoxRightNetSelect->IsSelected( ii ) )
if( !m_rightListCtrl->GetItemState( row, wxLIST_STATE_SELECTED ) )
continue;
// This is a trick to get an unsigned integer index from a pointer value.
// Some compilers cannot accept to convert a pointer to an unsigned without complains
char * ptr = (char*) m_listBoxRightNetSelect->GetClientData( ii );
unsigned idx = ptr - (char*)0;
m_NetsLinkToClasses[idx] = idx_class;
/*
@todo: get the netName, call setNetClass()
wxString netName = m_rightListCtrl->OnGetItemText( row, 0 );
setNetClass( netName, newClassName == wildCard ? NETCLASS::Default : newClassName );
*/
}
FillListBoxWithNetsNames( m_listBoxLeftNetSelect, m_CBoxLeftSelection->GetCurrentSelection() );
FillListBoxWithNetsNames( m_listBoxRightNetSelect, m_CBoxRightSelection->GetCurrentSelection() );
FillListBoxWithNetNames( m_leftListCtrl, m_leftClassChoice->GetStringSelection() );
FillListBoxWithNetNames( m_rightListCtrl, m_rightClassChoice->GetStringSelection() );
}
@ -504,24 +503,10 @@ void DIALOG_DESIGN_RULES::OnRightToLeftCopyButton( wxCommandEvent& event )
*/
void DIALOG_DESIGN_RULES::OnLeftToRightCopyButton( wxCommandEvent& event )
{
int idx_class = m_CBoxRightSelection->GetCurrentSelection();
// @todo factor code from above, or combine the two functions.
if( idx_class == wxNOT_FOUND )
return;
for( unsigned ii = 0; ii < m_listBoxLeftNetSelect->GetCount(); ii++ )
{
if( !m_listBoxLeftNetSelect->IsSelected( ii ) )
continue;
// This is a trick to get an unsigned integer index from a pointer value.
// Some compilers cannot accept to convert a pointer to an unsigned without complains
char * ptr = (char*) m_listBoxLeftNetSelect->GetClientData( ii );
unsigned idx = ptr - (char*)0 ;
m_NetsLinkToClasses[idx] = idx_class;
}
FillListBoxWithNetsNames( m_listBoxLeftNetSelect, m_CBoxLeftSelection->GetCurrentSelection() );
FillListBoxWithNetsNames( m_listBoxRightNetSelect, m_CBoxRightSelection->GetCurrentSelection() );
FillListBoxWithNetNames( m_leftListCtrl, m_leftClassChoice->GetStringSelection() );
FillListBoxWithNetNames( m_rightListCtrl, m_rightClassChoice->GetStringSelection() );
}
@ -530,8 +515,8 @@ void DIALOG_DESIGN_RULES::OnLeftToRightCopyButton( wxCommandEvent& event )
*/
void DIALOG_DESIGN_RULES::OnLeftSelectAllButton( wxCommandEvent& event )
{
for( unsigned ii = 0; ii < m_listBoxLeftNetSelect->GetCount(); ii++ )
m_listBoxLeftNetSelect->SetSelection( ii );
for( int ii = 0; ii < m_leftListCtrl->GetItemCount(); ii++ )
m_leftListCtrl->SetItemState( ii, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
}
@ -540,8 +525,21 @@ void DIALOG_DESIGN_RULES::OnLeftSelectAllButton( wxCommandEvent& event )
*/
void DIALOG_DESIGN_RULES::OnRightSelectAllButton( wxCommandEvent& event )
{
for( unsigned ii = 0; ii < m_listBoxRightNetSelect->GetCount(); ii++ )
m_listBoxRightNetSelect->SetSelection( ii );
for( int ii = 0; ii < m_rightListCtrl->GetItemCount(); ii++ )
m_rightListCtrl->SetItemState( ii, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
}
void DIALOG_DESIGN_RULES::setNetClass( const wxString& aNetName, const wxString& aClassName )
{
for( NETCUPS::iterator i = m_AllNets.begin(); i != m_AllNets.end(); ++i )
{
if( i->net == aNetName )
{
i->clazz = aClassName;
break;
}
}
}
@ -552,63 +550,32 @@ void DIALOG_DESIGN_RULES::OnRightSelectAllButton( wxCommandEvent& event )
*/
bool DIALOG_DESIGN_RULES::TestDataValidity()
{
bool success = true;
m_MessagesList->SetPage(wxEmptyString); // Clear message list
bool result = true;
// Test duplicate layers names
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows() - 1; ii++ )
m_MessagesList->SetPage(wxEmptyString); // Clear message list
wxString msg;
for( int row = 0; row < m_grid->GetNumberRows(); row++ )
{
wxString value = m_gridLayersProperties->GetCellValue( ii, LAYERS_GRID_NAME_POSITION );
for( int jj = ii+1; jj < m_gridLayersProperties->GetNumberRows(); jj++ )
int viadia = ReturnValueFromString( g_UnitMetric,
m_grid->GetCellValue(
row, GRID_VIASIZE ),
m_Parent->m_InternalUnits );
int viadrill = ReturnValueFromString( g_UnitMetric,
m_grid->GetCellValue(
row, GRID_VIADRILL ),
m_Parent->m_InternalUnits );
if( viadrill && viadrill >= viadia )
{
wxString othervalue = m_gridLayersProperties->GetCellValue( ii,
LAYERS_GRID_NAME_POSITION );
othervalue = m_gridLayersProperties->GetCellValue( jj, LAYERS_GRID_NAME_POSITION );
if( value.CmpNoCase( othervalue ) == 0 ) // Already exists!
{
wxString text;
text.Printf( _(
"<small>This layer name <b>%s</b> is already existing<br>" ),
value.GetData() );
m_MessagesList->AppendToPage( text );
success = false;
}
result = false;
msg.Printf( _( "%s: <b>Via Drill</b> &ge; <b>Via Dia</b><br>" ),
GetChars( m_grid->GetRowLabelValue(row)) );
m_MessagesList->AppendToPage( msg );
}
}
int value;
int minvalue;
for( int ii = 0; ii < m_gridNetClassesProperties->GetNumberRows(); ii++ )
{
value = ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue(
ii, RULE_GRID_TRACKSIZE_POSITION ),
m_Parent->m_InternalUnits );
minvalue = ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue( ii,
RULE_GRID_MINTRACKSIZE_POSITION ),
m_Parent->m_InternalUnits );
if( value < minvalue )
{
success = false;
m_MessagesList->AppendToPage( _( "The <b>track</b> minimum size is bigger than the size<br>" ) );
}
value = ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue(
ii, RULE_GRID_VIASIZE_POSITION ),
m_Parent->m_InternalUnits );
minvalue = ReturnValueFromString( g_UnitMetric,
m_gridNetClassesProperties->GetCellValue( ii,
RULE_GRID_MINVIASIZE_POSITION ),
m_Parent->m_InternalUnits );
if( value < minvalue )
{
success = false;
m_MessagesList->AppendToPage( _( "The <b>via</b> minimum size is bigger than the size<br>" ) );
}
}
return success;
return result;
}

View File

@ -7,45 +7,80 @@
#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
{
private:
WinEDA_PcbFrame * m_Parent;
int m_ActivesLayersCount;
BOARD * m_Pcb;
LAYER_T m_LayersType[4];
wxString m_LayersTypeName[4];
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
private:
private:
void OnLayerCountClick( wxCommandEvent& event );
void OnLayerGridLeftClick( wxGridEvent& event ){ event.Skip(); }
void OnLayerGridRighttClick( wxGridEvent& event ){ event.Skip(); }
void OnNetClassesGridLeftClick( wxGridEvent& event ){ event.Skip(); }
void OnNetClassesGridRightClick( wxGridEvent& event ){ event.Skip(); }
void OnCancelButtonClick( wxCommandEvent& event );
void OnOkButtonClick( wxCommandEvent& event );
void OnAddNetclassClick( wxCommandEvent& event );
void OnRemoveNetclassClick( wxCommandEvent& event );
void OnLeftCBSelection( wxCommandEvent& event );
void OnRightCBSelection( wxCommandEvent& event );
void OnRightToLeftCopyButton( wxCommandEvent& event );
void OnLeftToRightCopyButton( wxCommandEvent& event );
void OnLeftSelectAllButton( wxCommandEvent& event );
void OnRightSelectAllButton( wxCommandEvent& event );
bool TestDataValidity( );
static const wxString wildCard;
WinEDA_PcbFrame* m_Parent;
BOARD* m_Pcb;
std::vector<wxString> m_NetClasses;
NETCUPS m_AllNets;
private:
void OnLayerCountClick( wxCommandEvent& event );
void OnLayerGridLeftClick( wxGridEvent& event ){ event.Skip(); }
void OnLayerGridRighttClick( wxGridEvent& event ){ event.Skip(); }
void OnNetClassesGridLeftClick( wxGridEvent& event ){ event.Skip(); }
void OnNetClassesGridRightClick( wxGridEvent& event ){ event.Skip(); }
void OnCancelButtonClick( wxCommandEvent& event );
void OnOkButtonClick( wxCommandEvent& event );
void OnAddNetclassClick( wxCommandEvent& event );
void OnRemoveNetclassClick( wxCommandEvent& event );
void OnLeftCBSelection( wxCommandEvent& event );
void OnRightCBSelection( wxCommandEvent& event );
void OnRightToLeftCopyButton( wxCommandEvent& event );
void OnLeftToRightCopyButton( wxCommandEvent& event );
void OnLeftSelectAllButton( wxCommandEvent& event );
void OnRightSelectAllButton( wxCommandEvent& event );
bool TestDataValidity( );
void Init();
void InitRulesList();
void InitializeRulesSelectionBoxes();
void CopyRulesListToBoard();
void SetRoutableLayerStatus( );
void FillListBoxWithNetsNames(wxListBox* aListBox, int aNetclassIndex);
void SetRoutableLayerStatus();
void FillListBoxWithNetNames( wxListCtrl* aListCtrl, const wxString& aNetClass );
public:
DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent );
~DIALOG_DESIGN_RULES( ) { };
/**
* 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:
DIALOG_DESIGN_RULES( WinEDA_PcbFrame* parent );
~DIALOG_DESIGN_RULES( ) { };
};

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// C++ code generated with wxFormBuilder (version Sep 9 2009)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@ -16,199 +16,139 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_panelLayers = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bMainSizerLayers;
bMainSizerLayers = new wxBoxSizer( wxHORIZONTAL );
wxString m_LayersCountSelectionChoices[] = { _("1"), _("2"), _("4"), _("6"), _("8"), _("10"), _("12"), _("14"), _("16") };
int m_LayersCountSelectionNChoices = sizeof( m_LayersCountSelectionChoices ) / sizeof( wxString );
m_LayersCountSelection = new wxRadioBox( m_panelLayers, ID_LAYERS_COUNT_SELECTION, _("Layers Count"), wxDefaultPosition, wxDefaultSize, m_LayersCountSelectionNChoices, m_LayersCountSelectionChoices, 1, wxRA_SPECIFY_COLS );
m_LayersCountSelection->SetSelection( 1 );
bMainSizerLayers->Add( m_LayersCountSelection, 0, wxALL, 5 );
m_gridLayersProperties = new wxGrid( m_panelLayers, ID_LAYERS_PROPERTIES, wxDefaultPosition, wxDefaultSize, 0 );
// Grid
m_gridLayersProperties->CreateGrid( 16, 3 );
m_gridLayersProperties->EnableEditing( true );
m_gridLayersProperties->EnableGridLines( true );
m_gridLayersProperties->EnableDragGridSize( false );
m_gridLayersProperties->SetMargins( 0, 0 );
// Columns
m_gridLayersProperties->SetColSize( 0, 100 );
m_gridLayersProperties->SetColSize( 1, 100 );
m_gridLayersProperties->SetColSize( 2, 150 );
m_gridLayersProperties->EnableDragColMove( false );
m_gridLayersProperties->EnableDragColSize( true );
m_gridLayersProperties->SetColLabelSize( 30 );
m_gridLayersProperties->SetColLabelValue( 0, _("Active") );
m_gridLayersProperties->SetColLabelValue( 1, _("Status") );
m_gridLayersProperties->SetColLabelValue( 2, _("Name") );
m_gridLayersProperties->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
m_gridLayersProperties->AutoSizeRows();
m_gridLayersProperties->EnableDragRowSize( true );
m_gridLayersProperties->SetRowLabelSize( 80 );
m_gridLayersProperties->SetRowLabelValue( 0, _("Top Layer") );
m_gridLayersProperties->SetRowLabelValue( 1, _("Inner 14") );
m_gridLayersProperties->SetRowLabelValue( 2, _("Inner 13") );
m_gridLayersProperties->SetRowLabelValue( 3, _("Inner 12") );
m_gridLayersProperties->SetRowLabelValue( 4, _("Inner 11") );
m_gridLayersProperties->SetRowLabelValue( 5, _("Inner 10") );
m_gridLayersProperties->SetRowLabelValue( 6, _("Inner 9") );
m_gridLayersProperties->SetRowLabelValue( 7, _("Inner 8") );
m_gridLayersProperties->SetRowLabelValue( 8, _("Inner 7") );
m_gridLayersProperties->SetRowLabelValue( 9, _("Inner 6") );
m_gridLayersProperties->SetRowLabelValue( 10, _("Inner 5") );
m_gridLayersProperties->SetRowLabelValue( 11, _("Inner 4") );
m_gridLayersProperties->SetRowLabelValue( 12, _("Inner 3") );
m_gridLayersProperties->SetRowLabelValue( 13, _("Inner 2") );
m_gridLayersProperties->SetRowLabelValue( 14, _("Inner 1") );
m_gridLayersProperties->SetRowLabelValue( 15, _("Bottom Layer") );
m_gridLayersProperties->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Label Appearance
// Cell Defaults
m_gridLayersProperties->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
bMainSizerLayers->Add( m_gridLayersProperties, 1, wxALL|wxEXPAND, 5 );
m_panelLayers->SetSizer( bMainSizerLayers );
m_panelLayers->Layout();
bMainSizerLayers->Fit( m_panelLayers );
m_notebook->AddPage( m_panelLayers, _("Layers"), true );
m_panelNetClasses = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bmainSizerNclasses;
bmainSizerNclasses = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizer1;
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( m_panelNetClasses, wxID_ANY, _("Net classes:") ), wxHORIZONTAL );
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Net Classes:") ), wxVERTICAL );
m_gridNetClassesProperties = new wxGrid( m_panelNetClasses, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_grid = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxSIMPLE_BORDER|wxVSCROLL );
// Grid
m_gridNetClassesProperties->CreateGrid( 1, 5 );
m_gridNetClassesProperties->EnableEditing( true );
m_gridNetClassesProperties->EnableGridLines( true );
m_gridNetClassesProperties->EnableDragGridSize( false );
m_gridNetClassesProperties->SetMargins( 0, 0 );
m_grid->CreateGrid( 1, 6 );
m_grid->EnableEditing( true );
m_grid->EnableGridLines( true );
m_grid->EnableDragGridSize( false );
m_grid->SetMargins( 0, 0 );
// Columns
m_gridNetClassesProperties->SetColSize( 0, 100 );
m_gridNetClassesProperties->SetColSize( 1, 100 );
m_gridNetClassesProperties->SetColSize( 2, 100 );
m_gridNetClassesProperties->SetColSize( 3, 100 );
m_gridNetClassesProperties->SetColSize( 4, 100 );
m_gridNetClassesProperties->EnableDragColMove( false );
m_gridNetClassesProperties->EnableDragColSize( true );
m_gridNetClassesProperties->SetColLabelSize( 30 );
m_gridNetClassesProperties->SetColLabelValue( 0, _("Track size") );
m_gridNetClassesProperties->SetColLabelValue( 1, _("Vias size") );
m_gridNetClassesProperties->SetColLabelValue( 2, _("Clearance") );
m_gridNetClassesProperties->SetColLabelValue( 3, _("Track Min Size") );
m_gridNetClassesProperties->SetColLabelValue( 4, _("Via Min Size") );
m_gridNetClassesProperties->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
m_grid->SetColSize( 0, 100 );
m_grid->SetColSize( 1, 100 );
m_grid->SetColSize( 2, 100 );
m_grid->SetColSize( 3, 100 );
m_grid->SetColSize( 4, 100 );
m_grid->EnableDragColMove( false );
m_grid->EnableDragColSize( true );
m_grid->SetColLabelSize( 40 );
m_grid->SetColLabelValue( 0, _("Clearance") );
m_grid->SetColLabelValue( 1, _("Track Width") );
m_grid->SetColLabelValue( 2, _("Via Dia") );
m_grid->SetColLabelValue( 3, _("Via Drill") );
m_grid->SetColLabelValue( 4, _("uVia Dia") );
m_grid->SetColLabelValue( 5, _("uVia Drill") );
m_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
m_gridNetClassesProperties->AutoSizeRows();
m_gridNetClassesProperties->EnableDragRowSize( true );
m_gridNetClassesProperties->SetRowLabelSize( 80 );
m_gridNetClassesProperties->SetRowLabelValue( 0, _("Default") );
m_gridNetClassesProperties->SetRowLabelValue( 1, _("Special") );
m_gridNetClassesProperties->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
m_grid->AutoSizeRows();
m_grid->EnableDragRowSize( true );
m_grid->SetRowLabelSize( 120 );
m_grid->SetRowLabelValue( 0, _("Default") );
m_grid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE );
// Label Appearance
// Cell Defaults
m_gridNetClassesProperties->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
m_gridNetClassesProperties->SetMinSize( wxSize( -1,150 ) );
m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
m_grid->SetToolTip( _("Net Class parameters") );
m_grid->SetMinSize( wxSize( -1,150 ) );
sbSizer1->Add( m_gridNetClassesProperties, 1, wxALL|wxEXPAND, 5 );
sbSizer1->Add( m_grid, 1, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizerButtons;
bSizerButtons = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* buttonBoxSizer;
buttonBoxSizer = new wxBoxSizer( wxHORIZONTAL );
m_buttonADD = new wxButton( m_panelNetClasses, wxID_ADD_NETCLASS, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonADD, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_addButton = new wxButton( this, wxID_ADD_NETCLASS, _("Add"), wxDefaultPosition, wxDefaultSize, 0 );
m_addButton->SetToolTip( _("Add another Net Class") );
m_buttonRemove = new wxButton( m_panelNetClasses, wxID_REMOVE_NETCLASS, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonRemove, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
buttonBoxSizer->Add( m_addButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
sbSizer1->Add( bSizerButtons, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_removeButton = new wxButton( this, wxID_REMOVE_NETCLASS, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 );
m_removeButton->SetToolTip( _("Remove the currently select Net Class") );
bmainSizerNclasses->Add( sbSizer1, 0, wxEXPAND, 5 );
buttonBoxSizer->Add( m_removeButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
wxBoxSizer* bSizerNetSelect;
bSizerNetSelect = new wxBoxSizer( wxHORIZONTAL );
m_moveUpButton = new wxButton( this, wxID_ANY, _("Move Up"), wxDefaultPosition, wxDefaultSize, 0 );
m_moveUpButton->SetToolTip( _("Move the currently selected Net Class up one row") );
wxBoxSizer* bLeftSizerNetSelect;
bLeftSizerNetSelect = new wxBoxSizer( wxVERTICAL );
buttonBoxSizer->Add( m_moveUpButton, 0, wxALL, 5 );
wxArrayString m_CBoxLeftSelectionChoices;
m_CBoxLeftSelection = new wxChoice( m_panelNetClasses, ID_LEFT_CHOICE_CLICK, wxDefaultPosition, wxDefaultSize, m_CBoxLeftSelectionChoices, 0 );
m_CBoxLeftSelection->SetSelection( 0 );
bLeftSizerNetSelect->Add( m_CBoxLeftSelection, 0, wxALL|wxEXPAND, 5 );
sbSizer1->Add( buttonBoxSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, 5 );
m_listBoxLeftNetSelect = new wxListBox( m_panelNetClasses, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED );
bLeftSizerNetSelect->Add( m_listBoxLeftNetSelect, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bMainSizer->Add( sbSizer1, 1, wxALL|wxEXPAND, 5 );
bSizerNetSelect->Add( bLeftSizerNetSelect, 1, wxEXPAND, 5 );
wxStaticBoxSizer* sbSizer4;
sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Membership:") ), wxHORIZONTAL );
wxBoxSizer* leftNetSelectBoxSizer;
leftNetSelectBoxSizer = new wxBoxSizer( wxVERTICAL );
wxArrayString m_leftClassChoiceChoices;
m_leftClassChoice = new wxChoice( this, ID_LEFT_CHOICE_CLICK, wxDefaultPosition, wxDefaultSize, m_leftClassChoiceChoices, 0 );
m_leftClassChoice->SetSelection( 0 );
leftNetSelectBoxSizer->Add( m_leftClassChoice, 0, wxALL|wxEXPAND, 5 );
m_leftListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES );
m_leftListCtrl->SetMinSize( wxSize( 220,-1 ) );
leftNetSelectBoxSizer->Add( m_leftListCtrl, 1, wxALL|wxEXPAND, 5 );
sbSizer4->Add( leftNetSelectBoxSizer, 1, wxALL|wxEXPAND, 5 );
wxBoxSizer* bmiddleSizerNetSelect;
bmiddleSizerNetSelect = new wxBoxSizer( wxVERTICAL );
m_buttonRightToLeft = new wxButton( m_panelNetClasses, ID_LEFT_TO_RIGHT_COPY, _("<<<"), wxDefaultPosition, wxDefaultSize, 0 );
bmiddleSizerNetSelect->Add( m_buttonRightToLeft, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 );
m_buttonRightToLeft = new wxButton( this, ID_LEFT_TO_RIGHT_COPY, _("<<<"), wxDefaultPosition, wxDefaultSize, 0 );
bmiddleSizerNetSelect->Add( m_buttonRightToLeft, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
m_buttonLeftToRight = new wxButton( m_panelNetClasses, ID_RIGHT_TO_LEFT_COPY, _(">>>"), wxDefaultPosition, wxDefaultSize, 0 );
bmiddleSizerNetSelect->Add( m_buttonLeftToRight, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_buttonLeftToRight = new wxButton( this, ID_RIGHT_TO_LEFT_COPY, _(">>>"), wxDefaultPosition, wxDefaultSize, 0 );
bmiddleSizerNetSelect->Add( m_buttonLeftToRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
wxBoxSizer* bSizerButtonsSelecAll;
bSizerButtonsSelecAll = new wxBoxSizer( wxHORIZONTAL );
m_buttonLeftSelAll = new wxButton( m_panelNetClasses, wxID_ANY, _("<< Select All"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtonsSelecAll->Add( m_buttonLeftSelAll, 0, wxTOP|wxBOTTOM, 5 );
m_buttonLeftSelAll = new wxButton( this, wxID_ANY, _("<< Select All"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtonsSelecAll->Add( m_buttonLeftSelAll, 0, wxALL, 5 );
m_buttonRightSelAll = new wxButton( m_panelNetClasses, wxID_ANY, _("Select All >>"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtonsSelecAll->Add( m_buttonRightSelAll, 0, wxALIGN_RIGHT|wxALIGN_BOTTOM|wxTOP|wxBOTTOM, 5 );
m_buttonRightSelAll = new wxButton( this, wxID_ANY, _("Select All >>"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtonsSelecAll->Add( m_buttonRightSelAll, 0, wxALIGN_BOTTOM|wxALIGN_RIGHT|wxALL, 5 );
bmiddleSizerNetSelect->Add( bSizerButtonsSelecAll, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
bSizerNetSelect->Add( bmiddleSizerNetSelect, 0, wxALIGN_CENTER_VERTICAL, 5 );
sbSizer4->Add( bmiddleSizerNetSelect, 0, wxALIGN_CENTER_VERTICAL, 5 );
wxBoxSizer* bLeftSizerNetSelect1;
bLeftSizerNetSelect1 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* rghtNetSelectBoxSizer;
rghtNetSelectBoxSizer = new wxBoxSizer( wxVERTICAL );
wxArrayString m_CBoxRightSelectionChoices;
m_CBoxRightSelection = new wxChoice( m_panelNetClasses, ID_RIGHT_CHOICE_CLICK, wxDefaultPosition, wxDefaultSize, m_CBoxRightSelectionChoices, 0 );
m_CBoxRightSelection->SetSelection( 0 );
bLeftSizerNetSelect1->Add( m_CBoxRightSelection, 0, wxALL|wxEXPAND, 5 );
wxArrayString m_rightClassChoiceChoices;
m_rightClassChoice = new wxChoice( this, ID_RIGHT_CHOICE_CLICK, wxDefaultPosition, wxDefaultSize, m_rightClassChoiceChoices, 0 );
m_rightClassChoice->SetSelection( 0 );
rghtNetSelectBoxSizer->Add( m_rightClassChoice, 0, wxALL|wxEXPAND, 5 );
m_listBoxRightNetSelect = new wxListBox( m_panelNetClasses, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED );
bLeftSizerNetSelect1->Add( m_listBoxRightNetSelect, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_rightListCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VRULES );
m_rightListCtrl->SetMinSize( wxSize( 220,-1 ) );
bSizerNetSelect->Add( bLeftSizerNetSelect1, 1, wxEXPAND, 5 );
rghtNetSelectBoxSizer->Add( m_rightListCtrl, 1, wxALL|wxEXPAND, 5 );
bmainSizerNclasses->Add( bSizerNetSelect, 1, wxEXPAND, 5 );
sbSizer4->Add( rghtNetSelectBoxSizer, 1, wxALL|wxEXPAND, 5 );
m_panelNetClasses->SetSizer( bmainSizerNclasses );
m_panelNetClasses->Layout();
bmainSizerNclasses->Fit( m_panelNetClasses );
m_notebook->AddPage( m_panelNetClasses, _("Net Classes"), false );
bMainSizer->Add( sbSizer4, 1, wxALL|wxEXPAND, 5 );
bMainSizer->Add( m_notebook, 1, wxALL|wxEXPAND, 5 );
m_staticTextMsg = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextMsg->Wrap( -1 );
bMainSizer->Add( m_staticTextMsg, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
wxStaticBoxSizer* sbSizer2;
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Messages:") ), wxHORIZONTAL );
m_MessagesList = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER );
m_MessagesList->SetMinSize( wxSize( -1,100 ) );
bMainSizer->Add( m_MessagesList, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
sbSizer2->Add( m_MessagesList, 1, wxALL|wxEXPAND, 5 );
bMainSizer->Add( sbSizer2, 0, wxALL|wxEXPAND, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
@ -216,25 +156,22 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
bMainSizer->Add( m_sdbSizer1, 0, wxALIGN_RIGHT, 5 );
bMainSizer->Add( m_sdbSizer1, 0, wxALIGN_RIGHT|wxALL|wxEXPAND, 5 );
this->SetSizer( bMainSizer );
this->Layout();
// Connect Events
m_LayersCountSelection->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLayerCountClick ), NULL, this );
m_gridLayersProperties->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnLayerGridLeftClick ), NULL, this );
m_gridLayersProperties->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnLayerGridRighttClick ), NULL, this );
m_gridNetClassesProperties->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesGridLeftClick ), NULL, this );
m_gridNetClassesProperties->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesGridRightClick ), NULL, this );
m_buttonADD->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnAddNetclassClick ), NULL, this );
m_buttonRemove->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRemoveNetclassClick ), NULL, this );
m_CBoxLeftSelection->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftCBSelection ), NULL, this );
m_grid->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesGridLeftClick ), NULL, this );
m_grid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesGridRightClick ), NULL, this );
m_addButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnAddNetclassClick ), NULL, this );
m_removeButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRemoveNetclassClick ), NULL, this );
m_leftClassChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftCBSelection ), NULL, this );
m_buttonRightToLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightToLeftCopyButton ), NULL, this );
m_buttonLeftToRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftToRightCopyButton ), NULL, this );
m_buttonLeftSelAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftSelectAllButton ), NULL, this );
m_buttonRightSelAll->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightSelectAllButton ), NULL, this );
m_CBoxRightSelection->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightCBSelection ), NULL, this );
m_rightClassChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightCBSelection ), NULL, this );
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnCancelButtonClick ), NULL, this );
m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnOkButtonClick ), NULL, this );
}
@ -242,19 +179,17 @@ DIALOG_DESIGN_RULES_BASE::DIALOG_DESIGN_RULES_BASE( wxWindow* parent, wxWindowID
DIALOG_DESIGN_RULES_BASE::~DIALOG_DESIGN_RULES_BASE()
{
// Disconnect Events
m_LayersCountSelection->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLayerCountClick ), NULL, this );
m_gridLayersProperties->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnLayerGridLeftClick ), NULL, this );
m_gridLayersProperties->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnLayerGridRighttClick ), NULL, this );
m_gridNetClassesProperties->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesGridLeftClick ), NULL, this );
m_gridNetClassesProperties->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesGridRightClick ), NULL, this );
m_buttonADD->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnAddNetclassClick ), NULL, this );
m_buttonRemove->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRemoveNetclassClick ), NULL, this );
m_CBoxLeftSelection->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftCBSelection ), NULL, this );
m_grid->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesGridLeftClick ), NULL, this );
m_grid->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( DIALOG_DESIGN_RULES_BASE::OnNetClassesGridRightClick ), NULL, this );
m_addButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnAddNetclassClick ), NULL, this );
m_removeButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRemoveNetclassClick ), NULL, this );
m_leftClassChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftCBSelection ), NULL, this );
m_buttonRightToLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightToLeftCopyButton ), NULL, this );
m_buttonLeftToRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftToRightCopyButton ), NULL, this );
m_buttonLeftSelAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnLeftSelectAllButton ), NULL, this );
m_buttonRightSelAll->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightSelectAllButton ), NULL, this );
m_CBoxRightSelection->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightCBSelection ), NULL, this );
m_rightClassChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnRightCBSelection ), NULL, this );
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnCancelButtonClick ), NULL, this );
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DESIGN_RULES_BASE::OnOkButtonClick ), NULL, this );
}

Some files were not shown because too many files have changed in this diff Show More