78 lines
2.4 KiB
Tcl
78 lines
2.4 KiB
Tcl
# Defines the makeHdb<device> commands which create hipadaba nodes along
|
|
# with their read and write scripts. The makeHdb<device> commands are called
|
|
# by sourcing the hipadaba_configuration.tcl script when SICS is launched.
|
|
|
|
source ParList.tcl
|
|
|
|
# Common code for making Motor and ConfigurableVirtualMotor hdb scripts.
|
|
set hdbMakeAnyMotorScript {
|
|
append devPath $hpath "/" $treename
|
|
eval hmake $devPath spy none
|
|
foreach {ppName ppPriv ppType ppVal} $primaryProperty {
|
|
eval hmakescript "$devPath/$ppName" \"$sicsname\" \"run $sicsname\" $ppType;
|
|
}
|
|
foreach {name priv type value} $parList {
|
|
eval hmakescript "$devPath/$name" \"$sicsname $name\" \"$sicsname $name\" $type
|
|
}
|
|
}
|
|
|
|
# These commands make a hipadaba script in their devices namespace
|
|
proc ::deviceType::Motor::hdbMakeScript {hpath treename sicsname} {
|
|
variable parList;
|
|
variable primaryProperty;
|
|
global hdbMakeAnyMotorScript;
|
|
eval $hdbMakeAnyMotorScript;
|
|
}
|
|
|
|
proc ::deviceType::ConfigurableVirtualMotor::hdbMakeScript {hpath treename sicsname} {
|
|
variable parList;
|
|
variable primaryProperty;
|
|
global hdbMakeAnyMotorScript;
|
|
eval $hdbMakeAnyMotorScript;
|
|
}
|
|
|
|
proc ::deviceType::SingleCounter::hdbMakeScript {hpath treename sicsname} {
|
|
variable parList;
|
|
variable primaryProperty;
|
|
|
|
append devPath $hpath "/" $treename;
|
|
eval hmake $devPath spy none;
|
|
|
|
foreach {ppName ppPriv ppType ppVal} $primaryProperty {
|
|
eval hmakescript "$devPath/$ppName" \"$sicsname getcounts\" \"\" $ppType
|
|
}
|
|
|
|
foreach {name priv type value} $parList {
|
|
switch $name {
|
|
counting {
|
|
set cmd ::deviceType::SingleCounter::counting
|
|
eval hmakescript "$devPath/$name" \"\" \"$cmd $sicsname\" $type
|
|
}
|
|
default {
|
|
eval hmakescript "$devPath/$name" \"$sicsname $name\" \"$sicsname $name\" $type
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
# These commands will be called when the hipadaba configuration file is sourced
|
|
proc makeHdbMotor {hpath treename sicsname} {
|
|
::deviceType::Motor::hdbMakeScript $hpath $treename $sicsname;
|
|
}
|
|
|
|
proc makeHdbVirtMotor {hpath treename sicsname} {
|
|
::deviceType::ConfigurableVirtualMotor::hdbMakeScript $hpath $treename $sicsname;
|
|
}
|
|
|
|
proc makeHdbCounter {hpath treename sicsname} {
|
|
::deviceType::SingleCounter::hdbMakeScript $hpath $treename $sicsname;
|
|
}
|
|
|
|
#FIXME implement makeHdbHM
|
|
proc makeHdbHM {hpath treename sicsname} {
|
|
}
|
|
#------------------------------------------------------------------------
|
|
proc hdbReadOnly {} {
|
|
error "Parameter is READ ONLY"
|
|
}
|