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);
}
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;
}
Aggregations