This commit is contained in:
gac-S_Changer
2018-07-06 15:42:21 +02:00
parent 86d50a3de0
commit ac65aee710
5 changed files with 129 additions and 51 deletions

View File

@@ -9,10 +9,8 @@ import ch.psi.pshell.core.DevicePoolListener;
import ch.psi.pshell.device.Device;
import ch.psi.pshell.device.DeviceAdapter;
import ch.psi.pshell.device.GenericDevice;
import ch.psi.pshell.device.ProcessVariableBase;
import ch.psi.pshell.device.ReadbackDevice;
import ch.psi.pshell.ui.Panel;
import ch.psi.utils.swing.SwingUtils;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
@@ -212,18 +210,47 @@ public class Controller {
}
}
}
BasePlatePanel puckPanel;
void onPuckPressed(Puck puck){
//getMainFrame().textDetSensors.setText(String.valueOf(puck.getDetection()));
//getMainFrame().textDetImage.setText(String.valueOf(puck.getImageDetection()));
//JPanel panel = new SinglePuckPanel(puck);
//panel.setOpaque(false);
//getMainFrame().setDetail(panel);
if ((puckPanel==null) || (puckPanel != getMainFrame().getDetail())){
puckPanel = new BasePlatePanel();
puckPanel.setMode(BasePlatePanel.Mode.puck);
puckPanel.setDevice((Device) getDevice("BasePlate"));
puckPanel.setEnabled(false); //TODO: Puck cannot be shared between two panels (device store single coordinates foe comparing to click)
getMainFrame().setDetail(puckPanel);
}
}
void onPuckReleased(Puck puck){
if (!puck.isSelected()){
getMainFrame().setDefaultDetail();
puckPanel = null;
}
}
void onSamplePressed(Sample sample){
onPuckPressed(sample.getPuck());
}
void onSampleReleased(Sample sample){
onPuckReleased(sample.getPuck());
}
void onPlatePressed(BasePlate plate){
if (plate.getSelectedPuck() == null){
getMainFrame().setDefaultDetail();
puckPanel = null;
}
}
void onPlateReleased(BasePlate palte){
}
GenericDevice getDevice(String name){
return getMainFrame().getDevice(name);
}