From fb44e9fa81f77329fddaa16a3fee4ecc49227213 Mon Sep 17 00:00:00 2001 From: Rebecca Williams Date: Tue, 24 Oct 2023 14:29:16 +0100 Subject: [PATCH] Fix bug where disconnect is at the end of the iterator If a disconnect is detected in the last message then the next() function never gets called to save the latest data point and so it does not get plotted. --- .../archive/reader/appliance/ApplianceValueIterator.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/applications/archive/archive-plugins/org.csstudio.archive.reader.appliance/src/org/csstudio/archive/reader/appliance/ApplianceValueIterator.java b/applications/archive/archive-plugins/org.csstudio.archive.reader.appliance/src/org/csstudio/archive/reader/appliance/ApplianceValueIterator.java index 7979dbeea8..e28a3e4bd7 100644 --- a/applications/archive/archive-plugins/org.csstudio.archive.reader.appliance/src/org/csstudio/archive/reader/appliance/ApplianceValueIterator.java +++ b/applications/archive/archive-plugins/org.csstudio.archive.reader.appliance/src/org/csstudio/archive/reader/appliance/ApplianceValueIterator.java @@ -127,7 +127,11 @@ protected void fetchDataInternal(String pvName) throws ArchiverApplianceExceptio */ @Override public synchronized boolean hasNext() { - return !closed && mainIterator != null && mainIterator.hasNext(); + boolean hasNext = !closed && mainIterator != null && mainIterator.hasNext(); + if (reuseMessage && !hasNext) { + hasNext = true; + } + return hasNext; } /*