Search in sources :

Example 1 with DataManager

use of cbit.vcell.simdata.DataManager in project vcell by virtualcell.

the class ClientRequestManager method getDataViewerController.

/**
 * Insert the method's description here. Creation date: (6/11/2004 10:53:47 AM)
 *
 * @return cbit.vcell.desktop.controls.DataManager
 * @param vcDataIdentifier cbit.vcell.server.VCDataIdentifier
 */
public DataViewerController getDataViewerController(OutputContext outputContext, Simulation simulation, int jobIndex) throws DataAccessException {
    VCSimulationIdentifier vcSimulationIdentifier = simulation.getSimulationInfo().getAuthoritativeVCSimulationIdentifier();
    final VCDataIdentifier vcdataIdentifier = new VCSimulationDataIdentifier(vcSimulationIdentifier, jobIndex);
    DataManager dataManager = getDataManager(outputContext, vcdataIdentifier, simulation.isSpatial());
    return new SimResultsViewerController(dataManager, simulation);
}
Also used : VCSimulationIdentifier(cbit.vcell.solver.VCSimulationIdentifier) VCDataManager(cbit.vcell.simdata.VCDataManager) PDEDataManager(cbit.vcell.simdata.PDEDataManager) ODEDataManager(cbit.vcell.simdata.ODEDataManager) DataManager(cbit.vcell.simdata.DataManager) VCDataIdentifier(org.vcell.util.document.VCDataIdentifier) VCSimulationDataIdentifier(cbit.vcell.solver.VCSimulationDataIdentifier)

Example 2 with DataManager

use of cbit.vcell.simdata.DataManager in project vcell by virtualcell.

the class ClientSimManager method showSimulationResults0.

