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.
++Pcbnew:
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.
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>
================================================================================
......
......@@ -59,7 +59,7 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame )
EVT_MENU( ID_COLORS_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,
WinEDA_DrawFrame::SetLanguage )
......
......@@ -51,7 +51,7 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event )
}
case ID_PCB_TRACK_SIZE_SETUP:
case ID_PCB_LOOK_SETUP:
case ID_PCB_DISPLAY_OPTIONS_SETUP:
case ID_OPTIONS_SETUP:
InstallPcbOptionsFrame( pos, id );
break;
......
......@@ -28,7 +28,7 @@ void Print_PcbItems(BOARD * Pcb, wxDC *DC, int drawmode, int printmasklayer)
DisplayOpt.DisplayPadNoConn = 0;
DisplayOpt.DisplayPadIsol = 0;
DisplayOpt.DisplayPcbTrackFill = FILLED;
DisplayOpt.DisplayTrackIsol = 0;
DisplayOpt.ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE;
DisplayOpt.DisplayDrawItems = FILLED;
DisplayOpt.DisplayZonesMode = 0;
......
......@@ -390,7 +390,7 @@ void WinEDA_GerberFrame::InstallPcbOptionsFrame( const wxPoint& pos, int id )
{
switch( id )
{
case ID_PCB_LOOK_SETUP:
case ID_PCB_DISPLAY_OPTIONS_SETUP:
{
WinEDA_LookFrame* OptionsFrame =
new WinEDA_LookFrame( this, pos );
......
......@@ -87,7 +87,7 @@ void WinEDA_GerberFrame::ReCreateMenuBar( void )
ADD_MENUITEM_WITH_HELP( configmenu, ID_OPTIONS_SETUP, _( "&Options" ),
_( " 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" ),
display_options_xpm );
......
......@@ -43,7 +43,7 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl
DisplayOpt.DisplayModEdge = FILLED;
DisplayOpt.DisplayModText = FILLED;
DisplayOpt.DisplayPcbTrackFill = FILLED;
DisplayOpt.DisplayTrackIsol = 0;
DisplayOpt.ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE;
DisplayOpt.DisplayDrawItems = FILLED;
DisplayOpt.DisplayZonesMode = 0;
DisplayPolygonsModeImg = g_DisplayPolygonsModeSketch;
......
......@@ -268,6 +268,17 @@ public:
#include "class_marker.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
{
......@@ -279,10 +290,15 @@ public:
int DisplayModEdge;
int DisplayModText;
bool DisplayPcbTrackFill; /* FALSE = sketch , TRUE = filled */
bool DisplayTrackIsol;
int m_DisplayViaMode; /* 0 do not show via hole,
bool DisplayPcbTrackFill; /* FALSE = sketch , TRUE = filled */
int ShowTrackClearanceMode; /* = 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)
*/
int m_DisplayViaMode; /* 0 do not show via hole,
* 1 show via hole for non default value
* 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 )
{
// maybe return true for tracks and vias, not for zone segments
return !(aTrack->m_Flags & DRAW_ERASED)
&& DisplayOpt.DisplayTrackIsol
&& DisplayOpt.ShowTrackClearanceMode == SHOW_CLEARANCE_ALWAYS
&& aTrack->GetLayer() <= LAST_COPPER_LAYER
&& ( 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
}
}
if( DisplayOpt.DisplayTrackIsol )
if( DisplayOpt.ShowTrackClearanceMode == SHOW_CLEARANCE_ALWAYS )
GRCircle( &panel->m_ClipBox, DC, m_Start.x, m_Start.y,
rayon + g_DesignSettings.m_TrackClearence, color );
......
......@@ -143,12 +143,12 @@ DISPLAY_OPTIONS::DISPLAY_OPTIONS()
DisplayModEdge = true;
DisplayModText = true;
DisplayPcbTrackFill = true; /* false = sketch , true = rempli */
DisplayTrackIsol = false;
m_DisplayViaMode = VIA_HOLE_NOT_SHOW;
DisplayPcbTrackFill = true; /* false = sketch , true = filled */
ShowTrackClearanceMode = SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS;
m_DisplayViaMode = VIA_HOLE_NOT_SHOW;
DisplayPolarCood = false; /* false = display absolute coordinates,
* true = display polar cordinates */
* true = display polar cordinates */
DisplayZonesMode = 0; /* 0 = Show filled areas outlines in zones,
* 1 = do not show filled areas outlines
* 2 = show outlines of filled areas */
......
......@@ -60,13 +60,22 @@ void Dialog_Display_Options::init()
if ( DisplayOpt.DisplayPcbTrackFill )
m_OptDisplayTracks->SetSelection(1);
if ( DisplayOpt.DisplayTrackIsol )
m_OptDisplayTracksClearance->SetSelection(3);
else if ( g_ShowClearanceWhenTrackCreation == 1)
m_OptDisplayTracksClearance->SetSelection(1);
else if ( g_ShowClearanceWhenTrackCreation == 2)
m_OptDisplayTracksClearance->SetSelection(2);
else m_OptDisplayTracksClearance->SetSelection(0);
switch ( DisplayOpt.ShowTrackClearanceMode )
{
case DO_NOT_SHOW_CLEARANCE:
m_OptDisplayTracksClearance->SetSelection(0);
break;
case SHOW_CLEARANCE_NEW_TRACKS:
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 )
m_OptDisplayPads->SetSelection(1);
......@@ -115,21 +124,17 @@ void Dialog_Display_Options::OnOkClick(wxCommandEvent& event)
switch ( m_OptDisplayTracksClearance->GetSelection() )
{
case 3:
DisplayOpt.DisplayTrackIsol = TRUE;
g_ShowClearanceWhenTrackCreation = 1;
case 0:
DisplayOpt.ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE;
break;
case 1:
DisplayOpt.DisplayTrackIsol = FALSE;
g_ShowClearanceWhenTrackCreation = 1;
DisplayOpt.ShowTrackClearanceMode = SHOW_CLEARANCE_NEW_TRACKS;
break;
case 2:
DisplayOpt.DisplayTrackIsol = FALSE;
g_ShowClearanceWhenTrackCreation = 2;
DisplayOpt.ShowTrackClearanceMode = SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS;
break;
case 0:
DisplayOpt.DisplayTrackIsol = FALSE;
g_ShowClearanceWhenTrackCreation = 0;
case 3:
DisplayOpt.ShowTrackClearanceMode = SHOW_CLEARANCE_ALWAYS;
break;
}
......
This diff is collapsed.
......@@ -194,20 +194,13 @@ static PARAM_CFG_BOOL SegmFillCfg
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,
wxT( "SegAffG" ), /* Keyword */
&DisplayOpt.DisplayTrackIsol, /* Parameter address */
FALSE /* Default value */
wxT( "TrackDisplayClearance" ), /* Keyword */
&DisplayOpt.ShowTrackClearanceMode, /* Parameter address */
SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS /* Default value */
);
static PARAM_CFG_BOOL PadFillCfg
......@@ -816,8 +809,7 @@ PARAM_CFG_BASE* ParamCfgList[] =
&Raccord45Cfg,
&UnitCfg,
&SegmFillCfg,
&TrackAfficheGardeCfg,
&NewTrackAfficheGardeCfg,
&TrackDisplayClearanceCfg,
&PadFillCfg,
&PadAfficheGardeCfg,
&PadShowNumCfg,
......
......@@ -33,7 +33,6 @@ bool g_Show_Ratsnest;
bool g_Show_Module_Ratsnest;
bool g_Show_Pads_Module_in_Move = TRUE;
bool g_Raccord_45_Auto = TRUE;
int g_ShowClearanceWhenTrackCreation = 1;
bool Track_45_Only;
bool Segments_45_Only;
bool g_TwoSegmentTrackBuild = TRUE;
......
......@@ -54,12 +54,6 @@ extern bool g_Show_Ratsnest;
extern bool g_Show_Module_Ratsnest;
extern bool g_Show_Pads_Module_in_Move;
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
......
......@@ -45,12 +45,13 @@ void WinEDA_DrawPanel::PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref, int aPrintMa
DisplayOpt.DisplayModEdge = FILLED;
DisplayOpt.DisplayModText = FILLED;
frame->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = FILLED;
DisplayOpt.DisplayTrackIsol = false;
DisplayOpt.ShowTrackClearanceMode = DO_NOT_SHOW_CLEARANCE;
DisplayOpt.DisplayDrawItems = FILLED;
DisplayOpt.DisplayZonesMode = 0;
DisplayOpt.DisplayNetNamesMode = 0;
m_PrintIsMirrored = aPrintMirrorMode;
// 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,
// 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