@@ -187,7 +187,7 @@ proc config {} {
187
187
exit 1
188
188
}
189
189
190
- set ::LH(title) " $::argv0 $::LH(note,txt) "
190
+ set ::LH(title) " $::argv0 "
191
191
wm title . $::LH(title)
192
192
193
193
foreach thd $::LH(threads) {
@@ -226,14 +226,10 @@ proc other_info {} {
226
226
}
227
227
set linuxcncversion [exec linuxcnc_var LINUXCNCVERSION]
228
228
return " \
229
- $::LH(date) \
230
- [ exec hostname] \
231
229
$::tcl_platform(machine) \
232
230
$::tcl_platform(osVersion) \
233
231
$linuxcncversion \
234
232
$display \
235
- $::tcl_platform(user) \
236
- $::LH(note,txt) \
237
233
"
238
234
} ;# other_info
239
235
@@ -340,10 +336,18 @@ proc load_packages {} {
340
336
proc make_gui { {w .} } {
341
337
set f [frame ${w} fa]
342
338
pack $f -side top -fill x -expand 1
343
- pack [label $f .l -anchor w -text $::LH(info) ] -fill x -expand 1
339
+ set hname [exec hostname]
340
+ set user $::tcl_platform(user)
341
+ pack [label $f .l -anchor w \
342
+ -text " $::LH(date) $hname $user $::LH(note,txt) "
343
+ ] -fill x -expand 1
344
344
345
345
set f [frame ${w} fb]
346
346
pack $f -side top -fill x -expand 1
347
+ pack [label $f .l -anchor w -text $::LH(info) ] -fill x -expand 1
348
+
349
+ set f [frame ${w} fc]
350
+ pack $f -side top -fill x -expand 1
347
351
pack [label $f .l -anchor w -text $::LH(processor) ] -fill x -expand 1
348
352
349
353
set fmain [frame ${w} fmain]
@@ -369,8 +373,29 @@ proc make_gui { {w .} } {
369
373
xaxis $thd
370
374
$::LH(w,$thd) axis configure y -logscale $::LH(y,logscale)
371
375
376
+ set f [frame $f1 .extra12]
377
+ pack $f -side top -anchor w -fill x -expand 1
378
+
379
+ pack [label $f .min -text " min (us)" ] \
380
+ -side left -anchor e
381
+ set e [entry $f .emin -textvariable ::LH($thd ,latency_min,us) \
382
+ -state readonly -justify right -width 9]
383
+ pack $e -side left -anchor e
384
+
385
+ pack [label $f .sdev -text " sdev (us):" ] \
386
+ -side left
387
+ set e [entry $f .esdev -textvariable ::LH($thd ,latency_sdev,us) \
388
+ -state readonly -justify right -width 9]
389
+ pack $e -side left -anchor e
390
+
391
+ set e [entry $f .emax -textvariable ::LH($thd ,latency_max,us) \
392
+ -state readonly -justify right -width 9]
393
+ pack $e -side right -anchor e
394
+ pack [label $f .max -text " max(us)" ] \
395
+ -side right -anchor e
396
+
372
397
if $::LH(opt,show) {
373
- set f [frame $f1 .extra ]
398
+ set f [frame $f1 .extra2 ]
374
399
pack $f -side top -anchor w -fill x -expand 1
375
400
set e [entry $f .emin -textvariable ::LH($thd ,n,more) \
376
401
-state readonly -justify right -width 9]
@@ -511,6 +536,9 @@ proc reset_data {} {
511
536
set ::LH($thd ,nextra) 0
512
537
set ::LH($thd ,p,more) 0
513
538
set ::LH($thd ,n,more) 0
539
+ set ::LH($thd ,latency_min,us) " "
540
+ set ::LH($thd ,latency_max,us) " "
541
+ set ::LH($thd ,latency_sdev,us) " "
514
542
}
515
543
after 100
516
544
foreach thd $::LH(threads) {
@@ -647,10 +675,9 @@ proc update_chart {thd} {
647
675
set pbin [hal getp $::LH($thd,name) .pbinvalue]
648
676
set nbin [hal getp $::LH($thd,name) .nbinvalue]
649
677
650
- # verify index in range
651
- # if { ($pbin < 0) || ($nbin < 0) } {
652
- # puts stderr "Unexpected: thd=$thd index=$bin pbin=$pbin, nbin=$nbin"
653
- # }
678
+ # 1.1 value makes single unit bins show as pips when using log y scale:
679
+ if {$pbin == 1} {set pbin 1.1}
680
+ if {$nbin == 1} {set nbin 1.1}
654
681
655
682
lappend pxd [expr $bin * $::LH($thd,binsize,us) ]
656
683
lappend pyd $pbin
@@ -664,6 +691,19 @@ proc update_chart {thd} {
664
691
}
665
692
} ;# for bin
666
693
694
+ set ::LH($thd ,latency_min,us) [format %.1f \
695
+ [expr 1e-3 * [hal getp $::LH($thd,name) .latency-min]]]
696
+ set ::LH($thd ,latency_max,us) [format %.1f \
697
+ [expr 1e-3 * [hal getp $::LH($thd,name) .latency-max]]]
698
+
699
+ set variance [hal getp $::LH($thd,name) .variance]
700
+ if [catch {
701
+ set ::LH($thd ,latency_sdev,us) [format %.1f \
702
+ [expr 1e-3 * sqrt($variance )]]
703
+ } msg] {
704
+ puts msg=$msg
705
+ }
706
+
667
707
set ::LH($thd ,pextra) [hal getp $::LH($thd,name) .pextra]
668
708
set ::LH($thd ,p,more) [expr $pmore + $::LH($thd,pextra) ]
669
709
0 commit comments