use of org.vcell.util.DataAccessException in project vcell by virtualcell.
the class SimulationData method refreshLogFile.
/**
* This method was created in VisualAge.
*/
private synchronized void refreshLogFile() throws DataAccessException {
VCMongoMessage.sendTrace("SimulationData.refreshLogFile() <<ENTER>>");
//
try {
readLog(getLogFilePrivate());
} catch (FileNotFoundException e) {
} catch (IOException e) {
e.printStackTrace(System.out);
throw new DataAccessException(e.getMessage(), e);
} catch (SecurityException e) {
// Added because "new FileInputStream(...) throws security exception when file permissions wrong
e.printStackTrace(System.out);
throw new DataAccessException(e.getMessage(), e);
} catch (RuntimeException e) {
// log exceptions we are passing on
e.printStackTrace(System.out);
throw e;
}
VCMongoMessage.sendTrace("SimulationData.refreshLogFile() <<EXIT>>");
}
use of org.vcell.util.DataAccessException in project vcell by virtualcell.
the class SimulationData method refreshMeshFile.
/**
* This method was created in VisualAge.
*/
private synchronized void refreshMeshFile() throws DataAccessException, MathException {
//
// (re)read the log file if necessary
//
VCMongoMessage.sendTrace("SimulationData.refreshMeshFile() <<BEGIN>>");
try {
readMesh(getMeshFile(), getMembraneMeshMetricsFile());
VCMongoMessage.sendTrace("SimulationData.refreshMeshFile() <<EXIT normally>>");
} catch (FileNotFoundException e) {
VCMongoMessage.sendTrace("SimulationData.refreshMeshFile() <<EXIT-file not found>>");
} catch (Exception e) {
e.printStackTrace(System.out);
VCMongoMessage.sendTrace("SimulationData.refreshMeshFile() <<EXIT-IOException>>");
throw new DataAccessException(e.getMessage());
}
}
use of org.vcell.util.DataAccessException in project vcell by virtualcell.
the class SimulationData method refreshDataProcessingOutputInfo.
private void refreshDataProcessingOutputInfo(OutputContext outputContext) throws DataAccessException {
File dataProcessingOutputFile = getDataProcessingOutputSourceFileHDF5();
if (dataProcessingOutputInfo == null && !dataProcessingOutputFile.exists()) {
return;
}
AnnotatedFunction[] lastFunctions = (lastOutputContext == null ? null : lastOutputContext.getOutputFunctions());
AnnotatedFunction[] currentFunctions = (outputContext == null ? null : outputContext.getOutputFunctions());
boolean bFunctionsEqual = Compare.isEqualOrNull(lastFunctions, currentFunctions);
if (!bFunctionsEqual || dataProcessingOutputInfo == null || lastDataProcessingOutputInfoTime != dataProcessingOutputFile.lastModified()) {
lastDataProcessingOutputInfoTime = dataProcessingOutputFile.lastModified();
lastOutputContext = outputContext;
DataProcessingOutputInfoOP dataProcessingOutputInfoOP = new DataProcessingOutputInfoOP(vcDataId, false, outputContext);
try {
dataProcessingOutputInfo = (DataProcessingOutputInfo) DataSetControllerImpl.getDataProcessingOutput(dataProcessingOutputInfoOP, dataProcessingOutputFile);
} catch (Exception e) {
throw new DataAccessException(e.getMessage(), (e.getCause() == null ? e : e.getCause()));
}
}
}
use of org.vcell.util.DataAccessException in project vcell by virtualcell.
the class SimulationData method getODEDataFile.
/**
* This method was created in VisualAge.
* @return File
*/
private synchronized File getODEDataFile() throws DataAccessException {
refreshLogFile();
if (dataFilenames == null) {
throw new DataAccessException("ODE data filename not read from logfile");
}
File odeFile = amplistorHelper.getFile(dataFilenames[0]);
if (odeFile.exists()) {
return odeFile;
}
throw new DataAccessException("no results are available yet, please wait and try again...");
}
use of org.vcell.util.DataAccessException in project vcell by virtualcell.
the class SimulationData method getPDEDataSet.
/**
* This method was created by a SmartGuide.
* @return java.lang.String
* @param time double
*/
private synchronized DataSet getPDEDataSet(File pdeFile, double time) throws DataAccessException {
DataSet dataSet = new DataSet();
File zipFile = null;
try {
zipFile = getPDEDataZipFile(time);
} catch (DataAccessException ex) {
zipFile = null;
}
try {
dataSet.read(pdeFile, zipFile, amplistorHelper.solverDataType);
} catch (IOException ex) {
ex.printStackTrace();
throw new DataAccessException("data at time=" + time + " read error", ex);
}
return dataSet;
}
Aggregations