@Override public void pvChanged(PVReaderEvent<VDouble> event) { PVReader<VDouble> pv = event.getPvReader(); System.out.println(pv.getValue().getValue() + " " + Date.from(pv.getValue().getTimestamp()) + " " + pv.getValue().getAlarmSeverity()); } })
@Override public void pvChanged(PVReaderEvent<VDouble> event) { if (event.isValueChanged()) { valueLabel.setText(Double.toString(pv.getValue().getValue())); overallCounter++; Instant now = Instant.now(); double avgRage = overallCounter / (overallTimestamp.until(now, ChronoUnit.SECONDS)); avgRateLabel.setText("" + avgRage); if (now.compareTo(lastPeriodTimestamp.plus(measureInterval)) >= 0) { double currentRate = (overallCounter - lastPeriodCounter) / (lastPeriodTimestamp.until(now, ChronoUnit.SECONDS)); currentRateLabel.setText("" + currentRate); lastPeriodTimestamp = now; lastPeriodCounter = overallCounter; } } } }).maxRate(TimeDuration.ofHertz(scanRate));
PVScalar pvScalar = (PVScalar) pvField; if (value instanceof VDouble) { convert.fromDouble(pvScalar, ((VDouble) value).getValue()); } else if (value instanceof VInt) { convert.fromInt(pvScalar, ((VInt) value).getValue());
AlarmSeverity statSeverity = null; for (VDouble vDouble : data) { switch(vDouble.getAlarmSeverity()) { case NONE: totalSum += vDouble.getValue(); break; totalSum += vDouble.getValue(); break; totalSum += vDouble.getValue(); break; newTime(data.get(data.size() / 2).getTimestamp()), data.get(0));
AlarmSeverity statSeverity = null; for (VDouble vDouble : data) { switch(vDouble.getAlarmSeverity()) { case NONE: stats.includeValue(vDouble.getValue()); break; stats.includeValue(vDouble.getValue()); break; stats.includeValue(vDouble.getValue()); break; sqrt(stats.totalSquareSum / stats.nElements - (stats.totalSum * stats.totalSum) / (stats.nElements * stats.nElements)), stats.min, stats.max, stats.nElements, newAlarm(statSeverity, "NONE"), newTime(data.get(data.size() / 2).getTimestamp()), data.get(0));