Skip to content

Commit

Permalink
Merge pull request #59 from bowring/dibbs
Browse files Browse the repository at this point in the history
U-series (DIBBs) date math completed for gravimetric tracer.
  • Loading branch information
bowring committed Feb 27, 2016
2 parents 683771c + 54c0864 commit ddd9f76
Show file tree
Hide file tree
Showing 21 changed files with 513 additions and 248 deletions.
7 changes: 1 addition & 6 deletions src/main/java/org/earthtime/ETReduxFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -3386,15 +3386,10 @@ private void helpMenuMenuDeselected(javax.swing.event.MenuEvent evt) {//GEN-FIRS
private void interpretSampleDates_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_interpretSampleDates_buttonActionPerformed
// Dec 2015 experiment with customization of skins
if (theSample.getIsotopeStyle().compareToIgnoreCase("UTh") == 0) {
TopsoilEvolutionPlot topsoilEvolutionChart = new TopsoilEvolutionPlot();
TopsoilEvolutionPlot topsoilEvolutionChart = TopsoilEvolutionPlot.getInstance();
topsoilEvolutionChart.setSelectedFractions(theSample.getFractions());
topsoilEvolutionChart.preparePanel();
topsoilEvolutionChart.showPanel();

// TopsoilEvolutionPlot topsoilEvolutionChart2 = new TopsoilEvolutionPlot();
// topsoilEvolutionChart2.setSelectedFractions(theSample.getFractions());
// topsoilEvolutionChart2.preparePanel();
// topsoilEvolutionChart2.showPanel();
} else {

manageSampleDateInterpretation(//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import org.earthtime.Tripoli.sessions.TripoliSessionFractionationCalculatorInterface;
import org.earthtime.Tripoli.sessions.TripoliSessionInterface;
import org.earthtime.UPb_Redux.ReduxConstants;
import org.earthtime.UPb_Redux.dialogs.sessionManagers.SessionAnalysisWorkflowManagerInterface;
import org.earthtime.UPb_Redux.fractions.FractionsFilterInterface;
import org.earthtime.dataDictionaries.DataPresentationModeEnum;
import org.earthtime.dataDictionaries.FractionLayoutViewStylesEnum;
Expand Down Expand Up @@ -128,6 +129,7 @@ public class TripoliSessionRawDataView extends AbstractRawDataView implements Tr
private final JLayeredPane tripoliSessionDataHeader_pane;
private final JLayeredPane tripoliSessionDataControls_pane;
private AbstractRawDataView dataPresentationModeChooserPanel;
private SessionAnalysisWorkflowManagerInterface sessionAnalysisWorkflowManager;

/**
*
Expand All @@ -142,22 +144,22 @@ public class TripoliSessionRawDataView extends AbstractRawDataView implements Tr
* @param tripoliSessionDataHeader_pane
* @param tripoliSessionDataControls_pane
* @param scrollBounds
* @param sessionAnalysisWorkflowManager the value of sessionAnalysisWorkflowManager
*/
public TripoliSessionRawDataView(//
ETReduxFrame myUPbReduxFrame,
TripoliSessionInterface tripoliSession,//
Constructor dataModelViewConstructor,//
Method rawDataSourceMethod,//
ETReduxFrame myUPbReduxFrame, //
TripoliSessionInterface tripoliSession, //
Constructor dataModelViewConstructor, Method rawDataSourceMethod, //
FractionLayoutViewStylesEnum fractionLayoutViewStyle, //
JSlider yAxisZoomSlider, //
JSlider xAxisZoomSlider, //
JLayeredPane tripoliSessionRawDataViewYAxis,//
JSlider yAxisZoomSlider, JSlider xAxisZoomSlider, //
JLayeredPane tripoliSessionRawDataViewYAxis, //
JLayeredPane tripoliSessionDataHeader_pane, //
JLayeredPane tripoliSessionDataControls_pane,//
Rectangle scrollBounds) {
Rectangle scrollBounds, //
SessionAnalysisWorkflowManagerInterface sessionAnalysisWorkflowManager) {
super(scrollBounds);

uPbReduxFrame = myUPbReduxFrame;
this.uPbReduxFrame = myUPbReduxFrame;
this.tripoliSession = tripoliSession;
this.fractionSelectionType = FractionSelectionTypeEnum.STANDARD;
this.fractionIncludedType = IncludedTypeEnum.ALL;
Expand Down Expand Up @@ -186,6 +188,8 @@ public TripoliSessionRawDataView(//
this.zoomSlidersIndependent = true;

this.sessionFractionationCalculator = null;

this.sessionAnalysisWorkflowManager = sessionAnalysisWorkflowManager;

setBackground(new Color(204, 204, 204));

Expand Down Expand Up @@ -371,6 +375,7 @@ public void stateChanged(ChangeEvent e) {
theOtherSlider.setValue(value);
}
((AbstractRawDataView) sampleSessionDataView).refreshPanel();
sessionAnalysisWorkflowManager.revalidateScrollPane();
}
}
}
Expand Down Expand Up @@ -411,6 +416,7 @@ public void stateChanged(ChangeEvent e) {
theOtherSlider.setValue(value);
}
((AbstractRawDataView) sampleSessionDataView).refreshPanel();
sessionAnalysisWorkflowManager.revalidateScrollPane();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,19 @@ protected SortedSet<TripoliFraction> loadRawDataFile(//
SwingWorker loadDataTask, boolean usingFullPropagation, int leftShadeCount, int ignoreFirstFractions) {

SortedSet myTripoliFractions = new TreeSet<>();
PrawnFile prawnFile = null;
PrawnFile prawnFile;

// try {
// remote copy of example file
java.net.URL url;
try {
// remote copy of example file
java.net.URL url = null;
url = new URL("https://raw.githubusercontent.com/bowring/XSD/master/SHRIMP/EXAMPLE_100142_G6147_10111109.43_10.33.37%20AM.xml");

JAXBContext jaxbContext = JAXBContext.newInstance(PrawnFile.class);
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
prawnFile = (PrawnFile) jaxbUnmarshaller.unmarshal(url);// url);
// show some progress
loadDataTask.firePropertyChange("progress", 0, 10);
prawnFile = (PrawnFile) jaxbUnmarshaller.unmarshal(url);

// send name to project
loadDataTask.firePropertyChange("projectName", "", prawnFile.getMount());
Expand All @@ -174,7 +177,7 @@ protected SortedSet<TripoliFraction> loadRawDataFile(//
if (loadDataTask.isCancelled()) {
break;
}
loadDataTask.firePropertyChange("progress", 0, ((100 * f) / prawnFile.getRuns()));
loadDataTask.firePropertyChange("progress", 10, ((90 * f) / prawnFile.getRuns()));

PrawnFile.Run runFraction = prawnFile.getRun().get(f);

Expand All @@ -188,6 +191,7 @@ protected SortedSet<TripoliFraction> loadRawDataFile(//
if (myTripoliFractions.isEmpty()) {
myTripoliFractions = null;
}

} catch (JAXBException | MalformedURLException jAXBException) {
JOptionPane.showMessageDialog(
null,
Expand Down Expand Up @@ -267,10 +271,10 @@ private TripoliFraction processRunFraction(PrawnFile.Run runFraction) {

massSpec.processFractionRawRatiosII(//
backgroundAcquisitions, peakAcquisitions, true, tripoliFraction);

// supply calculated variances
((ShrimpSetupUPb)massSpec).initializeVariances(peakAcquisitionsVariances);
((ShrimpSetupUPb) massSpec).initializeVariances(peakAcquisitionsVariances);

tripoliFraction.shadeDataActiveMapLeft(0);
System.out.println("\n**** SHRIMP FractionID " + fractionID + " refMat? " + tripoliFraction.isStandard() + " <<<<<<<<<<<<<<<<<<\n");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import javax.swing.JLayeredPane;
import javax.swing.JPanel;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import org.earthtime.UPb_Redux.user.ReduxPersistentState;
import org.earthtime.archivingTools.GeochronAliquotManager;
import org.earthtime.archivingTools.IEDACredentialsValidator;
Expand Down Expand Up @@ -151,17 +150,12 @@ private void initSamplesDisplay() {
aliquotsLayeredPane.setPreferredSize(new Dimension(1100, topMarginForSampleDetails + (row + 1) * 100));
aliquotsLayeredPane.validate();

instructionsTextPane.addHyperlinkListener(new HyperlinkListener() {
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
if (Desktop.isDesktopSupported()) {
try {
Desktop.getDesktop().browse(e.getURL().toURI());
} catch (IOException | URISyntaxException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
instructionsTextPane.addHyperlinkListener((HyperlinkEvent e) -> {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
if (Desktop.isDesktopSupported()) {
try {
Desktop.getDesktop().browse(e.getURL().toURI());
} catch (IOException | URISyntaxException e1) {
}
}
}
Expand Down Expand Up @@ -322,7 +316,7 @@ private void validateGeochronAndSesarCredentials_buttonActionPerformed(java.awt.
}//GEN-LAST:event_validateGeochronAndSesarCredentials_buttonActionPerformed

private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
parent.loadAndShowReportTableData();
//parent.loadAndShowReportTableData();
}//GEN-LAST:event_formWindowClosing

// Variables declaration - do not modify//GEN-BEGIN:variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ public interface SessionAnalysisWorkflowManagerInterface {
*
*/
public void setupTripoliSessionRawDataView();

public void revalidateScrollPane();
}
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public void setupTripoliSessionRawDataView() {

// create data viewing pane
tripoliSessionRawDataView = new TripoliSessionRawDataView( //
//
uPbReduxFrame,//
tripoliSession,//
dataModelViewConstructorFactory(RawIntensitiesDataView.class.getName()),//
Expand All @@ -193,7 +194,7 @@ public void setupTripoliSessionRawDataView() {
tripoliSessionRawDataViewYAxis, //
tripoliSessionDataHeader_pane,//
tripoliSessionDataControls_pane, //
tripoliSessionDataView_scrollPane.getBounds());
tripoliSessionDataView_scrollPane.getBounds(), this);

// set sampleFractionationCalculator
((TripoliSessionRawDataView) tripoliSessionRawDataView).setSessionFractionationCalculator(tripoliSession);
Expand Down Expand Up @@ -1748,4 +1749,9 @@ public void setTripoliSession(TripoliSessionInterface tripoliSession) {
this.tripoliSession = tripoliSession;
}

@Override
public void revalidateScrollPane() {
tripoliSessionDataView_scrollPane.revalidate();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ public void setupTripoliSessionRawDataView() {

// create data viewing pane
tripoliSessionRawDataView = new TripoliSessionRawDataView( //
//
uPbReduxFrame,//
tripoliSession,//
dataModelViewConstructorFactory(RawIntensitiesDataView.class.getName()),//
Expand All @@ -194,7 +195,7 @@ public void setupTripoliSessionRawDataView() {
tripoliSessionRawDataViewYAxis, //
tripoliSessionDataHeader_pane,//
tripoliSessionDataControls_pane, //
tripoliSessionDataView_scrollPane.getBounds());
tripoliSessionDataView_scrollPane.getBounds(), this);

// set sampleFractionationCalculator
((TripoliSessionRawDataView) tripoliSessionRawDataView).setSessionFractionationCalculator(tripoliSession);
Expand Down Expand Up @@ -1752,4 +1753,9 @@ public void setTripoliSession(TripoliSessionInterface tripoliSession) {
this.tripoliSession = tripoliSession;
}

@Override
public void revalidateScrollPane() {
tripoliSessionDataView_scrollPane.revalidate();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private ReportColumnInterface SetupReportColumn(int index, String[][] specs) {
String displayName1 = specs[index][0];
ReportColumnInterface retVal = new ReportColumn(//
displayName1, //specs[index][0], // displayname1
specs[index][1], // displayname2
specs[index][1].equalsIgnoreCase("delta") ? " \u03B4" : specs[index][1], // displayname2
specs[index][2], // displayname3
index, // positionIndex
specs[index][3], // units
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ public void marshal(Object value, HierarchicalStreamWriter writer,
writer.endNode();

writer.startNode("displayName2");
writer.setValue(reportColumn.getDisplayName2());
String displayName2 = reportColumn.getDisplayName2();
// test for delta
if (displayName2.contains("\u03B4")) {
writer.setValue("LOWERCASEDELTA");
} else {
writer.setValue(reportColumn.getDisplayName2());
}
writer.endNode();

writer.startNode("displayName3");
Expand All @@ -118,16 +124,16 @@ public void marshal(Object value, HierarchicalStreamWriter writer,
if (reportColumn.getUncertaintyColumn() != null) {
ReportColumnInterface myReportColumn = reportColumn.getUncertaintyColumn();
// repaired jan 2016 to restore report columns after serialization
String displayName2 = myReportColumn.getDisplayName2();
displayName2 = myReportColumn.getDisplayName2();
String displayName3 = myReportColumn.getDisplayName3();

if (displayName3.contains("%")) {
myReportColumn.setDisplayName3("PLUSMINUS2SIGMA%");
} else {
myReportColumn.setDisplayName2("PLUSMINUS2SIGMA");
}
context.convertAnother(reportColumn.getUncertaintyColumn());

// restore
myReportColumn.setDisplayName2(displayName2);
myReportColumn.setDisplayName3(displayName3);
Expand Down Expand Up @@ -196,7 +202,13 @@ public Object unmarshal(HierarchicalStreamReader reader,
reader.moveUp();

reader.moveDown();
reportColumn.setDisplayName2(reader.getValue());
String displayName2 = reader.getValue();
// test for delta
if (displayName2.contains("LOWERCASEDELTA")) {
reportColumn.setDisplayName2(" \u03B4");
} else {
reportColumn.setDisplayName2(displayName2);
}
reader.moveUp();

reader.moveDown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class ReportSettings implements
* version number is advanced so that any existing analysis will update its
* report models upon opening in ET_Redux.
*/
private static transient int CURRENT_VERSION_REPORT_SETTINGS = 327;
private static transient int CURRENT_VERSION_REPORT_SETTINGS = 338;

// Fields
private String name;
Expand Down Expand Up @@ -96,7 +96,7 @@ public ReportSettings(String name, String isotopeStyle) {
"Dates",
isotypeStyleIsUPb
? ReportSpecifications.ReportCategory_Dates//
: ReportSpecifications.ReportCategory_Dates, isotypeStyleIsUPb);
: ReportSpecifications.ReportCategory_DatesUTh, true);

this.datesPbcCorrCategory
= new ReportCategory(//
Expand Down Expand Up @@ -560,6 +560,7 @@ public ArrayList<ReportCategoryInterface> getReportCategories() {
/**
* @return the reportSettingsXMLSchemaURL
*/
@Override
public String getReportSettingsXMLSchemaURL() {
return reportSettingsXMLSchemaURL;
}
Expand Down
Loading

0 comments on commit ddd9f76

Please sign in to comment.