From: Ron F. <ro...@us...> - 2005-03-08 22:41:48
|
Update of /cvsroot/nscldaq/clients/ScalerDisplay In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24225/ScalerDisplay Modified Files: scaler.tcl Log Message: Make the scaler.tcl script sourcable into SpecTcl. Index: scaler.tcl =================================================================== RCS file: /cvsroot/nscldaq/clients/ScalerDisplay/scaler.tcl,v retrieving revision 4.3 retrieving revision 4.4 diff -C2 -d -r4.3 -r4.4 *** scaler.tcl 4 Mar 2005 17:35:18 -0000 4.3 --- scaler.tcl 8 Mar 2005 22:41:37 -0000 4.4 *************** *** 38,44 **** namespace import ::blt::stripchart set RunNumber Unknown set RunTitle Unknown ! set RunState Unknown set ElapsedRunTime 0 set ScalerDeltaTime 0 --- 38,54 ---- namespace import ::blt::stripchart + # The run state variable depends on whether or not + # we're running inside of SpecTcl or as a + # TclServer for ScalerClient: + + if {[info exists SpecTclHome]} { + set RunStateName ScalerRunState + } else { + set RunStateName RunState + } + set RunNumber Unknown set RunTitle Unknown ! set $RunStateName Unknown set ElapsedRunTime 0 set ScalerDeltaTime 0 *************** *** 468,474 **** proc Update {} { ! global RunState global stripchartWidget UpdateStatistics if {$stripchartWidget != ""} { --- 478,487 ---- proc Update {} { ! global RunStateName ! global $RunStateName global stripchartWidget + set State [set $RunStateName] + UpdateStatistics if {$stripchartWidget != ""} { *************** *** 476,480 **** } ! if {$RunState == "Active" } { DoUpdate } else { --- 489,493 ---- } ! if {$State == "Active" } { DoUpdate } else { *************** *** 858,862 **** proc SetupGui {top} { ! global RunNumber RunTitle RunState global HMStime ScalerDeltaTime set stat [frame $top.status] --- 871,877 ---- proc SetupGui {top} { ! global RunNumber RunTitle ! global RunStateName ! global $RunStateName global HMStime ScalerDeltaTime set stat [frame $top.status] *************** *** 883,887 **** label $state.sl -text "Run state: " ! label $state.state -textvariable RunState label $duration.atl -text "Length of run: " --- 898,902 ---- label $state.sl -text "Run state: " ! label $state.state -textvariable $RunStateName label $duration.atl -text "Length of run: " |