kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #33459
process to push improvement
Hi, kicad team,
i'm newbie here.
I use kicad for simulation with ngspice.
Currently when you add directive .title in a textbox and generate
netlist you have this :
.title KiCad schematic
QQ1 /collector /base 0 Q_NPN_CBE
VV1 Net-_V1-Pad1_ 0 dc 0
VVSENSE1 Net-_V1-Pad1_ /collector dc 0
II1 0 /base dc 20u
.title BJT caracteristics
.model Q_NPN_CBE npn
.dc vv1 0 50 2 ii1 15u 75u 15u
.end
I have create a little patch to replace the default title if exist and
then you can have :
.title BJT caracteristics
QQ1 /collector /base 0 Q_NPN_CBE
VV1 Net-_V1-Pad1_ 0 dc 0
VVSENSE1 Net-_V1-Pad1_ /collector dc 0
II1 0 /base dc 20u
.model Q_NPN_CBE npn
.dc vv1 0 50 2 ii1 15u 75u 15u
.end
What is the process to suggest this improvement ?
--
Ludovic Léau-Mercier
diff --git a/eeschema/netlist_exporters/netlist_exporter_pspice.cpp b/eeschema/netlist_exporters/netlist_exporter_pspice.cpp
index 18a5c0c5d..1f30b5def 100644
--- a/eeschema/netlist_exporters/netlist_exporter_pspice.cpp
+++ b/eeschema/netlist_exporters/netlist_exporter_pspice.cpp
@@ -63,10 +63,13 @@ bool NETLIST_EXPORTER_PSPICE::Format( OUTPUTFORMATTER* aFormatter, unsigned aCtl
// Netlist options
const bool useNetcodeAsNetName = false;//aCtl & NET_USE_NETCODES_AS_NETNAMES;
+ // default title
+ m_title = "KiCad schematic";
+
if( !ProcessNetlist( aCtl ) )
return false;
- aFormatter->Print( 0, ".title KiCad schematic\n" );
+ aFormatter->Print( 0, ".title %s\n", (const char*) m_title.c_str() );
// Write .include directives
for( const auto& lib : m_libraries )
@@ -382,6 +385,10 @@ void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl )
if( !lib.IsEmpty() )
m_libraries.insert( lib );
}
+ if( directive.StartsWith( ".title ") )
+ {
+ m_title = directive.AfterFirst( ' ' );
+ }
else
{
m_directives.push_back( directive );
diff --git a/eeschema/netlist_exporters/netlist_exporter_pspice.h b/eeschema/netlist_exporters/netlist_exporter_pspice.h
index 1fc42b032..1a72054bd 100644
--- a/eeschema/netlist_exporters/netlist_exporter_pspice.h
+++ b/eeschema/netlist_exporters/netlist_exporter_pspice.h
@@ -216,6 +216,9 @@ protected:
virtual void writeDirectives( OUTPUTFORMATTER* aFormatter, unsigned aCtl ) const;
private:
+ ///> Spice simulation title found in the processed schematic sheet
+ wxString m_title;
+
///> Spice directives found in the processed schematic sheet
std::vector<wxString> m_directives;
Follow ups