Check zone fills before plotting.

Also adds a "Draft Plot" button for those who wish to sidestep
zone checking (which can be slow).

Fixes: lp:1712579
* https://bugs.launchpad.net/kicad/+bug/1712579
This commit is contained in:
Jeff Young 2018-05-03 23:23:47 +01:00
parent cad2d0656c
commit a31017bc9c
11 changed files with 111 additions and 212 deletions

View File

@ -52,6 +52,14 @@ DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* aParent ) :
m_plotOpts = aParent->GetPlotSettings(); m_plotOpts = aParent->GetPlotSettings();
init_Dialog(); init_Dialog();
// We use a sdbSizer here to get the order right, which is platform-dependent
m_sdbSizer1OK->SetLabel( _( "Plot" ) );
m_sdbSizer1Apply->SetLabel( _( "Draft Plot" ) );
m_sdbSizer1Apply->SetToolTip( _( "Plot without running zone fill checks." ) );
m_sdbSizer1Cancel->SetLabel( _( "Close" ) );
m_sdbSizer1OK->SetDefault();
GetSizer()->Fit( this ); GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
} }
@ -753,7 +761,19 @@ void DIALOG_PLOT::OnGerberX2Checked( wxCommandEvent& event )
} }
void DIALOG_PLOT::Plot( wxCommandEvent& event ) void DIALOG_PLOT::Plot( wxCommandEvent& )
{
doPlot( true );
}
void DIALOG_PLOT::DraftPlot( wxCommandEvent& )
{
doPlot( false );
}
void DIALOG_PLOT::doPlot( bool aCheckZones )
{ {
BOARD* board = m_parent->GetBoard(); BOARD* board = m_parent->GetBoard();
@ -782,6 +802,9 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
return; return;
} }
if( aCheckZones )
m_parent->Check_All_Zones( this );
m_plotOpts.SetAutoScale( false ); m_plotOpts.SetAutoScale( false );
m_plotOpts.SetScale( 1 ); m_plotOpts.SetScale( 1 );

View File

