PNS: Fix a few issues with debug logging

Hide non-copper layers for clarity

Fix saving of router settings
This commit is contained in:
Jon Evans 2023-08-06 15:30:53 -04:00
parent ca55656850
commit 5cbe3c5d42
4 changed files with 16 additions and 8 deletions

View File

@ -479,8 +479,10 @@ bool JSON_SETTINGS::SaveToFile( const wxString& aDirectory, bool aForce )
}
const std::string JSON_SETTINGS::FormatAsString() const
const std::string JSON_SETTINGS::FormatAsString()
{
Store();
LOCALE_IO dummy;
std::stringstream buffer;

View File

@ -224,10 +224,10 @@ c * @return true if the file was saved
* @param aTarget is the storage destination
* @return True if set, false if not
*/
static bool SetIfPresent( const nlohmann::json& aObj, const std::string& aPath,
static bool SetIfPresent( const nlohmann::json& aObj, const std::string& aPath ,
unsigned int& aTarget );
const std::string FormatAsString() const;
const std::string FormatAsString();
bool LoadFromRawFile( const wxString& aPath );

View File

@ -592,17 +592,20 @@ void ROUTER_TOOL::saveRouterDebugLog()
fname_settings.SetPath( cwd );
fname_settings.SetName( "pns.settings" );
wxString msg = wxString::Format( _( "Event file: %s\nBoard dump: %s" ), fname_log.GetFullPath(), fname_log.GetFullPath() );
wxString msg = wxString::Format( _( "Event file: %s\nBoard dump: %s" ), fname_log.GetFullPath(),
fname_log.GetFullPath() );
int rv = OKOrCancelDialog( nullptr, _("Save router log"), _("Would you like to save the router\nevent log for debugging purposes?"), msg, _("OK"), _("Cancel") );
int rv = OKOrCancelDialog( nullptr, _( "Save router log" ),
_( "Would you like to save the router\nevent log for debugging purposes?" ), msg,
_( "OK" ), _( "Cancel" ) );
if( !rv )
return;
FILE *f = fopen( fname_settings.GetFullPath().c_str(), "wb" );
FILE* f = fopen( fname_settings.GetFullPath().c_str(), "wb" );
std::string settingsStr = m_router->Settings().FormatAsString();
fprintf(f,"%s\n", settingsStr.c_str( ) );
fclose(f);
fprintf( f, "%s\n", settingsStr.c_str() );
fclose( f );
f = fopen( fname_log.GetFullPath().c_str(), "wb" );

View File

@ -172,6 +172,9 @@ PNS_LOG_VIEWER_FRAME::PNS_LOG_VIEWER_FRAME( wxFrame* frame ) : PNS_LOG_VIEWER_FR
m_overlay.reset( new PNS_LOG_VIEWER_OVERLAY ( m_galPanel->GetGAL() ) );
m_galPanel->GetView()->Add( m_overlay.get() );
m_galPanel->GetViewControls()->EnableCursorWarping(false);
for( PCB_LAYER_ID layer : LSET::AllNonCuMask().Seq() )
m_galPanel->GetView()->SetLayerVisible( layer, false );
}