make "ctrl-[0-9]" commands work again (change layer)

This commit is contained in:
Stefan Schippers 2020-09-16 00:50:15 +02:00
parent 9c1a940825
commit b51ce34b1c
4 changed files with 14 additions and 6 deletions

View File

@ -100,6 +100,7 @@ ctrl Enter Confirm closing dialog boxes
- '#' Highlight components with duplicated name (refdes)
ctrl '#' Rename components with duplicated name (refdes)
- '5' View only probes
ctrl '0-9' set current layer (4 -13)
- 'a' Make symbol from pin list of current schematic
ctrl 'a' Select all
shift 'A' Toggle show netlist

View File

@ -616,7 +616,10 @@ int callback(int event, int mx, int my, KeySym key,
} /* /20110112 */
if(key<='9' && key >='0' && state==ControlMask) /* choose layer */
{
char n[30];
rectcolor = key - '0'+4;
my_snprintf(n, S(n), "%d", rectcolor);
Tcl_VarEval(interp, "xschem set rectcolor ", n, "; reconfigure_layers_button", NULL);
dbg(1, "callback(): new color: %d\n",color_index[rectcolor]);
break;
}

View File

@ -59,6 +59,7 @@ ctrl Enter Confirm closing dialog boxes
- '#' Highlight components with duplicated name (refdes)
ctrl '#' Rename components with duplicated name (refdes)
- '5' View only probes
ctrl '0-9' set current layer (4 -13)
- 'a' Make symbol from pin list of current schematic
ctrl 'a' Select all
shift 'A' Toggle show netlist

View File

@ -45,11 +45,13 @@ proc read_ngspice_raw {arr fp} {
}
if {$variables} {
set bindata [read $fp [expr 8 * $n_vars * $n_points]]
binary scan $bindata d[expr $n_vars * $n_points] data
for {set p 0} {$p < $n_points} { incr p} {
for {set v 0} {$v < $n_vars} { incr v} {
lappend var($idx($v)) [lindex $data [expr $p * $n_vars + $v]]
# puts "-->|$idx($v)|$var($idx($v))|"
if { $n_points == 1} {
binary scan $bindata d[expr $n_vars * $n_points] data
for {set p 0} {$p < $n_points} { incr p} {
for {set v 0} {$v < $n_vars} { incr v} {
lappend var($idx($v)) [lindex $data [expr $p * $n_vars + $v]]
# puts "-->|$idx($v)|$var($idx($v))|"
}
}
}
set var(n\ vars) $n_vars
@ -122,6 +124,7 @@ proc annotate {} {
} else break;
}
close $fp
puts {Raw file read ...}
if { $op_point_read } {
### disable screen redraw and undo when looping to speed up performance
### but save state on undo stack before doing backannotations.
@ -169,4 +172,4 @@ proc annotate {} {
}
}
if { ![info exists no_x] } {bind .drw <Alt-a> {annotate} }
if { ![info exists no_x] } {bind .drw <Alt-a> {puts {Annotating...}; annotate} }