Package org.openwms.common.location
Class LocationGroup
java.lang.Object
org.ameba.integration.jpa.BaseEntity
org.ameba.integration.jpa.ApplicationEntity
org.openwms.common.location.Target
org.openwms.common.location.LocationGroup
- All Implemented Interfaces:
Serializable
,org.ameba.integration.TypedEntity<Long>
A LocationGroup is a logical group of
Location
s with same characteristics.- Author:
- Heiko Scherrer
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate Account
The LocationGroup might be assigned to anAccount
.private String
Description of theLocationGroup
.private @NotNull LocationGroupState
State of infeed, controlled by the subsystem only.private @NotNull LocationGroupState
State of outfeed.private String
A type can be assigned to aLocationGroup
.static final int
Length of the name field; used for telegram mapping and for column definition.private boolean
Is theLocationGroup
included in the calculation ofTransportUnit
s.private Set
<LocationGroup> ChildLocationGroup
s.ChildLocation
s.private float
Maximum fill level of theLocationGroup
.private @NotBlank @Size(min=1,max=255) String
Unique identifier of aLocationGroup
.private @NotBlank String
The operation mode is controlled by the subsystem and defines the physical mode aLocationGroup
is currently able to operate in.private LocationGroup
ParentLocationGroup
.private LocationGroup
References theLocationGroup
that locked thisLocationGroup
for infeed.private LocationGroup
References theLocationGroup
that locked thisLocationGroup
for outfeed.private Subsystem
The subsystem like a PLC, that manages thisLocationGroup
.Fields inherited from class org.ameba.integration.jpa.ApplicationEntity
C_ID
-
Constructor Summary
ModifierConstructorDescriptionprotected
Dear JPA...LocationGroup
(@NotBlank String name) Create a newLocationGroup
with a unique name. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addLocation
(Location location) Add aLocation
to the list of children.boolean
addLocationGroup
(LocationGroup locationGroup) Add aLocationGroup
to the list of children.void
changeGroupStateIn
(LocationGroupState newGroupStateIn) Change the infeed state of theLocationGroup
.private void
changeGroupStateIn
(LocationGroupState newGroupStateIn, LocationGroup lockLG) Change the infeed state of theLocationGroup
.void
changeGroupStateOut
(LocationGroupState newGroupStateOut) Change the outfeed state of theLocationGroup
.(package private) void
changeGroupStateOut
(LocationGroupState gStateOut, LocationGroup lockLg) Set the outfeed state of theLocationGroup
.void
changeState
(LocationGroupState stateIn, LocationGroupState stateOut) Tries to change thegroupStateIn
andgroupStateOut
of theLocationGroup
.boolean
Return theAccount
thisLocationGroup
is assigned to.Returns the description text.Returns the infeed state of theLocationGroup
.Return the outfeed state of theLocationGroup
.Returns the type of theLocationGroup
.Return all childLocationGroup
.Return allLocation
s.float
Returns the maximum fill level of theLocationGroup
.
The maximum fill level defines how manyLocation
s of theLocationGroup
can be occupied byTransportUnit
s.getName()
Returns the name of theLocationGroup
.int
Returns the count of all subLocation
s.Get the current operation mode thisLocationGroup
operates in.Returns the parentLocationGroup
.int
hashCode()
boolean
Check whether thisLocationGroup
hasLocationGroup
s as children.boolean
Check whether thisLocationGroup
hasLocation
s assigned.boolean
Whether this LocationGroup has a parent LocationGroup or not.boolean
Check whether infeed is allowed for theLocationGroup
.boolean
Check whether infeed of theLocationGroup
is blocked.boolean
Returns the locationGroupCountingActive.boolean
Check whether outfeed is allowed for theLocationGroup
.boolean
Check whether outfeed of theLocationGroup
is blocked.boolean
removeLocation
(Location location) Remove aLocation
from the list of children.boolean
removeLocationGroup
(@NotNull LocationGroup locationGroup) Remove aLocationGroup
from the list of children.void
setAccount
(Account account) Sets theAccount
for thisLocationGroup
.void
setDescription
(String description) Set the description text.void
setGroupType
(String groupType) Set the type for theLocationGroup
.void
setLocationGroupCountingActive
(boolean locationGroupCountingActive) Set the locationGroupCountingActive.void
setLocationGroups
(Set<LocationGroup> locationGroups) Sets the childLocationGroup
.void
setMaxFillLevel
(float maxFillLevel) Set the maximum fill level for theLocationGroup
.void
setOperationMode
(@NotBlank String operationMode) Set the current operation mode thisLocationGroup
can operate in.void
setParent
(LocationGroup parent) Sets the parentLocationGroup
of thisLocationGroup
.toString()
Return the name of theLocationGroup
as String.Methods inherited from class org.ameba.integration.jpa.ApplicationEntity
getPersistentKey, hasPersistentKey, onEntityPersist, onPersist, setPersistentKey
Methods inherited from class org.ameba.integration.jpa.BaseEntity
getCreatedBy, getCreateDt, getLastModifiedBy, getLastModifiedDt, getOl, getPk, isNew, setCreatedBy, setCreateDt, setLastModifiedBy, setLastModifiedDt, setOl
-
Field Details
-
name
Unique identifier of aLocationGroup
. -
LENGTH_NAME
public static final int LENGTH_NAMELength of the name field; used for telegram mapping and for column definition.- See Also:
-
account
The LocationGroup might be assigned to anAccount
. -
description
Description of theLocationGroup
. -
groupType
A type can be assigned to aLocationGroup
. -
locationGroupCountingActive
private boolean locationGroupCountingActiveIs theLocationGroup
included in the calculation ofTransportUnit
s. -
operationMode
The operation mode is controlled by the subsystem and defines the physical mode aLocationGroup
is currently able to operate in. -
groupStateIn
State of infeed, controlled by the subsystem only. -
stateInLocker
References theLocationGroup
that locked thisLocationGroup
for infeed. -
groupStateOut
State of outfeed. -
stateOutLocker
References theLocationGroup
that locked thisLocationGroup
for outfeed. -
maxFillLevel
private float maxFillLevelMaximum fill level of theLocationGroup
. -
subsystem
The subsystem like a PLC, that manages thisLocationGroup
. -
parent
ParentLocationGroup
. -
locationGroups
ChildLocationGroup
s. -
locations
ChildLocation
s.
-
-
Constructor Details
-
LocationGroup
protected LocationGroup()Dear JPA... -
LocationGroup
Create a newLocationGroup
with a unique name.- Parameters:
name
- The name of theLocationGroup
must not be null
-
-
Method Details
-
getName
Returns the name of theLocationGroup
.- Returns:
- The name of the
LocationGroup
-
getAccount
Return theAccount
thisLocationGroup
is assigned to.- Returns:
- The
Account
-
setAccount
Sets theAccount
for thisLocationGroup
.- Parameters:
account
- TheAccount
to set for thisLocationGroup
-
isInfeedAllowed
public boolean isInfeedAllowed()Check whether infeed is allowed for theLocationGroup
.- Returns:
- true if allowed, otherwise false.
-
isInfeedBlocked
public boolean isInfeedBlocked()Check whether infeed of theLocationGroup
is blocked.- Returns:
- true if blocked, otherwise false.
-
isOutfeedAllowed
public boolean isOutfeedAllowed()Check whether outfeed is allowed for theLocationGroup
.- Returns:
- true if allowed, otherwise false.
-
isOutfeedBlocked
public boolean isOutfeedBlocked()Check whether outfeed of theLocationGroup
is blocked.- Returns:
- true if blocked, otherwise false.
-
getOperationMode
Get the current operation mode thisLocationGroup
operates in.- Returns:
- The operational mode
-
setOperationMode
Set the current operation mode thisLocationGroup
can operate in.- Parameters:
operationMode
- The mode as an extensible String- See Also:
-
getGroupStateIn
Returns the infeed state of theLocationGroup
.- Returns:
- The state of infeed
-
changeGroupStateIn
Change the infeed state of theLocationGroup
.- Parameters:
newGroupStateIn
- The state to set
-
changeGroupStateIn
Change the infeed state of theLocationGroup
.- Parameters:
newGroupStateIn
- The state to setlockLG
- TheLocationGroup
that wants to lock/unlock thisLocationGroup
.
-
getGroupStateOut
Return the outfeed state of theLocationGroup
.- Returns:
- The state of outfeed
-
changeGroupStateOut
Change the outfeed state of theLocationGroup
.- Parameters:
newGroupStateOut
- The state to set
-
changeGroupStateOut
Set the outfeed state of theLocationGroup
.- Parameters:
gStateOut
- The state to setlockLg
- TheLocationGroup
that wants to lock/unlock thisLocationGroup
.
-
getNoLocations
public int getNoLocations()Returns the count of all subLocation
s.- Returns:
- The count of
Location
s belonging to thisLocationGroup
-
getMaxFillLevel
public float getMaxFillLevel()Returns the maximum fill level of theLocationGroup
.
The maximum fill level defines how manyLocation
s of theLocationGroup
can be occupied byTransportUnit
s.The maximum fill level is a value between 0 and 1 and represents a percentage value.
- Returns:
- The maximum fill level
-
setMaxFillLevel
public void setMaxFillLevel(float maxFillLevel) Set the maximum fill level for theLocationGroup
.Pass a value between 0 and 1.
For example maxFillLevel = 0.85 means: 85% of allLocation
s can be occupied.- Parameters:
maxFillLevel
- The maximum fill level
-
getGroupType
Returns the type of theLocationGroup
.- Returns:
- The type of the
LocationGroup
-
setGroupType
Set the type for theLocationGroup
.- Parameters:
groupType
- The type of theLocationGroup
-
getDescription
Returns the description text.- Returns:
- The Description as String
-
setDescription
Set the description text.- Parameters:
description
- The String to set as description text
-
getParent
Returns the parentLocationGroup
.- Returns:
- The parent
LocationGroup
-
setParent
Sets the parentLocationGroup
of thisLocationGroup
.- Parameters:
parent
- The parentLocationGroup
to set
-
getLocationGroups
Return all childLocationGroup
.- Returns:
- A set of all
LocationGroup
having this one as parent
-
hasLocationGroups
public boolean hasLocationGroups()Check whether thisLocationGroup
hasLocationGroup
s as children.- Returns:
- true if
LocationGroup
s are assigned, otherwise false
-
setLocationGroups
Sets the childLocationGroup
.- Parameters:
locationGroups
- the set of LocationGroups to set
-
addLocationGroup
Add aLocationGroup
to the list of children.- Parameters:
locationGroup
- TheLocationGroup
to be added as a child- Returns:
- true if the
LocationGroup
was new in the collection ofLocationGroup
s, otherwise false
-
removeLocationGroup
Remove aLocationGroup
from the list of children.- Parameters:
locationGroup
- TheLocationGroup
to be removed from the list of children- Returns:
- true if the
LocationGroup
was found and could be removed, otherwise false
-
getLocations
Return allLocation
s.- Returns:
Location
s
-
hasLocations
public boolean hasLocations()Check whether thisLocationGroup
hasLocation
s assigned.- Returns:
- true if
Location
s are assigned, otherwise false
-
addLocation
Add aLocation
to the list of children. -
removeLocation
Remove aLocation
from the list of children. -
isLocationGroupCountingActive
public boolean isLocationGroupCountingActive()Returns the locationGroupCountingActive.- Returns:
- The locationGroupCountingActive
-
setLocationGroupCountingActive
public void setLocationGroupCountingActive(boolean locationGroupCountingActive) Set the locationGroupCountingActive.- Parameters:
locationGroupCountingActive
- The locationGroupCountingActive to set
-
hashCode
public int hashCode()- Overrides:
hashCode
in classorg.ameba.integration.jpa.ApplicationEntity
- See Also:
-
equals
- Overrides:
equals
in classorg.ameba.integration.jpa.ApplicationEntity
- See Also:
-
toString
Return the name of theLocationGroup
as String. -
changeState
Tries to change thegroupStateIn
andgroupStateOut
of theLocationGroup
. A state change is only allowed when the parentLocationGroup
s state is not blocked.- Parameters:
stateIn
- The new groupStateIn to set, or nullstateOut
- The new groupStateOut to set, or null
-
hasParent
public boolean hasParent()Whether this LocationGroup has a parent LocationGroup or not.- Returns:
- true If it has a parent
-