private AsynchClientTask[] showSimulationResults0(final boolean isLocal, final ViewerType viewerType) {
    // Create the AsynchClientTasks
    ArrayList<AsynchClientTask> taskList = new ArrayList<AsynchClientTask>();
    taskList.add(new AsynchClientTaskFunction(h -> {
        h.put(H_LOCAL_SIM, isLocal);
        h.put(H_VIEWER_TYPE, viewerType);
    }, "setLocal", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING));
    final DocumentWindowManager documentWindowManager = getDocumentWindowManager();
    AsynchClientTask retrieveResultsTask = new AsynchClientTask("Retrieving results", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {

        @SuppressWarnings("unchecked")
        public void run(Hashtable<String, Object> hashTable) throws Exception {
            Simulation[] simsToShow = (Simulation[]) hashTable.get("simsArray");
            for (int i = 0; i < simsToShow.length; i++) {
                final Simulation sim = simsToShow[i];
                final VCSimulationIdentifier vcSimulationIdentifier = sim.getSimulationInfo().getAuthoritativeVCSimulationIdentifier();
                final SimulationWindow simWindow = documentWindowManager.haveSimulationWindow(vcSimulationIdentifier);
                OutputContext outputContext = (OutputContext) hashTable.get("outputContext");
                if (simWindow == null && (viewerType == ViewerType.NativeViewer_only)) {
                    try {
                        // make the manager and wire it up
                        DataViewerController dataViewerController = null;
                        if (!isLocal) {
                            dataViewerController = documentWindowManager.getRequestManager().getDataViewerController(outputContext, sim, 0);
                            // For changes in time or variable
                            documentWindowManager.addDataListener(dataViewerController);
                        } else {
                            // ---- preliminary : construct the localDatasetControllerProvider
                            File primaryDir = ResourceUtil.getLocalRootDir();
                            User usr = sim.getVersion().getOwner();
                            DataSetControllerImpl dataSetControllerImpl = new DataSetControllerImpl(null, primaryDir, null);
                            ExportServiceImpl localExportServiceImpl = new ExportServiceImpl();
                            LocalDataSetControllerProvider localDSCProvider = new LocalDataSetControllerProvider(usr, dataSetControllerImpl, localExportServiceImpl);
                            VCDataManager vcDataManager = new VCDataManager(localDSCProvider);
                            File localSimDir = ResourceUtil.getLocalSimDir(User.tempUser.getName());
                            LocalVCDataIdentifier vcDataId = new LocalVCSimulationDataIdentifier(vcSimulationIdentifier, 0, localSimDir);
                            DataManager dataManager = null;
                            if (sim.isSpatial()) {
                                dataManager = new PDEDataManager(outputContext, vcDataManager, vcDataId);
                            } else {
                                dataManager = new ODEDataManager(outputContext, vcDataManager, vcDataId);
                            }
                            dataViewerController = new SimResultsViewerController(dataManager, sim);
                            dataSetControllerImpl.addDataJobListener(documentWindowManager);
                        }
                        // make the viewer
                        Hashtable<VCSimulationIdentifier, DataViewerController> dataViewerControllers = (Hashtable<VCSimulationIdentifier, DataViewerController>) hashTable.get(H_DATA_VIEWER_CONTROLLERS);
                        if (dataViewerControllers == null) {
                            dataViewerControllers = new Hashtable<VCSimulationIdentifier, DataViewerController>();
                            hashTable.put(H_DATA_VIEWER_CONTROLLERS, dataViewerControllers);
                        }
                        dataViewerControllers.put(vcSimulationIdentifier, dataViewerController);
                    } catch (Throwable exc) {
                        exc.printStackTrace(System.out);
                        saveFailure(hashTable, sim, exc);
                    }
                }
            }
        }
    };
    taskList.add(retrieveResultsTask);
    AsynchClientTask displayResultsTask = new AsynchClientTask("Showing results", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {

        @SuppressWarnings("unchecked")
        public void run(Hashtable<String, Object> hashTable) throws Exception {
            boolean isLocal = fetch(hashTable, H_LOCAL_SIM, Boolean.class, true);
            SimulationWindow.LocalState localState = isLocal ? LocalState.LOCAL : LocalState.SERVER;
            Hashtable<Simulation, Throwable> failures = (Hashtable<Simulation, Throwable>) hashTable.get(H_FAILURES);
            Simulation[] simsToShow = (Simulation[]) hashTable.get("simsArray");
            for (int i = 0; i < simsToShow.length; i++) {
                final Simulation sim = simsToShow[i];
                if (failures != null && failures.containsKey(sim)) {
                    continue;
                }
                final VCSimulationIdentifier vcSimulationIdentifier = simsToShow[i].getSimulationInfo().getAuthoritativeVCSimulationIdentifier();
                final SimulationWindow simWindow = documentWindowManager.haveSimulationWindow(vcSimulationIdentifier);
                if (simWindow != null) {
                    ChildWindowManager childWindowManager = ChildWindowManager.findChildWindowManager(documentWindowManager.getComponent());
                    ChildWindow childWindow = childWindowManager.getChildWindowFromContext(simWindow);
                    if (childWindow == null) {
                        childWindow = childWindowManager.addChildWindow(simWindow.getDataViewer(), simWindow);
                        childWindow.pack();
                        childWindow.setIsCenteredOnParent();
                        childWindow.show();
                    }
                    setFinalWindow(hashTable, childWindow);
                    simWindow.setLocalState(localState);
                } else {
                    // wire it up the viewer
                    Hashtable<VCSimulationIdentifier, DataViewerController> dataViewerControllers = (Hashtable<VCSimulationIdentifier, DataViewerController>) hashTable.get(H_DATA_VIEWER_CONTROLLERS);
                    DataViewerController viewerController = dataViewerControllers.get(vcSimulationIdentifier);
                    Throwable ex = (failures == null ? null : failures.get(sim));
                    if (viewerController != null && ex == null) {
                        // no failure
                        DataViewer viewer = viewerController.createViewer();
                        getSimWorkspace().getSimulationOwner().getOutputFunctionContext().addPropertyChangeListener(viewerController);
                        documentWindowManager.addExportListener(viewer);
                        // For data related activities such as calculating statistics
                        documentWindowManager.addDataJobListener(viewer);
                        viewer.setSimulationModelInfo(new SimulationWorkspaceModelInfo(getSimWorkspace().getSimulationOwner(), sim.getName()));
                        viewer.setDataViewerManager(documentWindowManager);
                        SimulationWindow newWindow = new SimulationWindow(vcSimulationIdentifier, sim, getSimWorkspace().getSimulationOwner(), viewer);
                        BeanUtils.addCloseWindowKeyboardAction(newWindow.getDataViewer());
                        documentWindowManager.addResultsFrame(newWindow);
                        setFinalWindow(hashTable, viewer);
                        newWindow.setLocalState(localState);
                    }
                }
            }
            StringBuffer failMessage = new StringBuffer();
            if (failures != null) {
                if (!failures.isEmpty()) {
                    failMessage.append("Error, " + failures.size() + " of " + simsToShow.length + " sim results failed to display:\n");
                    Enumeration<Simulation> en = failures.keys();
                    while (en.hasMoreElements()) {
                        Simulation sim = en.nextElement();
                        Throwable exc = (Throwable) failures.get(sim);
                        failMessage.append("'" + sim.getName() + "' - " + exc.getMessage());
                    }
                }
            }
            if (failMessage.length() > 0) {
                PopupGenerator.showErrorDialog(ClientSimManager.this.getDocumentWindowManager(), failMessage.toString());
            }
        }
    };
    if (viewerType == ViewerType.NativeViewer_only) {
        taskList.add(displayResultsTask);
    }
    // Dispatch the tasks using the ClientTaskDispatcher.
    AsynchClientTask[] taskArray = new AsynchClientTask[taskList.size()];
    taskList.toArray(taskArray);
    return taskArray;
}
Also used : User(org.vcell.util.document.User) SimulationMessage(cbit.vcell.solver.server.SimulationMessage) Enumeration(java.util.Enumeration) Version(org.vcell.util.document.Version) Vector(java.util.Vector) Map(java.util.Map) AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) VCSimulationDataIdentifier(cbit.vcell.solver.VCSimulationDataIdentifier) SimulationContext(cbit.vcell.mapping.SimulationContext) PrintWriter(java.io.PrintWriter) NetworkGenerationRequirements(cbit.vcell.mapping.SimulationContext.NetworkGenerationRequirements) VCDataManager(cbit.vcell.simdata.VCDataManager) BeanUtils(org.vcell.util.BeanUtils) ODESimData(cbit.vcell.solver.ode.ODESimData) WindowAdapter(java.awt.event.WindowAdapter) SimulationWorkspace(cbit.vcell.client.desktop.simulation.SimulationWorkspace) SolverListener(cbit.vcell.solver.server.SolverListener) VtkManager(cbit.vcell.simdata.VtkManager) SimulationJob(cbit.vcell.solver.SimulationJob) VCellClientTest(cbit.vcell.client.test.VCellClientTest) ExportServiceImpl(cbit.vcell.export.server.ExportServiceImpl) DataProcessingInstructions(cbit.vcell.solver.DataProcessingInstructions) VCellClientDataServiceImpl(cbit.vcell.client.data.VCellClientDataServiceImpl) OutputContext(cbit.vcell.simdata.OutputContext) SimulationTask(cbit.vcell.messaging.server.SimulationTask) VCDocument(org.vcell.util.document.VCDocument) TempSimulation(cbit.vcell.solver.TempSimulation) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) SolverFactory(cbit.vcell.solver.server.SolverFactory) SolverStatus(cbit.vcell.solver.server.SolverStatus) SimulationInfo(cbit.vcell.solver.SimulationInfo) Container(java.awt.Container) PDEDataManager(cbit.vcell.simdata.PDEDataManager) AnnotatedFunction(cbit.vcell.solver.AnnotatedFunction) UserPreferences(cbit.vcell.client.server.UserPreferences) BioModel(cbit.vcell.biomodel.BioModel) BufferedWriter(java.io.BufferedWriter) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException) Window(java.awt.Window) IOException(java.io.IOException) DataAccessException(org.vcell.util.DataAccessException) PropertyLoader(cbit.vcell.resource.PropertyLoader) InputStreamReader(java.io.InputStreamReader) File(java.io.File) SolverUtilities(cbit.vcell.solver.SolverUtilities) DialogUtils(org.vcell.util.gui.DialogUtils) DataViewerController(cbit.vcell.client.data.DataViewerController) SimResultsViewer(cbit.vcell.client.data.SimResultsViewer) LocalVCDataIdentifier(org.vcell.util.document.LocalVCDataIdentifier) SimulationWindow(cbit.vcell.client.desktop.simulation.SimulationWindow) EventObject(java.util.EventObject) VCSimulationIdentifier(cbit.vcell.solver.VCSimulationIdentifier) DataViewer(cbit.vcell.client.data.DataViewer) ColumnDescription(cbit.vcell.util.ColumnDescription) FieldDataIdentifierSpec(cbit.vcell.field.FieldDataIdentifierSpec) SmoldynSolver(org.vcell.solver.smoldyn.SmoldynSolver) Simulation(cbit.vcell.solver.Simulation) Solver(cbit.vcell.solver.server.Solver) Collection(java.util.Collection) UtilCancelException(org.vcell.util.UtilCancelException) WindowEvent(java.awt.event.WindowEvent) FileNotFoundException(java.io.FileNotFoundException) SolverEvent(cbit.vcell.solver.server.SolverEvent) AsynchClientTaskFunction(cbit.vcell.client.task.AsynchClientTaskFunction) Dimension(java.awt.Dimension) List(java.util.List) ClientTaskDispatcher(cbit.vcell.client.task.ClientTaskDispatcher) VCellConfiguration(cbit.vcell.resource.VCellConfiguration) ODESolverResultSet(cbit.vcell.solver.ode.ODESolverResultSet) SimulationOwner(cbit.vcell.solver.SimulationOwner) ChildWindow(cbit.vcell.client.ChildWindowManager.ChildWindow) SimulationWorkspaceModelInfo(cbit.vcell.client.data.SimulationWorkspaceModelInfo) DataSetControllerImpl(cbit.vcell.simdata.DataSetControllerImpl) DataSetController(cbit.vcell.server.DataSetController) VtuVarInfo(org.vcell.vis.io.VtuVarInfo) LocalState(cbit.vcell.client.desktop.simulation.SimulationWindow.LocalState) SwingUtilities(javax.swing.SwingUtilities) SimDataConstants(cbit.vcell.simdata.SimDataConstants) SolverException(cbit.vcell.solver.SolverException) Hashtable(java.util.Hashtable) SimulationStatusDetailsPanel(cbit.vcell.client.desktop.simulation.SimulationStatusDetailsPanel) SimulationStatus(cbit.vcell.server.SimulationStatus) SimulationDataSetRef(cbit.vcell.client.pyvcellproxy.SimulationDataSetRef) ClientServerManager(cbit.vcell.client.server.ClientServerManager) ResourceUtil(cbit.vcell.resource.ResourceUtil) ODEDataManager(cbit.vcell.simdata.ODEDataManager) FileWriter(java.io.FileWriter) SmoldynFileWriter(org.vcell.solver.smoldyn.SmoldynFileWriter) ExpressionException(cbit.vcell.parser.ExpressionException) TokenMangler(org.vcell.util.TokenMangler) SolverDescription(cbit.vcell.solver.SolverDescription) SimulationStatusDetails(cbit.vcell.client.desktop.simulation.SimulationStatusDetails) ProgressDialogListener(org.vcell.util.ProgressDialogListener) DataManager(cbit.vcell.simdata.DataManager) InputStream(java.io.InputStream) UserCancelException(org.vcell.util.UserCancelException) LocalState(cbit.vcell.client.desktop.simulation.SimulationWindow.LocalState) AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) VCSimulationIdentifier(cbit.vcell.solver.VCSimulationIdentifier) User(org.vcell.util.document.User) ArrayList(java.util.ArrayList) AsynchClientTaskFunction(cbit.vcell.client.task.AsynchClientTaskFunction) DataViewerController(cbit.vcell.client.data.DataViewerController) DataViewer(cbit.vcell.client.data.DataViewer) ExportServiceImpl(cbit.vcell.export.server.ExportServiceImpl) VCDataManager(cbit.vcell.simdata.VCDataManager) SimulationWorkspaceModelInfo(cbit.vcell.client.data.SimulationWorkspaceModelInfo) Hashtable(java.util.Hashtable) VCDataManager(cbit.vcell.simdata.VCDataManager) PDEDataManager(cbit.vcell.simdata.PDEDataManager) ODEDataManager(cbit.vcell.simdata.ODEDataManager) DataManager(cbit.vcell.simdata.DataManager) LocalVCDataIdentifier(org.vcell.util.document.LocalVCDataIdentifier) ChildWindow(cbit.vcell.client.ChildWindowManager.ChildWindow) OutputContext(cbit.vcell.simdata.OutputContext) TempSimulation(cbit.vcell.solver.TempSimulation) Simulation(cbit.vcell.solver.Simulation) PDEDataManager(cbit.vcell.simdata.PDEDataManager) SimulationWindow(cbit.vcell.client.desktop.simulation.SimulationWindow) DataSetControllerImpl(cbit.vcell.simdata.DataSetControllerImpl) ODEDataManager(cbit.vcell.simdata.ODEDataManager) File(java.io.File)

