JavaLikeCalc.JavaScript
function setActMess(mess) {
	if(var_addr.isEVal())	SYS.messNote("OP:"+this.ownerSess().user()+":"+NAME, "'"+NAME+"'."+mess);
	else SYS.nodeAt(var_addr).nodePrev().messSet("'"+NAME+"'."+mess, 2, "OP", this.ownerSess().user());
}

txt_pnlTitle_arg0val = NAME;

if(f_start) clc = 0;
clc++;
if(clc == 3) event += "usr_ElCadr";
for(off = 0, ev_rez = ""; (ev_wrk=event.parse(0,"\n",off)).length; ) {
	if(ev_wrk == "ws_LnAccept:/kp") { setActMess("Kp : "+DESCR+" : "+Kp+" : " +kp_value); Kp = kp_value; }
	else if(ev_wrk == "ws_LnAccept:/ki") { setActMess("Ki : "+DESCR+" : "+Ki+" : " +ki_value); Ki = ki_value; }
	else if(ev_wrk == "ws_LnAccept:/ti") { setActMess("Ti : "+DESCR+" : "+Ti/1000+" : " +ti_value); Ti = 1000*ti_value; }
	else if(ev_wrk == "ws_LnAccept:/kd") { setActMess("Kd : "+DESCR+" : "+Kd+" : " +kd_value); Kd = kd_value; }
	else if(ev_wrk == "ws_LnAccept:/td") { setActMess("Td : "+DESCR+" : "+Td/1000+" : " +td_value); Td = 1000*td_value; }
	else if(ev_wrk == "ws_LnAccept:/tzd") { setActMess("Tzd : "+DESCR+" : "+Tzd+" : " +tzd_value); Tzd = 1000*tzd_value; }
	else if(ev_wrk == "ws_LnAccept:/zn") { setActMess("Zn : "+DESCR+" : "+Zi+" : " +zn_value); Zi = zn_value; }
	else if(ev_wrk == "ws_LnAccept:/h1") { setActMess("H1 : "+DESCR+" : "+Hdwn+" : " +h1_value); Hdwn = h1_value; }
	else if(ev_wrk == "ws_LnAccept:/h2") { setActMess("H2 : "+DESCR+" : "+Hup+" : " +h2_value); Hup = h2_value; }
	else if(ev_wrk == "ws_LnAccept:/k1") { setActMess("K1 : "+DESCR+" : "+K1+" : " +k1_value); K1 = k1_value; }
	else if(ev_wrk == "ws_LnAccept:/k2") { setActMess("K2 : "+DESCR+" : "+K2+" : " +k2_value); K2 = k2_value; }
	else if(ev_wrk == "ws_LnAccept:/k3") { setActMess("K3 : "+DESCR+" : "+K3+" : " +k3_value); K3 = k3_value; }
	else if(ev_wrk == "ws_LnAccept:/k4") { setActMess("K4 : "+DESCR+" : "+K4+" : " +k4_value); K4 = k4_value; }
	else if(ev_wrk == "ws_LnAccept:/tiPer") { setActMess("TImpPer : "+DESCR+" : "+TImpPer/1000+" : " +tiPer_value); TImpPer = 1000*tiPer_value; }
	else if(ev_wrk == "ws_LnAccept:/tiMin") { setActMess("TImpMin : "+DESCR+" : "+TImpMin/1000+" : " +tiMin_value); TImpMin = 1000*tiMin_value; }    
	else if(ev_wrk == "ws_LnAccept:/rfct") { setActMess("KImpRfact : "+DESCR+" : "+KImpRfact+" : " +rfct_value); KImpRfact = rfct_value; }
	else ev_rez += ev_wrk+"\n";
}
event = ev_rez;

