Commit e8778199 authored by charras's avatar charras

Pcbnew: Added: Option to show the via area while creating a new track. Better code.

parent 360eda0f
...@@ -9,7 +9,7 @@ email address. ...@@ -9,7 +9,7 @@ email address.
++Pcbnew: ++Pcbnew:
Added: in DRC tests: tests for vias min size and tracks min width. Added: in DRC tests: tests for vias min size and tracks min width.
Added: Option to show the via area while creating a new track. Added: Option to show the via area while creating a new track.
Useful in compact designs to know hos to place a via during track creation. Useful in compact designs to know how to place a via during track creation.
2009-june-11 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> 2009-june-11 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================ ================================================================================
......
...@@ -59,7 +59,7 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame ) ...@@ -59,7 +59,7 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame )
EVT_MENU( ID_COLORS_SETUP, WinEDA_GerberFrame::Process_Config ) EVT_MENU( ID_COLORS_SETUP, WinEDA_GerberFrame::Process_Config )
EVT_MENU( ID_OPTIONS_SETUP, WinEDA_GerberFrame::Process_Config ) EVT_MENU( ID_OPTIONS_SETUP, WinEDA_GerberFrame::Process_Config )
EVT_MENU( ID_PCB_LOOK_SETUP, WinEDA_GerberFrame::Process_Config ) EVT_MENU( ID_PCB_DISPLAY_OPTIONS_SETUP, WinEDA_GerberFrame::Process_Config )
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END,
WinEDA_DrawFrame::SetLanguage ) WinEDA_DrawFrame::SetLanguage )
......
...@@ -51,7 +51,7 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event ) ...@@ -51,7 +51,7 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event )
} }
case ID_PCB_TRACK_SIZE_SETUP: case ID_PCB_TRACK_SIZE_SETUP:
case ID_PCB_LOOK_SETUP: case ID_PCB_DISPLAY_OPTIONS_SETUP:
case ID_OPTIONS_SETUP: case ID_OPTIONS_SETUP:
InstallPcbOptionsFrame( pos, id ); InstallPcbOptionsFrame( pos, id );
break; break;
......
...@@ -28,7 +28,7 @@ void Print_PcbItems(BOARD * Pcb, wxDC *DC, int drawmode, int printmasklayer) ...@@ -28,7 +28,7 @@ void Print_PcbItems(BOARD * Pcb, wxDC *DC, int drawmode, int printmasklayer)
DisplayOpt.DisplayPadNoConn = 0; DisplayOpt.DisplayPadNoConn = 0;
DisplayOpt.DisplayPadIsol = 0; DisplayOpt.DisplayPadIsol = 0;
DisplayOpt.DisplayPcbTrackFill = FILLED; DisplayOpt.DisplayPcbTrackFill = FILLED;
DisplayOpt.DisplayTrackIsol = 0; DisplayOpt.ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE;
DisplayOpt.DisplayDrawItems = FILLED; DisplayOpt.DisplayDrawItems = FILLED;
DisplayOpt.DisplayZonesMode = 0; DisplayOpt.DisplayZonesMode = 0;
......
...@@ -390,7 +390,7 @@ void WinEDA_GerberFrame::InstallPcbOptionsFrame( const wxPoint& pos, int id ) ...@@ -390,7 +390,7 @@ void WinEDA_GerberFrame::InstallPcbOptionsFrame( const wxPoint& pos, int id )
{ {
switch( id ) switch( id )
{ {
case ID_PCB_LOOK_SETUP: case ID_PCB_DISPLAY_OPTIONS_SETUP:
{ {
WinEDA_LookFrame* OptionsFrame = WinEDA_LookFrame* OptionsFrame =
new WinEDA_LookFrame( this, pos ); new WinEDA_LookFrame( this, pos );
......
...@@ -87,7 +87,7 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void ) ...@@ -87,7 +87,7 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void )
ADD_MENUITEM_WITH_HELP( configmenu, ID_OPTIONS_SETUP, _( "&Options" ), ADD_MENUITEM_WITH_HELP( configmenu, ID_OPTIONS_SETUP, _( "&Options" ),
_( " Select general options" ), preference_xpm ); _( " Select general options" ), preference_xpm );
ADD_MENUITEM_WITH_HELP( configmenu, ID_PCB_LOOK_SETUP, _( "Display" ), ADD_MENUITEM_WITH_HELP( configmenu, ID_PCB_DISPLAY_OPTIONS_SETUP, _( "Display" ),
_( " Select how items are displayed" ), _( " Select how items are displayed" ),
display_options_xpm ); display_options_xpm );
......
...@@ -43,7 +43,7 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl ...@@ -43,7 +43,7 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl
DisplayOpt.DisplayModEdge = FILLED; DisplayOpt.DisplayModEdge = FILLED;
DisplayOpt.DisplayModText = FILLED; DisplayOpt.DisplayModText = FILLED;
DisplayOpt.DisplayPcbTrackFill = FILLED; DisplayOpt.DisplayPcbTrackFill = FILLED;
DisplayOpt.DisplayTrackIsol = 0; DisplayOpt.ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE;
DisplayOpt.DisplayDrawItems = FILLED; DisplayOpt.DisplayDrawItems = FILLED;
DisplayOpt.DisplayZonesMode = 0; DisplayOpt.DisplayZonesMode = 0;
DisplayPolygonsModeImg = g_DisplayPolygonsModeSketch; DisplayPolygonsModeImg = g_DisplayPolygonsModeSketch;
......
...@@ -268,6 +268,17 @@ public: ...@@ -268,6 +268,17 @@ public:
#include "class_marker.h" #include "class_marker.h"
#include "class_zone.h" #include "class_zone.h"
/* Values for DISPLAY_OPTIONS.ShowTrackClearanceMode parameter option
* This parameter controls how to show tracks and vias clerance area
*/
enum ShowTrackClearanceModeList {
DO_NOT_SHOW_CLEARANCE = 0, // Do not show clearance areas
SHOW_CLEARANCE_NEW_TRACKS, // Show clearance areas only for new track during track creation
SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS, /* Show clrearance areas only for new track during track creation,
* and shows a via clearnce area at end of current new segment (guide to place a nev via
*/
SHOW_CLEARANCE_ALWAYS // Show Always clearance areas for track and vias
};
class DISPLAY_OPTIONS class DISPLAY_OPTIONS
{ {
...@@ -279,10 +290,15 @@ public: ...@@ -279,10 +290,15 @@ public:
int DisplayModEdge; int DisplayModEdge;
int DisplayModText; int DisplayModText;
bool DisplayPcbTrackFill; /* FALSE = sketch , TRUE = filled */ bool DisplayPcbTrackFill; /* FALSE = sketch , TRUE = filled */
bool DisplayTrackIsol; int ShowTrackClearanceMode; /* = 0 , 1 or 2
* 0 = do not show clearance
int m_DisplayViaMode; /* 0 do not show via hole, * 1 = show track clearance
* 2 = show clearance + via area
* (useful to know what clearance area is neede if we want to put a via on terminal track point)
*/
int m_DisplayViaMode; /* 0 do not show via hole,
* 1 show via hole for non default value * 1 show via hole for non default value
* 2 show all via hole */ * 2 show all via hole */
......
No preview for this file type
This diff is collapsed.
...@@ -49,7 +49,7 @@ static bool ShowClearance( const TRACK* aTrack ) ...@@ -49,7 +49,7 @@ static bool ShowClearance( const TRACK* aTrack )
{ {
// maybe return true for tracks and vias, not for zone segments // maybe return true for tracks and vias, not for zone segments
return !(aTrack->m_Flags & DRAW_ERASED) return !(aTrack->m_Flags & DRAW_ERASED)
&& DisplayOpt.DisplayTrackIsol && DisplayOpt.ShowTrackClearanceMode == SHOW_CLEARANCE_ALWAYS
&& aTrack->GetLayer() <= LAST_COPPER_LAYER && aTrack->GetLayer() <= LAST_COPPER_LAYER
&& ( aTrack->Type() == TYPE_TRACK || aTrack->Type() == TYPE_VIA ); && ( aTrack->Type() == TYPE_TRACK || aTrack->Type() == TYPE_VIA );
} }
...@@ -764,7 +764,7 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi ...@@ -764,7 +764,7 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
} }
} }
if( DisplayOpt.DisplayTrackIsol ) if( DisplayOpt.ShowTrackClearanceMode == SHOW_CLEARANCE_ALWAYS )
GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y, GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y,
rayon + g_DesignSettings.m_TrackClearence, color ); rayon + g_DesignSettings.m_TrackClearence, color );
......
...@@ -143,12 +143,12 @@ DISPLAY_OPTIONS::DISPLAY_OPTIONS() ...@@ -143,12 +143,12 @@ DISPLAY_OPTIONS::DISPLAY_OPTIONS()
DisplayModEdge = true; DisplayModEdge = true;
DisplayModText = true; DisplayModText = true;
DisplayPcbTrackFill = true; /* false = sketch , true = rempli */ DisplayPcbTrackFill = true; /* false = sketch , true = filled */
DisplayTrackIsol = false; ShowTrackClearanceMode = SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS;
m_DisplayViaMode = VIA_HOLE_NOT_SHOW; m_DisplayViaMode = VIA_HOLE_NOT_SHOW;
DisplayPolarCood = false; /* false = display absolute coordinates, DisplayPolarCood = false; /* false = display absolute coordinates,
* true = display polar cordinates */ * true = display polar cordinates */
DisplayZonesMode = 0; /* 0 = Show filled areas outlines in zones, DisplayZonesMode = 0; /* 0 = Show filled areas outlines in zones,
* 1 = do not show filled areas outlines * 1 = do not show filled areas outlines
* 2 = show outlines of filled areas */ * 2 = show outlines of filled areas */
......
...@@ -60,13 +60,22 @@ void Dialog_Display_Options::init() ...@@ -60,13 +60,22 @@ void Dialog_Display_Options::init()
if ( DisplayOpt.DisplayPcbTrackFill ) if ( DisplayOpt.DisplayPcbTrackFill )
m_OptDisplayTracks->SetSelection(1); m_OptDisplayTracks->SetSelection(1);
if ( DisplayOpt.DisplayTrackIsol ) switch ( DisplayOpt.ShowTrackClearanceMode )
m_OptDisplayTracksClearance->SetSelection(3); {
else if ( g_ShowClearanceWhenTrackCreation == 1) case DO_NOT_SHOW_CLEARANCE:
m_OptDisplayTracksClearance->SetSelection(1); m_OptDisplayTracksClearance->SetSelection(0);
else if ( g_ShowClearanceWhenTrackCreation == 2) break;
m_OptDisplayTracksClearance->SetSelection(2); case SHOW_CLEARANCE_NEW_TRACKS:
else m_OptDisplayTracksClearance->SetSelection(0); m_OptDisplayTracksClearance->SetSelection(1);
break;
default:
case SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS:
m_OptDisplayTracksClearance->SetSelection(2);
break;
case SHOW_CLEARANCE_ALWAYS:
m_OptDisplayTracksClearance->SetSelection(3);
break;
}
if ( DisplayOpt.DisplayPadFill ) if ( DisplayOpt.DisplayPadFill )
m_OptDisplayPads->SetSelection(1); m_OptDisplayPads->SetSelection(1);
...@@ -115,21 +124,17 @@ void Dialog_Display_Options::OnOkClick(wxCommandEvent& event) ...@@ -115,21 +124,17 @@ void Dialog_Display_Options::OnOkClick(wxCommandEvent& event)
switch ( m_OptDisplayTracksClearance->GetSelection() ) switch ( m_OptDisplayTracksClearance->GetSelection() )
{ {
case 3: case 0:
DisplayOpt.DisplayTrackIsol = TRUE; DisplayOpt.ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE;
g_ShowClearanceWhenTrackCreation = 1;
break; break;
case 1: case 1:
DisplayOpt.DisplayTrackIsol = FALSE; DisplayOpt.ShowTrackClearanceMode = SHOW_CLEARANCE_NEW_TRACKS;
g_ShowClearanceWhenTrackCreation = 1;
break; break;
case 2: case 2:
DisplayOpt.DisplayTrackIsol = FALSE; DisplayOpt.ShowTrackClearanceMode = SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS;
g_ShowClearanceWhenTrackCreation = 2;
break; break;
case 0: case 3:
DisplayOpt.DisplayTrackIsol = FALSE; DisplayOpt.ShowTrackClearanceMode = SHOW_CLEARANCE_ALWAYS;
g_ShowClearanceWhenTrackCreation = 0;
break; break;
} }
......
This diff is collapsed.
...@@ -194,20 +194,13 @@ static PARAM_CFG_BOOL SegmFillCfg ...@@ -194,20 +194,13 @@ static PARAM_CFG_BOOL SegmFillCfg
TRUE /* Default value */ TRUE /* Default value */
); );
static PARAM_CFG_INT NewTrackAfficheGardeCfg
(
INSETUP,
wxT( "NewAffG" ), /* Keyword */
&g_ShowClearanceWhenTrackCreation, /* Parameter address */
1 /* Default value */
);
static PARAM_CFG_BOOL TrackAfficheGardeCfg static PARAM_CFG_INT TrackDisplayClearanceCfg
( (
INSETUP, INSETUP,
wxT( "SegAffG" ), /* Keyword */ wxT( "TrackDisplayClearance" ), /* Keyword */
&DisplayOpt.DisplayTrackIsol, /* Parameter address */ &DisplayOpt.ShowTrackClearanceMode, /* Parameter address */
FALSE /* Default value */ SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS /* Default value */
); );
static PARAM_CFG_BOOL PadFillCfg static PARAM_CFG_BOOL PadFillCfg
...@@ -816,8 +809,7 @@ PARAM_CFG_BASE* ParamCfgList[] = ...@@ -816,8 +809,7 @@ PARAM_CFG_BASE* ParamCfgList[] =
&Raccord45Cfg, &Raccord45Cfg,
&UnitCfg, &UnitCfg,
&SegmFillCfg, &SegmFillCfg,
&TrackAfficheGardeCfg, &TrackDisplayClearanceCfg,
&NewTrackAfficheGardeCfg,
&PadFillCfg, &PadFillCfg,
&PadAfficheGardeCfg, &PadAfficheGardeCfg,
&PadShowNumCfg, &PadShowNumCfg,
......
...@@ -33,7 +33,6 @@ bool g_Show_Ratsnest; ...@@ -33,7 +33,6 @@ bool g_Show_Ratsnest;
bool g_Show_Module_Ratsnest; bool g_Show_Module_Ratsnest;
bool g_Show_Pads_Module_in_Move = TRUE; bool g_Show_Pads_Module_in_Move = TRUE;
bool g_Raccord_45_Auto = TRUE; bool g_Raccord_45_Auto = TRUE;
int g_ShowClearanceWhenTrackCreation = 1;
bool Track_45_Only; bool Track_45_Only;
bool Segments_45_Only; bool Segments_45_Only;
bool g_TwoSegmentTrackBuild = TRUE; bool g_TwoSegmentTrackBuild = TRUE;
......
...@@ -54,12 +54,6 @@ extern bool g_Show_Ratsnest; ...@@ -54,12 +54,6 @@ extern bool g_Show_Ratsnest;
extern bool g_Show_Module_Ratsnest; extern bool g_Show_Module_Ratsnest;
extern bool g_Show_Pads_Module_in_Move; extern bool g_Show_Pads_Module_in_Move;
extern bool g_Raccord_45_Auto; extern bool g_Raccord_45_Auto;
extern int g_ShowClearanceWhenTrackCreation; /* = 0 , 1 or 2
* 0 = do not show clearance
* 1 = show track clearance
* 2 = show clearance + via area
* (useful to know what clearance area is neede if we want to put a via on terminal track point)
*/
extern const wxString g_FootprintLibFileWildcard; // Wildcard for footprint libraries filesnames extern const wxString g_FootprintLibFileWildcard; // Wildcard for footprint libraries filesnames
......
...@@ -45,12 +45,13 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa ...@@ -45,12 +45,13 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa
DisplayOpt.DisplayModEdge = FILLED; DisplayOpt.DisplayModEdge = FILLED;
DisplayOpt.DisplayModText = FILLED; DisplayOpt.DisplayModText = FILLED;
frame->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = FILLED; frame->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = FILLED;
DisplayOpt.DisplayTrackIsol = false; DisplayOpt.ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE;
DisplayOpt.DisplayDrawItems = FILLED; DisplayOpt.DisplayDrawItems = FILLED;
DisplayOpt.DisplayZonesMode = 0; DisplayOpt.DisplayZonesMode = 0;
DisplayOpt.DisplayNetNamesMode = 0;
m_PrintIsMirrored = aPrintMirrorMode; m_PrintIsMirrored = aPrintMirrorMode;
// The OR mode is used in color mode, but be aware the backgroud *must be BLACK. // The OR mode is used in color mode, but be aware the backgroud *must be BLACK.
// In print page dialog, we first plrint in BLACK, and after reprint in color, // In print page dialog, we first plrint in BLACK, and after reprint in color,
// on the black "local" backgroud, in OR mode // on the black "local" backgroud, in OR mode
......
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