<body docProcLang="JavaLikeCalc.JavaScript">

<center>
<h1>Month values of ""</h1>
<?dp return "<h1>"+tr("Month values of \"%1\"").replace("%1",title)+"</h1><span>"+SYS.strftime(time-1,"%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(!(pO=params[iP]).min.isEVal() && !pO.max.isEVal())
				srcs += (pO.trData.length?pO.trData:pO.var)+":"+pO.min+":"+pO.max+":"+pO.color+":0:2\n";
		return srcs.length ? DAQ.JavaLikeCalc.lib_doc.diagram(time, time-bTime, srcs, 800, 300, arch.parse(0,";")) : "";
	?>
</div></div>
<br/>

<TABLE class="data" width="100%" export="1" docAppend="1">
  <TR>
	<TH>Date</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>";
		for(iP = 0; iP < params.length; iP++) {
			pO = params[iP];
			rez += "<TH style='color: "+(enGraph?pO.color:"black")+";' "+((pO.isCntr&&showOrigCntr)?"colspan='2'":"")+">"+SYS.strEncode(pO.name, "HTML")+"</TH>";
		}
		return rez; ?>
  </TR>
  <TR>
	<TH>&nbsp;</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>";
		for(iP = 0; iP < params.length; iP++) {
			pO = params[iP];
			rez += "<TH "+((pO.isCntr&&showOrigCntr)?"colspan='2'":"")+">"+((enGraph && pO.min < pO.max)?"["+pO.min+"..."+pO.max+"] ":"")+SYS.strEncode(pO.ed, "HTML")+"</TH>";
		}
		return rez; ?>
  </TR>
  <?dp using DAQ.JavaLikeCalc.lib_doc;
	rez = "";
	bYear = 0;
	SYS.localtime(bTime, 0, 0, 0, 0, 0, bYear);
	tTime = tTime_ = SYS.mktime(0, 0, 0, 1, 0, bYear);
	for(iMonth = 0; tTime < time && tTime < SYS.time() && iMonth < 12; tTime = tTime_) {
		tTime_GM = SYS.timegm(0, 0, 0, 1, iMonth, bYear);
		iMonth++; tTime_ = SYS.mktime(0, 0, 0, 1, iMonth, bYear);
		rez_ = "<TD>"+SYS.strftime(tTime,"%B")+"</TD>";
		for(iP = 0; iP < params.length; iP++)
			if((pO=params[iP]).isMan) {
				if(pO.isCntr)
					rez_ += "<TD style='text-align: center;'>"+((tVl=pO.cntrData[tTime_GM]).isEVal()?tr("Empty"):tVl.toFixed(pO.prec))+"</TD>"+
						(showOrigCntr?"<TD style='text-align: center;'>"+((tVl=pO.manData[tTime_GM]).isEVal()?tr("Empty"):tVl.toFixed(pO.prec))+"</TD>":"");
				else rez_ += "<TD style='text-align: center;'>"+((tVl=pO.manData[tTime_GM]).isEVal()?tr("Empty"):tVl.toFixed(pO.prec))+"</TD>";
			}
			else if(pO.isCntr) {
				if(!(V1=getVal(pO.var,tTime,0,-1,arch.parse(0,";"),false,tTime_*1e6)).isEVal())	V1 = V1.toReal();
				if(!(V2=getVal(pO.var,tTime_,0,-1,arch.parse(0,";"),false,tTime*1e6)).isEVal())	V2 = V2.toReal();
				rez_ += "<TD style='text-align: center;'>"+((V1.isEVal() || V2.isEVal())?tr("Empty"):abs(V2-V1).toFixed(pO.prec))+"</TD>"+
					(showOrigCntr?"<TD style='text-align: center;'>"+(V1.isEVal()?tr("Empty"):V1.toFixed(pO.prec))+"</TD>":"");
			} else rez_ += "<TD style='text-align: center;'>"+averVal(pO.var,tTime,tTime_,pO.prec,arch.parse(0,";"))+"</TD>";
		rez = "<TR>" + rez_ + "</TR>" + rez;		
	}

	rez_ = "", presentCntr = false;
	for(iP = 0; iP < params.length; iP++)
		if(!(pO=params[iP]).isCntr)	rez_ += "<TD/>";
		else {
			presentCntr = true;
			if(!pO.isMan) {
				if(!(V1=getVal(pO.var,bTime,0,-1,arch.parse(0,";"),false,time*1e6)).isEVal())	V1 = V1.toReal();
				if(!(V2=getVal(pO.var,time,0,-1,arch.parse(0,";"),false,bTime*1e6)).isEVal())	V2 = V2.toReal();
				rez_ += "<TD style='text-align: center;' "+(showOrigCntr?"colspan='2'":"")+">"+((V1.isEVal() || V2.isEVal())?tr("Empty"):abs(V2-V1).toFixed(pO.prec)) + "</TD>";
			} else rez_ += "<TD style='text-align: center;' "+(showOrigCntr?"colspan='2'":"")+">"+(pO.manResCntr.isEVal()?tr("Empty"):pO.manResCntr.toFixed(pO.prec))+"</TD>";
		}
	if(presentCntr) rez += "<TR style='font-weight: bold;'><TD>"+tr("Summary")+"</TD>"+rez_+"</TR>";

	return rez;
  ?>
</TABLE>
</body>