<!DOCTYPE html>
<% language=javascript %>
<html>
<head lang="en">
    <meta charset="GB2312">
    <title></title>
    <link href="css/style.css" title="style" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.6.3.min.js"></script>

</head>
<body style="background: #F3F3F3">
<div class='type795 empty' style=' margin: 10px;'>
  <table width="100%">
    <tr>
    <td width="300px" style="text-align: center;"><img src="img/ico-ups.png" style="width: 50%;text-align: center;"></td>
    <td>
    <table width='100%'>
        <tr><td style='border: none'> <h1>基本信息</h1></td></tr>
        <tr><td style='width: 200px;'>基本信息</td><td>SID:<span class='SID795'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr795'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port795'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd795'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State795'> </span></td></tr>
    </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>运行参数</h1></td></tr>
        <tr><td >输入电压:<span class='VinA795'> </span>&nbsp;最大<span class='VinB794'> </span>&nbsp;最小<span class='VinC795'> </span></td><td> 输出电压:<span class='Vout795'> </span></td><td> 额定电压:<span class='Ved795'> </span></td></tr>
		<tr><td>输入频率:<span class='Fin795'> </span></td><td>输出频率:<span class='Fout795'> </span></td><td> 额定频率:<span class='Fed795'> </span></td></tr>
		<tr><td>输入功率:<span class='Aed795'> </span></td><td >输出功率:<span class='Aout795'> </span></span></td><td>额定功率: <span class='VAed795'> </span></td></tr>
        <tr><td>电池电压:<span class='Vbatt795'> </span></td><td>电池温度:<span class='Tem795'> </span></td><td>电池容量:<span class='Mbatt795'> </span></td></tr>
		<!--<tr><td>电池容量:<span class='Pbatt795'> </span></td><td> <span class='v1795'> </span></td><td> <span class='xx795'> </span></td></tr>-->

    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>工作状态</h1></td></tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=795;
var tescape= 5000,time;

<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbUps where SID="+sid,0); %>;
<% db_Close(); %>
$(function(){
    time=setInterval(ajax,tescape)
});
function ajax(){
    $.ajax({
        type: "POST",
        url: "omdev/smdat0.asp",
        data: "itype="+itype+"&sid="+sid,
        dataType:"json",
        success: function(msg){
            list3(msg)
        }
    });
}
list3(json);
function list3(data){
    $.each(data.recs,function(i,n){
        $(".SID795").html(n.SID);
        $(".Addr795").html(n.Addr);
        $(".Port795").html(n.Port%256);
        $(".DateUpd795").html(n.DateUpd);
        $(".State795").html(window.parent.parseState(n.State));

        $(".VinA795").html(n.Vin1/10+"V");
		$(".VinB795").html(n.Vin2/10+"V");
		$(".VinC795").html(n.Vin3/10+"V");
        $(".Vout795").html(n.Vout/10+"V");
        $(".Ved795").html(n.Ved/10+"V");
		
		$(".Fin795").html(n.Fin/10+"Hz");
		$(".Fout795").html(n.Fout/10+"Hz");
		$(".Fed795").html(n.Fed/10+"Hz");
		
		$(".Aed795").html(n.Aed/10+"kw");
		$(".Aout795").html(n.Aout/10+"kw");
		$(".VAed795").html(n.VAed/10+"kw");
		
        $(".Tem795").html(n.Tem/10+"℃");  
        $(".Vbatt795").html(n.Vbatt/10+"V");            
		//$(".Pbatt795").html(n.Pbatt/10+"%");
        $(".Mbatt795").html(n.Mbatt/10+"min");  
		
    })
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
}
</script>
</body>
</html>