@ -58,6 +58,7 @@ private:
// Event called functions // Event called functions
void Plot( wxCommandEvent& event ) override; void Plot( wxCommandEvent& event ) override;
void DraftPlot( wxCommandEvent& event ) override;
void OnQuit( wxCommandEvent& event ) override; void OnQuit( wxCommandEvent& event ) override;
void OnClose( wxCloseEvent& event ) override; void OnClose( wxCloseEvent& event ) override;
void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override; void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override;
@ -74,6 +75,7 @@ private:
void init_Dialog(); // main initialization void init_Dialog(); // main initialization
void reInitDialog(); // initialization after calling drill dialog void reInitDialog(); // initialization after calling drill dialog
void applyPlotSettings(); void applyPlotSettings();
void doPlot( bool aCheckZones );
PlotFormat getPlotFormat(); PlotFormat getPlotFormat();
void setPlotModeChoiceSelection( EDA_DRAW_MODE_T aPlotMode ) void setPlotModeChoiceSelection( EDA_DRAW_MODE_T aPlotMode )

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 19 2018) // C++ code generated with wxFormBuilder (version Dec 30 2017)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -378,23 +378,27 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
bSizerButtons = new wxBoxSizer( wxHORIZONTAL ); bSizerButtons = new wxBoxSizer( wxHORIZONTAL );
m_buttonDRC = new wxButton( this, wxID_ANY, _("Run DRC..."), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonDRC = new wxButton( this, wxID_ANY, _("Run DRC..."), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonDRC, 0, wxALL, 5 ); bSizerButtons->Add( m_buttonDRC, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_buttonDrill = new wxButton( this, ID_CREATE_DRILL_FILE, _("Generate Drill File..."), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonDrill, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
bSizerButtons->Add( 10, 0, 1, wxEXPAND, 5 ); bSizerButtons->Add( 10, 0, 1, wxEXPAND, 5 );
m_plotButton = new wxButton( this, wxID_ANY, _("Plot"), wxDefaultPosition, wxDefaultSize, 0 ); m_sdbSizer1 = new wxStdDialogButtonSizer();
m_plotButton->SetDefault(); m_sdbSizer1OK = new wxButton( this, wxID_OK );
bSizerButtons->Add( m_plotButton, 0, wxALL, 5 ); m_sdbSizer1->AddButton( m_sdbSizer1OK );
m_sdbSizer1Apply = new wxButton( this, wxID_APPLY );
m_sdbSizer1->AddButton( m_sdbSizer1Apply );
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
m_buttonDrill = new wxButton( this, ID_CREATE_DRILL_FILE, _("Generate Drill File..."), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButtons->Add( m_sdbSizer1, 0, wxEXPAND, 5 );
bSizerButtons->Add( m_buttonDrill, 0, wxALL, 5 );
m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtons->Add( m_buttonQuit, 0, wxALL, 5 );
m_MainSizer->Add( bSizerButtons, 0, wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_MainSizer->Add( bSizerButtons, 0, wxALIGN_RIGHT|wxEXPAND|wxLEFT, 5 );
this->SetSizer( m_MainSizer ); this->SetSizer( m_MainSizer );
@ -437,9 +441,10 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_useGerberX2Attributes->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnGerberX2Checked ), NULL, this ); m_useGerberX2Attributes->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnGerberX2Checked ), NULL, this );
m_DXF_plotModeOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeDXFPlotMode ), NULL, this ); m_DXF_plotModeOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeDXFPlotMode ), NULL, this );
m_buttonDRC->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::onRunDRC ), NULL, this ); m_buttonDRC->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::onRunDRC ), NULL, this );
m_plotButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this );
m_buttonDrill->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this ); m_buttonDrill->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this );
m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this ); m_sdbSizer1Apply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::DraftPlot ), NULL, this );
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this );
m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this );
this->Connect( m_menuItem1->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); this->Connect( m_menuItem1->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) );
this->Connect( m_menuItem2->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); this->Connect( m_menuItem2->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) );
this->Connect( m_menuItem3->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); this->Connect( m_menuItem3->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) );
@ -460,9 +465,10 @@ DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE()
m_useGerberX2Attributes->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnGerberX2Checked ), NULL, this ); m_useGerberX2Attributes->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnGerberX2Checked ), NULL, this );
m_DXF_plotModeOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeDXFPlotMode ), NULL, this ); m_DXF_plotModeOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnChangeDXFPlotMode ), NULL, this );
m_buttonDRC->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::onRunDRC ), NULL, this ); m_buttonDRC->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::onRunDRC ), NULL, this );
m_plotButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this );
m_buttonDrill->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this ); m_buttonDrill->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::CreateDrillFile ), NULL, this );
m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this ); m_sdbSizer1Apply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::DraftPlot ), NULL, this );
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this );
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::Plot ), NULL, this );
this->Disconnect( ID_LAYER_FAB, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); this->Disconnect( ID_LAYER_FAB, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) );
this->Disconnect( ID_SELECT_COPPER_LAYERS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); this->Disconnect( ID_SELECT_COPPER_LAYERS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) );
this->Disconnect( ID_DESELECT_COPPER_LAYERS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) ); this->Disconnect( ID_DESELECT_COPPER_LAYERS, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnPopUpLayers ) );

View File

