Loading pcbnew/autoplac.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -902,7 +902,7 @@ float WinEDA_PcbFrame::Compute_Ratsnest_PlaceModule( wxDC* DC ) /* Draw keep out area of a module. */ /* Draw keep out area of a module. */ /***********************************/ /***********************************/ /* ??? /* TRANSLATE * les cellules ( du plan des Distances ) du rectangle x0,y0 a x1,y1 sont * les cellules ( du plan des Distances ) du rectangle x0,y0 a x1,y1 sont * incrementees de la valeur Penalite * incrementees de la valeur Penalite * celles qui sont externes au rectangle, mais internes au rectangle * celles qui sont externes au rectangle, mais internes au rectangle Loading pcbnew/board.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -344,7 +344,7 @@ int Build_Work( BOARD* Pcb ) for( unsigned ii = 0; ii < Pcb->GetRatsnestsCount(); ii++ ) for( unsigned ii = 0; ii < Pcb->GetRatsnestsCount(); ii++ ) { { pt_rats = &Pcb->m_FullRatsnest[ii]; pt_rats = &Pcb->m_FullRatsnest[ii]; /* ??? On ne route que les chevelus actifs et routables */ /* TRANSLATE On ne route que les chevelus actifs et routables */ if( (pt_rats->m_Status & CH_ACTIF) == 0 ) if( (pt_rats->m_Status & CH_ACTIF) == 0 ) continue; continue; if( pt_rats->m_Status & CH_UNROUTABLE ) if( pt_rats->m_Status & CH_UNROUTABLE ) Loading pcbnew/deltrack.cpp +55 −58 Original line number Original line Diff line number Diff line /*********************************************/ /******************************************/ /* Edition des pistes: Routines d'effacement */ /* Edit Track: Erase Routines */ /* Effacement de segment, piste, net et zone */ /* Delete segments, tracks, and net areas */ /*********************************************/ /******************************************/ #include "fctsys.h" #include "fctsys.h" #include "common.h" #include "common.h" Loading @@ -14,16 +13,12 @@ #include "protos.h" #include "protos.h" /***************************************************************/ /* Removes 1 segment of track. TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) * 2 cases: /***************************************************************/ * If There is evidence of new track: delete new segment. * Otherwise, delete segment under the cursor. /* Supprime 1 segment de piste. * 2 Cas possibles: * Si On est en trace de nouvelle piste: Effacement du segment en * cours de trace * Sinon : Effacment du segment sous le curseur. */ */ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) { { int current_net_code; int current_net_code; Loading @@ -36,7 +31,8 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) return NULL; return NULL; } } if( aTrack->m_Flags & IS_NEW ) // Trace in progress, erase the last segment if( aTrack->m_Flags & IS_NEW ) // Trace in progress, erase the last // segment { { if( g_CurrentTrackList.GetCount() > 0 ) if( g_CurrentTrackList.GetCount() > 0 ) { { Loading @@ -44,7 +40,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) D( g_CurrentTrackList.VerifyListIntegrity(); ) D( g_CurrentTrackList.VerifyListIntegrity(); ) // effacement de la piste en cours // Delete the current trace ShowNewTrackWhenMovingCursor( DrawPanel, DC, FALSE ); ShowNewTrackWhenMovingCursor( DrawPanel, DC, FALSE ); // delete the most recently entered // delete the most recently entered Loading @@ -52,8 +48,9 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) if( g_TwoSegmentTrackBuild ) if( g_TwoSegmentTrackBuild ) { { // if in 2 track mode, and the next most recent is a segment not a via, // if in 2 track mode, and the next most recent is a segment // and the one previous to that is a via, then delete up to the via. // not a via, and the one previous to that is a via, then // delete up to the via. if( g_CurrentTrackList.GetCount() >= 2 if( g_CurrentTrackList.GetCount() >= 2 && g_CurrentTrackSegment->Type() != TYPE_VIA && g_CurrentTrackSegment->Type() != TYPE_VIA && g_CurrentTrackSegment->Back()->Type() == TYPE_VIA ) && g_CurrentTrackSegment->Back()->Type() == TYPE_VIA ) Loading @@ -62,22 +59,26 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) } } } } while( g_CurrentTrackSegment && g_CurrentTrackSegment->Type() == TYPE_VIA ) while( g_CurrentTrackSegment && g_CurrentTrackSegment->Type() == TYPE_VIA ) { { delete g_CurrentTrackList.PopBack(); delete g_CurrentTrackList.PopBack(); if( g_CurrentTrackSegment && g_CurrentTrackSegment->Type() != TYPE_VIA ) if( g_CurrentTrackSegment && g_CurrentTrackSegment->Type() != TYPE_VIA ) previous_layer = g_CurrentTrackSegment->GetLayer(); previous_layer = g_CurrentTrackSegment->GetLayer(); } } // Rectification couche active qui a pu changer si une via // Correct active layer which could change if a via // a ete effacee // has been erased ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = previous_layer; ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = previous_layer; UpdateStatusBar(); UpdateStatusBar(); if( g_TwoSegmentTrackBuild ) // We must have 2 segments or more, or 0 if( g_TwoSegmentTrackBuild ) // We must have 2 segments or more, // or 0 { { if( g_CurrentTrackList.GetCount()==1 && g_CurrentTrackSegment->Type() != TYPE_VIA ) if( g_CurrentTrackList.GetCount() == 1 && g_CurrentTrackSegment->Type() != TYPE_VIA ) { { delete g_CurrentTrackList.PopBack(); delete g_CurrentTrackList.PopBack(); } } Loading Loading @@ -110,6 +111,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) DLIST<TRACK>* container = (DLIST<TRACK>*)aTrack->GetList(); DLIST<TRACK>* container = (DLIST<TRACK>*)aTrack->GetList(); wxASSERT( container ); wxASSERT( container ); container->Remove( aTrack ); container->Remove( aTrack ); // redraw the area where the track was // redraw the area where the track was DrawPanel->PostDirtyRect( aTrack->GetBoundingBox() ); DrawPanel->PostDirtyRect( aTrack->GetBoundingBox() ); Loading @@ -122,9 +124,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) } } /**********************************************************/ void WinEDA_PcbFrame::Delete_Track( wxDC* DC, TRACK* aTrack ) void WinEDA_PcbFrame::Delete_Track( wxDC* DC, TRACK* aTrack ) /**********************************************************/ { { if( aTrack != NULL ) if( aTrack != NULL ) { { Loading @@ -136,9 +136,7 @@ void WinEDA_PcbFrame::Delete_Track( wxDC* DC, TRACK* aTrack ) } } /********************************************************/ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack ) void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack ) /********************************************************/ { { if( aTrack == NULL ) if( aTrack == NULL ) return; return; Loading @@ -163,6 +161,7 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack ) break; break; GetBoard()->m_Track.Remove( segm ); GetBoard()->m_Track.Remove( segm ); // redraw the area where the track was // redraw the area where the track was DrawPanel->PostDirtyRect( segm->GetBoundingBox() ); DrawPanel->PostDirtyRect( segm->GetBoundingBox() ); picker.m_PickedItem = segm; picker.m_PickedItem = segm; Loading @@ -174,25 +173,22 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack ) GetScreen()->SetModify(); GetScreen()->SetModify(); test_1_net_connexion( DC, net_code_delete ); test_1_net_connexion( DC, net_code_delete ); GetBoard()->DisplayInfo( this ); GetBoard()->DisplayInfo( this ); } } /********************************************************************/ /* Remove 1 track: void WinEDA_PcbFrame::Remove_One_Track( wxDC* DC, TRACK* pt_segm ) * The leading segment is removed and all adjacent segments /********************************************************************/ * until a pad or a junction point of more than 2 segments is found /* Routine de suppression de 1 piste: * le segment pointe est supprime puis les segments adjacents * jusqu'a un pad ou un point de jonction de plus de 2 segments */ */ void WinEDA_PcbFrame::Remove_One_Track( wxDC* DC, TRACK* pt_segm ) { { int segments_to_delete_count; int segments_to_delete_count; if( pt_segm == NULL ) if( pt_segm == NULL ) return; return; TRACK* trackList = Marque_Une_Piste( GetBoard(), pt_segm, &segments_to_delete_count, NULL, true ); TRACK* trackList = Marque_Une_Piste( GetBoard(), pt_segm, &segments_to_delete_count, NULL, true ); if( segments_to_delete_count == 0 ) if( segments_to_delete_count == 0 ) return; return; Loading @@ -213,6 +209,7 @@ void WinEDA_PcbFrame::Remove_One_Track( wxDC* DC, TRACK* pt_segm ) ); ) ); ) GetBoard()->m_Track.Remove( tracksegment ); GetBoard()->m_Track.Remove( tracksegment ); // redraw the area where the track was // redraw the area where the track was DrawPanel->PostDirtyRect( tracksegment->GetBoundingBox() ); DrawPanel->PostDirtyRect( tracksegment->GetBoundingBox() ); picker.m_PickedItem = tracksegment; picker.m_PickedItem = tracksegment; Loading pcbnew/dialog_SVG_print.cpp +47 −55 Original line number Original line Diff line number Diff line ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Name: dialog_svg_print.cpp // Name: dialog_svg_print.cpp // Author: jean-pierre Charras // Author: jean-pierre Charras // Modified by: // Modified by: Loading Loading @@ -56,16 +55,15 @@ private: void OnSetColorModeSelected( wxCommandEvent& event ); void OnSetColorModeSelected( wxCommandEvent& event ); void SetPenWidth(); void SetPenWidth(); void PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ); void PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ); bool DrawPage( const wxString& FullFileName, BASE_SCREEN* screen, bool aPrint_Framet_Ref ); bool DrawPage( const wxString& FullFileName, BASE_SCREEN* screen, bool aPrint_Framet_Ref ); }; }; /*******************************************************/ void WinEDA_DrawFrame::SVG_Print( wxCommandEvent& event ) /*******************************************************/ /* Prepare les structures de donnees de gestion de l'impression /* Prepare the data structures of print management * et affiche la fenetre de dialogue de gestion de l'impression des feuilles * And displays the dialog window management of printing sheets */ */ void WinEDA_DrawFrame::SVG_Print( wxCommandEvent& event ) { { DIALOG_SVG_PRINT frame( this ); DIALOG_SVG_PRINT frame( this ); Loading @@ -84,9 +82,7 @@ DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( WinEDA_DrawFrame* parent ) : } } /*************************************************************/ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event ) void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event ) /*************************************************************/ { { SetFocus(); // Make ESC key working SetFocus(); // Make ESC key working Loading @@ -99,7 +95,8 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event ) AddUnitSymbol( *m_TextPenWidth, g_UnitMetric ); AddUnitSymbol( *m_TextPenWidth, g_UnitMetric ); m_DialogPenWidth->SetValue( m_DialogPenWidth->SetValue( ReturnStringFromValue( g_UnitMetric, s_PrintPenMinWidth, m_Parent->m_InternalUnits ) ); ReturnStringFromValue( g_UnitMetric, s_PrintPenMinWidth, m_Parent->m_InternalUnits ) ); m_Print_Frame_Ref_Ctrl->SetValue( s_Print_Frame_Ref ); m_Print_Frame_Ref_Ctrl->SetValue( s_Print_Frame_Ref ); Loading @@ -108,15 +105,22 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event ) int mask = 1; int mask = 1; for( int layer = 0; layer<NB_LAYERS; layer++, mask <<= 1 ) for( int layer = 0; layer<NB_LAYERS; layer++, mask <<= 1 ) { { m_BoxSelectLayer[layer] = new wxCheckBox( this, -1, board->GetLayerName( layer ) ); m_BoxSelectLayer[layer] = new wxCheckBox( this, -1, board->GetLayerName( layer ) ); if( mask & s_SelectedLayers ) if( mask & s_SelectedLayers ) m_BoxSelectLayer[layer]->SetValue( true ); m_BoxSelectLayer[layer]->SetValue( true ); if( layer < 16 ) if( layer < 16 ) m_CopperLayersBoxSizer->Add( m_BoxSelectLayer[layer], 0, wxGROW | wxALL, 1 ); m_CopperLayersBoxSizer->Add( m_BoxSelectLayer[layer], 0, wxGROW | wxALL, 1 ); else else m_TechnicalBoxSizer->Add( m_BoxSelectLayer[layer], 0, wxGROW | wxALL, 1 ); m_TechnicalBoxSizer->Add( m_BoxSelectLayer[layer], 0, wxGROW | wxALL, 1 ); } } if( m_Config ) if( m_Config ) Loading @@ -141,11 +145,10 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event ) } } /***********************************/ void DIALOG_SVG_PRINT::SetPenWidth() void DIALOG_SVG_PRINT::SetPenWidth() /***********************************/ { { s_PrintPenMinWidth = ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits ); s_PrintPenMinWidth = ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits ); if( s_PrintPenMinWidth > WIDTH_MAX_VALUE ) if( s_PrintPenMinWidth > WIDTH_MAX_VALUE ) { { Loading @@ -158,13 +161,12 @@ void DIALOG_SVG_PRINT::SetPenWidth() } } m_DialogPenWidth->SetValue( m_DialogPenWidth->SetValue( ReturnStringFromValue( g_UnitMetric, s_PrintPenMinWidth, m_Parent->m_InternalUnits ) ); ReturnStringFromValue( g_UnitMetric, s_PrintPenMinWidth, m_Parent->m_InternalUnits ) ); } } /***************************************************************************/ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ) void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ) /***************************************************************************/ { { wxFileName fn; wxFileName fn; wxString msg; wxString msg; Loading Loading @@ -197,7 +199,6 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ) m_PrintMaskLayer = 1 << layer; m_PrintMaskLayer = 1 << layer; if( m_PrintBoardEdgesCtrl->IsChecked() ) if( m_PrintBoardEdgesCtrl->IsChecked() ) m_PrintMaskLayer |= EDGE_LAYER; m_PrintMaskLayer |= EDGE_LAYER; } } fn.SetExt( wxT( "svg" ) ); fn.SetExt( wxT( "svg" ) ); Loading @@ -215,14 +216,12 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ) } } /**********************************************************************************/ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* screen, bool aPrint_Framet_Ref ) /***********************************************************************************/ /* /* * Routine effective d'impression * Routine actual print */ */ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* screen, bool aPrint_Framet_Ref ) { { int tmpzoom; int tmpzoom; wxPoint tmp_startvisu; wxPoint tmp_startvisu; Loading @@ -231,7 +230,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre float dpi; float dpi; bool success = true; bool success = true; /* modification des cadrages et reglages locaux */ /* Change frames and local settings */ tmp_startvisu = screen->m_StartVisu; tmp_startvisu = screen->m_StartVisu; tmpzoom = screen->GetZoom(); tmpzoom = screen->GetZoom(); old_org = screen->m_DrawOrg; old_org = screen->m_DrawOrg; Loading @@ -250,16 +249,20 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre EDA_Rect tmp = panel->m_ClipBox; EDA_Rect tmp = panel->m_ClipBox; GRResetPenAndBrush( &dc ); GRResetPenAndBrush( &dc ); s_PrintPenMinWidth = ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits ); s_PrintPenMinWidth = ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits ); SetPenMinWidth( s_PrintPenMinWidth ); SetPenMinWidth( s_PrintPenMinWidth ); GRForceBlackPen( m_ModeColorOption->GetSelection() == 0 ? FALSE : true ); GRForceBlackPen( m_ModeColorOption->GetSelection() == 0 ? FALSE : true ); panel->m_ClipBox.SetX( 0 ); panel->m_ClipBox.SetY( 0 ); panel->m_ClipBox.SetX( 0 ); panel->m_ClipBox.SetY( 0 ); panel->m_ClipBox.SetWidth( 0x7FFFFF0 ); panel->m_ClipBox.SetHeight( 0x7FFFFF0 ); panel->m_ClipBox.SetWidth( 0x7FFFFF0 ); panel->m_ClipBox.SetHeight( 0x7FFFFF0 ); screen->m_IsPrinting = true; screen->m_IsPrinting = true; SetLocaleTo_C_standard(); // Switch the locale to standard C (needed to print floating point numbers like 1.3) SetLocaleTo_C_standard(); // Switch the locale to standard C (needed // to print floating point numbers like // 1.3) panel->PrintPage( &dc, aPrint_Framet_Ref, m_PrintMaskLayer, false ); panel->PrintPage( &dc, aPrint_Framet_Ref, m_PrintMaskLayer, false ); SetLocaleTo_Default(); // revert to the current locale SetLocaleTo_Default(); // revert to the current locale screen->m_IsPrinting = false; screen->m_IsPrinting = false; Loading @@ -276,35 +279,27 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre } } /********************************************************************/ void DIALOG_SVG_PRINT::OnButtonPrintBoardClick( wxCommandEvent& event ) void DIALOG_SVG_PRINT::OnButtonPrintBoardClick( wxCommandEvent& event ) /********************************************************************/ { { s_Print_Frame_Ref = m_Print_Frame_Ref_Ctrl->IsChecked(); s_Print_Frame_Ref = m_Print_Frame_Ref_Ctrl->IsChecked(); PrintSVGDoc( true, s_Print_Frame_Ref ); PrintSVGDoc( true, s_Print_Frame_Ref ); } } /********************************************************************/ void DIALOG_SVG_PRINT::OnButtonPrintSelectedClick( wxCommandEvent& event ) void DIALOG_SVG_PRINT::OnButtonPrintSelectedClick( wxCommandEvent& event ) /********************************************************************/ { { s_Print_Frame_Ref = m_Print_Frame_Ref_Ctrl->IsChecked(); s_Print_Frame_Ref = m_Print_Frame_Ref_Ctrl->IsChecked(); PrintSVGDoc( false, s_Print_Frame_Ref ); PrintSVGDoc( false, s_Print_Frame_Ref ); } } /******************************************************************/ void DIALOG_SVG_PRINT::OnButtonCancelClick( wxCommandEvent& event ) void DIALOG_SVG_PRINT::OnButtonCancelClick( wxCommandEvent& event ) /******************************************************************/ { { Close(); Close(); } } /***********************************************************/ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event ) void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event ) /***********************************************************/ { { SetPenWidth(); SetPenWidth(); s_PlotBlackAndWhite = m_ModeColorOption->GetSelection(); s_PlotBlackAndWhite = m_ModeColorOption->GetSelection(); Loading @@ -323,12 +318,9 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event ) } } /*********************************************************************/ void DIALOG_SVG_PRINT::OnSetColorModeSelected( wxCommandEvent& event ) /*********************************************************************/ /* called on radiobox color/black and white selection /* called on radiobox color/black and white selection */ */ void DIALOG_SVG_PRINT::OnSetColorModeSelected( wxCommandEvent& event ) { { s_PlotBlackAndWhite = m_ModeColorOption->GetSelection(); s_PlotBlackAndWhite = m_ModeColorOption->GetSelection(); } } Loading
pcbnew/autoplac.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -902,7 +902,7 @@ float WinEDA_PcbFrame::Compute_Ratsnest_PlaceModule( wxDC* DC ) /* Draw keep out area of a module. */ /* Draw keep out area of a module. */ /***********************************/ /***********************************/ /* ??? /* TRANSLATE * les cellules ( du plan des Distances ) du rectangle x0,y0 a x1,y1 sont * les cellules ( du plan des Distances ) du rectangle x0,y0 a x1,y1 sont * incrementees de la valeur Penalite * incrementees de la valeur Penalite * celles qui sont externes au rectangle, mais internes au rectangle * celles qui sont externes au rectangle, mais internes au rectangle Loading
pcbnew/board.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -344,7 +344,7 @@ int Build_Work( BOARD* Pcb ) for( unsigned ii = 0; ii < Pcb->GetRatsnestsCount(); ii++ ) for( unsigned ii = 0; ii < Pcb->GetRatsnestsCount(); ii++ ) { { pt_rats = &Pcb->m_FullRatsnest[ii]; pt_rats = &Pcb->m_FullRatsnest[ii]; /* ??? On ne route que les chevelus actifs et routables */ /* TRANSLATE On ne route que les chevelus actifs et routables */ if( (pt_rats->m_Status & CH_ACTIF) == 0 ) if( (pt_rats->m_Status & CH_ACTIF) == 0 ) continue; continue; if( pt_rats->m_Status & CH_UNROUTABLE ) if( pt_rats->m_Status & CH_UNROUTABLE ) Loading
pcbnew/deltrack.cpp +55 −58 Original line number Original line Diff line number Diff line /*********************************************/ /******************************************/ /* Edition des pistes: Routines d'effacement */ /* Edit Track: Erase Routines */ /* Effacement de segment, piste, net et zone */ /* Delete segments, tracks, and net areas */ /*********************************************/ /******************************************/ #include "fctsys.h" #include "fctsys.h" #include "common.h" #include "common.h" Loading @@ -14,16 +13,12 @@ #include "protos.h" #include "protos.h" /***************************************************************/ /* Removes 1 segment of track. TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) * 2 cases: /***************************************************************/ * If There is evidence of new track: delete new segment. * Otherwise, delete segment under the cursor. /* Supprime 1 segment de piste. * 2 Cas possibles: * Si On est en trace de nouvelle piste: Effacement du segment en * cours de trace * Sinon : Effacment du segment sous le curseur. */ */ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) { { int current_net_code; int current_net_code; Loading @@ -36,7 +31,8 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) return NULL; return NULL; } } if( aTrack->m_Flags & IS_NEW ) // Trace in progress, erase the last segment if( aTrack->m_Flags & IS_NEW ) // Trace in progress, erase the last // segment { { if( g_CurrentTrackList.GetCount() > 0 ) if( g_CurrentTrackList.GetCount() > 0 ) { { Loading @@ -44,7 +40,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) D( g_CurrentTrackList.VerifyListIntegrity(); ) D( g_CurrentTrackList.VerifyListIntegrity(); ) // effacement de la piste en cours // Delete the current trace ShowNewTrackWhenMovingCursor( DrawPanel, DC, FALSE ); ShowNewTrackWhenMovingCursor( DrawPanel, DC, FALSE ); // delete the most recently entered // delete the most recently entered Loading @@ -52,8 +48,9 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) if( g_TwoSegmentTrackBuild ) if( g_TwoSegmentTrackBuild ) { { // if in 2 track mode, and the next most recent is a segment not a via, // if in 2 track mode, and the next most recent is a segment // and the one previous to that is a via, then delete up to the via. // not a via, and the one previous to that is a via, then // delete up to the via. if( g_CurrentTrackList.GetCount() >= 2 if( g_CurrentTrackList.GetCount() >= 2 && g_CurrentTrackSegment->Type() != TYPE_VIA && g_CurrentTrackSegment->Type() != TYPE_VIA && g_CurrentTrackSegment->Back()->Type() == TYPE_VIA ) && g_CurrentTrackSegment->Back()->Type() == TYPE_VIA ) Loading @@ -62,22 +59,26 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) } } } } while( g_CurrentTrackSegment && g_CurrentTrackSegment->Type() == TYPE_VIA ) while( g_CurrentTrackSegment && g_CurrentTrackSegment->Type() == TYPE_VIA ) { { delete g_CurrentTrackList.PopBack(); delete g_CurrentTrackList.PopBack(); if( g_CurrentTrackSegment && g_CurrentTrackSegment->Type() != TYPE_VIA ) if( g_CurrentTrackSegment && g_CurrentTrackSegment->Type() != TYPE_VIA ) previous_layer = g_CurrentTrackSegment->GetLayer(); previous_layer = g_CurrentTrackSegment->GetLayer(); } } // Rectification couche active qui a pu changer si une via // Correct active layer which could change if a via // a ete effacee // has been erased ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = previous_layer; ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer = previous_layer; UpdateStatusBar(); UpdateStatusBar(); if( g_TwoSegmentTrackBuild ) // We must have 2 segments or more, or 0 if( g_TwoSegmentTrackBuild ) // We must have 2 segments or more, // or 0 { { if( g_CurrentTrackList.GetCount()==1 && g_CurrentTrackSegment->Type() != TYPE_VIA ) if( g_CurrentTrackList.GetCount() == 1 && g_CurrentTrackSegment->Type() != TYPE_VIA ) { { delete g_CurrentTrackList.PopBack(); delete g_CurrentTrackList.PopBack(); } } Loading Loading @@ -110,6 +111,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) DLIST<TRACK>* container = (DLIST<TRACK>*)aTrack->GetList(); DLIST<TRACK>* container = (DLIST<TRACK>*)aTrack->GetList(); wxASSERT( container ); wxASSERT( container ); container->Remove( aTrack ); container->Remove( aTrack ); // redraw the area where the track was // redraw the area where the track was DrawPanel->PostDirtyRect( aTrack->GetBoundingBox() ); DrawPanel->PostDirtyRect( aTrack->GetBoundingBox() ); Loading @@ -122,9 +124,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* aTrack ) } } /**********************************************************/ void WinEDA_PcbFrame::Delete_Track( wxDC* DC, TRACK* aTrack ) void WinEDA_PcbFrame::Delete_Track( wxDC* DC, TRACK* aTrack ) /**********************************************************/ { { if( aTrack != NULL ) if( aTrack != NULL ) { { Loading @@ -136,9 +136,7 @@ void WinEDA_PcbFrame::Delete_Track( wxDC* DC, TRACK* aTrack ) } } /********************************************************/ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack ) void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack ) /********************************************************/ { { if( aTrack == NULL ) if( aTrack == NULL ) return; return; Loading @@ -163,6 +161,7 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack ) break; break; GetBoard()->m_Track.Remove( segm ); GetBoard()->m_Track.Remove( segm ); // redraw the area where the track was // redraw the area where the track was DrawPanel->PostDirtyRect( segm->GetBoundingBox() ); DrawPanel->PostDirtyRect( segm->GetBoundingBox() ); picker.m_PickedItem = segm; picker.m_PickedItem = segm; Loading @@ -174,25 +173,22 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* aTrack ) GetScreen()->SetModify(); GetScreen()->SetModify(); test_1_net_connexion( DC, net_code_delete ); test_1_net_connexion( DC, net_code_delete ); GetBoard()->DisplayInfo( this ); GetBoard()->DisplayInfo( this ); } } /********************************************************************/ /* Remove 1 track: void WinEDA_PcbFrame::Remove_One_Track( wxDC* DC, TRACK* pt_segm ) * The leading segment is removed and all adjacent segments /********************************************************************/ * until a pad or a junction point of more than 2 segments is found /* Routine de suppression de 1 piste: * le segment pointe est supprime puis les segments adjacents * jusqu'a un pad ou un point de jonction de plus de 2 segments */ */ void WinEDA_PcbFrame::Remove_One_Track( wxDC* DC, TRACK* pt_segm ) { { int segments_to_delete_count; int segments_to_delete_count; if( pt_segm == NULL ) if( pt_segm == NULL ) return; return; TRACK* trackList = Marque_Une_Piste( GetBoard(), pt_segm, &segments_to_delete_count, NULL, true ); TRACK* trackList = Marque_Une_Piste( GetBoard(), pt_segm, &segments_to_delete_count, NULL, true ); if( segments_to_delete_count == 0 ) if( segments_to_delete_count == 0 ) return; return; Loading @@ -213,6 +209,7 @@ void WinEDA_PcbFrame::Remove_One_Track( wxDC* DC, TRACK* pt_segm ) ); ) ); ) GetBoard()->m_Track.Remove( tracksegment ); GetBoard()->m_Track.Remove( tracksegment ); // redraw the area where the track was // redraw the area where the track was DrawPanel->PostDirtyRect( tracksegment->GetBoundingBox() ); DrawPanel->PostDirtyRect( tracksegment->GetBoundingBox() ); picker.m_PickedItem = tracksegment; picker.m_PickedItem = tracksegment; Loading
pcbnew/dialog_SVG_print.cpp +47 −55 Original line number Original line Diff line number Diff line ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Name: dialog_svg_print.cpp // Name: dialog_svg_print.cpp // Author: jean-pierre Charras // Author: jean-pierre Charras // Modified by: // Modified by: Loading Loading @@ -56,16 +55,15 @@ private: void OnSetColorModeSelected( wxCommandEvent& event ); void OnSetColorModeSelected( wxCommandEvent& event ); void SetPenWidth(); void SetPenWidth(); void PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ); void PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ); bool DrawPage( const wxString& FullFileName, BASE_SCREEN* screen, bool aPrint_Framet_Ref ); bool DrawPage( const wxString& FullFileName, BASE_SCREEN* screen, bool aPrint_Framet_Ref ); }; }; /*******************************************************/ void WinEDA_DrawFrame::SVG_Print( wxCommandEvent& event ) /*******************************************************/ /* Prepare les structures de donnees de gestion de l'impression /* Prepare the data structures of print management * et affiche la fenetre de dialogue de gestion de l'impression des feuilles * And displays the dialog window management of printing sheets */ */ void WinEDA_DrawFrame::SVG_Print( wxCommandEvent& event ) { { DIALOG_SVG_PRINT frame( this ); DIALOG_SVG_PRINT frame( this ); Loading @@ -84,9 +82,7 @@ DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( WinEDA_DrawFrame* parent ) : } } /*************************************************************/ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event ) void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event ) /*************************************************************/ { { SetFocus(); // Make ESC key working SetFocus(); // Make ESC key working Loading @@ -99,7 +95,8 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event ) AddUnitSymbol( *m_TextPenWidth, g_UnitMetric ); AddUnitSymbol( *m_TextPenWidth, g_UnitMetric ); m_DialogPenWidth->SetValue( m_DialogPenWidth->SetValue( ReturnStringFromValue( g_UnitMetric, s_PrintPenMinWidth, m_Parent->m_InternalUnits ) ); ReturnStringFromValue( g_UnitMetric, s_PrintPenMinWidth, m_Parent->m_InternalUnits ) ); m_Print_Frame_Ref_Ctrl->SetValue( s_Print_Frame_Ref ); m_Print_Frame_Ref_Ctrl->SetValue( s_Print_Frame_Ref ); Loading @@ -108,15 +105,22 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event ) int mask = 1; int mask = 1; for( int layer = 0; layer<NB_LAYERS; layer++, mask <<= 1 ) for( int layer = 0; layer<NB_LAYERS; layer++, mask <<= 1 ) { { m_BoxSelectLayer[layer] = new wxCheckBox( this, -1, board->GetLayerName( layer ) ); m_BoxSelectLayer[layer] = new wxCheckBox( this, -1, board->GetLayerName( layer ) ); if( mask & s_SelectedLayers ) if( mask & s_SelectedLayers ) m_BoxSelectLayer[layer]->SetValue( true ); m_BoxSelectLayer[layer]->SetValue( true ); if( layer < 16 ) if( layer < 16 ) m_CopperLayersBoxSizer->Add( m_BoxSelectLayer[layer], 0, wxGROW | wxALL, 1 ); m_CopperLayersBoxSizer->Add( m_BoxSelectLayer[layer], 0, wxGROW | wxALL, 1 ); else else m_TechnicalBoxSizer->Add( m_BoxSelectLayer[layer], 0, wxGROW | wxALL, 1 ); m_TechnicalBoxSizer->Add( m_BoxSelectLayer[layer], 0, wxGROW | wxALL, 1 ); } } if( m_Config ) if( m_Config ) Loading @@ -141,11 +145,10 @@ void DIALOG_SVG_PRINT::OnInitDialog( wxInitDialogEvent& event ) } } /***********************************/ void DIALOG_SVG_PRINT::SetPenWidth() void DIALOG_SVG_PRINT::SetPenWidth() /***********************************/ { { s_PrintPenMinWidth = ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits ); s_PrintPenMinWidth = ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits ); if( s_PrintPenMinWidth > WIDTH_MAX_VALUE ) if( s_PrintPenMinWidth > WIDTH_MAX_VALUE ) { { Loading @@ -158,13 +161,12 @@ void DIALOG_SVG_PRINT::SetPenWidth() } } m_DialogPenWidth->SetValue( m_DialogPenWidth->SetValue( ReturnStringFromValue( g_UnitMetric, s_PrintPenMinWidth, m_Parent->m_InternalUnits ) ); ReturnStringFromValue( g_UnitMetric, s_PrintPenMinWidth, m_Parent->m_InternalUnits ) ); } } /***************************************************************************/ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ) void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ) /***************************************************************************/ { { wxFileName fn; wxFileName fn; wxString msg; wxString msg; Loading Loading @@ -197,7 +199,6 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ) m_PrintMaskLayer = 1 << layer; m_PrintMaskLayer = 1 << layer; if( m_PrintBoardEdgesCtrl->IsChecked() ) if( m_PrintBoardEdgesCtrl->IsChecked() ) m_PrintMaskLayer |= EDGE_LAYER; m_PrintMaskLayer |= EDGE_LAYER; } } fn.SetExt( wxT( "svg" ) ); fn.SetExt( wxT( "svg" ) ); Loading @@ -215,14 +216,12 @@ void DIALOG_SVG_PRINT::PrintSVGDoc( bool aPrintAll, bool aPrint_Framet_Ref ) } } /**********************************************************************************/ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* screen, bool aPrint_Framet_Ref ) /***********************************************************************************/ /* /* * Routine effective d'impression * Routine actual print */ */ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* screen, bool aPrint_Framet_Ref ) { { int tmpzoom; int tmpzoom; wxPoint tmp_startvisu; wxPoint tmp_startvisu; Loading @@ -231,7 +230,7 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre float dpi; float dpi; bool success = true; bool success = true; /* modification des cadrages et reglages locaux */ /* Change frames and local settings */ tmp_startvisu = screen->m_StartVisu; tmp_startvisu = screen->m_StartVisu; tmpzoom = screen->GetZoom(); tmpzoom = screen->GetZoom(); old_org = screen->m_DrawOrg; old_org = screen->m_DrawOrg; Loading @@ -250,16 +249,20 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre EDA_Rect tmp = panel->m_ClipBox; EDA_Rect tmp = panel->m_ClipBox; GRResetPenAndBrush( &dc ); GRResetPenAndBrush( &dc ); s_PrintPenMinWidth = ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits ); s_PrintPenMinWidth = ReturnValueFromTextCtrl( *m_DialogPenWidth, m_Parent->m_InternalUnits ); SetPenMinWidth( s_PrintPenMinWidth ); SetPenMinWidth( s_PrintPenMinWidth ); GRForceBlackPen( m_ModeColorOption->GetSelection() == 0 ? FALSE : true ); GRForceBlackPen( m_ModeColorOption->GetSelection() == 0 ? FALSE : true ); panel->m_ClipBox.SetX( 0 ); panel->m_ClipBox.SetY( 0 ); panel->m_ClipBox.SetX( 0 ); panel->m_ClipBox.SetY( 0 ); panel->m_ClipBox.SetWidth( 0x7FFFFF0 ); panel->m_ClipBox.SetHeight( 0x7FFFFF0 ); panel->m_ClipBox.SetWidth( 0x7FFFFF0 ); panel->m_ClipBox.SetHeight( 0x7FFFFF0 ); screen->m_IsPrinting = true; screen->m_IsPrinting = true; SetLocaleTo_C_standard(); // Switch the locale to standard C (needed to print floating point numbers like 1.3) SetLocaleTo_C_standard(); // Switch the locale to standard C (needed // to print floating point numbers like // 1.3) panel->PrintPage( &dc, aPrint_Framet_Ref, m_PrintMaskLayer, false ); panel->PrintPage( &dc, aPrint_Framet_Ref, m_PrintMaskLayer, false ); SetLocaleTo_Default(); // revert to the current locale SetLocaleTo_Default(); // revert to the current locale screen->m_IsPrinting = false; screen->m_IsPrinting = false; Loading @@ -276,35 +279,27 @@ bool DIALOG_SVG_PRINT::DrawPage( const wxString& FullFileName, BASE_SCREEN* scre } } /********************************************************************/ void DIALOG_SVG_PRINT::OnButtonPrintBoardClick( wxCommandEvent& event ) void DIALOG_SVG_PRINT::OnButtonPrintBoardClick( wxCommandEvent& event ) /********************************************************************/ { { s_Print_Frame_Ref = m_Print_Frame_Ref_Ctrl->IsChecked(); s_Print_Frame_Ref = m_Print_Frame_Ref_Ctrl->IsChecked(); PrintSVGDoc( true, s_Print_Frame_Ref ); PrintSVGDoc( true, s_Print_Frame_Ref ); } } /********************************************************************/ void DIALOG_SVG_PRINT::OnButtonPrintSelectedClick( wxCommandEvent& event ) void DIALOG_SVG_PRINT::OnButtonPrintSelectedClick( wxCommandEvent& event ) /********************************************************************/ { { s_Print_Frame_Ref = m_Print_Frame_Ref_Ctrl->IsChecked(); s_Print_Frame_Ref = m_Print_Frame_Ref_Ctrl->IsChecked(); PrintSVGDoc( false, s_Print_Frame_Ref ); PrintSVGDoc( false, s_Print_Frame_Ref ); } } /******************************************************************/ void DIALOG_SVG_PRINT::OnButtonCancelClick( wxCommandEvent& event ) void DIALOG_SVG_PRINT::OnButtonCancelClick( wxCommandEvent& event ) /******************************************************************/ { { Close(); Close(); } } /***********************************************************/ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event ) void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event ) /***********************************************************/ { { SetPenWidth(); SetPenWidth(); s_PlotBlackAndWhite = m_ModeColorOption->GetSelection(); s_PlotBlackAndWhite = m_ModeColorOption->GetSelection(); Loading @@ -323,12 +318,9 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event ) } } /*********************************************************************/ void DIALOG_SVG_PRINT::OnSetColorModeSelected( wxCommandEvent& event ) /*********************************************************************/ /* called on radiobox color/black and white selection /* called on radiobox color/black and white selection */ */ void DIALOG_SVG_PRINT::OnSetColorModeSelected( wxCommandEvent& event ) { { s_PlotBlackAndWhite = m_ModeColorOption->GetSelection(); s_PlotBlackAndWhite = m_ModeColorOption->GetSelection(); } }