better number formatting in backannotation. Alt-e if nothing selected opens another copy (tab/window) of current schematic (after warning)
This commit is contained in:
parent
e8b7714eca
commit
f73166efd1
|
|
@ -1137,8 +1137,11 @@ void schematic_in_new_window(void)
|
|||
rebuild_selected_array();
|
||||
if(xctx->lastsel !=1 || xctx->sel_array[0].type!=ELEMENT)
|
||||
{
|
||||
/* new_xschem_process("", 0); */
|
||||
new_xschem_process(xctx->sch[xctx->currsch], 0); /* 20111007 duplicate current schematic if no inst selected */
|
||||
if(tclgetvar("tabbed_interface")[0] == '1') {
|
||||
new_schematic("create", NULL, xctx->sch[xctx->currsch]);
|
||||
} else {
|
||||
new_xschem_process(xctx->sch[xctx->currsch], 0); /* 20111007 duplicate current schematic if no inst selected */
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -121,15 +121,17 @@ proc ngspice::get_current {n} {
|
|||
set n @$n
|
||||
}
|
||||
}
|
||||
puts "get_current: $n"
|
||||
set n i($n)
|
||||
# if { [regexp {\[} $n] } { set n \{$n\} }
|
||||
# puts "ngspice::get_current --> $n"
|
||||
set err [catch {set ::ngspice::ngspice_data($n)} res]
|
||||
if { $err } {
|
||||
set res {?}
|
||||
} else {
|
||||
set res [ format %.4g $res ]
|
||||
if { abs($res) <1e-3} {
|
||||
set res [ format %.4e $res ]
|
||||
} else {
|
||||
set res [ format %.4g $res ]
|
||||
}
|
||||
}
|
||||
# puts "$n --> $res"
|
||||
return $res
|
||||
|
|
@ -144,7 +146,11 @@ proc ngspice::get_voltage {n} {
|
|||
# puts "get_ngspice_node: $res"
|
||||
set res {?}
|
||||
} else {
|
||||
set res [ format %.4g $res ]
|
||||
if { abs($res) <1e-3} {
|
||||
set res [ format %.4e $res ]
|
||||
} else {
|
||||
set res [ format %.4g $res ]
|
||||
}
|
||||
}
|
||||
return $res
|
||||
}
|
||||
|
|
@ -154,12 +160,15 @@ proc ngspice::get_node {n} {
|
|||
set path [string range [xschem get sch_path] 1 end]
|
||||
# puts "ngspice::get_node --> $n, path=$path"
|
||||
set n [ subst -nocommand $n ]
|
||||
# if { [regexp {\[} $n] } { set n \{$n\} }
|
||||
set err [catch {set ::ngspice::ngspice_data($n)} res]
|
||||
if { $err } {
|
||||
set res {?}
|
||||
} else {
|
||||
set res [ format %.4g $res ]
|
||||
if { abs($res) <1e-3} {
|
||||
set res [ format %.4e $res ]
|
||||
} else {
|
||||
set res [ format %.4g $res ]
|
||||
}
|
||||
}
|
||||
return $res
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue