From 1d6917a782f16637cbb0017df6fbb72a1d1a97c3 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Wed, 31 Aug 2011 21:47:43 +0000 Subject: [PATCH] changes for rs git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@328 2a923420-c742-0410-a762-8d5b09965624 --- var/mongoose/include/restart.jim | 2 +- var/mongoose/include/sched.jim | 4 ++-- var/mongoose/lib/findhsvc | 41 ++++++++++++++++++++++++++++++++ var/mongoose/lib/rsv.class | 21 +++++++++++++++- 4 files changed, 64 insertions(+), 4 deletions(-) create mode 100755 var/mongoose/lib/findhsvc diff --git a/var/mongoose/include/restart.jim b/var/mongoose/include/restart.jim index 3483b31c..c4efc46c 100755 --- a/var/mongoose/include/restart.jim +++ b/var/mongoose/include/restart.jim @@ -35,7 +35,7 @@ puts { diff --git a/var/mongoose/include/sched.jim b/var/mongoose/include/sched.jim index e5086133..b7ee1ed5 100755 --- a/var/mongoose/include/sched.jim +++ b/var/mongoose/include/sched.jim @@ -127,10 +127,10 @@ proc eventrow {event {table TBL_RESERVATION}} { } if {$rsvicon ne ""} { - set rsvicon " + set rsvicon " } if {$RKIcon ne ""} { - set RKIcon " + set RKIcon " } if {$table eq "pending"} { diff --git a/var/mongoose/lib/findhsvc b/var/mongoose/lib/findhsvc new file mode 100755 index 00000000..293d494c --- /dev/null +++ b/var/mongoose/lib/findhsvc @@ -0,0 +1,41 @@ + +if {![exists -proc findhsvc]} { + + require rsv.class + + proc findhsvc {channel} { + global rsvdb + + set hsvc [$rsvdb query " + select hSvc + from channel.TBL_SVC + where szSvcName = '$channel' + or szSvcname = '\025$channel' + limit 1 + "] + + if {[llength $hsvc] == 1} { + return [lindex [lindex $hsvc 0] 1] + } else { + return 0 + } + } + + proc findhsvcbylcn {lcn} { + global rsvdb + + set hsvc [$rsvdb query " + select hSvc + from channel.TBL_SVC + where usLcn = $lcn + limit 1 + "] + + if {[llength $hsvc] == 1} { + return [lindex [lindex $hsvc 0] 1] + } else { + return 0 + } + } +} + diff --git a/var/mongoose/lib/rsv.class b/var/mongoose/lib/rsv.class index 8eb64fb1..e3749db6 100755 --- a/var/mongoose/lib/rsv.class +++ b/var/mongoose/lib/rsv.class @@ -65,7 +65,7 @@ rsv method name {} { 5 { set name "--- Wake-up ---" } 6 { set name "--- Sleep ---" } 7 { set name "--- Auto Update ---" } - 11 { set name "--- DSO Event? ---" } + 11 { set name "--- DSO Event ---" } default { set name "--- Unknown event type $ersvtype ---" } } } @@ -237,6 +237,25 @@ proc {rsv entry} {{table TBL_RESERVATION} crid svc} { return 0 } +proc {rsv fetch} {{table TBL_RESERVATION} hsvc nsttime usevtid events} { + set res [$::rsvdb query " + select $table.*, + channel.TBL_SVC.szSvcName, channel.TBL_SVC.usLcn + from $table + left join channel.TBL_SVC + on $table.hSvc = channel.TBL_SVC.hSvc + where $table.hsvc = '%s' + and $table.nsttime = '%s' + and $table.usevtid = '%s' + and $table.szEventToRecord = '%s' + " $hsvc $nsttime $usevtid $events] + + if {[llength $res] > 0} { + return [rsv new [lindex $res 0]] + } + return 0 +} + proc {rsv slot} {{table TBL_RESERVATION} slot} { set res [$::rsvdb query " select $table.*,