This commit is contained in:
@@ -164,9 +164,11 @@ public class PuckDetection extends DeviceBase {
|
|||||||
for (List<Integer> sensor : bus) {
|
for (List<Integer> sensor : bus) {
|
||||||
Integer indDetector = sensor.get(0);
|
Integer indDetector = sensor.get(0);
|
||||||
Integer mecDetector = sensor.get(1);
|
Integer mecDetector = sensor.get(1);
|
||||||
int index = Controller.getInstance().getPuckIndex(address);
|
if (Controller.getInstance()!=null){
|
||||||
PuckState puck = Controller.getInstance().getPuckState(index);
|
int index = Controller.getInstance().getPuckIndex(address);
|
||||||
puck.set(mecDetector, indDetector);
|
PuckState puck = Controller.getInstance().getPuckState(index);
|
||||||
|
puck.set(mecDetector, indDetector);
|
||||||
|
}
|
||||||
address++;
|
address++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -177,10 +179,16 @@ public class PuckDetection extends DeviceBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PuckState getPuckState(int id) throws Exception {
|
public PuckState getPuckState(int id) throws Exception {
|
||||||
|
if (Controller.getInstance() == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return Controller.getInstance().getPuckState(id);
|
return Controller.getInstance().getPuckState(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Puck getPuck(String name) throws Exception {
|
public Puck getPuck(String name) throws Exception {
|
||||||
|
if (Controller.getInstance() == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return Controller.getInstance().getPuck(name);
|
return Controller.getInstance().getPuck(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,8 +212,9 @@ public class PuckDetection extends DeviceBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException, InterruptedException {
|
public static void main(String[] args) throws IOException, InterruptedException {
|
||||||
PuckDetection pd = new PuckDetection("PD", "129.129.110.99:5556");
|
//PuckDetection pd = new PuckDetection("PD", "129.129.110.99:5556");
|
||||||
//PuckDetection pd = new PuckDetection("PD","raspberrypi:5556");
|
//PuckDetection pd = new PuckDetection("PD","raspberrypi:5556");
|
||||||
|
PuckDetection pd = new PuckDetection("PD", "tell10s-raspberrypi:5556");
|
||||||
pd.setDebug(true);
|
pd.setDebug(true);
|
||||||
pd.initialize();
|
pd.initialize();
|
||||||
Thread.sleep(100000);
|
Thread.sleep(100000);
|
||||||
|
|||||||
Reference in New Issue
Block a user