Printing waveforms in current plot window in AWD

  • Thread starter Svenn Are Bjerkem
  • Start date
S

Svenn Are Bjerkem

Guest
Hi,

I have a problem printing the waveforms from an AWD window into a
result window.

What I have tried so far:

(setq plotWin (window 5))
(awvPrintWaveform plotWin->awvWaveInfoDpl->subwinArr[0]->plotWaveList)

Which give me error messages like:
*Error* unknown data type drwave:229167128
one for each waveform in the window.

I then try to assign some waveforms to variables:
(setq w1 (car plotWin->awvWaveInfoDpl->subwinArr[0]->plotWaveList))
(setq w2 (cadr plotWin->awvWaveInfoDpl->subwinArr[0]->plotWaveList))
(setq w3 (caddr plotWin->awvWaveInfoDpl->subwinArr[0]->plotWaveList))
(setq w4 (cadddr plotWin->awvWaveInfoDpl->subwinArr[0]->plotWaveList))

(awvPrintWaveform w1 w2 w3 w4)

Which works.

plotWin->awvWaveInfoDpl->subwinArr[0]->plotWaveList alone return
(drwave:229167128 drwave:229167152 drwave:229167176 drwave:229167200
drwave:229167224)
which to me looks like a list.

Finder tells me that awvPrintWaveform needs to have each waveform
listed separately even if the explanatory text claims that it prints a
list, it doesn't, at least not for me.

Then I try:
foreach waveForm plotWin->awvWaveInfoDpl->subwinArr[0]->plotWaveList
awvPrintWaveform(waveForm)
which works in the sense that it gives me one print window per
waveform. This will give me one file per waveform, and is not quite
what I need.

I need some kind of solution which takes a list of objects and
dissolve them in a sequence of variables. This is probably a lamda or
a mapcar, but I don't get it right.

Any ideas?
--
Svenn
 
On Aug 9, 4:20 pm, Svenn Are Bjerkem <svenn.bjer...@googlemail.com>
wrote:
Hi,

Hi again,

I was playing around a bit to solve this problem and found a possible
solution:

; First I get the list of all the waves from the wanted waveform
window
(setq wlist (plotWin->awvWaveInfoDpl->subwinArr[0]->plotWaveList)

;Then I get a list of the x-axis data with sweepValues
; Assuming all waves have same length I just grab from the first wave
in list
setq xlist (sweepValues (car wlist))

; Then I use mapcar to iterate over those x-coordinates and for each
waveform
; extract the y-value at that x with value() and send it off to printf
to get it
(foreach mapcar x xlist (printf "\n%L" x) (foreach mapcar obj l
(printf "\t%L" (value obj x))))

Problem as far as I see is that I get a lot of annoying (t t t) lines
towards the end:
(from CDS.log)
.....
\o 4.981806e-09 0.0008387304 0.0008722564 0.0009083612
\o 4.990903e-09 0.0008422031 0.0008751578 0.0009107513
\t 5e-09 0.0008463219 0.0008790259 0.0009143342((t t t)
\t (t t t)
\t (t t t)
\t (t t t)
....

I guess it is printf which wants to show how successful it was, but I
eventually want to write to file so I probably don't care. I am
looking for a better solution that also is able to print the name of
the waveform at the top. I get this from the awvGetWaveNameList() but
I am not sure if the sequence of waveform expression names are always
the same as the one from plotWin->awvWaveInfoDpl->subwinArr[0]-
plotWaveList. Really took some hours to understand that mapcar
functionality, and hours/codeline is now wandering off to infinity....

--
Svenn
 
On Aug 18, 12:11 am, Svenn Are Bjerkem <svenn.bjer...@googlemail.com>
wrote:
On Aug 9, 4:20 pm, Svenn Are Bjerkem <svenn.bjer...@googlemail.com
wrote:> Hi,
Hi again,
I have been fiddling with the script a little bit more and came up
with something that actually can be copy-pasted into your CIW in case
somebody would like to help debugging. I have currently two issues:
1) I get one more heading column than I actually have data for.
2) I do not know if the headings are actually aligned with their data.

I currently don't know the reason for 1)

For 2) I use two different ways of getting the data:
For the header I use the resulting list of awvGetWaveNameList and for
the data I use the awful awvWaveInfoDpl->subwinArr[0]->plotWaveList
which also the awv save state uses. I would have liked to use the
first list of indexes that awvGetWaveNameList spits out, but I have so
far not been able to connect those numbers to the internal data of the
AWD window. I will probably come up with a solution as time goes by,
but I am thankful for any advice that make the search for a solution
easier.

Be careful with monte-carlo plots as excel may choke on too many
columns or rows :)

Now, here it is:

(hiSetBindKey "awv" "ShiftCtrl<Key>p" "(SABprintWaveform
hiGetCurrentWindow())")
(procedure (SABprintWaveform winId)
(let (fp header x xlist wlist obj)
(setq fp (outfile "printedWaves.txt"))
(setq header (buildString (cadr (awvGetWaveNameList winId)) "\t"))
(fprintf fp "time\t%s" header)
(setq wlist winId->awvWaveInfoDpl->subwinArr[0]->plotWaveList)
(setq xlist (sweepValues (car wlist)))
(foreach mapcar x xlist (fprintf fp "\n%L" x)
(foreach mapcar obj wlist (fprintf fp "\t%L" (value obj x))))
(fprintf fp "\n")
(close fp)
)
)

--
Svenn
 
On Sun, 19 Aug 2007 20:22:35 -0000, Svenn Are Bjerkem
<svenn.bjerkem@googlemail.com> wrote:

On Aug 18, 12:11 am, Svenn Are Bjerkem <svenn.bjer...@googlemail.com
wrote:
On Aug 9, 4:20 pm, Svenn Are Bjerkem <svenn.bjer...@googlemail.com
wrote:> Hi,
Hi again,

I have been fiddling with the script a little bit more and came up
with something that actually can be copy-pasted into your CIW in case
somebody would like to help debugging. I have currently two issues:
1) I get one more heading column than I actually have data for.
2) I do not know if the headings are actually aligned with their data.

I currently don't know the reason for 1)
stuff snipped

Well, if you use wavescan, you can simply select the waveforms in the graph, and
hit the table icon and it will "print" them to a table window directly within
the tool...

Regards,

Andrew.
--
Andrew Beckett
Senior Solution Architect
Cadence Design Systems, UK.
 
On Sep 16, 9:05 am, Andrew Beckett <andr...@DcEaLdEeTnEcTe.HcIoSm>
wrote:
On Sun, 19 Aug 2007 20:22:35 -0000, Svenn Are Bjerkem

svenn.bjer...@googlemail.com> wrote:
On Aug 18, 12:11 am, Svenn Are Bjerkem <svenn.bjer...@googlemail.com
wrote:
On Aug 9, 4:20 pm, Svenn Are Bjerkem <svenn.bjer...@googlemail.com
wrote:> Hi,
Hi again,

I have been fiddling with the script a little bit more and came up
with something that actually can be copy-pasted into your CIW in case
somebody would like to help debugging. I have currently two issues:
1) I get one more heading column than I actually have data for.
2) I do not know if the headings are actually aligned with their data.

I currently don't know the reason for 1)

stuff snipped

Well, if you use wavescan, you can simply select the waveforms in the graph, and
hit the table icon and it will "print" them to a table window directly within
the tool...
The only way you are going to get me using Wavescan is to EOL AWD. :)
--
Svenn
 

Welcome to EDABoard.com

Sponsor

Back
Top