Slightly re-tuned temp and water controllers
This commit is contained in:
parent
1f880a1167
commit
20fa65c926
2 changed files with 8 additions and 4 deletions
|
@ -24,7 +24,7 @@ public final class ControllerTemp extends ActorThread<WashingMessage> {
|
|||
public void run() {
|
||||
while (true) {
|
||||
try {
|
||||
temp = receiveWithTimeout(10000 / Settings.SPEEDUP);
|
||||
temp = receiveWithTimeout(30000 / Settings.SPEEDUP);
|
||||
|
||||
// If there is a new message, swap
|
||||
if (temp != null) {
|
||||
|
@ -39,7 +39,7 @@ public final class ControllerTemp extends ActorThread<WashingMessage> {
|
|||
|
||||
switch (heaterState) {
|
||||
case Order.TEMP_SET_40 -> {
|
||||
if (io.getTemperature() <= 39) {
|
||||
if (io.getTemperature() <= 38.5) {
|
||||
io.heat(true);
|
||||
} else {
|
||||
io.heat(false);
|
||||
|
@ -48,7 +48,7 @@ public final class ControllerTemp extends ActorThread<WashingMessage> {
|
|||
}
|
||||
}
|
||||
case Order.TEMP_SET_60 -> {
|
||||
if (io.getTemperature() <= 59) {
|
||||
if (io.getTemperature() <= 58.5) {
|
||||
io.heat(true);
|
||||
} else {
|
||||
io.heat(false);
|
||||
|
|
|
@ -46,13 +46,14 @@ public class ControllerWater extends ActorThread<WashingMessage> {
|
|||
case Order.WATER_DRAIN -> {
|
||||
io.drain(true);
|
||||
io.fill(false);
|
||||
// WARNING: Float comparison
|
||||
if (io.getWaterLevel() == 0 && !ackSent)
|
||||
sendAck();
|
||||
}
|
||||
case Order.WATER_FILL -> {
|
||||
io.drain(false);
|
||||
|
||||
if (io.getWaterLevel() < 19)
|
||||
if (io.getWaterLevel() < 10)
|
||||
io.fill(true);
|
||||
else {
|
||||
io.fill(false);
|
||||
|
@ -64,6 +65,9 @@ public class ControllerWater extends ActorThread<WashingMessage> {
|
|||
case Order.WATER_IDLE -> {
|
||||
io.drain(false);
|
||||
io.fill(false);
|
||||
if (!ackSent) {
|
||||
sendAck();
|
||||
}
|
||||
}
|
||||
default -> {
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue