From 4ccd5f6ca196e21c39e7ce8ed2498e606f34224d Mon Sep 17 00:00:00 2001 From: Alexandre Gobbo Date: Fri, 10 Feb 2017 12:07:37 +0100 Subject: [PATCH] Fixes --- src/main/java/ch/psi/plugin/BasePlate.java | 10 ++++++++-- src/main/java/ch/psi/plugin/BasePlatePanel.java | 6 +++--- src/main/java/ch/psi/plugin/Puck.java | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/ch/psi/plugin/BasePlate.java b/src/main/java/ch/psi/plugin/BasePlate.java index d6d8f27..a98c9a3 100644 --- a/src/main/java/ch/psi/plugin/BasePlate.java +++ b/src/main/java/ch/psi/plugin/BasePlate.java @@ -7,6 +7,7 @@ import ch.psi.pshell.device.Device; import ch.psi.pshell.device.DeviceBase; import ch.psi.pshell.imaging.DimensionDouble; import ch.psi.pshell.imaging.PointDouble; +import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Rectangle; @@ -34,7 +35,7 @@ public class BasePlate extends DeviceBase { new PointDouble(129.9, -150), new PointDouble(64.95, -187.5), new PointDouble(64.95, -112.5), - new PointDouble(0, -57), + new PointDouble(0, -75), new PointDouble(0, -150), new PointDouble(-64.95, -187.5), new PointDouble(-129.9, -150), @@ -51,7 +52,8 @@ public class BasePlate extends DeviceBase { new PointDouble(-64.95, 112.5) }; final static int numberOfPucks = pucksPosition.length; - final static DimensionDouble size = new DimensionDouble(500.0, 500.0); + //final static DimensionDouble size = new DimensionDouble(580.0, 580.0); + final static DimensionDouble size = new DimensionDouble(580.0, 580.0); BasePlate() { super("BasePlate", new BasePlateConfig()); @@ -128,6 +130,10 @@ public class BasePlate extends DeviceBase { void draw(Graphics2D g, Rectangle plotRect, boolean drawSamples, boolean drawIds) { this.plotRect = plotRect; + g.setColor(Color.BLACK); + int size = Math.min(plotRect.width, plotRect.height); + g.drawOval((int)(plotRect.getCenterX() - size/2),(int)(plotRect.getCenterY() - size/2), size, size); + for (Puck puck : getPucks()) { puck.draw(g, null, drawSamples, drawIds) ; } diff --git a/src/main/java/ch/psi/plugin/BasePlatePanel.java b/src/main/java/ch/psi/plugin/BasePlatePanel.java index 7a446df..50cf77f 100644 --- a/src/main/java/ch/psi/plugin/BasePlatePanel.java +++ b/src/main/java/ch/psi/plugin/BasePlatePanel.java @@ -32,7 +32,7 @@ public class BasePlatePanel extends DevicePanel { return (BasePlate) super.getDevice(); } - Mode mode = Mode.horizontal; + Mode mode = Mode.single; enum Mode { single, @@ -116,11 +116,11 @@ public class BasePlatePanel extends DevicePanel { break; case overlapped: //getDevice().draw(g2d, plotRect, false, true); - platePlotRect = new Rectangle(plotRect.x - ((int) (plotRect.width * 0.12)), plotRect.y - ((int) (plotRect.height * 0.12)), (int) (plotRect.width * 1.24), (int) (plotRect.height * 1.24)); + platePlotRect = new Rectangle(plotRect.x - ((int) (plotRect.width * 0.14)), plotRect.y - ((int) (plotRect.height * 0.14)), (int) (plotRect.width * 1.28), (int) (plotRect.height * 1.28)); getDevice().draw(g2d, platePlotRect, false, true); if (selectedPuck!=null){ int overlappedSize = (int) (1.5 * selectedPuck.getDrawSize()); - puckPlotRect = new Rectangle((int) (plotRect.getCenterX() - overlappedSize / 2), (int) (plotRect.getCenterY() - overlappedSize / 2.5), overlappedSize, overlappedSize); + puckPlotRect = new Rectangle((int) (plotRect.getCenterX() - overlappedSize / 2), (int) (plotRect.getCenterY() - overlappedSize / 2), overlappedSize, overlappedSize); selectedPuck.draw(g2d, puckPlotRect, true, false); } break; diff --git a/src/main/java/ch/psi/plugin/Puck.java b/src/main/java/ch/psi/plugin/Puck.java index c374680..14a09c9 100644 --- a/src/main/java/ch/psi/plugin/Puck.java +++ b/src/main/java/ch/psi/plugin/Puck.java @@ -40,7 +40,7 @@ public class Puck extends DeviceBase { new PointDouble(-28.39445573, 44.18263554) }; - final static PointDouble referencePosition = new PointDouble(0, -67.0); + final static PointDouble referencePosition = new PointDouble(0, -66.9); final static Double referenceSize = 6.2; final int numberOfSamples = samplesPosition.length;