/** * Sets minimum allowed value for this datasource. If <code>filterArchivedValues</code> * argument is set to true, all archived values less then <code>minValue</code> will * be fixed to NaN. * * @param minValue New minimal value. Specify <code>Double.NaN</code> if no minimal * value should be set * @param filterArchivedValues true, if archived datasource values should be fixed; * false, otherwise. * @throws java.io.IOException Thrown in case of I/O error * @throws java.lang.IllegalArgumentException Thrown if invalid minValue was supplied (not less then maxValue) */ public void setMinValue(double minValue, boolean filterArchivedValues) throws IOException { double maxValue = this.maxValue.get(); if (!Double.isNaN(minValue) && !Double.isNaN(maxValue) && minValue >= maxValue) { throw new IllegalArgumentException(INVALID_MIN_MAX_VALUES + minValue + "/" + maxValue); } this.minValue.set(minValue); if (!Double.isNaN(minValue) && filterArchivedValues) { int dsIndex = getDsIndex(); Archive[] archives = parentDb.getArchives(); for (Archive archive : archives) { archive.getRobin(dsIndex).filterValues(minValue, Double.NaN); } } }
/** * Sets maximum allowed value for this datasource. If <code>filterArchivedValues</code> * argument is set to true, all archived values greater then <code>maxValue</code> will * be fixed to NaN. * * @param maxValue New maximal value. Specify <code>Double.NaN</code> if no max * value should be set. * @param filterArchivedValues true, if archived datasource values should be fixed; * false, otherwise. * @throws java.io.IOException Thrown in case of I/O error * @throws java.lang.IllegalArgumentException Thrown if invalid maxValue was supplied (not greater then minValue) */ public void setMaxValue(double maxValue, boolean filterArchivedValues) throws IOException { double minValue = this.minValue.get(); if (!Double.isNaN(minValue) && !Double.isNaN(maxValue) && minValue >= maxValue) { throw new IllegalArgumentException(INVALID_MIN_MAX_VALUES + minValue + "/" + maxValue); } this.maxValue.set(maxValue); if (!Double.isNaN(maxValue) && filterArchivedValues) { int dsIndex = getDsIndex(); Archive[] archives = parentDb.getArchives(); for (Archive archive : archives) { archive.getRobin(dsIndex).filterValues(Double.NaN, maxValue); } } }
/** * Sets minimum allowed value for this datasource. If <code>filterArchivedValues</code> * argment is set to true, all archived values less then <code>minValue</code> will * be fixed to NaN. * * @param minValue New minimal value. Specify <code>Double.NaN</code> if no minimal * value should be set * @param filterArchivedValues true, if archived datasource values should be fixed; * false, otherwise. * @throws IOException Thrown in case of I/O error * @throws IllegalArgumentException Thrown if invalid minValue was supplied (not less then maxValue) */ public void setMinValue(double minValue, boolean filterArchivedValues) throws IOException { double maxValue = this.maxValue.get(); if (!Double.isNaN(minValue) && !Double.isNaN(maxValue) && minValue >= maxValue) { throw new IllegalArgumentException("Invalid min/max values: " + minValue + "/" + maxValue); } this.minValue.set(minValue); if (!Double.isNaN(minValue) && filterArchivedValues) { int dsIndex = getDsIndex(); Archive[] archives = parentDb.getArchives(); for (Archive archive : archives) { archive.getRobin(dsIndex).filterValues(minValue, Double.NaN); } } }
/** * Sets min/max values allowed for this datasource. If <code>filterArchivedValues</code> * argument is set to true, all archived values less then <code>minValue</code> or * greater then <code>maxValue</code> will be fixed to NaN. * * @param minValue New minimal value. Specify <code>Double.NaN</code> if no min * value should be set. * @param maxValue New maximal value. Specify <code>Double.NaN</code> if no max * value should be set. * @param filterArchivedValues true, if archived datasource values should be fixed; * false, otherwise. * @throws java.io.IOException Thrown in case of I/O error * @throws java.lang.IllegalArgumentException Thrown if invalid min/max values were supplied */ public void setMinMaxValue(double minValue, double maxValue, boolean filterArchivedValues) throws IOException { if (!Double.isNaN(minValue) && !Double.isNaN(maxValue) && minValue >= maxValue) { throw new IllegalArgumentException(INVALID_MIN_MAX_VALUES + minValue + "/" + maxValue); } this.minValue.set(minValue); this.maxValue.set(maxValue); if (!(Double.isNaN(minValue) && Double.isNaN(maxValue)) && filterArchivedValues) { int dsIndex = getDsIndex(); Archive[] archives = parentDb.getArchives(); for (Archive archive : archives) { archive.getRobin(dsIndex).filterValues(minValue, maxValue); } } }
/** * Sets min/max values allowed for this datasource. If <code>filterArchivedValues</code> * argment is set to true, all archived values less then <code>minValue</code> or * greater then <code>maxValue</code> will be fixed to NaN. * * @param minValue New minimal value. Specify <code>Double.NaN</code> if no min * value should be set. * @param maxValue New maximal value. Specify <code>Double.NaN</code> if no max * value should be set. * @param filterArchivedValues true, if archived datasource values should be fixed; * false, otherwise. * @throws IOException Thrown in case of I/O error * @throws IllegalArgumentException Thrown if invalid min/max values were supplied */ public void setMinMaxValue(double minValue, double maxValue, boolean filterArchivedValues) throws IOException { if (!Double.isNaN(minValue) && !Double.isNaN(maxValue) && minValue >= maxValue) { throw new IllegalArgumentException("Invalid min/max values: " + minValue + "/" + maxValue); } this.minValue.set(minValue); this.maxValue.set(maxValue); if (!(Double.isNaN(minValue) && Double.isNaN(maxValue)) && filterArchivedValues) { int dsIndex = getDsIndex(); Archive[] archives = parentDb.getArchives(); for (Archive archive : archives) { archive.getRobin(dsIndex).filterValues(minValue, maxValue); } } }
/** * Sets maximum allowed value for this datasource. If <code>filterArchivedValues</code> * argment is set to true, all archived values greater then <code>maxValue</code> will * be fixed to NaN. * * @param maxValue New maximal value. Specify <code>Double.NaN</code> if no max * value should be set. * @param filterArchivedValues true, if archived datasource values should be fixed; * false, otherwise. * @throws IOException Thrown in case of I/O error * @throws IllegalArgumentException Thrown if invalid maxValue was supplied (not greater then minValue) */ public void setMaxValue(double maxValue, boolean filterArchivedValues) throws IOException { double minValue = this.minValue.get(); if (!Double.isNaN(minValue) && !Double.isNaN(maxValue) && minValue >= maxValue) { throw new IllegalArgumentException("Invalid min/max values: " + minValue + "/" + maxValue); } this.maxValue.set(maxValue); if (!Double.isNaN(maxValue) && filterArchivedValues) { int dsIndex = getDsIndex(); Archive[] archives = parentDb.getArchives(); for (Archive archive : archives) { archive.getRobin(dsIndex).filterValues(Double.NaN, maxValue); } } }
public void setValueAt(Object aValue, int rowIndex, int columnIndex) { assert columnIndex == 2 : "Column " + columnIndex + " is not editable!"; double value; try { value = Double.parseDouble(aValue.toString()); } catch (NumberFormatException nfe) { value = Double.NaN; } if (dsIndex >= 0 && arcIndex >= 0 && file != null) { try { RrdDb rrd = new RrdDb(file.getAbsolutePath()); try { Robin robin = rrd.getArchive(arcIndex).getRobin(dsIndex); robin.setValue(rowIndex, value); values[rowIndex][2] = InspectorModel.formatDouble(robin.getValue(rowIndex)); } finally { rrd.close(); } } catch (Exception e) { Util.error(null, e); } } }
try { Archive arc = rrd.getArchive(arcIndex); Robin robin = arc.getRobin(dsIndex); long start = arc.getStartTime(); long step = arc.getArcStep();
Datasource ds = rrdDb.getDatasource(dsIndex); Archive arc = rrdDb.getArchive(arcIndex); Robin robin = arc.getRobin(dsIndex); dsName = ds.getName(); t1 = arc.getStartTime();