diff --git a/config/variables.properties b/config/variables.properties index 5c20319a..d93299f1 100644 --- a/config/variables.properties +++ b/config/variables.properties @@ -1,4 +1,4 @@ -#Mon Jul 04 12:51:10 CEST 2022 -LastRunDate=220704 -FileSequentialNumber=13220 -DaySequentialNumber=3 +#Tue Jul 05 10:11:41 CEST 2022 +LastRunDate=220705 +FileSequentialNumber=13221 +DaySequentialNumber=1 diff --git a/plugins/XPSSpectrum.java b/plugins/XPSSpectrum.java index 59a4d34d..a8594374 100644 --- a/plugins/XPSSpectrum.java +++ b/plugins/XPSSpectrum.java @@ -10,7 +10,7 @@ import ch.psi.pshell.epics.Scienta; import ch.psi.pshell.plot.LinePlotSeries; import ch.psi.pshell.plot.RangeSelectionPlot.RangeSelection; import ch.psi.pshell.ui.Panel; -import ch.psi.utils.Convert; +import ch.psi.utils.Convert; import ch.psi.utils.IO; import ch.psi.utils.Serializer; import ch.psi.utils.State; @@ -53,6 +53,7 @@ public class XPSSpectrum extends Panel { public XPSSpectrum() { initComponents(); rangeSelectionPanel.setOverlapAllowed(true); + rangeSelectionPanel.setDuplicateAllowed(true); rangeSelectionPanel.setShowMiddle(showMiddle); buttonSkip.setVisible(false); rangeSelectionPanel.setAditionalColumns(new String[]{"Time", "Size", "Iter", "Eph"}, new Class[]{Double.class, Double.class, Integer.class, Double.class}); @@ -62,19 +63,22 @@ public class XPSSpectrum extends Panel { public void tableChanged(TableModelEvent e) { if (e.getType() == TableModelEvent.INSERT) { final int row = e.getFirstRow(); + final int col = e.getColumn(); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { - if (row > 0) { - for (int col = indexTime; col <=indexEph; col++) { - model.setValueAt(model.getValueAt(row - 1, col), row, col); + if (col 0) { + for (int col = indexTime; col <=indexEph; col++) { + model.setValueAt(model.getValueAt(row - 1, col), row, col); + } + } else if (row == 0) { + model.setValueAt(valueTime.getValue(), row, indexTime); + model.setValueAt(valueSize.getValue(), row, indexSize); + model.setValueAt((int) valueIterations.getValue(), row, indexIter); + model.setValueAt(Double.NaN, row, indexEph); } - } else { - model.setValueAt(valueTime.getValue(), row, indexTime); - model.setValueAt(valueSize.getValue(), row, indexSize); - model.setValueAt((int) valueIterations.getValue(), row, indexIter); - model.setValueAt(Double.NaN, row, indexEph); } } }); @@ -205,8 +209,8 @@ public class XPSSpectrum extends Panel { Object[] ret = (Object[]) ((Object[]) result)[0]; if (ret.length > 0) { double[] xdata = (double[]) Convert.toPrimitiveArray(ret[0], Double.class); - double[] ydata = (double[]) Convert.toPrimitiveArray(ret[1], Double.class); - + double[] ydata = (double[]) Convert.toPrimitiveArray(ret[1], Double.class); + //double[] xdata = (double[]) ret[0]; //double[] ydata = (double[]) ret[1]; @@ -278,7 +282,7 @@ public class XPSSpectrum extends Panel { buttonSkip.setVisible((iterations > 1) && (current_iteration < (iterations - 1))); if (detailedScan) { - RangeSelection range = rangeSelectionPanel.getRangesOrdered()[scanIndex]; + RangeSelection range = rangeSelectionPanel.getRanges()[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); @@ -696,7 +700,7 @@ public class XPSSpectrum extends Panel { private void buttonDetailedScanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonDetailedScanActionPerformed try { detailedScan = true; - scanRanges = rangeSelectionPanel.getRangesOrdered(); + scanRanges = rangeSelectionPanel.getRanges(); start(); } catch (Exception ex) { diff --git a/script/XPSSpectrum.py b/script/XPSSpectrum.py index c9176687..db2ef9b0 100644 --- a/script/XPSSpectrum.py +++ b/script/XPSSpectrum.py @@ -4,6 +4,12 @@ # save_scienta_image # # skip_iteration: if set to 1 then skips after end of current iteration +print ranges +print pass_energy +print save_scienta_image +print ENDSCAN +1/0 + from ch.psi.pshell.data.LayoutDefault import ATTR_WRITABLE_DIMENSION as ATTR_WRITABLE_DIMENSION import org.jfree.chart.axis.NumberAxis as NumberAxis import math