Search in sources :

Example 1 with VCDataIdentifier

use of org.vcell.util.document.VCDataIdentifier in project vcell by virtualcell.

the class ODEDataViewer method setVcDataIdentifier.

/**
 * Sets the vcDataIdentifier property (cbit.vcell.server.VCDataIdentifier) value.
 * @param vcDataIdentifier The new value for the property.
 * @see #getVcDataIdentifier
 */
public void setVcDataIdentifier(VCDataIdentifier vcDataIdentifier) {
    VCDataIdentifier oldValue = fieldVcDataIdentifier;
    fieldVcDataIdentifier = vcDataIdentifier;
    setOdeDataContext();
    firePropertyChange("vcDataIdentifier", oldValue, vcDataIdentifier);
    outputSpeciesResultsPanel.refreshData();
}
Also used : VCDataIdentifier(org.vcell.util.document.VCDataIdentifier)

Example 2 with VCDataIdentifier

use of org.vcell.util.document.VCDataIdentifier in project vcell by virtualcell.

the class ODETimePlotMultipleScansPanel method updateScanParamChoices.

/**
 * Insert the method's description here.
 * Creation date: (10/18/2005 12:44:06 AM)
 */
private void updateScanParamChoices() {
    AsynchClientTask task1 = new AsynchClientTask("get ode results", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {

        @Override
        public void run(Hashtable<String, Object> hashTable) throws Exception {
            int[] jobIndexes = scanChoiceTable.getSelectedRows();
            VCSimulationIdentifier vcSimulationIdentifier = simulation.getSimulationInfo().getAuthoritativeVCSimulationIdentifier();
            int plotCount = jobIndexes.length * variableNames.length;
            SymbolTableEntry[] symbolTableEntries = new SymbolTableEntry[plotCount];
            double[][] dataValues = new double[plotCount + 1][];
            PlotData[] plotDatas = new PlotData[plotCount];
            String[] plotNames = new String[plotCount];
            int plotIndex = 0;
            dataValues[0] = null;
            for (int ji = 0; ji < jobIndexes.length; ji++) {
                int jobIndex = jobIndexes[ji];
                final VCDataIdentifier vcdid = new VCSimulationDataIdentifier(vcSimulationIdentifier, jobIndex);
                ODEDataManager odeDatamanager = ((ODEDataManager) dataManager).createNewODEDataManager(vcdid);
                ODESolverResultSet odeSolverResultSet = odeDatamanager.getODESolverResultSet();
                if (ji == 0) {
                    plotPane.setStepViewVisible(simulation.getSolverTaskDescription().getSolverDescription().isNonSpatialStochasticSolver(), odeSolverResultSet.isMultiTrialData());
                    hashTable.put("bMultiTrial", new Boolean(odeSolverResultSet.isMultiTrialData()));
                }
                double[] tdata = null;
                if (!odeSolverResultSet.isMultiTrialData()) {
                    int tcol = odeSolverResultSet.findColumn(ReservedVariable.TIME.getName());
                    tdata = odeSolverResultSet.extractColumn(tcol);
                    if (dataValues[0] == null) {
                        dataValues[0] = tdata;
                    }
                }
                for (int v = 0; v < variableNames.length; v++) {
                    String varname = variableNames[v];
                    int varcol = odeSolverResultSet.findColumn(varname);
                    double[] vdata = odeSolverResultSet.extractColumn(varcol);
                    if (!odeSolverResultSet.isMultiTrialData()) {
                        dataValues[plotIndex + 1] = vdata;
                        // plotNames[plotIndex] = varname + " -- " + JOB_PLOT_NAME + " " + jobIndex;
                        plotDatas[plotIndex] = new PlotData(tdata, vdata);
                    // symbolTableEntries[plotIndex] = simulation.getMathDescription().getVariable(varname);
                    } else {
                        Point2D[] histogram = ODESolverPlotSpecificationPanel.generateHistogram(vdata);
                        double[] x = new double[histogram.length];
                        double[] y = new double[histogram.length];
                        for (int j = 0; j < histogram.length; j++) {
                            x[j] = histogram[j].getX();
                            y[j] = histogram[j].getY();
                        }
                        plotDatas[plotIndex] = new PlotData(x, y);
                    }
                    plotNames[plotIndex] = varname + " -- " + JOB_PLOT_NAME + " " + jobIndex;
                    symbolTableEntries[plotIndex] = simulation.getMathDescription().getVariable(varname);
                    plotIndex++;
                }
            }
            hashTable.put("dataValues", dataValues);
            hashTable.put("plotDatas", plotDatas);
            hashTable.put("plotNames", plotNames);
            hashTable.put("symbolTableEntries", symbolTableEntries);
        }
    };
    AsynchClientTask task2 = new AsynchClientTask("show results", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {

        @Override
        public void run(Hashtable<String, Object> hashTable) throws Exception {
            double[][] dataValues = (double[][]) hashTable.get("dataValues");
            PlotData[] plotDatas = (PlotData[]) hashTable.get("plotDatas");
            String[] plotNames = (String[]) hashTable.get("plotNames");
            SymbolTableEntry[] symbolTableEntries = (SymbolTableEntry[]) hashTable.get("symbolTableEntries");
            if (plotDatas == null || plotDatas.length == 0 || (plotDatas.length == 1 && plotDatas[0] == null) || plotNames == null) {
                plotPane.setPlot2D(null);
                return;
            }
            Plot2D plot2D = null;
            if (hashTable.get("bMultiTrial") instanceof Boolean && (Boolean) hashTable.get("bMultiTrial")) {
                plot2D = new Plot2D(symbolTableEntries, null, plotNames, plotDatas, new String[] { "Probability Distribution of Species", "Number of Particles", "" });
            } else if (simulation.getSolverTaskDescription().getOutputTimeSpec() instanceof DefaultOutputTimeSpec) {
                plot2D = new Plot2D(symbolTableEntries, null, plotNames, plotDatas, new String[] { "Time Plot", ReservedVariable.TIME.getName(), "" });
            } else {
                plot2D = new SingleXPlot2D(symbolTableEntries, null, ReservedVariable.TIME.getName(), plotNames, dataValues);
            }
            plotPane.setPlot2D(plot2D);
        }
    };
    ClientTaskDispatcher.dispatch(this, new Hashtable<String, Object>(), new AsynchClientTask[] { task1, task2 });
}
Also used : AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) VCSimulationIdentifier(cbit.vcell.solver.VCSimulationIdentifier) SymbolTableEntry(cbit.vcell.parser.SymbolTableEntry) Point2D(java.awt.geom.Point2D) ODESolverResultSet(cbit.vcell.solver.ode.ODESolverResultSet) PlotData(cbit.plot.PlotData) Hashtable(java.util.Hashtable) VCSimulationDataIdentifier(cbit.vcell.solver.VCSimulationDataIdentifier) SingleXPlot2D(cbit.plot.SingleXPlot2D) ODEDataManager(cbit.vcell.simdata.ODEDataManager) SingleXPlot2D(cbit.plot.SingleXPlot2D) Plot2D(cbit.plot.Plot2D) VCDataIdentifier(org.vcell.util.document.VCDataIdentifier) DefaultOutputTimeSpec(cbit.vcell.solver.DefaultOutputTimeSpec)

Example 3 with VCDataIdentifier

use of org.vcell.util.document.VCDataIdentifier in project vcell by virtualcell.

the class PDEDataViewer method createContextTitle.

public static String createContextTitle(boolean isPostProcess, String prefix, PDEDataContext pdeDatacontext, SimulationModelInfo simulationModelInfo, Simulation simulation) {
    String myTitle = (prefix == null ? "" : prefix);
    try {
        int parameterScanJobID = -1;
        if (pdeDatacontext != null && pdeDatacontext.getVCDataIdentifier() != null) {
            VCDataIdentifier vcDid = pdeDatacontext.getVCDataIdentifier();
            boolean bIsOldStyle = vcDid instanceof VCSimulationDataIdentifierOldStyle;
            parameterScanJobID = (bIsOldStyle ? -1 : (((SimResampleInfoProvider) vcDid).isParameterScanType() ? ((SimResampleInfoProvider) vcDid).getJobIndex() : -1));
        }
        String simulationName = (simulationModelInfo == null || simulationModelInfo.getSimulationName() == null ? (simulation == null || simulation.getName() == null ? "?Sim?" : simulation.getName()) : simulationModelInfo.getSimulationName());
        String contextTitle = (simulationModelInfo == null ? "" : "[" + simulationModelInfo.getContextName() + "]:") + "[" + simulationName + "]" + (parameterScanJobID == -1 ? "" : ":ps=" + parameterScanJobID);
        myTitle += contextTitle;
    } catch (Exception e) {
        e.printStackTrace();
    // just send back the prefix if this happens
    }
    return (isPostProcess ? POST_PROCESS_PREFIX : "") + myTitle;
}
Also used : VCSimulationDataIdentifierOldStyle(cbit.vcell.solver.VCSimulationDataIdentifierOldStyle) VCDataIdentifier(org.vcell.util.document.VCDataIdentifier) Point(java.awt.Point) SinglePoint(cbit.vcell.geometry.SinglePoint) DataAccessException(org.vcell.util.DataAccessException) PropertyVetoException(java.beans.PropertyVetoException) ImageException(cbit.image.ImageException) UserCancelException(org.vcell.util.UserCancelException)

Example 4 with VCDataIdentifier

use of org.vcell.util.document.VCDataIdentifier in project vcell by virtualcell.

the class PDEDataViewer method updateDataValueSurfaceViewer0.

// private AsynchClientTask[] getDataVlaueSurfaceViewerTasks(){
// AsynchClientTask createDataValueSurfaceViewerTask = new AsynchClientTask("Create surface viewer...",AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {
// @Override
// public void run(Hashtable<String, Object> hashTable) throws Exception {
// if(getDataValueSurfaceViewer().getSurfaceCollectionDataInfoProvider() == null){
// createDataValueSurfaceViewer(getClientTaskStatusSupport());
// }
// }
// };
// 
// AsynchClientTask updateDataValueSurfaceViewerTask = new AsynchClientTask("Update surface viewer...",AsynchClientTask.TASKTYPE_SWING_BLOCKING) {
// @Override
// public void run(Hashtable<String, Object> hashTable) throws Exception {
// updateDataValueSurfaceViewer0();
// }
// };
// 
// AsynchClientTask resetDataValueSurfaceViewerTask = new AsynchClientTask("Reset tab...",AsynchClientTask.TASKTYPE_SWING_NONBLOCKING,false,false) {
// @Override
// public void run(Hashtable<String, Object> hashTable) throws Exception {
// if(getDataValueSurfaceViewer().getSurfaceCollectionDataInfoProvider() == null){
// viewDataTabbedPane.setSelectedIndex(0);
// }
// }
// };
// return new AsynchClientTask[] {createDataValueSurfaceViewerTask,updateDataValueSurfaceViewerTask,resetDataValueSurfaceViewerTask};
// }
// private Timer dataValueSurfaceTimer;
// //private boolean bPdeIsParamScan=false;
// private void updateDataValueSurfaceViewer(){
// //	if((dataValueSurfaceTimer = ClientTaskDispatcher.getBlockingTimer(this,getPdeDataContext(),null,dataValueSurfaceTimer,new ActionListener() {@Override public void actionPerformed(ActionEvent e2) {updateDataValueSurfaceViewer();}}))!=null){
// //		return;
// //	}
// if(bSkipSurfaceCalc){
// return;
// }
// if(getDataValueSurfaceViewer().getSurfaceCollectionDataInfoProvider() == null){
// if((dataValueSurfaceTimer = ClientTaskDispatcher.getBlockingTimer(this,getPdeDataContext(),null,dataValueSurfaceTimer,new ActionListener() {@Override public void actionPerformed(ActionEvent e2) {updateDataValueSurfaceViewer();}}))!=null){
// return;
// }
// ClientTaskDispatcher.dispatch(this, new Hashtable<String, Object>(), getDataVlaueSurfaceViewerTasks(),true,true,null);
// }else{
// try{
// updateDataValueSurfaceViewer0();
// }catch(Exception e){
// e.printStackTrace();
// DialogUtils.showErrorDialog(this, e.getMessage());
// }
// }
// }
/**
 * Insert the method's description here.
 * Creation date: (9/25/2005 2:00:05 PM)
 */
private void updateDataValueSurfaceViewer0() {
    // viewDataTabbedPane.addTab(CurrentView.SURFACE_VIEW.title, getDataValueSurfaceViewer());
    if (viewDataTabbedPane.getSelectedIndex() != CurrentView.SURFACE_VIEW.ordinal()) {
        return;
    }
    // SurfaceColors and DataValues
    if (getDataValueSurfaceViewer().getSurfaceCollectionDataInfo() == null) {
        // happens with PostProcessingImageData version of PDEDataViewer
        return;
    }
    SurfaceCollection surfaceCollection = getDataValueSurfaceViewer().getSurfaceCollectionDataInfo().getSurfaceCollection();
    DisplayAdapterService das = getPDEDataContextPanel1().getdisplayAdapterService1();
    final int[][] surfaceColors = new int[surfaceCollection.getSurfaceCount()][];
    final double[][] surfaceDataValues = new double[surfaceCollection.getSurfaceCount()][];
    boolean bMembraneVariable = getPdeDataContext().getDataIdentifier().getVariableType().equals(VariableType.MEMBRANE);
    RecodeDataForDomainInfo recodeDataForDomainInfo = getPDEDataContextPanel1().getRecodeDataForDomainInfo();
    double[] membraneValues = (recodeDataForDomainInfo.isRecoded() ? recodeDataForDomainInfo.getRecodedDataForDomain() : getPdeDataContext().getDataValues());
    for (int i = 0; i < surfaceCollection.getSurfaceCount(); i += 1) {
        Surface surface = surfaceCollection.getSurfaces(i);
        surfaceColors[i] = new int[surface.getPolygonCount()];
        surfaceDataValues[i] = new double[surface.getPolygonCount()];
        for (int j = 0; j < surface.getPolygonCount(); j += 1) {
            int membraneIndexForPolygon = meshRegionSurfaces.getMembraneIndexForPolygon(i, j);
            if (bMembraneVariable) {
                surfaceDataValues[i][j] = membraneValues[membraneIndexForPolygon];
            } else {
                // get membrane region index from membrane index
                surfaceDataValues[i][j] = membraneValues[getPdeDataContext().getCartesianMesh().getMembraneRegionIndex(membraneIndexForPolygon)];
            }
            surfaceColors[i][j] = das.getColorFromValue(surfaceDataValues[i][j]);
        }
    }
    DataValueSurfaceViewer.SurfaceCollectionDataInfoProvider svdp = new DataValueSurfaceViewer.SurfaceCollectionDataInfoProvider() {

        private DisplayAdapterService updatedDAS = new DisplayAdapterService(getPDEDataContextPanel1().getdisplayAdapterService1());

        private String updatedVariableName = getPdeDataContext().getVariableName();

        private double updatedTimePoint = getPdeDataContext().getTimePoint();

        private double[] updatedVariableValues = getPdeDataContext().getDataValues();

        private VCDataIdentifier updatedVCDataIdentifier = getPdeDataContext().getVCDataIdentifier();

        public void makeMovie(SurfaceCanvas surfaceCanvas) {
            makeSurfaceMovie(surfaceCanvas, updatedVariableValues.length, updatedVariableName, updatedDAS, updatedVCDataIdentifier);
        }

        public double getValue(int surfaceIndex, int polygonIndex) {
            return updatedVariableValues[meshRegionSurfaces.getMembraneIndexForPolygon(surfaceIndex, polygonIndex)];
        }

        public String getValueDescription(int surfaceIndex, int polygonIndex) {
            return updatedVariableName;
        }

        public int[][] getSurfacePolygonColors() {
            return surfaceColors;
        }

        public Coordinate getCentroid(int surfaceIndex, int polygonIndex) {
            return getPdeDataContext().getCartesianMesh().getMembraneElements()[meshRegionSurfaces.getMembraneIndexForPolygon(surfaceIndex, polygonIndex)].getCentroid();
        }

        public float getArea(int surfaceIndex, int polygonIndex) {
            return getPdeDataContext().getCartesianMesh().getMembraneElements()[meshRegionSurfaces.getMembraneIndexForPolygon(surfaceIndex, polygonIndex)].getArea();
        }

        public Vect3d getNormal(int surfaceIndex, int polygonIndex) {
            return getPdeDataContext().getCartesianMesh().getMembraneElements()[meshRegionSurfaces.getMembraneIndexForPolygon(surfaceIndex, polygonIndex)].getNormal();
        }

        public int getMembraneIndex(int surfaceIndex, int polygonIndex) {
            return meshRegionSurfaces.getMembraneIndexForPolygon(surfaceIndex, polygonIndex);
        }

        public Color getROIHighlightColor() {
            return new Color(getPDEDataContextPanel1().getdisplayAdapterService1().getSpecialColors()[cbit.image.DisplayAdapterService.FOREGROUND_HIGHLIGHT_COLOR_OFFSET]);
        }

        @Override
        public boolean isMembrIndexInVarDomain(int membrIndex) {
            return (getPDEDataContextPanel1().getRecodeDataForDomainInfo() != null ? getPDEDataContextPanel1().getRecodeDataForDomainInfo().isIndexInDomain(membrIndex) : true);
        }

        // public void showComponentInFrame(Component comp,String title){
        // PDEDataViewer.this.showComponentInFrame(comp,title);
        // }
        public void plotTimeSeriesData(int[][] indices, boolean bAllTimes, boolean bTimeStats, boolean bSpaceStats) throws DataAccessException {
            double[] timePoints = getPdeDataContext().getTimePoints();
            double beginTime = (bAllTimes ? timePoints[0] : updatedTimePoint);
            double endTime = (bAllTimes ? timePoints[timePoints.length - 1] : beginTime);
            String[] varNames = new String[indices.length];
            for (int i = 0; i < varNames.length; i += 1) {
                varNames[i] = updatedVariableName;
            }
            TimeSeriesJobSpec timeSeriesJobSpec = new TimeSeriesJobSpec(varNames, indices, beginTime, 1, endTime, bSpaceStats, bTimeStats, VCDataJobID.createVCDataJobID(getDataViewerManager().getUser(), true));
            Hashtable<String, Object> hash = new Hashtable<String, Object>();
            hash.put(StringKey_timeSeriesJobSpec, timeSeriesJobSpec);
            AsynchClientTask task1 = new TimeSeriesDataRetrievalTask("Retrieve data", PDEDataViewer.this, getPdeDataContext());
            AsynchClientTask task2 = new AsynchClientTask("Showing surface", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {

                @Override
                public void run(Hashtable<String, Object> hashTable) throws Exception {
                    TSJobResultsSpaceStats tsJobResultsSpaceStats = (TSJobResultsSpaceStats) hashTable.get(StringKey_timeSeriesJobResults);
                    plotSpaceStats(tsJobResultsSpaceStats);
                }
            };
            ClientTaskDispatcher.dispatch(PDEDataViewer.this, hash, new AsynchClientTask[] { task1, task2 }, true, true, null);
        }
    };
    getDataValueSurfaceViewer().setSurfaceCollectionDataInfoProvider(svdp);
}
Also used : DisplayAdapterService(cbit.image.DisplayAdapterService) AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) TimeSeriesJobSpec(org.vcell.util.document.TimeSeriesJobSpec) Surface(cbit.vcell.geometry.surface.Surface) RecodeDataForDomainInfo(cbit.vcell.simdata.gui.PDEDataContextPanel.RecodeDataForDomainInfo) SurfaceCollection(cbit.vcell.geometry.surface.SurfaceCollection) Hashtable(java.util.Hashtable) Color(java.awt.Color) TSJobResultsSpaceStats(org.vcell.util.document.TSJobResultsSpaceStats) Point(java.awt.Point) SinglePoint(cbit.vcell.geometry.SinglePoint) SurfaceCanvas(cbit.vcell.geometry.gui.SurfaceCanvas) DataValueSurfaceViewer(cbit.vcell.geometry.gui.DataValueSurfaceViewer) VCDataIdentifier(org.vcell.util.document.VCDataIdentifier)

Example 5 with VCDataIdentifier

use of org.vcell.util.document.VCDataIdentifier in project vcell by virtualcell.

the class PDEDataViewerPostProcess method createPostProcessPDEDataContext.

public static PostProcessDataPDEDataContext createPostProcessPDEDataContext(final ClientPDEDataContext parentPDEDataContext) throws Exception {
    final DataOperationResults.DataProcessingOutputInfo dataProcessingOutputInfo = (DataOperationResults.DataProcessingOutputInfo) parentPDEDataContext.doDataOperation(new DataOperation.DataProcessingOutputInfoOP(parentPDEDataContext.getVCDataIdentifier(), false, parentPDEDataContext.getDataManager().getOutputContext()));
    if (dataProcessingOutputInfo == null) {
        return null;
    }
    DataSetControllerProvider dataSetControllerProvider = new DataSetControllerProvider() {

        @Override
        public DataSetController getDataSetController() throws DataAccessException {
            return new DataSetController() {

                // DataIdentifier[] dataIdentifiers;
                @Override
                public ExportEvent makeRemoteFile(OutputContext outputContext, ExportSpecs exportSpecs) throws DataAccessException, RemoteProxyException {
                    throw new DataAccessException("Not implemented");
                }

                @Override
                public TimeSeriesJobResults getTimeSeriesValues(OutputContext outputContext, VCDataIdentifier vcdataID, TimeSeriesJobSpec timeSeriesJobSpec) throws RemoteProxyException, DataAccessException {
                    // return parentPDEDataContext.getDataManager().getTimeSeriesValues(timeSeriesJobSpec);
                    DataOperation.DataProcessingOutputTimeSeriesOP dataProcessingOutputTimeSeriesOP = new DataOperation.DataProcessingOutputTimeSeriesOP(vcdataID, timeSeriesJobSpec, outputContext, getDataSetTimes(vcdataID));
                    DataOperationResults.DataProcessingOutputTimeSeriesValues dataopDataProcessingOutputTimeSeriesValues = (DataOperationResults.DataProcessingOutputTimeSeriesValues) parentPDEDataContext.doDataOperation(dataProcessingOutputTimeSeriesOP);
                    return dataopDataProcessingOutputTimeSeriesValues.getTimeSeriesJobResults();
                }

                @Override
                public SimDataBlock getSimDataBlock(OutputContext outputContext, VCDataIdentifier vcdataID, String varName, double time) throws RemoteProxyException, DataAccessException {
                    // return parentPDEDataContext.getDataManager().getSimDataBlock(varName, time);
                    DataOperationResults.DataProcessingOutputDataValues dataProcessingOutputValues = (DataOperationResults.DataProcessingOutputDataValues) parentPDEDataContext.doDataOperation(new DataOperation.DataProcessingOutputDataValuesOP(vcdataID, varName, TimePointHelper.createSingleTimeTimePointHelper(time), DataIndexHelper.createAllDataIndexesDataIndexHelper(), outputContext, null));
                    PDEDataInfo pdeDataInfo = new PDEDataInfo(vcdataID.getOwner(), vcdataID.getID(), varName, time, Long.MIN_VALUE);
                    SimDataBlock simDataBlock = new SimDataBlock(pdeDataInfo, dataProcessingOutputValues.getDataValues()[0], VariableType.POSTPROCESSING);
                    return simDataBlock;
                }

                @Override
                public boolean getParticleDataExists(VCDataIdentifier vcdataID) throws DataAccessException, RemoteProxyException {
                    // TODO Auto-generated method stub
                    return false;
                }

                @Override
                public ParticleDataBlock getParticleDataBlock(VCDataIdentifier vcdataID, double time) throws DataAccessException, RemoteProxyException {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public ODESimData getODEData(VCDataIdentifier vcdataID) throws DataAccessException, RemoteProxyException {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public CartesianMesh getMesh(VCDataIdentifier vcdataID) throws RemoteProxyException, DataAccessException {
                    // throw new DataAccessException("PostProcessData mesh not available at this level");
                    return null;
                }

                @Override
                public PlotData getLineScan(OutputContext outputContext, VCDataIdentifier vcdataID, String variable, double time, SpatialSelection spatialSelection) throws RemoteProxyException, DataAccessException {
                    throw new DataAccessException("Remote getLineScan method should not be called for PostProcess");
                }

                @Override
                public AnnotatedFunction[] getFunctions(OutputContext outputContext, VCDataIdentifier vcdataID) throws DataAccessException, RemoteProxyException {
                    return outputContext.getOutputFunctions();
                }

                @Override
                public double[] getDataSetTimes(VCDataIdentifier vcdataID) throws RemoteProxyException, DataAccessException {
                    return dataProcessingOutputInfo.getVariableTimePoints();
                }

                @Override
                public DataSetTimeSeries getDataSetTimeSeries(VCDataIdentifier vcdataID, String[] variableNames) throws DataAccessException, RemoteProxyException {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public DataSetMetadata getDataSetMetadata(VCDataIdentifier vcdataID) throws DataAccessException, RemoteProxyException {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public DataIdentifier[] getDataIdentifiers(OutputContext outputContext, VCDataIdentifier vcdataID) throws RemoteProxyException, DataAccessException {
                    // return parentPDEDataContext.getDataIdentifiers();
                    ArrayList<DataIdentifier> postProcessDataIDs = new ArrayList<DataIdentifier>();
                    if (outputContext != null && outputContext.getOutputFunctions() != null) {
                        for (int i = 0; i < outputContext.getOutputFunctions().length; i++) {
                            if (outputContext.getOutputFunctions()[i].isPostProcessFunction()) {
                                postProcessDataIDs.add(new DataIdentifier(outputContext.getOutputFunctions()[i].getName(), VariableType.POSTPROCESSING, null, false, outputContext.getOutputFunctions()[i].getDisplayName()));
                            }
                        }
                    }
                    // get 'state' variables
                    for (int i = 0; i < dataProcessingOutputInfo.getVariableNames().length; i++) {
                        if (dataProcessingOutputInfo.getPostProcessDataType(dataProcessingOutputInfo.getVariableNames()[i]).equals(PostProcessDataType.image)) {
                            DataIdentifier dataIdentifier = new DataIdentifier(dataProcessingOutputInfo.getVariableNames()[i], VariableType.POSTPROCESSING, null, false, dataProcessingOutputInfo.getVariableNames()[i]);
                            postProcessDataIDs.add(dataIdentifier);
                        }
                    }
                    if (postProcessDataIDs.size() > 0) {
                        return postProcessDataIDs.toArray(new DataIdentifier[0]);
                    }
                    return null;
                }

                @Override
                public FieldDataFileOperationResults fieldDataFileOperation(FieldDataFileOperationSpec fieldDataFileOperationSpec) throws RemoteProxyException, DataAccessException {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public DataOperationResults doDataOperation(DataOperation dataOperation) throws DataAccessException, RemoteProxyException {
                    // TODO Auto-generated method stub
                    return parentPDEDataContext.doDataOperation(dataOperation);
                }

                @Override
                public VtuFileContainer getEmptyVtuMeshFiles(VCDataIdentifier vcdataID, int timeIndex) throws DataAccessException {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public double[] getVtuMeshData(OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time) throws RemoteProxyException, DataAccessException {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public VtuVarInfo[] getVtuVarInfos(OutputContext outputContext, VCDataIdentifier vcDataIdentifier) {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public double[] getVtuTimes(VCDataIdentifier vcdataID) throws RemoteProxyException, DataAccessException {
                    // TODO Auto-generated method stub
                    return null;
                }

                @Override
                public NFSimMolecularConfigurations getNFSimMolecularConfigurations(VCDataIdentifier vcdataID) throws RemoteProxyException, DataAccessException {
                    // TODO Auto-generated method stub
                    return null;
                }
            };
        }
    };
    VCDataManager postProcessVCDataManager = new VCDataManager(dataSetControllerProvider);
    PDEDataManager postProcessPDEDataManager = new PDEDataManager(((ClientPDEDataContext) parentPDEDataContext).getDataManager().getOutputContext(), postProcessVCDataManager, parentPDEDataContext.getVCDataIdentifier());
    PostProcessDataPDEDataContext postProcessDataPDEDataContext = new PostProcessDataPDEDataContext(postProcessPDEDataManager);
    return postProcessDataPDEDataContext;
}
Also used : VtuVarInfo(org.vcell.vis.io.VtuVarInfo) VCDataIdentifier(org.vcell.util.document.VCDataIdentifier) DataIdentifier(cbit.vcell.simdata.DataIdentifier) TimeSeriesJobSpec(org.vcell.util.document.TimeSeriesJobSpec) ExportSpecs(cbit.vcell.export.server.ExportSpecs) FieldDataFileOperationSpec(cbit.vcell.field.io.FieldDataFileOperationSpec) DataProcessingOutputInfo(cbit.vcell.simdata.DataOperationResults.DataProcessingOutputInfo) ArrayList(java.util.ArrayList) DataProcessingOutputInfoOP(cbit.vcell.simdata.DataOperation.DataProcessingOutputInfoOP) PDEDataInfo(cbit.vcell.simdata.PDEDataInfo) DataSetControllerProvider(cbit.vcell.server.DataSetControllerProvider) SimDataBlock(cbit.vcell.simdata.SimDataBlock) SpatialSelection(cbit.vcell.simdata.SpatialSelection) VCDataManager(cbit.vcell.simdata.VCDataManager) DataAccessException(org.vcell.util.DataAccessException) AnnotatedFunction(cbit.vcell.solver.AnnotatedFunction) DataOperation(cbit.vcell.simdata.DataOperation) DataSetController(cbit.vcell.server.DataSetController) OutputContext(cbit.vcell.simdata.OutputContext) PDEDataManager(cbit.vcell.simdata.PDEDataManager) DataProcessingOutputInfo(cbit.vcell.simdata.DataOperationResults.DataProcessingOutputInfo) DataOperationResults(cbit.vcell.simdata.DataOperationResults) ClientPDEDataContext(cbit.vcell.simdata.ClientPDEDataContext) VCDataIdentifier(org.vcell.util.document.VCDataIdentifier)

Aggregations

VCDataIdentifier (org.vcell.util.document.VCDataIdentifier)49 VCSimulationDataIdentifier (cbit.vcell.solver.VCSimulationDataIdentifier)20 CartesianMesh (cbit.vcell.solvers.CartesianMesh)17 DataAccessException (org.vcell.util.DataAccessException)15 Vector (java.util.Vector)12 IOException (java.io.IOException)11 User (org.vcell.util.document.User)11 File (java.io.File)10 ArrayList (java.util.ArrayList)10 ExternalDataIdentifier (org.vcell.util.document.ExternalDataIdentifier)10 SimDataBlock (cbit.vcell.simdata.SimDataBlock)9 KeyValue (org.vcell.util.document.KeyValue)9 MathException (cbit.vcell.math.MathException)8 DataIdentifier (cbit.vcell.simdata.DataIdentifier)8 PDEDataManager (cbit.vcell.simdata.PDEDataManager)8 AnnotatedFunction (cbit.vcell.solver.AnnotatedFunction)8 ObjectNotFoundException (org.vcell.util.ObjectNotFoundException)8 ExportSpecs (cbit.vcell.export.server.ExportSpecs)7 VariableType (cbit.vcell.math.VariableType)7 OutputContext (cbit.vcell.simdata.OutputContext)7