...
When this interface is implemented the method useUnreliables() must be specified. A boolean must be returned which defines whether or not unreliable data should be included in the input.
Unfortunately it is not possible to use a configured option to determine if unreliables are allowed, because the usage of unreliables are handled before the configured options are processed.
Code Block | ||||
---|---|---|---|---|
| ||||
package nl.wldelft.fews.openapi.transformationmodule; import nl.wldelft.util.timeseries.TimeSeriesArray; public class CustomIncludeUnreliablesTestFunction implements Calculation, UseUnreliableInputValueFunction { @Input TimeSeriesArray inputSeries = null; @Output TimeSeriesArray outputSeries = null; @Override public boolean useUnreliables() { return true; } @Override public void calculate() throws Exception { for (int i = 0, size = inputSeries.size(); i < size; i++) { long time = inputSeries.getTime(i); outputSeries.putValue(time, inputSeries.getValue(i)); int indexOfTime = outputSeries.indexOfTime(time); outputSeries.setFlag(indexOfTime, inputSeries.getFlag(i)); } } } |
...