Skip to content

Commit

Permalink
Fixed CIRDLES#589
Browse files Browse the repository at this point in the history
  • Loading branch information
bowring committed Feb 26, 2021
1 parent e71612d commit d44a50f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'java'
apply plugin: 'maven'

String mavenGroupId = 'org.cirdles'
String mavenVersion = '1.7.3'
String mavenVersion = '1.7.4'

sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.cirdles.squid.tasks.expressions.expressionTrees.ExpressionTree;
import org.cirdles.squid.tasks.expressions.expressionTrees.ExpressionTreeInterface;
import org.cirdles.squid.tasks.expressions.isotopes.ShrimpSpeciesNode;
import org.cirdles.squid.tasks.expressions.operations.Divide;
import org.cirdles.squid.tasks.expressions.spots.SpotFieldNode;
import org.cirdles.squid.tasks.expressions.variables.VariableNodeForSummary;

Expand All @@ -37,7 +36,6 @@
import static org.cirdles.squid.squidReports.squidReportColumns.SquidReportColumnInterface.formatBigDecimalForPublicationSigDigMode;
import static org.cirdles.squid.squidReports.squidReportTables.SquidReportTable.DEFAULT_COUNT_OF_SIGNIFICANT_DIGITS;
import static org.cirdles.squid.squidReports.squidReportTables.SquidReportTable.HEADER_ROW_COUNT;
import static org.cirdles.squid.tasks.expressions.builtinExpressions.BuiltInExpressionsDataDictionary.R204PB_206PB;

/**
* @author James F. Bowring, CIRDLES.org, and Earth-Time.org
Expand Down Expand Up @@ -121,11 +119,11 @@ public void initReportColumn(TaskInterface task) {
expressionNameCustom = "total_" + expressionName + "_cts_/sec";
}

amIsotopicRatio = false;
if (((ExpressionTree) expTree).getLeftET() instanceof ShrimpSpeciesNode) {
// Check for isotopic ratios
amIsotopicRatio = (((ExpressionTree) expTree).getOperation() instanceof Divide);
}
amIsotopicRatio = ((ExpressionTree) expTree).amIsotopicRatio();
// if (((ExpressionTree) expTree).getLeftET() instanceof ShrimpSpeciesNode) {
// // Check for isotopic ratios
// amIsotopicRatio = (((ExpressionTree) expTree).getOperation() instanceof Divide);
// }

// propose column headers by splitting on underscores in name
// row 0 is reserved for category displayname
Expand Down Expand Up @@ -180,7 +178,7 @@ public void initReportColumn(TaskInterface task) {

uncertaintyColumn = null;
if ((uncertaintyDirective.length() == 0)
&& expTree.builtAsValueModel()
&& ( expTree.builtAsValueModel() || amIsotopicRatio)
// && (!expressionName.toUpperCase().contains("PCT"))
// && (!expressionName.toUpperCase().contains("ERR"))
// && (!expressionName.toUpperCase().contains("CONCEN"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public class ExpressionTree
protected String uncertaintyDirective;

protected int index;

protected transient boolean hasNoTargetSpots;

public void setHasNoTargetSpots(boolean hasNoTargetSpots) {
Expand All @@ -137,7 +137,6 @@ public void setHasNoTargetSpots(boolean hasNoTargetSpots) {
public boolean doesHaveNoTargetSpots() {
return hasNoTargetSpots;
}


/**
*
Expand Down Expand Up @@ -468,6 +467,16 @@ public boolean amAnonymous() {
return name.compareTo(ANONYMOUS_NAME) == 0;
}

public boolean amIsotopicRatio() {
boolean retVal = false;
if (childrenET.size() > 1) {
retVal = (childrenET.get(0) instanceof ShrimpSpeciesNode)
&& (childrenET.get(1) instanceof ShrimpSpeciesNode)
&& (operation instanceof Divide);
}
return retVal;
}

/**
*
* @param xstream
Expand Down Expand Up @@ -572,18 +581,18 @@ public boolean isTypeFunction() {
public boolean isTypeFunctionOrOperation() {
return (operation instanceof Function) || (operation instanceof Operation);
}

/**
*
* @return true if this expressionTree is built as a ValueModel
*/
@Override
public boolean builtAsValueModel(){
public boolean builtAsValueModel() {
boolean retVal = false;
if (isTypeFunction()){
if (isTypeFunction()) {
retVal = operation.getColCount() > 1;
}

return retVal;
}

Expand Down

0 comments on commit d44a50f

Please sign in to comment.