<!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='type256 empty' style=' margin: 10px;'>
  <table width="100%">
    <tr>
    <td width="300px" style="text-align: center;"><img src="img/ico-elec.png" style="width: 70%;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='SID256'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr256'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port256'></span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd256'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State256'> </span></td></tr>
    </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>电压(监测量)</h1></td></tr>
         <tr><td style='width: 33%' >A相电压:<span class='Ady256'> </span></td><td>B相电压:<span class='Bdy256'> </span></td><td>c相电压:<span class='Cdy256'> </span></td></tr>
    </table>

    <table width='100%' style='margin-top: 10px'>
        <tr><td style='border: none'> <h1>电流(监测量)</h1></td></tr>
        <tr><td  style='width: 33%' >A相电流:<span class='Adl256'> </span></td><td>B相电流:<span class='Bdl256'> </span></td><td>C相电流:<span class='Cdl256'> </span></td></tr>
    </table>

    <table width='100%' style='margin-top:10px'>
        <tr><td style='border: none'> <h1>其它(监测量)</h1></td> </tr>
        <tr><td style='width: 200px'>有功功率</td><td>  A相:<span class='Ayggl256'> </span>,B相:<span class='Byggl256'> </span>,C相<span class='Cyggl256'> </span></td></tr>
        <tr> <td style='width: 200px'>无功功率</td><td> A相:<span class='Awggl256'> </span>,B相:<span class='Bwggl256'> </span>,C相:<span class='Cwggl256'> </span></td></tr>
        <tr> <td style='width: 200px'>视在功率</td><td> A相:<span class='Aszgl256'> </span>,B相:<span class='Bszgl256'> </span>,C相:<span class='Cszgl256'> </span></td> </tr>
        <tr> <td style='width: 200px'>功率因数</td><td> A相:<span class='Aglys256'> </span>,B相:<span class='Bglys256'> </span>,C相:<span class='Cglys256'> </span></td> </tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=256;
var tescape= 5000,time;

<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbElec 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){

        $(".SID256").html(n.SID);
        $(".Addr256").html(n.Addr);
        $(".Port256").html(n.Port%256);
        $(".DateUpd256").html(n.DateUpd);
        $(".State256").html(window.parent.parseState(n.State));

        $(".Ady256").html(n.Ady/10+"V");
        $(".Bdy256").html(n.Bdy/10+"V");
        $(".Cdy256").html(n.Cdy/10+"V");

        $(".Adl256").html(n.Adl/100+"A");
        $(".Bdl256").html(n.Bdl/100+"A");
        $(".Cdl256").html(n.Cdl/100+"A");

        //$(".Ygzdn256").html(n.Ygzdn/100+"KWH");
        //$(".Zyggl256").html(n.Zyggl+"W");
        $(".Ayggl256").html(n.Ayggl+"W");
        $(".Byggl256").html(n.Byggl+"W");
        $(".Cyggl256").html(n.Cyggl+"W");
        //$(".Zwggl256").html(n.Zwggl+"ar");
        $(".Awggl256").html(n.Awggl+"Var");
        $(".Bwggl256").html(n.Bwggl+"Var");
        $(".Cwggl256").html(n.Cwggl+"Var");
        //$(".Zszgl256").html(n.Zszgl+"VA");
        $(".Aszgl256").html(n.Aszgl+"VA");
        $(".Bszgl256").html(n.Bszgl+"VA");
        $(".Cszgl256").html(n.Cszgl+"VA");
        //$(".Zglys256").html(n.Zglys/1000);
        $(".Aglys256").html(n.Aglys/1000);
        $(".Bglys256").html(n.Bglys/1000);
        $(".Cglys256").html(n.Cglys/1000);
    });
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
}
</script>
</body>
</html>