Commit 683921f9 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Eeschema: fix crash in intermediate netlist generation when a component has no...

Eeschema: fix crash in intermediate netlist generation when a component has no pins (like logos or images).
Pcbnew: texts in dimensions can be now moved.
Gerbview: fix incorrect number of layers  in export to pcbnew function.
parent cc097762
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -328,8 +328,16 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
    {
        // Temporary change the help filename
        wxString tmp = wxGetApp().m_HelpFileName;

        // Search for "getting_started_in_kicad.pdf" or "Getting_Started_in_KiCad.pdf"
        wxGetApp().m_HelpFileName = wxT( "getting_started_in_kicad.pdf" );
        wxString helpFile = wxGetApp().GetHelpFile();

        if( !helpFile )
        {   // Try to find "Getting_Started_in_KiCad.pdf"
            wxGetApp().m_HelpFileName = wxT( "Getting_Started_in_KiCad.pdf" );
            wxString helpFile = wxGetApp().GetHelpFile();
        }

        if( !helpFile )
        {
+1 −1
Original line number Diff line number Diff line
@@ -787,7 +787,7 @@ XNODE* EXPORT_HELP::makeGenericLibParts()
         * Common pins (VCC, GND) can also be found more than once.
         */
        sort( pinList.begin(), pinList.end(), sortPinsByNumber );
        for( unsigned ii = 0; ii < pinList.size()-1; ii++ )
        for( int ii = 0; ii < (int)pinList.size()-1; ii++ )
        {
            if( pinList[ii]->GetNumber() == pinList[ii+1]->GetNumber() )
            {   // 2 pins have the same number, remove the redundant pin at index i+1
+9 −8
Original line number Diff line number Diff line
@@ -66,19 +66,17 @@ GBR_TO_PCB_EXPORTER::~GBR_TO_PCB_EXPORTER()
 */
void GERBVIEW_FRAME::ExportDataInPcbnewFormat( wxCommandEvent& event )
{
    int  ii = 0;
    bool no_used_layers = true; // Changed to false if any used layer found
    int layercount = 0;

    // Check whether any of the Gerber layers are actually currently used
    while( no_used_layers && ii < 32 )
    // Count the Gerber layers which are actually currently used
    for( int ii = 0; ii < 32; ii++ )
    {
        if( g_GERBER_List[ii] != NULL )
            no_used_layers = false;
            layercount++;

        ii++;
    }

    if( no_used_layers )
    if( layercount == 0 )
    {
        DisplayInfoMessage( this,
                            _( "None of the Gerber layers contain any data" ) );
@@ -233,6 +231,7 @@ bool GBR_TO_PCB_EXPORTER::ExportPcb( int* LayerLookUpTable )
    }

    cleanBoard();
    m_pcb->SetCopperLayerCount( LayerLookUpTable[32] );

    // Switch the locale to standard C (needed to print floating point numbers)
    SetLocaleTo_C_standard();
@@ -297,7 +296,7 @@ void GBR_TO_PCB_EXPORTER::export_copper_item( GERBER_DRAW_ITEM* aGbrItem, int aL
            break;

        case GBR_ARC:
//            export_segarc_copper_item( aGbrItem, aLayer );
            export_segarc_copper_item( aGbrItem, aLayer );
            break;

        default:
@@ -325,6 +324,7 @@ void GBR_TO_PCB_EXPORTER::export_segline_copper_item( GERBER_DRAW_ITEM* aGbrItem

void GBR_TO_PCB_EXPORTER::export_segarc_copper_item( GERBER_DRAW_ITEM* aGbrItem, int aLayer )
{
#if 0       // TODO: does not work in all cases, so needs some work
    double a  = atan2( (double)( aGbrItem->m_Start.y - aGbrItem->m_ArcCentre.y ),
                        (double)( aGbrItem->m_Start.x - aGbrItem->m_ArcCentre.x ) );
    double b  = atan2( (double)( aGbrItem->m_End.y - aGbrItem->m_ArcCentre.y ),
@@ -374,6 +374,7 @@ void GBR_TO_PCB_EXPORTER::export_segarc_copper_item( GERBER_DRAW_ITEM* aGbrItem,
        NEGATE( newtrack->m_End.y );
        m_pcb->Add( newtrack );
    }
#endif
}


+2 −2
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ void LAYERS_MAP_DIALOG::initDialog()

    // Ensure we have:
    //    at least 2 copper layers and NB_COPPER_LAYERS copper layers max
    //    an even layers count because board *must* have even layers count
    //    and even layers count because a board *must* have even layers count
    //    and maxi NB_COPPER_LAYERS copper layers count
    normalizeBrdLayersCount();

@@ -279,7 +279,7 @@ void LAYERS_MAP_DIALOG::OnResetClick( wxCommandEvent& event )
}


/* Stores the current mayers selection in config
/* Stores the current layers selection in config
 */
void LAYERS_MAP_DIALOG::OnStoreSetup( wxCommandEvent& event )
{
+3 −0
Original line number Diff line number Diff line
@@ -1253,6 +1253,9 @@ public:
    void ShowDimensionPropertyDialog( DIMENSION* aDimension, wxDC* aDC );
    DIMENSION* EditDimension( DIMENSION* aDimension, wxDC* aDC );
    void DeleteDimension( DIMENSION* aDimension, wxDC* aDC );
    void BeginMoveDimensionText( DIMENSION* aItem, wxDC* DC );
    void PlaceDimensionText( DIMENSION* aItem, wxDC* DC );


    // netlist  handling:
    void InstallNetlistFrame( wxDC* DC );
Loading