MainPanel prototype
This commit is contained in:
@@ -9,6 +9,8 @@ import ch.psi.pshell.device.Device;
|
||||
import ch.psi.pshell.device.DeviceAdapter;
|
||||
import ch.psi.pshell.device.DeviceListener;
|
||||
import ch.psi.pshell.device.GenericDevice;
|
||||
import ch.psi.pshell.device.ProcessVariableBase;
|
||||
import ch.psi.pshell.device.ReadbackDevice;
|
||||
import ch.psi.pshell.ui.Panel;
|
||||
import ch.psi.utils.State;
|
||||
|
||||
@@ -28,7 +30,7 @@ public class Controller {
|
||||
static void createInstance(Panel mainFrame){
|
||||
instance = new Controller(mainFrame);
|
||||
}
|
||||
|
||||
|
||||
enum PuckSensorAccess{
|
||||
RaspberryPi,
|
||||
Esera;
|
||||
@@ -136,7 +138,16 @@ public class Controller {
|
||||
}
|
||||
|
||||
|
||||
public String getHexaposiPosition(){
|
||||
return (String) hexaposi.take();
|
||||
public String getHexiposiPosition(){
|
||||
return (String) ((ReadbackDevice)hexaposi).getReadback().take();
|
||||
}
|
||||
|
||||
public Boolean isLedRoomTemp(){
|
||||
try{
|
||||
return ((ProcessVariableBase)getMainFrame().getDevice("led_ctrl_1")).getConfig().maxValue <= 0.50;
|
||||
} catch (Exception ex){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -67,7 +67,6 @@
|
||||
<Component class="ch.psi.pshell.swing.Led" name="ledD">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="ledSize" type="int" value="18"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.Box$Filler" name="filler7">
|
||||
@@ -75,7 +74,6 @@
|
||||
<Component class="ch.psi.pshell.swing.Led" name="ledC">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="ledSize" type="int" value="18"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.Box$Filler" name="filler6">
|
||||
@@ -91,7 +89,6 @@
|
||||
<Component class="ch.psi.pshell.swing.Led" name="ledE">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="ledSize" type="int" value="18"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.Box$Filler" name="filler10">
|
||||
@@ -128,7 +125,6 @@
|
||||
<Component class="ch.psi.pshell.swing.Led" name="ledB">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="ledSize" type="int" value="18"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.Box$Filler" name="filler3">
|
||||
@@ -144,7 +140,6 @@
|
||||
<Component class="ch.psi.pshell.swing.Led" name="ledF">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="ledSize" type="int" value="18"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.Box$Filler" name="filler2">
|
||||
@@ -160,7 +155,6 @@
|
||||
<Component class="ch.psi.pshell.swing.Led" name="ledA">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="ledSize" type="int" value="18"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.Box$Filler" name="filler1">
|
||||
|
||||
@@ -68,17 +68,14 @@ public class HexiposiPanel extends DevicePanel {
|
||||
circlePanel2.add(filler8);
|
||||
|
||||
ledD.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
ledD.setLedSize(18);
|
||||
circlePanel2.add(ledD);
|
||||
circlePanel2.add(filler7);
|
||||
|
||||
ledC.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
ledC.setLedSize(18);
|
||||
circlePanel2.add(ledC);
|
||||
circlePanel2.add(filler6);
|
||||
|
||||
ledE.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
ledE.setLedSize(18);
|
||||
circlePanel2.add(ledE);
|
||||
circlePanel2.add(filler10);
|
||||
|
||||
@@ -89,17 +86,14 @@ public class HexiposiPanel extends DevicePanel {
|
||||
circlePanel2.add(filler4);
|
||||
|
||||
ledB.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
ledB.setLedSize(18);
|
||||
circlePanel2.add(ledB);
|
||||
circlePanel2.add(filler3);
|
||||
|
||||
ledF.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
ledF.setLedSize(18);
|
||||
circlePanel2.add(ledF);
|
||||
circlePanel2.add(filler2);
|
||||
|
||||
ledA.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
ledA.setLedSize(18);
|
||||
circlePanel2.add(ledA);
|
||||
circlePanel2.add(filler1);
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace pref="487" max="32767" attributes="0"/>
|
||||
<Component id="buttonCamera" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@@ -93,7 +93,7 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="buttonCamera" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="636" max="32767" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -292,15 +292,33 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonExpert" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="buttonExpert" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JButton" name="buttonExpert">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Expert "/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonExpertActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel4">
|
||||
<Properties>
|
||||
@@ -314,22 +332,29 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="ledFillingControl" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="64" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="ledFillingDewar" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel14" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="deviceValuePanel1" pref="0" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="jToggleButton1" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="40" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -347,7 +372,10 @@
|
||||
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="jToggleButton1" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel14" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="deviceValuePanel1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@@ -368,9 +396,19 @@
|
||||
<Property name="text" type="java.lang.String" value="Currently Filling"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JToggleButton" name="jToggleButton1">
|
||||
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="deviceValuePanel1">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Activate"/>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
|
||||
<EtchetBorder/>
|
||||
</Border>
|
||||
</Property>
|
||||
<Property name="deviceName" type="java.lang.String" value="rim_heater_temp"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel14">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Temperature:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
@@ -402,7 +440,7 @@
|
||||
</Group>
|
||||
<Component id="buttonInitHexiposi" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="28" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="40" max="32767" attributes="0"/>
|
||||
<Component id="jPanel9" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@@ -512,7 +550,7 @@
|
||||
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace pref="44" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="59" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -581,7 +619,7 @@
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel13" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textSample" pref="175" max="32767" attributes="0"/>
|
||||
<Component id="textSample" pref="187" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel12" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
@@ -591,7 +629,7 @@
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel11" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textType" pref="141" max="32767" attributes="0"/>
|
||||
<Component id="textType" pref="187" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
@@ -680,7 +718,7 @@
|
||||
<Component id="jLabel18" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace pref="40" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="52" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
package ch.psi.mxsc;
|
||||
|
||||
import ch.psi.pshell.core.Context;
|
||||
import ch.psi.pshell.device.Device;
|
||||
import ch.psi.pshell.device.DeviceAdapter;
|
||||
import ch.psi.pshell.device.DeviceListener;
|
||||
@@ -11,10 +12,13 @@ import ch.psi.pshell.imaging.Source;
|
||||
import ch.psi.pshell.ui.Panel;
|
||||
import ch.psi.utils.State;
|
||||
import java.awt.Color;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.script.ScriptException;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -67,7 +71,7 @@ public class MainPanel extends Panel {
|
||||
updateHexiposiState(((Device) getDevice("hexiposi")).getState());
|
||||
|
||||
}
|
||||
|
||||
|
||||
void updateLevel(Object value){
|
||||
if ((value == null) || !(value instanceof Number)){
|
||||
progressLN2.setIndeterminate(true);
|
||||
@@ -75,6 +79,15 @@ public class MainPanel extends Panel {
|
||||
progressLN2.setIndeterminate(false);
|
||||
double val = ((Number)value).doubleValue() * 10.0;
|
||||
progressLN2.setValue(Math.min(Math.max((int)val, 0), 1000));
|
||||
}
|
||||
|
||||
Boolean roomTemp = (Controller.getInstance().isLedRoomTemp());
|
||||
if (roomTemp==null){
|
||||
((TitledBorder)panelDewar.getBorder()).setTitle("Dewar Light");
|
||||
} else if (roomTemp==true){
|
||||
((TitledBorder)panelDewar.getBorder()).setTitle("Dewar Light (room temperature)");
|
||||
} else {
|
||||
((TitledBorder)panelDewar.getBorder()).setTitle("Dewar Light (LN2)");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,8 +112,8 @@ public class MainPanel extends Panel {
|
||||
}
|
||||
|
||||
void updateHexiposiState(State state){
|
||||
ledLidControlActive.setColor(state == State.Offline ? Color.BLACK : Color.GREEN);
|
||||
ledLidInitialized.setColor(state.isNormal() ? Color.GREEN : Color.BLACK);
|
||||
ledLidControlActive.setColor(state.isInitialized() ? Color.GREEN : Color.BLACK );
|
||||
ledLidInitialized.setColor((state.isNormal()&& state !=State.Disabled) ? Color.GREEN : Color.BLACK);
|
||||
}
|
||||
|
||||
|
||||
@@ -130,12 +143,14 @@ public class MainPanel extends Panel {
|
||||
progressWater = new javax.swing.JProgressBar();
|
||||
roomTempBasePlatePanel1 = new ch.psi.mxsc.RoomTempBasePlatePanel();
|
||||
jPanel5 = new javax.swing.JPanel();
|
||||
buttonExpert = new javax.swing.JButton();
|
||||
jPanel4 = new javax.swing.JPanel();
|
||||
ledFillingControl = new ch.psi.pshell.swing.Led();
|
||||
ledFillingDewar = new ch.psi.pshell.swing.Led();
|
||||
jLabel4 = new javax.swing.JLabel();
|
||||
jLabel5 = new javax.swing.JLabel();
|
||||
jToggleButton1 = new javax.swing.JToggleButton();
|
||||
deviceValuePanel1 = new ch.psi.pshell.swing.DeviceValuePanel();
|
||||
jLabel14 = new javax.swing.JLabel();
|
||||
jPanel6 = new javax.swing.JPanel();
|
||||
ledLidControlActive = new ch.psi.pshell.swing.Led();
|
||||
jLabel6 = new javax.swing.JLabel();
|
||||
@@ -178,7 +193,7 @@ public class MainPanel extends Panel {
|
||||
basePlatePanel.setLayout(basePlatePanelLayout);
|
||||
basePlatePanelLayout.setHorizontalGroup(
|
||||
basePlatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, basePlatePanelLayout.createSequentialGroup()
|
||||
.addGroup(basePlatePanelLayout.createSequentialGroup()
|
||||
.addContainerGap(487, Short.MAX_VALUE)
|
||||
.addComponent(buttonCamera))
|
||||
);
|
||||
@@ -186,7 +201,7 @@ public class MainPanel extends Panel {
|
||||
basePlatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(basePlatePanelLayout.createSequentialGroup()
|
||||
.addComponent(buttonCamera)
|
||||
.addGap(0, 636, Short.MAX_VALUE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("LN2 Level"));
|
||||
@@ -212,7 +227,7 @@ public class MainPanel extends Panel {
|
||||
.addGap(4, 4, 4)
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(jSeparator2)
|
||||
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 35, Short.MAX_VALUE)))
|
||||
.addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE)))
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
@@ -291,15 +306,28 @@ public class MainPanel extends Panel {
|
||||
|
||||
jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Robot Arm"));
|
||||
|
||||
buttonExpert.setText("Expert ");
|
||||
buttonExpert.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonExpertActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
|
||||
jPanel5.setLayout(jPanel5Layout);
|
||||
jPanel5Layout.setHorizontalGroup(
|
||||
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addGroup(jPanel5Layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonExpert)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel5Layout.setVerticalGroup(
|
||||
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addGroup(jPanel5Layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonExpert)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("LN2 Control"));
|
||||
@@ -308,7 +336,10 @@ public class MainPanel extends Panel {
|
||||
|
||||
jLabel5.setText("Currently Filling");
|
||||
|
||||
jToggleButton1.setText("Activate");
|
||||
deviceValuePanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
deviceValuePanel1.setDeviceName("rim_heater_temp");
|
||||
|
||||
jLabel14.setText("Temperature:");
|
||||
|
||||
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
|
||||
jPanel4.setLayout(jPanel4Layout);
|
||||
@@ -320,13 +351,18 @@ public class MainPanel extends Panel {
|
||||
.addGroup(jPanel4Layout.createSequentialGroup()
|
||||
.addComponent(ledFillingControl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel4))
|
||||
.addComponent(jLabel4)
|
||||
.addContainerGap(64, Short.MAX_VALUE))
|
||||
.addGroup(jPanel4Layout.createSequentialGroup()
|
||||
.addComponent(ledFillingDewar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel5))
|
||||
.addComponent(jToggleButton1))
|
||||
.addContainerGap(40, Short.MAX_VALUE))
|
||||
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel4Layout.createSequentialGroup()
|
||||
.addComponent(jLabel14)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(deviceValuePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
.addComponent(jLabel5)))))
|
||||
);
|
||||
jPanel4Layout.setVerticalGroup(
|
||||
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
@@ -340,7 +376,9 @@ public class MainPanel extends Panel {
|
||||
.addComponent(ledFillingDewar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel5))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(jToggleButton1)
|
||||
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel14)
|
||||
.addComponent(deviceValuePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
@@ -390,7 +428,7 @@ public class MainPanel extends Panel {
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel7))
|
||||
.addComponent(buttonInitHexiposi))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 40, Short.MAX_VALUE)
|
||||
.addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap())
|
||||
);
|
||||
@@ -438,7 +476,7 @@ public class MainPanel extends Panel {
|
||||
.addComponent(led7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel10)))
|
||||
.addContainerGap(44, Short.MAX_VALUE))
|
||||
.addContainerGap(59, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel7Layout.setVerticalGroup(
|
||||
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
@@ -482,7 +520,7 @@ public class MainPanel extends Panel {
|
||||
.addGroup(jPanel8Layout.createSequentialGroup()
|
||||
.addComponent(jLabel13)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textSample, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE))
|
||||
.addComponent(textSample, javax.swing.GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE))
|
||||
.addGroup(jPanel8Layout.createSequentialGroup()
|
||||
.addComponent(jLabel12)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
@@ -490,7 +528,7 @@ public class MainPanel extends Panel {
|
||||
.addGroup(jPanel8Layout.createSequentialGroup()
|
||||
.addComponent(jLabel11)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textType, javax.swing.GroupLayout.DEFAULT_SIZE, 141, Short.MAX_VALUE)))
|
||||
.addComponent(textType, javax.swing.GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE)))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
@@ -535,7 +573,7 @@ public class MainPanel extends Panel {
|
||||
.addComponent(led15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel18)))
|
||||
.addContainerGap(40, Short.MAX_VALUE))
|
||||
.addContainerGap(52, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel10Layout.setVerticalGroup(
|
||||
jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
@@ -626,17 +664,28 @@ public class MainPanel extends Panel {
|
||||
}
|
||||
}//GEN-LAST:event_buttonInitHexiposiActionPerformed
|
||||
|
||||
private void buttonExpertActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonExpertActionPerformed
|
||||
try{
|
||||
getContext().getPluginManager().loadInitializePlugin(getContext().getSetup().expandPath("{plugins}/Expert.java"));
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonExpertActionPerformed
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private ch.psi.mxsc.BasePlatePanel basePlatePanel;
|
||||
private javax.swing.JToggleButton buttonCamera;
|
||||
private javax.swing.JButton buttonExpert;
|
||||
private javax.swing.JButton buttonInitHexiposi;
|
||||
private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel1;
|
||||
private ch.psi.mxsc.HexiposiPanel hexiposiPanel;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel10;
|
||||
private javax.swing.JLabel jLabel11;
|
||||
private javax.swing.JLabel jLabel12;
|
||||
private javax.swing.JLabel jLabel13;
|
||||
private javax.swing.JLabel jLabel14;
|
||||
private javax.swing.JLabel jLabel17;
|
||||
private javax.swing.JLabel jLabel18;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
@@ -660,7 +709,6 @@ public class MainPanel extends Panel {
|
||||
private javax.swing.JSeparator jSeparator1;
|
||||
private javax.swing.JSeparator jSeparator2;
|
||||
private javax.swing.JSeparator jSeparator3;
|
||||
private javax.swing.JToggleButton jToggleButton1;
|
||||
private ch.psi.pshell.swing.Led led14;
|
||||
private ch.psi.pshell.swing.Led led15;
|
||||
private ch.psi.pshell.swing.Led led5;
|
||||
|
||||
@@ -112,7 +112,20 @@ public class Puck extends DeviceBase {
|
||||
}
|
||||
|
||||
public boolean isSegmentSelected(){
|
||||
return ("" + getSegment()).equalsIgnoreCase(Controller.getInstance().getHexaposiPosition());
|
||||
/*
|
||||
switch(Integer.valueOf(Controller.getInstance().getHexaposiPosition())){
|
||||
case 1: return getSegment()=='A';
|
||||
case 2: return getSegment()=='B';
|
||||
case 3: return getSegment()=='C';
|
||||
case 4: return getSegment()=='D';
|
||||
case 5: return getSegment()=='E';
|
||||
case 6: return getSegment()=='F';
|
||||
}
|
||||
} catch(Exception ex){
|
||||
}
|
||||
return false;
|
||||
*/
|
||||
return ("" + getSegment()).equalsIgnoreCase(Controller.getInstance().getHexiposiPosition());
|
||||
}
|
||||
|
||||
public boolean isHighlithted(){
|
||||
|
||||
Reference in New Issue
Block a user