source $cfPath(counter)/counter_common_1.tcl ## TODO Put all the counter macros in the counter namespace namespace eval counter { variable isc_numchannels variable isc_monitor_address variable isc_portlist variable isc_beam_monitor_list variable isc_cm_address variable isc_cm_port proc set_sobj_attributes {} { } } proc ::counter::cm_initialize {} { if [ catch { variable isc_cm_address variable isc_cm_port set isc_cm_address 137.157.204.193 #set isc_cm_address localhost set isc_cm_port 33000 MakeAsyncQueue cmserver CAMERA $isc_cm_address $isc_cm_port MakeCounter cm1 anstocamera cmserver sicslist setatt cm1 privilege internal ::utility::macro::getset text cm1_mode {} { return [cm1 getmode] } sicslist setatt cm1_mode klass monitor sicslist setatt cm1_mode long_name mode sicslist setatt cm1_mode mutable false ::utility::macro::getset float cm1_preset {} { return [cm1 getpreset] } sicslist setatt cm1_preset klass monitor sicslist setatt cm1_preset long_name preset sicslist setatt cm1_preset mutable false ::utility::macro::getset int cm1_counts {} [subst -nocommands { return "[cm1 getcounts]" }] sicslist setatt cm1_counts klass monitor sicslist setatt cm1_counts long_name cm1_counts sicslist setatt cm1_counts mutable true ::utility::macro::getset float cm1_time {} [subst -nocommands { return "[cm1 gettime]" }] sicslist setatt cm1_time klass monitor sicslist setatt cm1_time long_name cm1_time sicslist setatt cm1_time mutable true } message ] { if {$::errorCode=="NONE"} {return $message} return -code error $message } } publish ::counter::cm_initialize user proc ::counter::isc_initialize {} { if [catch { variable isc_numchannels variable isc_monitor_address variable isc_portlist variable isc_beam_monitor_list {MONITOR_1 MONITOR_2 MONITOR_3} #set isc_monitor_address "das1-[SplitReply [instrument]]" #set isc_portlist [list 33000 33001 33002 33003 33004 33005 33006 33007] #set isc_numchannels [llength $isc_beam_monitor_list] #::counter::ic_initialize set isc_cm_address 137.157.204.193 set isc_cm_port 33000 ::counter::cm_initialize } message ] { if {$::errorCode=="NONE"} {return $message} return -code error "$message" } }