Skip to content

Commit 31ba102

Browse files
committed
CSSTUDIO-3410 When nag_period_ms == 0, annunciate the disconnection from the Alarm Server only once.
1 parent 9862ba4 commit 31ba102

File tree

1 file changed

+7
-1
lines changed
  • app/alarm/model/src/main/java/org/phoebus/applications/alarm/talk

1 file changed

+7
-1
lines changed

app/alarm/model/src/main/java/org/phoebus/applications/alarm/talk/TalkClient.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import static java.lang.Thread.sleep;
1111
import static org.phoebus.applications.alarm.AlarmSystem.logger;
12+
import static org.phoebus.applications.alarm.AlarmSystem.nag_period_ms;
1213

1314
import java.time.Duration;
1415
import java.time.Instant;
@@ -194,7 +195,12 @@ private void annunciateDisconnectionLoop() {
194195
} catch (final Exception ex) {
195196
logger.log(Level.WARNING, "Talk error for " + SeverityLevel.UNDEFINED + ", " + "Alarm Server Disconnected", ex);
196197
}
197-
nextDisconnectedAnnunciation = Optional.of(now.plus(disconnectionAnnunciationPeriod));
198+
if (nag_period_ms > 0) {
199+
nextDisconnectedAnnunciation = Optional.of(now.plus(disconnectionAnnunciationPeriod)); // Annunciate disconnect again after nag period_ms
200+
}
201+
else {
202+
nextDisconnectedAnnunciation = Optional.of(Instant.MAX); // When nag_period_ms == 0, don't annunciate the disconnection again.
203+
}
198204
}
199205
} else {
200206
nextDisconnectedAnnunciation = Optional.empty(); // Connection to the Alarm Server exists.

0 commit comments

Comments
 (0)