diff --git a/change_log.txt b/change_log.txt index 6a22bde590..9779abf03c 100644 --- a/change_log.txt +++ b/change_log.txt @@ -8,28 +8,29 @@ email address. 2008-Jan-25 UPDATE Dick Hollenbeck ================================================================================ +pcbnew: - SPECCTRA export does padstacks ok, except that oval arcs need to be split - into quarter circle arcs, and no consideration is given to "layer types" + * 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". 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 ================================================================================ +pcbnew: - - void Change_Side_Module( MODULE* Module, wxDC* DC ) is now member of class BOARD. + - void Change_Side_Module( MODULE* Module, wxDC* DC ) is now member of class BOARD. - - Better support for micro vias and buried vias (drill files now are useable for board manufacturers) - But not yet tested by a board manufacturer. Be carefull. - Todo: tools to conversion between via through and buried via and buried viad optimisation. - But must works for micro vias (needed for my next board) - (in pcbnew micro vias are blind vias between 2 adjacent layers: micro vias must be enabled - in Dimensions/track and via menu, and placed by ctrl v. - They are intended to connect small pitch BGA pins to the inner layer, and can be drilled by laser - if the hole diameter is small < 0.2mm. A laser can only drill a hole between 2 adjacent layers ). - - ** Currently use buried via for tests only, not for production **. - + - Better support for micro vias and buried vias (drill files now are useable for board manufacturers) + But not yet tested by a board manufacturer. Be carefull. + Todo: tools to conversion between via through and buried via and buried viad optimisation. + But must works for micro vias (needed for my next board) + (in pcbnew micro vias are blind vias between 2 adjacent layers: micro vias must be enabled + in Dimensions/track and via menu, and placed by ctrl v. + They are intended to connect small pitch BGA pins to the inner layer, and can be drilled by laser + if the hole diameter is small < 0.2mm. A laser can only drill a hole between 2 adjacent layers ). + + ** Currently use buried via for tests only, not for production **. + 2008-Jan-24 UPDATE Dick Hollenbeck ================================================================================ @@ -45,8 +46,8 @@ email address. 2008-Jan-24 UPDATE Jean-Pierre Charras ================================================================================ +pcbnew: - Bugs about fill zones removed (not all, of course). - Fixed an old bug in block delete (could crashes pcbnew after deleting footprints). + Bugs about fill zones removed (not all, of course). + Fixed an old bug in block delete (could crashes pcbnew after deleting footprints). 2008-Jan-23 UPDATE Dick Hollenbeck ================================================================================ diff --git a/include/pcbstruct.h b/include/pcbstruct.h index 39a9d7ceb1..cee09c5069 100644 --- a/include/pcbstruct.h +++ b/include/pcbstruct.h @@ -1,5 +1,5 @@ /**************************************************************/ -/* pcbstruct.h : definition des structures de donnees type PCB */ +/* pcbstruct.h : definition des structures de donnees type PCB */ /**************************************************************/ #ifndef PCBSTRUCT_H @@ -144,7 +144,7 @@ struct CHEVELU; #include "class_board.h" // Class for handle current printed board design settings -#define HIST0RY_NUMBER 8 +#define HISTORY_NUMBER 8 class EDA_BoardDesignSettings { public: @@ -153,11 +153,11 @@ public: int m_MicroViaDrill; // micro via drill (for the entire board) int m_CurrentViaSize; // Current via size int m_CurrentMicroViaSize; // Current micro via size - bool m_MicroViasAllowed; // true to allow micro vias - int m_ViaSizeHistory[HIST0RY_NUMBER]; // Last HIST0RY_NUMBER used via sizes + bool m_MicroViasAllowed; // true to allow micro vias + 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_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_EdgeSegmentWidth; // current graphic line width (EDGE layer only) int m_PcbTextWidth; // current Pcb (not module) Text width @@ -226,13 +226,13 @@ public: */ BOARD_ITEM* GetCurItem() const { return (BOARD_ITEM*) BASE_SCREEN::GetCurItem(); } - /* Return true if a microvia can be put on board - * A microvia ia a small via restricted to 2 near neighbour layers + /* Return true if a microvia can be put on board + * A microvia ia a small via restricted to 2 near neighbour layers * because its is hole is made by laser which can penetrate only one layer - * It is mainly used to connect BGA to the first inner layer - * And it is allowed from an external layer to the first inner layer + * It is mainly used to connect BGA to the first inner layer + * And it is allowed from an external layer to the first inner layer */ - bool IsMicroViaAcceptable(void); + bool IsMicroViaAcceptable(void); }; /**********************************/ @@ -240,9 +240,9 @@ public: /**********************************/ #include "class_pad.h" // class for pads -#include "class_edge_mod.h" // Class for footprint graphic elements -#include "class_text_mod.h" // Class for footprint fields -#include "class_module.h" // Class for the footprint +#include "class_edge_mod.h" // Class for footprint graphic elements +#include "class_text_mod.h" // Class for footprint fields +#include "class_module.h" // Class for the footprint #include "class_equipot.h" diff --git a/pcbnew/classpcb.cpp b/pcbnew/classpcb.cpp index 955ea76ccb..366efbde58 100644 --- a/pcbnew/classpcb.cpp +++ b/pcbnew/classpcb.cpp @@ -127,7 +127,8 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings() // Default values for designing boards { int ii; - int default_layer_color[32] = { + + static const int default_layer_color[32] = { GREEN, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, @@ -150,10 +151,10 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings() m_CurrentViaSize = 450; // Current via size m_CurrentViaType = VIA_THROUGH; /* via type (BLIND, TROUGHT ...), bits 1 and 2 (not 0 and 1)*/ 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_ViaSizeHistory[ii] = 0; // Last HIST0RY_NUMBER used via sizes + m_TrackWidthHistory[ii] = 0; // Last HISTORY_NUMBER used track widths + m_ViaSizeHistory[ii] = 0; // Last HISTORY_NUMBER used via sizes } m_DrawSegmentWidth = 100; // current graphic line width (not EDGE layer) diff --git a/pcbnew/dialog_track_options.cpp b/pcbnew/dialog_track_options.cpp index b2e57cd196..7e2a9199bd 100644 --- a/pcbnew/dialog_track_options.cpp +++ b/pcbnew/dialog_track_options.cpp @@ -1,4 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// + // Name: dialog_track_options.cpp // Purpose: // Author: jean-pierre Charras @@ -11,7 +12,7 @@ // 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" #endif @@ -47,13 +48,13 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_PcbTracksDialog, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_PcbTracksDialog, wxDialog ) ////@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 @@ -63,14 +64,20 @@ END_EVENT_TABLE() * 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; - Create(parent, id, caption, pos, size, style); + m_Parent = parent; + Create( parent, id, caption, pos, size, style ); } @@ -78,151 +85,260 @@ WinEDA_PcbTracksDialog::WinEDA_PcbTracksDialog( WinEDA_PcbFrame* parent, wxWindo * 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 m_ViaSizeTitle = NULL; - m_OptViaSize = NULL; + m_OptViaSize = NULL; m_ViaDefaultDrillValueTitle = NULL; m_OptViaDrill = NULL; m_ViaAltDrillValueTitle = NULL; m_OptCustomViaDrill = NULL; m_OptViaType = NULL; - m_MicroViaSizeTitle = NULL; - m_MicroViaSizeCtrl = NULL; + m_MicroViaSizeTitle = NULL; + m_MicroViaSizeCtrl = NULL; m_MicroViaDrillTitle = NULL; - m_MicroViaDrillCtrl = NULL; - m_AllowMicroViaCtrl = NULL; - m_TrackWidthTitle = NULL; + m_MicroViaDrillCtrl = NULL; + m_AllowMicroViaCtrl = NULL; + m_TrackWidthTitle = NULL; m_OptTrackWidth = NULL; m_TrackClearanceTitle = NULL; - m_OptTrackClearance = NULL; - m_MaskClearanceTitle = NULL; + m_OptTrackClearance = NULL; + m_MaskClearanceTitle = NULL; m_OptMaskMargin = NULL; + ////@end WinEDA_PcbTracksDialog member initialisation ////@begin WinEDA_PcbTracksDialog creation - SetExtraStyle(wxWS_EX_BLOCK_EVENTS); + SetExtraStyle( wxWS_EX_BLOCK_EVENTS ); wxDialog::Create( parent, id, caption, pos, size, style ); CreateControls(); - if (GetSizer()) + if( GetSizer() ) { - GetSizer()->SetSizeHints(this); + GetSizer()->SetSizeHints( this ); } Centre(); + ////@end WinEDA_PcbTracksDialog creation return true; } + /*! * Control creation for WinEDA_PcbTracksDialog */ void WinEDA_PcbTracksDialog::CreateControls() { - SetFont(*g_DialogFont); + SetFont( *g_DialogFont ); ////@begin WinEDA_PcbTracksDialog content construction // Generated by DialogBlocks, 11/01/2008 21:51:48 (unregistered) WinEDA_PcbTracksDialog* itemDialog1 = this; - wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL); - itemDialog1->SetSizer(itemBoxSizer2); + wxBoxSizer* itemBoxSizer2 = new wxBoxSizer( wxHORIZONTAL ); - wxStaticBox* itemStaticBoxSizer3Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Vias:")); - wxStaticBoxSizer* itemStaticBoxSizer3 = new wxStaticBoxSizer(itemStaticBoxSizer3Static, wxVERTICAL); - itemBoxSizer2->Add(itemStaticBoxSizer3, 0, wxGROW|wxALL, 5); + itemDialog1->SetSizer( itemBoxSizer2 ); - m_ViaSizeTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Via Size"), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticBoxSizer3->Add(m_ViaSizeTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); + wxStaticBox* itemStaticBoxSizer3Static = new wxStaticBox( itemDialog1, wxID_ANY, _( + "Vias:" ) ); - m_OptViaSize = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticBoxSizer3->Add(m_OptViaSize, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); + wxStaticBoxSizer* itemStaticBoxSizer3 = new wxStaticBoxSizer( + itemStaticBoxSizer3Static, + wxVERTICAL ); - m_ViaDefaultDrillValueTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Default Via Drill"), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticBoxSizer3->Add(m_ViaDefaultDrillValueTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); + itemBoxSizer2->Add( itemStaticBoxSizer3, 0, wxGROW | wxALL, 5 ); - m_OptViaDrill = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticBoxSizer3->Add(m_OptViaDrill, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); + m_ViaSizeTitle = new wxStaticText( itemDialog1, wxID_STATIC, _( + "Via Size" ), + wxDefaultPosition, + wxDefaultSize, 0 ); - 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); + itemStaticBoxSizer3->Add( m_ViaSizeTitle, + 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); + m_OptViaSize = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T( + "" ), wxDefaultPosition, + wxDefaultSize, 0 ); + + itemStaticBoxSizer3->Add( m_OptViaSize, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); + + m_ViaDefaultDrillValueTitle = new wxStaticText( itemDialog1, wxID_STATIC, _( + "Default Via Drill" ), + wxDefaultPosition, + wxDefaultSize, 0 ); + + itemStaticBoxSizer3->Add( m_ViaDefaultDrillValueTitle, + 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; - m_OptViaTypeStrings.Add(_("Through 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->SetSelection(0); - itemStaticBoxSizer3->Add(m_OptViaType, 0, wxGROW|wxALL, 5); + m_OptViaTypeStrings.Add( _( "Through 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 ); - wxStaticBox* itemStaticBoxSizer11Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Micro Vias:")); - wxStaticBoxSizer* itemStaticBoxSizer11 = new wxStaticBoxSizer(itemStaticBoxSizer11Static, wxVERTICAL); - itemBoxSizer2->Add(itemStaticBoxSizer11, 0, wxGROW|wxALL, 5); + m_OptViaType->SetSelection( 0 ); + itemStaticBoxSizer3->Add( m_OptViaType, 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); + wxStaticBox* itemStaticBoxSizer11Static = new wxStaticBox( itemDialog1, wxID_ANY, _( + "Micro Vias:" ) ); - m_MicroViaSizeCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL7, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticBoxSizer11->Add(m_MicroViaSizeCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); + wxStaticBoxSizer* itemStaticBoxSizer11 = new wxStaticBoxSizer( + itemStaticBoxSizer11Static, + wxVERTICAL ); - m_MicroViaDrillTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Micro Via Drill"), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticBoxSizer11->Add(m_MicroViaDrillTitle, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); + itemBoxSizer2->Add( itemStaticBoxSizer11, 0, wxGROW | wxALL, 5 ); - m_MicroViaDrillCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL6, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticBoxSizer11->Add(m_MicroViaDrillCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); + m_MicroViaSizeTitle = new wxStaticText( itemDialog1, wxID_STATIC, _( + "Micro Via Size" ), + wxDefaultPosition, + wxDefaultSize, 0 ); - itemStaticBoxSizer11->Add(5, 5, 0, wxGROW|wxALL, 5); + itemStaticBoxSizer11->Add( m_MicroViaSizeTitle, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 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); + m_MicroViaSizeCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL7, _T( + "" ), wxDefaultPosition, + wxDefaultSize, 0 ); - wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(itemBoxSizer18, 0, wxGROW|wxALL, 5); + itemStaticBoxSizer11->Add( m_MicroViaSizeCtrl, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); - m_TrackWidthTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Track Width"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer18->Add(m_TrackWidthTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); + m_MicroViaDrillTitle = new wxStaticText( itemDialog1, wxID_STATIC, _( + "Micro Via Drill" ), + wxDefaultPosition, + wxDefaultSize, 0 ); - m_OptTrackWidth = new wxTextCtrl( itemDialog1, ID_TEXTCTRL3, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer18->Add(m_OptTrackWidth, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); + itemStaticBoxSizer11->Add( m_MicroViaDrillTitle, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); - m_TrackClearanceTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Clearance"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer18->Add(m_TrackClearanceTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); + m_MicroViaDrillCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL6, _T( + "" ), wxDefaultPosition, + wxDefaultSize, 0 ); - m_OptTrackClearance = new wxTextCtrl( itemDialog1, ID_TEXTCTRL4, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer18->Add(m_OptTrackClearance, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); + itemStaticBoxSizer11->Add( m_MicroViaDrillCtrl, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); - m_MaskClearanceTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Mask clearance"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer18->Add(m_MaskClearanceTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); + itemStaticBoxSizer11->Add( 5, 5, 0, wxGROW | wxALL, 5 ); - m_OptMaskMargin = new wxTextCtrl( itemDialog1, ID_TEXTCTRL5, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer18->Add(m_OptMaskMargin, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); + m_AllowMicroViaCtrl = new wxCheckBox( itemDialog1, ID_CHECKBOX_ALLOWS_MICROVIA, _( + "Allows Micro Vias" ), wxDefaultPosition, + wxDefaultSize, 0 ); - wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(itemBoxSizer25, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + 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 ); - wxButton* itemButton26 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton26->SetForegroundColour(wxColour(210, 0, 0)); - itemBoxSizer25->Add(itemButton26, 0, wxGROW|wxALL, 5); + wxBoxSizer* itemBoxSizer18 = new wxBoxSizer( wxVERTICAL ); - 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); + itemBoxSizer2->Add( itemBoxSizer18, 0, wxGROW | wxALL, 5 ); + + m_TrackWidthTitle = new wxStaticText( itemDialog1, wxID_STATIC, _( + "Track Width" ), wxDefaultPosition, + wxDefaultSize, 0 ); + + itemBoxSizer18->Add( m_TrackWidthTitle, + 0, + wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, + 5 ); + + m_OptTrackWidth = new wxTextCtrl( itemDialog1, ID_TEXTCTRL3, _T( + "" ), wxDefaultPosition, wxDefaultSize, 0 ); + + itemBoxSizer18->Add( m_OptTrackWidth, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); + + m_TrackClearanceTitle = new wxStaticText( itemDialog1, wxID_STATIC, _( + "Clearance" ), wxDefaultPosition, + wxDefaultSize, 0 ); + + itemBoxSizer18->Add( m_TrackClearanceTitle, + 0, + wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, + 5 ); + + m_OptTrackClearance = new wxTextCtrl( itemDialog1, ID_TEXTCTRL4, _T( + "" ), wxDefaultPosition, wxDefaultSize, 0 ); + + itemBoxSizer18->Add( m_OptTrackClearance, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); + + m_MaskClearanceTitle = new wxStaticText( itemDialog1, wxID_STATIC, _( + "Mask clearance" ), wxDefaultPosition, + wxDefaultSize, 0 ); + + itemBoxSizer18->Add( m_MaskClearanceTitle, + 0, + wxALIGN_LEFT | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, + 5 ); + + m_OptMaskMargin = new wxTextCtrl( itemDialog1, ID_TEXTCTRL5, _T( + "" ), wxDefaultPosition, wxDefaultSize, 0 ); + + itemBoxSizer18->Add( m_OptMaskMargin, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); + + 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 ); + + 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 - m_AllowMicroViaCtrl->SetValidator( wxGenericValidator(& g_DesignSettings.m_MicroViasAllowed) ); + m_AllowMicroViaCtrl->SetValidator( wxGenericValidator( &g_DesignSettings.m_MicroViasAllowed ) ); + ////@end WinEDA_PcbTracksDialog content construction - SetDisplayValue(); + SetDisplayValue(); } + /*! * Should we show tooltips? */ @@ -232,6 +348,7 @@ bool WinEDA_PcbTracksDialog::ShowToolTips() return true; } + /*! * Get bitmap resources */ @@ -240,11 +357,13 @@ wxBitmap WinEDA_PcbTracksDialog::GetBitmapResource( const wxString& name ) { // Bitmap retrieval ////@begin WinEDA_PcbTracksDialog bitmap retrieval - wxUnusedVar(name); + wxUnusedVar( name ); return wxNullBitmap; + ////@end WinEDA_PcbTracksDialog bitmap retrieval } + /*! * Get icon resources */ @@ -253,146 +372,169 @@ wxIcon WinEDA_PcbTracksDialog::GetIconResource( const wxString& name ) { // Icon retrieval ////@begin WinEDA_PcbTracksDialog icon retrieval - wxUnusedVar(name); + wxUnusedVar( name ); return wxNullIcon; + ////@end WinEDA_PcbTracksDialog icon retrieval } + /*************************************************/ void WinEDA_PcbTracksDialog::SetDisplayValue() /*************************************************/ { - AddUnitSymbol(*m_ViaSizeTitle); - AddUnitSymbol(*m_MicroViaSizeTitle); - AddUnitSymbol(*m_ViaDefaultDrillValueTitle); - AddUnitSymbol(*m_MicroViaDrillTitle); - AddUnitSymbol(*m_ViaAltDrillValueTitle); - AddUnitSymbol(*m_TrackWidthTitle); - AddUnitSymbol(*m_TrackClearanceTitle); - AddUnitSymbol(*m_MaskClearanceTitle); + AddUnitSymbol( *m_ViaSizeTitle ); + AddUnitSymbol( *m_MicroViaSizeTitle ); + AddUnitSymbol( *m_ViaDefaultDrillValueTitle ); + AddUnitSymbol( *m_MicroViaDrillTitle ); + AddUnitSymbol( *m_ViaAltDrillValueTitle ); + AddUnitSymbol( *m_TrackWidthTitle ); + AddUnitSymbol( *m_TrackClearanceTitle ); + AddUnitSymbol( *m_MaskClearanceTitle ); - int Internal_Unit = m_Parent->m_InternalUnits; - PutValueInLocalUnits(*m_OptViaSize, g_DesignSettings.m_CurrentViaSize, Internal_Unit); - PutValueInLocalUnits(*m_MicroViaSizeCtrl, g_DesignSettings.m_CurrentMicroViaSize, Internal_Unit); - PutValueInLocalUnits(*m_OptViaDrill, g_DesignSettings.m_ViaDrill, Internal_Unit); - PutValueInLocalUnits(*m_MicroViaDrillCtrl, g_DesignSettings.m_MicroViaDrill, Internal_Unit); - PutValueInLocalUnits(*m_OptCustomViaDrill, g_ViaHoleLastValue, Internal_Unit); - PutValueInLocalUnits(*m_OptTrackWidth, g_DesignSettings.m_CurrentTrackWidth, Internal_Unit); - PutValueInLocalUnits(*m_OptTrackClearance, g_DesignSettings.m_TrackClearence, Internal_Unit); - PutValueInLocalUnits(*m_OptMaskMargin, g_DesignSettings.m_MaskMargin, Internal_Unit); - if ( g_DesignSettings.m_CurrentViaType != VIA_THROUGH ) - m_OptViaType->SetSelection(1); - - m_MicroViaSizeTitle->Enable(g_DesignSettings.m_MicroViasAllowed); - m_MicroViaSizeCtrl->Enable(g_DesignSettings.m_MicroViasAllowed); + int Internal_Unit = m_Parent->m_InternalUnits; + PutValueInLocalUnits( *m_OptViaSize, g_DesignSettings.m_CurrentViaSize, Internal_Unit ); + PutValueInLocalUnits( *m_MicroViaSizeCtrl, + g_DesignSettings.m_CurrentMicroViaSize, + Internal_Unit ); + PutValueInLocalUnits( *m_OptViaDrill, g_DesignSettings.m_ViaDrill, Internal_Unit ); + PutValueInLocalUnits( *m_MicroViaDrillCtrl, g_DesignSettings.m_MicroViaDrill, Internal_Unit ); + PutValueInLocalUnits( *m_OptCustomViaDrill, g_ViaHoleLastValue, Internal_Unit ); + PutValueInLocalUnits( *m_OptTrackWidth, g_DesignSettings.m_CurrentTrackWidth, Internal_Unit ); + PutValueInLocalUnits( *m_OptTrackClearance, g_DesignSettings.m_TrackClearence, Internal_Unit ); + PutValueInLocalUnits( *m_OptMaskMargin, g_DesignSettings.m_MaskMargin, Internal_Unit ); + if( g_DesignSettings.m_CurrentViaType != VIA_THROUGH ) + m_OptViaType->SetSelection( 1 ); - m_MicroViaDrillTitle->Enable(g_DesignSettings.m_MicroViasAllowed); - m_MicroViaDrillCtrl->Enable(g_DesignSettings.m_MicroViasAllowed); + m_MicroViaSizeTitle->Enable( g_DesignSettings.m_MicroViasAllowed ); + m_MicroViaSizeCtrl->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; - if ( m_OptViaType->GetSelection() > 0 ) - g_DesignSettings.m_CurrentViaType = VIA_BLIND_BURIED; + g_DesignSettings.m_CurrentViaType = VIA_THROUGH; + if( m_OptViaType->GetSelection() > 0 ) + g_DesignSettings.m_CurrentViaType = VIA_BLIND_BURIED; - g_DesignSettings.m_CurrentViaSize = - ReturnValueFromTextCtrl(*m_OptViaSize, m_Parent->m_InternalUnits); - g_DesignSettings.m_CurrentMicroViaSize = - ReturnValueFromTextCtrl(*m_MicroViaSizeCtrl, m_Parent->m_InternalUnits); + g_DesignSettings.m_CurrentViaSize = + ReturnValueFromTextCtrl( *m_OptViaSize, m_Parent->m_InternalUnits ); + g_DesignSettings.m_CurrentMicroViaSize = + ReturnValueFromTextCtrl( *m_MicroViaSizeCtrl, m_Parent->m_InternalUnits ); - g_DesignSettings.m_MicroViaDrill = - ReturnValueFromTextCtrl(*m_MicroViaDrillCtrl, m_Parent->m_InternalUnits); - g_DesignSettings.m_ViaDrill = - ReturnValueFromTextCtrl(*m_OptViaDrill, m_Parent->m_InternalUnits); - g_ViaHoleLastValue = - ReturnValueFromTextCtrl(*m_OptCustomViaDrill, m_Parent->m_InternalUnits); + g_DesignSettings.m_MicroViaDrill = + ReturnValueFromTextCtrl( *m_MicroViaDrillCtrl, m_Parent->m_InternalUnits ); + g_DesignSettings.m_ViaDrill = + ReturnValueFromTextCtrl( *m_OptViaDrill, m_Parent->m_InternalUnits ); + g_ViaHoleLastValue = + ReturnValueFromTextCtrl( *m_OptCustomViaDrill, m_Parent->m_InternalUnits ); g_DesignSettings.m_MicroViasAllowed = m_AllowMicroViaCtrl->IsChecked(); - g_DesignSettings.m_CurrentTrackWidth = - ReturnValueFromTextCtrl(*m_OptTrackWidth, m_Parent->m_InternalUnits); - g_DesignSettings.m_TrackClearence = - ReturnValueFromTextCtrl(*m_OptTrackClearance, m_Parent->m_InternalUnits); + g_DesignSettings.m_CurrentTrackWidth = + ReturnValueFromTextCtrl( *m_OptTrackWidth, m_Parent->m_InternalUnits ); + g_DesignSettings.m_TrackClearence = + ReturnValueFromTextCtrl( *m_OptTrackClearance, m_Parent->m_InternalUnits ); - g_DesignSettings.m_MaskMargin = - ReturnValueFromTextCtrl(*m_OptMaskMargin, m_Parent->m_InternalUnits); + g_DesignSettings.m_MaskMargin = + 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_CurrentTrackWidth, TYPETRACK); - EndModal(1); + m_Parent->AddHistory( g_DesignSettings.m_CurrentViaSize, TYPEVIA ); + m_Parent->AddHistory( g_DesignSettings.m_CurrentTrackWidth, TYPETRACK ); + 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 { -bool addhistory = TRUE; -int ii; + bool addhistory = TRUE; + int ii; - switch ( type ) - { - case TYPETRACK: - for ( ii = 0; ii < HIST0RY_NUMBER; ii++) - { - if ( g_DesignSettings.m_TrackWidhtHistory[ii] == value ) - { - addhistory = FALSE; break; - } - } - if ( ! addhistory ) break; - for ( ii = HIST0RY_NUMBER -1; ii > 0 ; ii--) - { - g_DesignSettings.m_TrackWidhtHistory[ii] = g_DesignSettings.m_TrackWidhtHistory[ii-1]; - } - g_DesignSettings.m_TrackWidhtHistory[0] = value; + switch( type ) + { + case TYPETRACK: + for( ii = 0; ii < HISTORY_NUMBER; ii++ ) + { + if( g_DesignSettings.m_TrackWidthHistory[ii] == value ) + { + addhistory = FALSE; + break; + } + } - // Reclassement par valeur croissante - for ( ii = 0; ii < HIST0RY_NUMBER -1; ii++) - { - if ( g_DesignSettings.m_TrackWidhtHistory[ii+1] == 0 ) break; // Fin de liste - if ( g_DesignSettings.m_TrackWidhtHistory[ii] > g_DesignSettings.m_TrackWidhtHistory[ii+1] ) - { - EXCHG(g_DesignSettings.m_TrackWidhtHistory[ii], g_DesignSettings.m_TrackWidhtHistory[ii+1]); - } - } - break; + if( !addhistory ) + break; + + for( ii = HISTORY_NUMBER-1; ii > 0; ii-- ) + { + g_DesignSettings.m_TrackWidthHistory[ii] = g_DesignSettings.m_TrackWidthHistory[ii-1]; + } - case TYPEVIA: - for ( ii = 0; ii < HIST0RY_NUMBER; ii++) - { - if (g_DesignSettings.m_ViaSizeHistory[ii] == value) - { - addhistory = FALSE; break; - } - } - if ( ! addhistory ) break; + g_DesignSettings.m_TrackWidthHistory[0] = value; - for ( ii = HIST0RY_NUMBER -1; ii > 0 ; ii--) - { - g_DesignSettings.m_ViaSizeHistory[ii] = g_DesignSettings.m_ViaSizeHistory[ii-1]; - } - g_DesignSettings.m_ViaSizeHistory[0] = value; + // Reclassement par valeur croissante + for( ii = 0; ii < HISTORY_NUMBER-1; ii++ ) + { + if( g_DesignSettings.m_TrackWidthHistory[ii+1] == 0 ) + break; // Fin de liste + + if( g_DesignSettings.m_TrackWidthHistory[ii] > + g_DesignSettings.m_TrackWidthHistory[ii+1] ) + { + EXCHG( g_DesignSettings.m_TrackWidthHistory[ii], + g_DesignSettings.m_TrackWidthHistory[ii + 1] ); + } + } - // Reclassement par valeur croissante - for ( ii = 0; ii < HIST0RY_NUMBER -1; ii++) - { - if ( g_DesignSettings.m_ViaSizeHistory[ii+1] == 0 ) 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]); - } - } - break; + break; - default: - break; - } + case TYPEVIA: + for( ii = 0; ii < HISTORY_NUMBER; ii++ ) + { + if( g_DesignSettings.m_ViaSizeHistory[ii] == value ) + { + addhistory = FALSE; + break; + } + } + + 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[0] = value; + + // Reclassement par valeur croissante + 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] > g_DesignSettings.m_ViaSizeHistory[ii+1] ) + { + EXCHG( g_DesignSettings.m_ViaSizeHistory[ii], + g_DesignSettings.m_ViaSizeHistory[ii+1] ); + } + } + break; + + default: + break; + } } @@ -402,9 +544,10 @@ int ii; void WinEDA_PcbTracksDialog::OnOkClick( wxCommandEvent& event ) { - AcceptPcbOptions(event); + AcceptPcbOptions( event ); } + /*! * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL */ @@ -414,11 +557,11 @@ void WinEDA_PcbTracksDialog::OnCancelClick( wxCommandEvent& event ) ////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_PcbTracksDialog. // Before editing this code, remove the block markers. event.Skip(); + ////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_PcbTracksDialog. } - /*! * wxEVT_INIT_DIALOG event handler for ID_DIALOG */ @@ -428,8 +571,8 @@ void WinEDA_PcbTracksDialog::OnInitDialog( wxInitDialogEvent& event ) m_OptViaSize->SetFocus(); // 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(); } @@ -440,10 +583,10 @@ void WinEDA_PcbTracksDialog::OnInitDialog( wxInitDialogEvent& event ) void WinEDA_PcbTracksDialog::OnCheckboxAllowsMicroviaClick( wxCommandEvent& event ) { - bool state = m_AllowMicroViaCtrl->IsChecked(); - m_MicroViaSizeTitle->Enable(state); - m_MicroViaSizeCtrl->Enable(state); - m_MicroViaDrillTitle->Enable(state); - m_MicroViaDrillCtrl->Enable(state); -} + bool state = m_AllowMicroViaCtrl->IsChecked(); + m_MicroViaSizeTitle->Enable( state ); + m_MicroViaSizeCtrl->Enable( state ); + m_MicroViaDrillTitle->Enable( state ); + m_MicroViaDrillCtrl->Enable( state ); +} diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 455ec4d304..e6a127e0af 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -829,7 +829,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) case ID_AUX_TOOLBAR_PCB_TRACK_WIDTH: { int ii = m_SelTrackWidthBox->GetChoice(); - g_DesignSettings.m_CurrentTrackWidth = g_DesignSettings.m_TrackWidhtHistory[ii]; + g_DesignSettings.m_CurrentTrackWidth = g_DesignSettings.m_TrackWidthHistory[ii]; DisplayTrackSettings(); m_SelTrackWidthBox_Changed = FALSE; m_SelViaSizeBox_Changed = FALSE; @@ -847,7 +847,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) DrawPanel->MouseToCursorSchema(); { 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(); } break; diff --git a/pcbnew/initpcb.cpp b/pcbnew/initpcb.cpp index b442b28fa8..fa01148717 100644 --- a/pcbnew/initpcb.cpp +++ b/pcbnew/initpcb.cpp @@ -192,13 +192,13 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query ) 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_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; Zoom_Automatique( TRUE ); diff --git a/pcbnew/ioascii.cpp b/pcbnew/ioascii.cpp index 74af5bf038..477c60e8e8 100644 --- a/pcbnew/ioascii.cpp +++ b/pcbnew/ioascii.cpp @@ -519,12 +519,12 @@ static int WriteSetup( FILE* File, WinEDA_BasePcbFrame* frame ) fprintf( File, "Layers %d\n", g_DesignSettings.m_CopperLayerCount ); 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; fprintf( File, "TrackWidthHistory %d\n", - g_DesignSettings.m_TrackWidhtHistory[ii] ); + g_DesignSettings.m_TrackWidthHistory[ii] ); } fprintf( File, "TrackClearence %d\n", g_DesignSettings.m_TrackClearence ); @@ -534,7 +534,7 @@ static int WriteSetup( FILE* File, WinEDA_BasePcbFrame* frame ) fprintf( File, "EdgeSegmWidth %d\n", g_DesignSettings.m_EdgeSegmentWidth ); fprintf( File, "ViaSize %d\n", g_DesignSettings.m_CurrentViaSize ); 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 ) break; diff --git a/pcbnew/onrightclick.cpp b/pcbnew/onrightclick.cpp index aba6fa92ff..1cc94668fb 100644 --- a/pcbnew/onrightclick.cpp +++ b/pcbnew/onrightclick.cpp @@ -71,12 +71,12 @@ static wxMenu* Append_Track_Width_List() double value; 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; value = To_User_Unit( g_UnitMetric, - g_DesignSettings.m_TrackWidhtHistory[ii], + g_DesignSettings.m_TrackWidthHistory[ii], PCB_INTERNAL_UNIT ); if( g_UnitMetric == INCHES ) // Affichage en mils msg.Printf( _( "Track %.1f" ), value * 1000 ); @@ -84,12 +84,12 @@ static wxMenu* Append_Track_Width_List() msg.Printf( _( "Track %.3f" ), value ); 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->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 ) break; diff --git a/pcbnew/pcbcfg.cpp b/pcbnew/pcbcfg.cpp index 13edaffdf6..405f3f8a08 100644 --- a/pcbnew/pcbcfg.cpp +++ b/pcbnew/pcbcfg.cpp @@ -170,11 +170,11 @@ int ii; 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; - 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; } diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index a0e41de50e..1c51694a02 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -452,12 +452,12 @@ void WinEDA_PcbFrame::SetToolbars() else 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 double value = To_User_Unit( g_UnitMetric, - g_DesignSettings.m_TrackWidhtHistory[ii], + g_DesignSettings.m_TrackWidthHistory[ii], PCB_INTERNAL_UNIT ); if( g_UnitMetric == INCHES ) @@ -467,7 +467,7 @@ void WinEDA_PcbFrame::SetToolbars() m_SelTrackWidthBox->Append( msg ); - if( g_DesignSettings.m_TrackWidhtHistory[ii] == + if( g_DesignSettings.m_TrackWidthHistory[ii] == g_DesignSettings.m_CurrentTrackWidth ) m_SelTrackWidthBox->SetSelection( ii ); } @@ -484,7 +484,7 @@ void WinEDA_PcbFrame::SetToolbars() else format += wxT( " %.3f" ); - for( ii = 0; ii < HIST0RY_NUMBER; ii++ ) + for( ii = 0; ii < HISTORY_NUMBER; ii++ ) { if( g_DesignSettings.m_ViaSizeHistory[ii] == 0 ) break; // Fin de liste diff --git a/pcbnew/specctra.h b/pcbnew/specctra.h index ef458ea60d..8e2295c5df 100644 --- a/pcbnew/specctra.h +++ b/pcbnew/specctra.h @@ -1706,7 +1706,7 @@ public: /** * Class SHAPE * corresponds to the "(shape ..)" element in the specctra dsn spec. - * It is not a <shape_descriptor> which is one of things that this + * It is not a <shape_descriptor>, which is one of things that this * elements contains, i.e. in its "shape" field. This class also implements * the "(outline ...)" element as a dual personality. */ @@ -1739,11 +1739,9 @@ public: delete shape; } - void SetShape( ELEM* aShape ) { delete shape; - shape = aShape; if( aShape ) diff --git a/pcbnew/specctra_export.cpp b/pcbnew/specctra_export.cpp index 40d904045e..841aaf3a9a 100644 --- a/pcbnew/specctra_export.cpp +++ b/pcbnew/specctra_export.cpp @@ -35,6 +35,7 @@ #include "specctra.h" #include "collectors.h" #include "wxPcbStruct.h" // Change_Side_Module() +#include "pcbstruct.h" // HISTORY_NUMBER using namespace DSN; @@ -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 * LIBRARY::padstacks list that it matches. */ -static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, - LIBRARY* aLibrary, PADSTACKS& aPadstacks ) +static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, LIBRARY* aLibrary ) { + char name[80]; // padstack name builder + if( aPads.GetCount() ) { 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, D_PAD* old_pad = NULL; 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 - // 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 // 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. - std::string layerId[2] = { + std::string layerId[COPPER_LAYERS] = { CONV_TO_UTF8(aBoard->GetLayerName( LAYER_CMP_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; im_logical_connexion = padstackNdx; - - if( old_pad && 0==D_PAD::Compare( old_pad, pad ) ) + + bool doLayer[COPPER_LAYERS] = { + pad->IsOnLayer( LAYER_CMP_N ), + pad->IsOnLayer( COPPER_LAYER_N ) + }; + + if( old_pad && 0==D_PAD::Compare( old_pad, pad ) ) { 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; // this is the index into the library->padstacks, be careful. @@ -289,11 +318,6 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, // Note that the y correction here is set negative. 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; switch( pad->m_PadShape ) @@ -303,9 +327,9 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, { double diameter = scale(pad->m_Size.x); - for( int layer=0; layer<2; ++layer ) + for( int layer=0; layerm_Size.x) ); name[ sizeof(name)-1 ] = 0; @@ -347,9 +369,9 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, lowerLeft += padOffset; upperRight += padOffset; - for( int layer=0; layer<2; ++layer ) + for( int layer=0; layerAppend( shape ); @@ -363,11 +385,8 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, } } - char name[80]; - snprintf( name, sizeof(name), "Rect%dPad_%.6gx%.6g_mil", coppers, scale(pad->m_Size.x), scale(pad->m_Size.y) ); - name[ sizeof(name)-1 ] = 0; // @todo verify that all pad names are unique, there is a chance that @@ -388,49 +407,53 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, { double radius = dy; - for( int layer=0; layer<2; ++layer ) + for( int layer=0; layerAppend( shape ); + path = makePath( + POINT( -dr + padOffset.x, padOffset.y - radius ), // aStart + POINT( dr + padOffset.x, padOffset.y - radius ), // aEnd + layerId[layer] ); + shape->SetShape( path ); + + shape = new SHAPE( padstack ); + padstack->Append( shape ); + // @todo: this 1/2 circle arc needs to be split into two quarter circle arcs + qarc = makeArc( + POINT( dr + padOffset.x, padOffset.y - radius), // aStart + POINT( dr + padOffset.x, padOffset.y + radius), // aEnd + POINT( dr + padOffset.x, padOffset.y ), // aCenter + layerId[layer] ); + shape->SetShape( qarc ); - SHAPE* shape; - PATH* path; - QARC* qarc; - - shape = new SHAPE( padstack ); - padstack->Append( shape ); - path = makePath( - POINT( -dr + padOffset.x, padOffset.y - radius ), // aStart - POINT( dr + padOffset.x, padOffset.y - radius ), // aEnd - layerId[layer] ); - shape->SetShape( path ); - - shape = new SHAPE( padstack ); - padstack->Append( shape ); - // @todo: this 1/2 circle arc needs to be split into two quarter circle arcs - qarc = makeArc( - POINT( dr + padOffset.x, padOffset.y - radius), // aStart - POINT( dr + padOffset.x, padOffset.y + radius), // aEnd - POINT( dr + padOffset.x, padOffset.y ), // aCenter - layerId[layer] ); - shape->SetShape( qarc ); - - shape = new SHAPE( padstack ); - padstack->Append( shape ); - path = makePath( - POINT( dr + padOffset.x, padOffset.y + radius ), // aStart - POINT( -dr + padOffset.x, padOffset.y + radius ), // aEnd - layerId[layer] ); - shape->SetShape( path ); - - shape = new SHAPE( padstack ); - padstack->Append( shape ); - // @todo: this 1/2 circle arc needs to be split into two quarter circle arcs - qarc = makeArc( - POINT( -dr + padOffset.x, padOffset.y + radius), // aStart - POINT( -dr + padOffset.x, padOffset.y - radius), // aEnd - POINT( -dr + padOffset.x, padOffset.y ), // aCenter - layerId[layer] ); - shape->SetShape( qarc ); + shape = new SHAPE( padstack ); + padstack->Append( shape ); + path = makePath( + POINT( dr + padOffset.x, padOffset.y + radius ), // aStart + POINT( -dr + padOffset.x, padOffset.y + radius ), // aEnd + layerId[layer] ); + shape->SetShape( path ); + + shape = new SHAPE( padstack ); + padstack->Append( shape ); + // @todo: this 1/2 circle arc needs to be split into two quarter circle arcs + qarc = makeArc( + POINT( -dr + padOffset.x, padOffset.y + radius), // aStart + POINT( -dr + padOffset.x, padOffset.y - radius), // aEnd + POINT( -dr + padOffset.x, padOffset.y ), // aCenter + layerId[layer] ); + shape->SetShape( qarc ); + ++coppers; + } } } else // oval is vertical @@ -439,57 +462,58 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, dr = -dr; - for( int layer=0; layer<2; ++layer ) + for( int layer=0; layerAppend( shape ); + path = makePath( + POINT( -radius + padOffset.x, padOffset.y - dr ), // aStart + POINT( -radius + padOffset.x, padOffset.y + dr ), // aEnd + layerId[layer] ); + shape->SetShape( path ); - SHAPE* shape; - PATH* path; - QARC* qarc; - - shape = new SHAPE( padstack ); - padstack->Append( shape ); - path = makePath( - POINT( -radius + padOffset.x, padOffset.y - dr ), // aStart - POINT( -radius + padOffset.x, padOffset.y + dr ), // aEnd - layerId[layer] ); - shape->SetShape( path ); - - shape = new SHAPE( padstack ); - padstack->Append( shape ); - // @todo: this 1/2 circle arc needs to be split into two quarter circle arcs - qarc = makeArc( - POINT( -radius + padOffset.x, padOffset.y + dr ), // aStart - POINT( radius + padOffset.x, padOffset.y + dr), // aEnd - POINT( padOffset.x, padOffset.y +dr ), // aCenter - layerId[layer] ); - shape->SetShape( qarc ); - - shape = new SHAPE( padstack ); - padstack->Append( shape ); - path = makePath( - POINT( radius + padOffset.x, padOffset.y + dr ), // aStart - POINT( radius + padOffset.x, padOffset.y - dr ), // aEnd - layerId[layer] ); - shape->SetShape( path ); - - shape = new SHAPE( padstack ); - padstack->Append( shape ); - // @todo: this 1/2 circle arc needs to be split into two quarter circle arcs - qarc = makeArc( - POINT( radius + padOffset.x, padOffset.y - dr), // aStart - POINT( -radius + padOffset.x, padOffset.y - dr), // aEnd - POINT( padOffset.x, padOffset.y - dr ), // aCenter - layerId[layer] ); - shape->SetShape( qarc ); + shape = new SHAPE( padstack ); + padstack->Append( shape ); + // @todo: this 1/2 circle arc needs to be split into two quarter circle arcs + qarc = makeArc( + POINT( -radius + padOffset.x, padOffset.y + dr ), // aStart + POINT( radius + padOffset.x, padOffset.y + dr), // aEnd + POINT( padOffset.x, padOffset.y +dr ), // aCenter + layerId[layer] ); + shape->SetShape( qarc ); + + shape = new SHAPE( padstack ); + padstack->Append( shape ); + path = makePath( + POINT( radius + padOffset.x, padOffset.y + dr ), // aStart + POINT( radius + padOffset.x, padOffset.y - dr ), // aEnd + layerId[layer] ); + shape->SetShape( path ); + + shape = new SHAPE( padstack ); + padstack->Append( shape ); + // @todo: this 1/2 circle arc needs to be split into two quarter circle arcs + qarc = makeArc( + POINT( radius + padOffset.x, padOffset.y - dr), // aStart + POINT( -radius + padOffset.x, padOffset.y - dr), // aEnd + POINT( padOffset.x, padOffset.y - dr ), // aCenter + layerId[layer] ); + shape->SetShape( qarc ); + ++coppers; + } } } - char name[80]; - snprintf( name, sizeof(name), "Oval%dPad_%.6gx%.6g_mil", coppers, scale(pad->m_Size.x), scale(pad->m_Size.y) ); - name[ sizeof(name)-1 ] = 0; // @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, */ } } + + // 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; im_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 ) // get all the D_PADs into pads. pads.Collect( aBoard, scanPADs ); - - makePADSTACKs( aBoard, pads, pcb->library, pcb->library->padstacks ); + makePADSTACKs( aBoard, pads, pcb->library ); + #if 0 && defined(DEBUG) for( int p=0; pShow( 0, std::cout ); #endif - + } + + //------------------------------------------------------ + { + // Output the vias in the padstack list here, by name + } + + //--------------------------------------------------- + { /* static const KICAD_T scanMODULEs[] = { TYPEMODULE, EOT }; @@ -714,7 +797,6 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) { MODULE* module = (MODULE*) items[m]; - // collate all the pads, and make a component. for( int p=0; p------------------------------------------------- - { - // Output the vias in the padstack list here, by name - } - // DSN Images (=Kicad MODULES and pads) must be presented from the // top view. Restore those that were flipped. diff --git a/todo.txt b/todo.txt index 17835221d2..35b9a92e8b 100644 --- a/todo.txt +++ b/todo.txt @@ -71,3 +71,9 @@ asked by: jp Charras 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 +