Modify legacy drivers so that they can be called by sct wrappers and define wrapper templates.

This commit is contained in:
Ferdi Franceschini
2014-07-15 00:30:17 +10:00
parent 6112c8afa0
commit 67b8576f35
24 changed files with 134 additions and 768 deletions

View File

@@ -122,12 +122,12 @@ close $fd
# @param cbFunc, this function will be called after the voltage reading has been updated
# NOTE: If the interval is negative then the multimeter will be polled on every cycle of
# the SICS task loop.
proc MakeProtek {name sctName {scale 1.0} {offset 0.0} {interval 0.5} {cbFunc "return idle"}} {
proc MakeProtek {name sctName CID CTYPE {scale 1.0} {offset 0.0} {interval 0.5} {cbFunc "return idle"}} {
set catch_status [ catch {
set sctName "sct_$name"
set sobjName "$name"
set soState "so_state_$name"
clientput "MakeSICSObj $sobjName SCT_OBJECT"
clientput "MakeSICSObj $soState SCT_OBJECT"
MakeSICSObj $soState SCT_OBJECT
sicslist setatt $sobjName long_name $sobjName
@@ -135,6 +135,7 @@ proc MakeProtek {name sctName {scale 1.0} {offset 0.0} {interval 0.5} {cbFunc "r
hsetprop /sics/$soState/state read rqStateRep
hsetprop /sics/$soState/state rdStateRep rdStateRep
hsetprop /sics/$soState/state oldval "UNKNOWN"
hsetprop /sics/$sobjName permlink data_set ${CTYPE}${CID}S1
hsetprop /sics/$sobjName read rqVal "reportVal"
hsetprop /sics/$sobjName reportVal ProtekMainDisplay /sics/$soState callBack
hsetprop /sics/$sobjName callBack $cbFunc