<!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>
    <script src="js/omara.js"></script>

</head>
<body style="background: #F3F3F3">
<div class='empty' style=' margin: 10px;'>
  <table width="100%">
    <tr>
    <td width="300px" style="text-align: center;"><img src="img/ico-cyber.png" style="width: 60%;text-align: center;"></td>
    <td>
    <table width='100%'>
        <tr><td style='border: none'> <h1 class='smName'></h1></td></tr>
        <tr><td style='width: 200px;'>基本信息</td><td>SID:<span class='SID2098'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr2098'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port2098'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd2098'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State2098'> </span></td></tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>基本信息</h1></td></tr>
		<tr><td width='25%'>温度设定值（白天）：<span class='TemSetDay2098'></span></td>
		    <td width='25%'>温度设定值（夜晚）：<span class='TemSetNight2098'></span></td>
		    <td width='25%'>湿度设定值：<span class='HumSet2098'></span></td>
			<td width='25%'>回风温度：<span class='TemRet2098'></span></td></tr>
		<tr><td width='25%'>回风湿度：<span class='HumRet2098'></span></td>
		    <td width='25%'>送风温度：<span class='TemSup2098'></span></td>
		    <td width='25%'>送风湿度：<span class='HumSup2098'></span></td>
			<td width='25%'><span class='2098'></span></td></tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>机组状态信息</h1></td></tr>
		<tr><td width='25%'>机组状态：<span class='StMachime2098'></span></td>
		    <td width='25%'>制冷模式：<span class='StCoolingMode2098'></span></td>
		    <td width='25%'>加热模式：<span class='StHeatingMode2098'></span></td>
			<td width='25%'>加湿模式：<span class='StHumidMode2098'></span></td></tr>
		<tr><td width='25%'>除湿模式：<span class='StDehumidMode2098'></span></td>
		    <td width='25%'>漏水报警：<span class='AlmLeak2098'></span></td>
		    <td width='25%'>压缩机 1 运行：<span class='StCompr12098'></span></td>
			<td width='25%'>压缩机 2 运行：<span class='StCompr22098'></span></td></tr>
		<tr><td width='25%'>电加热1运行：<span class='StElcHeat12098'></span></td>
		    <td width='25%'>电加热2运行：<span class='StElcHeat22098'></span></td>
		    <td width='25%'>电加热3运行：<span class='StElcHeat32098'></span></td>
			<td width='25%'>加湿器运行：<span class='StHumid12098'></span></td></tr>
		<tr><td width='25%'>风机运行：<span class='StFan12098'></span></td>
			<td width='25%'><span class='2098'></span></td>
		    <td width='25%'><span class='2098'></span></td>
		    <td width='25%'><span class='2098'></span></td></tr>
    </table>
    <table width='100%' style='margin-top: 30px'>
        <tr><td style='border: none'> <h1>机组报警信息</h1></td></tr>
		<tr><td width='25%'>回风温度太高报警：<span class='AlmreturnAtempHigh2098'></span></td>
		    <td width='25%'>回风温度太低报警：<span class='AlmreturnAtempLow2098'></span></td>
		    <td width='25%'>回风湿度太高报警：<span class='AlmreturnAhumidHigh2098'></span></td>
			<td width='25%'>回风湿度太低报警：<span class='AlmreturnAhumidLow2098'></span></td></tr>
		<tr><td width='25%'>送风温度太高报警：<span class='AlmsupplyAtempHigh2098'></span></td>
		    <td width='25%'>送风温度太低报警：<span class='AlmsupplyAtempLow2098'></span></td>
		    <td width='25%'>送风湿度太高报警：<span class='AlmsupplyAhumidHigh2098'></span></td>
			<td width='25%'>送风湿度太低报警：<span class='AlmsupplyAhumidLow2098'></span></td></tr>
		<tr><td width='25%'>高压/压缩机报警：<span class='AlmCompr1High2098'></span></td>
		    <td width='25%'>回路 1 低压报警：<span class='AlmCompr1Low2098'></span></td>
		    <td width='25%'>高压/压缩机报警：<span class='AlmCompr2High2098'></span></td>
			<td width='25%'>回路 2 低压报警：<span class='AlmCompr2Low2098'></span></td></tr>
		<tr><td width='25%'>相序报警：<span class='AlmPhaseCheck2098'></span></td>
			<td width='25%'>火灾报警：<span class='AlmFire2098'></span></td>
		    <td width='25%'>风机报警：<span class='AlmFan12098'></span></td>
			<td width='25%'>电加热报警：<span class='AlmElcHeat2098'></span></td></tr>
		<tr><td width='25%'>加湿器报警：<span class='AlmHumid2098'></span></td>
		    <td width='25%'>空气过滤网报警：<span class='Almfan1Filter2098'></span></td>
		    <td width='25%'><span class='2098'></span></td>
			<td width='25%'><span class='2098'></span></td></tr>
    </table>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
