Search in sources :

Example 6 with TestCriteriaNew

use of cbit.vcell.numericstest.TestCriteriaNew in project vcell by virtualcell.

the class TestingFrameworkPanel method selectInTreeView.

public void selectInTreeView(final BigDecimal testSuiteKey, final BigDecimal testCaseKey, final BigDecimal testCriteriaKey) {
    new Thread(new Runnable() {

        public void run() {
            long WAIT_TIME_MILLISEC = 20000;
            long startTime = System.currentTimeMillis();
            boolean UPDATE_IN_PROGRESS = false;
            do {
                if ((System.currentTimeMillis() - startTime) >= WAIT_TIME_MILLISEC) {
                    return;
                }
                final BioModelNode testSuiteRootNode = TestingFrmwkTreeModel.getTestSuiteRoot((DefaultTreeModel) getJTree1().getModel());
                for (int i = 0; i < testSuiteRootNode.getChildCount(); i++) {
                    final int finalI = i;
                    TestSuiteInfoNew tsInfo = (TestSuiteInfoNew) ((BioModelNode) testSuiteRootNode.getChildAt(i)).getUserObject();
                    if (tsInfo.getTSKey().equals(testSuiteKey)) {
                        if (testCaseKey != null) {
                            if (TestingFrameworkPanel.hasNullChild((BioModelNode) testSuiteRootNode.getChildAt(i))) {
                                if (UPDATE_IN_PROGRESS) {
                                    break;
                                }
                                AsynchClientTask[] tasksArr = new AsynchClientTask[] { new TFUpdateRunningStatus(getTestingFrameworkWindowManager(), tsInfo), new TFRefresh(getTestingFrameworkWindowManager(), tsInfo) };
                                ClientTaskDispatcher.dispatch(TestingFrameworkPanel.this, new Hashtable<String, Object>(), tasksArr, true);
                                UPDATE_IN_PROGRESS = true;
                                break;
                            }
                            UPDATE_IN_PROGRESS = false;
                            for (int j = 0; j < testSuiteRootNode.getChildAt(i).getChildCount(); j++) {
                                final int finalJ = j;
                                TestCaseNew tcase = (TestCaseNew) ((BioModelNode) testSuiteRootNode.getChildAt(i).getChildAt(j)).getUserObject();
                                if (tcase.getTCKey().equals(testCaseKey)) {
                                    if (testCriteriaKey != null) {
                                        for (int k = 0; k < testSuiteRootNode.getChildAt(i).getChildAt(j).getChildCount(); k++) {
                                            final int finalK = k;
                                            TestCriteriaNew tcrit = (TestCriteriaNew) ((BioModelNode) testSuiteRootNode.getChildAt(i).getChildAt(j).getChildAt(k)).getUserObject();
                                            if (tcrit.getTCritKey().equals(testCriteriaKey)) {
                                                SwingUtilities.invokeLater(new Runnable() {

                                                    public void run() {
                                                        TreePath treePath = new TreePath(((DefaultTreeModel) getJTree1().getModel()).getPathToRoot(testSuiteRootNode.getChildAt(finalI).getChildAt(finalJ).getChildAt(finalK)));
                                                        getJTree1().setSelectionPath(treePath);
                                                        getJTree1().scrollPathToVisible(treePath);
                                                    }
                                                });
                                                break;
                                            }
                                        }
                                        ;
                                    } else {
                                        SwingUtilities.invokeLater(new Runnable() {

                                            public void run() {
                                                TreePath treePath = new TreePath(((DefaultTreeModel) getJTree1().getModel()).getPathToRoot(testSuiteRootNode.getChildAt(finalI).getChildAt(finalJ)));
                                                getJTree1().setSelectionPath(treePath);
                                                getJTree1().scrollPathToVisible(treePath);
                                            }
                                        });
                                        break;
                                    }
                                }
                            }
                        } else {
                            SwingUtilities.invokeLater(new Runnable() {

                                public void run() {
                                    TreePath treePath = new TreePath(((DefaultTreeModel) getJTree1().getModel()).getPathToRoot(testSuiteRootNode.getChildAt(finalI)));
                                    getJTree1().setSelectionPath(treePath);
                                    getJTree1().scrollPathToVisible(treePath);
                                }
                            });
                            break;
                        }
                    }
                }
            } while (UPDATE_IN_PROGRESS);
        }
    }).start();
}
Also used : AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) BioModelNode(cbit.vcell.desktop.BioModelNode) TestCaseNew(cbit.vcell.numericstest.TestCaseNew) DefaultTreeModel(javax.swing.tree.DefaultTreeModel) TFUpdateRunningStatus(cbit.vcell.client.task.TFUpdateRunningStatus) TreePath(javax.swing.tree.TreePath) TFRefresh(cbit.vcell.client.task.TFRefresh) TestCriteriaNew(cbit.vcell.numericstest.TestCriteriaNew) TestSuiteInfoNew(cbit.vcell.numericstest.TestSuiteInfoNew)

