initial commit

This commit is contained in:
l_samenv
2022-08-18 15:04:28 +02:00
commit 46dcf8e77c
591 changed files with 69282 additions and 0 deletions

54
tcl/drivers/epc8210.tcl Normal file
View File

@@ -0,0 +1,54 @@
namespace eval epc8210 {} {
}
proc stdConfig::epc8210 {portlist} {
controller std "\n" 5 "'logout'"
prop write epc8210::write
obj EPC8210 rd -none
prop read epc8210::read
prop @portlist $portlist
kids "pumps/compressors" {
foreach {name i} $portlist {
node port$i out
prop enum 1
prop label $name
prop nr $i
if {$i % 4 == 1} {
prop newline 1
} else {
prop nonewline 1
}
}
}
}
proc epc8210::read {} {
sct send "\033"
return epc8210::update
}
proc epc8210::update {} {
set res [regsub -all {[^FN].*?O} [sct result] " O"]
foreach {name i} [sct @portlist] {
# clientput [sct @portlist]
set p [sct objectPath]/port[expr $i]
switch [lindex $res [expr $i -1] ] {
ON {updateval $p 1}
OFF {updateval $p 0}
}
}
return idle
}
proc epc8210::write {} {
set nr [sct nr]
if {[sct target]} {
set cmd 0x31
} else {
set cmd 0x32
}
set xor [expr $cmd ^ $nr]
sct send [format "%c%c%c%c%c" 0x80 $cmd $nr $xor 0x1B]
return epc8210::update
}