Closedown

This commit is contained in:
gac-x03da
2022-07-05 10:14:24 +02:00
parent c8b04a0fd4
commit 800c0f5775
3 changed files with 27 additions and 17 deletions

View File

@@ -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<model.getColumnCount()){
if (row > 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) {