<body docProcLang="JavaLikeCalc.JavaScript">
<h1>Protocol of messages <?dp return tr("Protocol of messages"); ?></h1>
<TABLE border="1" cellpadding="2" cellspacing="0" width="100%" class="data">
  <TR><TH colspan="6" align="left">Message at <?dp return tr("Message at %1").replace("%1",SYS.strftime(bTime)+" — "+SYS.strftime(time));?></TH></TR>
  <TR>
	<TH>Date</TH><TH>Time</TH><TH>Lev.</TH><TH>Source</TH><TH>Description</TH><TH>Value</TH>
     <?dp return "<TH>"+tr("Date")+"</TH><TH>"+tr("Time")+"</TH><TH>"+tr("Level")+"</TH><TH>"+tr("Source")+"</TH><TH>"+tr("Description")+"</TH><TH>"+tr("Value")+"</TH>";?>
  </TR>
  <TR docAMess="@@messCat@@" docAMessArchs="@@archLs@@" docRevers="1">
  <!--<TR docAMess="1:al*:*" docRevers="1">-->
<?dp
mValPrm = mVal.parse(0, ": "); mValDscr = mVal.parse(1, ": "); mValVal = mVal.parse(2, ": ");

srcO = mCat.match("^al(.+):([^\\.]+)|^([^:]+).*:al");
tVl = "";
//From remote station
if(srcO.length == 4 && (tVl=sourceCache[srcO[3]]).isEVal()) {
	req = SYS.XMLNode("get").setAttr("path","/Transport/%2fsub%2fehost").setAttr("upRiseSYS",1);
	SYS.cntrReq(req);
	for(iTr = 0; req.childSize() && iTr < req.childGet(0).childSize(); iTr++)
		if(req.childGet(0).childGet(iTr).text() == srcO[3]) {
			sourceCache[srcO[3]] = tVl = req.childGet(1).childGet(iTr).text();
			break;
		}
}
if(tVl.length)	mValPrm = tVl + " > " + mValPrm;

if(mCat.slice(0,2) == "OP") mValVal += " -> "+mVal.parse(3,":");
else if(mCat[0] == "/")	mValDscr = mVal, mValPrm = mCat;
if(fltr.length && !fltrCol.isEVal() && (
	(fltrCol == "dttm" && SYS.strftime(mTime,"%d %m %H:%M:%S").indexOf(fltr) < 0) ||
	//(fltrCol == "lev" && abs(mLev).toString().indexOf(fltr) < 0) ||
	(fltrCol == "lev" && ((fltr.toInt() > 0 && abs(mLev) < fltr.toInt()) || (fltr.toInt() < 0 &&  mLev > fltr.toInt()))) ||
	(fltrCol == "prm" && mValPrm.indexOf(fltr) < 0) ||
	(fltrCol == "dscr" && mValDscr.indexOf(fltr) < 0) ||
	(fltrCol == "alrm" && mValVal.indexOf(fltr) < 0))) return "";
if(mCat[0] == "/") return "<TD style='white-space: nowrap; '>"+SYS.strftime(mTime,"%d %m")+"</TD>"+
		"<TD>"+SYS.strftime(mTime,"%H:%M:%S")+"</TD>"+
		"<TD>"+mLev+"</TD>"+
		"<TD>"+SYS.strEncode(mValPrm,"HTML")+"</TD>"+
		"<TD colspan='2'>"+SYS.strEncode(mValDscr,"HTML")+"</TD>";
return "<TD style='white-space: nowrap; '>"+SYS.strftime(mTime,"%d %m")+"</TD>"+
		"<TD>"+SYS.strftime(mTime,"%H:%M:%S")+"</TD>"+
		"<TD>"+mLev+"</TD>"+
		"<TD>"+SYS.strEncode(mValPrm,"HTML")+"</TD>"+
		"<TD>"+SYS.strEncode(mValDscr,"HTML")+"</TD>"+
		"<TD>"+SYS.strEncode(mValVal,"HTML")+"</TD>";
?>
  </TR>
</TABLE>
</body>