kp_value = (kp_active=!Kp.isEVal()) ? Kp : 0;
ki_value = (ki_active=!Ki.isEVal()) ? Ki : 0;
ti_value = (ti_active=!Ti.isEVal()) ? Ti/1000 : 0;
kd_value = (kd_active=!Kd.isEVal()) ? Kd : 0;
td_value = (td_active=!Td.isEVal()) ? Td/1000 : 0;
tzd_value = (tzd_active=!Tzd.isEVal()) ? Tzd/1000 : 0;
zn_value = (zn_active=!Zi.isEVal()) ? Zi : 0;
h1_value = (h1_active=!Hdwn.isEVal()) ? Hdwn : 0;
h2_value = (h2_active=!Hup.isEVal()) ? Hup : 0;
k1_value = (k1_active=!K1.isEVal()) ? K1 : 0;
k2_value = (k2_active=!K2.isEVal()) ? K2 : 0;
k3_value = (k3_active=!K3.isEVal()) ? K3 : 0;
k4_value = (k4_active=!K4.isEVal()) ? K4 : 0;
tiPer_value = (tiPer_active=!TImpPer.isEVal()) ? TImpPer/1000 :0;
tiMin_value = (tiMin_active=!TImpMin.isEVal()) ? TImpMin/1000 : 0;
rfct_value = (rfct_active=!KImpRfact.isEVal()) ? KImpRfact : 0;

doc_tmpl = "<body bgcolor='"+backColor+"'><table style='color: "+labColor+"' border='1' cellpadding='1' cellspacing='0' width='100%'>\n";
doc_tmpl += "<tr><td>"+tr("Id")+":</td><td>"+(SHIFR.isEVal()?"":SYS.strEncode(SHIFR,"HTML"))+"</td></tr>\n";
doc_tmpl += "<tr><td>"+tr("Name")+":</td><td>"+(NAME.isEVal()?"":SYS.strEncode(NAME,"HTML"))+"</td></tr>\n";
doc_tmpl += "<tr><td>"+tr("Description")+":</td><td>"+(DESCR.isEVal()?"":SYS.strEncode(DESCR,"HTML"))+"</td></tr>\n";
doc_tmpl += "<tr><td>"+tr("Dimension")+":</td><td>"+(ed.isEVal()?"":SYS.strEncode(ed,"HTML"))+"</td></tr>\n";
doc_tmpl += "<tr><td>"+tr("Setpoint")+":</td><td>"+(trnd_prm1val.isEVal()?"":(prec.isEVal()?trnd_prm1val:trnd_prm1val.toFixed(prec)));
doc_tmpl += ((trnd_prm1val.isEVal() || max.isEVal() || min.isEVal() || max == min)?"":("("+(100*(trnd_prm1val-min)/(max-min).toFixed(1))+"%)"))+"</td></tr>\n";
doc_tmpl += "<tr><td>"+tr("Variable")+":</td><td>"+(trnd_prm2val.isEVal()?"":(prec.isEVal()?trnd_prm2val:trnd_prm2val.toFixed(prec)));
doc_tmpl += ((trnd_prm2val.isEVal() || max.isEVal() || min.isEVal() || max == min)?"":("("+(100*(trnd_prm2val-min)/(max-min).toFixed(1))+"%)"))+"</td></tr>\n";
doc_tmpl += "<tr><td>"+tr("Output")+":</td><td>"+(trnd_prm0val.isEVal()?"":trnd_prm0val.toFixed(1)+"%")+"</td></tr>\n";
doc_tmpl += "<tr><td>"+tr("Scale")+":</td><td>"+(min.isEVal()?"":min)+" ... "+(max.isEVal()?"":max)+"</td></tr>\n";
doc_tmpl += "<tr><td>"+tr("Mode")+":</td><td>"+(trnd_prm3val.isEVal()?" - ":(trnd_prm3val?tr("Automate"):tr("Manual")))+"</td></tr>\n";
doc_tmpl += "</table></body>";

//Diagram
trnd_prm0addr = out_addr;
trnd_prm1addr = sp_addr;
trnd_prm1bordL = min;
trnd_prm1bordU = max;
trnd_prm2addr = var_addr;
trnd_prm2bordL = min;
trnd_prm2bordU = max;
trnd_prm3addr = auto_addr;
trnd_prm4addr = impQup_addr;
trnd_prm5addr = impQdwn_addr;