<!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='type268 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='SID268'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr268'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port268'></span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd268'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State268'> </span></td></tr>
    </table>

    <table id="jpmcwb1" width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>1路</h1></td></tr>
        <tr><td style='width: 200px'>电压</td><td> A相:<span class='Ady0268'> </span>,&nbsp;B相:<span class='Bdy0268'> </span>,&nbsp;C相:<span class='Cdy0268'> </span></td></tr>
        <tr><td style='width: 200px'>电流</td><td> A相:<span class='Adl0268'> </span>,&nbsp;B相:<span class='Bdl0268'> </span>,&nbsp;C相:<span class='Cdl0268'> </span></td></tr>
        <!--<tr><td style='width: 200px'>频率</td><td> 频率:<span class='PL0268'> </span></td></tr>-->
        <tr><td style='width: 200px'>总电能</td><td> 有功总电能:<span class='Ygzdn0268'> </span></td></tr>
        <tr><td style='width: 200px'>有功功率</td><td> 总有功功率:<span class='Zyggl0268'> </span>,&nbsp;A相:<span class='Ayggl0268'> </span>,&nbsp;B相:<span class='Byggl0268'> </span>,&nbsp;C相:<span class='Cyggl0268'> </span></td></tr>
        <tr> <td style='width: 200px'>无功功率</td><td> 总无功功率:<span class='Zwggl0268'> </span>,&nbsp;A相:<span class='Awggl0268'> </span>,&nbsp;B相:<span class='Bwggl0268'> </span>,&nbsp;C相:<span class='Cwggl0268'> </span></td></tr>
        <tr> <td style='width: 200px'>视在功率</td><td> 总视在功率:<span class='Zszgl0268'> </span>,&nbsp;A相:<span class='Aszgl0268'> </span>,&nbsp;B相:<span class='Bszgl0268'> </span>,&nbsp;C相:<span class='Cszgl0268'> </span></td> </tr>
        <tr> <td style='width: 200px'>功率因数</td><td> 总功率因数:<span class='Zglys0268'> </span>,&nbsp;A相:<span class='Aglys0268'> </span>,&nbsp;B相:<span class='Bglys0268'> </span>,&nbsp;C相:<span class='Cglys0268'> </span></td> </tr>
    </table>
	
    <table id="jpmcwb2" width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>2路</h1></td></tr>
         <tr><td style='width: 200px'>电压</td><td> A相:<span class='Ady1268'> </span>,&nbsp;B相:<span class='Bdy1268'> </span>,&nbsp;C相:<span class='Cdy1268'> </span></td></tr>
        <tr><td  style='width: 200px'>电流</td><td> A相:<span class='Adl1268'> </span>,&nbsp;B相:<span class='Bdl1268'> </span>,&nbsp;C相:<span class='Cdl1268'> </span></td></tr>
        <!--<tr><td style='width: 200px'>频率</td><td> 频率:<span class='PL1268'> </span></td></tr>-->
        <tr><td style='width: 200px'>总电能</td><td> 有功总电能:<span class='Ygzdn1268'> </span></td></tr>
        <tr><td style='width: 200px'>有功功率</td><td> 总有功功率:<span class='Zyggl1268'> </span>,&nbsp;A相:<span class='Ayggl1268'> </span>,&nbsp;B相:<span class='Byggl1268'> </span>,&nbsp;C相:<span class='Cyggl1268'> </span></td></tr>
        <tr> <td style='width: 200px'>无功功率</td><td> 总无功功率:<span class='Zwggl1268'> </span>,&nbsp;A相:<span class='Awggl1268'> </span>,&nbsp;B相:<span class='Bwggl1268'> </span>,&nbsp;C相:<span class='Cwggl1268'> </span></td></tr>
        <tr> <td style='width: 200px'>视在功率</td><td> 总视在功率:<span class='Zszgl1268'> </span>,&nbsp;A相:<span class='Aszgl1268'> </span>,&nbsp;B相:<span class='Bszgl1268'> </span>,&nbsp;C相:<span class='Cszgl1268'> </span></td> </tr>
        <tr> <td style='width: 200px'>功率因数</td><td> 总功率因数:<span class='Zglys1268'> </span>,&nbsp;A相:<span class='Aglys1268'> </span>,&nbsp;B相:<span class='Bglys1268'> </span>,&nbsp;C相:<span class='Cglys1268'> </span></td> </tr>
    </table>
	
    <table id="jpmcwb3" width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>3路</h1></td></tr>
         <tr><td style='width: 200px'>电压</td><td> A相:<span class='Ady2268'> </span>,&nbsp;B相:<span class='Bdy2268'> </span>,&nbsp;C相:<span class='Cdy2268'> </span></td></tr>
        <tr><td  style='width: 200px'>电流</td><td> A相:<span class='Adl2268'> </span>,&nbsp;B相:<span class='Bdl2268'> </span>,&nbsp;C相:<span class='Cdl2268'> </span></td></tr>
        <!--<tr><td style='width: 200px'>频率</td><td> 频率:<span class='PL2268'> </span></td></tr>-->
        <tr><td style='width: 200px'>总电能</td><td> 有功总电能:<span class='Ygzdn2268'> </span></td></tr>
        <tr><td style='width: 200px'>有功功率</td><td> 总有功功率:<span class='Zyggl2268'> </span>,&nbsp;A相:<span class='Ayggl2268'> </span>,&nbsp;B相:<span class='Byggl2268'> </span>,&nbsp;C相:<span class='Cyggl2268'> </span></td></tr>
        <tr> <td style='width: 200px'>无功功率</td><td> 总无功功率:<span class='Zwggl2268'> </span>,&nbsp;A相:<span class='Awggl2268'> </span>,&nbsp;B相:<span class='Bwggl2268'> </span>,&nbsp;C相:<span class='Cwggl2268'> </span></td></tr>
        <tr> <td style='width: 200px'>视在功率</td><td> 总视在功率:<span class='Zszgl2268'> </span>,&nbsp;A相:<span class='Aszgl2268'> </span>,&nbsp;B相:<span class='Bszgl2268'> </span>,&nbsp;C相:<span class='Cszgl2268'> </span></td> </tr>
        <tr> <td style='width: 200px'>功率因数</td><td> 总功率因数:<span class='Zglys2268'> </span>,&nbsp;A相:<span class='Aglys2268'> </span>,&nbsp;B相:<span class='Bglys2268'> </span>,&nbsp;C相:<span class='Cglys2268'> </span></td> </tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=268;
