Re: [Kicad-developers] eeschema ngspice simulation improvment

2018-02-08 Thread ludovic léau-mercier

I work on. First result in attachment.


On 08/02/2018 10:07, Maciej Sumiński wrote:

Hi Ludovic,

If I recall correctly, when you run an analysis different than
transient, ngspice will not return any data when you ask for currents.
There is also another related line:

void NETLIST_EXPORTER_PSPICE_SIM::writeDirectives( OUTPUTFORMATTER*
aFormatter, unsigned aCtl ) const
{
 // Add a directive to obtain currents
 //aFormatter->Print( 0, ".options savecurrents\n" );// does
not work :(

The directive is described in ngspice manual [1, 15.7.1]. Perhaps it is
fixed in ngspice-27, I have no idea. Try commenting out the condition
that prevents listing current signals for analysis other than transient
and see if you succeed.

Regards,
Orson

1. http://ngspice.sourceforge.net/docs/ngspice-manual.pdf

On 02/08/2018 09:45 AM, ludovic léau-mercier wrote:

Hi all,

i try to create a patch to adding several improvment of eeshema simulation.

My first goal is to draw BJT caracteristics (like
https://www.st-andrews.ac.uk/~www_pa/Scots_Guide/info/comp/active/BiPolar/IcVce.gif)
with a simplest circuit in attachment.

I had beginning to work on this improvment but in the file :

  /kicad/eeschema/dialogs/dialog_signal_list.cpp

in method :

bool DIALOG_SIGNAL_LIST::TransferDataToWindow()

there is a strnage comment :

// For some reason, it is not possible to plot currents in any but
transient analysis

If someone can give me some informations ?




___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp





___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


--
Ludovic Léau-Mercier
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] eeschema ngspice simulation improvment

2018-02-08 Thread ludovic léau-mercier

Hi all,

i try to create a patch to adding several improvment of eeshema simulation.

My first goal is to draw BJT caracteristics (like 
https://www.st-andrews.ac.uk/~www_pa/Scots_Guide/info/comp/active/BiPolar/IcVce.gif) 
with a simplest circuit in attachment.


I had beginning to work on this improvment but in the file :

 /kicad/eeschema/dialogs/dialog_signal_list.cpp

in method :

bool DIALOG_SIGNAL_LIST::TransferDataToWindow()

there is a strnage comment :

// For some reason, it is not possible to plot currents in any but 
transient analysis


If someone can give me some informations ?


--
Ludovic Léau-Mercier
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] process to push improvement

2018-01-25 Thread ludovic léau-mercier

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 m_directives;
 
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp