<!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='type1304 empty' style=' margin: 10px;'>
  <table width="100%">
    <tr>
    <td width="300px" style="text-align: center;"><img src="img/ico-envir.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='SID1304'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr1304'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port1304'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd1304'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State1304'> </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%' >氧气浓度 :<span class='O2_1304'> </span></td>
         <td style='width: 33%' > <span class='1304'> </span></td>
		     <td style='width: 33%' > <span class='1304'> </span></td>
		  </tr>

    </table>
  
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
    </div>
<script>
var itype=1304;
var tescape= 5000,time;

<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var tag1=<% write(db_QryInt("select Tag1 from tbSM where SID="+sid,1));%>;
var json=<% db_QryAdv("select * from tbEnvirJXBS4001O2 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){
        $(".SID1304").html(n.SID);
        $(".Addr1304").html(n.Addr);
        $(".Port1304").html(n.Port%256);
        $(".DateUpd1304").html(n.DateUpd);
        $(".State1304").html(parseState(n.State));

		{
			
			$(".O2_1304").html(n.O2/10+"%");
			
		}

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

function parseState(istate)
{
    if(istate==0) return "正常";
    else   if(istate==1) return "告警";
    else return "故障";
}



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