Search in sources :

Example 1 with RcvrComputationException

use of edu.cmu.cs.hcii.cogtool.util.RcvrComputationException in project cogtool by cogtool.

the class SNIFACTCmd method computeInBackground.

public static SNIFACTExecContext computeInBackground(Project project, Design design, Interaction interaction, TaskGroup group, SNIFACTParameters parms) {
    isComputing = true;
    try {
        SNIFACTAnalysisWorkThread workThread = new SNIFACTAnalysisWorkThread(SNIFACTPredictionAlgo.ONLY, project, design, null, interaction, group, parms);
        if (SNIFACTPredictionAlgo.exportCTEModelFile != null) {
            return null;
        }
        ITraceWindow traceWin = interaction.createTraceWindow("Computation trace", workThread, "Trace output: stdout (top) and stderr (bottom)");
        workThread.setTraceWindow(traceWin);
        ThreadManager.startNewThread(workThread);
        return workThread.getExecContext();
    } catch (IPredictionAlgo.ComputationException ex) {
        throw new RcvrComputationException(ex);
    } catch (IllegalStateException ex) {
        throw new RcvrIllegalStateException(ex);
    } catch (UnsupportedOperationException ex) {
        throw new RcvrUnimplementedFnException(ex);
    } catch (Exception ex) {
        throw new RcvrComputationException(ex);
    }
}
Also used : RcvrIllegalStateException(edu.cmu.cs.hcii.cogtool.util.RcvrIllegalStateException) IPredictionAlgo(edu.cmu.cs.hcii.cogtool.model.IPredictionAlgo) ITraceWindow(edu.cmu.cs.hcii.cogtool.ui.Interaction.ITraceWindow) RcvrIllegalStateException(edu.cmu.cs.hcii.cogtool.util.RcvrIllegalStateException) RcvrUnimplementedFnException(edu.cmu.cs.hcii.cogtool.util.RcvrUnimplementedFnException) RcvrComputationException(edu.cmu.cs.hcii.cogtool.util.RcvrComputationException) RcvrComputationException(edu.cmu.cs.hcii.cogtool.util.RcvrComputationException) RcvrUnimplementedFnException(edu.cmu.cs.hcii.cogtool.util.RcvrUnimplementedFnException) RcvrIllegalStateException(edu.cmu.cs.hcii.cogtool.util.RcvrIllegalStateException)

Example 2 with RcvrComputationException

use of edu.cmu.cs.hcii.cogtool.util.RcvrComputationException in project cogtool by cogtool.

the class ComputePredictionCmd method computeInBackground.

/**
     * Perform the analysis in the background.  Set the result when done.
     */
public static APredictionResult computeInBackground(IPredictionAlgo computeAlg, Script s, Interaction interact) {
    try {
        DefaultAnalysisWorkThread workThread = new DefaultAnalysisWorkThread(computeAlg, s, null, interact);
        ITraceWindow traceWin = interact.createTraceWindow("Computation trace", workThread, "Trace output: stdout (top) and stderr (bottom)");
        workThread.setTraceWindow(traceWin);
        ThreadManager.startNewThread(workThread);
        return workThread.getResultProxy();
    } catch (IPredictionAlgo.ComputationException ex) {
        throw new RcvrComputationException(ex);
    } catch (IllegalStateException ex) {
        throw new RcvrIllegalStateException(ex);
    } catch (UnsupportedOperationException ex) {
        throw new RcvrUnimplementedFnException(ex);
    } catch (Exception ex) {
        throw new RcvrComputationException(ex);
    }
}
Also used : RcvrIllegalStateException(edu.cmu.cs.hcii.cogtool.util.RcvrIllegalStateException) IPredictionAlgo(edu.cmu.cs.hcii.cogtool.model.IPredictionAlgo) ITraceWindow(edu.cmu.cs.hcii.cogtool.ui.Interaction.ITraceWindow) RcvrIllegalStateException(edu.cmu.cs.hcii.cogtool.util.RcvrIllegalStateException) RcvrUnimplementedFnException(edu.cmu.cs.hcii.cogtool.util.RcvrUnimplementedFnException) RcvrComputationException(edu.cmu.cs.hcii.cogtool.util.RcvrComputationException) RcvrComputationException(edu.cmu.cs.hcii.cogtool.util.RcvrComputationException) RcvrParsingException(edu.cmu.cs.hcii.cogtool.util.RcvrParsingException) RcvrUnimplementedFnException(edu.cmu.cs.hcii.cogtool.util.RcvrUnimplementedFnException) RcvrIllegalStateException(edu.cmu.cs.hcii.cogtool.util.RcvrIllegalStateException)

Aggregations

IPredictionAlgo (edu.cmu.cs.hcii.cogtool.model.IPredictionAlgo)2 ITraceWindow (edu.cmu.cs.hcii.cogtool.ui.Interaction.ITraceWindow)2 RcvrComputationException (edu.cmu.cs.hcii.cogtool.util.RcvrComputationException)2 RcvrIllegalStateException (edu.cmu.cs.hcii.cogtool.util.RcvrIllegalStateException)2 RcvrUnimplementedFnException (edu.cmu.cs.hcii.cogtool.util.RcvrUnimplementedFnException)2 RcvrParsingException (edu.cmu.cs.hcii.cogtool.util.RcvrParsingException)1