diff --git a/qa/tools/pns/logviewer.fbp b/qa/tools/pns/logviewer.fbp index ed0d4b6c9c..77da26493f 100644 --- a/qa/tools/pns/logviewer.fbp +++ b/qa/tools/pns/logviewer.fbp @@ -728,6 +728,132 @@ onShowThinLinesChecked + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Show Vertices + + 0 + + + 0 + + 1 + m_showVertices + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onShowVerticesChecked + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,90,92,-1,70,0 + 0 + 0 + wxID_ANY + MyLabel + 0 + + 0 + + + 0 + + 1 + m_algoStatus + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + diff --git a/qa/tools/pns/main.cpp b/qa/tools/pns/main.cpp index 23c0d4fc10..274922a601 100644 --- a/qa/tools/pns/main.cpp +++ b/qa/tools/pns/main.cpp @@ -1,33 +1,82 @@ +#include + #include #include "pns_log_file.h" #include "pns_log_viewer_frame.h" + +static const wxCmdLineEntryDesc g_cmdLineDesc[] = { + { + wxCMD_LINE_SWITCH, + "h", + "help", + _( "displays help on the command line parameters" ).mb_str(), + wxCMD_LINE_VAL_NONE, + wxCMD_LINE_OPTION_HELP, + }, + { + wxCMD_LINE_OPTION, + "i", + "iteration-limit", + _( "Max number of iterations" ).mb_str(), + wxCMD_LINE_VAL_NUMBER, + wxCMD_LINE_PARAM_OPTIONAL, + }, + { + wxCMD_LINE_OPTION, + "s", + "steps-limit", + _( "execute log up to steps-limit events" ).mb_str(), + wxCMD_LINE_VAL_NUMBER, + wxCMD_LINE_PARAM_OPTIONAL, + }, + { + wxCMD_LINE_PARAM, + "filename", + "filename", + _( "log file name (no extensions)" ).mb_str(), + wxCMD_LINE_VAL_STRING, + wxCMD_LINE_OPTION_MANDATORY, + }, + { wxCMD_LINE_NONE } +}; + int replay_main_func( int argc, char* argv[] ) { + wxCmdLineParser cl_parser( argc, argv ); + cl_parser.SetDesc( g_cmdLineDesc ); + cl_parser.AddUsageText( _( "PNS Log (Re)player. Allows to step through the log written by the ROUTER_TOOL " + "in debug KiCad builds." ) ); + + int cmd_parsed_ok = cl_parser.Parse(); + + if( cl_parser.Found("help") ) + { + return 0; + } + + if( cmd_parsed_ok != 0 ) + { + printf("P&S Log Replay/Debug tool. For command line options, call %s -h.\n\n", argv[0] ); + // Help and invalid input both stop here + return ( cmd_parsed_ok == -1 ) ? KI_TEST::RET_CODES::OK : KI_TEST::RET_CODES::BAD_CMDLINE; + } + + wxString filename; + + long iter_limit = 256; + long steps_limit = -1; + cl_parser.Found( "iteration-limit", &iter_limit ); + cl_parser.Found( "steps-limit", &steps_limit ); + filename = cl_parser.GetParam(0); + + printf("iters %d steps %d file '%s'\n", iter_limit, steps_limit, (const char *) filename.c_str() ); + auto frame = new PNS_LOG_VIEWER_FRAME( nullptr ); - // drcCreateTestsProviderClearance(); - // drcCreateTestsProviderEdgeClearance(); - - if( argc >= 2 && std::string( argv[1] ) == "-h" ) - { - printf( "PNS Log (Re)player. Allows to step through the log written by the ROUTER_TOOL " - "in debug KiCad builds. " ); - printf( "Requires a board file with UUIDs and a matching log file. Both are written to " - "/tmp when you press '0' during routing." ); - return 0; - } - - if( argc < 3 ) - { - printf( "Expected parameters: log_file.log board_file.dump\n" ); - return 0; - } - PNS_LOG_FILE* logFile = new PNS_LOG_FILE; - logFile->Load( argv[1], argv[2] ); - + logFile->Load( wxFileName( argv[1] ) ); frame->SetLogFile( logFile ); return 0; diff --git a/qa/tools/pns/pns_log_file.cpp b/qa/tools/pns/pns_log_file.cpp index a56a41dcec..25d170e11f 100644 --- a/qa/tools/pns/pns_log_file.cpp +++ b/qa/tools/pns/pns_log_file.cpp @@ -64,9 +64,21 @@ PNS_LOG_FILE::PNS_LOG_FILE() } -bool PNS_LOG_FILE::Load( const std::string& logName, const std::string boardName ) +bool PNS_LOG_FILE::Load( const wxFileName& logFileName ) { - FILE* f = fopen( logName.c_str(), "rb" ); + wxFileName fname_log( logFileName ); + fname_log.SetExt( wxT( "log" ) ); + + wxFileName fname_dump( logFileName ); + fname_dump.SetExt( wxT( "dump" ) ); + + wxFileName fname_project( logFileName ); + fname_project.SetExt( wxT( "kicad_pro" ) ); + fname_project.MakeAbsolute(); + + FILE* f = fopen( fname_log.GetFullPath().c_str(), "rb" ); + + printf("Loading dump from '%s'\n", (const char*) fname_log.GetFullPath().c_str() ); if( !f ) return false; @@ -101,10 +113,15 @@ bool PNS_LOG_FILE::Load( const std::string& logName, const std::string boardName fclose( f ); + + m_settingsMgr.reset( new SETTINGS_MANAGER ( true ) ); + m_settingsMgr->LoadProject( fname_project.GetFullPath() ); + try { PCB_PLUGIN io; - m_board.reset( io.Load( boardName.c_str(), nullptr, nullptr ) ); + m_board.reset( io.Load( fname_dump.GetFullPath(), nullptr, nullptr ) ); + m_board->SetProject( m_settingsMgr->GetProject( fname_project.GetFullPath() ) ); std::shared_ptr drcEngine( new DRC_ENGINE ); @@ -113,6 +130,8 @@ bool PNS_LOG_FILE::Load( const std::string& logName, const std::string boardName bds.m_DRCEngine = drcEngine; + m_board->SynchronizeNetsAndNetClasses(); + drcEngine->SetBoard( m_board.get() ); drcEngine->SetDesignSettings( &bds ); drcEngine->SetLogReporter( new CONSOLE_MSG_REPORTER( &consoleLog ) ); diff --git a/qa/tools/pns/pns_log_file.h b/qa/tools/pns/pns_log_file.h index eb3cddb916..a10d35852b 100644 --- a/qa/tools/pns/pns_log_file.h +++ b/qa/tools/pns/pns_log_file.h @@ -31,6 +31,8 @@ #include #include +#include + #include #include #include @@ -40,6 +42,8 @@ #include #include +#include + class PNS_LOG_FILE { public: @@ -55,7 +59,7 @@ public: }; // Loads a P&S event log and the associated board file. These two always go together. - bool Load( const std::string& logFileName, const std::string boardFileName ); + bool Load( const wxFileName& logFileName ); BOARD_CONNECTED_ITEM* ItemById( const EVENT_ENTRY& evt ); @@ -67,6 +71,7 @@ public: PNS::ROUTING_SETTINGS* GetRoutingSettings() const { return m_routerSettings.get(); } private: + std::shared_ptr m_settingsMgr; std::unique_ptr m_routerSettings; std::vector m_events; std::shared_ptr m_board; diff --git a/qa/tools/pns/pns_log_player.cpp b/qa/tools/pns/pns_log_player.cpp index d4871e61af..2f21825b9e 100644 --- a/qa/tools/pns/pns_log_player.cpp +++ b/qa/tools/pns/pns_log_player.cpp @@ -136,8 +136,8 @@ void PNS_LOG_PLAYER::ReplayLog( PNS_LOG_FILE* aLog, int aStartEventIndex, int aF m_debugDecorator->NewStage( "move", 0, PNSLOGINFO ); m_viewTracker->SetStage( m_debugDecorator->GetStageCount() - 1 ); m_debugDecorator->Message( wxString::Format( "move (%d, %d)", evt.p.x, evt.p.y ) ); - printf( " move -> (%d, %d)\n", evt.p.x, evt.p.y ); - m_router->Move( evt.p, ritem ); + bool ret = m_router->Move( evt.p, ritem ); + m_debugDecorator->SetCurrentStageStatus( ret ); break; } diff --git a/qa/tools/pns/pns_log_viewer.cpp b/qa/tools/pns/pns_log_viewer.cpp index 4d0c0502c2..8c6b6f4036 100644 --- a/qa/tools/pns/pns_log_viewer.cpp +++ b/qa/tools/pns/pns_log_viewer.cpp @@ -78,8 +78,9 @@ void PNS_LOG_VIEWER_OVERLAY::AnnotatedPoint( const VECTOR2I p, int size, std::st Line( p + VECTOR2D( size, size ), p - VECTOR2D( size, size ) ); Line( p + VECTOR2D( -size, size ), p - VECTOR2D( -size, size ) ); - //if( aShowVertexNumbers) - // m_labelMgr->Add( aL, GetStrokeColor() ); + if( name.length() > 0 ) + m_labelMgr->Add( p, name, GetStrokeColor() ); + } @@ -627,7 +628,7 @@ void PNS_LOG_VIEWER_FRAME::updateDumpPanel( int iter ) buildListTree( rootItem, st->m_entries ); m_itemList->CheckItemRecursively( rootItem, wxCHK_UNCHECKED ); - expandAllChildren( m_itemList ); + collapseAllChildren( m_itemList ); m_itemList->Refresh(); } @@ -794,4 +795,4 @@ static bool registered4 = UTILITY_REGISTRY::Register( { "ttt", "Renderer performance test", ttt_main_func, -} ); \ No newline at end of file +} ); diff --git a/qa/tools/pns/pns_log_viewer_frame.cpp b/qa/tools/pns/pns_log_viewer_frame.cpp index 0ecb6127d8..48933f2633 100644 --- a/qa/tools/pns/pns_log_viewer_frame.cpp +++ b/qa/tools/pns/pns_log_viewer_frame.cpp @@ -47,9 +47,10 @@ class WX_SHAPE_TREE_ITEM_DATA : public wxClientData { public: - WX_SHAPE_TREE_ITEM_DATA( PNS_DEBUG_SHAPE* item ) : m_item( item ){}; + WX_SHAPE_TREE_ITEM_DATA( PNS_DEBUG_SHAPE* item, int level = 0 ) : m_item( item ), m_level( level ) {}; PNS_DEBUG_SHAPE* m_item; + int m_level; }; @@ -64,8 +65,8 @@ void PNS_LOG_VIEWER_OVERLAY::AnnotatedPolyline( const SHAPE_LINE_CHAIN& aL, std: { Polyline( aL ); - if( aShowVertexNumbers) - m_labelMgr->Add( aL, GetStrokeColor() ); + if( name.length() > 0 ) + m_labelMgr->Add( aL.CPoint(-1), name, GetStrokeColor() ); } @@ -74,8 +75,8 @@ void PNS_LOG_VIEWER_OVERLAY::AnnotatedPoint( const VECTOR2I p, int size, std::st Line( p + VECTOR2D( size, size ), p - VECTOR2D( size, size ) ); Line( p + VECTOR2D( -size, size ), p - VECTOR2D( -size, size ) ); - //if( aShowVertexNumbers) - // m_labelMgr->Add( aL, GetStrokeColor() ); + if( name.length() > 0 ) + m_labelMgr->Add( p, name, GetStrokeColor() ); } @@ -157,6 +158,8 @@ PNS_LOG_VIEWER_FRAME::PNS_LOG_VIEWER_FRAME( wxFrame* frame ) : PNS_LOG_VIEWER_FR m_itemList->AppendColumn( "File" ); m_itemList->AppendColumn( "Method" ); m_itemList->AppendColumn( "Line" ); + m_itemList->AppendColumn( "VCount" ); + m_itemList->AppendColumn( "Non-45" ); m_overlay.reset( new PNS_LOG_VIEWER_OVERLAY ( m_galPanel->GetGAL() ) ); m_galPanel->GetView()->Add( m_overlay.get() ); @@ -212,7 +215,7 @@ void PNS_LOG_VIEWER_FRAME::drawLoggedItems( int iter ) auto drawShapes = [&]( PNS_DEBUG_SHAPE* ent ) -> bool { bool isEnabled = ent->IsVisible(); - bool isSelected = false; + bool isSelected = ent->m_selected; if( !isEnabled ) return true; @@ -261,7 +264,7 @@ void PNS_LOG_VIEWER_FRAME::drawLoggedItems( int iter ) case SH_LINE_CHAIN: { auto lc = static_cast( sh ); - m_overlay->AnnotatedPolyline( *lc, ent->m_name.ToStdString(), ent->m_hasLabels && isSelected ); + m_overlay->AnnotatedPolyline( *lc, ent->m_name.ToStdString(), m_showVertices || ( ent->m_hasLabels && isSelected ) ); break; @@ -364,6 +367,13 @@ void PNS_LOG_VIEWER_FRAME::onShowRPIsChecked( wxCommandEvent& event ) updatePnsPreviewItems( m_rewindIter ); } +void PNS_LOG_VIEWER_FRAME::onShowVerticesChecked( wxCommandEvent& event ) +{ + m_showVertices = event.GetInt(); + drawLoggedItems( m_rewindIter ); + updatePnsPreviewItems( m_rewindIter ); +} + void PNS_LOG_VIEWER_FRAME::onRewindScroll( wxScrollEvent& event ) { @@ -410,6 +420,12 @@ void PNS_LOG_VIEWER_FRAME::onBtnRewindRight( wxCommandEvent& event ) } } +void PNS_LOG_VIEWER_FRAME::onFilterText( wxCommandEvent& event ) +{ + m_searchString = m_filterString->GetValue(); + updateDumpPanel( m_rewindIter ); +} + void PNS_LOG_VIEWER_FRAME::onRewindCountText( wxCommandEvent& event ) { @@ -518,6 +534,81 @@ void PNS_LOG_VIEWER_FRAME::onListSelect( wxCommandEvent& event ) } + +static bool isLine45Degree( const SHAPE_LINE_CHAIN* lc ) +{ + for( int i = 0; i < lc->SegmentCount(); i++ ) + { + const SEG& s = lc->CSegment( i ); + + if( lc->IsArcSegment( i ) ) + continue; + + if( s.Length() < 10 ) + continue; + + double angle = 180.0 / M_PI * + atan2( (double) s.B.y - (double) s.A.y, + (double) s.B.x - (double) s.A.x ); + + if( angle < 0 ) + angle += 360.0; + + double angle_a = fabs( fmod( angle, 45.0 ) ); + + if( angle_a > 1.0 && angle_a < 44.0 ) + return false; + } + + return true; +} + + +bool PNS_LOG_VIEWER_FRAME::filterStringMatches( PNS_DEBUG_SHAPE* ent ) +{ + + std::set processed; + std::deque q; + + q.push_back(ent); + int total = 0; + while ( q.size() > 0 ) + { + PNS_DEBUG_SHAPE* top = q.front(); + + q.pop_front(); + + for ( auto chld : top->m_children ) + { + bool match = m_searchString.Length() == 0 ? true : false; + //printf("CHK %s\n", (const char *) chld->m_name.c_str() ); + chld->m_filterMatch = false; + if ( chld->m_name.Contains( m_searchString ) ) + match = true; + if ( chld->m_msg.Contains( m_searchString ) ) + match = true; + + if( match ) + { + for ( PNS_DEBUG_SHAPE *cur = chld; cur; cur = cur->m_parent ) + cur->m_filterMatch = match; + } + + if( processed.find(chld) == processed.end() ) + { + q.push_back( chld ); + processed.insert( chld ); + } + } + total++; + } + + printf("total: %d\n", total ); + + return false; +} + + void PNS_LOG_VIEWER_FRAME::buildListTree( wxTreeListItem item, PNS_DEBUG_SHAPE* ent, int depth ) { @@ -533,7 +624,8 @@ void PNS_LOG_VIEWER_FRAME::buildListTree( wxTreeListItem item, wxTreeListItem ritem; - printf("depth %d\n", depth ); + if( !ent->m_filterMatch ) + return; if( ent->m_msg.length() ) { @@ -560,7 +652,35 @@ void PNS_LOG_VIEWER_FRAME::buildListTree( wxTreeListItem item, m_itemList->SetItemText( ritem, 3, ent->m_srcLoc.funcName ); m_itemList->SetItemText( ritem, 4, wxString::Format("%d", ent->m_srcLoc.line ) ); - m_itemList->SetItemData( ritem, new WX_SHAPE_TREE_ITEM_DATA( ent ) ); + int totalVC = 0, totalVCSimplified = 0; + bool is45Degree = true; + + for( SHAPE* sh : ent->m_shapes ) + { + if( sh->Type() == SH_LINE_CHAIN ) + { + auto lc = static_cast( sh ); + + totalVC += lc->PointCount(); + + SHAPE_LINE_CHAIN simp(*lc); + + simp.Simplify(); + + totalVCSimplified += simp.PointCount(); + + if( !isLine45Degree( lc ) ) + is45Degree = false; + } + } + + if( totalVC > 0 ) + m_itemList->SetItemText( ritem, 5, wxString::Format( "%d [%d]", totalVC, totalVCSimplified ) ); + + if( !is45Degree ) + m_itemList->SetItemText( ritem, 6, wxT("") ); + + m_itemList->SetItemData( ritem, new WX_SHAPE_TREE_ITEM_DATA( ent, depth ) ); if( !ent->m_children.size() ) return; @@ -572,7 +692,7 @@ void PNS_LOG_VIEWER_FRAME::buildListTree( wxTreeListItem item, } -static void expandAllChildren( wxTreeListCtrl* tree, int maxLevel = 0 ) +static void expandAllChildren( wxTreeListCtrl* tree, int maxLevel = -1 ) { wxTreeListItem child = tree->GetFirstItem (); @@ -581,7 +701,7 @@ static void expandAllChildren( wxTreeListCtrl* tree, int maxLevel = 0 ) WX_SHAPE_TREE_ITEM_DATA* idata = static_cast( tree->GetItemData( child ) ); - if( idata->m_item->m_level <= maxLevel ) + if( maxLevel < 0 || idata->m_level <= maxLevel ) tree->Expand ( child ); else tree->Collapse ( child ); @@ -621,13 +741,26 @@ void PNS_LOG_VIEWER_FRAME::updateDumpPanel( int iter ) iter = count - 1; auto st = dbgd->GetStage( iter ); + + if( st->m_status ) + { + m_algoStatus->SetLabel("OK"); + m_algoStatus->SetForegroundColour( wxColor(*wxGREEN)); + } + else + { + m_algoStatus->SetLabel("FAIL"); + m_algoStatus->SetForegroundColour( wxColor(*wxRED)); + } + auto rootItem = m_itemList->GetRootItem(); m_itemList->DeleteAllItems(); + filterStringMatches( st->m_entries ); buildListTree( rootItem, st->m_entries ); m_itemList->CheckItemRecursively( rootItem, wxCHK_UNCHECKED ); - expandAllChildren( m_itemList ); + expandAllChildren( m_itemList, 0 ); m_itemList->Refresh(); } @@ -823,4 +956,4 @@ static bool registered4 = UTILITY_REGISTRY::Register( { ttt_main_func, } ); -#endif \ No newline at end of file +#endif diff --git a/qa/tools/pns/pns_log_viewer_frame.h b/qa/tools/pns/pns_log_viewer_frame.h index 5c2afc9190..d5861e8143 100644 --- a/qa/tools/pns/pns_log_viewer_frame.h +++ b/qa/tools/pns/pns_log_viewer_frame.h @@ -63,6 +63,7 @@ private: void syncModel(); PNS_DEBUG_STAGE* getCurrentStage(); void updatePnsPreviewItems( int iter ); + bool filterStringMatches( PNS_DEBUG_SHAPE* ent ); virtual void onReload( wxCommandEvent& event ) override; virtual void onExit( wxCommandEvent& event ) override; @@ -75,6 +76,8 @@ private: virtual void onListChecked( wxCommandEvent& event ); virtual void onShowThinLinesChecked( wxCommandEvent& event ) override; virtual void onShowRPIsChecked( wxCommandEvent& event ) override; + virtual void onShowVerticesChecked( wxCommandEvent& event ) override; + virtual void onFilterText( wxCommandEvent& event ) override; std::shared_ptr m_overlay; std::shared_ptr m_logFile; @@ -85,6 +88,8 @@ private: bool m_showThinLines = true; bool m_showRPIs = true; + bool m_showVertices = false; + wxString m_searchString; }; class LABEL_MANAGER; diff --git a/qa/tools/pns/pns_log_viewer_frame_base.cpp b/qa/tools/pns/pns_log_viewer_frame_base.cpp index 692c699e79..fcf259f9b9 100644 --- a/qa/tools/pns/pns_log_viewer_frame_base.cpp +++ b/qa/tools/pns/pns_log_viewer_frame_base.cpp @@ -71,6 +71,15 @@ PNS_LOG_VIEWER_FRAME_BASE::PNS_LOG_VIEWER_FRAME_BASE( wxWindow* parent, wxWindow m_chkThinLines = new wxCheckBox( this, wxID_ANY, wxT("Thin lines"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer3->Add( m_chkThinLines, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_showVertices = new wxCheckBox( this, wxID_ANY, wxT("Show Vertices"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer3->Add( m_showVertices, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_algoStatus = new wxStaticText( this, wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 ); + m_algoStatus->Wrap( -1 ); + m_algoStatus->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); + + fgSizer3->Add( m_algoStatus, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_mainSizer->Add( fgSizer3, 0, wxEXPAND, 5 ); @@ -112,8 +121,10 @@ PNS_LOG_VIEWER_FRAME_BASE::PNS_LOG_VIEWER_FRAME_BASE( wxWindow* parent, wxWindow m_rewindRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PNS_LOG_VIEWER_FRAME_BASE::onBtnRewindRight ), NULL, this ); m_rewindPos->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PNS_LOG_VIEWER_FRAME_BASE::onRewindCountText2 ), NULL, this ); m_rewindPos->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( PNS_LOG_VIEWER_FRAME_BASE::onRewindCountText ), NULL, this ); + m_filterString->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PNS_LOG_VIEWER_FRAME_BASE::onFilterText ), NULL, this ); m_chkShowRPItems->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PNS_LOG_VIEWER_FRAME_BASE::onShowRPIsChecked ), NULL, this ); m_chkThinLines->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PNS_LOG_VIEWER_FRAME_BASE::onShowThinLinesChecked ), NULL, this ); + m_showVertices->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PNS_LOG_VIEWER_FRAME_BASE::onShowVerticesChecked ), NULL, this ); } PNS_LOG_VIEWER_FRAME_BASE::~PNS_LOG_VIEWER_FRAME_BASE() @@ -132,7 +143,9 @@ PNS_LOG_VIEWER_FRAME_BASE::~PNS_LOG_VIEWER_FRAME_BASE() m_rewindRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PNS_LOG_VIEWER_FRAME_BASE::onBtnRewindRight ), NULL, this ); m_rewindPos->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PNS_LOG_VIEWER_FRAME_BASE::onRewindCountText2 ), NULL, this ); m_rewindPos->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( PNS_LOG_VIEWER_FRAME_BASE::onRewindCountText ), NULL, this ); + m_filterString->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PNS_LOG_VIEWER_FRAME_BASE::onFilterText ), NULL, this ); m_chkShowRPItems->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PNS_LOG_VIEWER_FRAME_BASE::onShowRPIsChecked ), NULL, this ); m_chkThinLines->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PNS_LOG_VIEWER_FRAME_BASE::onShowThinLinesChecked ), NULL, this ); + m_showVertices->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PNS_LOG_VIEWER_FRAME_BASE::onShowVerticesChecked ), NULL, this ); } diff --git a/qa/tools/pns/pns_log_viewer_frame_base.h b/qa/tools/pns/pns_log_viewer_frame_base.h index becab2a409..54838ec383 100644 --- a/qa/tools/pns/pns_log_viewer_frame_base.h +++ b/qa/tools/pns/pns_log_viewer_frame_base.h @@ -51,6 +51,8 @@ class PNS_LOG_VIEWER_FRAME_BASE : public wxFrame wxTextCtrl* m_filterString; wxCheckBox* m_chkShowRPItems; wxCheckBox* m_chkThinLines; + wxCheckBox* m_showVertices; + wxStaticText* m_algoStatus; wxBoxSizer* m_viewSizer; wxTreeListCtrl* m_itemList; wxStatusBar* m_statusBar; @@ -63,8 +65,10 @@ class PNS_LOG_VIEWER_FRAME_BASE : public wxFrame virtual void onBtnRewindRight( wxCommandEvent& event ) { event.Skip(); } virtual void onRewindCountText2( wxCommandEvent& event ) { event.Skip(); } virtual void onRewindCountText( wxCommandEvent& event ) { event.Skip(); } + virtual void onFilterText( wxCommandEvent& event ) { event.Skip(); } virtual void onShowRPIsChecked( wxCommandEvent& event ) { event.Skip(); } virtual void onShowThinLinesChecked( wxCommandEvent& event ) { event.Skip(); } + virtual void onShowVerticesChecked( wxCommandEvent& event ) { event.Skip(); } public: diff --git a/qa/tools/pns/pns_test_debug_decorator.cpp b/qa/tools/pns/pns_test_debug_decorator.cpp index d5d50efea1..88fe1a2a27 100644 --- a/qa/tools/pns/pns_test_debug_decorator.cpp +++ b/qa/tools/pns/pns_test_debug_decorator.cpp @@ -101,6 +101,7 @@ PNS_DEBUG_STAGE::PNS_DEBUG_STAGE() m_name = ""; m_iter = 0; m_entries = new PNS_DEBUG_SHAPE(); + m_status = false; } PNS_DEBUG_STAGE::~PNS_DEBUG_STAGE() @@ -252,7 +253,13 @@ void PNS_TEST_DEBUG_DECORATOR::NewStage( const wxString& name, int iter, m_activeEntry = m_stages.back()->m_entries; } +void PNS_TEST_DEBUG_DECORATOR::SetCurrentStageStatus( bool stat ) +{ + if( m_stages.empty() ) + return; + m_stages.back()->m_status = stat; +} BOX2I PNS_TEST_DEBUG_DECORATOR::GetStageExtents( int stage ) const { diff --git a/qa/tools/pns/pns_test_debug_decorator.h b/qa/tools/pns/pns_test_debug_decorator.h index 35567211ac..f396cb0611 100644 --- a/qa/tools/pns/pns_test_debug_decorator.h +++ b/qa/tools/pns/pns_test_debug_decorator.h @@ -51,6 +51,7 @@ public: PNS::DEBUG_DECORATOR::SRC_LOCATION_INFO m_srcLoc; bool m_visible; bool m_selected; + bool m_filterMatch; int m_level; }; @@ -62,6 +63,7 @@ struct PNS_DEBUG_STAGE wxString m_name; int m_iter; PNS_DEBUG_SHAPE* m_entries; + bool m_status; }; @@ -101,6 +103,8 @@ public: BOX2I GetStageExtents( int stage ) const; + void SetCurrentStageStatus( bool stat ); + private: void addEntry( PNS_DEBUG_SHAPE* ent ); PNS_DEBUG_STAGE* currentStage();