[no commit message]
This commit is contained in:
parent
829d48b625
commit
c8ad2a51bc
@ -37,6 +37,7 @@ import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -169,7 +170,7 @@ public class NumassDataLoader extends AbstractLoader implements BinaryLoader<Env
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// LocalDateTime startTime = envelope.meta().get
|
||||
RawNMPoint raw = new RawNMPoint(envelope.meta().getDouble("external_meta.HV1_value", 0),
|
||||
events,
|
||||
@ -240,7 +241,7 @@ public class NumassDataLoader extends AbstractLoader implements BinaryLoader<Env
|
||||
@Override
|
||||
public List<NMPoint> getNMPoints() {
|
||||
List<NMPoint> res = new ArrayList<>();
|
||||
this.getPoints().stream().forEach((point) -> {
|
||||
this.getPoints().stream().forEachOrdered((point) -> {
|
||||
res.add(readPoint(point));
|
||||
});
|
||||
// res.sort((NMPoint o1, NMPoint o2) -> o1.getAbsouteTime().compareTo(o2.getAbsouteTime()));
|
||||
@ -256,6 +257,10 @@ public class NumassDataLoader extends AbstractLoader implements BinaryLoader<Env
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
res.sort((Envelope t, Envelope t1) -> t.meta().getInt("external_meta.point_index", -1)
|
||||
.compareTo(t1.meta().getInt("external_meta.point_index", -1)));
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ public class MspViewController implements Initializable {
|
||||
p.putValue("timestamp", last.getValue("timestamp").timeValue().plusMillis(10));
|
||||
for (String name : last.namesAsArray()) {
|
||||
if (!name.equals("timestamp")) {
|
||||
p.putValue(name, Value.getNull());
|
||||
p.putValue(name, Value.NULL);
|
||||
}
|
||||
}
|
||||
return p;
|
||||
|
@ -147,14 +147,14 @@ public class NumassLoaderViewComponent extends AnchorPane implements Initializab
|
||||
detectorDataExportButton.setOnAction(this::onExportButtonClick);
|
||||
lowChannelField.textProperty().bindBidirectional(channelSlider.lowValueProperty(), new NumberStringConverter());
|
||||
upChannelField.textProperty().bindBidirectional(channelSlider.highValueProperty(), new NumberStringConverter());
|
||||
|
||||
|
||||
channelSlider.setLowValue(300);
|
||||
channelSlider.setHighValue(1900);
|
||||
|
||||
|
||||
ChangeListener<? super Number> rangeChangeListener = (ObservableValue<? extends Number> observable, Number oldValue, Number newValue) -> {
|
||||
updateSpectrumPane();
|
||||
};
|
||||
|
||||
|
||||
channelSlider.lowValueProperty().addListener(rangeChangeListener);
|
||||
channelSlider.highValueProperty().addListener(rangeChangeListener);
|
||||
}
|
||||
@ -209,11 +209,18 @@ public class NumassLoaderViewComponent extends AnchorPane implements Initializab
|
||||
|
||||
private void updateSpectrumPane() {
|
||||
if (spectrumPlotFrame == null) {
|
||||
spectrumPlotFrame = new JFreeChartFrame("spectrum", null, spectrumPlotPane);
|
||||
Meta plotMeta = new MetaBuilder("plot")
|
||||
.setValue("xAxis.axisTitle", "U")
|
||||
.setValue("xAxis.axisUnits", "V")
|
||||
.setValue("yAxis.axisTitle", "count rate")
|
||||
.setValue("yAxis.axisUnits", "Hz")
|
||||
.setValue("legend.show", false);
|
||||
|
||||
spectrumPlotFrame = new JFreeChartFrame("spectrum", plotMeta, spectrumPlotPane);
|
||||
}
|
||||
|
||||
if (spectrumData == null) {
|
||||
spectrumData = new ChangeablePlottableData("", null);
|
||||
spectrumData = new ChangeablePlottableData("spectrum", null);
|
||||
spectrumPlotFrame.add(spectrumData);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user