2 # First read data from IRF540 simulation
10 # Fig 2 layout to quad
12 # Oops, forgot a signal in figure 2 graph 3
15 # Plot filter response
20 # Plot square signal, its FFT and a math signal
27 orange 0 15 -.002 .010
33 # Insert and remove a signal
37 # Create from reference signal. Note with Signal unit can be defined
40 vs2=Signal(sin(vsqu.ref*1e6), 'V')
47 print "*** List of figures"
50 # Create a copy of vout and freeze it
59 print '*** Now we will show the updating capabilties of ioscopy.'
60 print '*** We will use Figure 3 that has currently two identical signals'
61 print '*** \'vout\' and \'vo\' where \'vo\' is a frozen copy of vout.'
62 print '*** vout is the response of a simple RC lowpass filter.'
64 print '*** We will change a value in the schematics and then run simulation'
65 print '*** tools. Make sure you have gschem, gnetlist and gnucap installed'
67 print '*** Before updating simulation results we will run gschem.'
68 print '*** In the schematics, change value of capacitor \'C\' eg from 10n to 1n.'
69 print '*** Close gschem when finished to continue'
70 cmd = 'gschem demo/demo.sch'
71 c = raw_input('Command: %s [Y/n/c] ' % cmd)
73 if c in ['e','E']: cmd = raw_input('Enter command to execute: ')
74 if c in ['e', 'E', 'y', 'Y']: os.system(cmd)
77 print '*** Now we will run gnetlist'
78 print '*** press enter or \'y\' to continue, \'n\' to skip, \'e\' to change'
80 cmd = 'cd demo && gnetlist -g spice-sdb -s -o demo.net demo.sch'
81 c = raw_input('Command: %s [Y/n/c] ' % cmd)
83 if c in ['e','E']: cmd = raw_input('Enter command to execute: ')
84 if c in ['e', 'E', 'y', 'Y']: os.system(cmd)
86 print '*** Now we will run gnucap'
87 print '*** press enter or \'y\' to continue, \'n\' to skip, \'e\' to change'
89 cmd = 'cd demo && gnucap -b demo.net'
90 c = raw_input('Command: %s [Y/n/c] ' % cmd)
92 if c in ['e','E']: cmd = raw_input('Enter command to execute: ')
93 if c in ['e', 'E', 'y', 'Y']: os.system(cmd)
95 print "*** Unless there are errors simulation is complete we can update ioscopy"
99 print "*** Now you should look at figure 3"
103 owrite gnucap (ow:1) demo/res.dat v1,vsqu