Table of Contents

Class Unit

Namespace
Acuit.Pinpoint.Services.Entities
Assembly
Acuit.Pinpoint.Services.Entities.dll

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

unitId int

The unique identifier for this unit.

serialNumber string

The serial number.

modelNumber string

The model number.

modelNumberAlias string

The model number alias.

Exceptions

ArgumentNullException

serialNumber is null.

ArgumentNullException

modelNumber is null.

ArgumentNullException

modelNumberAlias is null.

Properties

IsPreassembly

Gets or sets whether this unit represents a preassembly.

[DataMember(Order = 2)]
public bool IsPreassembly { get; set; }

Property Value

bool

Remarks

Preassembly units use temporary serial numbers.

ModelNumber

Gets the model number.

[DataMember]
public string ModelNumber { get; }

Property Value

string

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

string

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

ProductionSchedule

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

string

UnitId

Gets the unique identifier for this unit.

[DataMember]
public int UnitId { get; }

Property Value

int

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

IList<UnitStation>

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

lineName string

The name of the line, which must match a line referenced by at least one unit station (via UnitStations.WorkerStation.Station.Line.Name).

stationName string

The name of the station. This should be a unique name distinct from the configured Acuit Pinpoint workstations.

stationTypeName string

The station type name.

workerBadgeNumber string

An optional worker badge number.

workerFirstName string

An optional worker first name.

workerLastName string

An optional worker last name.

unitScanDateTime DateTimeOffset

The date/time that the unit was scanned at the station.

shiftDate DateTime

The shift date that the unit was scanned at the station. Normally the line configuration should be used to determine this from unitScanDateTime.

shiftNumber byte

The 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

lineName is null.

ArgumentNullException

lineName is null.

ArgumentNullException

stationName is null.

ArgumentNullException

stationTypeName is 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

unitDefectId int

The 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

componentTypeName string

The 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

componentTypeName is null.

FindLatestBuyoffChange(string)

Finds the latest buyoff state change for a particular buyoff type recorded in this unit.

public UnitBuyoff? FindLatestBuyoffChange(string buyoffName)

Parameters

buyoffName string

The 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

buyoffName is null.

FindLatestTest(string)

Finds the latest test of a particular test type for this unit.

public UnitTest? FindLatestTest(string testTypeName)

Parameters

testTypeName string

The 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

testTypeName is null.

GetCurrentState()

Gets the current state for this unit, or null if it has never been transitioned to a state.

public State? GetCurrentState()

Returns

State

The current state for this unit, or null if it has never been transitioned to a state.

IsBuyoffSet(string)

Determines whether a particular buyoff is currently set for this unit.

public bool IsBuyoffSet(string buyoffName)

Parameters

buyoffName string

The 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

buyoffName is null.

IsComponentInstalled(string)

Determines whether a component type is installed.

public bool IsComponentInstalled(string componentTypeName)

Parameters

componentTypeName string

The component type name. The search is done in a case-insensitive manner.

Returns

bool

true if the component type is installed; otherwise, false.

Exceptions

ArgumentNullException

componentTypeName is null.

IsValidComponentInstalled(string)

Determines whether a component type is installed and is valid.

public bool IsValidComponentInstalled(string componentTypeName)

Parameters

componentTypeName string

The component type name. The search is done in a case-insensitive manner.

Returns

bool

true if the component type is installed and is valid; otherwise, false.

Exceptions

ArgumentNullException

componentTypeName is null.