MsgLog.log("getAlarmFromList", "concurrent modification error "+nerr,TErrorList.semaphore_error,e,0);
if (nerr > 3) return null;
continue;
}
keepTimestamp = false;
TAlarmDefinition ads = alm.getAlmDef();
if (alm.isTerminated())
{ // is marked for termination
boolean oscPinned = TAlarm.getAlmOscillationWindowPinned();
int oscw = TAlarm.getAlmOscillationWindow();
if (ads != null)
{
if (!oscPinned) oscPinned = ads.isOscillationWindowPinned();
oscw = ads.getAlarmOscillationWindow();
}
if (!alm.isTransient() && !oscPinned)
{ // oscillation window too small ?
int dt = (alm.getTimeStamp()+TAlarm.getTerminationWindow()) - (int)(System.currentTimeMillis()/1000);
if (dt > 0 && dt < TAlarm.ALM_OSCILLATION_MAXIMUM-oscw)
{ // adjust the oscillation window
oscw += dt;
if (ads != null) ads.setAlarmOscillationWindow(oscw);
else TAlarm.setAlmOscillationWindow(oscw,false);
if (TEquipmentModuleFactory.getDebugLevel() > 0)
DbgLog.log("getAlarmFromList","increase alarm oscillation windows to "+oscw+" clear counts");
}
}
continue;
}
else
{ // not marked for termination
if (alm.getCode() == code && alm.getWatchEntry() == awe)
{ // it's already in the list so remove NEW bit !
byte dsc = alm.getDescriptor();
byte[] adata = alm.getData();
int dlen = ads == null ? 0 : ads.getAlarmDataArraySize();
if (dlen > 0 && data != null && adata != null)
{ // check for alarm data changed
for (int n=0; n<dlen && n<adata.length && n<data.length; n++)
{
if (data[n] != adata[n])