private static void genForceControlCheckExceptNld(ControlLimit lim, Exception e) { NLDEvent nld = NLDEventFactory.getNLD("tspFeed"); nld.addRoute( NLDConstants.ERROR | NLDConstants.UTILIZATION | NLDConstants.REALTIMESTATUS | NLDConstants.SYSSTABLTY); nld.addKey("ErrorLog"); nld.addMessage("EncounteredException(ControlLimit): " + e.getMessage()); nld.addNLDElement("LocalizedMessage", e.getLocalizedMessage()); nld.addNLDElement("ID", lim.id); nld.addNLDElement("MonitorName", lim.monitor); StackTraceElement[] els = e.getStackTrace(); for (int i = 0; i < els.length; i++) nld.addNLDElement( "StackTrace[" + i + "]", els[i].getFileName() + " " + els[i].getClassName() + " " + els[i].getMethodName() + " " + els[i].getLineNumber()); nld.write(); }
protected void sendSoftWarning(String str) { CoreTsp.out(str); NLDEvent nld = NLDEventFactory.getNLD("tspFeed"); nld.addRoute(NLDConstants.WARNING | NLDConstants.REALTIMESTATUS); nld.addKey("Warining"); nld.addMessage(str); nld.write(); CoreTsp.status("Testing Warning: " + str); CoreTsp.out(str); }
/** * Called when PrintSummary requests the control limit data. * * <p>returns an ascii report of all the failing control limits. If everything is in control null * is returned. * * @return AsciiFailReport */ public static StringBuffer controlCheck() { if (activeLimits == null) { NLDEvent nld = NLDEventFactory.getNLD("tspFeed"); nld.addRoute( NLDConstants.ERROR | NLDConstants.UTILIZATION | NLDConstants.REALTIMESTATUS | NLDConstants.SYSSTABLTY); nld.addKey("Warining"); nld.addMessage("SPC Control limits all passing -- No active limits"); nld.write(); return null; } boolean allInControl = true; Iterator limItr = activeLimits.keySet().iterator(); StringBuffer report = new StringBuffer(); // Iterates through the active control limit data structure while (limItr.hasNext()) { String limID = (String) limItr.next(); ControlLimit lim = (ControlLimit) activeLimits.get(limID); if (!lim.enabled) continue; // Runs force limit check: try { lim.forceControlCheck(); lim.generateStatusNld(); } catch (Exception e) { genForceControlCheckExceptNld(lim, e); } if (!lim.inControl) { report.append(lim.generateAsciiSummary()); allInControl = false; } } if (allInControl) return null; return report; }
private void sendWarning() { /* POPUPWARNING = 0; public final static int POPUPHALT = 1; public final static int PASSIVEWARNING = 2; public final static int LOGONLY */ if (alarmType == PASSIVEWARNING) { NLDEvent nld = NLDEventFactory.getNLD("tspFeed"); nld.addRoute(NLDConstants.WARNING | NLDConstants.REALTIMESTATUS | NLDConstants.ASPECT); nld.addKey("SPC Control Event"); nld.addMessage("SPC Softwarning"); nld.addElement( createElement("Intervention Description", "Operator Warning, Production Paused")); nld.addDetail(new SPCEventDetail(this)); nld.write(); softWarning(); nld = NLDEventFactory.getNLD("tspFeed"); nld.addRoute(NLDConstants.WARNING | NLDConstants.REALTIMESTATUS | NLDConstants.ASPECT); nld.addKey("SPC Control Event"); nld.addMessage("SPC Warning Acknowledged - Resuming Production"); nld.write(); } else if (alarmType == POPUPHALT) { NLDEvent nld = NLDEventFactory.getNLD("tspFeed"); nld.addRoute(NLDConstants.WARNING | NLDConstants.REALTIMESTATUS | NLDConstants.ASPECT); nld.addKey("SPC Control Event"); nld.addMessage("SPC Limit Failed Halting Production"); nld.addElement( createElement( "Intervention Description", "Request for Line EA Assistence, Production Paused")); nld.addDetail(new SPCEventDetail(this)); nld.write(); hardWarning(); nld = NLDEventFactory.getNLD("tspFeed"); nld.addRoute(NLDConstants.WARNING | NLDConstants.REALTIMESTATUS | NLDConstants.ASPECT); nld.addKey("SPC Control Event"); nld.addMessage("SPC Warning Acknowledged - Resuming Production"); nld.write(); } else if (alarmType == LOGONLY) { NLDEvent nld = NLDEventFactory.getNLD("tspFeed"); nld.addRoute(NLDConstants.WARNING | NLDConstants.REALTIMESTATUS | NLDConstants.ASPECT); nld.addKey("SPC Control Event"); nld.addMessage("SPC Limit Failed"); nld.addElement( createElement( "Intervention Description", "Data logging only, production not interuppted.")); nld.addDetail(new SPCEventDetail(this)); nld.write(); } }