@Test public void testBasicConstruction() throws Exception { EepDataField dataField = new EepDataField("EDF1", 0, 8); DataRange rawDataRange = new DataRange(0, 255); DataRange unitsDataRange = new DataRange(0, 100); LinearScale scale = new LinearScale(rawDataRange, unitsDataRange, 2); Range range = new Range(dataField, scale); Assert.assertNull(range.rangeValue()); range = new Range(dataField, 100); Assert.assertEquals(100, range.rangeValue().intValue()); }
public Double rangeValue() { if(scaledValue != null) { return scaledValue.doubleValue(); } else if(rawValue != null) { return (double)rawValue; } else { return null; } }
Range implements DataType, EepDataListener { public Double rangeValue() { if(scaledValue != null) { return scaledValue.doubleValue(); } else if(rawValue != null) { return (double)rawValue; } else { return null; } } }
Range implements DataType, EepDataListener { public Double rangeValue() { if(scaledValue != null) { return scaledValue.doubleValue(); } else if(rawValue != null) { return (double)rawValue; } else { return null; } } Range(EepDataField dataField, LinearScale scale);  Range(EepDataField dataField, int rawValue); }
Range implements DataType, EepDataListener { public Double rangeValue() { if(scaledValue != null) { return scaledValue.doubleValue(); } else if(rawValue != null) { return (double)rawValue; } else { return null; } } Range(EepDataField dataField, LinearScale scale);  Range(EepDataField dataField, int rawValue); static Range createRange(String name, int offset, int size,
                                  int rawDataRangeMin, int rawDataRangeMax,
                                  double unitsDataRangeMin, double unitsDataRangeMax,
                                  int fractionalDigits); Double rangeValue(); @Override void didUpdateData(EepData data); @Override void updateData(EepData data); @Override void updateSensor(Sensor sensor); }
Range implements DataType, EepDataListener { public Double rangeValue() { if(scaledValue != null) { return scaledValue.doubleValue(); } else if(rawValue != null) { return (double)rawValue; } else { return null; } } Range(EepDataField dataField, LinearScale scale);  Range(EepDataField dataField, int rawValue); static Range createRange(String name, int offset, int size,
                                  int rawDataRangeMin, int rawDataRangeMax,
                                  double unitsDataRangeMin, double unitsDataRangeMax,
                                  int fractionalDigits); Double rangeValue(); @Override void didUpdateData(EepData data); @Override void updateData(EepData data); @Override void updateSensor(Sensor sensor);  }