<!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='type1024 empty' style='margin: 10px;'>
  <table width="100%">
    <tr>
    <td width="300px" style="text-align: center;"><img src="img/ico-batt.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='SID1024'></span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr1024'></span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port1024'></span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd1024'></span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State1024'></span></td></tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td ><span class='grey'>#01</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy11024'></span></td><td ><span class='grey'>#02</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy21024'></span></td><td ><span class='grey'>#03</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy31024'></span></td><td ><span class='grey'>#04</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy41024'></span></td><td ><span class='grey'>#05</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy51024'></span></td><td ><span class='grey'>#06</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy61024'></span></td></tr>
        <tr><td ><span class='grey'>#07</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy71024'></span></td><td ><span class='grey'>#08</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy81024'></span></td><td ><span class='grey'>#09</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy91024'></span></td><td ><span class='grey'>#10</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy101024'></span></td><td ><span class='grey'>#11</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy111024'></span></td><td ><span class='grey'>#12</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy121024'></span></td></tr>
        <tr><td ><span class='grey'>#13</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy131024'></span></td><td ><span class='grey'>#14</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy141024'></span></td><td ><span class='grey'>#15</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy151024'></span></td><td ><span class='grey'>#16</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy161024'></span></td><td ><span class='grey'>#17</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy171024'></span></td><td ><span class='grey'>#18</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy181024'></span></td></tr>
        <tr><td ><span class='grey'>#19</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy191024'></span></td><td ><span class='grey'>#20</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy201024'></span></td><td ><span class='grey'>#21</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy211024'></span></td><td ><span class='grey'>#22</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy221024'></span></td><td ><span class='grey'>#23</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy231024'></span></td><td ><span class='grey'>#24</span>&nbsp;&nbsp;电压:&nbsp;&nbsp;<span class='Dy241024'></span></td></tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td>电池组总电压:<span class='Dczdy1024'></span></td><td>充放电电流:<span class='Cfddl1024'></span></td><td>电池温度:<span class='Dcwd1024'></span></td></tr>
        <tr><td>电流传感器量程:<span class='Lc1024'></span></td><td>电池数量:<span class='Dcsl1024'></span></td><td>电池型号:<span class='Dcxh1024'></span></td></tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
var itype=1024;
var tescape= 5000,time;

<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbBattDb100 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){
            if(n.Dcxh==0){
                n.Dcxh="单体2V";
            }else if(n.Dcxh==2){
                n.Dcxh= "单体6V"
            }else if(n.Dcxh==4){
                n.Dcxh="单体12V"
            }
            $(".SID1024").html(n.SID);
            $(".Addr1024").html(n.Addr);
            $(".Port1024").html(n.Port%256);
            $(".DateUpd1024").html(n.DateUpd);
            $(".State1024").html(window.parent.parseState(n.State));

            $(".Dy11024").html(n.Dy1/1000+"V");
            $(".Dy21024").html(n.Dy2/1000+"V");
            $(".Dy31024").html(n.Dy3/1000+"V");
            $(".Dy41024").html(n.Dy4/1000+"V");
            $(".Dy51024").html(n.Dy5/1000+"V");
            $(".Dy61024").html(n.Dy6/1000+"V");
            $(".Dy71024").html(n.Dy7/1000+"V");
            $(".Dy81024").html(n.Dy8/1000+"V");
            $(".Dy91024").html(n.Dy9/1000+"V");
            $(".Dy101024").html(n.Dy10/1000+"V");
            $(".Dy111024").html(n.Dy11/1000+"V");
            $(".Dy121024").html(n.Dy12/1000+"V");
            $(".Dy131024").html(n.Dy13/1000+"V");
            $(".Dy141024").html(n.Dy14/1000+"V");
            $(".Dy151024").html(n.Dy15/1000+"V");
            $(".Dy161024").html(n.Dy16/1000+"V");
            $(".Dy171024").html(n.Dy17/1000+"V");
            $(".Dy181024").html(n.Dy18/1000+"V");
            $(".Dy191024").html(n.Dy19/1000+"V");
            $(".Dy201024").html(n.Dy20/1000+"V");
            $(".Dy211024").html(n.Dy21/1000+"V");
            $(".Dy221024").html(n.Dy22/1000+"V");
            $(".Dy231024").html(n.Dy23/1000+"V");
            $(".Dy241024").html(n.Dy24/1000+"V");

            $(".Dczdy1024").html(n.Dczdy/100+"V");
            $(".Cfddl1024").html(n.Cfddl/100+"A");
            $(".Dcwd1024").html(n.Dcwd/10+"℃");
            $(".Lc1024").html(n.Lc/100);
            $(".Dcsl1024").html(n.Dcsl);
            $(".Dcxh1024").html(n.Dcxh);
        });
        $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
        $("span:contains('正常')").addClass("ger").removeClass("red");
    }
</script>
</body>
</html>