add xschem get zoom to query zoom factor

This commit is contained in:
Stefan Frederik 2022-08-24 11:22:26 +02:00
parent dffc266e0d
commit 67ff8844f5
3 changed files with 10 additions and 1 deletions

View File

@ -147,6 +147,9 @@
<Component Id="CMPNGSPICEBACKANNOTATE">
<File Id="NGSPICEBACKANNOTATE" KeyPath="yes" Source="../../src/ngspice_backannotate.tcl" />
</Component>
<Component Id="CMPTRAVERSAL">
<File Id="TRAVERSAL" KeyPath="yes" Source="../../src/traversal.tcl" />
</Component>
<Component Id="CMPORDERLABELSAWK">
<File Id="ORDERLABELSAWK" KeyPath="yes" Source="../../src/order_labels.awk" />
</Component>
@ -329,6 +332,7 @@
<ComponentRef Id="CMPMAKESYMAWK" />
<ComponentRef Id="CMPMAKESYMLCCAWK" />
<ComponentRef Id="CMPNGSPICEBACKANNOTATE" />
<ComponentRef Id="CMPTRAVERSAL" />
<ComponentRef Id="CMPMAKEVHDLFROMSPICEAWK" />
<ComponentRef Id="CMPNETLISTCOMPACTORAWK" />
<ComponentRef Id="CMPORDERLABELSAWK" />

View File

@ -999,6 +999,11 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
my_snprintf(s, S(s), "%.16g", xctx->yorigin);
Tcl_SetResult(interp, s,TCL_VOLATILE);
}
else if(!strcmp(argv[2],"zoom")) {
char s[128];
my_snprintf(s, S(s), "%.16g", xctx->zoom);
Tcl_SetResult(interp, s,TCL_VOLATILE);
}
else {
fprintf(errfp, "xschem get %s: invalid command.\n", argv[2]);
}

View File

@ -48,13 +48,13 @@ proc spaces {n} {
proc hier_traversal {fd {level 0}} {
set schpath [xschem get sch_path]
set instances [xschem get instances]
set current_level [xschem get currsch]
for {set i 0} { $i < $instances} { incr i} {
set instname [xschem getprop instance $i name]
set symbol [xschem getprop instance $i cell::name]
set type [xschem getprop symbol $symbol type]
puts $fd "[spaces $level]$schpath$instname symbol: $symbol, type: $type"
if {$type eq {subcircuit}} {
set current_level [xschem get currsch]
set ninst [lindex [split [xschem expandlabel $instname] { }] 1]
for {set n 1} {$n <= $ninst} { incr n} {
xschem select instance $i