@ -14,7 +14,6 @@
<property name="file">dialog_plot_base</property> <property name="file">dialog_plot_base</property>
<property name="first_id">1000</property> <property name="first_id">1000</property>
<property name="help_provider">none</property> <property name="help_provider">none</property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property> <property name="internationalize">1</property>
<property name="name">Dialog_Plot_base</property> <property name="name">Dialog_Plot_base</property>
<property name="namespace"></property> <property name="namespace"></property>
@ -4391,7 +4390,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND</property> <property name="flag">wxALIGN_RIGHT|wxEXPAND|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
@ -4400,7 +4399,7 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="0"> <object class="wxButton" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -4488,105 +4487,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">1</property>
<object class="spacer" expanded="0">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">10</property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Plot</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_plotButton</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">Plot</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="0"> <object class="wxButton" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -4674,90 +4575,38 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag">wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">1</property>
<object class="wxButton" expanded="0"> <object class="spacer" expanded="0">
<property name="BottomDockable">1</property> <property name="height">0</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default">0</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_CANCEL</property>
<property name="label">Close</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_buttonQuit</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pin_button">1</property> <property name="width">10</property>
<property name="pos"></property> </object>
<property name="resize">Resizable</property> </object>
<property name="show">1</property> <object class="sizeritem" expanded="1">
<property name="size"></property> <property name="border">5</property>
<property name="style"></property> <property name="flag">wxEXPAND</property>
<property name="subclass"></property> <property name="proportion">0</property>
<property name="toolbar_pane">0</property> <object class="wxStdDialogButtonSizer" expanded="1">
<property name="tooltip"></property> <property name="Apply">1</property>
<property name="validator_data_type"></property> <property name="Cancel">1</property>
<property name="validator_style">wxFILTER_NONE</property> <property name="ContextHelp">0</property>
<property name="validator_type">wxDefaultValidator</property> <property name="Help">0</property>
<property name="validator_variable"></property> <property name="No">0</property>
<property name="window_extra_style"></property> <property name="OK">1</property>
<property name="window_name"></property> <property name="Save">0</property>
<property name="window_style"></property> <property name="Yes">0</property>
<event name="OnButtonClick">OnQuit</event> <property name="minimum_size"></property>
<event name="OnChar"></event> <property name="name">m_sdbSizer1</property>
<event name="OnEnterWindow"></event> <property name="permission">protected</property>
<event name="OnEraseBackground"></event> <event name="OnApplyButtonClick">DraftPlot</event>
<event name="OnKeyDown"></event> <event name="OnCancelButtonClick">OnQuit</event>
<event name="OnKeyUp"></event> <event name="OnContextHelpButtonClick"></event>
<event name="OnKillFocus"></event> <event name="OnHelpButtonClick"></event>
<event name="OnLeaveWindow"></event> <event name="OnNoButtonClick"></event>
<event name="OnLeftDClick"></event> <event name="OnOKButtonClick">Plot</event>
<event name="OnLeftDown"></event> <event name="OnSaveButtonClick"></event>
<event name="OnLeftUp"></event> <event name="OnYesButtonClick"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object> </object>

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 19 2018) // C++ code generated with wxFormBuilder (version Dec 30 2017)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -113,9 +113,11 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM
wxCheckBox* m_DXF_plotTextStrokeFontOpt; wxCheckBox* m_DXF_plotTextStrokeFontOpt;
WX_HTML_REPORT_PANEL* m_messagesPanel; WX_HTML_REPORT_PANEL* m_messagesPanel;
wxButton* m_buttonDRC; wxButton* m_buttonDRC;
wxButton* m_plotButton;
wxButton* m_buttonDrill; wxButton* m_buttonDrill;
wxButton* m_buttonQuit; wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Apply;
wxButton* m_sdbSizer1Cancel;
wxMenu* m_popMenu; wxMenu* m_popMenu;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
@ -128,9 +130,10 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM
virtual void OnGerberX2Checked( wxCommandEvent& event ) { event.Skip(); } virtual void OnGerberX2Checked( wxCommandEvent& event ) { event.Skip(); }
virtual void OnChangeDXFPlotMode( wxCommandEvent& event ) { event.Skip(); } virtual void OnChangeDXFPlotMode( wxCommandEvent& event ) { event.Skip(); }
virtual void onRunDRC( wxCommandEvent& event ) { event.Skip(); } virtual void onRunDRC( wxCommandEvent& event ) { event.Skip(); }
virtual void Plot( wxCommandEvent& event ) { event.Skip(); }
virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); } virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); }
virtual void DraftPlot( wxCommandEvent& event ) { event.Skip(); }
virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); } virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); }
virtual void Plot( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPopUpLayers( wxCommandEvent& event ) { event.Skip(); } virtual void OnPopUpLayers( wxCommandEvent& event ) { event.Skip(); }

View File

@ -334,6 +334,10 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_microWaveToolBar = NULL; m_microWaveToolBar = NULL;
m_Layers = nullptr; m_Layers = nullptr;
// We don't know what state board was in when it was lasat saved, so we have to
// assume dirty
m_ZoneFillsDirty = true;
m_rotationAngle = 900; m_rotationAngle = 900;
// Create GAL canvas // Create GAL canvas
@ -1087,6 +1091,8 @@ void PCB_EDIT_FRAME::OnModify( )
if( draw3DFrame ) if( draw3DFrame )
draw3DFrame->ReloadRequest(); draw3DFrame->ReloadRequest();
m_ZoneFillsDirty = true;
} }

View File

