Skip to content

Commit d3827a8

Browse files
committed
Improve logging for safe beam messages
1 parent a96b486 commit d3827a8

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

src/alice/dip/DipMessagesProcessor.java

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -318,27 +318,22 @@ private void handleSafeBeamMessage(DipData dipData) throws BadParameter, TypeMis
318318
if (currentFill == null) return;
319319

320320
String bm = currentFill.getBeamMode();
321-
322-
if (bm.contentEquals("STABLE BEAMS")) {
323-
AliDip2BK.log(
324-
0,
325-
"ProcData.newSafeBeams",
326-
" VAL=" + safeBeamPayload + " isB1=" + isBeam1 + " isB2=" + isBeam2 + " isSB=" + isStableBeams
327-
);
328-
329-
if (!isBeam1 || !isBeam2) {
321+
AliDip2BK.log(
322+
1,
323+
"ProcData.newSafeBeams",
324+
" VAL=" + safeBeamPayload + " isB1=" + isBeam1 + " isB2=" + isBeam2 + " isSB=" + isStableBeams
325+
);
326+
if ((bm.contentEquals("STABLE BEAMS") && (!isBeam1 || !isBeam2))) {
330327
currentFill.setBeamMode(time, "LOST BEAMS");
331-
if (beamModeEventsKafkaProducer != null) {
332-
beamModeEventsKafkaProducer.sendEvent(currentFill.fillNo, currentFill, time);
328+
if (this.beamModeEventsKafkaProducer != null) {
329+
this.beamModeEventsKafkaProducer.sendEvent(currentFill.fillNo, currentFill, time);
333330
}
334331
AliDip2BK.log(5, "ProcData.newSafeBeams", " CHANGE BEAM MODE TO LOST BEAMS !!! ");
335-
}
336-
337-
return;
338-
}
339-
340-
if (bm.contentEquals("LOST BEAMS") && isBeam1 && isBeam2) {
332+
} else if (bm.contentEquals("LOST BEAMS") && isBeam1 && isBeam2) {
341333
currentFill.setBeamMode(time, "STABLE BEAMS");
334+
if (this.beamModeEventsKafkaProducer != null) {
335+
this.beamModeEventsKafkaProducer.sendEvent(currentFill.fillNo, currentFill, time);
336+
}
342337
AliDip2BK.log(5, "ProcData.newSafeBeams", " RECOVER FROM BEAM LOST TO STABLE BEAMS ");
343338
}
344339
}

0 commit comments

Comments
 (0)