add drivers from l_samenv@samenv

This commit is contained in:
l_samenv
2022-08-22 14:59:00 +02:00
parent 0257120887
commit 078ab80814
18 changed files with 4167 additions and 0 deletions

46
tcl/drivers/mirror.tcl Normal file
View File

@ -0,0 +1,46 @@
# mirror defined list of parameters to a remote object (e.g. SECoP)
namespace eval mirror {
}
proc stdConfig::mirror {pars} {
controller syncedprot
variable node
pollperiod 0.25 0.25
obj MIRROR -text wr
default $pars
prop read mirror::update
prop write mirror::stdSct::completeUpdate
kids "mirror settings" {
}
}
proc mirror::update {} {
if {[catch {
set vpar [hval [sct]]
set pars [hlist $vpar]
set now [DoubleTime]
set timestamp 0
foreach par $pars {
if {$par ne "timestamp"} {
set par [string map {_ .} $par]
set value [get_var_value $par]
if {$value != [hval $vpar/$par]} {
hset $vpar/$par $value
set timestamp $now
}
}
}
if {$timestamp != 0} {
hset $vpar/timestamp $timestamp
}
} msg]} {
hset $vpar/timestamp [DoubleTime]
hupdate [sct]/status $msg
} else {
hupdate [sct]/status ""
}
return idle
}