Search in sources :

Example 1 with SimulationStatus

use of org.vcell.sbmlsim.api.common.SimulationStatus in project vcell by virtualcell.

the class VCellSbmlSimCLI method process_status.

private void process_status() throws Exception {
    Gson gson = new Gson();
    SimulationInfo simInfo = null;
    if (simhandle != null) {
        simInfo = new SimulationInfo(simhandle);
    } else {
        throw new CliException("simhandle (simulation handle) not specified");
    }
    if (outputfile == null) {
        throw new CliException("output file not specified");
    }
    SimulationStatus simstatus = simService.getStatus(simInfo);
    String simstatusJSON = gson.toJson(simstatus);
    FileUtils.write(outputfile, simstatusJSON);
}
Also used : SimulationStatus(org.vcell.sbmlsim.api.common.SimulationStatus) Gson(com.google.gson.Gson) SimulationInfo(org.vcell.sbmlsim.api.common.SimulationInfo)

Example 2 with SimulationStatus

use of org.vcell.sbmlsim.api.common.SimulationStatus in project vcell by virtualcell.

the class VCellSimService method getStatus.

public SimulationStatus getStatus(SimulationHandle simHandle) throws ExecutableException {
    Gson gson = new Gson();
    Executable exe = new Executable(new String[] { command().getAbsolutePath(), scriptArgDashes + "simhandle", Long.toString(simHandle.remoteId), "status" });
    int[] expectedReturnCodes = new int[] { 0 };
    exe.start(expectedReturnCodes);
    SimulationStatus simStatus = gson.fromJson(exe.getStdoutString(), SimulationStatus.class);
    return simStatus;
}
Also used : SimulationStatus(org.vcell.sbmlsim.api.common.SimulationStatus) Gson(com.google.gson.Gson)

Aggregations

Gson (com.google.gson.Gson)2 SimulationStatus (org.vcell.sbmlsim.api.common.SimulationStatus)2 SimulationInfo (org.vcell.sbmlsim.api.common.SimulationInfo)1