<!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='type790 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='SID790'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr790'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port790'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd790'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State790'> </span></td></tr>
    </table>

    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>运行参数</h1></td></tr>
        <tr><td >输入电压:<span class='VinA790'> </span>&nbsp;<span class='VinB790'> </span>&nbsp;<span class='VinC790'> </span></td><td> 输出电压:<span class='VoutA790'> </span>&nbsp;<span class='VoutB790'> </span>&nbsp;<span class='VoutC790'> </span></td><td >输入电流:<span class='IinA790'> </span>&nbsp;<span class='IinB790'> </span>&nbsp;<span class='IinC790'> </span></td><td>输出电流:<span class='IoutA790'> </span>&nbsp;<span class='IoutB790'> </span>&nbsp;<span class='IoutC790'> </span></td></tr>
        <tr><td>输入频率:<span class='FinA790'> </span>&nbsp;<span class='FinB790'> </span>&nbsp;<span class='FinC790'> </span></td><td>输出频率:<span class='FoutA790'> </span>&nbsp;<span class='FoutB790'> </span>&nbsp;<span class='FoutC790'> </span></td></tr>
		<tr><td>电池温度:<span class='Tem790'> </span></td><td>电池电压:<span class='Vbatt790'> </span></td><td>电池容量:<span class='Pbatt790'> </span></td><td>电池剩于时间:<span class='Mbatt790'> </span></td></tr>

    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>工作状态</h1></td></tr>
        <tr><td >电池连接状态:<span class='b15790'> </span></td><td> 整流器休眠状态:<span class='b14790'> </span></td><td>逆变器休眠状态:<span class='b13790'> </span></td><td >开机允许状态:<span class='p12790'> </span></td></tr>
        <tr><td >逆变器告警状态:<span class='b11790'> </span></td><td> 逆变器自检状态:<span class='b10790'> </span></td><td>逆变继电器状态:<span class='b9790'> </span></td><td >旁路告警状态:<span class='b8790'> </span></td></tr>
        <tr><td >电池告警状态:<span class='b7790'> </span></td><td> 电池自检状态:<span class='b6790'> </span></td><td>整流器限功率状态:<span class='b5790'> </span></td><td >放电器告警状态:<span class='b4790'> </span></td></tr>
        <tr><td >旁路通讯失败:<span class='b3790'> </span></td><td> 旁路配置失败:<span class='b2790'> </span></td><td>旁路供电状态:<span class='b1790'> </span></td><td >旁路接管状态:<span class='b0790'> </span></td></tr>
	</table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=790;
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){
        $(".SID790").html(n.SID);
        $(".Addr790").html(n.Addr);
        $(".Port790").html(n.Port%256);
        $(".DateUpd790").html(n.DateUpd);
        $(".State790").html(window.parent.parseState(n.State));

        $(".VinA790").html(n.Vin1/10+"V");
		$(".VinB790").html(n.Vin2/10+"V");
		$(".VinC790").html(n.Vin3/10+"V");
		
        $(".VoutA790").html(n.Vout1/10+"V");
		$(".VoutB790").html(n.Vout2/10+"V");
		$(".VoutC790").html(n.Vout3/10+"V");
		
		$(".IinA790").html(n.Iin1/10+"A");
		$(".IinB790").html(n.Iin2/10+"A");
		$(".IinC790").html(n.Iin3/10+"A");
		
		$(".IoutA790").html(n.Iout1/10+"A");
		$(".IoutB790").html(n.Iout2/10+"A");
		$(".IoutC790").html(n.Iout3/10+"A");
		
		$(".FinA790").html(n.Fin1/10+"Hz");
		$(".FinB790").html("");
		$(".FinC790").html("");
		
		$(".FoutA790").html(n.Fout1/10+"Hz");
		$(".FoutB790").html("");
		$(".FoutC790").html("");
		
        $(".Tem790").html(n.Tem/10+"℃");  
        $(".Vbatt790").html(n.Vbatt/10+"V");            
		$(".Pbatt790").html(n.Pbatt/10+"%");
        $(".Mbatt790").html(n.Mbatt/10+"min");  
		
		var str = "未连接";
		if (n.b15)
			str = "已连接"
        $(".b15790").html(str);
		
		str = "非休眠";
		if (n.b14)
			str = "休眠"
        $(".b14790").html(str);
		
		str = "非休眠";
		if (n.b13)
			str = "休眠"
        $(".b13790").html(str);
		
		str = "不允许";
		if (n.b12)
			str = "允许"
        $(".b12790").html(str);
		
		str = "正常";
		if (n.b11)
			str = "告警"
        $(".b11790").html(str);
		
		str = "未自检";
		if (n.b10)
			str = "自检中"
        $(".b10790").html(str);
		
		str = "断开";
		if (n.b9)
			str = "闭合"
        $(".b9790").html(str);
		
		str = "正常";
		if (n.b8)
			str = "告警"
        $(".b8790").html(str);
		
		str = "否";
		if (n.b7)
			str = "是"
        $(".b7790").html(str);
		
		str = "否";
		if (n.b6)
			str = "是"
        $(".b6790").html(str);
		
		str = "未限功率";
		if (n.b5)
			str = "限功率"
        $(".b5790").html(str);
		
		str = "正常";
		if (n.b4)
			str = "告警"
        $(".b4790").html(str);
		
		str = "正常";
		if (n.b3)
			str = "通讯失败"
        $(".b3790").html(str);
		
		str = "正常";
		if (n.b2)
			str = "配置失败"
        $(".b2790").html(str);
		
		str = "非旁路供电";
		if (n.b1)
			str = "旁路供电"
        $(".b1790").html(str);
		
		str = "旁路没有接管";
		if (n.b0)
			str = "旁路被接管"
        $(".b0790").html(str);

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