/** * 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; }
@Test (groups = {"11-06-i-detector"}, dependsOnMethods = {"testInstrument0"}) public void testDetector0() { Assert.assertNotNull(ome); detector0 = instrument0.getDetector(0); Assert.assertNotNull(detector0); Assert.assertEquals(ref.Instrument0Detector0Manufacturer, detector0.getManufacturer()); Assert.assertEquals(ref.Instrument0Detector0Model, detector0.getModel()); Assert.assertEquals(ref.Instrument0DetectorType, detector0.getType()); Assert.assertNull(detector0.getAmplificationGain()); Assert.assertNull(detector0.getGain()); Assert.assertNull(detector0.getLotNumber()); Assert.assertNull(detector0.getOffset()); Assert.assertNull(detector0.getSerialNumber()); Assert.assertNull(detector0.getVoltage()); Assert.assertNull(detector0.getZoom()); }
setZoom(Double.valueOf( element.getAttribute("Zoom"))); setAmplificationGain(Double.valueOf( element.getAttribute("AmplificationGain"))); setGain(Double.valueOf( element.getAttribute("Gain"))); setOffset(Double.valueOf( element.getAttribute("Offset"))); setType(DetectorType.fromString( element.getAttribute("Type"))); if (!element.hasAttribute("ID") && getID() == null) setID(String.valueOf( element.getAttribute("ID"))); model.addModelObject(getID(), this); unitSymbol = getVoltageUnitXsdDefault(); setVoltage(UnitsElectricPotentialEnumHandler.getQuantity(baseValue, modelUnit)); getChildrenByTagName(element, "AnnotationRef"); for (Element AnnotationRef_element : AnnotationRef_nodeList)
instrument.setID(InOutCurrentTest.INSTRUMENT_ID); Detector detector = new Detector(); detector.setID(InOutCurrentTest.DETECTOR_ID); detector.setModel(InOutCurrentTest.DETECTOR_MODEL); CommentAnnotation detectorAnnotation = new CommentAnnotation(); detectorAnnotation.setID(InOutCurrentTest.DETECTOR_ANNOTATION_ID); detectorAnnotation.setValue(InOutCurrentTest.DETECTOR_ANNOTATION_VALUE); detectorAnnotation.setNamespace(InOutCurrentTest.GENERAL_ANNOTATION_NAMESPACE); detector.linkAnnotation(detectorAnnotation); annotations.addCommentAnnotation(detectorAnnotation); instrument.addDetector(detector);
public void setDetectorModel(String model, int instrumentIndex, int detectorIndex) { // Parents: {u'Instrument': {u'OME': None}} // Model is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfDetectorList() == detectorIndex) { o1.addDetector(new Detector()); } Detector o2 = o1.getDetector(detectorIndex); o2.setModel(model); }
public void setDetectorID(String id, int instrumentIndex, int detectorIndex) { // Parents: {u'Instrument': {u'OME': None}} // ID is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfDetectorList() == detectorIndex) { o1.addDetector(new Detector()); } Detector o2 = o1.getDetector(detectorIndex); model.addModelObject(id, o2); o2.setID(id); }
var detective = new Detector(); var fonts_to_test = ["Non-existent Font", "Quaver Serif", "Times New Roman", "Serif"] fonts_to_test.forEach((font_name) => { console.log(font_name, ":", detective.detect(font_name)) })
public void setDetectorManufacturer(String manufacturer, int instrumentIndex, int detectorIndex) { // Parents: {u'Instrument': {u'OME': None}} // Manufacturer is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfDetectorList() == detectorIndex) { o1.addDetector(new Detector()); } Detector o2 = o1.getDetector(detectorIndex); o2.setManufacturer(manufacturer); }
public void setDetectorType(DetectorType type, int instrumentIndex, int detectorIndex) { // Parents: {u'Instrument': {u'OME': None}} // Type is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfDetectorList() == detectorIndex) { o1.addDetector(new Detector()); } Detector o2 = o1.getDetector(detectorIndex); o2.setType(type); }
public void setDetectorZoom(Double zoom, int instrumentIndex, int detectorIndex) { // Parents: {u'Instrument': {u'OME': None}} // Zoom is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfDetectorList() == detectorIndex) { o1.addDetector(new Detector()); } Detector o2 = o1.getDetector(detectorIndex); o2.setZoom(zoom); }
public void setDetectorGain(Double gain, int instrumentIndex, int detectorIndex) { // Parents: {u'Instrument': {u'OME': None}} // Gain is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfDetectorList() == detectorIndex) { o1.addDetector(new Detector()); } Detector o2 = o1.getDetector(detectorIndex); o2.setGain(gain); }
public void setDetectorOffset(Double offset, int instrumentIndex, int detectorIndex) { // Parents: {u'Instrument': {u'OME': None}} // Offset is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfDetectorList() == detectorIndex) { o1.addDetector(new Detector()); } Detector o2 = o1.getDetector(detectorIndex); o2.setOffset(offset); }
public void setDetectorLotNumber(String lotNumber, int instrumentIndex, int detectorIndex) { // Parents: {u'Instrument': {u'OME': None}} // LotNumber is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfDetectorList() == detectorIndex) { o1.addDetector(new Detector()); } Detector o2 = o1.getDetector(detectorIndex); o2.setLotNumber(lotNumber); }
public void setDetectorSerialNumber(String serialNumber, int instrumentIndex, int detectorIndex) { // Parents: {u'Instrument': {u'OME': None}} // SerialNumber is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfDetectorList() == detectorIndex) { o1.addDetector(new Detector()); } Detector o2 = o1.getDetector(detectorIndex); o2.setSerialNumber(serialNumber); }
public void setDetectorVoltage(ElectricPotential voltage, int instrumentIndex, int detectorIndex) { // Parents: {u'Instrument': {u'OME': None}} // Voltage is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfDetectorList() == detectorIndex) { o1.addDetector(new Detector()); } Detector o2 = o1.getDetector(detectorIndex); o2.setVoltage(voltage); }
public void setDetectorAmplificationGain(Double amplificationGain, int instrumentIndex, int detectorIndex) { // Parents: {u'Instrument': {u'OME': None}} // AmplificationGain is not a reference OME o0 = root; if (o0.sizeOfInstrumentList() == instrumentIndex) { o0.addInstrument(new Instrument()); } Instrument o1 = o0.getInstrument(instrumentIndex); if (o1.sizeOfDetectorList() == detectorIndex) { o1.addDetector(new Detector()); } Detector o2 = o1.getDetector(detectorIndex); o2.setAmplificationGain(amplificationGain); }
public String getDetectorModel(int instrumentIndex, int detectorIndex) { // Parents: {u'Instrument': {u'OME': None}} // Model is not a reference return root.getInstrument(instrumentIndex).getDetector(detectorIndex).getModel(); }
public String getDetectorAnnotationRef(int instrumentIndex, int detectorIndex, int annotationRefIndex) { // Parents: {u'Instrument': {u'OME': None}} // AnnotationRef is reference and occurs more than once return root.getInstrument(instrumentIndex).getDetector(detectorIndex).getLinkedAnnotation(annotationRefIndex).getID(); }