Example 7 with TestCriteriaNew

use of cbit.vcell.numericstest.TestCriteriaNew in project vcell by virtualcell.

the class TFRunSims method run.

/**
 * Insert the method's description here.
 * Creation date: (11/17/2004 2:08:09 PM)
 * @param hashTable java.util.Hashtable
 * @param clientWorker cbit.vcell.desktop.controls.ClientWorker
 */
public void run(Hashtable<String, Object> hashTable) {
    ClientTaskStatusSupport pp = getClientTaskStatusSupport();
    String errors = (String) hashTable.get(TFRefresh.TF_ERRORS);
    if (errors == null) {
        errors = "";
    }
    String error = "";
    if (tcrit != null) {
        error = tfwm.startSimulations(new TestCriteriaNew[] { tcrit }, pp);
    } else if (tcn != null) {
        error = tfwm.startSimulations(tcn.getTestCriterias(), pp);
    } else if (tsin != null) {
        error = tfwm.startTestSuiteSimulations(tsin, pp);
    }
    errors += (error == null ? "" : error);
    if (errors != null && errors.length() > 0) {
        hashTable.put(TFRefresh.TF_ERRORS, errors);
    }
}
Also used : ClientTaskStatusSupport(org.vcell.util.ClientTaskStatusSupport) TestCriteriaNew(cbit.vcell.numericstest.TestCriteriaNew)

Example 8 with TestCriteriaNew

use of cbit.vcell.numericstest.TestCriteriaNew in project vcell by virtualcell.

the class EditTestCriteriaPanel method setExistingTestCriteria.

/**
 * Sets the existingTestCriteria property (cbit.vcell.numericstest.TestCriteriaNew) value.
 * @param existingTestCriteria The new value for the property.
 * @see #getExistingTestCriteria
 */
public void setExistingTestCriteria(TestCriteriaNew existingTestCriteria) {
    TestCriteriaNew oldValue = fieldExistingTestCriteria;
    fieldExistingTestCriteria = existingTestCriteria;
    firePropertyChange("existingTestCriteria", oldValue, existingTestCriteria);
}
Also used : TestCriteriaNew(cbit.vcell.numericstest.TestCriteriaNew)

Example 9 with TestCriteriaNew

use of cbit.vcell.numericstest.TestCriteriaNew in project vcell by virtualcell.

the class EditTestCriteriaPanel method setNewTestCriteria.

/**
 * Sets the newTestCriteria property (cbit.vcell.numericstest.TestCriteriaNew) value.
 * @param newTestCriteria The new value for the property.
 * @see #getNewTestCriteria
 */
public void setNewTestCriteria(TestCriteriaNew newTestCriteria) {
    TestCriteriaNew oldValue = fieldNewTestCriteria;
    fieldNewTestCriteria = newTestCriteria;
    firePropertyChange("newTestCriteria", oldValue, newTestCriteria);
}
Also used : TestCriteriaNew(cbit.vcell.numericstest.TestCriteriaNew)

Example 10 with TestCriteriaNew

