<body docProcLang="JavaLikeCalc.JavaScript">

<center>
<h1>Average over hour values of ""</h1>
<?dp return "<h1>"+tr("Average over hour values of \"%1\"").replace("%1",title)+"</h1><span>"+SYS.strftime(time-params.repHour*3600-1,"%d %B %Y")+"</span>";?>
</center>

<div width="100%"><div style="margin-left: auto; margin-right: auto; text-align: center; width: fit-content;">
	<?dp if(!enGraph) return "";
		for(iP = 0, srcs = ""; iP < params.length; iP++)
			if(!params[iP].min.isEVal() && !params[iP].max.isEVal())
				srcs += params[iP].var+":"+params[iP].min+":"+params[iP].max+":"+params[iP].color+":0:2\n";
		return srcs.length ? DAQ.JavaLikeCalc.lib_doc.diagram(time, time-bTime, srcs, 800, 300, arch) : "";
	?>
</div></div>
<br/>

<TABLE class="data" width="100%" export="1">
  <TR>
	<TH>Date</TH><TH>Time</TH><TH>Capacity</TH><TH>Aver. pressure diff.</TH><TH>St. pressure</TH><TH>Aver. temp.</TH><TH>Density</TH>
	<?dp
		rez = "<TH>"+tr("Date")+"</TH><TH>"+tr("Time")+"</TH>";
		for(iP = 0; iP < params.length; iP++)
			rez += "<TH style='color: "+(enGraph?params[iP].color:"black")+";'>"+SYS.strEncode(params[iP].name, "HTML")+"</TH>";
		return rez; ?>
  </TR>
  <TR>
	<TH>&nbsp;</TH><TH>begin&nbsp;&nbsp;end</TH><TH>m3</TH><TH>kgF/m2</TH><TH>kgF/cm</TH><TH>grad.C</TH><TH>kg/m3</TH>
	<?dp
		rez = "<TH>&nbsp;</TH><TH>"+tr("begin")+"&nbsp;&nbsp;"+tr("end")+"</TH>";
		for(iP = 0; iP < params.length; iP++) {
			pO = params[iP];
			rez += "<TH>"+((enGraph && pO.min < pO.max)?"["+pO.min+"..."+pO.max+"] ":"")+SYS.strEncode(pO.ed, "HTML")+"</TH>";
		}
		return rez; ?>
  </TR>
  <TR docRept="3600">
  <?dp using DAQ.JavaLikeCalc.lib_doc;
	if((rTime-rPer) > SYS.time())	return "";
	rez = "<TD style='text-align: center;'>"+SYS.strftime(rTime,"%d %m")+"</TD>"+
		"<TD style='text-align: center;'>"+SYS.strftime(rTime-rPer,"%H:%M")+"&nbsp;&nbsp;"+SYS.strftime(rTime,"%H:%M")+"</TD>";
	for(iP = 0; iP < params.length; iP++)
		if(params[iP].isCntr == true) {
			if(!(V1=getVal(params[iP].var,rTime-rPer,0,-1,arch,false,rTime*1e6)).isEVal())	V1 = V1.toReal();
			if(!(V2=getVal(params[iP].var,rTime,0,-1,arch,false,(rTime-rPer)*1e6)).isEVal())	V2 = V2.toReal();
			rez += "<TD style='text-align: center;'>"+((V1.isEVal() || V2.isEVal())?tr("Empty"):abs(V2-V1).toFixed(params[iP].prec))+"</TD>";
		} else rez += "<TD style='text-align: center;'>"+averVal(params[iP].var,rTime-rPer,rTime,params[iP].prec,arch)+"</TD>";
	return rez; ?>
  </TR>
  <TR style="font-weight: bold;">
  <?dp using DAQ.JavaLikeCalc.lib_doc;
	rez = "<TD colspan='2' style='text-align: center;'>"+tr("Summary")+"</TD>";
	for(iP = 0; iP < params.length; iP++)
		if(params[iP].isCntr == true) {
			if(!(V1=getVal(params[iP].var,bTime,0,-1,arch,false,time*1e6)).isEVal())	V1 = V1.toReal();
			if(!(V2=getVal(params[iP].var,time,0,-1,arch,false,bTime*1e6)).isEVal())	V2 = V2.toReal();
			rez += "<TD style='text-align: center;'>"+((V1.isEVal() || V2.isEVal())?tr("Empty"):abs(V2-V1).toFixed(3))+"</TD>";
		} else rez += "<TD/>";
	return rez; ?>
  </TR>
</TABLE>
</body>