add new xschemrc global variable "load_file_postprocess" that might contain tcl commands to be executed whenever a new file is loaded.

This commit is contained in:
stefan schippers 2025-07-09 10:37:18 +02:00
parent 8fe82cf4ce
commit f5bd459082
3 changed files with 17 additions and 0 deletions

View File

@ -3669,6 +3669,7 @@ int load_schematic(int load_symbols, const char *fname, int reset_undo, int aler
drc_check(-1);
}
my_free(_ALLOC_ID_, &ffname);
if(reset_undo == 1) tcleval("eval_load_file_postprocess");
return ret;
}

View File

@ -9636,6 +9636,15 @@ proc eval_netlist_postprocess {} {
}
}
proc eval_load_file_postprocess {} {
global load_file_postprocess
if {[info exists load_file_postprocess]} {
if {[catch {uplevel #0 $load_file_postprocess} res]} {
puts "executing $load_file_postprocess:\n\n$res"
}
}
}
proc setup_tcp_xschem { {port_number {}} } {
global xschem_listen_port xschem_server_getdata

View File

@ -573,8 +573,15 @@
###########################################################################
#### TCL COMMANDS TO BE EXECUTED AFTER GENERATING NETLIST
###########################################################################
#### default: not set.
# set netlist_postprocess {textfile $netlist_dir/[xschem get netlist_name fallback]}
###########################################################################
#### TCL COMMANDS TO BE EXECUTED AFTER LOADING A NEW FILE
###########################################################################
#### default: not set.
# set load_file_postprocess {puts [xschem get schname]}
###########################################################################
#### WEB URL DOWNLOAD HELPER APPLICATION
###########################################################################