Package org.opentcs.drivers.peripherals
Class PeripheralProcessModel
java.lang.Object
org.opentcs.drivers.peripherals.PeripheralProcessModel
- All Implemented Interfaces:
java.io.Serializable
public class PeripheralProcessModel
extends java.lang.Object
implements java.io.Serializable
A model of a peripheral device's and its communication adapter's attributes.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PeripheralProcessModel.Attribute
Used to describe what has changed in a process model. -
Constructor Summary
Constructors Modifier Constructor Description PeripheralProcessModel(TCSResourceReference<Location> location)
Creates a new instance.protected
PeripheralProcessModel(TCSResourceReference<Location> location, boolean commAdapterEnabled, boolean commAdapterConnected, PeripheralInformation.State state)
-
Method Summary
Modifier and Type Method Description TCSResourceReference<Location>
getLocation()
Returns the reference to the location that is attached to this model.PeripheralInformation.State
getState()
Returns the peripheral device's current state.boolean
isCommAdapterConnected()
Returns whether the communication adapter is currently connected to the peripheral device.boolean
isCommAdapterEnabled()
Returns whether the communication adapter is currently enabled.PeripheralProcessModel
withCommAdapterConnected(boolean commAdapterConnected)
Creates a copy of the object, with the given connected state.PeripheralProcessModel
withCommAdapterEnabled(boolean commAdapterEnabled)
Creates a copy of the object, with the given enabled state.PeripheralProcessModel
withLocation(TCSResourceReference<Location> location)
Creates a copy of the object, with the given location reference.PeripheralProcessModel
withState(PeripheralInformation.State state)
Creates a copy of the object, with the given state.
-
Constructor Details
-
PeripheralProcessModel
Creates a new instance.- Parameters:
location
- The reference to the location that is attached to this model.
-
PeripheralProcessModel
protected PeripheralProcessModel(@Nonnull TCSResourceReference<Location> location, boolean commAdapterEnabled, boolean commAdapterConnected, @Nonnull PeripheralInformation.State state)
-
-
Method Details
-
getLocation
Returns the reference to the location that is attached to this model.- Returns:
- The reference to the location that is attached to this model.
-
withLocation
Creates a copy of the object, with the given location reference.- Parameters:
location
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
isCommAdapterEnabled
public boolean isCommAdapterEnabled()Returns whether the communication adapter is currently enabled.- Returns:
- Whether the communication adapter is currently enabled.
-
withCommAdapterEnabled
Creates a copy of the object, with the given enabled state.- Parameters:
commAdapterEnabled
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
isCommAdapterConnected
public boolean isCommAdapterConnected()Returns whether the communication adapter is currently connected to the peripheral device.- Returns:
- Whether the communication adapter is currently connected to the peripheral device.
-
withCommAdapterConnected
Creates a copy of the object, with the given connected state.- Parameters:
commAdapterConnected
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-
getState
Returns the peripheral device's current state.- Returns:
- The peripheral device's current state.
-
withState
Creates a copy of the object, with the given state.- Parameters:
state
- The value to be set in the copy.- Returns:
- A copy of this object, differing in the given value.
-