Package org.openpnp.model
Class Job
- java.lang.Object
-
- org.openpnp.model.AbstractModelObject
-
- org.openpnp.model.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJob.ErrorHandling
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<BoardLocation>boardLocationsDeprecated.All Boards are now held as children of the job's rootPanelprotected java.util.Map<java.lang.String,java.lang.Boolean>checkFiducialsStateMapprotected booleandirtyprotected java.util.Map<java.lang.String,java.lang.Boolean>enabledStateMapprotected java.util.Map<java.lang.String,Placement.ErrorHandling>errorHandlingStateMapprotected java.io.Filefileprotected java.util.ArrayList<Panel>panelsDeprecated.All Panels are now held as children of the job's rootPanelprotected java.util.Map<java.lang.String,java.lang.Boolean>placedStatusMapprotected PanelrootPanelprotected PanelLocationrootPanelLocationprotected java.lang.Doubleversion-
Fields inherited from class org.openpnp.model.AbstractModelObject
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description Job()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBoardOrPanelLocation(PlacementsHolderLocation<?> boardOrPanelLocation)Adds a BoardLocation or PanelLocation to the jobintgetActivePlacements(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.java.util.List<PlacementsHolderLocation<?>>getBoardAndPanelLocations()java.util.List<BoardLocation>getBoardLocations()Job.ErrorHandlinggetErrorHandling()java.io.FilegetFile()Gets the file where the job is stored in the file systemjava.util.List<PanelLocation>getPanelLocations()PanelLocationgetRootPanelLocation()Gets the root PanelLocation of the Job.intgetTotalActivePlacements(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.java.lang.DoublegetVersion()intinstanceCount(PlacementsHolder<?> boardOrPanel)Counts the number of instances of a Board or Panel that are held by the jobbooleanisDirty()Checks to see if the Job has been modifiedvoidpropertyChange(java.beans.PropertyChangeEvent evt)Processes property change events for the job to set the flag indicating the job has been modifiedvoidremoveAllCheckFiducialsState()Removes all stored check fiducial statesvoidremoveAllEnabledState()Removes all stored enabled statesvoidremoveAllErrorHandlingState()Removes all stored error handling statesvoidremoveAllPlacedStatus()Removes all stored placed statusvoidremoveBoardOrPanelLocation(PlacementsHolderLocation<?> boardOrPanelLocation)Removes a BoardLocation or PanelLocation from the jobvoidremoveCheckFiducialsState(PlacementsHolderLocation<?> placementsHolderLocation)Removes the stored check fiducials state of a PlacementsHolderLocationvoidremoveEnabledState(PlacementsHolderLocation<?> placementsHolderLocation, Placement placement)Removes the stored enabled state of a PlacementsHolderLocation or PlacementvoidremoveErrorHandlingState(PlacementsHolderLocation<?> placementsHolderLocation, Placement placement)Removes the stored error handling state of a PlacementvoidremovePlacedStatus(PlacementsHolderLocation<?> placementsHolderLocation, java.lang.String placementId)Removes the stored placed status of a PlacementbooleanretrieveCheckFiducialsState(PlacementsHolderLocation<?> placementsHolderLocation)Retrieves the stored check fiducials state of a PlacementsHolderLocationbooleanretrieveEnabledState(PlacementsHolderLocation<?> placementsHolderLocation, Placement placement)Retrieves the stored enabled state of a Placement or PlacementsHolderLocationPlacement.ErrorHandlingretrieveErrorHandlingState(PlacementsHolderLocation<?> placementsHolderLocation, Placement placement)Retrieves the stored error handling state of a PlacementbooleanretrievePlacedStatus(PlacementsHolderLocation<?> placementsHolderLocation, java.lang.String placementId)Retrieves the stored placed status of the PlacementvoidsetDirty(boolean dirty)Set the flag that indicates if the Job has been modifiedvoidsetErrorHandling(Job.ErrorHandling errorHandling)voidsetFile(java.io.File file)Sets the file where the job is stored in the file systemvoidstoreCheckFiducialsState(PlacementsHolderLocation<?> placementsHolderLocation, boolean enabled)Stores the check fiducials state of a PlacementsHolderLocation in a way that is uniquely identifiable to itvoidstoreEnabledState(PlacementsHolderLocation<?> placementsHolderLocation, Placement placement, boolean enabled)Stores the enabled state of a Placement or PlacementsHolderLocation in a way that is uniquely identifiable to itvoidstoreErrorHandlingState(PlacementsHolderLocation<?> placementsHolderLocation, Placement placement, Placement.ErrorHandling errorHandling)Stores the error handling state of a Placement in a way that is uniquely identifiable to itvoidstorePlacedStatus(PlacementsHolderLocation<?> placementsHolderLocation, java.lang.String placementId, boolean placed)Stores the placed status of a Placement in a way that is uniquely identifiable to it-
Methods inherited from class org.openpnp.model.AbstractModelObject
addPropertyChangeListener, addPropertyChangeListener, dispose, dumpListeners, fireIndexedPropertyChange, firePropertyChange, isListener, isListener, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
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
-
-
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
-
getErrorHandling
public Job.ErrorHandling getErrorHandling()
-
setErrorHandling
public void setErrorHandling(Job.ErrorHandling errorHandling)
-
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 PlacementplacementId- - the id of the Placementplaced- - 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 PlacementplacementId- - 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 PlacementplacementId- - 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 Placementplacement- - the Placement whose state is to be stored or null if the PlacementsHolderLocation state is to be storedenabledStateMap- - 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 Placementplacement- - 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 placementplacement- - 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 storedenabledStateMap- - 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 Placementplacement- - the PlacementerrorHandling- - 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 Placementplacement- - 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 Placementplacement- - 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:
propertyChangein interfacejava.beans.PropertyChangeListener
-
-