Commit eaa147c1 authored by dickelbeck's avatar dickelbeck

spelling errors, specctra work

parent 501fb2c2
...@@ -8,10 +8,11 @@ email address. ...@@ -8,10 +8,11 @@ email address.
2008-Jan-25 UPDATE Dick Hollenbeck <dick@softplc.com> 2008-Jan-25 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
+pcbnew: +pcbnew:
SPECCTRA export does padstacks ok, except that oval arcs need to be split * SPECCTRA export does padstacks ok, except that oval pad's arcs need to be split
into quarter circle arcs, and no consideration is given to "layer types" into quarter circle arcs, and no consideration is given to "layer types".
See page bottom of page 74 of the SECCTRA Design Language Reference, May 2000. See page bottom of page 74 of the SECCTRA Design Language Reference, May 2000.
Still working today... * HISTORY_NUMBER was spelt with a zero.
* Width was spelt as Widht
2008-Jan-25 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2008-Jan-25 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
......
...@@ -144,7 +144,7 @@ struct CHEVELU; ...@@ -144,7 +144,7 @@ struct CHEVELU;
#include "class_board.h" #include "class_board.h"
// Class for handle current printed board design settings // Class for handle current printed board design settings
#define HIST0RY_NUMBER 8 #define HISTORY_NUMBER 8
class EDA_BoardDesignSettings class EDA_BoardDesignSettings
{ {
public: public:
...@@ -154,10 +154,10 @@ public: ...@@ -154,10 +154,10 @@ public:
int m_CurrentViaSize; // Current via size int m_CurrentViaSize; // Current via size
int m_CurrentMicroViaSize; // Current micro via size int m_CurrentMicroViaSize; // Current micro via size
bool m_MicroViasAllowed; // true to allow micro vias bool m_MicroViasAllowed; // true to allow micro vias
int m_ViaSizeHistory[HIST0RY_NUMBER]; // Last HIST0RY_NUMBER used via sizes int m_ViaSizeHistory[HISTORY_NUMBER]; // Last HISTORY_NUMBER used via sizes
int m_CurrentViaType; // via type (BLIND, TROUGHT ...), bits 1 and 2 (not 0 and 1) int m_CurrentViaType; // via type (BLIND, TROUGHT ...), bits 1 and 2 (not 0 and 1)
int m_CurrentTrackWidth; // current track width int m_CurrentTrackWidth; // current track width
int m_TrackWidhtHistory[HIST0RY_NUMBER]; // Last HIST0RY_NUMBER used track widths int m_TrackWidthHistory[HISTORY_NUMBER]; // Last HISTORY_NUMBER used track widths
int m_DrawSegmentWidth; // current graphic line width (not EDGE layer) int m_DrawSegmentWidth; // current graphic line width (not EDGE layer)
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
......
...@@ -127,7 +127,8 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings() ...@@ -127,7 +127,8 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
// Default values for designing boards // Default values for designing boards
{ {
int ii; int ii;
int default_layer_color[32] = {
static const int default_layer_color[32] = {
GREEN, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, GREEN, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY,
LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY,
LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY,
...@@ -150,10 +151,10 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings() ...@@ -150,10 +151,10 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
m_CurrentViaSize = 450; // Current via size m_CurrentViaSize = 450; // Current via size
m_CurrentViaType = VIA_THROUGH; /* via type (BLIND, TROUGHT ...), bits 1 and 2 (not 0 and 1)*/ m_CurrentViaType = VIA_THROUGH; /* via type (BLIND, TROUGHT ...), bits 1 and 2 (not 0 and 1)*/
m_CurrentTrackWidth = 170; // current track width m_CurrentTrackWidth = 170; // current track width
for( ii = 0; ii < HIST0RY_NUMBER; ii++ ) for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{ {
m_TrackWidhtHistory[ii] = 0; // Last HIST0RY_NUMBER used track widths m_TrackWidthHistory[ii] = 0; // Last HISTORY_NUMBER used track widths
m_ViaSizeHistory[ii] = 0; // Last HIST0RY_NUMBER used via sizes m_ViaSizeHistory[ii] = 0; // Last HISTORY_NUMBER used via sizes
} }
m_DrawSegmentWidth = 100; // current graphic line width (not EDGE layer) m_DrawSegmentWidth = 100; // current graphic line width (not EDGE layer)
......
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_track_options.cpp // Name: dialog_track_options.cpp
// Purpose: // Purpose:
// Author: jean-pierre Charras // Author: jean-pierre Charras
...@@ -11,7 +12,7 @@ ...@@ -11,7 +12,7 @@
// Generated by DialogBlocks (unregistered), 24/02/2006 20:58:54 // Generated by DialogBlocks (unregistered), 24/02/2006 20:58:54
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #if defined (__GNUG__) && !defined (NO_GCC_PRAGMA)
#pragma implementation "dialog_track_options.h" #pragma implementation "dialog_track_options.h"
#endif #endif
...@@ -47,13 +48,13 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_PcbTracksDialog, wxDialog ) ...@@ -47,13 +48,13 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_PcbTracksDialog, wxDialog )
BEGIN_EVENT_TABLE( WinEDA_PcbTracksDialog, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_PcbTracksDialog, wxDialog )
////@begin WinEDA_PcbTracksDialog event table entries ////@begin WinEDA_PcbTracksDialog event table entries
EVT_INIT_DIALOG( WinEDA_PcbTracksDialog::OnInitDialog ) EVT_INIT_DIALOG( WinEDA_PcbTracksDialog::OnInitDialog )
EVT_CHECKBOX( ID_CHECKBOX_ALLOWS_MICROVIA, WinEDA_PcbTracksDialog::OnCheckboxAllowsMicroviaClick ) EVT_CHECKBOX( ID_CHECKBOX_ALLOWS_MICROVIA, WinEDA_PcbTracksDialog::OnCheckboxAllowsMicroviaClick )
EVT_BUTTON( wxID_OK, WinEDA_PcbTracksDialog::OnOkClick ) EVT_BUTTON( wxID_OK, WinEDA_PcbTracksDialog::OnOkClick )
EVT_BUTTON( wxID_CANCEL, WinEDA_PcbTracksDialog::OnCancelClick ) EVT_BUTTON( wxID_CANCEL, WinEDA_PcbTracksDialog::OnCancelClick )
////@end WinEDA_PcbTracksDialog event table entries ////@end WinEDA_PcbTracksDialog event table entries
...@@ -63,14 +64,20 @@ END_EVENT_TABLE() ...@@ -63,14 +64,20 @@ END_EVENT_TABLE()
* WinEDA_PcbTracksDialog constructors * WinEDA_PcbTracksDialog constructors
*/ */
WinEDA_PcbTracksDialog::WinEDA_PcbTracksDialog( ) WinEDA_PcbTracksDialog::WinEDA_PcbTracksDialog()
{ {
} }
WinEDA_PcbTracksDialog::WinEDA_PcbTracksDialog( WinEDA_PcbFrame* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
WinEDA_PcbTracksDialog::WinEDA_PcbTracksDialog( WinEDA_PcbFrame* parent,
wxWindowID id,
const wxString& caption,
const wxPoint& pos,
const wxSize& size,
long style )
{ {
m_Parent = parent; m_Parent = parent;
Create(parent, id, caption, pos, size, style); Create( parent, id, caption, pos, size, style );
} }
...@@ -78,7 +85,12 @@ WinEDA_PcbTracksDialog::WinEDA_PcbTracksDialog( WinEDA_PcbFrame* parent, wxWindo ...@@ -78,7 +85,12 @@ WinEDA_PcbTracksDialog::WinEDA_PcbTracksDialog( WinEDA_PcbFrame* parent, wxWindo
* WinEDA_PcbTracksDialog creator * WinEDA_PcbTracksDialog creator
*/ */
bool WinEDA_PcbTracksDialog::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) bool WinEDA_PcbTracksDialog::Create( wxWindow* parent,
wxWindowID id,
const wxString& caption,
const wxPoint& pos,
const wxSize& size,
long style )
{ {
////@begin WinEDA_PcbTracksDialog member initialisation ////@begin WinEDA_PcbTracksDialog member initialisation
m_ViaSizeTitle = NULL; m_ViaSizeTitle = NULL;
...@@ -99,130 +111,234 @@ bool WinEDA_PcbTracksDialog::Create( wxWindow* parent, wxWindowID id, const wxSt ...@@ -99,130 +111,234 @@ bool WinEDA_PcbTracksDialog::Create( wxWindow* parent, wxWindowID id, const wxSt
m_OptTrackClearance = NULL; m_OptTrackClearance = NULL;
m_MaskClearanceTitle = NULL; m_MaskClearanceTitle = NULL;
m_OptMaskMargin = NULL; m_OptMaskMargin = NULL;
////@end WinEDA_PcbTracksDialog member initialisation ////@end WinEDA_PcbTracksDialog member initialisation
////@begin WinEDA_PcbTracksDialog creation ////@begin WinEDA_PcbTracksDialog creation
SetExtraStyle(wxWS_EX_BLOCK_EVENTS); SetExtraStyle( wxWS_EX_BLOCK_EVENTS );
wxDialog::Create( parent, id, caption, pos, size, style ); wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls(); CreateControls();
if (GetSizer()) if( GetSizer() )
{ {
GetSizer()->SetSizeHints(this); GetSizer()->SetSizeHints( this );
} }
Centre(); Centre();
////@end WinEDA_PcbTracksDialog creation ////@end WinEDA_PcbTracksDialog creation
return true; return true;
} }
/*! /*!
* Control creation for WinEDA_PcbTracksDialog * Control creation for WinEDA_PcbTracksDialog
*/ */
void WinEDA_PcbTracksDialog::CreateControls() void WinEDA_PcbTracksDialog::CreateControls()
{ {
SetFont(*g_DialogFont); SetFont( *g_DialogFont );
////@begin WinEDA_PcbTracksDialog content construction ////@begin WinEDA_PcbTracksDialog content construction
// Generated by DialogBlocks, 11/01/2008 21:51:48 (unregistered) // Generated by DialogBlocks, 11/01/2008 21:51:48 (unregistered)
WinEDA_PcbTracksDialog* itemDialog1 = this; WinEDA_PcbTracksDialog* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxHORIZONTAL );
itemDialog1->SetSizer(itemBoxSizer2);
itemDialog1->SetSizer( itemBoxSizer2 );
wxStaticBox* itemStaticBoxSizer3Static = new wxStaticBox( itemDialog1, wxID_ANY, _(
"Vias:" ) );
wxStaticBoxSizer* itemStaticBoxSizer3 = new wxStaticBoxSizer(
itemStaticBoxSizer3Static,
wxVERTICAL );
wxStaticBox* itemStaticBoxSizer3Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Vias:")); itemBoxSizer2->Add( itemStaticBoxSizer3, 0, wxGROW | wxALL, 5 );
wxStaticBoxSizer* itemStaticBoxSizer3 = new wxStaticBoxSizer(itemStaticBoxSizer3Static, wxVERTICAL);
itemBoxSizer2->Add(itemStaticBoxSizer3, 0, wxGROW|wxALL, 5);
m_ViaSizeTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Via Size"), wxDefaultPosition, wxDefaultSize, 0 ); m_ViaSizeTitle = new wxStaticText( itemDialog1, wxID_STATIC, _(
itemStaticBoxSizer3->Add(m_ViaSizeTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); "Via Size" ),
wxDefaultPosition,
wxDefaultSize, 0 );
m_OptViaSize = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); itemStaticBoxSizer3->Add( m_ViaSizeTitle,
itemStaticBoxSizer3->Add(m_OptViaSize, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); 0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_ViaDefaultDrillValueTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Default Via Drill"), wxDefaultPosition, wxDefaultSize, 0 ); m_OptViaSize = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(
itemStaticBoxSizer3->Add(m_ViaDefaultDrillValueTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); "" ), wxDefaultPosition,
wxDefaultSize, 0 );
m_OptViaDrill = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); itemStaticBoxSizer3->Add( m_OptViaSize, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
itemStaticBoxSizer3->Add(m_OptViaDrill, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
m_ViaAltDrillValueTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Alternate Via Drill"), wxDefaultPosition, wxDefaultSize, 0 ); m_ViaDefaultDrillValueTitle = new wxStaticText( itemDialog1, wxID_STATIC, _(
itemStaticBoxSizer3->Add(m_ViaAltDrillValueTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); "Default Via Drill" ),
wxDefaultPosition,
wxDefaultSize, 0 );
m_OptCustomViaDrill = new wxTextCtrl( itemDialog1, ID_TEXTCTRL2, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); itemStaticBoxSizer3->Add( m_ViaDefaultDrillValueTitle,
itemStaticBoxSizer3->Add(m_OptCustomViaDrill, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); 0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_OptViaDrill = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(
"" ), wxDefaultPosition,
wxDefaultSize, 0 );
itemStaticBoxSizer3->Add( m_OptViaDrill, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
m_ViaAltDrillValueTitle = new wxStaticText( itemDialog1, wxID_STATIC, _(
"Alternate Via Drill" ),
wxDefaultPosition,
wxDefaultSize, 0 );
itemStaticBoxSizer3->Add( m_ViaAltDrillValueTitle,
0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_OptCustomViaDrill = new wxTextCtrl( itemDialog1, ID_TEXTCTRL2, _T(
"" ), wxDefaultPosition,
wxDefaultSize, 0 );
itemStaticBoxSizer3->Add( m_OptCustomViaDrill, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
wxArrayString m_OptViaTypeStrings; wxArrayString m_OptViaTypeStrings;
m_OptViaTypeStrings.Add(_("Through Via")); m_OptViaTypeStrings.Add( _( "Through Via" ) );
m_OptViaTypeStrings.Add(_("Blind or Buried Via ")); m_OptViaTypeStrings.Add( _( "Blind or Buried Via " ) );
m_OptViaType = new wxRadioBox( itemDialog1, ID_VIA_TYPE_SELECTION, _("Default Via Type"), wxDefaultPosition, wxDefaultSize, m_OptViaTypeStrings, 1, wxRA_SPECIFY_COLS ); m_OptViaType = new wxRadioBox( itemDialog1,
m_OptViaType->SetSelection(0); ID_VIA_TYPE_SELECTION,
itemStaticBoxSizer3->Add(m_OptViaType, 0, wxGROW|wxALL, 5); _( "Default Via Type" ),
wxDefaultPosition,
wxDefaultSize,
m_OptViaTypeStrings,
1,
wxRA_SPECIFY_COLS );
m_OptViaType->SetSelection( 0 );
itemStaticBoxSizer3->Add( m_OptViaType, 0, wxGROW | wxALL, 5 );
wxStaticBox* itemStaticBoxSizer11Static = new wxStaticBox( itemDialog1, wxID_ANY, _(
"Micro Vias:" ) );
wxStaticBoxSizer* itemStaticBoxSizer11 = new wxStaticBoxSizer(
itemStaticBoxSizer11Static,
wxVERTICAL );
itemBoxSizer2->Add( itemStaticBoxSizer11, 0, wxGROW | wxALL, 5 );
m_MicroViaSizeTitle = new wxStaticText( itemDialog1, wxID_STATIC, _(
"Micro Via Size" ),
wxDefaultPosition,
wxDefaultSize, 0 );
itemStaticBoxSizer11->Add( m_MicroViaSizeTitle, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );
m_MicroViaSizeCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL7, _T(
"" ), wxDefaultPosition,
wxDefaultSize, 0 );
itemStaticBoxSizer11->Add( m_MicroViaSizeCtrl, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
m_MicroViaDrillTitle = new wxStaticText( itemDialog1, wxID_STATIC, _(
"Micro Via Drill" ),
wxDefaultPosition,
wxDefaultSize, 0 );
itemStaticBoxSizer11->Add( m_MicroViaDrillTitle, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 );
m_MicroViaDrillCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL6, _T(
"" ), wxDefaultPosition,
wxDefaultSize, 0 );
itemStaticBoxSizer11->Add( m_MicroViaDrillCtrl, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
itemStaticBoxSizer11->Add( 5, 5, 0, wxGROW | wxALL, 5 );
m_AllowMicroViaCtrl = new wxCheckBox( itemDialog1, ID_CHECKBOX_ALLOWS_MICROVIA, _(
"Allows Micro Vias" ), wxDefaultPosition,
wxDefaultSize, 0 );
m_AllowMicroViaCtrl->SetValue( false );
m_AllowMicroViaCtrl->SetHelpText( _(
"Allows use of micro vias\nThey are very small vias only from an external copper layer to its near neightbour\n" ) );
if( WinEDA_PcbTracksDialog::ShowToolTips() )
m_AllowMicroViaCtrl->SetToolTip( _(
"Allows use of micro vias\nThey are very small vias only from an external copper layer to its near neightbour\n" ) );
itemStaticBoxSizer11->Add( m_AllowMicroViaCtrl, 0, wxGROW | wxALL, 5 );
wxStaticBox* itemStaticBoxSizer11Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Micro Vias:")); wxBoxSizer* itemBoxSizer18 = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* itemStaticBoxSizer11 = new wxStaticBoxSizer(itemStaticBoxSizer11Static, wxVERTICAL);
itemBoxSizer2->Add(itemStaticBoxSizer11, 0, wxGROW|wxALL, 5);
m_MicroViaSizeTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Micro Via Size"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer2->Add( itemBoxSizer18, 0, wxGROW | wxALL, 5 );
itemStaticBoxSizer11->Add(m_MicroViaSizeTitle, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
m_MicroViaSizeCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL7, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); m_TrackWidthTitle = new wxStaticText( itemDialog1, wxID_STATIC, _(
itemStaticBoxSizer11->Add(m_MicroViaSizeCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); "Track Width" ), wxDefaultPosition,
wxDefaultSize, 0 );
m_MicroViaDrillTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Micro Via Drill"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer18->Add( m_TrackWidthTitle,
itemStaticBoxSizer11->Add(m_MicroViaDrillTitle, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); 0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_MicroViaDrillCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL6, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); m_OptTrackWidth = new wxTextCtrl( itemDialog1, ID_TEXTCTRL3, _T(
itemStaticBoxSizer11->Add(m_MicroViaDrillCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); "" ), wxDefaultPosition, wxDefaultSize, 0 );
itemStaticBoxSizer11->Add(5, 5, 0, wxGROW|wxALL, 5); itemBoxSizer18->Add( m_OptTrackWidth, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
m_AllowMicroViaCtrl = new wxCheckBox( itemDialog1, ID_CHECKBOX_ALLOWS_MICROVIA, _("Allows Micro Vias"), wxDefaultPosition, wxDefaultSize, 0 ); m_TrackClearanceTitle = new wxStaticText( itemDialog1, wxID_STATIC, _(
m_AllowMicroViaCtrl->SetValue(false); "Clearance" ), wxDefaultPosition,
m_AllowMicroViaCtrl->SetHelpText(_("Allows use of micro vias\nThey are very small vias only from an external copper layer to its near neightbour\n")); wxDefaultSize, 0 );
if (WinEDA_PcbTracksDialog::ShowToolTips())
m_AllowMicroViaCtrl->SetToolTip(_("Allows use of micro vias\nThey are very small vias only from an external copper layer to its near neightbour\n"));
itemStaticBoxSizer11->Add(m_AllowMicroViaCtrl, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxVERTICAL); itemBoxSizer18->Add( m_TrackClearanceTitle,
itemBoxSizer2->Add(itemBoxSizer18, 0, wxGROW|wxALL, 5); 0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_TrackWidthTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Track Width"), wxDefaultPosition, wxDefaultSize, 0 ); m_OptTrackClearance = new wxTextCtrl( itemDialog1, ID_TEXTCTRL4, _T(
itemBoxSizer18->Add(m_TrackWidthTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); "" ), wxDefaultPosition, wxDefaultSize, 0 );
m_OptTrackWidth = new wxTextCtrl( itemDialog1, ID_TEXTCTRL3, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer18->Add( m_OptTrackClearance, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
itemBoxSizer18->Add(m_OptTrackWidth, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
m_TrackClearanceTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Clearance"), wxDefaultPosition, wxDefaultSize, 0 ); m_MaskClearanceTitle = new wxStaticText( itemDialog1, wxID_STATIC, _(
itemBoxSizer18->Add(m_TrackClearanceTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); "Mask clearance" ), wxDefaultPosition,
wxDefaultSize, 0 );
m_OptTrackClearance = new wxTextCtrl( itemDialog1, ID_TEXTCTRL4, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer18->Add( m_MaskClearanceTitle,
itemBoxSizer18->Add(m_OptTrackClearance, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); 0,
wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE,
5 );
m_MaskClearanceTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Mask clearance"), wxDefaultPosition, wxDefaultSize, 0 ); m_OptMaskMargin = new wxTextCtrl( itemDialog1, ID_TEXTCTRL5, _T(
itemBoxSizer18->Add(m_MaskClearanceTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); "" ), wxDefaultPosition, wxDefaultSize, 0 );
m_OptMaskMargin = new wxTextCtrl( itemDialog1, ID_TEXTCTRL5, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer18->Add( m_OptMaskMargin, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 );
itemBoxSizer18->Add(m_OptMaskMargin, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* itemBoxSizer25 = new wxBoxSizer( wxVERTICAL );
itemBoxSizer2->Add(itemBoxSizer25, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* itemButton26 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer2->Add( itemBoxSizer25, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
itemButton26->SetForegroundColour(wxColour(210, 0, 0));
itemBoxSizer25->Add(itemButton26, 0, wxGROW|wxALL, 5);
wxButton* itemButton27 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, wxBU_LEFT ); wxButton* itemButton26 = new wxButton( itemDialog1, wxID_OK, _(
itemButton27->SetForegroundColour(wxColour(0, 0, 255)); "&OK" ), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer25->Add(itemButton27, 0, wxGROW|wxALL, 5);
itemButton26->SetForegroundColour( wxColour( 210, 0, 0 ) );
itemBoxSizer25->Add( itemButton26, 0, wxGROW | wxALL, 5 );
wxButton* itemButton27 = new wxButton( itemDialog1, wxID_CANCEL, _(
"&Cancel" ), wxDefaultPosition,
wxDefaultSize, wxBU_LEFT );
itemButton27->SetForegroundColour( wxColour( 0, 0, 255 ) );
itemBoxSizer25->Add( itemButton27, 0, wxGROW | wxALL, 5 );
// Set validators // Set validators
m_AllowMicroViaCtrl->SetValidator( wxGenericValidator(& g_DesignSettings.m_MicroViasAllowed) ); m_AllowMicroViaCtrl->SetValidator( wxGenericValidator( &g_DesignSettings.m_MicroViasAllowed ) );
////@end WinEDA_PcbTracksDialog content construction ////@end WinEDA_PcbTracksDialog content construction
SetDisplayValue(); SetDisplayValue();
} }
/*! /*!
* Should we show tooltips? * Should we show tooltips?
*/ */
...@@ -232,6 +348,7 @@ bool WinEDA_PcbTracksDialog::ShowToolTips() ...@@ -232,6 +348,7 @@ bool WinEDA_PcbTracksDialog::ShowToolTips()
return true; return true;
} }
/*! /*!
* Get bitmap resources * Get bitmap resources
*/ */
...@@ -240,11 +357,13 @@ wxBitmap WinEDA_PcbTracksDialog::GetBitmapResource( const wxString& name ) ...@@ -240,11 +357,13 @@ wxBitmap WinEDA_PcbTracksDialog::GetBitmapResource( const wxString& name )
{ {
// Bitmap retrieval // Bitmap retrieval
////@begin WinEDA_PcbTracksDialog bitmap retrieval ////@begin WinEDA_PcbTracksDialog bitmap retrieval
wxUnusedVar(name); wxUnusedVar( name );
return wxNullBitmap; return wxNullBitmap;
////@end WinEDA_PcbTracksDialog bitmap retrieval ////@end WinEDA_PcbTracksDialog bitmap retrieval
} }
/*! /*!
* Get icon resources * Get icon resources
*/ */
...@@ -253,139 +372,162 @@ wxIcon WinEDA_PcbTracksDialog::GetIconResource( const wxString& name ) ...@@ -253,139 +372,162 @@ wxIcon WinEDA_PcbTracksDialog::GetIconResource( const wxString& name )
{ {
// Icon retrieval // Icon retrieval
////@begin WinEDA_PcbTracksDialog icon retrieval ////@begin WinEDA_PcbTracksDialog icon retrieval
wxUnusedVar(name); wxUnusedVar( name );
return wxNullIcon; return wxNullIcon;
////@end WinEDA_PcbTracksDialog icon retrieval ////@end WinEDA_PcbTracksDialog icon retrieval
} }
/*************************************************/ /*************************************************/
void WinEDA_PcbTracksDialog::SetDisplayValue() void WinEDA_PcbTracksDialog::SetDisplayValue()
/*************************************************/ /*************************************************/
{ {
AddUnitSymbol(*m_ViaSizeTitle); AddUnitSymbol( *m_ViaSizeTitle );
AddUnitSymbol(*m_MicroViaSizeTitle); AddUnitSymbol( *m_MicroViaSizeTitle );
AddUnitSymbol(*m_ViaDefaultDrillValueTitle); AddUnitSymbol( *m_ViaDefaultDrillValueTitle );
AddUnitSymbol(*m_MicroViaDrillTitle); AddUnitSymbol( *m_MicroViaDrillTitle );
AddUnitSymbol(*m_ViaAltDrillValueTitle); AddUnitSymbol( *m_ViaAltDrillValueTitle );
AddUnitSymbol(*m_TrackWidthTitle); AddUnitSymbol( *m_TrackWidthTitle );
AddUnitSymbol(*m_TrackClearanceTitle); AddUnitSymbol( *m_TrackClearanceTitle );
AddUnitSymbol(*m_MaskClearanceTitle); AddUnitSymbol( *m_MaskClearanceTitle );
int Internal_Unit = m_Parent->m_InternalUnits; int Internal_Unit = m_Parent->m_InternalUnits;
PutValueInLocalUnits(*m_OptViaSize, g_DesignSettings.m_CurrentViaSize, Internal_Unit); PutValueInLocalUnits( *m_OptViaSize, g_DesignSettings.m_CurrentViaSize, Internal_Unit );
PutValueInLocalUnits(*m_MicroViaSizeCtrl, g_DesignSettings.m_CurrentMicroViaSize, Internal_Unit); PutValueInLocalUnits( *m_MicroViaSizeCtrl,
PutValueInLocalUnits(*m_OptViaDrill, g_DesignSettings.m_ViaDrill, Internal_Unit); g_DesignSettings.m_CurrentMicroViaSize,
PutValueInLocalUnits(*m_MicroViaDrillCtrl, g_DesignSettings.m_MicroViaDrill, Internal_Unit); Internal_Unit );
PutValueInLocalUnits(*m_OptCustomViaDrill, g_ViaHoleLastValue, Internal_Unit); PutValueInLocalUnits( *m_OptViaDrill, g_DesignSettings.m_ViaDrill, Internal_Unit );
PutValueInLocalUnits(*m_OptTrackWidth, g_DesignSettings.m_CurrentTrackWidth, Internal_Unit); PutValueInLocalUnits( *m_MicroViaDrillCtrl, g_DesignSettings.m_MicroViaDrill, Internal_Unit );
PutValueInLocalUnits(*m_OptTrackClearance, g_DesignSettings.m_TrackClearence, Internal_Unit); PutValueInLocalUnits( *m_OptCustomViaDrill, g_ViaHoleLastValue, Internal_Unit );
PutValueInLocalUnits(*m_OptMaskMargin, g_DesignSettings.m_MaskMargin, Internal_Unit); PutValueInLocalUnits( *m_OptTrackWidth, g_DesignSettings.m_CurrentTrackWidth, Internal_Unit );
if ( g_DesignSettings.m_CurrentViaType != VIA_THROUGH ) PutValueInLocalUnits( *m_OptTrackClearance, g_DesignSettings.m_TrackClearence, Internal_Unit );
m_OptViaType->SetSelection(1); PutValueInLocalUnits( *m_OptMaskMargin, g_DesignSettings.m_MaskMargin, Internal_Unit );
if( g_DesignSettings.m_CurrentViaType != VIA_THROUGH )
m_MicroViaSizeTitle->Enable(g_DesignSettings.m_MicroViasAllowed); m_OptViaType->SetSelection( 1 );
m_MicroViaSizeCtrl->Enable(g_DesignSettings.m_MicroViasAllowed);
m_MicroViaSizeTitle->Enable( g_DesignSettings.m_MicroViasAllowed );
m_MicroViaDrillTitle->Enable(g_DesignSettings.m_MicroViasAllowed); m_MicroViaSizeCtrl->Enable( g_DesignSettings.m_MicroViasAllowed );
m_MicroViaDrillCtrl->Enable(g_DesignSettings.m_MicroViasAllowed);
m_MicroViaDrillTitle->Enable( g_DesignSettings.m_MicroViasAllowed );
m_MicroViaDrillCtrl->Enable( g_DesignSettings.m_MicroViasAllowed );
} }
/*******************************************************************/ /*******************************************************************/
void WinEDA_PcbTracksDialog::AcceptPcbOptions(wxCommandEvent& event) void WinEDA_PcbTracksDialog::AcceptPcbOptions( wxCommandEvent& event )
/*******************************************************************/ /*******************************************************************/
{ {
g_DesignSettings.m_CurrentViaType = VIA_THROUGH; g_DesignSettings.m_CurrentViaType = VIA_THROUGH;
if ( m_OptViaType->GetSelection() > 0 ) if( m_OptViaType->GetSelection() > 0 )
g_DesignSettings.m_CurrentViaType = VIA_BLIND_BURIED; g_DesignSettings.m_CurrentViaType = VIA_BLIND_BURIED;
g_DesignSettings.m_CurrentViaSize = g_DesignSettings.m_CurrentViaSize =
ReturnValueFromTextCtrl(*m_OptViaSize, m_Parent->m_InternalUnits); ReturnValueFromTextCtrl( *m_OptViaSize, m_Parent->m_InternalUnits );
g_DesignSettings.m_CurrentMicroViaSize = g_DesignSettings.m_CurrentMicroViaSize =
ReturnValueFromTextCtrl(*m_MicroViaSizeCtrl, m_Parent->m_InternalUnits); ReturnValueFromTextCtrl( *m_MicroViaSizeCtrl, m_Parent->m_InternalUnits );
g_DesignSettings.m_MicroViaDrill = g_DesignSettings.m_MicroViaDrill =
ReturnValueFromTextCtrl(*m_MicroViaDrillCtrl, m_Parent->m_InternalUnits); ReturnValueFromTextCtrl( *m_MicroViaDrillCtrl, m_Parent->m_InternalUnits );
g_DesignSettings.m_ViaDrill = g_DesignSettings.m_ViaDrill =
ReturnValueFromTextCtrl(*m_OptViaDrill, m_Parent->m_InternalUnits); ReturnValueFromTextCtrl( *m_OptViaDrill, m_Parent->m_InternalUnits );
g_ViaHoleLastValue = g_ViaHoleLastValue =
ReturnValueFromTextCtrl(*m_OptCustomViaDrill, m_Parent->m_InternalUnits); ReturnValueFromTextCtrl( *m_OptCustomViaDrill, m_Parent->m_InternalUnits );
g_DesignSettings.m_MicroViasAllowed = m_AllowMicroViaCtrl->IsChecked(); g_DesignSettings.m_MicroViasAllowed = m_AllowMicroViaCtrl->IsChecked();
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_TrackClearence =
ReturnValueFromTextCtrl(*m_OptTrackClearance, m_Parent->m_InternalUnits); ReturnValueFromTextCtrl( *m_OptTrackClearance, m_Parent->m_InternalUnits );
g_DesignSettings.m_MaskMargin = g_DesignSettings.m_MaskMargin =
ReturnValueFromTextCtrl(*m_OptMaskMargin, m_Parent->m_InternalUnits); ReturnValueFromTextCtrl( *m_OptMaskMargin, m_Parent->m_InternalUnits );
m_Parent->DisplayTrackSettings(); m_Parent->DisplayTrackSettings();
m_Parent->AddHistory(g_DesignSettings.m_CurrentViaSize, TYPEVIA); m_Parent->AddHistory( g_DesignSettings.m_CurrentViaSize, TYPEVIA );
m_Parent->AddHistory(g_DesignSettings.m_CurrentTrackWidth, TYPETRACK); m_Parent->AddHistory( g_DesignSettings.m_CurrentTrackWidth, TYPETRACK );
EndModal(1); EndModal( 1 );
} }
/*********************************************************************/ /*********************************************************************/
void WinEDA_BasePcbFrame::AddHistory(int value, KICAD_T type) void WinEDA_BasePcbFrame::AddHistory( int value, KICAD_T type )
/**********************************************************************/ /**********************************************************************/
// Mise a jour des listes des dernieres epaisseurs de via et track utilisées // Mise a jour des listes des dernieres epaisseurs de via et track utilisées
{ {
bool addhistory = TRUE; bool addhistory = TRUE;
int ii; int ii;
switch ( type ) switch( type )
{ {
case TYPETRACK: case TYPETRACK:
for ( ii = 0; ii < HIST0RY_NUMBER; ii++) for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{ {
if ( g_DesignSettings.m_TrackWidhtHistory[ii] == value ) if( g_DesignSettings.m_TrackWidthHistory[ii] == value )
{ {
addhistory = FALSE; break; addhistory = FALSE;
break;
} }
} }
if ( ! addhistory ) break;
for ( ii = HIST0RY_NUMBER -1; ii > 0 ; ii--) if( !addhistory )
break;
for( ii = HISTORY_NUMBER-1; ii > 0; ii-- )
{ {
g_DesignSettings.m_TrackWidhtHistory[ii] = g_DesignSettings.m_TrackWidhtHistory[ii-1]; g_DesignSettings.m_TrackWidthHistory[ii] = g_DesignSettings.m_TrackWidthHistory[ii-1];
} }
g_DesignSettings.m_TrackWidhtHistory[0] = value;
g_DesignSettings.m_TrackWidthHistory[0] = value;
// Reclassement par valeur croissante // Reclassement par valeur croissante
for ( ii = 0; ii < HIST0RY_NUMBER -1; ii++) for( ii = 0; ii < HISTORY_NUMBER-1; ii++ )
{ {
if ( g_DesignSettings.m_TrackWidhtHistory[ii+1] == 0 ) break; // Fin de liste if( g_DesignSettings.m_TrackWidthHistory[ii+1] == 0 )
if ( g_DesignSettings.m_TrackWidhtHistory[ii] > g_DesignSettings.m_TrackWidhtHistory[ii+1] ) break; // Fin de liste
if( g_DesignSettings.m_TrackWidthHistory[ii] >
g_DesignSettings.m_TrackWidthHistory[ii+1] )
{ {
EXCHG(g_DesignSettings.m_TrackWidhtHistory[ii], g_DesignSettings.m_TrackWidhtHistory[ii+1]); EXCHG( g_DesignSettings.m_TrackWidthHistory[ii],
g_DesignSettings.m_TrackWidthHistory[ii + 1] );
} }
} }
break; break;
case TYPEVIA: case TYPEVIA:
for ( ii = 0; ii < HIST0RY_NUMBER; ii++) for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{ {
if (g_DesignSettings.m_ViaSizeHistory[ii] == value) if( g_DesignSettings.m_ViaSizeHistory[ii] == value )
{ {
addhistory = FALSE; break; addhistory = FALSE;
break;
} }
} }
if ( ! addhistory ) break;
for ( ii = HIST0RY_NUMBER -1; ii > 0 ; ii--) if( !addhistory )
break;
for( ii = HISTORY_NUMBER-1; ii > 0; ii-- )
{ {
g_DesignSettings.m_ViaSizeHistory[ii] = g_DesignSettings.m_ViaSizeHistory[ii-1]; g_DesignSettings.m_ViaSizeHistory[ii] = g_DesignSettings.m_ViaSizeHistory[ii-1];
} }
g_DesignSettings.m_ViaSizeHistory[0] = value; g_DesignSettings.m_ViaSizeHistory[0] = value;
// Reclassement par valeur croissante // Reclassement par valeur croissante
for ( ii = 0; ii < HIST0RY_NUMBER -1; ii++) for( ii = 0; ii < HISTORY_NUMBER-1; ii++ )
{ {
if ( g_DesignSettings.m_ViaSizeHistory[ii+1] == 0 ) break; // Fin de liste if( g_DesignSettings.m_ViaSizeHistory[ii+1] == 0 )
if ( g_DesignSettings.m_ViaSizeHistory[ii] > g_DesignSettings.m_ViaSizeHistory[ii+1] ) break; // Fin de liste
if( g_DesignSettings.m_ViaSizeHistory[ii] > g_DesignSettings.m_ViaSizeHistory[ii+1] )
{ {
EXCHG(g_DesignSettings.m_ViaSizeHistory[ii], g_DesignSettings.m_ViaSizeHistory[ii+1]); EXCHG( g_DesignSettings.m_ViaSizeHistory[ii],
g_DesignSettings.m_ViaSizeHistory[ii+1] );
} }
} }
break; break;
...@@ -402,9 +544,10 @@ int ii; ...@@ -402,9 +544,10 @@ int ii;
void WinEDA_PcbTracksDialog::OnOkClick( wxCommandEvent& event ) void WinEDA_PcbTracksDialog::OnOkClick( wxCommandEvent& event )
{ {
AcceptPcbOptions(event); AcceptPcbOptions( event );
} }
/*! /*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
*/ */
...@@ -414,11 +557,11 @@ void WinEDA_PcbTracksDialog::OnCancelClick( wxCommandEvent& event ) ...@@ -414,11 +557,11 @@ void WinEDA_PcbTracksDialog::OnCancelClick( wxCommandEvent& event )
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_PcbTracksDialog. ////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_PcbTracksDialog.
// Before editing this code, remove the block markers. // Before editing this code, remove the block markers.
event.Skip(); event.Skip();
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_PcbTracksDialog. ////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_PcbTracksDialog.
} }
/*! /*!
* wxEVT_INIT_DIALOG event handler for ID_DIALOG * wxEVT_INIT_DIALOG event handler for ID_DIALOG
*/ */
...@@ -428,7 +571,7 @@ void WinEDA_PcbTracksDialog::OnInitDialog( wxInitDialogEvent& event ) ...@@ -428,7 +571,7 @@ void WinEDA_PcbTracksDialog::OnInitDialog( wxInitDialogEvent& event )
m_OptViaSize->SetFocus(); m_OptViaSize->SetFocus();
// deselect the existing text, seems SetFocus() wants to emulate Microsoft, which is not desireable here. // deselect the existing text, seems SetFocus() wants to emulate Microsoft, which is not desireable here.
m_OptViaSize->SetSelection(0,0); m_OptViaSize->SetSelection( 0, 0 );
event.Skip(); event.Skip();
} }
...@@ -441,9 +584,9 @@ void WinEDA_PcbTracksDialog::OnInitDialog( wxInitDialogEvent& event ) ...@@ -441,9 +584,9 @@ void WinEDA_PcbTracksDialog::OnInitDialog( wxInitDialogEvent& event )
void WinEDA_PcbTracksDialog::OnCheckboxAllowsMicroviaClick( wxCommandEvent& event ) void WinEDA_PcbTracksDialog::OnCheckboxAllowsMicroviaClick( wxCommandEvent& event )
{ {
bool state = m_AllowMicroViaCtrl->IsChecked(); bool state = m_AllowMicroViaCtrl->IsChecked();
m_MicroViaSizeTitle->Enable(state);
m_MicroViaSizeCtrl->Enable(state);
m_MicroViaDrillTitle->Enable(state);
m_MicroViaDrillCtrl->Enable(state);
}
m_MicroViaSizeTitle->Enable( state );
m_MicroViaSizeCtrl->Enable( state );
m_MicroViaDrillTitle->Enable( state );
m_MicroViaDrillCtrl->Enable( state );
}
...@@ -829,7 +829,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -829,7 +829,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_AUX_TOOLBAR_PCB_TRACK_WIDTH: case ID_AUX_TOOLBAR_PCB_TRACK_WIDTH:
{ {
int ii = m_SelTrackWidthBox->GetChoice(); int ii = m_SelTrackWidthBox->GetChoice();
g_DesignSettings.m_CurrentTrackWidth = g_DesignSettings.m_TrackWidhtHistory[ii]; g_DesignSettings.m_CurrentTrackWidth = g_DesignSettings.m_TrackWidthHistory[ii];
DisplayTrackSettings(); DisplayTrackSettings();
m_SelTrackWidthBox_Changed = FALSE; m_SelTrackWidthBox_Changed = FALSE;
m_SelViaSizeBox_Changed = FALSE; m_SelViaSizeBox_Changed = FALSE;
...@@ -847,7 +847,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -847,7 +847,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
{ {
int ii = id - ID_POPUP_PCB_SELECT_WIDTH1; int ii = id - ID_POPUP_PCB_SELECT_WIDTH1;
g_DesignSettings.m_CurrentTrackWidth = g_DesignSettings.m_TrackWidhtHistory[ii]; g_DesignSettings.m_CurrentTrackWidth = g_DesignSettings.m_TrackWidthHistory[ii];
DisplayTrackSettings(); DisplayTrackSettings();
} }
break; break;
......
...@@ -192,13 +192,13 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query ) ...@@ -192,13 +192,13 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query )
g_HightLigt_Status = 0; g_HightLigt_Status = 0;
for( int ii = 1; ii < HIST0RY_NUMBER; ii++ ) for( int ii = 1; ii < HISTORY_NUMBER; ii++ )
{ {
g_DesignSettings.m_ViaSizeHistory[ii] = g_DesignSettings.m_ViaSizeHistory[ii] =
g_DesignSettings.m_TrackWidhtHistory[ii] = 0; g_DesignSettings.m_TrackWidthHistory[ii] = 0;
} }
g_DesignSettings.m_TrackWidhtHistory[0] = g_DesignSettings.m_CurrentTrackWidth; g_DesignSettings.m_TrackWidthHistory[0] = g_DesignSettings.m_CurrentTrackWidth;
g_DesignSettings.m_ViaSizeHistory[0] = g_DesignSettings.m_CurrentViaSize; g_DesignSettings.m_ViaSizeHistory[0] = g_DesignSettings.m_CurrentViaSize;
Zoom_Automatique( TRUE ); Zoom_Automatique( TRUE );
......
...@@ -519,12 +519,12 @@ static int WriteSetup( FILE* File, WinEDA_BasePcbFrame* frame ) ...@@ -519,12 +519,12 @@ static int WriteSetup( FILE* File, WinEDA_BasePcbFrame* frame )
fprintf( File, "Layers %d\n", g_DesignSettings.m_CopperLayerCount ); fprintf( File, "Layers %d\n", g_DesignSettings.m_CopperLayerCount );
fprintf( File, "TrackWidth %d\n", g_DesignSettings.m_CurrentTrackWidth ); fprintf( File, "TrackWidth %d\n", g_DesignSettings.m_CurrentTrackWidth );
for( ii = 0; ii < HIST0RY_NUMBER; ii++ ) for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{ {
if( g_DesignSettings.m_TrackWidhtHistory[ii] == 0 ) if( g_DesignSettings.m_TrackWidthHistory[ii] == 0 )
break; break;
fprintf( File, "TrackWidthHistory %d\n", fprintf( File, "TrackWidthHistory %d\n",
g_DesignSettings.m_TrackWidhtHistory[ii] ); g_DesignSettings.m_TrackWidthHistory[ii] );
} }
fprintf( File, "TrackClearence %d\n", g_DesignSettings.m_TrackClearence ); fprintf( File, "TrackClearence %d\n", g_DesignSettings.m_TrackClearence );
...@@ -534,7 +534,7 @@ static int WriteSetup( FILE* File, WinEDA_BasePcbFrame* frame ) ...@@ -534,7 +534,7 @@ static int WriteSetup( FILE* File, WinEDA_BasePcbFrame* frame )
fprintf( File, "EdgeSegmWidth %d\n", g_DesignSettings.m_EdgeSegmentWidth ); fprintf( File, "EdgeSegmWidth %d\n", g_DesignSettings.m_EdgeSegmentWidth );
fprintf( File, "ViaSize %d\n", g_DesignSettings.m_CurrentViaSize ); fprintf( File, "ViaSize %d\n", g_DesignSettings.m_CurrentViaSize );
fprintf( File, "ViaDrill %d\n", g_DesignSettings.m_ViaDrill ); fprintf( File, "ViaDrill %d\n", g_DesignSettings.m_ViaDrill );
for( ii = 0; ii < HIST0RY_NUMBER; ii++ ) for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{ {
if( g_DesignSettings.m_ViaSizeHistory[ii] == 0 ) if( g_DesignSettings.m_ViaSizeHistory[ii] == 0 )
break; break;
......
...@@ -71,12 +71,12 @@ static wxMenu* Append_Track_Width_List() ...@@ -71,12 +71,12 @@ static wxMenu* Append_Track_Width_List()
double value; double value;
trackwidth_menu = new wxMenu; trackwidth_menu = new wxMenu;
for( ii = 0; (ii < HIST0RY_NUMBER) && (ii < TRACK_HISTORY_NUMBER_MAX); ii++ ) for( ii = 0; (ii < HISTORY_NUMBER) && (ii < TRACK_HISTORY_NUMBER_MAX); ii++ )
{ {
if( g_DesignSettings.m_TrackWidhtHistory[ii] == 0 ) if( g_DesignSettings.m_TrackWidthHistory[ii] == 0 )
break; break;
value = To_User_Unit( g_UnitMetric, value = To_User_Unit( g_UnitMetric,
g_DesignSettings.m_TrackWidhtHistory[ii], g_DesignSettings.m_TrackWidthHistory[ii],
PCB_INTERNAL_UNIT ); PCB_INTERNAL_UNIT );
if( g_UnitMetric == INCHES ) // Affichage en mils if( g_UnitMetric == INCHES ) // Affichage en mils
msg.Printf( _( "Track %.1f" ), value * 1000 ); msg.Printf( _( "Track %.1f" ), value * 1000 );
...@@ -84,12 +84,12 @@ static wxMenu* Append_Track_Width_List() ...@@ -84,12 +84,12 @@ static wxMenu* Append_Track_Width_List()
msg.Printf( _( "Track %.3f" ), value ); msg.Printf( _( "Track %.3f" ), value );
trackwidth_menu->Append( ID_POPUP_PCB_SELECT_WIDTH1 + ii, msg, wxEmptyString, TRUE ); trackwidth_menu->Append( ID_POPUP_PCB_SELECT_WIDTH1 + ii, msg, wxEmptyString, TRUE );
if( g_DesignSettings.m_TrackWidhtHistory[ii] == g_DesignSettings.m_CurrentTrackWidth ) if( g_DesignSettings.m_TrackWidthHistory[ii] == g_DesignSettings.m_CurrentTrackWidth )
trackwidth_menu->Check( ID_POPUP_PCB_SELECT_WIDTH1 + ii, TRUE ); trackwidth_menu->Check( ID_POPUP_PCB_SELECT_WIDTH1 + ii, TRUE );
} }
trackwidth_menu->AppendSeparator(); trackwidth_menu->AppendSeparator();
for( ii = 0; (ii < HIST0RY_NUMBER) && (ii < VIA_HISTORY_NUMBER_MAX); ii++ ) for( ii = 0; (ii < HISTORY_NUMBER) && (ii < VIA_HISTORY_NUMBER_MAX); ii++ )
{ {
if( g_DesignSettings.m_ViaSizeHistory[ii] == 0 ) if( g_DesignSettings.m_ViaSizeHistory[ii] == 0 )
break; break;
......
...@@ -170,11 +170,11 @@ int ii; ...@@ -170,11 +170,11 @@ int ii;
ScreenPcb->m_UserGridUnit = g_UserGrid_Unit; ScreenPcb->m_UserGridUnit = g_UserGrid_Unit;
} }
g_DesignSettings.m_TrackWidhtHistory[0] = g_DesignSettings.m_CurrentTrackWidth; g_DesignSettings.m_TrackWidthHistory[0] = g_DesignSettings.m_CurrentTrackWidth;
g_DesignSettings.m_ViaSizeHistory[0] = g_DesignSettings.m_CurrentViaSize; g_DesignSettings.m_ViaSizeHistory[0] = g_DesignSettings.m_CurrentViaSize;
for ( ii = 1; ii < HIST0RY_NUMBER; ii++) for ( ii = 1; ii < HISTORY_NUMBER; ii++)
{ {
g_DesignSettings.m_TrackWidhtHistory[ii] = 0; g_DesignSettings.m_TrackWidthHistory[ii] = 0;
g_DesignSettings.m_ViaSizeHistory[ii] = 0; g_DesignSettings.m_ViaSizeHistory[ii] = 0;
} }
......
...@@ -452,12 +452,12 @@ void WinEDA_PcbFrame::SetToolbars() ...@@ -452,12 +452,12 @@ void WinEDA_PcbFrame::SetToolbars()
else else
format += wxT( " %.3f" ); format += wxT( " %.3f" );
for( ii = 0; ii < HIST0RY_NUMBER; ii++ ) for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{ {
if( g_DesignSettings.m_TrackWidhtHistory[ii] == 0 ) if( g_DesignSettings.m_TrackWidthHistory[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_TrackWidhtHistory[ii], g_DesignSettings.m_TrackWidthHistory[ii],
PCB_INTERNAL_UNIT ); PCB_INTERNAL_UNIT );
if( g_UnitMetric == INCHES ) if( g_UnitMetric == INCHES )
...@@ -467,7 +467,7 @@ void WinEDA_PcbFrame::SetToolbars() ...@@ -467,7 +467,7 @@ void WinEDA_PcbFrame::SetToolbars()
m_SelTrackWidthBox->Append( msg ); m_SelTrackWidthBox->Append( msg );
if( g_DesignSettings.m_TrackWidhtHistory[ii] == if( g_DesignSettings.m_TrackWidthHistory[ii] ==
g_DesignSettings.m_CurrentTrackWidth ) g_DesignSettings.m_CurrentTrackWidth )
m_SelTrackWidthBox->SetSelection( ii ); m_SelTrackWidthBox->SetSelection( ii );
} }
...@@ -484,7 +484,7 @@ void WinEDA_PcbFrame::SetToolbars() ...@@ -484,7 +484,7 @@ void WinEDA_PcbFrame::SetToolbars()
else else
format += wxT( " %.3f" ); format += wxT( " %.3f" );
for( ii = 0; ii < HIST0RY_NUMBER; ii++ ) for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{ {
if( g_DesignSettings.m_ViaSizeHistory[ii] == 0 ) if( g_DesignSettings.m_ViaSizeHistory[ii] == 0 )
break; // Fin de liste break; // Fin de liste
......
...@@ -1706,7 +1706,7 @@ public: ...@@ -1706,7 +1706,7 @@ public:
/** /**
* Class SHAPE * Class SHAPE
* corresponds to the "(shape ..)" element in the specctra dsn spec. * corresponds to the "(shape ..)" element in the specctra dsn spec.
* It is not a &lt;shape_descriptor&gt; which is one of things that this * It is not a &lt;shape_descriptor&gt;, which is one of things that this
* elements contains, i.e. in its "shape" field. This class also implements * elements contains, i.e. in its "shape" field. This class also implements
* the "(outline ...)" element as a dual personality. * the "(outline ...)" element as a dual personality.
*/ */
...@@ -1739,11 +1739,9 @@ public: ...@@ -1739,11 +1739,9 @@ public:
delete shape; delete shape;
} }
void SetShape( ELEM* aShape ) void SetShape( ELEM* aShape )
{ {
delete shape; delete shape;
shape = aShape; shape = aShape;
if( aShape ) if( aShape )
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "specctra.h" #include "specctra.h"
#include "collectors.h" #include "collectors.h"
#include "wxPcbStruct.h" // Change_Side_Module() #include "wxPcbStruct.h" // Change_Side_Module()
#include "pcbstruct.h" // HISTORY_NUMBER
using namespace DSN; using namespace DSN;
...@@ -240,9 +241,10 @@ static QARC* makeArc( const POINT& aStart, const POINT& aEnd, ...@@ -240,9 +241,10 @@ static QARC* makeArc( const POINT& aStart, const POINT& aEnd,
* makes all the PADSTACKs, and marks each D_PAD with the index into the * makes all the PADSTACKs, and marks each D_PAD with the index into the
* LIBRARY::padstacks list that it matches. * LIBRARY::padstacks list that it matches.
*/ */
static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, LIBRARY* aLibrary )
LIBRARY* aLibrary, PADSTACKS& aPadstacks )
{ {
char name[80]; // padstack name builder
if( aPads.GetCount() ) if( aPads.GetCount() )
{ {
qsort( (void*) aPads.BasePtr(), aPads.GetCount(), sizeof(D_PAD*), Pad_list_Sort_by_Shapes ); qsort( (void*) aPads.BasePtr(), aPads.GetCount(), sizeof(D_PAD*), Pad_list_Sort_by_Shapes );
...@@ -251,29 +253,56 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, ...@@ -251,29 +253,56 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads,
D_PAD* old_pad = NULL; D_PAD* old_pad = NULL;
int padstackNdx = 0; int padstackNdx = 0;
#define COPPER_LAYERS 2 // top and bottom
int reportedLayers = COPPER_LAYERS; // how many layers are reported.
// for now, report on only the top and bottom layers with respect to the copper // for now, report on only the top and bottom layers with respect to the copper
// within a padstack. this is usually correct, but not rigorous. We could do // within a pad's padstack. this is usually correct, but not rigorous. We could do
// better if there was actually a "layer type" field within Kicad which would // better if there was actually a "layer type" field within Kicad which would
// hold one of: T_signal, T_power, T_mixed, T_jumper // hold one of: T_signal, T_power, T_mixed, T_jumper
// See page bottom of page 74 of the SECCTRA Design Language Reference, May 2000. // See page bottom of page 74 of the SECCTRA Design Language Reference, May 2000.
std::string layerId[2] = { std::string layerId[COPPER_LAYERS] = {
CONV_TO_UTF8(aBoard->GetLayerName( LAYER_CMP_N )), CONV_TO_UTF8(aBoard->GetLayerName( LAYER_CMP_N )),
CONV_TO_UTF8(aBoard->GetLayerName( COPPER_LAYER_N )), CONV_TO_UTF8(aBoard->GetLayerName( COPPER_LAYER_N )),
}; };
#if 1
// late breaking news, we can use "signal" as the layer name and report the
// padstack as a single layer.
reportedLayers = 1;
layerId[0] = "signal";
#endif
for( int i=0; i<aPads.GetCount(); ++i ) for( int i=0; i<aPads.GetCount(); ++i )
{ {
D_PAD* pad = (D_PAD*) aPads[i]; D_PAD* pad = (D_PAD*) aPads[i];
pad->m_logical_connexion = padstackNdx; pad->m_logical_connexion = padstackNdx;
bool doLayer[COPPER_LAYERS] = {
pad->IsOnLayer( LAYER_CMP_N ),
pad->IsOnLayer( COPPER_LAYER_N )
};
if( old_pad && 0==D_PAD::Compare( old_pad, pad ) ) if( old_pad && 0==D_PAD::Compare( old_pad, pad ) )
{ {
continue; continue;
} }
// if pad has no copper presence, then it will be made into
// an "image->keepout" later. No copper pad here, it is probably a hole.
if( !doLayer[0] && !doLayer[1] )
{
continue;
}
#if 1 // late breaking news..... see above
doLayer[0] = true;
#endif
old_pad = pad; old_pad = pad;
// this is the index into the library->padstacks, be careful. // this is the index into the library->padstacks, be careful.
...@@ -289,11 +318,6 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, ...@@ -289,11 +318,6 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads,
// Note that the y correction here is set negative. // Note that the y correction here is set negative.
POINT padOffset( scale(pad->m_Offset.x), -scale(pad->m_Offset.y) ); POINT padOffset( scale(pad->m_Offset.x), -scale(pad->m_Offset.y) );
bool doLayer[2] = {
pad->IsOnLayer( LAYER_CMP_N ),
pad->IsOnLayer( COPPER_LAYER_N )
};
int coppers = 0; int coppers = 0;
switch( pad->m_PadShape ) switch( pad->m_PadShape )
...@@ -303,9 +327,9 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, ...@@ -303,9 +327,9 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads,
{ {
double diameter = scale(pad->m_Size.x); double diameter = scale(pad->m_Size.x);
for( int layer=0; layer<2; ++layer ) for( int layer=0; layer<reportedLayers; ++layer )
{ {
if( doLayer[i] ) if( doLayer[layer] )
{ {
CIRCLE* circle; CIRCLE* circle;
SHAPE* shape = new SHAPE( padstack ); SHAPE* shape = new SHAPE( padstack );
...@@ -322,8 +346,6 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, ...@@ -322,8 +346,6 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads,
} }
} }
char name[80];
snprintf( name, sizeof(name), "Round%dPad_%.6g_mil", coppers, scale(pad->m_Size.x) ); snprintf( name, sizeof(name), "Round%dPad_%.6g_mil", coppers, scale(pad->m_Size.x) );
name[ sizeof(name)-1 ] = 0; name[ sizeof(name)-1 ] = 0;
...@@ -347,9 +369,9 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, ...@@ -347,9 +369,9 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads,
lowerLeft += padOffset; lowerLeft += padOffset;
upperRight += padOffset; upperRight += padOffset;
for( int layer=0; layer<2; ++layer ) for( int layer=0; layer<reportedLayers; ++layer )
{ {
if( doLayer[i] ) if( doLayer[layer] )
{ {
SHAPE* shape = new SHAPE( padstack ); SHAPE* shape = new SHAPE( padstack );
padstack->Append( shape ); padstack->Append( shape );
...@@ -363,11 +385,8 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, ...@@ -363,11 +385,8 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads,
} }
} }
char name[80];
snprintf( name, sizeof(name), "Rect%dPad_%.6gx%.6g_mil", snprintf( name, sizeof(name), "Rect%dPad_%.6gx%.6g_mil",
coppers, scale(pad->m_Size.x), scale(pad->m_Size.y) ); coppers, scale(pad->m_Size.x), scale(pad->m_Size.y) );
name[ sizeof(name)-1 ] = 0; name[ sizeof(name)-1 ] = 0;
// @todo verify that all pad names are unique, there is a chance that // @todo verify that all pad names are unique, there is a chance that
...@@ -388,7 +407,9 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, ...@@ -388,7 +407,9 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads,
{ {
double radius = dy; double radius = dy;
for( int layer=0; layer<2; ++layer ) for( int layer=0; layer<reportedLayers; ++layer )
{
if( doLayer[layer] )
{ {
// each oval is 2 lines and 4 (quarter circle) qarcs // each oval is 2 lines and 4 (quarter circle) qarcs
...@@ -431,6 +452,8 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, ...@@ -431,6 +452,8 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads,
POINT( -dr + padOffset.x, padOffset.y ), // aCenter POINT( -dr + padOffset.x, padOffset.y ), // aCenter
layerId[layer] ); layerId[layer] );
shape->SetShape( qarc ); shape->SetShape( qarc );
++coppers;
}
} }
} }
else // oval is vertical else // oval is vertical
...@@ -439,7 +462,9 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, ...@@ -439,7 +462,9 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads,
dr = -dr; dr = -dr;
for( int layer=0; layer<2; ++layer ) for( int layer=0; layer<reportedLayers; ++layer )
{
if( doLayer[layer] )
{ {
// each oval is 2 lines and 2 qarcs // each oval is 2 lines and 2 qarcs
...@@ -482,14 +507,13 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, ...@@ -482,14 +507,13 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads,
POINT( padOffset.x, padOffset.y - dr ), // aCenter POINT( padOffset.x, padOffset.y - dr ), // aCenter
layerId[layer] ); layerId[layer] );
shape->SetShape( qarc ); shape->SetShape( qarc );
++coppers;
}
} }
} }
char name[80];
snprintf( name, sizeof(name), "Oval%dPad_%.6gx%.6g_mil", snprintf( name, sizeof(name), "Oval%dPad_%.6gx%.6g_mil",
coppers, scale(pad->m_Size.x), scale(pad->m_Size.y) ); coppers, scale(pad->m_Size.x), scale(pad->m_Size.y) );
name[ sizeof(name)-1 ] = 0; name[ sizeof(name)-1 ] = 0;
// @todo verify that all pad names are unique, there is a chance that // @todo verify that all pad names are unique, there is a chance that
...@@ -506,6 +530,57 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, ...@@ -506,6 +530,57 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads,
*/ */
} }
} }
// unique pads are now in the padstack. next we add the via's which may be used.
int defaultViaSize = aBoard->m_BoardSettings->m_CurrentViaSize;
if( defaultViaSize )
{
PADSTACK* padstack = new PADSTACK( aLibrary );
aLibrary->AddPadstack( padstack );
padstackNdx++; // remember this index, it is the default via
SHAPE* shape = new SHAPE( padstack );
padstack->Append( shape );
CIRCLE* circle = new CIRCLE( shape );
shape->SetShape( circle );
circle->SetLayerId( layerId[0].c_str() );
circle->SetDiameter( scale(defaultViaSize) );
padstack->SetPadstackId( "Via_Default" );
}
for( int i=0; i<HISTORY_NUMBER; ++i )
{
int viaSize = aBoard->m_BoardSettings->m_ViaSizeHistory[i];
if( !viaSize )
break;
if( viaSize == defaultViaSize )
continue;
PADSTACK* padstack = new PADSTACK( aLibrary );
aLibrary->AddPadstack( padstack );
padstackNdx++; // remember this index, it is the default via
SHAPE* shape = new SHAPE( padstack );
padstack->Append( shape );
CIRCLE* circle = new CIRCLE( shape );
shape->SetShape( circle );
circle->SetLayerId( layerId[0].c_str() );
circle->SetDiameter( scale(viaSize) );
snprintf( name, sizeof(name), "Via_%.6g_mil", scale(viaSize) );
name[ sizeof(name)-1 ] = 0;
// @todo verify that all pad names are unique, there is a chance that
// D_PAD::Compare() could say two pads are different, yet they get the same
// name here. If so, blend in the padNdx into the name.
padstack->SetPadstackId( name );
}
} }
...@@ -697,14 +772,22 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) ...@@ -697,14 +772,22 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
// get all the D_PADs into pads. // get all the D_PADs into pads.
pads.Collect( aBoard, scanPADs ); pads.Collect( aBoard, scanPADs );
makePADSTACKs( aBoard, pads, pcb->library );
makePADSTACKs( aBoard, pads, pcb->library, pcb->library->padstacks );
#if 0 && defined(DEBUG) #if 0 && defined(DEBUG)
for( int p=0; p<pads.GetCount(); ++p ) for( int p=0; p<pads.GetCount(); ++p )
pads[p]->Show( 0, std::cout ); pads[p]->Show( 0, std::cout );
#endif #endif
}
//-----<via_descriptor>-------------------------------------------------
{
// Output the vias in the padstack list here, by name
}
//-----<build the images>----------------------------------------------
{
/* /*
static const KICAD_T scanMODULEs[] = { TYPEMODULE, EOT }; static const KICAD_T scanMODULEs[] = { TYPEMODULE, EOT };
...@@ -714,7 +797,6 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) ...@@ -714,7 +797,6 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
{ {
MODULE* module = (MODULE*) items[m]; MODULE* module = (MODULE*) items[m];
// collate all the pads, and make a component. // collate all the pads, and make a component.
for( int p=0; p<pads.GetCount(); ++p ) for( int p=0; p<pads.GetCount(); ++p )
{ {
...@@ -729,11 +811,6 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) ...@@ -729,11 +811,6 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
*/ */
} }
//-----<via_descriptor>-------------------------------------------------
{
// Output the vias in the padstack list here, by name
}
// DSN Images (=Kicad MODULES and pads) must be presented from the // DSN Images (=Kicad MODULES and pads) must be presented from the
// top view. Restore those that were flipped. // top view. Restore those that were flipped.
......
...@@ -71,3 +71,9 @@ asked by: jp Charras ...@@ -71,3 +71,9 @@ asked by: jp Charras
Use the collector classes in eeschema. Use the collector classes in eeschema.
2008-Jan-25 Assigned To: any one who wants to
asked by: dick
================================================================================
Split the QARCs being created as 1/2 circles into quarter arcs. Problem
is in 4 places in specctra_export.cpp
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