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
This commit is contained in:
Lorenzo Marcantonio 2013-03-27 19:32:12 +01:00
parent 0cbe14c12e
commit aae87178a7
18 changed files with 90 additions and 91 deletions

View File

@ -140,8 +140,8 @@ void PCB_EDIT_FRAME::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC )
}
memopos = CurrPosition;
lay_tmp_BOTTOM = Route_Layer_BOTTOM;
lay_tmp_TOP = Route_Layer_TOP;
lay_tmp_BOTTOM = g_Route_Layer_BOTTOM;
lay_tmp_TOP = g_Route_Layer_TOP;
RoutingMatrix.m_GridRouting = (int) GetScreen()->GetGridSize().x;
@ -353,8 +353,8 @@ end_of_tst:
RoutingMatrix.UnInitRoutingMatrix();
Route_Layer_TOP = lay_tmp_TOP;
Route_Layer_BOTTOM = lay_tmp_BOTTOM;
g_Route_Layer_TOP = lay_tmp_TOP;
g_Route_Layer_BOTTOM = lay_tmp_BOTTOM;
Module = GetBoard()->m_Modules;
@ -447,12 +447,12 @@ int PCB_EDIT_FRAME::GenPlaceBoard()
msg.Printf( wxT( "%d" ), RoutingMatrix.m_MemSize / 1024 );
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 )
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 */
TRACK TmpSegm( NULL );
@ -969,10 +969,10 @@ void CreateKeepOutRectangle( int ux0, int uy0, int ux1, int uy1,
DIST_CELL data, LocalKeepOut;
int lgain, cgain;
if( aLayerMask & GetLayerMask( Route_Layer_BOTTOM ) )
if( aLayerMask & GetLayerMask( g_Route_Layer_BOTTOM ) )
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. */
if( trace == 0 )

View File

@ -61,12 +61,12 @@ void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode )
if( GetBoard()->GetCopperLayerCount() > 1 )
{
Route_Layer_TOP = GetScreen()->m_Route_Layer_TOP;
Route_Layer_BOTTOM = GetScreen()->m_Route_Layer_BOTTOM;
g_Route_Layer_TOP = GetScreen()->m_Route_Layer_TOP;
g_Route_Layer_BOTTOM = GetScreen()->m_Route_Layer_BOTTOM;
}
else
{
Route_Layer_TOP = Route_Layer_BOTTOM = LAYER_N_BACK;
g_Route_Layer_TOP = g_Route_Layer_BOTTOM = LAYER_N_BACK;
}
switch( mode )
@ -172,7 +172,7 @@ void PCB_EDIT_FRAME::Autoroute( wxDC* DC, int mode )
/* Map the board */
RoutingMatrix.m_RoutingLayersCount = 1;
if( Route_Layer_TOP != Route_Layer_BOTTOM )
if( g_Route_Layer_TOP != g_Route_Layer_BOTTOM )
RoutingMatrix.m_RoutingLayersCount = 2;
if( RoutingMatrix.InitRoutingMatrix() < 0 )

View File

