<!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='type797 empty' style=' margin: 10px;'>
  <table width="100%">
    <tr>
    <td width="300px" style="text-align: center;"><img src="img/ico-ups.png" style="width: 50%;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='SID797'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr797'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port797'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd797'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State797'> </span></td></tr>
    </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>运行参数</h1></td></tr>
        <tr>
			<td >输入电压:<span class='VinA797'> </span>&nbsp;<span class='VinB797'> </span>&nbsp;<span class='VinC797'> </span></td>
			<td> 输出电压:<span class='VoutA797'> </span>&nbsp;<span class='VoutB797'> </span>&nbsp;<span class='VoutC797'> </span></td>
			<td> 旁路电压:<span class='VBA797'> </span>&nbsp;<span class='VBB797'> </span>&nbsp;<span class='VBC797'> </span></td>
		</tr>
		<tr>
			<td>输入频率:<span class='FinA797'> </span>&nbsp;<span class='FinB797'> </span>&nbsp;<span class='FinC797'> </span></td>
			<td>输出频率:<span class='FoutA797'> </span>&nbsp;<span class='FoutB797'> </span>&nbsp;<span class='FoutC797'> </span></td>
			<td>旁路频率:<span class='FBA797'> </span>&nbsp;<span class='FBB797'> </span>&nbsp;<span class='FBC797'> </span></td>
		</tr>
		<tr>
			<td>输出电流:<span class='IoutA797'> </span>&nbsp;<span class='IoutB797'> </span>&nbsp;<span class='IoutC797'> </span></td>
			<td ><span class='IinA797'> </span>&nbsp;<span class='IinB797'> </span>&nbsp;<span class='IinC797'> </span></td>
			<td> <span class='IBA797'> </span>&nbsp;<span class='IBB797'> </span>&nbsp;<span class='IBC797'> </span></td>
		</tr>
        <tr>
			<td>电池电压:<span class='Vbatt797'> </span></td>
			<td>电池温度:<span class='Tem797'> </span></td>
			<td>电池剩于时间:<span class='Mbatt797'> </span></td>
		</tr>
		<tr>
			<td>电池容量:<span class='Pbatt797'> </span></td>
			<td> <span class='v1797'> </span></td>
			<td> <span class='xx797'> </span></td>
		</tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>工作状态</h1></td></tr>
        <tr>
			<td >供电模式:<span class='b15797'> </span></td>
			<td> 输入制式:<span class='b14797'> </span></td>
			<td>输出制式:<span class='b13797'> </span></td>
			<td >开机状态:<span class='b12797'> </span></td>
		</tr>
			<tr><td >单机ECO:<span class='b11797'> </span></td>
			<td> 电池状态:<span class='b10797'> </span></td>
			<td>主路相序反:<span class='b9797'> </span></td>
			<td >主路零线缺失:<span class='b8797'> </span></td>
		</tr>
        <tr>
			<td >主路欠压:<span class='b7797'> </span></td>
			<td> 主路过载:<span class='b6797'> </span></td>
			<td>内部过温:<span class='b5797'> </span></td>
			<td >整流器告警:<span class='b4797'> </span></td>
		</tr>
        <tr>
			<td >电池过温:<span class='b3797'> </span></td>
			<td> 电池低温:<span class='b2797'> </span></td>
			<td>电池过压:<span class='b1797'> </span></td>
			<td >电池过流:<span class='b0797'> </span></td>
		</tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=797;
var tescape= 5000,time;

