<!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='type259 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='SID259'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr259'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port259'></span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd259'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State259'> </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='StSen259'> </span>,&nbsp;&nbsp;风机状态:<span class='StWind259'> </span>,&nbsp;&nbsp;报警状态:<span class='StAlm259'> </span>,&nbsp;&nbsp;闸刀状态:<span class='StTrip259'> </span></td></tr>
        <tr> <td style='width: 200px'>A相</td><td> 温度:<span class='TemA259'> </span>,&nbsp;&nbsp;传感器状态:<span class='StSenA259'> </tr>
        <tr> <td style='width: 200px'>B相</td><td> 温度:<span class='TemB259'> </span>,&nbsp;&nbsp;传感器状态:<span class='StSenB259'>  </tr>
        <tr> <td style='width: 200px'>C相</td><td> 温度:<span class='TemC259'> </span>,&nbsp;&nbsp;传感器状态:<span class='StSenC259'>  </tr>
        <tr> <td style='width: 200px'>铁心</td><td> 温度:<span class='TemI259'> </span>,&nbsp;&nbsp;传感器状态:<span class='StSenI259'> </tr>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
    var itype=259;
    var tescape= 5000,time;
	
<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbTransf 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){

            $(".SID259").html(n.SID);
            $(".Addr259").html(n.Addr);
            $(".Port259").html(n.Port%259);
            $(".DateUpd259").html(n.DateUpd);
            $(".State259").html(window.parent.parseState(n.State));

            $(".StSen259").html(SensorState(n.StSen));
			
			if (0 == n.StWind)
				n.StWind = "关机";
			else
				n.StWind = "开机";
            $(".StWind259").html(n.StWind);
			
			if (0 == n.StAlm)
				n.StAlm = "正常";
			else
				n.StAlm = "告警";
            $(".StAlm259").html(n.StAlm);
			
			if (0 == n.StTrip)
				n.StTrip = "正常";
			else
				n.StTrip = "跳闸";
            $(".StTrip259").html(n.StTrip);
			
            $(".TemA259").html(n.TemA + "℃");
            $(".TemB259").html(n.TemB + "℃");
            $(".TemC259").html(n.TemC + "℃");
            $(".TemI259").html(n.TemI + "℃");
			
            $(".StSenA259").html(SensorState(n.StSenA));
            $(".StSenB259").html(SensorState(n.StSenB));
            $(".StSenC259").html(SensorState(n.StSenC));
            $(".StSenI259").html(SensorState(n.StSenI));
        });
        $("span:contains('故障'),span:contains('告警'),span:contains('闭合'),span:contains('关闭'),span:contains('开机'),span:contains('跳闸')").addClass("red").removeClass("ger");
        $("span:contains('正常'),span:contains('关机')").addClass("ger").removeClass("red");
    }
	
	function SensorState(st)
	{
		var str;
		if (0 == st)
			str = "正常";
		else
			str = "故障";
		return str;
	}
</script>
</body>
</html>