Commit aae87178 authored by Lorenzo Marcantonio's avatar Lorenzo Marcantonio

Renamed global variables:

Drc_On => g_Drc_On
Route_Layer_TOP => g_Route_Layer_TOP
Route_Layer_BOTTOM => g_Route_Layer_BOTTOM
Track_45_Only_Allowed => g_Track_45_Only_Allowed
parent 0cbe14c1
...@@ -140,8 +140,8 @@ void PCB_EDIT_FRAME::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC ) ...@@ -140,8 +140,8 @@ void PCB_EDIT_FRAME::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC )
} }
memopos = CurrPosition; memopos = CurrPosition;
lay_tmp_BOTTOM = Route_Layer_BOTTOM; lay_tmp_BOTTOM = g_Route_Layer_BOTTOM;
lay_tmp_TOP = Route_Layer_TOP; lay_tmp_TOP = g_Route_Layer_TOP;
RoutingMatrix.m_GridRouting = (int) GetScreen()->GetGridSize().x; RoutingMatrix.m_GridRouting = (int) GetScreen()->GetGridSize().x;
...@@ -353,8 +353,8 @@ end_of_tst: ...@@ -353,8 +353,8 @@ end_of_tst:
RoutingMatrix.UnInitRoutingMatrix(); RoutingMatrix.UnInitRoutingMatrix();
Route_Layer_TOP = lay_tmp_TOP; g_Route_Layer_TOP = lay_tmp_TOP;
Route_Layer_BOTTOM = lay_tmp_BOTTOM; g_Route_Layer_BOTTOM = lay_tmp_BOTTOM;
Module = GetBoard()->m_Modules; Module = GetBoard()->m_Modules;
...@@ -447,12 +447,12 @@ int PCB_EDIT_FRAME::GenPlaceBoard() ...@@ -447,12 +447,12 @@ int PCB_EDIT_FRAME::GenPlaceBoard()
msg.Printf( wxT( "%d" ), RoutingMatrix.m_MemSize / 1024 ); msg.Printf( wxT( "%d" ), RoutingMatrix.m_MemSize / 1024 );
m_messagePanel->SetMessage( 24, wxT( "Mem(Kb)" ), msg, CYAN ); m_messagePanel->SetMessage( 24, wxT( "Mem(Kb)" ), msg, CYAN );
Route_Layer_BOTTOM = LAYER_N_FRONT; g_Route_Layer_BOTTOM = LAYER_N_FRONT;
if( RoutingMatrix.m_RoutingLayersCount > 1 ) if( RoutingMatrix.m_RoutingLayersCount > 1 )
Route_Layer_BOTTOM = LAYER_N_BACK; g_Route_Layer_BOTTOM = LAYER_N_BACK;
Route_Layer_TOP = LAYER_N_FRONT; g_Route_Layer_TOP = LAYER_N_FRONT;
/* Place the edge layer segments */ /* Place the edge layer segments */
TRACK TmpSegm( NULL ); TRACK TmpSegm( NULL );
...@@ -969,10 +969,10 @@ void CreateKeepOutRectangle( int ux0, int uy0, int ux1, int uy1, ...@@ -969,10 +969,10 @@ void CreateKeepOutRectangle( int ux0, int uy0, int ux1, int uy1,
DIST_CELL data, LocalKeepOut; DIST_CELL data, LocalKeepOut;
int lgain, cgain; int lgain, cgain;
if( aLayerMask & GetLayerMask( Route_Layer_BOTTOM ) ) if( aLayerMask & GetLayerMask( g_Route_Layer_BOTTOM ) )
trace = 1; /* Trace on bottom layer. */ trace = 1; /* Trace on bottom layer. */
if( ( aLayerMask & GetLayerMask( Route_Layer_TOP ) ) && RoutingMatrix.m_RoutingLayersCount ) if( ( aLayerMask & GetLayerMask( g_Route_Layer_TOP ) ) && RoutingMatrix.m_RoutingLayersCount )
trace |= 2; /* Trace on top layer. */ trace |= 2; /* Trace on top layer. */
if( trace == 0 ) if( trace == 0 )
......
...@@ -61,12 +61,12 @@ void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode ) ...@@ -61,12 +61,12 @@ void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode )
if( GetBoard()->GetCopperLayerCount() > 1 ) if( GetBoard()->GetCopperLayerCount() > 1 )
{ {
Route_Layer_TOP = GetScreen()->m_Route_Layer_TOP; g_Route_Layer_TOP = GetScreen()->m_Route_Layer_TOP;
Route_Layer_BOTTOM = GetScreen()->m_Route_Layer_BOTTOM; g_Route_Layer_BOTTOM = GetScreen()->m_Route_Layer_BOTTOM;
} }
else else
{ {
Route_Layer_TOP = Route_Layer_BOTTOM = LAYER_N_BACK; g_Route_Layer_TOP = g_Route_Layer_BOTTOM = LAYER_N_BACK;
} }
switch( mode ) switch( mode )
...@@ -172,7 +172,7 @@ void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode ) ...@@ -172,7 +172,7 @@ void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode )
/* Map the board */ /* Map the board */
RoutingMatrix.m_RoutingLayersCount = 1; RoutingMatrix.m_RoutingLayersCount = 1;
if( Route_Layer_TOP != Route_Layer_BOTTOM ) if( g_Route_Layer_TOP != g_Route_Layer_BOTTOM )
RoutingMatrix.m_RoutingLayersCount = 2; RoutingMatrix.m_RoutingLayersCount = 2;
if( RoutingMatrix.InitRoutingMatrix() < 0 ) if( RoutingMatrix.InitRoutingMatrix() < 0 )
......
...@@ -76,10 +76,10 @@ static void TraceCircle( int ux0, int uy0, int ux1, int uy1, int lg, int layer, ...@@ -76,10 +76,10 @@ static void TraceCircle( int ux0, int uy0, int ux1, int uy1, int lg, int layer,
} \ } \
else \ else \
{ \ { \
if( layer == Route_Layer_BOTTOM ) \ if( layer == g_Route_Layer_BOTTOM ) \
RoutingMatrix.WriteCell( dy, dx, BOTTOM, color ); \ RoutingMatrix.WriteCell( dy, dx, BOTTOM, color ); \
if( RoutingMatrix.m_RoutingLayersCount > 1 ) \ if( RoutingMatrix.m_RoutingLayersCount > 1 ) \
if( layer == Route_Layer_TOP ) \ if( layer == g_Route_Layer_TOP ) \
RoutingMatrix.WriteCell( dy, dx, TOP, color ); \ RoutingMatrix.WriteCell( dy, dx, TOP, color ); \
} \ } \
} }
...@@ -152,10 +152,10 @@ void TraceFilledCircle( int cx, int cy, int radius, ...@@ -152,10 +152,10 @@ void TraceFilledCircle( int cx, int cy, int radius,
int tstwrite = 0; int tstwrite = 0;
int distmin; int distmin;
if( aLayerMask & GetLayerMask( Route_Layer_BOTTOM ) ) if( aLayerMask & GetLayerMask( g_Route_Layer_BOTTOM ) )
trace = 1; // Trace on BOTTOM trace = 1; // Trace on BOTTOM
if( aLayerMask & GetLayerMask( Route_Layer_TOP ) ) if( aLayerMask & GetLayerMask( g_Route_Layer_TOP ) )
if( RoutingMatrix.m_RoutingLayersCount > 1 ) if( RoutingMatrix.m_RoutingLayersCount > 1 )
trace |= 2; // Trace on TOP trace |= 2; // Trace on TOP
...@@ -275,13 +275,13 @@ void TraceSegmentPcb( TRACK* pt_segm, int color, int marge, int op_logic ) ...@@ -275,13 +275,13 @@ void TraceSegmentPcb( TRACK* pt_segm, int color, int marge, int op_logic )
{ {
int mask_layer = 0; int mask_layer = 0;
if( pt_segm->IsOnLayer( Route_Layer_BOTTOM ) ) if( pt_segm->IsOnLayer( g_Route_Layer_BOTTOM ) )
mask_layer = 1 << Route_Layer_BOTTOM; mask_layer = 1 << g_Route_Layer_BOTTOM;
if( pt_segm->IsOnLayer( Route_Layer_TOP ) ) if( pt_segm->IsOnLayer( g_Route_Layer_TOP ) )
{ {
if( mask_layer == 0 ) if( mask_layer == 0 )
mask_layer = 1 << Route_Layer_TOP; mask_layer = 1 << g_Route_Layer_TOP;
else else
mask_layer = -1; mask_layer = -1;
} }
...@@ -474,10 +474,10 @@ void TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1, ...@@ -474,10 +474,10 @@ void TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1,
int row_min, row_max, col_min, col_max; int row_min, row_max, col_min, col_max;
int trace = 0; int trace = 0;
if( ( aLayerMask & GetLayerMask( Route_Layer_BOTTOM ) ) ) if( ( aLayerMask & GetLayerMask( g_Route_Layer_BOTTOM ) ) )
trace = 1; // Trace on BOTTOM trace = 1; // Trace on BOTTOM
if( ( aLayerMask & GetLayerMask( Route_Layer_TOP ) ) && if( ( aLayerMask & GetLayerMask( g_Route_Layer_TOP ) ) &&
RoutingMatrix.m_RoutingLayersCount > 1 ) RoutingMatrix.m_RoutingLayersCount > 1 )
trace |= 2; // Trace on TOP trace |= 2; // Trace on TOP
...@@ -540,10 +540,10 @@ void TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1, ...@@ -540,10 +540,10 @@ void TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1,
int rotrow, rotcol; int rotrow, rotcol;
int trace = 0; int trace = 0;
if( aLayerMask & GetLayerMask( Route_Layer_BOTTOM ) ) if( aLayerMask & GetLayerMask( g_Route_Layer_BOTTOM ) )
trace = 1; // Trace on BOTTOM trace = 1; // Trace on BOTTOM
if( aLayerMask & GetLayerMask( Route_Layer_TOP ) ) if( aLayerMask & GetLayerMask( g_Route_Layer_TOP ) )
{ {
if( RoutingMatrix.m_RoutingLayersCount > 1 ) if( RoutingMatrix.m_RoutingLayersCount > 1 )
trace |= 2; // Trace on TOP trace |= 2; // Trace on TOP
......
...@@ -416,8 +416,8 @@ static int Autoroute_One_Track( PCB_EDIT_FRAME* pcbframe, ...@@ -416,8 +416,8 @@ static int Autoroute_One_Track( PCB_EDIT_FRAME* pcbframe,
int marge; int marge;
int padLayerMaskStart; /* Mask layers belonging to the starting pad. */ int padLayerMaskStart; /* Mask layers belonging to the starting pad. */
int padLayerMaskEnd; /* Mask layers belonging to the ending pad. */ int padLayerMaskEnd; /* Mask layers belonging to the ending pad. */
int topLayerMask = GetLayerMask( Route_Layer_TOP ); int topLayerMask = GetLayerMask( g_Route_Layer_TOP );
int bottomLayerMask = GetLayerMask( Route_Layer_BOTTOM ); int bottomLayerMask = GetLayerMask( g_Route_Layer_BOTTOM );
int routeLayerMask; /* Mask two layers for routing. */ int routeLayerMask; /* Mask two layers for routing. */
int tab_mask[2]; /* Enables the calculation of the mask layer being int tab_mask[2]; /* Enables the calculation of the mask layer being
* tested. (side = TOP or BOTTOM) */ * tested. (side = TOP or BOTTOM) */
...@@ -1169,7 +1169,7 @@ static void OrCell_Trace( BOARD* pcb, int col, int row, ...@@ -1169,7 +1169,7 @@ static void OrCell_Trace( BOARD* pcb, int col, int row,
g_CurrentTrackList.PushBack( newTrack ); g_CurrentTrackList.PushBack( newTrack );
g_CurrentTrackSegment->SetState( TRACK_AR, ON ); g_CurrentTrackSegment->SetState( TRACK_AR, true );
g_CurrentTrackSegment->SetLayer( 0x0F ); g_CurrentTrackSegment->SetLayer( 0x0F );
g_CurrentTrackSegment->SetStart(wxPoint( pcb->GetBoundingBox().GetX() + g_CurrentTrackSegment->SetStart(wxPoint( pcb->GetBoundingBox().GetX() +
...@@ -1189,12 +1189,12 @@ static void OrCell_Trace( BOARD* pcb, int col, int row, ...@@ -1189,12 +1189,12 @@ static void OrCell_Trace( BOARD* pcb, int col, int row,
g_CurrentTrackList.PushBack( newTrack ); g_CurrentTrackList.PushBack( newTrack );
g_CurrentTrackSegment->SetLayer( Route_Layer_BOTTOM ); g_CurrentTrackSegment->SetLayer( g_Route_Layer_BOTTOM );
if( side == TOP ) if( side == TOP )
g_CurrentTrackSegment->SetLayer( Route_Layer_TOP ); g_CurrentTrackSegment->SetLayer( g_Route_Layer_TOP );
g_CurrentTrackSegment->SetState( TRACK_AR, ON ); g_CurrentTrackSegment->SetState( TRACK_AR, true );
g_CurrentTrackSegment->SetEnd( wxPoint( pcb->GetBoundingBox().GetX() + g_CurrentTrackSegment->SetEnd( wxPoint( pcb->GetBoundingBox().GetX() +
( RoutingMatrix.m_GridRouting * row ), ( RoutingMatrix.m_GridRouting * row ),
pcb->GetBoundingBox().GetY() + pcb->GetBoundingBox().GetY() +
...@@ -1305,12 +1305,12 @@ static void AddNewTrace( PCB_EDIT_FRAME* pcbframe, wxDC* DC ) ...@@ -1305,12 +1305,12 @@ static void AddNewTrace( PCB_EDIT_FRAME* pcbframe, wxDC* DC )
g_FirstTrackSegment->start = pcbframe->GetBoard()->GetPad( g_FirstTrackSegment, FLG_START ); g_FirstTrackSegment->start = pcbframe->GetBoard()->GetPad( g_FirstTrackSegment, FLG_START );
if( g_FirstTrackSegment->start ) if( g_FirstTrackSegment->start )
g_FirstTrackSegment->SetState( BEGIN_ONPAD, ON ); g_FirstTrackSegment->SetState( BEGIN_ONPAD, true );
g_CurrentTrackSegment->end = pcbframe->GetBoard()->GetPad( g_CurrentTrackSegment, FLG_END ); g_CurrentTrackSegment->end = pcbframe->GetBoard()->GetPad( g_CurrentTrackSegment, FLG_END );
if( g_CurrentTrackSegment->end ) if( g_CurrentTrackSegment->end )
g_CurrentTrackSegment->SetState( END_ONPAD, ON ); g_CurrentTrackSegment->SetState( END_ONPAD, true );
/* Out the new track on the matrix board */ /* Out the new track on the matrix board */
for( TRACK* track = g_FirstTrackSegment; track; track = track->Next() ) for( TRACK* track = g_FirstTrackSegment; track; track = track->Next() )
......
...@@ -332,7 +332,7 @@ void PCB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -332,7 +332,7 @@ void PCB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
{ {
// If there's no intrusion and DRC is active, we pass the cursor // If there's no intrusion and DRC is active, we pass the cursor
// "as is", and let ShowNewTrackWhenMovingCursor figure out what to do. // "as is", and let ShowNewTrackWhenMovingCursor figure out what to do.
if( !Drc_On || !g_CurrentTrackSegment || if( !g_Drc_On || !g_CurrentTrackSegment ||
(BOARD_ITEM*)g_CurrentTrackSegment != this->GetCurItem() || (BOARD_ITEM*)g_CurrentTrackSegment != this->GetCurItem() ||
!LocateIntrusion( m_Pcb->m_Track, g_CurrentTrackSegment, !LocateIntrusion( m_Pcb->m_Track, g_CurrentTrackSegment,
GetScreen()->m_Active_Layer, GetScreen()->RefPos( true ) ) ) GetScreen()->m_Active_Layer, GetScreen()->RefPos( true ) ) )
......
...@@ -82,18 +82,17 @@ void DIALOG_GENERALOPTIONS::init() ...@@ -82,18 +82,17 @@ void DIALOG_GENERALOPTIONS::init()
m_SaveTime->SetValue( timevalue ); m_SaveTime->SetValue( timevalue );
m_MaxShowLinks->SetValue( g_MaxLinksShowed ); m_MaxShowLinks->SetValue( g_MaxLinksShowed );
m_DrcOn->SetValue( Drc_On ); m_DrcOn->SetValue( g_Drc_On );
m_ShowModuleRatsnest->SetValue( g_Show_Module_Ratsnest ); m_ShowModuleRatsnest->SetValue( g_Show_Module_Ratsnest );
m_ShowGlobalRatsnest->SetValue( m_Board->IsElementVisible( RATSNEST_VISIBLE ) ); m_ShowGlobalRatsnest->SetValue( m_Board->IsElementVisible( RATSNEST_VISIBLE ) );
m_TrackAutodel->SetValue( g_AutoDeleteOldTrack ); m_TrackAutodel->SetValue( g_AutoDeleteOldTrack );
m_Track_45_Only_Ctrl->SetValue( g_Track_45_Only_Allowed ); m_Track_45_Only_Ctrl->SetValue( g_Track_45_Only_Allowed );
m_Segments_45_Only_Ctrl->SetValue( Segments_45_Only ); m_Segments_45_Only_Ctrl->SetValue( g_Segments_45_Only );
m_ZoomNoCenterOpt->SetValue( GetParent()->GetCanvas()->GetEnableZoomNoCenter() ); m_ZoomNoCenterOpt->SetValue( GetParent()->GetCanvas()->GetEnableZoomNoCenter() );
m_MiddleButtonPANOpt->SetValue( GetParent()->GetCanvas()->GetEnableMiddleButtonPan() ); m_MiddleButtonPANOpt->SetValue( GetParent()->GetCanvas()->GetEnableMiddleButtonPan() );
m_OptMiddleButtonPanLimited->SetValue( GetParent()->GetCanvas()->GetMiddleButtonPanLimited() ); m_OptMiddleButtonPanLimited->SetValue( GetParent()->GetCanvas()->GetMiddleButtonPanLimited() );
m_OptMiddleButtonPanLimited->Enable( m_MiddleButtonPANOpt->GetValue() ); m_OptMiddleButtonPanLimited->Enable( m_MiddleButtonPANOpt->GetValue() );
m_AutoPANOpt->SetValue( GetParent()->GetCanvas()->GetEnableAutoPan() ); m_AutoPANOpt->SetValue( GetParent()->GetCanvas()->GetEnableAutoPan() );
m_Segments_45_Only_Ctrl->SetValue( Segments_45_Only );
m_Track_DoubleSegm_Ctrl->SetValue( g_TwoSegmentTrackBuild ); m_Track_DoubleSegm_Ctrl->SetValue( g_TwoSegmentTrackBuild );
m_MagneticPadOptCtrl->SetSelection( g_MagneticPadOption ); m_MagneticPadOptCtrl->SetSelection( g_MagneticPadOption );
...@@ -125,7 +124,7 @@ void DIALOG_GENERALOPTIONS::OnOkClick( wxCommandEvent& event ) ...@@ -125,7 +124,7 @@ void DIALOG_GENERALOPTIONS::OnOkClick( wxCommandEvent& event )
/* Updating the combobox to display the active layer. */ /* Updating the combobox to display the active layer. */
g_MaxLinksShowed = m_MaxShowLinks->GetValue(); g_MaxLinksShowed = m_MaxShowLinks->GetValue();
Drc_On = m_DrcOn->GetValue(); g_Drc_On = m_DrcOn->GetValue();
if( m_Board->IsElementVisible(RATSNEST_VISIBLE) != m_ShowGlobalRatsnest->GetValue() ) if( m_Board->IsElementVisible(RATSNEST_VISIBLE) != m_ShowGlobalRatsnest->GetValue() )
{ {
...@@ -135,7 +134,7 @@ void DIALOG_GENERALOPTIONS::OnOkClick( wxCommandEvent& event ) ...@@ -135,7 +134,7 @@ void DIALOG_GENERALOPTIONS::OnOkClick( wxCommandEvent& event )
g_Show_Module_Ratsnest = m_ShowModuleRatsnest->GetValue(); g_Show_Module_Ratsnest = m_ShowModuleRatsnest->GetValue();
g_AutoDeleteOldTrack = m_TrackAutodel->GetValue(); g_AutoDeleteOldTrack = m_TrackAutodel->GetValue();
Segments_45_Only = m_Segments_45_Only_Ctrl->GetValue(); g_Segments_45_Only = m_Segments_45_Only_Ctrl->GetValue();
g_Track_45_Only_Allowed = m_Track_45_Only_Ctrl->GetValue(); g_Track_45_Only_Allowed = m_Track_45_Only_Ctrl->GetValue();
GetParent()->GetCanvas()->SetEnableZoomNoCenter( m_ZoomNoCenterOpt->GetValue() ); GetParent()->GetCanvas()->SetEnableZoomNoCenter( m_ZoomNoCenterOpt->GetValue() );
...@@ -162,11 +161,11 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -162,11 +161,11 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
switch( id ) switch( id )
{ {
case ID_TB_OPTIONS_DRC_OFF: case ID_TB_OPTIONS_DRC_OFF:
Drc_On = !state; g_Drc_On = !state;
if( GetToolId() == ID_TRACK_BUTT ) if( GetToolId() == ID_TRACK_BUTT )
{ {
if( Drc_On ) if( g_Drc_On )
m_canvas->SetCursor( wxCURSOR_PENCIL ); m_canvas->SetCursor( wxCURSOR_PENCIL );
else else
m_canvas->SetCursor( wxCURSOR_QUESTION_ARROW ); m_canvas->SetCursor( wxCURSOR_QUESTION_ARROW );
......
...@@ -1329,7 +1329,7 @@ void PCB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent ) ...@@ -1329,7 +1329,7 @@ void PCB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
break; break;
case ID_TRACK_BUTT: case ID_TRACK_BUTT:
if( Drc_On ) if( g_Drc_On )
SetToolID( id, wxCURSOR_PENCIL, _( "Add tracks" ) ); SetToolID( id, wxCURSOR_PENCIL, _( "Add tracks" ) );
else else
SetToolID( id, wxCURSOR_QUESTION_ARROW, _( "Add tracks" ) ); SetToolID( id, wxCURSOR_QUESTION_ARROW, _( "Add tracks" ) );
......
...@@ -76,7 +76,7 @@ bool PCB_EDIT_FRAME::SetTrackSegmentWidth( TRACK* aTrackItem, ...@@ -76,7 +76,7 @@ bool PCB_EDIT_FRAME::SetTrackSegmentWidth( TRACK* aTrackItem,
{ {
int diagdrc = OK_DRC; int diagdrc = OK_DRC;
if( Drc_On ) if( g_Drc_On )
diagdrc = m_drc->Drc( aTrackItem, GetBoard()->m_Track ); diagdrc = m_drc->Drc( aTrackItem, GetBoard()->m_Track );
if( diagdrc == OK_DRC ) if( diagdrc == OK_DRC )
...@@ -175,7 +175,7 @@ void PCB_EDIT_FRAME::Edit_Track_Width( wxDC* aDC, TRACK* aTrackSegment ) ...@@ -175,7 +175,7 @@ void PCB_EDIT_FRAME::Edit_Track_Width( wxDC* aDC, TRACK* aTrackSegment )
for( int ii = 0; ii < nb_segm; ii++, pt_track = pt_track->Next() ) for( int ii = 0; ii < nb_segm; ii++, pt_track = pt_track->Next() )
{ {
pt_track->SetState( BUSY, OFF ); pt_track->SetState( BUSY, false );
if( SetTrackSegmentWidth( pt_track, &itemsListPicker, false ) ) if( SetTrackSegmentWidth( pt_track, &itemsListPicker, false ) )
change = true; change = true;
......
...@@ -343,7 +343,7 @@ static void DrawSegment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosi ...@@ -343,7 +343,7 @@ static void DrawSegment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosi
if( aErase ) if( aErase )
Segment->Draw( aPanel, aDC, GR_XOR ); Segment->Draw( aPanel, aDC, GR_XOR );
if( Segments_45_Only && Segment->GetShape() == S_SEGMENT ) if( g_Segments_45_Only && Segment->GetShape() == S_SEGMENT )
{ {
wxPoint pt; wxPoint pt;
......
...@@ -73,7 +73,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC ) ...@@ -73,7 +73,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
} }
// Is the current segment Ok (no DRC error) ? // Is the current segment Ok (no DRC error) ?
if( Drc_On ) if( g_Drc_On )
{ {
if( BAD_DRC==m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) ) if( BAD_DRC==m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) )
// DRC error, the change layer is not made // DRC error, the change layer is not made
...@@ -150,7 +150,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC ) ...@@ -150,7 +150,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
break; break;
} }
if( Drc_On && BAD_DRC == m_drc->Drc( via, GetBoard()->m_Track ) ) if( g_Drc_On && BAD_DRC == m_drc->Drc( via, GetBoard()->m_Track ) )
{ {
// DRC fault: the Via cannot be placed here ... // DRC fault: the Via cannot be placed here ...
delete via; delete via;
......
...@@ -182,7 +182,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC ) ...@@ -182,7 +182,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
{ {
g_CurrentTrackSegment->m_PadsConnected.push_back( pad ); g_CurrentTrackSegment->m_PadsConnected.push_back( pad );
// Useful to display track length, if the pad has a die length: // Useful to display track length, if the pad has a die length:
g_CurrentTrackSegment->SetState( BEGIN_ONPAD, ON ); g_CurrentTrackSegment->SetState( BEGIN_ONPAD, true );
g_CurrentTrackSegment->start = pad; g_CurrentTrackSegment->start = pad;
} }
...@@ -196,7 +196,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC ) ...@@ -196,7 +196,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
g_CurrentTrackSegment->start = g_FirstTrackSegment; g_CurrentTrackSegment->start = g_FirstTrackSegment;
g_FirstTrackSegment->end = g_CurrentTrackSegment; g_FirstTrackSegment->end = g_CurrentTrackSegment;
g_FirstTrackSegment->SetState( BEGIN_ONPAD | END_ONPAD, OFF ); g_FirstTrackSegment->SetState( BEGIN_ONPAD | END_ONPAD, false );
} }
D( g_CurrentTrackList.VerifyListIntegrity(); ); D( g_CurrentTrackList.VerifyListIntegrity(); );
...@@ -205,7 +205,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC ) ...@@ -205,7 +205,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
SetCurItem( g_CurrentTrackSegment, false ); SetCurItem( g_CurrentTrackSegment, false );
m_canvas->CallMouseCapture( aDC, wxDefaultPosition, false ); m_canvas->CallMouseCapture( aDC, wxDefaultPosition, false );
if( Drc_On ) if( g_Drc_On )
{ {
if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) ) if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) )
{ {
...@@ -216,7 +216,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC ) ...@@ -216,7 +216,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
else // Track in progress : segment coordinates are updated by ShowNewTrackWhenMovingCursor. else // Track in progress : segment coordinates are updated by ShowNewTrackWhenMovingCursor.
{ {
// Test for a D.R.C. error: // Test for a D.R.C. error:
if( Drc_On ) if( g_Drc_On )
{ {
if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) ) if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) )
return NULL; return NULL;
...@@ -261,7 +261,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC ) ...@@ -261,7 +261,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
g_CurrentTrackList.PushBack( newTrack ); g_CurrentTrackList.PushBack( newTrack );
newTrack->SetFlags( IS_NEW ); newTrack->SetFlags( IS_NEW );
newTrack->SetState( BEGIN_ONPAD | END_ONPAD, OFF ); newTrack->SetState( BEGIN_ONPAD | END_ONPAD, false );
D_PAD* pad = GetBoard()->GetPad( previousTrack, FLG_END ); D_PAD* pad = GetBoard()->GetPad( previousTrack, FLG_END );
...@@ -357,7 +357,7 @@ bool PCB_EDIT_FRAME::Add45DegreeSegment( wxDC* aDC ) ...@@ -357,7 +357,7 @@ bool PCB_EDIT_FRAME::Add45DegreeSegment( wxDC* aDC )
else else
newTrack->SetEnd( wxPoint(newTrack->GetEnd().x - segm_step_45, newTrack->GetEnd().y) ); newTrack->SetEnd( wxPoint(newTrack->GetEnd().x - segm_step_45, newTrack->GetEnd().y) );
if( Drc_On && BAD_DRC == m_drc->Drc( curTrack, GetBoard()->m_Track ) ) if( g_Drc_On && BAD_DRC == m_drc->Drc( curTrack, GetBoard()->m_Track ) )
{ {
delete newTrack; delete newTrack;
return false; return false;
...@@ -392,7 +392,7 @@ bool PCB_EDIT_FRAME::Add45DegreeSegment( wxDC* aDC ) ...@@ -392,7 +392,7 @@ bool PCB_EDIT_FRAME::Add45DegreeSegment( wxDC* aDC )
else else
newTrack->SetEnd( wxPoint(newTrack->GetEnd().x, newTrack->GetEnd().y - segm_step_45) ); newTrack->SetEnd( wxPoint(newTrack->GetEnd().x, newTrack->GetEnd().y - segm_step_45) );
if( Drc_On && BAD_DRC==m_drc->Drc( newTrack, GetBoard()->m_Track ) ) if( g_Drc_On && BAD_DRC==m_drc->Drc( newTrack, GetBoard()->m_Track ) )
{ {
delete newTrack; delete newTrack;
return false; return false;
...@@ -416,7 +416,7 @@ bool PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* aDC ) ...@@ -416,7 +416,7 @@ bool PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* aDC )
if( aTrack == NULL ) if( aTrack == NULL )
return false; return false;
if( Drc_On && BAD_DRC == m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) ) if( g_Drc_On && BAD_DRC == m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) )
return false; return false;
// Saving the coordinate of end point of the trace // Saving the coordinate of end point of the trace
...@@ -495,7 +495,7 @@ bool PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* aDC ) ...@@ -495,7 +495,7 @@ bool PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* aDC )
for( track = firstTrack; track && i < newCount; ++i, track = track->Next() ) for( track = firstTrack; track && i < newCount; ++i, track = track->Next() )
{ {
track->ClearFlags(); track->ClearFlags();
track->SetState( BUSY, OFF ); track->SetState( BUSY, false );
} }
// delete the old track, if it exists and is redundant // delete the old track, if it exists and is redundant
...@@ -737,7 +737,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo ...@@ -737,7 +737,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
{ {
g_CurrentTrackSegment->SetEnd( screen->GetCrossHairPosition() ); g_CurrentTrackSegment->SetEnd( screen->GetCrossHairPosition() );
if( Drc_On ) if( g_Drc_On )
PushTrack( aPanel ); PushTrack( aPanel );
ComputeBreakPoint( g_CurrentTrackSegment, ComputeBreakPoint( g_CurrentTrackSegment,
...@@ -1047,7 +1047,7 @@ void DeleteNullTrackSegments( BOARD* pcb, DLIST<TRACK>& aTrackList ) ...@@ -1047,7 +1047,7 @@ void DeleteNullTrackSegments( BOARD* pcb, DLIST<TRACK>& aTrackList )
firsttrack->start = LockPoint; firsttrack->start = LockPoint;
if( LockPoint && LockPoint->Type()==PCB_PAD_T ) if( LockPoint && LockPoint->Type()==PCB_PAD_T )
firsttrack->SetState( BEGIN_ONPAD, ON ); firsttrack->SetState( BEGIN_ONPAD, true );
track = firsttrack; track = firsttrack;
...@@ -1059,12 +1059,12 @@ void DeleteNullTrackSegments( BOARD* pcb, DLIST<TRACK>& aTrackList ) ...@@ -1059,12 +1059,12 @@ void DeleteNullTrackSegments( BOARD* pcb, DLIST<TRACK>& aTrackList )
if( LockPoint ) if( LockPoint )
{ {
track->end = LockPoint; track->end = LockPoint;
track->SetState( END_ONPAD, ON ); track->SetState( END_ONPAD, true );
if( next_track ) if( next_track )
{ {
next_track->start = LockPoint; next_track->start = LockPoint;
next_track->SetState( BEGIN_ONPAD, ON ); next_track->SetState( BEGIN_ONPAD, true );
} }
} }
...@@ -1082,7 +1082,7 @@ void EnsureEndTrackOnPad( D_PAD* aPad ) ...@@ -1082,7 +1082,7 @@ void EnsureEndTrackOnPad( D_PAD* aPad )
if( g_CurrentTrackSegment->GetEnd() == aPad->GetPosition() ) // Ok ! if( g_CurrentTrackSegment->GetEnd() == aPad->GetPosition() ) // Ok !
{ {
g_CurrentTrackSegment->end = aPad; g_CurrentTrackSegment->end = aPad;
g_CurrentTrackSegment->SetState( END_ONPAD, ON ); g_CurrentTrackSegment->SetState( END_ONPAD, true );
return; return;
} }
...@@ -1097,8 +1097,8 @@ void EnsureEndTrackOnPad( D_PAD* aPad ) ...@@ -1097,8 +1097,8 @@ void EnsureEndTrackOnPad( D_PAD* aPad )
} }
g_CurrentTrackSegment->SetEnd( aPad->GetPosition() ); g_CurrentTrackSegment->SetEnd( aPad->GetPosition() );
g_CurrentTrackSegment->SetState( END_ONPAD, OFF ); g_CurrentTrackSegment->SetState( END_ONPAD, false );
g_CurrentTrackSegment->end = aPad; g_CurrentTrackSegment->end = aPad;
g_CurrentTrackSegment->SetState( END_ONPAD, ON ); g_CurrentTrackSegment->SetState( END_ONPAD, true );
} }
...@@ -107,7 +107,7 @@ bool Project( wxPoint* aNearPos, wxPoint on_grid, const TRACK* track ) ...@@ -107,7 +107,7 @@ bool Project( wxPoint* aNearPos, wxPoint on_grid, const TRACK* track )
bool Magnetize( PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize aGridSize, bool Magnetize( PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize aGridSize,
wxPoint on_grid, wxPoint* curpos ) wxPoint on_grid, wxPoint* curpos )
{ {
bool doCheckNet = g_MagneticPadOption != capture_always && Drc_On; bool doCheckNet = g_MagneticPadOption != capture_always && g_Drc_On;
bool doTrack = false; bool doTrack = false;
bool doPad = false; bool doPad = false;
bool amMovingVia = false; bool amMovingVia = false;
......
...@@ -90,7 +90,7 @@ static void Abort_MoveTrack( EDA_DRAW_PANEL* aPanel, wxDC* aDC ) ...@@ -90,7 +90,7 @@ static void Abort_MoveTrack( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
{ {
TRACK* track = g_DragSegmentList[jj].m_Track; TRACK* track = g_DragSegmentList[jj].m_Track;
g_DragSegmentList[jj].RestoreInitialValues(); g_DragSegmentList[jj].RestoreInitialValues();
track->SetState( IN_EDIT, OFF ); track->SetState( IN_EDIT, false );
track->ClearFlags(); track->ClearFlags();
} }
...@@ -717,13 +717,13 @@ void PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC ...@@ -717,13 +717,13 @@ void PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC
// Test if more than one segment is connected to this point // Test if more than one segment is connected to this point
if( TrackToStartPoint ) if( TrackToStartPoint )
{ {
TrackToStartPoint->SetState( BUSY, ON ); TrackToStartPoint->SetState( BUSY, true );
if( ( TrackToStartPoint->Type() == PCB_VIA_T ) if( ( TrackToStartPoint->Type() == PCB_VIA_T )
|| track->GetTrace( GetBoard()->m_Track, NULL, FLG_START ) ) || track->GetTrace( GetBoard()->m_Track, NULL, FLG_START ) )
error = true; error = true;
TrackToStartPoint->SetState( BUSY, OFF ); TrackToStartPoint->SetState( BUSY, false );
} }
if( ( track->end == NULL ) || ( track->end->Type() == PCB_TRACE_T ) ) if( ( track->end == NULL ) || ( track->end->Type() == PCB_TRACE_T ) )
...@@ -732,13 +732,13 @@ void PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC ...@@ -732,13 +732,13 @@ void PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC
// Test if more than one segment is connected to this point // Test if more than one segment is connected to this point
if( TrackToEndPoint ) if( TrackToEndPoint )
{ {
TrackToEndPoint->SetState( BUSY, ON ); TrackToEndPoint->SetState( BUSY, true );
if( (TrackToEndPoint->Type() == PCB_VIA_T) if( (TrackToEndPoint->Type() == PCB_VIA_T)
|| track->GetTrace( GetBoard()->m_Track, NULL, FLG_END ) ) || track->GetTrace( GetBoard()->m_Track, NULL, FLG_END ) )
error = true; error = true;
TrackToEndPoint->SetState( BUSY, OFF ); TrackToEndPoint->SetState( BUSY, false );
} }
if( error ) if( error )
...@@ -834,7 +834,7 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC ) ...@@ -834,7 +834,7 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC )
int current_net_code = Track->GetNet(); int current_net_code = Track->GetNet();
// DRC control: // DRC control:
if( Drc_On ) if( g_Drc_On )
{ {
errdrc = m_drc->Drc( Track, GetBoard()->m_Track ); errdrc = m_drc->Drc( Track, GetBoard()->m_Track );
...@@ -853,13 +853,13 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC ) ...@@ -853,13 +853,13 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC )
// DRC Ok: place track segments // DRC Ok: place track segments
Track->ClearFlags(); Track->ClearFlags();
Track->SetState( IN_EDIT, OFF ); Track->SetState( IN_EDIT, false );
/* Draw dragged tracks */ /* Draw dragged tracks */
for( unsigned ii = 0; ii < g_DragSegmentList.size(); ii++ ) for( unsigned ii = 0; ii < g_DragSegmentList.size(); ii++ )
{ {
Track = g_DragSegmentList[ii].m_Track; Track = g_DragSegmentList[ii].m_Track;
Track->SetState( IN_EDIT, OFF ); Track->SetState( IN_EDIT, false );
Track->ClearFlags(); Track->ClearFlags();
/* Test the connections modified by the move /* Test the connections modified by the move
...@@ -869,16 +869,16 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC ) ...@@ -869,16 +869,16 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC )
Track->start = GetBoard()->GetPadFast( Track->GetStart(), layerMask ); Track->start = GetBoard()->GetPadFast( Track->GetStart(), layerMask );
if( Track->start ) if( Track->start )
Track->SetState( BEGIN_ONPAD, ON ); Track->SetState( BEGIN_ONPAD, true );
else else
Track->SetState( BEGIN_ONPAD, OFF ); Track->SetState( BEGIN_ONPAD, false );
Track->end = GetBoard()->GetPadFast( Track->GetEnd(), layerMask ); Track->end = GetBoard()->GetPadFast( Track->GetEnd(), layerMask );
if( Track->end ) if( Track->end )
Track->SetState( END_ONPAD, ON ); Track->SetState( END_ONPAD, true );
else else
Track->SetState( END_ONPAD, OFF ); Track->SetState( END_ONPAD, false );
} }
EraseDragList(); EraseDragList();
......
...@@ -56,17 +56,17 @@ ...@@ -56,17 +56,17 @@
// Colors for layers and items // Colors for layers and items
COLORS_DESIGN_SETTINGS g_ColorsSettings; COLORS_DESIGN_SETTINGS g_ColorsSettings;
bool Drc_On = true; bool g_Drc_On = true;
bool g_AutoDeleteOldTrack = true; bool g_AutoDeleteOldTrack = true;
bool g_Show_Module_Ratsnest; bool g_Show_Module_Ratsnest;
bool g_Raccord_45_Auto = true; bool g_Raccord_45_Auto = true;
bool g_Alternate_Track_Posture = false; bool g_Alternate_Track_Posture = false;
bool g_Track_45_Only_Allowed = true; // True to allow horiz, vert. and 45deg only tracks bool g_Track_45_Only_Allowed = true; // True to allow horiz, vert. and 45deg only tracks
bool Segments_45_Only; // True to allow horiz, vert. and 45deg only graphic segments bool g_Segments_45_Only; // True to allow horiz, vert. and 45deg only graphic segments
bool g_TwoSegmentTrackBuild = true; bool g_TwoSegmentTrackBuild = true;
int Route_Layer_TOP; int g_Route_Layer_TOP;
int Route_Layer_BOTTOM; int g_Route_Layer_BOTTOM;
int g_MaxLinksShowed; int g_MaxLinksShowed;
int g_MagneticPadOption = capture_cursor_in_track_tool; int g_MagneticPadOption = capture_cursor_in_track_tool;
int g_MagneticTrackOption = capture_cursor_in_track_tool; int g_MagneticTrackOption = capture_cursor_in_track_tool;
......
...@@ -49,17 +49,17 @@ ...@@ -49,17 +49,17 @@
extern wxString g_DocModulesFileName; extern wxString g_DocModulesFileName;
/* variables */ /* variables */
extern bool Drc_On; extern bool g_Drc_On;
extern bool g_AutoDeleteOldTrack; extern bool g_AutoDeleteOldTrack;
extern bool g_Show_Module_Ratsnest; extern bool g_Show_Module_Ratsnest;
extern bool g_Raccord_45_Auto; extern bool g_Raccord_45_Auto;
extern bool g_Track_45_Only_Allowed; extern bool g_Track_45_Only_Allowed;
extern bool g_Alternate_Track_Posture; extern bool g_Alternate_Track_Posture;
extern bool Segments_45_Only; extern bool g_Segments_45_Only;
/* Layer pair for auto routing and switch layers by hotkey */ /* Layer pair for auto routing and switch layers by hotkey */
extern int Route_Layer_TOP; extern int g_Route_Layer_TOP;
extern int Route_Layer_BOTTOM; extern int g_Route_Layer_BOTTOM;
extern int g_MaxLinksShowed; // Max count links showed in routing extern int g_MaxLinksShowed; // Max count links showed in routing
extern bool g_TwoSegmentTrackBuild; extern bool g_TwoSegmentTrackBuild;
......
...@@ -451,7 +451,7 @@ PARAM_CFG_ARRAY& PCB_EDIT_FRAME::GetConfigurationSettings() ...@@ -451,7 +451,7 @@ PARAM_CFG_ARRAY& PCB_EDIT_FRAME::GetConfigurationSettings()
&g_Show_Module_Ratsnest, true ) ); &g_Show_Module_Ratsnest, true ) );
m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "TwoSegT" ), m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "TwoSegT" ),
&g_TwoSegmentTrackBuild, true ) ); &g_TwoSegmentTrackBuild, true ) );
m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "SegmPcb45Only" ), &Segments_45_Only, m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "SegmPcb45Only" ), &g_Segments_45_Only,
true ) ); true ) );
return m_configSettings; return m_configSettings;
} }
......
...@@ -113,10 +113,10 @@ void PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle( wxUpdateUIEvent& aEvent ) ...@@ -113,10 +113,10 @@ void PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateDrcEnable( wxUpdateUIEvent& aEvent ) void PCB_EDIT_FRAME::OnUpdateDrcEnable( wxUpdateUIEvent& aEvent )
{ {
bool state = !Drc_On; bool state = !g_Drc_On;
aEvent.Check( state ); aEvent.Check( state );
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_DRC_OFF, m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_DRC_OFF,
Drc_On ? g_Drc_On ?
_( "Disable design rule checking" ) : _( "Disable design rule checking" ) :
_( "Enable design rule checking" ) ); _( "Enable design rule checking" ) );
} }
......
...@@ -657,7 +657,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) ...@@ -657,7 +657,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
zone->AppendCorner( GetScreen()->GetCrossHairPosition() ); zone->AppendCorner( GetScreen()->GetCrossHairPosition() );
if( Drc_On && (m_drc->Drc( zone, 0 ) == BAD_DRC) && zone->IsOnCopperLayer() ) if( g_Drc_On && (m_drc->Drc( zone, 0 ) == BAD_DRC) && zone->IsOnCopperLayer() )
{ {
zone->ClearFlags(); zone->ClearFlags();
zone->RemoveAllContours(); zone->RemoveAllContours();
...@@ -682,7 +682,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) ...@@ -682,7 +682,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
// by Show_New_Edge_While_Move_Mouse // by Show_New_Edge_While_Move_Mouse
if( zone->GetCornerPosition( ii - 1 ) != zone->GetCornerPosition( ii ) ) if( zone->GetCornerPosition( ii - 1 ) != zone->GetCornerPosition( ii ) )
{ {
if( !Drc_On || !zone->IsOnCopperLayer() || ( m_drc->Drc( zone, ii - 1 ) == OK_DRC ) ) if( !g_Drc_On || !zone->IsOnCopperLayer() || ( m_drc->Drc( zone, ii - 1 ) == OK_DRC ) )
{ {
// Ok, we can add a new corner // Ok, we can add a new corner
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
...@@ -720,10 +720,10 @@ bool PCB_EDIT_FRAME::End_Zone( wxDC* DC ) ...@@ -720,10 +720,10 @@ bool PCB_EDIT_FRAME::End_Zone( wxDC* DC )
int icorner = zone->GetNumCorners() - 1; int icorner = zone->GetNumCorners() - 1;
if( zone->IsOnCopperLayer() ) if( zone->IsOnCopperLayer() )
{ {
if( Drc_On && m_drc->Drc( zone, icorner - 1 ) == BAD_DRC ) // we can't validate last edge if( g_Drc_On && m_drc->Drc( zone, icorner - 1 ) == BAD_DRC ) // we can't validate last edge
return false; return false;
if( Drc_On && m_drc->Drc( zone, icorner ) == BAD_DRC ) // we can't validate the closing edge if( g_Drc_On && m_drc->Drc( zone, icorner ) == BAD_DRC ) // we can't validate the closing edge
{ {
DisplayError( this, DisplayError( this,
_( "DRC error: closing this area creates a drc error with an other area" ) ); _( "DRC error: closing this area creates a drc error with an other area" ) );
......
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