Pcbnew, dialog plot: add a button (Run DRC) to run the DRC from the plot dialog.
This commit is contained in:
parent
f029047a97
commit
62bf20271b
|
@ -41,13 +41,14 @@
|
|||
* and run DRC tests
|
||||
*/
|
||||
|
||||
DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* parent ) :
|
||||
DIALOG_DRC_CONTROL_BASE( parent )
|
||||
DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFrame,
|
||||
wxWindow* aParent ) :
|
||||
DIALOG_DRC_CONTROL_BASE( aParent )
|
||||
{
|
||||
m_tester = aTester;
|
||||
m_Parent = parent;
|
||||
m_currentBoard = m_Parent->GetBoard();
|
||||
m_BrdSettings = m_Parent->GetBoard()->GetDesignSettings();
|
||||
m_brdEditor = aEditorFrame;
|
||||
m_currentBoard = m_brdEditor->GetBoard();
|
||||
m_BrdSettings = m_brdEditor->GetBoard()->GetDesignSettings();
|
||||
|
||||
InitValues();
|
||||
|
||||
|
@ -60,7 +61,7 @@ DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* parent ) :
|
|||
|
||||
void DIALOG_DRC_CONTROL::OnActivateDlg( wxActivateEvent& event )
|
||||
{
|
||||
if( m_currentBoard != m_Parent->GetBoard() )
|
||||
if( m_currentBoard != m_brdEditor->GetBoard() )
|
||||
{
|
||||
// If m_currentBoard is not the current parent board,
|
||||
// (for instance because a new board was loaded),
|
||||
|
@ -74,7 +75,7 @@ void DIALOG_DRC_CONTROL::OnActivateDlg( wxActivateEvent& event )
|
|||
|
||||
// updating data which can be modified outside the dialog (DRC parameters, units ...)
|
||||
// because the dialog is not modal
|
||||
m_BrdSettings = m_Parent->GetBoard()->GetDesignSettings();
|
||||
m_BrdSettings = m_brdEditor->GetBoard()->GetDesignSettings();
|
||||
DisplayDRCValues();
|
||||
}
|
||||
|
||||
|
@ -129,7 +130,7 @@ void DIALOG_DRC_CONTROL::SetDrcParmeters( )
|
|||
m_BrdSettings.m_ViasMinSize = ValueFromTextCtrl( *m_SetViaMinSizeCtrl );
|
||||
m_BrdSettings.m_MicroViasMinSize = ValueFromTextCtrl( *m_SetMicroViakMinSizeCtrl );
|
||||
|
||||
m_Parent->GetBoard()->SetDesignSettings( m_BrdSettings );
|
||||
m_brdEditor->GetBoard()->SetDesignSettings( m_BrdSettings );
|
||||
}
|
||||
|
||||
|
||||
|
@ -181,7 +182,7 @@ void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event )
|
|||
// run all the tests, with no UI at this time.
|
||||
m_Messages->Clear();
|
||||
wxSafeYield(); // Allows time slice to refresh the m_Messages window
|
||||
m_Parent->GetBoard()->m_Status_Pcb = 0; // Force full connectivity and ratsnest recalculations
|
||||
m_brdEditor->GetBoard()->m_Status_Pcb = 0; // Force full connectivity and ratsnest recalculations
|
||||
m_tester->RunTests(m_Messages);
|
||||
m_Notebook->ChangeSelection( 0 ); // display the 1at tab "...Markers ..."
|
||||
|
||||
|
@ -279,7 +280,7 @@ void DIALOG_DRC_CONTROL::OnListUnconnectedClick( wxCommandEvent& event )
|
|||
|
||||
void DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick( wxCommandEvent& event )
|
||||
{
|
||||
wxFileName fn = m_Parent->GetBoard()->GetFileName();
|
||||
wxFileName fn = m_brdEditor->GetBoard()->GetFileName();
|
||||
fn.SetExt( ReportFileExtension );
|
||||
wxString prj_path = Prj().GetProjectPath();
|
||||
|
||||
|
@ -338,16 +339,16 @@ void DIALOG_DRC_CONTROL::OnLeftDClickClearance( wxMouseEvent& event )
|
|||
|
||||
if( item )
|
||||
{
|
||||
m_Parent->CursorGoto( item->GetPointA() );
|
||||
m_Parent->GetGalCanvas()->GetView()->SetCenter( VECTOR2D( item->GetPointA() ) );
|
||||
m_brdEditor->CursorGoto( item->GetPointA() );
|
||||
m_brdEditor->GetGalCanvas()->GetView()->SetCenter( VECTOR2D( item->GetPointA() ) );
|
||||
|
||||
// turn control over to m_Parent, hide this DIALOG_DRC_CONTROL window,
|
||||
// turn control over to m_brdEditor, hide this DIALOG_DRC_CONTROL window,
|
||||
// no destruction so we can preserve listbox cursor
|
||||
Show( false );
|
||||
|
||||
// We do not want the clarification popup window.
|
||||
// when releasing the left button in the main window
|
||||
m_Parent->SkipNextLeftButtonReleaseEvent();
|
||||
m_brdEditor->SkipNextLeftButtonReleaseEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -391,8 +392,8 @@ void DIALOG_DRC_CONTROL::OnPopupMenu( wxCommandEvent& event )
|
|||
|
||||
if( item )
|
||||
{
|
||||
m_Parent->CursorGoto( pos );
|
||||
m_Parent->GetGalCanvas()->GetView()->SetCenter( VECTOR2D( item->GetPointA() ) );
|
||||
m_brdEditor->CursorGoto( pos );
|
||||
m_brdEditor->GetGalCanvas()->GetView()->SetCenter( VECTOR2D( item->GetPointA() ) );
|
||||
|
||||
Show( false );
|
||||
}
|
||||
|
@ -471,14 +472,14 @@ void DIALOG_DRC_CONTROL::OnLeftDClickUnconnected( wxMouseEvent& event )
|
|||
const DRC_ITEM* item = m_UnconnectedListBox->GetItem( selection );
|
||||
if( item )
|
||||
{
|
||||
m_Parent->CursorGoto( item->GetPointA() );
|
||||
m_Parent->GetGalCanvas()->GetView()->SetCenter( VECTOR2D( item->GetPointA() ) );
|
||||
m_brdEditor->CursorGoto( item->GetPointA() );
|
||||
m_brdEditor->GetGalCanvas()->GetView()->SetCenter( VECTOR2D( item->GetPointA() ) );
|
||||
|
||||
Show( false );
|
||||
|
||||
// We do not want the clarification popup window.
|
||||
// when releasing the left button in the main window
|
||||
m_Parent->SkipNextLeftButtonReleaseEvent();
|
||||
m_brdEditor->SkipNextLeftButtonReleaseEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -507,8 +508,8 @@ void DIALOG_DRC_CONTROL::OnMarkerSelectionEvent( wxCommandEvent& event )
|
|||
const DRC_ITEM* item = m_ClearanceListBox->GetItem( selection );
|
||||
if( item )
|
||||
{
|
||||
m_Parent->CursorGoto( item->GetPointA(), false );
|
||||
m_Parent->GetGalCanvas()->GetView()->SetCenter( VECTOR2D( item->GetPointA() ) );
|
||||
m_brdEditor->CursorGoto( item->GetPointA(), false );
|
||||
m_brdEditor->GetGalCanvas()->GetView()->SetCenter( VECTOR2D( item->GetPointA() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -530,8 +531,8 @@ void DIALOG_DRC_CONTROL::OnUnconnectedSelectionEvent( wxCommandEvent& event )
|
|||
const DRC_ITEM* item = m_UnconnectedListBox->GetItem( selection );
|
||||
if( item )
|
||||
{
|
||||
m_Parent->CursorGoto( item->GetPointA(), false );
|
||||
m_Parent->GetGalCanvas()->GetView()->SetCenter( VECTOR2D( item->GetPointA() ) );
|
||||
m_brdEditor->CursorGoto( item->GetPointA(), false );
|
||||
m_brdEditor->GetGalCanvas()->GetView()->SetCenter( VECTOR2D( item->GetPointA() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -541,13 +542,13 @@ void DIALOG_DRC_CONTROL::OnUnconnectedSelectionEvent( wxCommandEvent& event )
|
|||
|
||||
void DIALOG_DRC_CONTROL::RedrawDrawPanel()
|
||||
{
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
m_brdEditor->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_DRC_CONTROL::DelDRCMarkers()
|
||||
{
|
||||
m_Parent->SetCurItem( NULL ); // clear curr item, because it could be a DRC marker
|
||||
m_brdEditor->SetCurItem( NULL ); // clear curr item, because it could be a DRC marker
|
||||
m_ClearanceListBox->DeleteAllItems();
|
||||
m_UnconnectedListBox->DeleteAllItems();
|
||||
m_DeleteCurrentMarkerButton->Enable( false );
|
||||
|
@ -586,7 +587,7 @@ bool DIALOG_DRC_CONTROL::writeReport( const wxString& aFullFileName )
|
|||
int count;
|
||||
|
||||
fprintf( fp, "** Drc report for %s **\n",
|
||||
TO_UTF8( m_Parent->GetBoard()->GetFileName() ) );
|
||||
TO_UTF8( m_brdEditor->GetBoard()->GetFileName() ) );
|
||||
|
||||
wxDateTime now = wxDateTime::Now();
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
BOARD_DESIGN_SETTINGS m_BrdSettings;
|
||||
|
||||
/// Constructors
|
||||
DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* parent );
|
||||
DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
|
||||
~DIALOG_DRC_CONTROL(){};
|
||||
|
||||
/**
|
||||
|
@ -143,7 +143,7 @@ private:
|
|||
|
||||
BOARD* m_currentBoard; // the board currently on test
|
||||
DRC* m_tester;
|
||||
PCB_EDIT_FRAME* m_Parent;
|
||||
PCB_EDIT_FRAME* m_brdEditor;
|
||||
};
|
||||
|
||||
#endif // _DIALOG_DRC_H_
|
||||
|
|
|
@ -299,18 +299,19 @@ void DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked( wxCommandEvent& event )
|
|||
|
||||
wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
|
||||
|
||||
wxMessageDialog dialog( this, _( "Use a relative path? " ),
|
||||
_( "Plot Output Directory" ),
|
||||
fn = Prj().AbsolutePath( m_parent->GetBoard()->GetFileName() );
|
||||
wxString defaultPath = fn.GetPathWithSep();
|
||||
wxString msg;
|
||||
msg.Printf( _( "Do you want to use a path relative to\n'%s'" ),
|
||||
GetChars( defaultPath ) );
|
||||
|
||||
wxMessageDialog dialog( this, msg, _( "Plot Output Directory" ),
|
||||
wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
|
||||
|
||||
if( dialog.ShowModal() == wxID_YES )
|
||||
{
|
||||
wxString boardFilePath = Prj().AbsolutePath( m_parent->GetBoard()->GetFileName() );
|
||||
|
||||
boardFilePath = wxPathOnly( boardFilePath );
|
||||
|
||||
if( !dirName.MakeRelativeTo( boardFilePath ) )
|
||||
wxMessageBox( _( "Cannot make path relative. The target volume is different from board file volume!" ),
|
||||
if( !dirName.MakeRelativeTo( defaultPath ) )
|
||||
wxMessageBox( _( "Cannot make path relative (target volume different from file volume)!" ),
|
||||
_( "Plot Output Directory" ), wxOK | wxICON_ERROR );
|
||||
}
|
||||
|
||||
|
|
|
@ -813,3 +813,20 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
|
|||
if( !m_plotOpts.GetLayerSelection().any() )
|
||||
DisplayError( this, _( "No layer selected" ) );
|
||||
}
|
||||
|
||||
#include <drc_stuff.h>
|
||||
void DIALOG_PLOT::onRunDRC( wxCommandEvent& event )
|
||||
{
|
||||
PCB_EDIT_FRAME* parent = dynamic_cast<PCB_EDIT_FRAME*>( GetParent() );
|
||||
|
||||
if( parent )
|
||||
{
|
||||
// First close an existing dialog if open
|
||||
// (low probability, but can happen)
|
||||
parent->GetDrcController()->DestroyDialog( wxID_OK );
|
||||
|
||||
// Open a new drc dialod, with the right parent frame
|
||||
parent->GetDrcController()->ShowDialog( this );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ private:
|
|||
void SetPlotFormat( wxCommandEvent& event );
|
||||
void OnSetScaleOpt( wxCommandEvent& event );
|
||||
void CreateDrillFile( wxCommandEvent& event );
|
||||
virtual void onRunDRC( wxCommandEvent& event ) override;
|
||||
|
||||
// orther functions
|
||||
void applyPlotSettings();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jan 1 2016)
|
||||
// C++ code generated with wxFormBuilder (version Jul 24 2016)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -355,6 +355,12 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
m_buttonDrill = new wxButton( this, ID_CREATE_DRILL_FILE, _("Generate Drill File"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerButtons->Add( m_buttonDrill, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bSizerButtons->Add( 10, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
m_buttonDRC = new wxButton( this, wxID_ANY, _("Run DRC"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerButtons->Add( m_buttonDRC, 0, wxALL, 5 );
|
||||
|
||||
m_buttonQuit = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizerButtons->Add( m_buttonQuit, 0, wxALL, 5 );
|
||||
|
||||
|
@ -400,6 +406,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
|
|||
m_scaleOpt->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), 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_buttonDRC->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::onRunDRC ), NULL, this );
|
||||
m_buttonQuit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this );
|
||||
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 ) );
|
||||
|
@ -420,6 +427,7 @@ DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE()
|
|||
m_scaleOpt->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnSetScaleOpt ), 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_buttonDRC->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::onRunDRC ), NULL, this );
|
||||
m_buttonQuit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PLOT_BASE::OnQuit ), NULL, this );
|
||||
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 ) );
|
||||
|
|
|
@ -4201,6 +4201,104 @@
|
|||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="spacer" expanded="1">
|
||||
<property name="height">0</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="width">10</property>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxButton" expanded="1">
|
||||
<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">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_ANY</property>
|
||||
<property name="label">Run DRC</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_buttonDRC</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">onRunDRC</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>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jan 1 2016)
|
||||
// C++ code generated with wxFormBuilder (version Jul 24 2016)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -109,6 +109,7 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM
|
|||
WX_HTML_REPORT_PANEL* m_messagesPanel;
|
||||
wxButton* m_plotButton;
|
||||
wxButton* m_buttonDrill;
|
||||
wxButton* m_buttonDRC;
|
||||
wxButton* m_buttonQuit;
|
||||
wxMenu* m_popMenu;
|
||||
|
||||
|
@ -121,6 +122,7 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM
|
|||
virtual void OnSetScaleOpt( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void Plot( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void CreateDrillFile( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onRunDRC( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnQuit( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnPopUpLayers( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
|
|
@ -53,12 +53,12 @@
|
|||
#include <wx/progdlg.h>
|
||||
|
||||
|
||||
void DRC::ShowDialog()
|
||||
void DRC::ShowDialog( wxWindow* aParent )
|
||||
{
|
||||
if( !m_drcDialog )
|
||||
{
|
||||
m_mainWindow->GetToolManager()->RunAction( COMMON_ACTIONS::selectionClear, true );
|
||||
m_drcDialog = new DIALOG_DRC_CONTROL( this, m_mainWindow );
|
||||
m_pcbEditorFrame->GetToolManager()->RunAction( COMMON_ACTIONS::selectionClear, true );
|
||||
m_drcDialog = new DIALOG_DRC_CONTROL( this, m_pcbEditorFrame, aParent );
|
||||
updatePointers();
|
||||
|
||||
m_drcDialog->SetRptSettings( m_doCreateRptFile, m_rptFilename);
|
||||
|
@ -88,7 +88,7 @@ void DRC::DestroyDialog( int aReason )
|
|||
|
||||
DRC::DRC( PCB_EDIT_FRAME* aPcbWindow )
|
||||
{
|
||||
m_mainWindow = aPcbWindow;
|
||||
m_pcbEditorFrame = aPcbWindow;
|
||||
m_pcb = aPcbWindow->GetBoard();
|
||||
m_drcDialog = NULL;
|
||||
|
||||
|
@ -132,7 +132,7 @@ int DRC::Drc( TRACK* aRefSegm, TRACK* aList )
|
|||
{
|
||||
wxASSERT( m_currentMarker );
|
||||
|
||||
m_mainWindow->SetMsgPanel( m_currentMarker );
|
||||
m_pcbEditorFrame->SetMsgPanel( m_currentMarker );
|
||||
return BAD_DRC;
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,7 @@ int DRC::Drc( TRACK* aRefSegm, TRACK* aList )
|
|||
{
|
||||
wxASSERT( m_currentMarker );
|
||||
|
||||
m_mainWindow->SetMsgPanel( m_currentMarker );
|
||||
m_pcbEditorFrame->SetMsgPanel( m_currentMarker );
|
||||
return BAD_DRC;
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ int DRC::Drc( ZONE_CONTAINER* aArea, int aCornerIndex )
|
|||
if( !doEdgeZoneDrc( aArea, aCornerIndex ) )
|
||||
{
|
||||
wxASSERT( m_currentMarker );
|
||||
m_mainWindow->SetMsgPanel( m_currentMarker );
|
||||
m_pcbEditorFrame->SetMsgPanel( m_currentMarker );
|
||||
return BAD_DRC;
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ void DRC::RunTests( wxTextCtrl* aMessages )
|
|||
{
|
||||
// be sure m_pcb is the current board, not a old one
|
||||
// ( the board can be reloaded )
|
||||
m_pcb = m_mainWindow->GetBoard();
|
||||
m_pcb = m_pcbEditorFrame->GetBoard();
|
||||
|
||||
// Ensure ratsnest is up to date:
|
||||
if( (m_pcb->m_Status_Pcb & LISTE_RATSNEST_ITEM_OK) == 0 )
|
||||
|
@ -178,7 +178,7 @@ void DRC::RunTests( wxTextCtrl* aMessages )
|
|||
wxSafeYield();
|
||||
}
|
||||
|
||||
m_mainWindow->Compile_Ratsnest( NULL, true );
|
||||
m_pcbEditorFrame->Compile_Ratsnest( NULL, true );
|
||||
}
|
||||
|
||||
// someone should have cleared the two lists before calling this.
|
||||
|
@ -217,7 +217,7 @@ void DRC::RunTests( wxTextCtrl* aMessages )
|
|||
wxSafeYield();
|
||||
}
|
||||
|
||||
testTracks( aMessages ? aMessages->GetParent() : m_mainWindow, true );
|
||||
testTracks( aMessages ? aMessages->GetParent() : m_pcbEditorFrame, true );
|
||||
|
||||
// Before testing segments and unconnected, refill all zones:
|
||||
// this is a good caution, because filled areas can be outdated.
|
||||
|
@ -227,7 +227,7 @@ void DRC::RunTests( wxTextCtrl* aMessages )
|
|||
wxSafeYield();
|
||||
}
|
||||
|
||||
m_mainWindow->Fill_All_Zones( aMessages ? aMessages->GetParent() : m_mainWindow,
|
||||
m_pcbEditorFrame->Fill_All_Zones( aMessages ? aMessages->GetParent() : m_pcbEditorFrame,
|
||||
false );
|
||||
|
||||
// test zone clearances to other zones
|
||||
|
@ -295,8 +295,8 @@ void DRC::ListUnconnectedPads()
|
|||
|
||||
void DRC::updatePointers()
|
||||
{
|
||||
// update my pointers, m_mainWindow is the only unchangeable one
|
||||
m_pcb = m_mainWindow->GetBoard();
|
||||
// update my pointers, m_pcbEditorFrame is the only unchangeable one
|
||||
m_pcb = m_pcbEditorFrame->GetBoard();
|
||||
|
||||
if( m_drcDialog ) // Use diag list boxes only in DRC dialog
|
||||
{
|
||||
|
@ -325,7 +325,7 @@ bool DRC::doNetClass( NETCLASSPTR nc, wxString& msg )
|
|||
|
||||
m_currentMarker = fillMarker( DRCE_NETCLASS_CLEARANCE, msg, m_currentMarker );
|
||||
m_pcb->Add( m_currentMarker );
|
||||
m_mainWindow->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_pcbEditorFrame->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_currentMarker = 0;
|
||||
ret = false;
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ bool DRC::doNetClass( NETCLASSPTR nc, wxString& msg )
|
|||
|
||||
m_currentMarker = fillMarker( DRCE_NETCLASS_TRACKWIDTH, msg, m_currentMarker );
|
||||
m_pcb->Add( m_currentMarker );
|
||||
m_mainWindow->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_pcbEditorFrame->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_currentMarker = 0;
|
||||
ret = false;
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ bool DRC::doNetClass( NETCLASSPTR nc, wxString& msg )
|
|||
|
||||
m_currentMarker = fillMarker( DRCE_NETCLASS_VIASIZE, msg, m_currentMarker );
|
||||
m_pcb->Add( m_currentMarker );
|
||||
m_mainWindow->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_pcbEditorFrame->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_currentMarker = 0;
|
||||
ret = false;
|
||||
}
|
||||
|
@ -371,7 +371,7 @@ bool DRC::doNetClass( NETCLASSPTR nc, wxString& msg )
|
|||
|
||||
m_currentMarker = fillMarker( DRCE_NETCLASS_VIADRILLSIZE, msg, m_currentMarker );
|
||||
m_pcb->Add( m_currentMarker );
|
||||
m_mainWindow->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_pcbEditorFrame->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_currentMarker = 0;
|
||||
ret = false;
|
||||
}
|
||||
|
@ -386,7 +386,7 @@ bool DRC::doNetClass( NETCLASSPTR nc, wxString& msg )
|
|||
|
||||
m_currentMarker = fillMarker( DRCE_NETCLASS_uVIASIZE, msg, m_currentMarker );
|
||||
m_pcb->Add( m_currentMarker );
|
||||
m_mainWindow->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_pcbEditorFrame->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_currentMarker = 0;
|
||||
ret = false;
|
||||
}
|
||||
|
@ -401,7 +401,7 @@ bool DRC::doNetClass( NETCLASSPTR nc, wxString& msg )
|
|||
|
||||
m_currentMarker = fillMarker( DRCE_NETCLASS_uVIADRILLSIZE, msg, m_currentMarker );
|
||||
m_pcb->Add( m_currentMarker );
|
||||
m_mainWindow->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_pcbEditorFrame->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_currentMarker = 0;
|
||||
ret = false;
|
||||
}
|
||||
|
@ -466,7 +466,7 @@ void DRC::testPad2Pad()
|
|||
{
|
||||
wxASSERT( m_currentMarker );
|
||||
m_pcb->Add( m_currentMarker );
|
||||
m_mainWindow->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_pcbEditorFrame->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_currentMarker = 0;
|
||||
}
|
||||
}
|
||||
|
@ -519,7 +519,7 @@ void DRC::testTracks( wxWindow *aActiveWindow, bool aShowProgressBar )
|
|||
{
|
||||
wxASSERT( m_currentMarker );
|
||||
m_pcb->Add( m_currentMarker );
|
||||
m_mainWindow->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_pcbEditorFrame->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_currentMarker = 0;
|
||||
}
|
||||
}
|
||||
|
@ -533,8 +533,8 @@ void DRC::testUnconnected()
|
|||
{
|
||||
if( (m_pcb->m_Status_Pcb & LISTE_RATSNEST_ITEM_OK) == 0 )
|
||||
{
|
||||
wxClientDC dc( m_mainWindow->GetCanvas() );
|
||||
m_mainWindow->Compile_Ratsnest( &dc, true );
|
||||
wxClientDC dc( m_pcbEditorFrame->GetCanvas() );
|
||||
m_pcbEditorFrame->Compile_Ratsnest( &dc, true );
|
||||
}
|
||||
|
||||
if( m_pcb->GetRatsnestsCount() == 0 )
|
||||
|
@ -594,7 +594,7 @@ void DRC::testZones()
|
|||
m_currentMarker = fillMarker( test_area,
|
||||
DRCE_SUSPICIOUS_NET_FOR_ZONE_OUTLINE, m_currentMarker );
|
||||
m_pcb->Add( m_currentMarker );
|
||||
m_mainWindow->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_pcbEditorFrame->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_currentMarker = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -630,7 +630,7 @@ void DRC::testKeepoutAreas()
|
|||
m_currentMarker = fillMarker( segm, NULL,
|
||||
DRCE_TRACK_INSIDE_KEEPOUT, m_currentMarker );
|
||||
m_pcb->Add( m_currentMarker );
|
||||
m_mainWindow->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_pcbEditorFrame->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_currentMarker = 0;
|
||||
}
|
||||
}
|
||||
|
@ -647,7 +647,7 @@ void DRC::testKeepoutAreas()
|
|||
m_currentMarker = fillMarker( segm, NULL,
|
||||
DRCE_VIA_INSIDE_KEEPOUT, m_currentMarker );
|
||||
m_pcb->Add( m_currentMarker );
|
||||
m_mainWindow->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_pcbEditorFrame->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_currentMarker = 0;
|
||||
}
|
||||
}
|
||||
|
@ -708,7 +708,7 @@ void DRC::testTexts()
|
|||
DRCE_TRACK_INSIDE_TEXT,
|
||||
m_currentMarker );
|
||||
m_pcb->Add( m_currentMarker );
|
||||
m_mainWindow->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_pcbEditorFrame->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_currentMarker = NULL;
|
||||
break;
|
||||
}
|
||||
|
@ -727,7 +727,7 @@ void DRC::testTexts()
|
|||
m_currentMarker = fillMarker( track, text,
|
||||
DRCE_VIA_INSIDE_TEXT, m_currentMarker );
|
||||
m_pcb->Add( m_currentMarker );
|
||||
m_mainWindow->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_pcbEditorFrame->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_currentMarker = NULL;
|
||||
break;
|
||||
}
|
||||
|
@ -777,7 +777,7 @@ void DRC::testTexts()
|
|||
m_currentMarker = fillMarker( pad, text,
|
||||
DRCE_PAD_INSIDE_TEXT, m_currentMarker );
|
||||
m_pcb->Add( m_currentMarker );
|
||||
m_mainWindow->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_pcbEditorFrame->GetGalCanvas()->GetView()->Add( m_currentMarker );
|
||||
m_currentMarker = NULL;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -193,7 +193,7 @@ private:
|
|||
int m_xcliphi;
|
||||
int m_ycliphi;
|
||||
|
||||
PCB_EDIT_FRAME* m_mainWindow;
|
||||
PCB_EDIT_FRAME* m_pcbEditorFrame; ///< The pcb frame editor which owns the board
|
||||
BOARD* m_pcb;
|
||||
DIALOG_DRC_CONTROL* m_drcDialog;
|
||||
|
||||
|
@ -203,7 +203,7 @@ private:
|
|||
/**
|
||||
* Function updatePointers
|
||||
* is a private helper function used to update needed pointers from the
|
||||
* one pointer which is known not to change, m_mainWindow.
|
||||
* one pointer which is known not to change, m_pcbEditorFrame.
|
||||
*/
|
||||
void updatePointers();
|
||||
|
||||
|
@ -441,8 +441,10 @@ public:
|
|||
* opens a dialog and prompts the user, then if a test run button is
|
||||
* clicked, runs the test(s) and creates the MARKERS. The dialog is only
|
||||
* created if it is not already in existence.
|
||||
* @param aParent is the parent window for wxWidgets. Usually the PCB editor frame
|
||||
* but can be an other dialog
|
||||
*/
|
||||
void ShowDialog();
|
||||
void ShowDialog( wxWindow* aParent );
|
||||
|
||||
/**
|
||||
* Function DestroyDialog
|
||||
|
|
|
@ -294,7 +294,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
case ID_DRC_CONTROL:
|
||||
m_drc->ShowDialog();
|
||||
m_drc->ShowDialog( this );
|
||||
break;
|
||||
|
||||
case ID_GET_NETLIST:
|
||||
|
|
Loading…
Reference in New Issue