sige 1 year ago
parent
commit
c25ed1ca7d
  1. 12
      src/src/main/java/com/my/graphiteDigesterBg/resource/ResHeatingTubeRackSlotManager.java

12
src/src/main/java/com/my/graphiteDigesterBg/resource/ResHeatingTubeRackSlotManager.java

@ -52,8 +52,12 @@ public class ResHeatingTubeRackSlotManager extends DiResourceManagerBase {
public void refreshSlotTemperature() { public void refreshSlotTemperature() {
var registers = this.getDevice().getRegisters(); var registers = this.getDevice().getRegisters();
for (ResHeatingTubeRackSlot slot : this.slots) { for (ResHeatingTubeRackSlot slot : this.slots) {
slot.temperature = registers.getValue("HeatingPlateSlotTemperature" + slot.index);
LOG.info("[Heating Slot {}] temperature: {}", slot.index, slot.temperature);
try {
slot.temperature = registers.getValue("HeatingPlateSlotTemperature" + slot.index);
LOG.info("[Heating Slot {}] temperature: {}", slot.index, slot.temperature);
} catch (Exception e) {
LOG.error("Failed to get temperature for slot {}", slot.index, e);
}
} }
} }
@ -77,7 +81,7 @@ public class ResHeatingTubeRackSlotManager extends DiResourceManagerBase {
} }
throw new RuntimeException("暂无空闲试管架位置"); throw new RuntimeException("暂无空闲试管架位置");
} }
// get slot by index // get slot by index
public ResHeatingTubeRackSlot getSlotByIndex( Integer index ) { public ResHeatingTubeRackSlot getSlotByIndex( Integer index ) {
return this.slots.get(index); return this.slots.get(index);
@ -91,7 +95,7 @@ public class ResHeatingTubeRackSlotManager extends DiResourceManagerBase {
// get slot at liquid plate // get slot at liquid plate
public ResHeatingTubeRackSlot getSlotAtLiquidPlate() { public ResHeatingTubeRackSlot getSlotAtLiquidPlate() {
for (ResHeatingTubeRackSlot slot : this.slots) { for (ResHeatingTubeRackSlot slot : this.slots) {
if (slot.rackPosition.equals(ResHeatingTubeRackSlot.LOCATION_LIQUID_PLATE)) {
if (ResHeatingTubeRackSlot.LOCATION_LIQUID_PLATE.equals(slot.rackPosition)) {
return slot; return slot;
} }
} }

Loading…
Cancel
Save