Package org.opentcs.drivers.peripherals
Class PeripheralProcessModel
java.lang.Object
org.opentcs.drivers.peripherals.PeripheralProcessModel
- All Implemented Interfaces:
Serializable
A model of a peripheral device's and its communication adapter's attributes.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Used to describe what has changed in a process model. -
Constructor Summary
ConstructorsModifierConstructorDescriptionPeripheralProcessModel
(TCSResourceReference<Location> location) Creates a new instance.protected
PeripheralProcessModel
(TCSResourceReference<Location> location, boolean commAdapterEnabled, boolean commAdapterConnected, PeripheralInformation.State state) -
Method Summary
Modifier and TypeMethodDescriptionReturns the reference to the location that is attached to this model.getState()
Returns the peripheral device's current state.boolean
Returns whether the communication adapter is currently connected to the peripheral device.boolean
Returns whether the communication adapter is currently enabled.withCommAdapterConnected
(boolean commAdapterConnected) Creates a copy of the object, with the given connected state.withCommAdapterEnabled
(boolean commAdapterEnabled) Creates a copy of the object, with the given enabled state.withLocation
(TCSResourceReference<Location> location) Creates a copy of the object, with the given location reference.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.
-