Commit 90378c47 authored by charras's avatar charras

Try to fix bug 2960683 in build_BOM.cpp

Pad edit dialog uses now default layers names in modedit and the current board layers names in board editor
parent 7affa6a5
...@@ -845,9 +845,10 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart( ...@@ -845,9 +845,10 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart(
NxtName[0] = 0; NxtName[0] = 0;
// Store fields. try to store non empty fields. // Store fields. try to find and store non empty fields.
if( (int)cmpFields.GetCount() < DrawLibItem->GetFieldCount() ) int needed_size = DrawLibItem->GetFieldCount() - cmpFields.GetCount();
cmpFields.Alloc(DrawLibItem->GetFieldCount()); if( needed_size > 0 )
cmpFields.Add(wxEmptyString, needed_size);
for( int jj = FIELD1; jj < DrawLibItem->GetFieldCount(); jj++ ) for( int jj = FIELD1; jj < DrawLibItem->GetFieldCount(); jj++ )
{ {
if( cmpFields[jj].IsEmpty() ) if( cmpFields[jj].IsEmpty() )
......
...@@ -498,6 +498,7 @@ void BOARD::SetVisibleElementColor( int aPCB_VISIBLE, int aColor ) ...@@ -498,6 +498,7 @@ void BOARD::SetVisibleElementColor( int aPCB_VISIBLE, int aColor )
case PAD_FR_VISIBLE: case PAD_FR_VISIBLE:
case PAD_BK_VISIBLE: case PAD_BK_VISIBLE:
case GRID_VISIBLE: case GRID_VISIBLE:
case RATSNEST_VISIBLE:
GetColorsSettings()->SetItemColor( aPCB_VISIBLE, aColor ); GetColorsSettings()->SetItemColor( aPCB_VISIBLE, aColor );
break; break;
......
...@@ -53,12 +53,14 @@ static long Std_Pad_Layers[NBTYPES] = ...@@ -53,12 +53,14 @@ static long Std_Pad_Layers[NBTYPES] =
/********************************************************************/ /********************************************************************/
class DIALOG_PAD_PROPERTIES : public DIALOG_PAD_PROPERTIES_BASE class DIALOG_PAD_PROPERTIES : public DIALOG_PAD_PROPERTIES_BASE
{ {
public: private:
WinEDA_BasePcbFrame* m_Parent; WinEDA_BasePcbFrame* m_Parent;
D_PAD* m_CurrentPad; D_PAD* m_CurrentPad;
BOARD * m_Board;
public: public:
DIALOG_PAD_PROPERTIES( WinEDA_BasePcbFrame* parent, D_PAD* Pad ); DIALOG_PAD_PROPERTIES( WinEDA_BasePcbFrame* parent, D_PAD* Pad );
private:
void InitDialog( ); void InitDialog( );
void OnPadShapeSelection( wxCommandEvent& event ); void OnPadShapeSelection( wxCommandEvent& event );
void OnDrillShapeSelected( wxCommandEvent& event ); void OnDrillShapeSelected( wxCommandEvent& event );
...@@ -77,6 +79,7 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( WinEDA_BasePcbFrame* parent, D_PAD ...@@ -77,6 +79,7 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( WinEDA_BasePcbFrame* parent, D_PAD
{ {
m_Parent = parent; m_Parent = parent;
m_CurrentPad = Pad; m_CurrentPad = Pad;
m_Board = m_Parent->GetBoard();
if( m_CurrentPad ) if( m_CurrentPad )
{ {
...@@ -258,6 +261,22 @@ void DIALOG_PAD_PROPERTIES::InitDialog( ) ...@@ -258,6 +261,22 @@ void DIALOG_PAD_PROPERTIES::InitDialog( )
cmd_event.SetId( m_PadType->GetSelection() ); cmd_event.SetId( m_PadType->GetSelection() );
PadTypeSelected( cmd_event ); PadTypeSelected( cmd_event );
} }
// Setup layers names from board
m_PadLayerCu->SetLabel(m_Board->GetLayerName(LAYER_N_BACK));
m_PadLayerCmp->SetLabel(m_Board->GetLayerName(LAYER_N_FRONT));
m_PadLayerAdhCmp->SetLabel(m_Board->GetLayerName( ADHESIVE_N_FRONT ));
m_PadLayerAdhCu->SetLabel(m_Board->GetLayerName( ADHESIVE_N_BACK ));
m_PadLayerPateCmp->SetLabel(m_Board->GetLayerName( SOLDERPASTE_N_FRONT ));
m_PadLayerPateCu->SetLabel(m_Board->GetLayerName(SOLDERPASTE_N_BACK ));
m_PadLayerSilkCmp->SetLabel(m_Board->GetLayerName( SILKSCREEN_N_FRONT ));
m_PadLayerSilkCu->SetLabel(m_Board->GetLayerName( SILKSCREEN_N_BACK ));
m_PadLayerMaskCmp->SetLabel(m_Board->GetLayerName( SOLDERMASK_N_FRONT ));
m_PadLayerMaskCu->SetLabel(m_Board->GetLayerName( SOLDERMASK_N_BACK ));
m_PadLayerECO1->SetLabel(m_Board->GetLayerName( ECO1_N ));
m_PadLayerECO2->SetLabel(m_Board->GetLayerName( ECO2_N));
m_PadLayerDraft->SetLabel(m_Board->GetLayerName( DRAW_N ));
} }
......
...@@ -148,7 +148,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -148,7 +148,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
Module_Ref = Module; Module_Ref = Module;
int pad_orient = aPad->m_Orient - Module_Ref->m_Orient; int pad_orient = aPad->m_Orient - Module_Ref->m_Orient;
// Prepare une undo list: // Prepare an undo list:
PICKED_ITEMS_LIST itemsList; PICKED_ITEMS_LIST itemsList;
Module = (MODULE*) m_Pcb->m_Modules; Module = (MODULE*) m_Pcb->m_Modules;
for( ; Module != NULL; Module = Module->Next() ) for( ; Module != NULL; Module = Module->Next() )
...@@ -156,7 +156,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -156,7 +156,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
if( !edit_Same_Modules && (Module != Module_Ref) ) if( !edit_Same_Modules && (Module != Module_Ref) )
continue; continue;
if( Module->m_LibRef != Module->m_LibRef ) if( Module->m_LibRef != Module_Ref->m_LibRef )
continue; continue;
bool saveMe = false; bool saveMe = false;
...@@ -196,7 +196,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -196,7 +196,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
if( !edit_Same_Modules && (Module != Module_Ref) ) if( !edit_Same_Modules && (Module != Module_Ref) )
continue; continue;
if( Module->m_LibRef != Module->m_LibRef ) if( Module->m_LibRef != Module_Ref->m_LibRef )
continue; continue;
/* Erase module on screen */ /* Erase module on screen */
......
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