|
|
@ -30,6 +30,17 @@ public class DeviceStateService { |
|
|
|
support.addPropertyChangeListener(deviceStateListener); |
|
|
|
} |
|
|
|
|
|
|
|
public synchronized HeatModuleState getHeatModuleState(HeatModuleCode moduleCode) { |
|
|
|
HeatModuleState heatModuleState = null; |
|
|
|
for (HeatModuleState t : deviceState.getHeatModule()) { |
|
|
|
if (moduleCode.equals(t.getModuleCode())) { |
|
|
|
heatModuleState = t; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
return heatModuleState; |
|
|
|
} |
|
|
|
|
|
|
|
public synchronized void setVirtual(boolean virtual) { |
|
|
|
boolean oldValue = deviceState.isVirtual(); |
|
|
|
deviceState.setVirtual(virtual); |
|
|
@ -60,103 +71,103 @@ public class DeviceStateService { |
|
|
|
support.firePropertyChange("setGantryArmStateIdle", oldValue, idle); |
|
|
|
} |
|
|
|
|
|
|
|
public synchronized void setHeatAreaStateTrayStatus(HeatModuleCode heatModuleId, int trayStatus) { |
|
|
|
HeatAreaState heatAreaState = null; |
|
|
|
for (HeatAreaState t : deviceState.getHeatArea()) { |
|
|
|
public synchronized void setHeatModuleStateTrayStatus(HeatModuleCode heatModuleId, int trayStatus) { |
|
|
|
HeatModuleState heatModuleState = null; |
|
|
|
for (HeatModuleState t : deviceState.getHeatModule()) { |
|
|
|
if (heatModuleId.equals(t.getModuleCode())) { |
|
|
|
heatAreaState = t; |
|
|
|
heatModuleState = t; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
assert heatAreaState != null; |
|
|
|
int oldValue = heatAreaState.getTrayStatus(); |
|
|
|
heatAreaState.setTrayStatus(trayStatus); |
|
|
|
support.firePropertyChange("setHeatAreaStateTrayStatus", oldValue, trayStatus); |
|
|
|
assert heatModuleState != null; |
|
|
|
int oldValue = heatModuleState.getTrayStatus(); |
|
|
|
heatModuleState.setTrayStatus(trayStatus); |
|
|
|
support.firePropertyChange("setHeatModuleStateTrayStatus", oldValue, trayStatus); |
|
|
|
} |
|
|
|
|
|
|
|
public synchronized void setHeatAreaStateHeating(HeatModuleCode heatModuleId, boolean heating) { |
|
|
|
HeatAreaState heatAreaState = null; |
|
|
|
for (HeatAreaState t : deviceState.getHeatArea()) { |
|
|
|
public synchronized void setHeatModuleStateHeating(HeatModuleCode heatModuleId, boolean heating) { |
|
|
|
HeatModuleState heatModuleState = null; |
|
|
|
for (HeatModuleState t : deviceState.getHeatModule()) { |
|
|
|
if (heatModuleId.equals(t.getModuleCode())) { |
|
|
|
heatAreaState = t; |
|
|
|
heatModuleState = t; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
assert heatAreaState != null; |
|
|
|
boolean oldValue = heatAreaState.isHeating(); |
|
|
|
heatAreaState.setHeating(heating); |
|
|
|
support.firePropertyChange("setHeatAreaStateHeating", oldValue, heating); |
|
|
|
assert heatModuleState != null; |
|
|
|
boolean oldValue = heatModuleState.isHeating(); |
|
|
|
heatModuleState.setHeating(heating); |
|
|
|
support.firePropertyChange("setHeatModuleStateHeating", oldValue, heating); |
|
|
|
} |
|
|
|
|
|
|
|
public synchronized void setHeatAreaStateCapExist(HeatModuleCode heatModuleId, boolean capStatus) { |
|
|
|
HeatAreaState heatAreaState = null; |
|
|
|
for (HeatAreaState t : deviceState.getHeatArea()) { |
|
|
|
public synchronized void setHeatModuleStateCapExist(HeatModuleCode heatModuleId, boolean capStatus) { |
|
|
|
HeatModuleState heatModuleState = null; |
|
|
|
for (HeatModuleState t : deviceState.getHeatModule()) { |
|
|
|
if (heatModuleId.equals(t.getModuleCode())) { |
|
|
|
heatAreaState = t; |
|
|
|
heatModuleState = t; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
assert heatAreaState != null; |
|
|
|
boolean oldValue = heatAreaState.isCapExist(); |
|
|
|
heatAreaState.setCapExist(capStatus); |
|
|
|
support.firePropertyChange("setHeatAreaStateCapExist", oldValue, capStatus); |
|
|
|
assert heatModuleState != null; |
|
|
|
boolean oldValue = heatModuleState.isCapExist(); |
|
|
|
heatModuleState.setCapExist(capStatus); |
|
|
|
support.firePropertyChange("setHeatModuleStateCapExist", oldValue, capStatus); |
|
|
|
} |
|
|
|
|
|
|
|
public synchronized void setHeatAreaStateTargetTemperature(HeatModuleCode heatModuleId, double targetTemperature) { |
|
|
|
HeatAreaState heatAreaState = null; |
|
|
|
for (HeatAreaState t : deviceState.getHeatArea()) { |
|
|
|
public synchronized void setHeatModuleStateTargetTemperature(HeatModuleCode heatModuleId, double targetTemperature) { |
|
|
|
HeatModuleState heatModuleState = null; |
|
|
|
for (HeatModuleState t : deviceState.getHeatModule()) { |
|
|
|
if (heatModuleId.equals(t.getModuleCode())) { |
|
|
|
heatAreaState = t; |
|
|
|
heatModuleState = t; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
assert heatAreaState != null; |
|
|
|
double oldValue = heatAreaState.getTargetTemperature(); |
|
|
|
heatAreaState.setTemperature(targetTemperature); |
|
|
|
support.firePropertyChange("setHeatAreaStateTargetTemperature", oldValue, targetTemperature); |
|
|
|
assert heatModuleState != null; |
|
|
|
double oldValue = heatModuleState.getTargetTemperature(); |
|
|
|
heatModuleState.setTemperature(targetTemperature); |
|
|
|
support.firePropertyChange("setHeatModuleStateTargetTemperature", oldValue, targetTemperature); |
|
|
|
} |
|
|
|
|
|
|
|
public synchronized void setHeatAreaStateTemperature(HeatModuleCode heatModuleId, double temperature) { |
|
|
|
HeatAreaState heatAreaState = null; |
|
|
|
for (HeatAreaState t : deviceState.getHeatArea()) { |
|
|
|
public synchronized void setHeatModuleStateTemperature(HeatModuleCode heatModuleId, double temperature) { |
|
|
|
HeatModuleState heatModuleState = null; |
|
|
|
for (HeatModuleState t : deviceState.getHeatModule()) { |
|
|
|
if (heatModuleId.equals(t.getModuleCode())) { |
|
|
|
heatAreaState = t; |
|
|
|
heatModuleState = t; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
assert heatAreaState != null; |
|
|
|
double oldValue = heatAreaState.getTemperature(); |
|
|
|
heatAreaState.setTemperature(temperature); |
|
|
|
support.firePropertyChange("setHeatAreaStateTemperature", oldValue, temperature); |
|
|
|
assert heatModuleState != null; |
|
|
|
double oldValue = heatModuleState.getTemperature(); |
|
|
|
heatModuleState.setTemperature(temperature); |
|
|
|
support.firePropertyChange("setHeatModuleStateTemperature", oldValue, temperature); |
|
|
|
} |
|
|
|
|
|
|
|
public synchronized void setSolutionAreaStateIdle(boolean idle) { |
|
|
|
boolean oldValue = deviceState.getSolutionArea().isIdle(); |
|
|
|
deviceState.getSolutionArea().setIdle(idle); |
|
|
|
support.firePropertyChange("setSolutionAreaStateIdle", oldValue, idle); |
|
|
|
public synchronized void setSolutionModuleStateIdle(boolean idle) { |
|
|
|
boolean oldValue = deviceState.getSolutionModule().isIdle(); |
|
|
|
deviceState.getSolutionModule().setIdle(idle); |
|
|
|
support.firePropertyChange("setSolutionModuleStateIdle", oldValue, idle); |
|
|
|
} |
|
|
|
|
|
|
|
public synchronized void setSolutionAreaStateShaking(boolean shaking) { |
|
|
|
boolean oldValue = deviceState.getSolutionArea().isShaking(); |
|
|
|
deviceState.getSolutionArea().setShaking(shaking); |
|
|
|
support.firePropertyChange("setSolutionAreaStateShaking", oldValue, shaking); |
|
|
|
public synchronized void setSolutionModuleStateShaking(boolean shaking) { |
|
|
|
boolean oldValue = deviceState.getSolutionModule().isShaking(); |
|
|
|
deviceState.getSolutionModule().setShaking(shaking); |
|
|
|
support.firePropertyChange("setSolutionModuleStateShaking", oldValue, shaking); |
|
|
|
} |
|
|
|
|
|
|
|
public synchronized void setSolutionAreaStateTrayStatus(int trayStatus) { |
|
|
|
int oldValue = deviceState.getSolutionArea().getTrayStatus(); |
|
|
|
deviceState.getSolutionArea().setTrayStatus(trayStatus); |
|
|
|
support.firePropertyChange("setSolutionAreaStateTrayStatus", oldValue, trayStatus); |
|
|
|
public synchronized void setSolutionModuleStateTrayStatus(int trayStatus) { |
|
|
|
int oldValue = deviceState.getSolutionModule().getTrayStatus(); |
|
|
|
deviceState.getSolutionModule().setTrayStatus(trayStatus); |
|
|
|
support.firePropertyChange("setSolutionModuleStateTrayStatus", oldValue, trayStatus); |
|
|
|
} |
|
|
|
|
|
|
|
public synchronized void setSolutionAreaStatePumping(boolean pumping) { |
|
|
|
boolean oldValue = deviceState.getSolutionArea().isPumping(); |
|
|
|
deviceState.getSolutionArea().setPumping(pumping); |
|
|
|
support.firePropertyChange("setSolutionAreaStatePumping", oldValue, pumping); |
|
|
|
public synchronized void setSolutionModuleStatePumping(boolean pumping) { |
|
|
|
boolean oldValue = deviceState.getSolutionModule().isPumping(); |
|
|
|
deviceState.getSolutionModule().setPumping(pumping); |
|
|
|
support.firePropertyChange("setSolutionModuleStatePumping", oldValue, pumping); |
|
|
|
} |
|
|
|
|
|
|
|
public synchronized void setSolutionContainerStateEmpty(ContainerCode containerCode, boolean empty) { |
|
|
|
SolutionContainerState solutionContainerState = null; |
|
|
|
for (SolutionContainerState t : deviceState.getSolutionArea().getSolutionContainer()) { |
|
|
|
for (SolutionContainerState t : deviceState.getSolutionModule().getSolutionContainer()) { |
|
|
|
if (containerCode.equals(t.getContainerCode())) { |
|
|
|
solutionContainerState = t; |
|
|
|
break; |
|
|
@ -170,7 +181,7 @@ public class DeviceStateService { |
|
|
|
|
|
|
|
public synchronized void setSolutionContainerStateFull(ContainerCode containerCode, boolean full) { |
|
|
|
SolutionContainerState solutionContainerState = null; |
|
|
|
for (SolutionContainerState t : deviceState.getSolutionArea().getSolutionContainer()) { |
|
|
|
for (SolutionContainerState t : deviceState.getSolutionModule().getSolutionContainer()) { |
|
|
|
if (containerCode.equals(t.getContainerCode())) { |
|
|
|
solutionContainerState = t; |
|
|
|
break; |
|
|
@ -196,7 +207,7 @@ public class DeviceStateService { |
|
|
|
support.firePropertyChange("setTrayStateHeatModuleId", oldValue, heatModuleId); |
|
|
|
} |
|
|
|
|
|
|
|
public synchronized void setTrayStateInSolutionArea(String trayUUID, boolean inSolutionArea) { |
|
|
|
public synchronized void setTrayStateInSolutionModule(String trayUUID, boolean inSolutionModule) { |
|
|
|
TrayState foundTrayState = null; |
|
|
|
for (TrayState t : deviceState.getTray()) { |
|
|
|
if (trayUUID.equals(t.getUuid())) { |
|
|
@ -205,12 +216,12 @@ public class DeviceStateService { |
|
|
|
} |
|
|
|
} |
|
|
|
assert foundTrayState != null; |
|
|
|
boolean oldValue = foundTrayState.isInSolutionArea(); |
|
|
|
foundTrayState.setInSolutionArea(inSolutionArea); |
|
|
|
support.firePropertyChange("traySetInSolutionArea", oldValue, inSolutionArea); |
|
|
|
boolean oldValue = foundTrayState.isInSolutionModule(); |
|
|
|
foundTrayState.setInSolutionModule(inSolutionModule); |
|
|
|
support.firePropertyChange("traySetInSolutionModule", oldValue, inSolutionModule); |
|
|
|
} |
|
|
|
|
|
|
|
public synchronized void setTrayStateInHeatArea(String trayUUID, boolean inHeatArea) { |
|
|
|
public synchronized void setTrayStateInHeatModule(String trayUUID, boolean inHeatModule) { |
|
|
|
TrayState foundTrayState = null; |
|
|
|
for (TrayState t : deviceState.getTray()) { |
|
|
|
if (trayUUID.equals(t.getUuid())) { |
|
|
@ -219,9 +230,9 @@ public class DeviceStateService { |
|
|
|
} |
|
|
|
} |
|
|
|
assert foundTrayState != null; |
|
|
|
boolean oldValue = foundTrayState.isInHeatArea(); |
|
|
|
foundTrayState.setInHeatArea(inHeatArea); |
|
|
|
support.firePropertyChange("setTrayStateInHeatArea", oldValue, inHeatArea); |
|
|
|
boolean oldValue = foundTrayState.isInHeatModule(); |
|
|
|
foundTrayState.setInHeatModule(inHeatModule); |
|
|
|
support.firePropertyChange("setTrayStateInHeatModule", oldValue, inHeatModule); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|