|
1 | 1 | /******************************************************************************* |
2 | | - * Copyright (c) 2015-2020 Oak Ridge National Laboratory. |
| 2 | + * Copyright (c) 2015-2022 Oak Ridge National Laboratory. |
3 | 3 | * All rights reserved. This program and the accompanying materials |
4 | 4 | * are made available under the terms of the Eclipse Public License v1.0 |
5 | 5 | * which accompanies this distribution, and is available at |
|
44 | 44 | import org.csstudio.javafx.rtplot.internal.NumericAxis; |
45 | 45 | import org.epics.util.array.ArrayDouble; |
46 | 46 | import org.epics.util.array.ListNumber; |
| 47 | +import org.epics.vtype.Display; |
| 48 | +import org.epics.vtype.VImage; |
47 | 49 | import org.epics.vtype.VNumber; |
48 | 50 | import org.epics.vtype.VNumberArray; |
49 | 51 | import org.epics.vtype.VType; |
@@ -286,11 +288,22 @@ private void computeTrace() |
286 | 288 | return; |
287 | 289 |
|
288 | 290 | final ListNumber x_data, y_data, error; |
289 | | - final VType y_value = model_trace.traceYValue().getValue(); |
| 291 | + VType y_value = model_trace.traceYValue().getValue(); |
| 292 | + |
| 293 | + if (y_value instanceof VImage) |
| 294 | + { // Extract VNumberArray from image, then continue with that |
| 295 | + final VImage image = (VImage) y_value; |
| 296 | + y_value = VNumberArray.of(image.getData(), image.getAlarm(), image.getTime(), Display.none()); |
| 297 | + } |
290 | 298 |
|
291 | 299 | if (y_value instanceof VNumberArray) |
292 | 300 | { |
293 | | - final VType x_value = model_trace.traceXValue().getValue(); |
| 301 | + VType x_value = model_trace.traceXValue().getValue(); |
| 302 | + if (x_value instanceof VImage) |
| 303 | + { // Extract VNumberArray from image, then continue with that |
| 304 | + final VImage image = (VImage) x_value; |
| 305 | + x_value = VNumberArray.of(image.getData(), image.getAlarm(), image.getTime(), Display.none()); |
| 306 | + } |
294 | 307 | x_data = (x_value instanceof VNumberArray) ? ((VNumberArray)x_value).getData() : null; |
295 | 308 |
|
296 | 309 | final VNumberArray y_array = (VNumberArray)y_value; |
@@ -323,7 +336,12 @@ else if (y_value instanceof VNumber) |
323 | 336 | else |
324 | 337 | { // No Y Data. |
325 | 338 | // Do we have X data? |
326 | | - final VType x_value = model_trace.traceXValue().getValue(); |
| 339 | + VType x_value = model_trace.traceXValue().getValue(); |
| 340 | + if (x_value instanceof VImage) |
| 341 | + { // Extract VNumberArray from image, then continue with that |
| 342 | + final VImage image = (VImage) x_value; |
| 343 | + x_value = VNumberArray.of(image.getData(), image.getAlarm(), image.getTime(), Display.none()); |
| 344 | + } |
327 | 345 | if (x_value instanceof VNumberArray) |
328 | 346 | { |
329 | 347 | x_data = ((VNumberArray)x_value).getData(); |
|
0 commit comments