Table of Contents

Class UnitStation

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

Information about a unit at a workstation.

[DataContract(IsReference = true)]
[KnownType(typeof(Override))]
[KnownType(typeof(Unit))]
[KnownType(typeof(UnitBuyoff))]
[KnownType(typeof(UnitComponent))]
[KnownType(typeof(UnitDefectRepair))]
[KnownType(typeof(UnitDefect))]
[KnownType(typeof(UnitTest))]
[KnownType(typeof(UnitTransition))]
[KnownType(typeof(WorkerStation))]
public class UnitStation : INotifyPropertyChanged
Inheritance
UnitStation
Implements
Inherited Members

Properties

IsDeserializing

Gets or sets whether this object is currently being deserialized.

protected bool IsDeserializing { get; }

Property Value

bool

Overrides

Gets or sets the overrides that were performed while the unit was at this station.

[DataMember]
public TrackableCollection<Override> Overrides { get; set; }

Property Value

TrackableCollection<Override>

ReleaseDateTime

Gets or sets the date/time when the unit was released from the station, in UTC.

[DataMember]
public DateTime? ReleaseDateTime { get; set; }

Property Value

DateTime?

Remarks

This will be null if there is no release date/time recorded.

ScanDateTime

Gets or sets the date/time when the unit was scanned, in UTC.

[DataMember]
public DateTime ScanDateTime { get; set; }

Property Value

DateTime

Unit

Gets or sets the unit associated with this unit station.

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

Property Value

Unit

UnitBuyoffs

Gets or sets the buyoffs that occurred while the unit was at this station.

[DataMember]
public TrackableCollection<UnitBuyoff> UnitBuyoffs { get; set; }

Property Value

TrackableCollection<UnitBuyoff>

UnitComponents

Gets or sets the component scans that occurred while the unit was at this station.

[DataMember]
public TrackableCollection<UnitComponent> UnitComponents { get; set; }

Property Value

TrackableCollection<UnitComponent>

UnitDefectRepairs

Gets or sets the defect repairs added while the unit was at this station.

[DataMember]
public TrackableCollection<UnitDefectRepair> UnitDefectRepairs { get; set; }

Property Value

TrackableCollection<UnitDefectRepair>

UnitDefects

Gets or sets the defects added while the unit was at this station.

[DataMember]
public TrackableCollection<UnitDefect> UnitDefects { get; set; }

Property Value

TrackableCollection<UnitDefect>

UnitHasBeenIncluded

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 UnitHasBeenIncluded { get; set; }

Property Value

bool

UnitStationId

Gets or sets the unique identifier for this unit station.

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

Property Value

int

UnitTests

Gets or sets the tests that were performed while the unit was at this station.

[DataMember]
public TrackableCollection<UnitTest> UnitTests { get; set; }

Property Value

TrackableCollection<UnitTest>

UnitTransitions

Gets or sets the transitions that occurred while the unit was at this station.

[DataMember]
public TrackableCollection<UnitTransition> UnitTransitions { get; set; }

Property Value

TrackableCollection<UnitTransition>

WorkerStation

Gets or sets the worker station.

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

Property Value

WorkerStation

WorkerStationHasBeenIncluded

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 WorkerStationHasBeenIncluded { get; set; }

Property Value

bool

Methods

AddExternalTest(string, DateTimeOffset, bool, string, string, IDictionary)

Add a unit test that represents a test at some external station (i.e., a third-party test station) to the unit station record.

public UnitTest AddExternalTest(string testTypeName, DateTimeOffset testDateTime, bool passed, string reason, string notes, IDictionary data)

Parameters

testTypeName string

The test type name.

testDateTime DateTimeOffset

The date/time that the test was performed.

passed bool

Whether the test passed.

reason string

The reason for a failed test. This can be null if the test passed.

notes string

Optional additional notes about the test. This can be null or empty.

data IDictionary

Optional test data to be saved with the test, or null. See the remarks for more information.

Returns

UnitTest

The added UnitTest.

Examples

The following demonstrates passing test data. Note that any data type is supported; the data value is converted to a string before saving.

var testData = new Hashtable();
testData["LowFan"] = 1.2;
testData["HighFan"] = 2.3;
testData["Thermistors"] = true;
testData["Compressor"] = 3.4;
testData["LowerElement"] = 4.5;
testData["UpperElement"] = 5.6;
testData["ParamCode"] = "EF12";
unitStation.AddExternalTest("Run Test", DateTimeOffset.Now, true, null, null, testData);

Remarks

If data is not null, it should be a collection of name/value pairs. Any collection that implements IDictionary can be used, such as Hashtable, OrderedDictionary, or Dictionary<TKey, TValue>.

The name of each item in the dictionary should be a valid XML element name. These names must follow these naming rules:

  • Names must start with a letter or underscore.
  • Names can contain letters, digits, hyphens, underscores, and periods.
  • Names cannot contain spaces.
  • Names cannot start with the letters xml (or XML, or Xml, etc.).

Exceptions

ArgumentNullException

testTypeName is null.

XmlException

data contains an item with an invalid XML name.

AddExternalTest(string, DateTimeOffset, bool, string, string, string)

Add a unit test that represents a test at some external station (i.e., a third-party test station) to the unit station record.

public UnitTest AddExternalTest(string testTypeName, DateTimeOffset testDateTime, bool passed, string reason, string notes, string dataXml)

Parameters

testTypeName string

The test type name.

testDateTime DateTimeOffset

The date/time that the test was performed.

passed bool

Whether the test passed.

reason string

The reason for a failed test. This can be null if the test passed.

notes string

Optional additional notes about the test. This can be null or empty.

dataXml string

Optional test-specific data, formatted as XML, or null.

Returns

UnitTest

The added UnitTest.

Exceptions

ArgumentNullException

testTypeName is null.

ConvertTestDataToXml(IDictionary)

Converts a dictionary containing custom test data to a valid XML fragment.

public static string ConvertTestDataToXml(IDictionary testData)

Parameters

testData IDictionary

Optional test data to be saved with the test, or null.

Returns

string

A valid XML fragment representing the data in testData, or null if there is no test data, either because testData is null, or because testData contains no elements.

Exceptions

XmlException

testData contains an item with an invalid XML name.

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.

Events

PropertyChanged

Occurs when a property value changes.

public event PropertyChangedEventHandler PropertyChanged

Event Type

PropertyChangedEventHandler