Startup
This commit is contained in:
@@ -11,10 +11,12 @@ import ch.psi.pshell.epics.Scienta.EnergyMode;
|
||||
import ch.psi.pshell.epics.Scienta.LensMode;
|
||||
import ch.psi.pshell.plot.LinePlotSeries;
|
||||
import ch.psi.pshell.plot.Plot;
|
||||
import ch.psi.utils.Arr;
|
||||
import ch.psi.utils.State;
|
||||
import ch.psi.utils.swing.SwingUtils;
|
||||
import java.awt.Component;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.JComboBox;
|
||||
@@ -262,10 +264,8 @@ public final class ScientaPanel extends DevicePanel {
|
||||
if ((dd.spectrum == null)||(dd.spectrumX==null)) {
|
||||
throw new Exception("Invalid spectrum");
|
||||
}
|
||||
if (dd.spectrumX.length<dd.spectrum.length){
|
||||
throw new Exception("Invalid spectrum x size: " + dd.spectrumX.length + " - y size: " + dd.spectrum.length);
|
||||
}
|
||||
spectrumSeries.setData(dd.spectrumX, dd.spectrum);
|
||||
int length = Math.min(dd.spectrumX.length, dd.spectrum.length);
|
||||
spectrumSeries.setData( Arrays.copyOfRange(dd.spectrumX, 0, length),Arrays.copyOfRange(dd.spectrum, 0, length));
|
||||
plot.updateSeries(spectrumSeries);
|
||||
} catch (Exception ex) {
|
||||
getLogger().log(Level.FINE, null, ex);
|
||||
|
||||
Reference in New Issue
Block a user