diff --git a/pom.xml b/pom.xml index 65b6bad..f7222e7 100644 --- a/pom.xml +++ b/pom.xml @@ -1,55 +1,55 @@ - - - 4.0.0 - ch.psi - MXSC - 1.5.0 - jar - - - ${project.groupId} - pshell - ${project.version} - - - - UTF-8 - 1.8 - 1.8 - - - - releases - releases - https://artifacts.psi.ch/artifactory/releases - - - libs-releases - libs-releases - https://artifacts.psi.ch/artifactory/libs-releases-local - - - libs-snapshots - libs-snapshots - https://artifacts.psi.ch/artifactory/libs-snapshots-local - - - - MXSC - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.3.1 - - ../../pshell/home/plugins - - - - + + + 4.0.0 + ch.psi + MXSC + 1.8.0 + jar + + + ${project.groupId} + pshell + 1.8.0 + + + + UTF-8 + 1.8 + 1.8 + + + + releases + releases + https://artifacts.psi.ch/artifactory/releases + + + libs-releases + libs-releases + https://artifacts.psi.ch/artifactory/libs-releases-local + + + libs-snapshots + libs-snapshots + https://artifacts.psi.ch/artifactory/libs-snapshots-local + + + + MXSC + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.3.1 + + ../pshell/home/plugins + + + + \ No newline at end of file diff --git a/src/main/java/ch/psi/mxsc/MainPanel.java b/src/main/java/ch/psi/mxsc/MainPanel.java index d191e57..ddbf86c 100644 --- a/src/main/java/ch/psi/mxsc/MainPanel.java +++ b/src/main/java/ch/psi/mxsc/MainPanel.java @@ -18,7 +18,15 @@ public class MainPanel extends Panel { BasePlate basePlate; /** Creates new form Panel */ static MainPanel instance; - static String PUCK_DETECTION_DEVICE = "onewire"; + + enum PuckSensorAccess{ + RaspberryPi, + Esera; + } + + final PuckSensorAccess puckSensorAccess = PuckSensorAccess.RaspberryPi; + + static String PUCK_ESERA_DEVICE = "onewire"; public static final int NUMBER_OF_PUCKS = 30; @@ -71,27 +79,29 @@ public class MainPanel extends Panel { addDevice(basePlate); clearPuckStates(); - getContext().getDevicePool().addListener(new DevicePoolListener() { - @Override - public void onDeviceAdded(GenericDevice dev) { - if (dev.getName().equals(PUCK_DETECTION_DEVICE)){ - detection = new EseraDetection((Device) dev); + if (puckSensorAccess == PuckSensorAccess.Esera){ + getContext().getDevicePool().addListener(new DevicePoolListener() { + @Override + public void onDeviceAdded(GenericDevice dev) { + if (dev.getName().equals(PUCK_ESERA_DEVICE)){ + detection = new EseraDetection((Device) dev); + } } - } - @Override - public void onDeviceRemoved(GenericDevice dev) { - if (dev.getName().equals(PUCK_DETECTION_DEVICE)){ - detection.close(); - detection = null; + @Override + public void onDeviceRemoved(GenericDevice dev) { + if (dev.getName().equals(PUCK_ESERA_DEVICE)){ + detection.close(); + detection = null; + } } + }); + if (detection != null){ + detection.close(); + detection = null; + } + if ((Device) getDevice(PUCK_ESERA_DEVICE) != null){ + detection = new EseraDetection((Device) getDevice(PUCK_ESERA_DEVICE)); } - }); - if (detection != null){ - detection.close(); - detection = null; - } - if ((Device) getDevice(PUCK_DETECTION_DEVICE) != null){ - detection = new EseraDetection((Device) getDevice(PUCK_DETECTION_DEVICE)); } } diff --git a/src/main/java/ch/psi/mxsc/Puck.java b/src/main/java/ch/psi/mxsc/Puck.java index b5c2e13..937ba90 100644 --- a/src/main/java/ch/psi/mxsc/Puck.java +++ b/src/main/java/ch/psi/mxsc/Puck.java @@ -211,10 +211,16 @@ public class Puck extends DeviceBase { } Font getLabelFont() { + if (plotRect != null){ + return new Font("Times New Roman", Font.BOLD, 18); + } return new Font("Times New Roman", Font.BOLD, 12); } Font getIdFont() { + if (plotRect != null){ + return new Font("Times New Roman", Font.PLAIN, 12); + } return new Font("Times New Roman", Font.PLAIN, 9); } diff --git a/src/main/java/ch/psi/mxsc/PuckDetection.java b/src/main/java/ch/psi/mxsc/PuckDetection.java index 5e1736e..cf3ff9e 100644 --- a/src/main/java/ch/psi/mxsc/PuckDetection.java +++ b/src/main/java/ch/psi/mxsc/PuckDetection.java @@ -57,7 +57,6 @@ public class PuckDetection extends DeviceBase{ watchDog.start(); } - void subscriberTask(){ try{ setState(State.Ready); @@ -68,9 +67,9 @@ public class PuckDetection extends DeviceBase{ try{ while (!Thread.currentThread().isInterrupted()) { String type = subscriber.recvStr(); - System.out.println(type); + //System.out.println(type); String contents = subscriber.recvStr(); - System.out.println(contents); + //System.out.println(contents); processMessage(contents); if (MainPanel.getInstance()!=null){ MainPanel.getInstance().repaint();