Display user name
This commit is contained in:
@@ -281,7 +281,7 @@ public class BasePlate extends DeviceBase {
|
||||
public void clearId(String id) {
|
||||
for (Device d : getChildren()) {
|
||||
if (d instanceof Puck) {
|
||||
if ((id == null) || id.equals(((Puck) d).getId())) {
|
||||
if ((id == null) || Puck.isSameId(id, ((Puck) d).getId())) {
|
||||
((Puck) d).setId(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="text" type="java.lang.String" value="Cache"/>
|
||||
<Property name="text" type="java.lang.String" value="Cleared:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="textCoverCache">
|
||||
@@ -432,6 +432,7 @@
|
||||
<ComponentRef name="buttonGroup1"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Image"/>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonCameraActionPerformed"/>
|
||||
@@ -443,6 +444,7 @@
|
||||
<ComponentRef name="buttonGroup1"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Design"/>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonDrawingActionPerformed"/>
|
||||
|
||||
@@ -407,13 +407,15 @@ public class MainPanel extends Panel {
|
||||
});
|
||||
updateDryer(((Device) getDevice("gripper_dryer")).take());
|
||||
|
||||
((Device) getDevice("feedback_psys_safety")).addListener(new DeviceAdapter() {
|
||||
Device feedback_psys_safety = ((Device) getDevice("feedback_psys_safety"));
|
||||
feedback_psys_safety.addListener(new DeviceAdapter() {
|
||||
@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 DeviceAdapter() {
|
||||
@Override
|
||||
@@ -604,7 +606,7 @@ public class MainPanel extends Panel {
|
||||
}
|
||||
|
||||
void updateButtonState(){
|
||||
boolean doors_open = !Controller.getInstance().isDoorClosed();
|
||||
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());
|
||||
@@ -850,7 +852,7 @@ public class MainPanel extends Panel {
|
||||
sampleData,
|
||||
new String[]{
|
||||
//"User Name", "Dewar Name",
|
||||
"Puck Name", "Puck Type", "Puck Id", "Puck Address",
|
||||
"Puck Name", "User Name", "Puck Id", "Puck Address",
|
||||
"Sample Name", "Sample Position", "Sample Id", "Sample Status", "Mount Count"
|
||||
}
|
||||
) {
|
||||
@@ -1061,20 +1063,30 @@ public class MainPanel extends Panel {
|
||||
}
|
||||
}
|
||||
updateButtonState();
|
||||
String text;
|
||||
try {
|
||||
List cache = (List)eval("get_cover_location_cache()", true);
|
||||
text = cache.get(0) + ", " +cache.get(1);
|
||||
text= "Robot";
|
||||
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);
|
||||
|
||||
@@ -1307,7 +1319,7 @@ public class MainPanel extends Panel {
|
||||
});
|
||||
|
||||
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
jLabel2.setText("Cache");
|
||||
jLabel2.setText("Cleared:");
|
||||
|
||||
textCoverCache.setEditable(false);
|
||||
textCoverCache.setHorizontalAlignment(javax.swing.JTextField.CENTER);
|
||||
@@ -1345,6 +1357,7 @@ public class MainPanel extends Panel {
|
||||
|
||||
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);
|
||||
@@ -1353,6 +1366,7 @@ public class MainPanel extends Panel {
|
||||
|
||||
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);
|
||||
|
||||
@@ -353,6 +353,18 @@ public class Puck extends DeviceBase {
|
||||
}
|
||||
id = value;
|
||||
}
|
||||
|
||||
public static boolean isSameId(String id1, String id2){
|
||||
return id1.equals(id2) || BarcodeMatcher.matchBarcodes(id1,id2);
|
||||
}
|
||||
|
||||
public static boolean hasSameId(Puck p1, Puck p2){
|
||||
return isSameId(p1.getId(), p2.getId());
|
||||
}
|
||||
|
||||
public boolean hasSameId(Puck p){
|
||||
return isSameId(getId(), p.getId());
|
||||
}
|
||||
|
||||
public char getSegment() {
|
||||
return segment;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
@@ -32,7 +32,6 @@
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="labelSuggestion" max="32767" attributes="0"/>
|
||||
<Component id="panelTable" pref="484" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel1" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
@@ -45,8 +44,12 @@
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="textDetectedPuck" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="panelTable" pref="531" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="labelStatus" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
@@ -115,7 +118,8 @@
|
||||
<Font name="Lucida Grande" size="30" style="0"/>
|
||||
</Property>
|
||||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||||
<Table columnCount="3" rowCount="0">
|
||||
<Table columnCount="4" rowCount="0">
|
||||
<Column editable="false" title="User" type="java.lang.String"/>
|
||||
<Column editable="false" title="Dewar" type="java.lang.String"/>
|
||||
<Column editable="false" title="Puck Id/Datamatrix" type="java.lang.String"/>
|
||||
<Column editable="false" title="Puck Position" type="java.lang.String"/>
|
||||
|
||||
@@ -24,9 +24,10 @@ public class PuckLoadingDialog extends JDialog {
|
||||
DefaultTableModel model;
|
||||
final boolean load;
|
||||
|
||||
final int INDEX_DEWAR = 0;
|
||||
final int INDEX_DATAMATRIX = 1;
|
||||
final int INDEX_POSITION = 2;
|
||||
final int INDEX_USER = 0;
|
||||
final int INDEX_DEWAR = 1;
|
||||
final int INDEX_DATAMATRIX = 2;
|
||||
final int INDEX_POSITION = 3;
|
||||
/**
|
||||
* Creates new form PuckLoadingDialog
|
||||
*/
|
||||
@@ -75,15 +76,17 @@ public class PuckLoadingDialog extends JDialog {
|
||||
if (keys.length != model.getRowCount()){
|
||||
model.setRowCount(keys.length);
|
||||
}
|
||||
for (int i=0; i< keys.length; i++) {
|
||||
for (int i=0; i< keys.length; i++) {
|
||||
model.setValueAt(keys[i], i, INDEX_DATAMATRIX);
|
||||
try{
|
||||
Map info = (Map) dms.get(keys[i]);
|
||||
model.setValueAt(info.get("address"), i, INDEX_POSITION);
|
||||
model.setValueAt(info.get("dewar"), i, INDEX_DEWAR);
|
||||
model.setValueAt(info.get("user"), i, INDEX_USER);
|
||||
} catch (Exception ex){
|
||||
model.setValueAt("Unknown", i, INDEX_POSITION);
|
||||
model.setValueAt("Unknown", i, INDEX_DEWAR);
|
||||
model.setValueAt("Unknown", i, INDEX_USER);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -260,14 +263,14 @@ public class PuckLoadingDialog extends JDialog {
|
||||
|
||||
},
|
||||
new String [] {
|
||||
"Dewar", "Puck Id/Datamatrix", "Puck Position"
|
||||
"User", "Dewar", "Puck Id/Datamatrix", "Puck Position"
|
||||
}
|
||||
) {
|
||||
Class[] types = new Class [] {
|
||||
java.lang.String.class, java.lang.String.class, java.lang.String.class
|
||||
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
|
||||
};
|
||||
boolean[] canEdit = new boolean [] {
|
||||
false, false, false
|
||||
false, false, false, false
|
||||
};
|
||||
|
||||
public Class getColumnClass(int columnIndex) {
|
||||
@@ -329,7 +332,6 @@ public class PuckLoadingDialog extends JDialog {
|
||||
.addComponent(buttonSet, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addComponent(labelSuggestion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(panelTable, javax.swing.GroupLayout.DEFAULT_SIZE, 484, Short.MAX_VALUE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
@@ -339,7 +341,10 @@ public class PuckLoadingDialog extends JDialog {
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jLabel2)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(textDetectedPuck)))
|
||||
.addComponent(textDetectedPuck))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(panelTable, javax.swing.GroupLayout.DEFAULT_SIZE, 531, Short.MAX_VALUE)
|
||||
.addGap(14, 14, 14)))
|
||||
.addContainerGap())
|
||||
.addComponent(labelStatus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
);
|
||||
|
||||
@@ -23,8 +23,8 @@ public class SampleInfo extends HashMap {
|
||||
|
||||
Object[] getData() {
|
||||
return new Object[]{
|
||||
//getStr("userName"), getStr("dewarName"),
|
||||
getStr("puckName"), getEnum("puckType", PuckType.class, PuckType.Unknown), getStr("puckBarcode"), getStr("puckAddress"),
|
||||
//), getStr("dewarName"), getEnum("puckType", PuckType.class, PuckType.Unknown)
|
||||
getStr("puckName"), getStr("userName"), getStr("puckBarcode"), getStr("puckAddress"),
|
||||
getStr("sampleName"), getInt("samplePosition"), getStr("sampleBarcode"), getEnum("sampleStatus", SampleStatus.class, SampleStatus.Unknown), getInt("sampleMountCount")
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user