This commit is contained in:
@@ -91,6 +91,43 @@ public class Controller {
|
||||
this.mainFrame = (MainPanel) mainFrame;
|
||||
instance = this;
|
||||
clearPuckStates();
|
||||
|
||||
basePlate.addListener(new DeviceAdapter() {
|
||||
@Override
|
||||
public void onValueChanged(Device device, Object value, Object former) {
|
||||
if (value!=null){
|
||||
String segment = ((Object[])value)[0].toString();
|
||||
Integer puck = (Integer) ((Object[])value)[1];
|
||||
Integer sample = (Integer) ((Object[])value)[2];
|
||||
Controller.this.mainFrame.onSelectionChanged(segment, puck, sample);
|
||||
} else {
|
||||
Controller.this.mainFrame.onSelectionChanged(null,null,null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String getCurrentSelection(){
|
||||
Object value = basePlate.take();
|
||||
if (value!=null){
|
||||
String segment = ((Object[])value)[0].toString();
|
||||
Integer puck = (Integer) ((Object[])value)[1];
|
||||
Integer sample = (Integer) ((Object[])value)[2];
|
||||
String ret = segment + String.valueOf(puck);
|
||||
if (sample!=null){
|
||||
ret = ret + String.valueOf(sample);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void selectPuck(Puck puck){
|
||||
getMainFrame().basePlatePanel.selectPuck(puck);
|
||||
}
|
||||
|
||||
public void selectSample(Sample sample){
|
||||
getMainFrame().basePlatePanel.selectSample(sample);
|
||||
}
|
||||
|
||||
//public Panel getMainFrame() {
|
||||
@@ -109,6 +146,7 @@ public class Controller {
|
||||
}
|
||||
getMainFrame().addDevice(basePlate);
|
||||
|
||||
|
||||
|
||||
if (puckSensorAccess == PuckSensorAccess.Esera) {
|
||||
getMainFrame().getContext().getDevicePool().addListener(new DevicePoolListener() {
|
||||
|
||||
Reference in New Issue
Block a user