- Adding first working version of new AMOR settings module
- Improved sls magnet driver
This commit is contained in:
32
makedspcodes
Executable file
32
makedspcodes
Executable file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/tclsh
|
||||
#----- little script which converts ukas Tanners error code header file into a
|
||||
#------ subroutine which converts into text
|
||||
|
||||
set f [open MessagesCodes.h r]
|
||||
|
||||
puts stdout "void slsdspCodeToText(int code, char *text, int textlen){"
|
||||
puts stdout " switch(code){"
|
||||
|
||||
proc tokenize {txt} {
|
||||
set l [split $txt]
|
||||
foreach w $l {
|
||||
if {[string length $w] > 1} {
|
||||
lappend result $w
|
||||
}
|
||||
}
|
||||
return $result
|
||||
}
|
||||
|
||||
while {[gets $f line] >= 0} {
|
||||
if {[string first "#define" $line] >= 0} {
|
||||
set l [tokenize $line]
|
||||
puts stdout " case [lindex $l 2]:"
|
||||
puts stdout " strncpy(text,\"[lindex $l 1]\",textlen);"
|
||||
puts stdout " break;"
|
||||
}
|
||||
}
|
||||
|
||||
puts stdout " }"
|
||||
puts stdout "}"
|
||||
close $f
|
||||
exit 0
|
Reference in New Issue
Block a user