Example 3 with DataManager

use of cbit.vcell.simdata.DataManager in project vcell by virtualcell.

the class TestingFrameworkWindowManager method generateTestCriteriaReport.

/**
 * Insert the method's description here.
 * Creation date: (8/18/2003 5:36:47 PM)
 */
private String generateTestCriteriaReport(TestCaseNew testCase, TestCriteriaNew testCriteria, Simulation testSim, TFGenerateReport.VCDocumentAndSimInfo userSelectedRefSimInfo) /*,VCDocument refDoc,VCDocument testDocument*/
{
    if (testSim.getScanCount() != 1) {
        throw new RuntimeException("paramater scan is not supported in Math Testing Framework");
    }
    SimulationSymbolTable simSymbolTable = new SimulationSymbolTable(testSim, 0);
    String simReportStatus = null;
    String simReportStatusMessage = null;
    StringBuffer reportTCBuffer = new StringBuffer();
    VariableComparisonSummary[] failVarSummaries = null;
    VariableComparisonSummary[] allVarSummaries = null;
    double absErr = 0;
    double relErr = 0;
    if (testCriteria != null) {
        absErr = testCriteria.getMaxAbsError().doubleValue();
        relErr = testCriteria.getMaxRelError().doubleValue();
    }
    try {
        VCDocument testDoc = null;
        if (testCase instanceof TestCaseNewMathModel) {
            MathModelInfo mmInfo = ((TestCaseNewMathModel) testCase).getMathModelInfo();
            MathModel mathModel = getRequestManager().getDocumentManager().getMathModel(mmInfo);
            testDoc = mathModel;
        } else if (testCase instanceof TestCaseNewBioModel) {
            TestCaseNewBioModel bioTestCase = (TestCaseNewBioModel) testCase;
            // bioTestCase.
            BioModelInfo bmInfo = bioTestCase.getBioModelInfo();
            BioModel bioModel = getRequestManager().getDocumentManager().getBioModel(bmInfo);
            testDoc = bioModel;
        }
        TFGenerateReport.VCDocumentAndSimInfo refVCDocumentAndSimInfo = null;
        if (userSelectedRefSimInfo == null) {
            SimulationInfo refSimInfo = testCriteria.getRegressionSimInfo();
            if (refSimInfo != null) {
                VCDocument refDoc = null;
                if (testCriteria instanceof TestCriteriaNewMathModel) {
                    MathModelInfo mmInfo = ((TestCriteriaNewMathModel) testCriteria).getRegressionMathModelInfo();
                    MathModel mathModel = getRequestManager().getDocumentManager().getMathModel(mmInfo);
                    refDoc = mathModel;
                } else if (testCriteria instanceof TestCriteriaNewBioModel) {
                    BioModelInfo bmInfo = ((TestCriteriaNewBioModel) testCriteria).getRegressionBioModelInfo();
                    BioModel bioModel = getRequestManager().getDocumentManager().getBioModel(bmInfo);
                    refDoc = bioModel;
                }
                refVCDocumentAndSimInfo = new TFGenerateReport.VCDocumentAndSimInfo(refSimInfo, refDoc);
            }
            reportTCBuffer.append("\t\t" + testSim.getName() + (refVCDocumentAndSimInfo != null ? " (Using TestCrit RegrRefSim)" : "") + " : " + "\n");
        } else {
            refVCDocumentAndSimInfo = userSelectedRefSimInfo;
            reportTCBuffer.append("\t\t" + testSim.getName() + " (Using UserDefined RegrRefSim '" + userSelectedRefSimInfo.getSimInfo().getAuthoritativeVCSimulationIdentifier() + "') : " + "\n");
        }
        if (testCase.getType().equals(TestCaseNew.REGRESSION) && refVCDocumentAndSimInfo == null) {
            reportTCBuffer.append("\t\t\tNo reference SimInfo, SimInfoKey=" + testCriteria.getSimInfo().getVersion().getName() + ". Cannot perform Regression Test!\n");
            simReportStatus = TestCriteriaNew.TCRIT_STATUS_NOREFREGR;
        } else {
            VCDataIdentifier vcdID = new VCSimulationDataIdentifier(testSim.getSimulationInfo().getAuthoritativeVCSimulationIdentifier(), 0);
            DataManager simDataManager = getRequestManager().getDataManager(null, vcdID, testSim.isSpatial());
            double[] timeArray = null;
            // can be histogram, so there won't be time array
            try {
                timeArray = simDataManager.getDataSetTimes();
            } catch (Exception ex) {
                ex.printStackTrace(System.out);
            }
            NonspatialStochSimOptions stochOpt = testSim.getSolverTaskDescription().getStochOpt();
            if ((stochOpt == null || stochOpt.getNumOfTrials() == 1) && (timeArray == null || timeArray.length == 0)) {
                reportTCBuffer.append("\t\t\tNO DATA : Simulation not run yet.\n");
                simReportStatus = TestCriteriaNew.TCRIT_STATUS_NODATA;
            } else {
                // SPATIAL simulation
                if (testSim.getMathDescription().isSpatial()) {
                    PDEDataManager pdeDataManager = (PDEDataManager) simDataManager;
                    // Get EXACT solution if test case type is EXACT, Compare with numerical
                    if (testCase.getType().equals(TestCaseNew.EXACT) || testCase.getType().equals(TestCaseNew.EXACT_STEADY)) {
                        SimulationComparisonSummary simCompSummary = MathTestingUtilities.comparePDEResultsWithExact(simSymbolTable, pdeDataManager, testCase.getType(), testCriteria.getMaxAbsError(), testCriteria.getMaxRelError());
                        // Failed var summaries
                        failVarSummaries = simCompSummary.getFailingVariableComparisonSummaries(absErr, relErr);
                        allVarSummaries = simCompSummary.getVariableComparisonSummaries();
                        if (failVarSummaries.length > 0) {
                            simReportStatus = TestCriteriaNew.TCRIT_STATUS_FAILEDVARS;
                            // Failed simulation
                            reportTCBuffer.append("\t\tTolerance test FAILED \n");
                            reportTCBuffer.append("\t\tFailed Variables : \n");
                            for (int m = 0; m < failVarSummaries.length; m++) {
                                reportTCBuffer.append("\t\t\t" + failVarSummaries[m].toShortString() + "\n");
                            }
                        } else {
                            simReportStatus = TestCriteriaNew.TCRIT_STATUS_PASSED;
                            reportTCBuffer.append("\t\tTolerance test PASSED \n");
                        }
                        reportTCBuffer.append("\t\tPassed Variables : \n");
                        // Check if varSummary exists in failed summaries list. If not, simulation passed.
                        for (int m = 0; m < allVarSummaries.length; m++) {
                            if (!BeanUtils.arrayContains(failVarSummaries, allVarSummaries[m])) {
                                reportTCBuffer.append("\t\t\t" + allVarSummaries[m].toShortString() + "\n");
                            }
                        }
                    // Get CONSTRUCTED solution if test case type is CONSTRUCTED, Compare with numerical
                    } else if (testCase.getType().equals(TestCaseNew.CONSTRUCTED)) {
                        SimulationComparisonSummary simCompSummary = MathTestingUtilities.comparePDEResultsWithExact(simSymbolTable, pdeDataManager, testCase.getType(), testCriteria.getMaxAbsError(), testCriteria.getMaxRelError());
                        // Failed var summaries
                        failVarSummaries = simCompSummary.getFailingVariableComparisonSummaries(absErr, relErr);
                        allVarSummaries = simCompSummary.getVariableComparisonSummaries();
                        if (failVarSummaries.length > 0) {
                            simReportStatus = TestCriteriaNew.TCRIT_STATUS_FAILEDVARS;
                            // Failed simulation
                            reportTCBuffer.append("\t\tTolerance test FAILED \n");
                            reportTCBuffer.append("\t\tFailed Variables : \n");
                            for (int m = 0; m < failVarSummaries.length; m++) {
                                reportTCBuffer.append("\t\t\t" + failVarSummaries[m].toShortString() + "\n");
                            }
                        } else {
                            simReportStatus = TestCriteriaNew.TCRIT_STATUS_PASSED;
                            reportTCBuffer.append("\t\tTolerance test PASSED \n");
                        }
                        reportTCBuffer.append("\t\tPassed Variables : \n");
                        // Check if varSummary exists in failed summaries list. If not, simulation passed.
                        for (int m = 0; m < allVarSummaries.length; m++) {
                            if (!BeanUtils.arrayContains(failVarSummaries, allVarSummaries[m])) {
                                reportTCBuffer.append("\t\t\t" + allVarSummaries[m].toShortString() + "\n");
                            }
                        }
                    } else if (testCase.getType().equals(TestCaseNew.REGRESSION)) {
                        Simulation refSim = ((ClientDocumentManager) getRequestManager().getDocumentManager()).getSimulation(refVCDocumentAndSimInfo.getSimInfo());
                        VCDataIdentifier refVcdID = new VCSimulationDataIdentifier(refVCDocumentAndSimInfo.getSimInfo().getAuthoritativeVCSimulationIdentifier(), 0);
                        PDEDataManager refDataManager = (PDEDataManager) getRequestManager().getDataManager(null, refVcdID, refSim.isSpatial());
                        if (refSim.getScanCount() != 1) {
                            throw new RuntimeException("paramater scan is not supported in Math Testing Framework");
                        }
                        SimulationSymbolTable refSimSymbolTable = new SimulationSymbolTable(refSim, 0);
                        String[] varsToCompare = getVariableNamesToCompare(simSymbolTable, refSimSymbolTable);
                        SimulationComparisonSummary simCompSummary = MathTestingUtilities.comparePDEResults(simSymbolTable, pdeDataManager, refSimSymbolTable, refDataManager, varsToCompare, testCriteria.getMaxAbsError(), testCriteria.getMaxRelError(), refVCDocumentAndSimInfo.getVCDocument(), getDataInfoProvider(refVCDocumentAndSimInfo.getVCDocument(), refDataManager.getPDEDataContext(), refSim.getName()), testDoc, getDataInfoProvider(testDoc, pdeDataManager.getPDEDataContext(), testSim.getName()));
                        // Failed var summaries
                        failVarSummaries = simCompSummary.getFailingVariableComparisonSummaries(absErr, relErr);
                        allVarSummaries = simCompSummary.getVariableComparisonSummaries();
                        if (failVarSummaries.length > 0) {
                            simReportStatus = TestCriteriaNew.TCRIT_STATUS_FAILEDVARS;
                            // Failed simulation
                            reportTCBuffer.append("\t\tTolerance test FAILED \n");
                            reportTCBuffer.append("\t\tFailed Variables : \n");
                            for (int m = 0; m < failVarSummaries.length; m++) {
                                reportTCBuffer.append("\t\t\t" + failVarSummaries[m].toShortString() + "\n");
                            }
                        } else {
                            simReportStatus = TestCriteriaNew.TCRIT_STATUS_PASSED;
                            reportTCBuffer.append("\t\tTolerance test PASSED \n");
                        }
                        reportTCBuffer.append("\t\tPassed Variables : \n");
                        // Check if varSummary exists in failed summaries list. If not, simulation passed.
                        for (int m = 0; m < allVarSummaries.length; m++) {
                            if (!BeanUtils.arrayContains(failVarSummaries, allVarSummaries[m])) {
                                reportTCBuffer.append("\t\t\t" + allVarSummaries[m].toShortString() + "\n");
                            }
                        }
                    }
                } else {
                    // NON-SPATIAL CASE
                    ODEDataManager odeDataManager = (ODEDataManager) simDataManager;
                    ODESolverResultSet numericalResultSet = odeDataManager.getODESolverResultSet();
                    // Get EXACT result set if test case type is EXACT, Compare with numerical
                    if (testCase.getType().equals(TestCaseNew.EXACT) || testCase.getType().equals(TestCaseNew.EXACT_STEADY)) {
                        ODESolverResultSet exactResultSet = MathTestingUtilities.getExactResultSet(testSim.getMathDescription(), timeArray, testSim.getSolverTaskDescription().getSensitivityParameter());
                        String[] varsToCompare = getVariableNamesToCompare(simSymbolTable, simSymbolTable);
                        SimulationComparisonSummary simCompSummary_exact = MathTestingUtilities.compareResultSets(numericalResultSet, exactResultSet, varsToCompare, testCase.getType(), testCriteria.getMaxAbsError(), testCriteria.getMaxRelError());
                        // Get all the variable comparison summaries and the failed ones to print out report for EXACT solution comparison.
                        failVarSummaries = simCompSummary_exact.getFailingVariableComparisonSummaries(absErr, relErr);
                        allVarSummaries = simCompSummary_exact.getVariableComparisonSummaries();
                        if (failVarSummaries.length > 0) {
                            simReportStatus = TestCriteriaNew.TCRIT_STATUS_FAILEDVARS;
                            // Failed simulation
                            reportTCBuffer.append("\t\tTolerance test FAILED \n");
                            reportTCBuffer.append("\t\tFailed Variables : \n");
                            for (int m = 0; m < failVarSummaries.length; m++) {
                                reportTCBuffer.append("\t\t\t" + failVarSummaries[m].toShortString() + "\n");
                            }
                        } else {
                            simReportStatus = TestCriteriaNew.TCRIT_STATUS_PASSED;
                            reportTCBuffer.append("\t\tTolerance test PASSED \n");
                        }
                        reportTCBuffer.append("\t\tPassed Variables : \n");
                        // Check if varSummary exists in failed summaries list. If not, simulation passed.
                        for (int m = 0; m < allVarSummaries.length; m++) {
                            if (!BeanUtils.arrayContains(failVarSummaries, allVarSummaries[m])) {
                                reportTCBuffer.append("\t\t\t" + allVarSummaries[m].toShortString() + "\n");
                            }
                        }
                    // Get CONSTRUCTED result set if test case type is CONSTRUCTED , compare with numerical
                    } else if (testCase.getType().equals(TestCaseNew.CONSTRUCTED)) {
                        ODESolverResultSet constructedResultSet = MathTestingUtilities.getConstructedResultSet(testSim.getMathDescription(), timeArray);
                        String[] varsToCompare = getVariableNamesToCompare(simSymbolTable, simSymbolTable);
                        SimulationComparisonSummary simCompSummary_constr = MathTestingUtilities.compareResultSets(numericalResultSet, constructedResultSet, varsToCompare, testCase.getType(), testCriteria.getMaxAbsError(), testCriteria.getMaxRelError());
                        // Get all the variable comparison summaries and the failed ones to print out report for CONSTRUCTED solution comparison.
                        failVarSummaries = simCompSummary_constr.getFailingVariableComparisonSummaries(absErr, relErr);
                        allVarSummaries = simCompSummary_constr.getVariableComparisonSummaries();
                        if (failVarSummaries.length > 0) {
                            simReportStatus = TestCriteriaNew.TCRIT_STATUS_FAILEDVARS;
                            // Failed simulation
                            reportTCBuffer.append("\t\tTolerance test FAILED \n");
                            reportTCBuffer.append("\t\tFailed Variables : \n");
                            for (int m = 0; m < failVarSummaries.length; m++) {
                                reportTCBuffer.append("\t\t\t" + failVarSummaries[m].toShortString() + "\n");
                            }
                        } else {
                            simReportStatus = TestCriteriaNew.TCRIT_STATUS_PASSED;
                            reportTCBuffer.append("\t\tTolerance test PASSED \n");
                        }
                        reportTCBuffer.append("\t\tPassed Variables : \n");
                        // Check if varSummary exists in failed summaries list. If not, simulation passed.
                        for (int m = 0; m < allVarSummaries.length; m++) {
                            if (!BeanUtils.arrayContains(failVarSummaries, allVarSummaries[m])) {
                                reportTCBuffer.append("\t\t\t" + allVarSummaries[m].toShortString() + "\n");
                            }
                        }
                    } else if (testCase.getType().equals(TestCaseNew.REGRESSION)) {
                        Simulation refSim = ((ClientDocumentManager) getRequestManager().getDocumentManager()).getSimulation(testCriteria.getRegressionSimInfo());
                        if (refSim.getScanCount() != 1) {
                            throw new RuntimeException("paramater scan is not supported in Math Testing Framework");
                        }
                        SimulationSymbolTable refSimSymbolTable = new SimulationSymbolTable(refSim, 0);
                        String[] varsToTest = getVariableNamesToCompare(simSymbolTable, refSimSymbolTable);
                        VCDataIdentifier refVcdID = new VCSimulationDataIdentifier(refVCDocumentAndSimInfo.getSimInfo().getAuthoritativeVCSimulationIdentifier(), 0);
                        ODEDataManager refDataManager = (ODEDataManager) getRequestManager().getDataManager(null, refVcdID, refSim.isSpatial());
                        ODESolverResultSet referenceResultSet = refDataManager.getODESolverResultSet();
                        SimulationComparisonSummary simCompSummary_regr = null;
                        int interpolationOrder = 1;
                        SolverTaskDescription solverTaskDescription = refSim.getSolverTaskDescription();
                        if (solverTaskDescription.getOutputTimeSpec().isDefault() && ((DefaultOutputTimeSpec) solverTaskDescription.getOutputTimeSpec()).getKeepEvery() == 1) {
                            SolverDescription solverDescription = solverTaskDescription.getSolverDescription();
                            if ((!solverDescription.supportsAll(SolverDescription.DiscontinutiesFeatures)) || !refSim.getMathDescription().hasDiscontinuities()) {
                                interpolationOrder = solverDescription.getTimeOrder();
                            }
                        }
                        simCompSummary_regr = MathTestingUtilities.compareUnEqualResultSets(numericalResultSet, referenceResultSet, varsToTest, testCriteria.getMaxAbsError(), testCriteria.getMaxRelError(), interpolationOrder);
                        // Get all the variable comparison summaries and the failed ones to print out report for CONSTRUCTED solution comparison.
                        failVarSummaries = simCompSummary_regr.getFailingVariableComparisonSummaries(absErr, relErr);
                        allVarSummaries = simCompSummary_regr.getVariableComparisonSummaries();
                        if (failVarSummaries.length > 0) {
                            simReportStatus = TestCriteriaNew.TCRIT_STATUS_FAILEDVARS;
                            // Failed simulation
                            reportTCBuffer.append("\t\tTolerance test FAILED \n");
                            reportTCBuffer.append("\t\tFailed Variables : \n");
                            for (int m = 0; m < failVarSummaries.length; m++) {
                                reportTCBuffer.append("\t\t\t" + failVarSummaries[m].toShortString() + "\n");
                            }
                        } else {
                            simReportStatus = TestCriteriaNew.TCRIT_STATUS_PASSED;
                            reportTCBuffer.append("\t\tTolerance test PASSED \n");
                        }
                        reportTCBuffer.append("\t\tPassed Variables : \n");
                        // Check if varSummary exists in failed summaries list. If not, simulation passed.
                        for (int m = 0; m < allVarSummaries.length; m++) {
                            if (!BeanUtils.arrayContains(failVarSummaries, allVarSummaries[m])) {
                                reportTCBuffer.append("\t\t\t" + allVarSummaries[m].toShortString() + "\n");
                            }
                        }
                    }
                }
            }
        }
    } catch (Throwable e) {
        simReportStatus = TestCriteriaNew.TCRIT_STATUS_RPERROR;
        simReportStatusMessage = e.getClass().getName() + " " + e.getMessage();
        reportTCBuffer.append("\t\t" + simReportStatusMessage + "\n");
        e.printStackTrace(System.out);
    }
    if (userSelectedRefSimInfo == null) {
        try {
            // Remove any test results already present for testCriteria
            RemoveTestResultsOP removeResultsOP = new RemoveTestResultsOP(new BigDecimal[] { testCriteria.getTCritKey() });
            // testResultsOPsVector.add(removeResultsOP);
            getRequestManager().getDocumentManager().doTestSuiteOP(removeResultsOP);
            // Create new AddTestREsultsOP object for the current simulation./testCriteria.
            if (allVarSummaries != null) {
                AddTestResultsOP testResultsOP = new AddTestResultsOP(testCriteria.getTCritKey(), allVarSummaries);
                // testResultsOPsVector.add(testResultsOP);
                // Write the testResults for simulation/TestCriteria into the database ...
                getRequestManager().getDocumentManager().doTestSuiteOP(testResultsOP);
            }
            // Update report status
            updateTCritStatus(testCriteria, simReportStatus, simReportStatusMessage);
        } catch (Throwable e) {
            reportTCBuffer.append("\t\tUpdate DB Results failed. " + e.getClass().getName() + " " + e.getMessage() + "\n");
            try {
                getRequestManager().getDocumentManager().doTestSuiteOP(new EditTestCriteriaOPReportStatus(testCriteria.getTCritKey(), TestCriteriaNew.TCRIT_STATUS_RPERROR, e.getClass().getName() + " " + e.getMessage()));
            } catch (Throwable e2) {
            // Nothing more can be done
            }
        }
    }
    return reportTCBuffer.toString();
}
Also used : MathModel(cbit.vcell.mathmodel.MathModel) AddTestCasesOPMathModel(cbit.vcell.numericstest.AddTestCasesOPMathModel) TestCaseNewMathModel(cbit.vcell.numericstest.TestCaseNewMathModel) TestCriteriaNewMathModel(cbit.vcell.numericstest.TestCriteriaNewMathModel) EditTestCriteriaOPMathModel(cbit.vcell.numericstest.EditTestCriteriaOPMathModel) AddTestCriteriaOPMathModel(cbit.vcell.numericstest.AddTestCriteriaOPMathModel) SolverDescription(cbit.vcell.solver.SolverDescription) TestCriteriaNewBioModel(cbit.vcell.numericstest.TestCriteriaNewBioModel) NonspatialStochSimOptions(cbit.vcell.solver.NonspatialStochSimOptions) ClientDocumentManager(cbit.vcell.clientdb.ClientDocumentManager) TFGenerateReport(cbit.vcell.client.task.TFGenerateReport) TestCaseNewBioModel(cbit.vcell.numericstest.TestCaseNewBioModel) RemoveTestResultsOP(cbit.vcell.numericstest.RemoveTestResultsOP) TestCriteriaNewMathModel(cbit.vcell.numericstest.TestCriteriaNewMathModel) AddTestResultsOP(cbit.vcell.numericstest.AddTestResultsOP) SimulationComparisonSummary(cbit.vcell.solver.test.SimulationComparisonSummary) ODESolverResultSet(cbit.vcell.solver.ode.ODESolverResultSet) VariableComparisonSummary(cbit.vcell.solver.test.VariableComparisonSummary) SolverTaskDescription(cbit.vcell.solver.SolverTaskDescription) EditTestCriteriaOPReportStatus(cbit.vcell.numericstest.EditTestCriteriaOPReportStatus) VCDocument(org.vcell.util.document.VCDocument) SimulationSymbolTable(cbit.vcell.solver.SimulationSymbolTable) BioModelInfo(org.vcell.util.document.BioModelInfo) PDEDataManager(cbit.vcell.simdata.PDEDataManager) ODEDataManager(cbit.vcell.simdata.ODEDataManager) DataManager(cbit.vcell.simdata.DataManager) MathModelInfo(org.vcell.util.document.MathModelInfo) VCSimulationDataIdentifier(cbit.vcell.solver.VCSimulationDataIdentifier) ObjectNotFoundException(org.vcell.util.ObjectNotFoundException) DataAccessException(org.vcell.util.DataAccessException) UserCancelException(org.vcell.util.UserCancelException) Simulation(cbit.vcell.solver.Simulation) PDEDataManager(cbit.vcell.simdata.PDEDataManager) TestCaseNewBioModel(cbit.vcell.numericstest.TestCaseNewBioModel) TestCriteriaNewBioModel(cbit.vcell.numericstest.TestCriteriaNewBioModel) AddTestCasesOPBioModel(cbit.vcell.numericstest.AddTestCasesOPBioModel) BioModel(cbit.vcell.biomodel.BioModel) EditTestCriteriaOPBioModel(cbit.vcell.numericstest.EditTestCriteriaOPBioModel) AddTestCriteriaOPBioModel(cbit.vcell.numericstest.AddTestCriteriaOPBioModel) TestCaseNewMathModel(cbit.vcell.numericstest.TestCaseNewMathModel) ODEDataManager(cbit.vcell.simdata.ODEDataManager) VCDataIdentifier(org.vcell.util.document.VCDataIdentifier) DefaultOutputTimeSpec(cbit.vcell.solver.DefaultOutputTimeSpec) SimulationInfo(cbit.vcell.solver.SimulationInfo)

Example 4 with DataManager

use of cbit.vcell.simdata.DataManager in project vcell by virtualcell.

the class ClientRequestManager method getDataManager.

/**
 * Insert the method's description here. Creation date: (6/11/2004 10:53:47 AM)
 *
 * @return cbit.vcell.desktop.controls.DataManager
 * @param vcDataIdentifier cbit.vcell.server.VCDataIdentifier
 */
public DataManager getDataManager(OutputContext outputContext, VCDataIdentifier vcDataId, boolean isSpatial) throws DataAccessException {
    // 
    // Create ODE or PDE or Merged Datamanager depending on ODE or PDE or Merged
    // data.
    // 
    DataManager dataManager = null;
    VCDataManager vcDataManager = getClientServerManager().getVCDataManager();
    if (isSpatial) {
        dataManager = new PDEDataManager(outputContext, vcDataManager, vcDataId);
    } else {
        dataManager = new ODEDataManager(outputContext, vcDataManager, vcDataId);
    }
    // dataManager.connect();
    return dataManager;
}
Also used : PDEDataManager(cbit.vcell.simdata.PDEDataManager) VCDataManager(cbit.vcell.simdata.VCDataManager) PDEDataManager(cbit.vcell.simdata.PDEDataManager) ODEDataManager(cbit.vcell.simdata.ODEDataManager) DataManager(cbit.vcell.simdata.DataManager) ODEDataManager(cbit.vcell.simdata.ODEDataManager) VCDataManager(cbit.vcell.simdata.VCDataManager)

