@Override public Exception lastException() { return reader.lastException(); }
@Override public void pvChanged(PVReaderEvent<Object> event) { // Timeout are passed as exceptions. This allows you to // treat them as any other error conditions. Exception ex = event.getPvReader().lastException(); if (ex instanceof TimeoutException) { System.out.println("Didn't connected after 5 seconds"); } } })
@Override public void pvChanged(PVReaderEvent<Object> event) { // By default, read exceptions are made available // on the reader itself. // This will give you only the last exception, so if // more then one exception was generated after the last read, // some will be lost. Exception ex = event.getPvReader().lastException(); // Note that taking the exception, clears it // so next call you'll get null. if (event.getPvReader().lastException() == null) { // Always true } } })
@Override public void pvChanged(PVReaderEvent<VIntArray> event) { PVReader<VIntArray> pv = event.getPvReader(); logException(pv.lastException()); System.out.println(pv.getValue().getData() + " " + Date.from(pv.getValue().getTimestamp()) + " " + pv.getValue().getAlarmSeverity()); } })
@Override public void pvChanged(PVReaderEvent<VImage> event) { setLastError(pv.lastException()); if (pv.getValue() != null) { BufferedImage image = ValueUtil.toImage(pv.getValue()); plotView.setImage(image); } } })
@Override public void pvChanged(PVReaderEvent<VImage> event) { setLastError(pv.lastException()); if (pv.getValue() != null) { BufferedImage image = ValueUtil.toImage(pv.getValue()); plotView.setImage(image); } } })
@Override public void pvChanged(PVReaderEvent<VDoubleArray> event) { PVReader<VDoubleArray> pv = event.getPvReader(); logException(pv.lastException()); if (pv.getValue() != null) { System.out.println(pv.getValue().getData() + " " + Date.from(pv.getValue().getTimestamp()) + " " + pv.getValue().getAlarmSeverity()); } } })
@Override public void pvChanged(PVReaderEvent<VEnum> event) { PVReader<VEnum> pv = event.getPvReader(); logException(pv.lastException()); if (pv.getValue() != null) { System.out.println(pv.getValue().getValue() + " " + Date.from(pv.getValue().getTimestamp()) + " " + pv.getValue().getAlarmSeverity()); } } })
@Override public void pvChanged(PVReaderEvent<VString> event) { PVReader<VString> pv = event.getPvReader(); logException(pv.lastException()); if (pv.getValue() != null) { System.out.println(pv.getValue().getValue() + " " + Date.from(pv.getValue().getTimestamp()) + " " + pv.getValue().getAlarmSeverity()); } } })
@Override public void pvChanged(PVReaderEvent<Object> event) { PVReader<Object> pv = event.getPvReader(); long pause = System.currentTimeMillis() - start; start = System.currentTimeMillis(); if (pv.getValue() instanceof VShortArray) { System.out.println(pause + " ms - " + pv.getValue() + " - count " + ((VShortArray) pv.getValue()).getData().size()); } else if (pv.getValue() instanceof VDoubleArray) { System.out.println(pause + " ms - " + pv.getValue() + " - count " + ((VDoubleArray) pv.getValue()).getData().size()); } else { System.out.println(pause + " ms - " + pv.getValue()); } Exception ex = pv.lastException(); if (ex != null) { ex.printStackTrace(); } } })
@Override public void pvChanged(PVReaderEvent<Graph2DResult> event) { setLastError(pv.lastException()); if (pv.getValue() != null) { BufferedImage image = ValueUtil.toImage(pv.getValue().getImage()); plotView.setImage(image); } } })
@Override public void pvChanged(PVReaderEvent<Graph2DResult> event) { setLastError(pv.lastException()); if (pv.getValue() != null) { BufferedImage image = ValueUtil.toImage(pv.getValue().getImage()); imagePanel.setImage(image); } } })
@Override public void pvChanged(PVReaderEvent<Graph2DResult> event) { setLastError(event.getPvReader().lastException()); if (event.getPvReader().getValue() != null) { BufferedImage image = ValueUtil.toImage(event.getPvReader().getValue().getImage()); imagePanels.get(i).setImage(image); } } })
logException(pv.lastException()); VDouble value = (VDouble) pv.getValue(); System.out.println(value.getClass()); logException(pv.lastException()); VString value = (VString) pv.getValue(); System.out.println(value.getClass()); logException(pv.lastException()); VEnum value = (VEnum) pv.getValue(); System.out.println(value.getClass()); logException(pv.lastException()); VInt value = (VInt) pv.getValue(); System.out.println(value.getClass()); logException(pv.lastException()); VDoubleArray value = (VDoubleArray) pv.getValue(); System.out.println(value.getClass());
@Override public void pvChanged(PVReaderEvent<Object> event) { setLastError(pv.lastException()); Object value = pv.getValue(); setTextValue(format.format(value)); setType(ValueUtil.typeOf(value)); setAlarm(ValueUtil.alarmOf(value)); setTime(ValueUtil.timeOf(value)); setIndicator(ValueUtil.normalizedNumericValueOf(value)); setMetadata(ValueUtil.displayOf(value)); setConnected(pv.isConnected()); } })