public static ElectricPotential createElectricPotential(Integer value, Unit<ElectricPotential> valueUnit) { if (value == null) { return null; } return new ElectricPotential(value, valueUnit); }
public static ElectricPotential createElectricPotential(Double value, Unit<ElectricPotential> valueUnit) { if (value == null) { return null; } return new ElectricPotential(value, valueUnit); }
public static ElectricPotential createElectricPotential(Integer value, Unit<ElectricPotential> valueUnit) { if (value == null) { return null; } return new ElectricPotential(value, valueUnit); }
public static ElectricPotential createElectricPotential(Double value, Unit<ElectricPotential> valueUnit) { if (value == null) { return null; } return new ElectricPotential(value, valueUnit); }
public static <T extends PrimitiveNumber> ElectricPotential createElectricPotential(T value, Unit<ElectricPotential> valueUnit) { if (value == null) { return null; } return new ElectricPotential(value.getNumberValue(), valueUnit); }
public static <T extends PrimitiveNumber> ElectricPotential createElectricPotential(T value, Unit<ElectricPotential> valueUnit) { if (value == null) { return null; } return new ElectricPotential(value.getNumberValue(), valueUnit); }
public static <T extends Number> ElectricPotential getQuantity(T inValue, UnitsElectricPotential inModelUnit) throws EnumerationException { if (inValue instanceof Double) { Double doubleValue = (Double) inValue; return new ome.units.quantity.ElectricPotential(doubleValue, getBaseUnit(inModelUnit)); } if (inValue instanceof Integer) { Integer intValue = (Integer) inValue; return new ome.units.quantity.ElectricPotential(intValue, getBaseUnit(inModelUnit)); } LOGGER.warn("Unknown type '{}' cannot be used to create a 'ElectricPotential' quantity", inValue.getClass().getName()); throw new EnumerationException("UnitsElectricPotentialEnumHandler: type '" + inValue.getClass().getName() + "' cannot be used to create a quantity"); }
public static <T extends Number> ElectricPotential getQuantity(T inValue, UnitsElectricPotential inModelUnit) throws EnumerationException { if (inValue instanceof Double) { Double doubleValue = (Double) inValue; return new ome.units.quantity.ElectricPotential(doubleValue, getBaseUnit(inModelUnit)); } if (inValue instanceof Integer) { Integer intValue = (Integer) inValue; return new ome.units.quantity.ElectricPotential(intValue, getBaseUnit(inModelUnit)); } LOGGER.warn("Unknown type '{}' cannot be used to create a 'ElectricPotential' quantity", inValue.getClass().getName()); throw new EnumerationException("UnitsElectricPotentialEnumHandler: type '" + inValue.getClass().getName() + "' cannot be used to create a quantity"); }
public static ome.units.quantity.ElectricPotential makeXMLQuantity(double d, String unit) { ome.units.unit.Unit<ome.units.quantity.ElectricPotential> units = ome.xml.model.enums.handlers.UnitsElectricPotentialEnumHandler .getBaseUnit(makeXMLUnit(unit)); return new ome.units.quantity.ElectricPotential(d, units); }
public static ome.units.quantity.ElectricPotential makeElectricPotentialXML(double d, String unit) { ome.units.unit.Unit<ome.units.quantity.ElectricPotential> units = ome.xml.model.enums.handlers.UnitsElectricPotentialEnumHandler .getBaseUnit(makeElectricPotentialUnitXML(unit)); return new ome.units.quantity.ElectricPotential(d, units); }
return new ome.units.quantity.ElectricPotential(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.ElectricPotential(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.ElectricPotential(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.ElectricPotential(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.ElectricPotential(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.ElectricPotential(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.ElectricPotential(typedValue.getValue(), getBaseUnit(inModelUnit));
return new ome.units.quantity.ElectricPotential(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.ElectricPotential(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.ElectricPotential(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.ElectricPotential(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.ElectricPotential(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.ElectricPotential(typedValue.getValue(), getBaseUnit(inModelUnit)); return new ome.units.quantity.ElectricPotential(typedValue.getValue(), getBaseUnit(inModelUnit));
/** * FIXME: this should likely take a default so that locations which don't * want an exception can have * * log.warn("Using new PositiveFloat(1.0)!", e); return new * PositiveFloat(1.0); * * or similar. */ public static ome.units.quantity.ElectricPotential convertElectricPotential(ElectricPotential t) { if (t == null) { return null; } Double v = t.getValue(); String u = t.getUnit().getSymbol(); ome.xml.model.enums.UnitsElectricPotential units = makeElectricPotentialUnitXML(u); ome.units.unit.Unit<ome.units.quantity.ElectricPotential> units2 = ome.xml.model.enums.handlers.UnitsElectricPotentialEnumHandler .getBaseUnit(units); return new ome.units.quantity.ElectricPotential(v, units2); }
/** * FIXME: this should likely take a default so that locations which don't * want an exception can have * * log.warn("Using new PositiveFloat(1.0)!", e); return new * PositiveFloat(1.0); * * or similar. */ public static ome.units.quantity.ElectricPotential convert(ElectricPotential t) { if (t == null) { return null; } Double v = t.getValue(); // Use the code/symbol-mapping in the ome.model.enums files // to convert to the specification value. String u = ome.model.enums.UnitsElectricPotential.valueOf( t.getUnit().toString()).getSymbol(); ome.xml.model.enums.UnitsElectricPotential units = makeXMLUnit(u); ome.units.unit.Unit<ome.units.quantity.ElectricPotential> units2 = ome.xml.model.enums.handlers.UnitsElectricPotentialEnumHandler .getBaseUnit(units); return new ome.units.quantity.ElectricPotential(v, units2); }
/** * Creates a detector settings. * * @param ref Reference to the detector. * @return See above. */ public DetectorSettings createDetectorSettings(int ref) { DetectorSettings settings = new DetectorSettings(); settings.setID("Detector:"+ref); settings.setBinning(BINNING); settings.setGain(1.0); settings.setOffset(1.0); settings.setReadOutRate(new Frequency(1.0, UNITS.HERTZ)); settings.setVoltage(new ElectricPotential(1.0, UNITS.VOLT)); settings.setIntegration(new PositiveInteger(20)); settings.setZoom(3.0); return settings; }
/** * Creates a detector. * * @param index The index of the detector in the file. * @return See above. */ public Detector createDetector(int index) { Detector detector = new Detector(); detector.setID("Detector:"+index); detector.setModel(COMPONENT_MODEL); detector.setManufacturer(COMPONENT_MANUFACTURER); detector.setSerialNumber(COMPONENT_SERIAL_NUMBER); detector.setLotNumber(COMPONENT_LOT_NUMBER); detector.setAmplificationGain(0.0); detector.setGain(1.0); detector.setOffset(2.0); detector.setVoltage(new ElectricPotential(100, UNITS.VOLT)); detector.setType(DETECTOR_TYPE); detector.setZoom(3.0); return detector; }
if (voltages != null && voltages[i] != null) { store.setDetectorSettingsVoltage( new ElectricPotential(new Double(voltages[i]), UNITS.VOLT), 0, i);
store.setDetectorSettingsGain(new Double(p.gain), i, c); if (c < p.voltage.size()) { store.setDetectorSettingsVoltage(new ElectricPotential(p.voltage .get(c), UNITS.VOLT), i, c);
if (c < p.voltage.size()) { store.setDetectorSettingsVoltage( new ElectricPotential(p.voltage.get(c), UNITS.VOLT), i, c);
if (c < p.voltage.size()) { store.setDetectorSettingsVoltage( new ElectricPotential(p.voltage.get(c), UNITS.VOLT), i, c);