Added WEB scripts
This commit is contained in:
parent
a6dc8d3836
commit
e3bdf5e967
15
logger.tcl
15
logger.tcl
|
@ -9,7 +9,6 @@ package require mysqltcl
|
||||||
|
|
||||||
# параметры соединения с СУБД
|
# параметры соединения с СУБД
|
||||||
|
|
||||||
#source config.tcl
|
|
||||||
#set db(host) "host"
|
#set db(host) "host"
|
||||||
#set db(user) "user"
|
#set db(user) "user"
|
||||||
#set db(pass) "password"
|
#set db(pass) "password"
|
||||||
|
@ -72,12 +71,18 @@ proc ParceString {line} {
|
||||||
InsertData
|
InsertData
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc Read {} {
|
||||||
|
global fh
|
||||||
|
if {[gets $fh line] >= 0} {
|
||||||
|
ParceString $line
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
proc PortDataRead {portName} {
|
proc PortDataRead {portName} {
|
||||||
global out_dir
|
global out_dir fh
|
||||||
set fh [open $portName RDONLY]
|
set fh [open $portName RDONLY]
|
||||||
fconfigure $fh -blocking 0 -buffering none -mode 9600,n,8,1 -translation crlf -eofchar {}
|
fconfigure $fh -blocking 0 -buffering line -mode 9600,n,8,1 -translation crlf -eofchar {}
|
||||||
fileevent $fh readable [list read $fh]
|
fileevent $fh readable Read
|
||||||
puts "Waiting for Capture data"
|
|
||||||
vwait forever
|
vwait forever
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user