<!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='SID2095'> </span>&nbsp;&nbsp;&nbsp;编址:<span class='Addr2095'> </span>&nbsp;&nbsp;&nbsp;数据端口:<span class='Port2095'> </span></td></tr>
        <tr><td style='width: 200px;'>更新时间</td><td><span class='DateUpd2095'> </span></td></tr>
        <tr><td style='width: 200px;'>监测项状态</td><td><span class='State2095'> </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='workmode2095'></span></td>
		    <td width='25%'>室内温度校正:<span class='TemRoomClib2095'></span></td>
			<td width='25%'>室内湿度校正:<span class='HumRoomClib2095'></span></td>
		    <td width='25%'>湿度设置:<span class='HumSet2095'></span></td></tr>
		<tr><td width='25%'>温度设置:<span class='TemSet2095'></span></td>
		    <td width='25%'>送风温度:<span class='TemSup2095'></span></td>
			<td width='25%'>室内温度:<span class='TemRoom2095'></span></td>
		    <td width='25%'>室内湿度:<span class='HumRoot2095'></span></td></tr>
		<tr><td width='25%'>加湿器电流:<span class='CurHumer2095'></span></td>
		    <td width='25%'><span class='2095'></span></td>
			<td width='25%'><span class='2095'></span></td>
		    <td width='25%'><span class='2095'></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='StfSenSup2095'></span></td>
			<td width='25%'>冷却出水:<span class='StfSenCols2095'></span></td>
		    <td width='25%'>冷却回水:<span class='StfSenColr2095'></span></td>
		    <td width='25%'>火灾报警:<span class='AlmFire2095'></span></td></tr>
		<tr><td width='25%'>回风温度探头故障:<span class='StfSenTemr2095'></span></td>
			<td width='25%'>回风湿度探头故障:<span class='StfSemHumr2095'></span></td>
		    <td width='25%'>水溢报警:<span class='AlmWaterOv2095'></span></td>
		    <td width='25%'>水浸报警:<span class='AlmLeak2095'></span></td></tr>
		<tr><td width='25%'>低湿报警:<span class='AlmHumLow2095'></span></td>
			<td width='25%'>高湿报警:<span class='AlmHumHigh2095'></span></td>
		    <td width='25%'>低温报警:<span class='AlmTemLow2095'></span></td>
		    <td width='25%'>高温报警:<span class='AlmTemHigh2095'></span></td></tr>
		<tr><td width='25%'>压缩机一高压:<span class='StfComp1High2095'></span></td>
			<td width='25%'>压缩机一低压:<span class='StfComp1Low2095'></span></td>
		    <td width='25%'>外风机一过载:<span class='StfComp1Ov2095'></span></td>
		    <td width='25%'>压缩机二高压:<span class='StfComp2High2095'></span></td></tr>
		<tr><td width='25%'>压缩机二低压:<span class='StfComp2Low2095'></span></td>
			<td width='25%'>外风机二过载:<span class='StfComp2Ov2095'></span></td>
		    <td width='25%'>制热保护:<span class='StfHeaterPro2095'></span></td>
		    <td width='25%'>冷却水泵过载:<span class='StfColWaterOv2095'></span></td></tr>
		<tr><td width='25%'>冷却水流开关:<span class='StfColWaterOn2095'></span></td>
			<td width='25%'>送风温度过高过低:<span class='StfTemSup2095'></span></td>
		    <td width='25%'>电源故障:<span class='StfPow2095'></span></td>
		    <td width='25%'>失风报警:<span class='AlmLostAir2095'></span></td></tr>
		<tr><td width='25%'>滤网堵塞:<span class='AlmFilter2095'></span></td>
			<td width='25%'>高电流报警:<span class='AlmCurHigh2095'></span></td>
		    <td width='25%'>低电流报警:<span class='AlmCurLow2095'></span></td>
		    <td width='25%'>水质软报警:<span class='AlmWater2095'></span></td></tr>
		<tr><td width='25%'>手动排水报警:<span class='AlmDrainage2095'></span></td>
			<td width='25%'>FSC1 高压报警:<span class='AlmCompHigh2095'></span></td>
		    <td width='25%'>FSC2 高压报警:<span class='AlmCompLow2095'></span></td>
		    <td width='25%'><span class='2095'></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='StoFan2095'></span></td>
		    <td width='25%'>压缩机一:<span class='StoComp12095'></span></td>
			<td width='25%'>压缩机二:<span class='StoComp22095'></span></td>
		    <td width='25%'>电加热一:<span class='StoHeater12095'></span></td></tr>
		<tr><td width='25%'>电加热二:<span class='StoHeater22095'></span></td>
		    <td width='25%'>除湿阀:<span class='StoHumer2095'></span></td>
			<td width='25%'>加湿电极:<span class='StoHumElc2095'></span></td>
		    <td width='25%'>冷凝风机一:<span class='StoCool12095'></span></td></tr>
		<tr><td width='25%'>冷凝风机二:<span class='StoCool22095'></span></td>
		    <td width='25%'>进水阀:<span class='StoInletvalve2095'></span></td>
			<td width='25%'>排水阀:<span class='StoDrainagevalve2095'></span></td>
		    <td width='25%'><span class='2095'></span></td></tr>
	</table>
    </table>
    </td>
    </tr>
  </table>
    <a href='javascript:history.back()' class='back' style='color: #fff'>返回</a>
