<!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='type261 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='SID261'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr261'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port261'></span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd261'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State261'> </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='Ady261'> </span></td><td>B相电压:<span class='Bdy261'> </span></td><td>c相电压:<span class='Cdy261'> </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%' >A相电流:<span class='Adl261'> </span></td><td>B相电流:<span class='Bdl261'> </span></td><td>C相电流:<span class='Cdl261'> </span></td></tr>
    </table>

    <table width='100%' style='margin-top:10px'>
        <tr><td style='border: none'> <h1>其它(监测量)</h1></td> </tr>
        <tr><td style='width: 200px'>输出频率</td><td> 频率:<span class='pl261'> </span></span></td></tr>
        <tr><td style='width: 200px'>实际功率</td><td> 总实际功率:<span class='Zsjgl261'> </span>,&nbsp;&nbsp;A相:<span class='Asjgl261'> </span>,&nbsp;&nbsp;B相:<span class='Bsjgl261'> </span>,&nbsp;&nbsp;C相:<span class='Csjgl261'> </span></td></tr>
        <tr> <td style='width: 200px'>无功功率</td><td> 总无功功率:<span class='Zwggl261'> </span>,&nbsp;&nbsp;A相:<span class='Awggl261'> </span>,&nbsp;&nbsp;B相:<span class='Bwggl261'> </span>,&nbsp;&nbsp;C相:<span class='Cwggl261'> </span></td></tr>
        <tr> <td style='width: 200px'>功率因数</td><td> 总功率因数:<span class='Zglys261'> </span>,&nbsp;&nbsp;A相:<span class='Aglys261'> </span>,&nbsp;&nbsp;B相:<span class='Bglys261'> </span>,&nbsp;&nbsp;C相:<span class='Cglys261'> </span></td> </tr>
        <tr> <td style='width: 200px'>工作状态</td><td> 冷却液温度:<span class='OilTem261'> </span>,&nbsp;&nbsp;引擎油压:<span class='OilPre261'> </span>,&nbsp;&nbsp;电池电压:<span class='Vbatt261'> </span>,&nbsp;&nbsp;启停状态:<span class='OnOff261'></td> </tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=260;
var tescape= 5000,time;

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

        $(".SID261").html(n.SID);
        $(".Addr261").html(n.Addr);
        $(".Port261").html(n.Port%256);
        $(".DateUpd261").html(n.DateUpd);
        $(".State261").html(window.parent.parseState(n.State));

        $(".Ady261").html(n.ady/10+"V");
        $(".Bdy261").html(n.bdy/10+"V");
        $(".Cdy261").html(n.cdy/10+"V");

        $(".Adl261").html(n.adl/100+"A");
        $(".Bdl261").html(n.bdl/100+"A");
        $(".Cdl261").html(n.cdl/100+"A");

        $(".Zsjgl261").html(n.zsjgl+"W");
        $(".Asjgl261").html(n.asjgl+"W");
        $(".Bsjgl261").html(n.bsjgl+"W");
        $(".Csjgl261").html(n.csjgl+"W");
        $(".Zwggl261").html(n.zwggl+"Var");
        $(".Awggl261").html(n.awggl+"Var");
        $(".Bwggl261").html(n.bwggl+"Var");
        $(".Cwggl261").html(n.cwggl+"Var");
        $(".Zglys261").html(n.zglys/1000);
        $(".Aglys261").html(n.aglys/1000);
        $(".Bglys261").html(n.bglys/1000);
        $(".Cglys261").html(n.cglys/1000);
		
        $(".OilTem261").html(n.OilTem/100+"℃");
        $(".OilPre261").html(n.OilPre/100+"KPa");
        $(".Vbatt261").html(n.Vbatt/100+"V");
		if (0 == n.AutoOnOff)
			$(".OnOff261").html("停止");
		else if (1 == n.AutoOnOff)
			$(".OnOff261").html("自动");
		else if (2 == n.AutoOnOff)
			$(".OnOff261").html("运行");
		else
			$(".OnOff261").html("未知");
        $(".pl261").html(n.pl/10+"Hz");
    });
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
}
</script>
</body>
</html>