<!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='type788 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>GXEUPS</h1></td></tr>
        <tr><td style='width: 200px;'>基本信息</td><td>SID:<span class='SID788'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr788'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port788'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd788'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State788'> </span></td></tr>
    </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>运行参数</h1></td></tr>
        <tr><td >输入电压:<span class='VinA788'> </span>&nbsp;<span class='VinB788'> </span>&nbsp;<span class='VinC788'> </span></td><td> 输出电压:<span class='VoutA788'> </span>&nbsp;<span class='VoutB788'> </span>&nbsp;<span class='VoutC788'> </span></td><td>输出电流:<span class='IoutA788'> </span>&nbsp;<span class='IoutB788'> </span>&nbsp;<span class='IoutC788'> </span></td></tr>
        <tr><td>旁路电压:<span class='BV788'> </span></td><td>输入频率:<span class='Pin788'> </span></td><td>输出频率:<span class='Pout788'> </span></td></tr>
		<tr><td>旁路电流:<span class='BI788'> </span></td><td>旁路频率:<span class='BP788'> </span></td><td>交流输出有功功率:<span class='RPout788'> </span></td></tr>
		<tr><td>交流输出视在功率:<span class='APout788'> </span></td><td>交流输出负载百分比:<span class='Lodaout788'> </span></td><td>电池后备时间:<span class='Mbatt788'> </span></td></tr>
		<tr><td>直流输入电压:<span class='AVin788'> </span></td></tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>工作状态</h1></td></tr>
        <tr><td >供电方式:<span class='powerType788'> </span></td><td> 整流侧供电状态:<span class='powerStatus2788'> </span></td><td>电池充电状态:<span class='battCharge788'> </span></td><td >开机状态:<span class='powerStatus788'> </span></td></tr>
		
		<tr><td >电池自检状态 :<span class='battCheck788'> </span></td><td> 电池自检允许状态:<span class='battCheck2788'> </span></td><td>电池电压预告警状态:<span class='VbattAlam788'> </span></td></tr>
		
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=788;
var tescape= 5000,time;

<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbUpsGXE 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){
        $(".SID788").html(n.SID);
        $(".Addr788").html(n.Addr);
        $(".Port788").html(n.Port%256);
        $(".DateUpd788").html(n.DateUpd);
        $(".State788").html(window.parent.parseState(n.State));

        if(n.VinB==0x20)
			n.VinB=0;
		if(n.VinC==0x20)
			n.VinC=0;
		if(n.VoutB==0x20)
			n.VoutB=0;
		if(n.VoutC==0x20)
			n.VoutC=0;
		if(n.IoutB==0x20)
			n.IoutB=0;
		if(n.IoutC==0x20)
			n.IoutC=0;
        $(".VinA788").html(n.VinA/100+"V");
		$(".VinB788").html(n.VinB/100+"V");
		$(".VinC788").html(n.VinC/100+"V");
		
        $(".VoutA788").html(n.VoutA/100+"V");
		$(".VoutB788").html(n.VoutB/100+"V");
		$(".VoutC788").html(n.VoutC/100+"V");
		
        $(".AVin788").html(n.AVin/100+"V");
		
		$(".IoutA788").html(n.IoutA/100+"A");
		$(".IoutB788").html(n.IoutB/100+"A");
		$(".IoutC788").html(n.IoutC/100+"A");
		
        $(".BV788").html(n.BV/100+"V");
        $(".Pin788").html(n.Pin/100+"Hz");  
        $(".Pout788").html(n.Pout/100+"Hz");            

		$(".BI788").html(n.BI/100+"A");
        $(".BP788").html(n.BP/100+"Hz");  
        $(".RPout788").html(n.RPout/100+"kW");   

		$(".APout788").html(n.APout/100+"kVA");
        $(".Lodaout788").html(n.Lodaout/100+"%");  
        $(".Mbatt788").html(n.Mbatt+"Min");   
		
		var str="",str2="",str3="",str4="",str5="",str6="",str7="";
		if(n.powerType == 0x01)
			str = "UPS(逆变)供电";
		else if(n.powerType == 0x02)
			str = "旁路供电";
		else if(n.powerType == 0xE0)
			str = "均不供电(用户自定义)";
			
		if(n.powerStatus2 == 0xE0)
			str2 = "市电电池均不供电市";
		else if(n.powerStatus2 == 0xE1)
			str2 = "市电供电状态";
		else if(n.powerStatus2 == 0xE2)
			str2 = "电池供电状态";

		if(n.battCharge == 0xE0)
			str3 = "非充电非放电状态";
		else if(n.battCharge == 0xE1)
			str3 = "浮充状态";
		else if(n.battCharge == 0xE2)
			str3 = "均充状态";
		else if(n.battCharge == 0xE3)
			str3 = "放电状态";
			
		if(n.battCheck == 0xE0)
			str4 = "自检中";
		else if(n.battCheck == 0xE1)
			str4 = "不在自检";
		
		if(n.battCheck2 == 0xE0)
			str5 = "允许自检";
		else if(n.battCheck2 == 0xE1)
			str5 = "不能自检";
			
		if(n.VbattAlam == 0xE0)
			str6= "电池电压正常";
		else if(n.VbattAlam == 0xE1)
			str6 = "电池电压低预告警";

		if(n.powerStatus == 0xE0)
			str7= "关机状态";
		else if(n.powerStatus == 0xE1)
			str7 = "开机状态";

        $(".powerType788").html(str);
        $(".powerStatus2788").html(str2);
        $(".battCharge788").html(str3);
        $(".powerStatus788").html(str7);
        $(".battCheck788").html(str4);
        $(".battCheck2788").html(str5);
        $(".VbattAlam788").html(str6);

    })
    $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭')").addClass("red").removeClass("ger");
    $("span:contains('正常')").addClass("ger").removeClass("red");
}
</script>
</body>
</html>