kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #42537
Re: [PATCH] simulation: allow entering signals (spice vectors) by name
Thank you Wayne!
I would of course be very happy if you decide to merge it to 5.1
branch as well, since it's currently the only way to do math on
simulation plots, and I understand 6.0 is quite far away.
Regarding automatically populating the signal list with available
spice vectors, I agree that this would be great and I might start
working on that as well if no one else wants to go first. Maybe some
internal spice vectors should be ignored? Specifically 'frequency' and
'time'.
However, in my opinion I think it's a good idea to keep the "enter by
name" even when automatically adding spice vectors to the signal list.
Since I added the feature, I often use it *instead* of picking the
signal in the list, because it's a lot faster to just write "/out" and
hitting return instead of scrolling through this rather long list. And
since I made it automatically select the text after adding the signal,
one can simply just continue and enter a new signal and press return
again, etc. I find it to be a very convenient way to add signals.
Also, in the future I'd like to look into automatically generate "let"
spice commands from expressions entered in this textbox, so one could
write "=V(/in, /out)" to get the difference between in and out, etc.
Cheers
On Mon, Nov 11, 2019 at 3:47 PM Wayne Stambaugh <stambaughw@xxxxxxxxx> wrote:
>
> Hi Jonaton,
>
> I pushed your patch into the master branch. I haven't made up my mind
> on the 5.1 branch. Technically this is a new feature. We have an
> unwritten policy to not backport new features from the master branch.
> Given that this is a fairly trivial change, I may consider applying your
> patch to the 5.1 branch after 5.1.5 is released.
>
> All that being said, I hope that this patch is a temporary fix and that
> we use the information Holger provided on how to query ngspice to fetch
> a list of vectors that can be plotted rather than manually entering
> them. I'm sure someone is going to request this and even if they don't
> I think this would provide a far better user experience.
>
> Thank you for your contribution to KiCad.
>
> Cheers,
>
> Wayne
>
> On 11/7/19 3:52 AM, Jonatan Liljedahl wrote:
> > Hi,
> >
> > Here's an updated patch with fixed commit message. Also I removed some
> > unrelated UI tweaks in sim_plot_frame that accidentally was part of
> > the previous patch. This patch applies to both 5.1 and master.
> >
> > Cheers
> >
> > On Thu, Nov 7, 2019 at 12:04 AM Kymatica <j.r.liljedahl@xxxxxxxxx> wrote:
> >>
> >> Oh, this was for 5.1.
> >> I’ll look into rebasing on master tomorrow! Sleepy time here in Sweden...
> >>
> >> /Jonatan
> >>
> >>> 6 nov. 2019 kl. 23:57 skrev Wayne Stambaugh <stambaughw@xxxxxxxxx>:
> >>>
> >>> This patch does not apply cleanly against master using `git am`. Did
> >>> you forget to rebase against the master branch before creating your patch?
> >>>
> >>> Wayne
> >>>
> >>>> On 11/6/19 5:48 PM, Jonatan Liljedahl wrote:
> >>>> Ok, now I think I've followed the policies correctly, here's the updated patch.
> >>>>
> >>>> Cheers
> >>>>
> >>>>> On Wed, Nov 6, 2019 at 10:33 PM Wayne Stambaugh <stambaughw@xxxxxxxxx> wrote:
> >>>>>
> >>>>> Hi Jonathon,
> >>>>>
> >>>>> I tested your original patch on the 5.1 branch and it seems to work as
> >>>>> advertised. It would be nice if there was a way to query ngspice for a
> >>>>> list of vectors rather than using just the net list to populate add
> >>>>> signals dialog. Maybe Holger can weigh in on this.
> >>>>>
> >>>>> Before you submit your updated patch, please fix your code formatting to
> >>>>> follow the KiCad Coding Policy[1] and your commit message to follow the
> >>>>> KiCad Commit Message[2] policy. There is a git commit hook[3] to help
> >>>>> you with coding policy issues. I saw some K&R curly brace placement in
> >>>>> your patch.
> >>>>>
> >>>>> Thanks,
> >>>>>
> >>>>> Wayne
> >>>>>
> >>>>> [1]:
> >>>>> http://docs.kicad-pcb.org/doxygen/md_Documentation_development_coding-style-policy.html
> >>>>> [2]: http://docs.kicad-pcb.org/doxygen/commit_messages.html
> >>>>> [3]:
> >>>>> http://docs.kicad-pcb.org/doxygen/md_Documentation_development_coding-style-policy.html#tools
> >>>>>
> >>>>> On 11/6/19 4:06 PM, Jonatan Liljedahl wrote:
> >>>>>> This patch does not implement all of pt 4 in that bug report, it only
> >>>>>> allows adding plots of vectors by name, including vectors created by
> >>>>>> LET statements in a spice text block in the schematic (which are not
> >>>>>> listed in the signals list, since that list is based on the net names,
> >>>>>> not the existing spice vectors).
> >>>>>>
> >>>>>> However, I just realized that there's a problem with my patch, it only
> >>>>>> works for V, not I. I'll take a look and update my patch.
> >>>>>>
> >>>>>> On Wed, Nov 6, 2019 at 9:08 PM Sylwester Kocjan <s.kocjan@xxxxx> wrote:
> >>>>>>>
> >>>>>>> Hi Jonatan,
> >>>>>>>
> >>>>>>> On 06/11/2019 13:29, Jonatan Liljedahl wrote:
> >>>>>>>> useful for plotting calculated vectors ("let AB=V(a)*V(b)"),
> >>>>>>>> see for example
> >>>>>>>> https://forum.kicad.info/t/ac-analysis-of-op-amp-loop-gain-and-phase/19661/6
> >>>>>>>>
> >>>>>>>
> >>>>>>> Just small remark to limit entropy in bug reports: it looks like you
> >>>>>>> have implemented pt. 4 from:
> >>>>>>>
> >>>>>>> https://bugs.launchpad.net/kicad/+bug/1814188
> >>>>>>>
> >>>>>>> Maybe it's worth to update that bug report if it will be merged.
> >>>>>>>
> >>>>>>> Best regards,
> >>>>>>> Sylwester
> >>>>>>>
> >>>>>>> _______________________________________________
> >>>>>>> Mailing list: https://launchpad.net/~kicad-developers
> >>>>>>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> >>>>>>> Unsubscribe : https://launchpad.net/~kicad-developers
> >>>>>>> More help : https://help.launchpad.net/ListHelp
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>
> >>>>> _______________________________________________
> >>>>> Mailing list: https://launchpad.net/~kicad-developers
> >>>>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> >>>>> Unsubscribe : https://launchpad.net/~kicad-developers
> >>>>> More help : https://help.launchpad.net/ListHelp
> >>>>
> >>>>
> >>>>
> >>>
> >>> _______________________________________________
> >>> Mailing list: https://launchpad.net/~kicad-developers
> >>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> >>> Unsubscribe : https://launchpad.net/~kicad-developers
> >>> More help : https://help.launchpad.net/ListHelp
> >
> >
> >
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
--
/Jonatan
http://kymatica.com
References