Skip to content

Commit 6f1c7e0

Browse files
authored
Merge pull request #2594 from ControlSystemStudio/rdb_arch_null_text
RDB archive: Handle samples that have time but no value at all
2 parents c002a14 + a51bf85 commit 6f1c7e0

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

app/databrowser/src/main/java/org/csstudio/trends/databrowser3/export/ValueWithInfoFormatter.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2010-2018 Oak Ridge National Laboratory.
2+
* Copyright (c) 2010-2023 Oak Ridge National Laboratory.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v1.0
55
* which accompanies this distribution, and is available at
@@ -8,8 +8,6 @@
88
package org.csstudio.trends.databrowser3.export;
99

1010
import org.csstudio.trends.databrowser3.Messages;
11-
import org.epics.vtype.VString;
12-
import org.epics.vtype.VStringArray;
1311
import org.epics.vtype.VType;
1412
import org.phoebus.archive.vtype.Style;
1513
import org.phoebus.archive.vtype.VTypeHelper;
@@ -40,12 +38,6 @@ public String getHeader()
4038
@Override
4139
public String format(final VType value)
4240
{
43-
if (value instanceof VString
44-
|| value instanceof VStringArray
45-
|| Double.isNaN(VTypeHelper.toDouble(value)))
46-
return super.format(value) +
47-
Messages.Export_Delimiter + Messages.Export_NoValueMarker +
48-
Messages.Export_Delimiter + Messages.Export_NoValueMarker;
4941
return super.format(value) + Messages.Export_Delimiter +
5042
org.phoebus.core.vtypes.VTypeHelper.getSeverity(value) + Messages.Export_Delimiter +
5143
VTypeHelper.getMessage(value);

app/databrowser/src/main/java/org/phoebus/archive/reader/rdb/AbstractRDBValueIterator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2017-2018 Oak Ridge National Laboratory.
2+
* Copyright (c) 2017-2023 Oak Ridge National Laboratory.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v1.0
55
* which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@
1515
import java.text.NumberFormat;
1616
import java.util.ArrayList;
1717
import java.util.List;
18+
import java.util.Objects;
1819

1920
import org.epics.util.array.ArrayDouble;
2021
import org.epics.util.stats.Range;
@@ -224,7 +225,7 @@ protected VType decodeSampleTableValue(final ResultSet result, final boolean han
224225

225226
// Default to string
226227
final String txt = result.getString(6);
227-
return VString.of(txt, alarm, time);
228+
return VString.of(Objects.toString(txt), alarm, time);
228229
}
229230

230231
/** @param severity Original severity

app/databrowser/src/main/java/org/phoebus/archive/reader/rdb/StoredProcedureValueIterator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2017-2020 Oak Ridge National Laboratory.
2+
* Copyright (c) 2017-2023 Oak Ridge National Laboratory.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v1.0
55
* which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@
1818
import java.time.Instant;
1919
import java.util.ArrayList;
2020
import java.util.List;
21+
import java.util.Objects;
2122
import java.util.TimeZone;
2223
import java.util.logging.Level;
2324
import java.util.logging.Logger;
@@ -219,7 +220,7 @@ private List<VType> decodeOptimizedTable(final ResultSet result) throws Exceptio
219220
// WB==-1 indicates a String sample
220221
final VType value;
221222
if (result.getInt(1) < 0)
222-
value = VString.of(result.getString(8), alarm, time);
223+
value = VString.of(Objects.toString(result.getString(8)), alarm, time);
223224
else
224225
{ // Only one value within averaging bucket?
225226
final int cnt = result.getInt(9);

0 commit comments

Comments
 (0)