var tescape= 5000,time;

<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var ext1=<% write(db_QryInt("select Ext1 from tbSM where SID="+sid,1));%>;
var json=<% db_QryAdv("select * from tbElecJpmcwb where SID="+sid,0); %>;
<% db_Close(); %>

if (ext1==0)
	ext1 = 7;

$(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){
	if (!(ext1 & 0x01))
		$("#jpmcwb1").hide();
	if (!(ext1 & 0x02))
		$("#jpmcwb2").hide();
	if (!(ext1 & 0x04))
		$("#jpmcwb3").hide();
	
    $.each(data.recs,function(i,n){

        $(".SID268").html(n.SID);
        $(".Addr268").html(n.Addr);
        $(".Port268").html(n.Port%256);
        $(".DateUpd268").html(n.DateUpd);
        $(".State268").html(window.parent.parseState(n.State));

		$(".Ady0268").html(n.Ady0/10+"V");
		$(".Bdy0268").html(n.Bdy0/10+"V");
		$(".Cdy0268").html(n.Cdy0/10+"V");
		$(".Adl0268").html(n.Adl0/100+"A");
		$(".Bdl0268").html(n.Bdl0/100+"A");
		$(".Cdl0268").html(n.Cdl0/100+"A");
		//$(".PL0268").html(n.Pl0/100+"Hz");
		$(".Ygzdn0268").html(n.Ygzdn0/100+"KWH");
		$(".Zyggl0268").html(n.Zyggl0+"W");
		$(".Ayggl0268").html(n.Ayggl0+"W");
		$(".Byggl0268").html(n.Byggl0+"W");
		$(".Cyggl0268").html(n.Cyggl0+"W");
		$(".Zwggl0268").html(n.Zwggl0+"Var");
		$(".Awggl0268").html(n.Awggl0+"Var");
		$(".Bwggl0268").html(n.Bwggl0+"Var");
		$(".Cwggl0268").html(n.Cwggl0+"Var");
		$(".Zszgl0268").html(n.Zszgl0+"VA");
		$(".Aszgl0268").html(n.Aszgl0+"VA");
		$(".Bszgl0268").html(n.Bszgl0+"VA");
		$(".Cszgl0268").html(n.Cszgl0+"VA");
		$(".Zglys0268").html(n.Zglys0/1000);
		$(".Aglys0268").html(n.Aglys0/1000);
		$(".Bglys0268").html(n.Bglys0/1000);
		$(".Cglys0268").html(n.Cglys0/1000);
		
		$(".Ady1268").html(n.Ady1/10+"V");
		$(".Bdy1268").html(n.Bdy1/10+"V");
		$(".Cdy1268").html(n.Cdy1/10+"V");
		$(".Adl1268").html(n.Adl1/100+"A");
		$(".Bdl1268").html(n.Bdl1/100+"A");
		$(".Cdl1268").html(n.Cdl1/100+"A");
		//$(".PL1268").html(n.Pl1/100+"Hz");
		$(".Ygzdn1268").html(n.Ygzdn1/100+"KWH");
		$(".Zyggl1268").html(n.Zyggl1+"W");
		$(".Ayggl1268").html(n.Ayggl1+"W");
		$(".Byggl1268").html(n.Byggl1+"W");
		$(".Cyggl1268").html(n.Cyggl1+"W");
		$(".Zwggl1268").html(n.Zwggl1+"Var");
		$(".Awggl1268").html(n.Awggl1+"Var");
		$(".Bwggl1268").html(n.Bwggl1+"Var");
		$(".Cwggl1268").html(n.Cwggl1+"Var");
		$(".Zszgl1268").html(n.Zszgl1+"VA");
		$(".Aszgl1268").html(n.Aszgl1+"VA");
		$(".Bszgl1268").html(n.Bszgl1+"VA");
		$(".Cszgl1268").html(n.Cszgl1+"VA");
		$(".Zglys1268").html(n.Zglys1/1000);
		$(".Aglys1268").html(n.Aglys1/1000);
		$(".Bglys1268").html(n.Bglys1/1000);
		$(".Cglys1268").html(n.Cglys1/1000);
		
		$(".Ady2268").html(n.Ady2/10+"V");
		$(".Bdy2268").html(n.Bdy2/10+"V");
		$(".Cdy2268").html(n.Cdy2/10+"V");
		$(".Adl2268").html(n.Adl2/100+"A");
		$(".Bdl2268").html(n.Bdl2/100+"A");
		$(".Cdl2268").html(n.Cdl2/100+"A");
		//$(".PL2268").html(n.Pl2/100+"Hz");
		$(".Ygzdn2268").html(n.Ygzdn2/100+"KWH");
		$(".Zyggl2268").html(n.Zyggl2+"W");
		$(".Ayggl2268").html(n.Ayggl2+"W");
		$(".Byggl2268").html(n.Byggl2+"W");
		$(".Cyggl2268").html(n.Cyggl2+"W");
		$(".Zwggl2268").html(n.Zwggl2+"Var");
		$(".Awggl2268").html(n.Awggl2+"Var");
		$(".Bwggl2268").html(n.Bwggl2+"Var");
		$(".Cwggl2268").html(n.Cwggl2+"Var");
		$(".Zszgl2268").html(n.Zszgl2+"VA");
		$(".Aszgl2268").html(n.Aszgl2+"VA");
		$(".Bszgl2268").html(n.Bszgl2+"VA");
		$(".Cszgl2268").html(n.Cszgl2+"VA");
		$(".Zglys2268").html(n.Zglys2/1000);
		$(".Aglys2268").html(n.Aglys2/1000);
		$(".Bglys2268").html(n.Bglys2/1000);
		$(".Cglys2268").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>