Changeset 6841


Ignore:
Timestamp:
08/24/10 12:25:12 (9 years ago)
Author:
melissa
Message:
  • Updated MetadataConverter to properly handle LightSource attributes.
  • Fixed a handful of small bugs in the SPW model tests.
Location:
trunk/components/bio-formats
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats/src/loci/formats/meta/MetadataConverter.java

    r6786 r6841  
    725725    } catch (NullPointerException e) { } 
    726726      try { 
    727       /* 
    728       int arcCount = src.getArcCount(instrumentIndex); 
    729       for (int arcIndex=0; arcIndex<arcCount; arcIndex++) { 
    730       try { 
    731         String arcIDValue = src.getArcID(instrumentIndex, arcIndex); 
    732         if (arcIDValue != null) dest.setArcID(arcIDValue, instrumentIndex, arcIndex); 
    733       } catch (NullPointerException e) { } 
    734       try { 
    735         String arcLotNumberValue = src.getArcLotNumber(instrumentIndex, arcIndex); 
    736         if (arcLotNumberValue != null) dest.setArcLotNumber(arcLotNumberValue, instrumentIndex, arcIndex); 
    737       } catch (NullPointerException e) { } 
    738       try { 
    739         String arcManufacturerValue = src.getArcManufacturer(instrumentIndex, arcIndex); 
    740         if (arcManufacturerValue != null) dest.setArcManufacturer(arcManufacturerValue, instrumentIndex, arcIndex); 
    741       } catch (NullPointerException e) { } 
    742       try { 
    743         String arcModelValue = src.getArcModel(instrumentIndex, arcIndex); 
    744         if (arcModelValue != null) dest.setArcModel(arcModelValue, instrumentIndex, arcIndex); 
    745       } catch (NullPointerException e) { } 
    746       try { 
    747         Double arcPowerValue = src.getArcPower(instrumentIndex, arcIndex); 
    748         if (arcPowerValue != null) dest.setArcPower(arcPowerValue, instrumentIndex, arcIndex); 
    749       } catch (NullPointerException e) { } 
    750       try { 
    751         String arcSerialNumberValue = src.getArcSerialNumber(instrumentIndex, arcIndex); 
    752         if (arcSerialNumberValue != null) dest.setArcSerialNumber(arcSerialNumberValue, instrumentIndex, arcIndex); 
    753       } catch (NullPointerException e) { } 
    754       try { 
    755         ArcType arcTypeValue = src.getArcType(instrumentIndex, arcIndex); 
    756         if (arcTypeValue != null) dest.setArcType(arcTypeValue, instrumentIndex, arcIndex); 
    757       } catch (NullPointerException e) { } 
    758       } 
    759       */ 
    760       } catch (NullPointerException e) { } 
    761       try { 
    762727      int detectorCount = src.getDetectorCount(instrumentIndex); 
    763728      for (int detectorIndex=0; detectorIndex<detectorCount; detectorIndex++) { 
     
    832797      } catch (NullPointerException e) { } 
    833798      } 
    834       } catch (NullPointerException e) { } 
    835       try { 
    836       /* 
    837       int filamentCount = src.getFilamentCount(instrumentIndex); 
    838       for (int filamentIndex=0; filamentIndex<filamentCount; filamentIndex++) { 
    839       try { 
    840         String filamentIDValue = src.getFilamentID(instrumentIndex, filamentIndex); 
    841         if (filamentIDValue != null) dest.setFilamentID(filamentIDValue, instrumentIndex, filamentIndex); 
    842       } catch (NullPointerException e) { } 
    843       try { 
    844         String filamentLotNumberValue = src.getFilamentLotNumber(instrumentIndex, filamentIndex); 
    845         if (filamentLotNumberValue != null) dest.setFilamentLotNumber(filamentLotNumberValue, instrumentIndex, filamentIndex); 
    846       } catch (NullPointerException e) { } 
    847       try { 
    848         String filamentManufacturerValue = src.getFilamentManufacturer(instrumentIndex, filamentIndex); 
    849         if (filamentManufacturerValue != null) dest.setFilamentManufacturer(filamentManufacturerValue, instrumentIndex, filamentIndex); 
    850       } catch (NullPointerException e) { } 
    851       try { 
    852         String filamentModelValue = src.getFilamentModel(instrumentIndex, filamentIndex); 
    853         if (filamentModelValue != null) dest.setFilamentModel(filamentModelValue, instrumentIndex, filamentIndex); 
    854       } catch (NullPointerException e) { } 
    855       try { 
    856         Double filamentPowerValue = src.getFilamentPower(instrumentIndex, filamentIndex); 
    857         if (filamentPowerValue != null) dest.setFilamentPower(filamentPowerValue, instrumentIndex, filamentIndex); 
    858       } catch (NullPointerException e) { } 
    859       try { 
    860         String filamentSerialNumberValue = src.getFilamentSerialNumber(instrumentIndex, filamentIndex); 
    861         if (filamentSerialNumberValue != null) dest.setFilamentSerialNumber(filamentSerialNumberValue, instrumentIndex, filamentIndex); 
    862       } catch (NullPointerException e) { } 
    863       try { 
    864         FilamentType filamentTypeValue = src.getFilamentType(instrumentIndex, filamentIndex); 
    865         if (filamentTypeValue != null) dest.setFilamentType(filamentTypeValue, instrumentIndex, filamentIndex); 
    866       } catch (NullPointerException e) { } 
    867       } 
    868       */ 
    869799      } catch (NullPointerException e) { } 
    870800      try { 
     
    967897      } catch (NullPointerException e) { } 
    968898      try { 
    969       /* 
    970       int laserCount = src.getLaserCount(instrumentIndex); 
    971       for (int laserIndex=0; laserIndex<laserCount; laserIndex++) { 
    972       try { 
    973         PositiveInteger laserFrequencyMultiplicationValue = src.getLaserFrequencyMultiplication(instrumentIndex, laserIndex); 
    974         if (laserFrequencyMultiplicationValue != null) dest.setLaserFrequencyMultiplication(laserFrequencyMultiplicationValue, instrumentIndex, laserIndex); 
    975       } catch (NullPointerException e) { } 
    976       try { 
    977         String laserIDValue = src.getLaserID(instrumentIndex, laserIndex); 
    978         if (laserIDValue != null) dest.setLaserID(laserIDValue, instrumentIndex, laserIndex); 
    979       } catch (NullPointerException e) { } 
    980       try { 
    981         LaserMedium laserLaserMediumValue = src.getLaserLaserMedium(instrumentIndex, laserIndex); 
    982         if (laserLaserMediumValue != null) dest.setLaserLaserMedium(laserLaserMediumValue, instrumentIndex, laserIndex); 
    983       } catch (NullPointerException e) { } 
    984       try { 
    985         String laserLotNumberValue = src.getLaserLotNumber(instrumentIndex, laserIndex); 
    986         if (laserLotNumberValue != null) dest.setLaserLotNumber(laserLotNumberValue, instrumentIndex, laserIndex); 
    987       } catch (NullPointerException e) { } 
    988       try { 
    989         String laserManufacturerValue = src.getLaserManufacturer(instrumentIndex, laserIndex); 
    990         if (laserManufacturerValue != null) dest.setLaserManufacturer(laserManufacturerValue, instrumentIndex, laserIndex); 
    991       } catch (NullPointerException e) { } 
    992       try { 
    993         String laserModelValue = src.getLaserModel(instrumentIndex, laserIndex); 
    994         if (laserModelValue != null) dest.setLaserModel(laserModelValue, instrumentIndex, laserIndex); 
    995       } catch (NullPointerException e) { } 
    996       try { 
    997         Boolean laserPockelCellValue = src.getLaserPockelCell(instrumentIndex, laserIndex); 
    998         if (laserPockelCellValue != null) dest.setLaserPockelCell(laserPockelCellValue, instrumentIndex, laserIndex); 
    999       } catch (NullPointerException e) { } 
    1000       try { 
    1001         Double laserPowerValue = src.getLaserPower(instrumentIndex, laserIndex); 
    1002         if (laserPowerValue != null) dest.setLaserPower(laserPowerValue, instrumentIndex, laserIndex); 
    1003       } catch (NullPointerException e) { } 
    1004       try { 
    1005         Pulse laserPulseValue = src.getLaserPulse(instrumentIndex, laserIndex); 
    1006         if (laserPulseValue != null) dest.setLaserPulse(laserPulseValue, instrumentIndex, laserIndex); 
    1007       } catch (NullPointerException e) { } 
    1008       try { 
    1009         String laserPumpValue = src.getLaserPump(instrumentIndex, laserIndex); 
    1010         if (laserPumpValue != null) dest.setLaserPump(laserPumpValue, instrumentIndex, laserIndex); 
    1011       } catch (NullPointerException e) { } 
    1012       try { 
    1013         Double laserRepetitionRateValue = src.getLaserRepetitionRate(instrumentIndex, laserIndex); 
    1014         if (laserRepetitionRateValue != null) dest.setLaserRepetitionRate(laserRepetitionRateValue, instrumentIndex, laserIndex); 
    1015       } catch (NullPointerException e) { } 
    1016       try { 
    1017         String laserSerialNumberValue = src.getLaserSerialNumber(instrumentIndex, laserIndex); 
    1018         if (laserSerialNumberValue != null) dest.setLaserSerialNumber(laserSerialNumberValue, instrumentIndex, laserIndex); 
    1019       } catch (NullPointerException e) { } 
    1020       try { 
    1021         Boolean laserTuneableValue = src.getLaserTuneable(instrumentIndex, laserIndex); 
    1022         if (laserTuneableValue != null) dest.setLaserTuneable(laserTuneableValue, instrumentIndex, laserIndex); 
    1023       } catch (NullPointerException e) { } 
    1024       try { 
    1025         LaserType laserTypeValue = src.getLaserType(instrumentIndex, laserIndex); 
    1026         if (laserTypeValue != null) dest.setLaserType(laserTypeValue, instrumentIndex, laserIndex); 
    1027       } catch (NullPointerException e) { } 
    1028       try { 
    1029         PositiveInteger laserWavelengthValue = src.getLaserWavelength(instrumentIndex, laserIndex); 
    1030         if (laserWavelengthValue != null) dest.setLaserWavelength(laserWavelengthValue, instrumentIndex, laserIndex); 
    1031       } catch (NullPointerException e) { } 
    1032       } 
    1033       */ 
    1034       } catch (NullPointerException e) { } 
    1035       try { 
    1036       /* 
    1037       int lightEmittingDiodeCount = src.getLightEmittingDiodeCount(instrumentIndex); 
    1038       for (int lightEmittingDiodeIndex=0; lightEmittingDiodeIndex<lightEmittingDiodeCount; lightEmittingDiodeIndex++) { 
    1039       try { 
    1040         String lightEmittingDiodeIDValue = src.getLightEmittingDiodeID(instrumentIndex, lightEmittingDiodeIndex); 
    1041         if (lightEmittingDiodeIDValue != null) dest.setLightEmittingDiodeID(lightEmittingDiodeIDValue, instrumentIndex, lightEmittingDiodeIndex); 
    1042       } catch (NullPointerException e) { } 
    1043       try { 
    1044         String lightEmittingDiodeLotNumberValue = src.getLightEmittingDiodeLotNumber(instrumentIndex, lightEmittingDiodeIndex); 
    1045         if (lightEmittingDiodeLotNumberValue != null) dest.setLightEmittingDiodeLotNumber(lightEmittingDiodeLotNumberValue, instrumentIndex, lightEmittingDiodeIndex); 
    1046       } catch (NullPointerException e) { } 
    1047       try { 
    1048         String lightEmittingDiodeManufacturerValue = src.getLightEmittingDiodeManufacturer(instrumentIndex, lightEmittingDiodeIndex); 
    1049         if (lightEmittingDiodeManufacturerValue != null) dest.setLightEmittingDiodeManufacturer(lightEmittingDiodeManufacturerValue, instrumentIndex, lightEmittingDiodeIndex); 
    1050       } catch (NullPointerException e) { } 
    1051       try { 
    1052         String lightEmittingDiodeModelValue = src.getLightEmittingDiodeModel(instrumentIndex, lightEmittingDiodeIndex); 
    1053         if (lightEmittingDiodeModelValue != null) dest.setLightEmittingDiodeModel(lightEmittingDiodeModelValue, instrumentIndex, lightEmittingDiodeIndex); 
    1054       } catch (NullPointerException e) { } 
    1055       try { 
    1056         Double lightEmittingDiodePowerValue = src.getLightEmittingDiodePower(instrumentIndex, lightEmittingDiodeIndex); 
    1057         if (lightEmittingDiodePowerValue != null) dest.setLightEmittingDiodePower(lightEmittingDiodePowerValue, instrumentIndex, lightEmittingDiodeIndex); 
    1058       } catch (NullPointerException e) { } 
    1059       try { 
    1060         String lightEmittingDiodeSerialNumberValue = src.getLightEmittingDiodeSerialNumber(instrumentIndex, lightEmittingDiodeIndex); 
    1061         if (lightEmittingDiodeSerialNumberValue != null) dest.setLightEmittingDiodeSerialNumber(lightEmittingDiodeSerialNumberValue, instrumentIndex, lightEmittingDiodeIndex); 
    1062       } catch (NullPointerException e) { } 
    1063       } 
    1064       */ 
    1065       } catch (NullPointerException e) { } 
    1066       try { 
    1067899        String microscopeLotNumberValue = src.getMicroscopeLotNumber(instrumentIndex); 
    1068900        if (microscopeLotNumberValue != null) dest.setMicroscopeLotNumber(microscopeLotNumberValue, instrumentIndex); 
     
    11941026      } 
    11951027      } catch (NullPointerException e) { } 
     1028      convertLightSources(src, dest, instrumentIndex); 
    11961029    } 
    11971030    } catch (NullPointerException e) { } 
     
    22912124  } 
    22922125 
     2126  // -- Helper methods -- 
     2127 
     2128  private static void convertLightSources(MetadataRetrieve src, 
     2129    MetadataStore dest, int instrumentIndex) 
     2130  { 
     2131    int lightSourceCount = src.getLightSourceCount(instrumentIndex); 
     2132 
     2133    for (int lightSource=0; lightSource<lightSourceCount; lightSource++) { 
     2134      String type = src.getLightSourceType(instrumentIndex, lightSource); 
     2135      if (type.equals("Arc")) { 
     2136        try { 
     2137          String id = src.getArcID(instrumentIndex, lightSource); 
     2138          if (id != null) dest.setArcID(id, instrumentIndex, lightSource); 
     2139        } 
     2140        catch (NullPointerException e) { } 
     2141 
     2142        try { 
     2143          String lotNumber = src.getArcLotNumber(instrumentIndex, lightSource); 
     2144          if (lotNumber != null) { 
     2145            dest.setArcLotNumber(lotNumber, instrumentIndex, lightSource); 
     2146          } 
     2147        } 
     2148        catch (NullPointerException e) { } 
     2149 
     2150        try { 
     2151          String manufacturer = 
     2152            src.getArcManufacturer(instrumentIndex, lightSource); 
     2153          if (manufacturer != null) { 
     2154            dest.setArcManufacturer(manufacturer, instrumentIndex, lightSource); 
     2155          } 
     2156        } 
     2157        catch (NullPointerException e) { } 
     2158 
     2159        try { 
     2160          String model = src.getArcModel(instrumentIndex, lightSource); 
     2161          if (model != null) { 
     2162            dest.setArcModel(model, instrumentIndex, lightSource); 
     2163          } 
     2164        } 
     2165        catch (NullPointerException e) { } 
     2166 
     2167        try { 
     2168          Double power = src.getArcPower(instrumentIndex, lightSource); 
     2169          if (power != null) { 
     2170            dest.setArcPower(power, instrumentIndex, lightSource); 
     2171          } 
     2172        } 
     2173        catch (NullPointerException e) { } 
     2174 
     2175        try { 
     2176          String serialNumber = 
     2177            src.getArcSerialNumber(instrumentIndex, lightSource); 
     2178          if (serialNumber != null) { 
     2179            dest.setArcSerialNumber(serialNumber, instrumentIndex, lightSource); 
     2180          } 
     2181        } 
     2182        catch (NullPointerException e) { } 
     2183 
     2184        try { 
     2185          ArcType arcType = src.getArcType(instrumentIndex, lightSource); 
     2186          if (arcType != null) { 
     2187            dest.setArcType(arcType, instrumentIndex, lightSource); 
     2188          } 
     2189        } 
     2190        catch (NullPointerException e) { } 
     2191      } 
     2192      else if (type.equals("Filament")) { 
     2193        try { 
     2194          String id = src.getFilamentID(instrumentIndex, lightSource); 
     2195          if (id != null) dest.setFilamentID(id, instrumentIndex, lightSource); 
     2196        } 
     2197        catch (NullPointerException e) { } 
     2198 
     2199        try { 
     2200          String lotNumber = 
     2201            src.getFilamentLotNumber(instrumentIndex, lightSource); 
     2202          if (lotNumber != null) { 
     2203            dest.setFilamentLotNumber(lotNumber, instrumentIndex, lightSource); 
     2204          } 
     2205        } 
     2206        catch (NullPointerException e) { } 
     2207 
     2208        try { 
     2209          String manufacturer = 
     2210            src.getFilamentManufacturer(instrumentIndex, lightSource); 
     2211          if (manufacturer != null) { 
     2212            dest.setFilamentManufacturer( 
     2213              manufacturer, instrumentIndex, lightSource); 
     2214          } 
     2215        } 
     2216        catch (NullPointerException e) { } 
     2217 
     2218        try { 
     2219          String model = src.getFilamentModel(instrumentIndex, lightSource); 
     2220          if (model != null) { 
     2221            dest.setFilamentModel(model, instrumentIndex, lightSource); 
     2222          } 
     2223        } 
     2224        catch (NullPointerException e) { } 
     2225 
     2226        try { 
     2227          Double power = src.getFilamentPower(instrumentIndex, lightSource); 
     2228          if (power != null) { 
     2229            dest.setFilamentPower(power, instrumentIndex, lightSource); 
     2230          } 
     2231        } 
     2232        catch (NullPointerException e) { } 
     2233 
     2234        try { 
     2235          String serialNumber = 
     2236            src.getFilamentSerialNumber(instrumentIndex, lightSource); 
     2237          if (serialNumber != null) { 
     2238            dest.setFilamentSerialNumber( 
     2239              serialNumber, instrumentIndex, lightSource); 
     2240          } 
     2241        } 
     2242        catch (NullPointerException e) { } 
     2243 
     2244        try { 
     2245          FilamentType filamentType = 
     2246            src.getFilamentType(instrumentIndex, lightSource); 
     2247          if (filamentType != null) { 
     2248            dest.setFilamentType(filamentType, instrumentIndex, lightSource); 
     2249          } 
     2250        } 
     2251        catch (NullPointerException e) { } 
     2252      } 
     2253      else if (type.equals("Laser")) { 
     2254        try { 
     2255          String id = src.getLaserID(instrumentIndex, lightSource); 
     2256          if (id != null) dest.setLaserID(id, instrumentIndex, lightSource); 
     2257        } 
     2258        catch (NullPointerException e) { } 
     2259 
     2260        try { 
     2261          String lotNumber = 
     2262            src.getLaserLotNumber(instrumentIndex, lightSource); 
     2263          if (lotNumber != null) { 
     2264            dest.setLaserLotNumber(lotNumber, instrumentIndex, lightSource); 
     2265          } 
     2266        } 
     2267        catch (NullPointerException e) { } 
     2268 
     2269        try { 
     2270          String manufacturer = 
     2271            src.getLaserManufacturer(instrumentIndex, lightSource); 
     2272          if (manufacturer != null) { 
     2273            dest.setLaserManufacturer( 
     2274              manufacturer, instrumentIndex, lightSource); 
     2275          } 
     2276        } 
     2277        catch (NullPointerException e) { } 
     2278 
     2279        try { 
     2280          String model = src.getLaserModel(instrumentIndex, lightSource); 
     2281          if (model != null) { 
     2282            dest.setLaserModel(model, instrumentIndex, lightSource); 
     2283          } 
     2284        } 
     2285        catch (NullPointerException e) { } 
     2286 
     2287        try { 
     2288          Double power = src.getLaserPower(instrumentIndex, lightSource); 
     2289          if (power != null) { 
     2290            dest.setLaserPower(power, instrumentIndex, lightSource); 
     2291          } 
     2292        } 
     2293        catch (NullPointerException e) { } 
     2294 
     2295        try { 
     2296          String serialNumber = 
     2297            src.getLaserSerialNumber(instrumentIndex, lightSource); 
     2298          if (serialNumber != null) { 
     2299            dest.setLaserSerialNumber( 
     2300              serialNumber, instrumentIndex, lightSource); 
     2301          } 
     2302        } 
     2303        catch (NullPointerException e) { } 
     2304 
     2305        try { 
     2306          LaserType laserType = src.getLaserType(instrumentIndex, lightSource); 
     2307          if (laserType != null) { 
     2308            dest.setLaserType(laserType, instrumentIndex, lightSource); 
     2309          } 
     2310        } 
     2311        catch (NullPointerException e) { } 
     2312 
     2313        try { 
     2314          PositiveInteger frequencyMultiplication = 
     2315            src.getLaserFrequencyMultiplication(instrumentIndex, lightSource); 
     2316          if (frequencyMultiplication != null) { 
     2317            dest.setLaserFrequencyMultiplication( 
     2318              frequencyMultiplication, instrumentIndex, lightSource); 
     2319          } 
     2320        } 
     2321        catch (NullPointerException e) { } 
     2322 
     2323        try { 
     2324          LaserMedium medium = 
     2325            src.getLaserLaserMedium(instrumentIndex, lightSource); 
     2326          if (medium != null) { 
     2327            dest.setLaserLaserMedium(medium, instrumentIndex, lightSource); 
     2328          } 
     2329        } 
     2330        catch (NullPointerException e) { } 
     2331 
     2332        try { 
     2333          Boolean pockelCell = 
     2334            src.getLaserPockelCell(instrumentIndex, lightSource); 
     2335          if (pockelCell != null) { 
     2336            dest.setLaserPockelCell(pockelCell, instrumentIndex, lightSource); 
     2337          } 
     2338        } 
     2339        catch (NullPointerException e) { } 
     2340 
     2341        try { 
     2342          Pulse pulse = src.getLaserPulse(instrumentIndex, lightSource); 
     2343          if (pulse != null) { 
     2344            dest.setLaserPulse(pulse, instrumentIndex, lightSource); 
     2345          } 
     2346        } 
     2347        catch (NullPointerException e) { } 
     2348 
     2349        try { 
     2350          String pump = src.getLaserPump(instrumentIndex, lightSource); 
     2351          if (pump != null) { 
     2352            dest.setLaserPump(pump, instrumentIndex, lightSource); 
     2353          } 
     2354        } 
     2355        catch (NullPointerException e) { } 
     2356 
     2357        try { 
     2358          Double repetitionRate = 
     2359            src.getLaserRepetitionRate(instrumentIndex, lightSource); 
     2360          if (repetitionRate != null) { 
     2361            dest.setLaserRepetitionRate( 
     2362              repetitionRate, instrumentIndex, lightSource); 
     2363          } 
     2364        } 
     2365        catch (NullPointerException e) { } 
     2366 
     2367        try { 
     2368          Boolean tuneable = src.getLaserTuneable(instrumentIndex, lightSource); 
     2369          if (tuneable != null) { 
     2370            dest.setLaserTuneable(tuneable, instrumentIndex, lightSource); 
     2371          } 
     2372        } 
     2373        catch (NullPointerException e) { } 
     2374 
     2375        try { 
     2376          PositiveInteger wavelength = 
     2377            src.getLaserWavelength(instrumentIndex, lightSource); 
     2378          if (wavelength != null) { 
     2379            dest.setLaserWavelength(wavelength, instrumentIndex, lightSource); 
     2380          } 
     2381        } 
     2382        catch (NullPointerException e) { } 
     2383      } 
     2384      else if (type.equals("LightEmittingDiode")) { 
     2385        try { 
     2386          String id = src.getLightEmittingDiodeID(instrumentIndex, lightSource); 
     2387          if (id != null) { 
     2388            dest.setLightEmittingDiodeID(id, instrumentIndex, lightSource); 
     2389          } 
     2390        } 
     2391        catch (NullPointerException e) { } 
     2392 
     2393        try { 
     2394          String lotNumber = 
     2395            src.getLightEmittingDiodeLotNumber(instrumentIndex, lightSource); 
     2396          if (lotNumber != null) { 
     2397            dest.setLightEmittingDiodeLotNumber( 
     2398              lotNumber, instrumentIndex, lightSource); 
     2399          } 
     2400        } 
     2401        catch (NullPointerException e) { } 
     2402 
     2403        try { 
     2404          String manufacturer = 
     2405            src.getLightEmittingDiodeManufacturer(instrumentIndex, lightSource); 
     2406          if (manufacturer != null) { 
     2407            dest.setLightEmittingDiodeManufacturer( 
     2408              manufacturer, instrumentIndex, lightSource); 
     2409          } 
     2410        } 
     2411        catch (NullPointerException e) { } 
     2412 
     2413        try { 
     2414          String model = 
     2415            src.getLightEmittingDiodeModel(instrumentIndex, lightSource); 
     2416          if (model != null) { 
     2417            dest.setLightEmittingDiodeModel( 
     2418              model, instrumentIndex, lightSource); 
     2419          } 
     2420        } 
     2421        catch (NullPointerException e) { } 
     2422 
     2423        try { 
     2424          Double power = 
     2425            src.getLightEmittingDiodePower(instrumentIndex, lightSource); 
     2426          if (power != null) { 
     2427            dest.setLightEmittingDiodePower( 
     2428              power, instrumentIndex, lightSource); 
     2429          } 
     2430        } 
     2431        catch (NullPointerException e) { } 
     2432 
     2433        try { 
     2434          String serialNumber = 
     2435            src.getLightEmittingDiodeSerialNumber(instrumentIndex, lightSource); 
     2436          if (serialNumber != null) { 
     2437            dest.setLightEmittingDiodeSerialNumber( 
     2438              serialNumber, instrumentIndex, lightSource); 
     2439          } 
     2440        } 
     2441        catch (NullPointerException e) { } 
     2442      } 
     2443    } 
     2444  } 
     2445 
    22932446} 
  • trunk/components/bio-formats/test/loci/formats/utests/SPWModelMock.java

    r6839 r6841  
    330330    instrument.addDetector(detector); 
    331331 
    332     if (!makeLightSources) { 
     332    if (makeLightSources) { 
    333333      // Create <Laser/> under <Instrument/> 
    334334      Laser laser = new Laser(); 
  • trunk/components/bio-formats/test/loci/formats/utests/SPWModelReaderTest.java

    r6839 r6841  
    115115    readerWithNoLightSources = new MinMaxCalculator(new ImageReader()); 
    116116    metadataWithNoLightSources = new OMEXMLMetadataImpl(); 
    117     readerWithNoLightSources.setMetadataStore(metadata); 
    118     readerWithNoLightSources.setId(temporaryFile.getAbsolutePath()); 
     117    readerWithNoLightSources.setMetadataStore(metadataWithNoLightSources); 
     118    readerWithNoLightSources.setId( 
     119      temporaryFileWithNoLightSources.getAbsolutePath()); 
    119120  } 
    120121 
     
    167168  public void testHasLightSources() { 
    168169    assertEquals(1, metadata.getInstrumentCount()); 
    169     assertEquals(4, metadata.getLightSourceCount(0)); 
     170    assertEquals(5, metadata.getLightSourceCount(0)); 
    170171  } 
    171172 
Note: See TracChangeset for help on using the changeset viewer.