/* * Copyright (c) 2014 Paul Scherrer Institute. All rights reserved. */ package ch.psi.mxsc; import ch.psi.mxsc.BasePlatePanel.SelectionMode; import ch.psi.pshell.framework.Context; import ch.psi.pshell.device.Device; import ch.psi.pshell.device.DeviceListener; import ch.psi.pshell.device.DeviceBase; import ch.psi.pshell.device.DeviceListener; import ch.psi.pshell.device.GenericDevice; import ch.psi.pshell.extension.Plugin; import ch.psi.pshell.imaging.PointDouble; import ch.psi.pshell.imaging.Renderer; import ch.psi.pshell.imaging.RendererMode; import ch.psi.pshell.imaging.Source; import ch.psi.pshell.scripting.ViewPreference; import ch.psi.pshell.framework.App; import ch.psi.pshell.framework.Panel; import ch.psi.pshell.framework.Setup; import ch.psi.pshell.framework.StatusBar; import ch.psi.pshell.utils.Chrono; import ch.psi.pshell.utils.State; import ch.psi.pshell.swing.Document; import ch.psi.pshell.swing.DocumentListener; import ch.psi.pshell.swing.Editor; import ch.psi.pshell.swing.JsonTableEditor; import ch.psi.pshell.swing.SwingUtils; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Dialog; import java.awt.Dimension; import java.awt.GridBagLayout; import java.awt.Image; import java.awt.Point; import java.awt.Rectangle; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.File; import java.io.IOException; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import javax.script.ScriptException; import javax.swing.GroupLayout; import javax.swing.ImageIcon; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.SwingUtilities; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.DefaultTableModel; /** * */ public class MainPanel extends Panel { /** * Creates new form Panel */ Boolean manualMode; Boolean roomTemperature; public final String PUCK_LOADING_STATUS = "Puck loading"; public final String PUCK_UNLOADING_STATUS = "Puck unloading"; StatusBar statusBar; JPopupMenu samplePopupMenu; JMenuItem menuMountSample; JMenuItem menuUnmoountSample; boolean doorsHaveOpened; public enum BasePlateLayout { normal, sf, x06da, rt } public static final BasePlateLayout BASE_PLATE_LAYOUT = App.hasAdditionalArgument("sf") ? BasePlateLayout.sf : ( App.hasAdditionalArgument("6d") ? BasePlateLayout.x06da : ( App.hasAdditionalArgument("rt") ? BasePlateLayout.rt : BasePlateLayout.normal) ); public static boolean isRt(){ return App.hasAdditionalArgument("rt"); } public MainPanel() { initComponents(); Context.getExtensions().addDynamicClass(PuckDetection.class); Controller.createInstance(this); basePlatePanel.setMode(BasePlatePanel.Mode.single); setExpertMode(false); setDefaultDetail(); panelTablePucks.getVerticalScrollBar().setPreferredSize(new Dimension(20, 0)); panelTableSamples.getVerticalScrollBar().setPreferredSize(new Dimension(20, 0)); if (isRt()){ panelLegend.setVisible(false); panelLN2Level.setVisible(false); panelDisplayMode.setVisible(false); //panelBottom.setMinimumSize(panelTop.getMinimumSize()); panelTop.setMinimumSize(new Dimension(panelTop.getMinimumSize().width, panelTop.getMinimumSize().height-150)); panelBottom.setMinimumSize(new Dimension(panelBottom.getMinimumSize().width, panelBottom.getMinimumSize().height+150)); panelDatamatrix.setVisible(false); panelDetail.setVisible(false); ((GroupLayout)panelTop.getLayout()).replace(panelRight, panelDevices); } ((DefaultTableModel)tablePucks.getModel()).setNumRows(BasePlate.numberOfPucks); int row = 0; for (String segment : new String[]{"A", "B", "C", "D", "E", "F"}) { for (int puck = 1; puck <= BasePlate.numberOfPucksPerSegments; puck++) { tablePucks.getModel().setValueAt(segment + puck, row++, 0); } } tablePucks.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { try { if (e.getValueIsAdjusting() == false) { String add = String.valueOf(tablePucks.getModel().getValueAt(tablePucks.getSelectedRow(), 0)); String cur = Controller.getInstance().getCurrentSelection(); if (cur != null) { cur = cur.substring(0, 2); } if (!add.equals(cur)) { Puck puck = Controller.getInstance().getPuck(add); Controller.getInstance().selectPuck(puck); } } } catch (Exception ex) { showException(ex); } } }); tableSamples.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { try { if (e.getValueIsAdjusting() == false) { int selection = tableSamples.getSelectedRow(); if (selection >= 0) { String add = getSamplesTableSelectedPuck(); if (!add.trim().isEmpty()) { int pos = getSamplesTableSelectedPosition(); String curSelection = Controller.getInstance().getCurrentSelection(); String curPuck = (curSelection == null) ? null : curSelection.substring(0, 2); if (!add.equals(curPuck)) { Puck puck = Controller.getInstance().getPuck(add); Controller.getInstance().selectPuck(puck); } if (pos >= 0) { add += pos; if (!add.equals(curSelection)) { Sample sample = Controller.getInstance().getSample(add); Controller.getInstance().selectSample(sample); } } } } } } catch (Exception ex) { showException(ex); } } }); tableSamples.getTableHeader().addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { try { if ((e.getClickCount() == 2) && (!e.isPopupTrigger())) { openSamplesInfo(); } } catch (Exception ex) { showException(ex); } } }); tableSamples.addMouseListener(new MouseAdapter() { /* @Override public void mouseClicked(MouseEvent e) { try { if ((e.getClickCount() == 2) && (!e.isPopupTrigger())) { int index = tableSamples.getSelectedRow(); if (index>=0) { onDoubleClickSample(index); } } } catch (Exception ex) { showException(ex); } } */ @Override public void mouseReleased(MouseEvent e) { checkPopup(e); } @Override public void mousePressed(MouseEvent e) { checkPopup(e); } private void checkPopup(MouseEvent e) { try { if (e.isPopupTrigger()) { int r = tableSamples.rowAtPoint(e.getPoint()); if (r >= 0 && r < tableSamples.getRowCount()) { tableSamples.setRowSelectionInterval(r, r); } else { tableSamples.clearSelection(); } int index = tableSamples.getSelectedRow(); if (index>=0) { Sample clickedSample = getSamplesTableSelectedSample(); if (clickedSample!=null){ //menuLoadSample.setEnabled(!clickedSample.isLoaded() && Controller.getInstance().basePlate.getLoadedSample()==null); menuMountSample.setEnabled(!clickedSample.isLoaded()); menuUnmoountSample.setEnabled(clickedSample.isLoaded() && Controller.getInstance().basePlate.getLoadedSample()!=null); samplePopupMenu.show(e.getComponent(), e.getX(), e.getY()); } } } } catch (Exception ex) { showException(ex); } } } ); samplePopupMenu = new JPopupMenu(); menuMountSample = new JMenuItem("Mount"); menuMountSample.addActionListener((ActionEvent e) -> { try { Sample clickedSample = getSamplesTableSelectedSample(); int sample = clickedSample.getNumber(); int puck = clickedSample.getPuck().getNumber(); char segment = clickedSample.getPuck().getSegment(); Controller.instance.execute("mount('" + segment + "'," + puck + "," + sample + ", auto_unmount=True)"); } catch (Exception ex) { SwingUtils.showException(this, ex); } }); menuUnmoountSample = new JMenuItem("Unmount"); menuUnmoountSample.addActionListener((ActionEvent e) -> { try { Sample clickedSample = getSamplesTableSelectedSample(); int sample = clickedSample.getNumber(); int puck = clickedSample.getPuck().getNumber(); char segment = clickedSample.getPuck().getSegment(); Controller.instance.execute("unmount('" + segment + "'," + puck + "," + sample + ")"); } catch (Exception ex) { SwingUtils.showException(this, ex); } }); samplePopupMenu.add(menuMountSample); samplePopupMenu.add(menuUnmoountSample); } JMenuItem menuEditSamples; JsonTableEditor samplesInfoEditor; @Override protected void onLoaded() { if (Setup.isDetached()) { Image img = new ImageIcon(this.getClass().getResource("/apple_transparent_white_100x50.png")).getImage(); SwingUtils.getWindow(this).setIconImage(img); } if (isRt()){ basePlatePanel.setSelectionMode(SelectionMode.Samples); } else { basePlatePanel.setSelectionMode(SelectionMode.Pucks); } basePlatePanel.setDevice(Controller.getInstance().basePlate); try{ statusBar = (StatusBar) SwingUtils.getComponentsByType(getTopLevel(), StatusBar.class)[0]; } catch (Exception ex){ } if (getView() != null) { JMenuBar menu = getView().getMenu(); JMenu menuFile = (JMenu) SwingUtils.getComponentByName(menu, "menuFile"); menuEditSamples = new JMenuItem("Edit Samples Info"); menuFile.insert(menuEditSamples,0); menuEditSamples.addActionListener((e) -> { samplesInfoEditor = openSamplesInfo(); }); } } public String getSamplesTableSelectedPuck(){ try { int selection = tableSamples.getSelectedRow(); return String.valueOf(tableSamples.getModel().getValueAt(selection, COLUMN_PUCK_ADDRESS)); } catch (Exception ex) { return ""; } } public int getSamplesTableSelectedPosition(){ try { int selection = tableSamples.getSelectedRow(); return Integer.valueOf(String.valueOf(tableSamples.getModel().getValueAt(selection, COLUMN_SAMPLE_POSITION))); } catch (Exception ex) { return -1; } } public Sample getSamplesTableSelectedSample(){ try{ String puck = getSamplesTableSelectedPuck(); int pos = getSamplesTableSelectedPosition(); return Controller.getInstance().basePlate.getSampleByName(puck+pos); } catch (Exception ex){ return null; } } @Override protected void onUnloaded() { if (getView() != null) { JMenuBar menu = getView().getMenu(); JMenu menuFile = (JMenu) SwingUtils.getComponentByName(menu, "menuFile"); menuFile.remove(menuEditSamples); } } @Override public void onInitialize(int runCount) { stopTimer(); try{ Controller.getInstance().onInitialize(runCount); panelDisplayMode.setVisible(Controller.getInstance().isRoomTempEnabled()); panelBeamlineStatus.setVisible(Controller.getInstance().isBeamlineStatusEnabled()); if (basePlatePanel.getDevice() != (Device) getDevice("BasePlate")) { basePlatePanel.setDevice((Device) getDevice("BasePlate")); } try { devicesPanel.initialize(); ((Device) getDevice("dewar_level")).addListener(new DeviceListener() { @Override public void onValueChanged(Device device, Object value, Object former) { updateLevel(value); } }); updateLevel(((Device) getDevice("dewar_level")).take()); ((Device) getDevice("air_pressure_ok")).addListener(new DeviceListener() { @Override public void onValueChanged(Device device, Object value, Object former) { updateAirPressure(value); } }); updateAirPressure(((Device) getDevice("air_pressure_ok")).take()); ((Device) getDevice("n2_pressure_ok")).addListener(new DeviceListener() { @Override public void onValueChanged(Device device, Object value, Object former) { updateN2Pressure(value); } }); updateN2Pressure(((Device) getDevice("n2_pressure_ok")).take()); ((Device) getDevice("feedback_local_safety")).addListener(new DeviceListener() { @Override public void onValueChanged(Device device, Object value, Object former) { updateLocalSafety(value); } }); updateLocalSafety(((Device) getDevice("feedback_local_safety")).take()); updateN2Pressure(((Device) getDevice("n2_pressure_ok")).take()); ((Device) getDevice("gripper_dryer")).addListener(new DeviceListener() { @Override public void onValueChanged(Device device, Object value, Object former) { updateDryer(value); } }); updateDryer(((Device) getDevice("gripper_dryer")).take()); Device feedback_psys_safety = ((Device) getDevice("feedback_psys_safety")); feedback_psys_safety.addListener(new DeviceListener() { @Override public void onValueChanged(Device device, Object value, Object former) { doorsHaveOpened = Boolean.FALSE.equals(value); updatePsysSafety(value); } }); feedback_psys_safety.request(); updatePsysSafety(((Device) getDevice("feedback_psys_safety")).take()); ((Device) getDevice("robot")).addListener(new DeviceListener() { @Override public void onValueChanged(Device device, Object value, Object former) { updateMode(value); } public void onStateChanged(Device device, State state, State former) { if (!state.isNormal()) { updateMode(null); } } }); updateMode(((Device) getDevice("robot")).take()); } catch (Exception ex) { this.getLogger().log(Level.SEVERE, null, ex); } DeviceBase dev = (DeviceBase) this.getDevice("cover_detection"); dev.addListener(cover_detection_listener); setPuckDatamatrix(null); setSampleDatamatrix(null); setBackgroundUpdate(true); startTimer(3000, 1000); if (runCount==0){ GenericDevice img = this.getDevice("img"); if (img!=null){ buttonCamera.setSelected(true); } } SwingUtilities.invokeLater(()->{updateCameraView();}); } catch (Exception ex){ getLogger().log(Level.SEVERE, null, ex); } } @Override public void onStateChange(State state, State former) { Controller.getInstance().onStateChange(state, former); updateButtonState(); } public void setViewCamera(){ buttonCamera.setSelected(true); SwingUtilities.invokeLater(()->{updateCameraView();}); } public void setViewDesign(){ buttonDrawing.setSelected(true); SwingUtilities.invokeLater(()->{updateCameraView();}); } @Override protected void onTimer() { try { devicesPanel.update(); try { roomTemperature = Controller.getInstance().isRoomTemp(); ledRoomTemperature.setColor(roomTemperature ? Color.YELLOW : Color.GREEN); labelRoomTemperature.setText(roomTemperature ? "Room Temperature" : "Cryo Operation"); try { ledHeaterOk.setColor(roomTemperature ? Color.GREEN : (((Double) panelHeaterTemp.getDevice().take()) < 20.0 ? Color.RED : Color.GREEN)); } catch (Exception ex) { ledHeaterOk.setColor(Color.BLACK); } } catch (Exception ex) { roomTemperature = null; ledRoomTemperature.setColor(Color.BLACK); labelRoomTemperature.setText("Room Temperature"); } try { ledServiceMode.setColor(Controller.getInstance().isServiceMode() ? Color.YELLOW : Color.GREEN); } catch (Exception ex) { ledServiceMode.setColor(Color.BLACK); } try { if ((expertChrono != null) && (expertChrono.isTimeout(10 * 60000))) { //After 10min setExpertMode(false); } } catch (Exception ex) { getLogger().log(Level.WARNING, null, ex); } Controller.getInstance().onTimer(); if (getState() == State.Ready) { boolean puckLoading = Controller.getInstance().isPuckLoading(); setStatus((puckLoading==false) ? "Ready" : PUCK_LOADING_STATUS); } else { status = null; } } catch (Exception ex) { getLogger().log(Level.WARNING, null, ex); } } String status; void setStatus(String status) { String current = current = (statusBar==null) ? this.status : statusBar.getStatusLabel().getText(); if (!status.equals(current)) { Context.getSequencer().setPreference(ViewPreference.STATUS, status); } this.status = status; } volatile boolean refreshing; void refresh() { if (!SwingUtilities.isEventDispatchThread()) { if (!refreshing){ refreshing = true; SwingUtilities.invokeLater(() -> { refreshing = false; refresh(); }); } return; } repaint(); for (Puck p : Controller.getInstance().basePlate.getPucks()) { int index = p.getUserIndex(); tablePucks.getModel().setValueAt(p.getStatus(), index, 1); tablePucks.getModel().setValueAt(p.getId(), index, 2); } } void updateLevel(Object value) { if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(()->{ updateLevel(value); }); return; } if ((value == null) || !(value instanceof Number)) { progressLN2.setIndeterminate(true); } else { progressLN2.setIndeterminate(false); double val = ((Number) value).doubleValue() * 10.0; progressLN2.setValue(Math.min(Math.max((int) val, 0), 1000)); } } void updateAirPressure(Object value) { if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(()->{ updateAirPressure(value); }); return; } if ((value == null) || !(value instanceof Boolean)) { ledAirPressure.setColor(Color.BLACK); } else if ((Boolean) value) { ledAirPressure.setColor(Color.GREEN); } else { ledAirPressure.setColor(Color.RED); } } void updateN2Pressure(Object value) { if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(()->{ updateN2Pressure(value); }); return; } if ((value == null) || !(value instanceof Boolean)) { ledN2Pressure.setColor(Color.BLACK); } else if ((Boolean) value) { ledN2Pressure.setColor(Color.GREEN); } else { ledN2Pressure.setColor(Color.RED); } } void updateLocalSafety(Object value) { if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(()->{ updateLocalSafety(value); }); return; } if ((value == null) || !(value instanceof Boolean)) { ledLocalSafety.setColor(Color.BLACK); } else if ((Boolean) value) { ledLocalSafety.setColor(Color.GREEN); } else { ledLocalSafety.setColor(Color.RED); } } void updateDryer(Object value) { if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(()->{ updateDryer(value); }); return; } if ((value == null) || !(value instanceof Boolean)) { ledDryer.setColor(Color.BLACK); } else if ((Boolean) value) { ledDryer.setColor(Color.RED); } else { ledDryer.setColor(Color.GREEN); } } public boolean isCoverPosDetected(){ try{ return textCoverDet.getText().contains(", "); } catch(Exception ex){ return false; } } void updateButtonState(){ if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(()->{ updateButtonState(); }); return; } boolean doors_open = !Boolean.TRUE.equals(Controller.getInstance().isDoorClosed()); boolean cover_pos_detected = isCoverPosDetected(); buttonSampleLoad.setEnabled(doors_open && !cover_pos_detected && getState().isInitialized()); buttonCamera.setEnabled(getState().isInitialized()); buttonDrawing.setEnabled(getState().isInitialized()); } void updatePsysSafety(Object value) { if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(()->{ updatePsysSafety(value); }); return; } if ((value == null) || !(value instanceof Boolean)) { ledPsysSafety.setColor(Color.BLACK); } else if (Boolean.TRUE.equals(manualMode)) { ledPsysSafety.setColor(Color.YELLOW); } else if ((Boolean) value) { ledPsysSafety.setColor(Color.GREEN); } else { ledPsysSafety.setColor(Color.RED); } if (!Boolean.TRUE.equals(value)){ try { Controller.getInstance().setPuckLoading(false); } catch (Exception ex) { getLogger().log(Level.WARNING, null, ex); } } updateButtonState(); } void updateMode(Object value) { if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(()->{ updateMode(value); }); return; } if ((value != null) && (value instanceof Map)) { manualMode = "manual".equals(String.valueOf(((Map) value).get("mode"))); ledManualMode.setColor(manualMode ? Color.YELLOW : Color.GREEN); labelManualMode.setText(manualMode ? "Manual Mode" : "Remote Mode"); updatePsysSafety(((Device) getDevice("feedback_psys_safety")).take()); } else { ledManualMode.setColor(Color.BLACK); labelManualMode.setText("Unknown Mode"); } } void updateCameraView() { if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(()->{ updateCameraView(); }); return; } try{ //if (buttonCamera.isSelected()){ int center_x = ((Number)this.eval("cover_detection.config.center_x", true)).intValue(); int center_y = ((Number)this.eval("cover_detection.config.center_y", true)).intValue(); int diam_dewar = ((Number)this.eval("cover_detection.config.diameter_dewar", true)).intValue(); double dewar_wall = ((Number)this.eval("cover_detection.config.border_dewar", true)).doubleValue(); int diam =(int) (dewar_wall * diam_dewar); Rectangle roi = new Rectangle(center_x-diam/2,center_y - diam/2, diam, diam ); basePlatePanel.basePlateGraphics.setImageRoi(roi); //} } catch (Exception ex){ if (getState().isInitialized()){ getLogger().log(Level.SEVERE, null, ex); } } Source source = buttonCamera.isSelected() ? (Source) this.getDevice("img") : null; basePlatePanel.setCameraView(source); } void execute(String statement) { execute(statement, false); } void execute(String statement, boolean background) { execute(statement, background, false); } void execute(String statement, boolean background, boolean showReturn) { execute(statement, background, showReturn, true); } void execute(String statement, boolean background, boolean showReturn, boolean showException) { try { getLogger().log(Level.INFO, "Execute: " + statement + (background ? "&" : "")); evalAsync(statement, background).handle((ret, ex) -> { if (ex != null) { if (showException) { showException((Exception) ex); } } else if (showReturn) { showMessage("Return", String.valueOf(ret)); } return ret; }); } catch (Exception ex) { if (showException) { showException(ex); } } } void execute(String script, Object args, boolean background, boolean showReturn) { execute(script, args, background, showReturn, true); } void execute(String script, Object args, boolean background, boolean showReturn, boolean showException) { try { getLogger().log(Level.INFO, "Execute: " + script + (background ? "&" : "")); runAsync(script, args, background).handle((ret, ex) -> { if (ex != null) { showException((Exception) ex); } else if (showReturn) { showMessage("Return", String.valueOf(ret)); } return ret; }); } catch (Exception ex) { if (showException) { showException(ex); } } } void updateViewType() { try { updateCameraView(); } catch (Exception ex) { showException(ex); } } boolean viewDewar = true; RoomTemperaturePanel roomTempPanel; WaterLevelPanel waterLevelPanel; void updateViewMode() { if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(()->{ updateViewMode(); }); return; } try { if (btViewDewar.isSelected() != viewDewar) { viewDewar = btViewDewar.isSelected(); if (viewDewar) { ((GroupLayout) panelTop.getLayout()).replace(roomTempPanel, basePlatePanel); ((GroupLayout) panelTop.getLayout()).replace(waterLevelPanel, panelLN2Level); } else { if (roomTempPanel == null) { roomTempPanel = new RoomTemperaturePanel(); roomTempPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Room Temperature")); } roomTempPanel.setDevice(Controller.getInstance().roomTemperatureBasePlate); ((GroupLayout) panelTop.getLayout()).replace(basePlatePanel, roomTempPanel); if (waterLevelPanel == null) { waterLevelPanel = new WaterLevelPanel(); } waterLevelPanel.setPreferredSize(panelLN2Level.getPreferredSize()); ((GroupLayout) panelTop.getLayout()).replace(panelLN2Level, waterLevelPanel); } } } catch (Exception ex) { showException(ex); } } volatile boolean updating; void setExpertMode(boolean expert) { if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(()->{ setExpertMode(expert); }); return; } try{ updating = true; boolean current = buttonExpertCommands.isVisible(); buttonExpertCommands.setVisible(expert); buttonRecovery.setVisible(expert); buttonConfig.setVisible(expert); buttonDetectionCalibrate.setVisible(expert); buttonDetectionExposure.setVisible(expert); checkService.setVisible(expert); devicesPanel.setActive(expert); //panelViewType.setVisible(expert); Puck.setDisplayDetectionError(expert); if (checkExpert.isSelected() != expert) { checkExpert.setSelected(expert); } if (expert == false) { Controller.getInstance().setServiceMode(false); // buttonCamera.setSelected(true); // buttonDrawing.setSelected(false); // updateViewType(); } else { checkService.setSelected( Boolean.TRUE.equals(Controller.getInstance().isServiceMode())); } if (current != expert) { onModeChange(expert); } } finally { updating = false; } } Plugin commandsPlugin; Panel showCommandsPanel() { if (commandsPlugin != null) { Context.getExtensions().unloadPlugin(commandsPlugin); } commandsPlugin = Context.getExtensions().loadPlugin(Setup.expandPath("{plugins}/Commands.java")); ((Panel) commandsPlugin).setDetached(true, getTopLevel()); Context.getExtensions().initializePlugin(commandsPlugin); return ((Panel) commandsPlugin); } Plugin recoveryPlugin; Panel showRecoveryPanel() { if (recoveryPlugin != null) { Context.getExtensions().unloadPlugin(recoveryPlugin); } recoveryPlugin = Context.getExtensions().loadPlugin(Setup.expandPath("{plugins}/Recovery.java")); ((Panel) recoveryPlugin).setDetached(true, getTopLevel()); Context.getExtensions().initializePlugin(recoveryPlugin); return ((Panel) recoveryPlugin); } void setDefaultDetail() { JLabel label = new JLabel(); label.setIcon(new javax.swing.ImageIcon(getClass().getResource("/apple_transparent_white_100x50.png"))); JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); panel.add(label); setDetail(panel); //setContext(label); } void setDetail(Component c) { panelDetail.removeAll(); panelDetail.setLayout(new BorderLayout()); //panelContext.setLayout(new GridBagLayout()); panelDetail.add(c); updateUI(); } Component getDetail() { return this.getComponent(0); } Dimension getDetailSize() { return panelDetail.getSize(); } final int COLUMN_PUCK_ADDRESS = 3; final int COLUMN_SAMPLE_POSITION = 5; void setSamplesTable(Object[][] sampleData) { if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(()->{ setSamplesTable(sampleData); }); return; } tableSamples.setModel(new DefaultTableModel( sampleData, new String[]{ //"User Name", "Dewar Name", "Puck Name", "User Name", "Puck Id", "Puck Address", "Sample Name", "Sample Position", "Sample Id", "Sample Status", "Mount Count" } ) { public boolean isCellEditable(int rowIndex, int columnIndex) { return false; } } ); if (isRt()){ for (int i=0; i<3; i++){ tableSamples.getColumnModel().getColumn(i).setMinWidth(0); tableSamples.getColumnModel().getColumn(i).setMaxWidth(0); tableSamples.getColumnModel().getColumn(i).setWidth(0); } } } void onSelectionChanged(String segment, Integer puck, Integer sample) { if (segment != null) { String add = segment + String.valueOf(puck); for (int i = 0; i < tablePucks.getModel().getRowCount(); i++) { if (add.equals(tablePucks.getModel().getValueAt(i, 0))) { if (tablePucks.getSelectedRow() != i) { tablePucks.setRowSelectionInterval(i, i); SwingUtils.scrollToVisible(tablePucks, i, 0); } break; } } for (int i = 0; i < tableSamples.getModel().getRowCount(); i++) { if (add.equals(tableSamples.getModel().getValueAt(i, COLUMN_PUCK_ADDRESS))) { if (sample != null) { if (!sample.equals(tableSamples.getModel().getValueAt(i, COLUMN_SAMPLE_POSITION))) { continue; } } if (tableSamples.getSelectedRow() != i) { tableSamples.setRowSelectionInterval(i, i); SwingUtils.scrollToVisible(tableSamples, i, 0); } break; } } } } public void setPuckDatamatrix(String datamatrix) { if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(()->{ setPuckDatamatrix(datamatrix); }); return; } textPuckDatamatrix.setText((datamatrix == null) ? "" : String.valueOf(datamatrix)); } public void setSampleDatamatrix(String datamatrix) { if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(()->{ setSampleDatamatrix(datamatrix); }); return; } textSampleDatamatrix.setText((datamatrix == null) ? "" : String.valueOf(datamatrix)); } public String getPuckDatamatrix() { String ret = textPuckDatamatrix.getText(); return (ret != null) ? ret.trim() : ""; } public String getSampleDatamatrix() { String ret = textSampleDatamatrix.getText(); return (ret != null) ? ret.trim() : ""; } Chrono expertChrono; final List expertWindows = new ArrayList<>(); void onExpertCommand(Window window) { expertChrono = new Chrono(); if ((window != null) && (!expertWindows.contains(window))) { expertWindows.add(window); } } void onModeChange(boolean expert) { if (expert) { expertChrono = new Chrono(); } else { expertChrono = null; for (Window w : expertWindows) { if ((w != null) && (w.isShowing())) { w.setVisible(false); w.dispose(); } } expertWindows.clear(); } } JDialog samplesDialog; JsonTableEditor openSamplesInfo(){ try{ String file = Setup.expandPath("{context}/samples_info.json"); if (getView()!=null){ for (Editor ed : getView().getEditors()) { if (ed instanceof JsonTableEditor) { if (file.equals(ed.getFileName())){ if (ed.changedOnDisk()){ getView().closeFile(file); } else { getView().selectPanel(ed); return (JsonTableEditor) ed; } } } } } else { if ((samplesDialog!=null) && (samplesDialog.isDisplayable())){ SwingUtils.centerComponent(this, samplesDialog); samplesDialog.requestFocus(); return (JsonTableEditor) SwingUtils.getComponentsByType(samplesDialog, JsonTableEditor.class)[0]; } } String[] columns = new String[]{ "userName", "dewarName", "puckName", "puckType", "puckBarcode", "puckAddress", "sampleName", "samplePosition", "sampleBarcode", "sampleStatus", "sampleMountCount" }; Class[] types = null; Object[] defaults = new Object[]{ null, null, null, isRt() ? "RT" : null, null, null, null, null, null, "Present", 0 }; JsonTableEditor editor = new JsonTableEditor(columns, types); editor.setShowClearButton(true); editor.getDocument().addListener(new DocumentListener() { @Override public void onDocumentChanged(Document doc) { updateSamplesInfoTitle(); } @Override public void onDocumentSaved(Document doc) { try { eval("restore_samples_info()", true); } catch (Exception ex) { showException(ex); } } }); editor.setDefaultValues(defaults); editor.load(file); if (getView()!=null){ getView().openEditor(editor); } else { samplesDialog = showDialog("Samples Info", new Dimension (1000,800), editor); } return editor; } catch (Exception ex) { showException(ex); return null; } } void updateSamplesInfoTitle() { try { if ((samplesInfoEditor!=null) &&(samplesInfoEditor.isDisplayable())){ String title = new File(samplesInfoEditor.getFileName()).getName()+ (samplesInfoEditor.hasChanged() ? "*" : ""); int index = getView().getDocumentsTab().indexOfComponent(samplesInfoEditor); if (index>=0){ if (!title.equals(getView().getDocumentsTab().getTitleAt(index))) { getView().getDocumentsTab().setTitleAt(index, title); SwingUtils.CloseButtonTabComponent tabComponent = (SwingUtils.CloseButtonTabComponent) getView().getDocumentsTab().getTabComponentAt(index); tabComponent.updateUI(); } } } } catch (Exception ex) { getLogger().log(Level.WARNING, null, ex); } } final DeviceListener cover_detection_listener = new DeviceListener() { @Override public void onCacheChanged(Device device, Object value, Object former, long timestamp, boolean valueChange) { Point mm = null; Point det = null; try{ mm = new Point(Array.getInt(value, 4), Array.getInt(value, 5)); det = new Point(Array.getInt(value, 0), Array.getInt(value, 1)); } catch (Exception ex){ } Point fmm = mm; Point fdet = det; SwingUtilities.invokeLater(()->{ if ((value!=null) && (value instanceof String) && ((String)value).toLowerCase().startsWith("no cover")){ textCoverDet.setText("No Cover"); } else { textCoverDet.setText((fmm==null) ? "" :fmm.x + ", " + fmm.y); if ( getState().isReady() && !checkExpert.isSelected() && Boolean.FALSE.equals(Controller.getInstance().isDoorClosed())){ try{ if ((fmm!=null)){ Controller.getInstance().setPuckLoading(false); } else { if (doorsHaveOpened){ doorsHaveOpened=false; Controller.getInstance().setPuckLoading(true); } } } catch (Exception e) { getLogger().log(Level.WARNING, null, e); } } } updateButtonState(); String text = ""; try{ /* Number clearStatus = (Number)eval("get_cover_location_mm(raise_ex=False, print_log=False)[3]", true); switch (clearStatus.intValue()){ case 1: text = "Dewar"; break; case 2: text = "Doors"; break; case 3: text = "Manual"; break; case 4: text = "Task"; break; default: text = ""; } */ } catch (Exception ex) { text = ""; /* try{ Object use_target_cache = eval("use_target_cache", true); if (Boolean.TRUE.equals(use_target_cache)){ text= "Target"; } } catch (Exception e) { } */ } textCoverCache.setText(text); basePlatePanel.basePlateGraphics.setDetection(fdet); }); } }; /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents private void initComponents() { buttonGroup1 = new javax.swing.ButtonGroup(); panelTop = new javax.swing.JPanel(); basePlatePanel = new ch.psi.mxsc.BasePlatePanel(); panelLegend = new javax.swing.JPanel(); ledLidControlActive2 = new ch.psi.pshell.swing.Led(); ledLidControlActive1 = new ch.psi.pshell.swing.Led(); jLabel20 = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); jLabel19 = new javax.swing.JLabel(); ledLidControlActive4 = new ch.psi.pshell.swing.Led(); ledLidControlActive3 = new ch.psi.pshell.swing.Led(); ledLidControlActive5 = new ch.psi.pshell.swing.Led(); jLabel23 = new javax.swing.JLabel(); panelDetection = new javax.swing.JPanel(); buttonSampleLoad = new javax.swing.JButton(); panelCover = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); textCoverDet = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); textCoverCache = new javax.swing.JTextField(); panelViewType = new javax.swing.JPanel(); buttonCamera = new javax.swing.JToggleButton(); buttonDrawing = new javax.swing.JToggleButton(); panelLN2Level = new javax.swing.JPanel(); jPanel3 = new javax.swing.JPanel(); progressLN2 = new javax.swing.JProgressBar(); jLabel4 = new javax.swing.JLabel(); panelStatus = new javax.swing.JPanel(); panelBeamlineStatus = new javax.swing.JPanel(); led5 = new ch.psi.pshell.swing.Led(); led6 = new ch.psi.pshell.swing.Led(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); panelSystemStatus = new javax.swing.JPanel(); ledAirPressure = new ch.psi.pshell.swing.Led(); jLabel24 = new javax.swing.JLabel(); jLabel25 = new javax.swing.JLabel(); ledN2Pressure = new ch.psi.pshell.swing.Led(); jLabel26 = new javax.swing.JLabel(); ledLocalSafety = new ch.psi.pshell.swing.Led(); jLabell21 = new javax.swing.JLabel(); ledPsysSafety = new ch.psi.pshell.swing.Led(); buttonRelease = new javax.swing.JButton(); filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 30), new java.awt.Dimension(0, 30), new java.awt.Dimension(32767, 30)); ledRoomTemperature = new ch.psi.pshell.swing.Led(); labelRoomTemperature = new javax.swing.JLabel(); ledManualMode = new ch.psi.pshell.swing.Led(); labelManualMode = new javax.swing.JLabel(); ledHeaterOk = new ch.psi.pshell.swing.Led(); jLabel29 = new javax.swing.JLabel(); panelHeaterTemp = new ch.psi.pshell.swing.DeviceValuePanel(); ledDryer = new ch.psi.pshell.swing.Led(); jLabel27 = new javax.swing.JLabel(); labelManualMode1 = new javax.swing.JLabel(); ledServiceMode = new ch.psi.pshell.swing.Led(); checkService = new javax.swing.JCheckBox(); panelDatamatrix = new javax.swing.JPanel(); jLabel11 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); textSampleDatamatrix = new javax.swing.JTextField(); textPuckDatamatrix = new javax.swing.JTextField(); panelRight = new javax.swing.JPanel(); panelDetail = new javax.swing.JPanel(); panelDisplayMode = new javax.swing.JPanel(); btViewDewar = new javax.swing.JToggleButton(); btViewRT = new javax.swing.JToggleButton(); panelDevices = new javax.swing.JPanel(); devicesPanel = new ch.psi.mxsc.DevicesPanel(); panelExpert = new javax.swing.JPanel(); checkExpert = new javax.swing.JCheckBox(); buttonExpertCommands = new javax.swing.JButton(); buttonRecovery = new javax.swing.JButton(); buttonConfig = new javax.swing.JButton(); buttonDetectionCalibrate = new javax.swing.JButton(); buttonDetectionExposure = new javax.swing.JButton(); panelBottom = new javax.swing.JPanel(); panelSamples = new javax.swing.JPanel(); panelTableSamples = new javax.swing.JScrollPane(); tableSamples = new javax.swing.JTable(); jPanel4 = new javax.swing.JPanel(); panelTablePucks = new javax.swing.JScrollPane(); tablePucks = new javax.swing.JTable(); setPreferredSize(new java.awt.Dimension(1030, 530)); setRequestFocusEnabled(false); basePlatePanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Dewar")); panelLegend.setBorder(javax.swing.BorderFactory.createTitledBorder("Legend")); ledLidControlActive2.setForeground(new java.awt.Color(128, 232, 152)); ledLidControlActive2.setLedSize(20); ledLidControlActive1.setForeground(new java.awt.Color(192, 128, 128)); ledLidControlActive1.setLedSize(20); jLabel20.setText("Empty"); jLabel15.setText("Error"); jLabel16.setText("Minispine"); jLabel19.setText("Unipuck"); ledLidControlActive4.setForeground(new java.awt.Color(128, 128, 128)); ledLidControlActive4.setLedSize(20); ledLidControlActive3.setForeground(new java.awt.Color(128, 192, 192)); ledLidControlActive3.setLedSize(20); ledLidControlActive5.setForeground(new java.awt.Color(192, 152, 45)); ledLidControlActive5.setLedSize(20); jLabel23.setText("Offline"); javax.swing.GroupLayout panelLegendLayout = new javax.swing.GroupLayout(panelLegend); panelLegend.setLayout(panelLegendLayout); panelLegendLayout.setHorizontalGroup( panelLegendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelLegendLayout.createSequentialGroup() .addContainerGap() .addGroup(panelLegendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelLegendLayout.createSequentialGroup() .addComponent(ledLidControlActive1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel15)) .addGroup(panelLegendLayout.createSequentialGroup() .addComponent(ledLidControlActive2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel16)) .addGroup(panelLegendLayout.createSequentialGroup() .addComponent(ledLidControlActive3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel19)) .addGroup(panelLegendLayout.createSequentialGroup() .addComponent(ledLidControlActive4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel20)) .addGroup(panelLegendLayout.createSequentialGroup() .addComponent(ledLidControlActive5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel23))) .addContainerGap(30, Short.MAX_VALUE)) ); panelLegendLayout.setVerticalGroup( panelLegendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelLegendLayout.createSequentialGroup() .addGap(0, 0, 0) .addGroup(panelLegendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ledLidControlActive4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel20)) .addGap(0, 0, 0) .addGroup(panelLegendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ledLidControlActive3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel19)) .addGap(0, 0, 0) .addGroup(panelLegendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ledLidControlActive2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel16)) .addGap(0, 0, 0) .addGroup(panelLegendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ledLidControlActive1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel15)) .addGap(0, 0, 0) .addGroup(panelLegendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ledLidControlActive5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel23))) ); panelDetection.setBorder(javax.swing.BorderFactory.createTitledBorder("Sample Transfer")); buttonSampleLoad.setText("Load"); buttonSampleLoad.setEnabled(false); buttonSampleLoad.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonSampleLoadActionPerformed(evt); } }); javax.swing.GroupLayout panelDetectionLayout = new javax.swing.GroupLayout(panelDetection); panelDetection.setLayout(panelDetectionLayout); panelDetectionLayout.setHorizontalGroup( panelDetectionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelDetectionLayout.createSequentialGroup() .addContainerGap() .addComponent(buttonSampleLoad, javax.swing.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE) .addContainerGap()) ); panelDetectionLayout.setVerticalGroup( panelDetectionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelDetectionLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(buttonSampleLoad) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); panelCover.setBorder(javax.swing.BorderFactory.createTitledBorder("Cover Detection")); panelCover.setPreferredSize(new java.awt.Dimension(112, 153)); jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText("Image:"); textCoverDet.setEditable(false); textCoverDet.setHorizontalAlignment(javax.swing.JTextField.CENTER); textCoverDet.setDisabledTextColor(new java.awt.Color(0, 0, 0)); textCoverDet.setEnabled(false); textCoverDet.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { textCoverDetActionPerformed(evt); } }); jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel2.setText("Cleared:"); textCoverCache.setEditable(false); textCoverCache.setHorizontalAlignment(javax.swing.JTextField.CENTER); textCoverCache.setDisabledTextColor(new java.awt.Color(0, 0, 0)); textCoverCache.setEnabled(false); javax.swing.GroupLayout panelCoverLayout = new javax.swing.GroupLayout(panelCover); panelCover.setLayout(panelCoverLayout); panelCoverLayout.setHorizontalGroup( panelCoverLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelCoverLayout.createSequentialGroup() .addContainerGap() .addGroup(panelCoverLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(textCoverDet) .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(textCoverCache, javax.swing.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE)) .addContainerGap()) ); panelCoverLayout.setVerticalGroup( panelCoverLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelCoverLayout.createSequentialGroup() .addContainerGap(12, Short.MAX_VALUE) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(textCoverCache, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, 18, Short.MAX_VALUE) .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(textCoverDet, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(12, Short.MAX_VALUE)) ); panelViewType.setBorder(javax.swing.BorderFactory.createTitledBorder("View")); buttonGroup1.add(buttonCamera); buttonCamera.setText("Image"); buttonCamera.setEnabled(false); buttonCamera.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonCameraActionPerformed(evt); } }); buttonGroup1.add(buttonDrawing); buttonDrawing.setText("Design"); buttonDrawing.setEnabled(false); buttonDrawing.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonDrawingActionPerformed(evt); } }); javax.swing.GroupLayout panelViewTypeLayout = new javax.swing.GroupLayout(panelViewType); panelViewType.setLayout(panelViewTypeLayout); panelViewTypeLayout.setHorizontalGroup( panelViewTypeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelViewTypeLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(panelViewTypeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(buttonCamera, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(buttonDrawing, javax.swing.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); panelViewTypeLayout.setVerticalGroup( panelViewTypeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelViewTypeLayout.createSequentialGroup() .addContainerGap() .addComponent(buttonCamera) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(buttonDrawing) .addContainerGap()) ); javax.swing.GroupLayout basePlatePanelLayout = new javax.swing.GroupLayout(basePlatePanel); basePlatePanel.setLayout(basePlatePanelLayout); basePlatePanelLayout.setHorizontalGroup( basePlatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, basePlatePanelLayout.createSequentialGroup() .addContainerGap() .addGroup(basePlatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(panelLegend, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panelDetection, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 242, Short.MAX_VALUE) .addGroup(basePlatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(panelCover, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panelViewType, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); basePlatePanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {panelCover, panelDetection, panelLegend, panelViewType}); basePlatePanelLayout.setVerticalGroup( basePlatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, basePlatePanelLayout.createSequentialGroup() .addGroup(basePlatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(panelViewType, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panelDetection, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(basePlatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(panelLegend, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panelCover, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); basePlatePanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {panelCover, panelLegend}); panelLN2Level.setBorder(javax.swing.BorderFactory.createTitledBorder("LN2 Level")); progressLN2.setMaximum(1000); progressLN2.setOrientation(1); jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/pin3.png"))); // NOI18N javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addGap(0, 0, 0) .addComponent(progressLN2, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(4, 4, 4) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 38, Short.MAX_VALUE) .addGap(0, 0, 0)) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(progressLN2, javax.swing.GroupLayout.DEFAULT_SIZE, 428, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel4) .addGap(2, 2, 2)) ); javax.swing.GroupLayout panelLN2LevelLayout = new javax.swing.GroupLayout(panelLN2Level); panelLN2Level.setLayout(panelLN2LevelLayout); panelLN2LevelLayout.setHorizontalGroup( panelLN2LevelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelLN2LevelLayout.createSequentialGroup() .addContainerGap() .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0)) ); panelLN2LevelLayout.setVerticalGroup( panelLN2LevelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelLN2LevelLayout.createSequentialGroup() .addContainerGap() .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) ); panelBeamlineStatus.setBorder(javax.swing.BorderFactory.createTitledBorder("Beamline Status")); jLabel8.setText("Valve state"); jLabel9.setText("Transfer permitted"); javax.swing.GroupLayout panelBeamlineStatusLayout = new javax.swing.GroupLayout(panelBeamlineStatus); panelBeamlineStatus.setLayout(panelBeamlineStatusLayout); panelBeamlineStatusLayout.setHorizontalGroup( panelBeamlineStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelBeamlineStatusLayout.createSequentialGroup() .addContainerGap() .addGroup(panelBeamlineStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelBeamlineStatusLayout.createSequentialGroup() .addComponent(led5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel8)) .addGroup(panelBeamlineStatusLayout.createSequentialGroup() .addComponent(led6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel9))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); panelBeamlineStatusLayout.setVerticalGroup( panelBeamlineStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelBeamlineStatusLayout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addGroup(panelBeamlineStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(led5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel8)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(panelBeamlineStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(led6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel9)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); panelSystemStatus.setBorder(javax.swing.BorderFactory.createTitledBorder("System Status")); jLabel24.setText("Air Pressure"); jLabel25.setText("N2 Pressure"); jLabel26.setText("Local Safety"); jLabell21.setText("Door Safety"); buttonRelease.setText("Release"); buttonRelease.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonReleaseActionPerformed(evt); } }); labelRoomTemperature.setText("Room Temperature"); labelManualMode.setText("Manual Mode"); jLabel29.setText("Heater"); panelHeaterTemp.setBorder(javax.swing.BorderFactory.createEtchedBorder()); panelHeaterTemp.setDeviceName("rim_heater_temp"); jLabel27.setText("Dryer"); labelManualMode1.setText("Service Mode"); checkService.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { checkServiceActionPerformed(evt); } }); javax.swing.GroupLayout panelSystemStatusLayout = new javax.swing.GroupLayout(panelSystemStatus); panelSystemStatus.setLayout(panelSystemStatusLayout); panelSystemStatusLayout.setHorizontalGroup( panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelSystemStatusLayout.createSequentialGroup() .addGap(10, 10, 10) .addGroup(panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ledAirPressure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ledHeaterOk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ledN2Pressure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ledLocalSafety, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ledRoomTemperature, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ledPsysSafety, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ledManualMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ledDryer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ledServiceMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelSystemStatusLayout.createSequentialGroup() .addComponent(jLabel29) .addGap(18, 18, Short.MAX_VALUE) .addComponent(panelHeaterTemp, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel24) .addComponent(jLabel25) .addComponent(jLabel26) .addComponent(jLabell21) .addComponent(labelRoomTemperature) .addComponent(labelManualMode) .addComponent(jLabel27) .addGroup(panelSystemStatusLayout.createSequentialGroup() .addComponent(labelManualMode1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(checkService))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(panelSystemStatusLayout.createSequentialGroup() .addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(buttonRelease) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); panelSystemStatusLayout.setVerticalGroup( panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelSystemStatusLayout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addGroup(panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ledManualMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(labelManualMode)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ledServiceMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(labelManualMode1)) .addComponent(checkService)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelSystemStatusLayout.createSequentialGroup() .addGroup(panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ledRoomTemperature, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(labelRoomTemperature)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ledHeaterOk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel29))) .addComponent(panelHeaterTemp, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ledAirPressure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel24)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ledN2Pressure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel25)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ledDryer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel27)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ledLocalSafety, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel26)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ledPsysSafety, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabell21)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelSystemStatusLayout.createSequentialGroup() .addComponent(buttonRelease) .addGap(0, 0, Short.MAX_VALUE)) .addComponent(filler1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(4, 4, 4)) ); panelDatamatrix.setBorder(javax.swing.BorderFactory.createTitledBorder("Datamatrix")); jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel11.setText("Puck:"); jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); jLabel13.setText("Sample:"); textSampleDatamatrix.setEditable(false); textSampleDatamatrix.setBackground(new java.awt.Color(214, 217, 223)); textSampleDatamatrix.setHorizontalAlignment(javax.swing.JTextField.CENTER); textPuckDatamatrix.setEditable(false); textPuckDatamatrix.setBackground(new java.awt.Color(214, 217, 223)); textPuckDatamatrix.setHorizontalAlignment(javax.swing.JTextField.CENTER); javax.swing.GroupLayout panelDatamatrixLayout = new javax.swing.GroupLayout(panelDatamatrix); panelDatamatrix.setLayout(panelDatamatrixLayout); panelDatamatrixLayout.setHorizontalGroup( panelDatamatrixLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelDatamatrixLayout.createSequentialGroup() .addContainerGap() .addGroup(panelDatamatrixLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(panelDatamatrixLayout.createSequentialGroup() .addComponent(jLabel11) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(textPuckDatamatrix, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(panelDatamatrixLayout.createSequentialGroup() .addComponent(jLabel13) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(textSampleDatamatrix))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); panelDatamatrixLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel11, jLabel13}); panelDatamatrixLayout.setVerticalGroup( panelDatamatrixLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelDatamatrixLayout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addGroup(panelDatamatrixLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel11) .addComponent(textPuckDatamatrix, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(panelDatamatrixLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel13) .addComponent(textSampleDatamatrix, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 0, Short.MAX_VALUE)) ); javax.swing.GroupLayout panelStatusLayout = new javax.swing.GroupLayout(panelStatus); panelStatus.setLayout(panelStatusLayout); panelStatusLayout.setHorizontalGroup( panelStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(panelBeamlineStatus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panelDatamatrix, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panelSystemStatus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); panelStatusLayout.setVerticalGroup( panelStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelStatusLayout.createSequentialGroup() .addGap(0, 0, 0) .addComponent(panelSystemStatus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(0, 0, 0) .addComponent(panelBeamlineStatus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(0, 0, 0) .addComponent(panelDatamatrix, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); panelDetail.setBorder(javax.swing.BorderFactory.createTitledBorder("Detail")); panelDetail.setPreferredSize(new java.awt.Dimension(300, 95)); javax.swing.GroupLayout panelDetailLayout = new javax.swing.GroupLayout(panelDetail); panelDetail.setLayout(panelDetailLayout); panelDetailLayout.setHorizontalGroup( panelDetailLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE) ); panelDetailLayout.setVerticalGroup( panelDetailLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE) ); panelDisplayMode.setBorder(javax.swing.BorderFactory.createTitledBorder("Mode")); btViewDewar.setSelected(true); btViewDewar.setText("Dewar"); btViewDewar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btViewDewarActionPerformed(evt); } }); btViewRT.setText("Room Temp."); btViewRT.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btViewRTActionPerformed(evt); } }); javax.swing.GroupLayout panelDisplayModeLayout = new javax.swing.GroupLayout(panelDisplayMode); panelDisplayMode.setLayout(panelDisplayModeLayout); panelDisplayModeLayout.setHorizontalGroup( panelDisplayModeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelDisplayModeLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btViewDewar) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btViewRT) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); panelDisplayModeLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {btViewDewar, btViewRT}); panelDisplayModeLayout.setVerticalGroup( panelDisplayModeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelDisplayModeLayout.createSequentialGroup() .addContainerGap() .addGroup(panelDisplayModeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btViewDewar) .addComponent(btViewRT)) .addContainerGap()) ); panelDevices.setBorder(javax.swing.BorderFactory.createTitledBorder("Devices")); panelDevices.setPreferredSize(new java.awt.Dimension(300, 282)); devicesPanel.setActive(false); checkExpert.setText("Expert"); checkExpert.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); checkExpert.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { checkExpertActionPerformed(evt); } }); buttonExpertCommands.setText("Commands"); buttonExpertCommands.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonExpertCommandsActionPerformed(evt); } }); buttonRecovery.setText("Recovery"); buttonRecovery.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonRecoveryActionPerformed(evt); } }); buttonConfig.setText("Settings"); buttonConfig.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonConfigActionPerformed(evt); } }); buttonDetectionCalibrate.setText("Calibrate"); buttonDetectionCalibrate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonDetectionCalibrateActionPerformed(evt); } }); buttonDetectionExposure.setText("Detection"); buttonDetectionExposure.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonDetectionExposureActionPerformed(evt); } }); javax.swing.GroupLayout panelExpertLayout = new javax.swing.GroupLayout(panelExpert); panelExpert.setLayout(panelExpertLayout); panelExpertLayout.setHorizontalGroup( panelExpertLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(checkExpert, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(buttonExpertCommands, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(panelExpertLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(buttonRecovery, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(buttonConfig, javax.swing.GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE) .addComponent(buttonDetectionCalibrate, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(buttonDetectionExposure, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)) ); panelExpertLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonConfig, buttonExpertCommands, buttonRecovery}); panelExpertLayout.setVerticalGroup( panelExpertLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelExpertLayout.createSequentialGroup() .addGap(0, 0, 0) .addComponent(checkExpert) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(buttonExpertCommands) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(buttonRecovery) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(buttonConfig) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(buttonDetectionCalibrate) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(buttonDetectionExposure) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); javax.swing.GroupLayout panelDevicesLayout = new javax.swing.GroupLayout(panelDevices); panelDevices.setLayout(panelDevicesLayout); panelDevicesLayout.setHorizontalGroup( panelDevicesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelDevicesLayout.createSequentialGroup() .addGap(0, 0, 0) .addComponent(devicesPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE) .addComponent(panelExpert, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(26, Short.MAX_VALUE)) ); panelDevicesLayout.setVerticalGroup( panelDevicesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelDevicesLayout.createSequentialGroup() .addContainerGap(10, Short.MAX_VALUE) .addGroup(panelDevicesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(panelExpert, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(devicesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE)) .addContainerGap(9, Short.MAX_VALUE)) ); javax.swing.GroupLayout panelRightLayout = new javax.swing.GroupLayout(panelRight); panelRight.setLayout(panelRightLayout); panelRightLayout.setHorizontalGroup( panelRightLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelRightLayout.createSequentialGroup() .addGap(0, 0, 0) .addGroup(panelRightLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(panelDetail, javax.swing.GroupLayout.DEFAULT_SIZE, 276, Short.MAX_VALUE) .addComponent(panelDisplayMode, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panelDevices, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 276, Short.MAX_VALUE)) .addGap(0, 0, 0)) ); panelRightLayout.setVerticalGroup( panelRightLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelRightLayout.createSequentialGroup() .addGap(0, 0, 0) .addComponent(panelDetail, javax.swing.GroupLayout.DEFAULT_SIZE, 125, Short.MAX_VALUE) .addGap(0, 0, 0) .addComponent(panelDevices, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(panelDisplayMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0)) ); javax.swing.GroupLayout panelTopLayout = new javax.swing.GroupLayout(panelTop); panelTop.setLayout(panelTopLayout); panelTopLayout.setHorizontalGroup( panelTopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelTopLayout.createSequentialGroup() .addGap(0, 0, 0) .addComponent(panelLN2Level, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(panelStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(basePlatePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(panelRight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0)) ); panelTopLayout.setVerticalGroup( panelTopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelTopLayout.createSequentialGroup() .addGap(0, 0, 0) .addGroup(panelTopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(panelRight, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(basePlatePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panelLN2Level, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panelStatus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(0, 0, 0)) ); panelBottom.setPreferredSize(new java.awt.Dimension(810, 150)); panelBottom.setRequestFocusEnabled(false); panelSamples.setBorder(javax.swing.BorderFactory.createTitledBorder("Samples")); tableSamples.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { } )); tableSamples.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); panelTableSamples.setViewportView(tableSamples); javax.swing.GroupLayout panelSamplesLayout = new javax.swing.GroupLayout(panelSamples); panelSamples.setLayout(panelSamplesLayout); panelSamplesLayout.setHorizontalGroup( panelSamplesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelSamplesLayout.createSequentialGroup() .addGap(0, 0, 0) .addComponent(panelTableSamples, javax.swing.GroupLayout.DEFAULT_SIZE, 676, Short.MAX_VALUE) .addGap(0, 0, 0)) ); panelSamplesLayout.setVerticalGroup( panelSamplesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panelSamplesLayout.createSequentialGroup() .addGap(0, 0, 0) .addComponent(panelTableSamples, javax.swing.GroupLayout.DEFAULT_SIZE, 43, Short.MAX_VALUE) .addGap(0, 0, 0)) ); jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Pucks")); tablePucks.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null}, {null, null, null} }, new String [] { "Address", "Status", "Id" } ) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class, java.lang.String.class }; boolean[] canEdit = new boolean [] { false, false, false }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } }); tablePucks.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); panelTablePucks.setViewportView(tablePucks); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGap(0, 0, 0) .addComponent(panelTablePucks, javax.swing.GroupLayout.DEFAULT_SIZE, 328, Short.MAX_VALUE) .addGap(0, 0, 0)) ); jPanel4Layout.setVerticalGroup( jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGap(0, 0, 0) .addComponent(panelTablePucks, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addGap(0, 0, 0)) ); javax.swing.GroupLayout panelBottomLayout = new javax.swing.GroupLayout(panelBottom); panelBottom.setLayout(panelBottomLayout); panelBottomLayout.setHorizontalGroup( panelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelBottomLayout.createSequentialGroup() .addGap(0, 0, 0) .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(panelSamples, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(0, 0, 0)) ); panelBottomLayout.setVerticalGroup( panelBottomLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(panelSamples, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(panelTop, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panelBottom, javax.swing.GroupLayout.DEFAULT_SIZE, 1030, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(panelTop, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(0, 0, 0) .addComponent(panelBottom, javax.swing.GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE) .addGap(1, 1, 1)) ); }// //GEN-END:initComponents private void buttonCameraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCameraActionPerformed setViewCamera(); }//GEN-LAST:event_buttonCameraActionPerformed private void buttonExpertCommandsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonExpertCommandsActionPerformed try { Panel panel = showCommandsPanel(); onExpertCommand(SwingUtils.getWindow(panel)); } catch (Exception ex) { showException(ex); } }//GEN-LAST:event_buttonExpertCommandsActionPerformed //Dialog dlgDetPlot; //Dialog dlgDetText; Dialog dlgDetRenderer; JComponent dlgDetPlotComp; JComponent dlgDetTextComp; JComponent dlgDetRendererComp; private void buttonDetectionCalibrateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonDetectionCalibrateActionPerformed execute("imgproc/CoverCalibration", null, false, true); }//GEN-LAST:event_buttonDetectionCalibrateActionPerformed private void buttonDetectionExposureActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonDetectionExposureActionPerformed try { this.evalAsync("cover_detection.set_renderer(show_panel(img))", true); } catch (Exception ex) { showException(ex); } }//GEN-LAST:event_buttonDetectionExposureActionPerformed private void checkExpertActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkExpertActionPerformed if (checkExpert.isSelected()) { PasswordDialog dlg = new PasswordDialog(getTopLevel(), true, 1234); dlg.setResizable(false); dlg.setLocationRelativeTo(getTopLevel()); dlg.setVisible(true); if (dlg.getResult() == false) { checkExpert.setSelected(false); return; } } setExpertMode(checkExpert.isSelected()); }//GEN-LAST:event_checkExpertActionPerformed private void buttonDrawingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonDrawingActionPerformed setViewDesign(); }//GEN-LAST:event_buttonDrawingActionPerformed private void btViewDewarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btViewDewarActionPerformed btViewRT.setSelected(!btViewDewar.isSelected()); if (btViewRT.isSelected()) { setDefaultDetail(); } updateViewMode(); }//GEN-LAST:event_btViewDewarActionPerformed private void btViewRTActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btViewRTActionPerformed btViewDewar.setSelected(!btViewRT.isSelected()); if (btViewRT.isSelected()) { setDefaultDetail(); } updateViewMode(); }//GEN-LAST:event_btViewRTActionPerformed private void buttonRecoveryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRecoveryActionPerformed try { Panel panel = showRecoveryPanel(); onExpertCommand(SwingUtils.getWindow(panel)); } catch (Exception ex) { showException(ex); } }//GEN-LAST:event_buttonRecoveryActionPerformed private void buttonConfigActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonConfigActionPerformed onExpertCommand(null); boolean current = false; try { current = "true".equalsIgnoreCase(getSetting("valve_control")); } catch (Exception ex) { } showSettingsEditor(true); //Check if must open valve if (current) { SwingUtilities.invokeLater(() -> { try { boolean valveControl = "true".equalsIgnoreCase(getSetting("valve_control")); if (!valveControl) { execute("open_valve()", true); } } catch (Exception ex) { getLogger().log(Level.WARNING, null, ex); } }); } }//GEN-LAST:event_buttonConfigActionPerformed private void buttonReleaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonReleaseActionPerformed execute("release_safety()", true); }//GEN-LAST:event_buttonReleaseActionPerformed private void textCoverDetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textCoverDetActionPerformed // TODO add your handling code here: }//GEN-LAST:event_textCoverDetActionPerformed private void checkServiceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkServiceActionPerformed try { if (!updating){ Controller.getInstance().setServiceMode(checkService.isSelected()); } } catch (Exception ex) { showException(ex); } }//GEN-LAST:event_checkServiceActionPerformed private void buttonSampleLoadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSampleLoadActionPerformed try { Controller.getInstance().setPuckLoading(true); } catch (Exception ex) { showException(ex); } }//GEN-LAST:event_buttonSampleLoadActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables ch.psi.mxsc.BasePlatePanel basePlatePanel; private javax.swing.JToggleButton btViewDewar; private javax.swing.JToggleButton btViewRT; private javax.swing.JToggleButton buttonCamera; private javax.swing.JButton buttonConfig; private javax.swing.JButton buttonDetectionCalibrate; private javax.swing.JButton buttonDetectionExposure; private javax.swing.JToggleButton buttonDrawing; private javax.swing.JButton buttonExpertCommands; private javax.swing.ButtonGroup buttonGroup1; private javax.swing.JButton buttonRecovery; private javax.swing.JButton buttonRelease; private javax.swing.JButton buttonSampleLoad; private javax.swing.JCheckBox checkExpert; private javax.swing.JCheckBox checkService; private ch.psi.mxsc.DevicesPanel devicesPanel; private javax.swing.Box.Filler filler1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel15; private javax.swing.JLabel jLabel16; private javax.swing.JLabel jLabel19; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel20; private javax.swing.JLabel jLabel23; private javax.swing.JLabel jLabel24; private javax.swing.JLabel jLabel25; private javax.swing.JLabel jLabel26; private javax.swing.JLabel jLabel27; private javax.swing.JLabel jLabel29; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JLabel jLabell21; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JLabel labelManualMode; private javax.swing.JLabel labelManualMode1; private javax.swing.JLabel labelRoomTemperature; private ch.psi.pshell.swing.Led led5; private ch.psi.pshell.swing.Led led6; private ch.psi.pshell.swing.Led ledAirPressure; private ch.psi.pshell.swing.Led ledDryer; private ch.psi.pshell.swing.Led ledHeaterOk; private ch.psi.pshell.swing.Led ledLidControlActive1; private ch.psi.pshell.swing.Led ledLidControlActive2; private ch.psi.pshell.swing.Led ledLidControlActive3; private ch.psi.pshell.swing.Led ledLidControlActive4; private ch.psi.pshell.swing.Led ledLidControlActive5; private ch.psi.pshell.swing.Led ledLocalSafety; private ch.psi.pshell.swing.Led ledManualMode; private ch.psi.pshell.swing.Led ledN2Pressure; private ch.psi.pshell.swing.Led ledPsysSafety; private ch.psi.pshell.swing.Led ledRoomTemperature; private ch.psi.pshell.swing.Led ledServiceMode; private javax.swing.JPanel panelBeamlineStatus; private javax.swing.JPanel panelBottom; private javax.swing.JPanel panelCover; private javax.swing.JPanel panelDatamatrix; private javax.swing.JPanel panelDetail; private javax.swing.JPanel panelDetection; private javax.swing.JPanel panelDevices; private javax.swing.JPanel panelDisplayMode; private javax.swing.JPanel panelExpert; private ch.psi.pshell.swing.DeviceValuePanel panelHeaterTemp; private javax.swing.JPanel panelLN2Level; private javax.swing.JPanel panelLegend; private javax.swing.JPanel panelRight; private javax.swing.JPanel panelSamples; private javax.swing.JPanel panelStatus; private javax.swing.JPanel panelSystemStatus; private javax.swing.JScrollPane panelTablePucks; private javax.swing.JScrollPane panelTableSamples; private javax.swing.JPanel panelTop; private javax.swing.JPanel panelViewType; private javax.swing.JProgressBar progressLN2; private javax.swing.JTable tablePucks; private javax.swing.JTable tableSamples; private javax.swing.JTextField textCoverCache; private javax.swing.JTextField textCoverDet; private javax.swing.JTextField textPuckDatamatrix; private javax.swing.JTextField textSampleDatamatrix; // End of variables declaration//GEN-END:variables }