Class Unit
A unit.
[DataContract(IsReference = true)]
[KnownType(typeof(UnitStation))]
[KnownType(typeof(ProductionSchedule))]
public class Unit
- Inheritance
-
Unit
- Inherited Members
Constructors
Unit(int, string, string, string)
Initializes a new instance of the Unit class.
public Unit(int unitId, string serialNumber, string modelNumber, string modelNumberAlias)
Parameters
unitIdintThe unique identifier for this unit.
serialNumberstringThe serial number.
modelNumberstringThe model number.
modelNumberAliasstringThe model number alias.
Exceptions
- ArgumentNullException
serialNumberis null.- ArgumentNullException
modelNumberis null.- ArgumentNullException
modelNumberAliasis null.
Properties
IsPreassembly
Gets or sets whether this unit represents a preassembly.
[DataMember(Order = 2)]
public bool IsPreassembly { get; set; }
Property Value
Remarks
Preassembly units use temporary serial numbers.
ModelNumber
Gets the model number.
[DataMember]
public string ModelNumber { get; }
Property Value
Remarks
This is the actual unit model number (i.e., scanned from the model number bar code). This might be a trade-brand model number. For the manufacturer equivalent model number, use ModelNumberAlias.
ModelNumberAlias
Gets the model number alias.
[DataMember]
public string ModelNumberAlias { get; }
Property Value
Remarks
This is the equivalent manufacturer model number for the unit. If the scanned model number is a trade-brand model number, this will be the manufacturer equivalent model number; otherwise, it will be the same as ModelNumber.
ProductionSchedule
Gets or sets the optional production schedule that included this unit.
[DataMember]
public ProductionSchedule? ProductionSchedule { get; set; }
Property Value
SequenceNumber
Gets or sets the unit sequence number in the production group, or null if not known.
[DataMember(Order = 3)]
public int? SequenceNumber { get; set; }
Property Value
- int?
SerialNumber
Gets the serial number.
[DataMember]
public string SerialNumber { get; }
Property Value
UnitId
Gets the unique identifier for this unit.
[DataMember]
public int UnitId { get; }
Property Value
UnitStations
Gets the list of stations at which the unit was scanned, representing the unit history, with the changes that occurred at each station.
public IList<UnitStation> UnitStations { get; }
Property Value
Methods
AddExternalUnitStation(string, string, string, string, string, string, DateTimeOffset, DateTime, byte)
Add a unit station that represents a unit at some external station (i.e., a third-party test station) to the unit record.
public UnitStation AddExternalUnitStation(string lineName, string stationName, string stationTypeName, string workerBadgeNumber, string workerFirstName, string workerLastName, DateTimeOffset unitScanDateTime, DateTime shiftDate, byte shiftNumber)
Parameters
lineNamestringThe name of the line, which must match a line referenced by at least one unit station (via UnitStations.WorkerStation.Station.Line.Name).
stationNamestringThe name of the station. This should be a unique name distinct from the configured Acuit Pinpoint workstations.
stationTypeNamestringThe station type name.
workerBadgeNumberstringAn optional worker badge number.
workerFirstNamestringAn optional worker first name.
workerLastNamestringAn optional worker last name.
unitScanDateTimeDateTimeOffsetThe date/time that the unit was scanned at the station.
shiftDateDateTimeThe shift date that the unit was scanned at the station. Normally the line configuration should be used to determine this from
unitScanDateTime.shiftNumberbyteThe shift number that the unit was scanned at the station. Normally the line configuration should be used to determine this from
unitScanDateTime.
Returns
- UnitStation
The added UnitStation.
Exceptions
- ArgumentNullException
lineNameis null.- ArgumentNullException
lineNameis null.- ArgumentNullException
stationNameis null.- ArgumentNullException
stationTypeNameis null.
EnumerateDefects()
Enumerates all defects recorded for this unit. All defects ever recorded for this unit, whether repaired or not, are included. The order is not defined.
public IEnumerable<UnitDefect> EnumerateDefects()
Returns
- IEnumerable<UnitDefect>
An enumerable sequence of UnitDefect objects.
EnumerateInstalledComponents()
Enumerates the installed components in this unit. The order is not defined.
public IEnumerable<UnitComponent> EnumerateInstalledComponents()
Returns
- IEnumerable<UnitComponent>
An enumerable sequence of UnitComponent objects.
EnumerateLatestBuyoffChanges()
Enumerates the latest buyoff state change for each buyoff type recorded in this unit. The order is not defined.
public IEnumerable<UnitBuyoff> EnumerateLatestBuyoffChanges()
Returns
- IEnumerable<UnitBuyoff>
An enumerable sequence of UnitBuyoff objects.
Remarks
The IsSet property in each item indicates whether the buyoff was last set or cleared.
EnumerateLatestComponentChanges()
Enumerates the latest component change for each component type recorded in this unit. The order is not defined.
public IEnumerable<UnitComponent> EnumerateLatestComponentChanges()
Returns
- IEnumerable<UnitComponent>
An enumerable sequence of UnitComponent objects.
Remarks
The IsInstalled property in each item indicates whether the component is installed.
EnumerateLatestTests()
Enumerates the latest recorded test of each type in this unit. The order is not defined.
public IEnumerable<UnitTest> EnumerateLatestTests()
Returns
- IEnumerable<UnitTest>
An enumerable sequence of UnitTest objects.
EnumerateSetBuyoffs()
Enumerates the buyoffs that are set in this unit. The order is not defined.
public IEnumerable<UnitBuyoff> EnumerateSetBuyoffs()
Returns
- IEnumerable<UnitBuyoff>
An enumerable sequence of UnitBuyoff objects.
EnumerateTestOverridesByDateTime()
Enumerates all test overrides recorded for this unit, ordered by date/time.
public IEnumerable<Override> EnumerateTestOverridesByDateTime()
Returns
- IEnumerable<Override>
An enumerable sequence of Override objects.
EnumerateTestsByDateTime()
Enumerates all tests recorded for this unit, ordered by date/time.
public IEnumerable<UnitTest> EnumerateTestsByDateTime()
Returns
- IEnumerable<UnitTest>
An enumerable sequence of UnitTest objects.
EnumerateTransitionsByDateTime()
Enumerates the transitions for this unit, ordered by date/time.
public IEnumerable<UnitTransition> EnumerateTransitionsByDateTime()
Returns
- IEnumerable<UnitTransition>
An enumerable sequence of UnitTransition objects.
FindDefect(int)
Finds a defect recorded for this unit by the unit defect identifier.
public UnitDefect? FindDefect(int unitDefectId)
Parameters
unitDefectIdintThe unit defect identifier.
Returns
- UnitDefect
The UnitDefect if found; otherwise, null.
FindInstalledComponent(string)
Finds the installed component for a particular component type.
public UnitComponent? FindInstalledComponent(string componentTypeName)
Parameters
componentTypeNamestringThe component type name. The search is done in a case-insensitive manner.
Returns
- UnitComponent
The installed unit component, or null if it is not installed.
Exceptions
- ArgumentNullException
componentTypeNameis null.
FindLatestBuyoffChange(string)
Finds the latest buyoff state change for a particular buyoff type recorded in this unit.
public UnitBuyoff? FindLatestBuyoffChange(string buyoffName)
Parameters
buyoffNamestringThe buyoff type name. The search is done in a case-insensitive manner.
Returns
- UnitBuyoff
The UnitBuyoff for the buyoff state change, or null if one was not found.
Remarks
The IsSet property indicates whether the buyoff was last set or cleared.
Exceptions
- ArgumentNullException
buyoffNameis null.
FindLatestTest(string)
Finds the latest test of a particular test type for this unit.
public UnitTest? FindLatestTest(string testTypeName)
Parameters
testTypeNamestringThe test type name. The search is done in a case-insensitive manner.
Returns
- UnitTest
The latest test of the specified type, or null if there are no tests of that type recorded for this unit.
Exceptions
- ArgumentNullException
testTypeNameis null.
GetCurrentState()
Gets the current state for this unit, or null if it has never been transitioned to a state.
public State? GetCurrentState()
Returns
IsBuyoffSet(string)
Determines whether a particular buyoff is currently set for this unit.
public bool IsBuyoffSet(string buyoffName)
Parameters
buyoffNamestringThe buyoff type name. The search is done in a case-insensitive manner.
Returns
- bool
true if any status changes for the specified buyoff type exist for this unit and the latest status change is setting the buyoff; otherwise, false.
Exceptions
- ArgumentNullException
buyoffNameis null.
IsComponentInstalled(string)
Determines whether a component type is installed.
public bool IsComponentInstalled(string componentTypeName)
Parameters
componentTypeNamestringThe component type name. The search is done in a case-insensitive manner.
Returns
Exceptions
- ArgumentNullException
componentTypeNameis null.
IsValidComponentInstalled(string)
Determines whether a component type is installed and is valid.
public bool IsValidComponentInstalled(string componentTypeName)
Parameters
componentTypeNamestringThe component type name. The search is done in a case-insensitive manner.
Returns
Exceptions
- ArgumentNullException
componentTypeNameis null.