use of cbit.vcell.numericstest.TestCriteriaNew in project vcell by virtualcell.

the class EditTestCriteriaPanel method applyTestCriteriaInfo.

/**
 * Comment
 */
private void applyTestCriteriaInfo() {
    TestCriteriaNew newTestCriteria = null;
    Double relErr = Double.valueOf(getRelErrTextField().getText());
    Double absErr = Double.valueOf(getAbsErrTextField().getText());
    if (getSolutionType().equals(TestCaseNew.REGRESSION)) {
        // newTestCriteria = new TestCriteriaNew(null, getExistingTestCriteria().getSimInfo(), getReferenceMathModelInfo(), getReferenceSimInfo(), relErr, absErr, null);
        if (getExistingTestCriteria() instanceof TestCriteriaNewMathModel) {
            newTestCriteria = new TestCriteriaNewMathModel(null, getExistingTestCriteria().getSimInfo(), getReferenceMathModelInfo(), getReferenceSimInfo(), relErr, absErr, null, TestCriteriaNew.TCRIT_STATUS_NEEDSREPORT, null);
        } else if (getExistingTestCriteria() instanceof TestCriteriaNewBioModel) {
            newTestCriteria = new TestCriteriaNewBioModel(null, getExistingTestCriteria().getSimInfo(), getbioModelInfo(), getappName(), getbmAppSimInfo(), relErr, absErr, null, TestCriteriaNew.TCRIT_STATUS_NEEDSREPORT, null);
        }
    } else {
        // CONSTRUCTED SOLN OR EXACT SOLUTION
        if (getExistingTestCriteria() instanceof TestCriteriaNewMathModel) {
            newTestCriteria = new TestCriteriaNewMathModel(null, getExistingTestCriteria().getSimInfo(), null, null, relErr, absErr, null, TestCriteriaNew.TCRIT_STATUS_NEEDSREPORT, null);
        } else if (getExistingTestCriteria() instanceof TestCriteriaNewBioModel) {
            newTestCriteria = new TestCriteriaNewBioModel(null, getExistingTestCriteria().getSimInfo(), null, null, null, relErr, absErr, null, TestCriteriaNew.TCRIT_STATUS_NEEDSREPORT, null);
        }
    }
    setNewTestCriteria(newTestCriteria);
}
Also used : TestCriteriaNewMathModel(cbit.vcell.numericstest.TestCriteriaNewMathModel) TestCriteriaNewBioModel(cbit.vcell.numericstest.TestCriteriaNewBioModel) TestCriteriaNew(cbit.vcell.numericstest.TestCriteriaNew)

Aggregations

TestCriteriaNew (cbit.vcell.numericstest.TestCriteriaNew)17 TestCaseNew (cbit.vcell.numericstest.TestCaseNew)10 TestSuiteInfoNew (cbit.vcell.numericstest.TestSuiteInfoNew)8 BioModelNode (cbit.vcell.desktop.BioModelNode)6 TestCriteriaNewBioModel (cbit.vcell.numericstest.TestCriteriaNewBioModel)6 TestCriteriaNewMathModel (cbit.vcell.numericstest.TestCriteriaNewMathModel)6 TestSuiteNew (cbit.vcell.numericstest.TestSuiteNew)6 Vector (java.util.Vector)5 TestCaseNewBioModel (cbit.vcell.numericstest.TestCaseNewBioModel)4 TestCaseNewMathModel (cbit.vcell.numericstest.TestCaseNewMathModel)4 SimulationInfo (cbit.vcell.solver.SimulationInfo)4 AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)3 TFRefresh (cbit.vcell.client.task.TFRefresh)3 TFUpdateRunningStatus (cbit.vcell.client.task.TFUpdateRunningStatus)3 Hashtable (java.util.Hashtable)3 TFGenerateReport (cbit.vcell.client.task.TFGenerateReport)2 SimulationStatus (cbit.vcell.server.SimulationStatus)2 BigDecimal (java.math.BigDecimal)2 JLabel (javax.swing.JLabel)2 TreePath (javax.swing.tree.TreePath)2