<!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='type516 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='SID516'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr516'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port516'></span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd516'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State516'> </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'>无功功率:<span class='ReactivePow1516'> </span></td>
			<td style='width: 200px'>视在功率:<span class='ApparentPow1516'> </span></td>
			<td style='width: 200px'>无功电能:<span class='ReactiveEnergy1516'> </span></td>
			<td style='width: 200px'>电度:<span class='ActiveEnergy1516'> </span></td>
		</tr>
        <tr><td style='width: 200px'>电流:<span class='Current1516'> </span></td>
			<td style='width: 200px'>功率:<span class='ActivePow1516'> </span></td>
			<td style='width: 200px'>功率因素:<span class='PowFactor1516'> </span></td>
			<td style='width: 200px'>电压:<span class='Voltage1516'> </span></td>
		</tr>
        <tr><td style='width: 200px'>电压3-31次谐波:<span class='VHARM1516'> </span></td>
			<td style='width: 200px'>通道电流3-31次谐波:<span class='AHARM1516'> </span></td>
			<td style='width: 200px'>频率:<span class='Voltage4516'> </span></td>
			<td style='width: 200px'><span class='516'> </span></td>
		</tr>
   </table>
	
    <table id="jpmcwb2" width='100%' style='margin-top: 30px;display:none'>
        <tr><td style='border: none'> <h1>2路</h1></td></tr>
        <tr><td style='width: 200px'>无功功率:<span class='ReactivePow2516'> </span></td>
			<td style='width: 200px'>视在功率:<span class='ApparentPow2516'> </span></td>
			<td style='width: 200px'>无功电能:<span class='ReactiveEnergy2516'> </span></td>
			<td style='width: 200px'>电度:<span class='ActiveEnergy2516'> </span></td>
		</tr>
        <tr><td style='width: 200px'>电流:<span class='Current2516'> </span></td>
			<td style='width: 200px'>功率:<span class='ActivePow2516'> </span></td>
			<td style='width: 200px'>功率因素:<span class='PowFactor2516'> </span></td>
			<td style='width: 200px'>电压/频率/开关输入:<span class='Voltage2516'> </span></td>
		</tr>
        <tr><td style='width: 200px'>电压3-31次谐波:<span class='VHARM2516'> </span></td>
			<td style='width: 200px'>通道电流3-31次谐波:<span class='AHARM2516'> </span></td>
			<td style='width: 200px'>频率:<span class='Voltage4516'> </span></td>
			<td style='width: 200px'><span class='516'> </span></td>
		</tr>
   </table>
	
    <table id="jpmcwb3" width='100%' style='margin-top: 30px;display:none'>
        <tr><td style='border: none'> <h1>3路</h1></td></tr>
        <tr><td style='width: 200px'>无功功率:<span class='ReactivePow3516'> </span></td>
			<td style='width: 200px'>视在功率:<span class='ApparentPow3516'> </span></td>
			<td style='width: 200px'>无功电能:<span class='ReactiveEnergy3516'> </span></td>
			<td style='width: 200px'>电度:<span class='ActiveEnergy3516'> </span></td>
		</tr>
        <tr><td style='width: 200px'>电流:<span class='Current3516'> </span></td>
			<td style='width: 200px'>功率:<span class='ActivePow3516'> </span></td>
			<td style='width: 200px'>功率因素:<span class='PowFactor3516'> </span></td>
			<td style='width: 200px'>电压/频率/开关输入:<span class='Voltage3516'> </span></td>
		</tr>
        <tr><td style='width: 200px'>电压3-31次谐波:<span class='VHARM3516'> </span></td>
			<td style='width: 200px'>通道电流3-31次谐波:<span class='AHARM3516'> </span></td>
			<td style='width: 200px'>频率:<span class='Voltage4516'> </span></td>
			<td style='width: 200px'><span class='516'> </span></td>
		</tr>
   </table>
	
    <table id="jpmcwb4" width='100%' style='margin-top: 30px;display:none'>
        <tr><td style='border: none'> <h1>4路</h1></td></tr>
        <tr><td style='width: 200px'>无功功率:<span class='ReactivePow4516'> </span></td>
			<td style='width: 200px'>视在功率:<span class='ApparentPow4516'> </span></td>
			<td style='width: 200px'>无功电能:<span class='ReactiveEnergy4516'> </span></td>
			<td style='width: 200px'>电度:<span class='ActiveEnergy4516'> </span></td>
		</tr>
        <tr><td style='width: 200px'>电流:<span class='Current4516'> </span></td>
			<td style='width: 200px'>功率:<span class='ActivePow4516'> </span></td>
			<td style='width: 200px'>功率因素:<span class='PowFactor4516'> </span></td>
			<td style='width: 200px'><span class='516'> </span></td>
		</tr>
        <tr><td style='width: 200px'>电压3-31次谐波:<span class='VHARM4516'> </span></td>
			<td style='width: 200px'>通道电流3-31次谐波:<span class='AHARM4516'> </span></td>
			<td style='width: 200px'><span class='516'> </span></td>
			<td style='width: 200px'><span class='516'> </span></td>
		</tr>
   </table>
	
    <table id="jpmcwb5" width='100%' style='margin-top: 30px;display:none'>
        <tr><td style='border: none'> <h1>5路</h1></td></tr>
        <tr><td style='width: 200px'>无功功率:<span class='ReactivePow5516'> </span></td>
			<td style='width: 200px'>视在功率:<span class='ApparentPow5516'> </span></td>
			<td style='width: 200px'>无功电能:<span class='ReactiveEnergy5516'> </span></td>
			<td style='width: 200px'>电度:<span class='ActiveEnergy5516'> </span></td>
		</tr>
        <tr><td style='width: 200px'>电流:<span class='Current5516'> </span></td>
			<td style='width: 200px'>功率:<span class='ActivePow5516'> </span></td>
			<td style='width: 200px'>功率因素:<span class='PowFactor5516'> </span></td>
			<td style='width: 200px'><span class='516'> </span></td>
		</tr>
        <tr><td style='width: 200px'>电压3-31次谐波:<span class='VHARM5516'> </span></td>
			<td style='width: 200px'>通道电流3-31次谐波:<span class='AHARM5516'> </span></td>
			<td style='width: 200px'><span class='516'> </span></td>
			<td style='width: 200px'><span class='516'> </span></td>
		</tr>
   </table>
	
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=516;
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 tbElcSwIDCA21 where SID="+sid,0); %>;
<% db_Close(); %>

