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>

@Entity public class LocationGroup extends Target implements Serializable
A LocationGroup is a logical group of Locations with same characteristics.
Author:
Heiko Scherrer
See Also:
  • Field Details

    • name

      @NotBlank @Size(min=1, max=255) private @NotBlank @Size(min=1,max=255) String name
      Unique identifier of a LocationGroup.
    • LENGTH_NAME

      public static final int LENGTH_NAME
      Length of the name field; used for telegram mapping and for column definition.
      See Also:
    • account

      private Account account
      The LocationGroup might be assigned to an Account.
    • description

      private String description
      Description of the LocationGroup.
    • groupType

      private String groupType
      A type can be assigned to a LocationGroup.
    • locationGroupCountingActive

      private boolean locationGroupCountingActive
      Is the LocationGroup included in the calculation of TransportUnits.
    • operationMode

      @NotBlank private @NotBlank String operationMode
      The operation mode is controlled by the subsystem and defines the physical mode a LocationGroup is currently able to operate in.
    • groupStateIn

      @NotNull private @NotNull LocationGroupState groupStateIn
      State of infeed, controlled by the subsystem only.
    • stateInLocker

      private LocationGroup stateInLocker
      References the LocationGroup that locked this LocationGroup for infeed.
    • groupStateOut

      @NotNull private @NotNull LocationGroupState groupStateOut
      State of outfeed.
    • stateOutLocker

      private LocationGroup stateOutLocker
      References the LocationGroup that locked this LocationGroup for outfeed.
    • maxFillLevel

      private float maxFillLevel
      Maximum fill level of the LocationGroup.
    • subsystem

      private Subsystem subsystem
      The subsystem like a PLC, that manages this LocationGroup.
    • parent

      private LocationGroup parent
      Parent LocationGroup.
    • locationGroups

      private Set<LocationGroup> locationGroups
      Child LocationGroups.
    • locations

      private Set<Location> locations
      Child Locations.
  • Constructor Details

    • LocationGroup

      protected LocationGroup()
      Dear JPA...
    • LocationGroup

      public LocationGroup(@NotBlank @NotBlank String name)
      Create a new LocationGroup with a unique name.
      Parameters:
      name - The name of the LocationGroup must not be null
  • Method Details

    • getName

      public String getName()
      Returns the name of the LocationGroup.
      Returns:
      The name of the LocationGroup
    • getAccount

      public Account getAccount()
      Return the Account this LocationGroup is assigned to.
      Returns:
      The Account
    • setAccount

      public void setAccount(Account account)
      Sets the Account for this LocationGroup.
      Parameters:
      account - The Account to set for this LocationGroup
    • isInfeedAllowed

      public boolean isInfeedAllowed()
      Check whether infeed is allowed for the LocationGroup.
      Returns:
      true if allowed, otherwise false.
    • isInfeedBlocked

      public boolean isInfeedBlocked()
      Check whether infeed of the LocationGroup is blocked.
      Returns:
      true if blocked, otherwise false.
    • isOutfeedAllowed

      public boolean isOutfeedAllowed()
      Check whether outfeed is allowed for the LocationGroup.
      Returns:
      true if allowed, otherwise false.
    • isOutfeedBlocked

      public boolean isOutfeedBlocked()
      Check whether outfeed of the LocationGroup is blocked.
      Returns:
      true if blocked, otherwise false.
    • getOperationMode

      public String getOperationMode()
      Get the current operation mode this LocationGroup operates in.
      Returns:
      The operational mode
    • setOperationMode

      public void setOperationMode(@NotBlank @NotBlank String operationMode)
      Set the current operation mode this LocationGroup can operate in.
      Parameters:
      operationMode - The mode as an extensible String
      See Also:
    • getGroupStateIn

      public LocationGroupState getGroupStateIn()
      Returns the infeed state of the LocationGroup.
      Returns:
      The state of infeed
    • changeGroupStateIn

      public void changeGroupStateIn(LocationGroupState newGroupStateIn)
      Change the infeed state of the LocationGroup.
      Parameters:
      newGroupStateIn - The state to set
    • changeGroupStateIn

      private void changeGroupStateIn(LocationGroupState newGroupStateIn, LocationGroup lockLG)
      Change the infeed state of the LocationGroup.
      Parameters:
      newGroupStateIn - The state to set
      lockLG - The LocationGroup that wants to lock/unlock this LocationGroup.
    • getGroupStateOut

      public LocationGroupState getGroupStateOut()
      Return the outfeed state of the LocationGroup.
      Returns:
      The state of outfeed
    • changeGroupStateOut

      public void changeGroupStateOut(LocationGroupState newGroupStateOut)
      Change the outfeed state of the LocationGroup.
      Parameters:
      newGroupStateOut - The state to set
    • changeGroupStateOut

      void changeGroupStateOut(LocationGroupState gStateOut, LocationGroup lockLg)
      Set the outfeed state of the LocationGroup.
      Parameters:
      gStateOut - The state to set
      lockLg - The LocationGroup that wants to lock/unlock this LocationGroup.
    • getNoLocations

      public int getNoLocations()
      Returns the count of all sub Locations.
      Returns:
      The count of Locations belonging to this LocationGroup
    • getMaxFillLevel

      public float getMaxFillLevel()
      Returns the maximum fill level of the LocationGroup.
      The maximum fill level defines how many Locations of the LocationGroup can be occupied by TransportUnits.

      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 the LocationGroup.

      Pass a value between 0 and 1.
      For example maxFillLevel = 0.85 means: 85% of all Locations can be occupied.

      Parameters:
      maxFillLevel - The maximum fill level
    • getGroupType

      public String getGroupType()
      Returns the type of the LocationGroup.
      Returns:
      The type of the LocationGroup
    • setGroupType

      public void setGroupType(String groupType)
      Set the type for the LocationGroup.
      Parameters:
      groupType - The type of the LocationGroup
    • getDescription

      public String getDescription()
      Returns the description text.
      Returns:
      The Description as String
    • setDescription

      public void setDescription(String description)
      Set the description text.
      Parameters:
      description - The String to set as description text
    • getParent

      public LocationGroup getParent()
      Returns the parent LocationGroup.
      Returns:
      The parent LocationGroup
    • setParent

      public void setParent(LocationGroup parent)
      Sets the parent LocationGroup of this LocationGroup.
      Parameters:
      parent - The parent LocationGroup to set
    • getLocationGroups

      public Set<LocationGroup> getLocationGroups()
      Return all child LocationGroup.
      Returns:
      A set of all LocationGroup having this one as parent
    • hasLocationGroups

      public boolean hasLocationGroups()
      Check whether this LocationGroup has LocationGroups as children.
      Returns:
      true if LocationGroups are assigned, otherwise false
    • setLocationGroups

      public void setLocationGroups(Set<LocationGroup> locationGroups)
      Sets the child LocationGroup.
      Parameters:
      locationGroups - the set of LocationGroups to set
    • addLocationGroup

      public boolean addLocationGroup(LocationGroup locationGroup)
      Add a LocationGroup to the list of children.
      Parameters:
      locationGroup - The LocationGroup to be added as a child
      Returns:
      true if the LocationGroup was new in the collection of LocationGroups, otherwise false
    • removeLocationGroup

      public boolean removeLocationGroup(@NotNull @NotNull LocationGroup locationGroup)
      Remove a LocationGroup from the list of children.
      Parameters:
      locationGroup - The LocationGroup to be removed from the list of children
      Returns:
      true if the LocationGroup was found and could be removed, otherwise false
    • getLocations

      public Set<Location> getLocations()
      Return all Locations.
      Returns:
      Locations
    • hasLocations

      public boolean hasLocations()
      Check whether this LocationGroup has Locations assigned.
      Returns:
      true if Locations are assigned, otherwise false
    • addLocation

      public boolean addLocation(Location location)
      Add a Location to the list of children.
      Parameters:
      location - The Location to be added as child
      Returns:
      true if the Location was new in the collection of Locations, otherwise false
    • removeLocation

      public boolean removeLocation(Location location)
      Remove a Location from the list of children.
      Parameters:
      location - The Location to be removed from the list of children
      Returns:
      true if the Location was found and could be removed, otherwise false
    • 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 class org.ameba.integration.jpa.ApplicationEntity
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class org.ameba.integration.jpa.ApplicationEntity
      See Also:
    • toString

      public String toString()
      Return the name of the LocationGroup as String.
      Overrides:
      toString in class Object
      Returns:
      The name
    • changeState

      public void changeState(LocationGroupState stateIn, LocationGroupState stateOut)
      Tries to change the groupStateIn and groupStateOut of the LocationGroup. A state change is only allowed when the parent LocationGroups state is not blocked.
      Parameters:
      stateIn - The new groupStateIn to set, or null
      stateOut - 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