spice netlist export when first line began without a dot : bug or feature ?

Asked by ludovic leau-mercier

Hi,
when i export a spice netlist with i a text block :
If the first line don't began with a dot all the text is not exported
if the first line began with a dot (by example .model Q1 npn) all line began with dot are exported
example 1 :
.model Q_NPN_CBE npn bf=50
* comment
.tran 10n 1u

export is :
.model Q_NPN_CBE npn bf=50
* comment
.tran 10n 1u

example 2 :
* comment
.model Q_NPN_CBE npn bf=50
* comment
.tran 10n 1u

no line are exported...

is a bug or not ?

Question information

Language:
English Edit question
Status:
Answered
For:
KiCad Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Maciej Suminski (orsonmmz) said :
#1

Hi Ludovic,

It sounds like a bug. Are you putting the mentioned lines (".model ...") in a text object on a schematic sheet?

Revision history for this message
ludovic leau-mercier (ludovic-mercier) said :
#2

Hi Maciej,

yes i put the mentionned lines in a text object on a schematic sheet
with eeshema

and i launch a spice netlist export.

On 23/01/2018 09:27, Maciej Suminski wrote:
> Your question #663410 on KiCad changed:
> https://answers.launchpad.net/kicad/+question/663410
>
> Status: Open => Needs information
>
> Maciej Suminski requested more information:
> Hi Ludovic,
>
> It sounds like a bug. Are you putting the mentioned lines (".model ...")
> in a text object on a schematic sheet?
>

--
Ludovic Léau-Mercier

Revision history for this message
ludovic leau-mercier (ludovic-mercier) said :
#3

Hi Maciej,

in the file : netlist_exporter_pspice.cpp
method : void NETLIST_EXPORTER_PSPICE::UpdateDirectives( unsigned aCtl )

we have a if statement wich test if first character is a dot :

 if( text.GetChar( 0 ) == '.' )

and doesn't export if not.

Then is a bug or not ?

Revision history for this message
Maciej Suminski (orsonmmz) said :
#4

Hi Ludovic,

This needs some extra thoughts. The filter you mention is to prevent all texts from schematic to be included in a generated Spice netlist. Normally Spice directives start with a dot, therefore the condition seems reasonable but it is also the reason why you do not get fields starting with a Spice comment. Perhaps it could be extended to skip lines starting with '*' and see if there is one with starting with a dot.

Can you help with this problem?

Provide an answer of your own, or ask ludovic leau-mercier for more information if necessary.

To post a message you must log in.