Example 5 with DataManager

use of cbit.vcell.simdata.DataManager in project vcell by virtualcell.

the class TestingFrameworkWindowManager method compare.

/**
 * Insert the method's description here.
 * Creation date: (1/20/2003 11:52:18 AM)
 * @return boolean
 * @param mathDesc cbit.vcell.math.MathDescription
 */
public void compare(final TestCriteriaNew testCriteria, final SimulationInfo userDefinedRegrSimInfo) {
    final String KEY_MERGEDDATAINFO = "KEY_MERGEDDATAINFO";
    final String KEY_MERGEDDATASETVIEWERCNTRLR = "KEY_MERGEDDATASETVIEWERCNTRLR";
    AsynchClientTask gatherDataTask = new AsynchClientTask("Gathering compare Dta...", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {

        @Override
        public void run(Hashtable<String, Object> hashTable) throws Exception {
            // create the merged data for the simulationInfo in testCriteria and the regression simInfo
            SimulationInfo simInfo = testCriteria.getSimInfo();
            SimulationInfo regrSimInfo = null;
            if (userDefinedRegrSimInfo != null) {
                regrSimInfo = userDefinedRegrSimInfo;
            } else {
                regrSimInfo = testCriteria.getRegressionSimInfo();
            }
            if (regrSimInfo == null) {
                return;
            }
            VCDataIdentifier vcSimId1 = new VCSimulationDataIdentifier(simInfo.getAuthoritativeVCSimulationIdentifier(), 0);
            VCDataIdentifier vcSimId2 = new VCSimulationDataIdentifier(regrSimInfo.getAuthoritativeVCSimulationIdentifier(), 0);
            User user = simInfo.getOwner();
            VCDataIdentifier[] vcIdentifierArray = new VCDataIdentifier[] { vcSimId2, vcSimId1 };
            MergedDataInfo mergedDataInfo = new MergedDataInfo(user, vcIdentifierArray, MergedDataInfo.createDefaultPrefixNames(vcIdentifierArray.length));
            hashTable.put(KEY_MERGEDDATAINFO, mergedDataInfo);
            // get the data manager and wire it up
            // 
            // get all "Data1.XXX" data identifiers ... and remove those which are functions
            // add functions of the form DIFF_XXX = (Data1.XXX - Data2.XXX) for convenience in comparing results.
            // 
            Simulation sim1 = ((ClientDocumentManager) getRequestManager().getDocumentManager()).getSimulation(simInfo);
            Simulation sim2 = ((ClientDocumentManager) getRequestManager().getDocumentManager()).getSimulation(regrSimInfo);
            boolean isSpatial = sim1.isSpatial();
            if (sim2.isSpatial() != isSpatial) {
                throw new RuntimeException("Cannot compare spatial and non-spatial data sets : " + simInfo + "& " + regrSimInfo);
            }
            DataManager mergedDataManager = getRequestManager().getDataManager(null, mergedDataInfo, isSpatial);
            DataManager data1Manager = getRequestManager().getDataManager(null, vcSimId1, isSpatial);
            DataManager data2Manager = getRequestManager().getDataManager(null, vcSimId2, isSpatial);
            Vector<AnnotatedFunction> functionList = new Vector<AnnotatedFunction>();
            AnnotatedFunction[] data1Functions = data1Manager.getFunctions();
            AnnotatedFunction[] existingFunctions = mergedDataManager.getFunctions();
            DataIdentifier[] data1Identifiers = data1Manager.getDataIdentifiers();
            DataIdentifier[] data2Identifiers = data2Manager.getDataIdentifiers();
            for (int i = 0; i < data1Identifiers.length; i++) {
                // 
                // make sure dataIdentifier is not already a function
                // 
                boolean bIsFunction = false;
                for (int j = 0; j < data1Functions.length; j++) {
                    if (data1Identifiers[i].getName().equals(data1Functions[j].getName())) {
                        bIsFunction = true;
                    }
                }
                if (bIsFunction) {
                    continue;
                }
                // 
                // make sure corresponding identifier exists in "Data2"
                // 
                boolean bIsInData2 = false;
                for (int j = 0; j < data2Identifiers.length; j++) {
                    if (data2Identifiers[j].getName().equals(data1Identifiers[i].getName())) {
                        bIsInData2 = true;
                    }
                }
                if (!bIsInData2) {
                    continue;
                }
                // 
                // create "Diff" function
                // 
                String data1Name = "Data1." + data1Identifiers[i].getName();
                String data2Name = "Data2." + data1Identifiers[i].getName();
                String functionName = "DIFF_" + data1Identifiers[i].getName();
                VariableType varType = data1Identifiers[i].getVariableType();
                Expression exp = new Expression(data1Name + "-" + data2Name);
                AnnotatedFunction newFunction = new AnnotatedFunction(functionName, exp, data1Identifiers[i].getDomain(), "", varType, FunctionCategory.OUTPUTFUNCTION);
                // 
                // make sure new "Diff" function isn't already in existing function list.
                // 
                boolean bDiffFunctionAlreadyHere = false;
                for (int j = 0; j < existingFunctions.length; j++) {
                    if (newFunction.getName().equals(existingFunctions[j].getName())) {
                        bDiffFunctionAlreadyHere = true;
                    }
                }
                if (bDiffFunctionAlreadyHere) {
                    continue;
                }
                functionList.add(newFunction);
            }
            OutputContext outputContext = null;
            if (functionList.size() > 0) {
                AnnotatedFunction[] newDiffFunctions = (AnnotatedFunction[]) BeanUtils.getArray(functionList, AnnotatedFunction.class);
                outputContext = new OutputContext(newDiffFunctions);
            }
            MergedDatasetViewerController mergedDatasetViewerCtr = getRequestManager().getMergedDatasetViewerController(outputContext, mergedDataInfo, !isSpatial);
            hashTable.put(KEY_MERGEDDATASETVIEWERCNTRLR, mergedDatasetViewerCtr);
        }
    };
    AsynchClientTask showResultsTask = new AsynchClientTask("Showing Compare Results", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {

        @Override
        public void run(Hashtable<String, Object> hashTable) throws Exception {
            // make the viewer
            MergedDatasetViewerController mergedDatasetViewerCtr = (MergedDatasetViewerController) hashTable.get(KEY_MERGEDDATASETVIEWERCNTRLR);
            addDataListener(mergedDatasetViewerCtr);
            DataViewer viewer = mergedDatasetViewerCtr.createViewer();
            viewer.setDataViewerManager(TestingFrameworkWindowManager.this);
            addExportListener(viewer);
            VCDataIdentifier vcDataIdentifier = (MergedDataInfo) hashTable.get(KEY_MERGEDDATAINFO);
            ChildWindowManager childWindowManager = TFWFinder.findChildWindowManager(getComponent());
            ChildWindow childWindow = childWindowManager.addChildWindow(viewer, vcDataIdentifier, "Comparing ... " + vcDataIdentifier.getID());
            childWindow.pack();
            // childWindow.setSize(450, 450);
            childWindow.setIsCenteredOnParent();
            childWindow.show();
        }
    };
    ClientTaskDispatcher.dispatch(getComponent(), new Hashtable<String, Object>(), new AsynchClientTask[] { gatherDataTask, showResultsTask }, false);
}
Also used : AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) User(org.vcell.util.document.User) VCSimulationDataIdentifier(cbit.vcell.solver.VCSimulationDataIdentifier) VCDataIdentifier(org.vcell.util.document.VCDataIdentifier) DataIdentifier(cbit.vcell.simdata.DataIdentifier) ClientDocumentManager(cbit.vcell.clientdb.ClientDocumentManager) MergedDataInfo(cbit.vcell.simdata.MergedDataInfo) DataViewer(cbit.vcell.client.data.DataViewer) Vector(java.util.Vector) MergedDatasetViewerController(cbit.vcell.client.data.MergedDatasetViewerController) AnnotatedFunction(cbit.vcell.solver.AnnotatedFunction) VariableType(cbit.vcell.math.VariableType) Hashtable(java.util.Hashtable) PDEDataManager(cbit.vcell.simdata.PDEDataManager) ODEDataManager(cbit.vcell.simdata.ODEDataManager) DataManager(cbit.vcell.simdata.DataManager) VCSimulationDataIdentifier(cbit.vcell.solver.VCSimulationDataIdentifier) ChildWindow(cbit.vcell.client.ChildWindowManager.ChildWindow) OutputContext(cbit.vcell.simdata.OutputContext) Simulation(cbit.vcell.solver.Simulation) Expression(cbit.vcell.parser.Expression) VCDataIdentifier(org.vcell.util.document.VCDataIdentifier) SimulationInfo(cbit.vcell.solver.SimulationInfo)

Aggregations

DataManager (cbit.vcell.simdata.DataManager)5 ODEDataManager (cbit.vcell.simdata.ODEDataManager)5 PDEDataManager (cbit.vcell.simdata.PDEDataManager)5 VCSimulationDataIdentifier (cbit.vcell.solver.VCSimulationDataIdentifier)4 VCDataManager (cbit.vcell.simdata.VCDataManager)3 BioModel (cbit.vcell.biomodel.BioModel)2 ChildWindow (cbit.vcell.client.ChildWindowManager.ChildWindow)2 DataViewer (cbit.vcell.client.data.DataViewer)2 AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)2 ClientDocumentManager (cbit.vcell.clientdb.ClientDocumentManager)2 OutputContext (cbit.vcell.simdata.OutputContext)2 Simulation (cbit.vcell.solver.Simulation)2 SimulationInfo (cbit.vcell.solver.SimulationInfo)2 VCSimulationIdentifier (cbit.vcell.solver.VCSimulationIdentifier)2 VCDataIdentifier (org.vcell.util.document.VCDataIdentifier)2 DataViewerController (cbit.vcell.client.data.DataViewerController)1 MergedDatasetViewerController (cbit.vcell.client.data.MergedDatasetViewerController)1 SimResultsViewer (cbit.vcell.client.data.SimResultsViewer)1 SimulationWorkspaceModelInfo (cbit.vcell.client.data.SimulationWorkspaceModelInfo)1 VCellClientDataServiceImpl (cbit.vcell.client.data.VCellClientDataServiceImpl)1