Bug fixes and event
This commit is contained in:
@@ -20,9 +20,15 @@ public class BarcodeMatcher {
|
||||
String one = "Astx-0023";
|
||||
String two = "ASTX_0023";
|
||||
String three = "Astx-0032";
|
||||
String four = "Astx0032";
|
||||
String five = "E-07";
|
||||
String six = "E07";
|
||||
|
||||
System.out.println("one == two: " + matchBarcodes(one, two));
|
||||
System.out.println("one == three: " + matchBarcodes(one, three));
|
||||
System.out.println("two == three: " + matchBarcodes(two, three));
|
||||
System.out.println("three == four: " + matchBarcodes(three, four));
|
||||
System.out.println("five == six: " + matchBarcodes(six, five));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -981,6 +981,13 @@ public class Controller {
|
||||
dialogPuckLoading.setVisible(false);
|
||||
dialogPuckLoading.dispose();
|
||||
dialogPuckLoading = null;
|
||||
|
||||
try {
|
||||
List puckInfo = (List) getMainFrame().eval("get_puck_info()", true);
|
||||
Context.getInstance().sendEvent("DewarContentUpdate", puckInfo);
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -546,8 +546,8 @@ public class MainPanel extends Panel {
|
||||
tablePucks.getModel().setValueAt(p.getId(), index, 2);
|
||||
}
|
||||
}
|
||||
|
||||
void updateLevel(Object value) {
|
||||
|
||||
void updateLevel(Object value) {
|
||||
if ((value == null) || !(value instanceof Number)) {
|
||||
progressLN2.setIndeterminate(true);
|
||||
} else {
|
||||
|
||||
@@ -342,11 +342,13 @@ public class Puck extends DeviceBase {
|
||||
}
|
||||
|
||||
public void setId(String value) {
|
||||
for (Device d : getParent().getChildren()) {
|
||||
if (d instanceof Puck) {
|
||||
if (((Puck)d).getId() != null){
|
||||
if (((Puck)d).getId().equals(value)){
|
||||
((Puck)d).setId(null);
|
||||
if (value!=null){
|
||||
for (Device d : getParent().getChildren()) {
|
||||
if (d instanceof Puck) {
|
||||
if (((Puck)d).getId() != null){
|
||||
if (isSameId (((Puck)d).getId(), value)){
|
||||
((Puck)d).setId(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -355,6 +357,9 @@ public class Puck extends DeviceBase {
|
||||
}
|
||||
|
||||
public static boolean isSameId(String id1, String id2){
|
||||
if ((id1==null) || (id2==null)){
|
||||
return false;
|
||||
}
|
||||
return id1.equals(id2) || BarcodeMatcher.matchBarcodes(id1,id2);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user