Preliminary implementation of SwissMX RT

This commit is contained in:
2023-04-26 09:22:59 +02:00
parent f961ee0758
commit a904eac8eb
9 changed files with 321 additions and 137 deletions

View File

@@ -134,18 +134,36 @@ public class BasePlate extends DeviceBase {
new PointDouble(-129.9, -150),
new PointDouble(-64.95, -187.5),
};
final static PointDouble[] pucksPositionRt = new PointDouble[]{
new PointDouble(0, 150),
new PointDouble(-130, 75),
new PointDouble(-130, -75),
new PointDouble(0, -150),
new PointDouble(130, -75),
new PointDouble(130, 75)
};
//TODO: Fix SF only to change address based on BASE_PLATE_LAYOUT
final static PointDouble[] pucksPosition =
(MainPanel.BASE_PLATE_LAYOUT == BasePlateLayout.normal) ? pucksPositionNormal :
((MainPanel.BASE_PLATE_LAYOUT == BasePlateLayout.sf) ? pucksPositionSf : pucksPosition6s );
( (MainPanel.BASE_PLATE_LAYOUT == BasePlateLayout.sf) ? pucksPositionSf :
((MainPanel.BASE_PLATE_LAYOUT == BasePlateLayout.rt) ? pucksPositionRt : pucksPosition6s)
);
final static int numberOfPucks = pucksPosition.length;
final static int numberOfSegments = 6;
final static int numberOfPucksPerSegments = numberOfPucks/numberOfSegments;
//final static DimensionDouble size = new DimensionDouble(580.0, 580.0);
final static DimensionDouble size = new DimensionDouble(470.0, 470.0);
BasePlate() {
super("BasePlate", new BasePlateConfig());
if (MainPanel.BASE_PLATE_LAYOUT == BasePlateLayout.rt){
//Controller.getInstance().getContext().getDevicePool().removeDevice("puck_detection");
}
ArrayList<Puck> pucks = new ArrayList<>();
for (int i = 0; i < numberOfPucks; i++) {
new Puck(this, i);
@@ -193,7 +211,7 @@ public class BasePlate extends DeviceBase {
Puck.Detection[] getDetection() {
Puck.Detection[] ret = new Puck.Detection[Controller.NUMBER_OF_PUCKS];
for (int i = 0; i < ret.length; i++) {
ret[i] = getPucks()[i].detection;
ret[i] = getPucks()[i].getDetection();
}
return ret;
}