<!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='type271 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='SID271'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr271'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port271'></span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd271'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State271'> </span></td></tr>
    </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>1路(监测量)</h1></td></tr>
        <tr><td style='width: 33%' >电压</td><td>A相:<span class='Ady271'> </span>,B相:<span class='Bdy271'> </span>,c相:<span class='Cdy271'> </span></td></tr>
        <tr><td style='width: 33%' >电流</td><td>A相:<span class='Adl271'> </span>,B相:<span class='Bdl271'> </span>,C相:<span class='Cdl271'> </span></td></tr>
        <tr><td style='width: 200px'>总电能</td><td> 有功总电能:<span class='Ygzdn271'> </span></td></tr>
        <tr><td style='width: 200px'>有功功率</td><td> 总有功功率:<span class='Zyggl271'> </span>,A相:<span class='Ayggl271'> </span>,B相:<span class='Byggl271'> </span>,C相<span class='Cyggl271'> </span></td></tr>
        <tr><td style='width: 200px'>无功功率</td><td> 总无功功率:<span class='Zwggl271'> </span>,A相:<span class='Awggl271'> </span>,B相:<span class='Bwggl271'> </span>,C相:<span class='Cwggl271'> </span></td></tr>
        <tr><td style='width: 200px'>视在功率</td><td> 总视在功率:<span class='Zszgl271'> </span>,A相:<span class='Aszgl271'> </span>,B相:<span class='Bszgl271'> </span>,C相:<span class='Cszgl271'> </span></td> </tr>
        <tr><td style='width: 200px'>功率因数</td><td> 总功率因数:<span class='Zglys271'> </span>,A相:<span class='Aglys271'> </span>,B相:<span class='Bglys271'> </span>,C相:<span class='Cglys271'> </span></td> </tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>2路(监测量)</h1></td></tr>
        <tr><td style='width: 33%' >电压</td><td>A相:<span class='Ady2271'></span>,B相:<span class='Bdy2271'> </span>,c相:<span class='Cdy2271'> </span></td></tr>
        <tr><td style='width: 33%' >电流</td><td>A相:<span class='Adl2271'></span>,B相:<span class='Bdl2271'> </span>,C相:<span class='Cdl2271'> </span></td></tr>
        <tr><td style='width: 200px'>总电能</td><td> 有功总电能:<span class='Ygzdn2271'> </span></td></tr>
        <tr><td style='width: 200px'>有功功率</td><td> 总有功功率:<span class='Zyggl2271'> </span>,A相:<span class='Ayggl2271'> </span>,B相:<span class='Byggl2271'> </span>,C相<span class='Cyggl2271'> </span></td></tr>
        <tr><td style='width: 200px'>无功功率</td><td> 总无功功率:<span class='Zwggl2271'> </span>,A相:<span class='Awggl2271'> </span>,B相:<span class='Bwggl2271'> </span>,C相:<span class='Cwggl2271'> </span></td></tr>
        <tr><td style='width: 200px'>视在功率</td><td> 总视在功率:<span class='Zszgl2271'> </span>,A相:<span class='Aszgl2271'> </span>,B相:<span class='Bszgl2271'> </span>,C相:<span class='Cszgl2271'> </span></td> </tr>
        <tr><td style='width: 200px'>功率因数</td><td> 总功率因数:<span class='Zglys2271'> </span>,A相:<span class='Aglys2271'> </span>,B相:<span class='Bglys2271'> </span>,C相:<span class='Cglys2271'> </span></td> </tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=271;
var tescape= 5000,time;

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

        $(".SID271").html(n.SID);
        $(".Addr271").html(n.Addr);
        $(".Port271").html(n.Port%256);
        $(".DateUpd271").html(n.DateUpd);
        $(".State271").html(window.parent.parseState(n.State));

        $(".Ady271").html(n.Ady/10+"V");
        $(".Bdy271").html(n.Bdy/10+"V");
        $(".Cdy271").html(n.Cdy/10+"V");
        $(".Adl271").html(n.Adl/100+"A");
        $(".Bdl271").html(n.Bdl/100+"A");
        $(".Cdl271").html(n.Cdl/100+"A");
        $(".Ygzdn271").html(n.Ygzdn/100+"KWH");
        $(".Zyggl271").html(n.Zyggl+"W");
        $(".Ayggl271").html(n.Ayggl+"W");
        $(".Byggl271").html(n.Byggl+"W");
        $(".Cyggl271").html(n.Cyggl+"W");
        $(".Zwggl271").html(n.Zwggl+"Var");
        $(".Awggl271").html(n.Awggl+"Var");
        $(".Bwggl271").html(n.Bwggl+"Var");
        $(".Cwggl271").html(n.Cwggl+"Var");
        $(".Zszgl271").html(n.Zszgl+"VA");
        $(".Aszgl271").html(n.Aszgl+"VA");
        $(".Bszgl271").html(n.Bszgl+"VA");
        $(".Cszgl271").html(n.Cszgl+"VA");
        $(".Zglys271").html(n.Zglys/1000);
        $(".Aglys271").html(n.Aglys/1000);
        $(".Bglys271").html(n.Bglys/1000);
        $(".Cglys271").html(n.Cglys/1000);
		
        $(".Ady2271").html(n.Ady2/10+"V");
        $(".Bdy2271").html(n.Bdy2/10+"V");
        $(".Cdy2271").html(n.Cdy2/10+"V");
        $(".Adl2271").html(n.Adl2/100+"A");
        $(".Bdl2271").html(n.Bdl2/100+"A");
        $(".Cdl2271").html(n.Cdl2/100+"A");
        $(".Ygzdn2271").html(n.Ygzdn2/100+"KWH");
        $(".Zyggl2271").html(n.Zyggl2+"W");
        $(".Ayggl2271").html(n.Ayggl2+"W");
        $(".Byggl2271").html(n.Byggl2+"W");
        $(".Cyggl2271").html(n.Cyggl2+"W");
        $(".Zwggl2271").html(n.Zwggl2+"Var");
        $(".Awggl2271").html(n.Awggl2+"Var");
        $(".Bwggl2271").html(n.Bwggl2+"Var");
        $(".Cwggl2271").html(n.Cwggl2+"Var");
        $(".Zszgl2271").html(n.Zszgl2+"VA");
        $(".Aszgl2271").html(n.Aszgl2+"VA");
        $(".Bszgl2271").html(n.Bszgl2+"VA");
        $(".Cszgl2271").html(n.Cszgl2+"VA");
        $(".Zglys2271").html(n.Zglys2/1000);
        $(".Aglys2271").html(n.Aglys2/1000);
        $(".Bglys2271").html(n.Bglys2/1000);
        $(".Cglys2271").html(n.Cglys2/1000);
    });
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
}
</script>
</body>
</html>