Escape CR and LF in Spice simulation command when saved

This commit is contained in:
Mikolaj Wielgus 2021-07-03 16:09:12 +02:00 committed by Jon Evans
parent bd1f3d85f4
commit 87441e256c
2 changed files with 6 additions and 3 deletions

View File

@ -35,6 +35,7 @@
#include <wildcards_and_files_ext.h>
#include <widgets/tuner_slider.h>
#include <dialogs/dialog_signal_list.h>
#include "kicad_string.h"
#include "netlist_exporter_pspice_sim.h"
#include <pgm_base.h>
#include "ngspice.h"
@ -948,7 +949,7 @@ bool SIM_PLOT_FRAME::loadWorkbook( const wxString& aPath )
return false;
}
wxString simCommand = file.GetNextLine();
wxString simCommand = UnescapeString( file.GetNextLine() );
NewPlotPanel( simCommand );
StartSimulation( simCommand );
@ -1058,7 +1059,7 @@ bool SIM_PLOT_FRAME::saveWorkbook( const wxString& aPath )
}
file.AddLine( wxString::Format( "%d", basePanel->GetType() ) );
file.AddLine( m_workbook->GetSimCommand( basePanel ) );
file.AddLine( EscapeString( m_workbook->GetSimCommand( basePanel ), CTX_LINE ) );
const SIM_PLOT_PANEL* plotPanel = dynamic_cast<const SIM_PLOT_PANEL*>( basePanel );

View File

@ -25,7 +25,9 @@
#include <sim/sim_workbook.h>
SIM_WORKBOOK::SIM_WORKBOOK() = default;
SIM_WORKBOOK::SIM_WORKBOOK() : wxAuiNotebook()
{
}
SIM_WORKBOOK::SIM_WORKBOOK( wxWindow* aParent, wxWindowID aId, const wxPoint& aPos, const wxSize&