@ -256,6 +256,8 @@ public:
bool m_show_microwave_tools; bool m_show_microwave_tools;
bool m_show_layer_manager_tools; bool m_show_layer_manager_tools;
bool m_ZoneFillsDirty; // Board has been modified since last zone fill.
virtual ~PCB_EDIT_FRAME(); virtual ~PCB_EDIT_FRAME();
/** /**

View File

@ -118,7 +118,9 @@ int ZONE_FILLER_TOOL::ZoneFillAll( const TOOL_EVENT& aEvent )
ZONE_FILLER filler( board(), &commit ); ZONE_FILLER filler( board(), &commit );
filler.SetProgressReporter( progressReporter.get() ); filler.SetProgressReporter( progressReporter.get() );
filler.Fill( toFill );
if( filler.Fill( toFill ) )
frame()->m_ZoneFillsDirty = false;
return 0; return 0;
} }

View File

@ -82,7 +82,7 @@ void ZONE_FILLER::SetProgressReporter( WX_PROGRESS_REPORTER* aReporter )
m_progressReporter = aReporter; m_progressReporter = aReporter;
} }
void ZONE_FILLER::Fill( std::vector<ZONE_CONTAINER*> aZones, bool aCheck ) bool ZONE_FILLER::Fill( std::vector<ZONE_CONTAINER*> aZones, bool aCheck )
{ {
int parallelThreadCount = std::max( ( int )std::thread::hardware_concurrency(), 2 ); int parallelThreadCount = std::max( ( int )std::thread::hardware_concurrency(), 2 );
@ -90,7 +90,7 @@ void ZONE_FILLER::Fill( std::vector<ZONE_CONTAINER*> aZones, bool aCheck )
auto connectivity = m_board->GetConnectivity(); auto connectivity = m_board->GetConnectivity();
if( !connectivity->TryLock() ) if( !connectivity->TryLock() )
return; return false;
for( auto zone : aZones ) for( auto zone : aZones )
{ {
@ -202,7 +202,7 @@ void ZONE_FILLER::Fill( std::vector<ZONE_CONTAINER*> aZones, bool aCheck )
connectivity->SetProgressReporter( nullptr ); connectivity->SetProgressReporter( nullptr );
connectivity->Unlock(); connectivity->Unlock();
return; return false;
} }
} }
@ -311,6 +311,7 @@ void ZONE_FILLER::Fill( std::vector<ZONE_CONTAINER*> aZones, bool aCheck )
} }
connectivity->Unlock(); connectivity->Unlock();
return true;
} }

View File

@ -41,8 +41,8 @@ public:
ZONE_FILLER( BOARD* aBoard, COMMIT* aCommit = nullptr ); ZONE_FILLER( BOARD* aBoard, COMMIT* aCommit = nullptr );
~ZONE_FILLER(); ~ZONE_FILLER();
void SetProgressReporter( WX_PROGRESS_REPORTER* aReporter ); void SetProgressReporter( WX_PROGRESS_REPORTER* aReporter );
void Fill( std::vector<ZONE_CONTAINER*> aZones, bool aCheck = false ); bool Fill( std::vector<ZONE_CONTAINER*> aZones, bool aCheck = false );
private: private:

View File

@ -105,6 +105,9 @@ int PCB_EDIT_FRAME::Fill_All_Zones( wxWindow* aActiveWindow )
void PCB_EDIT_FRAME::Check_All_Zones( wxWindow* aActiveWindow ) void PCB_EDIT_FRAME::Check_All_Zones( wxWindow* aActiveWindow )
{ {
if( !m_ZoneFillsDirty )
return;
std::vector<ZONE_CONTAINER*> toFill; std::vector<ZONE_CONTAINER*> toFill;
for( auto zone : GetBoard()->Zones() ) for( auto zone : GetBoard()->Zones() )
@ -117,5 +120,7 @@ void PCB_EDIT_FRAME::Check_All_Zones( wxWindow* aActiveWindow )
ZONE_FILLER filler( GetBoard(), &commit ); ZONE_FILLER filler( GetBoard(), &commit );
filler.SetProgressReporter( progressReporter.get() ); filler.SetProgressReporter( progressReporter.get() );
filler.Fill( toFill, true );
if( filler.Fill( toFill, true ) )
m_ZoneFillsDirty = false;
} }