This commit is contained in:
gac-S_Changer
2018-08-22 08:50:52 +02:00
parent 401d2b10ff
commit b42b1cf988
7 changed files with 133 additions and 27 deletions

View File

@@ -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() {