var itype=2098;
var tescape= 5000,time;
  
<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbCyberStulzC7000CPDU_A where SID="+sid,0);%>;
var jname = <% db_QryAdv("select Name from tbSM where SID="+sid,0); %>
<% db_Close(); %>

$(".smName").html(jname.recs[0].Name);
	
$(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){
	if (data.reccnt == 0)
		return;
    $.each(data.recs,function(i,n){
        $(".SID2098").html(n.SID);
        $(".Addr2098").html(n.Addr);
        $(".Port2098").html(n.Port%256);
        $(".DateUpd2098").html(n.DateUpd);
        $(".State2098").html(parseState(n.State));
		
		$(".StMachime2098").html((n.StMachime) ? "开" : "关");
		$(".StCoolingMode2098").html((n.StCoolingMode) ? "开" : "关");
		$(".StHeatingMode2098").html((n.StHeatingMode) ? "开" : "关");
		$(".StHumidMode2098").html((n.StHumidMode) ? "开" : "关");
		$(".StDehumidMode2098").html((n.StDehumidMode) ? "开" : "关");
		$(".AlmLeak2098").html((n.AlmLeak) ? "是" : "否");
		$(".AlmPhaseCheck2098").html((n.AlmPhaseCheck) ? "是" : "否");
		$(".AlmFire2098").html((n.AlmFire) ? "是" : "否");
		$(".AlmreturnAtempHigh2098").html((n.AlmreturnAtempHigh) ? "是" : "否");
		$(".AlmreturnAtempLow2098").html((n.AlmreturnAtempLow) ? "是" : "否");
		$(".AlmreturnAhumidHigh2098").html((n.AlmreturnAhumidHigh) ? "是" : "否");
		$(".AlmreturnAhumidLow2098").html((n.AlmreturnAhumidLow) ? "是" : "否");
		$(".AlmsupplyAtempHigh2098").html((n.AlmsupplyAtempHigh) ? "是" : "否");
		$(".AlmsupplyAtempLow2098").html((n.AlmsupplyAtempLow) ? "是" : "否");
		$(".AlmsupplyAhumidHigh2098").html((n.AlmsupplyAhumidHigh) ? "是" : "否");
		$(".AlmsupplyAhumidLow2098").html((n.AlmsupplyAhumidLow) ? "是" : "否");
		$(".TemSetDay2098").html((n.TemSetDay/10) + "℃");
		$(".TemSetNight2098").html((n.TemSetNight/10) + "℃");
		$(".HumSet2098").html((n.HumSet/10) + "％");
		$(".TemRet2098").html((n.TemRet/10) + "℃");
		$(".HumRet2098").html((n.HumRet/10) + "％");
		$(".TemSup2098").html((n.TemSup/10) + "℃");
		$(".HumSup2098").html((n.HumSup/10) + "％");
		$(".AlmElcHeat2098").html((n.AlmElcHeat) ? "是" : "否");
		$(".StElcHeat12098").html((n.StElcHeat1) ? "开" : "关");
		$(".StElcHeat22098").html((n.StElcHeat2) ? "开" : "关");
		$(".StElcHeat32098").html((n.StElcHeat3) ? "开" : "关");
		$(".StHumid12098").html((n.StHumid1) ? "开" : "关");
		$(".AlmHumid2098").html((n.AlmHumid) ? "是" : "否");
		$(".Almfan1Filter2098").html((n.Almfan1Filter) ? "是" : "否");
		$(".StFan12098").html((n.StFan1) ? "开" : "关");
		$(".AlmFan12098").html((n.AlmFan1) ? "开" : "关");
		$(".AlmCompr1High2098").html((n.AlmCompr1High) ? "是" : "否");
		$(".AlmCompr1Low2098").html((n.AlmCompr1Low) ? "是" : "否");
		$(".AlmCompr2High2098").html((n.AlmCompr2High) ? "是" : "否");
		$(".AlmCompr2Low2098").html((n.AlmCompr2Low) ? "是" : "否");
		$(".StCompr12098").html((n.StCompr1) ? "开" : "关");
		$(".StCompr22098").html((n.StCompr2) ? "开" : "关");
    })

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

function parseAlm(istate){
    if(istate==0) return "正常";
    else   if(istate==1) return "告警";
    else return "无效";
}

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

function alarmState(istate){
    if(istate==0) return "正常";
    else   if(istate==1) return "短路";
    else return "开路";
}

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