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.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<BoardLocation>
boardLocations
Deprecated.All Boards are now held as children of the job's rootPanelprotected java.util.Map<java.lang.String,java.lang.Boolean>
checkFiducialsStateMap
protected boolean
dirty
protected java.util.Map<java.lang.String,java.lang.Boolean>
enabledStateMap
protected java.util.Map<java.lang.String,Placement.ErrorHandling>
errorHandlingStateMap
protected java.io.File
file
protected java.util.ArrayList<Panel>
panels
Deprecated.All Panels are now held as children of the job's rootPanelprotected java.util.Map<java.lang.String,java.lang.Boolean>
placedStatusMap
protected Panel
rootPanel
protected PanelLocation
rootPanelLocation
protected java.lang.Double
version
-
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 void
addBoardOrPanelLocation(PlacementsHolderLocation<?> boardOrPanelLocation)
Adds a BoardLocation or PanelLocation to the jobint
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.java.util.List<PlacementsHolderLocation<?>>
getBoardAndPanelLocations()
java.util.List<BoardLocation>
getBoardLocations()
java.io.File
getFile()
Gets the file where the job is stored in the file systemjava.util.List<PanelLocation>
getPanelLocations()
PanelLocation
getRootPanelLocation()
Gets the root PanelLocation of the Job.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.java.lang.Double
getVersion()
int
instanceCount(PlacementsHolder<?> boardOrPanel)
Counts the number of instances of a Board or Panel that are held by the jobboolean
isDirty()
Checks to see if the Job has been modifiedvoid
propertyChange(java.beans.PropertyChangeEvent evt)
Processes property change events for the job to set the flag indicating the job has been modifiedvoid
removeAllCheckFiducialsState()
Removes all stored check fiducial statesvoid
removeAllEnabledState()
Removes all stored enabled statesvoid
removeAllErrorHandlingState()
Removes all stored error handling statesvoid
removeAllPlacedStatus()
Removes all stored placed statusvoid
removeBoardOrPanelLocation(PlacementsHolderLocation<?> boardOrPanelLocation)
Removes a BoardLocation or PanelLocation from the jobvoid
removeCheckFiducialsState(PlacementsHolderLocation<?> placementsHolderLocation)
Removes the stored check fiducials state of a PlacementsHolderLocationvoid
removeEnabledState(PlacementsHolderLocation<?> placementsHolderLocation, Placement placement)
Removes the stored enabled state of a PlacementsHolderLocation or Placementvoid
removeErrorHandlingState(PlacementsHolderLocation<?> placementsHolderLocation, Placement placement)
Removes the stored error handling state of a Placementvoid
removePlacedStatus(PlacementsHolderLocation<?> placementsHolderLocation, java.lang.String placementId)
Removes the stored placed status of a Placementboolean
retrieveCheckFiducialsState(PlacementsHolderLocation<?> placementsHolderLocation)
Retrieves the stored check fiducials state of a PlacementsHolderLocationboolean
retrieveEnabledState(PlacementsHolderLocation<?> placementsHolderLocation, Placement placement)
Retrieves the stored enabled state of a Placement or PlacementsHolderLocationPlacement.ErrorHandling
retrieveErrorHandlingState(PlacementsHolderLocation<?> placementsHolderLocation, Placement placement)
Retrieves the stored error handling state of a Placementboolean
retrievePlacedStatus(PlacementsHolderLocation<?> placementsHolderLocation, java.lang.String placementId)
Retrieves the stored placed status of the Placementvoid
setDirty(boolean dirty)
Set the flag that indicates if the Job has been modifiedvoid
setFile(java.io.File file)
Sets the file where the job is stored in the file systemvoid
storeCheckFiducialsState(PlacementsHolderLocation<?> placementsHolderLocation, boolean enabled)
Stores the check fiducials state of a PlacementsHolderLocation in a way that is uniquely identifiable to itvoid
storeEnabledState(PlacementsHolderLocation<?> placementsHolderLocation, Placement placement, boolean enabled)
Stores the enabled state of a Placement or PlacementsHolderLocation in a way that is uniquely identifiable to itvoid
storeErrorHandlingState(PlacementsHolderLocation<?> placementsHolderLocation, Placement placement, Placement.ErrorHandling errorHandling)
Stores the error handling state of a Placement in a way that is uniquely identifiable to itvoid
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-
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
-
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:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
-