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
+22 -9
View File
@@ -54,8 +54,8 @@ public class Controller {
static Controller instance;
final BasePlate basePlate;
final RoomTemperatureBasePlate roomTemperatureBasePlate;
final /*Panel*/ MainPanel mainFrame;
RoomTemperatureBasePlate roomTemperatureBasePlate;
static /*Panel*/ MainPanel mainFrame;
Device hexiposi;
Device barcode_reader;
Device barcode_reader_puck;
@@ -67,9 +67,19 @@ public class Controller {
public static Controller getInstance() {
return instance;
}
public static boolean isRt() {
return Controller.mainFrame.isRt();
}
static void createInstance(Panel mainFrame) {
instance = new Controller(mainFrame);
Controller.mainFrame = (MainPanel) mainFrame;
System.setProperty(GenericDevice.PROPERTY_CONFIG_PATH, Context.getInstance().getSetup().getDevicesPath());
if (isRt()){
instance = new ControllerRT(mainFrame);
} else {
instance = new Controller(mainFrame);
}
}
enum PuckMountMode {
@@ -120,16 +130,19 @@ public class Controller {
static String PUCK_ESERA_DEVICE = "onewire";
public static final int NUMBER_OF_PUCKS = 30;
private Controller(Panel mainFrame) {
System.setProperty(GenericDevice.PROPERTY_CONFIG_PATH, Context.getInstance().getSetup().getDevicesPath());
protected Controller(){
basePlate = new BasePlate();
instance = this;
}
private Controller(Panel mainFrame) {
this();
//basePlate = new BasePlate();
puckState = new PuckState[NUMBER_OF_PUCKS];
for (int i = 0; i < NUMBER_OF_PUCKS; i++) {
puckState[i] = new PuckState(i + 1);
}
this.mainFrame = (MainPanel) mainFrame;
instance = this;
clearPuckStates();
basePlate.addListener(basePlateListener);
@@ -369,7 +382,7 @@ public class Controller {
}
}
final PuckState[] puckState;
PuckState[] puckState;
public PuckState[] getPuckStates() {
return puckState;