<%@ LANGUAGE="JSCRIPT" %><% // 20-Jan-11 rbd New edit, from pstatus.asp // 22-Jan-11 rbd GEM:574 add access to ACP logs // 05-Feb-12 rbd Copyright to 2012 // 05-Jan-14 rbd Copyright to 2014, navigation notes // GEM:1063 Fix plan state % listings. // 22-Jan-14 rbd GEM:1083 No more DBRelay hack :-) // 17-Dec-14 rbd GEM:1266 Light style, factor out the status-specific // styles into new style.css stylesheets. // 07-Jun-16 rbd GEM:1456 Color code active/run, completion and fail columns // 16-Jun-18 rbd No GEM - Update copyright // 18-Aug-18 rbd GEM:1625 ACT column not red any more, only status. // 17-Jan-19 rbd GEM:1660 Modern DOCTYPE and HTML declarations // 07-Jan-20 rbd No GEM - Copyright to 2021 // 13-Sep-23 rbd No GEM - Copyright to 2023 // // Enhance String with a trim() method // String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); }; var DB = Scheduler.Database; var FSO = new ActiveXObject("Scripting.FileSystemObject"); Response.ExpiresAbsolute = new Date("Jan 1, 2000").getVarDate(); // Expire even with clock offsets Response.AddHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0"); // // URL must include a query string rid=NNN, where NNN is the Plan ID // var idP = parseInt(Request.Form("pid").Item); // Plan ID var P = DB.Plan(idP); // The plan! %> ACP Schedule Browser ACP Scheduler <% var tr = ""; var tre = "\r\n"; var td = "\r\n"; var tdd = "
Observations for Plan <%= P.Name %>
Click the Plan name above to return to Plans
For completed or failed Observations (only) click the name below to see the ACP log
Observation Status Sets Imgs Time Act Cmpl Fail
"; var tde = ""; function dispTime(t) { if(t >= 3600) { t /= 3600; return t.toFixed(2) + "h"; } else { t /= 60; return t.toFixed(1) + "min"; } } var eO = new Enumerator(P.Observations); for(;!eO.atEnd(); eO.moveNext()) { var O = eO.item(); var status; switch(O.Status) { case 0: status = "Pending"; break; case 1: status = "Running"; break; case 2: status = "Completed"; break; case 3: status = "Failed"; break; case 4: status = "Vetoed"; break; case 5: status = "Disabled"; break; } var totImg = 0; var totTime = 0; var totAct = 0; var totCompl = 0; var totFail = 0; var eI = new Enumerator(O.Images); for(;!eI.atEnd(); eI.moveNext()) { I = eI.item(); totImg += I.RepeatCount; totTime += I.ExposureInterval * I.RepeatCount; switch(I.Status) { case 0: totAct += I.RepeatCount; break; case 1: totAct += I.RepeatCount; break; case 2: totCompl += I.RepeatCount; break; case 3: totFail += I.RepeatCount; break; } } totImg *= O.SetCount; totTime *= O.SetCount; totAct *= O.SetCount; totCompl *= O.SetCount; totFail *= O.SetCount; totAct = (totAct / totImg) * 100; totCompl = (totCompl / totImg) * 100; totFail = (totFail / totImg) * 100; Response.Write(tr); Response.Write(td + "" + O.Name + "" + tde); if ((O.Status == 2 || O.Status == 3) && FSO.FileExists(O.LastSequencerLog)) { var tgtUri = encodeURI("sviewlog.asp?op=ACP&oid=" + O.ID); Response.Write(td + " " + status + " (view log)" + tde); } else { Response.Write(td + status + tde); } Response.Write(td + (O.Images.Count * O.SetCount) + tde); Response.Write(td + totImg + tde); Response.Write(td + dispTime(totTime) + tde); if(O.Status != 5 && O.Images.Count !== 0 ) { if(totAct > 0) Response.Write(td + totAct.toFixed(1) + "%" + tde); else Response.Write(td + "0.0%" + tde); if(totCompl == 100) { Response.Write(td + "" + totCompl.toFixed(1) + "%" + tde); } else if(totCompl > 80) { Response.Write(td + "" + totCompl.toFixed(1) + "%" + tde); } else { Response.Write(td + totCompl.toFixed(1) + "%" + tde); } if(totFail > 0) Response.Write(td + "" + totFail.toFixed(1) + "%" + tde); else Response.Write(td + "0.0%" + tde); } else { Response.Write(tdd + "---" + tde); Response.Write(tdd + "---" + tde); Response.Write(tdd + "---" + tde); } Response.Write(tre); } %>