

<div class="detailCon">
	<ul class="line lineL">
		<!-- 波特率 -->
		<li class="line" id="baudrate">
			<label class="des desA">{%label.baudrate%}</label>
			<span class="selCon">
				<span id="baudRateSelect" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<!-- 数据位 -->
		<li class="line" id="databits">
			<label class="des desA">{%label.databits%}</label>
			<span class="selCon">
				<span id="dataBitsSelect" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<!-- 停止位 -->
		<li class="line" id="stopbits">
			<label class="des desA">{%label.stopbits%}</label>
			<span class="selCon">
				<span id="stopBitsSelect" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<!-- 校验 -->
		<li class="line" id="checkMode">
			<label class="des desA">{%label.checkMode%}</label>
			<span class="selCon">
				<span id="checkModeSelect" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<!-- 流控 -->
		<li class="line" id="flowCtrl">
			<label class="des desA">{%label.flowCtrl%}</label>
			<span class="selCon">
				<span id="flowCtrlSelect" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<!-- 解码器类型 -->
		<li class="line" id="decoderType">
			<label class="des desA">{%label.decoderType%}</label>
			<span class="selCon">
				<span id="decoderTypeSelect" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<!-- 解码器地址 -->
		<li class="line" id="decoderAddr">
			<label class="des desA">{%label.decoderAddress%}</label>
			<input id="decoderAddress" type="text" class="text textA1" maxlength="32" />
		</li>
	</ul>
	<div class="funcBtnCon">
		<input id="save" type="button" value="{%btn.save%}" class="subBtn btnA" />
	</div>
</div>
<script type="text/javascript">function init(){function A(c,b){var a="";switch(c){case ENONE:return!0;case IPCSTRLENINV:a=errStr.deviceAliasNameSizeErr;break;case IPCUMGUESTNAUTH:a=errStr.invPermissionDenied;break;case IPC_RS485_BAUDRATE_SET_ERROR:a=errStr.baudrateSetErr;break;case IPC_RS485_DATABITS_SET_ERROR:a=errStr.databitsSetErr;break;case IPC_RS485_STOPBITS_SET_ERROR:a=errStr.stopbitsSetErr;break;case IPC_RS485_CHECK_MODE_SET_ERROR:a=errStr.checkModeSetErr;break;case IPC_RS485_FLOW_CTRL_SET_ERROR:a=errStr.flowCtrlSetErr;
break;case IPC_RS485_PROTOCOL_SET_ERROR:a=errStr.protocolSetErr;break;case IPC_RS485_ADDR_SET_ERROR:a=errStr.addrSetErr;break;default:a=errStr.invRequestFail}closeToast();showAlert(a,b);return!1}function M(c){r=c}function N(c){s=c}function O(c){t=c}function P(c){u=c}function Q(c){v=c}function R(c){w=c}var h=uciRS485Capability.fileName,k=uciRS485Capability.secName.capability,S=uciRS485Capability.optName.baudrateRange,T=uciRS485Capability.optName.databitsRange,U=uciRS485Capability.optName.stopbitsRange,
V=uciRS485Capability.optName.checkModeRange,W=uciRS485Capability.optName.flowCtrlRange,X=uciRS485Capability.optName.protocolRange,Y=uciRS485Capability.optName.addrRange,d=uciRS485.fileName,e=uciRS485.secName.rs485Cfg,B=uciRS485.optName.baudRate,C=uciRS485.optName.dataBits,D=uciRS485.optName.stopBits,E=uciRS485.optName.checkMode,F=uciRS485.optName.flowCtrl,G=uciRS485.optName.protocol,H=uciRS485.optName.addr,n,p,q,f,g,l,m,r,s,t,u,v,w,I,J=[],K=[],L=[],x=[],y=[],z=[];id("save").onclick=function(){var c=
id("decoderAddress").value,b={};b[d]={};b[d][e]={};n&&(b[d][e][B]=r);p&&(b[d][e][C]=s);q&&(b[d][e][D]=t);f&&(b[d][e][E]=u);g&&(b[d][e][F]=v);l&&(b[d][e][G]=w);if(m){b[d][e][H]=c;var a;a=0==c.toString().length?!0:void 0;if(a){showNote("decoderAddress",errStr.rs485AddressEmpty);return}if(/\D/g.test(c.toString())||isNaN(c)||c<m[0]||c>m[1]){showNote("decoderAddress",errStr.rs485AddressInvalid+m[0].toString()+"-"+m[1].toString());return}}showToast("loading");$.modify(b,function(a){A(a[ERR_CODE])&&showToast("success")})};
(function(){var c={};c[h]={};c[h][KEY_NAME]=k;c[d]={};c[d][KEY_NAME]=e;$.query(c,function(b){if(!0==A(b[ERR_CODE])){n=b[h][k][S];p=b[h][k][T];q=b[h][k][U];f=b[h][k][V];g=b[h][k][W];l=b[h][k][X];m=b[h][k][Y];if(n){r=b[d][e][B];for(var a=0;a<n.length;a++)J.push({str:n[a],value:n[a]});selectInit("baudRateSelect",J,r,M)}else id("baudrate").style.display="none";if(p){s=b[d][e][C];for(a=0;a<p.length;a++)K.push({str:p[a],value:p[a]});selectInit("dataBitsSelect",K,s,N)}else id("databits").style.display="none";
if(q){t=b[d][e][D];for(a=0;a<q.length;a++)L.push({str:q[a],value:q[a]});selectInit("stopBitsSelect",L,t,O)}else id("stopbits").style.display="none";if(f){u=b[d][e][E];for(a=0;a<f.length;a++)uciRS485.optValue.none==f[a]&&x.push({str:label.none,value:f[a]}),uciRS485.optValue.evenCheck==f[a]&&x.push({str:label.even,value:f[a]}),uciRS485.optValue.oddCheck==f[a]&&x.push({str:label.oddCheck,value:f[a]});selectInit("checkModeSelect",x,u,P)}else id("checkMode").style.display="none";if(g){v=b[d][e][F];for(a=
0;a<g.length;a++)uciRS485.optValue.none==g[a]&&y.push({str:label.none,value:g[a]}),uciRS485.optValue.hardFlowCtrl==g[a]&&y.push({str:label.hardFlowCtrl,value:g[a]}),uciRS485.optValue.softFlowCtrl==g[a]&&y.push({str:label.softFlowCtrl,value:g[a]});selectInit("flowCtrlSelect",y,v,Q)}else id("flowCtrl").style.display="none";if(l){w=b[d][e][G];for(a=0;a<l.length;a++)uciRS485.optValue.pelcoD==l[a]&&z.push({str:label.PELCOD,value:l[a]}),uciRS485.optValue.pelcoP==l[a]&&z.push({str:label.PELCOP,value:l[a]});
selectInit("decoderTypeSelect",z,w,R)}else id("decoderType").style.display="none";m?(I=b[d][e][H],id("decoderAddress").value=I):id("decoderAddr").style.display="none";showDetailCon()}})})()}init();
</script><style type="text/css">ul.line li.line{width:600px;padding:5px 0}ul.line li.line label.desA{width:90px;line-height:20px}span.modeSelect{width:70px;text-align:center}ul.lineL{margin-bottom:25px}</style>