@ -76,10 +76,10 @@ static void TraceCircle( int ux0, int uy0, int ux1, int uy1, int lg, int layer,
} \
else \
{ \
if( layer == Route_Layer_BOTTOM ) \
if( layer == g_Route_Layer_BOTTOM ) \
RoutingMatrix.WriteCell( dy, dx, BOTTOM, color ); \
if( RoutingMatrix.m_RoutingLayersCount > 1 ) \
if( layer == Route_Layer_TOP ) \
if( layer == g_Route_Layer_TOP ) \
RoutingMatrix.WriteCell( dy, dx, TOP, color ); \
} \
}
@ -152,10 +152,10 @@ void TraceFilledCircle( int cx, int cy, int radius,
int tstwrite = 0;
int distmin;
if( aLayerMask & GetLayerMask( Route_Layer_BOTTOM ) )
if( aLayerMask & GetLayerMask( g_Route_Layer_BOTTOM ) )
trace = 1; // Trace on BOTTOM
if( aLayerMask & GetLayerMask( Route_Layer_TOP ) )
if( aLayerMask & GetLayerMask( g_Route_Layer_TOP ) )
if( RoutingMatrix.m_RoutingLayersCount > 1 )
trace |= 2; // Trace on TOP
@ -275,13 +275,13 @@ void TraceSegmentPcb( TRACK* pt_segm, int color, int marge, int op_logic )
{
int mask_layer = 0;
if( pt_segm->IsOnLayer( Route_Layer_BOTTOM ) )
mask_layer = 1 << Route_Layer_BOTTOM;
if( pt_segm->IsOnLayer( g_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 )
mask_layer = 1 << Route_Layer_TOP;
mask_layer = 1 << g_Route_Layer_TOP;
else
mask_layer = -1;
}
@ -474,10 +474,10 @@ void TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1,
int row_min, row_max, col_min, col_max;
int trace = 0;
if( ( aLayerMask & GetLayerMask( Route_Layer_BOTTOM ) ) )
if( ( aLayerMask & GetLayerMask( g_Route_Layer_BOTTOM ) ) )
trace = 1; // Trace on BOTTOM
if( ( aLayerMask & GetLayerMask( Route_Layer_TOP ) ) &&
if( ( aLayerMask & GetLayerMask( g_Route_Layer_TOP ) ) &&
RoutingMatrix.m_RoutingLayersCount > 1 )
trace |= 2; // Trace on TOP
@ -540,10 +540,10 @@ void TraceFilledRectangle( int ux0, int uy0, int ux1, int uy1,
int rotrow, rotcol;
int trace = 0;
if( aLayerMask & GetLayerMask( Route_Layer_BOTTOM ) )
if( aLayerMask & GetLayerMask( g_Route_Layer_BOTTOM ) )
trace = 1; // Trace on BOTTOM
if( aLayerMask & GetLayerMask( Route_Layer_TOP ) )
if( aLayerMask & GetLayerMask( g_Route_Layer_TOP ) )
{
if( RoutingMatrix.m_RoutingLayersCount > 1 )
trace |= 2; // Trace on TOP

View File

@ -416,8 +416,8 @@ static int Autoroute_One_Track( PCB_EDIT_FRAME* pcbframe,
int marge;
int padLayerMaskStart; /* Mask layers belonging to the starting pad. */
int padLayerMaskEnd; /* Mask layers belonging to the ending pad. */
int topLayerMask = GetLayerMask( Route_Layer_TOP );
int bottomLayerMask = GetLayerMask( Route_Layer_BOTTOM );
int topLayerMask = GetLayerMask( g_Route_Layer_TOP );
int bottomLayerMask = GetLayerMask( g_Route_Layer_BOTTOM );
int routeLayerMask; /* Mask two layers for routing. */
int tab_mask[2]; /* Enables the calculation of the mask layer being
* tested. (side = TOP or BOTTOM) */
@ -1169,7 +1169,7 @@ static void OrCell_Trace( BOARD* pcb, int col, int row,
g_CurrentTrackList.PushBack( newTrack );
g_CurrentTrackSegment->SetState( TRACK_AR, ON );
g_CurrentTrackSegment->SetState( TRACK_AR, true );
g_CurrentTrackSegment->SetLayer( 0x0F );
g_CurrentTrackSegment->SetStart(wxPoint( pcb->GetBoundingBox().GetX() +
@ -1189,12 +1189,12 @@ static void OrCell_Trace( BOARD* pcb, int col, int row,
g_CurrentTrackList.PushBack( newTrack );
g_CurrentTrackSegment->SetLayer( Route_Layer_BOTTOM );
g_CurrentTrackSegment->SetLayer( g_Route_Layer_BOTTOM );
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() +
( RoutingMatrix.m_GridRouting * row ),
pcb->GetBoundingBox().GetY() +
@ -1305,12 +1305,12 @@ static void AddNewTrace( PCB_EDIT_FRAME* pcbframe, wxDC* DC )
g_FirstTrackSegment->start = pcbframe->GetBoard()->GetPad( g_FirstTrackSegment, FLG_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 );
if( g_CurrentTrackSegment->end )
g_CurrentTrackSegment->SetState( END_ONPAD, ON );
g_CurrentTrackSegment->SetState( END_ONPAD, true );
/* Out the new track on the matrix board */
for( TRACK* track = g_FirstTrackSegment; track; track = track->Next() )

View File

@ -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
// "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() ||
!LocateIntrusion( m_Pcb->m_Track, g_CurrentTrackSegment,
GetScreen()->m_Active_Layer, GetScreen()->RefPos( true ) ) )

View File

@ -82,18 +82,17 @@ void DIALOG_GENERALOPTIONS::init()
m_SaveTime->SetValue( timevalue );
m_MaxShowLinks->SetValue( g_MaxLinksShowed );
m_DrcOn->SetValue( Drc_On );
m_DrcOn->SetValue( g_Drc_On );
m_ShowModuleRatsnest->SetValue( g_Show_Module_Ratsnest );
m_ShowGlobalRatsnest->SetValue( m_Board->IsElementVisible( RATSNEST_VISIBLE ) );
m_TrackAutodel->SetValue( g_AutoDeleteOldTrack );
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_MiddleButtonPANOpt->SetValue( GetParent()->GetCanvas()->GetEnableMiddleButtonPan() );
m_OptMiddleButtonPanLimited->SetValue( GetParent()->GetCanvas()->GetMiddleButtonPanLimited() );
m_OptMiddleButtonPanLimited->Enable( m_MiddleButtonPANOpt->GetValue() );
m_AutoPANOpt->SetValue( GetParent()->GetCanvas()->GetEnableAutoPan() );
m_Segments_45_Only_Ctrl->SetValue( Segments_45_Only );
m_Track_DoubleSegm_Ctrl->SetValue( g_TwoSegmentTrackBuild );
m_MagneticPadOptCtrl->SetSelection( g_MagneticPadOption );
@ -125,7 +124,7 @@ void DIALOG_GENERALOPTIONS::OnOkClick( wxCommandEvent& event )
/* Updating the combobox to display the active layer. */
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() )
{
@ -135,7 +134,7 @@ void DIALOG_GENERALOPTIONS::OnOkClick( wxCommandEvent& event )
g_Show_Module_Ratsnest = m_ShowModuleRatsnest->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();
GetParent()->GetCanvas()->SetEnableZoomNoCenter( m_ZoomNoCenterOpt->GetValue() );
@ -162,11 +161,11 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
switch( id )
{
case ID_TB_OPTIONS_DRC_OFF:
Drc_On = !state;
g_Drc_On = !state;
if( GetToolId() == ID_TRACK_BUTT )
{
if( Drc_On )
if( g_Drc_On )
m_canvas->SetCursor( wxCURSOR_PENCIL );
else
m_canvas->SetCursor( wxCURSOR_QUESTION_ARROW );

View File

@ -1329,7 +1329,7 @@ void PCB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
break;
case ID_TRACK_BUTT:
if( Drc_On )
if( g_Drc_On )
SetToolID( id, wxCURSOR_PENCIL, _( "Add tracks" ) );
else
SetToolID( id, wxCURSOR_QUESTION_ARROW, _( "Add tracks" ) );

View File

@ -76,7 +76,7 @@ bool PCB_EDIT_FRAME::SetTrackSegmentWidth( TRACK* aTrackItem,
{
int diagdrc = OK_DRC;
if( Drc_On )
if( g_Drc_On )
diagdrc = m_drc->Drc( aTrackItem, GetBoard()->m_Track );
if( diagdrc == OK_DRC )
@ -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() )
{
pt_track->SetState( BUSY, OFF );
pt_track->SetState( BUSY, false );
if( SetTrackSegmentWidth( pt_track, &itemsListPicker, false ) )
change = true;

View File

@ -343,7 +343,7 @@ static void DrawSegment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosi
if( aErase )
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;

View File

@ -73,7 +73,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
}
// 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 ) )
// DRC error, the change layer is not made
@ -150,7 +150,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
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 ...
delete via;

View File

@ -182,7 +182,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
{
g_CurrentTrackSegment->m_PadsConnected.push_back( pad );
// 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;
}
@ -196,7 +196,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
g_CurrentTrackSegment->start = g_FirstTrackSegment;
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(); );
@ -205,7 +205,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
SetCurItem( g_CurrentTrackSegment, 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 ) )
{
@ -216,7 +216,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
else // Track in progress : segment coordinates are updated by ShowNewTrackWhenMovingCursor.
{
// 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 ) )
return NULL;
@ -261,7 +261,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
g_CurrentTrackList.PushBack( newTrack );
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 );
@ -357,7 +357,7 @@ bool PCB_EDIT_FRAME::Add45DegreeSegment( wxDC* aDC )
else
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;
return false;
@ -392,7 +392,7 @@ bool PCB_EDIT_FRAME::Add45DegreeSegment( wxDC* aDC )
else
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;
return false;
@ -416,7 +416,7 @@ bool PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* aDC )
if( aTrack == NULL )
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;
// Saving the coordinate of end point of the trace
@ -495,7 +495,7 @@ bool PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* aDC )
for( track = firstTrack; track && i < newCount; ++i, track = track->Next() )
{
track->ClearFlags();
track->SetState( BUSY, OFF );
track->SetState( BUSY, false );
}
// delete the old track, if it exists and is redundant
@ -737,7 +737,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
{
g_CurrentTrackSegment->SetEnd( screen->GetCrossHairPosition() );
if( Drc_On )
if( g_Drc_On )
PushTrack( aPanel );
ComputeBreakPoint( g_CurrentTrackSegment,
@ -1047,7 +1047,7 @@ void DeleteNullTrackSegments( BOARD* pcb, DLIST<TRACK>& aTrackList )
firsttrack->start = LockPoint;
if( LockPoint && LockPoint->Type()==PCB_PAD_T )
firsttrack->SetState( BEGIN_ONPAD, ON );
firsttrack->SetState( BEGIN_ONPAD, true );
track = firsttrack;
@ -1059,12 +1059,12 @@ void DeleteNullTrackSegments( BOARD* pcb, DLIST<TRACK>& aTrackList )
if( LockPoint )
{
track->end = LockPoint;
track->SetState( END_ONPAD, ON );
track->SetState( END_ONPAD, true );
if( next_track )
{
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 )
if( g_CurrentTrackSegment->GetEnd() == aPad->GetPosition() ) // Ok !
{
g_CurrentTrackSegment->end = aPad;
g_CurrentTrackSegment->SetState( END_ONPAD, ON );
g_CurrentTrackSegment->SetState( END_ONPAD, true );
return;
}
@ -1097,8 +1097,8 @@ void EnsureEndTrackOnPad( D_PAD* aPad )
}
g_CurrentTrackSegment->SetEnd( aPad->GetPosition() );
g_CurrentTrackSegment->SetState( END_ONPAD, OFF );
g_CurrentTrackSegment->SetState( END_ONPAD, false );
g_CurrentTrackSegment->end = aPad;
g_CurrentTrackSegment->SetState( END_ONPAD, ON );
g_CurrentTrackSegment->SetState( END_ONPAD, true );
}

View File

@ -107,7 +107,7 @@ bool Project( wxPoint* aNearPos, wxPoint on_grid, const TRACK* track )
bool Magnetize( PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize aGridSize,
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 doPad = false;
bool amMovingVia = false;

View File

@ -90,7 +90,7 @@ static void Abort_MoveTrack( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
{
TRACK* track = g_DragSegmentList[jj].m_Track;
g_DragSegmentList[jj].RestoreInitialValues();
track->SetState( IN_EDIT, OFF );
track->SetState( IN_EDIT, false );
track->ClearFlags();
}
@ -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
if( TrackToStartPoint )
{
TrackToStartPoint->SetState( BUSY, ON );
TrackToStartPoint->SetState( BUSY, true );
if( ( TrackToStartPoint->Type() == PCB_VIA_T )
|| track->GetTrace( GetBoard()->m_Track, NULL, FLG_START ) )
error = true;
TrackToStartPoint->SetState( BUSY, OFF );
TrackToStartPoint->SetState( BUSY, false );
}
if( ( track->end == NULL ) || ( track->end->Type() == PCB_TRACE_T ) )
@ -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
if( TrackToEndPoint )
{
TrackToEndPoint->SetState( BUSY, ON );
TrackToEndPoint->SetState( BUSY, true );
if( (TrackToEndPoint->Type() == PCB_VIA_T)
|| track->GetTrace( GetBoard()->m_Track, NULL, FLG_END ) )
error = true;
TrackToEndPoint->SetState( BUSY, OFF );
TrackToEndPoint->SetState( BUSY, false );
}
if( error )
@ -834,7 +834,7 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC )
int current_net_code = Track->GetNet();
// DRC control:
if( Drc_On )
if( g_Drc_On )
{
errdrc = m_drc->Drc( Track, GetBoard()->m_Track );
@ -853,13 +853,13 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC )
// DRC Ok: place track segments
Track->ClearFlags();
Track->SetState( IN_EDIT, OFF );
Track->SetState( IN_EDIT, false );
/* Draw dragged tracks */
for( unsigned ii = 0; ii < g_DragSegmentList.size(); ii++ )
{
Track = g_DragSegmentList[ii].m_Track;
Track->SetState( IN_EDIT, OFF );
Track->SetState( IN_EDIT, false );
Track->ClearFlags();
/* Test the connections modified by the move
@ -869,16 +869,16 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC )
Track->start = GetBoard()->GetPadFast( Track->GetStart(), layerMask );
if( Track->start )
Track->SetState( BEGIN_ONPAD, ON );
Track->SetState( BEGIN_ONPAD, true );
else
Track->SetState( BEGIN_ONPAD, OFF );
Track->SetState( BEGIN_ONPAD, false );
Track->end = GetBoard()->GetPadFast( Track->GetEnd(), layerMask );
if( Track->end )
Track->SetState( END_ONPAD, ON );
Track->SetState( END_ONPAD, true );
else
Track->SetState( END_ONPAD, OFF );
Track->SetState( END_ONPAD, false );
}
EraseDragList();

View File

@ -56,17 +56,17 @@
// Colors for layers and items
COLORS_DESIGN_SETTINGS g_ColorsSettings;
bool Drc_On = true;
bool g_Drc_On = true;
bool g_AutoDeleteOldTrack = true;
bool g_Show_Module_Ratsnest;
bool g_Raccord_45_Auto = true;
bool g_Alternate_Track_Posture = false;
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;
int Route_Layer_TOP;
int Route_Layer_BOTTOM;
int g_Route_Layer_TOP;
int g_Route_Layer_BOTTOM;
int g_MaxLinksShowed;
int g_MagneticPadOption = capture_cursor_in_track_tool;
int g_MagneticTrackOption = capture_cursor_in_track_tool;

View File

@ -49,17 +49,17 @@
extern wxString g_DocModulesFileName;
/* variables */
extern bool Drc_On;
extern bool g_Drc_On;
extern bool g_AutoDeleteOldTrack;
extern bool g_Show_Module_Ratsnest;
extern bool g_Raccord_45_Auto;
extern bool g_Track_45_Only_Allowed;
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 */
extern int Route_Layer_TOP;
extern int Route_Layer_BOTTOM;
extern int g_Route_Layer_TOP;
extern int g_Route_Layer_BOTTOM;
extern int g_MaxLinksShowed; // Max count links showed in routing
extern bool g_TwoSegmentTrackBuild;

View File

@ -451,7 +451,7 @@ PARAM_CFG_ARRAY& PCB_EDIT_FRAME::GetConfigurationSettings()
&g_Show_Module_Ratsnest, true ) );
m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "TwoSegT" ),
&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 ) );
return m_configSettings;
}

View File

@ -113,10 +113,10 @@ void PCB_EDIT_FRAME::OnUpdateZoneDisplayStyle( wxUpdateUIEvent& aEvent )
void PCB_EDIT_FRAME::OnUpdateDrcEnable( wxUpdateUIEvent& aEvent )
{
bool state = !Drc_On;
bool state = !g_Drc_On;
aEvent.Check( state );
m_optionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_DRC_OFF,
Drc_On ?
g_Drc_On ?
_( "Disable design rule checking" ) :
_( "Enable design rule checking" ) );
}

View File

@ -657,7 +657,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
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->RemoveAllContours();
@ -682,7 +682,7 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
// by Show_New_Edge_While_Move_Mouse
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
if( m_canvas->IsMouseCaptured() )
@ -720,10 +720,10 @@ bool PCB_EDIT_FRAME::End_Zone( wxDC* DC )
int icorner = zone->GetNumCorners() - 1;
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;
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,
_( "DRC error: closing this area creates a drc error with an other area" ) );