Startup
This commit is contained in:
@@ -56,6 +56,8 @@ import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.ActionEvent;
|
||||
@@ -74,6 +76,7 @@ import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JMenuItem;
|
||||
@@ -1510,9 +1513,8 @@ public class ScreenPanel extends Panel {
|
||||
return (Epics.get("SIN-TIMAST-TMA:Beam-Las-Delay-Sel", Integer.class) == 0);
|
||||
}
|
||||
|
||||
void elog(String title, String message, String[] attachments) throws Exception {
|
||||
String domain = "";
|
||||
String logbook = "SwissFEL commissioning data";
|
||||
void elog(String logbook, String title, String message, String[] attachments) throws Exception {
|
||||
String domain = "";
|
||||
String category = "Info";
|
||||
String entry = "";
|
||||
StringBuffer cmd = new StringBuffer();
|
||||
@@ -1579,23 +1581,56 @@ public class ScreenPanel extends Panel {
|
||||
}
|
||||
}
|
||||
|
||||
void saveSnapshot() throws Exception {
|
||||
void saveSnapshot() throws Exception {
|
||||
String snapshotFile = getContext().getSetup().expandPath("{images}/{date}_{time}_snapshot.png");
|
||||
renderer.saveSnapshot(snapshotFile, "png", true);
|
||||
getContext().setExecutionPars("snapshot");
|
||||
String path = "/data";
|
||||
getContext().getDataManager().setDataset(path, renderer.getData().getMatrix(), renderer.getData().isUnsigned());
|
||||
getContext().getDataManager().setAttribute(path, "Camera", String.valueOf(cameraName));
|
||||
getContext().getDataManager().setAttribute(path, "Screen", String.valueOf(valueScreen.getLabel().getText()));
|
||||
getContext().getDataManager().setAttribute(path, "Filter", String.valueOf(valueFilter.getLabel().getText()));
|
||||
getContext().getDataManager().closeOutput();
|
||||
StringBuilder message = new StringBuilder();
|
||||
message.append("Camera: ").append(cameraName).append(" (").
|
||||
append((camera instanceof Camtool) ? "camtool" : "direct").append(")").append("\n");
|
||||
message.append("Data file: ").append(getContext().getExecutionPars().getPath()).append("\n");
|
||||
if ((fitOv != null) && (fitOv.length > 5)) {
|
||||
Overlays.Text text = (Overlays.Text) fitOv[5];
|
||||
message.append(text.getText()).append("\n");
|
||||
}
|
||||
elog("ScreenPanel Snapshot", message.toString(), new String[]{snapshotFile});
|
||||
SwingUtils.showMessage(getTopLevel(), "Success", "Generated data file:\n" + getContext().getExecutionPars().getPath(), 5000);
|
||||
|
||||
JPanel panel = new JPanel();
|
||||
GridBagLayout layout = new GridBagLayout();
|
||||
layout.columnWidths = new int[]{0, 180}; //Minimum width
|
||||
layout.rowHeights = new int[]{30, 30, 30}; //Minimum height
|
||||
panel.setLayout(layout);
|
||||
JComboBox comboLogbook = new JComboBox(new String[]{"SwissFEL commissioning data", "SwissFEL commissioning"});
|
||||
JTextField textComment = new JTextField();
|
||||
GridBagConstraints c = new GridBagConstraints();
|
||||
c.gridx = 0;
|
||||
c.gridy = 0;
|
||||
panel.add(new JLabel("Data file:"), c);
|
||||
c.gridy = 1;
|
||||
panel.add(new JLabel("Logbook:"), c);
|
||||
c.gridy = 2;
|
||||
panel.add(new JLabel("Comment:"), c);
|
||||
c.fill = GridBagConstraints.HORIZONTAL;
|
||||
c.gridx = 1;
|
||||
panel.add(textComment, c);
|
||||
c.gridy = 1;
|
||||
panel.add(comboLogbook, c);
|
||||
c.gridy = 0;
|
||||
panel.add(new JLabel(getContext().getExecutionPars().getPath()), c);
|
||||
|
||||
if (SwingUtils.showOption(getTopLevel(), "Success", panel, OptionType.OkCancel) == OptionResult.Yes){
|
||||
StringBuilder message = new StringBuilder();
|
||||
message.append("Camera: ").append(cameraName).append(" (").
|
||||
append((camera instanceof Camtool) ? "camtool" : "direct").append(")").append("\n");
|
||||
message.append("Screen: ").append(String.valueOf(valueScreen.getLabel().getText())).append("\n");
|
||||
message.append("Filter: ").append(String.valueOf(valueFilter.getLabel().getText())).append("\n");
|
||||
message.append("Data file: ").append(getContext().getExecutionPars().getPath()).append("\n");
|
||||
message.append("Comment: ").append(textComment.getText()).append("\n");
|
||||
if ((fitOv != null) && (fitOv.length > 5)) {
|
||||
Overlays.Text text = (Overlays.Text) fitOv[5];
|
||||
message.append(text.getText()).append("\n");
|
||||
}
|
||||
elog((String) comboLogbook.getSelectedItem(), "ScreenPanel Snapshot", message.toString(), new String[]{snapshotFile});
|
||||
}
|
||||
//SwingUtils.showMessage(getTopLevel(), "Success", "Generated data file:\n" + getContext().getExecutionPars().getPath(), 5000);
|
||||
//elog("SwissFEL commissioning data", "ScreenPanel Snapshot", message.toString(), new String[]{snapshotFile});
|
||||
}
|
||||
|
||||
void saveStack() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user