This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="panelTop" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="panelBottom" pref="91" max="32767" attributes="0"/>
|
||||
<Component id="panelBottom" pref="88" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@@ -93,7 +93,7 @@
|
||||
<Component id="panelDetection" linkSize="23" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="panelLegend" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="251" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="276" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="panelHexiposi" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="panelViewType" linkSize="23" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
@@ -486,7 +486,7 @@
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -605,7 +605,7 @@
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="led5" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
@@ -615,7 +615,7 @@
|
||||
<Component id="led6" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="25" max="32767" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@@ -687,7 +687,7 @@
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
@@ -733,7 +733,7 @@
|
||||
<Component id="buttonRelease" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="filler1" pref="35" max="32767" attributes="0"/>
|
||||
<Component id="filler1" pref="38" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@@ -811,7 +811,7 @@
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel29">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Heater Ok"/>
|
||||
<Property name="text" type="java.lang.String" value="Heater"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="ch.psi.pshell.swing.DeviceValuePanel" name="panelHeaterTemp">
|
||||
@@ -844,7 +844,7 @@
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel11" linkSize="27" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="textType" min="-2" pref="105" max="-2" attributes="0"/>
|
||||
<Component id="textType" min="-2" pref="90" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel13" linkSize="27" min="-2" max="-2" attributes="0"/>
|
||||
@@ -929,9 +929,9 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="panelDetail" pref="96" max="32767" attributes="0"/>
|
||||
<Component id="panelDetail" pref="93" max="32767" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="panelDevices" min="-2" pref="274" max="-2" attributes="0"/>
|
||||
<Component id="panelDevices" min="-2" pref="280" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="panelDisplayMode" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
@@ -1046,10 +1046,10 @@
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<EmptySpace pref="14" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="panelExpert" max="32767" attributes="0"/>
|
||||
<Component id="devicesPanel" pref="229" max="32767" attributes="0"/>
|
||||
<Component id="devicesPanel" pref="232" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@@ -1212,7 +1212,7 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="jScrollPane1" pref="68" max="32767" attributes="0"/>
|
||||
<Component id="jScrollPane1" pref="65" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.awt.Dialog;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.Image;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.swing.GroupLayout;
|
||||
@@ -138,13 +139,25 @@ public class MainPanel extends Panel {
|
||||
public void onValueChanged(Device device, Object value, Object former) {
|
||||
updatePsysSafety(value);
|
||||
}
|
||||
});
|
||||
});
|
||||
updatePsysSafety(((Device) getDevice("feedback_psys_safety")).take());
|
||||
((Device) getDevice("robot")).addListener(new DeviceAdapter() {
|
||||
@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);
|
||||
}
|
||||
Controller.getInstance().updatePuckTypes();
|
||||
startTimer(10000, 10);
|
||||
startTimer(10000, 1000);
|
||||
updateCameraView();
|
||||
refreshSamplesTable();
|
||||
|
||||
@@ -166,23 +179,13 @@ public class MainPanel extends Panel {
|
||||
try {
|
||||
ledHeaterOk.setColor(roomTemperature ? Color.GREEN :( ((Double)panelHeaterTemp.getDevice().take())<20.0 ? Color.RED : Color.GREEN));
|
||||
} catch (Exception ex) {
|
||||
ledHeaterOk.setColor(Color.BLACK);
|
||||
}
|
||||
ledHeaterOk.setColor(Color.BLACK);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
roomTemperature = null;
|
||||
ledRoomTemperature.setColor(Color.BLACK);
|
||||
labelRoomTemperature.setText("Room Temperature");
|
||||
}
|
||||
try {
|
||||
manualMode = Controller.getInstance().isManualMode();
|
||||
ledManualMode.setColor( manualMode ? Color.YELLOW : Color.GREEN);
|
||||
labelManualMode.setText(manualMode ? "Manual Mode" : "Remote Mode");
|
||||
} catch (Exception ex) {
|
||||
manualMode = null;
|
||||
ledManualMode.setColor( Color.BLACK);
|
||||
labelManualMode.setText("Unknown Robot Mode");
|
||||
}
|
||||
updatePsysSafety(((Device) getDevice("feedback_psys_safety")).take());
|
||||
}
|
||||
|
||||
|
||||
@@ -246,6 +249,18 @@ public class MainPanel extends Panel {
|
||||
ledPsysSafety.setColor(Color.RED);
|
||||
}
|
||||
}
|
||||
|
||||
void updateMode(Object value) {
|
||||
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() {
|
||||
Source source = buttonCamera.isSelected() ? (Source) this.getDevice("img") : null;
|
||||
@@ -746,7 +761,7 @@ public class MainPanel extends Panel {
|
||||
.addGroup(basePlatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(panelDetection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(panelLegend, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 251, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 276, Short.MAX_VALUE)
|
||||
.addGroup(basePlatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(panelHexiposi, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(panelViewType, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
@@ -805,7 +820,7 @@ public class MainPanel extends Panel {
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(jSeparator1)
|
||||
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
||||
.addContainerGap())
|
||||
.addGap(0, 0, 0))
|
||||
);
|
||||
jPanel3Layout.setVerticalGroup(
|
||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
@@ -872,7 +887,7 @@ public class MainPanel extends Panel {
|
||||
panelBeamlineStatusLayout.setVerticalGroup(
|
||||
panelBeamlineStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelBeamlineStatusLayout.createSequentialGroup()
|
||||
.addGap(4, 4, 4)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, 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))
|
||||
@@ -880,7 +895,7 @@ public class MainPanel extends Panel {
|
||||
.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(25, Short.MAX_VALUE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
panelSystemStatus.setBorder(javax.swing.BorderFactory.createTitledBorder("System Status"));
|
||||
@@ -904,7 +919,7 @@ public class MainPanel extends Panel {
|
||||
|
||||
labelManualMode.setText("Manual Mode");
|
||||
|
||||
jLabel29.setText("Heater Ok");
|
||||
jLabel29.setText("Heater");
|
||||
|
||||
panelHeaterTemp.setBorder(javax.swing.BorderFactory.createEtchedBorder());
|
||||
panelHeaterTemp.setDeviceName("rim_heater_temp");
|
||||
@@ -945,7 +960,7 @@ public class MainPanel extends Panel {
|
||||
panelSystemStatusLayout.setVerticalGroup(
|
||||
panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelSystemStatusLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(panelSystemStatusLayout.createSequentialGroup()
|
||||
.addGroup(panelSystemStatusLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
@@ -981,7 +996,7 @@ public class MainPanel extends Panel {
|
||||
.addGroup(panelSystemStatusLayout.createSequentialGroup()
|
||||
.addComponent(buttonRelease)
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addComponent(filler1, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE))
|
||||
.addComponent(filler1, javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE))
|
||||
.addGap(4, 4, 4))
|
||||
);
|
||||
|
||||
@@ -1011,7 +1026,7 @@ public class MainPanel extends Panel {
|
||||
.addGroup(panelDatamatrixLayout.createSequentialGroup()
|
||||
.addComponent(jLabel11)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(textType, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(textType, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(panelDatamatrixLayout.createSequentialGroup()
|
||||
.addComponent(jLabel13)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
@@ -1208,10 +1223,10 @@ public class MainPanel extends Panel {
|
||||
panelDevicesLayout.setVerticalGroup(
|
||||
panelDevicesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelDevicesLayout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addContainerGap(14, 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, 229, Short.MAX_VALUE))
|
||||
.addComponent(devicesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
@@ -1231,9 +1246,9 @@ public class MainPanel extends Panel {
|
||||
panelRightLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelRightLayout.createSequentialGroup()
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(panelDetail, javax.swing.GroupLayout.DEFAULT_SIZE, 96, Short.MAX_VALUE)
|
||||
.addComponent(panelDetail, javax.swing.GroupLayout.DEFAULT_SIZE, 93, Short.MAX_VALUE)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(panelDevices, javax.swing.GroupLayout.PREFERRED_SIZE, 274, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.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))
|
||||
@@ -1295,7 +1310,7 @@ public class MainPanel extends Panel {
|
||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 65, Short.MAX_VALUE)
|
||||
.addGap(0, 0, 0))
|
||||
);
|
||||
|
||||
@@ -1402,7 +1417,7 @@ public class MainPanel extends Panel {
|
||||
.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, 91, Short.MAX_VALUE)
|
||||
.addComponent(panelBottom, javax.swing.GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE)
|
||||
.addGap(1, 1, 1))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
Reference in New Issue
Block a user