</div>
<script>
var itype=2095;
var tescape= 5000,time;
  
<% db_Open("/NandFlash/tmp/dbDat0.db3"); %>
var sid=<% write(sid);%>;
var json=<% db_QryAdv("select * from tbCyberSL1600F 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){
        $(".SID2095").html(n.SID);
        $(".Addr2095").html(n.Addr);
        $(".Port2095").html(n.Port%256);
        $(".DateUpd2095").html(n.DateUpd);
        $(".State2095").html(parseState(n.State));
		
		 //0=恒温恒湿，1=恒温，2=送风
		if (0 == n.workmode)
			n.workmode = "恒温恒湿";
		else if (0 == n.workmode)
			n.workmode = "恒温";
		else if (0 == n.workmode)
			n.workmode = "送风";
		else //if (0 == n.workmode)
			n.workmode = "未知";
		$(".workmode2095").html((n.workmode));
		$(".TemRoomClib2095").html((n.TemRoomClib/10) + "℃");
		$(".HumRoomClib2095").html((n.HumRoomClib/10) + "％");
		$(".HumSet2095").html((n.HumSet/10) + "％");
		$(".TemSet2095").html((n.TemSet/10) + "℃");
		$(".TemSup2095").html((n.TemSup/10) + "℃");
		$(".TemRoom2095").html((n.TemRoom/10) + "℃");
		$(".HumRoot2095").html((n.HumRoot/10) + "％");
		$(".CurHumer2095").html((n.CurHumer /10) + "A");
		
		$(".StfSenSup2095").html((n.StfSenSup) ? "是" : "否");
		$(".StfSenCols2095").html((n.StfSenCols) ? "是" : "否");
		$(".StfSenColr2095").html((n.StfSenColr) ? "是" : "否");
		$(".AlmFire2095").html((n.AlmFire) ? "是" : "否");
		$(".StfSenTemr2095").html((n.StfSenTemr) ? "是" : "否");
		$(".StfSemHumr2095").html((n.StfSemHumr) ? "是" : "否");
		$(".AlmWaterOv2095").html((n.AlmWaterOv) ? "是" : "否");
		$(".AlmLeak2095").html((n.AlmLeak) ? "是" : "否");
		$(".AlmHumLow2095").html((n.AlmHumLow) ? "是" : "否");
		$(".AlmHumHigh2095").html((n.AlmHumHigh) ? "是" : "否");
		$(".AlmTemLow2095").html((n.AlmTemLow) ? "是" : "否");
		$(".AlmTemHigh2095").html((n.AlmTemHigh) ? "是" : "否");
		$(".StfComp1High2095").html((n.StfComp1High) ? "是" : "否");
		$(".StfComp1Low2095").html((n.StfComp1Low) ? "是" : "否");
		$(".StfComp1Ov2095").html((n.StfComp1Ov) ? "是" : "否");
		$(".StfComp2High2095").html((n.StfComp2High) ? "是" : "否");
		$(".StfComp2Low2095").html((n.StfComp2Low) ? "是" : "否");
		$(".StfComp2Ov2095").html((n.StfComp2Ov) ? "是" : "否");
		$(".StfHeaterPro2095").html((n.StfHeaterPro) ? "是" : "否");
		$(".StfColWaterOv2095").html((n.StfColWaterOv) ? "是" : "否");
		$(".StfColWaterOn2095").html((n.StfColWaterOn) ? "是" : "否");
		$(".StfTemSup2095").html((n.StfTemSup) ? "是" : "否");
		$(".StfPow2095").html((n.StfPow) ? "是" : "否");
		$(".AlmLostAir2095").html((n.AlmLostAir) ? "是" : "否");
		$(".AlmFilter2095").html((n.AlmFilter) ? "是" : "否");
		$(".AlmCurHigh2095").html((n.AlmCurHigh) ? "是" : "否");
		$(".AlmCurLow2095").html((n.AlmCurLow) ? "是" : "否");
		$(".AlmWater2095").html((n.AlmWater) ? "是" : "否");
		$(".AlmDrainage2095").html((n.AlmDrainage) ? "是" : "否");
		$(".AlmCompHigh2095").html((n.AlmCompHigh) ? "是" : "否");
		$(".AlmCompLow2095").html((n.AlmCompLow) ? "是" : "否");
		
		$(".StoFan2095").html((n.StoFan) ? "开" : "关");
		$(".StoComp12095").html((n.StoComp1) ? "开" : "关");
		$(".StoComp22095").html((n.StoComp2) ? "开" : "关");
		$(".StoHeater12095").html((n.StoHeater1) ? "开" : "关");
		$(".StoHeater22095").html((n.StoHeater2) ? "开" : "关");
		$(".StoHumer2095").html((n.StoHumer) ? "开" : "关");
		$(".StoHumElc2095").html((n.StoHumElc) ? "开" : "关");
		$(".StoCool12095").html((n.StoCool1) ? "开" : "关");
		$(".StoCool22095").html((n.StoCool2) ? "开" : "关");
		$(".StoInletvalve2095").html((n.StoInletvalve) ? "开" : "关");
		$(".StoDrainagevalve2095").html((n.StoDrainagevalve) ? "开" : "关");
    })

	$("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>