SICS-294 anstohttp.c
Histmem now only calls TaskYield after SICS has finished initalising, this stops the statusfile task from being called early and overwriting the status file. Created ANSTO_MakeHistMemory command to install ANSTO_HistAction Added veto functions. Mapped the HistDriver interface Pause() and Continue() commands to AnstoHttpVeto and AnstoHttpNoVeto. Implemented an ANSTO_Histaction to call AnstoHttpPause when sent a "pause" subcommand. hmcontrol_ansto.c Call AnstoHttpPause() directly when Pause_HM_After_Count is set to preserver current behaviour. counterdriv.c Now sends the correct "SICS RESUME" command to resume a paused count. ansto_sctdriveadapter.c NEW This lets you create driveable objects from script-context controllers which have one node for setting a parameter and another node for reading the parameter (eg temperature controllers, choppers, velocity selectors) sctemonadapter.c NEW This generates an environment monitor interface for script-context controllers so that the emon object in SICS will be able to pause counters if the controller goes out of tolerance. sct_usbtmcprot.c, usbtmc.h NEW First attempt at a protocol handler for USB Test and Measurement Class devices sct_julabo_lh45.tcl NEW Implements script-context controller for the Julabo LH45 temperature controller. Makefile Added ansto_sctdriveadapter and sctemonadapter hardsup/makefile Added velocity selector and usbtmc protocol handlers hardsup/sct_velselprot.c Simplified, don't worry about trying to implement a login handler for now, just implement a "Reading" handler. site_ansto.c Add the velocity selector and USBTMC protocol handlers. Added the ANSTO_MakeHM command instrument/config/hipadaba/common_instrument_dictionary.tcl Added support for auxiliary data, ie extra meta-data entries in the "data" group of the nexus file. Add new NXvelocity_selector object under /instrument. instrument/config/hipadaba/hipadaba_configuration_common.tcl Add the new "sct_object" script-context controller objects to the hdb tree. instrument/config/hipadaba/instdict_specification.tcl Define the new sct_object controllers. instrument/config/hmm/hmm_configuration_common_1.tcl Use the new ANSTO_MakeHM command to create histmem drivers which support veto. Define allowed attributes and elements for the BAT_TABLE and FAT_TABLE Stop between counts instead of pausing because setting pause now sends a veto. instrument/config/motors/sct_jogmotor_common.tcl You now need to specify klass when creating a jogmotor. instrument/config/motors/sct_positmotor_common.tcl You can now specify an optional function which calculates the instrument parameter (eg attenuation) from a posit table entry when defining a posit motor. instrument/config/nexus/nxscripts_common_1.tcl Report file status info in the /experiment section of the hdb tree. Add auxiliary data to data file. Handle saving data from script-context controller objects. instrument/util/script_context_util.tcl Added procedure to set required properties for saving script-context object data. instrument/util/utility.tcl Added set_sct_object_attributes proc to automatically set required attributes on SCT_OBJECTs Fixed hlistplainprop to deal with empty property fields on hdb nodes. instrument/server_config.tcl Call the new nexus initialisation command and set attributes on sct objects. hrpd/config/motors/motor_configuration.tcl New absenc home readings for mchi and mphi. New absenc home and range for mf1 hipd/config/commands/commands.tcl Exported and published the new ajscmds so that they can be used in batch files. hipd/config/motors/motor_configuration.tcl New mchi absenc home rsd/config/hmm/hmm_configuration.tcl Provide support for saving corrected hmm data rsd/config/motors/motor_configuration.tcl Use simple names for motors. SICS-329 sans/config/INSTCFCOMMON.TXT Added julabo and lakeshore configuration files to list. sans/config/optics/guide_configuration.tcl Added entrance aperture positions to the configuration table and the cn_maps which map the index to the component ID. sans/commands/commands.tcl The "guide" command now set EApPosYmm after driving the guides in place. The indexed position to component maps (cn_map) have been moved to the guide_configuration.tcl file. sans/motors/motor_configuration.tcl Set samy home to 56.1mm sans/config/velsel/sct_velsel.tc NEW Implements script-context controller object for the NVS40 velocity selector. TODO tilt-angle control, driveable interface. sans/config/hmm/hmm_configuration.tcl Set 5.08mm spacing on detector width. Use pixel-offset for vertical and horizontal detector axes. sans/config/motors/motor_configuration.tcl Swap directions of beamstops 4 and 5 (the two smallest) New config parameters for samx, samthet, apx, det, detoff, bsz, sans/config/motors/positmotor_configuration.tcl Added descriptive headers to positmotor configuration tables and new synstax for the make positmotor command. sans/config/nexus/nxscripts.tcl Implemented initialisation command. sans/config/parameters/parameters.tcl Added SampleThickness and TransmissionFlag. Calculate SamplePosYmm from samy and SamyOffsetmm. Added beamstops to hdb tree. reflectometer/config/nexus/nxscripts.tcl Implement the initialisation procedure. r2767 | ffr | 2009-03-31 10:16:54 +1100 (Tue, 31 Mar 2009) | 123 lines
This commit is contained in:
committed by
Douglas Clowes
parent
eec824f98a
commit
d2f57e4615
191
site_ansto/instrument/sans/config/velsel/sct_velsel.tcl
Normal file
191
site_ansto/instrument/sans/config/velsel/sct_velsel.tcl
Normal file
@@ -0,0 +1,191 @@
|
||||
##
|
||||
# @file
|
||||
# The velocity selector control is split into two objects,
|
||||
# 1. velsel_poller: This object polls the velocity selector to get its
|
||||
# current state.
|
||||
# 2. velsel: This object provides manages a set of status nodes which
|
||||
# correspond to the state parameters read by the velsel_poller object.
|
||||
# It also provides commands to set the speed and angle for the velocity
|
||||
# selector.
|
||||
|
||||
# Test by adding the following to barebones.tcl
|
||||
# InstallHdb
|
||||
# source config/velsel/sct_velsel.tcl
|
||||
# hfactory /velsel link velsel
|
||||
|
||||
# The velocity selector doesn't close client connections
|
||||
# if the connection is broken. It only closes the connection
|
||||
# when a client logs off with "#SES#bye", NOTE bye must be lowercase.
|
||||
|
||||
makesctcontroller sct_velsel astvelsel 137.157.202.73:10000 "" 10
|
||||
sct_velsel transact "NVS"
|
||||
sct_velsel transact "NVS"
|
||||
|
||||
namespace eval ::scobj::velsel {
|
||||
variable paramindex
|
||||
variable paramtype
|
||||
variable pollrate
|
||||
set pollrate 7
|
||||
|
||||
array set paramindex {
|
||||
state 0
|
||||
rspeed 1
|
||||
aspeed 2
|
||||
sspeed 3
|
||||
aveto 4
|
||||
ploss 5
|
||||
splos 6
|
||||
ttang 7
|
||||
rtemp 8
|
||||
wflow 9
|
||||
winlt 10
|
||||
woutt 11
|
||||
vacum 12
|
||||
wvalv 13
|
||||
vvalv 14
|
||||
vibrt 15
|
||||
bcuun 16
|
||||
}
|
||||
array set paramtype {
|
||||
state text
|
||||
rspeed float
|
||||
aspeed float
|
||||
sspeed float
|
||||
aveto text
|
||||
ploss float
|
||||
splos float
|
||||
ttang float
|
||||
rtemp float
|
||||
wflow float
|
||||
winlt float
|
||||
woutt float
|
||||
vacum float
|
||||
wvalv text
|
||||
vvalv text
|
||||
vibrt float
|
||||
bcuun float
|
||||
}
|
||||
MakeSICSObj velsel_poller SCT_OBJECT
|
||||
MakeSICSObj velsel SCT_OBJECT
|
||||
sicslist setatt velsel klass NXvelocity_selector
|
||||
sicslist setatt velsel long_name velsel
|
||||
|
||||
##
|
||||
# @brief Request a state report from the velocity selector
|
||||
proc getStatus {} {
|
||||
sct send "#SOS#STATE "
|
||||
return rdStatus
|
||||
}
|
||||
|
||||
##
|
||||
# @brief Read the current state report from the velocity selector.
|
||||
proc rdStatus {} {
|
||||
set data [sct result]
|
||||
if {$data != [sct oldval]} {
|
||||
sct oldval $data
|
||||
set status [lrange [split $data "#"] 3 end-1]
|
||||
sct update $status
|
||||
sct utime readtime
|
||||
}
|
||||
return idle
|
||||
}
|
||||
|
||||
##
|
||||
# @brief This dummy read command forces a transition to a state which
|
||||
# will update a parameter from the current status.
|
||||
proc getpar {nextstate} {
|
||||
return $nextstate
|
||||
}
|
||||
|
||||
proc noResponse {} {
|
||||
sct result
|
||||
return idle
|
||||
}
|
||||
##
|
||||
# @brief Looks up a parameter in the current status and updates the
|
||||
# parameter node.
|
||||
# @param statuspath, path to the poller object's status node.
|
||||
# @param parindex, index of the required parameter
|
||||
proc updatepar {statuspath parindex} {
|
||||
set data [lindex [hval $statuspath] $parindex end]
|
||||
if {$data != [sct oldval]} {
|
||||
sct oldval $data
|
||||
sct update $data
|
||||
sct utime readtime
|
||||
}
|
||||
return idle
|
||||
}
|
||||
|
||||
proc setSpeed {nextState} {
|
||||
set speed [format "%5d" [sct target]]
|
||||
sct send "#SOS#SPEED $speed"
|
||||
return $nextState
|
||||
}
|
||||
|
||||
proc setState {nextState} {
|
||||
set state [string tolower [sct target]]
|
||||
switch $state {
|
||||
"idle" {
|
||||
sct send "#SOS#IDLE "
|
||||
}
|
||||
"brake" {
|
||||
sct send "#SOS#BRAKE "
|
||||
}
|
||||
default {
|
||||
return idle
|
||||
}
|
||||
}
|
||||
return $nextState
|
||||
}
|
||||
|
||||
|
||||
hfactory /sics/velsel_poller/status plain internal text
|
||||
hsetprop /sics/velsel_poller/status read ::scobj::velsel::getStatus
|
||||
hsetprop /sics/velsel_poller/status rdStatus ::scobj::velsel::rdStatus
|
||||
hsetprop /sics/velsel_poller/status oldval UNKNOWN
|
||||
|
||||
sct_velsel poll /sics/velsel_poller/status $pollrate halt read
|
||||
hfactory /sics/velsel/LambdaA plain user float
|
||||
hfactory /sics/velsel/LambdaResFWHM_percent plain user float
|
||||
|
||||
foreach par [lsort [array names paramindex]] {
|
||||
hfactory /sics/velsel/$par plain spy $paramtype($par)
|
||||
hsetprop /sics/velsel/$par read ::scobj::velsel::getpar rdpar
|
||||
hsetprop /sics/velsel/$par rdpar ::scobj::velsel::updatepar /sics/velsel_poller/status $paramindex($par)
|
||||
hsetprop /sics/velsel/$par oldval UNKNOWN
|
||||
sct_velsel poll /sics/velsel/$par $pollrate
|
||||
}
|
||||
|
||||
hfactory /sics/velsel/setspeed plain spy $paramtype($par)
|
||||
hsetprop /sics/velsel/setspeed write ::scobj::velsel::setSpeed ignore
|
||||
hsetprop /sics/velsel/setspeed ignore ::scobj::velsel::noResponse
|
||||
sct_velsel write /sics/velsel/setspeed
|
||||
|
||||
hfactory /sics/velsel/setstate plain spy $paramtype($par)
|
||||
hsetprop /sics/velsel/setstate write ::scobj::velsel::setState ignore
|
||||
hsetprop /sics/velsel/setstate ignore ::scobj::velsel::noResponse
|
||||
sct_velsel write /sics/velsel/setstate
|
||||
|
||||
::scobj::hinitprops velsel
|
||||
hsetprop /sics/velsel klass NXvelocity_selector
|
||||
hsetprop /sics/velsel privilege spy
|
||||
hsetprop /sics/velsel type part
|
||||
::scobj::set_required_props /sics/velsel
|
||||
foreach {hpath klass priv alias} {
|
||||
LambdaA parameter user velsel_lambdaa
|
||||
LambdaResFWHM_percent parameter user velsel_lambdaresfwhm_percent
|
||||
rspeed parameter user velsel_rspeed
|
||||
aspeed parameter user velsel_aspeed
|
||||
ttang parameter user velsel_ttang
|
||||
} {
|
||||
hsetprop /sics/velsel/$hpath nxalias $alias
|
||||
hsetprop /sics/velsel/$hpath klass $klass
|
||||
hsetprop /sics/velsel/$hpath privilege $priv
|
||||
hsetprop /sics/velsel/$hpath control true
|
||||
hsetprop /sics/velsel/$hpath data true
|
||||
hsetprop /sics/velsel/$hpath nxsave true
|
||||
hsetprop /sics/velsel/$hpath mutable true
|
||||
hsetprop /sics/velsel/$hpath sdsinfo ::nexus::scobj::sdsinfo
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user