02.2026
This commit is contained in:
@@ -2,35 +2,31 @@
|
||||
* Copyright (c) 2014-2017 Paul Scherrer Institute. All rights reserved.
|
||||
*/
|
||||
|
||||
import ch.psi.pshell.framework.App;
|
||||
import ch.psi.pshell.device.Device;
|
||||
import ch.psi.pshell.device.DeviceAdapter;
|
||||
import ch.psi.pshell.device.DeviceListener;
|
||||
import ch.psi.pshell.epics.ChannelDouble;
|
||||
import ch.psi.pshell.epics.ChannelInteger;
|
||||
import ch.psi.pshell.epics.Epics;
|
||||
import ch.psi.pshell.swing.DevicePanel;
|
||||
import ch.psi.pshell.swing.DeviceValueChart;
|
||||
import ch.psi.pshell.ui.App;
|
||||
import ch.psi.pshell.ui.Panel;
|
||||
import ch.psi.pshell.ui.Plugin;
|
||||
import ch.psi.utils.Convert;
|
||||
import ch.psi.utils.State;
|
||||
import ch.psi.utils.swing.SwingUtils;
|
||||
import ch.psi.pshell.framework.Context;
|
||||
import ch.psi.pshell.framework.Panel;
|
||||
import ch.psi.pshell.framework.Plugin;
|
||||
import ch.psi.pshell.framework.Setup;
|
||||
import ch.psi.pshell.utils.Convert;
|
||||
import ch.psi.pshell.utils.State;
|
||||
import ch.psi.pshell.swing.SwingUtils;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JFrame;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -92,8 +88,8 @@ public class WireScan extends Panel {
|
||||
cb.setModel(model);
|
||||
}
|
||||
|
||||
if (App.hasArgument("ws")){
|
||||
comboWireScanner.setSelectedItem(App.getArgumentValue("ws"));
|
||||
if (App.hasAdditionalArgument("ws")){
|
||||
comboWireScanner.setSelectedItem(App.getAdditionalArgumentValue("ws"));
|
||||
}
|
||||
comboWireScannerActionPerformed(null);
|
||||
updatePanelRepRate();
|
||||
@@ -1015,7 +1011,7 @@ public class WireScan extends Panel {
|
||||
panelStatus.setDevice(scannerInfo);
|
||||
Device dev = new ChannelDouble (null, currentScannner + ":ENC_1_BS", 3);
|
||||
dev.setMonitored(true);
|
||||
dev.addListener(new DeviceAdapter() {
|
||||
dev.addListener(new DeviceListener() {
|
||||
@Override
|
||||
public void onValueChanged(Device device, Object value, Object former) {
|
||||
updatePosition((Double)value);
|
||||
@@ -1079,25 +1075,25 @@ ChannelDouble channelEndY;
|
||||
channelStartY.initialize(); channelStartY.setMonitored(true);
|
||||
channelEndY.initialize(); channelEndY.setMonitored(true);
|
||||
|
||||
channelStartX.addListener(new DeviceAdapter() {
|
||||
channelStartX.addListener(new DeviceListener() {
|
||||
@Override
|
||||
public void onValueChanged(Device device, Object value, Object former) {
|
||||
spinnerStartX.setValue(((Number)value).doubleValue());
|
||||
}
|
||||
});
|
||||
channelEndX.addListener(new DeviceAdapter() {
|
||||
channelEndX.addListener(new DeviceListener() {
|
||||
@Override
|
||||
public void onValueChanged(Device device, Object value, Object former) {
|
||||
spinnerEndX.setValue(((Number)value).doubleValue());
|
||||
}
|
||||
});
|
||||
channelStartY.addListener(new DeviceAdapter() {
|
||||
channelStartY.addListener(new DeviceListener() {
|
||||
@Override
|
||||
public void onValueChanged(Device device, Object value, Object former) {
|
||||
spinnerStartY.setValue(((Number)value).doubleValue());
|
||||
}
|
||||
});
|
||||
channelEndY.addListener(new DeviceAdapter() {
|
||||
channelEndY.addListener(new DeviceListener() {
|
||||
@Override
|
||||
public void onValueChanged(Device device, Object value, Object former) {
|
||||
spinnerEndY.setValue(((Number)value).doubleValue());
|
||||
@@ -1182,12 +1178,12 @@ ChannelDouble channelEndY;
|
||||
getLogger().info("Exception executing scan: " + ex);
|
||||
showException((Exception) ex);
|
||||
} else {
|
||||
//SwingUtils.showMessage(WireScan.this, "Success", "Data file: \n" + getContext().getDataManager().getLastOutput());
|
||||
//SwingUtils.showMessage(WireScan.this, "Success", "Data file: \n" + Context.getDataManager().getLastOutput());
|
||||
/*
|
||||
JPanel pn = new JPanel(new BorderLayout());
|
||||
((BorderLayout) pn.getLayout()).setHgap(5);
|
||||
pn.add(new JLabel("Generated data file:"), BorderLayout.NORTH);
|
||||
JTextField tf = new JTextField(getContext().getDataManager().getLastOutput());
|
||||
JTextField tf = new JTextField(Context.getDataManager().getLastOutput());
|
||||
tf.setPreferredSize(new Dimension(600, tf.getPreferredSize().height));
|
||||
tf.setEditable(false);
|
||||
pn.add(tf, BorderLayout.SOUTH);
|
||||
@@ -1238,15 +1234,15 @@ ChannelDouble channelEndY;
|
||||
|
||||
//String caqtdm = "caqtdm -noMsg -stylefile sfop.qss -attach";
|
||||
//String caqtdm = "startDM -noMsg -stylefile sfop.qss";
|
||||
ch.psi.pshell.core.Plugin calibrationPlugin;
|
||||
ch.psi.pshell.extension.Plugin calibrationPlugin;
|
||||
private void buttonCalibrationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCalibrationActionPerformed
|
||||
try {
|
||||
//String cmd = caqtdm + " -macro 'P=" + comboWireScanner.getSelectedItem() + ":,M=MOTOR_1' /sf/common/config/qt/motorx_all.ui";
|
||||
//Runtime.getRuntime().exec(new String[]{"bash", "-c", cmd.toString()});false WireScanCalibration.java
|
||||
if (calibrationPlugin!=null){
|
||||
getContext().getPluginManager().unloadPlugin(calibrationPlugin);
|
||||
Context.getExtensions().unloadPlugin(calibrationPlugin);
|
||||
}
|
||||
calibrationPlugin = getContext().getPluginManager().loadInitializePlugin(getContext().getSetup().expandPath("{plugins}/WireScanCalibration.java"));
|
||||
calibrationPlugin = Context.getExtensions().loadInitializePlugin(Setup.expandPath("{plugins}/WireScanCalibration.java"));
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user