/** * Initialization of an experiment, taking the type, path, traces, indexPageSize and resource * * @param type the event type * @param path the experiment path * @param traces the experiment set of traces * @param indexPageSize the experiment index page size * @param resource the resource associated to the experiment * @since 3.0 */ public void initExperiment( final Class<? extends ITmfEvent> type, final String path, final ITmfTrace[] traces, final int indexPageSize, IResource resource) { setCacheSize(indexPageSize); setStreamingInterval(0); setParser(this); // traces have to be set before super.initialize() fTraces = traces; try { super.initialize(resource, path, type); } catch (TmfTraceException e) { Activator.logError("Error initializing experiment", e); // $NON-NLS-1$ } if (resource != null) { try { this.synchronizeTraces(); } catch (TmfTraceException e) { Activator.logError("Error synchronizing experiment", e); // $NON-NLS-1$ } } }
/** @since 3.0 */ @Override public void setTimestampTransform(final ITmfTimestampTransform tt) { fTsTransform = tt; /* Save the timestamp transform to a file */ File sync_file = getSyncFormulaFile(); if (sync_file != null) { if (sync_file.exists()) { sync_file.delete(); } FileOutputStream fos; ObjectOutputStream oos; /* Save the header of the file */ try { fos = new FileOutputStream(sync_file, false); oos = new ObjectOutputStream(fos); oos.writeObject(fTsTransform); oos.close(); fos.close(); } catch (IOException e1) { Activator.logError("Error writing timestamp transform for trace", e1); // $NON-NLS-1$ } } }