if (ext1==0)
	ext1 = 1;
else if (ext1 > 5)
	ext1 = 5;
var i=1;
for (i=1; i<=ext1; i++)
	$("#jpmcwb"+i).show();

$(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){

        $(".SID516").html(n.SID);
        $(".Addr516").html(n.Addr);
        $(".Port516").html(n.Port%256);
        $(".DateUpd516").html(n.DateUpd);
        $(".State516").html(window.parent.parseState(n.State));

		$(".ReactivePow1516").html(n.ReactivePow1/100+"KVar");
		$(".ApparentPow1516").html(n.ApparentPow1/100+"KVA");
		$(".ReactiveEnergy1516").html(n.ReactiveEnergy1/10+"KVARH");
		$(".Current1516").html(n.Current1/10+"A");
		$(".ActivePow1516").html(n.ActivePow1/100+"KW");
		$(".PowFactor1516").html(n.PowFactor1/100);
		$(".ActiveEnergy1516").html(n.ActiveEnergy1/10+"KWH");
		$(".Voltage1516").html(n.Voltage1/10+"V");
		$(".VHARM1516").html(n.VHARM1/10);
		$(".AHARM1516").html(n.AHARM1/10);

		$(".ReactivePow2516").html(n.ReactivePow2/100+"KVar");
		$(".ApparentPow2516").html(n.ApparentPow2/100+"KVA");
		$(".ReactiveEnergy2516").html(n.ReactiveEnergy2/10+"KVARH");
		$(".Current2516").html(n.Current2/10+"A");
		$(".ActivePow2516").html(n.ActivePow2/100+"KW");
		$(".PowFactor2516").html(n.PowFactor2/100);
		$(".ActiveEnergy2516").html(n.ActiveEnergy2/10+"KWH");
		$(".Voltage2516").html(n.Voltage2/10+"V");
		$(".VHARM2516").html(n.VHARM2/10);
		$(".AHARM2516").html(n.AHARM2/10);

		$(".ReactivePow3516").html(n.ReactivePow3/100+"KVar");
		$(".ApparentPow3516").html(n.ApparentPow3/100+"KVA");
		$(".ReactiveEnergy3516").html(n.ReactiveEnergy3/10+"KVARH");
		$(".Current3516").html(n.Current3/10+"A");
		$(".ActivePow3516").html(n.ActivePow3/100+"KW");
		$(".PowFactor3516").html(n.PowFactor3/100);
		$(".ActiveEnergy3516").html(n.ActiveEnergy3/10+"KWH");
		$(".Voltage3516").html(n.Voltage3/10+"V");
		$(".VHARM3516").html(n.VHARM3/10);
		$(".AHARM3516").html(n.AHARM3/10);
		$(".Voltage4516").html(n.Voltage4/10+"Hz");

		$(".ReactivePow4516").html(n.ReactivePow4/100+"KVar");
		$(".ApparentPow4516").html(n.ApparentPow4/100+"KVA");
		$(".ReactiveEnergy4516").html(n.ReactiveEnergy4/10+"KVARH");
		$(".Current4516").html(n.Current4/10+"A");
		$(".ActivePow4516").html(n.ActivePow4/100+"KW");
		$(".PowFactor4516").html(n.PowFactor4/100);
		$(".ActiveEnergy4516").html(n.ActiveEnergy4/10+"KWH");
		//$(".Voltage4516").html(n.Voltage4/10+"V");
		$(".VHARM4516").html(n.VHARM4/10);
		$(".AHARM4516").html(n.AHARM4/10);

		$(".ReactivePow5516").html(n.ReactivePow5/100+"KVar");
		$(".ApparentPow5516").html(n.ApparentPow5/100+"KVA");
		$(".ReactiveEnergy5516").html(n.ReactiveEnergy5/10+"KVARH");
		$(".Current5516").html(n.Current5/10+"A");
		$(".ActivePow5516").html(n.ActivePow5/100+"KW");
		$(".PowFactor5516").html(n.PowFactor5/100);
		$(".ActiveEnergy5516").html(n.ActiveEnergy5/10+"KWH");
		//$(".Voltage5516").html(n.Voltage5/10+"V");
		$(".VHARM5516").html(n.VHARM5/10);
		$(".AHARM5516").html(n.AHARM5/10);
		
    });
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
}
</script>
</body>
</html>