sct_flipper.tcl

If the current, frequency or voltage readings are invalid then set the corresponding parameter in SICS to -1

r2970 | ffr | 2010-07-01 23:48:47 +1000 (Thu, 01 Jul 2010) | 3 lines
This commit is contained in:
Ferdi Franceschini
2010-07-01 23:48:47 +10:00
committed by Douglas Clowes
parent bbc133dab9
commit 39d25dcf95

View File

@@ -51,13 +51,28 @@ proc ::scobj::rfgen::mkStatArr {stateArrName stateReport} {
upvar $stateArrName stateArr
array set stateArr $stateReport
if {$stateArr(curr) != 0} {
set stateArr(curr) [string trimleft $stateArr(curr) 0]
set val [string trimleft $stateArr(curr) 0]
if {[string is integer $val]} {
set stateArr(curr) $val
} else {
set stateArr(curr) -1
}
}
if {$stateArr(freq) != 0} {
set stateArr(freq) [string trimleft $stateArr(freq) 0]
set val [string trimleft $stateArr(freq) 0]
if {[string is integer $val]} {
set stateArr(freq) $val
} else {
set stateArr(freq) -1
}
}
if {$stateArr(voltage) != 0} {
set stateArr(voltage) [string trimleft $stateArr(voltage) 0]
set val [string trimleft $stateArr(voltage) 0]
if {[string is integer $val]} {
set stateArr(voltage) $val
} else {
set stateArr(voltage) -1
}
}
}