<!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='type270 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='SID270'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr270'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port270'></span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd270'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State270'> </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相（线AB）电压:<span class='ValAIn270'> </span></td>
		     <td style='width: 33%' >B相（线BC）电压:<span class='ValBIn270'> </span></td>
		     <td style='width: 33%' >c相（线CA）电压:<span class='VolCIn270'> </span></td></tr>
         <tr><td style='width: 33%' >频率:<span class='FreqIn270'> </span></td>
		     <td style='width: 33%' ><span class='270'> </span></td>
		     <td style='width: 33%' ><span class='270'> </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%' >输出电压:<span class='RecVolOut270'> </span></td>
			<td style='width: 33%' ><span class='270'> </span></td>
			<td style='width: 33%' ><span class='270'> </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%' >电池电压:<span class='BatVolOut270'> </span></td>
			<td style='width: 33%' >电池容量:<span class='BatCapOut270'> </span></td>
			<td style='width: 33%' ><span class='270'> </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%' >输出电压:<span class='DCVolOut270'> </span></td>
			<td style='width: 33%' >总负载电流:<span class='DCCurOut270'> </span></td>
			<td style='width: 33%' ><span class='270'> </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%' >交流输入线/相电压上限:<span class='SetVolH270'> </span></td>
			<td style='width: 33%' >交流输入线/相电压下限:<span class='SetVolL270'> </span></td>
			<td style='width: 33%' >交流输出电流上限:<span class='SetCurH270'> </span></td></tr>
        <tr><td style='width: 33%' >频率上限:<span class='SetFreqH270'> </span></td>
			<td style='width: 33%' >频率下限:<span class='SetFreqL270'> </span></td>
			<td style='width: 33%' ><span class='270'> </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%' >输出开关状态:<span class='StDO270'> </span></td>
			<td style='width: 33%' >A相（线AB）输入电压:<span class='AlmVA270'> </span></td>
			<td style='width: 33%' >B相（线BC）输入电压:<span class='AlmVB270'> </span></td></tr>
        <tr><td style='width: 33%' >c相（线CA）输入电压:<span class='AlmVC270'> </span></td>
			<td style='width: 33%' >输入频率:<span class='AlmFq270'> </span></td>
			<td style='width: 33%' >熔丝/开关1:m:<span class='AlmFu270'> </span></td></tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=270;
var tescape= 5000,time;

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

        $(".SID270").html(n.SID);
        $(".Addr270").html(n.Addr);
        $(".Port270").html(n.Port%256);
        $(".DateUpd270").html(n.DateUpd);
        $(".State270").html(window.parent.parseState(n.State));

        $(".ValAIn270").html(n.ValAIn/10+"V");
        $(".ValBIn270").html(n.ValBIn/10+"V");
        $(".VolCIn270").html(n.VolCIn/10+"V");
        $(".FreqIn270").html(n.FreqIn/10+"Hz");
		
        $(".RecVolOut270").html(n.RecVolOut/100+"V");
		
        $(".BatVolOut270").html(n.BatVolOut/10+"V");
        $(".BatCapOut270").html(n.BatCapOut+"AH");
		
        $(".DCVolOut270").html(n.DCVolOut/100+"V");
        $(".DCCurOut270").html(n.DCCurOut/100+"A");
		
        $(".StDO270").html(n.StDO ? "告警" : "正常");
        $(".AlmVA270").html(n.AlmVA ? "告警" : "正常");
        $(".AlmVB270").html(n.AlmVB ? "告警" : "正常");
        $(".AlmVC270").html(n.AlmVC ? "告警" : "正常");
        $(".AlmFq270").html(n.AlmFq ? "告警" : "正常");
        $(".AlmFu270").html(n.AlmFu ? "告警" : "正常");
        $(".SetVolH270").html(n.SetVolH/10+"V");
        $(".SetVolL270").html(n.SetVolL/10+"V");
        $(".SetCurH270").html(n.SetCurH/10+"A");
        $(".SetFreqH270").html(n.SetFreqH/10+"Hz");
        $(".SetFreqL270").html(n.SetFreqL/10+"Hz");
    });
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
}
</script>
</body>
</html>