Commit 611a5155 authored by Roman Bashkov's avatar Roman Bashkov Committed by Andrey Fedorushkov

pcbnew:

* Add visible clearance when edit node or track segment,
  add parameter "show clearance for new or edited track with via area"
  in "Display options" menu.
parent c09bc26d
...@@ -33,6 +33,10 @@ enum TRACE_CLEARANCE_DISPLAY_MODE_T { ...@@ -33,6 +33,10 @@ enum TRACE_CLEARANCE_DISPLAY_MODE_T {
* clearance area at end of current new * clearance area at end of current new
* segment (guide to place a new via * segment (guide to place a new via
*/ */
SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS,
/* Show clearance for new, moving and
* dragging tracks and vias
*/
SHOW_CLEARANCE_ALWAYS /* Show Always clearance areas SHOW_CLEARANCE_ALWAYS /* Show Always clearance areas
* for track and vias * for track and vias
*/ */
......
...@@ -30,9 +30,13 @@ ...@@ -30,9 +30,13 @@
static bool ShowClearance( const TRACK* aTrack ) 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 DisplayOpt.ShowTrackClearanceMode == SHOW_CLEARANCE_ALWAYS return 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 ); && ( ( DisplayOpt.ShowTrackClearanceMode == SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS
&& ( aTrack->m_Flags & IS_DRAGGED || aTrack->m_Flags & IS_MOVED || aTrack->m_Flags & IS_NEW ) )
|| ( DisplayOpt.ShowTrackClearanceMode == SHOW_CLEARANCE_ALWAYS )
);
} }
......
...@@ -56,20 +56,24 @@ void DIALOG_DISPLAY_OPTIONS::init() ...@@ -56,20 +56,24 @@ void DIALOG_DISPLAY_OPTIONS::init()
m_OptDisplayTracksClearance->SetSelection( 1 ); m_OptDisplayTracksClearance->SetSelection( 1 );
break; break;
case SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS:
m_OptDisplayTracksClearance->SetSelection( 3 );
break;
default: default:
case SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS: case SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS:
m_OptDisplayTracksClearance->SetSelection(2); m_OptDisplayTracksClearance->SetSelection( 2 );
break; break;
case SHOW_CLEARANCE_ALWAYS: case SHOW_CLEARANCE_ALWAYS:
m_OptDisplayTracksClearance->SetSelection(3); m_OptDisplayTracksClearance->SetSelection( 4 );
break; break;
} }
if ( DisplayOpt.DisplayPadFill ) if ( DisplayOpt.DisplayPadFill )
m_OptDisplayPads->SetSelection(1); m_OptDisplayPads->SetSelection( 1 );
else else
m_OptDisplayPads->SetSelection(0); m_OptDisplayPads->SetSelection( 0 );
if ( DisplayOpt.DisplayViaFill ) if ( DisplayOpt.DisplayViaFill )
m_OptDisplayVias->SetSelection( 1 ); m_OptDisplayVias->SetSelection( 1 );
...@@ -127,6 +131,10 @@ void DIALOG_DISPLAY_OPTIONS::OnOkClick(wxCommandEvent& event) ...@@ -127,6 +131,10 @@ void DIALOG_DISPLAY_OPTIONS::OnOkClick(wxCommandEvent& event)
break; break;
case 3: case 3:
DisplayOpt.ShowTrackClearanceMode = SHOW_CLEARANCE_NEW_AND_EDITED_TRACKS_AND_VIA_AREAS;
break;
case 4:
DisplayOpt.ShowTrackClearanceMode = SHOW_CLEARANCE_ALWAYS; DisplayOpt.ShowTrackClearanceMode = SHOW_CLEARANCE_ALWAYS;
break; break;
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 17 2010) // C++ code generated with wxFormBuilder (version Sep 6 2011)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_display_options_base__ #ifndef __dialog_display_options_base__
#define __dialog_display_options_base__ #define __dialog_display_options_base__
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/string.h> #include <wx/string.h>
#include <wx/radiobox.h> #include <wx/radiobox.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include <wx/font.h> #include <wx/font.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/statbox.h> #include <wx/statbox.h>
#include <wx/checkbox.h> #include <wx/checkbox.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_DISPLAY_OPTIONS_BASE /// Class DIALOG_DISPLAY_OPTIONS_BASE
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DIALOG_DISPLAY_OPTIONS_BASE : public wxDialog class DIALOG_DISPLAY_OPTIONS_BASE : public wxDialog
{ {
private: private:
protected: protected:
enum enum
{ {
wxID_DISPLAY_TRACK = 1000, wxID_DISPLAY_TRACK = 1000,
ID_VIAS_SHAPES, ID_VIAS_SHAPES,
ID_VIAS_HOLES, ID_VIAS_HOLES,
ID_SHOW_CLEARANCE, ID_SHOW_CLEARANCE,
ID_EDGES_MODULES, ID_EDGES_MODULES,
ID_TEXT_MODULES, ID_TEXT_MODULES,
ID_PADS_SHAPES, ID_PADS_SHAPES,
}; };
wxRadioBox* m_OptDisplayTracks; wxRadioBox* m_OptDisplayTracks;
wxRadioBox* m_OptDisplayVias; wxRadioBox* m_OptDisplayVias;
wxRadioBox* m_OptDisplayViaHole; wxRadioBox* m_OptDisplayViaHole;
wxRadioBox* m_ShowNetNamesOption; wxRadioBox* m_ShowNetNamesOption;
wxRadioBox* m_OptDisplayTracksClearance; wxRadioBox* m_OptDisplayTracksClearance;
wxRadioBox* m_OptDisplayModEdges; wxRadioBox* m_OptDisplayModEdges;
wxRadioBox* m_OptDisplayModTexts; wxRadioBox* m_OptDisplayModTexts;
wxRadioBox* m_OptDisplayPads; wxRadioBox* m_OptDisplayPads;
wxCheckBox* m_OptDisplayPadClearence; wxCheckBox* m_OptDisplayPadClearence;
wxCheckBox* m_OptDisplayPadNumber; wxCheckBox* m_OptDisplayPadNumber;
wxCheckBox* m_OptDisplayPadNoConn; wxCheckBox* m_OptDisplayPadNoConn;
wxRadioBox* m_OptDisplayDrawings; wxRadioBox* m_OptDisplayDrawings;
wxRadioBox* m_Show_Page_Limits; wxRadioBox* m_Show_Page_Limits;
wxButton* m_buttonOK; wxButton* m_buttonOK;
wxButton* m_buttonCANCEL; wxButton* m_buttonCANCEL;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
public: public:
DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Display options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 731,291 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Display options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 731,291 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_DISPLAY_OPTIONS_BASE(); ~DIALOG_DISPLAY_OPTIONS_BASE();
}; };
#endif //__dialog_display_options_base__ #endif //__dialog_display_options_base__
...@@ -129,6 +129,8 @@ static void Abort_MoveTrack( EDA_DRAW_PANEL* Panel, wxDC* DC ) ...@@ -129,6 +129,8 @@ static void Abort_MoveTrack( EDA_DRAW_PANEL* Panel, wxDC* DC )
EraseDragList(); EraseDragList();
Panel->SetMouseCapture( NULL, NULL ); Panel->SetMouseCapture( NULL, NULL );
Panel->Refresh();
} }
...@@ -1036,6 +1038,8 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC ) ...@@ -1036,6 +1038,8 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC )
OnModify(); OnModify();
DrawPanel->SetMouseCapture( NULL, NULL ); DrawPanel->SetMouseCapture( NULL, NULL );
DrawPanel->Refresh();
if( current_net_code > 0 ) if( current_net_code > 0 )
TestNetConnection( DC, current_net_code ); TestNetConnection( DC, current_net_code );
......
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