Averager devices

This commit is contained in:
gac-bernina
2021-05-03 09:59:40 +02:00
parent 89562f457f
commit 2bcbb2b157
17 changed files with 154 additions and 61 deletions

View File

@@ -22,7 +22,7 @@ public class PSSS extends Panel {
final String CAMERA_NAME = "SARFE10-PSSS059";
PipelineServer pipelineServer;
volatile boolean updatingPlot;
volatile boolean updatingImage;
volatile boolean updatingImage;
public PSSS() {
initComponents();
@@ -39,7 +39,7 @@ public class PSSS extends Panel {
try {
setGlobalVar("PSSS_PLOT", plot);
setGlobalVar("HISTORY_PLOT", history);
setGlobalVar("PSSS_RENDERER", renderer);
setGlobalVar("PSSS_RENDERER", renderer);
pipelineServer = (PipelineServer) getDevice("cam_server");
((LinePlotJFree)histogramGeneratorPanelCenter.getPlot()).setLegendVisible(true);
@@ -48,6 +48,8 @@ public class PSSS extends Panel {
histogramGeneratorFwhm.getPlot().getAxis(Plot.AxisId.Y).setRange(0, 100);
//setImageEnabled(true);
tabStateChanged(null);
spinnerAverage.setValue(( (Number) eval("get_psss_averaging()", true)).intValue());
} catch (Exception ex) {
getLogger().log(Level.WARNING, null, ex);
@@ -74,7 +76,8 @@ public class PSSS extends Panel {
try {
if (!updatingPlot){
updatingPlot = true;
evalAsync("plot_psss(PSSS_PLOT, HISTORY_PLOT, " + spinnerAverage.getValue() + ")", true).handle((ret,ex)->{
//evalAsync("plot_psss(PSSS_PLOT, HISTORY_PLOT, " + spinnerAverage.getValue() + ")", true).handle((ret,ex)->{
evalAsync("plot_psss(PSSS_PLOT, HISTORY_PLOT)", true).handle((ret,ex)->{
updatingPlot = false;
return ret;
});
@@ -195,6 +198,11 @@ public class PSSS extends Panel {
jLabel1.setText("Average:");
spinnerAverage.setModel(new javax.swing.SpinnerNumberModel(1, 1, 100, 1));
spinnerAverage.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
spinnerAverageStateChanged(evt);
}
});
histogramGeneratorPanelCenter.setDeviceName("histo_center");
@@ -632,7 +640,7 @@ public class PSSS extends Panel {
private void btAbortActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btAbortActionPerformed
try {
abort();
} catch (InterruptedException ex) {
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_btAbortActionPerformed
@@ -677,6 +685,14 @@ public class PSSS extends Panel {
((CardLayout)panelScan.getLayout()).show(panelScan, "crystal");
}//GEN-LAST:event_radioCrystalScanActionPerformed
private void spinnerAverageStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerAverageStateChanged
try {
eval("set_psss_averaging(" + spinnerAverage.getValue() + ")", true);
} catch (Exception ex) {
showException(ex);
}
}//GEN-LAST:event_spinnerAverageStateChanged
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btAbort;
private javax.swing.JButton btStartCam;