This commit is contained in:
@@ -5,8 +5,11 @@ package ch.psi.mxsc;
|
||||
|
||||
import ch.psi.pshell.device.Device;
|
||||
import ch.psi.pshell.device.DeviceBase;
|
||||
import ch.psi.pshell.device.DeviceConfig;
|
||||
import ch.psi.pshell.imaging.DimensionDouble;
|
||||
import ch.psi.pshell.imaging.PointDouble;
|
||||
import ch.psi.pshell.swing.DevicePanel;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
@@ -153,10 +156,21 @@ public class Puck extends DeviceBase {
|
||||
final int address;
|
||||
final int number;
|
||||
final double angle;
|
||||
|
||||
public static enum PuckDetectionMode{
|
||||
Inductive,
|
||||
Mechanical,
|
||||
Both
|
||||
}
|
||||
|
||||
public static class PuckConfig extends DeviceConfig{
|
||||
public boolean disabled;
|
||||
public PuckDetectionMode detection = PuckDetectionMode.Both;
|
||||
}
|
||||
|
||||
Puck(BasePlate basePlate, int index) {
|
||||
//super(String.valueOf(index+1));
|
||||
super(SEGMENTS[index] + "" + NUMBERS[index]);
|
||||
super(SEGMENTS[index] + "" + NUMBERS[index], new PuckConfig());
|
||||
this.setParent(basePlate);
|
||||
this.index = index;
|
||||
this.segment = SEGMENTS[index];
|
||||
@@ -168,6 +182,19 @@ public class Puck extends DeviceBase {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PuckConfig getConfig(){
|
||||
return (PuckConfig) super.getConfig();
|
||||
}
|
||||
|
||||
public boolean isDisabled(){
|
||||
return getConfig().disabled;
|
||||
}
|
||||
|
||||
public PuckDetectionMode getDetectionMode(){
|
||||
return getConfig().detection == null ? PuckDetectionMode.Both: getConfig().detection;
|
||||
}
|
||||
|
||||
public BasePlate getBasePlate() {
|
||||
return (BasePlate) getParent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user