From: Ron F. <ro...@us...> - 2004-09-03 17:56:49
|
Update of /cvsroot/nscldaq/clients/ScalerDisplay In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32678 Modified Files: Tag: daqclients-7_4_development scaler.tcl Log Message: Remove divide by zero possibility for >very< short runs. Index: scaler.tcl =================================================================== RCS file: /cvsroot/nscldaq/clients/ScalerDisplay/Attic/scaler.tcl,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** scaler.tcl 3 Sep 2004 17:50:08 -0000 1.1.2.6 --- scaler.tcl 3 Sep 2004 17:56:39 -0000 1.1.2.7 *************** *** 110,113 **** --- 110,116 ---- global IntervalCount + if {($ElapsedRunTime == 0) || ($IntervalCount == 0)} { + return 0 + } *************** *** 233,237 **** if {$channel != $Fakename} { set id $ScalerMap($channel) ! set Average [expr $Scaler_Totals($id)/$ElapsedRunTime] set sigma [StdDev $id] catch {set line [format $fmt $channel $Scaler_Totals($id) $Average $sigma]} --- 236,244 ---- if {$channel != $Fakename} { set id $ScalerMap($channel) ! if {$ElapsedRunTime != 0} { ! set Average [expr $Scaler_Totals($id)/$ElapsedRunTime] ! } else { ! set Average 0 ! } set sigma [StdDev $id] catch {set line [format $fmt $channel $Scaler_Totals($id) $Average $sigma]} |