void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event ) { wxString reportName; bool make_report = m_CreateRptCtrl->IsChecked(); if( make_report ) // Create a rpt file { reportName = m_RptFilenameCtrl->GetValue(); if( reportName.IsEmpty() ) { wxCommandEvent dummy; OnButtonBrowseRptFileClick( dummy ); } if( !reportName.IsEmpty() ) reportName = makeValidFileNameReport(); } SetDrcParmeters(); m_tester->SetSettings( true, // Pad to pad DRC test enabled true, // unconnected pads DRC test enabled true, // DRC test for zones enabled true, // DRC test for keepout areas enabled reportName, make_report ); DelDRCMarkers(); wxBeginBusyCursor(); // run all the tests, with no UI at this time. m_Messages->Clear(); wxSafeYield(); // Allows time slice to refresh the m_Messages window 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 ..." // Generate the report if( !reportName.IsEmpty() ) { if( writeReport( reportName ) ) { wxString msg; msg.Printf( _( "Report file \"%s\" created" ), GetChars( reportName ) ); wxString caption( _( "Disk File Report Completed" ) ); wxMessageDialog popupWindow( this, msg, caption ); popupWindow.ShowModal(); } else DisplayError( this, wxString::Format( _( "Unable to create report file '%s' "), GetChars( reportName ) ) ); } wxEndBusyCursor(); RedrawDrawPanel(); }
void DIALOG_DRC_CONTROL::OnOkClick( wxCommandEvent& event ) { SetReturnCode( wxID_OK ); SetDrcParmeters(); m_tester->DestroyDialog( wxID_OK ); }
void DIALOG_DRC_CONTROL::OnListUnconnectedClick( wxCommandEvent& event ) { wxString reportName; bool make_report = m_CreateRptCtrl->IsChecked(); if( make_report ) // Create a file rpt { reportName = m_RptFilenameCtrl->GetValue(); if( reportName.IsEmpty() ) { wxCommandEvent junk; OnButtonBrowseRptFileClick( junk ); } if( !reportName.IsEmpty() ) reportName = makeValidFileNameReport(); } SetDrcParmeters(); m_tester->SetSettings( true, // Pad to pad DRC test enabled true, // unconnected pads DRC test enabled true, // DRC test for zones enabled true, // DRC test for keepout areas enabled reportName, make_report ); DelDRCMarkers(); wxBeginBusyCursor(); m_Messages->Clear(); m_tester->ListUnconnectedPads(); m_Notebook->ChangeSelection( 1 ); // display the 2nd tab "Unconnected..." // Generate the report if( !reportName.IsEmpty() ) { if( writeReport( reportName ) ) { wxString msg; msg.Printf( _( "Report file \"%s\" created" ), GetChars( reportName ) ); wxString caption( _( "Disk File Report Completed" ) ); wxMessageDialog popupWindow( this, msg, caption ); popupWindow.ShowModal(); } else DisplayError( this, wxString::Format( _( "Unable to create report file '%s' "), GetChars( reportName ) ) ); } wxEndBusyCursor(); /* there is currently nothing visible on the DrawPanel for unconnected pads * RedrawDrawPanel(); */ }
void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event ) { wxString reportName; if( m_CreateRptCtrl->IsChecked() ) // Create a file rpt { reportName = m_RptFilenameCtrl->GetValue(); if( reportName.IsEmpty() ) { wxCommandEvent junk; OnButtonBrowseRptFileClick( junk ); } reportName = m_RptFilenameCtrl->GetValue(); } SetDrcParmeters(); m_tester->SetSettings( true, // Pad to pad DRC test enabled true, // unconnected pdas DRC test enabled true, // DRC test for zones enabled true, // DRC test for keepout areas enabled reportName, m_CreateRptCtrl->IsChecked() ); DelDRCMarkers(); wxBeginBusyCursor(); // run all the tests, with no UI at this time. m_Messages->Clear(); wxSafeYield(); // Allows time slice to refresh the m_Messages window m_tester->m_pcb->m_Status_Pcb = 0; // Force full connectivity and ratsnest recalculations m_tester->RunTests(m_Messages); m_Notebook->ChangeSelection( 0 ); // display the 1at tab "...Markers ..." // Generate the report if( !reportName.IsEmpty() ) { FILE* fp = wxFopen( reportName, wxT( "w" ) ); writeReport( fp ); fclose( fp ); wxString msg; msg.Printf( _( "Report file \"%s\" created" ), GetChars( reportName ) ); wxString caption( _( "Disk File Report Completed" ) ); wxMessageDialog popupWindow( this, msg, caption ); popupWindow.ShowModal(); } wxEndBusyCursor(); RedrawDrawPanel(); }
void DIALOG_DRC_CONTROL::OnCancelClick( wxCommandEvent& event ) { SetReturnCode( wxID_CANCEL ); SetDrcParmeters(); // The dialog can be modal or not modal. // Leave the DRC caller destroy (or not) the dialog m_tester->DestroyDRCDialog( wxID_CANCEL ); }
void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event ) { wxString reportName, msg; bool make_report = m_CreateRptCtrl->IsChecked(); if( make_report ) // Create a rpt file { reportName = m_RptFilenameCtrl->GetValue(); if( reportName.IsEmpty() ) { wxCommandEvent dummy; OnButtonBrowseRptFileClick( dummy ); } if( !reportName.IsEmpty() ) reportName = makeValidFileNameReport(); } SetDrcParmeters(); m_tester->m_doZonesTest = m_cbReportTracksToZonesErrors->GetValue(); m_tester->m_rptFilename = reportName; m_tester->m_doCreateRptFile = make_report; m_tester->m_refillZones = m_cbRefillZones->GetValue(); m_tester->m_drcInLegacyRoutingMode = false; m_tester->m_reportAllTrackErrors = m_cbReportAllTrackErrors->GetValue(); m_tester->m_testFootprints = m_cbTestFootprints->GetValue(); DelDRCMarkers(); wxBeginBusyCursor(); wxWindowDisabler disabler; // run all the tests, with no UI at this time. m_Messages->Clear(); wxSafeYield(); // Allows time slice to refresh the Messages m_brdEditor->GetBoard()->m_Status_Pcb = 0; // Force full connectivity and ratsnest calculations m_tester->RunTests(m_Messages); m_Notebook->ChangeSelection( 0 ); // display the "Problems/Markers" tab // Generate the report if( !reportName.IsEmpty() ) { if( writeReport( reportName ) ) { msg.Printf( _( "Report file \"%s\" created" ), GetChars( reportName ) ); wxMessageDialog popupWindow( this, msg, _( "Disk File Report Completed" ) ); popupWindow.ShowModal(); } else { msg.Printf( _( "Unable to create report file \"%s\"" ), GetChars( reportName ) ); DisplayError( this, msg ); } } wxEndBusyCursor(); RedrawDrawPanel(); }