Load drivers which have been enabled in the SICS config ini files.

Lakeshore 336 drivers with known IP addresses have been added to the ini files with unique IDs.
All entries in the ini files now have unique IDs
The wombat ini now has radio buttons to select sample stage motor configurations.
This commit is contained in:
Ferdi Franceschini
2014-05-05 12:20:53 +10:00
parent a52835379d
commit d7acb7c16c
13 changed files with 699 additions and 159 deletions

View File

@@ -1143,7 +1143,7 @@ proc createNode {scobj_hpath sct_controller cmdGroup varName readable writable p
# @param tempobj short name for the magnet power supply scriptcontext object (typ. ma1 or ma2)
# @param tol magentic field strength tolerance in Tesla (typ. 1)
# @return nothing (well, the sct object)
proc mk_sct_bruker_BEC1 {sct_controller klasse tempobj tol} {
proc mk_sct_bruker_BEC1 {sct_controller klasse tempobj tol CID CTYPE} {
set catch_status [ catch {
set ns ::scobj::bruker_BEC1
set ::scobj::bruker_BEC1::bruker_BEC1_sct_obj_name $tempobj
@@ -1323,6 +1323,8 @@ proc mk_sct_bruker_BEC1 {sct_controller klasse tempobj tol} {
#::scobj::hinitprops $tempobj/sensor nominal_outp_current
hsetprop $scobj_hpath/pwrctrl/statusByte control false
hsetprop $scobj_hpath/sensor/desired_current type drivable
hsetprop $scobj_hpath/sensor/desired_current permlink data_set ${CTYPE}${CID}SP1
hsetprop $scobj_hpath/sensor/measured_field permlink data_set ${CTYPE}${CID}S1
ansto_makesctdrive ${tempobj}_driveable $scobj_hpath/sensor/desired_current $scobj_hpath/sensor/nominal_outp_current $sct_controller
@@ -1346,7 +1348,7 @@ namespace export mk_sct_bruker_BEC1
# @param port port number on the moxabox (typ. 4001, 4002, 4003, or 4004)
# @param tol magnetic field strength tolerance in Tesla (default 0.1T)
# @return nothing (well, the sct object)
proc add_bruker_BEC1 {name IP port {_tol 0.1} } {
proc add_bruker_BEC1 {name IP port {_tol 0.1} {CID 1} {CTYPE B} } {
# Don't create a magnet controller for the script validator, this may cause the
# the BEC1 to lock up.
# NOTE: This is placed outside the catch block because "return" raises an exception
@@ -1358,10 +1360,30 @@ proc add_bruker_BEC1 {name IP port {_tol 0.1} } {
# Command terminator for Bruker unit is always carriage return without linefeed '\r'
makesctcontroller sct_bruker_BEC1_$name astvelsel ${IP}:$port "\r"
# proc mk_sct_bruker_BEC1 (sct_controller klasse tempobj tol)
mk_sct_bruker_BEC1 sct_bruker_BEC1_$name environment $name $_tol
mk_sct_bruker_BEC1 sct_bruker_BEC1_$name environment $name $_tol $CID $CTYPE
makesctemon $name /sics/$name/emon/mon_mode /sics/$name/emon/is_in_tolerance /sics/$name/emon/errhandler
} message ]
handle_exception $catch_status $message "In subroutine add_bruker_BEC1()."
}
if {[ catch {
if { [ info exists ::config_dict ] } {
dict for {secname secinfo} $::config_dict {
if { [dict exists $secinfo "driver"] && ([dict get $secinfo "driver"] == "bruker_bec1") } {
if { [ dict get $::secinfo enabled ] } {
set name [dict get $::secinfo name]
set IP [dict get $::secinfo ip]
set PORT [dict get $::secinfo port]
set tol [dict get $::secinfo tol]
set cid [dict get $::secinfo id]
set ctype [dict get $::secinfo type]
add_bruker_BEC1 $name $IP $PORT $tol $cid $ctype
}
}
}
}
} message ]} {
puts "ERROR: $message"
}
namespace import ::scobj::bruker_BEC1::*