Skip to content

Commit

Permalink
Merge pull request #116 from bowring/lead
Browse files Browse the repository at this point in the history
Improvements for LAICPMS and Legacy UPb
  • Loading branch information
bowring authored Oct 3, 2016
2 parents 6008e02 + f688a27 commit 2bfaa8f
Show file tree
Hide file tree
Showing 49 changed files with 1,153 additions and 640 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<groupId>org.cirdles</groupId>
<artifactId>ET_Redux</artifactId>
<name>ET_Redux</name>
<version>3.6.6</version>
<version>3.6.7</version>
<description>Successor to U-Pb_Redux</description>
<url>https://cirdles.org</url>
<inceptionYear>2006</inceptionYear>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/earthtime/ETReduxFrame.form
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@
<Menu class="javax.swing.JMenu" name="aliquotsMenu">
<Properties>
<Property name="text" type="java.lang.String" value="Aliquots"/>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
</Menu>
<Menu class="javax.swing.JMenu" name="fractionsMenu">
Expand All @@ -409,7 +408,6 @@
<MenuItem class="javax.swing.JMenuItem" name="selectAllFractions_menuItem">
<Properties>
<Property name="text" type="java.lang.String" value="Select All Fractions"/>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="selectAllFractions_menuItemActionPerformed"/>
Expand All @@ -418,7 +416,6 @@
<MenuItem class="javax.swing.JMenuItem" name="deSelectAllFractions_menuItem">
<Properties>
<Property name="text" type="java.lang.String" value="De-select All Fractions"/>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deSelectAllFractions_menuItemActionPerformed"/>
Expand Down Expand Up @@ -840,6 +837,9 @@
<Color blue="fa" green="f2" red="ed" type="rgb"/>
</Property>
<Property name="locationByPlatform" type="boolean" value="true"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[1160, 750]"/>
</Property>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="menuBar" type="java.lang.String" value="mainMenuBar"/>
Expand Down
44 changes: 15 additions & 29 deletions src/main/java/org/earthtime/ETReduxFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -1012,8 +1012,7 @@ private void setUpNewSample(String sampleType, String sampleAnalysisType, String

// set up a new empty sample based on sampleType
theSample
= //
new Sample("NONE", sampleType, sampleAnalysisType, myState.getReduxPreferences().getDefaultSampleAnalysisPurpose(), isotopeStyle);
= new Sample("NONE", sampleType, sampleAnalysisType, myState.getReduxPreferences().getDefaultSampleAnalysisPurpose(), isotopeStyle);
SampleInterface.specializeNewSample(theSample);

// manageTheSample sets up the correct form and returns whether it was successful
Expand Down Expand Up @@ -1398,33 +1397,22 @@ public synchronized void setUpTheSample(boolean performReduction) {

private void buildAliquotsMenu() {
// aug 2010 provide aliquot management menu
boolean doActivate = (theSample.getActiveAliquots().size() > 0);
aliquotsMenu.removeAll();
aliquotsMenu.setEnabled(false);
fractionsMenu.setEnabled(false);
selectAllFractions_menuItem.setEnabled(false);
deSelectAllFractions_menuItem.setEnabled(false);
aliquotsMenu.setEnabled(doActivate);
fractionsMenu.setEnabled(doActivate);
selectAllFractions_menuItem.setEnabled(doActivate);
deSelectAllFractions_menuItem.setEnabled(doActivate);

theSample.getActiveAliquots().stream().map((a) -> {
theSample.getActiveAliquots().stream().forEach((a) -> {
JMenuItem menuItem = aliquotsMenu.add(new JMenuItem(a.getAliquotName()));
menuItem.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
editAliquotByNumber(((ReduxAliquotInterface) a).getAliquotNumber());
}
menuItem.addActionListener((java.awt.event.ActionEvent evt) -> {
editAliquotByNumber(((ReduxAliquotInterface) a).getAliquotNumber());
});
return a;
}).map((_item) -> {
aliquotsMenu.setEnabled(true);
return _item;
}).map((_item) -> {
fractionsMenu.setEnabled(true);
return _item;
}).map((_item) -> {
selectAllFractions_menuItem.setEnabled(true);
return _item;
}).forEach((_item) -> {
deSelectAllFractions_menuItem.setEnabled(true);
});

//forces menu update
pack();
}

private void customizeReduxSkin() {
Expand Down Expand Up @@ -1493,7 +1481,6 @@ public void updateReportTable(boolean performReduction, boolean inLiveMode, Stri
((SampleDateInterpretationsManager) sampleDateInterpDialog).setSample(theSample);
}

// updated with rescaling april 2016
try {
((SampleDateInterpretationsManager) sampleDateInterpDialog).refreshSampleDateInterpretations(false, inLiveMode);
} catch (Exception e) {
Expand Down Expand Up @@ -2023,6 +2010,7 @@ private void initComponents() {
setTitle("EARTHTIME Redux");
setBackground(new java.awt.Color(237, 242, 250));
setLocationByPlatform(true);
setPreferredSize(new java.awt.Dimension(1160, 750));
addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentResized(java.awt.event.ComponentEvent evt) {
formComponentResized(evt);
Expand Down Expand Up @@ -2589,13 +2577,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
mainMenuBar.add(sampleFileMenu);

aliquotsMenu.setText("Aliquots");
aliquotsMenu.setEnabled(false);
mainMenuBar.add(aliquotsMenu);

fractionsMenu.setText("Fractions");

selectAllFractions_menuItem.setText("Select All Fractions");
selectAllFractions_menuItem.setEnabled(false);
selectAllFractions_menuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
selectAllFractions_menuItemActionPerformed(evt);
Expand All @@ -2604,7 +2590,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
fractionsMenu.add(selectAllFractions_menuItem);

deSelectAllFractions_menuItem.setText("De-select All Fractions");
deSelectAllFractions_menuItem.setEnabled(false);
deSelectAllFractions_menuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
deSelectAllFractions_menuItemActionPerformed(evt);
Expand Down Expand Up @@ -3823,7 +3808,8 @@ private void editAliquot(SampleInterface sample, AliquotInterface aliquot) {
* @param aliquot
*/
public void editAliquotByProjectType(AliquotInterface aliquot) {
if (theSample.isSampleTypeProject() && !theSample.getSampleAnalysisType().equalsIgnoreCase("TRIPOLIZED")) {
if (theSample.isSampleTypeProject() //
&& !theSample.getSampleAnalysisType().equalsIgnoreCase("TRIPOLIZED")) {
// Project has a compiledSuperSample made up of actual projectSamples
// we need the actual sample associated with this aliquot
// this aliquot is a copy for compiled super sample and we need
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,7 @@ public long getCollectorDataFrequencyMillisecs() {
/**
* @return the dataActiveMap
*/
@Override
public boolean[] getDataActiveMap() {
return dataActiveMap;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,10 +708,23 @@ public void preparePanel(boolean doReScale, boolean inLiveMode) {
double overallMaxY = -Double.MAX_VALUE;
boolean atLeastOneStandard = true;

for (int f = 0; f < (fractionCountForHorizontalLayout); f++) {
if (Double.isFinite(rawDataModelViews[i][f].getMinY()) && Double.isFinite(rawDataModelViews[i][f].getMaxY())) {
overallMinY = Math.min(overallMinY, rawDataModelViews[i][f].getMinY());
overallMaxY = Math.max(overallMaxY, rawDataModelViews[i][f].getMaxY());
if (FRACTION_LAYOUT_VIEW_STYLE.equals(FractionLayoutViewStylesEnum.SESSION)) {
for (int f = 0; f < (fractionCountForHorizontalLayout); f++) {
if (Double.isFinite(rawDataModelViews[i][f].getMinY()) && Double.isFinite(rawDataModelViews[i][f].getMaxY())) {
overallMinY = Math.min(overallMinY, rawDataModelViews[i][f].getMinY());
overallMaxY = Math.max(overallMaxY, rawDataModelViews[i][f].getMaxY());
}
}
} else {
for (int f = 0; f < (fractionCountForHorizontalLayout); f++) {
if (Double.isFinite(rawDataModelViews[i][f].getMinY()) //
&& Double.isFinite(rawDataModelViews[i][f].getMaxY())//
&& !rawDataModelViews[i][f].isNotShownDueToBelowDetectionFlag()//
&& !((SAVED_DATA_USED_FOR_SCALING.equals(IncludedTypeEnum.INCLUDED)//
&& !rawDataModelViews[i][f].getTripoliFraction().isIncluded()))) {
overallMinY = Math.min(overallMinY, rawDataModelViews[i][f].getMinY());
overallMaxY = Math.max(overallMaxY, rawDataModelViews[i][f].getMaxY());
}
}
}

Expand Down Expand Up @@ -933,8 +946,7 @@ public void preparePanel(boolean doReScale, boolean inLiveMode) {
// TODO: dec 2012 check for missing ratio due to all belowDetection
if (rawDataModelViews[i][0] instanceof FitFunctionsOnRatioDataView) {
RawRatioNames rrName
= //
rawDataModelViews[i][0].getDataModel().getRawRatioModelName();
= rawDataModelViews[i][0].getDataModel().getRawRatioModelName();

((DataViewsOverlay) rawDataModelViewsOverlay).setFractionationDataModel(downholeFractionationDataModels.get(rrName));

Expand Down Expand Up @@ -972,7 +984,6 @@ public void preparePanel(boolean doReScale, boolean inLiveMode) {
AbstractRawDataView residualsYAxisLabel = new ResidualsYAxisLabel(//
rawDataModelViews[0][0], //
new Rectangle(//
//
1,//
i * (dataModelHeight + HEIGHT_OF_OVERLAY_XAXIS_PANES + residualsHeight + verticalGraphSeparation) + topMargin + dataModelHeight + HEIGHT_OF_OVERLAY_XAXIS_PANES, //
tripoliSessionRawDataViewYAxis.getWidth() - 1, //
Expand Down Expand Up @@ -1008,30 +1019,32 @@ public void preparePanel(boolean doReScale, boolean inLiveMode) {
}
}

// establish graphWidth
if (FRACTION_LAYOUT_VIEW_STYLE.equals(FractionLayoutViewStylesEnum.GRAPH)) {
minX = tripoliFractions.first().getPeakTimeStamp();
maxX = tripoliFractions.last().getPeakTimeStamp() //
+ (rawDataModelViews[0][0].getRangeX_Display() * rawDataModelViews[0][0].getDataModel().getCollectorDataFrequencyMillisecs());
graphWidth = (int) ((maxX - minX) * dataModelWidth //
/ rawDataModelViews[0][0].getRangeX_Display() / rawDataModelViews[0][0].getDataModel().getCollectorDataFrequencyMillisecs());

} else if (FRACTION_LAYOUT_VIEW_STYLE.equals(FractionLayoutViewStylesEnum.OVERLAY)) {
minX = 0;
maxX = dataModelWidth + horizontalGraphSeparation + WIDTH_OF_FIT_FUNCTION_PANES;
graphWidth = (int) (maxX - minX);

} else if (FRACTION_LAYOUT_VIEW_STYLE.equals(FractionLayoutViewStylesEnum.SESSION)) {
minX = 0;
maxX = fractionCountForHorizontalLayout * (sessionModelWidth + horizontalGraphSeparation);
graphWidth = (int) (maxX - minX);
graphWidth += countOfLocalYAxisPanes * WIDTH_OF_LOCAL_YAXIS_PANES + countOfInterceptFitFunctionsPresentationPanes * WIDTH_OF_FIT_FUNCTION_PANES;

} else {
minX = 0;
maxX = fractionCountForHorizontalLayout * (dataModelWidth + horizontalGraphSeparation);
graphWidth = (int) (maxX - minX);
graphWidth += countOfLocalYAxisPanes * WIDTH_OF_LOCAL_YAXIS_PANES + countOfInterceptFitFunctionsPresentationPanes * WIDTH_OF_FIT_FUNCTION_PANES;
// establish graphWidth
switch (FRACTION_LAYOUT_VIEW_STYLE) {
case GRAPH:
minX = tripoliFractions.first().getPeakTimeStamp();
maxX = tripoliFractions.last().getPeakTimeStamp() //
+ (rawDataModelViews[0][0].getRangeX_Display() * rawDataModelViews[0][0].getDataModel().getCollectorDataFrequencyMillisecs());
graphWidth = (int) ((maxX - minX) * dataModelWidth //
/ rawDataModelViews[0][0].getRangeX_Display() / rawDataModelViews[0][0].getDataModel().getCollectorDataFrequencyMillisecs());
break;
case OVERLAY:
minX = 0;
maxX = dataModelWidth + horizontalGraphSeparation + WIDTH_OF_FIT_FUNCTION_PANES;
graphWidth = (int) (maxX - minX);
break;
case SESSION:
minX = 0;
maxX = fractionCountForHorizontalLayout * (sessionModelWidth + horizontalGraphSeparation);
graphWidth = (int) (maxX - minX);
graphWidth += countOfLocalYAxisPanes * WIDTH_OF_LOCAL_YAXIS_PANES + countOfInterceptFitFunctionsPresentationPanes * WIDTH_OF_FIT_FUNCTION_PANES;
break;
default:
minX = 0;
maxX = fractionCountForHorizontalLayout * (dataModelWidth + horizontalGraphSeparation);
graphWidth = (int) (maxX - minX);
graphWidth += countOfLocalYAxisPanes * WIDTH_OF_LOCAL_YAXIS_PANES + countOfInterceptFitFunctionsPresentationPanes * WIDTH_OF_FIT_FUNCTION_PANES;
break;
}

// create vertical fraction panes for layout on x = time axis ********************************************************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ public void preparePanel(boolean doReScale, boolean inLiveMode) {
boolean showAll = showIncludedDataPoints.equals(IncludedTypeEnum.ALL);
// rework logic April 2016
for (int i = 0; i < myOnPeakData.length; i++) {
if ((Double.isFinite(myOnPeakData[i])) && (showAll || myDataActiveMap[i])) {
if ((Double.isFinite(myOnPeakData[i])) //
&& (showAll || myDataActiveMap[i])) {
minY = Math.min(minY, myOnPeakData[i]);
maxY = Math.max(maxY, myOnPeakData[i]);
}
Expand Down
Loading

0 comments on commit 2bfaa8f

Please sign in to comment.