Table of Contents

Class Unit

Namespace
Acuit.Pinpoint.Client2
Assembly
Acuit.Pinpoint.Client2.dll

A unit.

[DataContract(IsReference = true)]
[KnownType(typeof(UnitStation))]
[KnownType(typeof(ProductionSchedule))]
public class Unit : INotifyPropertyChanged
Inheritance
Unit
Implements
Inherited Members

Properties

IsDeserializing

Gets or sets whether this object is currently being deserialized.

protected bool IsDeserializing { get; }

Property Value

bool

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 or sets the model number.

[DataMember]
public string ModelNumber { get; set; }

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 or sets the model number alias.

[DataMember]
public string ModelNumberAlias { get; set; }

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 production schedule that included this unit.

[DataMember]
public ProductionSchedule ProductionSchedule { get; set; }

Property Value

ProductionSchedule

ProductionScheduleHasBeenIncluded

Gets or sets whether a navigation property has been included yet while getting an entity graph for a data model (to prevent doing so more than once).

public bool ProductionScheduleHasBeenIncluded { get; set; }

Property Value

bool

SequenceNumber

Gets or sets the unit sequence number in the production group.

[DataMember(Order = 3)]
public int? SequenceNumber { get; set; }

Property Value

int?

SerialNumber

Gets or sets the serial number.

[DataMember]
public string SerialNumber { get; set; }

Property Value

string

UnitId

Gets or sets the unique identifier for this unit.

[DataMember]
public int UnitId { get; set; }

Property Value

int

UnitStations

Gets or sets the unit history, as a list of stations at which the unit was scanned, along with the changes that occurred at each station.

[DataMember]
public TrackableCollection<UnitStation> UnitStations { get; set; }

Property Value

TrackableCollection<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. This should match a line configured within Acuit Pinpoint.

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

stationName is null.

ArgumentNullException

stationTypeName is null.

AddUnitStations(IEnumerable<UnitStation>)

Adds unit changes to this one.

public void AddUnitStations(IEnumerable<UnitStation> otherUnitStations)

Parameters

otherUnitStations IEnumerable<UnitStation>

The unit stations containing the unit changes to add.

Exceptions

ArgumentNullException

otherUnitStations is null.

InvalidOperationException

A unit station already exists with the specified unit station id.

FindInstalledComponent(string)

Finds the installed component for a particular component type, or null if it is not installed.

public UnitComponent FindInstalledComponent(string componentTypeName)

Parameters

componentTypeName string

The component type name.

Returns

UnitComponent

The installed unit component, or null if it is not installed.

Remarks

The component type name is compared using a case-sensitive search.

Exceptions

ArgumentNullException

componentTypeName is null.

GetCurrentBuyoffs()

Gets the current list of buyoffs, which include the latest buyoff state change for each unique buyoff type, ordered by the date/time the buyoff state was changed.

public IEnumerable<UnitBuyoff> GetCurrentBuyoffs()

Returns

IEnumerable<UnitBuyoff>

The current list of buyoffs.

Remarks

Use the IsSet property in each item in the returned sequence to determine whether the buyoff was last set or cleared.

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.

GetInstalledComponents()

Gets the list of installed components for this unit, ordered by component type name.

public IEnumerable<UnitComponent> GetInstalledComponents()

Returns

IEnumerable<UnitComponent>

The list of installed components.

GetLatestTest(string)

Gets the latest test of a particular test type for this unit, or null if there are no tests for the unit of this type.

public UnitTest GetLatestTest(string testTypeName)

Parameters

testTypeName string

The test type name.

Returns

UnitTest

The latest test for the test type.

Exceptions

ArgumentNullException

testTypeName is null.

GetLatestTests()

Gets a list of the latest test of each type for this unit, ordered by date/time.

public IEnumerable<UnitTest> GetLatestTests()

Returns

IEnumerable<UnitTest>

A list of the latest test of each type for this unit.

GetTests()

Gets the list of tests for this unit, ordered by date/time.

public IEnumerable<UnitTest> GetTests()

Returns

IEnumerable<UnitTest>

The list of tests for this unit.

GetTransitions()

Gets the list of transitions for this unit, ordered by date/time.

public IEnumerable<UnitTransition> GetTransitions()

Returns

IEnumerable<UnitTransition>

The list of transitions for this unit.

GetUnitDefects()

Gets the list of defects for this unit, ordered by the date/time the defect was added.

public IEnumerable<UnitDefect> GetUnitDefects()

Returns

IEnumerable<UnitDefect>

The list of defects for this unit.

Remarks

All defects ever recorded for this unit, whether repaired or not, are included.

IsComponentInstalled(string)

Determines whether a component type is installed.

public bool IsComponentInstalled(string componentTypeName)

Parameters

componentTypeName string

The component type name.

Returns

bool

Whether the component type is installed.

Remarks

The component type name is compared using a case-sensitive search.

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.

Returns

bool

Whether the component type is installed and is valid.

Remarks

The component type name is compared using a case-sensitive search.

Exceptions

ArgumentNullException

componentTypeName is null.

MoveChangesFrom(UnitStation)

Moves unit changes from a different entity graph to this one.

public void MoveChangesFrom(UnitStation other)

Parameters

other UnitStation

The unit station containing unit changes to move.

Remarks

Unit changes are represented by items in the collection properties of the UnitStation object. Clients that maintain a copy of the Unit returned from the unit scan and want to keep it up-to-date as other changes to the unit are made can call this, passing the UnitStation object returned from other server API calls. NOTE: This can result in duplicated entity instances for certain entities, like State, Buyoff, etc., entities.

Exceptions

ArgumentNullException

other is null.

ArgumentException

other does not correspond to an existing unit station.

OnPropertyChanged(string)

Processes property changes by raising the PropertyChanged event.

protected virtual void OnPropertyChanged(string propertyName)

Parameters

propertyName string

The name of the property that changed.

RemoveUnitStations(IEnumerable<UnitStation>)

Removes unit changes from this one.

public void RemoveUnitStations(IEnumerable<UnitStation> otherUnitStations)

Parameters

otherUnitStations IEnumerable<UnitStation>

The list of unit stations to remove from this unit.

Exceptions

ArgumentNullException

otherUnitStations is null.

Events

PropertyChanged

Occurs when a property value changes.

public event PropertyChangedEventHandler PropertyChanged

Event Type

PropertyChangedEventHandler