53                       wxEVT_COMMAND_BUTTON_CLICKED,
 
   66    GetSizer()->SetSizeHints( 
this );
 
 
  145        label = 
new wxStaticText( 
this, wxID_STATIC, msg );
 
  146        flexColumnBoxSizer->Add( label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
 
  150        label = 
new wxStaticText( 
this, wxID_STATIC, fn.GetFullName() );
 
  151        flexColumnBoxSizer->Add( label, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
 
  155        wxButton * Button = 
new wxButton( 
this, item_ID, wxT( 
"..." ), wxDefaultPosition, wxDefaultSize,
 
  158        flexColumnBoxSizer->Add( Button, 0, wxALIGN_CENTER_VERTICAL | wxALL );
 
  169        msg  = 
_( 
"Do not export" );
 
  170        text = 
new wxStaticText( 
this, item_ID, msg );
 
  171        text->SetForegroundColour( *wxBLUE );
 
  183            goodSize = 
text->GetSize();
 
  189                if( goodSize.x < 
text->GetSize().x )
 
  190                    goodSize.x = 
text->GetSize().x;
 
  192            text->SetLabel( msg ); 
 
  195        text->SetMinSize( goodSize );
 
  196        flexColumnBoxSizer->Add( 
text, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
 
  203    if( 
config->m_GerberToPcbLayerMapping.size() == 0 )
 
  206    std::vector<int> gerber2KicadMapping;
 
  211    if( numMappedGerbers > 0 )
 
  214        int returnVal = wxMessageBox( wxString::Format( 
_( 
"Gerbers with known layers: %d" ), numMappedGerbers )
 
  215                                              + wxT( 
"\n\n" ) + 
_( 
"Assign to matching PCB layers?" ),
 
  216                                      _( 
"Automatic Layer Assignment" ),
 
  217                                      wxOK | wxCANCEL | wxOK_DEFAULT );
 
  219        if( returnVal == wxOK )
 
  221            int total_copper = 0;
 
  225                int currLayer = gerber2KicadMapping[ii];
 
  242                    m_layersList[ii]->SetForegroundColour( wxColour( 255, 0, 128 ) );
 
 
  273    int id = 
event.GetSelection();
 
 
  299    config->m_GerberToPcbLayerMapping.clear();
 
 
  323        if( (
size_t)ii >= 
config->m_GerberToPcbLayerMapping.size() )
 
  341            m_layersList[ii]->SetForegroundColour( wxColour( 255, 0, 128 ) );
 
  346            m_layersList[ii]->SetForegroundColour( wxColour( 255, 0, 128 ) );
 
 
  358        wxFAIL_MSG( wxT( 
"Bad layer id" ) );
 
  368    wxFileName fn( 
m_Parent->GetGerberLayout()->GetImagesList()->GetGbrImage( ii )->m_FileName );
 
  371    wxString layerName = wxT( 
"\"" ) + fn.GetFullName() + wxT( 
"\"" );
 
  397            m_layersList[ii]->SetForegroundColour( wxColour( 255, 0, 128 ) );
 
  405            m_layersList[ii]->SetForegroundColour( wxColour( 255, 0, 128 ) );
 
 
  417    if( !wxDialog::TransferDataFromWindow() )
 
  423    int inner_layer_max = 0;
 
  438        wxMessageBox( 
_( 
"Exported board does not have enough copper layers to handle selected " 
 
  449    int numKnownGerbers = 0;
 
  463    return numKnownGerbers;
 
 
  473    std::map<wxString, PCB_LAYER_ID> altiumExt{
 
  474        { wxT( 
"GTL" ), 
F_Cu },      
 
  505        { wxT( 
"GBL" ), 
B_Cu },      
 
  518    std::map<wxString, PCB_LAYER_ID>::iterator it;
 
  520    int numAltiumMatches = 0; 
 
  527    if( ( aGerber2KicadMapping.size() != 0 )
 
  529        return numAltiumMatches;
 
  534    if( aGerber2KicadMapping.size() == 0 )
 
  546            wxString FileExt = fn.GetExt();
 
  550            it = altiumExt.find( FileExt );
 
  552            if( it != altiumExt.end() )
 
  560                    aGerber2KicadMapping[ii] = it->second;
 
  570    return numAltiumMatches;
 
 
  580    std::map<wxString, PCB_LAYER_ID> kicadLayers
 
  639    std::map<wxString, PCB_LAYER_ID>::iterator it;
 
  641    int numKicadMatches = 0; 
 
  648    if( ( aGerber2KicadMapping.size() != 0 )
 
  650        return numKicadMatches;
 
  655    if( aGerber2KicadMapping.size() == 0 )
 
  666            wxString layerName = fn.GetName();
 
  672            int dashPos = layerName.Find( 
'-', 
true );
 
  677            if( dashPos != wxNOT_FOUND )
 
  678                suffix = layerName.Right( layerName.length() - dashPos );
 
  681            it = kicadLayers.find( suffix );
 
  683            if( it != kicadLayers.end() )
 
  691                    aGerber2KicadMapping[ii] = it->second;
 
  701    return numKicadMatches;
 
 
  711    std::map<wxString, PCB_LAYER_ID> kicadLayers
 
  713        { wxT( 
"Top" ),   
F_Cu },
 
  743        { wxT( 
"Bot" ),   
B_Cu },
 
  746        { wxT( 
"BotPaste" ),           
B_Paste },
 
  747        { wxT( 
"TopPaste" ),           
F_Paste },
 
  748        { wxT( 
"BotLegend" ),          
B_SilkS },
 
  749        { wxT( 
"TopLegend" ),          
F_SilkS },
 
  750        { wxT( 
"BotSoldermask" ),      
B_Mask },
 
  751        { wxT( 
"TopSoldermask" ),      
F_Mask },
 
  752        { wxT( 
"FabricationDrawing" ), 
Dwgs_User },
 
  754        { wxT( 
"TopAssemblyDrawing" ), 
F_Fab },
 
  755        { wxT( 
"BotAssemblyDrawing" ), 
B_Fab },
 
  761    std::map<wxString, PCB_LAYER_ID>::iterator it;
 
  763    int numKicadMatches = 0; 
 
  772    if( ( aGerber2KicadMapping.size() != 0 )
 
  775        return numKicadMatches;
 
  781    if( aGerber2KicadMapping.size() == 0 )
 
  795                wxCHECK( x2, numKicadMatches );
 
  803                    if( mapThis.IsSameAs( wxT( 
"Inr" ), 
false ) )
 
  813                it = kicadLayers.find( mapThis );
 
  815                if( it != kicadLayers.end() )
 
  823                        aGerber2KicadMapping[ii] = it->second;
 
  831    return numKicadMatches;
 
 
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
 
Class DIALOG_MAP_GERBER_LAYERS_TO_PCB_BASE.
 
wxFlexGridSizer * m_flexLeftColumnBoxSizer
 
wxComboBox * m_comboCopperLayersCount
 
wxButton * m_buttonRetrieve
 
wxFlexGridSizer * m_flexRightColumnBoxSizer
 
wxStaticLine * m_staticlineSep
 
Show the Gerber files loaded and allow the user to choose between Gerber layers and pcb layers.
 
bool TransferDataFromWindow() override
 
int m_layersLookUpTable[GERBER_DRAWLAYERS_COUNT]
 
void OnStoreSetup(wxCommandEvent &event) override
 
GERBVIEW_FRAME * m_Parent
 
static int m_exportBoardCopperLayersCount
 
int findNumKiCadGerbersLoaded(std::vector< int > &aGerber2KicadMapping)
Find number of loaded Gerbers using KiCad naming convention.
 
wxStaticText * m_layersList[int(GERBER_DRAWLAYERS_COUNT)+1]
 
void OnResetClick(wxCommandEvent &event) override
 
int m_gerberActiveLayersCount
 
void OnSelectLayer(wxCommandEvent &event)
 
int m_buttonTable[int(GERBER_DRAWLAYERS_COUNT)+1]
 
int findNumX2GerbersLoaded(std::vector< int > &aGerber2KicadMapping)
Find number of loaded Gerbers using X2 File Functions to define layers.
 
void OnBrdLayersCountSelection(wxCommandEvent &event) override
 
int findKnownGerbersLoaded(std::vector< int > &aGerber2KicadMapping)
Find number of loaded Gerbers where the matching KiCad layer can be identified.
 
void OnGetSetup(wxCommandEvent &event) override
 
int findNumAltiumGerbersLoaded(std::vector< int > &aGerber2KicadMapping)
Find number of loaded Gerbers using Altium file extensions.
 
void normalizeBrdLayersCount()
 
GERBER_FILE_IMAGE_LIST is a helper class to handle a list of GERBER_FILE_IMAGE files which are loaded...
 
GERBER_FILE_IMAGE * GetGbrImage(int aIdx)
 
X2_ATTRIBUTE_FILEFUNCTION * m_FileFunction
file function parameters, found in a TF command or a G04
 
wxString m_FileName
Full File Name for this layer.
 
bool m_IsX2_file
True if a X2 gerber attribute was found in file.
 
APP_SETTINGS_BASE * KifaceSettings() const
 
static wxString Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
 
X2_ATTRIBUTE_FILEFUNCTION ( from TF.FileFunction in Gerber file) Example file function: TF....
 
bool IsCopper()
return true if the filefunction type is "Copper"
 
const wxString & GetBrdLayerSide()
the brd layer Pos: Top, Bot, Inr same as GetBrdLayerId() for non copper type
 
const wxString & GetFileType()
the type of layer (Copper, Soldermask ... )
 
const wxString & GetBrdLayerId()
the brd layer identifier: Ln, only for Copper type or Top, Bot for other types
 
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
 
size_t CopperLayerToOrdinal(PCB_LAYER_ID aLayer)
Converts KiCad copper layer enum to an ordinal between the front and back layers.
 
bool IsInnerCopperLayer(int aLayerId)
Test whether a layer is an inner (In1_Cu to In30_Cu) copper layer.
 
PCB_LAYER_ID
A quick note on layer IDs:
 
bool IsValidLayer(int aLayerId)
Test whether a given integer is a valid layer index, i.e.
 
#define GERBER_DRAWLAYERS_COUNT
Number of draw layers in Gerbview.
 
PCB_LAYER_ID ToLAYER_ID(int aLayer)
 
EVT_COMMAND_RANGE(ID_MATRIX_0, ID_MATRIX_0+(PINMAP_TYPE_COUNT *PINMAP_TYPE_COUNT) - 1, wxEVT_COMMAND_BUTTON_CLICKED, PANEL_SETUP_PINMAP::changeErrorLevel) PANEL_SETUP_PINMAP
 
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...