MainPanel prototype

This commit is contained in:
gac-S_Changer
2018-03-16 15:00:32 +01:00
parent 983520f388
commit 3ccf49f01d
3 changed files with 46 additions and 36 deletions

View File

@@ -34,15 +34,16 @@ public class PuckState {
}
}
void set(boolean mecSwitch, boolean indSwitch) {
void set(int mecSwitch, int indSwitch) {
online = true;
this.mecSwitch = mecSwitch;
this.indSwitch = indSwitch;
//TODO: Hanfle -1 value: error
this.mecSwitch = mecSwitch ==1;
this.indSwitch = mecSwitch ==1;
BasePlate basePlate = getBasePlate();
if (basePlate != null) {
if (mecSwitch != indSwitch) {
if (this.mecSwitch != this.indSwitch) {
basePlate.getPucks()[id - 1].detection = Puck.Detection.Error;
} else if (mecSwitch) {
} else if (this.mecSwitch) {
basePlate.getPucks()[id - 1].detection = Puck.Detection.Present;
} else {
basePlate.getPucks()[id - 1].detection = Puck.Detection.Empty;