<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbUpsEx 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){
        $(".SID797").html(n.SID);
        $(".Addr797").html(n.Addr);
        $(".Port797").html(n.Port%256);
        $(".DateUpd797").html(n.DateUpd);
        $(".State797").html(window.parent.parseState(n.State));

        $(".VinA797").html(n.Vin1/10+"V");
		$(".VinB797").html(n.Vin2/10+"V");
		$(".VinC797").html(n.Vin3/10+"V");
		
        $(".VoutA797").html(n.Vout1/10+"V");
		$(".VoutB797").html(n.Vout2/10+"V");
		$(".VoutC797").html(n.Vout3/10+"V");
		
        $(".VBA797").html(n.VB1/10+"V");
		$(".VBB797").html(n.VB2/10+"V");
		$(".VBC797").html(n.VB3/10+"V");
		
		//$(".IinA797").html(n.Iin1/10+"A");
		//$(".IinB797").html(n.Iin2/10+"A");
		//$(".IinC797").html(n.Iin3/10+"A");
		
		$(".IoutA797").html(n.Iout1/10+"A");
		$(".IoutB797").html(n.Iout2/10+"A");
		$(".IoutC797").html(n.Iout3/10+"A");
		
		//$(".IBA797").html(n.IB1/10+"A");
		//$(".IBB797").html(n.IB2/10+"A");
		//$(".IBC797").html(n.IB3/10+"A");
		
		$(".FinA797").html(n.Fin1/10+"Hz");
		$(".FinB797").html(n.Fin2/10+"Hz");
		$(".FinC797").html(n.Fin3/10+"Hz");
		
		$(".FoutA797").html(n.Fout1/10+"Hz");
		$(".FoutB797").html(n.Fout2/10+"Hz");
		$(".FoutC797").html(n.Fout3/10+"Hz");
		
		$(".FBA797").html(n.FB1/10+"Hz");
		$(".FBB797").html(n.FB2/10+"Hz");
		$(".FBC797").html(n.FB3/10+"Hz");
		
        $(".Tem797").html(n.Tem/10+"℃");  
        $(".Vbatt797").html(n.Vbatt+"V");            
		$(".Pbatt797").html(n.Pbatt+"%");
        $(".Mbatt797").html(n.Mbatt+"min");  
		
		if (n.b15 == 0)
			n.b15 = "不供电";
		else if (n.b15 == 1)
			n.b15 = "旁路";
		else if (n.b15 == 2)
			n.b15 = "主路";
		else if (n.b15 == 3)
			n.b15 = "电池";
		else if (n.b15 == 4)
			n.b15 = "主路ECO";
		else if (n.b15 == 5)
			n.b15 = "电池ECO";
		else
			n.b15 = "未知";
        $(".b15797").html(n.b15);
		
		if (n.b14 == 0)
			n.b14 = "单相";
		else
			n.b14 = "三相";
        $(".b14797").html(n.b14);
		
		if (n.b13 == 0)
			n.b13 = "单相";
		else
			n.b13 = "三相";
        $(".b13797").html(n.b13);
		
		if (n.b12 == 0)
			n.b12 = "关机";
		if (n.b12 == 1)
			n.b12 = "开机中";
		if (n.b12 == 2)
			n.b12 = "开机失败";
		if (n.b12 == 3)
			n.b12 = "开机完成";
		else
			n.b12 = "未知";
        $(".b12797").html(n.b12);
		
        $(".b11797").html(n.b11 ? "允许" : "禁止");
		
		if (n.b10 == 2)
			n.b10 = "休眠";
		if (n.b10 == 3)
			n.b10 = "浮充";
		if (n.b10 == 4)
			n.b10 = "均充";
		if (n.b10 == 5)
			n.b10 = "放电";
		else
			n.b10 = "未知";
        $(".b10797").html(n.b10);
		
        $(".b9797").html(n.b9 ? "是" : "否");
        $(".b8797").html(n.b8 ? "是" : "否");
        $(".b7797").html(n.b7 ? "是" : "否");
        $(".b6797").html(n.b6 ? "是" : "否");
        $(".b5797").html(n.b5 ? "是" : "否");
        $(".b4797").html(n.b4 ? "是" : "否");
        $(".b3797").html(n.b3 ? "是" : "否");
        $(".b2797").html(n.b2 ? "是" : "否");
        $(".b1797").html(n.b1 ? "是" : "否");
        $(".b0797").html(n.b0 ? "是" : "否");

    })
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭'),span:contains('异常'),span:contains('是')").addClass("red").removeClass("ger");
    $("span:contains('正常'),span:contains('否')").addClass("ger").removeClass("red");
}

</script>
</body>
</html>