[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gEDA-dev: Gnucap & python wrapper
I succeeded in wrappring gnucap CMD::cmdproc() method and controlling a
simulation sequence.
The issue I think of is the result ouput.
A user would like to run a simulation step and then
- get some values of the computed vectors;
- set directly some values (controlled sources);
- store values in python matrices/vectors;
- apply transformations to the values before he reinjectes them;
- ...
In the code, outputs are handled in the sweep method (for transient
simulation) and at each iteration the outputdata method is executed.
The (tr, ac, dc, op) simulation are locale to the CMD::(tr; ac; dc; op)
method. So It's not possible to interrogate the simulation.
So I tried to use static members.
I wrapped PROBELIST and PROBE so AFTER the simulation (eq5-.tran.ckt) I
do the following sequence :
# from Pyton, free syntax, between C++ and Python :-)
v5Probe = PROBE_LISTS::print[sTRAN].bag[0]
If fact, I have added to PROBELIST two methods to get the PROBEs (it's
not important):
PROBELIST* next() {return this + 1;};
PROBE* getProbe(const int i) {return &(bag[i]);};
python>print v5Probe.label()
-> "v(5)"
So, Probes are accessible.
python>print v5Probe.value()
segmentation fault.
Why does this segmentation fault occur ? Matrices cleared ?
Is it possible to reach probes value after the run ?
The idea would be to do something like this :
CMD::cmdproc("get eq5-.tran.ckt")
for ( .... )
{
CMD::cmdproc("tr")
// Results/Probes exploitation
....
}
Thanks,
Cyril.
_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev