2011-09-09 19:38:37 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
package require cgi
|
|
|
|
package require sqlite3
|
2012-05-21 20:23:41 +00:00
|
|
|
source /mod/webif/lib/setup
|
2011-09-09 19:38:37 +00:00
|
|
|
require altrow progressbar epg.class
|
|
|
|
|
|
|
|
header
|
|
|
|
|
|
|
|
proc f2c {frequency} {
|
|
|
|
set ch int($((($frequency / 1000) - 303.25) / 8))
|
|
|
|
return [expr int($ch)]
|
|
|
|
}
|
|
|
|
|
|
|
|
if {[catch {set db [sqlite3.open /var/lib/humaxtv/channel.db]} msg]} {
|
|
|
|
puts "Error opening channel database: $msg"
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
puts "
|
|
|
|
<button id=expandall>Expand All</button>
|
|
|
|
<button id=collapseall>Collapse All</button>
|
|
|
|
<br><br>
|
|
|
|
<table class=borders>
|
|
|
|
<tr>
|
|
|
|
<th>Channel</th>
|
|
|
|
<th>Frequency</th>
|
|
|
|
<th>Signal Strength</th>
|
|
|
|
<th>Signal Quality</th>
|
2012-01-18 22:15:20 +00:00
|
|
|
<th>Network</th>
|
2011-09-21 20:21:13 +00:00
|
|
|
<th>Mux</th>
|
2011-09-09 19:38:37 +00:00
|
|
|
<th>Channels</th>
|
2011-09-21 20:21:13 +00:00
|
|
|
<th>>799</th>
|
2011-09-09 19:38:37 +00:00
|
|
|
</tr>
|
|
|
|
"
|
|
|
|
foreach tw [$db query {
|
2012-01-18 22:15:20 +00:00
|
|
|
select tsIdx, szNetName, usTsID, ulFrequency, ucLevel, ucQuality
|
|
|
|
from TBL_TS join TBL_NET using (netIdx)
|
2011-09-09 19:38:37 +00:00
|
|
|
order by ulFrequency
|
|
|
|
}] {
|
2012-01-18 22:15:20 +00:00
|
|
|
lassign $tw \
|
|
|
|
x tsIdx x netName x usTsID x ulFrequency x ucLevel x ucQuality
|
2011-09-09 19:38:37 +00:00
|
|
|
|
|
|
|
altrow
|
|
|
|
puts "
|
|
|
|
<td>[f2c $ulFrequency]</td>
|
|
|
|
<td>[expr $ulFrequency / 1000.0] MHz</td>
|
|
|
|
"
|
|
|
|
puts "<td>[progressbar $ucLevel]</td>"
|
|
|
|
puts "<td>[progressbar $ucQuality]</td>"
|
2012-01-18 22:15:20 +00:00
|
|
|
puts "<td>[string range $netName 3 end]</td>"
|
2011-09-09 19:38:37 +00:00
|
|
|
|
|
|
|
set channels [$db query {
|
|
|
|
select usLcn, szSvcName, szPrvName, aucDefaultAuthority
|
|
|
|
from TBL_SVC left join TBL_PRV using (prvIdx)
|
|
|
|
where tsIdx = %s
|
|
|
|
order by usLcn
|
|
|
|
} $tsIdx]
|
2011-09-21 20:21:13 +00:00
|
|
|
|
2012-01-13 21:23:03 +00:00
|
|
|
set mux "Local"
|
2011-09-21 20:21:13 +00:00
|
|
|
set ehs 0
|
|
|
|
foreach chan $channels {
|
|
|
|
lassign $chan x lcn x name
|
|
|
|
set name [string range $name 1 end]
|
|
|
|
if {$lcn >= 800} { incr ehs }
|
|
|
|
switch $name {
|
|
|
|
"BBC ONE" { set mux "PSB1/BBC A" }
|
2011-09-22 22:29:43 +00:00
|
|
|
"ITV1" { set mux "PSB2/D3&4" }
|
2013-01-18 18:47:14 +00:00
|
|
|
"ITV" { set mux "PSB2/D3&4" }
|
2013-07-11 22:13:36 +00:00
|
|
|
"BBC ONE HD" { set mux "PSB3/BBC B (HD)" }
|
2011-09-21 20:21:13 +00:00
|
|
|
"ITV3" { set mux "COM4/SDN" }
|
|
|
|
"Dave" { set mux "COM5/ARQ A" }
|
|
|
|
"Film4" { set mux "COM6/ARQ B" }
|
2013-10-23 20:38:25 +00:00
|
|
|
"BBC News HD" { set mux "COM7/ARQ C" }
|
2012-01-13 21:23:03 +00:00
|
|
|
"Movies4Men" { set mux "Local" }
|
2011-09-21 20:21:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
puts "<td>$mux</td>"
|
|
|
|
|
2011-09-09 19:38:37 +00:00
|
|
|
puts "<td>[llength $channels]
|
|
|
|
<a class=mchan ts=$tsIdx href=#>
|
|
|
|
<img border=0 height=14
|
|
|
|
src=/images/421_1_00_CH_Title_2R_Arrow.png>
|
|
|
|
view
|
|
|
|
</a></td>"
|
2011-09-21 20:21:13 +00:00
|
|
|
puts "<td>$ehs</th>"
|
2011-09-09 19:38:37 +00:00
|
|
|
puts "</tr>"
|
|
|
|
puts "<tr id=mchan_$tsIdx class=mchan style=\"display: none\">
|
|
|
|
<td colspan=5>"
|
|
|
|
puts "<table style=\"margin-left: 5em\">"
|
|
|
|
puts "<tr>
|
|
|
|
<th colspan=3>Channel</th>
|
|
|
|
<th>Provider</th>
|
|
|
|
<th>Authority</th>
|
|
|
|
</tr>"
|
|
|
|
foreach chan $channels {
|
|
|
|
lassign $chan x lcn x name x prv x auth
|
|
|
|
set name [string range $name 1 end]
|
|
|
|
set prv [string range $prv 3 end]
|
|
|
|
altrow
|
|
|
|
puts "<td class=va>"
|
|
|
|
puts "[epg channelicon $name 50]</td>
|
|
|
|
<td>$lcn</td><td>$name</td>"
|
|
|
|
puts "</td><td>"
|
|
|
|
puts $prv
|
|
|
|
puts "</td><td>"
|
|
|
|
puts $auth
|
|
|
|
puts "</td>"
|
|
|
|
puts "</tr>"
|
|
|
|
}
|
|
|
|
puts "</table>"
|
|
|
|
puts "</td></tr>"
|
|
|
|
}
|
|
|
|
|
|
|
|
puts "</table>"
|
|
|
|
|
|
|
|
puts {
|
|
|
|
<script type=text/javascript>
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('a.mchan').click(function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
$('#mchan_' + $(this).attr('ts')).slideToggle('slow');
|
|
|
|
});
|
|
|
|
$('#expandall').button().click(function() {
|
|
|
|
$('tr.mchan').slideDown('slow');
|
|
|
|
});
|
|
|
|
$('#collapseall').button().click(function() {
|
|
|
|
$('tr.mchan').slideUp('slow');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
}
|
|
|
|
|