From 414274f4a3d04ef187d44a0fa867b436e48fb53a Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Fri, 8 Mar 2024 23:13:02 +0100 Subject: [PATCH] add an example for postinit_commands in xschemrc --- src/xschemrc | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/xschemrc b/src/xschemrc index ec352cea..117ed85d 100644 --- a/src/xschemrc +++ b/src/xschemrc @@ -470,20 +470,26 @@ # .menubar.simulate configure -command {xschem netlist -erc; simulate_from_button} # } # +# +#### example: if a raw file already exists re-run a tran simulation. +#### and schedule a waveform load at the end. # set postinit_commands { -# xschem netlist -# set sim(spice,default) 1 ;# ngspice control mode (no xterminal) -# set sim(spice,1,st) 0 ;# no status report -# set sim(spice,1,fg) 0 ;# background -# simulate { -# viewdata $execute(data,$execute(id)) -# xschem raw read $netlist_dir/solar_panel.raw -# xschem redraw -# } -# viewdata $messages ro +# set rawfile $netlist_dir/[file rootname [xschem get current_name]].raw +# if {[file exists $rawfile]} { +# xschem netlist +# set sim(spice,default) 1 ;# ngspice control mode (no xterminal) +# set sim(spice,1,st) 0 ;# no status report +# set sim(spice,1,fg) 0 ;# background +# simulate_from_button { +# viewdata $execute(data,last) +# xschem raw read $rawfile tran +# xschem redraw +# } +# } # } + ########################################################################### #### WEB URL DOWNLOAD HELPER APPLICATION ###########################################################################