use of org.vcell.util.Issue in project vcell by virtualcell.
the class IssueTableModel method getComparator.
@Override
protected Comparator<Issue> getComparator(final int col, final boolean ascending) {
return new Comparator<Issue>() {
public int compare(Issue o1, Issue o2) {
VCDocument vcDocument = (issueManager != null) ? (issueManager.getVCDocument()) : null;
int scale = ascending ? 1 : -1;
switch(col) {
case COLUMN_DESCRIPTION:
{
Severity s1 = o1.getSeverity();
Severity s2 = o2.getSeverity();
if (s1 == s2) {
return scale * o1.getMessage().compareTo(o2.getMessage());
} else {
return scale * s1.compareTo(s2);
}
}
case COLUMN_URL:
{
String u1 = o1.getHyperlink();
String u2 = o2.getHyperlink();
return u1 != null ? u1.compareTo(u2) : -1;
}
case COLUMN_SOURCE:
return scale * getSourceObjectDescription(vcDocument, o1).compareTo(getSourceObjectDescription(vcDocument, o2));
case COLUMN_PATH:
return scale * getSourceObjectPathDescription(vcDocument, o1).compareTo(getSourceObjectPathDescription(vcDocument, o2));
}
return 0;
}
};
}
use of org.vcell.util.Issue in project vcell by virtualcell.
the class GeometrySpec method gatherIssues.
public void gatherIssues(IssueContext issueContext, Geometry geometry, List<Issue> issueVector) {
//
if (getDimension() > 0) {
VCImage argSampledImage = getSampledImage().getCurrentValue();
if (argSampledImage == null) {
return;
}
try {
//
// make sure that each sample was assigned to a SubVolume
//
int count = 0;
byte[] samples = argSampledImage.getPixels();
for (int i = 0; i < samples.length; i++) {
if (samples[i] == -1) {
count++;
}
}
if (count > 0) {
String errorMessage = "Invalid Geometry - " + count + " of " + samples.length + " samples of geometry domain didn't map to any subdomain";
Issue issue = new Issue(geometry, issueContext, IssueCategory.SubVolumeVerificationError, errorMessage, Issue.SEVERITY_ERROR);
issueVector.add(issue);
}
//
// make sure that each subvolume is resolved in the geometry
//
ArrayList<SubVolume> missingSubVolumeList = new ArrayList<SubVolume>();
SubVolume[] subVolumes = getSubVolumes();
for (int i = 0; i < subVolumes.length; i++) {
if (argSampledImage.getPixelClassFromPixelValue(subVolumes[i].getHandle()) == null) {
missingSubVolumeList.add(subVolumes[i]);
}
}
if (missingSubVolumeList.size() > 0) {
for (int i = 0; i < missingSubVolumeList.size(); i++) {
String errorMessage = "Subdomain '" + missingSubVolumeList.get(i).getName() + "' is not resolved in geometry domain";
Issue issue = new Issue(geometry, issueContext, IssueCategory.SubVolumeVerificationError, errorMessage, Issue.SEVERITY_ERROR);
issueVector.add(issue);
}
}
} catch (Exception ex) {
Issue issue = new Issue(geometry, issueContext, IssueCategory.SubVolumeVerificationError, ex.getMessage(), Issue.SEVERITY_ERROR);
issueVector.add(issue);
}
}
}
use of org.vcell.util.Issue in project vcell by virtualcell.
the class FeatureMapping method gatherIssues.
public void gatherIssues(IssueContext issueContext, List<Issue> issueVector) {
super.gatherIssues(issueContext, issueVector);
if (simulationContext.getGeometry().getDimension() == 0) {
if (!simulationContext.getGeometryContext().isAllSizeSpecifiedPositive()) {
String tooltip = "\nIn non-spatial application, size of structure '" + getStructure().getName() + "' must be assigned a positive value if referenced in the model.";
String message = "In non-spatial application, size of structure '" + getStructure().getName() + "' must be assigned a positive value.";
issueVector.add(new Issue(this, issueContext, IssueCategory.StructureMappingSizeParameterNotSet, message, Issue.SEVERITY_WARNING));
}
}
}
use of org.vcell.util.Issue in project vcell by virtualcell.
the class MembraneMapping method gatherIssues.
public void gatherIssues(IssueContext issueContext, List<Issue> issueVector) {
super.gatherIssues(issueContext, issueVector);
if (simulationContext.getGeometry().getDimension() == 0) {
if (!simulationContext.getGeometryContext().isAllSizeSpecifiedPositive()) {
String tooltip = "\nIn non-spatial application, size of structure '" + getStructure().getName() + "' must be assigned a positive value if referenced in the model.";
String message = "In non-spatial application, size of structure '" + getStructure().getName() + "' must be assigned a positive value.";
issueVector.add(new Issue(this, issueContext, IssueCategory.StructureMappingSizeParameterNotSet, message, Issue.SEVERITY_WARNING));
}
}
}
use of org.vcell.util.Issue in project vcell by virtualcell.
the class MicroscopeMeasurement method gatherIssues.
public void gatherIssues(IssueContext issueContext, List<Issue> issueVector) {
issueContext = issueContext.newChildContext(ContextType.MicroscopyMeasurement, this);
if (fluorescentSpecies.size() > 0) {
if (getConvolutionKernel() instanceof ProjectionZKernel && simulationContext.getGeometry().getDimension() != 3) {
Issue issue = new Issue(this, issueContext, IssueCategory.Microscope_Measurement_ProjectionZKernel_Geometry_3DWarning, "Z Projection is only supported in 3D spatial applications.", Issue.SEVERITY_ERROR);
issueVector.add(issue);
}
}
}
Aggregations