@@ -166,7 +166,7 @@ public class Task implements TaskInterface, Serializable, XMLSerializerInterface
166
166
protected ShrimpDataFileInterface prawnFile ;
167
167
protected CalamariReportsEngine reportsEngine ;
168
168
protected boolean changed ;
169
- protected boolean useCalculatedAv_ParentElement_ConcenConst ;
169
+ protected boolean useCalculatedAvParentElementConcenConst ;
170
170
protected IndexIsoptopesEnum selectedIndexIsotope ;
171
171
// next 7 fields used to track user's choice of displayed options in mass audits
172
172
protected List <MassStationDetail > massMinuends ;
@@ -279,7 +279,7 @@ public Task(String name, ShrimpDataFileInterface prawnFile, CalamariReportsEngin
279
279
this .changed = true ;
280
280
SquidProject .setProjectChanged (true );
281
281
282
- this .useCalculatedAv_ParentElement_ConcenConst = false ;
282
+ this .useCalculatedAvParentElementConcenConst = false ;
283
283
284
284
this .massMinuends = new ArrayList <>();
285
285
this .massSubtrahends = new ArrayList <>();
@@ -355,7 +355,7 @@ public boolean synchronizeTaskVersion() throws SquidException {
355
355
}
356
356
if (taskSquidVersion .compareTo (Squid .VERSION ) != 0 ) {
357
357
taskSquidVersion = Squid .VERSION ;
358
- updateTask ();
358
+ updateTask (true );
359
359
retVal = true ;
360
360
}
361
361
@@ -370,7 +370,6 @@ public List<ParametersModel> verifySquidLabDataParameters() throws SquidExceptio
370
370
ParametersModel physConst = getPhysicalConstantsModel ();
371
371
ParametersModel commonPbMod = getCommonPbModel ();
372
372
373
- // SquidLabData squidLabData = SquidLabData.getExistingSquidLabData();
374
373
if (physConst == null ) {
375
374
setPhysicalConstantsModel (squidLabData .getPhysConstDefault ());
376
375
} else if (!squidLabData .getPhysicalConstantsModels ().contains (physConst )) {
@@ -450,7 +449,8 @@ public void updateTaskFromTaskDesign(TaskDesign taskDesign, boolean taskSkeleton
450
449
methodName .replaceFirst ("is" , "set" ),
451
450
gettersAndSetters [i ].getReturnType ()).invoke (this , gettersAndSetters [i ].invoke (taskDesign ));
452
451
}
453
- } catch (NoSuchMethodException | IllegalArgumentException | IllegalAccessException | InvocationTargetException e ) {
452
+ } catch (NoSuchMethodException | IllegalArgumentException | IllegalAccessException |
453
+ InvocationTargetException e ) {
454
454
System .out .println (">>> " + methodName + " " + e .getMessage ());
455
455
}
456
456
}
@@ -543,7 +543,8 @@ public void updateTaskDesignFromTask(TaskDesign taskDesign, boolean includeCusto
543
543
methodName );
544
544
methSetPref .invoke (taskDesign , methGetTask .invoke (this ));
545
545
}
546
- } catch (NoSuchMethodException | IllegalArgumentException | IllegalAccessException | InvocationTargetException e ) {
546
+ } catch (NoSuchMethodException | IllegalArgumentException | IllegalAccessException |
547
+ InvocationTargetException e ) {
547
548
System .out .println (">>> " + methodName + " " + e .getMessage ());
548
549
}
549
550
}
@@ -1163,9 +1164,7 @@ public void setupSquidSessionSkeleton()
1163
1164
@ Override
1164
1165
public void updateRatioNames (String [] ratioNames ) throws SquidException {
1165
1166
this .ratioNames .clear ();
1166
- for (String rn : ratioNames ) {
1167
- this .ratioNames .add (rn );
1168
- }
1167
+ Collections .addAll (this .ratioNames , ratioNames );
1169
1168
1170
1169
populateTableOfSelectedRatiosFromRatiosList ();
1171
1170
@@ -1315,9 +1314,7 @@ private void reorderExpressions() {
1315
1314
}
1316
1315
1317
1316
taskExpressionsOrdered .clear ();
1318
- for (Expression listedExp : expArray ) {
1319
- taskExpressionsOrdered .add (listedExp );
1320
- }
1317
+ Collections .addAll (taskExpressionsOrdered , expArray );
1321
1318
}
1322
1319
1323
1320
/**
@@ -1436,7 +1433,7 @@ public ExpressionTreeInterface retrieveAliasedExpression(ExpressionTreeInterface
1436
1433
&& !((VariableNodeForSummary ) lookupExpTree ).isUsesArrayIndex ()) {
1437
1434
aliasedExpTree = getExpressionByName (lookupExpTree .getName ()).getExpressionTree ();
1438
1435
}
1439
- } else if ((lookupExpTree instanceof VariableNodeForIsotopicRatios ) && (((ExpressionTree ) aliasedExpTree ).getOperation () instanceof Value )){
1436
+ } else if ((lookupExpTree instanceof VariableNodeForIsotopicRatios ) && (((ExpressionTree ) aliasedExpTree ).getOperation () instanceof Value )) {
1440
1437
aliasedExpTree = namedExpressionsMap .get (lookupExpTree .getName ());
1441
1438
}
1442
1439
}
@@ -1538,20 +1535,17 @@ private void updateRefMatCalibConstWMeanExpression(String wmWxpressionName, bool
1538
1535
wmExp .setExcelExpressionString (wmExp .getExcelExpressionString ()
1539
1536
.replaceFirst ("\\ s*,\\ s*(TRUE|FALSE)\\ s*,\\ s*" ,
1540
1537
"," + String .valueOf (!squidAllowsAutoExclusionOfSpots ).toUpperCase (Locale .ENGLISH ) + "," ));
1541
- completeUpdateRefMatCalibConstWMeanExpressions (wmExp );
1542
- }
1543
- }
1544
1538
1545
- private void completeUpdateRefMatCalibConstWMeanExpressions (Expression listedExp ) {
1546
- listedExp .parseOriginalExpressionStringIntoExpressionTree (namedExpressionsMap );
1547
- listedExp .getExpressionTree ().setSquidSpecialUPbThExpression (true );
1548
- listedExp .getExpressionTree ().setSquidSwitchSTReferenceMaterialCalculation (true );
1549
- listedExp .getExpressionTree ().setSquidSwitchSCSummaryCalculation (true );
1539
+ wmExp .parseOriginalExpressionStringIntoExpressionTree (namedExpressionsMap );
1540
+ wmExp .getExpressionTree ().setSquidSpecialUPbThExpression (true );
1541
+ wmExp .getExpressionTree ().setSquidSwitchSTReferenceMaterialCalculation (true );
1542
+ wmExp .getExpressionTree ().setSquidSwitchSCSummaryCalculation (true );
1550
1543
1551
- // Aug 2018 change logic to clear the spots list now that task manager has checkbox for auto reject
1552
- SpotSummaryDetails spotSummaryDetails = taskExpressionsEvaluationsPerSpotSet .get (listedExp .getName ());
1553
- if (spotSummaryDetails != null ) {
1554
- spotSummaryDetails .rejectNone ();
1544
+ // Aug 2018 change logic to clear the spots list now that task manager has checkbox for auto reject
1545
+ SpotSummaryDetails spotSummaryDetails = taskExpressionsEvaluationsPerSpotSet .get (wmExp .getName ());
1546
+ if ((spotSummaryDetails != null ) && squidAllowsAutoExclusionOfSpots ) {
1547
+ spotSummaryDetails .rejectNone ();
1548
+ }
1555
1549
}
1556
1550
}
1557
1551
@@ -1623,10 +1617,10 @@ public void resetMassStationGraphViews() {
1623
1617
@ Override
1624
1618
public void applyTaskIsotopeLabelsToMassStationsAndUpdateTask () throws SquidException {
1625
1619
applyTaskIsotopeLabelsToMassStations ();
1626
- updateTask ();
1620
+ updateTask (false );
1627
1621
}
1628
1622
1629
- private void updateTask () throws SquidException {
1623
+ private void updateTask (boolean customizeTaskExpressions ) throws SquidException {
1630
1624
changed = true ;
1631
1625
1632
1626
// Sept 2020 - need to comb out bad ratios accidentally introduced
@@ -1640,7 +1634,7 @@ private void updateTask() throws SquidException {
1640
1634
ratioNames .remove (ratio );
1641
1635
}
1642
1636
1643
- applyDirectives ();
1637
+ applyDirectives (customizeTaskExpressions );
1644
1638
1645
1639
}
1646
1640
@@ -1740,7 +1734,7 @@ private void alignTaskMassStationsWithPrawnFile() {
1740
1734
for (int i = 0 ; i < nominalMasses .size (); i ++) {// String taskIsotopeLabel : nominalMasses) {
1741
1735
String taskIsotopeLabel = nominalMasses .get (i );
1742
1736
boolean matched = false ;
1743
- int intTaskIsotopeLabel = new BigDecimal (taskIsotopeLabel ).add (new BigDecimal (0.5 )).intValue ();
1737
+ int intTaskIsotopeLabel = new BigDecimal (taskIsotopeLabel ).add (new BigDecimal (" 0.5" )).intValue ();
1744
1738
for (Map .Entry <Integer , MassStationDetail > entry : mapOfIndexToMassStationDetails .entrySet ()) {
1745
1739
if (!matched ) {
1746
1740
int intPrawnIsoptopeLabel = new BigDecimal (entry .getValue ().getIsotopeLabel ()).setScale (0 , RoundingMode .HALF_EVEN ).intValue ();// Integer.parseInt(entry.getValue().getIsotopeLabel());
@@ -1992,7 +1986,7 @@ public List<ShrimpFractionExpressionInterface> processRunFractions(ShrimpDataFil
1992
1986
concentrationReferenceMaterialSpots = new ArrayList <>();
1993
1987
unknownSpots = new ArrayList <>();
1994
1988
boolean firstReferenceMaterial = true ;
1995
- long baseTimeOfFirstRefMatForCalcHoursField = 0l ;
1989
+ long baseTimeOfFirstRefMatForCalcHoursField = 0L ;
1996
1990
int refMatSpotIndex = 1 ;
1997
1991
for (ShrimpFractionExpressionInterface spot : shrimpFractions ) {
1998
1992
// spots that are concentrationReferenceMaterialModel will also be in one of the other two buckets
@@ -2282,11 +2276,12 @@ public void evaluateExpressionForSpotSet(
2282
2276
}
2283
2277
2284
2278
// if the spotsForExpression are the same, then preserve list of indices of rejected
2285
- // otherwise reset the list of indices to empty
2286
- if (!spotSummaryDetails .getSelectedSpots ().equals (spotsForExpression )) {
2279
+ // otherwise reset the list of indices
2280
+ // issue #729 reworked logic here
2281
+ if (!SpotSummaryDetails .compareTwoSpotLists (spotSummaryDetails .getSelectedSpots (), spotsForExpression )) {
2287
2282
spotSummaryDetails .setRejectedIndices (new boolean [spotsForExpression .size ()]);
2288
- spotSummaryDetails .setSelectedSpots (spotsForExpression );
2289
2283
}
2284
+ spotSummaryDetails .setSelectedSpots (spotsForExpression );
2290
2285
2291
2286
if (((expressionTree instanceof ConstantNode ) || ((ExpressionTree ) expressionTree ).getOperation ().isScalarResult ())
2292
2287
&& !expressionTree .isRootExpressionTree ()) {
@@ -3368,20 +3363,20 @@ public void setReportsEngine(CalamariReportsEngine reportsEngine) {
3368
3363
}
3369
3364
3370
3365
/**
3371
- * @return the useCalculatedAv_ParentElement_ConcenConst
3366
+ * @return the useCalculatedAvParentElementConcenConst
3372
3367
*/
3373
3368
@ Override
3374
- public boolean isUseCalculatedAv_ParentElement_ConcenConst () {
3375
- return useCalculatedAv_ParentElement_ConcenConst ;
3369
+ public boolean isUseCalculatedAvParentElementConcenConst () {
3370
+ return useCalculatedAvParentElementConcenConst ;
3376
3371
}
3377
3372
3378
3373
/**
3379
- * @param useCalculatedAv_ParentElement_ConcenConst the
3380
- * useCalculatedAv_ParentElement_ConcenConst to set
3374
+ * @param useCalculatedAvParentElementConcenConst the
3375
+ * useCalculatedAvParentElementConcenConst to set
3381
3376
*/
3382
3377
@ Override
3383
- public void setUseCalculatedAv_ParentElement_ConcenConst (boolean useCalculatedAv_ParentElement_ConcenConst ) {
3384
- this .useCalculatedAv_ParentElement_ConcenConst = useCalculatedAv_ParentElement_ConcenConst ;
3378
+ public void setUseCalculatedAvParentElementConcenConst (boolean useCalculatedAvParentElementConcenConst ) {
3379
+ this .useCalculatedAvParentElementConcenConst = useCalculatedAvParentElementConcenConst ;
3385
3380
}
3386
3381
3387
3382
/**
@@ -3867,7 +3862,7 @@ public int hashCode() {
3867
3862
namedExpressionsMap , namedOvercountExpressionsMap , namedConstantsMap , namedParametersMap , namedSpotLookupFieldsMap , shrimpFractions ,
3868
3863
referenceMaterialSpots , concentrationReferenceMaterialSpots , unknownSpots ,
3869
3864
mapOfUnknownsBySampleNames , prawnChanged , taskExpressionsEvaluationsPerSpotSet ,
3870
- prawnFile , reportsEngine , changed , useCalculatedAv_ParentElement_ConcenConst ,
3865
+ prawnFile , reportsEngine , changed , useCalculatedAvParentElementConcenConst ,
3871
3866
selectedIndexIsotope , massMinuends , massSubtrahends , showTimeNormalized ,
3872
3867
showPrimaryBeam , showQt1y , showQt1z , squidAllowsAutoExclusionOfSpots ,
3873
3868
extPErrU , extPErrTh , physicalConstantsModel , referenceMaterialModel , commonPbModel ,
0 commit comments