use 5 significant digits in graph (time) measures

This commit is contained in:
Stefan Frederik 2022-06-29 11:47:10 +02:00
parent 0c9abf15aa
commit c9d16d6008
3 changed files with 9 additions and 12 deletions

View File

@ -337,9 +337,9 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
xval = G_X(xctx->mousex);
if(xctx->graph_sim_type == 3) xval = pow(10, xval);
if(gr->unitx != 0)
my_snprintf(sx, S(sx), "%.4g%c", gr->unitx * xval, gr->unitx_suffix);
my_snprintf(sx, S(sx), "%.5g%c", gr->unitx * xval, gr->unitx_suffix);
else
my_snprintf(sx, S(sx), "%.4g", xval);
my_snprintf(sx, S(sx), "%.5g", xval);
if(gr->unitx != 0)
my_snprintf(sy, S(sy), "%.4g%c", gr->unity * yval, gr->unity_suffix);

View File

@ -2089,9 +2089,9 @@ static void draw_cursor(double active_cursorx, double other_cursorx, int cursor_
drawline(cursor_color, NOW, xx, gr->ry1, xx, gr->ry2, 1);
if(xctx->graph_sim_type == 3) active_cursorx = pow(10, active_cursorx);
if(gr->unitx != 1.0)
my_snprintf(tmpstr, S(tmpstr), "%.4g%c", gr->unitx * active_cursorx , gr->unitx_suffix);
my_snprintf(tmpstr, S(tmpstr), "%.5g%c", gr->unitx * active_cursorx , gr->unitx_suffix);
else
my_snprintf(tmpstr, S(tmpstr), "%.4g", active_cursorx);
my_snprintf(tmpstr, S(tmpstr), "%.5g", active_cursorx);
text_bbox(tmpstr, txtsize, txtsize, 2, flip, 0, 0, xx + xoffs, gr->ry2-1, &tx1, &ty1, &tx2, &ty2, &tmp, &dtmp);
filledrect(0, NOW, tx1, ty1, tx2, ty2);
draw_string(cursor_color, NOW, tmpstr, 2, flip, 0, 0, xx + xoffs, gr->ry2-1, txtsize, txtsize);

View File

@ -259,8 +259,8 @@ proc execute_fileevent {id} {
# nonblocking close always succeed
close $execute(pipe,$id)
}
if {[info exists execute(callback,$id)]} {
eval $execute(callback,$id)
if {[info exists execute(callback,$id)] && $execute(callback,$id) ne {}} {
uplevel #0 "eval $execute(callback,$id)"
unset execute(callback,$id)
}
unset execute(pipe,$id)
@ -1178,7 +1178,7 @@ proc simulate {{callback {}}} {
if {$OS == "Windows"} {
# $cmd cannot be surrounded by {} as exec will change forward slash to backward slash
if { $callback ne {} } {
eval $callback
uplevel #0 "eval $callback"
}
#eval exec {cmd /V /C "cd $netlist_dir&&$cmd}
eval exec $cmd &
@ -4542,7 +4542,7 @@ set tctx::global_list {
only_probes path pathlist persistent_command preserve_unchanged_attrs prev_symbol ps_colors rainbow_colors
rawfile_loaded rcode recentfile replace_key retval retval_orig rotated_text save_initialfile search_exact
search_found search_schematic search_select search_value selected_tok show_hidden_texts show_infowindow
show_pin_net_names simconf_default_geometry simconf_vpos
show_pin_net_names simconf_default_geometry simconf_vpos
spiceprefix split_files svg_colors svg_font_name symbol symbol_width sym_txt tclcmd_txt tclstop
text_line_default_geometry textwindow_fileid textwindow_filename textwindow_w tmp_bus_char
toolbar_horiz toolbar_visible top_subckt transparent_svg undo_type
@ -4628,10 +4628,7 @@ proc housekeeping_ctx {} {
}
proc simulate_button {button_path} {
if { [set simulate_bg [$button_path cget -bg]] ne {red} } {
$button_path configure -bg red
simulate "$button_path configure -bg $simulate_bg"
}
simulate
}
proc set_bindings {topwin} {