Merge branch 'master' of gitlab.psi.ch-samenv:samenv/sea

This commit is contained in:
l_samenv
2023-10-26 10:05:55 +02:00
10 changed files with 51 additions and 66 deletions

2
.gitignore vendored
View File

@ -33,6 +33,7 @@ CVS
/focus
/hifi
/hrpt
/hrpt2
/morpheus
/poldi
/ppms
@ -40,6 +41,7 @@ CVS
/seaman
/tasp
/zebra
/zebra2
/logger_tar
cheat_chart
tcl/stuff_before_2022

View File

@ -1,54 +1,13 @@
stickDesc = 100 mm dilution
deviceDesc = DIL5 Frappy history recorder
set box linse-dil5
set ::secop_version 4
proc triton {kind obj name db col {htrdb ""}} {
upvar box box
makenv $obj -driver itc$kind -port ${box}:33576 -controller _tritondil $db $htrdb
switch $kind {
temp {
GraphAdd $obj K_3 T_$name
# GraphAdd $obj.raw Ohm_3 R_$name
}
press {
GraphAdd $obj mbar_2 p_$name
}
}
set ins [result instrument]
if {[string match "prep*" $ins]} {
set nr [string range $ins end end]
makenv frappy_stick -driver secop -port localhost:1521$nr
} elseif {[lindex [split [info hostname] .] 0] ne $ins} {
error "runs on instruments or prep0-9 only"
} else {
makenv frappy_stick -driver secop -port localhost:15201
}
proc itcchan {obj name dbt dbh col setcol} {
upvar box box
makenv $obj -driver itctemp -port ${box}:3000 -controller _itcdil ${dbt}.T1 ${dbh}.H1
GraphAdd $obj K_5 T_$name
GraphAdd $obj.set K_5 T_${name}_set $setcol
# GraphAdd $obj.pow W_3 pow_$name
# GraphAdd $obj.raw Ohm_3 R_$name
}
itcchan twstill wupstill MB1 MB0 blue cyan
itcchan tonek oneK DB5 DB3 red orange
itcchan twmix wupMix DB6 DB1 green lightgreen
itcchan twivc wupIVC DB7 DB2 magenta violet
itcchan tcond cond DB8 DB3 yellow grey
triton temp tsorb sorb T1 dark_violet
triton temp tivc IVC T2 brown
triton temp tstill still T3 orange
triton temp tcp cond T4 grey
triton temp tmix mix T5 cyan H1
triton press pdump dump P1 cyan
triton press pcond cond P2 blue
triton press pstill still P3 black
triton press pfore fore P4 green
triton press pback back P5 red
makenv tmixdrv -driver drvpar /tmix
defineTemperature tmixdrv

View File

@ -181,7 +181,7 @@ proc ccu4ext::fillExt {type} {
set rdpath [hvali [sct]/readpath]
set level [hvali $rdpath]
set levelerror [silent "" hgetpropval $rdpath geterror]
if {$levelerror ne "" && $errtxt eq ""} {
if {$levelerror ne "" && $errtxt eq "" && [hvali [sct]] < 2} {
set errtxt "$txt ($rdpath $levelerror)"
}
if {$errtxt eq ""} {

View File

@ -404,11 +404,12 @@ proc hepump::get_auto {} {
if {$auto && $oldeco != 2} {
set eco [sctval [sct parent]/eco]
set lim [sctval [sct parent]/eco_t_lim 7]
set target [silent [silent $lim hval /tt/target] hval /tt/set/reg]
if {[silent 0 result nv use_pressure]} {
set ecoset 0
} elseif {[silent 10 hval /tt/target] < $lim && [silent 10 hval /tt] < 2 * $lim} {
} elseif {$target < $lim && [silent $lim hval /tt] < 2 * $lim} {
set ecoset 0
} elseif {[silent 10 hval /tt/target] > $lim || [silent 10 hval /tt] > 3 * $lim} {
} elseif {$target > $lim || [silent $lim hval /tt] > 3 * $lim} {
set ecoset 1
} else {
set ecoset $eco

View File

@ -895,7 +895,7 @@ proc lsc::set_curve {} {
}
#write action, direct
proc lsc::check_header {id} {
proc lsc::check_header {{id unknown}} {
upvar #0 lsc::cache_$id cache
if {[lsc::hdreq $cache([sct curveno]) [sct result]]} {
sct oldhdr [sct result]
@ -2950,7 +2950,9 @@ proc lsc::check_set {} {
}
if {[silent 0 sct internalset] eq "0"} {
if {[silent 0 sct setmaintarget] ne "0"} {
eval "[sct setmaintarget] $target"
if {[catch {eval "[sct setmaintarget] $target"} msg]} {
clientlog "WARNING: $msg"
}
}
}
if {$target == 0} {
@ -4626,6 +4628,7 @@ proc stdConfig::lsc_end {} {
if {$lsc(samplesensor) eq ""} {
set lsc(samplesensor) $lsc(mainsensor)
}
dolater 0 fix_stick_sensors
hsetprop $path getcmd "hvali $path/$lsc(mainsensor)"
hsetprop $path getsample "hvali $path/$lsc(samplesensor)"
if {[silent "" set lsc(setsample)] ne ""} {

View File

@ -18,7 +18,7 @@ makeCCU4 ma10 nv_release_blocked he_ilm
hefill minfillminutes 20
hefill maxfillminutes 60
hupdate /nv/set 1.8
hupdate /nv/set 1.2
makenv mf -driver ipsmag -port ma10-ts:3001 -controller _mf

View File

@ -5,11 +5,11 @@ device stick_menu "ma6 dil2 dil3 dil4 coil"
makenv tt -driver [lsdriver] {
lsc_sensor tm A -sensor x48581 -sensorname VTI
lsc_sensor ts C -sensorname sample
lsc_sensor ts_2 D -sensor code -sensorname sample2
# 2023-07-06: sample sensor seems defect, use hx sensor
# lsc_sensor ts C -sensorname sample
# lsc_sensor ts_2 D -sensor code -sensorname sample2
lsc_sensor ts D -sensorname sample
lsc_sensor ts_2 C -sensor code -sensorname sample2
# lsc_sensor ts D -sensorname sample
# lsc_sensor ts_2 C -sensor code -sensorname sample2
lsc_loop set -loop 1 -channel A -maxheater 32W -resist 80Ohm -color green
if {[lsdriver] eq "336_lsc"} {
lsc_loop setsamp -loop 2 -channel C -maxheater 62.5W -resist 20Ohm -color dark_green -loopname sample
@ -20,7 +20,7 @@ makenv tt -driver [lsdriver] {
makeCCU4 ma6 nv he_ilm
hupdate /nv/set 1.2
hupdate /nv/set 1.5
makeN2Fill ccu4ilm {
ln2fill lowlevel 10
ln2fill highlevel 100

View File

@ -1,4 +1,4 @@
stickDesc = standard MA6 stick
stick_sensors x63163 undefined
# stick_sensors x63161 x63163
stick_sensors x63161 undefined
#stick_sensors x63161 x63163 # sensor 2 wiring defect

View File

@ -628,7 +628,7 @@ proc stick_sensors {sensor1 sensor2} {
source config/stick.list
if {[string match "code*" $sensor2]} {
set code [lindex [split $sensor2=0 =] 1]
set table_code [silent -1 set stick_cfgtable($stick_name)]
set table_code [silent 0 set stick_cfgtable($stick_name)]
if {$table_code != $code} {
clientput "ERROR: code $code in $stick_name.stick does not match value from config/sticklist: $table_code"
}
@ -652,6 +652,16 @@ proc stick_sensors {sensor1 sensor2} {
}
}
proc fix_stick_sensors {} {
# fix stick sensors
foreach path {/tt/ts/curve /tt/ts_2/curve} {
set curv [silent "" sctval $path]
if {$curv ne ""} {
hset $path $curv
}
}
}
proc ts_sensor {sensor} {
catch {
catch {

View File

@ -30,7 +30,17 @@ proc flow::loop {difget flowget flowset path flowstd flowlim} {
set flowtarget $setval
}
putIntoLimits flowtarget $flowstd $flowlim
hupdate $path/flowtarget $flowtarget
set suppress_auto [silent 0 sct suppress_auto]
if {$suppress_auto || $flowtarget > ($flowstd + $flowlim) * 0.5} {
sct suppress_auto 0
hupdate $path/flowtarget $flowtarget
} else {
if {$flowtarget < $flowstd + 0.1} {
sct suppress_auto 1
} else {
hupdate $path/flowtarget $flowtarget
}
}
}
proc flow::bufferPut {path name var value} {