Closedown
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
import ch.psi.pshell.ui.Panel;
|
||||
import ch.psi.utils.State;
|
||||
import java.awt.Component;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.JLabel;
|
||||
@@ -13,14 +14,14 @@ import javax.swing.JLabel;
|
||||
*
|
||||
*/
|
||||
public class HystScan extends Panel {
|
||||
|
||||
|
||||
final static boolean POP_SCRIPT_EXCEPTIONS = true;
|
||||
|
||||
public HystScan() {
|
||||
initComponents();
|
||||
}
|
||||
|
||||
//Overridable callbacks
|
||||
//Overridable callbacks
|
||||
@Override
|
||||
public void onInitialize(int runCount) {
|
||||
|
||||
@@ -35,13 +36,11 @@ public class HystScan extends Panel {
|
||||
public void onExecutedFile(String fileName, Object result) {
|
||||
}
|
||||
|
||||
|
||||
//Callback to perform update - in event thread
|
||||
@Override
|
||||
protected void doUpdate() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void setEnabled(boolean value) {
|
||||
super.setEnabled(value);
|
||||
@@ -51,7 +50,7 @@ public class HystScan extends Panel {
|
||||
c.setEnabled(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
@@ -79,12 +78,12 @@ public class HystScan extends Panel {
|
||||
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel1.setText("E1:");
|
||||
|
||||
spinnerE1.setModel(new javax.swing.SpinnerNumberModel(690.0d, 0.0d, 9999.0d, 1.0d));
|
||||
spinnerE1.setModel(new javax.swing.SpinnerNumberModel(707.9d, 0.0d, 9999.0d, 1.0d));
|
||||
|
||||
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel2.setText("E2:");
|
||||
|
||||
spinnerE2.setModel(new javax.swing.SpinnerNumberModel(755.0d, 0.0d, 9999.0d, 1.0d));
|
||||
spinnerE2.setModel(new javax.swing.SpinnerNumberModel(703.9d, 0.0d, 9999.0d, 1.0d));
|
||||
|
||||
jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
||||
jLabel8.setText("Ramp Rate:");
|
||||
@@ -237,21 +236,25 @@ public class HystScan extends Panel {
|
||||
HashMap args = new HashMap();
|
||||
Double e1 = (Double) spinnerE1.getValue();
|
||||
Double e2 = (Double) spinnerE2.getValue();
|
||||
args.put("E1", e1);
|
||||
args.put("E2", e2);
|
||||
//args.put("E1", e1);
|
||||
//args.put("E2", e2);
|
||||
ArrayList<Double> energies = new ArrayList<>();
|
||||
energies.add(e1);
|
||||
energies.add(e2);
|
||||
args.put("ENERGIES", energies);
|
||||
args.put("START_FIELD", (Double) spinnerStartField.getValue());
|
||||
args.put("END_FIELD", (Double) spinnerEndField.getValue());
|
||||
args.put("RAMP_RATE", (Double) spinnerRampRate.getValue());
|
||||
args.put("ENERGY_CHANGE_SLEEP", (Double) spinnerSleep.getValue());
|
||||
buttonAbort.setEnabled(true);
|
||||
runAsync("HystScan", args).handle((ok, ex) -> {
|
||||
buttonAbort.setEnabled(false);
|
||||
if (ex != null){
|
||||
getLogger().log(Level.WARNING, null, ex);
|
||||
}
|
||||
return ok;
|
||||
});
|
||||
|
||||
runAsync("HystScan", args).handle((ok, ex) -> {
|
||||
buttonAbort.setEnabled(false);
|
||||
if (ex != null) {
|
||||
getLogger().log(Level.WARNING, null, ex);
|
||||
}
|
||||
return ok;
|
||||
});
|
||||
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user