Class Job

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.EventListener

    public class Job
    extends AbstractModelObject
    implements java.beans.PropertyChangeListener
    A Job specifies a list of one or more PanelLocations and/or BoardLocations.
    • Field Detail

      • version

        protected java.lang.Double version
      • panels

        @Deprecated
        protected java.util.ArrayList<Panel> panels
        Deprecated.
        All Panels are now held as children of the job's rootPanel
      • boardLocations

        @Deprecated
        protected java.util.ArrayList<BoardLocation> boardLocations
        Deprecated.
        All Boards are now held as children of the job's rootPanel
      • rootPanel

        protected Panel rootPanel
      • placedStatusMap

        protected java.util.Map<java.lang.String,​java.lang.Boolean> placedStatusMap
      • enabledStateMap

        protected java.util.Map<java.lang.String,​java.lang.Boolean> enabledStateMap
      • checkFiducialsStateMap

        protected java.util.Map<java.lang.String,​java.lang.Boolean> checkFiducialsStateMap
      • errorHandlingStateMap

        protected java.util.Map<java.lang.String,​Placement.ErrorHandling> errorHandlingStateMap
      • file

        protected transient java.io.File file
      • dirty

        protected transient boolean dirty
      • rootPanelLocation

        protected final transient PanelLocation rootPanelLocation
    • Constructor Detail

      • Job

        public Job()
    • Method Detail

      • getBoardLocations

        public java.util.List<BoardLocation> getBoardLocations()
        Returns:
        a flattened list of all BoardLocations held by the job
      • getPanelLocations

        public java.util.List<PanelLocation> getPanelLocations()
        Returns:
        a flattened list of all PanelLocations held by the job
      • getBoardAndPanelLocations

        public java.util.List<PlacementsHolderLocation<?>> getBoardAndPanelLocations()
        Returns:
        a flattened list of all PanelLocations and BoardLocations held by the job
      • addBoardOrPanelLocation

        public void addBoardOrPanelLocation​(PlacementsHolderLocation<?> boardOrPanelLocation)
        Adds a BoardLocation or PanelLocation to the job
        Parameters:
        boardOrPanelLocation - - the BoardLocation or PanelLocation
      • removeBoardOrPanelLocation

        public void removeBoardOrPanelLocation​(PlacementsHolderLocation<?> boardOrPanelLocation)
        Removes a BoardLocation or PanelLocation from the job
        Parameters:
        boardOrPanelLocation - - the BoardLocation or PanelLocation
      • instanceCount

        public int instanceCount​(PlacementsHolder<?> boardOrPanel)
        Counts the number of instances of a Board or Panel that are held by the job
        Parameters:
        boardOrPanel - - the Board or Panel whose instances are to be counted
        Returns:
        - the count
      • getFile

        public java.io.File getFile()
        Gets the file where the job is stored in the file system
        Returns:
        - the file
      • setFile

        public void setFile​(java.io.File file)
        Sets the file where the job is stored in the file system
        Parameters:
        file - - the file
      • isDirty

        public boolean isDirty()
        Checks to see if the Job has been modified
        Returns:
        - true if the Job has been modified
      • setDirty

        public void setDirty​(boolean dirty)
        Set the flag that indicates if the Job has been modified
        Parameters:
        dirty - - the state to set the flag
      • getRootPanelLocation

        public PanelLocation getRootPanelLocation()
        Gets the root PanelLocation of the Job. This contains all the BoardLocations and/or PanelLocations for the Job.
        Returns:
        - the root PanelLocation
      • getTotalActivePlacements

        public int getTotalActivePlacements​(PlacementsHolderLocation<?> placementsHolderLocation)
        Gets the total number of Placements held by a PlacementsHolderLocation and it descendants that are facing up on the machine and are enabled.
        Parameters:
        placementsHolderLocation - - the PlacementsHolderLocation
        Returns:
        the total number of active placements
      • getActivePlacements

        public int getActivePlacements​(PlacementsHolderLocation<?> placementsHolderLocation)
        Gets the number of Placements held by a PlacementsHolderLocation and its descendants that are facing up on the machine, are enabled, and have not yet been placed.
        Parameters:
        placementsHolderLocation - - the PlacementsHolderLocation
        Returns:
        the number of active placements
      • storePlacedStatus

        public void storePlacedStatus​(PlacementsHolderLocation<?> placementsHolderLocation,
                                      java.lang.String placementId,
                                      boolean placed)
        Stores the placed status of a Placement in a way that is uniquely identifiable to it
        Parameters:
        placementsHolderLocation - - the PlacementsHolderLocation that contains the Placement
        placementId - - the id of the Placement
        placed - - the status to be stored
      • retrievePlacedStatus

        public boolean retrievePlacedStatus​(PlacementsHolderLocation<?> placementsHolderLocation,
                                            java.lang.String placementId)
        Retrieves the stored placed status of the Placement
        Parameters:
        placementsHolderLocation - - the PlacementsHolderLocation that contains the Placement
        placementId - - the id of the Placement
        Returns:
        the placed status of the Placement if one has previously been stored, otherwise returns false
      • removePlacedStatus

        public void removePlacedStatus​(PlacementsHolderLocation<?> placementsHolderLocation,
                                       java.lang.String placementId)
        Removes the stored placed status of a Placement
        Parameters:
        placementsHolderLocation - - the PlacementsHolderLocation that contains the Placement
        placementId - - the id of the Placement
      • removeAllPlacedStatus

        public void removeAllPlacedStatus()
        Removes all stored placed status
      • storeEnabledState

        public void storeEnabledState​(PlacementsHolderLocation<?> placementsHolderLocation,
                                      Placement placement,
                                      boolean enabled)
        Stores the enabled state of a Placement or PlacementsHolderLocation in a way that is uniquely identifiable to it
        Parameters:
        placementsHolderLocation - - the PlacementsHolderLocation holding the Placement
        placement - - the Placement whose state is to be stored or null if the PlacementsHolderLocation state is to be stored
        enabledStateMap - - the enabled state to be stored
      • retrieveEnabledState

        public boolean retrieveEnabledState​(PlacementsHolderLocation<?> placementsHolderLocation,
                                            Placement placement)
        Retrieves the stored enabled state of a Placement or PlacementsHolderLocation
        Parameters:
        placementsHolderLocation - - the PlacementsHolderLocation holding the Placement
        placement - - the Placement whose state is to be retrieved or null if the PlacementsHolderLocation state is to be retrieved
        Returns:
        the stored enabled state if one has been previously stored, otherwise returns the current enabled state of the Placement or PlacementsHolderLocation
      • removeEnabledState

        public void removeEnabledState​(PlacementsHolderLocation<?> placementsHolderLocation,
                                       Placement placement)
        Removes the stored enabled state of a PlacementsHolderLocation or Placement
        Parameters:
        placementsHolderLocation - - the placementsHolderLocation that contains the placement
        placement - - the Placement whose state is to be removed or null if the PlacementsHolderLocation state is to be removed
      • removeAllEnabledState

        public void removeAllEnabledState()
        Removes all stored enabled states
      • storeCheckFiducialsState

        public void storeCheckFiducialsState​(PlacementsHolderLocation<?> placementsHolderLocation,
                                             boolean enabled)
        Stores the check fiducials state of a PlacementsHolderLocation in a way that is uniquely identifiable to it
        Parameters:
        placementsHolderLocation - - the PlacementsHolderLocation whose state is to be stored
        enabledStateMap - - the check fiducials state to be stored
      • retrieveCheckFiducialsState

        public boolean retrieveCheckFiducialsState​(PlacementsHolderLocation<?> placementsHolderLocation)
        Retrieves the stored check fiducials state of a PlacementsHolderLocation
        Parameters:
        placementsHolderLocation - - the PlacementsHolderLocation whose state is to be retrieved
        Returns:
        the stored check fiducials state if one has been previously stored, otherwise returns the current check fiducials state of the PlacementsHolderLocation
      • removeCheckFiducialsState

        public void removeCheckFiducialsState​(PlacementsHolderLocation<?> placementsHolderLocation)
        Removes the stored check fiducials state of a PlacementsHolderLocation
        Parameters:
        placementsHolderLocation - - the PlacementsHolderLocation whose state is to be removed
      • removeAllCheckFiducialsState

        public void removeAllCheckFiducialsState()
        Removes all stored check fiducial states
      • storeErrorHandlingState

        public void storeErrorHandlingState​(PlacementsHolderLocation<?> placementsHolderLocation,
                                            Placement placement,
                                            Placement.ErrorHandling errorHandling)
        Stores the error handling state of a Placement in a way that is uniquely identifiable to it
        Parameters:
        placementsHolderLocation - - the PlacementsHolderLocation that contains the Placement
        placement - - the Placement
        errorHandling - - the state to be stored
      • retrieveErrorHandlingState

        public Placement.ErrorHandling retrieveErrorHandlingState​(PlacementsHolderLocation<?> placementsHolderLocation,
                                                                  Placement placement)
        Retrieves the stored error handling state of a Placement
        Parameters:
        placementsHolderLocation - - the PlacementsHolderLocation that contains the Placement
        placement - - the Placements whose stored state is to be retrieved
        Returns:
        - the stored error handling state if one was previously stored, otherwise returns the current error handling state of the Placement
      • removeErrorHandlingState

        public void removeErrorHandlingState​(PlacementsHolderLocation<?> placementsHolderLocation,
                                             Placement placement)
        Removes the stored error handling state of a Placement
        Parameters:
        placementsHolderLocation - - the PlacementsHolderLocation that contains the Placement
        placement - - the Placements whose stored state is to be removed
      • removeAllErrorHandlingState

        public void removeAllErrorHandlingState()
        Removes all stored error handling states
      • getVersion

        public java.lang.Double getVersion()
        Returns:
        the job's version
      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent evt)
        Processes property change events for the job to set the flag indicating the job has been modified
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener