private IGroup fetchHistogram(URI fileHandle, String name) throws FileAccessException, NullDataObjectException, IOException, URISyntaxException { IGroup entry = DataManagerFactory.getDataManager(ConverterLib.getDictionaryPath(Activator.PLUGIN_ID)) .getGroup(fileHandle); IGroup hm = entry.findGroup(name); return hm; }
/* (non-Javadoc) * @see au.gov.ansto.bragg.quokka.dra.core.ConcreteProcessor#process() */ public Boolean process() throws Exception { // TODO Auto-generated method stub // if (histogramViewer_interval.doubleValue() != interval.doubleValue()){ // System.out.println("oldValue=" + interval + " newValue=" + histogramViewer_interval); // setInterval(histogramViewer_interval); // System.out.println("set the interval to " + interval); // return true; // } retriever = new LiveDataRetriever(); retriever.setUser("Gumtree"); retriever.setPassword("Gumtree"); // histogramViewer_host = "localhost"; if (histogramViewer_host.equals("default")) { ICommandLineOptions options = ServiceUtils.getService(ICommandLineOptions.class); if (options.hasOptionValue(OPTION_SICS_INSTRUMENT)) { String instrumentName = options.getOptionValue(OPTION_SICS_INSTRUMENT); instrumentName = instrumentName.substring(instrumentName.lastIndexOf(".") + 1); histogramViewer_host = "das1-" + instrumentName + ".nbi.ansto.gov.au"; } } // histogramViewer_host = "localhost"; // URI fileHandle = null; try { // fileHandle = retriever.getHDFFileHandle("localhost", 8081, HistogramType.TOTAL_HISTO_XY); fileHandle = retriever.getHDFFileHandle( histogramViewer_host, histogramViewer_port, HistogramType.TOTAL_HISTO_XY); } catch (Exception e) { // TODO Auto-generated catch block try { fileHandle = retriever.getHDFFileHandle("localhost", 8080, HistogramType.TOTAL_HISTO_XY); } catch (Exception e1) { // TODO: handle exception throw e1; } // e.printStackTrace(); // return "can not make the connection"; } // Test if file is physically available System.out.println("wait for " + histogramViewer_interval + "sec"); try { Thread.sleep((long) (histogramViewer_interval * 1000)); } catch (Exception e) { // TODO: handle exception throw e; } System.out.println(fileHandle); histogramViewer_data = ((NcGroup) DataManagerFactory.getDataManager( ConverterLib.getDictionaryPath(Activator.PLUGIN_ID)) .getGroup(fileHandle)) .getFirstEntryAccess(); histogramViewer_loopOut = !histogramViewer_stop; return histogramViewer_stop; }
private IGroup fetchHistogram(URI fileHandle, int entryIndex) throws FileAccessException, NullDataObjectException, IOException, URISyntaxException { IGroup entry = DataManagerFactory.getDataManager(ConverterLib.getDictionaryPath(Activator.PLUGIN_ID)) .getGroup(fileHandle); List<IGroup> entryList = ((NcGroup) entry).getEntries(); IGroup hm = entryList.get(entryIndex); return hm; }
private IGroup fetchHistogram(URI fileHandle) throws FileAccessException, NullDataObjectException, IOException, URISyntaxException { IGroup hm = ((NcGroup) DataManagerFactory.getDataManager( ConverterLib.getDictionaryPath(Activator.PLUGIN_ID)) .getGroup(fileHandle)) .getFirstEntryAccess(); return hm; }