From b4fd307b9d62f634e32de4923a5dfb9eda48cf68 Mon Sep 17 00:00:00 2001 From: x03daop Date: Tue, 6 Sep 2016 10:51:37 +0200 Subject: [PATCH] Closedown --- devices/ps1img.properties | 2 +- devices/src1.properties | 13 ++++- devices/src2.properties | 13 ++++- plugins/XPSSpectrum.form | 52 +++++++++++++++++- plugins/XPSSpectrum.java | 112 ++++++++++++++++++++++++++++---------- script/XPSSpectrum.py | 2 + 6 files changed, 160 insertions(+), 34 deletions(-) diff --git a/devices/ps1img.properties b/devices/ps1img.properties index 03f275a3..0a64db65 100644 --- a/devices/ps1img.properties +++ b/devices/ps1img.properties @@ -1,4 +1,4 @@ -#Tue Aug 30 14:09:40 CEST 2016 +#Tue Sep 06 10:39:20 CEST 2016 colormap=Grayscale colormapAutomatic=true colormapMax=4169.819 diff --git a/devices/src1.properties b/devices/src1.properties index dec2ac81..b0220492 100644 --- a/devices/src1.properties +++ b/devices/src1.properties @@ -1,4 +1,4 @@ -#Mon Nov 02 17:56:22 CET 2015 +#Tue Sep 06 10:00:18 CEST 2016 colormap=Temperature colormapAutomatic=true colormapMax=255.0 @@ -13,5 +13,16 @@ pollingBackground=false pollingInterval=0 rescaleFactor=1.0 rescaleOffset=0.0 +roiHeight=-1 +roiWidth=-1 +roiX=0 +roiY=0 rotation=0.0 +rotationCrop=false scale=1.0 +spatialCalOffsetX=NaN +spatialCalOffsetY=NaN +spatialCalScaleX=NaN +spatialCalScaleY=NaN +spatialCalUnits=mm +transpose=false diff --git a/devices/src2.properties b/devices/src2.properties index a7e238cb..dcf8f430 100644 --- a/devices/src2.properties +++ b/devices/src2.properties @@ -1,4 +1,4 @@ -#Mon Nov 02 17:56:22 CET 2015 +#Tue Sep 06 10:00:18 CEST 2016 colormap=Grayscale colormapAutomatic=true colormapMax=255.0 @@ -13,5 +13,16 @@ pollingBackground=false pollingInterval=0 rescaleFactor=1.0 rescaleOffset=0.0 +roiHeight=-1 +roiWidth=-1 +roiX=0 +roiY=0 rotation=0.0 +rotationCrop=false scale=1.0 +spatialCalOffsetX=NaN +spatialCalOffsetY=NaN +spatialCalScaleX=NaN +spatialCalScaleY=NaN +spatialCalUnits=mm +transpose=false diff --git a/plugins/XPSSpectrum.form b/plugins/XPSSpectrum.form index a6d16793..3038d3db 100644 --- a/plugins/XPSSpectrum.form +++ b/plugins/XPSSpectrum.form @@ -87,6 +87,18 @@ + + + + + + + + + + + + @@ -120,12 +132,22 @@ - + - + + + + + + + + + + + @@ -253,6 +275,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -281,7 +327,7 @@ - + diff --git a/plugins/XPSSpectrum.java b/plugins/XPSSpectrum.java index 12df80ea..45def00f 100644 --- a/plugins/XPSSpectrum.java +++ b/plugins/XPSSpectrum.java @@ -18,6 +18,7 @@ import ch.psi.pshell.swing.ValueSelection; import java.awt.Component; import java.io.File; import java.nio.file.Files; +import java.time.LocalTime; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -82,6 +83,8 @@ public class XPSSpectrum extends Panel { scienta = (Scienta) getDevice("Scienta"); scienta.getTotalChannels().addListener(progressListener); scienta.getCurrentChannel().addListener(progressListener); + dvpAcqTime.setDevice(scienta.getAcquisitionTime()); + startTimer(500,100); } @Override @@ -90,7 +93,7 @@ public class XPSSpectrum extends Panel { if (!state.isProcessing()){ buttonSkip.setVisible(false); if (running){ - stopTimer(); + //stopTimer(); running = false; getView().getStatusBar().setProgress(-1); } @@ -168,33 +171,48 @@ public class XPSSpectrum extends Panel { @Override protected void onTimer() { try{ - Object index = XPSSpectrum.this.eval(CURRERNT_RANGE_VAR, true); - if ((index!=null) && (index instanceof Integer) && ((Integer)index >= 0)){ - int scanIndex = (Integer)index; - if (scanIndex!=currentScanIndex){ - buttonSkip.setEnabled(true); - } - currentScanIndex = scanIndex; + if (running){ + Object index = XPSSpectrum.this.eval(CURRERNT_RANGE_VAR, true); + if ((index!=null) && (index instanceof Integer) && ((Integer)index >= 0)){ + int scanIndex = (Integer)index; + if (scanIndex!=currentScanIndex){ + buttonSkip.setEnabled(true); + } + currentScanIndex = scanIndex; - int current_iteration = (Integer) XPSSpectrum.this.eval(CURRERNT_ITERATION_VAR, true); - int iterations = (Integer)scanRanges[currentScanIndex].getVars()[2]; + int current_iteration = (Integer) XPSSpectrum.this.eval(CURRERNT_ITERATION_VAR, true); + int iterations = (Integer)scanRanges[currentScanIndex].getVars()[2]; - buttonSkip.setVisible((iterations>1) && (current_iteration < (iterations-1))); + buttonSkip.setVisible((iterations>1) && (current_iteration < (iterations-1))); - if (detailedScan){ - RangeSelection range = rangeSelectionPanel.getRangesOrdered()[scanIndex]; - for (int row = 0; row< rangeSelectionPanel.getTable().getRowCount(); row++){ - if (range.equals((Double)rangeSelectionPanel.getTable().getValueAt(row, 0), (Double)rangeSelectionPanel.getTable().getValueAt(row, 2))){ - rangeSelectionPanel.getTable().setRowSelectionInterval(row, row); - break; - } - if (row == (rangeSelectionPanel.getTable().getRowCount()-1)){ - rangeSelectionPanel.getTable().clearSelection(); - } - } + if (detailedScan){ + RangeSelection range = rangeSelectionPanel.getRangesOrdered()[scanIndex]; + for (int row = 0; row< rangeSelectionPanel.getTable().getRowCount(); row++){ + if (range.equals((Double)rangeSelectionPanel.getTable().getValueAt(row, 0), (Double)rangeSelectionPanel.getTable().getValueAt(row, 2))){ + rangeSelectionPanel.getTable().setRowSelectionInterval(row, row); + break; + } + if (row == (rangeSelectionPanel.getTable().getRowCount()-1)){ + rangeSelectionPanel.getTable().clearSelection(); + } + } + } + } else { + rangeSelectionPanel.getTable().clearSelection(); } } else { - rangeSelectionPanel.getTable().clearSelection(); + int steps = 0; + RangeSelection[] r = rangeSelectionPanel.getRanges(); + if ((buttonDetailedScan.isEnabled()) && (r.length>0)){ + for (int i=0;i