<!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='type264 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='SID264'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr264'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port264'></span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd264'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State264'> </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='Uac1264'> </span></td><td>B相电压:<span class='Uac2264'> </span></td><td>c相电压:<span class='Uac3264'> </span></td></tr>
        <tr><td  style='width: 33%' >直流母线电压:<span class='Udc1264'> </span></td><td>直流母线电流:<span class='Idc1264'> </span></td><td><span> </span></td></tr>
        <tr><td  style='width: 33%' >蓄电池组电压:<span class='Ubat264'> </span></td><td>蓄电池组电流:<span class='Ibat264'> </span></td><td><span > </span></td></tr>
    </table>

    <table width='100%' style='margin-top:10px'>
        <tr><td style='border: none'> <h1>状态(监测量)</h1></td> </tr>
        <tr><td> 系统总故障:<span class='sysst264'> </span></td></tr>
        <tr><td> 电池充电方式:<span class='batchmod264'> </span></td><td>交流供电回路:<span class='acmod264'> </span></td><td><span class='Byggl264'> </span></td><td><span class='Cyggl264'> </span></td></tr>
        <tr><td> 1号充电模块故障:<span class='chst1264'> </span></td><td>2号充电模块故障:<span class='chst2264'> </span></td><td>3号充电模块故障:<span class='chst3264'> </span></td><td>4号充电模块故障:<span class='chst4264'> </span></td></tr>
        <tr><td> 5号充电模块故障:<span class='chst5264'> </span></td><td>6号充电模块故障:<span class='chst6264'> </span></td><td>7号充电模块故障:<span class='chst7264'> </span></td><td>8号充电模块故障:<span class='chst8264'> </span></td> </tr>
        <tr><td> 交流电源故障:<span class='acst264'> </span></td><td>控制母线过压:<span class='mov264'> </span></td><td>控制母线欠压:<span class='mnv264'> </span></td><td>蓄电池组欠压:<span class='bnv264'> </span></td> </tr>
		<tr><td> 电池熔断器故障:<span class='batst264'> </span></td><td>电池开关断开:<span class='batswst264'> </span></td><td>馈出支路开关跳闸:<span class='rest264'> </span></td><td><span > </span></td> </tr>
	</table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=264;
var tescape= 5000,time;

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

        $(".SID264").html(n.SID);
        $(".Addr264").html(n.Addr);
        $(".Port264").html(n.Port%256);
        $(".DateUpd264").html(n.DateUpd);
        $(".State264").html(window.parent.parseState(n.State));

        $(".Uac1264").html(n.Uac1/10+"V");
        $(".Uac2264").html(n.Uac2/10+"V");
        $(".Uac3264").html(n.Uac3/10+"V");

        $(".Udc1264").html(n.Udc1/10+"V");
        $(".Idc1264").html(n.Idc1/10+"A");
        $(".Ubat264").html(n.Ubat/10+"V");
        $(".Ibat264").html(n.Ibat/10+"A");

        $(".sysst264").html(_asertState(n.sysst));
        $(".batchmod264").html(n.batchmod ? "浮充": "浮充");
        $(".acmod264").html(n.acmod ? "2路" : "2路");
        $(".chst1264").html(_asertState(n.chst1));
        $(".chst2264").html(_asertState(n.chst2));
        $(".chst3264").html(_asertState(n.chst3));
        $(".chst4264").html(_asertState(n.chst4));
        $(".chst5264").html(_asertState(n.chst5));
        $(".chst6264").html(_asertState(n.chst6));
        $(".chst7264").html(_asertState(n.chst7));
        $(".chst8264").html(_asertState(n.chst8));
        $(".acst264").html(_asertState(n.acst));
        $(".mov264").html(_asertState(n.mov));
        $(".mnv264").html(_asertState(n.mnv));
        $(".bnv264").html(_asertState(n.bnv));
        $(".batst264").html(_asertState(n.batst));
        $(".batswst264").html(_asertState(n.batswst));
        $(".rest264").html(_asertState(n.rest));
    });
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
}

function _asertState(st)
{
	var state = "是";
	if (st == 0) {
		state = "否";
	}
	return state;
}
</script>
</body>
</html>